From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/kformula/DESIGN | 66 +- lib/kformula/MatrixDialog.cc | 34 +- lib/kformula/MatrixDialog.h | 7 +- lib/kformula/actionelement.cc | 16 +- lib/kformula/actionelement.h | 12 +- lib/kformula/basicelement.cc | 84 +-- lib/kformula/basicelement.h | 142 ++-- lib/kformula/bracketelement.cc | 266 +++---- lib/kformula/bracketelement.h | 124 ++-- lib/kformula/config/esstixeight.font | 2 +- lib/kformula/config/esstixeleven.font | 2 +- lib/kformula/config/esstixfifteen.font | 2 +- lib/kformula/config/esstixfive.font | 2 +- lib/kformula/config/esstixfour.font | 2 +- lib/kformula/config/esstixfourteen.font | 2 +- lib/kformula/config/esstixnine.font | 2 +- lib/kformula/config/esstixone.font | 2 +- lib/kformula/config/esstixseven.font | 2 +- lib/kformula/config/esstixseventeen.font | 2 +- lib/kformula/config/esstixsix.font | 2 +- lib/kformula/config/esstixsixteen.font | 2 +- lib/kformula/config/esstixten.font | 2 +- lib/kformula/config/esstixthirteen.font | 2 +- lib/kformula/config/esstixthree.font | 2 +- lib/kformula/config/esstixtwelve.font | 2 +- lib/kformula/config/esstixtwo.font | 2 +- lib/kformula/config/unicode.tbl | 4 +- lib/kformula/contextstyle.cc | 66 +- lib/kformula/contextstyle.h | 184 ++--- lib/kformula/creationstrategy.cc | 6 +- lib/kformula/creationstrategy.h | 16 +- lib/kformula/elementtype.cc | 72 +- lib/kformula/elementtype.h | 50 +- lib/kformula/encloseelement.cc | 6 +- lib/kformula/encloseelement.h | 10 +- lib/kformula/entities.h | 2 +- lib/kformula/errorelement.cc | 26 +- lib/kformula/errorelement.h | 14 +- lib/kformula/fontstyle.cc | 298 ++++---- lib/kformula/fontstyle.h | 104 +-- lib/kformula/formulacursor.cc | 66 +- lib/kformula/formulacursor.h | 28 +- lib/kformula/formulaelement.cc | 64 +- lib/kformula/formulaelement.h | 40 +- lib/kformula/fractionelement.cc | 96 +-- lib/kformula/fractionelement.h | 56 +- lib/kformula/glyphelement.cc | 66 +- lib/kformula/glyphelement.h | 26 +- lib/kformula/identifierelement.cc | 42 +- lib/kformula/identifierelement.h | 4 +- lib/kformula/indexelement.cc | 168 ++--- lib/kformula/indexelement.h | 118 +-- lib/kformula/kformulacommand.cc | 110 +-- lib/kformula/kformulacommand.h | 66 +- lib/kformula/kformulacompatibility.cc | 116 +-- lib/kformula/kformulacompatibility.h | 24 +- lib/kformula/kformulaconfigpage.cc | 220 +++--- lib/kformula/kformulaconfigpage.h | 68 +- lib/kformula/kformulacontainer.cc | 134 ++-- lib/kformula/kformulacontainer.h | 65 +- lib/kformula/kformuladefs.h | 60 +- lib/kformula/kformuladocument.cc | 232 +++--- lib/kformula/kformuladocument.h | 48 +- lib/kformula/kformulainputfilter.h | 9 +- lib/kformula/kformulamathmlread.cc | 498 ++++++------- lib/kformula/kformulamathmlread.h | 19 +- lib/kformula/kformulamimesource.cc | 50 +- lib/kformula/kformulamimesource.h | 14 +- lib/kformula/kformulaview.cc | 78 +- lib/kformula/kformulaview.h | 57 +- lib/kformula/kformulawidget.cc | 52 +- lib/kformula/kformulawidget.h | 35 +- lib/kformula/main.cc | 164 ++--- lib/kformula/matrixelement.cc | 506 ++++++------- lib/kformula/matrixelement.h | 124 ++-- lib/kformula/numberelement.cc | 56 +- lib/kformula/numberelement.h | 4 +- lib/kformula/oasiscreationstrategy.cc | 16 +- lib/kformula/oasiscreationstrategy.h | 10 +- lib/kformula/operatorelement.cc | 88 +-- lib/kformula/operatorelement.h | 10 +- lib/kformula/paddedelement.cc | 68 +- lib/kformula/paddedelement.h | 18 +- lib/kformula/phantomelement.cc | 10 +- lib/kformula/phantomelement.h | 14 +- lib/kformula/prototype/engine.py | 266 +++---- lib/kformula/prototype/gensymbolfontmap.py | 62 +- lib/kformula/prototype/unicode.py | 12 +- lib/kformula/rootelement.cc | 110 +-- lib/kformula/rootelement.h | 70 +- lib/kformula/scripts/bycodes.py | 18 +- lib/kformula/scripts/bynames.py | 10 +- lib/kformula/scripts/oper-dict.py | 8 +- lib/kformula/scrollview.h | 7 +- lib/kformula/sequenceelement.cc | 452 ++++++------ lib/kformula/sequenceelement.h | 128 ++-- lib/kformula/sequenceparser.cc | 18 +- lib/kformula/sequenceparser.h | 12 +- lib/kformula/spaceelement.cc | 102 +-- lib/kformula/spaceelement.h | 38 +- lib/kformula/stringelement.cc | 10 +- lib/kformula/stringelement.h | 16 +- lib/kformula/styleelement.cc | 58 +- lib/kformula/styleelement.h | 14 +- lib/kformula/symbolaction.cc | 88 +-- lib/kformula/symbolaction.h | 22 +- lib/kformula/symbolelement.cc | 134 ++-- lib/kformula/symbolelement.h | 74 +- lib/kformula/symboltable.cc | 80 +- lib/kformula/symboltable.h | 54 +- lib/kformula/textelement.cc | 174 ++--- lib/kformula/textelement.h | 72 +- lib/kformula/tokenelement.cc | 18 +- lib/kformula/tokenelement.h | 8 +- lib/kformula/tokenstyleelement.cc | 70 +- lib/kformula/tokenstyleelement.h | 36 +- lib/kformula/unicodetable.cc | 2 +- lib/kofficecore/KoApplication.cpp | 30 +- lib/kofficecore/KoApplication.h | 5 +- lib/kofficecore/KoApplicationIface.cc | 30 +- lib/kofficecore/KoApplicationIface.h | 10 +- lib/kofficecore/KoChild.cpp | 126 ++-- lib/kofficecore/KoChild.h | 77 +- lib/kofficecore/KoContainerHandler.cpp | 202 ++--- lib/kofficecore/KoContainerHandler.h | 38 +- lib/kofficecore/KoDetailsPane.cpp | 192 ++--- lib/kofficecore/KoDetailsPane.h | 48 +- lib/kofficecore/KoDocument.cpp | 636 ++++++++-------- lib/kofficecore/KoDocument.h | 225 +++--- lib/kofficecore/KoDocumentChild.cpp | 136 ++-- lib/kofficecore/KoDocumentChild.h | 41 +- lib/kofficecore/KoDocumentIface.cc | 130 ++-- lib/kofficecore/KoDocumentIface.h | 92 +-- lib/kofficecore/KoDocumentInfo.cpp | 242 +++--- lib/kofficecore/KoDocumentInfo.h | 190 ++--- lib/kofficecore/KoDocumentInfoDlg.cpp | 214 +++--- lib/kofficecore/KoDocumentInfoDlg.h | 10 +- lib/kofficecore/KoDocument_p.h | 1 + lib/kofficecore/KoDom.cpp | 6 +- lib/kofficecore/KoDom.h | 22 +- lib/kofficecore/KoFactory.cpp | 4 +- lib/kofficecore/KoFactory.h | 3 +- lib/kofficecore/KoFileDialog.cpp | 26 +- lib/kofficecore/KoFileDialog.h | 15 +- lib/kofficecore/KoFilter.cpp | 38 +- lib/kofficecore/KoFilter.h | 49 +- lib/kofficecore/KoFilterChain.cpp | 206 +++--- lib/kofficecore/KoFilterChain.h | 102 +-- lib/kofficecore/KoFilterManager.cpp | 216 +++--- lib/kofficecore/KoFilterManager.h | 43 +- lib/kofficecore/KoFilterManager_p.h | 13 +- lib/kofficecore/KoFrame.cpp | 152 ++-- lib/kofficecore/KoFrame.h | 21 +- lib/kofficecore/KoGenStyles.cpp | 150 ++-- lib/kofficecore/KoGenStyles.h | 118 +-- lib/kofficecore/KoGlobal.cpp | 70 +- lib/kofficecore/KoGlobal.h | 26 +- lib/kofficecore/KoMainWindow.cpp | 300 ++++---- lib/kofficecore/KoMainWindow.h | 23 +- lib/kofficecore/KoMainWindowIface.cc | 12 +- lib/kofficecore/KoMainWindowIface.h | 4 +- lib/kofficecore/KoOasisLoadingContext.cpp | 48 +- lib/kofficecore/KoOasisLoadingContext.h | 26 +- lib/kofficecore/KoOasisSettings.cpp | 82 +-- lib/kofficecore/KoOasisSettings.h | 46 +- lib/kofficecore/KoOasisStore.cpp | 50 +- lib/kofficecore/KoOasisStore.h | 10 +- lib/kofficecore/KoOasisStyles.cpp | 348 ++++----- lib/kofficecore/KoOasisStyles.h | 122 +-- lib/kofficecore/KoOpenPane.cpp | 120 +-- lib/kofficecore/KoOpenPane.h | 29 +- lib/kofficecore/KoPageLayout.cpp | 64 +- lib/kofficecore/KoPageLayout.h | 46 +- lib/kofficecore/KoPicture.cpp | 60 +- lib/kofficecore/KoPicture.h | 70 +- lib/kofficecore/KoPictureBase.cpp | 44 +- lib/kofficecore/KoPictureBase.h | 40 +- lib/kofficecore/KoPictureClipart.cpp | 48 +- lib/kofficecore/KoPictureClipart.h | 34 +- lib/kofficecore/KoPictureCollection.cpp | 62 +- lib/kofficecore/KoPictureCollection.h | 36 +- lib/kofficecore/KoPictureEps.cpp | 108 +-- lib/kofficecore/KoPictureEps.h | 48 +- lib/kofficecore/KoPictureImage.cpp | 62 +- lib/kofficecore/KoPictureImage.h | 40 +- lib/kofficecore/KoPictureKey.cpp | 42 +- lib/kofficecore/KoPictureKey.h | 46 +- lib/kofficecore/KoPictureShared.cpp | 126 ++-- lib/kofficecore/KoPictureShared.h | 76 +- lib/kofficecore/KoPictureWmf.cpp | 44 +- lib/kofficecore/KoPictureWmf.h | 38 +- lib/kofficecore/KoPoint.h | 24 +- lib/kofficecore/KoQueryTrader.cpp | 38 +- lib/kofficecore/KoQueryTrader.h | 46 +- lib/kofficecore/KoRect.cpp | 26 +- lib/kofficecore/KoRect.h | 22 +- lib/kofficecore/KoSetPropCommand.h | 8 +- lib/kofficecore/KoSize.h | 32 +- lib/kofficecore/KoSpeaker.cpp | 294 ++++---- lib/kofficecore/KoSpeaker.h | 39 +- lib/kofficecore/KoStyleStack.cpp | 108 +-- lib/kofficecore/KoStyleStack.h | 42 +- lib/kofficecore/KoTemplates.cpp | 130 ++-- lib/kofficecore/KoTemplates.h | 76 +- lib/kofficecore/KoUnit.cpp | 58 +- lib/kofficecore/KoUnit.h | 20 +- lib/kofficecore/KoView.cpp | 248 +++---- lib/kofficecore/KoView.h | 72 +- lib/kofficecore/KoViewIface.cc | 14 +- lib/kofficecore/KoViewIface.h | 6 +- lib/kofficecore/KoXmlNS.h | 4 +- lib/kofficecore/KoXmlReader.cpp | 424 +++++------ lib/kofficecore/KoXmlReader.h | 120 +-- lib/kofficecore/Koversiondialog.cpp | 54 +- lib/kofficecore/Koversiondialog.h | 24 +- lib/kofficecore/THOUGHTS | 10 +- lib/kofficecore/kkbdaccessextensions.cpp | 276 +++---- lib/kofficecore/kkbdaccessextensions.h | 48 +- lib/kofficecore/koDetailsPaneBase.ui | 30 +- lib/kofficecore/koDocumentInfoAboutWidget.ui | 70 +- lib/kofficecore/koDocumentInfoAuthorWidget.ui | 48 +- .../koDocumentInfoUserMetadataWidget.ui | 26 +- lib/kofficecore/koOpenPaneBase.ui | 22 +- lib/kofficecore/koffice_export.h | 2 +- lib/kofficecore/priorityqueue.h | 26 +- lib/kofficecore/tests/filter_graph.cpp | 44 +- lib/kofficecore/tests/filterchain_test.cpp | 8 +- lib/kofficecore/tests/kodomtest.cpp | 46 +- lib/kofficecore/tests/kogenstylestest.cpp | 58 +- lib/kofficecore/tests/kooasissettingstest.cpp | 6 +- lib/kofficecore/tests/kooasisstoretest.cpp | 10 +- lib/kofficecore/tests/kopointtest.cpp | 10 +- lib/kofficecore/tests/korecttest.cpp | 8 +- lib/kofficecore/tests/koxmlreadertest.cpp | 820 ++++++++++----------- lib/kofficecore/tests/priorityqueue_test.cpp | 8 +- lib/kofficeui/KoBrush.cpp | 6 +- lib/kofficeui/KoBrush.h | 24 +- lib/kofficeui/KoCharSelectDia.cpp | 28 +- lib/kofficeui/KoCharSelectDia.h | 29 +- lib/kofficeui/KoCommandHistory.cpp | 104 +-- lib/kofficeui/KoCommandHistory.h | 32 +- lib/kofficeui/KoContextCelp.cpp | 266 +++---- lib/kofficeui/KoContextCelp.h | 141 ++-- lib/kofficeui/KoEditPath.cpp | 46 +- lib/kofficeui/KoEditPath.h | 16 +- lib/kofficeui/KoGeneralPropertyUi.ui | 28 +- lib/kofficeui/KoGuideLineDia.cpp | 62 +- lib/kofficeui/KoGuideLineDia.h | 19 +- lib/kofficeui/KoGuides.cpp | 216 +++--- lib/kofficeui/KoGuides.h | 89 +-- lib/kofficeui/KoInsertLink.cpp | 250 +++---- lib/kofficeui/KoInsertLink.h | 101 +-- lib/kofficeui/KoKoolBar.cpp | 74 +- lib/kofficeui/KoKoolBar.h | 72 +- lib/kofficeui/KoPageLayoutColumns.cpp | 24 +- lib/kofficeui/KoPageLayoutColumns.h | 19 +- lib/kofficeui/KoPageLayoutColumnsBase.ui | 16 +- lib/kofficeui/KoPageLayoutDia.cpp | 194 ++--- lib/kofficeui/KoPageLayoutDia.h | 70 +- lib/kofficeui/KoPageLayoutHeader.cpp | 14 +- lib/kofficeui/KoPageLayoutHeader.h | 11 +- lib/kofficeui/KoPageLayoutHeaderBase.ui | 44 +- lib/kofficeui/KoPageLayoutSize.cpp | 110 +-- lib/kofficeui/KoPageLayoutSize.h | 25 +- lib/kofficeui/KoPartSelectAction.cpp | 28 +- lib/kofficeui/KoPartSelectAction.h | 15 +- lib/kofficeui/KoPartSelectDia.cpp | 32 +- lib/kofficeui/KoPartSelectDia.h | 17 +- lib/kofficeui/KoPen.cpp | 14 +- lib/kofficeui/KoPen.h | 12 +- lib/kofficeui/KoPictureFilePreview.cpp | 40 +- lib/kofficeui/KoPictureFilePreview.h | 7 +- lib/kofficeui/KoRuler.cpp | 282 +++---- lib/kofficeui/KoRuler.h | 71 +- lib/kofficeui/KoSelectAction.cpp | 50 +- lib/kofficeui/KoSelectAction.h | 21 +- lib/kofficeui/KoTabBar.cpp | 248 +++---- lib/kofficeui/KoTabBar.h | 53 +- lib/kofficeui/KoTabChooser.cpp | 34 +- lib/kofficeui/KoTabChooser.h | 27 +- lib/kofficeui/KoTemplateChooseDia.cpp | 292 ++++---- lib/kofficeui/KoTemplateChooseDia.h | 103 +-- lib/kofficeui/KoTemplateCreateDia.cpp | 188 ++--- lib/kofficeui/KoTemplateCreateDia.h | 23 +- lib/kofficeui/KoToolBox.cpp | 80 +- lib/kofficeui/KoToolBox.h | 51 +- lib/kofficeui/KoTooluButton.cpp | 600 +++++++-------- lib/kofficeui/KoTooluButton.h | 105 +-- lib/kofficeui/KoUnitWidgets.cpp | 154 ++-- lib/kofficeui/KoUnitWidgets.h | 36 +- lib/kofficeui/KoZoomAction.cpp | 80 +- lib/kofficeui/KoZoomAction.h | 15 +- lib/kofficeui/KoZoomHandler.h | 20 +- lib/kofficeui/KoZoomMode.cpp | 4 +- lib/kofficeui/KoZoomMode.h | 12 +- lib/kofficeui/Kolinestyleaction.cpp | 28 +- lib/kofficeui/Kolinestyleaction.h | 15 +- lib/kofficeui/Kolinewidthaction.cpp | 50 +- lib/kofficeui/Kolinewidthaction.h | 18 +- lib/kofficeui/kcoloractions.cpp | 104 +-- lib/kofficeui/kcoloractions.h | 42 +- lib/kofficeui/tests/coloraction_test.cpp | 52 +- lib/kofficeui/tests/coloraction_test.h | 9 +- lib/kofficeui/tkaction.cpp | 96 +-- lib/kofficeui/tkaction.h | 35 +- lib/kofficeui/tkcoloractions.cpp | 442 +++++------ lib/kofficeui/tkcoloractions.h | 74 +- lib/kofficeui/tkcombobox.cpp | 52 +- lib/kofficeui/tkcombobox.h | 11 +- lib/kofficeui/tktoolbarbutton.cpp | 210 +++--- lib/kofficeui/tktoolbarbutton.h | 67 +- lib/kopainter/koColor.cc | 22 +- lib/kopainter/koColor.h | 16 +- lib/kopainter/koColorChooser.cc | 166 ++--- lib/kopainter/koColorChooser.h | 92 +-- lib/kopainter/koColorSlider.cc | 122 +-- lib/kopainter/koColorSlider.h | 69 +- lib/kopainter/koFrameButton.cc | 22 +- lib/kopainter/koFrameButton.h | 27 +- lib/kopainter/koIconChooser.cc | 98 +-- lib/kopainter/koIconChooser.h | 48 +- lib/kopainter/ko_cmyk_widget.cc | 110 +-- lib/kopainter/ko_cmyk_widget.h | 55 +- lib/kopainter/ko_color_wheel.cc | 36 +- lib/kopainter/ko_color_wheel.h | 19 +- lib/kopainter/ko_gray_widget.cc | 70 +- lib/kopainter/ko_gray_widget.h | 39 +- lib/kopainter/ko_hsv_widget.cc | 80 +- lib/kopainter/ko_hsv_widget.h | 39 +- lib/kopainter/ko_rgb_widget.cc | 114 +-- lib/kopainter/ko_rgb_widget.h | 49 +- lib/kopainter/kogradientmanager.cc | 120 +-- lib/kopainter/kogradientmanager.h | 32 +- lib/kopainter/svgnamedcolors.h | 4 +- lib/kopainter/svgpathparser.cc | 8 +- lib/kopainter/svgpathparser.h | 4 +- lib/kopalette/kopalette.cc | 42 +- lib/kopalette/kopalette.h | 43 +- lib/kopalette/kopalettemanager.cc | 192 ++--- lib/kopalette/kopalettemanager.h | 71 +- lib/kopalette/kotabpalette.cc | 42 +- lib/kopalette/kotabpalette.h | 23 +- lib/kopalette/kotoolboxpalette.cc | 36 +- lib/kopalette/kotoolboxpalette.h | 25 +- lib/koproperty/customproperty.cpp | 138 ++-- lib/koproperty/customproperty.h | 46 +- lib/koproperty/editor.cpp | 316 ++++---- lib/koproperty/editor.h | 41 +- lib/koproperty/editoritem.cpp | 216 +++--- lib/koproperty/editoritem.h | 54 +- lib/koproperty/editors/booledit.cpp | 86 +-- lib/koproperty/editors/booledit.h | 32 +- lib/koproperty/editors/coloredit.cpp | 36 +- lib/koproperty/editors/coloredit.h | 11 +- lib/koproperty/editors/combobox.cpp | 62 +- lib/koproperty/editors/combobox.h | 11 +- lib/koproperty/editors/cursoredit.cpp | 102 +-- lib/koproperty/editors/cursoredit.h | 13 +- lib/koproperty/editors/dateedit.cpp | 34 +- lib/koproperty/editors/dateedit.h | 17 +- lib/koproperty/editors/datetimeedit.cpp | 34 +- lib/koproperty/editors/datetimeedit.h | 17 +- lib/koproperty/editors/dummywidget.cpp | 14 +- lib/koproperty/editors/dummywidget.h | 13 +- lib/koproperty/editors/fontedit.cpp | 78 +- lib/koproperty/editors/fontedit.h | 13 +- lib/koproperty/editors/linestyledit.cpp | 54 +- lib/koproperty/editors/linestyleedit.h | 13 +- lib/koproperty/editors/pixmapedit.cpp | 130 ++-- lib/koproperty/editors/pixmapedit.h | 33 +- lib/koproperty/editors/pointedit.cpp | 40 +- lib/koproperty/editors/pointedit.h | 13 +- lib/koproperty/editors/rectedit.cpp | 44 +- lib/koproperty/editors/rectedit.h | 13 +- lib/koproperty/editors/sizeedit.cpp | 38 +- lib/koproperty/editors/sizeedit.h | 13 +- lib/koproperty/editors/sizepolicyedit.cpp | 78 +- lib/koproperty/editors/sizepolicyedit.h | 23 +- lib/koproperty/editors/spinbox.cpp | 138 ++-- lib/koproperty/editors/spinbox.h | 36 +- lib/koproperty/editors/stringedit.cpp | 24 +- lib/koproperty/editors/stringedit.h | 13 +- lib/koproperty/editors/stringlistedit.cpp | 42 +- lib/koproperty/editors/stringlistedit.h | 21 +- lib/koproperty/editors/symbolcombo.cpp | 52 +- lib/koproperty/editors/symbolcombo.h | 19 +- lib/koproperty/editors/timeedit.cpp | 36 +- lib/koproperty/editors/timeedit.h | 15 +- lib/koproperty/editors/urledit.cpp | 22 +- lib/koproperty/editors/urledit.h | 9 +- lib/koproperty/factory.cpp | 58 +- lib/koproperty/factory.h | 44 +- lib/koproperty/property.cpp | 256 +++---- lib/koproperty/property.h | 200 ++--- lib/koproperty/set.cpp | 136 ++-- lib/koproperty/set.h | 56 +- lib/koproperty/test/test.cpp | 52 +- lib/koproperty/test/test.h | 1 + lib/koproperty/utils.h | 14 +- lib/koproperty/widget.cpp | 36 +- lib/koproperty/widget.h | 21 +- lib/koproperty/widgetproxy.cpp | 32 +- lib/koproperty/widgetproxy.h | 17 +- lib/kotext/DESIGN | 20 +- lib/kotext/DateFormatWidget.cpp | 52 +- lib/kotext/DateFormatWidget.h | 7 +- lib/kotext/IsoDuration.h | 16 +- lib/kotext/KFontDialog_local.cpp | 386 +++++----- lib/kotext/KFontDialog_local.h | 164 +++-- lib/kotext/KoAutoFormat.cpp | 524 ++++++------- lib/kotext/KoAutoFormat.h | 129 ++-- lib/kotext/KoAutoFormatDia.cpp | 452 ++++++------ lib/kotext/KoAutoFormatDia.h | 77 +- lib/kotext/KoBgSpellCheck.cpp | 56 +- lib/kotext/KoBgSpellCheck.h | 11 +- lib/kotext/KoBorder.cpp | 60 +- lib/kotext/KoBorder.h | 36 +- lib/kotext/KoChangeCaseDia.cpp | 30 +- lib/kotext/KoChangeCaseDia.h | 17 +- lib/kotext/KoCommentDia.cpp | 36 +- lib/kotext/KoCommentDia.h | 15 +- lib/kotext/KoCompletionBase.ui | 64 +- lib/kotext/KoCompletionDia.cpp | 58 +- lib/kotext/KoCompletionDia.h | 12 +- lib/kotext/KoComplexText.cpp | 716 +++++++++--------- lib/kotext/KoComplexText.h | 100 +-- lib/kotext/KoCreateStyleDia.cpp | 26 +- lib/kotext/KoCreateStyleDia.h | 15 +- lib/kotext/KoCustomVariablesDia.cpp | 158 ++-- lib/kotext/KoCustomVariablesDia.h | 52 +- lib/kotext/KoDecorationTab.cpp | 30 +- lib/kotext/KoDecorationTab.h | 23 +- lib/kotext/KoFontDia.cpp | 116 +-- lib/kotext/KoFontDia.h | 19 +- lib/kotext/KoFontDiaPreview.cpp | 142 ++-- lib/kotext/KoFontDiaPreview.h | 53 +- lib/kotext/KoFontTab.cpp | 14 +- lib/kotext/KoFontTab.h | 13 +- lib/kotext/KoHighlightingTab.cpp | 36 +- lib/kotext/KoHighlightingTab.h | 11 +- lib/kotext/KoImportStyleDia.cpp | 44 +- lib/kotext/KoImportStyleDia.h | 17 +- lib/kotext/KoLanguageTab.cpp | 24 +- lib/kotext/KoLanguageTab.h | 7 +- lib/kotext/KoLayoutTab.cpp | 18 +- lib/kotext/KoLayoutTab.h | 7 +- lib/kotext/KoListStyleStack.cpp | 12 +- lib/kotext/KoListStyleStack.h | 14 +- lib/kotext/KoOasisContext.cpp | 28 +- lib/kotext/KoOasisContext.h | 22 +- lib/kotext/KoParagCounter.cpp | 238 +++--- lib/kotext/KoParagCounter.h | 82 +-- lib/kotext/KoParagDecorationTab.ui | 32 +- lib/kotext/KoParagDia.cpp | 756 +++++++++---------- lib/kotext/KoParagDia.h | 212 +++--- lib/kotext/KoParagDia_p.h | 66 +- lib/kotext/KoParagLayout.cpp | 542 +++++++------- lib/kotext/KoParagLayout.h | 54 +- lib/kotext/KoParagStyle.cpp | 78 +- lib/kotext/KoParagStyle.h | 24 +- lib/kotext/KoRichText.cpp | 204 ++--- lib/kotext/KoRichText.h | 288 ++++---- lib/kotext/KoSearchDia.cpp | 298 ++++---- lib/kotext/KoSearchDia.h | 151 ++-- lib/kotext/KoSpell.cpp | 22 +- lib/kotext/KoSpell.h | 13 +- lib/kotext/KoStyleCollection.cpp | 56 +- lib/kotext/KoStyleCollection.h | 18 +- lib/kotext/KoStyleManager.cpp | 168 ++--- lib/kotext/KoStyleManager.h | 84 ++- lib/kotext/KoTextBookmark.cpp | 4 +- lib/kotext/KoTextBookmark.h | 28 +- lib/kotext/KoTextCommand.cpp | 50 +- lib/kotext/KoTextCommand.h | 34 +- lib/kotext/KoTextCustomItem.cpp | 30 +- lib/kotext/KoTextCustomItem.h | 22 +- lib/kotext/KoTextDocument.cpp | 308 ++++---- lib/kotext/KoTextDocument.h | 147 ++-- lib/kotext/KoTextFormat.cpp | 354 ++++----- lib/kotext/KoTextFormat.h | 178 ++--- lib/kotext/KoTextFormatter.cpp | 180 ++--- lib/kotext/KoTextFormatter.h | 6 +- lib/kotext/KoTextIterator.cpp | 42 +- lib/kotext/KoTextIterator.h | 27 +- lib/kotext/KoTextObject.cpp | 428 +++++------ lib/kotext/KoTextObject.h | 147 ++-- lib/kotext/KoTextParag.cpp | 680 ++++++++--------- lib/kotext/KoTextParag.h | 134 ++-- lib/kotext/KoTextView.cpp | 240 +++--- lib/kotext/KoTextView.h | 75 +- lib/kotext/KoTextViewIface.cc | 106 +-- lib/kotext/KoTextViewIface.h | 76 +- lib/kotext/KoTextZoomHandler.cpp | 38 +- lib/kotext/KoTextZoomHandler.h | 72 +- lib/kotext/KoUserStyle.cpp | 6 +- lib/kotext/KoUserStyle.h | 16 +- lib/kotext/KoUserStyleCollection.cpp | 38 +- lib/kotext/KoUserStyleCollection.h | 24 +- lib/kotext/KoVariable.cpp | 768 +++++++++---------- lib/kotext/KoVariable.h | 351 ++++----- lib/kotext/TimeFormatWidget.cpp | 52 +- lib/kotext/TimeFormatWidget.h | 7 +- lib/kotext/kodecorationtabbase.ui | 24 +- lib/kotext/kofonttabbase.ui | 4 +- lib/kotext/kohighlightingtabbase.ui | 14 +- lib/kotext/kohyphen/hyphdicts/hyph_da.dic | 2 +- lib/kotext/kohyphen/hyphdicts/hyph_es.dic | 4 +- lib/kotext/kohyphen/hyphdicts/hyph_hu.dic | 4 +- lib/kotext/kohyphen/hyphdicts/hyph_nl.dic | 2 +- lib/kotext/kohyphen/hyphdicts/hyph_sv.dic | 2 +- lib/kotext/kohyphen/kohyphen.cpp | 84 +-- lib/kotext/kohyphen/kohyphen.h | 36 +- lib/kotext/kohyphen/kohyphentest.cpp | 28 +- lib/kotext/kolanguagetabbase.ui | 10 +- lib/kotext/kolayouttabbase.ui | 36 +- lib/kotext/tests/KoUserStyleTester.cpp | 22 +- lib/kotext/tests/KoUserStyleTester.h | 1 + lib/kotext/tests/kobordertest.cpp | 60 +- lib/kotext/tests/kotextformattertest.cpp | 10 +- lib/kotext/tests/kovariabletest.cpp | 10 +- lib/kotext/timedateformatwidget.ui | 40 +- lib/kross/api/callable.cpp | 52 +- lib/kross/api/callable.h | 32 +- lib/kross/api/class.h | 14 +- lib/kross/api/dict.cpp | 14 +- lib/kross/api/dict.h | 14 +- lib/kross/api/event.h | 56 +- lib/kross/api/eventaction.cpp | 8 +- lib/kross/api/eventaction.h | 10 +- lib/kross/api/eventscript.cpp | 8 +- lib/kross/api/eventscript.h | 10 +- lib/kross/api/eventsignal.cpp | 24 +- lib/kross/api/eventsignal.h | 28 +- lib/kross/api/eventslot.cpp | 172 ++--- lib/kross/api/eventslot.h | 54 +- lib/kross/api/exception.cpp | 20 +- lib/kross/api/exception.h | 20 +- lib/kross/api/function.h | 2 +- lib/kross/api/interpreter.cpp | 22 +- lib/kross/api/interpreter.h | 42 +- lib/kross/api/list.cpp | 20 +- lib/kross/api/list.h | 42 +- lib/kross/api/module.h | 10 +- lib/kross/api/object.cpp | 14 +- lib/kross/api/object.h | 22 +- lib/kross/api/proxy.h | 10 +- lib/kross/api/qtobject.cpp | 116 +-- lib/kross/api/qtobject.h | 50 +- lib/kross/api/script.h | 12 +- lib/kross/api/value.h | 4 +- lib/kross/api/variant.cpp | 110 +-- lib/kross/api/variant.h | 82 +-- lib/kross/main/krossconfig.cpp | 4 +- lib/kross/main/krossconfig.h | 8 +- lib/kross/main/mainmodule.cpp | 22 +- lib/kross/main/mainmodule.h | 46 +- lib/kross/main/manager.cpp | 94 +-- lib/kross/main/manager.h | 28 +- lib/kross/main/scriptaction.cpp | 66 +- lib/kross/main/scriptaction.h | 49 +- lib/kross/main/scriptcontainer.cpp | 74 +- lib/kross/main/scriptcontainer.h | 40 +- lib/kross/main/scriptguiclient.cpp | 156 ++-- lib/kross/main/scriptguiclient.h | 45 +- lib/kross/main/wdgscriptsmanager.cpp | 110 +-- lib/kross/main/wdgscriptsmanager.h | 7 +- lib/kross/main/wdgscriptsmanagerbase.ui | 22 +- lib/kross/python/cxx/Objects.hxx | 16 +- lib/kross/python/cxx/PyCXX.html | 14 +- lib/kross/python/cxx/cxxsupport.cxx | 2 +- lib/kross/python/pythonextension.cpp | 154 ++-- lib/kross/python/pythonextension.h | 54 +- lib/kross/python/pythoninterpreter.cpp | 36 +- lib/kross/python/pythoninterpreter.h | 2 +- lib/kross/python/pythonmodule.cpp | 18 +- lib/kross/python/pythonmodule.h | 2 +- lib/kross/python/pythonobject.cpp | 20 +- lib/kross/python/pythonobject.h | 12 +- lib/kross/python/pythonscript.cpp | 94 +-- lib/kross/python/pythonscript.h | 10 +- lib/kross/python/pythonsecurity.cpp | 30 +- lib/kross/python/pythonsecurity.h | 10 +- .../python/scripts/RestrictedPython/Guards.py | 2 +- lib/kross/python/scripts/gui.py | 134 ++-- lib/kross/ruby/rubyextension.cpp | 92 +-- lib/kross/ruby/rubyextension.h | 42 +- lib/kross/ruby/rubyinterpreter.cpp | 14 +- lib/kross/ruby/rubymodule.cpp | 8 +- lib/kross/ruby/rubymodule.h | 4 +- lib/kross/ruby/rubyscript.cpp | 16 +- lib/kross/ruby/rubyscript.h | 8 +- lib/kross/runner/main.cpp | 26 +- lib/kross/test/main.cpp | 36 +- lib/kross/test/testaction.cpp | 6 +- lib/kross/test/testaction.h | 9 +- lib/kross/test/testcase.py | 8 +- lib/kross/test/testgui.py | 28 +- lib/kross/test/testobject.cpp | 46 +- lib/kross/test/testobject.h | 35 +- lib/kross/test/testplugin.cpp | 28 +- lib/kross/test/testplugin.h | 30 +- lib/kross/test/testwindow.cpp | 48 +- lib/kross/test/testwindow.h | 15 +- lib/kwmf/kowmfpaint.cc | 70 +- lib/kwmf/kowmfpaint.h | 46 +- lib/kwmf/kowmfread.cc | 12 +- lib/kwmf/kowmfread.h | 62 +- lib/kwmf/kowmfreadprivate.cc | 354 ++++----- lib/kwmf/kowmfreadprivate.h | 168 ++--- lib/kwmf/kowmfstack.h | 20 +- lib/kwmf/kowmfstruct.h | 140 ++-- lib/kwmf/kowmfwrite.cc | 206 +++--- lib/kwmf/kowmfwrite.h | 66 +- lib/kwmf/kwmf.cc | 176 ++--- lib/kwmf/kwmf.h | 90 +-- lib/kwmf/qwmf.cc | 246 +++---- lib/kwmf/qwmf.h | 60 +- lib/kwmf/wmfstruct.h | 4 +- lib/store/KoDirectoryStore.cpp | 38 +- lib/store/KoDirectoryStore.h | 22 +- lib/store/KoStore.cpp | 132 ++-- lib/store/KoStore.h | 86 +-- lib/store/KoStoreBase.h | 4 +- lib/store/KoStoreDevice.h | 25 +- lib/store/KoStoreDrag.cpp | 10 +- lib/store/KoStoreDrag.h | 14 +- lib/store/KoTarStore.cpp | 26 +- lib/store/KoTarStore.h | 20 +- lib/store/KoXmlWriter.cpp | 96 +-- lib/store/KoXmlWriter.h | 68 +- lib/store/KoZipStore.cpp | 32 +- lib/store/KoZipStore.h | 20 +- lib/store/fix_storage.pl | 8 +- lib/store/tests/storage_test.cpp | 38 +- lib/store/tests/storedroptest.cpp | 72 +- lib/store/tests/xmlwritertest.cpp | 40 +- lib/store/tests/xmlwritertest.h | 20 +- 637 files changed, 23458 insertions(+), 23220 deletions(-) (limited to 'lib') diff --git a/lib/kformula/DESIGN b/lib/kformula/DESIGN index a6a7eccb..f060b897 100644 --- a/lib/kformula/DESIGN +++ b/lib/kformula/DESIGN @@ -19,21 +19,21 @@ objects from it. Responsebilities (This goes for every derived element and therefore for each one.) -- knows its children. Actually BasicElement doesn't have any. But it - already defines that children must be known by their parent. -- knows its bounding rectangle (its size.) The children are included - in this rect. (The position is relative to the parent.) -//- knows its middle line. (for alignment) -- knows it's zero point for midline (vertical alignment) and +- knows its tqchildren. Actually BasicElement doesn't have any. But it + already defines that tqchildren must be known by their tqparent. +- knows its bounding rectangle (its size.) The tqchildren are included + in this rect. (The position is relative to the tqparent.) +//- knows its middle line. (for tqalignment) +- knows it's zero point for midline (vertical tqalignment) and keep open the possibility of negative positions (out of bounding rect) -- draws itself (given a painter); children are drawn, too +- draws itself (given a painter); tqchildren are drawn, too - knows all positions where the cursor is allowed to be. (see below) -- knows its parent; The topmost element has no parent; there is a +- knows its tqparent; The topmost element has no tqparent; there is a implicit guaranty that the topmost element is always a SequenceElement. - can save and load itself. different formates. (see below) -- all children must be a SequenceElement. Except for SequenceElement's - children that might be of any type. +- all tqchildren must be a SequenceElement. Except for SequenceElement's + tqchildren that might be of any type. - might have its own color. - might have its own font size (see below). @@ -41,14 +41,14 @@ Responsebilities SequenceElement from BasicElement --------------- -Manages a list of children. The children are aligned horizontally at +Manages a list of tqchildren. The tqchildren are aligned horizontally at one middle line. No gaps, no overlaps. -Has no own look. It just draws all its children and is done. Except if +Has no own look. It just draws all its tqchildren and is done. Except if its empty. It looks like an empty space then (i.e. a little square) Has n+1 valid cursor positions where n is the number of -children. These are before, between and after the children. +tqchildren. These are before, between and after the tqchildren. May contain any (type of) element as child @@ -56,41 +56,41 @@ except SequenceElements if they contains a SequenceElement they merge it in the list They can handle splitting of the sequence to allow "select an put selected item -between parenthesis" i.e. as content child of a delimiterelement) +between tqparenthesis" i.e. as content child of a delimiterelement) FormulaElement from SequenceElement -------------- -The only element those parent is null. The root of the element object +The only element those tqparent is null. The root of the element object tree. This is the element that is created by the KFormulaDoc and that knows -about it. As every other element knows its parent and therefore the +about it. As every other element knows its tqparent and therefore the FormulaElement we get a chance to pass messages to the outside world. RootElement from BasicElement ----------- -contains two children. content and index. index is optional. +contains two tqchildren. content and index. index is optional. IndexElement from BasicElement ------------ -contains five children. content and four indexes. all indexes are +contains five tqchildren. content and four indexes. all indexes are optional. If there is no index the element might be replaced by its content. TextElement from BasicElement ----------- -contains one char and no children at all. +contains one char and no tqchildren at all. Might have its own font and size. But preferes to use a reasonalbe -font and size that are calculated from its parents font and a given +font and size that are calculated from its tqparents font and a given scheme (see below). @@ -104,7 +104,7 @@ choose with. FractionElement from BasicElement --------------- -2 children: numerator, denominator +2 tqchildren: numerator, denominator DecorationElement from BasicElement @@ -121,7 +121,7 @@ the other side of the decoration. SumIntegralElement from BasicElement //PrefixedElement ------------------ -draws all sorts of mathematical symbols with three children. Above, +draws all sorts of mathematical symbols with three tqchildren. Above, below (or whereever the indices and limits go)and to the right. @@ -129,7 +129,7 @@ GeometryElement from BasicElement --------------- One child. -Draw it at a fixed position relative to parent or absolute. +Draw it at a fixed position relative to tqparent or absolute. This is to do dirty things. This element must not be used, kformula will provide you everything @@ -142,7 +142,7 @@ typical of a math formula. MatrixElement from BasicElement ------------- -A matrix of children. +A matrix of tqchildren. With all align stuff, internal borders etc, matrix dots handling (i.e. those dots or lines that complete the matrix, not well handled in TeX), etc.. @@ -150,7 +150,7 @@ etc.. SpaceElement from BasicElement ------------ -No children at all. Provides the facility to insert horizontal spaces +No tqchildren at all. Provides the facility to insert horizontal spaces in the formula. (therefore it is similar to TextElement.) @@ -184,18 +184,18 @@ If the cursor points into an element this element is said to own the cursor. There are a few rules that describe how new cursor positions are calculated given the current key: -- An elements cursor positions are its children. The element might not -own the cursor except when it is owned by one of its children. The +- An elements cursor positions are its tqchildren. The element might not +own the cursor except when it is owned by one of its tqchildren. The only exception is SequenceElement which has valid cursor positions -before, between and after its children, too. +before, between and after its tqchildren, too. (Therefore the cursor is always owned by a SequenceElement.) -- Each element's children are ordered. If the cursor leaves one child +- Each element's tqchildren are ordered. If the cursor leaves one child the next child it. The direction depends on the key that moved the -cursor. If there is child left the cursor is passed to the parent. +cursor. If there is child left the cursor is passed to the tqparent. -- If the cursor comes from our parent the first or the last child gets +- If the cursor comes from our tqparent the first or the last child gets it. Depending on the direction in which the cursor moved. Please note that because each element knows its own cursor positions @@ -344,7 +344,7 @@ We want a formula to look different according to its surroundings. (Most obviosly according to the available height and/or width.) It would be great to get something like automatic operator -alignment. So if you type some formulas each on its own line the +tqalignment. So if you type some formulas each on its own line the assigment operators should be automatically in a column. (If the user turns this on.) @@ -353,7 +353,7 @@ turns this on.) Fonts and font size ################### -Each elements font size is calculated starting from its parents font +Each elements font size is calculated starting from its tqparents font size. It knows how it differs to those. The font size might also be used to choose the pen width and other diff --git a/lib/kformula/MatrixDialog.cc b/lib/kformula/MatrixDialog.cc index 7f8ee9d5..a0536c1d 100644 --- a/lib/kformula/MatrixDialog.cc +++ b/lib/kformula/MatrixDialog.cc @@ -18,11 +18,11 @@ */ #include "MatrixDialog.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include KFORMULA_NAMESPACE_BEGIN @@ -30,34 +30,34 @@ KFORMULA_NAMESPACE_BEGIN const int DEFAULT_SIZE = 3; const int MAX_SIZE = 200; -MatrixDialog::MatrixDialog( QWidget *parent, int _width, int _height ) - : KDialogBase(parent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel) +MatrixDialog::MatrixDialog( TQWidget *tqparent, int _width, int _height ) + : KDialogBase(tqparent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel) { w = _width; h = _height; - QLabel *rows, *columns; - QWidget *page = new QWidget( this ); + TQLabel *rows, *columns; + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QGridLayout *grid = new QGridLayout(page, 4, 2, 10); + TQGridLayout *grid = new TQGridLayout(page, 4, 2, 10); - rows = new QLabel(i18n("Rows:"), page); - columns = new QLabel(i18n("Columns:"), page); + rows = new TQLabel(i18n("Rows:"), page); + columns = new TQLabel(i18n("Columns:"), page); grid->addWidget(rows, 0, 0); grid->addWidget(columns, 0, 1); - QSpinBox *width, *height; + TQSpinBox *width, *height; - height = new QSpinBox(1, MAX_SIZE, 1, page); + height = new TQSpinBox(1, MAX_SIZE, 1, page); grid->addWidget(height, 1, 0); height->setValue(h); - connect(height, SIGNAL(valueChanged(int)), SLOT(setHeight(int))); + connect(height, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setHeight(int))); - width = new QSpinBox(1, MAX_SIZE, 1, page); + width = new TQSpinBox(1, MAX_SIZE, 1, page); grid->addWidget(width, 1, 1); width->setValue(w); - connect(width, SIGNAL(valueChanged(int)), SLOT(setWidth(int))); + connect(width, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setWidth(int))); height->setFocus(); } diff --git a/lib/kformula/MatrixDialog.h b/lib/kformula/MatrixDialog.h index d8b728d3..06688b90 100644 --- a/lib/kformula/MatrixDialog.h +++ b/lib/kformula/MatrixDialog.h @@ -20,9 +20,9 @@ #ifndef MATRIXDIALOG_H_INCLUDED #define MATRIXDIALOG_H_INCLUDED -#include +#include #include -#include +#include #include "kformuladefs.h" @@ -34,13 +34,14 @@ KFORMULA_NAMESPACE_BEGIN class MatrixDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: int w; int h; - MatrixDialog( QWidget *parent, int width = 3, int height = 3 ); + MatrixDialog( TQWidget *tqparent, int width = 3, int height = 3 ); ~MatrixDialog() {} protected slots: diff --git a/lib/kformula/actionelement.cc b/lib/kformula/actionelement.cc index fdee73a5..5fa5a38e 100644 --- a/lib/kformula/actionelement.cc +++ b/lib/kformula/actionelement.cc @@ -22,19 +22,19 @@ KFORMULA_NAMESPACE_BEGIN -ActionElement::ActionElement( BasicElement* parent ) : SequenceElement( parent ), +ActionElement::ActionElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_selection( 0 ) { } -bool ActionElement::readAttributesFromMathMLDom(const QDomElement& element) +bool ActionElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } m_actionType = element.attribute( "actiontype" ); - QString selectionStr = element.attribute( "selection" ); + TQString selectionStr = element.attribute( "selection" ); if ( ! selectionStr.isNull() ) { bool ok; m_selection = selectionStr.toUInt( &ok ); @@ -44,12 +44,12 @@ bool ActionElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -int ActionElement::buildChildrenFromMathMLDom(QPtrList& list, QDomNode n) +int ActionElement::buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n) { if ( ! n.isElement() ) return -1; - QDomElement e = n.toElement(); - QString tag = e.tagName().lower(); + TQDomElement e = n.toElement(); + TQString tag = e.tagName().lower(); BasicElement* child = getCreationStrategy()->createElement( tag, e ); if ( child == 0 ) return -1; @@ -63,13 +63,13 @@ int ActionElement::buildChildrenFromMathMLDom(QPtrList& list, QDom return 1; } -void ActionElement::writeMathMLAttributes( QDomElement& element ) const +void ActionElement::writeMathMLAttributes( TQDomElement& element ) const { if ( ! m_actionType.isNull() ) { element.setAttribute( "actiontype", m_actionType ); } if ( m_selection ) { - element.setAttribute( "selection", QString( "%1" ).arg( m_selection ) ); + element.setAttribute( "selection", TQString( "%1" ).tqarg( m_selection ) ); } } diff --git a/lib/kformula/actionelement.h b/lib/kformula/actionelement.h index d4a0906b..9c7342d5 100644 --- a/lib/kformula/actionelement.h +++ b/lib/kformula/actionelement.h @@ -32,15 +32,15 @@ KFORMULA_NAMESPACE_BEGIN class ActionElement : public SequenceElement { typedef SequenceElement inherited; public: - ActionElement( BasicElement* parent = 0 ); - virtual int buildChildrenFromMathMLDom(QPtrList& list, QDomNode n); + ActionElement( BasicElement* tqparent = 0 ); + virtual int buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n); private: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); - virtual QString getElementName() const { return "maction"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); + virtual TQString getElementName() const { return "maction"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QString m_actionType; + TQString m_actionType; uint m_selection; }; diff --git a/lib/kformula/basicelement.cc b/lib/kformula/basicelement.cc index 82913cec..bbe6f453 100644 --- a/lib/kformula/basicelement.cc +++ b/lib/kformula/basicelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include "contextstyle.h" @@ -34,7 +34,7 @@ using namespace std; int BasicElement::evilDestructionCount = 0; BasicElement::BasicElement( BasicElement* p ) - : parent( p ), m_baseline( 0 ), elementType( 0 ) + : tqparent( p ), m_baseline( 0 ), elementType( 0 ) { setX( 0 ); setY( 0 ); @@ -49,7 +49,7 @@ BasicElement::~BasicElement() } BasicElement::BasicElement( const BasicElement& other ) - : parent( 0 ), + : tqparent( 0 ), m_baseline( other.m_baseline ), elementType( other.elementType ) { @@ -63,14 +63,14 @@ BasicElement::BasicElement( const BasicElement& other ) bool BasicElement::readOnly( const BasicElement* /*child*/ ) const { - return parent->readOnly( this ); + return tqparent->readOnly( this ); } FormulaElement* BasicElement::formula() { - //if ( parent != 0 ) { - return parent->formula(); + //if ( tqparent != 0 ) { + return tqparent->formula(); //} //return 0; } @@ -80,11 +80,11 @@ FormulaElement* BasicElement::formula() * Returns the element the point is in. */ BasicElement* BasicElement::goToPos( FormulaCursor*, bool&, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - luPixel x = point.x() - (parentOrigin.x() + getX()); + luPixel x = point.x() - (tqparentOrigin.x() + getX()); if ((x >= 0) && (x < getWidth())) { - luPixel y = point.y() - (parentOrigin.y() + getY()); + luPixel y = point.y() - (tqparentOrigin.y() + getY()); if ((y >= 0) && (y < getHeight())) { return this; } @@ -99,7 +99,7 @@ LuPixelPoint BasicElement::widgetPos() { luPixel x = 0; luPixel y = 0; - for (BasicElement* element = this; element != 0; element = element->parent) { + for (BasicElement* element = this; element != 0; element = element->tqparent) { x += element->getX(); y += element->getY(); } @@ -166,23 +166,23 @@ void BasicElement::normalize(FormulaCursor* cursor, Direction direction) } -QDomElement BasicElement::getElementDom( QDomDocument& doc) +TQDomElement BasicElement::getElementDom( TQDomDocument& doc) { - QDomElement de = doc.createElement(getTagName()); + TQDomElement de = doc.createElement(getTagName()); writeDom(de); return de; } -void BasicElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void BasicElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); + TQDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); writeMathMLAttributes( de ); writeMathMLContent( doc, de, oasisFormat ); - parent.appendChild( de ); + tqparent.appendChild( de ); } -bool BasicElement::buildFromDom(QDomElement element) +bool BasicElement::buildFromDom(TQDomElement element) { if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -191,11 +191,11 @@ bool BasicElement::buildFromDom(QDomElement element) if (!readAttributesFromDom(element)) { return false; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromDom(node); } -int BasicElement::buildFromMathMLDom(QDomElement element) +int BasicElement::buildFromMathMLDom(TQDomElement element) {/* if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -204,14 +204,14 @@ int BasicElement::buildFromMathMLDom(QDomElement element) if (!readAttributesFromMathMLDom(element)) { return -1; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromMathMLDom(node); } /** * Appends our attributes to the dom element. */ -void BasicElement::writeDom(QDomElement) +void BasicElement::writeDom(TQDomElement) { } @@ -219,7 +219,7 @@ void BasicElement::writeDom(QDomElement) * Reads our attributes from the element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromDom(QDomElement) +bool BasicElement::readAttributesFromDom(TQDomElement) { return true; } @@ -229,7 +229,7 @@ bool BasicElement::readAttributesFromDom(QDomElement) * that needs to be read. * Returns false if it failed. */ -bool BasicElement::readContentFromDom(QDomNode&) +bool BasicElement::readContentFromDom(TQDomNode&) { return true; } @@ -238,14 +238,14 @@ bool BasicElement::readContentFromDom(QDomNode&) * Returns a SequenceElement constructed from the nodes first child * if the nodes name matches the given name. */ -bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString name ) +bool BasicElement::buildChild( SequenceElement* child, TQDomNode node, TQString name ) { if (node.isElement()) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if (e.tagName().upper() == name) { - QDomNode nodeInner = e.firstChild(); + TQDomNode nodeInner = e.firstChild(); if (nodeInner.isElement()) { - QDomElement element = nodeInner.toElement(); + TQDomElement element = nodeInner.toElement(); return child->buildFromDom( element ); } } @@ -257,7 +257,7 @@ bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString na * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) +bool BasicElement::readAttributesFromMathMLDom(const TQDomElement& ) { return true; } @@ -267,12 +267,12 @@ bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) * that needs to be read. * Returns false if it failed. */ -int BasicElement::readContentFromMathMLDom(QDomNode&) +int BasicElement::readContentFromMathMLDom(TQDomNode&) { return 1; } -QString BasicElement::toLatex() +TQString BasicElement::toLatex() { return "{}"; } @@ -287,41 +287,41 @@ QString BasicElement::toLatex() * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ -double BasicElement::getSize( const QString& str, SizeType* st ) +double BasicElement::getSize( const TQString& str, SizeType* st ) { - int index = str.find( "%" ); + int index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str, st, index, PixelSize ); } @@ -329,7 +329,7 @@ double BasicElement::getSize( const QString& str, SizeType* st ) return str2size( str, st, str.length(),AbsoluteSize ); } -SizeType BasicElement::getSpace( const QString& str ) +SizeType BasicElement::getSpace( const TQString& str ) { if ( str == "negativeveryverythinmathspace" ) { return NegativeVeryVeryThinMathSpace; @@ -380,9 +380,9 @@ SizeType BasicElement::getSpace( const QString& str ) /** * Used internally by getSize() */ -double BasicElement::str2size( const QString& str, SizeType *st, uint index, SizeType type ) +double BasicElement::str2size( const TQString& str, SizeType *st, uint index, SizeType type ) { - QString num = str.left( index ); + TQString num = str.left( index ); bool ok; double size = num.toDouble( &ok ); if ( ok ) { diff --git a/lib/kformula/basicelement.h b/lib/kformula/basicelement.h index ee9cffe0..d373fc6c 100644 --- a/lib/kformula/basicelement.h +++ b/lib/kformula/basicelement.h @@ -21,10 +21,10 @@ #ifndef BASICELEMENT_H #define BASICELEMENT_H -// Qt Include -#include -#include -#include +// TQt Include +#include +#include +#include // KDE Include @@ -32,7 +32,7 @@ #include "contextstyle.h" #include "kformuladefs.h" -class QKeyEvent; +class TQKeyEvent; class KCommand; @@ -53,7 +53,7 @@ class StyleElement; * Basis of every formula element. An element is used basically by * other elements and by the @ref FormulaCursor . * - * Each element knows its size (a rect that includes all children) + * Each element knows its size (a rect that includes all tqchildren) * and how to draw itself. See @ref calcSizes and @ref draw . * * An element might contain valid cursor position. If the cursor @@ -63,11 +63,11 @@ class StyleElement; * cursor that tell how it wants to move. See @ref moveLeft , * @ref moveRight , @ref moveUp , @ref moveDown . * - * To build a tree an element must own children. If there are children + * To build a tree an element must own tqchildren. If there are tqchildren * there must be a main child. This is the child that might be used to * replace the element. See @ref getMainChild(). * - * If there can be children you might want to @ref insert and @ref remove + * If there can be tqchildren you might want to @ref insert and @ref remove * them. After a removal the element might be senseless. * (See @ref isSenseless ) * If it is it must be removed. @@ -81,13 +81,13 @@ class BasicElement public: /* - * Each element might contain children. Each child needs + * Each element might contain tqchildren. Each child needs * its own unique number. It is not guaranteed, however, * that the number stays the same all the time. - * (The SequenceElement's children are simply counted.) + * (The SequenceElement's tqchildren are simply counted.) */ - BasicElement(BasicElement* parent = 0); + BasicElement(BasicElement* tqparent = 0); virtual ~BasicElement(); // deep copy @@ -102,7 +102,7 @@ public: /** * @returns whether the child should be read-only. The idea is - * that a read-only parent has read-only children. + * that a read-only tqparent has read-only tqchildren. */ virtual bool readOnly( const BasicElement* child ) const; @@ -114,14 +114,14 @@ public: /** * Provide fast access to the rootElement for each child. */ - virtual const FormulaElement* formula() const { return parent->formula(); } + virtual const FormulaElement* formula() const { return tqparent->formula(); } /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const { return QChar::null; } + virtual TQChar getCharacter() const { return TQChar::null; } /** * @returns the type of this element. Used for @@ -141,7 +141,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Returns our position inside the widget. @@ -158,7 +158,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -166,20 +166,20 @@ public: StyleAttributes& style ) = 0; /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) = 0; + const LuPixelPoint& tqparentOrigin ) = 0; /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* /*cmd*/ ) {} @@ -243,7 +243,7 @@ public: */ virtual void entered( SequenceElement* /*child*/ ); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -257,7 +257,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return 0; } //virtual void setMainChild(SequenceElement*) {} @@ -265,21 +265,21 @@ public: // editing // - // Insert and remove children. + // Insert and remove tqchildren. /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList&, Direction) {} + virtual void insert(FormulaCursor*, TQPtrList&, Direction) {} /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - virtual void remove(FormulaCursor*, QPtrList&, Direction) {} + virtual void remove(FormulaCursor*, TQPtrList&, Direction) {} /** * Moves the cursor to a normal place where new elements @@ -290,7 +290,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless() { return false; } @@ -316,7 +316,7 @@ public: /** - * Callback for the tabs among our children. Needed for alignment. + * Callback for the tabs among our tqchildren. Needed for tqalignment. */ virtual void registerTab( BasicElement* /*tab*/ ) {} @@ -336,13 +336,13 @@ public: * new elements because it owns the undo stack. But only the * sequence knows what chars are allowed. */ - virtual KCommand* input( Container*, QKeyEvent* ) { return 0; } + virtual KCommand* input( Container*, TQKeyEvent* ) { return 0; } // basic support - const BasicElement* getParent() const { return parent; } - BasicElement* getParent() { return parent; } - void setParent(BasicElement* p) { parent = p; } + const BasicElement* getParent() const { return tqparent; } + BasicElement* getParent() { return tqparent; } + void setParent(BasicElement* p) { tqparent = p; } luPixel getX() const { return m_x; } luPixel getY() const { return m_y; } @@ -350,7 +350,7 @@ public: void setX( luPixel x ) { m_x = x; } void setY( luPixel y ) { m_y = y; } - //QSize getSize() { return size; } + //TQSize getSize() { return size; } luPixel getWidth() const { return m_width; } luPixel getHeight() const { return m_height; } @@ -367,36 +367,36 @@ public: return getBaseline() - style.axisHeight( tstyle, factor ); } /** - * @return a QDomElement that contain as DomChildren the - * children, and as attribute the attribute of this + * @return a TQDomElement that contain as DomChildren the + * tqchildren, and as attribute the attribute of this * element. */ - QDomElement getElementDom( QDomDocument& doc); + TQDomElement getElementDom( TQDomDocument& doc); /** * Same as above, just MathML. * It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead */ - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; /** - * Set this element attribute, build children and + * Set this element attribute, build tqchildren and * call their buildFromDom. */ - bool buildFromDom(QDomElement element); + bool buildFromDom(TQDomElement element); /** - * Set this element attribute, build children and call + * Set this element attribute, build tqchildren and call * their builFromMathMLDom. * Returns the number of nodes processed or -1 if it failed. */ - int buildFromMathMLDom( QDomElement element ); + int buildFromMathMLDom( TQDomElement element ); // debug static int getEvilDestructionCount() { return evilDestructionCount; } /** - * @returns our type. This is an object from our parent's syntax tree + * @returns our type. This is an object from our tqparent's syntax tree * or 0 if there was a very bad parsing error. */ ElementType* getElementType() const { return elementType; } @@ -408,7 +408,7 @@ public: virtual void setStyle(StyleElement*) {} - virtual QString getElementName() const { return ""; }; + virtual TQString getElementName() const { return ""; }; protected: //Save/load support @@ -416,45 +416,45 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "BASIC"; } + virtual TQString getTagName() const { return "BASIC"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual void writeMathMLAttributes( QDomElement& /*element*/ ) const {}; - virtual void writeMathMLContent( QDomDocument& /*doc*/, - QDomElement& /*element*/, + virtual void writeMathMLAttributes( TQDomElement& /*element*/ ) const {}; + virtual void writeMathMLContent( TQDomDocument& /*doc*/, + TQDomElement& /*element*/, bool /*oasisFormat*/ ) const {}; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Returns if the SequenceElement could be constructed from the nodes first child. * The node name must match the given name. * - * This is a service for all subclasses that contain children. + * This is a service for all subclasses that contain tqchildren. */ - bool buildChild( SequenceElement* child, QDomNode node, QString name ); + bool buildChild( SequenceElement* child, TQDomNode node, TQString name ); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node @@ -462,16 +462,16 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString() { return ""; } + virtual TQString formulaString() { return ""; } /** * Utility function that sets the size type and returns the size value from @@ -483,33 +483,33 @@ protected: * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ - double getSize( const QString& str, SizeType* st ); + double getSize( const TQString& str, SizeType* st ); - SizeType getSpace( const QString& str ); + SizeType getSpace( const TQString& str ); private: /** * Used internally by getSize() */ - double str2size( const QString& str, SizeType* st, uint index, SizeType type ); + double str2size( const TQString& str, SizeType* st, uint index, SizeType type ); /** - * Our parent. - * The parent might not be null except for the FormulaElement + * Our tqparent. + * The tqparent might not be null except for the FormulaElement * that is the top of the element tree. */ - BasicElement* parent; + BasicElement* tqparent; /** * This elements size. */ - //QSize size; + //TQSize size; luPixel m_width; luPixel m_height; /** - * Our position relative to our parent. + * Our position relative to our tqparent. */ //KoPoint position; luPixel m_x; @@ -521,7 +521,7 @@ private: * along this line. * * There are elements (like matrix) that don't have a base line. It is - * -1 in this case. The alignment is done using the middle line. + * -1 in this case. The tqalignment is done using the middle line. */ luPixel m_baseline; diff --git a/lib/kformula/bracketelement.cc b/lib/kformula/bracketelement.cc index 2e00af12..d95eac78 100644 --- a/lib/kformula/bracketelement.cc +++ b/lib/kformula/bracketelement.cc @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -35,8 +35,8 @@ KFORMULA_NAMESPACE_BEGIN -SingleContentElement::SingleContentElement(BasicElement* parent ) - : BasicElement( parent ) +SingleContentElement::SingleContentElement(BasicElement* tqparent ) + : BasicElement( tqparent ) { content = new SequenceElement( this ); } @@ -56,10 +56,10 @@ SingleContentElement::~SingleContentElement() } -QChar SingleContentElement::getCharacter() const +TQChar SingleContentElement::getCharacter() const { // This is meant to make the SingleContentElement text only. - // This "fixes" the parenthesis problem (parenthesis too large). + // This "fixes" the tqparenthesis problem (tqparenthesis too large). // I'm not sure if we really want this. There should be better ways. if ( content->isTextOnly() ) { return '\\'; @@ -68,12 +68,12 @@ QChar SingleContentElement::getCharacter() const } BasicElement* SingleContentElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -132,14 +132,14 @@ void SingleContentElement::moveDown(FormulaCursor* cursor, BasicElement* /*from* } void SingleContentElement::remove( FormulaCursor* cursor, - QPtrList& removedChildren, + TQPtrList& removedChildren, Direction direction ) { switch (cursor->getPos()) { case contentPos: - BasicElement* parent = getParent(); - parent->selectChild(cursor, this); - parent->remove(cursor, removedChildren, direction); + BasicElement* tqparent = getParent(); + tqparent->selectChild(cursor, this); + tqparent->remove(cursor, removedChildren, direction); } } @@ -165,18 +165,18 @@ void SingleContentElement::selectChild(FormulaCursor* cursor, BasicElement* chil } } -void SingleContentElement::writeDom(QDomElement element) +void SingleContentElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); } -bool SingleContentElement::readContentFromDom(QDomNode& node) +bool SingleContentElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -191,7 +191,7 @@ bool SingleContentElement::readContentFromDom(QDomNode& node) return true; } -int SingleContentElement::readContentFromMathMLDom( QDomNode& node ) +int SingleContentElement::readContentFromMathMLDom( TQDomNode& node ) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -206,15 +206,15 @@ int SingleContentElement::readContentFromMathMLDom( QDomNode& node ) return nodeCounter; } -void SingleContentElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void SingleContentElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { content->writeMathML( doc, element, oasisFormat ); } -BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* parent) - : SingleContentElement(parent), +BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* tqparent) + : SingleContentElement(tqparent), left( 0 ), right( 0 ), leftType( l ), rightType( r ), m_operator( false ), m_customLeft( false ), m_customRight( false ) @@ -252,12 +252,12 @@ void BracketElement::entered( SequenceElement* /*child*/ ) BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = getContent()->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -281,7 +281,7 @@ BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void BracketElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -303,28 +303,28 @@ void BracketElement::calcSizes( const ContextStyle& context, left->calcSizes(context, tstyle, factor); right->calcSizes(context, tstyle, factor); - setBaseline(QMAX(content->getBaseline(), - QMAX(left->getBaseline(), right->getBaseline()))); + setBaseline(TQMAX(content->getBaseline(), + TQMAX(left->getBaseline(), right->getBaseline()))); content->setY(getBaseline() - content->getBaseline()); left ->setY(getBaseline() - left ->getBaseline()); right ->setY(getBaseline() - right ->getBaseline()); //setMidline(content->getY() + content->getMidline()); - setHeight(QMAX(content->getY() + content->getHeight(), - QMAX(left ->getY() + left ->getHeight(), + setHeight(TQMAX(content->getY() + content->getHeight(), + TQMAX(left ->getY() + left ->getHeight(), right->getY() + right->getHeight()))); } else { //kdDebug( DEBUGID ) << "BracketElement::calcSizes " << content->axis( context, tstyle ) << " " << content->getHeight() << endl; - luPixel contentHeight = 2 * QMAX( content->axis( context, tstyle, factor ), + luPixel contentHeight = 2 * TQMAX( content->axis( context, tstyle, factor ), content->getHeight() - content->axis( context, tstyle, factor ) ); left->calcSizes( context, tstyle, factor, contentHeight ); right->calcSizes( context, tstyle, factor, contentHeight ); // height - setHeight(QMAX(contentHeight, - QMAX(left->getHeight(), right->getHeight()))); + setHeight(TQMAX(contentHeight, + TQMAX(left->getHeight(), right->getHeight()))); //setMidline(getHeight() / 2); content->setY(getHeight() / 2 - content->axis( context, tstyle, factor )); @@ -360,18 +360,18 @@ void BracketElement::calcSizes( const ContextStyle& context, /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void BracketElement::draw( QPainter& painter, const LuPixelRect& r, +void BracketElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -384,7 +384,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, } else { double factor = style.sizeFactor(); - luPixel contentHeight = 2 * QMAX(content->axis( context, tstyle, factor ), + luPixel contentHeight = 2 * TQMAX(content->axis( context, tstyle, factor ), content->getHeight() - content->axis( context, tstyle, factor )); left->draw(painter, r, context, tstyle, style, contentHeight, myPos); right->draw(painter, r, context, tstyle, style, contentHeight, myPos); @@ -392,16 +392,16 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, // Debug #if 0 - painter.setBrush( Qt::NoBrush ); - painter.setPen( Qt::red ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x()+left->getX() ), - context.layoutUnitToPixelY( myPos.y()+left->getY() ), - context.layoutUnitToPixelX( left->getWidth() ), - context.layoutUnitToPixelY( left->getHeight() ) ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x()+right->getX() ), - context.layoutUnitToPixelY( myPos.y()+right->getY() ), - context.layoutUnitToPixelX( right->getWidth() ), - context.layoutUnitToPixelY( right->getHeight() ) ); + painter.setBrush( TQt::NoBrush ); + painter.setPen( TQt::red ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+left->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+left->getY() ), + context.tqlayoutUnitToPixelX( left->getWidth() ), + context.tqlayoutUnitToPixelY( left->getHeight() ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+right->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+right->getY() ), + context.tqlayoutUnitToPixelX( right->getWidth() ), + context.tqlayoutUnitToPixelY( right->getHeight() ) ); #endif } @@ -409,7 +409,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, /** * Appends our attributes to the dom element. */ -void BracketElement::writeDom(QDomElement element) +void BracketElement::writeDom(TQDomElement element) { SingleContentElement::writeDom(element); element.setAttribute("LEFT", leftType); @@ -420,16 +420,16 @@ void BracketElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool BracketElement::readAttributesFromDom(QDomElement element) +bool BracketElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString leftStr = element.attribute("LEFT"); + TQString leftStr = element.attribute("LEFT"); if(!leftStr.isNull()) { leftType = static_cast(leftStr.toInt()); } - QString rightStr = element.attribute("RIGHT"); + TQString rightStr = element.attribute("RIGHT"); if(!rightStr.isNull()) { rightType = static_cast(rightStr.toInt()); } @@ -440,7 +440,7 @@ bool BracketElement::readAttributesFromDom(QDomElement element) * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) +bool BracketElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -453,7 +453,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) else { // mfenced, see attributes in section 3.3.8.2 leftType = LeftRoundBracket; rightType = RightRoundBracket; - QString openStr = element.attribute( "open" ).stripWhiteSpace(); + TQString openStr = element.attribute( "open" ).stripWhiteSpace(); if ( !openStr.isNull() ) { m_customLeft = true; if ( openStr == "[" ) @@ -479,7 +479,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) else // TODO: Check for entity references leftType = LeftRoundBracket; } - QString closeStr = element.attribute( "close" ).stripWhiteSpace(); + TQString closeStr = element.attribute( "close" ).stripWhiteSpace(); if ( !closeStr.isNull() ) { m_customRight = true; if ( closeStr == "[" ) @@ -515,14 +515,14 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -int BracketElement::readContentFromMathMLDom(QDomNode& node) +int BracketElement::readContentFromMathMLDom(TQDomNode& node) { bool empty = false; int nodeCounter = 0; if ( m_operator ) { - node = node.parentNode(); - QDomNode open = node; - QDomNode parent = node.parentNode(); + node = node.tqparentNode(); + TQDomNode open = node; + TQDomNode tqparent = node.tqparentNode(); if ( ! operatorType( node, true ) ) return -1; int nodeNum = searchOperator( node ); @@ -540,15 +540,15 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) else { // More than two elements inside, infer a mrow nodeCounter += nodeNum; kdWarning() << "NodeNum: " << nodeNum << endl; - QDomDocument doc = node.ownerDocument(); - QDomElement de = doc.createElement( "mrow" ); + TQDomDocument doc = node.ownerDocument(); + TQDomElement de = doc.createElement( "mrow" ); int i = 0; do { - QDomNode n = node.nextSibling(); + TQDomNode n = node.nextSibling(); de.appendChild( node.toElement() ); node = n; } while ( ++i < nodeNum ); - parent.insertAfter( de, open ); + tqparent.insertAfter( de, open ); node = de; kdWarning() << doc.toString() << endl; } @@ -558,22 +558,22 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) // See section 3.3.8 while ( ! node.isNull() && ! node.isElement() ) node = node.nextSibling(); - QDomNode next = node.nextSibling(); + TQDomNode next = node.nextSibling(); while ( ! next.isNull() && ! next.isElement() ) next = next.nextSibling(); if ( ! next.isNull()) { - QDomDocument doc = node.ownerDocument(); - QDomNode parent = node.parentNode(); - QString ns = parent.prefix(); - QDomElement de = doc.createElementNS( ns, "mrow" ); + TQDomDocument doc = node.ownerDocument(); + TQDomNode tqparent = node.tqparentNode(); + TQString ns = tqparent.prefix(); + TQDomElement de = doc.createElementNS( ns, "mrow" ); uint pos = 0; while ( ! node.isNull() ) { - QDomNode no = node.nextSibling(); + TQDomNode no = node.nextSibling(); while ( ! no.isNull() && ! no.isElement() ) no = no.nextSibling(); de.appendChild( node.toElement() ); if ( ! no.isNull() && ( m_separators.isNull() || ! m_separators.isEmpty() ) ) { - QDomElement sep = doc.createElementNS( ns, "mo" ); + TQDomElement sep = doc.createElementNS( ns, "mo" ); de.appendChild( sep ); if ( m_separators.isNull() ) { sep.appendChild( doc.createTextNode( "," ) ); @@ -582,7 +582,7 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) if ( m_separators.at( pos ).isSpace() ) { pos++; } - sep.appendChild( doc.createTextNode( QString ( m_separators.at( pos ) ) ) ); + sep.appendChild( doc.createTextNode( TQString ( m_separators.at( pos ) ) ) ); } if ( pos < m_separators.length() - 1 ) { pos++; @@ -590,8 +590,8 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) } node = no; } - parent.appendChild( de ); - node = parent.firstChild(); + tqparent.appendChild( de ); + node = tqparent.firstChild(); while ( ! node.isElement() ) node = node.nextSibling(); } @@ -619,9 +619,9 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) return nodeCounter; } -QString BracketElement::toLatex() +TQString BracketElement::toLatex() { - QString ls,rs,cs; + TQString ls,rs,cs; cs=getContent()->toLatex(); ls="\\left"+latexString(leftType) + " "; rs=" \\right"+latexString(rightType); @@ -629,7 +629,7 @@ QString BracketElement::toLatex() return ls+cs+rs; } -QString BracketElement::latexString(char type) +TQString BracketElement::latexString(char type) { switch (type) { case ']': @@ -658,12 +658,12 @@ QString BracketElement::latexString(char type) return "."; } -QString BracketElement::formulaString() +TQString BracketElement::formulaString() { return "(" + getContent()->formulaString() + ")"; } -int BracketElement::operatorType( QDomNode& node, bool open ) +int BracketElement::operatorType( TQDomNode& node, bool open ) { int counter = 1; SymbolType* type = open ? &leftType : &rightType; @@ -672,11 +672,11 @@ int BracketElement::operatorType( QDomNode& node, bool open ) counter++; } if ( node.isElement() ) { - QDomElement e = node.toElement(); - QDomNode child = e.firstChild(); + TQDomElement e = node.toElement(); + TQDomNode child = e.firstChild(); if ( child.isEntityReference() ) { kdWarning() << "Entity Reference\n"; - QString name = node.nodeName(); + TQString name = node.nodeName(); // TODO: To fully support these, SymbolType has to be extended, // and better Unicode support is a must // CloseCurlyDoubleQuote 0x201D @@ -704,10 +704,10 @@ int BracketElement::operatorType( QDomNode& node, bool open ) } } else { - QString s = e.text(); + TQString s = e.text(); if ( s.isNull() ) return -1; - *type = static_cast( QString::number( s.at( 0 ).latin1() ).toInt() ); + *type = static_cast( TQString::number( s.tqat( 0 ).latin1() ).toInt() ); } } else { @@ -716,21 +716,21 @@ int BracketElement::operatorType( QDomNode& node, bool open ) return counter; } -int BracketElement::searchOperator( const QDomNode& node ) +int BracketElement::searchOperator( const TQDomNode& node ) { - QDomNode n = node; + TQDomNode n = node; for ( int i = -2; ! n.isNull(); n = n.nextSibling() ) { if ( n.isElement() ) { i++; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() == "mo" ) { // Try to guess looking at attributes - QString form = e.attribute( "form" ); - QString f; + TQString form = e.attribute( "form" ); + TQString f; if ( ! form.isNull() ) { f = form.stripWhiteSpace().lower(); } - QString fence = e.attribute( "fence" ); + TQString fence = e.attribute( "fence" ); if ( ! fence.isNull() ) { if ( fence.stripWhiteSpace().lower() == "false" ) { continue; @@ -746,8 +746,8 @@ int BracketElement::searchOperator( const QDomNode& node ) } // Guess looking at contents - QDomNode child = e.firstChild(); - QString name; + TQDomNode child = e.firstChild(); + TQString name; if ( child.isText() ) name = child.toText().data().stripWhiteSpace(); else if ( child.isEntityReference() ) @@ -784,21 +784,21 @@ int BracketElement::searchOperator( const QDomNode& node ) } -void BracketElement::writeMathMLAttributes( QDomElement& element ) const +void BracketElement::writeMathMLAttributes( TQDomElement& element ) const { if ( left->getType() != LeftRoundBracket || right->getType() != RightRoundBracket ) { - element.setAttribute( "open", QString( QChar( leftType ) ) ); - element.setAttribute( "close", QString( QChar( rightType ) ) ); + element.setAttribute( "open", TQString( TQChar( leftType ) ) ); + element.setAttribute( "close", TQString( TQChar( rightType ) ) ); } if ( ! m_separators.isNull() ) { element.setAttribute( "separators", m_separators ); } } -OverlineElement::OverlineElement( BasicElement* parent ) - : SingleContentElement( parent ) +OverlineElement::OverlineElement( BasicElement* tqparent ) + : SingleContentElement( tqparent ) { } @@ -845,14 +845,14 @@ void OverlineElement::calcSizes( const ContextStyle& context, setBaseline(content->getBaseline() + content->getY()); } -void OverlineElement::draw( QPainter& painter, const LuPixelRect& r, +void OverlineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -867,40 +867,40 @@ void OverlineElement::draw( QPainter& painter, const LuPixelRect& r, luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); //luPixel unit = (content->getHeight() + distY)/ 3; - painter.setPen( QPen( context.getDefaultColor(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + painter.setPen( TQPen( context.getDefaultColor(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+content->getWidth() ), - context.layoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+distY/3 ) ); } -QString OverlineElement::toLatex() +TQString OverlineElement::toLatex() { return "\\overline{" + getContent()->toLatex() + "}"; } -QString OverlineElement::formulaString() +TQString OverlineElement::formulaString() { return getContent()->formulaString(); } -void OverlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void OverlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" ); + TQDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" ); SingleContentElement::writeMathML( doc, de, oasisFormat ); - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); // is this the right entity? Mozilla renders it correctly. op.appendChild( doc.createEntityReference( "OverBar" ) ); de.appendChild( op ); - parent.appendChild( de ); + tqparent.appendChild( de ); } -UnderlineElement::UnderlineElement( BasicElement* parent ) - : SingleContentElement( parent ) +UnderlineElement::UnderlineElement( BasicElement* tqparent ) + : SingleContentElement( tqparent ) { } @@ -949,14 +949,14 @@ void UnderlineElement::calcSizes( const ContextStyle& context, setBaseline(content->getBaseline() + content->getY()); } -void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r, +void UnderlineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -971,35 +971,35 @@ void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r, //luPixel unit = (content->getHeight() + distY)/ 3; double factor = style.sizeFactor(); - painter.setPen( QPen( context.getDefaultColor(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + painter.setPen( TQPen( context.getDefaultColor(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), - context.layoutUnitToPixelX( x+content->getWidth() ), - context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), + context.tqlayoutUnitToPixelX( x+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); } -QString UnderlineElement::toLatex() +TQString UnderlineElement::toLatex() { return "\\underline{" + getContent()->toLatex() + "}"; } -QString UnderlineElement::formulaString() +TQString UnderlineElement::formulaString() { return getContent()->formulaString(); } -void UnderlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void UnderlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" ); + TQDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" ); SingleContentElement::writeMathML( doc, de, oasisFormat ); - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); // is this the right entity? Mozilla renders it correctly. op.appendChild( doc.createEntityReference( "UnderBar" ) ); de.appendChild( op ); - parent.appendChild( de ); + tqparent.appendChild( de ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/bracketelement.h b/lib/kformula/bracketelement.h index a929c04b..98f515a1 100644 --- a/lib/kformula/bracketelement.h +++ b/lib/kformula/bracketelement.h @@ -21,8 +21,8 @@ #ifndef BRACKETELEMENT_H #define BRACKETELEMENT_H -#include -#include +#include +#include #include "basicelement.h" @@ -40,7 +40,7 @@ class SingleContentElement : public BasicElement { SingleContentElement& operator=( const SingleContentElement& ) { return *this; } public: - SingleContentElement(BasicElement* parent = 0); + SingleContentElement(BasicElement* tqparent = 0); ~SingleContentElement(); SingleContentElement( const SingleContentElement& ); @@ -48,9 +48,9 @@ public: /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const; + virtual TQChar getCharacter() const; /** * Sets the cursor and returns the element the point is in. @@ -59,10 +59,10 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -95,12 +95,12 @@ public: virtual void moveDown(FormulaCursor* cursor, BasicElement* from); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ - virtual void remove(FormulaCursor*, QPtrList&, Direction); + virtual void remove(FormulaCursor*, TQPtrList&, Direction); /** * Moves the cursor to a normal place where new elements @@ -110,7 +110,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); @@ -125,24 +125,24 @@ protected: /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const; /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); SequenceElement* getContent() { return content; } @@ -166,7 +166,7 @@ public: enum { contentPos }; BracketElement(SymbolType left = EmptyBracket, SymbolType right = EmptyBracket, - BasicElement* parent = 0); + BasicElement* tqparent = 0); ~BracketElement(); BracketElement( const BracketElement& ); @@ -196,11 +196,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -208,16 +208,16 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); protected: @@ -226,23 +226,23 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "BRACKET"; } + virtual TQString getTagName() const { return "BRACKET"; } /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const { return "mfenced"; } - virtual void writeMathMLAttributes( QDomElement& element ) const; + virtual TQString getElementName() const { return "mfenced"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const; /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node @@ -250,35 +250,35 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); private: /** * @return a LaTex string for the given symbol */ - QString latexString(char); + TQString latexString(char); /** * Set left and right types in operator fences * @param open if true set SymbolType for open (left) bracket, * otherwise set for close (right) bracket. */ - int operatorType( QDomNode& node, bool open ); + int operatorType( TQDomNode& node, bool open ); /** * Search through the nodes to find the close operator to match current * open bracket. */ - int searchOperator( const QDomNode& node ); + int searchOperator( const TQDomNode& node ); /** * The brackets we are showing. @@ -289,7 +289,7 @@ private: SymbolType leftType; SymbolType rightType; - QString m_separators; + TQString m_separators; bool m_operator; bool m_customLeft; bool m_customRight; @@ -303,7 +303,7 @@ class OverlineElement : public SingleContentElement { OverlineElement& operator=( const OverlineElement& ) { return *this; } public: - OverlineElement(BasicElement* parent = 0); + OverlineElement(BasicElement* tqparent = 0); ~OverlineElement(); OverlineElement( const OverlineElement& ); @@ -322,7 +322,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -330,26 +330,26 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const; protected: @@ -358,7 +358,7 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "OVERLINE"; } + virtual TQString getTagName() const { return "OVERLINE"; } private: }; @@ -370,7 +370,7 @@ private: class UnderlineElement : public SingleContentElement { UnderlineElement& operator=( const UnderlineElement& ) { return *this; } public: - UnderlineElement(BasicElement* parent = 0); + UnderlineElement(BasicElement* tqparent = 0); ~UnderlineElement(); UnderlineElement( const UnderlineElement& ); @@ -389,7 +389,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -397,26 +397,26 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const; protected: @@ -425,7 +425,7 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "UNDERLINE"; } + virtual TQString getTagName() const { return "UNDERLINE"; } private: }; diff --git a/lib/kformula/config/esstixeight.font b/lib/kformula/config/esstixeight.font index 37cbdfdb..88992333 100644 --- a/lib/kformula/config/esstixeight.font +++ b/lib/kformula/config/esstixeight.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixeight font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 33, 0xE201 37, 0xE205 diff --git a/lib/kformula/config/esstixeleven.font b/lib/kformula/config/esstixeleven.font index d94bd375..41e9fbe1 100644 --- a/lib/kformula/config/esstixeleven.font +++ b/lib/kformula/config/esstixeleven.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixeleven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixfifteen.font b/lib/kformula/config/esstixfifteen.font index 3df00e54..920be0c1 100644 --- a/lib/kformula/config/esstixfifteen.font +++ b/lib/kformula/config/esstixfifteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixfifteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixfive.font b/lib/kformula/config/esstixfive.font index 9f57fec2..62724a84 100644 --- a/lib/kformula/config/esstixfive.font +++ b/lib/kformula/config/esstixfive.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfive font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 52, 0x2295 53, 0x2297 diff --git a/lib/kformula/config/esstixfour.font b/lib/kformula/config/esstixfour.font index dc6844b9..411a138a 100644 --- a/lib/kformula/config/esstixfour.font +++ b/lib/kformula/config/esstixfour.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfour font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 56, 0x2291 77, 0x2290 diff --git a/lib/kformula/config/esstixfourteen.font b/lib/kformula/config/esstixfourteen.font index 802c47ec..723a4094 100644 --- a/lib/kformula/config/esstixfourteen.font +++ b/lib/kformula/config/esstixfourteen.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfourteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 99, 0x2138 97, 0x2135 diff --git a/lib/kformula/config/esstixnine.font b/lib/kformula/config/esstixnine.font index 4f4e6197..e294bd6d 100644 --- a/lib/kformula/config/esstixnine.font +++ b/lib/kformula/config/esstixnine.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixnine font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixone.font b/lib/kformula/config/esstixone.font index 9ff6cabf..df3e95ec 100644 --- a/lib/kformula/config/esstixone.font +++ b/lib/kformula/config/esstixone.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixone font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 75, 0x219B 70, 0x219A diff --git a/lib/kformula/config/esstixseven.font b/lib/kformula/config/esstixseven.font index 25a7d01c..37650ee1 100644 --- a/lib/kformula/config/esstixseven.font +++ b/lib/kformula/config/esstixseven.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixseven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 61, 0x0028 62, 0x0029 diff --git a/lib/kformula/config/esstixseventeen.font b/lib/kformula/config/esstixseventeen.font index c3b8f311..00df77cd 100644 --- a/lib/kformula/config/esstixseventeen.font +++ b/lib/kformula/config/esstixseventeen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixseventeen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixsix.font b/lib/kformula/config/esstixsix.font index a6412a58..43e2752c 100644 --- a/lib/kformula/config/esstixsix.font +++ b/lib/kformula/config/esstixsix.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixsix font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 46, 0x220F 35, 0x222E diff --git a/lib/kformula/config/esstixsixteen.font b/lib/kformula/config/esstixsixteen.font index c212e08d..2a96c0c1 100644 --- a/lib/kformula/config/esstixsixteen.font +++ b/lib/kformula/config/esstixsixteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixsixteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixten.font b/lib/kformula/config/esstixten.font index dd4c2b0f..fa9c5ee2 100644 --- a/lib/kformula/config/esstixten.font +++ b/lib/kformula/config/esstixten.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixten font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 118, 0x2202 86, 0x2207 diff --git a/lib/kformula/config/esstixthirteen.font b/lib/kformula/config/esstixthirteen.font index fc13f891..cee5bf99 100644 --- a/lib/kformula/config/esstixthirteen.font +++ b/lib/kformula/config/esstixthirteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixthirteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixthree.font b/lib/kformula/config/esstixthree.font index c55acaeb..fe359c1f 100644 --- a/lib/kformula/config/esstixthree.font +++ b/lib/kformula/config/esstixthree.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixthree font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 101, 0x2204 95, 0x227B diff --git a/lib/kformula/config/esstixtwelve.font b/lib/kformula/config/esstixtwelve.font index b82e5d7f..3a4b9d23 100644 --- a/lib/kformula/config/esstixtwelve.font +++ b/lib/kformula/config/esstixtwelve.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixtwelve font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixtwo.font b/lib/kformula/config/esstixtwo.font index ed83909f..201f95e1 100644 --- a/lib/kformula/config/esstixtwo.font +++ b/lib/kformula/config/esstixtwo.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixtwo font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 100, 0x2203 99, 0x2200 diff --git a/lib/kformula/config/unicode.tbl b/lib/kformula/config/unicode.tbl index e3e27db8..d86b1df3 100644 --- a/lib/kformula/config/unicode.tbl +++ b/lib/kformula/config/unicode.tbl @@ -1,6 +1,6 @@ # -# KFormula unicode table -# Each line contains the unicode value, the char class +# KFormula tqunicode table +# Each line contains the tqunicode value, the char class # (ORDINARY, BINOP or RELATION) and optionally the # chars TeX name. # diff --git a/lib/kformula/contextstyle.cc b/lib/kformula/contextstyle.cc index 61e290f4..f358b62c 100644 --- a/lib/kformula/contextstyle.cc +++ b/lib/kformula/contextstyle.cc @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -34,9 +34,9 @@ KFORMULA_NAMESPACE_BEGIN ContextStyle::ContextStyle() : symbolFont( "Symbol" ), - defaultColor(Qt::black), numberColor(Qt::blue), - operatorColor(Qt::darkGreen), errorColor(Qt::darkRed), - emptyColor(Qt::blue), helpColor( Qt::gray ), m_sizeFactor( 0 ) + defaultColor(TQt::black), numberColor(TQt::blue), + operatorColor(TQt::darkGreen), errorColor(TQt::darkRed), + emptyColor(TQt::blue), helpColor( TQt::gray ), m_sizeFactor( 0 ) { // kdDebug() << "ContextStyle::ContextStyle" << endl // << "defaultFont: " << defaultFont.rawName() << endl @@ -74,7 +74,7 @@ void ContextStyle::init( bool init ) } -void ContextStyle::setFontStyle( const QString& fontStyle, bool init ) +void ContextStyle::setFontStyle( const TQString& fontStyle, bool init ) { delete m_fontStyle; m_fontStyleName = fontStyle; @@ -92,7 +92,7 @@ const SymbolTable& ContextStyle::symbolTable() const void ContextStyle::readConfig( KConfig* config, bool init ) { config->setGroup( "kformula Font" ); - QString fontName = config->readEntry( "defaultFont", "Times,12,-1,5,50,1,0,0,0,0" ); + TQString fontName = config->readEntry( "defaultFont", "Times,12,-1,5,50,1,0,0,0,0" ); defaultFont.fromString( fontName ); fontName = config->readEntry( "nameFont", "Times,12,-1,5,50,0,0,0,0,0" ); nameFont.fromString( fontName ); @@ -100,7 +100,7 @@ void ContextStyle::readConfig( KConfig* config, bool init ) numberFont.fromString( fontName ); fontName = config->readEntry( "operatorFont", "Times,12,-1,5,50,0,0,0,0,0" ); operatorFont.fromString( fontName ); - QString baseSize = config->readEntry( "baseSize", "20" ); + TQString baseSize = config->readEntry( "baseSize", "20" ); m_baseSize = baseSize.toInt(); if ( ! FontStyle::missingFonts( init ).isEmpty() ) { @@ -136,7 +136,7 @@ bool ContextStyle::setZoomAndResolution( int zoom, double zoomX, double zoomY, b return changes; } -QColor ContextStyle::getNumberColor() const +TQColor ContextStyle::getNumberColor() const { if ( edit() && syntaxHighlighting() ) { return numberColor; @@ -144,7 +144,7 @@ QColor ContextStyle::getNumberColor() const return getDefaultColor(); } -QColor ContextStyle::getOperatorColor() const +TQColor ContextStyle::getOperatorColor() const { if ( edit() && syntaxHighlighting() ) { return operatorColor; @@ -152,7 +152,7 @@ QColor ContextStyle::getOperatorColor() const return getDefaultColor(); } -QColor ContextStyle::getErrorColor() const +TQColor ContextStyle::getErrorColor() const { if ( edit() && syntaxHighlighting() ) { return errorColor; @@ -160,7 +160,7 @@ QColor ContextStyle::getErrorColor() const return getDefaultColor(); } -QColor ContextStyle::getEmptyColor() const +TQColor ContextStyle::getEmptyColor() const { if ( edit() && syntaxHighlighting() ) { return emptyColor; @@ -168,7 +168,7 @@ QColor ContextStyle::getEmptyColor() const return getDefaultColor(); } -QColor ContextStyle::getHelpColor() const +TQColor ContextStyle::getHelpColor() const { if ( edit() && syntaxHighlighting() ) { return helpColor; @@ -176,38 +176,38 @@ QColor ContextStyle::getHelpColor() const return getDefaultColor(); } -void ContextStyle::setDefaultColor( const QColor& color ) +void ContextStyle::setDefaultColor( const TQColor& color ) { defaultColor = color; } -void ContextStyle::setNumberColor( const QColor& color ) +void ContextStyle::setNumberColor( const TQColor& color ) { numberColor = color; } -void ContextStyle::setOperatorColor( const QColor& color ) +void ContextStyle::setOperatorColor( const TQColor& color ) { operatorColor = color; } -void ContextStyle::setErrorColor( const QColor& color ) +void ContextStyle::setErrorColor( const TQColor& color ) { errorColor = color; } -void ContextStyle::setEmptyColor( const QColor& color ) +void ContextStyle::setEmptyColor( const TQColor& color ) { emptyColor = color; } -void ContextStyle::setHelpColor( const QColor& color ) +void ContextStyle::setHelpColor( const TQColor& color ) { helpColor = color; } #if 0 -const QStringList& ContextStyle::requestedFonts() const +const TQStringList& ContextStyle::requestedFonts() const { return m_requestedFonts; } -void ContextStyle::setRequestedFonts( const QStringList& list ) +void ContextStyle::setRequestedFonts( const TQStringList& list ) { m_requestedFonts = list; //table.init( this ); @@ -221,7 +221,7 @@ double ContextStyle::getReductionFactor( TextStyle tstyle ) const luPt ContextStyle::getAdjustedSize( TextStyle tstyle, double factor ) const { - return qRound( ptToLayoutUnitPt( m_sizeFactor + return tqRound( ptToLayoutUnitPt( m_sizeFactor * m_baseSize * getReductionFactor( tstyle ) * factor @@ -235,7 +235,7 @@ luPixel ContextStyle::getSpace( TextStyle tstyle, SpaceWidth space, double facto case THIN: return getThinSpace( tstyle, factor ); case MEDIUM: return getMediumSpace( tstyle, factor ); case THICK: return getThickSpace( tstyle, factor ); - case QUAD: return getQuadSpace( tstyle, factor ); + case TQUAD: return getQuadSpace( tstyle, factor ); } return 0; } @@ -360,16 +360,16 @@ ContextStyle::TextStyle ContextStyle::convertTextStyleIndex( TextStyle tstyle ) void ContextStyle::setup() { luPt size = static_cast( m_baseSize ); - QFont font = symbolFont; + TQFont font = symbolFont; font.setPointSize( size ); - QFontMetrics fm( font ); + TQFontMetrics fm( font ); // Or better the real space required? ( boundingRect ) quad = ptToLayoutUnitPt( fm.width( 'M' ) ); - font = QFont(defaultFont); + font = TQFont(defaultFont); font.setPointSize( size ); - QFontMetrics fm2( font ); + TQFontMetrics fm2( font ); //m_axisHeight = ptToLayoutUnitPt( fm2.strikeOutPos() ); //ptToLayoutUnitPixY //m_axisHeight = ptToLayoutUnitPt( pixelYToPt( fm2.strikeOutPos() ) ); @@ -412,29 +412,29 @@ CharFamily StyleAttributes::charFamily() const return m_charFamily.top(); } -QColor StyleAttributes::color() const +TQColor StyleAttributes::color() const { if ( m_color.empty() ) { // kdWarning( DEBUGID ) << "Color stack is empty.\n"; - return QColor( Qt::black ); + return TQColor( TQt::black ); //return getDefaultColor(); } return m_color.top(); } -QColor StyleAttributes::background() const +TQColor StyleAttributes::background() const { if ( m_background.empty() ) { // kdWarning( DEBUGID ) << "Background stack is empty.\n"; - return QColor( Qt::color0 ); + return TQColor( TQt::color0 ); } return m_background.top(); } -QFont StyleAttributes::font() const +TQFont StyleAttributes::font() const { if ( m_font.empty() ) { - return QFont(); + return TQFont(); } return m_font.top(); } diff --git a/lib/kformula/contextstyle.h b/lib/kformula/contextstyle.h index 811c580a..be4a8bcf 100644 --- a/lib/kformula/contextstyle.h +++ b/lib/kformula/contextstyle.h @@ -21,12 +21,12 @@ #ifndef CONTEXTSTYLE_H #define CONTEXTSTYLE_H -//Qt Include -#include -#include -#include -#include -#include +//TQt Include +#include +#include +#include +#include +#include //KDE Include #include @@ -117,45 +117,45 @@ public: bool syntaxHighlighting() const { return m_syntaxHighlighting; } void setSyntaxHighlighting( bool highlight ) { m_syntaxHighlighting = highlight; } - QColor getDefaultColor() const { return defaultColor; } - QColor getNumberColorPlain() const { return numberColor; } - QColor getOperatorColorPlain() const { return operatorColor; } - QColor getErrorColorPlain() const { return errorColor; } - QColor getEmptyColorPlain() const { return emptyColor; } - QColor getHelpColorPlain() const { return helpColor; } - QColor getNumberColor() const; - QColor getOperatorColor() const; - QColor getErrorColor() const; - QColor getEmptyColor() const; - QColor getHelpColor() const; - - void setDefaultColor( const QColor& ); - void setNumberColor( const QColor& ); - void setOperatorColor( const QColor& ); - void setErrorColor( const QColor& ); - void setEmptyColor( const QColor& ); - void setHelpColor( const QColor& ); - - QString getFontStyle() const { return m_fontStyleName; } - void setFontStyle( const QString& fontStyle, bool init = true ); - - QFont getMathFont() const { return mathFont; } - QFont getBracketFont() const { return bracketFont; } - QFont getDefaultFont() const { return defaultFont; } - QFont getNameFont() const { return nameFont; } - QFont getNumberFont() const { return numberFont; } - QFont getOperatorFont() const { return operatorFont; } - QFont getSymbolFont() const { return symbolFont; } - - void setMathFont( QFont f ) { defaultFont = f; } - void setBracketFont( QFont f ) { bracketFont = f; } - void setDefaultFont( QFont f ) { defaultFont = f; } - void setNameFont( QFont f ) { nameFont = f; } - void setNumberFont( QFont f ) { numberFont = f; } - void setOperatorFont( QFont f ) { operatorFont = f; } - - //const QStringList& requestedFonts() const; - //void setRequestedFonts( const QStringList& list ); + TQColor getDefaultColor() const { return defaultColor; } + TQColor getNumberColorPlain() const { return numberColor; } + TQColor getOperatorColorPlain() const { return operatorColor; } + TQColor getErrorColorPlain() const { return errorColor; } + TQColor getEmptyColorPlain() const { return emptyColor; } + TQColor getHelpColorPlain() const { return helpColor; } + TQColor getNumberColor() const; + TQColor getOperatorColor() const; + TQColor getErrorColor() const; + TQColor getEmptyColor() const; + TQColor getHelpColor() const; + + void setDefaultColor( const TQColor& ); + void setNumberColor( const TQColor& ); + void setOperatorColor( const TQColor& ); + void setErrorColor( const TQColor& ); + void setEmptyColor( const TQColor& ); + void setHelpColor( const TQColor& ); + + TQString getFontStyle() const { return m_fontStyleName; } + void setFontStyle( const TQString& fontStyle, bool init = true ); + + TQFont getMathFont() const { return mathFont; } + TQFont getBracketFont() const { return bracketFont; } + TQFont getDefaultFont() const { return defaultFont; } + TQFont getNameFont() const { return nameFont; } + TQFont getNumberFont() const { return numberFont; } + TQFont getOperatorFont() const { return operatorFont; } + TQFont getSymbolFont() const { return symbolFont; } + + void setMathFont( TQFont f ) { defaultFont = f; } + void setBracketFont( TQFont f ) { bracketFont = f; } + void setDefaultFont( TQFont f ) { defaultFont = f; } + void setNameFont( TQFont f ) { nameFont = f; } + void setNumberFont( TQFont f ) { numberFont = f; } + void setOperatorFont( TQFont f ) { operatorFont = f; } + + //const TQStringList& requestedFonts() const; + //void setRequestedFonts( const TQStringList& list ); double getReductionFactor( TextStyle tstyle ) const; @@ -256,22 +256,22 @@ private: TextStyleValues textStyleValues[ 4 ]; - QFont mathFont; - QFont bracketFont; - QFont defaultFont; - QFont nameFont; - QFont numberFont; - QFont operatorFont; - QFont symbolFont; + TQFont mathFont; + TQFont bracketFont; + TQFont defaultFont; + TQFont nameFont; + TQFont numberFont; + TQFont operatorFont; + TQFont symbolFont; - //QStringList m_requestedFonts; + //TQStringList m_requestedFonts; - QColor defaultColor; - QColor numberColor; - QColor operatorColor; - QColor errorColor; - QColor emptyColor; - QColor helpColor; + TQColor defaultColor; + TQColor numberColor; + TQColor operatorColor; + TQColor errorColor; + TQColor emptyColor; + TQColor helpColor; /** * The cursors movement style. You need to notify each cursor @@ -312,7 +312,7 @@ private: /** * true means to center the symbol between its indexes. - * false means alignment to the right. + * false means tqalignment to the right. */ bool centerSymbol; @@ -332,7 +332,7 @@ private: //SymbolTable table; FontStyle* m_fontStyle; - QString m_fontStyleName; + TQString m_fontStyleName; }; // Section 3.3.4.2, default values @@ -352,9 +352,9 @@ class StyleAttributes { bool customMathVariant() const ; CharStyle charStyle() const ; CharFamily charFamily() const ; - QColor color() const ; - QColor background() const ; - QFont font() const ; + TQColor color() const ; + TQColor background() const ; + TQFont font() const ; bool fontWeight() const ; bool customFontWeight() const ; bool fontStyle() const ; @@ -380,9 +380,9 @@ class StyleAttributes { void setCustomMathVariant( bool cmv ) { m_customMathVariant.push( cmv ); } void setCharStyle( CharStyle cs ) { m_charStyle.push( cs ); } void setCharFamily( CharFamily cf ) { m_charFamily.push( cf ); } - void setColor( const QColor& c ) { m_color.push( c ); } - void setBackground( const QColor& bg ) { m_background.push( bg ); } - void setFont( const QFont& f ) { m_font.push( f ); } + void setColor( const TQColor& c ) { m_color.push( c ); } + void setBackground( const TQColor& bg ) { m_background.push( bg ); } + void setFont( const TQFont& f ) { m_font.push( f ); } void setCustomFont( bool cf ) { m_customFontFamily.push ( cf ); } void setCustomFontWeight( bool cfw ) { m_customFontWeight.push( cfw ); } void setFontWeight( bool fw ) { m_fontWeight.push( fw ); } @@ -426,53 +426,53 @@ class StyleAttributes { private: // Size of the font in points (mathsize / fontsize) - QValueStack m_size; + TQValueStack m_size; // Whether a custom mathvariant attribute is in use - QValueStack m_customMathVariant; + TQValueStack m_customMathVariant; // Font style (mathvariant, fontweight, fontstyle) - QValueStack m_charStyle; + TQValueStack m_charStyle; // Font family (mathvariant) - QValueStack m_charFamily; + TQValueStack m_charFamily; // Foreground color (mathcolor, color) - QValueStack m_color; + TQValueStack m_color; // Background color (mathbackground) - QValueStack m_background; + TQValueStack m_background; // Font family (fontfamily) - QValueStack m_font; + TQValueStack m_font; // Whether a custom fontfamily attribute is in use (instead of CharFamily) - QValueStack m_customFontFamily; + TQValueStack m_customFontFamily; // Font Weight (fontweight) - QValueStack m_fontWeight; + TQValueStack m_fontWeight; // Whether a custom fontweight attribute is in use - QValueStack m_customFontWeight; + TQValueStack m_customFontWeight; // Font Style (fontstyle) - QValueStack m_fontStyle; + TQValueStack m_fontStyle; // Whether a custom fontstyle attribute is in use - QValueStack m_customFontStyle; - - QValueStack m_scriptLevel; - QValueStack m_scriptSizeMultiplier; - QValueStack m_scriptMinSize; - QValueStack m_veryVeryThinMathSpace; - QValueStack m_veryThinMathSpace; - QValueStack m_thinMathSpace; - QValueStack m_mediumMathSpace; - QValueStack m_thickMathSpace; - QValueStack m_veryThickMathSpace; - QValueStack m_veryVeryThickMathSpace; - QValueStack m_displayStyle; - QValueStack m_customDisplayStyle; + TQValueStack m_customFontStyle; + + TQValueStack m_scriptLevel; + TQValueStack m_scriptSizeMultiplier; + TQValueStack m_scriptMinSize; + TQValueStack m_veryVeryThinMathSpace; + TQValueStack m_veryThinMathSpace; + TQValueStack m_thinMathSpace; + TQValueStack m_mediumMathSpace; + TQValueStack m_thickMathSpace; + TQValueStack m_veryThickMathSpace; + TQValueStack m_veryVeryThickMathSpace; + TQValueStack m_displayStyle; + TQValueStack m_customDisplayStyle; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/creationstrategy.cc b/lib/kformula/creationstrategy.cc index 2a1a8aa1..592c744b 100644 --- a/lib/kformula/creationstrategy.cc +++ b/lib/kformula/creationstrategy.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include "bracketelement.h" #include "creationstrategy.h" @@ -36,7 +36,7 @@ KFORMULA_NAMESPACE_BEGIN -BasicElement* OrdinaryCreationStrategy::createElement( QString type, const QDomElement& ) +BasicElement* OrdinaryCreationStrategy::createElement( TQString type, const TQDomElement& ) { if ( type == "TEXT" ) return new TextElement(); else if ( type == "EMPTY" ) return new EmptyElement(); @@ -59,7 +59,7 @@ BasicElement* OrdinaryCreationStrategy::createElement( QString type, const QDomE } -TextElement* OrdinaryCreationStrategy::createTextElement( const QChar& ch, bool symbol ) +TextElement* OrdinaryCreationStrategy::createTextElement( const TQChar& ch, bool symbol ) { return new TextElement( ch, symbol ); } diff --git a/lib/kformula/creationstrategy.h b/lib/kformula/creationstrategy.h index c6599eed..a20322bd 100644 --- a/lib/kformula/creationstrategy.h +++ b/lib/kformula/creationstrategy.h @@ -22,8 +22,8 @@ #define CREATIONSTRATEGY_H -#include -#include +#include +#include #include "kformuladefs.h" @@ -55,10 +55,10 @@ class ElementCreationStrategy { public: virtual ~ElementCreationStrategy() {} - virtual BasicElement* createElement( QString type, const QDomElement& element ) = 0; + virtual BasicElement* createElement( TQString type, const TQDomElement& element ) = 0; /// there must always be a TextElement, so this can never return 0 - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ) = 0; + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ) = 0; /// when this gets called the user has seen the matrix dialog and expects a matrix! virtual MatrixElement* createMatrixElement( uint rows, uint columns ) = 0; @@ -77,7 +77,7 @@ public: virtual IdentifierElement* createIdentifierElement() = 0; virtual OperatorElement* createOperatorElement() = 0; virtual NumberElement* createNumberElement() = 0; - virtual QString type() const = 0; + virtual TQString type() const = 0; }; @@ -86,9 +86,9 @@ public: */ class OrdinaryCreationStrategy : public ElementCreationStrategy { public: - virtual BasicElement* createElement( QString type, const QDomElement& element = 0 ); + virtual BasicElement* createElement( TQString type, const TQDomElement& element = 0 ); - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ); + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ); virtual EmptyElement* createEmptyElement(); virtual NameSequence* createNameSequence(); virtual BracketElement* createBracketElement( SymbolType lhs, SymbolType rhs ); @@ -104,7 +104,7 @@ public: virtual IdentifierElement* createIdentifierElement(); virtual OperatorElement* createOperatorElement(); virtual NumberElement* createNumberElement(); - virtual QString type() const { return "Ordinary"; } + virtual TQString type() const { return "Ordinary"; } }; diff --git a/lib/kformula/elementtype.cc b/lib/kformula/elementtype.cc index 94ec0162..a2e44ee6 100644 --- a/lib/kformula/elementtype.cc +++ b/lib/kformula/elementtype.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include @@ -40,9 +40,9 @@ int ElementType::evilDestructionCount = 0; * Converts CharStyle and CharFamily to the MathML 'mathvariant' * attribute (see MathML spec 3.2.2). */ -QString format2variant( CharStyle style, CharFamily family ) +TQString format2variant( CharStyle style, CharFamily family ) { - QString result; + TQString result; switch( family ) { case normalFamily: @@ -90,9 +90,9 @@ ElementType::~ElementType() } -QString ElementType::text( SequenceElement* seq ) const +TQString ElementType::text( SequenceElement* seq ) const { - QString str; + TQString str; for ( uint i=start(); igetChild( i )->getCharacter() ); } @@ -194,12 +194,12 @@ luPt ElementType::thickSpaceIfNotScript( const ContextStyle& context, } -QFont ElementType::getFont(const ContextStyle& context) +TQFont ElementType::getFont(const ContextStyle& context) { return context.getDefaultFont(); } -void ElementType::setUpPainter(const ContextStyle& context, QPainter& painter) +void ElementType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getDefaultColor()); } @@ -214,7 +214,7 @@ void ElementType::output() kdDebug( DEBUGID ) << start() << " - " << end() << endl; } -void ElementType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void ElementType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { for ( uint i = from; i < to; ++i ) { se->getChild( i )->writeMathML( doc, de, oasisFormat ); @@ -304,13 +304,13 @@ TextType::TextType( SequenceParser* parser ) { } -void TextType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void TextType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { for ( uint i = start(); i < end(); ++i ) { - QDomElement text = doc.createElement( oasisFormat ? "math:mi" : "mi" ); + TQDomElement text = doc.createElement( oasisFormat ? "math:mi" : "mi" ); BasicElement* be = se->getChild( i ); TextElement* te = static_cast( be ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily()); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily()); if ( !mathvariant.isNull() ) text.setAttribute( "mathvariant", mathvariant ); @@ -318,7 +318,7 @@ void TextType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement d de.appendChild( text ); if ( i != end() - 1 ) { - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); op.appendChild( doc.createEntityReference( "InvisibleTimes" ) ); de.appendChild( op ); } @@ -331,13 +331,13 @@ NameType::NameType( SequenceParser* parser ) { } -void NameType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void NameType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { se->getChild( start() )->writeMathML( doc, de, oasisFormat ); /* - QDomElement name = doc.createElement( "mi" ); - QString value; + TQDomElement name = doc.createElement( "mi" ); + TQString value; for ( uint i = start(); i < end(); ++i ) { BasicElement* be = se->getChild( i ); //TextElement* te = static_cast( be ); @@ -348,7 +348,7 @@ void NameType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement d } -QFont NameType::getFont(const ContextStyle& context) +TQFont NameType::getFont(const ContextStyle& context) { return context.getNameFont(); } @@ -358,26 +358,26 @@ NumberType::NumberType( SequenceParser* parser ) { } -QFont NumberType::getFont(const ContextStyle& context) +TQFont NumberType::getFont(const ContextStyle& context) { return context.getNumberFont(); } -void NumberType::setUpPainter(const ContextStyle& context, QPainter& painter) +void NumberType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getNumberColor()); } -void NumberType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void NumberType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { - QDomElement name = doc.createElement( oasisFormat ? "math:mn" : "mn" ); - QString value; + TQDomElement name = doc.createElement( oasisFormat ? "math:mn" : "mn" ); + TQString value; for ( uint i = start(); i < end(); ++i ) { BasicElement* be = se->getChild( i ); value += be->getCharacter(); } TextElement* te = static_cast( se->getChild( start() ) ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); if ( !mathvariant.isNull() ) name.setAttribute( "mathvariant", mathvariant ); @@ -397,21 +397,21 @@ AbstractOperatorType::AbstractOperatorType( SequenceParser* parser ) { } -void AbstractOperatorType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void AbstractOperatorType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); BasicElement* be = se->getChild( start() ); if ( be->getCharacter().latin1() != 0 ) { // latin-1 char op.appendChild( doc.createTextNode( be->getCharacter() ) ); } else { - // unicode char - QString s; - op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().unicode() ) ) ); + // tqunicode char + TQString s; + op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().tqunicode() ) ) ); } TextElement* te = static_cast( be ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); if ( !mathvariant.isNull() ) op.setAttribute( "mathvariant", mathvariant ); @@ -466,12 +466,12 @@ luPt OperatorType::getSpaceAfter( InnerElementType*, } -QFont OperatorType::getFont(const ContextStyle& context) +TQFont OperatorType::getFont(const ContextStyle& context) { return context.getOperatorFont(); } -void OperatorType::setUpPainter(const ContextStyle& context, QPainter& painter) +void OperatorType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getOperatorColor()); } @@ -524,12 +524,12 @@ luPt RelationType::getSpaceAfter( InnerElementType*, return thickSpaceIfNotScript( context, tstyle, factor ); } -QFont RelationType::getFont( const ContextStyle& context ) +TQFont RelationType::getFont( const ContextStyle& context ) { return context.getOperatorFont(); } -void RelationType::setUpPainter( const ContextStyle& context, QPainter& painter ) +void RelationType::setUpPainter( const ContextStyle& context, TQPainter& painter ) { painter.setPen(context.getOperatorColor()); } @@ -599,12 +599,12 @@ luPt PunctuationType::getSpaceAfter( InnerElementType*, return thinSpaceIfNotScript( context, tstyle, factor ); } -QFont PunctuationType::getFont( const ContextStyle& context ) +TQFont PunctuationType::getFont( const ContextStyle& context ) { return context.getOperatorFont(); } -void PunctuationType::setUpPainter( const ContextStyle& context, QPainter& painter ) +void PunctuationType::setUpPainter( const ContextStyle& context, TQPainter& painter ) { painter.setPen( context.getDefaultColor() ); } diff --git a/lib/kformula/elementtype.h b/lib/kformula/elementtype.h index 18c55f25..7fc44144 100644 --- a/lib/kformula/elementtype.h +++ b/lib/kformula/elementtype.h @@ -21,14 +21,14 @@ #ifndef ELEMENTTYPE_H #define ELEMENTTYPE_H -#include -#include -#include +#include +#include +#include #include "contextstyle.h" #include "kformuladefs.h" -class QPainter; +class TQPainter; KFORMULA_NAMESPACE_BEGIN @@ -61,9 +61,9 @@ public: /** * @returns the spanned text. seq must be the original - * parent sequence. + * tqparent sequence. */ - virtual QString text( SequenceElement* seq ) const; + virtual TQString text( SequenceElement* seq ) const; /** * @returns the position of the first character @@ -114,12 +114,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); // debug static int getEvilDestructionCount() { return evilDestructionCount; } @@ -133,7 +133,7 @@ public: ElementType* getPrev() const { return prev; } - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); virtual bool multiElement() const { return false; } @@ -223,13 +223,13 @@ public: /** * @returns the spanned text. seq must be the original - * parent sequence. + * tqparent sequence. */ - virtual QString text( SequenceElement* /*seq*/ ) const { return m_text; } + virtual TQString text( SequenceElement* /*seq*/ ) const { return m_text; } private: - QString m_text; + TQString m_text; }; @@ -240,7 +240,7 @@ private: class TextType : public MultiElementType { public: TextType( SequenceParser* parser ); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; @@ -254,14 +254,14 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont(const ContextStyle& context); + virtual TQFont getFont(const ContextStyle& context); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter(const ContextStyle& context, QPainter& painter); + virtual void setUpPainter(const ContextStyle& context, TQPainter& painter); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; @@ -284,9 +284,9 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); private: }; @@ -296,7 +296,7 @@ class AbstractOperatorType : public SingleElementType { public: AbstractOperatorType( SequenceParser* parser ); - void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; class OperatorType : public AbstractOperatorType { @@ -326,12 +326,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont(const ContextStyle& context); + virtual TQFont getFont(const ContextStyle& context); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter(const ContextStyle& context, QPainter& painter); + virtual void setUpPainter(const ContextStyle& context, TQPainter& painter); }; @@ -362,12 +362,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); }; @@ -406,12 +406,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); }; diff --git a/lib/kformula/encloseelement.cc b/lib/kformula/encloseelement.cc index 384f6b92..05617361 100644 --- a/lib/kformula/encloseelement.cc +++ b/lib/kformula/encloseelement.cc @@ -21,10 +21,10 @@ KFORMULA_NAMESPACE_BEGIN -EncloseElement::EncloseElement( BasicElement* parent ) : SequenceElement( parent ) { +EncloseElement::EncloseElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } -bool EncloseElement::readAttributesFromMathMLDom(const QDomElement& element) +bool EncloseElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -34,7 +34,7 @@ bool EncloseElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void EncloseElement::writeMathMLAttributes( QDomElement& element ) const +void EncloseElement::writeMathMLAttributes( TQDomElement& element ) const { if ( ! m_notation.isNull() ) { element.setAttribute( "notation", m_notation ); diff --git a/lib/kformula/encloseelement.h b/lib/kformula/encloseelement.h index 9bec85b0..b6b16a0d 100644 --- a/lib/kformula/encloseelement.h +++ b/lib/kformula/encloseelement.h @@ -27,14 +27,14 @@ KFORMULA_NAMESPACE_BEGIN class EncloseElement : public SequenceElement { typedef SequenceElement inherited; public: - EncloseElement( BasicElement* parent = 0 ); + EncloseElement( BasicElement* tqparent = 0 ); private: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); - virtual QString getElementName() const { return "menclose"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); + virtual TQString getElementName() const { return "menclose"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QString m_notation; + TQString m_notation; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/entities.h b/lib/kformula/entities.h index 38a5a0e8..78e39315 100644 --- a/lib/kformula/entities.h +++ b/lib/kformula/entities.h @@ -38,7 +38,7 @@ struct entityMap { return strcmp( name, right ) < 0; } const char* name; - const uint unicode; + const uint tqunicode; }; extern const entityMap entities[]; diff --git a/lib/kformula/errorelement.cc b/lib/kformula/errorelement.cc index f6141c4f..0bf80237 100644 --- a/lib/kformula/errorelement.cc +++ b/lib/kformula/errorelement.cc @@ -17,35 +17,35 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include "errorelement.h" KFORMULA_NAMESPACE_BEGIN -ErrorElement::ErrorElement( BasicElement* parent ) : SequenceElement( parent ) { +ErrorElement::ErrorElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void ErrorElement::draw( QPainter& painter, const LuPixelRect& r, +void ErrorElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); - painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ), + painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ), context.getErrorColor() ); - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/errorelement.h b/lib/kformula/errorelement.h index fa3b1e76..bc23b5e2 100644 --- a/lib/kformula/errorelement.h +++ b/lib/kformula/errorelement.h @@ -27,22 +27,22 @@ KFORMULA_NAMESPACE_BEGIN class ErrorElement : public SequenceElement { typedef SequenceElement inherited; public: - ErrorElement( BasicElement* parent = 0 ); + ErrorElement( BasicElement* tqparent = 0 ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); private: - virtual QString getElementName() const { return "merror"; } + virtual TQString getElementName() const { return "merror"; } }; diff --git a/lib/kformula/fontstyle.cc b/lib/kformula/fontstyle.cc index 3287120c..0d1792e0 100644 --- a/lib/kformula/fontstyle.cc +++ b/lib/kformula/fontstyle.cc @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -48,19 +48,19 @@ bool FontStyle::init( ContextStyle* style, bool install ) return true; } -// Cache the family list from QFontDatabase after fixing it up (no foundry, lowercase) +// Cache the family list from TQFontDatabase after fixing it up (no foundry, lowercase) class FontList { public: FontList() { - QFontDatabase db; - const QStringList lst = db.families(); - for ( QStringList::const_iterator it = lst.begin(), end = lst.end() ; it != end ; ++it ) { - const QString name = *it; - int i = name.find('['); - QString family = name; + TQFontDatabase db; + const TQStringList lst = db.tqfamilies(); + for ( TQStringList::const_iterator it = lst.begin(), end = lst.end() ; it != end ; ++it ) { + const TQString name = *it; + int i = name.tqfind('['); + TQString family = name; // Remove foundry if ( i > -1 ) { - const int li = name.findRev(']'); + const int li = name.tqfindRev(']'); if (i < li) { if (name[i - 1] == ' ') i--; @@ -70,15 +70,15 @@ public: m_fontNames.append( family.lower() ); } } - bool hasFont( const QString& fontName ) const { - return m_fontNames.find( fontName ) != m_fontNames.end(); + bool hasFont( const TQString& fontName ) const { + return m_fontNames.tqfind( fontName ) != m_fontNames.end(); } - QStringList m_fontNames; + TQStringList m_fontNames; }; static FontList* s_fontList = 0; static KStaticDeleter s_fontList_sd; -void FontStyle::testFont( QStringList& missing, const QString& fontName ) { +void FontStyle::testFont( TQStringList& missing, const TQString& fontName ) { if ( !s_fontList ) s_fontList_sd.setObject( s_fontList, new FontList() ); if ( !s_fontList->hasFont( fontName ) ) { @@ -88,18 +88,18 @@ void FontStyle::testFont( QStringList& missing, const QString& fontName ) { } -QStringList FontStyle::missingFonts( bool install ) +TQStringList FontStyle::missingFonts( bool install ) { if (!m_installed && install) installFonts(); - QStringList missing = missingFontsInternal(); + TQStringList missing = missingFontsInternal(); return missing; } -QStringList FontStyle::missingFontsInternal() +TQStringList FontStyle::missingFontsInternal() { - QStringList missing; + TQStringList missing; testFont( missing, "cmex10" ); testFont( missing, "arev sans"); @@ -111,11 +111,11 @@ void FontStyle::installFonts() { if (m_installed) return; - QStringList missing = missingFontsInternal(); + TQStringList missing = missingFontsInternal(); if (!missing.isEmpty()) { - QStringList urlList; - for (QStringList::iterator it = missing.begin(); it != missing.end(); ++it) + TQStringList urlList; + for (TQStringList::iterator it = missing.begin(); it != missing.end(); ++it) { if ( *it == "arev sans" ) { if (!KIO::NetAccess::exists("fonts:/Personal/Arev.ttf", true, NULL)) @@ -133,7 +133,7 @@ void FontStyle::installFonts() } } KIO::copy(urlList, "fonts:/Personal/", false); - KMessageBox::information(qApp->mainWidget(), + KMessageBox::information(tqApp->mainWidget(), i18n("Some fonts have been installed to assure that symbols in formulas are properly visualized. You must restart the application in order so that changes take effect")); } m_installed = true; @@ -146,45 +146,45 @@ Artwork* FontStyle::createArtwork( SymbolType type ) const // We claim that all chars come from the same font. // It's up to the font tables to ensure this. -const QChar leftRoundBracket[] = { +const TQChar leftRoundBracket[] = { 0x30, // uppercorner 0x40, // lowercorner 0x42 // line }; -const QChar leftSquareBracket[] = { +const TQChar leftSquareBracket[] = { 0x32, // uppercorner 0x34, // lowercorner 0x36 // line }; -const QChar leftCurlyBracket[] = { +const TQChar leftCurlyBracket[] = { 0x38, // uppercorner 0x3A, // lowercorner 0x3E, // line 0x3C // middle }; -const QChar leftLineBracket[] = { +const TQChar leftLineBracket[] = { 0x36, // line 0x36, // line 0x36 // line }; -const QChar rightLineBracket[] = { +const TQChar rightLineBracket[] = { 0x37, // line 0x37, // line 0x37 // line }; -const QChar rightRoundBracket[] = { +const TQChar rightRoundBracket[] = { 0x31, // uppercorner 0x41, // lowercorner 0x43 // line }; -const QChar rightSquareBracket[] = { +const TQChar rightSquareBracket[] = { 0x33, // uppercorner 0x35, // lowercorner 0x37 // line }; -const QChar rightCurlyBracket[] = { +const TQChar rightCurlyBracket[] = { 0x39, // uppercorner 0x3B, // lowercorner 0x3E, // line @@ -266,17 +266,17 @@ static short cmex_nextchar( short ch ) bool Artwork::calcCMDelimiterSize( const ContextStyle& context, uchar c, luPt fontSize, - luPt parentSize ) + luPt tqparentSize ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); - QFontMetrics fm( f ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + TQFontMetrics fm( f ); for ( char i=1; c != 0; ++i ) { LuPixelRect bound = fm.boundingRect( c ); luPt height = context.ptToLayoutUnitPt( bound.height() ); - if ( height >= parentSize ) { + if ( height >= tqparentSize ) { luPt width = context.ptToLayoutUnitPt( fm.width( c ) ); luPt baseline = context.ptToLayoutUnitPt( -bound.top() ); @@ -299,9 +299,9 @@ bool Artwork::calcCMDelimiterSize( const ContextStyle& context, void Artwork::calcLargest( const ContextStyle& context, uchar c, luPt fontSize ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); - QFontMetrics fm( f ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + TQFontMetrics fm( f ); cmChar = c; for ( ;; ) { @@ -324,26 +324,26 @@ void Artwork::calcLargest( const ContextStyle& context, } -void Artwork::drawCMDelimiter( QPainter& painter, const ContextStyle& style, +void Artwork::drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, luPt height ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y + getBaseline() ), - QString( QChar( cmChar ) ) ); + painter.drawText( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y + getBaseline() ), + TQString( TQChar( cmChar ) ) ); // Debug #if 0 - QFontMetrics fm( f ); + TQFontMetrics fm( f ); LuPixelRect bound = fm.boundingRect( cmChar ); - painter.setBrush(Qt::NoBrush); - painter.setPen(Qt::green); - painter.drawRect( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y ), + painter.setBrush(TQt::NoBrush); + painter.setPen(TQt::green); + painter.drawRect( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y ), fm.width( cmChar ), bound.height() ); #endif @@ -359,7 +359,7 @@ Artwork::Artwork(SymbolType t) void Artwork::calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt parentSize ) + luPt tqparentSize ) { setBaseline( -1 ); cmChar = -1; @@ -367,86 +367,86 @@ void Artwork::calcSizes( const ContextStyle& style, switch (getType()) { case LeftSquareBracket: if ( calcCMDelimiterSize( style, cmex_LeftSquareBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, leftSquareBracket, parentSize, mySize ); + calcRoundBracket( style, leftSquareBracket, tqparentSize, mySize ); break; case RightSquareBracket: if ( calcCMDelimiterSize( style, cmex_RightSquareBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, rightSquareBracket, parentSize, mySize ); + calcRoundBracket( style, rightSquareBracket, tqparentSize, mySize ); break; case LeftLineBracket: - calcRoundBracket( style, leftLineBracket, parentSize, mySize ); + calcRoundBracket( style, leftLineBracket, tqparentSize, mySize ); setWidth( getWidth()/2 ); break; case RightLineBracket: - calcRoundBracket( style, rightLineBracket, parentSize, mySize ); + calcRoundBracket( style, rightLineBracket, tqparentSize, mySize ); setWidth( getWidth()/2 ); break; case SlashBracket: if ( calcCMDelimiterSize( style, cmex_SlashBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_SlashBracket, mySize ); break; case BackSlashBracket: if ( calcCMDelimiterSize( style, cmex_BackSlashBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_BackSlashBracket, mySize ); break; case LeftCornerBracket: if ( calcCMDelimiterSize( style, cmex_LeftCornerBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_LeftCornerBracket, mySize ); break; case RightCornerBracket: if ( calcCMDelimiterSize( style, cmex_RightCornerBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_RightCornerBracket, mySize ); break; case LeftRoundBracket: if ( calcCMDelimiterSize( style, cmex_LeftRoundBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, leftRoundBracket, parentSize, mySize ); + calcRoundBracket( style, leftRoundBracket, tqparentSize, mySize ); break; case RightRoundBracket: if ( calcCMDelimiterSize( style, cmex_RightRoundBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, rightRoundBracket, parentSize, mySize ); + calcRoundBracket( style, rightRoundBracket, tqparentSize, mySize ); break; case EmptyBracket: - setHeight(parentSize); + setHeight(tqparentSize); //setWidth(style.getEmptyRectWidth()); setWidth(0); break; case LeftCurlyBracket: if ( calcCMDelimiterSize( style, cmex_LeftCurlyBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcCurlyBracket( style, leftCurlyBracket, parentSize, mySize ); + calcCurlyBracket( style, leftCurlyBracket, tqparentSize, mySize ); break; case RightCurlyBracket: if ( calcCMDelimiterSize( style, cmex_RightCurlyBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcCurlyBracket( style, rightCurlyBracket, parentSize, mySize ); + calcCurlyBracket( style, rightCurlyBracket, tqparentSize, mySize ); break; case Integral: calcCharSize( style, style.getBracketFont(), mySize, cmex_Int ); @@ -514,13 +514,13 @@ void Artwork::calcSizes( const ContextStyle& style, } -void Artwork::draw(QPainter& painter, const LuPixelRect& /*r*/, +void Artwork::draw(TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, - StyleAttributes& style, const LuPixelPoint& parentOrigin) + StyleAttributes& style, const LuPixelPoint& tqparentOrigin) { luPt mySize = context.getAdjustedSize( tstyle, style.sizeFactor() ); - luPixel myX = parentOrigin.x() + getX(); - luPixel myY = parentOrigin.y() + getY(); + luPixel myX = tqparentOrigin.x() + getX(); + luPixel myY = tqparentOrigin.y() + getY(); /* if ( !LuPixelRect( myX, myY, getWidth(), getHeight() ).intersects( r ) ) return; @@ -572,7 +572,7 @@ void Artwork::draw(QPainter& painter, const LuPixelRect& /*r*/, } } -void Artwork::draw(QPainter& painter, const LuPixelRect& , +void Artwork::draw(TQPainter& painter, const LuPixelRect& , const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, luPt , const LuPixelPoint& origin) { @@ -672,45 +672,45 @@ void Artwork::draw(QPainter& painter, const LuPixelRect& , case EmptyBracket: break; case Integral: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Int); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Int); break; case Sum: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Sum); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Sum); break; case Product: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Prod); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Prod); break; } // debug -// painter.setBrush(Qt::NoBrush); -// painter.setPen(Qt::green); -// painter.drawRect( context.layoutUnitToPixelX( myX ), -// context.layoutUnitToPixelY( myY ), -// context.layoutUnitToPixelX( getWidth() ), -// context.layoutUnitToPixelY( getHeight() ) ); +// painter.setBrush(TQt::NoBrush); +// painter.setPen(TQt::green); +// painter.drawRect( context.tqlayoutUnitToPixelX( myX ), +// context.tqlayoutUnitToPixelY( myY ), +// context.tqlayoutUnitToPixelX( getWidth() ), +// context.tqlayoutUnitToPixelY( getHeight() ) ); } -void Artwork::calcCharSize( const ContextStyle& style, luPt height, QChar ch ) +void Artwork::calcCharSize( const ContextStyle& style, luPt height, TQChar ch ) { calcCharSize( style, style.getMathFont(), height, ch ); } -void Artwork::drawCharacter( QPainter& painter, const ContextStyle& style, +void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, - luPt height, QChar ch ) + luPt height, TQChar ch ) { drawCharacter( painter, style, style.getMathFont(), x, y, height, ch ); } -void Artwork::calcCharSize( const ContextStyle& style, QFont f, - luPt height, QChar c ) +void Artwork::calcCharSize( const ContextStyle& style, TQFont f, + luPt height, TQChar c ) { - f.setPointSizeFloat( style.layoutUnitPtToPt( height ) ); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( height ) ); //f.setPointSize( height ); - QFontMetrics fm(f); + TQFontMetrics fm(f); setWidth( style.ptToLayoutUnitPt( fm.width( c ) ) ); LuPixelRect bound = fm.boundingRect( c ); setHeight( style.ptToLayoutUnitPt( bound.height() ) ); @@ -718,70 +718,70 @@ void Artwork::calcCharSize( const ContextStyle& style, QFont f, } -void Artwork::drawCharacter( QPainter& painter, const ContextStyle& style, - QFont f, +void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, + TQFont f, luPixel x, luPixel y, luPt height, uchar c ) { - f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y+getBaseline() ), - QString( QChar( c ) ) ); + painter.drawText( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y+getBaseline() ), + TQString( TQChar( c ) ) ); } -void Artwork::calcRoundBracket( const ContextStyle& style, const QChar chars[], +void Artwork::calcRoundBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ) { uchar uppercorner = chars[0]; uchar lowercorner = chars[1]; //uchar line = style.symbolTable().character( chars[2] ); - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); - QFontMetrics fm( f ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); //LuPtRect lineBound = fm.boundingRect( line ); - setWidth( style.ptToLayoutUnitPt( fm.width( QChar( uppercorner ) ) ) ); + setWidth( style.ptToLayoutUnitPt( fm.width( TQChar( uppercorner ) ) ) ); luPt edgeHeight = style.ptToLayoutUnitPt( upperBound.height()+lowerBound.height() ); //luPt lineHeight = style.ptToLayoutUnitPt( lineBound.height() ); //setHeight( edgeHeight + ( ( height-edgeHeight-1 ) / lineHeight + 1 ) * lineHeight ); - setHeight( QMAX( edgeHeight, height ) ); + setHeight( TQMAX( edgeHeight, height ) ); } -void Artwork::drawBigRoundBracket( QPainter& p, const ContextStyle& style, const QChar chars[], +void Artwork::drawBigRoundBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ) { uchar uppercorner = chars[0]; uchar lowercorner = chars[1]; uchar line = chars[2]; - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); p.setFont(f); - QFontMetrics fm(f); - QRect upperBound = fm.boundingRect(uppercorner); - QRect lowerBound = fm.boundingRect(lowercorner); - QRect lineBound = fm.boundingRect(line); + TQFontMetrics fm(f); + TQRect upperBound = fm.boundingRect(uppercorner); + TQRect lowerBound = fm.boundingRect(lowercorner); + TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.layoutUnitToPixelX( x ); - pixel ptY = style.layoutUnitToPixelY( y ); - pixel height = style.layoutUnitToPixelY( getHeight() ); + pixel ptX = style.tqlayoutUnitToPixelX( x ); + pixel ptY = style.tqlayoutUnitToPixelY( y ); + pixel height = style.tqlayoutUnitToPixelY( getHeight() ); -// p.setPen( Qt::red ); +// p.setPen( TQt::red ); // //p.drawRect( ptX, ptY, upperBound.width(), upperBound.height() + lowerBound.height() ); -// p.drawRect( ptX, ptY, style.layoutUnitToPixelX( getWidth() ), -// style.layoutUnitToPixelY( getHeight() ) ); +// p.drawRect( ptX, ptY, style.tqlayoutUnitToPixelX( getWidth() ), +// style.tqlayoutUnitToPixelY( getHeight() ) ); -// p.setPen( Qt::black ); - p.drawText( ptX, ptY-upperBound.top(), QString( QChar( uppercorner ) ) ); +// p.setPen( TQt::black ); + p.drawText( ptX, ptY-upperBound.top(), TQString( TQChar( uppercorner ) ) ); p.drawText( ptX, ptY+height-lowerBound.top()-lowerBound.height(), - QString( QChar( lowercorner ) ) ); + TQString( TQChar( lowercorner ) ) ); // for printing //pt safety = lineBound.height() / 10.0; @@ -789,19 +789,19 @@ void Artwork::drawBigRoundBracket( QPainter& p, const ContextStyle& style, const pixel gap = height - upperBound.height() - lowerBound.height(); pixel lineHeight = lineBound.height() - safety; - int lineCount = qRound( static_cast( gap ) / lineHeight ); + int lineCount = tqRound( static_cast( gap ) / lineHeight ); pixel start = upperBound.height()-lineBound.top() - safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY+start+i*lineHeight, QString(QChar(line))); + p.drawText( ptX, ptY+start+i*lineHeight, TQString(TQChar(line))); } pixel remaining = gap - lineCount*lineHeight; pixel dist = ( lineHeight - remaining ) / 2; p.drawText( ptX, ptY+height-upperBound.height()+dist-lineBound.height()-lineBound.top(), - QString( QChar( line ) ) ); + TQString( TQChar( line ) ) ); } -void Artwork::calcCurlyBracket( const ContextStyle& style, const QChar chars[], +void Artwork::calcCurlyBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ) { uchar uppercorner = chars[0]; @@ -809,30 +809,30 @@ void Artwork::calcCurlyBracket( const ContextStyle& style, const QChar chars[], //uchar line = style.symbolTable().character( chars[2] ); uchar middle = chars[3]; - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); - QFontMetrics fm( f ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); //LuPtRect lineBound = fm.boundingRect( line ); LuPtRect middleBound = fm.boundingRect( middle ); - setWidth( style.ptToLayoutUnitPt( fm.width( QChar( uppercorner ) ) ) ); + setWidth( style.ptToLayoutUnitPt( fm.width( TQChar( uppercorner ) ) ) ); luPt edgeHeight = style.ptToLayoutUnitPt( upperBound.height()+ lowerBound.height()+ middleBound.height() ); //luPt lineHeight = style.ptToLayoutUnitPt( lineBound.height() ); //setHeight( edgeHeight + ( ( height-edgeHeight-1 ) / lineHeight + 1 ) * lineHeight ); - setHeight( QMAX( edgeHeight, height ) ); + setHeight( TQMAX( edgeHeight, height ) ); } -void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const QChar chars[], +void Artwork::drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ) { - //QFont f = style.getSymbolFont(); - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); + //TQFont f = style.getSymbolFont(); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); p.setFont(f); uchar uppercorner = chars[0]; @@ -840,24 +840,24 @@ void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const uchar line = chars[2]; uchar middle = chars[3]; - QFontMetrics fm(p.fontMetrics()); - QRect upperBound = fm.boundingRect(uppercorner); - QRect lowerBound = fm.boundingRect(lowercorner); - QRect middleBound = fm.boundingRect(middle); - QRect lineBound = fm.boundingRect(line); + TQFontMetrics fm(p.fontMetrics()); + TQRect upperBound = fm.boundingRect(uppercorner); + TQRect lowerBound = fm.boundingRect(lowercorner); + TQRect middleBound = fm.boundingRect(middle); + TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.layoutUnitToPixelX( x ); - pixel ptY = style.layoutUnitToPixelY( y ); - pixel height = style.layoutUnitToPixelY( getHeight() ); + pixel ptX = style.tqlayoutUnitToPixelX( x ); + pixel ptY = style.tqlayoutUnitToPixelY( y ); + pixel height = style.tqlayoutUnitToPixelY( getHeight() ); - //p.setPen(Qt::gray); + //p.setPen(TQt::gray); //p.drawRect(x, y, upperBound.width() + offset, height); - p.drawText( ptX, ptY-upperBound.top(), QString( QChar( uppercorner ) ) ); + p.drawText( ptX, ptY-upperBound.top(), TQString( TQChar( uppercorner ) ) ); p.drawText( ptX, ptY+(height-middleBound.height())/2-middleBound.top(), - QString( QChar( middle ) ) ); + TQString( TQChar( middle ) ) ); p.drawText( ptX, ptY+height-lowerBound.top()-lowerBound.height(), - QString( QChar( lowercorner ) ) ); + TQString( TQChar( lowercorner ) ) ); // for printing // If the world was perfect and the urw-symbol font correct @@ -869,19 +869,19 @@ void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const pixel gap = height/2 - upperBound.height() - middleBound.height() / 2; if (gap > 0) { - QString ch = QString(QChar(line)); - int lineCount = qRound( gap / lineHeight ) + 1; + TQString ch = TQString(TQChar(line)); + int lineCount = tqRound( gap / lineHeight ) + 1; pixel start = (height - middleBound.height()) / 2 + safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY-lineBound.top()+QMAX( start-(i+1)*lineHeight, + p.drawText( ptX, ptY-lineBound.top()+TQMAX( start-(i+1)*lineHeight, upperBound.width() ), ch ); } start = (height + middleBound.height()) / 2 - safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY-lineBound.top()+QMIN( start+i*lineHeight, + p.drawText( ptX, ptY-lineBound.top()+TQMIN( start+i*lineHeight, height-upperBound.width()-lineBound.height() ), ch ); } diff --git a/lib/kformula/fontstyle.h b/lib/kformula/fontstyle.h index 52105821..72db8caf 100644 --- a/lib/kformula/fontstyle.h +++ b/lib/kformula/fontstyle.h @@ -21,8 +21,8 @@ #ifndef FONTSTYLE_H #define FONTSTYLE_H -#include -#include +#include +#include #include "contextstyle.h" #include "kformuladefs.h" @@ -48,56 +48,56 @@ public: */ bool init( ContextStyle* context, bool install = true ); - /// the table for ordinary symbols (those that have a unicode value) + /// the table for ordinary symbols (those that have a tqunicode value) const SymbolTable* symbolTable() const { return &m_symbolTable; } SymbolTable* symbolTable() { return &m_symbolTable; } Artwork* createArtwork(SymbolType type = EmptyBracket) const; - static QStringList missingFonts( bool install = true ); + static TQStringList missingFonts( bool install = true ); static bool m_installed; - static void testFont( QStringList& missing, const QString& fontName ); + static void testFont( TQStringList& missing, const TQString& fontName ); private: - static QStringList missingFontsInternal(); + static TQStringList missingFontsInternal(); static void installFonts(); SymbolTable m_symbolTable; }; -const QChar spaceChar = 0x0020; -const QChar leftParenthesisChar = 0x0028; -const QChar rightParenthesisChar = 0x0029; -const QChar leftSquareBracketChar = 0x005B; -const QChar rightSquareBracketChar = 0x005D; -const QChar leftCurlyBracketChar = 0x007B; -const QChar verticalLineChar = 0x007C; -const QChar rightCurlyBracketChar = 0x007D; -const QChar leftAngleBracketChar = 0x2329; -const QChar rightAngleBracketChar = 0x232A; -const QChar slashChar = 0x002F; -const QChar backSlashChar = 0x005C; -const QChar integralChar = 0x222B; -const QChar summationChar = 0x2211; -const QChar productChar = 0x220F; -const QChar applyFunctionChar = 0x2061; -const QChar invisibleTimes = 0x2062; -const QChar invisibleComma = 0x2063; - -extern const QChar leftRoundBracket[]; -extern const QChar leftSquareBracket[]; -extern const QChar leftCurlyBracket[]; - -extern const QChar leftLineBracket[]; -extern const QChar rightLineBracket[]; - -extern const QChar rightRoundBracket[]; -extern const QChar rightSquareBracket[]; -extern const QChar rightCurlyBracket[]; +const TQChar spaceChar = 0x0020; +const TQChar leftParenthesisChar = 0x0028; +const TQChar rightParenthesisChar = 0x0029; +const TQChar leftSquareBracketChar = 0x005B; +const TQChar rightSquareBracketChar = 0x005D; +const TQChar leftCurlyBracketChar = 0x007B; +const TQChar verticalLineChar = 0x007C; +const TQChar rightCurlyBracketChar = 0x007D; +const TQChar leftAngleBracketChar = 0x2329; +const TQChar rightAngleBracketChar = 0x232A; +const TQChar slashChar = 0x002F; +const TQChar backSlashChar = 0x005C; +const TQChar integralChar = 0x222B; +const TQChar summationChar = 0x2211; +const TQChar productChar = 0x220F; +const TQChar applyFunctionChar = 0x2061; +const TQChar invisibleTimes = 0x2062; +const TQChar invisibleComma = 0x2063; + +extern const TQChar leftRoundBracket[]; +extern const TQChar leftSquareBracket[]; +extern const TQChar leftCurlyBracket[]; + +extern const TQChar leftLineBracket[]; +extern const TQChar rightLineBracket[]; + +extern const TQChar rightRoundBracket[]; +extern const TQChar rightSquareBracket[]; +extern const TQChar rightCurlyBracket[]; /* * A piece of art that may be used by any element. @@ -111,21 +111,21 @@ public: virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt parentSize ); + luPt tqparentSize ); virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor ); - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - luPt parentSize, const LuPixelPoint& origin ); - virtual void draw( QPainter& painter, const LuPixelRect& r, + luPt tqparentSize, const LuPixelPoint& origin ); + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); luPixel getWidth() const { return size.width(); } luPixel getHeight() const { return size.height(); } @@ -151,20 +151,20 @@ public: protected: - void calcCharSize( const ContextStyle& style, luPt height, QChar ch ); - void drawCharacter( QPainter& painter, const ContextStyle& style, - luPixel x, luPixel y, luPt height, QChar ch ); + void calcCharSize( const ContextStyle& style, luPt height, TQChar ch ); + void drawCharacter( TQPainter& painter, const ContextStyle& style, + luPixel x, luPixel y, luPt height, TQChar ch ); - void calcCharSize( const ContextStyle& style, QFont f, luPt height, QChar c ); - void drawCharacter( QPainter& painter, const ContextStyle& style, - QFont f, + void calcCharSize( const ContextStyle& style, TQFont f, luPt height, TQChar c ); + void drawCharacter( TQPainter& painter, const ContextStyle& style, + TQFont f, luPixel x, luPixel y, luPt height, uchar c ); - void calcRoundBracket( const ContextStyle& style, const QChar chars[], luPt height, luPt charHeight ); - void calcCurlyBracket( const ContextStyle& style, const QChar chars[], luPt height, luPt charHeight ); + void calcRoundBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ); + void calcCurlyBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ); - void drawBigRoundBracket( QPainter& p, const ContextStyle& style, const QChar chars[], luPixel x, luPixel y, luPt charHeight ); - void drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const QChar chars[], luPixel x, luPixel y, luPt charHeight ); + void drawBigRoundBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ); + void drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ); private: @@ -179,9 +179,9 @@ private: SymbolType type; bool calcCMDelimiterSize( const ContextStyle& context, uchar c, - luPt fontSize, luPt parentSize ); + luPt fontSize, luPt tqparentSize ); void calcLargest( const ContextStyle& context, uchar c, luPt fontSize ); - void drawCMDelimiter( QPainter& painter, const ContextStyle& style, + void drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, luPt height ); short cmChar; diff --git a/lib/kformula/formulacursor.cc b/lib/kformula/formulacursor.cc index 83b46e45..6545b18c 100644 --- a/lib/kformula/formulacursor.cc +++ b/lib/kformula/formulacursor.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -79,7 +79,7 @@ void FormulaCursor::calcCursorSize( const ContextStyle& context, bool smallCurso } } -void FormulaCursor::draw( QPainter& painter, const ContextStyle& context, +void FormulaCursor::draw( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, bool smallCursor, bool activeCursor ) { //if (readOnly && !isSelection()) @@ -296,26 +296,26 @@ void FormulaCursor::normalize(Direction direction) */ void FormulaCursor::insert(BasicElement* child, Direction direction) { - QPtrList list; + TQPtrList list; list.append(child); insert(list, direction); } -void FormulaCursor::insert(QPtrList& children, +void FormulaCursor::insert(TQPtrList& tqchildren, Direction direction) { assert( !isReadOnly() ); BasicElement* element = getElement(); - element->insert(this, children, direction); + element->insert(this, tqchildren, direction); } /** - * Removes the current selected children and returns them. + * Removes the current selected tqchildren and returns them. * The cursor needs to be normal (that is be inside a SequenceElement) * for this to have any effect. */ -void FormulaCursor::remove(QPtrList& children, +void FormulaCursor::remove(TQPtrList& tqchildren, Direction direction) { assert( !isReadOnly() ); @@ -325,15 +325,15 @@ void FormulaCursor::remove(QPtrList& children, // If there is no child to remove in the sequence // remove the sequence instead. if (sequence->countChildren() == 0) { - BasicElement* parent = sequence->getParent(); - if (parent != 0) { - parent->selectChild(this, sequence); - parent->remove(this, children, direction); + BasicElement* tqparent = sequence->getParent(); + if (tqparent != 0) { + tqparent->selectChild(this, sequence); + tqparent->remove(this, tqchildren, direction); return; } } else { - sequence->remove(this, children, direction); + sequence->remove(this, tqchildren, direction); } } } @@ -347,7 +347,7 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, Direction direction) { assert( !isReadOnly() ); - QPtrList list; + TQPtrList list; // we suppres deletion here to get an error if something // was left in the list. //list.setAutoDelete(true); @@ -363,12 +363,12 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, mainChild->goInside(this); insert(list); /* - BasicElement* parent = element->getParent(); + BasicElement* tqparent = element->getParent(); if (direction == beforeCursor) { - parent->moveRight(this, element); + tqparent->moveRight(this, element); } else { - parent->moveLeft(this, element); + tqparent->moveLeft(this, element); } */ element->selectChild(this, mainChild); @@ -383,18 +383,18 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) { assert( !isReadOnly() ); - QPtrList childrenList; - QPtrList list; + TQPtrList tqchildrenList; + TQPtrList list; BasicElement* element = getElement(); SequenceElement* mainChild = element->getMainChild(); if ((mainChild != 0) && (mainChild->countChildren() > 0)) { mainChild->selectAllChildren(this); - remove(childrenList); + remove(tqchildrenList); } element->getParent()->selectChild(this, element); setSelection(false); remove(list); - insert(childrenList, direction); + insert(tqchildrenList, direction); if (list.count() > 0) { return list.take(0); } @@ -403,7 +403,7 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) /** - * Trys to find the element we are the main child of and replace + * Trys to find the element we are the main child of and tqreplace * it with our content. * * This is simply another form of replaceByMainChildContent. You @@ -412,10 +412,10 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) BasicElement* FormulaCursor::removeEnclosingElement(Direction direction) { assert( !isReadOnly() ); - BasicElement* parent = getElement()->getParent(); - if (parent != 0) { - if (getElement() == parent->getMainChild()) { - parent->selectChild(this, getElement()); + BasicElement* tqparent = getElement()->getParent(); + if (tqparent != 0) { + if (getElement() == tqparent->getMainChild()) { + tqparent->selectChild(this, getElement()); return replaceByMainChildContent(direction); } } @@ -582,7 +582,7 @@ MatrixElement* FormulaCursor::getActiveMatrixElement() } /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void FormulaCursor::elementWillVanish(BasicElement* element) { @@ -636,15 +636,15 @@ bool FormulaCursor::isReadOnly() const /** * Stores the currently selected elements inside a dom. */ -void FormulaCursor::copy( QDomDocument& doc ) +void FormulaCursor::copy( TQDomDocument& doc ) { if (isSelection()) { SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", + TQDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); doc.appendChild( root ); - QDomElement de = doc.createElement( "mrow" ); + TQDomElement de = doc.createElement( "mrow" ); root.appendChild( de ); sequence->getChildrenMathMLDom(doc, de, getSelectionStart(), getSelectionEnd()); } @@ -659,12 +659,12 @@ void FormulaCursor::copy( QDomDocument& doc ) * Inserts the elements that could be read from the dom into * the list. Returns true on success. */ -bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList& list ) +bool FormulaCursor::buildElementsFromDom( TQDomElement root, TQPtrList& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromDom(list, e.firstChild())) { return true; } @@ -676,12 +676,12 @@ bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList& list ) +bool FormulaCursor::buildElementsFromMathMLDom( TQDomElement root, TQPtrList& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromMathMLDom(list, e.firstChild())) { return true; } diff --git a/lib/kformula/formulacursor.h b/lib/kformula/formulacursor.h index 72cfb178..1aa5d8bf 100644 --- a/lib/kformula/formulacursor.h +++ b/lib/kformula/formulacursor.h @@ -21,7 +21,7 @@ #ifndef FORMULACURSOR_H #define FORMULACURSOR_H -#include +#include #include "basicelement.h" #include "kformuladefs.h" @@ -104,7 +104,7 @@ public: * Draws the cursor at its current position. * The cursor will always be drawn in xor mode. */ - void draw( QPainter&, const ContextStyle& context, StyleAttributes& style, + void draw( TQPainter&, const ContextStyle& context, StyleAttributes& style, bool smallCursor, bool activeCursor ); @@ -152,19 +152,19 @@ public: void insert(BasicElement*, Direction = beforeCursor); /** - * Inserts the listed children at the current position. + * Inserts the listed tqchildren at the current position. * Ignores the selection. * The list will be emptied. */ - void insert(QPtrList&, + void insert(TQPtrList&, Direction = beforeCursor); /** - * Removes the current selected children and returns them. + * Removes the current selected tqchildren and returns them. * The cursor needs to be normal (that is be inside a SequenceElement) * for this to have any effect. */ - void remove(QPtrList&, + void remove(TQPtrList&, Direction = beforeCursor); @@ -182,7 +182,7 @@ public: BasicElement* replaceByMainChildContent(Direction = beforeCursor); /** - * Trys to find the element we are the main child of and replace + * Trys to find the element we are the main child of and tqreplace * it with our content. * * This is simply another form of replaceByMainChildContent. You @@ -200,8 +200,8 @@ public: // The range that is selected. Makes no sense if there is // no selection. - int getSelectionStart() const { return QMIN(getPos(), getMark()); } - int getSelectionEnd() const { return QMAX(getPos(), getMark()); } + int getSelectionStart() const { return TQMIN(getPos(), getMark()); } + int getSelectionEnd() const { return TQMAX(getPos(), getMark()); } /** @@ -291,19 +291,19 @@ public: /** * Stores the currently selected elements inside a dom. */ - void copy( QDomDocument& doc ); + void copy( TQDomDocument& doc ); /** * Inserts the elements that could be read from the dom into * the list. Returns true on success. */ - bool buildElementsFromDom( QDomElement root, QPtrList& list ); + bool buildElementsFromDom( TQDomElement root, TQPtrList& list ); /** * Inserts the elements that could be read from the MathML dom into * the list. Returns true on success. */ - bool buildElementsFromMathMLDom( QDomElement root, QPtrList& list ); + bool buildElementsFromMathMLDom( TQDomElement root, TQPtrList& list ); // undo/redo support @@ -341,7 +341,7 @@ public: void setCursorData(CursorData* data); /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void elementWillVanish(BasicElement* element); @@ -409,7 +409,7 @@ private: /** * The position the cursor in on inside the element. - * Might be anything from 0 to current->children->size(). + * Might be anything from 0 to current->tqchildren->size(). * * This is where new elements are put in. */ diff --git a/lib/kformula/formulaelement.cc b/lib/kformula/formulaelement.cc index 39349fd1..84944150 100644 --- a/lib/kformula/formulaelement.cc +++ b/lib/kformula/formulaelement.cc @@ -19,7 +19,7 @@ */ #include -#include +#include #include @@ -101,7 +101,7 @@ void FormulaElement::moveOutAbove( FormulaCursor* cursor ) document->moveOutAbove( cursor ); } -void FormulaElement::tell( const QString& msg ) +void FormulaElement::tell( const TQString& msg ) { document->tell( msg ); } @@ -125,14 +125,14 @@ void FormulaElement::calcSizes( const ContextStyle& context, } -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); } @@ -155,7 +155,7 @@ void FormulaElement::calcSizes( ContextStyle& context ) /** * Draws the whole thing. */ -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle& context ) { //kdDebug( DEBUGID ) << "FormulaElement::draw" << endl; @@ -187,9 +187,9 @@ const SymbolTable& FormulaElement::getSymbolTable() const } -QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) +TQDomElement FormulaElement::emptyFormulaElement( TQDomDocument& doc ) { - QDomElement element = doc.createElement( getTagName() ); + TQDomElement element = doc.createElement( getTagName() ); /* element.setAttribute( "VERSION", "6" ); if ( ownBaseSize ) { @@ -199,17 +199,17 @@ QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) return element; } -KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) +KCommand* FormulaElement::input( Container* container, TQKeyEvent* event ) { - QChar ch = event->text().at( 0 ); + TQChar ch = event->text().at( 0 ); if ( !ch.isPrint() ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Return: - case Qt::Key_Enter: { + case TQt::Key_Return: + case TQt::Key_Enter: { FormulaCursor* cursor = container->activeCursor(); insertFormula( cursor ); return 0; @@ -222,7 +222,7 @@ KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) /** * Appends our attributes to the dom element. */ -void FormulaElement::writeDom(QDomElement element) +void FormulaElement::writeDom(TQDomElement element) { inherited::writeDom(element); element.setAttribute( "VERSION", "6" ); @@ -235,13 +235,13 @@ void FormulaElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool FormulaElement::readAttributesFromDom(QDomElement element) +bool FormulaElement::readAttributesFromDom(TQDomElement element) { if (!inherited::readAttributesFromDom(element)) { return false; } int version = -1; - QString versionStr = element.attribute( "VERSION" ); + TQString versionStr = element.attribute( "VERSION" ); if ( !versionStr.isNull() ) { version = versionStr.toInt(); } @@ -252,7 +252,7 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) convertNames( element ); } } - QString baseSizeStr = element.attribute( "BASESIZE" ); + TQString baseSizeStr = element.attribute( "BASESIZE" ); if ( !baseSizeStr.isNull() ) { ownBaseSize = true; baseSize = baseSizeStr.toInt(); @@ -268,26 +268,26 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool FormulaElement::readContentFromDom(QDomNode& node) +bool FormulaElement::readContentFromDom(TQDomNode& node) { return inherited::readContentFromDom(node); } -void FormulaElement::convertNames( QDomNode node ) +void FormulaElement::convertNames( TQDomNode node ) { if ( node.isElement() && ( node.nodeName().upper() == "TEXT" ) ) { - QDomNamedNodeMap attr = node.attributes(); - QDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); + TQDomNamedNodeMap attr = node.attributes(); + TQDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); if ( ch.value() == "\\" ) { - QDomNode sequence = node.parentNode(); - QDomDocument doc = sequence.ownerDocument(); - QDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); - sequence.replaceChild( nameseq, node ); + TQDomNode sequence = node.tqparentNode(); + TQDomDocument doc = sequence.ownerDocument(); + TQDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); + sequence.tqreplaceChild( nameseq, node ); bool inName = true; while ( inName ) { inName = false; - QDomNode n = nameseq.nextSibling(); + TQDomNode n = nameseq.nextSibling(); if ( n.isElement() && ( n.nodeName().upper() == "TEXT" ) ) { attr = n.attributes(); ch = attr.namedItem( "CHAR" ).toAttr(); @@ -300,7 +300,7 @@ void FormulaElement::convertNames( QDomNode node ) } } if ( node.hasChildNodes() ) { - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); while ( !n.isNull() ) { convertNames( n ); n = n.nextSibling(); @@ -308,23 +308,23 @@ void FormulaElement::convertNames( QDomNode node ) } } -QString FormulaElement::toLatex() +TQString FormulaElement::toLatex() { return inherited::toLatex(); //Consider $$ sorround } -void FormulaElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void FormulaElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de; + TQDomElement de; if ( !oasisFormat ) { de = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); - parent.appendChild( de ); + tqparent.appendChild( de ); } else { - QDomElement element = doc.createElement( "math:semantics" ); + TQDomElement element = doc.createElement( "math:semantics" ); de = doc.createElement( "math:mrow" ); - parent.appendChild( element ); + tqparent.appendChild( element ); element.appendChild( de ); } for ( uint i = 0; i < countChildren(); ++i ) { diff --git a/lib/kformula/formulaelement.h b/lib/kformula/formulaelement.h index fda89d79..831456a7 100644 --- a/lib/kformula/formulaelement.h +++ b/lib/kformula/formulaelement.h @@ -34,8 +34,8 @@ class SymbolTable; /** * The main element. - * A formula consists of a FormulaElement and its children. - * The only element that has no parent. + * A formula consists of a FormulaElement and its tqchildren. + * The only element that has no tqparent. */ class FormulaElement : public SequenceElement { typedef SequenceElement inherited; @@ -101,7 +101,7 @@ public: /** * Tell the user something has happened. */ - void tell( const QString& msg ); + void tell( const TQString& msg ); /** * Gets called when the formula wants to vanish. The one who @@ -113,7 +113,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -121,16 +121,16 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * Calculates the formulas sizes and positions. @@ -140,7 +140,7 @@ public: /** * Draws the whole thing. */ - void draw( QPainter& painter, const LuPixelRect& r, ContextStyle& context ); + void draw( TQPainter& painter, const LuPixelRect& r, ContextStyle& context ); /** * This is called by the container to get a command depending on @@ -159,28 +159,28 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); int getBaseSize() const { return baseSize; } void setBaseSize( int size ); bool hasOwnBaseSize() const { return ownBaseSize; } - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * For copy&paste we need to create an empty XML element. */ - QDomElement emptyFormulaElement( QDomDocument& doc ); + TQDomElement emptyFormulaElement( TQDomDocument& doc ); protected: @@ -189,20 +189,20 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "FORMULA"; } + virtual TQString getTagName() const { return "FORMULA"; } /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); private: @@ -211,7 +211,7 @@ private: * The introduction of 'NameSequence' changed the DOM. * However, we need to read the old version. */ - void convertNames( QDomNode node ); + void convertNames( TQDomNode node ); /** * The document that owns (is) this formula. diff --git a/lib/kformula/fractionelement.cc b/lib/kformula/fractionelement.cc index 8652bf66..a8c1db9c 100644 --- a/lib/kformula/fractionelement.cc +++ b/lib/kformula/fractionelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -32,7 +32,7 @@ KFORMULA_NAMESPACE_BEGIN using namespace std; -FractionElement::FractionElement(BasicElement* parent) : BasicElement(parent), +FractionElement::FractionElement(BasicElement* tqparent) : BasicElement(tqparent), m_lineThicknessType( NoSize ), m_numAlign( NoHorizontalAlign ), m_denomAlign( NoHorizontalAlign ), @@ -81,12 +81,12 @@ void FractionElement::entered( SequenceElement* child ) BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = numerator->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -121,7 +121,7 @@ BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void FractionElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -140,10 +140,10 @@ void FractionElement::calcSizes( const ContextStyle& context, double linethickness = lineThickness( context, factor ); - setWidth( QMAX( numerator->getWidth(), denominator->getWidth() ) ); + setWidth( TQMAX( numerator->getWidth(), denominator->getWidth() ) ); setHeight( numerator->getHeight() + denominator->getHeight() + 2*distY + linethickness ); - setBaseline( qRound( numerator->getHeight() + distY + .5*linethickness + setBaseline( tqRound( numerator->getHeight() + distY + .5*linethickness + context.axisHeight( tstyle, factor ) ) ); numerator->setX( ( getWidth() - numerator->getWidth() ) / 2 ); @@ -155,18 +155,18 @@ void FractionElement::calcSizes( const ContextStyle& context, /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void FractionElement::draw( QPainter& painter, const LuPixelRect& r, +void FractionElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -184,12 +184,12 @@ void FractionElement::draw( QPainter& painter, const LuPixelRect& r, // TODO: thickness double factor = style.sizeFactor(); double linethickness = lineThickness( context, factor ); - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelY( linethickness ) ) ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), - context.layoutUnitToPixelX( myPos.x() + getWidth() ), - context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelY( linethickness ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), + context.tqlayoutUnitToPixelX( myPos.x() + getWidth() ), + context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); } } @@ -312,7 +312,7 @@ void FractionElement::moveDown(FormulaCursor* cursor, BasicElement* from) * Reinserts the denominator if it has been removed. */ void FractionElement::insert(FormulaCursor* cursor, - QPtrList& newChildren, + TQPtrList& newChildren, Direction direction) { if (cursor->getPos() == denominatorPos) { @@ -332,8 +332,8 @@ void FractionElement::insert(FormulaCursor* cursor, /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our numerator. * @@ -341,7 +341,7 @@ void FractionElement::insert(FormulaCursor* cursor, * are senseless and the caller is required to replace us. */ void FractionElement::remove(FormulaCursor* cursor, - QPtrList& removedChildren, + TQPtrList& removedChildren, Direction direction) { switch (cursor->getPos()) { @@ -362,7 +362,7 @@ void FractionElement::remove(FormulaCursor* cursor, /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ bool FractionElement::isSenseless() @@ -373,7 +373,7 @@ bool FractionElement::isSenseless() // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. SequenceElement* FractionElement::getMainChild() { @@ -407,18 +407,18 @@ void FractionElement::selectChild(FormulaCursor* cursor, BasicElement* child) /** * Appends our attributes to the dom element. */ -void FractionElement::writeDom(QDomElement element) +void FractionElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); if (!withLine()) element.setAttribute("NOLINE", 1); - QDomElement num = doc.createElement("NUMERATOR"); + TQDomElement num = doc.createElement("NUMERATOR"); num.appendChild(numerator->getElementDom(doc)); element.appendChild(num); - QDomElement den = doc.createElement("DENOMINATOR"); + TQDomElement den = doc.createElement("DENOMINATOR"); den.appendChild(denominator->getElementDom(doc)); element.appendChild(den); } @@ -427,12 +427,12 @@ void FractionElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool FractionElement::readAttributesFromDom(QDomElement element) +bool FractionElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString lineStr = element.attribute("NOLINE"); + TQString lineStr = element.attribute("NOLINE"); if(!lineStr.isNull()) { m_lineThicknessType = RelativeSize; m_lineThickness = lineStr.toInt(); @@ -444,12 +444,12 @@ bool FractionElement::readAttributesFromDom(QDomElement element) * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) +bool FractionElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString linethicknessStr = element.attribute( "linethickness" ).lower(); + TQString linethicknessStr = element.attribute( "linethickness" ).lower(); if ( ! linethicknessStr.isNull() ) { if ( linethicknessStr == "thin" ) { m_lineThicknessType = RelativeSize; @@ -467,7 +467,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_lineThickness = getSize( linethicknessStr, &m_lineThicknessType ); } } - QString numalignStr = element.attribute( "numalign" ).lower(); + TQString numalignStr = element.attribute( "numalign" ).lower(); if ( ! numalignStr.isNull() ) { if ( numalignStr == "left" ) { m_numAlign = LeftHorizontalAlign; @@ -479,7 +479,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_numAlign = RightHorizontalAlign; } } - QString denomalignStr = element.attribute( "denomalign" ).lower(); + TQString denomalignStr = element.attribute( "denomalign" ).lower(); if ( ! denomalignStr.isNull() ) { if ( denomalignStr == "left" ) { m_denomAlign = LeftHorizontalAlign; @@ -491,7 +491,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_denomAlign = RightHorizontalAlign; } } - QString bevelledStr = element.attribute( "bevelled" ).lower(); + TQString bevelledStr = element.attribute( "bevelled" ).lower(); if ( ! bevelledStr.isNull() ) { m_customBevelled = true; if ( bevelledStr == "true" ) { @@ -510,7 +510,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -bool FractionElement::readContentFromDom(QDomNode& node) +bool FractionElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -536,7 +536,7 @@ bool FractionElement::readContentFromDom(QDomNode& node) * that needs to be read. * Returns false if it failed. */ -int FractionElement::readContentFromMathMLDom(QDomNode& node) +int FractionElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -562,7 +562,7 @@ int FractionElement::readContentFromMathMLDom(QDomNode& node) return 1; } -QString FractionElement::toLatex() +TQString FractionElement::toLatex() { if ( withLine() ) { return "\\frac{" + numerator->toLatex() +"}{" + denominator->toLatex() + "}"; @@ -572,22 +572,22 @@ QString FractionElement::toLatex() } } -QString FractionElement::formulaString() +TQString FractionElement::formulaString() { return "(" + numerator->formulaString() + ")/(" + denominator->formulaString() + ")"; } -void FractionElement::writeMathMLAttributes( QDomElement& element ) const +void FractionElement::writeMathMLAttributes( TQDomElement& element ) const { switch ( m_lineThicknessType ) { case AbsoluteSize: - element.setAttribute( "linethickness", QString( "%1pt" ).arg( m_lineThickness ) ); + element.setAttribute( "linethickness", TQString( "%1pt" ).tqarg( m_lineThickness ) ); break; case RelativeSize: - element.setAttribute( "linethickness", QString( "%1%" ).arg( m_lineThickness * 100.0 ) ); + element.setAttribute( "linethickness", TQString( "%1%" ).tqarg( m_lineThickness * 100.0 ) ); break; case PixelSize: - element.setAttribute( "linethickness", QString( "%1px" ).arg( m_lineThickness ) ); + element.setAttribute( "linethickness", TQString( "%1px" ).tqarg( m_lineThickness ) ); break; default: break; @@ -626,8 +626,8 @@ void FractionElement::writeMathMLAttributes( QDomElement& element ) const } } -void FractionElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void FractionElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { numerator->writeMathML( doc, element, oasisFormat ); diff --git a/lib/kformula/fractionelement.h b/lib/kformula/fractionelement.h index 8a49a719..c578ee5b 100644 --- a/lib/kformula/fractionelement.h +++ b/lib/kformula/fractionelement.h @@ -36,7 +36,7 @@ public: enum { numeratorPos, denominatorPos }; - FractionElement(BasicElement* parent = 0); + FractionElement(BasicElement* tqparent = 0); ~FractionElement(); FractionElement( const FractionElement& ); @@ -66,11 +66,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -78,19 +78,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -125,23 +125,23 @@ public: /** * Reinserts the denominator if it has been removed. */ - virtual void insert(FormulaCursor*, QPtrList&, Direction); + virtual void insert(FormulaCursor*, TQPtrList&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our numerator. * * It is possible to remove the denominator. But after this we * are senseless and the caller is required to replace us. */ - virtual void remove(FormulaCursor*, QPtrList&, Direction); + virtual void remove(FormulaCursor*, TQPtrList&, Direction); // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); @@ -150,7 +150,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless(); @@ -182,11 +182,11 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -195,44 +195,44 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "FRACTION"; } + virtual TQString getTagName() const { return "FRACTION"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - virtual QString getElementName() const { return "mfrac"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return "mfrac"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; double lineThickness( const ContextStyle& context, double factor ); diff --git a/lib/kformula/glyphelement.cc b/lib/kformula/glyphelement.cc index 798621a2..381bbcf9 100644 --- a/lib/kformula/glyphelement.cc +++ b/lib/kformula/glyphelement.cc @@ -17,18 +17,18 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include "fontstyle.h" #include "glyphelement.h" KFORMULA_NAMESPACE_BEGIN -GlyphElement::GlyphElement( BasicElement* parent ) : TextElement( ' ', false, parent ) { +GlyphElement::GlyphElement( BasicElement* tqparent ) : TextElement( ' ', false, tqparent ) { } -bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool GlyphElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -40,7 +40,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) kdWarning( DEBUGID ) << "Required attribute fontfamily not found in glyph element\n"; return false; } - QString indexStr = element.attribute( "index" ); + TQString indexStr = element.attribute( "index" ); if ( indexStr.isNull() ) { kdWarning( DEBUGID ) << "Required attribute index not found in glyph element\n"; return false; @@ -51,7 +51,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) kdWarning( DEBUGID ) << "Invalid index value in glyph element\n"; return false; } - m_char = QChar( index ); + m_char = TQChar( index ); m_alt = element.attribute( "alt" ); if ( m_alt.isNull() ) { @@ -59,7 +59,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) return false; } - QStringList missing; + TQStringList missing; FontStyle::testFont( missing, m_fontFamily.lower() ); m_hasFont = missing.isEmpty(); @@ -69,7 +69,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void GlyphElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -78,19 +78,19 @@ void GlyphElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QRect bound; + TQRect bound; if ( m_hasFont ) { - QFont font( m_fontFamily ); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm ( font ); + TQFont font( m_fontFamily ); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm ( font ); bound = fm.boundingRect( m_char ); setWidth( context.ptToLayoutUnitPt( fm.width( m_char ) ) ); } else { - QFont font( context.getDefaultFont() ); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm ( font ); + TQFont font( context.getDefaultFont() ); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm ( font ); bound = fm.boundingRect( m_alt ); setWidth( context.ptToLayoutUnitPt( fm.width( m_alt ) ) ); } @@ -105,36 +105,36 @@ void GlyphElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/, +void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font; - QString text; + TQFont font; + TQString text; if ( m_hasFont ) { painter.setPen( style.color() ); setCharStyle( style.charStyle() ); setCharFamily( style.charFamily() ); - font = QFont( m_fontFamily ); + font = TQFont( m_fontFamily ); text = m_char; - painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ), + painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ), style.background() ); } else { @@ -142,17 +142,17 @@ void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/, font = context.getDefaultFont(); text = m_alt; } - font.setPointSizeFloat( context.layoutUnitToFontSize( mySize, false ) ); + font.setPointSizeFloat( context.tqlayoutUnitToFontSize( mySize, false ) ); painter.setFont( font ); - painter.drawText( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getBaseline() ), + painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ), text ); } -void GlyphElement::writeMathMLAttributes( QDomElement& element ) const +void GlyphElement::writeMathMLAttributes( TQDomElement& element ) const { element.setAttribute( "fontfamily", m_fontFamily ); - element.setAttribute( "index", m_char.unicode() ); + element.setAttribute( "index", m_char.tqunicode() ); element.setAttribute( "alt", m_alt ); } diff --git a/lib/kformula/glyphelement.h b/lib/kformula/glyphelement.h index 425caf10..dd6c6e8c 100644 --- a/lib/kformula/glyphelement.h +++ b/lib/kformula/glyphelement.h @@ -27,11 +27,11 @@ KFORMULA_NAMESPACE_BEGIN class GlyphElement : public TextElement { typedef TextElement inherited; public: - GlyphElement( BasicElement* parent = 0 ); + GlyphElement( BasicElement* tqparent = 0 ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -39,27 +39,27 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); protected: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); private: - virtual QString getElementName() const { return "mglyph"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mglyph"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QChar m_char; // Char to be shown - QString m_fontFamily; // Font family to use - QString m_alt; // Alternative text if font family not found + TQChar m_char; // Char to be shown + TQString m_fontFamily; // Font family to use + TQString m_alt; // Alternative text if font family not found bool m_hasFont; // Whether required font is available }; diff --git a/lib/kformula/identifierelement.cc b/lib/kformula/identifierelement.cc index a457403a..324151d5 100644 --- a/lib/kformula/identifierelement.cc +++ b/lib/kformula/identifierelement.cc @@ -32,13 +32,13 @@ KFORMULA_NAMESPACE_BEGIN -IdentifierElement::IdentifierElement( BasicElement* parent ) : TokenElement( parent ) {} +IdentifierElement::IdentifierElement( BasicElement* tqparent ) : TokenElement( tqparent ) {} /* * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* IdentifierElement::buildCommand( Container* container, Request* request ) { @@ -67,21 +67,21 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -89,7 +89,7 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addOperator: { @@ -100,9 +100,9 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques command->addCursor( cursor ); command->addToken( op ); command->addContent( op, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -114,9 +114,9 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques command->addCursor( cursor ); command->addToken( num ); command->addContent( num, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -159,7 +159,7 @@ void IdentifierElement::setStyleVariant( StyleAttributes& style ) style.setCustomMathVariant( false ); if ( customFontFamily() ) { style.setCustomFont( true ); - style.setFont( QFont(fontFamily()) ); + style.setFont( TQFont(fontFamily()) ); } bool fontweight = false; diff --git a/lib/kformula/identifierelement.h b/lib/kformula/identifierelement.h index 9c84c2ab..485fc28e 100644 --- a/lib/kformula/identifierelement.h +++ b/lib/kformula/identifierelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class IdentifierElement : public TokenElement { typedef TokenElement inherited; public: - IdentifierElement( BasicElement* parent = 0 ); + IdentifierElement( BasicElement* tqparent = 0 ); /** * This is called by the container to get a command depending on @@ -39,7 +39,7 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mi"; } + virtual TQString getElementName() const { return "mi"; } protected: virtual void setStyleVariant( StyleAttributes& style ); diff --git a/lib/kformula/indexelement.cc b/lib/kformula/indexelement.cc index 76c25d28..5e2ee3e5 100644 --- a/lib/kformula/indexelement.cc +++ b/lib/kformula/indexelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -38,7 +38,7 @@ class IndexSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - IndexSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + IndexSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual IndexSequenceElement* clone() { return new IndexSequenceElement( *this ); } @@ -90,8 +90,8 @@ KCommand* IndexSequenceElement::buildCommand( Container* container, Request* req } -IndexElement::IndexElement(BasicElement* parent) - : BasicElement(parent), +IndexElement::IndexElement(BasicElement* tqparent) + : BasicElement(tqparent), m_subScriptShiftType( NoSize ), m_superScriptShiftType( NoSize ), m_customAccentUnder( false ), @@ -184,29 +184,29 @@ bool IndexElement::accept( ElementVisitor* visitor ) } -QChar IndexElement::getCharacter() const +TQChar IndexElement::getCharacter() const { if ( !content->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperRight() && !upperRight->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperMiddle() && !upperMiddle->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperLeft() && !upperLeft->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerRight() && !lowerRight->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerMiddle() && !lowerMiddle->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerLeft() && !lowerLeft->isTextOnly() ) { - return QChar::null; + return TQChar::null; } return ' '; @@ -227,11 +227,11 @@ void IndexElement::entered( SequenceElement* child ) * Returns the element the point is in. */ BasicElement* IndexElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY()); + LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) return e; @@ -341,7 +341,7 @@ void IndexElement::setMiddleX(int xOffset, int middleWidth) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void IndexElement::calcSizes(const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -406,7 +406,7 @@ void IndexElement::calcSizes(const ContextStyle& context, // get the contents size content->calcSizes( context, tstyle, istyle, style ); - luPixel width = QMAX(content->getWidth(), QMAX(umWidth, lmWidth)); + luPixel width = TQMAX(content->getWidth(), TQMAX(umWidth, lmWidth)); luPixel toMidline = content->axis( context, tstyle, factor ); luPixel fromMidline = content->getHeight() - toMidline; @@ -436,7 +436,7 @@ void IndexElement::calcSizes(const ContextStyle& context, if (hasLowerRight()) { lowerRight->setX(width); } - width += QMAX(urWidth, lrWidth); + width += TQMAX(urWidth, lrWidth); // calculate the y offsets luPixel ulOffset = 0; @@ -445,10 +445,10 @@ void IndexElement::calcSizes(const ContextStyle& context, luPixel lrOffset = 0; if (content->isTextOnly()) { luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); - QFontMetrics fm(font); + TQFontMetrics fm(font); LuPixelRect bound = fm.boundingRect('x'); luPixel exBaseline = context.ptToLayoutUnitPt( -bound.top() ); @@ -463,12 +463,12 @@ void IndexElement::calcSizes(const ContextStyle& context, else { // the upper half - ulOffset = QMAX(ulMidline, ulHeight-toMidline); - urOffset = QMAX(urMidline, urHeight-toMidline); + ulOffset = TQMAX(ulMidline, ulHeight-toMidline); + urOffset = TQMAX(urMidline, urHeight-toMidline); // the lower half - llOffset = QMAX(content->getHeight()-llMidline, toMidline); - lrOffset = QMAX(content->getHeight()-lrMidline, toMidline); + llOffset = TQMAX(content->getHeight()-llMidline, toMidline); + lrOffset = TQMAX(content->getHeight()-lrMidline, toMidline); } // Add more offset if defined in attributes @@ -500,7 +500,7 @@ void IndexElement::calcSizes(const ContextStyle& context, break; } - luPixel height = QMAX(umHeight, QMAX(ulOffset, urOffset)); + luPixel height = TQMAX(umHeight, TQMAX(ulOffset, urOffset)); // the upper half content->setY(height); @@ -526,7 +526,7 @@ void IndexElement::calcSizes(const ContextStyle& context, lowerRight->setY( height + lrOffset ); } - fromMidline += QMAX(QMAX(llHeight+llOffset, lrHeight+lrOffset) - content->getHeight(), lmHeight); + fromMidline += TQMAX(TQMAX(llHeight+llOffset, lrHeight+lrOffset) - content->getHeight(), lmHeight); // set the result setWidth(width); @@ -542,18 +542,18 @@ void IndexElement::calcSizes(const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void IndexElement::draw( QPainter& painter, const LuPixelRect& r, +void IndexElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -582,8 +582,8 @@ void IndexElement::draw( QPainter& painter, const LuPixelRect& r, } // Debug - //painter.setBrush(Qt::NoBrush); - //painter.setPen(Qt::red); + //painter.setBrush(TQt::NoBrush); + //painter.setPen(TQt::red); //painter.drawRect(myPos.x(), myPos.y(), getWidth(), getHeight()); //painter.drawLine(myPos.x(), myPos.y()+getMidline(), // myPos.x()+getWidth(), myPos.y()+getMidline()); @@ -645,7 +645,7 @@ int IndexElement::getFromPos(BasicElement* from) else if (from == upperLeft) { return upperLeftPos; } - return parentPos; + return tqparentPos; } /** @@ -680,7 +680,7 @@ void IndexElement::moveLeft(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case parentPos: + case tqparentPos: if (hasLowerRight() && linear) { lowerRight->moveLeft(cursor, this); break; @@ -751,7 +751,7 @@ void IndexElement::moveRight(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case parentPos: + case tqparentPos: if (hasUpperLeft() && linear) { upperLeft->moveRight(cursor, this); break; @@ -885,12 +885,12 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) } -// children +// tqchildren // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. // void IndexElement::setMainChild(SequenceElement* child) // { @@ -902,7 +902,7 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -912,7 +912,7 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) * The list will be emptied but stays the property of the caller. */ void IndexElement::insert(FormulaCursor* cursor, - QPtrList& newChildren, + TQPtrList& newChildren, Direction direction) { SequenceElement* index = static_cast(newChildren.take(0)); @@ -954,8 +954,8 @@ void IndexElement::insert(FormulaCursor* cursor, /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -965,7 +965,7 @@ void IndexElement::insert(FormulaCursor* cursor, * The ownership of the list is passed to the caller. */ void IndexElement::remove(FormulaCursor* cursor, - QPtrList& removedChildren, + TQPtrList& removedChildren, Direction direction) { int pos = cursor->getPos(); @@ -983,9 +983,9 @@ void IndexElement::remove(FormulaCursor* cursor, setToLowerLeft(cursor); break; case contentPos: { - BasicElement* parent = getParent(); - parent->selectChild(cursor, this); - parent->remove(cursor, removedChildren, direction); + BasicElement* tqparent = getParent(); + tqparent->selectChild(cursor, this); + tqparent->remove(cursor, removedChildren, direction); break; } case upperMiddlePos: @@ -1032,7 +1032,7 @@ void IndexElement::normalize(FormulaCursor* cursor, Direction direction) /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ bool IndexElement::isSenseless() @@ -1227,43 +1227,43 @@ void IndexElement::moveToLowerRight(FormulaCursor* cursor, Direction direction) /** * Appends our attributes to the dom element. */ -void IndexElement::writeDom(QDomElement element) +void IndexElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement cont = doc.createElement("CONTENT"); + TQDomElement cont = doc.createElement("CONTENT"); cont.appendChild(content->getElementDom(doc)); element.appendChild(cont); if (hasUpperLeft()) { - QDomElement ind = doc.createElement("UPPERLEFT"); + TQDomElement ind = doc.createElement("UPPERLEFT"); ind.appendChild(upperLeft->getElementDom(doc)); element.appendChild(ind); } if (hasUpperMiddle()) { - QDomElement ind = doc.createElement("UPPERMIDDLE"); + TQDomElement ind = doc.createElement("UPPERMIDDLE"); ind.appendChild(upperMiddle->getElementDom(doc)); element.appendChild(ind); } if (hasUpperRight()) { - QDomElement ind = doc.createElement("UPPERRIGHT"); + TQDomElement ind = doc.createElement("UPPERRIGHT"); ind.appendChild(upperRight->getElementDom(doc)); element.appendChild(ind); } if (hasLowerLeft()) { - QDomElement ind = doc.createElement("LOWERLEFT"); + TQDomElement ind = doc.createElement("LOWERLEFT"); ind.appendChild(lowerLeft->getElementDom(doc)); element.appendChild(ind); } if (hasLowerMiddle()) { - QDomElement ind = doc.createElement("LOWERMIDDLE"); + TQDomElement ind = doc.createElement("LOWERMIDDLE"); ind.appendChild(lowerMiddle->getElementDom(doc)); element.appendChild(ind); } if (hasLowerRight()) { - QDomElement ind = doc.createElement("LOWERRIGHT"); + TQDomElement ind = doc.createElement("LOWERRIGHT"); ind.appendChild(lowerRight->getElementDom(doc)); element.appendChild(ind); } @@ -1273,7 +1273,7 @@ void IndexElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool IndexElement::readAttributesFromDom(QDomElement element) +bool IndexElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; @@ -1286,7 +1286,7 @@ bool IndexElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool IndexElement::readContentFromDom(QDomNode& node) +bool IndexElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -1345,28 +1345,28 @@ bool IndexElement::readContentFromDom(QDomNode& node) lowerLeftRead || lowerMiddleRead || lowerRightRead; } -bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool IndexElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString tag = element.tagName().stripWhiteSpace().lower(); + TQString tag = element.tagName().stripWhiteSpace().lower(); if ( tag == "msub" || tag == "msubsup" ) { - QString subscriptshiftStr = element.attribute( "subscriptshift" ).stripWhiteSpace().lower(); + TQString subscriptshiftStr = element.attribute( "subscriptshift" ).stripWhiteSpace().lower(); if ( ! subscriptshiftStr.isNull() ) { m_subScriptShift = getSize( subscriptshiftStr, &m_subScriptShiftType ); } } if ( tag == "msup" || tag == "msubsup" ) { - QString superscriptshiftStr = element.attribute( "superscriptshift" ).stripWhiteSpace().lower(); + TQString superscriptshiftStr = element.attribute( "superscriptshift" ).stripWhiteSpace().lower(); if ( ! superscriptshiftStr.isNull() ) { m_superScriptShift = getSize( superscriptshiftStr, &m_superScriptShiftType ); } } if ( tag == "munder" || tag == "munderover" ) { - QString accentunderStr = element.attribute( "accentunder" ).stripWhiteSpace().lower(); + TQString accentunderStr = element.attribute( "accentunder" ).stripWhiteSpace().lower(); if ( ! accentunderStr.isNull() ) { if ( accentunderStr == "true" ) { m_customAccentUnder = true; @@ -1383,7 +1383,7 @@ bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) } } if ( tag == "mover" || tag == "munderover" ) { - QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); + TQString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); if ( ! accentStr.isNull() ) { if ( accentStr == "true" ) { m_customAccent = true; @@ -1408,7 +1408,7 @@ bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ -int IndexElement::readContentFromMathMLDom( QDomNode& node ) +int IndexElement::readContentFromMathMLDom( TQDomNode& node ) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -1426,7 +1426,7 @@ int IndexElement::readContentFromMathMLDom( QDomNode& node ) node = node.nextSibling(); } - QString indexType = node.parentNode().toElement().tagName().lower(); + TQString indexType = node.tqparentNode().toElement().tagName().lower(); if ( indexType == "msub" ) { lowerRight = new SequenceElement( this ); int lowerRightNumber = lowerRight->buildMathMLChild( node ); @@ -1580,9 +1580,9 @@ ElementIndexPtr IndexElement::getIndex( int position ) -QString IndexElement::toLatex() +TQString IndexElement::toLatex() { - QString index; + TQString index; if ( hasUpperMiddle() ) { index += "\\overset{" + upperMiddle->toLatex() + "}{"; @@ -1622,9 +1622,9 @@ QString IndexElement::toLatex() return index; } -QString IndexElement::formulaString() +TQString IndexElement::formulaString() { - QString index = "(" + content->formulaString() + ")"; + TQString index = "(" + content->formulaString() + ")"; if ( hasLowerRight() ) { index += "_(" + lowerRight->formulaString() + ")"; } @@ -1634,7 +1634,7 @@ QString IndexElement::formulaString() return index; } -QString IndexElement::getElementName() const +TQString IndexElement::getElementName() const { if ( hasUpperMiddle() && hasLowerMiddle() ) return "munderover"; @@ -1653,19 +1653,19 @@ QString IndexElement::getElementName() const return "msubsup"; } -void IndexElement::writeMathMLAttributes( QDomElement& element ) const +void IndexElement::writeMathMLAttributes( TQDomElement& element ) const { - QString tag = getElementName(); + TQString tag = getElementName(); if ( tag == "msub" || tag == "msubsup" ) { switch ( m_subScriptShiftType ) { case AbsoluteSize: - element.setAttribute( "subscriptshift", QString( "%1pt" ).arg( m_subScriptShift ) ); + element.setAttribute( "subscriptshift", TQString( "%1pt" ).tqarg( m_subScriptShift ) ); break; case RelativeSize: - element.setAttribute( "subscriptshift", QString( "%1%" ).arg( m_subScriptShift * 100.0 ) ); + element.setAttribute( "subscriptshift", TQString( "%1%" ).tqarg( m_subScriptShift * 100.0 ) ); break; case PixelSize: - element.setAttribute( "subscriptshift", QString( "%1px" ).arg( m_subScriptShift ) ); + element.setAttribute( "subscriptshift", TQString( "%1px" ).tqarg( m_subScriptShift ) ); break; default: break; @@ -1674,13 +1674,13 @@ void IndexElement::writeMathMLAttributes( QDomElement& element ) const if ( tag == "msup" || tag == "msubsup" ) { switch ( m_superScriptShiftType ) { case AbsoluteSize: - element.setAttribute( "superscriptshift", QString( "%1pt" ).arg( m_superScriptShift ) ); + element.setAttribute( "superscriptshift", TQString( "%1pt" ).tqarg( m_superScriptShift ) ); break; case RelativeSize: - element.setAttribute( "superscriptshift", QString( "%1%" ).arg( m_superScriptShift * 100.0 ) ); + element.setAttribute( "superscriptshift", TQString( "%1%" ).tqarg( m_superScriptShift * 100.0 ) ); break; case PixelSize: - element.setAttribute( "superscriptshift", QString( "%1px" ).arg( m_superScriptShift ) ); + element.setAttribute( "superscriptshift", TQString( "%1px" ).tqarg( m_superScriptShift ) ); break; default: break; @@ -1699,11 +1699,11 @@ void IndexElement::writeMathMLAttributes( QDomElement& element ) const } -void IndexElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void IndexElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { - QDomElement de; + TQDomElement de; content->writeMathML( doc, element, oasisFormat ); // base if ( hasUpperMiddle() && hasLowerMiddle() ) diff --git a/lib/kformula/indexelement.h b/lib/kformula/indexelement.h index 06aac43d..49b03bc7 100644 --- a/lib/kformula/indexelement.h +++ b/lib/kformula/indexelement.h @@ -35,7 +35,7 @@ class IndexElement : public BasicElement { IndexElement& operator=( const IndexElement& ) { return *this; } public: - IndexElement(BasicElement* parent = 0); + IndexElement(BasicElement* tqparent = 0); ~IndexElement(); IndexElement( const IndexElement& ); @@ -49,9 +49,9 @@ public: /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const; + virtual TQChar getCharacter() const; /** * The cursor has entered one of our child sequences. @@ -66,7 +66,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); // drawing // @@ -77,7 +77,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -85,19 +85,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -137,7 +137,7 @@ public: */ virtual void moveDown(FormulaCursor* cursor, BasicElement* from); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -151,7 +151,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return content; } //SequenceElement* upperLeft; @@ -163,7 +163,7 @@ public: /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -172,11 +172,11 @@ public: * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList&, Direction); + virtual void insert(FormulaCursor*, TQPtrList&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -185,7 +185,7 @@ public: * * The ownership of the list is passed to the caller. */ - virtual void remove(FormulaCursor*, QPtrList&, Direction); + virtual void remove(FormulaCursor*, TQPtrList&, Direction); /** * Moves the cursor to a normal place where new elements @@ -212,7 +212,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless(); @@ -259,12 +259,12 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); // the upper right index is the only one we show - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -273,39 +273,39 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "INDEX"; } + virtual TQString getTagName() const { return "INDEX"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const ; - virtual void writeMathMLAttributes( QDomElement& element ) const ; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const ; + virtual void writeMathMLAttributes( TQDomElement& element ) const ; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); - virtual bool readAttributesFromMathMLDom( const QDomElement& element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement& element ); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. It is sometimes needed to read more than one node * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom( QDomNode& node ); + virtual int readContentFromMathMLDom( TQDomNode& node ); private: @@ -314,78 +314,78 @@ private: */ class IndexElementIndex : public ElementIndex { public: - IndexElementIndex(IndexElement* p) : parent(p) {} - virtual IndexElement* getElement() { return parent; } + IndexElementIndex(IndexElement* p) : tqparent(p) {} + virtual IndexElement* getElement() { return tqparent; } protected: - IndexElement* parent; + IndexElement* tqparent; }; // We have a (very simple) type for every index. class UpperLeftIndex : public IndexElementIndex { public: - UpperLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperLeftIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperLeft(cursor, direction); } + { tqparent->moveToUpperLeft(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperLeft(cursor); } + { tqparent->setToUpperLeft(cursor); } virtual bool hasIndex() const - { return parent->hasUpperLeft(); } + { return tqparent->hasUpperLeft(); } }; class LowerLeftIndex : public IndexElementIndex { public: - LowerLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerLeftIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerLeft(cursor, direction); } + { tqparent->moveToLowerLeft(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerLeft(cursor); } + { tqparent->setToLowerLeft(cursor); } virtual bool hasIndex() const - { return parent->hasLowerLeft(); } + { return tqparent->hasLowerLeft(); } }; class UpperMiddleIndex : public IndexElementIndex { public: - UpperMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperMiddleIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperMiddle(cursor, direction); } + { tqparent->moveToUpperMiddle(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperMiddle(cursor); } + { tqparent->setToUpperMiddle(cursor); } virtual bool hasIndex() const - { return parent->hasUpperMiddle(); } + { return tqparent->hasUpperMiddle(); } }; class LowerMiddleIndex : public IndexElementIndex { public: - LowerMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerMiddleIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerMiddle(cursor, direction); } + { tqparent->moveToLowerMiddle(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerMiddle(cursor); } + { tqparent->setToLowerMiddle(cursor); } virtual bool hasIndex() const - { return parent->hasLowerMiddle(); } + { return tqparent->hasLowerMiddle(); } }; class UpperRightIndex : public IndexElementIndex { public: - UpperRightIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperRightIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperRight(cursor, direction); } + { tqparent->moveToUpperRight(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperRight(cursor); } + { tqparent->setToUpperRight(cursor); } virtual bool hasIndex() const - { return parent->hasUpperRight(); } + { return tqparent->hasUpperRight(); } }; class LowerRightIndex : public IndexElementIndex { public: - LowerRightIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerRightIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerRight(cursor, direction); } + { tqparent->moveToLowerRight(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerRight(cursor); } + { tqparent->setToLowerRight(cursor); } virtual bool hasIndex() const - { return parent->hasLowerRight(); } + { return tqparent->hasLowerRight(); } }; diff --git a/lib/kformula/kformulacommand.cc b/lib/kformula/kformulacommand.cc index 24d49019..804b66c6 100644 --- a/lib/kformula/kformulacommand.cc +++ b/lib/kformula/kformulacommand.cc @@ -20,7 +20,7 @@ #include //This is for undo descriptions -#include +#include #include "formulacursor.h" #include "formulaelement.h" @@ -36,7 +36,7 @@ KFORMULA_NAMESPACE_BEGIN int PlainCommand::evilDestructionCount = 0; -PlainCommand::PlainCommand( const QString& name ) +PlainCommand::PlainCommand( const TQString& name ) : KNamedCommand(name) { evilDestructionCount++; @@ -47,7 +47,7 @@ PlainCommand::~PlainCommand() evilDestructionCount--; } -Command::Command(const QString &name, Container* document) +Command::Command(const TQString &name, Container* document) : PlainCommand(name), cursordata(0), undocursor(0), doc(document) { } @@ -93,7 +93,7 @@ void Command::setUnexecuteCursor(FormulaCursor* cursor) // ****** Generic Add command -KFCAdd::KFCAdd(const QString &name, Container *document) +KFCAdd::KFCAdd(const TQString &name, Container *document) : Command(name, document) { addList.setAutoDelete( true ); @@ -148,7 +148,7 @@ void KFCRemoveSelection::unexecute() -KFCReplace::KFCReplace(const QString &name, Container* document) +KFCReplace::KFCReplace(const TQString &name, Container* document) : KFCAdd(name, document), removeSelection(0) { } @@ -180,15 +180,15 @@ void KFCReplace::unexecute() // ****** Token Add command -KFCAddToken::KFCAddToken(const QString &name, Container *document) +KFCAddToken::KFCAddToken(const TQString &name, Container *document) : Command(name, document) { } KFCAddToken::~KFCAddToken() { - QPtrDictIterator< QPtrList< BasicElement > > it( contentList ); - QPtrList< BasicElement >* list; + TQPtrDictIterator< TQPtrList< BasicElement > > it( contentList ); + TQPtrList< BasicElement >* list; while ( ( list = it.current() ) != 0 ) { delete list; ++it; @@ -199,15 +199,15 @@ void KFCAddToken::execute() { kdDebug( DEBUGID ) << k_funcinfo << endl; FormulaCursor* cursor = getExecuteCursor(); - QPtrList tokenListTmp = tokenList; + TQPtrList tokenListTmp = tokenList; cursor->insert( tokenList, beforeCursor ); tokenList = tokenListTmp; - QPtrListIterator< BasicElement > it( tokenList ); + TQPtrListIterator< BasicElement > it( tokenList ); BasicElement* element; BasicElement* current = cursor->getElement(); while ( (element = it.current()) != 0 ) { element->goInside( cursor ); - cursor->insert( *contentList.find( element ), beforeCursor ); + cursor->insert( *contentList.tqfind( element ), beforeCursor ); ++it; } setUnexecuteCursor( cursor ); @@ -220,20 +220,20 @@ void KFCAddToken::unexecute() { kdDebug( DEBUGID ) << k_funcinfo << endl; FormulaCursor* cursor = getUnexecuteCursor(); - SequenceElement* parent = static_cast(cursor->getElement()->getParent()); + SequenceElement* tqparent = static_cast(cursor->getElement()->getParent()); for ( int i = 0; i < tokenList.count(); i++ ) { SequenceElement* current = static_cast(cursor->getElement()); - QPtrList< BasicElement > list; + TQPtrList< BasicElement > list; for ( uint i = 0; i < current->countChildren(); ++i ) { cursor->remove( list, beforeCursor ); } - if ( parent ) { - int pos = parent->childPos( current ); - cursor->setTo( parent, pos + 1); + if ( tqparent ) { + int pos = tqparent->childPos( current ); + cursor->setTo( tqparent, pos + 1); cursor->remove( list, beforeCursor ); if ( pos > 0 ) { - BasicElement* element = parent->getChild( pos - 1 ); + BasicElement* element = tqparent->getChild( pos - 1 ); if (element) element->moveEnd( cursor ); } @@ -248,11 +248,11 @@ void KFCAddToken::unexecute() void KFCAddToken::addToken( BasicElement* element ) { tokenList.append( element ); - contentList.insert( element, new QPtrList< BasicElement > ); - contentList.find( element )->setAutoDelete( true ); + contentList.insert( element, new TQPtrList< BasicElement > ); + contentList.tqfind( element )->setAutoDelete( true ); } -KFCReplaceToken::KFCReplaceToken(const QString &name, Container* document) +KFCReplaceToken::KFCReplaceToken(const TQString &name, Container* document) : KFCAddToken(name, document), removeSelection(0) { } @@ -284,7 +284,7 @@ void KFCReplaceToken::unexecute() } -KFCSplitToken::KFCSplitToken(const QString &name, Container* document) +KFCSplitToken::KFCSplitToken(const TQString &name, Container* document) : KFCAddToken(name, document), removeSelection(0) { splitList.setAutoDelete( true ); @@ -306,15 +306,15 @@ void KFCSplitToken::execute() removeSelection->execute(); } splitCursor = cursor->getCursorData(); - SequenceElement* parent = static_cast( cursor->getElement() ); - if ( parent ) { - cursor->setMark( parent->countChildren() ); + SequenceElement* tqparent = static_cast( cursor->getElement() ); + if ( tqparent ) { + cursor->setMark( tqparent->countChildren() ); cursor->setSelection( true ); } cursor->remove( splitList, afterCursor ); TokenElement *token = new TokenElement();// TODO addToken( token ); - QPtrListIterator< BasicElement > it ( splitList ); + TQPtrListIterator< BasicElement > it ( splitList ); BasicElement* element; while ( ( element = it.current() ) != 0 ) { addContent( token, element ); @@ -322,8 +322,8 @@ void KFCSplitToken::execute() } KFCAddToken::execute(); cursor = getExecuteCursor(); - if ( parent ) { - BasicElement* child = parent->getChild( cursor->getPos() ); + if ( tqparent ) { + BasicElement* child = tqparent->getChild( cursor->getPos() ); if ( child ) { child->moveEnd( cursor ); } @@ -425,7 +425,7 @@ void KFCRemoveEnclosing::unexecute() // ****** Add root, bracket etc command -KFCAddReplacing::KFCAddReplacing(const QString &name, Container* document) +KFCAddReplacing::KFCAddReplacing(const TQString &name, Container* document) : Command(name, document), element(0) { } @@ -496,7 +496,7 @@ void KFCAddIndex::unexecute() } -KFCChangeBaseSize::KFCChangeBaseSize( const QString& name, Container* document, +KFCChangeBaseSize::KFCChangeBaseSize( const TQString& name, Container* document, FormulaElement* formula, int size ) : PlainCommand( name ), m_document( document ), m_formula( formula ), m_size( size ) { @@ -516,7 +516,7 @@ void KFCChangeBaseSize::unexecute() } -FontCommand::FontCommand( const QString& name, Container* document ) +FontCommand::FontCommand( const TQString& name, Container* document ) : Command( name, document ) { list.setAutoDelete( false ); @@ -534,10 +534,10 @@ void FontCommand::collectChildren() } -void FontCommand::parseSequences( const QMap& parents ) +void FontCommand::parseSequences( const TQMap& tqparents ) { - QValueList sequences = parents.keys(); - for ( QValueList::iterator i = sequences.begin(); + TQValueList sequences = tqparents.keys(); + for ( TQValueList::iterator i = sequences.begin(); i != sequences.end(); ++i ) { ( *i )->parse(); @@ -545,7 +545,7 @@ void FontCommand::parseSequences( const QMap& parents ) } -CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container* document ) +CharStyleCommand::CharStyleCommand( CharStyle cs, const TQString& name, Container* document ) : FontCommand( name, document ), charStyle( cs ) { } @@ -553,37 +553,37 @@ CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container void CharStyleCommand::execute() { collectChildren(); - QMap parentCollector; + TQMap tqparentCollector; styleList.clear(); - uint count = childrenList().count(); + uint count = tqchildrenList().count(); styleList.reserve( count ); for ( uint i=0; igetCharStyle(); child->setCharStyle( charStyle ); - parentCollector[static_cast( child->getParent() )] = 1; + tqparentCollector[static_cast( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } void CharStyleCommand::unexecute() { - QMap parentCollector; - uint count = childrenList().count(); + TQMap tqparentCollector; + uint count = tqchildrenList().count(); //styleList.reserve( count ); for ( uint i=0; isetCharStyle( styleList[i] ); - parentCollector[static_cast( child->getParent() )] = 1; + tqparentCollector[static_cast( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } -CharFamilyCommand::CharFamilyCommand( CharFamily cf, const QString& name, Container* document ) +CharFamilyCommand::CharFamilyCommand( CharFamily cf, const TQString& name, Container* document ) : FontCommand( name, document ), charFamily( cf ) { } @@ -592,32 +592,32 @@ void CharFamilyCommand::execute() { collectChildren(); - QMap parentCollector; + TQMap tqparentCollector; familyList.clear(); - uint count = childrenList().count(); + uint count = tqchildrenList().count(); familyList.reserve( count ); for ( uint i=0; igetCharFamily(); child->setCharFamily( charFamily ); - parentCollector[static_cast( child->getParent() )] = 1; + tqparentCollector[static_cast( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } void CharFamilyCommand::unexecute() { - QMap parentCollector; - uint count = childrenList().count(); + TQMap tqparentCollector; + uint count = tqchildrenList().count(); //familyList.reserve( count ); for ( uint i=0; isetCharFamily( familyList[i] ); - parentCollector[static_cast( child->getParent() )] = 1; + tqparentCollector[static_cast( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } diff --git a/lib/kformula/kformulacommand.h b/lib/kformula/kformulacommand.h index 0e13928e..ec014604 100644 --- a/lib/kformula/kformulacommand.h +++ b/lib/kformula/kformulacommand.h @@ -21,10 +21,10 @@ #ifndef KFORMULACOMMAND_H #define KFORMULACOMMAND_H -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -61,7 +61,7 @@ public: * * @param name a description to be used as menu entry. */ - PlainCommand(const QString& name); + PlainCommand(const TQString& name); virtual ~PlainCommand(); /** @@ -89,7 +89,7 @@ public: * @param name a description to be used as menu entry. * @param document the container we are working for. */ - Command(const QString& name, Container* document); + Command(const TQString& name, Container* document); virtual ~Command(); protected: @@ -164,7 +164,7 @@ class KFCAdd : public Command { public: - KFCAdd(const QString &name, Container* document); + KFCAdd(const TQString &name, Container* document); virtual void execute(); virtual void unexecute(); @@ -180,7 +180,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList addList; + TQPtrList addList; }; @@ -207,7 +207,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList removedList; + TQPtrList removedList; Direction dir; }; @@ -221,7 +221,7 @@ class KFCReplace : public KFCAdd { public: - KFCReplace(const QString &name, Container* document); + KFCReplace(const TQString &name, Container* document); ~KFCReplace(); virtual void execute(); @@ -241,7 +241,7 @@ private: class KFCAddToken : public Command { public: - KFCAddToken( const QString &name, Container *document); + KFCAddToken( const TQString &name, Container *document); ~KFCAddToken(); virtual void execute(); @@ -256,7 +256,7 @@ public: * Collect content for each token */ void addContent( BasicElement* element, BasicElement* content ) { - contentList.find( element )->append( content ); + contentList.tqfind( element )->append( content ); } @@ -265,12 +265,12 @@ private: /** * List where all token elements are stored. */ - QPtrList< BasicElement > tokenList; + TQPtrList< BasicElement > tokenList; /** * Dictionary where all content elements are stored */ - QPtrDict< QPtrList< BasicElement > > contentList; + TQPtrDict< TQPtrList< BasicElement > > contentList; }; /** @@ -281,7 +281,7 @@ class KFCReplaceToken : public KFCAddToken { public: - KFCReplaceToken(const QString &name, Container* document); + KFCReplaceToken(const TQString &name, Container* document); ~KFCReplaceToken(); virtual void execute(); @@ -306,7 +306,7 @@ class KFCSplitToken : public KFCAddToken { public: - KFCSplitToken(const QString &name, Container* document); + KFCSplitToken(const TQString &name, Container* document); ~KFCSplitToken(); virtual void execute(); @@ -327,7 +327,7 @@ private: /** * The list of elements that are splited into another token */ - QPtrList< BasicElement > splitList; + TQPtrList< BasicElement > splitList; /** * Information about cursor position where the split is made. @@ -366,7 +366,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList removedList; + TQPtrList removedList; /** * The element we might have extracted. @@ -385,7 +385,7 @@ private: /** - * Command to remove the parent element. + * Command to remove the tqparent element. */ class KFCRemoveEnclosing : public Command { @@ -410,7 +410,7 @@ private: class KFCAddReplacing : public Command { public: - KFCAddReplacing(const QString &name, Container* document); + KFCAddReplacing(const TQString &name, Container* document); ~KFCAddReplacing(); virtual void execute(); @@ -468,7 +468,7 @@ class FormulaElement; class KFCChangeBaseSize : public PlainCommand { public: - KFCChangeBaseSize( const QString& name, Container* document, FormulaElement* formula, int size ); + KFCChangeBaseSize( const TQString& name, Container* document, FormulaElement* formula, int size ); void execute(); void unexecute(); @@ -487,7 +487,7 @@ private: */ class FontCommand : public Command { public: - FontCommand( const QString& name, Container* document ); + FontCommand( const TQString& name, Container* document ); /** * Collects all elements that are to be modified. @@ -495,17 +495,17 @@ public: void addTextElement( TextElement* element ) { list.append(element); } /** - * Collects all parent elements those children are to be changend. + * Collects all tqparent elements those tqchildren are to be changend. */ void addElement( BasicElement* element ) { elementList.append( element ); } protected: - QPtrList& childrenList() { return list; } + TQPtrList& tqchildrenList() { return list; } void collectChildren(); - void parseSequences( const QMap& parents ); + void parseSequences( const TQMap& tqparents ); private: @@ -513,25 +513,25 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList list; + TQPtrList list; - QPtrList elementList; + TQPtrList elementList; }; /** - * Changes the char style of a number of elements an their children. + * Changes the char style of a number of elements an their tqchildren. */ class CharStyleCommand : public FontCommand { public: - CharStyleCommand( CharStyle cs, const QString& name, Container* document ); + CharStyleCommand( CharStyle cs, const TQString& name, Container* document ); virtual void execute(); virtual void unexecute(); private: - typedef QValueVector StyleList; + typedef TQValueVector StyleList; StyleList styleList; CharStyle charStyle; @@ -539,18 +539,18 @@ private: /** - * Changes the char family of a number of elements an their children. + * Changes the char family of a number of elements an their tqchildren. */ class CharFamilyCommand : public FontCommand { public: - CharFamilyCommand( CharFamily cf, const QString& name, Container* document ); + CharFamilyCommand( CharFamily cf, const TQString& name, Container* document ); virtual void execute(); virtual void unexecute(); private: - typedef QValueVector FamilyList; + typedef TQValueVector FamilyList; FamilyList familyList; CharFamily charFamily; diff --git a/lib/kformula/kformulacompatibility.cc b/lib/kformula/kformulacompatibility.cc index 70f77ed9..434bd28b 100644 --- a/lib/kformula/kformulacompatibility.cc +++ b/lib/kformula/kformulacompatibility.cc @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include "kformuladefs.h" @@ -45,7 +45,7 @@ const BoxType OF_SUB = '_' + UNUSED_OFFSET; const BoxType OF_LSUP = '6' + UNUSED_OFFSET; const BoxType OF_LSUB = '%' + UNUSED_OFFSET; //const BoxType PAREN = '('; -//const BoxType EQUAL = '='; +//const BoxType ETQUAL = '='; //const BoxType MORE = '>'; //const BoxType LESS = '<'; //const BoxType ABS = '|'; @@ -71,19 +71,19 @@ Compatibility::Compatibility() } -QDomDocument Compatibility::buildDOM(QString text) +TQDomDocument Compatibility::buildDOM(TQString text) { - QDomDocument doc("KFORMULA"); + TQDomDocument doc("KFORMULA"); pos = 0; formulaString = text; - QDomElement formula = readSequence(doc); + TQDomElement formula = readSequence(doc); formula.setTagName("FORMULA"); doc.appendChild(formula); return doc; } -void Compatibility::appendNextSequence(const QDomDocument& doc, QDomElement element) +void Compatibility::appendNextSequence(const TQDomDocument& doc, TQDomElement element) { if (hasNext() && nextToken() == '{') { element.appendChild(readSequence(doc)); @@ -95,16 +95,16 @@ void Compatibility::appendNextSequence(const QDomDocument& doc, QDomElement elem } -QDomElement Compatibility::getLastSequence(const QDomDocument& doc, QDomElement sequence) +TQDomElement Compatibility::getLastSequence(const TQDomDocument& doc, TQDomElement sequence) { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomNode child = sequence.removeChild(sequence.lastChild()); + TQDomNode child = sequence.removeChild(sequence.lastChild()); return child.toElement(); } else { - QDomElement newSeq = doc.createElement("SEQUENCE"); + TQDomElement newSeq = doc.createElement("SEQUENCE"); if (!sequence.lastChild().isNull()) { - QDomNode child = sequence.removeChild(sequence.lastChild()); + TQDomNode child = sequence.removeChild(sequence.lastChild()); newSeq.appendChild(child); } return newSeq; @@ -112,15 +112,15 @@ QDomElement Compatibility::getLastSequence(const QDomDocument& doc, QDomElement } -QDomElement Compatibility::findIndexNode(const QDomDocument& doc, QDomElement sequence) +TQDomElement Compatibility::findIndexNode(const TQDomDocument& doc, TQDomElement sequence) { - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); con.appendChild(getLastSequence(doc, sequence)); sequence.appendChild(element); @@ -129,14 +129,14 @@ QDomElement Compatibility::findIndexNode(const QDomDocument& doc, QDomElement se } -void Compatibility::appendToSequence(QDomElement sequence, QDomElement element, int leftIndexSeen) +void Compatibility::appendToSequence(TQDomElement sequence, TQDomElement element, int leftIndexSeen) { if (leftIndexSeen > 0) { if (sequence.lastChild().nodeName() == "INDEX") { - QDomElement index = sequence.lastChild().toElement(); + TQDomElement index = sequence.lastChild().toElement(); if ((index.firstChild().nodeName() == "CONTENT") && (index.firstChild().firstChild().nodeName() == "SEQUENCE")) { - QDomElement seq = index.firstChild().firstChild().toElement(); + TQDomElement seq = index.firstChild().firstChild().toElement(); if (element.nodeName() == "SEQUENCE") { index.firstChild().replaceChild(element, seq); } @@ -151,9 +151,9 @@ void Compatibility::appendToSequence(QDomElement sequence, QDomElement element, } -QDomElement Compatibility::readMatrix(const QDomDocument& doc) +TQDomElement Compatibility::readMatrix(const TQDomDocument& doc) { - QDomElement element = doc.createElement("MATRIX"); + TQDomElement element = doc.createElement("MATRIX"); uint cols = nextToken(); nextToken(); @@ -163,11 +163,11 @@ QDomElement Compatibility::readMatrix(const QDomDocument& doc) element.setAttribute("COLUMNS", cols); if ((nextToken() == '}') && (nextToken() == OF_MATRIX) && (nextToken() == '{')) { - QValueList matrix; + TQValueList matrix; for (uint c = 0; c < cols; c++) { for (uint r = 0; r < rows; r++) { if (hasNext() && (nextToken() == '{')) { - QDomElement tmp = readSequence(doc); + TQDomElement tmp = readSequence(doc); matrix.append(tmp); } if (hasNext() && (nextToken() != OF_SEPARATOR)) { @@ -195,7 +195,7 @@ QDomElement Compatibility::readMatrix(const QDomDocument& doc) } -QDomElement Compatibility::readSequence(const QDomDocument& doc) +TQDomElement Compatibility::readSequence(const TQDomDocument& doc) { // matrizes start with something that isn't a sequence if ((tokenLeft() > 6) && (lookAhead(1) == OF_SEPARATOR)) { @@ -203,7 +203,7 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) } int leftIndexSeen = 0; - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); while (hasNext()) { ushort ch = nextToken(); @@ -227,24 +227,24 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) sequence.removeChild(sequence.lastChild()); } - QDomElement element = doc.createElement("BRACKET"); + TQDomElement element = doc.createElement("BRACKET"); appendToSequence(sequence, element, leftIndexSeen); element.setAttribute("LEFT", ch); element.setAttribute("RIGHT", (ch=='(') ? ')' : ((ch=='[') ? ']' : '|')); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); appendNextSequence(doc, con); break; } case OF_DIVIDE: { - QDomElement element = doc.createElement("FRACTION"); + TQDomElement element = doc.createElement("FRACTION"); - QDomElement num = doc.createElement("NUMERATOR"); + TQDomElement num = doc.createElement("NUMERATOR"); element.appendChild(num); num.appendChild(getLastSequence(doc, sequence)); - QDomElement den = doc.createElement("DENOMINATOR"); + TQDomElement den = doc.createElement("DENOMINATOR"); element.appendChild(den); appendNextSequence(doc, den); @@ -252,12 +252,12 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_SQRT: { - QDomElement element = doc.createElement("ROOT"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement element = doc.createElement("ROOT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); appendNextSequence(doc, con); - QDomElement ind = doc.createElement("INDEX"); + TQDomElement ind = doc.createElement("INDEX"); element.appendChild(ind); ind.appendChild(getLastSequence(doc, sequence)); @@ -265,31 +265,31 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_POWER: { - QDomElement element = findIndexNode(doc, sequence); - QDomElement upperRight = doc.createElement("UPPERRIGHT"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement upperRight = doc.createElement("UPPERRIGHT"); element.appendChild(upperRight); appendNextSequence(doc, upperRight); break; } case OF_SUB: { - QDomElement element = findIndexNode(doc, sequence); - QDomElement lowerRight = doc.createElement("LOWERRIGHT"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement lowerRight = doc.createElement("LOWERRIGHT"); element.appendChild(lowerRight); appendNextSequence(doc, lowerRight); break; } case OF_LSUP: { - QDomElement upperLeft = doc.createElement("UPPERLEFT"); + TQDomElement upperLeft = doc.createElement("UPPERLEFT"); upperLeft.appendChild(getLastSequence(doc, sequence)); - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); - QDomElement seq = doc.createElement("SEQUENCE"); + TQDomElement seq = doc.createElement("SEQUENCE"); con.appendChild(seq); appendToSequence(sequence, element, leftIndexSeen); } @@ -298,17 +298,17 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_LSUB: { - QDomElement lowerLeft = doc.createElement("LOWERLEFT"); + TQDomElement lowerLeft = doc.createElement("LOWERLEFT"); lowerLeft.appendChild(getLastSequence(doc, sequence)); - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); - QDomElement seq = doc.createElement("SEQUENCE"); + TQDomElement seq = doc.createElement("SEQUENCE"); con.appendChild(seq); appendToSequence(sequence, element, leftIndexSeen); } @@ -318,14 +318,14 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) } case OF_ABOVE: { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomElement seq = sequence.lastChild().toElement(); + TQDomElement seq = sequence.lastChild().toElement(); if ((seq.childNodes().count() == 1) && ((seq.lastChild().nodeName() == "SYMBOL") || (seq.lastChild().nodeName() == "INDEX"))) { sequence.removeChild(seq); - QDomElement element = seq.lastChild().toElement(); - QDomElement upper = (element.nodeName() == "SYMBOL") ? + TQDomElement element = seq.lastChild().toElement(); + TQDomElement upper = (element.nodeName() == "SYMBOL") ? doc.createElement("UPPER") : doc.createElement("UPPERMIDDLE"); element.appendChild(upper); @@ -334,22 +334,22 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } } - QDomElement element = findIndexNode(doc, sequence); - QDomElement upper = doc.createElement("UPPERMIDDLE"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement upper = doc.createElement("UPPERMIDDLE"); element.appendChild(upper); appendNextSequence(doc, upper); break; } case OF_BELOW: { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomElement seq = sequence.lastChild().toElement(); + TQDomElement seq = sequence.lastChild().toElement(); if ((seq.childNodes().count() == 1) && ((seq.lastChild().nodeName() == "SYMBOL") || (seq.lastChild().nodeName() == "INDEX"))) { sequence.removeChild(seq); - QDomElement element = seq.lastChild().toElement(); - QDomElement lower = (element.nodeName() == "SYMBOL") ? + TQDomElement element = seq.lastChild().toElement(); + TQDomElement lower = (element.nodeName() == "SYMBOL") ? doc.createElement("LOWER") : doc.createElement("LOWERMIDDLE"); element.appendChild(lower); @@ -358,8 +358,8 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } } - QDomElement element = findIndexNode(doc, sequence); - QDomElement lower = doc.createElement("LOWERMIDDLE"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement lower = doc.createElement("LOWERMIDDLE"); element.appendChild(lower); appendNextSequence(doc, lower); break; @@ -370,12 +370,12 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) case INTEGRAL: case SUM: case PRODUCT: { - QDomElement element = doc.createElement("SYMBOL"); + TQDomElement element = doc.createElement("SYMBOL"); element.setAttribute("TYPE", (ch==INTEGRAL) ? Integral : ((ch==SUM) ? Sum : Product)); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); con.appendChild(readSequence(doc)); pushback(); @@ -383,15 +383,15 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case ARROW: { - QDomElement element = doc.createElement("TEXT"); - element.setAttribute("CHAR", QString(QChar(static_cast(174)))); + TQDomElement element = doc.createElement("TEXT"); + element.setAttribute("CHAR", TQString(TQChar(static_cast(174)))); element.setAttribute("SYMBOL", "1"); appendToSequence(sequence, element, leftIndexSeen); break; } default: { - QDomElement element = doc.createElement("TEXT"); - element.setAttribute("CHAR", QString(formulaString[pos-1])); + TQDomElement element = doc.createElement("TEXT"); + element.setAttribute("CHAR", TQString(formulaString[pos-1])); appendToSequence(sequence, element, leftIndexSeen); } } diff --git a/lib/kformula/kformulacompatibility.h b/lib/kformula/kformulacompatibility.h index 98c268cc..9be5c7ba 100644 --- a/lib/kformula/kformulacompatibility.h +++ b/lib/kformula/kformulacompatibility.h @@ -20,8 +20,8 @@ #ifndef KFORMULACOMPATIBILITY_H #define KFORMULACOMPATIBILITY_H -#include -#include +#include +#include KFORMULA_NAMESPACE_BEGIN @@ -37,22 +37,22 @@ public: /** * Builds a kformula DOM from a old formula string. */ - QDomDocument buildDOM(QString text); + TQDomDocument buildDOM(TQString text); private: - QDomElement readSequence(const QDomDocument& doc); - QDomElement readMatrix(const QDomDocument& doc); + TQDomElement readSequence(const TQDomDocument& doc); + TQDomElement readMatrix(const TQDomDocument& doc); - void appendToSequence(QDomElement sequence, QDomElement element, int leftIndexSeen); + void appendToSequence(TQDomElement sequence, TQDomElement element, int leftIndexSeen); - void appendNextSequence(const QDomDocument& doc, QDomElement element); - QDomElement getLastSequence(const QDomDocument& doc, QDomElement sequence); + void appendNextSequence(const TQDomDocument& doc, TQDomElement element); + TQDomElement getLastSequence(const TQDomDocument& doc, TQDomElement sequence); - QDomElement findIndexNode(const QDomDocument& doc, QDomElement sequence); + TQDomElement findIndexNode(const TQDomDocument& doc, TQDomElement sequence); - ushort nextToken() { return formulaString[pos++].unicode(); } - ushort lookAhead(uint i) const { return formulaString[pos+i].unicode(); } + ushort nextToken() { return formulaString[pos++].tqunicode(); } + ushort lookAhead(uint i) const { return formulaString[pos+i].tqunicode(); } void pushback() { pos--; } bool hasNext() const { return pos < formulaString.length(); } @@ -61,7 +61,7 @@ private: /** * the string we read */ - QString formulaString; + TQString formulaString; /** * current pos diff --git a/lib/kformula/kformulaconfigpage.cc b/lib/kformula/kformulaconfigpage.cc index 8037192f..143ce49d 100644 --- a/lib/kformula/kformulaconfigpage.cc +++ b/lib/kformula/kformulaconfigpage.cc @@ -18,18 +18,18 @@ * Boston, MA 02110-1301, USA. */ -#include // first for gcc 2.7.2 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // first for gcc 2.7.2 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //#include @@ -53,17 +53,17 @@ KFORMULA_NAMESPACE_BEGIN -ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name ) - : QObject( box->parent(), name ), m_document( document ), m_view( view ), m_config( config ), m_changed( false ) +ConfigurePage::ConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name ) + : TQObject( box->tqparent(), name ), m_document( document ), m_view( view ), m_config( config ), m_changed( false ) { const ContextStyle& contextStyle = document->getContextStyle( true ); // fonts - QGroupBox *gbox = new QGroupBox( i18n( "Fonts" ), box ); + TQGroupBox *gbox = new TQGroupBox( i18n( "Fonts" ), box ); gbox->setColumnLayout( 0, Qt::Horizontal ); - QGridLayout* grid = new QGridLayout( gbox->layout(), 5, 3 ); + TQGridLayout* grid = new TQGridLayout( gbox->tqlayout(), 5, 3 ); grid->setSpacing( KDialog::spacingHint() ); grid->setColStretch(1, 1); @@ -75,21 +75,21 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config connect( buildFontLine( gbox, grid, 0, defaultFont, i18n( "Default font:" ), defaultFontName ), - SIGNAL( clicked() ), SLOT( selectNewDefaultFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewDefaultFont() ) ); connect( buildFontLine( gbox, grid, 1, nameFont, i18n( "Name font:" ), nameFontName ), - SIGNAL( clicked() ), SLOT( selectNewNameFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewNameFont() ) ); connect( buildFontLine( gbox, grid, 2, numberFont, i18n( "Number font:" ), numberFontName ), - SIGNAL( clicked() ), SLOT( selectNewNumberFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewNumberFont() ) ); connect( buildFontLine( gbox, grid, 3, operatorFont, i18n( "Operator font:" ), operatorFontName ), - SIGNAL( clicked() ), SLOT( selectNewOperatorFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewOperatorFont() ) ); - QLabel* sizeTitle = new QLabel( i18n( "Default base size:" ), gbox ); + TQLabel* sizeTitle = new TQLabel( i18n( "Default base size:" ), gbox ); grid->addWidget( sizeTitle, 4, 0 ); sizeSpin = new KIntNumInput( contextStyle.baseSize(), gbox ); @@ -97,21 +97,21 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config grid->addMultiCellWidget( sizeSpin, 4, 4, 1, 2 ); - connect( sizeSpin, SIGNAL( valueChanged( int ) ), - SLOT( baseSizeChanged( int ) ) ); + connect( sizeSpin, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( baseSizeChanged( int ) ) ); // syntax highlighting - syntaxHighlighting = new QCheckBox( i18n( "Use syntax highlighting" ),box ); + syntaxHighlighting = new TQCheckBox( i18n( "Use syntax highlighting" ),box ); syntaxHighlighting->setChecked( contextStyle.syntaxHighlighting() ); -// hlBox = new QGroupBox( i18n( "Highlight Colors" ), box ); +// hlBox = new TQGroupBox( i18n( "Highlight Colors" ), box ); // hlBox->setColumnLayout( 0, Qt::Horizontal ); -// grid = new QGridLayout( hlBox->layout(), 5, 2 ); +// grid = new TQGridLayout( hlBox->tqlayout(), 5, 2 ); // grid->setSpacing( KDialog::spacingHint() ); -// QLabel* defaultLabel = new QLabel( hlBox, "defaultLabel" ); +// TQLabel* defaultLabel = new TQLabel( hlBox, "defaultLabel" ); // defaultLabel->setText( i18n( "Default color:" ) ); // grid->addWidget( defaultLabel, 0, 0 ); @@ -120,7 +120,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( defaultColorBtn, 0, 1 ); -// QLabel* numberLabel = new QLabel( hlBox, "numberLabel" ); +// TQLabel* numberLabel = new TQLabel( hlBox, "numberLabel" ); // numberLabel->setText( i18n( "Number color:" ) ); // grid->addWidget( numberLabel, 1, 0 ); @@ -129,7 +129,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( numberColorBtn, 1, 1 ); -// QLabel* operatorLabel = new QLabel( hlBox, "operatorLabel" ); +// TQLabel* operatorLabel = new TQLabel( hlBox, "operatorLabel" ); // operatorLabel->setText( i18n( "Operator color:" ) ); // grid->addWidget( operatorLabel, 2, 0 ); @@ -138,7 +138,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( operatorColorBtn, 2, 1 ); -// QLabel* emptyLabel = new QLabel( hlBox, "emptyLabel" ); +// TQLabel* emptyLabel = new TQLabel( hlBox, "emptyLabel" ); // emptyLabel->setText( i18n( "Empty color:" ) ); // grid->addWidget( emptyLabel, 3, 0 ); @@ -147,7 +147,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( emptyColorBtn, 3, 1 ); -// QLabel* errorLabel = new QLabel( hlBox, "errorLabel" ); +// TQLabel* errorLabel = new TQLabel( hlBox, "errorLabel" ); // errorLabel->setText( i18n( "Error color:" ) ); // grid->addWidget( errorLabel, 4, 0 ); @@ -155,34 +155,34 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // errorColorBtn->setColor( contextStyle.getErrorColorPlain() ); // grid->addWidget( errorColorBtn, 4, 1 ); - connect( syntaxHighlighting, SIGNAL( clicked() ), - SLOT( syntaxHighlightingClicked() ) ); + connect( syntaxHighlighting, TQT_SIGNAL( clicked() ), + TQT_SLOT( syntaxHighlightingClicked() ) ); syntaxHighlightingClicked(); - connect( syntaxHighlighting, SIGNAL( clicked() ), this, SLOT( slotChanged() ) ); - connect( sizeSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotChanged() ) ); + connect( syntaxHighlighting, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( sizeSpin, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotChanged() ) ); Q_ASSERT( !m_changed ); } -QPushButton* ConfigurePage::buildFontLine( QWidget* parent, - QGridLayout* layout, int number, QFont font, QString name, - QLabel*& fontName ) +TQPushButton* ConfigurePage::buildFontLine( TQWidget* tqparent, + TQGridLayout* tqlayout, int number, TQFont font, TQString name, + TQLabel*& fontName ) { - QLabel* fontTitle = new QLabel( name, parent ); + TQLabel* fontTitle = new TQLabel( name, tqparent ); - QString labelName = font.family() + ' ' + QString::number( font.pointSize() ); - fontName = new QLabel( labelName, parent ); + TQString labelName = font.family() + ' ' + TQString::number( font.pointSize() ); + fontName = new TQLabel( labelName, tqparent ); fontName->setFont( font ); - fontName->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + fontName->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); - QPushButton* chooseButton = new QPushButton( i18n( "Choose..." ), parent ); + TQPushButton* chooseButton = new TQPushButton( i18n( "Choose..." ), tqparent ); - layout->addWidget( fontTitle, number, 0 ); - layout->addWidget( fontName, number, 1 ); - layout->addWidget( chooseButton, number, 2 ); + tqlayout->addWidget( fontTitle, number, 0 ); + tqlayout->addWidget( fontName, number, 1 ); + tqlayout->addWidget( chooseButton, number, 2 ); return chooseButton; } @@ -209,11 +209,11 @@ void ConfigurePage::apply() // contextStyle.setErrorColor( errorColorBtn->color() ); m_config->setGroup( "kformula Font" ); - m_config->writeEntry( "defaultFont", defaultFont.toString() ); - m_config->writeEntry( "nameFont", nameFont.toString() ); - m_config->writeEntry( "numberFont", numberFont.toString() ); - m_config->writeEntry( "operatorFont", operatorFont.toString() ); - m_config->writeEntry( "baseSize", QString::number( sizeSpin->value() ) ); + m_config->writeEntry( "defaultFont", TQString(defaultFont.toString()) ); + m_config->writeEntry( "nameFont", TQString(nameFont.toString()) ); + m_config->writeEntry( "numberFont", TQString(numberFont.toString()) ); + m_config->writeEntry( "operatorFont", TQString(operatorFont.toString()) ); + m_config->writeEntry( "baseSize", TQString::number( sizeSpin->value() ) ); // m_config->setGroup( "kformula Color" ); // m_config->writeEntry( "syntaxHighlighting", syntaxHighlighting->isChecked() ); @@ -230,8 +230,8 @@ void ConfigurePage::apply() void ConfigurePage::slotDefault() { - defaultFont = QFont( "Times", 12, QFont::Normal, true ); - nameFont = QFont( "Times" ); + defaultFont = TQFont( "Times", 12, TQFont::Normal, true ); + nameFont = TQFont( "Times" ); numberFont = nameFont; operatorFont = nameFont; @@ -245,11 +245,11 @@ void ConfigurePage::slotDefault() syntaxHighlighting->setChecked( true ); syntaxHighlightingClicked(); -// defaultColorBtn->setColor( Qt::black ); -// numberColorBtn->setColor( Qt::blue ); -// operatorColorBtn->setColor( Qt::darkGreen ); -// emptyColorBtn->setColor( Qt::blue ); -// errorColorBtn->setColor( Qt::darkRed ); +// defaultColorBtn->setColor( TQt::black ); +// numberColorBtn->setColor( TQt::blue ); +// operatorColorBtn->setColor( TQt::darkGreen ); +// emptyColorBtn->setColor( TQt::blue ); +// errorColorBtn->setColor( TQt::darkRed ); slotChanged(); } @@ -283,9 +283,9 @@ void ConfigurePage::selectNewOperatorFont() updateFontLabel( operatorFont, operatorFontName ); } -bool ConfigurePage::selectFont( QFont & font ) +bool ConfigurePage::selectFont( TQFont & font ) { - QStringList list; + TQStringList list; KFontChooser::getFontList( list, KFontChooser::SmoothScalableFonts ); @@ -306,9 +306,9 @@ void ConfigurePage::baseSizeChanged( int /*value*/ ) { } -void ConfigurePage::updateFontLabel( QFont font, QLabel* label ) +void ConfigurePage::updateFontLabel( TQFont font, TQLabel* label ) { - label->setText( font.family() + ' ' + QString::number( font.pointSize() ) ); + label->setText( font.family() + ' ' + TQString::number( font.pointSize() ) ); label->setFont( font ); } @@ -319,19 +319,19 @@ void ConfigurePage::slotChanged() // class UsedFontItem : public KListViewItem { // public: -// UsedFontItem( MathFontsConfigurePage* page, QListView* parent, QString font ) -// : KListViewItem( parent, font ), m_page( page ) {} +// UsedFontItem( MathFontsConfigurePage* page, TQListView* tqparent, TQString font ) +// : KListViewItem( tqparent, font ), m_page( page ) {} -// int compare( QListViewItem* i, int col, bool ascending ) const; +// int compare( TQListViewItem* i, int col, bool ascending ) const; // private: // MathFontsConfigurePage* m_page; // }; -// int UsedFontItem::compare( QListViewItem* i, int, bool ) const +// int UsedFontItem::compare( TQListViewItem* i, int, bool ) const // { -// QValueVector::iterator lhsIt = m_page->findUsedFont( text( 0 ) ); -// QValueVector::iterator rhsIt = m_page->findUsedFont( i->text( 0 ) ); +// TQValueVector::iterator lhsIt = m_page->findUsedFont( text( 0 ) ); +// TQValueVector::iterator rhsIt = m_page->findUsedFont( i->text( 0 ) ); // if ( lhsIt < rhsIt ) { // return -1; // } @@ -341,21 +341,21 @@ void ConfigurePage::slotChanged() // return 0; // } -// MathFontsConfigurePage::MathFontsConfigurePage( Document* document, QWidget* view, -// KConfig* config, QVBox* box, char* name ) -// : QObject( box->parent(), name ), m_document( document ), m_view( view ), m_config( config ) +// MathFontsConfigurePage::MathFontsConfigurePage( Document* document, TQWidget* view, +// KConfig* config, TQVBox* box, char* name ) +// : TQObject( box->tqparent(), name ), m_document( document ), m_view( view ), m_config( config ) // { -// QWidget* fontWidget = new QWidget( box ); -// QGridLayout* fontLayout = new QGridLayout( fontWidget, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); +// TQWidget* fontWidget = new TQWidget( box ); +// TQGridLayout* fontLayout = new TQGridLayout( fontWidget, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); -// QHBoxLayout* hLayout = new QHBoxLayout( 0, 0, 6 ); +// TQHBoxLayout* hLayout = new TQHBoxLayout( 0, 0, 6 ); // availableFonts = new KListView( fontWidget ); // availableFonts->addColumn( i18n( "Available Fonts" ) ); // hLayout->addWidget( availableFonts ); -// QVBoxLayout* vLayout = new QVBoxLayout( 0, 0, 6 ); -// QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); +// TQVBoxLayout* vLayout = new TQVBoxLayout( 0, 0, 6 ); +// TQSpacerItem* spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); // vLayout->addItem( spacer1 ); // addFont = new KPushButton( fontWidget ); @@ -366,12 +366,12 @@ void ConfigurePage::slotChanged() // removeFont->setText( "<-" ); // vLayout->addWidget( removeFont ); -// QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); +// TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); // vLayout->addItem( spacer2 ); // hLayout->addLayout( vLayout ); -// vLayout = new QVBoxLayout( 0, 0, 6 ); +// vLayout = new TQVBoxLayout( 0, 0, 6 ); // moveUp = new KPushButton( fontWidget ); // moveUp->setText( i18n( "Up" ) ); @@ -389,20 +389,20 @@ void ConfigurePage::slotChanged() // fontLayout->addLayout( hLayout, 0, 0 ); -// // connect( availableFonts, SIGNAL( executed( QListViewItem* ) ), -// // this, SLOT( slotAddFont() ) ); -// // connect( requestedFonts, SIGNAL( executed( QListViewItem* ) ), -// // this, SLOT( slotRemoveFont() ) ); -// connect( addFont, SIGNAL( clicked() ), this, SLOT( slotAddFont() ) ); -// connect( removeFont, SIGNAL( clicked() ), this, SLOT( slotRemoveFont() ) ); -// connect( moveUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); -// connect( moveDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); +// // connect( availableFonts, TQT_SIGNAL( executed( TQListViewItem* ) ), +// // this, TQT_SLOT( slotAddFont() ) ); +// // connect( requestedFonts, TQT_SIGNAL( executed( TQListViewItem* ) ), +// // this, TQT_SLOT( slotRemoveFont() ) ); +// connect( addFont, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddFont() ) ); +// connect( removeFont, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveFont() ) ); +// connect( moveUp, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveUp() ) ); +// connect( moveDown, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveDown() ) ); // const ContextStyle& contextStyle = document->getContextStyle( true ); // const SymbolTable& symbolTable = contextStyle.symbolTable(); -// const QStringList& usedFonts = contextStyle.requestedFonts(); +// const TQStringList& usedFonts = contextStyle.requestedFonts(); -// QMap fontMap; +// TQMap fontMap; // // symbolTable.findAvailableFonts( &fontMap ); // setupLists( usedFonts ); @@ -410,7 +410,7 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::apply() // { -// QStringList strings; +// TQStringList strings; // std::copy( usedFontList.begin(), usedFontList.end(), std::back_inserter( strings ) ); // m_config->setGroup( "kformula Font" ); @@ -422,7 +422,7 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotDefault() // { -// QStringList usedFonts; +// TQStringList usedFonts; // usedFonts.push_back( "esstixone" ); // usedFonts.push_back( "esstixtwo" ); @@ -449,37 +449,37 @@ void ConfigurePage::slotChanged() // setupLists( usedFonts ); // } -// QValueVector::iterator MathFontsConfigurePage::findUsedFont( QString name ) +// TQValueVector::iterator MathFontsConfigurePage::findUsedFont( TQString name ) // { -// return std::find( usedFontList.begin(), usedFontList.end(), name ); +// return std::tqfind( usedFontList.begin(), usedFontList.end(), name ); // } -// void MathFontsConfigurePage::setupLists( const QStringList& usedFonts ) +// void MathFontsConfigurePage::setupLists( const TQStringList& usedFonts ) // { // const ContextStyle& contextStyle = m_document->getContextStyle( true ); // const SymbolTable& symbolTable = contextStyle.symbolTable(); -// QMap fontMap; +// TQMap fontMap; // // symbolTable.findAvailableFonts( &fontMap ); -// for ( QStringList::const_iterator it = usedFonts.begin(); it != usedFonts.end(); ++it ) { -// QMap::iterator font = fontMap.find( *it ); +// for ( TQStringList::const_iterator it = usedFonts.begin(); it != usedFonts.end(); ++it ) { +// TQMap::iterator font = fontMap.tqfind( *it ); // if ( font != fontMap.end() ) { // fontMap.erase( font ); // new UsedFontItem( this, requestedFonts, *it ); // usedFontList.push_back( *it ); // } // } -// for ( QMap::iterator it = fontMap.begin(); it != fontMap.end(); ++it ) { +// for ( TQMap::iterator it = fontMap.begin(); it != fontMap.end(); ++it ) { // new KListViewItem( availableFonts, it.key() ); // } // } // void MathFontsConfigurePage::slotAddFont() // { -// QListViewItem* fontItem = availableFonts->selectedItem(); +// TQListViewItem* fontItem = availableFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); +// TQString fontName = fontItem->text( 0 ); // //availableFonts->takeItem( fontItem ); // delete fontItem; @@ -490,10 +490,10 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotRemoveFont() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // usedFontList.erase( it ); // } @@ -505,14 +505,14 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotMoveUp() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // uint pos = it - usedFontList.begin(); // if ( pos > 0 ) { -// QValueVector::iterator before = it-1; +// TQValueVector::iterator before = it-1; // std::swap( *it, *before ); // requestedFonts->sort(); // } @@ -522,14 +522,14 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotMoveDown() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // uint pos = it - usedFontList.begin(); // if ( pos < usedFontList.size()-1 ) { -// QValueVector::iterator after = it+1; +// TQValueVector::iterator after = it+1; // std::swap( *it, *after ); // requestedFonts->sort(); // } diff --git a/lib/kformula/kformulaconfigpage.h b/lib/kformula/kformulaconfigpage.h index c5bc9b73..e3ff716a 100644 --- a/lib/kformula/kformulaconfigpage.h +++ b/lib/kformula/kformulaconfigpage.h @@ -21,22 +21,22 @@ #ifndef kfconfigpages_h #define kfconfigpages_h -#include -#include +#include +#include #include #include "kformuladefs.h" -class QButtonGroup; -class QCheckBox; -class QColor; -class QGridLayout; -class QLabel; -class QPushButton; -class QSpinBox; -class QStringList; -class QWidget; +class TQButtonGroup; +class TQCheckBox; +class TQColor; +class TQGridLayout; +class TQLabel; +class TQPushButton; +class TQSpinBox; +class TQStringList; +class TQWidget; class KColorButton; class KConfig; @@ -49,18 +49,19 @@ KFORMULA_NAMESPACE_BEGIN class Document; -class KOFORMULA_EXPORT ConfigurePage : public QObject +class KOFORMULA_EXPORT ConfigurePage : public TQObject { Q_OBJECT + TQ_OBJECT public: - ConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name = 0 ); + ConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name = 0 ); void apply(); void slotDefault(); protected: - bool selectFont( QFont & ); + bool selectFont( TQFont & ); protected slots: @@ -75,48 +76,49 @@ protected slots: private: - QPushButton* buildFontLine( QWidget* fontWidget, QGridLayout* layout, int number, - QFont font, QString name, QLabel*& fontName ); + TQPushButton* buildFontLine( TQWidget* fontWidget, TQGridLayout* tqlayout, int number, + TQFont font, TQString name, TQLabel*& fontName ); - void updateFontLabel( QFont font, QLabel* label ); + void updateFontLabel( TQFont font, TQLabel* label ); Document* m_document; - QWidget* m_view; + TQWidget* m_view; KConfig* m_config; - QFont defaultFont; - QFont nameFont; - QFont numberFont; - QFont operatorFont; + TQFont defaultFont; + TQFont nameFont; + TQFont numberFont; + TQFont operatorFont; KIntNumInput* sizeSpin; - QLabel* defaultFontName; - QLabel* nameFontName; - QLabel* numberFontName; - QLabel* operatorFontName; + TQLabel* defaultFontName; + TQLabel* nameFontName; + TQLabel* numberFontName; + TQLabel* operatorFontName; // KColorButton* defaultColorBtn; // KColorButton* numberColorBtn; // KColorButton* operatorColorBtn; // KColorButton* emptyColorBtn; // KColorButton* errorColorBtn; - QCheckBox* syntaxHighlighting; + TQCheckBox* syntaxHighlighting; bool m_changed; }; -// class MathFontsConfigurePage : public QObject +// class MathFontsConfigurePage : public TQObject // { // Q_OBJECT +// TQ_OBJECT // public: -// MathFontsConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name = 0 ); +// MathFontsConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name = 0 ); // void apply(); // void slotDefault(); -// QValueVector::iterator findUsedFont( QString name ); +// TQValueVector::iterator findUsedFont( TQString name ); // protected slots: @@ -127,10 +129,10 @@ private: // private: -// void setupLists( const QStringList& usedFonts ); +// void setupLists( const TQStringList& usedFonts ); // Document* m_document; -// QWidget* m_view; +// TQWidget* m_view; // KConfig* m_config; // KListView* availableFonts; @@ -141,7 +143,7 @@ private: // KPushButton* moveUp; // KPushButton* moveDown; -// QValueVector usedFontList; +// TQValueVector usedFontList; // }; diff --git a/lib/kformula/kformulacontainer.cc b/lib/kformula/kformulacontainer.cc index 84471e1b..a141aa50 100644 --- a/lib/kformula/kformulacontainer.cc +++ b/lib/kformula/kformulacontainer.cc @@ -18,14 +18,14 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -194,7 +194,7 @@ void Container::moveOutBelow( FormulaCursor* cursor ) emit leaveFormula( this, cursor, EXIT_BELOW ); } -void Container::tell( const QString& msg ) +void Container::tell( const TQString& msg ) { emit statusMsg( msg ); } @@ -273,10 +273,10 @@ void Container::recalc() ContextStyle& context = impl->document->getContextStyle(); rootElement()->calcSizes( context ); - emit formulaChanged( context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ); - emit formulaChanged( context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), - context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); + emit formulaChanged( context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); + emit formulaChanged( context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), + context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); emit cursorMoved( activeCursor() ); } @@ -292,16 +292,16 @@ const SymbolTable& Container::getSymbolTable() const } -void Container::draw( QPainter& painter, const QRect& r, const QColorGroup& cg, bool edit ) +void Container::draw( TQPainter& painter, const TQRect& r, const TQColorGroup& cg, bool edit ) { painter.fillRect( r, cg.base() ); draw( painter, r, edit ); } -void Container::draw( QPainter& painter, const QRect& r, bool edit ) +void Container::draw( TQPainter& painter, const TQRect& r, bool edit ) { - //ContextStyle& context = document()->getContextStyle( painter.device()->devType() == QInternal::Printer ); + //ContextStyle& context = document()->getContextStyle( painter.device()->devType() == TQInternal::Printer ); ContextStyle& context = document()->getContextStyle( edit ); rootElement()->draw( painter, context.pixelToLayoutUnit( r ), context ); } @@ -315,7 +315,7 @@ void Container::checkCursor() } } -void Container::input( QKeyEvent* event ) +void Container::input( TQKeyEvent* event ) { //if ( !hasValidCursor() ) if ( impl->activeCursor == 0 ) { @@ -339,20 +339,20 @@ void Container::paste() { if (!hasValidCursor()) return; - QClipboard* clipboard = QApplication::clipboard(); - const QMimeSource* source = clipboard->data(); + TQClipboard* clipboard = TQApplication::tqclipboard(); + const TQMimeSource* source = clipboard->data(); if (source->provides( MimeSource::selectionMimeType() )) { - QByteArray data = source->encodedData( MimeSource::selectionMimeType() ); - QDomDocument formula; + TQByteArray data = source->tqencodedData( MimeSource::selectionMimeType() ); + TQDomDocument formula; formula.setContent(data); paste( formula, i18n("Paste") ); } } -void Container::paste( const QDomDocument& document, QString desc ) +void Container::paste( const TQDomDocument& document, TQString desc ) { FormulaCursor* cursor = activeCursor(); - QPtrList list; + TQPtrList list; list.setAutoDelete( true ); if ( cursor->buildElementsFromMathMLDom( document.documentElement(), list ) ) { uint count = list.count(); @@ -372,9 +372,9 @@ void Container::copy() // read-only cursors are fine for copying. FormulaCursor* cursor = activeCursor(); if (cursor != 0) { - QDomDocument formula = document()->createMathMLDomDocument(); + TQDomDocument formula = document()->createMathMLDomDocument(); cursor->copy( formula ); - QClipboard* clipboard = QApplication::clipboard(); + TQClipboard* clipboard = TQApplication::tqclipboard(); clipboard->setData(new MimeSource(document(), formula)); } } @@ -392,7 +392,7 @@ void Container::cut() } -void Container::emitErrorMsg( const QString& msg ) +void Container::emitErrorMsg( const TQString& msg ) { emit errorMsg( msg ); } @@ -405,28 +405,28 @@ void Container::execute(KCommand* command) } -QRect Container::boundingRect() const +TQRect Container::boundingRect() const { const ContextStyle& context = document()->getContextStyle(); - return QRect( context.layoutUnitToPixelX( rootElement()->getX() ), - context.layoutUnitToPixelY( rootElement()->getY() ), - context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ); + return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), + context.tqlayoutUnitToPixelY( rootElement()->getY() ), + context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); } -QRect Container::coveredRect() +TQRect Container::coveredRect() { if ( impl->activeCursor != 0 ) { const ContextStyle& context = document()->getContextStyle(); const LuPixelRect& cursorRect = impl->activeCursor->getCursorSize(); - return QRect( context.layoutUnitToPixelX( rootElement()->getX() ), - context.layoutUnitToPixelY( rootElement()->getY() ), - context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ) | - QRect( context.layoutUnitToPixelX( cursorRect.x() ), - context.layoutUnitToPixelY( cursorRect.y() ), - context.layoutUnitToPixelX( cursorRect.width() ), - context.layoutUnitToPixelY( cursorRect.height() ) ); + return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), + context.tqlayoutUnitToPixelY( rootElement()->getY() ), + context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ) | + TQRect( context.tqlayoutUnitToPixelX( cursorRect.x() ), + context.tqlayoutUnitToPixelY( cursorRect.y() ), + context.tqlayoutUnitToPixelX( cursorRect.width() ), + context.tqlayoutUnitToPixelY( cursorRect.height() ) ); } return boundingRect(); } @@ -434,20 +434,20 @@ QRect Container::coveredRect() double Container::width() const { const ContextStyle& context = document()->getContextStyle(); - return context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); + return context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); } double Container::height() const { const ContextStyle& context = document()->getContextStyle(); - return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); + return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); } double Container::baseline() const { const ContextStyle& context = document()->getContextStyle(); - //return context.layoutUnitToPixelY( rootElement()->getBaseline() ); - return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); + //return context.tqlayoutUnitToPixelY( rootElement()->getBaseline() ); + return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); } void Container::moveTo( int x, int y ) @@ -464,7 +464,7 @@ int Container::fontSize() const } else { const ContextStyle& context = document()->getContextStyle(); - return qRound( context.baseSize() ); + return tqRound( context.baseSize() ); } } @@ -490,9 +490,9 @@ void Container::updateMatrixActions() document()->wrapper()->enableMatrixActions( false ); } -void Container::save( QDomElement &root ) +void Container::save( TQDomElement &root ) { - QDomDocument ownerDoc = root.ownerDocument(); + TQDomDocument ownerDoc = root.ownerDocument(); root.appendChild(rootElement()->getElementDom(ownerDoc)); } @@ -500,7 +500,7 @@ void Container::save( QDomElement &root ) /** * Loads a formula from the document. */ -bool Container::load( const QDomElement &fe ) +bool Container::load( const TQDomElement &fe ) { if (!fe.isNull()) { FormulaElement* root = createMainSequence(); @@ -524,9 +524,9 @@ bool Container::load( const QDomElement &fe ) } -void Container::saveMathML( QTextStream& stream, bool oasisFormat ) +void Container::saveMathML( TQTextStream& stream, bool oasisFormat ) { - QDomDocument doc; + TQDomDocument doc; if ( !oasisFormat ) { doc = document()->createMathMLDomDocument(); } @@ -534,13 +534,13 @@ void Container::saveMathML( QTextStream& stream, bool oasisFormat ) stream << doc; } -bool Container::loadMathML( const QDomDocument &doc, bool oasisFormat ) +bool Container::loadMathML( const TQDomDocument &doc, bool oasisFormat ) { return loadMathML( doc.documentElement(), oasisFormat ); } /* -bool Container::loadMathML( const QDomElement &element, bool oasisFormat ) +bool Container::loadMathML( const TQDomElement &element, bool oasisFormat ) { const ContextStyle& context = document()->getContextStyle(); MathML2KFormula filter( element, context, oasisFormat ); @@ -557,7 +557,7 @@ bool Container::loadMathML( const QDomElement &element, bool oasisFormat ) } */ -bool Container::loadMathML( const QDomElement &fe, bool /*oasisFormat*/ ) +bool Container::loadMathML( const TQDomElement &fe, bool /*oasisFormat*/ ) { kdDebug( DEBUGID ) << "loadMathML" << endl; if (!fe.isNull()) { @@ -585,7 +585,7 @@ bool Container::loadMathML( const QDomElement &fe, bool /*oasisFormat*/ ) void Container::print(KPrinter& printer) { //printer.setFullPage(true); - QPainter painter; + TQPainter painter; if (painter.begin(&printer)) { rootElement()->draw( painter, LuPixelRect( rootElement()->getX(), rootElement()->getY(), @@ -595,31 +595,31 @@ void Container::print(KPrinter& printer) } } -QImage Container::drawImage( int width, int height ) +TQImage Container::drawImage( int width, int height ) { ContextStyle& context = document()->getContextStyle( false ); - QRect rect(impl->rootElement->getX(), impl->rootElement->getY(), + TQRect rect(impl->rootElement->getX(), impl->rootElement->getY(), impl->rootElement->getWidth(), impl->rootElement->getHeight()); - int realWidth = context.layoutUnitToPixelX( impl->rootElement->getWidth() ); - int realHeight = context.layoutUnitToPixelY( impl->rootElement->getHeight() ); + int realWidth = context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ); + int realHeight = context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ); - double f = QMAX( static_cast( width )/static_cast( realWidth ), + double f = TQMAX( static_cast( width )/static_cast( realWidth ), static_cast( height )/static_cast( realHeight ) ); int oldZoom = context.zoom(); - context.setZoomAndResolution( qRound( oldZoom*f ), KoGlobal::dpiX(), KoGlobal::dpiY() ); + context.setZoomAndResolution( tqRound( oldZoom*f ), KoGlobal::dpiX(), KoGlobal::dpiY() ); kdDebug( DEBUGID ) << "Container::drawImage " << "(" << width << " " << height << ")" - << "(" << context.layoutUnitToPixelX( impl->rootElement->getWidth() ) - << " " << context.layoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" + << "(" << context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ) + << " " << context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" << endl; - QPixmap pm( context.layoutUnitToPixelX( impl->rootElement->getWidth() ), - context.layoutUnitToPixelY( impl->rootElement->getHeight() ) ); + TQPixmap pm( context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ), + context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) ); pm.fill(); - QPainter paint(&pm); + TQPainter paint(&pm); impl->rootElement->draw(paint, rect, context); paint.end(); context.setZoomAndResolution( oldZoom, KoGlobal::dpiX(), KoGlobal::dpiY() ); @@ -627,12 +627,12 @@ QImage Container::drawImage( int width, int height ) return pm.convertToImage(); } -QString Container::texString() +TQString Container::texString() { return rootElement()->toLatex(); } -QString Container::formulaString() +TQString Container::formulaString() { return rootElement()->formulaString(); } diff --git a/lib/kformula/kformulacontainer.h b/lib/kformula/kformulacontainer.h index 4d4254ab..d87e8184 100644 --- a/lib/kformula/kformulacontainer.h +++ b/lib/kformula/kformulacontainer.h @@ -21,22 +21,22 @@ #ifndef KFORMULACONTAINER_H #define KFORMULACONTAINER_H -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include //#include #include "KoCommandHistory.h" #include "kformuladefs.h" -class QColorGroup; -class QKeyEvent; -class QPainter; +class TQColorGroup; +class TQKeyEvent; +class TQPainter; class KCommand; class KPrinter; @@ -75,7 +75,7 @@ public: virtual void moveOutRight( FormulaCursor* ) {} virtual void moveOutAbove( FormulaCursor* ) {} virtual void moveOutBelow( FormulaCursor* ) {} - virtual void tell( const QString& /*msg*/ ) {} + virtual void tell( const TQString& /*msg*/ ) {} virtual void insertFormula( FormulaCursor* ) {} virtual void removeFormula( FormulaCursor* ) {} virtual void baseSizeChanged( int, bool ) {} @@ -87,9 +87,10 @@ public: * The document. Actually only one part of the whole. * Provides everything to edit the formula. */ -class KOFORMULA_EXPORT Container : public QObject, public FormulaDocument { +class KOFORMULA_EXPORT Container : public TQObject, public FormulaDocument { friend class MimeSource; Q_OBJECT + TQ_OBJECT // no copying Container( const Container& ); @@ -153,7 +154,7 @@ public: void moveOutRight( FormulaCursor* ); void moveOutAbove( FormulaCursor* ); void moveOutBelow( FormulaCursor* ); - void tell( const QString& msg ); + void tell( const TQString& msg ); void removeFormula( FormulaCursor* ); /** @@ -170,47 +171,47 @@ public: /** * Draws the whole thing. */ - void draw( QPainter& painter, const QRect& r, - const QColorGroup& cg, bool edit=false ); + void draw( TQPainter& painter, const TQRect& r, + const TQColorGroup& cg, bool edit=false ); /** * Draws the whole thing. */ - void draw( QPainter& painter, const QRect& r, bool edit=false ); + void draw( TQPainter& painter, const TQRect& r, bool edit=false ); /** * Saves the data into the document. */ - void save( QDomElement &root ); + void save( TQDomElement &root ); /** * Save formula as MathML. */ - void saveMathML( QTextStream& stream, bool oasisFormat = false ); + void saveMathML( TQTextStream& stream, bool oasisFormat = false ); /** * Load function. * Load the formula from the specified file containing MathML . */ - bool loadMathML( const QDomDocument &doc, bool oasisFormat = false ); + bool loadMathML( const TQDomDocument &doc, bool oasisFormat = false ); /** * Load function. * Load the formula from the specified file containing MathML . */ - bool loadMathML( const QDomElement &doc, bool oasisFormat = false ); + bool loadMathML( const TQDomElement &doc, bool oasisFormat = false ); /** * Loads a formula from the document. */ - bool load( const QDomElement &fe ); + bool load( const TQDomElement &fe ); /** * @returns Tex string for the formula */ - QString texString(); + TQString texString(); - QString formulaString(); + TQString formulaString(); /** * Prints the formula. @@ -220,7 +221,7 @@ public: /** * @returns an image that looks like out formula. */ - QImage drawImage( int width, int height ); + TQImage drawImage( int width, int height ); /** * @returns the cursor to be used for editing. @@ -239,12 +240,12 @@ public: /** * @returns the formula's size. */ - QRect boundingRect() const; + TQRect boundingRect() const; /** * @returns the formula's size including its active cursor. */ - QRect coveredRect(); + TQRect coveredRect(); double width() const; double height() const; @@ -338,15 +339,15 @@ signals: /** * A message that might be a useful hint. Meant for the statusbar. */ - void statusMsg( const QString& msg ); + void statusMsg( const TQString& msg ); /** * A message that describes an error. Meant for a message box. (?) */ - void errorMsg( const QString& ); + void errorMsg( const TQString& ); /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void elementWillVanish(BasicElement* element); @@ -365,7 +366,7 @@ public: /** * General input. */ - void input( QKeyEvent* event ); + void input( TQKeyEvent* event ); void performRequest( Request* request ); @@ -379,7 +380,7 @@ public: /** * Insert data from the document. */ - void paste( const QDomDocument& document, QString desc ); + void paste( const TQDomDocument& document, TQString desc ); /** * Copy the current selection to the clipboard. @@ -405,7 +406,7 @@ protected: */ virtual FormulaElement* createMainSequence(); - void emitErrorMsg( const QString& ); + void emitErrorMsg( const TQString& ); private: diff --git a/lib/kformula/kformuladefs.h b/lib/kformula/kformuladefs.h index d42d0b16..2e9d8a8b 100644 --- a/lib/kformula/kformuladefs.h +++ b/lib/kformula/kformuladefs.h @@ -23,9 +23,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -54,23 +54,23 @@ typedef KoRect PtRect; * Pixels. At any zoom level. */ typedef int pixel; -typedef QPoint PixelPoint; -typedef QRect PixelRect; -//typedef QSize PixelSize; +typedef TQPoint PixelPoint; +typedef TQRect PixelRect; +//typedef TQSize PixelSize; /** * Layout Unit. That's the values we store to get * wysiwyg right. */ typedef int luPt; -typedef QPoint LuPtPoint; -typedef QRect LuPtRect; -typedef QSize LuPtSize; +typedef TQPoint LuPtPoint; +typedef TQRect LuPtRect; +typedef TQSize LuPtSize; typedef int luPixel; -typedef QPoint LuPixelPoint; -typedef QRect LuPixelRect; -typedef QSize LuPixelSize; +typedef TQPoint LuPixelPoint; +typedef TQRect LuPixelRect; +typedef TQSize LuPixelSize; /** @@ -106,9 +106,9 @@ enum MoveFlag { NormalMovement = 0, SelectMovement = 1, WordMovement = 2 }; inline MoveFlag movementFlag( int state ) { int flag = NormalMovement; - if ( state & Qt::ControlButton ) + if ( state & TQt::ControlButton ) flag |= WordMovement; - if ( state & Qt::ShiftButton ) + if ( state & TQt::ShiftButton ) flag |= SelectMovement; return static_cast( flag ); } @@ -163,8 +163,8 @@ enum TokenElementType { * The struct used to store static font data. */ struct InternFontTable { - short unicode; - QChar pos; + short tqunicode; + TQChar pos; CharClass cl; CharStyle style; }; @@ -180,7 +180,7 @@ enum Direction { beforeCursor, afterCursor }; /** * The types of space we know. */ -enum SpaceWidth { THIN, MEDIUM, THICK, QUAD, NEGTHIN }; +enum SpaceWidth { THIN, MEDIUM, THICK, TQUAD, NEGTHIN }; /** * The types of MathML horizontal or vertical sizes we know @@ -235,7 +235,7 @@ enum IndexPosition { lowerMiddlePos, upperRightPos, lowerRightPos, - parentPos + tqparentPos }; @@ -364,33 +364,33 @@ public: }; class TextCharRequest : public Request { - QChar m_ch; + TQChar m_ch; bool m_isSymbol; public: - TextCharRequest( QChar ch, bool isSymbol=false ) : Request( req_addTextChar ), m_ch( ch ), m_isSymbol( isSymbol ) {} - QChar ch() const { return m_ch; } + TextCharRequest( TQChar ch, bool isSymbol=false ) : Request( req_addTextChar ), m_ch( ch ), m_isSymbol( isSymbol ) {} + TQChar ch() const { return m_ch; } bool isSymbol() const { return m_isSymbol; } }; class OperatorRequest: public Request { - QChar m_ch; + TQChar m_ch; public: - OperatorRequest( QChar ch ) : Request( req_addOperator ), m_ch( ch ) {} - QChar ch() const { return m_ch; } + OperatorRequest( TQChar ch ) : Request( req_addOperator ), m_ch( ch ) {} + TQChar ch() const { return m_ch; } }; class NumberRequest: public Request { - QChar m_ch; + TQChar m_ch; public: - NumberRequest( QChar ch ) : Request( req_addNumber ), m_ch( ch ) {} - QChar ch() const { return m_ch; } + NumberRequest( TQChar ch ) : Request( req_addNumber ), m_ch( ch ) {} + TQChar ch() const { return m_ch; } }; class TextRequest : public Request { - QString m_text; + TQString m_text; public: - TextRequest( QString text ) : Request( req_addText ), m_text( text ) {} - QString text() const { return m_text; } + TextRequest( TQString text ) : Request( req_addText ), m_text( text ) {} + TQString text() const { return m_text; } }; class MatrixRequest : public Request { diff --git a/lib/kformula/kformuladocument.cc b/lib/kformula/kformuladocument.cc index 57b5bc04..3a19ac70 100644 --- a/lib/kformula/kformuladocument.cc +++ b/lib/kformula/kformuladocument.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -45,7 +45,7 @@ static const int CURRENT_SYNTAX_VERSION = 1; // Make sure an appropriate DTD is available in www/koffice/DTD if changing this value static const char * CURRENT_DTD_VERSION = "1.3"; -int FormulaList::compareItems( QPtrCollection::Item a, QPtrCollection::Item b ) +int FormulaList::compareItems( TQPtrCollection::Item a, TQPtrCollection::Item b ) { double ya = static_cast( a )->getDocumentY(); double yb = static_cast( b )->getDocumentY(); @@ -61,9 +61,9 @@ int FormulaList::compareItems( QPtrCollection::Item a, QPtrCollection::Item b ) } -Document::Document( QObject *parent, const char *name, - const QStringList &/*args*/ ) - : QObject( parent, name ), m_wrapper( 0 ), m_formula( 0 ), creationStrategy( 0 ) +Document::Document( TQObject *tqparent, const char *name, + const TQStringList &/*args*/ ) + : TQObject( tqparent, name ), m_wrapper( 0 ), m_formula( 0 ), creationStrategy( 0 ) { m_contextStyle = new ContextStyle; setCreationStrategy( "Oasis" ); @@ -98,15 +98,15 @@ Container* Document::createFormula( int pos, bool registerMe ) } -QPtrListIterator Document::formulas() +TQPtrListIterator Document::formulas() { - return QPtrListIterator( formulae ); + return TQPtrListIterator( formulae ); } int Document::formulaPos( Container* formula ) { - return formulae.find( formula ); + return formulae.tqfind( formula ); } @@ -122,12 +122,12 @@ int Document::formulaCount() } -bool Document::loadXML( const QDomDocument& doc ) +bool Document::loadXML( const TQDomDocument& doc ) { setCreationStrategy( "Ordinary" ); //clear(); - QDomElement root = doc.documentElement(); + TQDomElement root = doc.documentElement(); // backward compatibility if ( root.tagName() == "FORMULA" ) { @@ -135,9 +135,9 @@ bool Document::loadXML( const QDomDocument& doc ) return formula->load( root ); } - QDomNode node = root.firstChild(); + TQDomNode node = root.firstChild(); if ( node.isElement() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( element.tagName() == "FORMULASETTINGS" ) { if ( !loadDocumentPart( element ) ) { return false; @@ -148,7 +148,7 @@ bool Document::loadXML( const QDomDocument& doc ) uint number = 0; while ( !node.isNull() ) { if ( node.isElement() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); Container* formula = newFormula( number ); if ( !formula->load( element ) ) { return false; @@ -160,7 +160,7 @@ bool Document::loadXML( const QDomDocument& doc ) return formulae.count() > 0; } -bool Document::loadOasis( const QDomDocument& doc ) +bool Document::loadOasis( const TQDomDocument& doc ) { // ### TODO: not finished! setCreationStrategy( "Oasis" ); @@ -168,15 +168,15 @@ bool Document::loadOasis( const QDomDocument& doc ) return formula->loadMathML( doc, true ); } -bool Document::loadDocumentPart( QDomElement /*node*/ ) +bool Document::loadDocumentPart( TQDomElement /*node*/ ) { return true; } -QDomDocument Document::saveXML() +TQDomDocument Document::saveXML() { - QDomDocument doc = createDomDocument(); - QDomElement root = doc.documentElement(); + TQDomDocument doc = createDomDocument(); + TQDomElement root = doc.documentElement(); root.appendChild( saveDocumentPart( doc ) ); uint count = formulae.count(); for ( uint i=0; itype() != strategy ) { delete creationStrategy; @@ -442,225 +442,225 @@ void DocumentWrapper::createActions( KActionCollection* collection ) m_addNegThinSpaceAction = new KAction( i18n( "Add Negative Thin Space" ), 0, - this, SLOT( addNegThinSpace() ), + this, TQT_SLOT( addNegThinSpace() ), collection, "formula_addnegthinspace") ; m_addThinSpaceAction = new KAction( i18n( "Add Thin Space" ), 0, - this, SLOT( addThinSpace() ), + this, TQT_SLOT( addThinSpace() ), collection, "formula_addthinspace") ; m_addMediumSpaceAction = new KAction( i18n( "Add Medium Space" ), 0, - this, SLOT( addMediumSpace() ), + this, TQT_SLOT( addMediumSpace() ), collection, "formula_addmediumspace" ); m_addThickSpaceAction = new KAction( i18n( "Add Thick Space" ), 0, - this, SLOT( addThickSpace() ), + this, TQT_SLOT( addThickSpace() ), collection, "formula_addthickspace" ); m_addQuadSpaceAction = new KAction( i18n( "Add Quad Space" ), 0, - this, SLOT( addQuadSpace() ), + this, TQT_SLOT( addQuadSpace() ), collection, "formula_addquadspace" ); m_addIntegralAction = new KAction(i18n("Add Integral"), "int", 0, - this, SLOT(addIntegral()), + this, TQT_SLOT(addIntegral()), collection, "formula_addintegral"); m_addSumAction = new KAction(i18n("Add Sum"), "sum", 0, - this, SLOT(addSum()), + this, TQT_SLOT(addSum()), collection, "formula_addsum"); m_addProductAction = new KAction(i18n("Add Product"), "prod", 0, - this, SLOT(addProduct()), + this, TQT_SLOT(addProduct()), collection, "formula_addproduct"); m_addRootAction = new KAction(i18n("Add Root"), "sqrt", 0, - this, SLOT(addRoot()), + this, TQT_SLOT(addRoot()), collection, "formula_addroot"); m_addFractionAction = new KAction(i18n("Add Fraction"), "frac", 0, - this, SLOT(addFraction()), + this, TQT_SLOT(addFraction()), collection, "formula_addfrac"); m_addBracketAction = new KAction(i18n("Add Bracket"), "paren", 0, - this, SLOT(addDefaultBracket()), + this, TQT_SLOT(addDefaultBracket()), collection,"formula_addbra"); m_addSBracketAction = new KAction(i18n("Add Square Bracket"), "brackets", 0, - this, SLOT(addSquareBracket()), + this, TQT_SLOT(addSquareBracket()), collection,"formula_addsqrbra"); m_addCBracketAction = new KAction(i18n("Add Curly Bracket"), "math_brace", 0, - this, SLOT(addCurlyBracket()), + this, TQT_SLOT(addCurlyBracket()), collection,"formula_addcurbra"); m_addAbsAction = new KAction(i18n("Add Abs"), "abs", 0, - this, SLOT(addLineBracket()), + this, TQT_SLOT(addLineBracket()), collection,"formula_addabsbra"); m_addMatrixAction = new KAction(i18n("Add Matrix..."), "matrix", 0, - this, SLOT(addMatrix()), + this, TQT_SLOT(addMatrix()), collection, "formula_addmatrix"); m_addOneByTwoMatrixAction = new KAction(i18n("Add 1x2 Matrix"), "onetwomatrix", 0, - this, SLOT(addOneByTwoMatrix()), + this, TQT_SLOT(addOneByTwoMatrix()), collection, "formula_add_one_by_two_matrix"); m_addUpperLeftAction = new KAction(i18n("Add Upper Left Index"), "lsup", 0, - this, SLOT(addUpperLeftIndex()), + this, TQT_SLOT(addUpperLeftIndex()), collection, "formula_addupperleft"); m_addLowerLeftAction = new KAction(i18n("Add Lower Left Index"), "lsub", 0, - this, SLOT(addLowerLeftIndex()), + this, TQT_SLOT(addLowerLeftIndex()), collection, "formula_addlowerleft"); m_addUpperRightAction = new KAction(i18n("Add Upper Right Index"), "rsup", 0, - this, SLOT(addUpperRightIndex()), + this, TQT_SLOT(addUpperRightIndex()), collection, "formula_addupperright"); m_addLowerRightAction = new KAction(i18n("Add Lower Right Index"), "rsub", 0, - this, SLOT(addLowerRightIndex()), + this, TQT_SLOT(addLowerRightIndex()), collection, "formula_addlowerright"); m_addGenericUpperAction = new KAction(i18n("Add Upper Index"), "gsup", /*CTRL + Key_U*/0, - this, SLOT(addGenericUpperIndex()), + this, TQT_SLOT(addGenericUpperIndex()), collection, "formula_addupperindex"); m_addGenericLowerAction = new KAction(i18n("Add Lower Index"), "gsub", 0, - this, SLOT(addGenericLowerIndex()), + this, TQT_SLOT(addGenericLowerIndex()), collection, "formula_addlowerindex"); m_addOverlineAction = new KAction(i18n("Add Overline"), "over", 0, - this, SLOT(addOverline()), + this, TQT_SLOT(addOverline()), collection, "formula_addoverline"); m_addUnderlineAction = new KAction(i18n("Add Underline"), "under", 0, - this, SLOT(addUnderline()), + this, TQT_SLOT(addUnderline()), collection, "formula_addunderline"); m_addMultilineAction = new KAction(i18n("Add Multiline"), "multiline", 0, - this, SLOT(addMultiline()), + this, TQT_SLOT(addMultiline()), collection, "formula_addmultiline"); m_removeEnclosingAction = new KAction(i18n("Remove Enclosing Element"), 0, - this, SLOT(removeEnclosing()), + this, TQT_SLOT(removeEnclosing()), collection, "formula_removeenclosing"); m_makeGreekAction = new KAction(i18n("Convert to Greek"), 0, - this, SLOT(makeGreek()), + this, TQT_SLOT(makeGreek()), collection, "formula_makegreek"); m_appendColumnAction = new KAction( i18n( "Append Column" ), "inscol", 0, - this, SLOT( appendColumn() ), + this, TQT_SLOT( appendColumn() ), collection, "formula_appendcolumn" ); m_insertColumnAction = new KAction( i18n( "Insert Column" ), "inscol", 0, - this, SLOT( insertColumn() ), + this, TQT_SLOT( insertColumn() ), collection, "formula_insertcolumn" ); m_removeColumnAction = new KAction( i18n( "Remove Column" ), "remcol", 0, - this, SLOT( removeColumn() ), + this, TQT_SLOT( removeColumn() ), collection, "formula_removecolumn" ); m_appendRowAction = new KAction( i18n( "Append Row" ), "insrow", 0, - this, SLOT( appendRow() ), + this, TQT_SLOT( appendRow() ), collection, "formula_appendrow" ); m_insertRowAction = new KAction( i18n( "Insert Row" ), "insrow", 0, - this, SLOT( insertRow() ), + this, TQT_SLOT( insertRow() ), collection, "formula_insertrow" ); m_removeRowAction = new KAction( i18n( "Remove Row" ), "remrow", 0, - this, SLOT( removeRow() ), + this, TQT_SLOT( removeRow() ), collection, "formula_removerow" ); m_syntaxHighlightingAction = new KToggleAction(i18n("Syntax Highlighting"), 0, - this, SLOT(toggleSyntaxHighlighting()), + this, TQT_SLOT(toggleSyntaxHighlighting()), collection, "formula_syntaxhighlighting"); //m_syntaxHighlightingAction->setChecked( m_contextStyle->syntaxHighlighting() ); m_formatBoldAction = new KToggleAction( i18n( "&Bold" ), "text_bold", 0, //CTRL + Key_B, - this, SLOT( textBold() ), + this, TQT_SLOT( textBold() ), collection, "formula_format_bold" ); m_formatItalicAction = new KToggleAction( i18n( "&Italic" ), "text_italic", 0, //CTRL + Key_I, - this, SLOT( textItalic() ), + this, TQT_SLOT( textItalic() ), collection, "formula_format_italic" ); m_formatBoldAction->setEnabled( false ); m_formatItalicAction->setEnabled( false ); - QStringList delimiter; - delimiter.append(QString("(")); - delimiter.append(QString("[")); - delimiter.append(QString("{")); - delimiter.append(QString("<")); - delimiter.append(QString("/")); - delimiter.append(QString("\\")); - delimiter.append(QString("|")); - delimiter.append(QString(" ")); - delimiter.append(QString(")")); - delimiter.append(QString("]")); - delimiter.append(QString("}")); - delimiter.append(QString(">")); + TQStringList delimiter; + delimiter.append(TQString("(")); + delimiter.append(TQString("[")); + delimiter.append(TQString("{")); + delimiter.append(TQString("<")); + delimiter.append(TQString("/")); + delimiter.append(TQString("\\")); + delimiter.append(TQString("|")); + delimiter.append(TQString(" ")); + delimiter.append(TQString(")")); + delimiter.append(TQString("]")); + delimiter.append(TQString("}")); + delimiter.append(TQString(">")); m_leftBracket = new KSelectAction(i18n("Left Delimiter"), - 0, this, SLOT(delimiterLeft()), + 0, this, TQT_SLOT(delimiterLeft()), collection, "formula_typeleft"); m_leftBracket->setItems(delimiter); //leftBracket->setCurrentItem(0); delimiter.clear(); - delimiter.append(QString(")")); - delimiter.append(QString("]")); - delimiter.append(QString("}")); - delimiter.append(QString(">")); - delimiter.append(QString("/")); - delimiter.append(QString("\\")); - delimiter.append(QString("|")); - delimiter.append(QString(" ")); - delimiter.append(QString("(")); - delimiter.append(QString("[")); - delimiter.append(QString("{")); - delimiter.append(QString("<")); + delimiter.append(TQString(")")); + delimiter.append(TQString("]")); + delimiter.append(TQString("}")); + delimiter.append(TQString(">")); + delimiter.append(TQString("/")); + delimiter.append(TQString("\\")); + delimiter.append(TQString("|")); + delimiter.append(TQString(" ")); + delimiter.append(TQString("(")); + delimiter.append(TQString("[")); + delimiter.append(TQString("{")); + delimiter.append(TQString("<")); m_rightBracket = new KSelectAction(i18n("Right Delimiter"), - 0, this, SLOT(delimiterRight()), + 0, this, TQT_SLOT(delimiterRight()), collection, "formula_typeright"); m_rightBracket->setItems(delimiter); //rightBracket->setCurrentItem(0); @@ -668,30 +668,30 @@ void DocumentWrapper::createActions( KActionCollection* collection ) m_insertSymbolAction = new KAction(i18n("Insert Symbol"), "key_enter", /*CTRL + Key_I*/0, - this, SLOT(insertSymbol()), + this, TQT_SLOT(insertSymbol()), collection, "formula_insertsymbol"); m_symbolNamesAction = new SymbolAction(i18n("Symbol Names"), - 0, this, SLOT(symbolNames()), + 0, this, TQT_SLOT(symbolNames()), collection, "formula_symbolnames"); - QStringList ff; + TQStringList ff; ff.append( i18n( "Normal" ) ); ff.append( i18n( "Script" ) ); ff.append( i18n( "Fraktur" ) ); ff.append( i18n( "Double Struck" ) ); m_fontFamily = new KSelectAction(i18n("Font Family"), - 0, this, SLOT(fontFamily()), + 0, this, TQT_SLOT(fontFamily()), collection, "formula_fontfamily"); m_fontFamily->setItems( ff ); m_fontFamily->setEnabled( false ); - QStringList et; + TQStringList et; et.append( i18n( "Identifier" ) ); et.append( i18n( "Operator" ) ); et.append( i18n( "Number" ) ); et.append( i18n( "Text" ) ); m_tokenElement = new KSelectAction( i18n( "Token Type" ), - 0, this, SLOT( tokenElement() ), + 0, this, TQT_SLOT( tokenElement() ), collection, "formula_tokenelement" ); m_tokenElement->setItems( et ); // m_tokenElements->setEnabled( true ); @@ -760,7 +760,7 @@ void DocumentWrapper::addThickSpace() void DocumentWrapper::addQuadSpace() { if (hasFormula()) { - SpaceRequest r( QUAD ); + SpaceRequest r( TQUAD ); formula()->performRequest( &r ); } } @@ -968,9 +968,9 @@ void DocumentWrapper::makeGreek() void DocumentWrapper::insertSymbol() { if ( hasFormula() && - m_document->m_contextStyle->symbolTable().contains( m_selectedName ) ) { - QChar ch = m_document->m_contextStyle->symbolTable().unicode( m_selectedName ); - if ( ch != QChar::null ) { + m_document->m_contextStyle->symbolTable().tqcontains( m_selectedName ) ) { + TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( m_selectedName ); + if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); } @@ -981,12 +981,12 @@ void DocumentWrapper::insertSymbol() } } -void DocumentWrapper::insertSymbol( QString name ) +void DocumentWrapper::insertSymbol( TQString name ) { if ( hasFormula() ) { - if ( m_document->m_contextStyle->symbolTable().contains( name ) ) { - QChar ch = m_document->m_contextStyle->symbolTable().unicode( name ); - if ( ch != QChar::null ) { + if ( m_document->m_contextStyle->symbolTable().tqcontains( name ) ) { + TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( name ); + if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); return; @@ -1074,8 +1074,8 @@ void DocumentWrapper::textItalic() void DocumentWrapper::delimiterLeft() { - QString left = m_leftBracket->currentText(); - switch ( left.at(0).latin1() ) { + TQString left = m_leftBracket->currentText(); + switch ( left.tqat(0).latin1() ) { case '[': case ']': case '{': @@ -1086,7 +1086,7 @@ void DocumentWrapper::delimiterLeft() case ')': case '/': case '\\': - m_leftBracketChar = static_cast( left.at(0).latin1() ); + m_leftBracketChar = static_cast( left.tqat(0).latin1() ); break; case '|': m_leftBracketChar = LeftLineBracket; @@ -1099,8 +1099,8 @@ void DocumentWrapper::delimiterLeft() void DocumentWrapper::delimiterRight() { - QString right = m_rightBracket->currentText(); - switch ( right.at(0).latin1() ) { + TQString right = m_rightBracket->currentText(); + switch ( right.tqat(0).latin1() ) { case '[': case ']': case '{': @@ -1111,7 +1111,7 @@ void DocumentWrapper::delimiterRight() case ')': case '/': case '\\': - m_rightBracketChar = static_cast( right.at(0).latin1() ); + m_rightBracketChar = static_cast( right.tqat(0).latin1() ); break; case '|': m_rightBracketChar = RightLineBracket; @@ -1166,15 +1166,15 @@ void DocumentWrapper::initSymbolNamesAction() { if ( m_hasActions ) { const SymbolTable& st = m_document->m_contextStyle->symbolTable(); - QStringList names = st.allNames(); - QFont font( m_document->m_contextStyle->getFontStyle() ); - QMemArray chars( names.count() ); + TQStringList names = st.allNames(); + TQFont font( m_document->m_contextStyle->getFontStyle() ); + TQMemArray chars( names.count() ); uint i = 0; - for ( QStringList::Iterator it = names.begin(); + for ( TQStringList::Iterator it = names.begin(); it != names.end(); ++it, ++i ) { - chars[ i ] = st.unicode( *it ); + chars[ i ] = st.tqunicode( *it ); } m_symbolNamesAction->setSymbols( names, m_document->m_contextStyle->getMathFont(), chars ); m_selectedName = names[0]; diff --git a/lib/kformula/kformuladocument.h b/lib/kformula/kformuladocument.h index 26d6bdd7..62b2dab3 100644 --- a/lib/kformula/kformuladocument.h +++ b/lib/kformula/kformuladocument.h @@ -21,11 +21,11 @@ #ifndef KFORMULADOCUMENT_H #define KFORMULADOCUMENT_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,10 +48,10 @@ class ElementCreationStrategy; * small utility class representing a sortable (by x,y position) list * of formulas you can use sort() and inSort(item) **/ -class FormulaList: public QPtrList +class FormulaList: public TQPtrList { protected: - virtual int compareItems( QPtrCollection::Item a, QPtrCollection::Item b ); + virtual int compareItems( TQPtrCollection::Item a, TQPtrCollection::Item b ); }; @@ -65,8 +65,9 @@ protected: * bother to ask the document. It's legal to directly create * or destroy a Container object. */ -class KOFORMULA_EXPORT Document : public QObject { +class KOFORMULA_EXPORT Document : public TQObject { Q_OBJECT + TQ_OBJECT friend class DocumentWrapper; friend class Container; @@ -76,8 +77,8 @@ public: /** * Creates a formula document. */ - Document( QObject *parent=0, const char *name=0, - const QStringList &args=QStringList() ); + Document( TQObject *tqparent=0, const char *name=0, + const TQStringList &args=TQStringList() ); ~Document(); /** @@ -108,28 +109,28 @@ public: * Load a kformula DomDocument with all its formulas. * This must only be called on a virgin document. */ - bool loadXML( const QDomDocument& doc ); + bool loadXML( const TQDomDocument& doc ); /** * Load a OASIS content.xml DomDocument * @since 1.4 */ - bool loadOasis( const QDomDocument& doc ); + bool loadOasis( const TQDomDocument& doc ); /** * Load the document settings. */ - bool loadDocumentPart( QDomElement node ); + bool loadDocumentPart( TQDomElement node ); /** * Save the document with all its formulae. */ - QDomDocument saveXML(); + TQDomDocument saveXML(); /** * Save the document settings. */ - QDomElement saveDocumentPart( QDomDocument& doc ); + TQDomElement saveDocumentPart( TQDomDocument& doc ); /** @@ -184,13 +185,13 @@ public: /** * Return a kformula DomDocument. */ - static QDomDocument createDomDocument(); + static TQDomDocument createDomDocument(); /** - * Create a MathML Dom Document, deprecates KFO Dom Document for internal layout + * Create a MathML Dom Document, deprecates KFO Dom Document for internal tqlayout * TODO: Shouldn't this go to KoDocument ? */ - QDomDocument createMathMLDomDocument(); + TQDomDocument createMathMLDomDocument(); /** * Set formula creation strategy: old KFormula or MathML/ODF. @@ -198,14 +199,14 @@ public: * * @param strategy -- "Ordinary" for old Kformula, "Oasis" for MathML/ODF */ - void setCreationStrategy( QString strategy ); + void setCreationStrategy( TQString strategy ); public: /** * @returns an iterator for the collection of formulas. */ - QPtrListIterator formulas(); + TQPtrListIterator formulas(); SymbolType leftBracketChar(); SymbolType rightBracketChar(); @@ -288,8 +289,9 @@ private: * A Wrapper that constracts the actions and must be given a real * document to work with. */ -class KOFORMULA_EXPORT DocumentWrapper : public QObject { +class KOFORMULA_EXPORT DocumentWrapper : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -412,7 +414,7 @@ public slots: void removeEnclosing(); void makeGreek(); void insertSymbol(); - void insertSymbol( QString name ); + void insertSymbol( TQString name ); void appendColumn(); void insertColumn(); @@ -491,7 +493,7 @@ private: SymbolType m_leftBracketChar; SymbolType m_rightBracketChar; - QString m_selectedName; + TQString m_selectedName; KConfig* m_config; KoCommandHistory* m_history; diff --git a/lib/kformula/kformulainputfilter.h b/lib/kformula/kformulainputfilter.h index f91efe8c..81b0625e 100644 --- a/lib/kformula/kformulainputfilter.h +++ b/lib/kformula/kformulainputfilter.h @@ -21,21 +21,22 @@ #ifndef KFORMULAINPUTFILTER_H #define KFORMULAINPUTFILTER_H -#include -#include +#include +#include #include "kformuladefs.h" KFORMULA_NAMESPACE_BEGIN -class KFInputFilter : public QObject +class KFInputFilter : public TQObject { Q_OBJECT + TQ_OBJECT public: /* * Get the just created DOM. */ - virtual QDomDocument getKFormulaDom() =0; + virtual TQDomDocument getKFormulaDom() =0; bool isDone() {return done; } diff --git a/lib/kformula/kformulamathmlread.cc b/lib/kformula/kformulamathmlread.cc index 1bee8550..f42e3ae1 100644 --- a/lib/kformula/kformulamathmlread.cc +++ b/lib/kformula/kformulamathmlread.cc @@ -19,8 +19,8 @@ */ #include -#include -#include +#include +#include #include #include @@ -40,53 +40,53 @@ class MathML2KFormulaPrivate public: MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& contextStyle, - const QDomDocument& formuladoc ); + const TQDomDocument& formuladoc ); ~MathML2KFormulaPrivate(); - void math( QDomElement element ); + void math( TQDomElement element ); // Token Elements - void mi( QDomElement element, QDomNode docnode ); - void mn( QDomElement element, QDomNode docnode ); - void mo( QDomElement element, QDomNode docnode ); - void mtext( QDomElement element, QDomNode docnode ); - void mspace( QDomElement element, QDomNode docnode ); - void ms( QDomElement element, QDomNode docnode ); + void mi( TQDomElement element, TQDomNode docnode ); + void mn( TQDomElement element, TQDomNode docnode ); + void mo( TQDomElement element, TQDomNode docnode ); + void mtext( TQDomElement element, TQDomNode docnode ); + void mspace( TQDomElement element, TQDomNode docnode ); + void ms( TQDomElement element, TQDomNode docnode ); // mglyph not supported // General Layout Schemata - void mrow( QDomElement element, QDomNode docnode ); - void mfrac( QDomElement element, QDomNode docnode ); - void msqrt( QDomElement element, QDomNode docnode ); - void mroot( QDomElement element, QDomNode docnode ); - void mstyle( QDomElement element, QDomNode docnode ); + void mrow( TQDomElement element, TQDomNode docnode ); + void mfrac( TQDomElement element, TQDomNode docnode ); + void msqrt( TQDomElement element, TQDomNode docnode ); + void mroot( TQDomElement element, TQDomNode docnode ); + void mstyle( TQDomElement element, TQDomNode docnode ); // merror not supported // mpadded not supported // mphantom not supported - void mfenced( QDomElement element, QDomNode docnode ); + void mfenced( TQDomElement element, TQDomNode docnode ); // menclose not supported // Script and Limit Schemata - void msub_msup( QDomElement element, QDomNode docnode ); - void msubsup( QDomElement element, QDomNode docnode ); - void munder( QDomElement element, QDomNode docnode, bool oasisFormat ); - void mover( QDomElement element, QDomNode docnode, bool oasisFormat ); - void munderover( QDomElement element, QDomNode docnode, bool oasisFormat ); + void msub_msup( TQDomElement element, TQDomNode docnode ); + void msubsup( TQDomElement element, TQDomNode docnode ); + void munder( TQDomElement element, TQDomNode docnode, bool oasisFormat ); + void mover( TQDomElement element, TQDomNode docnode, bool oasisFormat ); + void munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat ); // mmultiscripts not supported // Tables and Matrices - void mtable( QDomElement element, QDomNode docnode ); + void mtable( TQDomElement element, TQDomNode docnode ); // not much supported // Enlivening Expressions // maction not supported protected: - void createTextElements( QString text, QDomNode docnode ); - void createNameSequence( QString text, QDomNode docnode ); - double convertToPoint( QString value, bool* ok ); - bool isEmbellishedOperator( QDomNode node, QDomElement* mo, bool oasisFormat ); - bool isSpaceLike( QDomNode node, bool oasisFormat ); + void createTextElements( TQString text, TQDomNode docnode ); + void createNameSequence( TQString text, TQDomNode docnode ); + double convertToPoint( TQString value, bool* ok ); + bool isEmbellishedOperator( TQDomNode node, TQDomElement* mo, bool oasisFormat ); + bool isSpaceLike( TQDomNode node, bool oasisFormat ); enum MathVariant { normal, @@ -132,7 +132,7 @@ protected: << endl; } - void setStyles( QDomElement element ) + void setStyles( TQDomElement element ) { if ( !useVariant ) return; @@ -189,7 +189,7 @@ protected: } } - void readStyles( QDomElement mmlElement ) + void readStyles( TQDomElement mmlElement ) { if ( mmlElement.hasAttribute( "mathvariant" ) ) { @@ -250,14 +250,14 @@ protected: }; MathStyle style; - QDomDocument doc; + TQDomDocument doc; private: const ContextStyle& context; MathML2KFormula* filter; }; -MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const QDomDocument& formuladoc ) +MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const TQDomDocument& formuladoc ) : doc( formuladoc ), context( cs ), filter( mml_filter ) { } @@ -266,12 +266,12 @@ MathML2KFormulaPrivate::~MathML2KFormulaPrivate() { } -void MathML2KFormulaPrivate::math( QDomElement element ) +void MathML2KFormulaPrivate::math( TQDomElement element ) { - QDomElement formula = doc.createElement( "FORMULA" ); - QDomNode n = element.firstChild(); + TQDomElement formula = doc.createElement( "FORMULA" ); + TQDomNode n = element.firstChild(); - QString display = element.attribute( "display" ); + TQString display = element.attribute( "display" ); if ( display == "block" ) { style.displaystyle = true; @@ -295,10 +295,10 @@ void MathML2KFormulaPrivate::math( QDomElement element ) doc.appendChild( formula ); } -void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mi( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); if ( text.length() == 1 ) { // Default italic, only when content is one char style.mathvariant = italic; style.useVariant = true; @@ -311,38 +311,38 @@ void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::mo( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mo( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); createTextElements( text, docnode ); style = previousStyle; } -void MathML2KFormulaPrivate::mn( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mn( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); createTextElements( text, docnode ); style = previousStyle; } -void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mtext( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isText() ) { - QString text = n.toText().data().stripWhiteSpace(); + TQString text = n.toText().data().stripWhiteSpace(); createTextElements( text, docnode ); } else if ( n.isElement() ) { @@ -358,11 +358,11 @@ void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::ms( TQDomElement element, TQDomNode docnode ) { - QString lquote = element.attribute( "lquote", "\"" ); - QString rquote = element.attribute( "rquote", "\"" ); - QString text; + TQString lquote = element.attribute( "lquote", "\"" ); + TQString rquote = element.attribute( "rquote", "\"" ); + TQString text; text = lquote; text += element.text().stripWhiteSpace(); @@ -371,12 +371,12 @@ void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode ) createTextElements( text, docnode ); } -void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mspace( TQDomElement element, TQDomNode docnode ) { // we support only horizontal space - QString width = element.attribute( "width" ); + TQString width = element.attribute( "width" ); - QDomElement spaceelement = doc.createElement( "SPACE" ); + TQDomElement spaceelement = doc.createElement( "SPACE" ); // check for namedspace. We don't support much... if ( width == "veryverythinmathspace" ) { @@ -411,7 +411,7 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) // See MathML specification, Appendix H w = context.getDefaultFont().pointSize(); if ( w == -1 ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); w = fm.width( 'm' ); } w = w * width.remove( width.length() - 2, 2 ).toDouble( &ok ); @@ -461,12 +461,12 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) docnode.appendChild( spaceelement ); } -void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mrow( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isElement () ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); // We do not allow sequence inside sequence filter->processElement( e, doc, docnode ); } @@ -477,10 +477,10 @@ void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode ) } } -void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mfrac( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); - QDomElement fraction = doc.createElement( "FRACTION" ); + TQDomNode n = element.firstChild(); + TQDomElement fraction = doc.createElement( "FRACTION" ); MathStyle previousStyle( style ); style.displaystyle ? style.displaystyle = false : style.scriptlevel += 1; @@ -491,21 +491,21 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) if ( n.isElement() ) { ++i; if ( i == 1 ) { //first is numerator - QDomElement numerator = + TQDomElement numerator = doc.createElement( "NUMERATOR" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); numerator.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); fraction.appendChild( numerator ); } else { - QDomElement denominator = + TQDomElement denominator = doc.createElement( "DENOMINATOR" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); denominator.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); fraction.appendChild( denominator ); @@ -521,20 +521,20 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) docnode.appendChild( fraction ); } -void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mroot( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "ROOT" ); + TQDomElement root = doc.createElement( "ROOT" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { //first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild(content); @@ -545,10 +545,10 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement index = doc.createElement( "INDEX" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -563,13 +563,13 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msqrt( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); - QDomElement root = doc.createElement( "ROOT" ); + TQDomNode n = element.firstChild(); + TQDomElement root = doc.createElement( "ROOT" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); root.appendChild( content ); @@ -586,7 +586,7 @@ void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mstyle( TQDomElement element, TQDomNode docnode ) { bool ok; @@ -594,7 +594,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.readStyles( element ); if ( element.hasAttribute( "scriptlevel" ) ) { - QString scriptlevel = element.attribute( "scriptlevel" ); + TQString scriptlevel = element.attribute( "scriptlevel" ); if ( scriptlevel.startsWith( "+" ) || scriptlevel.startsWith( "-" ) ) style.scriptlevel += scriptlevel.toInt( &ok ); else @@ -603,7 +603,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.scriptlevel = previousStyle.scriptlevel; } if ( element.hasAttribute( "displaystyle" ) ) { - QString displaystyle = element.attribute( "displaystyle" ); + TQString displaystyle = element.attribute( "displaystyle" ); if ( displaystyle == "true" ) style.displaystyle = true; else if ( displaystyle == "false" ) @@ -616,50 +616,50 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.scriptsizemultiplier = previousStyle.scriptsizemultiplier; } if ( element.hasAttribute( "scriptminsize" ) ) { - QString scriptminsize = element.attribute( "scriptminsize" ); + TQString scriptminsize = element.attribute( "scriptminsize" ); style.scriptminsize = convertToPoint( scriptminsize, &ok ); if ( !ok ) style.scriptminsize = previousStyle.scriptminsize; } if ( element.hasAttribute( "veryverythinmathspace" ) ) { - QString vvthinmspace = element.attribute( "veryverythinmathspace" ); + TQString vvthinmspace = element.attribute( "veryverythinmathspace" ); style.veryverythinmathspace = convertToPoint( vvthinmspace, &ok ); if ( !ok ) style.veryverythinmathspace = previousStyle.veryverythinmathspace; } if ( element.hasAttribute( "verythinmathspace" ) ) { - QString vthinmspace = element.attribute( "verythinmathspace" ); + TQString vthinmspace = element.attribute( "verythinmathspace" ); style.verythinmathspace = convertToPoint( vthinmspace, &ok ); if ( !ok ) style.verythinmathspace = previousStyle.verythinmathspace; } if ( element.hasAttribute( "thinmathspace" ) ) { - QString thinmathspace = element.attribute( "thinmathspace" ); + TQString thinmathspace = element.attribute( "thinmathspace" ); style.thinmathspace = convertToPoint( thinmathspace, &ok ); if ( !ok ) style.thinmathspace = previousStyle.thinmathspace; } if ( element.hasAttribute( "mediummathspace" ) ) { - QString mediummathspace = element.attribute( "mediummathspace" ); + TQString mediummathspace = element.attribute( "mediummathspace" ); style.mediummathspace = convertToPoint( mediummathspace, &ok ); if ( !ok ) style.mediummathspace = previousStyle.mediummathspace; } if ( element.hasAttribute( "thickmathspace" ) ) { - QString thickmathspace = element.attribute( "thickmathspace" ); + TQString thickmathspace = element.attribute( "thickmathspace" ); style.thickmathspace = convertToPoint( thickmathspace, &ok ); if ( !ok ) style.thickmathspace = previousStyle.thickmathspace; } if ( element.hasAttribute( "verythickmathspace" ) ) { - QString vthickmspace = element.attribute( "verythickmathspace" ); + TQString vthickmspace = element.attribute( "verythickmathspace" ); style.verythickmathspace = convertToPoint( vthickmspace, &ok ); if ( !ok ) style.verythickmathspace = previousStyle.verythickmathspace; } if ( element.hasAttribute( "veryverythickmathspace" ) ) { - QString vvthickmspace = element.attribute( "veryverythickmathspace" ); + TQString vvthickmspace = element.attribute( "veryverythickmathspace" ); style.veryverythickmathspace = convertToPoint( vvthickmspace, &ok ); if ( !ok ) style.veryverythickmathspace = @@ -668,7 +668,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.styleChange(); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { filter->processElement( n, doc, docnode ); n = n.nextSibling(); @@ -677,34 +677,34 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mfenced( TQDomElement element, TQDomNode docnode ) { - QDomElement bracket = doc.createElement( "BRACKET" ); - QString value = element.attribute( "open", "(" ); - bracket.setAttribute( "LEFT", QString::number( value.at( 0 ).latin1() ) ); + TQDomElement bracket = doc.createElement( "BRACKET" ); + TQString value = element.attribute( "open", "(" ); + bracket.setAttribute( "LEFT", TQString::number( value.at( 0 ).latin1() ) ); value = element.attribute( "close", ")" ); - bracket.setAttribute( "RIGHT", QString::number( value.at( 0 ).latin1() ) ); + bracket.setAttribute( "RIGHT", TQString::number( value.at( 0 ).latin1() ) ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QString separators = element.attribute( "separators", "," ); + TQString separators = element.attribute( "separators", "," ); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); uint i = 0; while ( !n.isNull() ) { if ( n.isElement() ) { if ( i != 0 && !separators.isEmpty() ) { - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement textelement = doc.createElement( "TEXT" ); if ( i > separators.length() ) i = separators.length(); - textelement.setAttribute( "CHAR", QString( separators.at( i - 1 ) ) ); + textelement.setAttribute( "CHAR", TQString( separators.at( i - 1 ) ) ); //style.setStyles( textelement ); sequence.appendChild( textelement ); } ++i; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); } else { @@ -716,10 +716,10 @@ void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode ) docnode.appendChild( bracket ); } -void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mtable( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); - QString displaystyle = element.attribute( "displaystyle", "false" ); + TQString displaystyle = element.attribute( "displaystyle", "false" ); if ( displaystyle == "true" ) { style.displaystyle = true; } @@ -729,13 +729,13 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) } style.styleChange(); - QString subtag; + TQString subtag; int rows = 0; int cols = 0; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); subtag = e.tagName(); if (subtag == "mtr") { @@ -743,7 +743,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) /* Determins the number of columns */ - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { @@ -767,22 +767,22 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) of rows and cols to leave empty spaces */ n = element.firstChild(); - QDomElement matrix = doc.createElement( "MATRIX" ); + TQDomElement matrix = doc.createElement( "MATRIX" ); matrix.setAttribute( "COLUMNS", cols ); matrix.setAttribute( "ROWS", rows ); while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); subtag = e.tagName(); if ( subtag == "mtr" ) { - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { if ( cellnode.isElement() ) { ++cc; - QDomElement cell = doc.createElement( "SEQUENCE" ); - QDomElement cellelement = cellnode.toElement(); + TQDomElement cell = doc.createElement( "SEQUENCE" ); + TQDomElement cellelement = cellnode.toElement(); filter->processElement( cellelement, doc, cell ); matrix.appendChild( cell ); } @@ -791,7 +791,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) /* Add empty elements */ for(; cc < cols; cc++ ) { - QDomElement cell = doc.createElement( "SEQUENCE" ); + TQDomElement cell = doc.createElement( "SEQUENCE" ); matrix.appendChild( cell ); } } @@ -803,26 +803,26 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) docnode.appendChild(matrix); } -void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msub_msup( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); } else { - QDomElement index; + TQDomElement index; if ( element.tagName() == "msup" ) index = doc.createElement( "UPPERRIGHT" ); else @@ -833,9 +833,9 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -851,11 +851,11 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::munder( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accentunder; - QString au = element.attribute( "accentunder" ); + TQString au = element.attribute( "accentunder" ); if ( au == "true" ) accentunder = true; else if ( au == "false" ) @@ -863,7 +863,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool else { // use default - QDomElement mo; + TQDomElement mo; // is underscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -875,18 +875,18 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool accentunder = false; } - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -899,7 +899,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -910,9 +910,9 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool index = doc.createElement( "LOWERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -929,11 +929,11 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool docnode.appendChild( root ); } -void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::mover( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accent; - QString ac = element.attribute( "accent" ); + TQString ac = element.attribute( "accent" ); if ( ac == "true" ) accent = true; else if ( ac == "false" ) @@ -941,7 +941,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool else { // use default - QDomElement mo; + TQDomElement mo; // is overscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -953,18 +953,18 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool accent = false; } - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -977,7 +977,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -988,9 +988,9 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool index = doc.createElement( "UPPERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1007,12 +1007,12 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool docnode.appendChild( root ); } -void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accent; bool accentunder; - QString value = element.attribute( "accentunder" ); + TQString value = element.attribute( "accentunder" ); if ( value == "true" ) accentunder = true; else if ( value == "false" ) @@ -1020,7 +1020,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, else { // use default - QDomElement mo; + TQDomElement mo; // is underscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -1039,7 +1039,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, else { // use default - QDomElement mo; + TQDomElement mo; // is overscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 2 ), &mo,oasisFormat ) ) { kdDebug( DEBUGID ) << "embellished operator" << endl; @@ -1054,18 +1054,18 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, kdDebug( DEBUGID ) << "munderover:\n accentunder = " << accentunder << "\n accent = " << accent << endl; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 3 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // base - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -1078,7 +1078,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; // is the base an embellished operator? if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) && !previousStyle.displaystyle && @@ -1090,9 +1090,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, index = doc.createElement( "LOWERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1106,7 +1106,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -1117,9 +1117,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, index = doc.createElement( "UPPERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1136,21 +1136,21 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, docnode.appendChild( root ); } -void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msubsup( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement("INDEX"); + TQDomElement root = doc.createElement("INDEX"); MathStyle previousStyle( style ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // base - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -1160,22 +1160,22 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement index; + TQDomElement index; index = doc.createElement( "LOWERRIGHT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); } else { // superscript - QDomElement index; + TQDomElement index; index = doc.createElement( "UPPERRIGHT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1191,11 +1191,11 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode ) +void MathML2KFormulaPrivate::createTextElements( TQString text, TQDomNode docnode ) { for ( uint i = 0; i < text.length(); ++i ) { - QDomElement textelement = doc.createElement( "TEXT" ); - textelement.setAttribute( "CHAR", QString( text.at( i ) ) ); + TQDomElement textelement = doc.createElement( "TEXT" ); + textelement.setAttribute( "CHAR", TQString( text.at( i ) ) ); style.setStyles( textelement ); if ( context.symbolTable().inTable( text.at( i ) ) ) { // The element is a symbol. @@ -1205,12 +1205,12 @@ void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode } } -void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode ) +void MathML2KFormulaPrivate::createNameSequence( TQString text, TQDomNode docnode ) { - QDomElement namesequence = doc.createElement( "NAMESEQUENCE" ); + TQDomElement namesequence = doc.createElement( "NAMESEQUENCE" ); for ( uint i = 0; i < text.length(); ++i ) { - QDomElement textelement = doc.createElement( "TEXT" ); - textelement.setAttribute( "CHAR", QString( text.at( i ) ) ); + TQDomElement textelement = doc.createElement( "TEXT" ); + textelement.setAttribute( "CHAR", TQString( text.at( i ) ) ); style.setStyles( textelement ); if ( context.symbolTable().inTable( text.at( i ) ) ) { // The element is a symbol. @@ -1221,7 +1221,7 @@ void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode docnode.appendChild( namesequence ); } -double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) +double MathML2KFormulaPrivate::convertToPoint( TQString value, bool* ok ) { double pt = 0; @@ -1229,14 +1229,14 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) // See MathML specification, Appendix H pt = context.getDefaultFont().pointSize(); if ( pt == -1 ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); pt = fm.width( 'M' ); // PIXELS! } pt = pt * value.remove( value.length() - 2, 2 ).toDouble( ok ); } else if ( value.endsWith( "ex" ) ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); pt = fm.height(); // PIXELS, and totally wrong! } @@ -1270,16 +1270,16 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) return pt; } -bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, - QDomElement* mo, bool oasisFormat ) +bool MathML2KFormulaPrivate::isEmbellishedOperator( TQDomNode node, + TQDomElement* mo, bool oasisFormat ) { // See MathML 2.0 specification: 3.2.5.7 if ( !node.isElement() ) return false; - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mo" ) { @@ -1297,7 +1297,7 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, return false; // not supported } if ( tag == "mrow" || tag == "mstyle" || tag == "mphantom" || tag == "mpadded" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; while ( !n.isNull() ) { @@ -1315,22 +1315,22 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, return false; } -bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat ) +bool MathML2KFormulaPrivate::isSpaceLike( TQDomNode node, bool oasisFormat ) { // See MathML 2.0 specification: 3.2.7.3 if ( !node.isElement() ) return false; - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mtext" || tag == "mspace" || tag == "maligngroup" || tag == "malignmark" ) { return true; } if ( tag == "mstyle" || tag == "mphantom" || tag == "mpadded" || tag == "mrow" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( isSpaceLike( n,oasisFormat ) ) n = n.nextSibling(); @@ -1347,20 +1347,20 @@ bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat ) } -MathML2KFormula::MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat ) +MathML2KFormula::MathML2KFormula( const TQDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat ) : m_error( false ), oasisFormat( _oasisFormat ), context( contextStyle ) { orig_element = mmldoc.documentElement(); done = false; } -MathML2KFormula::MathML2KFormula( const QDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat ) +MathML2KFormula::MathML2KFormula( const TQDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat ) : m_error( false ), orig_element( mmlelm ), oasisFormat( _oasisFormat ), context( contextStyle ) { done = false; } -QDomDocument MathML2KFormula::getKFormulaDom() +TQDomDocument MathML2KFormula::getKFormulaDom() { return formuladoc; } @@ -1372,7 +1372,7 @@ void MathML2KFormula::startConversion() //TODO:let it be async //kdDebug() << origdoc.toString() << endl; done = false; - formuladoc = QDomDocument( "KFORMULA" ); + formuladoc = TQDomDocument( "KFORMULA" ); impl = new MathML2KFormulaPrivate( this, context, formuladoc ); if ( orig_element.tagName() == "math" ) { impl->math( orig_element ); @@ -1386,15 +1386,15 @@ void MathML2KFormula::startConversion() done = true; } -bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode docnode ) +bool MathML2KFormula::processElement( TQDomNode node, TQDomDocument& doc, TQDomNode docnode ) { - //QDomElement *element; + //TQDomElement *element; Type type = UNKNOWN; if ( node.isElement() ) { - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mi" ) { type = TOKEN; @@ -1472,16 +1472,16 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode // content markup (not yet complete) else if ( tag == "apply" ) { type = CONTENT; - QDomNode n = element.firstChild(); - QDomElement op = n.toElement(); + TQDomNode n = element.firstChild(); + TQDomElement op = n.toElement(); uint count = element.childNodes().count(); - //adding explicit brackets to replace "apply"s implicit ones - QDomElement brackets = doc.createElement("BRACKET"); + //adding explicit brackets to tqreplace "apply"s implicit ones + TQDomElement brackets = doc.createElement("BRACKET"); brackets.setAttribute("RIGHT", "41"); brackets.setAttribute("LEFT", "40"); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); brackets.appendChild(content); - QDomElement base = doc.createElement("SEQUENCE"); + TQDomElement base = doc.createElement("SEQUENCE"); content.appendChild(base); docnode.appendChild(brackets); //Arithmetic, Algebra and Logic operators status @@ -1523,8 +1523,8 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode while ( !n.isNull() ) { if ( n.isElement() ) { if ( !first ) { - QDomElement text = doc.createElement( "TEXT" ); - QString value; + TQDomElement text = doc.createElement( "TEXT" ); + TQString value; if ( op.tagName() == "plus" ) value = "+"; @@ -1541,7 +1541,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode base.appendChild( text ); } first = false; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); } n = n.nextSibling(); @@ -1549,7 +1549,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( op.tagName() == "factorial" ) { - QDomElement e = n.nextSibling().toElement(); + TQDomElement e = n.nextSibling().toElement(); processElement( e, doc, docnode ); impl->createTextElements( "!", base ); } @@ -1557,11 +1557,11 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode n = n.nextSibling(); if ( count == 2 ) { // unary impl->createTextElements( "-", base ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); } else if ( count == 3 ) { // binary - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); impl->createTextElements( "-", base ); n = n.nextSibling(); @@ -1572,7 +1572,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( op.tagName() == "divide" && count == 3 ) { n = n.nextSibling(); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); impl->createTextElements("/", base); n = n.nextSibling(); @@ -1582,15 +1582,15 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( op.tagName() == "power" && count == 3 ) { //code duplication of msub_sup(), but I can't find a way to cleanly call it n = n.nextSibling(); - QDomElement e = n.toElement(); - QDomElement index = doc.createElement("INDEX"); + TQDomElement e = n.toElement(); + TQDomElement index = doc.createElement("INDEX"); base.appendChild(index); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); index.appendChild(content); - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); content.appendChild(sequence); processElement(e, doc, sequence); - QDomElement upper = doc.createElement("UPPERRIGHT"); + TQDomElement upper = doc.createElement("UPPERRIGHT"); index.appendChild(upper); sequence = doc.createElement("SEQUENCE"); upper.appendChild(sequence); @@ -1600,28 +1600,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( op.tagName() == "abs" && count == 2) { n = n.nextSibling(); - QDomElement e = n.toElement(); - QDomElement bracket = doc.createElement("BRACKET"); + TQDomElement e = n.toElement(); + TQDomElement bracket = doc.createElement("BRACKET"); bracket.setAttribute("RIGHT", "257"); bracket.setAttribute("LEFT", "256"); base.appendChild(bracket); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); bracket.appendChild(content); - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); content.appendChild(sequence); processElement(e, doc, sequence); } else if ( op.tagName() == "not" && count == 2) { n = n.nextSibling(); - QDomElement e = n.toElement(); - impl->createTextElements(QString(QChar(0xAC)), base); + TQDomElement e = n.toElement(); + impl->createTextElements(TQString(TQChar(0xAC)), base); processElement(e, doc, base); } else if ( op.tagName() == "implies" && count == 3 ) { n = n.nextSibling(); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); - impl->createTextElements(QString(QChar(0x21D2)), base); + impl->createTextElements(TQString(TQChar(0x21D2)), base); n = n.nextSibling(); e = n.toElement(); processElement( e, doc, base ); @@ -1632,28 +1632,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "cn" ) { type = CONTENT; - QString type = element.attribute( "type", "real" ); + TQString type = element.attribute( "type", "real" ); if ( type == "real" || type == "constant" ) { impl->createTextElements( element.text().stripWhiteSpace(), docnode ); } else if ( type == "integer" ) { - QString base = element.attribute( "base" ); + TQString base = element.attribute( "base" ); if ( !base ) { impl->createTextElements( element.text().stripWhiteSpace(), docnode ); } else { - QDomElement index = doc.createElement( "INDEX" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); impl->createTextElements( element.text().stripWhiteSpace(), sequence ); content.appendChild( sequence ); index.appendChild( content ); - QDomElement lowerright = doc.createElement( "LOWERRIGHT" ); + TQDomElement lowerright = doc.createElement( "LOWERRIGHT" ); sequence = doc.createElement( "SEQUENCE" ); impl->createTextElements( base, sequence ); @@ -1665,7 +1665,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } } else if ( type == "rational" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); @@ -1677,7 +1677,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode docnode ); } else if ( type == "complex-cartesian" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); @@ -1692,21 +1692,21 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( type == "complex-polar" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); n = n.nextSibling(); // - QDomElement index = doc.createElement( "INDEX" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "e" ); sequence.appendChild( textelement ); content.appendChild( sequence ); index.appendChild( content ); - QDomElement upperright = doc.createElement( "UPPERRIGHT" ); + TQDomElement upperright = doc.createElement( "UPPERRIGHT" ); sequence = doc.createElement( "SEQUENCE" ); textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "i" ); @@ -1725,14 +1725,14 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "ci" ) { type = CONTENT; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); if ( n.isText() ) { impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); } else if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, docnode ); } else if ( n.isEntityReference() ) { @@ -1746,25 +1746,25 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "list" ) { type = CONTENT; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); - QDomElement bracket = doc.createElement( "BRACKET" ); + TQDomElement bracket = doc.createElement( "BRACKET" ); bracket.setAttribute( "LEFT", 91 ); // [ bracket.setAttribute( "RIGHT", 93 ); // ] - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); bool first = true; while ( !n.isNull() ) { if ( n.isElement() ) { if ( !first ) { - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "," ); sequence.appendChild( textelement ); } first = false; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, sequence ); } n = n.nextSibling(); @@ -1776,9 +1776,9 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } } - if ( type == UNKNOWN && node.nodeType() != QDomNode::AttributeNode ) { + if ( type == UNKNOWN && node.nodeType() != TQDomNode::AttributeNode ) { kdDebug() << "Not an element: " << node.nodeName() << endl; - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); while ( !n.isNull() ) { processElement( n, doc, docnode ); n = n.nextSibling(); diff --git a/lib/kformula/kformulamathmlread.h b/lib/kformula/kformulamathmlread.h index 2a3cb2a5..2aad4d68 100644 --- a/lib/kformula/kformulamathmlread.h +++ b/lib/kformula/kformulamathmlread.h @@ -21,8 +21,8 @@ #ifndef KFORMULAMATHMLREAD_H #define KFORMULAMATHMLREAD_H -#include -#include +#include +#include #include "kformulainputfilter.h" #include "contextstyle.h" @@ -37,6 +37,7 @@ class MathML2KFormulaPrivate; class MathML2KFormula : public KFInputFilter { Q_OBJECT + TQ_OBJECT friend class MathML2KFormulaPrivate; @@ -48,18 +49,18 @@ public: * a conversionFinished() signal, then call * getKFormulaDom() to get the converted DOM */ - MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool oasisFormat = false ); + MathML2KFormula( const TQDomDocument& mmldoc, const ContextStyle &contextStyle, bool oasisFormat = false ); /** * Build a MathML 2 KFormula converter. * A DOM Element is required instead of a full Document, useful for embedded MathML */ - MathML2KFormula( const QDomElement& mmelm, const ContextStyle &contextStyle, bool oasisFormat = false ); + MathML2KFormula( const TQDomElement& mmelm, const ContextStyle &contextStyle, bool oasisFormat = false ); /* * Get the just created DOM. */ - virtual QDomDocument getKFormulaDom(); + virtual TQDomDocument getKFormulaDom(); public slots: @@ -71,11 +72,11 @@ public: private: - bool processElement( QDomNode node, QDomDocument& doc, - QDomNode docnode ); + bool processElement( TQDomNode node, TQDomDocument& doc, + TQDomNode docnode ); - QDomElement orig_element; - QDomDocument formuladoc; + TQDomElement orig_element; + TQDomDocument formuladoc; bool oasisFormat; const ContextStyle& context; diff --git a/lib/kformula/kformulamimesource.cc b/lib/kformula/kformulamimesource.cc index a0438e5e..af727959 100644 --- a/lib/kformula/kformulamimesource.cc +++ b/lib/kformula/kformulamimesource.cc @@ -20,12 +20,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -39,7 +39,7 @@ KFORMULA_NAMESPACE_BEGIN using namespace std; -MimeSource::MimeSource(Document* doc, const QDomDocument& formula) +MimeSource::MimeSource(Document* doc, const TQDomDocument& formula) : formulaDocument( doc ), document(formula) { // The query for text/plain comes very often. So make sure @@ -48,7 +48,7 @@ MimeSource::MimeSource(Document* doc, const QDomDocument& formula) rootElement = new FormulaElement(this); FormulaCursor cursor(rootElement); - QPtrList list; + TQPtrList list; list.setAutoDelete(true); if ( cursor.buildElementsFromDom( document.documentElement(), list ) ) { cursor.insert(list); @@ -87,27 +87,27 @@ const char* MimeSource::format( int n ) const bool MimeSource::provides( const char * format) const { //This is not completed - if(QString(format)==selectionMimeType()) + if(TQString(format)==selectionMimeType()) return true; - else if(QString(format)=="image/ppm") + else if(TQString(format)=="image/ppm") return true; - else if(QString(format)=="text/plain") + else if(TQString(format)=="text/plain") return true; - else if(QString(format)=="text/x-tex") + else if(TQString(format)=="text/x-tex") return true; else return false; } -QByteArray MimeSource::encodedData ( const char *format ) const +TQByteArray MimeSource::tqencodedData ( const char *format ) const { - QString fmt=format; //case sensitive? + TQString fmt=format; //case sensitive? if ((fmt=="text/plain") || (fmt=="text/x-tex")) return latexString; if (fmt==selectionMimeType()) { - QByteArray d=document.toCString(); + TQByteArray d=document.toCString(); d.truncate(d.size()-1); return d; } @@ -119,31 +119,31 @@ QByteArray MimeSource::encodedData ( const char *format ) const //context.setResolution(5, 5); rootElement->calcSizes(context); - QRect rect(rootElement->getX(), rootElement->getY(), + TQRect rect(rootElement->getX(), rootElement->getY(), rootElement->getWidth(), rootElement->getHeight()); - QPixmap pm( context.layoutUnitToPixelX( rootElement->getWidth() ), - context.layoutUnitToPixelY( rootElement->getHeight() ) ); + TQPixmap pm( context.tqlayoutUnitToPixelX( rootElement->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement->getHeight() ) ); pm.fill(); - QPainter paint(&pm); + TQPainter paint(&pm); rootElement->draw(paint, rect, context); paint.end(); - QByteArray d; - QBuffer buff(d); + TQByteArray d; + TQBuffer buff(d); buff.open(IO_WriteOnly); - QImageIO io(&buff,"PPM"); - QImage ima=pm.convertToImage(); + TQImageIO io(&buff,"PPM"); + TQImage ima=pm.convertToImage(); ima.detach(); io.setImage(ima); if(!io.write()) - return QByteArray(); + return TQByteArray(); buff.close(); return d; } - return QByteArray(); + return TQByteArray(); } const SymbolTable& MimeSource::getSymbolTable() const diff --git a/lib/kformula/kformulamimesource.h b/lib/kformula/kformulamimesource.h index 5619e43b..a58255eb 100644 --- a/lib/kformula/kformulamimesource.h +++ b/lib/kformula/kformulamimesource.h @@ -21,8 +21,8 @@ #ifndef KFORMULAMIMESOURCE_H #define KFORMULAMIMESOURCE_H -#include -#include +#include +#include #include "kformulacontainer.h" #include @@ -31,15 +31,15 @@ KFORMULA_NAMESPACE_BEGIN class FormulaElement; -class KOFORMULA_EXPORT MimeSource : public QMimeSource, public FormulaDocument +class KOFORMULA_EXPORT MimeSource : public TQMimeSource, public FormulaDocument { public: - MimeSource(Document* doc, const QDomDocument& formula); + MimeSource(Document* doc, const TQDomDocument& formula); ~MimeSource(); virtual const char* format ( int n = 0 ) const; virtual bool provides ( const char * ) const; - virtual QByteArray encodedData ( const char * ) const; + virtual TQByteArray tqencodedData ( const char * ) const; virtual const SymbolTable& getSymbolTable() const; @@ -49,8 +49,8 @@ private: Document* formulaDocument; - QDomDocument document; - QByteArray latexString; + TQDomDocument document; + TQByteArray latexString; FormulaElement* rootElement; }; diff --git a/lib/kformula/kformulaview.cc b/lib/kformula/kformulaview.cc index 543bc727..8099f633 100644 --- a/lib/kformula/kformulaview.cc +++ b/lib/kformula/kformulaview.cc @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include #include @@ -41,25 +41,25 @@ struct View::View_Impl { : smallCursor(false), activeCursor(true), cursorHasChanged(true), document(doc) { - connect(document, SIGNAL(elementWillVanish(BasicElement*)), - view, SLOT(slotElementWillVanish(BasicElement*))); - connect(document, SIGNAL(formulaLoaded(FormulaElement*)), - view, SLOT(slotFormulaLoaded(FormulaElement*))); - connect(document, SIGNAL(cursorMoved(FormulaCursor*)), - view, SLOT(slotCursorMoved(FormulaCursor*))); + connect(document, TQT_SIGNAL(elementWillVanish(BasicElement*)), + view, TQT_SLOT(slotElementWillVanish(BasicElement*))); + connect(document, TQT_SIGNAL(formulaLoaded(FormulaElement*)), + view, TQT_SLOT(slotFormulaLoaded(FormulaElement*))); + connect(document, TQT_SIGNAL(cursorMoved(FormulaCursor*)), + view, TQT_SLOT(slotCursorMoved(FormulaCursor*))); cursor = document->createCursor(); - blinkTimer = new QTimer( view ); - connect( blinkTimer, SIGNAL( timeout() ), - view, SLOT( slotBlinkCursor() ) ); - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + blinkTimer = new TQTimer( view ); + connect( blinkTimer, TQT_SIGNAL( timeout() ), + view, TQT_SLOT( slotBlinkCursor() ) ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void startTimer() { - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void stopTimer() @@ -95,7 +95,7 @@ struct View::View_Impl { /** * Timer for cursor blinking */ - QTimer *blinkTimer; + TQTimer *blinkTimer; /** * The formula we show. @@ -130,9 +130,9 @@ View::~View() } -QPoint View::getCursorPoint() const +TQPoint View::getCursorPoint() const { - return contextStyle().layoutUnitToPixel( cursor()->getCursorPoint() ); + return contextStyle().tqlayoutUnitToPixel( cursor()->getCursorPoint() ); } void View::setReadOnly(bool ro) @@ -147,7 +147,7 @@ void View::calcCursor() } -void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) +void View::draw(TQPainter& painter, const TQRect& rect, const TQColorGroup& cg) { // kdDebug( DEBUGID ) << "View::draw: " << rect.x() << " " << rect.y() << " " // << rect.width() << " " << rect.height() << endl; @@ -158,7 +158,7 @@ void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) } } -void View::draw(QPainter& painter, const QRect& rect) +void View::draw(TQPainter& painter, const TQRect& rect) { container()->draw( painter, rect, true ); if ( cursorVisible() ) { @@ -167,13 +167,13 @@ void View::draw(QPainter& painter, const QRect& rect) } } -void View::keyPressEvent( QKeyEvent* event ) +void View::keyPressEvent( TQKeyEvent* event ) { container()->input( event ); } -void View::focusInEvent(QFocusEvent*) +void View::focusInEvent(TQFocusEvent*) { //cursor()->calcCursorSize( contextStyle(), smallCursor() ); container()->setActiveCursor(cursor()); @@ -183,7 +183,7 @@ void View::focusInEvent(QFocusEvent*) emitCursorChanged(); } -void View::focusOutEvent(QFocusEvent*) +void View::focusOutEvent(TQFocusEvent*) { //container()->setActiveCursor(0); activeCursor() = false; @@ -192,96 +192,96 @@ void View::focusOutEvent(QFocusEvent*) emitCursorChanged(); } -void View::mousePressEvent( QMouseEvent* event ) +void View::mousePressEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseReleaseEvent( QMouseEvent* event ) +void View::mouseReleaseEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event ) +void View::mouseDoubleClickEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseMoveEvent( QMouseEvent* event ) +void View::mouseMoveEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::wheelEvent( QWheelEvent* event ) +void View::wheelEvent( TQWheelEvent* event ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mousePressEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseReleaseEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseDoubleClickEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseMoveEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::wheelEvent( QWheelEvent* event, const PtPoint& pos ) +void View::wheelEvent( TQWheelEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mousePress( pos, flags ); emitCursorChanged(); } -void View::mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseRelease( pos, flags ); emitCursorChanged(); } -void View::mouseDoubleClickEvent( QMouseEvent*, const LuPixelPoint& ) +void View::mouseDoubleClickEvent( TQMouseEvent*, const LuPixelPoint& ) { cursor()->moveRight( WordMovement ); cursor()->moveLeft( SelectMovement | WordMovement ); emitCursorChanged(); } -void View::mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseMove( pos, flags ); emitCursorChanged(); } -void View::wheelEvent( QWheelEvent*, const LuPixelPoint& ) +void View::wheelEvent( TQWheelEvent*, const LuPixelPoint& ) { } @@ -378,7 +378,7 @@ void View::eraseSelection( Direction direction ) container()->performRequest( &r ); } -void View::addText( QString str ) +void View::addText( TQString str ) { TextRequest r( str ); container()->performRequest( &r ); diff --git a/lib/kformula/kformulaview.h b/lib/kformula/kformulaview.h index f93b491f..9562bbfe 100644 --- a/lib/kformula/kformulaview.h +++ b/lib/kformula/kformulaview.h @@ -21,14 +21,14 @@ #ifndef KFORMULAVIEW_H #define KFORMULAVIEW_H -#include -#include -#include +#include +#include +#include #include "kformuladefs.h" #include "contextstyle.h" -class QColorGroup; +class TQColorGroup; KFORMULA_NAMESPACE_BEGIN @@ -47,8 +47,9 @@ class Container; * to be used alone if there is a bigger widget the formula * is to be drawn into. */ -class KOFORMULA_EXPORT View : public QObject { +class KOFORMULA_EXPORT View : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -58,41 +59,41 @@ public: /** * @returns the point inside the formula view where the cursor is. */ - QPoint getCursorPoint() const; + TQPoint getCursorPoint() const; /** * Puts the widget in read only mode. */ void setReadOnly(bool ro); - void mousePressEvent(QMouseEvent* event); - void mouseReleaseEvent(QMouseEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void wheelEvent(QWheelEvent* event); + void mousePressEvent(TQMouseEvent* event); + void mouseReleaseEvent(TQMouseEvent* event); + void mouseDoubleClickEvent(TQMouseEvent* event); + void mouseMoveEvent(TQMouseEvent* event); + void wheelEvent(TQWheelEvent* event); // the mouse event happened at a certain point - void mousePressEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseReleaseEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseDoubleClickEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseMoveEvent( QMouseEvent* event, const PtPoint& pos ); - void wheelEvent( QWheelEvent* event, const PtPoint& pos ); + void mousePressEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseReleaseEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseDoubleClickEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseMoveEvent( TQMouseEvent* event, const PtPoint& pos ); + void wheelEvent( TQWheelEvent* event, const PtPoint& pos ); // the mouse event happened at a certain point - void mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseDoubleClickEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void wheelEvent( QWheelEvent* event, const LuPixelPoint& pos ); + void mousePressEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseReleaseEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseDoubleClickEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseMoveEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void wheelEvent( TQWheelEvent* event, const LuPixelPoint& pos ); - void keyPressEvent(QKeyEvent* event); - virtual void focusInEvent(QFocusEvent* event); - virtual void focusOutEvent(QFocusEvent* event); + void keyPressEvent(TQKeyEvent* event); + virtual void focusInEvent(TQFocusEvent* event); + virtual void focusOutEvent(TQFocusEvent* event); void calcCursor(); - void draw(QPainter& painter, const QRect& rect, const QColorGroup& cg); - void draw(QPainter& painter, const QRect& rect); + void draw(TQPainter& painter, const TQRect& rect, const TQColorGroup& cg); + void draw(TQPainter& painter, const TQRect& rect); /** * The document we show. @@ -123,7 +124,7 @@ public: bool isEnd() const; void eraseSelection( Direction direction = beforeCursor ); - void addText( QString str ); + void addText( TQString str ); signals: @@ -140,7 +141,7 @@ protected slots: /** * The cursor has been moved by the container. - * We need to repaint if it was ours. + * We need to tqrepaint if it was ours. */ void slotCursorMoved(FormulaCursor* cursor); diff --git a/lib/kformula/kformulawidget.cc b/lib/kformula/kformulawidget.cc index 15295392..0de1ad7c 100644 --- a/lib/kformula/kformulawidget.cc +++ b/lib/kformula/kformulawidget.cc @@ -20,7 +20,7 @@ #include -#include +#include #include #include @@ -35,19 +35,19 @@ #include "kformulawidget.h" -KFormulaWidget::KFormulaWidget(Container* doc, QWidget* parent, const char* name, WFlags f) - : QWidget(parent, name, f | WRepaintNoErase | WResizeNoErase), +KFormulaWidget::KFormulaWidget(Container* doc, TQWidget* tqparent, const char* name, WFlags f) + : TQWidget(tqparent, name, f | WRepaintNoErase | WResizeNoErase), formulaView(doc) { - connect(doc, SIGNAL(formulaChanged(int, int)), - this, SLOT(slotFormulaChanged(int, int))); - connect(&formulaView, SIGNAL(cursorChanged(bool, bool)), - this, SLOT(slotCursorChanged(bool, bool))); + connect(doc, TQT_SIGNAL(formulaChanged(int, int)), + this, TQT_SLOT(slotFormulaChanged(int, int))); + connect(&formulaView, TQT_SIGNAL(cursorChanged(bool, bool)), + this, TQT_SLOT(slotCursorChanged(bool, bool))); - setFocusPolicy(QWidget::StrongFocus); - setBackgroundMode(NoBackground/*QWidget::PaletteBase*/); + setFocusPolicy(TQ_StrongFocus); + setBackgroundMode(NoBackground/*TQWidget::PaletteBase*/); - QRect rect = doc->boundingRect(); + TQRect rect = doc->boundingRect(); slotFormulaChanged(rect.width(), rect.height()); } @@ -56,7 +56,7 @@ KFormulaWidget::~KFormulaWidget() } -QPoint KFormulaWidget::getCursorPoint() const +TQPoint KFormulaWidget::getCursorPoint() const { return formulaView.getCursorPoint(); } @@ -67,58 +67,58 @@ void KFormulaWidget::setReadOnly(bool ro) } -void KFormulaWidget::paintEvent(QPaintEvent* event) +void KFormulaWidget::paintEvent(TQPaintEvent* event) { - // Always repaint the buffer. This is not so much more work - // than it seems to be as each cursor movement requires a repaint. - QPainter p( &buffer ); + // Always tqrepaint the buffer. This is not so much more work + // than it seems to be as each cursor movement requires a tqrepaint. + TQPainter p( &buffer ); //p.translate( -fr.x(), -fr.y() ); - formulaView.draw( p, event->rect(), colorGroup() ); + formulaView.draw( p, event->rect(), tqcolorGroup() ); - QPainter painter; + TQPainter painter; painter.begin(this); painter.drawPixmap( event->rect().x(), event->rect().y(), buffer, event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height() ); painter.end(); } -void KFormulaWidget::keyPressEvent(QKeyEvent* event) +void KFormulaWidget::keyPressEvent(TQKeyEvent* event) { formulaView.keyPressEvent(event); } -void KFormulaWidget::focusInEvent(QFocusEvent* event) +void KFormulaWidget::focusInEvent(TQFocusEvent* event) { formulaView.focusInEvent(event); } -void KFormulaWidget::focusOutEvent(QFocusEvent* event) +void KFormulaWidget::focusOutEvent(TQFocusEvent* event) { formulaView.focusOutEvent(event); } -void KFormulaWidget::mousePressEvent(QMouseEvent* event) +void KFormulaWidget::mousePressEvent(TQMouseEvent* event) { formulaView.mousePressEvent(event); } -void KFormulaWidget::mouseReleaseEvent(QMouseEvent* event) +void KFormulaWidget::mouseReleaseEvent(TQMouseEvent* event) { formulaView.mouseReleaseEvent(event); } -void KFormulaWidget::mouseDoubleClickEvent(QMouseEvent* event) +void KFormulaWidget::mouseDoubleClickEvent(TQMouseEvent* event) { formulaView.mouseDoubleClickEvent(event); } -void KFormulaWidget::mouseMoveEvent(QMouseEvent* event) +void KFormulaWidget::mouseMoveEvent(TQMouseEvent* event) { formulaView.mouseMoveEvent(event); } -void KFormulaWidget::wheelEvent(QWheelEvent* event) +void KFormulaWidget::wheelEvent(TQWheelEvent* event) { formulaView.wheelEvent(event); } @@ -128,7 +128,7 @@ void KFormulaWidget::slotFormulaChanged(int width, int height) // Magic numbers just to see the cursor. resize(width + 5, height + 5); buffer.resize(width + 5, height + 5); - // repaint is needed even if the size doesn't change. + // tqrepaint is needed even if the size doesn't change. //update(); } diff --git a/lib/kformula/kformulawidget.h b/lib/kformula/kformulawidget.h index 99079e1d..ead28ddc 100644 --- a/lib/kformula/kformulawidget.h +++ b/lib/kformula/kformulawidget.h @@ -21,10 +21,10 @@ #ifndef KFORMULAWIDGET_H #define KFORMULAWIDGET_H -#include -#include -#include -#include +#include +#include +#include +#include #include "kformuladefs.h" #include "kformulaview.h" @@ -45,18 +45,19 @@ using namespace KFormula; * The view. A widget that shows the formula. There are methods * to move the cursor around. To edit the formula use the document. */ -class KFormulaWidget : public QWidget { +class KFormulaWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KFormulaWidget(Container*, QWidget* parent=0, const char* name=0, WFlags f=0); + KFormulaWidget(Container*, TQWidget* tqparent=0, const char* name=0, WFlags f=0); ~KFormulaWidget(); /** * @returns the point inside the formula widget where the cursor is. */ - QPoint getCursorPoint() const; + TQPoint getCursorPoint() const; /** * Puts the widget in read only mode. @@ -85,16 +86,16 @@ protected slots: protected: - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* event); - virtual void mouseMoveEvent(QMouseEvent* event); - virtual void wheelEvent(QWheelEvent* event); + virtual void mousePressEvent(TQMouseEvent* event); + virtual void mouseReleaseEvent(TQMouseEvent* event); + virtual void mouseDoubleClickEvent(TQMouseEvent* event); + virtual void mouseMoveEvent(TQMouseEvent* event); + virtual void wheelEvent(TQWheelEvent* event); - virtual void paintEvent(QPaintEvent* event); - virtual void keyPressEvent(QKeyEvent* event); - virtual void focusInEvent(QFocusEvent* event); - virtual void focusOutEvent(QFocusEvent* event); + virtual void paintEvent(TQPaintEvent* event); + virtual void keyPressEvent(TQKeyEvent* event); + virtual void focusInEvent(TQFocusEvent* event); + virtual void focusOutEvent(TQFocusEvent* event); /** * The document we show. @@ -113,7 +114,7 @@ private: */ View formulaView; - QPixmap buffer; + TQPixmap buffer; }; #endif // KFORMULAWIDGET_H diff --git a/lib/kformula/main.cc b/lib/kformula/main.cc index bbab2bbb..dde69731 100644 --- a/lib/kformula/main.cc +++ b/lib/kformula/main.cc @@ -2,17 +2,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -33,44 +33,44 @@ using namespace KFormula; class TestWidget : public KFormulaWidget { public: - TestWidget(Container* doc, QWidget* parent=0, const char* name=0, WFlags f=0) - : KFormulaWidget(doc, parent, name, f) {} + TestWidget(Container* doc, TQWidget* tqparent=0, const char* name=0, WFlags f=0) + : KFormulaWidget(doc, tqparent, name, f) {} protected: - virtual void keyPressEvent(QKeyEvent* event); + virtual void keyPressEvent(TQKeyEvent* event); private: }; -void save( const QString &filename, const QDomDocument& doc ) +void save( const TQString &filename, const TQDomDocument& doc ) { - QFile f( filename ); + TQFile f( filename ); if(!f.open(IO_Truncate | IO_ReadWrite)) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); doc.save(stream, 2); f.close(); } -void load( KFormula::Document* document, const QString &filename ) +void load( KFormula::Document* document, const TQString &filename ) { - QFile f(filename); + TQFile f(filename); if (!f.open(IO_ReadOnly)) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); - QString content = stream.read(); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); + TQString content = stream.read(); f.close(); //kdDebug( DEBUGID ) << content << endl; - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( content ) ) { return; } @@ -80,34 +80,34 @@ void load( KFormula::Document* document, const QString &filename ) } -void saveMathML( KFormula::Container* formula, const QString &filename, bool oasisFormat ) +void saveMathML( KFormula::Container* formula, const TQString &filename, bool oasisFormat ) { - QFile f( filename ); + TQFile f( filename ); if ( !f.open( IO_Truncate | IO_ReadWrite ) ) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream( &f ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &f ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); formula->saveMathML( stream, oasisFormat ); f.close(); } -void loadMathML( KFormula::Container* formula, const QString &filename ) +void loadMathML( KFormula::Container* formula, const TQString &filename ) { - QFile f( filename ); + TQFile f( filename ); if ( !f.open( IO_ReadOnly ) ) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream( &f ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QString content = stream.read(); + TQTextStream stream( &f ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString content = stream.read(); - QDomDocument doc; - QString errorMsg; + TQDomDocument doc; + TQString errorMsg; int errorLine; int errorColumn; if ( !doc.setContent( content, true, @@ -129,7 +129,7 @@ void loadMathML( KFormula::Container* formula, const QString &filename ) } -void TestWidget::keyPressEvent(QKeyEvent* event) +void TestWidget::keyPressEvent(TQKeyEvent* event) { Container* document = getDocument(); @@ -137,19 +137,19 @@ void TestWidget::keyPressEvent(QKeyEvent* event) int state = event->state(); //MoveFlag flag = movementFlag(state); - if ( ( state & Qt::ShiftButton ) && ( state & Qt::ControlButton ) ) { + if ( ( state & TQt::ShiftButton ) && ( state & TQt::ControlButton ) ) { switch (event->key()) { - case Qt::Key_B: document->document()->wrapper()->appendColumn(); return; - case Qt::Key_I: document->document()->wrapper()->insertColumn(); return; - case Qt::Key_R: document->document()->wrapper()->removeColumn(); return; - case Qt::Key_Z: document->document()->wrapper()->redo(); return; - case Qt::Key_F: saveMathML( document, "test.mml", true/*save to oasis format*/ ); return; - case Qt::Key_M: saveMathML( document, "test.mml", false ); return; - case Qt::Key_O: { - QString file = KFileDialog::getOpenFileName(); + case TQt::Key_B: document->document()->wrapper()->appendColumn(); return; + case TQt::Key_I: document->document()->wrapper()->insertColumn(); return; + case TQt::Key_R: document->document()->wrapper()->removeColumn(); return; + case TQt::Key_Z: document->document()->wrapper()->redo(); return; + case TQt::Key_F: saveMathML( document, "test.mml", true/*save to oasis format*/ ); return; + case TQt::Key_M: saveMathML( document, "test.mml", false ); return; + case TQt::Key_O: { + TQString file = KFileDialog::getOpenFileName(); kdDebug( DEBUGID ) << file << endl; if( !file.isEmpty() ) { - QFileInfo fi( file ); + TQFileInfo fi( file ); if ( fi.extension() == "mml" ) { loadMathML( document, file ); } @@ -161,35 +161,35 @@ void TestWidget::keyPressEvent(QKeyEvent* event) } } } - else if (state & Qt::ControlButton) { + else if (state & TQt::ControlButton) { switch (event->key()) { - case Qt::Key_1: document->document()->wrapper()->addSum(); return; - case Qt::Key_2: document->document()->wrapper()->addProduct(); return; - case Qt::Key_3: document->document()->wrapper()->addIntegral(); return; - case Qt::Key_4: document->document()->wrapper()->addRoot(); return; - case Qt::Key_5: document->document()->wrapper()->addFraction(); return; - case Qt::Key_6: document->document()->wrapper()->addMatrix(); return; - case Qt::Key_7: document->document()->wrapper()->addOneByTwoMatrix(); return; - case Qt::Key_8: document->document()->wrapper()->addOverline(); return; - case Qt::Key_9: document->document()->wrapper()->addUnderline(); return; - case Qt::Key_A: slotSelectAll(); return; - case Qt::Key_B: document->document()->wrapper()->appendRow(); return; - case Qt::Key_C: document->document()->wrapper()->copy(); return; - case Qt::Key_D: document->document()->wrapper()->removeEnclosing(); return; - case Qt::Key_G: document->document()->wrapper()->makeGreek(); return; - case Qt::Key_I: document->document()->wrapper()->insertRow(); return; - case Qt::Key_R: document->document()->wrapper()->removeRow(); return; - case Qt::Key_K: document->document()->wrapper()->addMultiline(); return; - case Qt::Key_L: document->document()->wrapper()->addGenericLowerIndex(); return; - case Qt::Key_M: loadMathML( document, "test.mml" ); return; - case Qt::Key_O: load( document->document(), "test.xml" ); return; - case Qt::Key_Q: kapp->quit(); return; - case Qt::Key_S: save( "test.xml", document->document()->saveXML() ); return; - case Qt::Key_T: std::cout << document->texString().latin1() << std::endl; return; - case Qt::Key_U: document->document()->wrapper()->addGenericUpperIndex(); return; - case Qt::Key_V: document->document()->wrapper()->paste(); return; - case Qt::Key_X: document->document()->wrapper()->cut(); return; - case Qt::Key_Z: document->document()->wrapper()->undo(); return; + case TQt::Key_1: document->document()->wrapper()->addSum(); return; + case TQt::Key_2: document->document()->wrapper()->addProduct(); return; + case TQt::Key_3: document->document()->wrapper()->addIntegral(); return; + case TQt::Key_4: document->document()->wrapper()->addRoot(); return; + case TQt::Key_5: document->document()->wrapper()->addFraction(); return; + case TQt::Key_6: document->document()->wrapper()->addMatrix(); return; + case TQt::Key_7: document->document()->wrapper()->addOneByTwoMatrix(); return; + case TQt::Key_8: document->document()->wrapper()->addOverline(); return; + case TQt::Key_9: document->document()->wrapper()->addUnderline(); return; + case TQt::Key_A: slotSelectAll(); return; + case TQt::Key_B: document->document()->wrapper()->appendRow(); return; + case TQt::Key_C: document->document()->wrapper()->copy(); return; + case TQt::Key_D: document->document()->wrapper()->removeEnclosing(); return; + case TQt::Key_G: document->document()->wrapper()->makeGreek(); return; + case TQt::Key_I: document->document()->wrapper()->insertRow(); return; + case TQt::Key_R: document->document()->wrapper()->removeRow(); return; + case TQt::Key_K: document->document()->wrapper()->addMultiline(); return; + case TQt::Key_L: document->document()->wrapper()->addGenericLowerIndex(); return; + case TQt::Key_M: loadMathML( document, "test.mml" ); return; + case TQt::Key_O: load( document->document(), "test.xml" ); return; + case TQt::Key_Q: kapp->quit(); return; + case TQt::Key_S: save( "test.xml", document->document()->saveXML() ); return; + case TQt::Key_T: std::cout << document->texString().latin1() << std::endl; return; + case TQt::Key_U: document->document()->wrapper()->addGenericUpperIndex(); return; + case TQt::Key_V: document->document()->wrapper()->paste(); return; + case TQt::Key_X: document->document()->wrapper()->cut(); return; + case TQt::Key_Z: document->document()->wrapper()->undo(); return; default: //std::cerr << "Key: " << event->key() << std::endl; break; @@ -201,19 +201,19 @@ void TestWidget::keyPressEvent(QKeyEvent* event) ScrollView::ScrollView() - : QScrollView(), child(0) + : TQScrollView(), child(0) { } void ScrollView::addChild(KFormulaWidget* c, int x, int y) { - QScrollView::addChild(c, x, y); + TQScrollView::addChild(c, x, y); child = c; - connect(child, SIGNAL(cursorChanged(bool, bool)), - this, SLOT(cursorChanged(bool, bool))); + connect(child, TQT_SIGNAL(cursorChanged(bool, bool)), + this, TQT_SLOT(cursorChanged(bool, bool))); } -void ScrollView::focusInEvent(QFocusEvent*) +void ScrollView::focusInEvent(TQFocusEvent*) { if (child != 0) child->setFocus(); } @@ -246,7 +246,7 @@ int main(int argc, char** argv) KApplication app; - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit())); DocumentWrapper* wrapper = new DocumentWrapper( kapp->config(), 0 ); Document* document = new Document; @@ -263,7 +263,7 @@ int main(int argc, char** argv) KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); for ( int i = 0; i < args->count(); ++i ) { - QFileInfo fi( args->url( i ).path() ); + TQFileInfo fi( args->url( i ).path() ); if ( fi.extension() == "mml" ) loadMathML( container1, args->url( i ).path() ); else if ( fi.extension() == "xml" ) @@ -277,7 +277,7 @@ int main(int argc, char** argv) // Make sure there are no elements in the clipboard. // Okey for a debug app. - QApplication::clipboard()->clear(); + TQApplication::tqclipboard()->clear(); int destruct = BasicElement::getEvilDestructionCount(); if (destruct != 0) { diff --git a/lib/kformula/matrixelement.cc b/lib/kformula/matrixelement.cc index 88a59081..b8abd22b 100644 --- a/lib/kformula/matrixelement.cc +++ b/lib/kformula/matrixelement.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include @@ -43,7 +43,7 @@ class MatrixSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MatrixSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + MatrixSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual MatrixSequenceElement* clone() { return new MatrixSequenceElement( *this ); } @@ -62,7 +62,7 @@ public: class KFCRemoveRow : public Command { public: - KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveRow(); virtual void execute(); @@ -73,13 +73,13 @@ protected: uint rowPos; uint colPos; - QPtrList* row; + TQPtrList* row; }; class KFCInsertRow : public KFCRemoveRow { public: - KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveRow::unexecute(); } virtual void unexecute() { KFCRemoveRow::execute(); } @@ -88,7 +88,7 @@ public: class KFCRemoveColumn : public Command { public: - KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveColumn(); virtual void execute(); @@ -99,13 +99,13 @@ protected: uint rowPos; uint colPos; - QPtrList* column; + TQPtrList* column; }; class KFCInsertColumn : public KFCRemoveColumn { public: - KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveColumn::unexecute(); } virtual void unexecute() { KFCRemoveColumn::execute(); } @@ -166,7 +166,7 @@ KCommand* MatrixSequenceElement::buildCommand( Container* container, Request* re } -KFCRemoveRow::KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveRow::KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ), row( 0 ) { } @@ -206,10 +206,10 @@ void KFCRemoveRow::unexecute() } -KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertRow::KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveRow( name, document, m, r, c ) { - row = new QPtrList< MatrixSequenceElement >; + row = new TQPtrList< MatrixSequenceElement >; row->setAutoDelete( true ); for ( uint i = 0; i < matrix->getColumns(); i++ ) { row->append( new MatrixSequenceElement( matrix ) ); @@ -217,10 +217,10 @@ KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElem } -KFCRemoveColumn::KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveColumn::KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ) { - column = new QPtrList< MatrixSequenceElement >; + column = new TQPtrList< MatrixSequenceElement >; column->setAutoDelete( true ); } @@ -260,7 +260,7 @@ void KFCRemoveColumn::unexecute() } -KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertColumn::KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveColumn( name, document, m, r, c ) { for ( uint i = 0; i < matrix->getRows(); i++ ) { @@ -269,8 +269,8 @@ KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, Matr } -MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) - : BasicElement(parent), +MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* tqparent) + : BasicElement(tqparent), m_rowNumber( 0 ), m_align( NoAlign ), m_widthType( NoSize ), @@ -284,7 +284,7 @@ MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) m_customDisplayStyle( false ) { for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { list->append(new MatrixSequenceElement(this)); @@ -305,12 +305,12 @@ MatrixElement::MatrixElement( const MatrixElement& other ) uint rows = other.getRows(); uint columns = other.getColumns(); - QPtrListIterator< QPtrList< MatrixSequenceElement > > rowIter( other.content ); + TQPtrListIterator< TQPtrList< MatrixSequenceElement > > rowIter( other.content ); for (uint r = 0; r < rows; r++) { ++rowIter; - QPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); + TQPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { ++colIter; @@ -339,12 +339,12 @@ void MatrixElement::entered( SequenceElement* /*child*/ ) BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); uint rows = getRows(); uint columns = getColumns(); @@ -430,16 +430,16 @@ BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void MatrixElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style ) { - QMemArray toMidlines(getRows()); - QMemArray fromMidlines(getRows()); - QMemArray widths(getColumns()); + TQMemArray toMidlines(getRows()); + TQMemArray fromMidlines(getRows()); + TQMemArray widths(getColumns()); toMidlines.fill(0); fromMidlines.fill(0); @@ -453,14 +453,14 @@ void MatrixElement::calcSizes( const ContextStyle& context, double factor = style.sizeFactor(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); for (uint c = 0; c < columns; c++) { SequenceElement* element = list->at(c); element->calcSizes( context, i_tstyle, i_istyle, style ); - toMidlines[r] = QMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); - fromMidlines[r] = QMAX(fromMidlines[r], + toMidlines[r] = TQMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); + fromMidlines[r] = TQMAX(fromMidlines[r], element->getHeight()-element->axis( context, i_tstyle, factor )); - widths[c] = QMAX(widths[c], element->getWidth()); + widths[c] = TQMAX(widths[c], element->getWidth()); } } @@ -469,7 +469,7 @@ void MatrixElement::calcSizes( const ContextStyle& context, luPixel yPos = 0; for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); luPixel xPos = 0; yPos += toMidlines[r]; for (uint c = 0; c < columns; c++) { @@ -508,18 +508,18 @@ void MatrixElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, +void MatrixElement::draw( TQPainter& painter, const LuPixelRect& rect, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( rect ) ) // return; @@ -537,7 +537,7 @@ void MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, } // Debug - //painter.setPen(Qt::red); + //painter.setPen(TQt::red); //painter.drawRect(myPos.x(), myPos.y(), getWidth(), getHeight()); } @@ -730,12 +730,12 @@ void MatrixElement::selectChild(FormulaCursor* cursor, BasicElement* child) const MatrixSequenceElement* MatrixElement::getElement( uint row, uint column ) const { - QPtrListIterator< QPtrList < MatrixSequenceElement > > rows( content ); + TQPtrListIterator< TQPtrList < MatrixSequenceElement > > rows( content ); rows += row; if ( ! rows.current() ) return 0; - QPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); + TQPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); cols += column; return cols.current(); } @@ -761,7 +761,7 @@ bool MatrixElement::searchElement(BasicElement* element, uint& row, uint& column /** * Appends our attributes to the dom element. */ -void MatrixElement::writeDom(QDomElement element) +void MatrixElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); @@ -771,11 +771,11 @@ void MatrixElement::writeDom(QDomElement element) element.setAttribute("ROWS", rows); element.setAttribute("COLUMNS", cols); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for (uint r = 0; r < rows; r++) { for (uint c = 0; c < cols; c++) { - QDomElement tmp = getElement(r,c)->getElementDom(doc); + TQDomElement tmp = getElement(r,c)->getElementDom(doc); element.appendChild(tmp); } element.appendChild(doc.createComment("end of row")); @@ -786,13 +786,13 @@ void MatrixElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool MatrixElement::readAttributesFromDom(QDomElement element) +bool MatrixElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint rows = 0; - QString rowStr = element.attribute("ROWS"); + TQString rowStr = element.attribute("ROWS"); if(!rowStr.isNull()) { rows = rowStr.toInt(); } @@ -801,7 +801,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) return false; } - QString columnStr = element.attribute("COLUMNS"); + TQString columnStr = element.attribute("COLUMNS"); uint cols = 0; if(!columnStr.isNull()) { cols = columnStr.toInt(); @@ -813,7 +813,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -829,7 +829,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MatrixElement::readContentFromDom(QDomNode& node) +bool MatrixElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -843,7 +843,7 @@ bool MatrixElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && r < rows ) { if ( node.isElement() ) { SequenceElement* element = getElement( r, c ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -858,38 +858,38 @@ bool MatrixElement::readContentFromDom(QDomNode& node) return true; } -bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool MatrixElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString alignStr = element.attribute( "align" ).lower(); + TQString alignStr = element.attribute( "align" ).lower(); if ( ! alignStr.isNull() ) { - if ( alignStr.find( "top" ) != -1 ) { + if ( alignStr.tqfind( "top" ) != -1 ) { m_align = TopAlign; } - else if ( alignStr.find( "bottom" ) != -1 ) { + else if ( alignStr.tqfind( "bottom" ) != -1 ) { m_align = BottomAlign; } - else if ( alignStr.find( "center" ) != -1 ) { + else if ( alignStr.tqfind( "center" ) != -1 ) { m_align = CenterAlign; } - else if ( alignStr.find( "baseline" ) != -1 ) { + else if ( alignStr.tqfind( "baseline" ) != -1 ) { m_align = BaselineAlign; } - else if ( alignStr.find( "axis" ) != -1 ) { + else if ( alignStr.tqfind( "axis" ) != -1 ) { m_align = AxisAlign; } - int index = alignStr.findRev( ' ' ); + int index = alignStr.tqfindRev( ' ' ); if ( index != -1 ) { m_rowNumber = alignStr.right( index + 1 ).toInt(); } } - QString rowalignStr = element.attribute( "rowalign" ).lower(); + TQString rowalignStr = element.attribute( "rowalign" ).lower(); if ( ! rowalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "top" ) { m_rowAlign.append( TopAlign ); } @@ -907,10 +907,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnalignStr = element.attribute( "columnalign" ).lower(); + TQString columnalignStr = element.attribute( "columnalign" ).lower(); if ( ! columnalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "left" ) { m_columnAlign.append( LeftHorizontalAlign ); } @@ -922,22 +922,22 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString alignmentscopeStr = element.attribute( "alignmentscope" ).lower(); - if ( ! alignmentscopeStr.isNull() ) { - QStringList list = QStringList::split( ' ', alignmentscopeStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQString tqalignmentscopeStr = element.attribute( "tqalignmentscope" ).lower(); + if ( ! tqalignmentscopeStr.isNull() ) { + TQStringList list = TQStringList::split( ' ', tqalignmentscopeStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "true" ) { - m_alignmentScope.append( true ); + m_tqalignmentScope.append( true ); } else if ( *it == "false" ) { - m_alignmentScope.append( false ); + m_tqalignmentScope.append( false ); } } } - QString columnwidthStr = element.attribute( "columnwidth" ).lower(); + TQString columnwidthStr = element.attribute( "columnwidth" ).lower(); if ( columnwidthStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnwidthStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnwidthStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type = NoSize; double length; if ( *it == "auto" ) { @@ -960,7 +960,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString widthStr = element.attribute( "width" ).lower(); + TQString widthStr = element.attribute( "width" ).lower(); if ( ! widthStr.isNull() ) { if ( widthStr == "auto" ) { m_widthType = AutoSize; @@ -969,10 +969,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_width = getSize( widthStr, &m_widthType ); } } - QString rowspacingStr = element.attribute( "rowspacing" ).lower(); + TQString rowspacingStr = element.attribute( "rowspacing" ).lower(); if ( ! rowspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type != NoSize ) { @@ -981,10 +981,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnspacingStr = element.attribute( "columnspacing" ).lower(); + TQString columnspacingStr = element.attribute( "columnspacing" ).lower(); if ( ! columnspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type == NoSize ) { @@ -998,10 +998,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString rowlinesStr = element.attribute( "rowlines" ).lower(); + TQString rowlinesStr = element.attribute( "rowlines" ).lower(); if ( ! rowlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_rowLines.append( NoneLine ); } @@ -1013,10 +1013,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnlinesStr = element.attribute( "columnlines" ).lower(); + TQString columnlinesStr = element.attribute( "columnlines" ).lower(); if ( ! columnlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_columnLines.append( NoneLine ); } @@ -1028,7 +1028,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); + TQString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); if ( ! frameStr.isNull() ) { if ( frameStr == "none" ) { m_frame = NoneLine; @@ -1040,9 +1040,9 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_frame = DashedLine; } } - QString framespacingStr = element.attribute( "framespacing" ); + TQString framespacingStr = element.attribute( "framespacing" ); if ( ! framespacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', framespacingStr ); + TQStringList list = TQStringList::split( ' ', framespacingStr ); m_frameHSpacing = getSize( list[0], &m_frameHSpacingType ); if ( m_frameHSpacingType == NoSize ) { m_frameHSpacingType = getSpace( list[0] ); @@ -1054,7 +1054,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); + TQString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); if ( ! equalrowsStr.isNull() ) { m_customEqualRows = true; if ( equalrowsStr == "false" ) { @@ -1064,7 +1064,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalRows = true; } } - QString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); + TQString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); if ( ! equalcolumnsStr.isNull() ) { m_customEqualColumns = true; if ( equalcolumnsStr == "false" ) { @@ -1074,7 +1074,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalColumns = true; } } - QString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); + TQString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); if ( ! displaystyleStr.isNull() ) { m_customDisplayStyle = true; if ( displaystyleStr == "false" ) { @@ -1084,7 +1084,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_displayStyle = true; } } - QString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); + TQString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); if ( ! sideStr.isNull() ) { if ( sideStr == "left" ) { m_side = LeftSide; @@ -1099,7 +1099,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_side = RightOverlapSide; } } - QString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); + TQString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); if ( ! minlabelspacingStr.isNull() ) { m_minLabelSpacing = getSize( minlabelspacingStr, &m_minLabelSpacingType ); if ( m_minLabelSpacingType == NoSize ) { @@ -1115,7 +1115,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ -int MatrixElement::readContentFromMathMLDom( QDomNode& node ) +int MatrixElement::readContentFromMathMLDom( TQDomNode& node ) { // We have twice, since there may be empty elements and we need to know how // many of them we have. So, first pass, get number of rows and columns @@ -1126,16 +1126,16 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint rows = 0; uint cols = 0; - QDomNode n = node; + TQDomNode n = node; while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { rows++; /* Determins the number of columns */ - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { @@ -1155,7 +1155,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) // Create elements content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -1169,9 +1169,9 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint c = 0; while ( !node.isNull() ) { if ( node.isElement() ) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); if ( e.tagName().lower() == "mlabeledtr" ) { while ( ! cellnode.isNull() && ! cellnode.isElement() ) cellnode = cellnode.nextSibling(); @@ -1180,7 +1180,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) } while ( !cellnode.isNull() ) { if ( cellnode.isElement() ) { - QDomElement cellelement = cellnode.toElement(); + TQDomElement cellelement = cellnode.toElement(); if ( cellelement.tagName().lower() != "mtd" ) { // TODO: Inferred mtd. Deprecated in MathML 2.0 kdWarning( DEBUGID ) << "Unsupported tag " @@ -1205,11 +1205,11 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) return 1; } -QString MatrixElement::toLatex() +TQString MatrixElement::toLatex() { //All the border handling must be implemented here too - QString matrix; + TQString matrix; uint cols=getColumns(); uint rows=getRows(); @@ -1232,9 +1232,9 @@ QString MatrixElement::toLatex() return matrix; } -QString MatrixElement::formulaString() +TQString MatrixElement::formulaString() { - QString matrix = "["; + TQString matrix = "["; uint cols=getColumns(); uint rows=getRows(); for (uint r = 0; r < rows; r++) { @@ -1256,11 +1256,11 @@ SequenceElement* MatrixElement::elementAt(uint row, uint column) return getElement( row, column ); } -void MatrixElement::writeMathMLAttributes( QDomElement& element ) const +void MatrixElement::writeMathMLAttributes( TQDomElement& element ) const { - QString rownumber; + TQString rownumber; if ( m_rowNumber ) { - rownumber = QString( " %1" ).arg( m_rowNumber ); + rownumber = TQString( " %1" ).tqarg( m_rowNumber ); } switch ( m_align ) { case TopAlign: @@ -1281,8 +1281,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString rowalign; - for ( QValueList< VerticalAlign >::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) + TQString rowalign; + for ( TQValueList::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) { switch ( *it ) { case TopAlign: @@ -1307,8 +1307,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowalign.isNull() ) { element.setAttribute( "rowalign", rowalign.stripWhiteSpace() ); } - QString columnalign; - for ( QValueList< HorizontalAlign >::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) + TQString columnalign; + for ( TQValueList::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) { switch ( *it ) { case LeftHorizontalAlign: @@ -1327,22 +1327,22 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! columnalign.isNull() ) { element.setAttribute( "columnalign", columnalign.stripWhiteSpace() ); } - QString alignmentscope; - for ( QValueList< bool >::const_iterator it = m_alignmentScope.begin(); it != m_alignmentScope.end(); it++ ) + TQString tqalignmentscope; + for ( TQValueList< bool >::const_iterator it = m_tqalignmentScope.begin(); it != m_tqalignmentScope.end(); it++ ) { if ( *it ) { - alignmentscope.append( "true " ); + tqalignmentscope.append( "true " ); } else { - alignmentscope.append( "false " ); + tqalignmentscope.append( "false " ); } } - if ( ! alignmentscope.isNull() ) { - element.setAttribute( "alignmentscope", alignmentscope.stripWhiteSpace() ); + if ( ! tqalignmentscope.isNull() ) { + element.setAttribute( "tqalignmentscope", tqalignmentscope.stripWhiteSpace() ); } - QString columnwidth; - QValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); + TQString columnwidth; + TQValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); typeIt != m_columnWidthType.end(); typeIt ++ ) { switch ( *typeIt ) { case AutoSize: @@ -1352,15 +1352,15 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const columnwidth.append( "fit " ); break; case AbsoluteSize: - columnwidth.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnwidth.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnwidth.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnwidth.append( QString( "%1px " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1417,30 +1417,30 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const element.setAttribute( "width", "auto" ); break; case AbsoluteSize: - element.setAttribute( "width", QString( "%1pt" ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1pt" ).tqarg( m_width ) ); break; case RelativeSize: - element.setAttribute( "width", QString( "%1% " ).arg( m_width * 100.0 ) ); + element.setAttribute( "width", TQString( "%1% " ).tqarg( m_width * 100.0 ) ); break; case PixelSize: - element.setAttribute( "width", QString( "%1px " ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1px " ).tqarg( m_width ) ); break; default: break; } - QString rowspacing; + TQString rowspacing; lengthIt = m_rowSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); typeIt != m_rowSpacingType.end(); typeIt++, lengthIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - rowspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); break; case RelativeSize: - rowspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + rowspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); break; case PixelSize: - rowspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); break; default: break; @@ -1449,21 +1449,21 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString columnspacing; + TQString columnspacing; lengthIt = m_columnSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); typeIt != m_columnSpacingType.end(); typeIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - columnspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1515,8 +1515,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString rowlines; - for ( QValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) + TQString rowlines; + for ( TQValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1535,8 +1535,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowlines.isNull() ) { element.setAttribute( "rowlines", rowlines.stripWhiteSpace() ); } - QString columnlines; - for ( QValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) + TQString columnlines; + for ( TQValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1568,16 +1568,16 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString framespacing; + TQString framespacing; switch ( m_frameHSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameHSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameHSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameHSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameHSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1626,13 +1626,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_frameVSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameVSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameVSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameVSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameVSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1709,13 +1709,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_minLabelSpacingType ) { case AbsoluteSize: - element.setAttribute( "minlabelspacing", QString( "%1pt" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1pt" ).tqarg( m_minLabelSpacing ) ); break; case RelativeSize: - element.setAttribute( "minlabelspacing", QString( "%1%" ).arg( m_minLabelSpacing * 100.0 ) ); + element.setAttribute( "minlabelspacing", TQString( "%1%" ).tqarg( m_minLabelSpacing * 100.0 ) ); break; case PixelSize: - element.setAttribute( "minlabelspacing", QString( "%1px" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1px" ).tqarg( m_minLabelSpacing ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( "minlabelspacing", "negativeveryverythinmathspace" ); @@ -1764,12 +1764,12 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } } -void MatrixElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void MatrixElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { - QDomElement row; - QDomElement cell; + TQDomElement row; + TQDomElement cell; uint rows = getRows(); uint cols = getColumns(); @@ -1799,18 +1799,18 @@ class MultilineSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MultilineSequenceElement( BasicElement* parent = 0 ); + MultilineSequenceElement( BasicElement* tqparent = 0 ); virtual MultilineSequenceElement* clone() { return new MultilineSequenceElement( *this ); } virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -1829,9 +1829,9 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); - virtual KCommand* input( Container* container, QChar ch ); + virtual KCommand* input( Container* container, TQChar ch ); uint tabCount() const { return tabs.count(); } @@ -1846,18 +1846,18 @@ public: /// Return the position of tab i. int tabPos( uint i ); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; private: - QPtrList tabs; + TQPtrList tabs; }; // Split the line at position pos. class KFCNewLine : public Command { public: - KFCNewLine( const QString& name, Container* document, + KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ); virtual ~KFCNewLine(); @@ -1872,7 +1872,7 @@ private: }; -KFCNewLine::KFCNewLine( const QString& name, Container* document, +KFCNewLine::KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ) : Command( name, document ), m_line( line ), m_pos( pos ) @@ -1890,17 +1890,17 @@ KFCNewLine::~KFCNewLine() void KFCNewLine::execute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast( m_line->getParent() ); - int linePos = parent->content.find( m_line ); - parent->content.insert( linePos+1, m_newline ); + MultilineElement* tqparent = static_cast( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); + tqparent->content.insert( linePos+1, m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_line->countChildren() > static_cast( m_pos ) ) { // Remove anything after position pos from the current line m_line->selectAllChildren( cursor ); cursor->setMark( m_pos ); - QPtrList elementList; + TQPtrList elementList; m_line->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the new line @@ -1925,22 +1925,22 @@ void KFCNewLine::execute() void KFCNewLine::unexecute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast( m_line->getParent() ); - int linePos = parent->content.find( m_line ); + MultilineElement* tqparent = static_cast( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); // Now the command owns the new line again. - m_newline = parent->content.at( linePos+1 ); + m_newline = tqparent->content.at( linePos+1 ); // Tell all cursors to leave this sequence FormulaElement* formula = m_line->formula(); formula->elementRemoval( m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_newline->countChildren() > 0 ) { // Remove anything from the line to be deleted m_newline->selectAllChildren( cursor ); - QPtrList elementList; + TQPtrList elementList; m_newline->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the previous line @@ -1951,7 +1951,7 @@ void KFCNewLine::unexecute() else { m_line->moveEnd( cursor ); } - parent->content.take( linePos+1 ); + tqparent->content.take( linePos+1 ); // Tell that something changed formula->changed(); @@ -1959,19 +1959,19 @@ void KFCNewLine::unexecute() } -MultilineSequenceElement::MultilineSequenceElement( BasicElement* parent ) - : SequenceElement( parent ) +MultilineSequenceElement::MultilineSequenceElement( BasicElement* tqparent ) + : SequenceElement( tqparent ) { tabs.setAutoDelete( false ); } BasicElement* MultilineSequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - //LuPixelPoint myPos(parentOrigin.x() + getX(), - // parentOrigin.y() + getY()); - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + //LuPixelPoint myPos(tqparentOrigin.x() + getX(), + // tqparentOrigin.y() + getY()); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if (e == 0) { // If the mouse was behind this line put the cursor to the last position. @@ -2033,19 +2033,19 @@ KCommand* MultilineSequenceElement::buildCommand( Container* container, Request* } -KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* event ) +KCommand* MultilineSequenceElement::input( Container* container, TQKeyEvent* event ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Enter: - case Qt::Key_Return: { + case TQt::Key_Enter: + case TQt::Key_Return: { Request newline( req_addNewline ); return buildCommand( container, &newline ); } - case Qt::Key_Tab: { + case TQt::Key_Tab: { Request r( req_addTabMark ); return buildCommand( container, &r ); } @@ -2054,7 +2054,7 @@ KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* even } -KCommand* MultilineSequenceElement::input( Container* container, QChar ch ) +KCommand* MultilineSequenceElement::input( Container* container, TQChar ch ) { int latin1 = ch.latin1(); switch (latin1) { @@ -2110,12 +2110,12 @@ int MultilineSequenceElement::tabPos( uint i ) } -void MultilineSequenceElement::writeMathML( QDomDocument& doc, - QDomNode& parent, bool oasisFormat ) const +void MultilineSequenceElement::writeMathML( TQDomDocument& doc, + TQDomNode& tqparent, bool oasisFormat ) const { - // parent is required to be a tag + // tqparent is required to be a tag - QDomElement tmp = doc.createElement( "TMP" ); + TQDomElement tmp = doc.createElement( "TMP" ); inherited::writeMathML( doc, tmp, oasisFormat ); @@ -2124,14 +2124,14 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, * end of a tag. */ - QDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); + TQDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); // The mrow, if it exists. - QDomNode n = tmp.firstChild().firstChild(); + TQDomNode n = tmp.firstChild().firstChild(); while ( !n.isNull() ) { - // the illegal TabMarkers are children of the mrow, child of tmp. + // the illegal TabMarkers are tqchildren of the mrow, child of tmp. if ( n.isElement() && n.toElement().tagName() == "TAB" ) { - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); } else { @@ -2140,12 +2140,12 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, n = n.nextSibling(); } - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); } -MultilineElement::MultilineElement( BasicElement* parent ) - : BasicElement( parent ) +MultilineElement::MultilineElement( BasicElement* tqparent ) + : BasicElement( tqparent ) { content.setAutoDelete( true ); content.append( new MultilineSequenceElement( this ) ); @@ -2184,12 +2184,12 @@ void MultilineElement::entered( SequenceElement* /*child*/ ) * Returns the element the point is in. */ BasicElement* MultilineElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if ( e != 0 ) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); uint count = content.count(); for ( uint i = 0; i < count; ++i ) { @@ -2217,15 +2217,15 @@ void MultilineElement::moveLeft( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { content.at( pos-1 )->moveLeft( cursor, this ); @@ -2252,7 +2252,7 @@ void MultilineElement::moveRight( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast( from ) ); + int pos = content.tqfind( static_cast( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2279,15 +2279,15 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { //content.at( pos-1 )->moveLeft( cursor, this ); @@ -2304,7 +2304,7 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2314,11 +2314,11 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2343,7 +2343,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast( from ) ); + int pos = content.tqfind( static_cast( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2362,7 +2362,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2372,11 +2372,11 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2399,9 +2399,9 @@ void MultilineElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm( font ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm( font ); luPixel leading = context.ptToLayoutUnitPt( fm.leading() ); luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); @@ -2412,13 +2412,13 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); line->calcSizes( context, tstyle, istyle, style ); - tabCount = QMAX( tabCount, line->tabCount() ); + tabCount = TQMAX( tabCount, line->tabCount() ); height += leading; line->setX( 0 ); line->setY( height ); height += line->getHeight() + distY; - width = QMAX( line->getWidth(), width ); + width = TQMAX( line->getWidth(), width ); } // calculate the tab positions @@ -2427,17 +2427,17 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { - pos = QMAX( pos, line->tab( t )->getX() ); + pos = TQMAX( pos, line->tab( t )->getX() ); } else { - pos = QMAX( pos, line->getWidth() ); + pos = TQMAX( pos, line->getWidth() ); } } for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { line->moveTabTo( t, pos ); - width = QMAX( width, line->getWidth() ); + width = TQMAX( width, line->getWidth() ); } } } @@ -2453,14 +2453,14 @@ void MultilineElement::calcSizes( const ContextStyle& context, } } -void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, +void MultilineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() ); + LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() ); uint count = content.count(); if ( context.edit() ) { @@ -2471,10 +2471,10 @@ void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, if ( tabCount < line->tabCount() ) { for ( uint t = tabCount; t < line->tabCount(); ++t ) { BasicElement* marker = line->tab( t ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); } tabCount = line->tabCount(); } @@ -2498,7 +2498,7 @@ void MultilineElement::dispatchFontCommand( FontCommand* cmd ) } void MultilineElement::insert( FormulaCursor* cursor, - QPtrList& newChildren, + TQPtrList& newChildren, Direction direction ) { MultilineSequenceElement* e = static_cast(newChildren.take(0)); @@ -2516,7 +2516,7 @@ void MultilineElement::insert( FormulaCursor* cursor, } void MultilineElement::remove( FormulaCursor* cursor, - QPtrList& removedChildren, + TQPtrList& removedChildren, Direction direction ) { if ( content.count() == 1 ) { //&& ( cursor->getPos() == 0 ) ) { @@ -2566,7 +2566,7 @@ SequenceElement* MultilineElement::getMainChild() void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) { - int pos = content.find( dynamic_cast( child ) ); + int pos = content.tqfind( dynamic_cast( child ) ); if ( pos > -1 ) { cursor->setTo( this, pos ); //content.at( pos )->moveRight( cursor, this ); @@ -2577,26 +2577,26 @@ void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) /** * Appends our attributes to the dom element. */ -void MultilineElement::writeDom(QDomElement element) +void MultilineElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); uint lineCount = content.count(); element.setAttribute( "LINES", lineCount ); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for ( uint i = 0; i < lineCount; ++i ) { - QDomElement tmp = content.at( i )->getElementDom(doc); + TQDomElement tmp = content.at( i )->getElementDom(doc); element.appendChild(tmp); } } -void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void MultilineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); - QDomElement row; QDomElement cell; + TQDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); + TQDomElement row; TQDomElement cell; - for ( QPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { + for ( TQPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { row = doc.createElement( oasisFormat ? "math:mtr" : "mtr" ); de.appendChild( row ); //cell = doc.createElement( "mtd" ); @@ -2606,20 +2606,20 @@ void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oa it.current()->writeMathML( doc, row, oasisFormat ); } - parent.appendChild( de ); + tqparent.appendChild( de ); } /** * Reads our attributes from the element. * Returns false if it failed. */ -bool MultilineElement::readAttributesFromDom(QDomElement element) +bool MultilineElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint lineCount = 0; - QString lineCountStr = element.attribute("LINES"); + TQString lineCountStr = element.attribute("LINES"); if(!lineCountStr.isNull()) { lineCount = lineCountStr.toInt(); } @@ -2641,7 +2641,7 @@ bool MultilineElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MultilineElement::readContentFromDom(QDomNode& node) +bool MultilineElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -2652,7 +2652,7 @@ bool MultilineElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && i < lineCount ) { if ( node.isElement() ) { SequenceElement* element = content.at( i ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -2663,10 +2663,10 @@ bool MultilineElement::readContentFromDom(QDomNode& node) return true; } -QString MultilineElement::toLatex() +TQString MultilineElement::toLatex() { uint lineCount = content.count(); - QString muliline = "\\begin{split} "; + TQString muliline = "\\begin{split} "; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->toLatex(); muliline += " \\\\ "; @@ -2676,10 +2676,10 @@ QString MultilineElement::toLatex() } // Does this make any sense at all? -QString MultilineElement::formulaString() +TQString MultilineElement::formulaString() { uint lineCount = content.count(); - QString muliline = ""; + TQString muliline = ""; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->formulaString(); muliline += "\n"; diff --git a/lib/kformula/matrixelement.h b/lib/kformula/matrixelement.h index 5f7eec4d..ede10114 100644 --- a/lib/kformula/matrixelement.h +++ b/lib/kformula/matrixelement.h @@ -22,7 +22,7 @@ #ifndef MATRIXELEMENT_H #define MATRIXELEMENT_H -#include +#include #include "basicelement.h" @@ -45,7 +45,7 @@ class MatrixElement : public BasicElement { enum SideType { NoSide, LeftSide, RightSide, LeftOverlapSide, RightOverlapSide }; MatrixElement& operator=( const MatrixElement& ) { return *this; } public: - MatrixElement(uint rows = 1, uint columns = 1, BasicElement* parent = 0); + MatrixElement(uint rows = 1, uint columns = 1, BasicElement* tqparent = 0); ~MatrixElement(); MatrixElement( const MatrixElement& ); @@ -69,7 +69,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); // drawing // @@ -80,7 +80,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -88,19 +88,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -153,16 +153,16 @@ public: virtual SequenceElement* getMainChild(); /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. */ - //virtual void insert(FormulaCursor*, QPtrList&, Direction); + //virtual void insert(FormulaCursor*, TQPtrList&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - //virtual void remove(FormulaCursor*, QPtrList&, Direction); + //virtual void remove(FormulaCursor*, TQPtrList&, Direction); /** * Moves the cursor to a normal place where new elements @@ -184,18 +184,18 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ //virtual bool isSenseless(); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); uint getRows() const { return content.count(); } uint getColumns() const { return content.getFirst()->count(); } @@ -209,32 +209,32 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "MATRIX"; } + virtual TQString getTagName() const { return "MATRIX"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const { return "mtable"; } - virtual void writeMathMLAttributes( QDomElement& element ) const; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return "mtable"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); - virtual bool readAttributesFromMathMLDom( const QDomElement& element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement& element ); /** * Reads our content from the MathML node. Sets the node to the next node @@ -242,10 +242,10 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - void writeMathMLAttributes( QDomElement& element ); + void writeMathMLAttributes( TQDomElement& element ); MatrixSequenceElement* getElement(uint row, uint column) { return content.at(row)->at(column); } @@ -262,26 +262,26 @@ private: /** * The elements we contain. */ - QPtrList< QPtrList< MatrixSequenceElement > > content; + TQPtrList< TQPtrList< MatrixSequenceElement > > content; /** * MathML Attributes. See Section 3.5.1.2 */ int m_rowNumber; VerticalAlign m_align; - QValueList< VerticalAlign > m_rowAlign; - QValueList< HorizontalAlign > m_columnAlign; - QValueList< bool > m_alignmentScope; - QValueList< SizeType > m_columnWidthType; - QValueList< double > m_columnWidth; + TQValueList< VerticalAlign > m_rowAlign; + TQValueList< HorizontalAlign > m_columnAlign; + TQValueList< bool > m_tqalignmentScope; + TQValueList< SizeType > m_columnWidthType; + TQValueList< double > m_columnWidth; SizeType m_widthType; double m_width; - QValueList< SizeType > m_rowSpacingType; - QValueList< double > m_rowSpacing; - QValueList< SizeType > m_columnSpacingType; - QValueList< double > m_columnSpacing; - QValueList< LineType > m_rowLines; - QValueList< LineType > m_columnLines; + TQValueList< SizeType > m_rowSpacingType; + TQValueList< double > m_rowSpacing; + TQValueList< SizeType > m_columnSpacingType; + TQValueList< double > m_columnSpacing; + TQValueList< LineType > m_rowLines; + TQValueList< LineType > m_columnLines; LineType m_frame; SizeType m_frameHSpacingType; double m_frameHSpacing; @@ -316,7 +316,7 @@ public: * The container this FormulaElement belongs to must not be 0, * except you really know what you are doing. */ - MultilineElement( BasicElement* parent = 0 ); + MultilineElement( BasicElement* tqparent = 0 ); ~MultilineElement(); MultilineElement( const MultilineElement& ); @@ -337,7 +337,7 @@ public: * Returns the element the point is in. */ BasicElement* goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Sets the cursor inside this element to its start position. @@ -375,7 +375,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -383,24 +383,24 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); - virtual void insert(FormulaCursor*, QPtrList&, Direction); - virtual void remove(FormulaCursor*, QPtrList&, Direction); + virtual void insert(FormulaCursor*, TQPtrList&, Direction); + virtual void remove(FormulaCursor*, TQPtrList&, Direction); virtual void normalize(FormulaCursor*, Direction); @@ -414,13 +414,13 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; protected: @@ -429,25 +429,25 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "MULTILINE"; } + virtual TQString getTagName() const { return "MULTILINE"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); private: @@ -455,7 +455,7 @@ private: /** * The list of sequences. Each one is a line. */ - QPtrList< MultilineSequenceElement > content; + TQPtrList< MultilineSequenceElement > content; }; diff --git a/lib/kformula/numberelement.cc b/lib/kformula/numberelement.cc index 41ddc179..4532d259 100644 --- a/lib/kformula/numberelement.cc +++ b/lib/kformula/numberelement.cc @@ -31,13 +31,13 @@ KFORMULA_NAMESPACE_BEGIN -NumberElement::NumberElement( BasicElement* parent ) : TokenElement( parent ) {} +NumberElement::NumberElement( BasicElement* tqparent ) : TokenElement( tqparent ) {} /* * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* NumberElement::buildCommand( Container* container, Request* request ) { @@ -56,21 +56,21 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -78,7 +78,7 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addTextChar: { @@ -89,9 +89,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) command->addCursor( cursor ); command->addToken( id ); command->addContent( id, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -106,9 +106,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) TextElement* text = creationStrategy->createTextElement( tr->text()[i] ); command->addContent( id, text ); } - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -121,9 +121,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) command->addCursor( cursor ); command->addToken( op ); command->addContent( op, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -136,11 +136,11 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) case req_addSymbol: case req_addOneByTwoMatrix: case req_addMatrix: { - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } default: diff --git a/lib/kformula/numberelement.h b/lib/kformula/numberelement.h index 21342fe2..fe6d92e4 100644 --- a/lib/kformula/numberelement.h +++ b/lib/kformula/numberelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class NumberElement : public TokenElement { typedef TokenElement inherited; public: - NumberElement( BasicElement* parent = 0 ); + NumberElement( BasicElement* tqparent = 0 ); /** * This is called by the container to get a command depending on @@ -39,7 +39,7 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mn"; } + virtual TQString getElementName() const { return "mn"; } }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/oasiscreationstrategy.cc b/lib/kformula/oasiscreationstrategy.cc index 637bd695..9f7949cb 100644 --- a/lib/kformula/oasiscreationstrategy.cc +++ b/lib/kformula/oasiscreationstrategy.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include "bracketelement.h" #include "elementtype.h" @@ -45,7 +45,7 @@ KFORMULA_NAMESPACE_BEGIN -BasicElement* OasisCreationStrategy::createElement( QString type, const QDomElement& element ) +BasicElement* OasisCreationStrategy::createElement( TQString type, const TQDomElement& element ) { // TODO @@ -95,7 +95,7 @@ BasicElement* OasisCreationStrategy::createElement( QString type, const QDomElem } -TextElement* OasisCreationStrategy::createTextElement( const QChar& ch, bool symbol ) +TextElement* OasisCreationStrategy::createTextElement( const TQChar& ch, bool symbol ) { return new TextElement( ch, symbol ); } @@ -160,13 +160,13 @@ IndexElement* OasisCreationStrategy::createIndexElement() return new IndexElement; } -BasicElement* OasisCreationStrategy::createOperatorElement( const QDomElement& element ) +BasicElement* OasisCreationStrategy::createOperatorElement( const TQDomElement& element ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); if ( n.isNull() ) return 0; if ( n.isEntityReference() ) { - QString name = n.nodeName(); + TQString name = n.nodeName(); if ( name == "CloseCurlyDoubleQuote" || name == "CloseCurlyQuote" || name == "LeftAngleBracket" @@ -184,8 +184,8 @@ BasicElement* OasisCreationStrategy::createOperatorElement( const QDomElement& e return new OperatorElement(); } if ( n.isText() ) { - QString text = n.toText().data(); - if ( text.length() == 1 && QString("()[]{}").contains(text[0]) ) { + TQString text = n.toText().data(); + if ( text.length() == 1 && TQString("()[]{}").tqcontains(text[0]) ) { return new BracketElement(); } } diff --git a/lib/kformula/oasiscreationstrategy.h b/lib/kformula/oasiscreationstrategy.h index 276749f0..d8603a23 100644 --- a/lib/kformula/oasiscreationstrategy.h +++ b/lib/kformula/oasiscreationstrategy.h @@ -22,7 +22,7 @@ #define OASISCREATIONSTRATEGY_H -#include +#include #include "kformuladefs.h" #include "creationstrategy.h" @@ -49,9 +49,9 @@ class UnderlineElement; */ class OasisCreationStrategy : public ElementCreationStrategy { public: - virtual BasicElement* createElement( QString type, const QDomElement& element ); + virtual BasicElement* createElement( TQString type, const TQDomElement& element ); - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ); + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ); virtual EmptyElement* createEmptyElement(); virtual NameSequence* createNameSequence(); virtual BracketElement* createBracketElement( SymbolType lhs, SymbolType rhs ); @@ -67,9 +67,9 @@ public: virtual IdentifierElement* createIdentifierElement(); virtual OperatorElement* createOperatorElement(); virtual NumberElement* createNumberElement(); - virtual QString type() const { return "Oasis"; } + virtual TQString type() const { return "Oasis"; } - BasicElement* createOperatorElement( const QDomElement& element ); + BasicElement* createOperatorElement( const TQDomElement& element ); }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/operatorelement.cc b/lib/kformula/operatorelement.cc index 534c093e..a9deab3c 100644 --- a/lib/kformula/operatorelement.cc +++ b/lib/kformula/operatorelement.cc @@ -19,7 +19,7 @@ #include -#include +#include #include @@ -39,7 +39,7 @@ KFORMULA_NAMESPACE_BEGIN -OperatorElement::OperatorElement( BasicElement* parent ) : TokenElement( parent ), +OperatorElement::OperatorElement( BasicElement* tqparent ) : TokenElement( tqparent ), m_form( NoForm ), m_lspaceType( ThickMathSpace ), m_rspaceType( ThickMathSpace ), @@ -77,11 +77,11 @@ void OperatorElement::setForm( FormType type ) if ( ! isTextOnly() ) { // Only text content can be dictionary keys return; } - QString text; + TQString text; for ( uint i = 0; i < countChildren(); i++ ) { text.append( getChild( i )->getCharacter() ); } - QString form; + TQString form; switch ( m_form ) { case PrefixForm: form = "prefix"; @@ -159,7 +159,7 @@ void OperatorElement::setForm( FormType type ) * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* OperatorElement::buildCommand( Container* container, Request* request ) { @@ -178,21 +178,21 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -200,7 +200,7 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addTextChar: { @@ -211,9 +211,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request command->addCursor( cursor ); command->addToken( id ); command->addContent( id, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -228,9 +228,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request TextElement* text = creationStrategy->createTextElement( tr->text()[i] ); command->addContent( id, text ); } - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -243,9 +243,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request command->addCursor( cursor ); command->addToken( num ); command->addContent( num, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -269,13 +269,13 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request } -bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) +bool OperatorElement::readAttributesFromMathMLDom( const TQDomElement &element ) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString formStr = element.attribute( "form" ).stripWhiteSpace().lower(); + TQString formStr = element.attribute( "form" ).stripWhiteSpace().lower(); if ( ! formStr.isNull() ) { m_customForm = true; if ( formStr == "prefix" ) { @@ -292,7 +292,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customForm = false; } } - QString fenceStr = element.attribute( "fence" ).stripWhiteSpace().lower(); + TQString fenceStr = element.attribute( "fence" ).stripWhiteSpace().lower(); if ( ! fenceStr.isNull() ) { m_customFence = true; if ( fenceStr == "true" ) { @@ -306,7 +306,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customFence = false; } } - QString separatorStr = element.attribute( "separator" ).stripWhiteSpace().lower(); + TQString separatorStr = element.attribute( "separator" ).stripWhiteSpace().lower(); if ( ! separatorStr.isNull() ) { m_customSeparator = true; if ( separatorStr == "true" ) { @@ -320,7 +320,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customSeparator = false; } } - QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); + TQString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); if ( ! lspaceStr.isNull() ) { m_customLSpace = true; m_lspace = getSize( lspaceStr, &m_lspaceType ); @@ -328,7 +328,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_lspaceType = getSpace( lspaceStr ); } } - QString rspaceStr = element.attribute( "rspace" ).stripWhiteSpace().lower(); + TQString rspaceStr = element.attribute( "rspace" ).stripWhiteSpace().lower(); if ( ! rspaceStr.isNull() ) { m_customRSpace = true; m_rspace = getSize( rspaceStr, &m_rspaceType ); @@ -336,7 +336,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_rspaceType = getSpace( rspaceStr ); } } - QString stretchyStr = element.attribute( "stretchy" ).stripWhiteSpace().lower(); + TQString stretchyStr = element.attribute( "stretchy" ).stripWhiteSpace().lower(); if ( ! stretchyStr.isNull() ) { m_customStretchy = true; if ( stretchyStr == "true" ) { @@ -350,7 +350,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customStretchy = false; } } - QString symmetricStr = element.attribute( "symmetric" ).stripWhiteSpace().lower(); + TQString symmetricStr = element.attribute( "symmetric" ).stripWhiteSpace().lower(); if ( ! symmetricStr.isNull() ) { m_customSymmetric = true; if ( symmetricStr == "true" ) { @@ -364,7 +364,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customSymmetric = false; } } - QString maxsizeStr = element.attribute( "maxsize" ).stripWhiteSpace().lower(); + TQString maxsizeStr = element.attribute( "maxsize" ).stripWhiteSpace().lower(); if ( ! maxsizeStr.isNull() ) { m_customMaxSize = true; if ( maxsizeStr == "infinity" ) { @@ -377,7 +377,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) } } } - QString minsizeStr = element.attribute( "minsize" ).stripWhiteSpace().lower(); + TQString minsizeStr = element.attribute( "minsize" ).stripWhiteSpace().lower(); if ( ! minsizeStr.isNull() ) { m_customMinSize = true; m_minSize = getSize( minsizeStr, &m_minSizeType ); @@ -385,7 +385,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_minSizeType = getSpace( minsizeStr ); } } - QString largeopStr = element.attribute( "largeop" ).stripWhiteSpace().lower(); + TQString largeopStr = element.attribute( "largeop" ).stripWhiteSpace().lower(); if ( ! largeopStr.isNull() ) { m_customLargeOp = true; if ( largeopStr == "true" ) { @@ -399,7 +399,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customLargeOp = false; } } - QString movablelimitsStr = element.attribute( "movablelimits" ).stripWhiteSpace().lower(); + TQString movablelimitsStr = element.attribute( "movablelimits" ).stripWhiteSpace().lower(); if ( ! movablelimitsStr.isNull() ) { m_customMovableLimits = true; if ( movablelimitsStr == "true" ) { @@ -413,7 +413,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customMovableLimits = false; } } - QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); + TQString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); if ( ! accentStr.isNull() ) { m_customAccent = true; if ( accentStr == "true" ) { @@ -430,7 +430,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) return true; } -void OperatorElement::writeMathMLAttributes( QDomElement& element ) const +void OperatorElement::writeMathMLAttributes( TQDomElement& element ) const { if ( m_customForm ) { switch ( m_form ) { @@ -481,20 +481,20 @@ void OperatorElement::writeMathMLAttributes( QDomElement& element ) const } } -void OperatorElement::writeSizeAttribute( QDomElement& element, const QString &attr, SizeType type, double length ) const +void OperatorElement::writeSizeAttribute( TQDomElement& element, const TQString &attr, SizeType type, double length ) const { switch ( type ) { case InfinitySize: element.setAttribute( attr, "infinity" ); break; case AbsoluteSize: - element.setAttribute( attr, QString( "%1pt" ).arg( length ) ); + element.setAttribute( attr, TQString( "%1pt" ).tqarg( length ) ); break; case RelativeSize: - element.setAttribute( attr, QString( "%1% " ).arg( length * 100.0 ) ); + element.setAttribute( attr, TQString( "%1% " ).tqarg( length * 100.0 ) ); break; case PixelSize: - element.setAttribute( attr, QString( "%1px " ).arg( length ) ); + element.setAttribute( attr, TQString( "%1px " ).tqarg( length ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( attr, "negativeveryverythinmathspace" ); diff --git a/lib/kformula/operatorelement.h b/lib/kformula/operatorelement.h index 476b6e99..52c35537 100644 --- a/lib/kformula/operatorelement.h +++ b/lib/kformula/operatorelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class OperatorElement : public TokenElement { typedef TokenElement inherited; public: - OperatorElement( BasicElement* parent = 0 ); + OperatorElement( BasicElement* tqparent = 0 ); void setForm( FormType type ); /** @@ -40,11 +40,11 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mo"; } + virtual TQString getElementName() const { return "mo"; } private: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); - void writeMathMLAttributes( QDomElement& element ) const ; - void writeSizeAttribute( QDomElement& element, const QString &attr, SizeType type, double length ) const ; + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); + void writeMathMLAttributes( TQDomElement& element ) const ; + void writeSizeAttribute( TQDomElement& element, const TQString &attr, SizeType type, double length ) const ; FormType m_form; SizeType m_lspaceType; diff --git a/lib/kformula/paddedelement.cc b/lib/kformula/paddedelement.cc index f48d4503..f79e6789 100644 --- a/lib/kformula/paddedelement.cc +++ b/lib/kformula/paddedelement.cc @@ -22,7 +22,7 @@ KFORMULA_NAMESPACE_BEGIN -PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ), +PaddedElement::PaddedElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_widthType( NoSize ), m_lspaceType( NoSize ), m_heightType( NoSize ), @@ -36,7 +36,7 @@ PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void PaddedElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -60,13 +60,13 @@ void PaddedElement::calcSizes( const ContextStyle& context, width += it->getWidth() + spaceBefore; luPixel baseline = it->getBaseline(); if ( baseline > -1 ) { - height = QMAX( height, baseline ); - depth = QMAX( depth, it->getHeight() - baseline ); + height = TQMAX( height, baseline ); + depth = TQMAX( depth, it->getHeight() - baseline ); } else { luPixel bl = it->getHeight()/2 + context.axisHeight( tstyle, factor ); - height = QMAX( height, bl ); - depth = QMAX( depth, it->getHeight() - bl ); + height = TQMAX( height, bl ); + depth = TQMAX( depth, it->getHeight() - bl ); } } } @@ -110,25 +110,25 @@ void PaddedElement::calcSizes( const ContextStyle& context, } } -bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) +bool PaddedElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); + TQString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); if ( ! widthStr.isNull() ) { m_width = readSizeAttribute( widthStr, &m_widthType, &m_widthRelative ); } - QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); + TQString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); if ( ! lspaceStr.isNull() ) { m_lspace = readSizeAttribute( lspaceStr, &m_lspaceType, &m_lspaceRelative ); } - QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); + TQString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); if ( ! heightStr.isNull() ) { m_height = readSizeAttribute( heightStr, &m_heightType, &m_heightRelative ); } - QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); + TQString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); if ( ! depthStr.isNull() ) { m_depth = readSizeAttribute( depthStr, &m_depthType, &m_depthRelative ); } @@ -136,7 +136,7 @@ bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void PaddedElement::writeMathMLAttributes( QDomElement& element ) const +void PaddedElement::writeMathMLAttributes( TQDomElement& element ) const { writeSizeAttribute( element, "width", m_widthType, m_width, m_widthRelative ); writeSizeAttribute( element, "lspace", m_lspaceType, m_lspace, m_lspaceRelative ); @@ -144,7 +144,7 @@ void PaddedElement::writeMathMLAttributes( QDomElement& element ) const writeSizeAttribute( element, "depth", m_depthType, m_depth, m_depthRelative ); } -double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* relative ) +double PaddedElement::readSizeAttribute( const TQString& str, SizeType* st, bool* relative ) { if ( st == 0 ){ return -1; @@ -152,55 +152,55 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* if ( str[0] == '+' || str[0] == '-' ) { *relative = true; } - int index = str.find( "width" ); + int index = str.tqfind( "width" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, WidthRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, WidthRelativeSize ); } - index = str.find( "height" ); + index = str.tqfind( "height" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, HeightRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, HeightRelativeSize ); } - index = str.find( "%" ); + index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, PixelSize ); } @@ -208,7 +208,7 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* return str2size( str, st, AbsoluteSize ); } -double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type ) +double PaddedElement::str2size( const TQString& str, SizeType *st, SizeType type ) { bool ok; double size = str.toDouble( &ok ); @@ -224,27 +224,27 @@ double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type return -1; } -void PaddedElement::writeSizeAttribute( QDomElement element, const QString& str, +void PaddedElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, bool relative, double s ) const { - QString prefix; + TQString prefix; if ( relative ) { s < 0 ? prefix = "-" : prefix = "+" ; } switch ( st ) { case WidthRelativeSize: - element.setAttribute( str, prefix + QString( "%1 width" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 width" ).tqarg( s ) ); break; case HeightRelativeSize: - element.setAttribute( str, prefix + QString( "%1 height" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 height" ).tqarg( s ) ); case AbsoluteSize: - element.setAttribute( str, prefix + QString( "%1pt" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1pt" ).tqarg( s ) ); break; case RelativeSize: - element.setAttribute( str, prefix + QString( "%1%" ).arg( s * 100.0 ) ); + element.setAttribute( str, prefix + TQString( "%1%" ).tqarg( s * 100.0 ) ); break; case PixelSize: - element.setAttribute( str, prefix + QString( "%1px" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1px" ).tqarg( s ) ); break; default: break; diff --git a/lib/kformula/paddedelement.h b/lib/kformula/paddedelement.h index 591f87bf..6d552837 100644 --- a/lib/kformula/paddedelement.h +++ b/lib/kformula/paddedelement.h @@ -28,11 +28,11 @@ class PaddedElement : public SequenceElement { typedef SequenceElement inherited; enum SizeType { NoSize, RelativeSize, AbsoluteSize, PixelSize, WidthRelativeSize, HeightRelativeSize }; public: - PaddedElement( BasicElement* parent = 0 ); + PaddedElement( BasicElement* tqparent = 0 ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -40,16 +40,16 @@ public: StyleAttributes& style ); protected: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); private: - virtual QString getElementName() const { return "mpadded"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mpadded"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - double readSizeAttribute( const QString& str, SizeType* st, bool* relative ); - double getSize( const QString& str, SizeType* st ); - double str2size( const QString& str, SizeType* st, SizeType type ); - void writeSizeAttribute( QDomElement element, const QString& str, + double readSizeAttribute( const TQString& str, SizeType* st, bool* relative ); + double getSize( const TQString& str, SizeType* st ); + double str2size( const TQString& str, SizeType* st, SizeType type ); + void writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, bool relative, double s ) const ; luPixel calcSize( const ContextStyle& context, SizeType type, bool relative, double length, luPixel width, diff --git a/lib/kformula/phantomelement.cc b/lib/kformula/phantomelement.cc index 2aff0dcd..662ec53d 100644 --- a/lib/kformula/phantomelement.cc +++ b/lib/kformula/phantomelement.cc @@ -21,16 +21,16 @@ KFORMULA_NAMESPACE_BEGIN -PhantomElement::PhantomElement( BasicElement* parent ) : SequenceElement( parent ) +PhantomElement::PhantomElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void PhantomElement::draw( QPainter&, const LuPixelRect&, const ContextStyle&, +void PhantomElement::draw( TQPainter&, const LuPixelRect&, const ContextStyle&, ContextStyle::TextStyle, ContextStyle::IndexStyle, StyleAttributes&, const LuPixelPoint& ) { diff --git a/lib/kformula/phantomelement.h b/lib/kformula/phantomelement.h index 01880d7b..885a9651 100644 --- a/lib/kformula/phantomelement.h +++ b/lib/kformula/phantomelement.h @@ -27,22 +27,22 @@ KFORMULA_NAMESPACE_BEGIN class PhantomElement : public SequenceElement { typedef SequenceElement inherited; public: - PhantomElement( BasicElement* parent = 0 ); + PhantomElement( BasicElement* tqparent = 0 ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); private: - virtual QString getElementName() const { return "mphantom"; } + virtual TQString getElementName() const { return "mphantom"; } }; diff --git a/lib/kformula/prototype/engine.py b/lib/kformula/prototype/engine.py index f1391069..0ce870cf 100644 --- a/lib/kformula/prototype/engine.py +++ b/lib/kformula/prototype/engine.py @@ -24,8 +24,8 @@ from qt import * class BasicElement: """The interface for every element.""" - def __init__(self, parent): - self.parent = parent + def __init__(self, tqparent): + self.tqparent = tqparent self.size = QSize() self.pos = QPoint() @@ -47,7 +47,7 @@ class BasicElement: while element != None: x += element.x() y += element.y() - element = element.parent + element = element.tqparent return QPoint(x, y) def elementAt(self, point, startPoint): @@ -79,19 +79,19 @@ class BasicElement: def formula(self): """Returns the FormulaElement we are a child of.""" - return self.parent.formula() + return self.tqparent.formula() def draw(self, painter, styleContext, startPoint): - """Draws the whole thing. Including its children.""" + """Draws the whole thing. Including its tqchildren.""" pass def calcSizes(self, styleContext): """Recalculates the size. - position (relative our to parent), width and height + position (relative our to tqparent), width and height will be stored in self.size, the midline offset in self.midline. - Please note: It's up to a parent to store its children's position.""" + Please note: It's up to a tqparent to store its tqchildren's position.""" pass def mainChild(self): @@ -116,22 +116,22 @@ class BasicElement: class SequenceElement (BasicElement): - """The element that contains a number of children. - The children are aligned in one line.""" + """The element that contains a number of tqchildren. + The tqchildren are aligned in one line.""" - def __init__(self, parent): - BasicElement.__init__(self, parent) - self.children = [] + def __init__(self, tqparent): + BasicElement.__init__(self, tqparent) + self.tqchildren = [] def elementAtCursor(self, cursor): """Returns the element before the cursor.""" if cursor.pos() > 0: - return self.children[cursor.pos()-1] + return self.tqchildren[cursor.pos()-1] def elementAt(self, point, startPoint): r = BasicElement.elementAt(self, point, startPoint) if r != None: - for child in self.children: + for child in self.tqchildren: r = child.elementAt(point, QPoint(startPoint.x()+child.x(), startPoint.y()+child.y())) if r != None: @@ -141,9 +141,9 @@ class SequenceElement (BasicElement): def moveLeft(self, cursor, fromElement): - # Our parent asks us for a cursor position. Found. - if fromElement == self.parent: - cursor.set(self, len(self.children)) + # Our tqparent asks us for a cursor position. Found. + if fromElement == self.tqparent: + cursor.set(self, len(self.tqchildren)) # We already owned the cursor. Ask next child then. elif fromElement == self: @@ -151,16 +151,16 @@ class SequenceElement (BasicElement): if cursor.isSelection(): cursor.set (self, cursor.pos()-1) else: - self.children[cursor.pos()-1].moveLeft(cursor, self) + self.tqchildren[cursor.pos()-1].moveLeft(cursor, self) else: # Needed because FormulaElement derives this. - if self.parent != None: - self.parent.moveLeft(cursor, self) + if self.tqparent != None: + self.tqparent.moveLeft(cursor, self) - # The cursor came from one of our children or + # The cursor came from one of our tqchildren or # something is wrong. else: - fromPos = self.children.index(fromElement) + fromPos = self.tqchildren.index(fromElement) cursor.set(self, fromPos) if cursor.isSelection(): if not cursor.mouseMark(): @@ -169,26 +169,26 @@ class SequenceElement (BasicElement): def moveRight(self, cursor, fromElement): - # Our parent asks us for a cursor position. Found. - if fromElement == self.parent: + # Our tqparent asks us for a cursor position. Found. + if fromElement == self.tqparent: cursor.set(self, 0) # We already owned the cursor. Ask next child then. elif fromElement == self: - if cursor.pos() < len(self.children): + if cursor.pos() < len(self.tqchildren): if cursor.isSelection(): cursor.set (self, cursor.pos()+1) else: - self.children[cursor.pos()].moveRight(cursor, self) + self.tqchildren[cursor.pos()].moveRight(cursor, self) else: # Needed because FormulaElement derives this. - if self.parent != None: - self.parent.moveRight(cursor, self) + if self.tqparent != None: + self.tqparent.moveRight(cursor, self) - # The cursor came from one of our children or + # The cursor came from one of our tqchildren or # something is wrong. else: - fromPos = self.children.index(fromElement) + fromPos = self.tqchildren.index(fromElement) cursor.set(self, fromPos+1) if cursor.isSelection(): if not cursor.mouseMark(): @@ -196,44 +196,44 @@ class SequenceElement (BasicElement): def moveUp(self, cursor, fromElement): - if fromElement == self.parent: + if fromElement == self.tqparent: self.moveRight(cursor, self) else: - if self.parent != None: - self.parent.moveUp(cursor, self) + if self.tqparent != None: + self.tqparent.moveUp(cursor, self) def moveDown(self, cursor, fromElement): - if fromElement == self.parent: + if fromElement == self.tqparent: self.moveRight(cursor, self) else: - if self.parent != None: - self.parent.moveDown(cursor, self) + if self.tqparent != None: + self.tqparent.moveDown(cursor, self) def moveHome(self, cursor): if cursor.isSelection(): element = cursor.element() if element != self: - while element.parent != self: - element = element.parent - cursor.setMarkPos(self.children.index(element)+1) + while element.tqparent != self: + element = element.tqparent + cursor.setMarkPos(self.tqchildren.index(element)+1) cursor.set(self, 0) def moveEnd(self, cursor): if cursor.isSelection(): element = cursor.element() if element != self: - while element.parent != self: - element = element.parent - cursor.setMarkPos(self.children.index(element)) - cursor.set(self, len(self.children)) + while element.tqparent != self: + element = element.tqparent + cursor.setMarkPos(self.tqchildren.index(element)) + cursor.set(self, len(self.tqchildren)) def draw(self, painter, styleContext, startPoint): x, y = startPoint.x(), startPoint.y() - if len(self.children) > 0: - for child in self.children: + if len(self.tqchildren) > 0: + for child in self.tqchildren: cX = child.x() cY = child.y() child.draw(painter, styleContext, QPoint(x+cX, y+cY)) @@ -246,11 +246,11 @@ class SequenceElement (BasicElement): painter.drawRect(x, y, self.width(), self.height()) def calcSizes(self, styleContext): - if len(self.children) > 0: + if len(self.tqchildren) > 0: x = self.x() y = self.y() width = toMidline = fromMidline = 0 - for child in self.children: + for child in self.tqchildren: child.calcSizes(styleContext) child.setX(width) width += child.width() @@ -263,7 +263,7 @@ class SequenceElement (BasicElement): self.setHeight(toMidline+fromMidline) self.midline = toMidline - for child in self.children: + for child in self.tqchildren: child.setY(self.midline - child.midline) else: @@ -272,14 +272,14 @@ class SequenceElement (BasicElement): self.midline = 5 def mainChild(self): - if len(self.children) > 0: - return self.children[0] + if len(self.tqchildren) > 0: + return self.tqchildren[0] return None def setMainChild(self, sequenceElement): - if len(self.children) > 0: - self.children[0] = sequenceElement - sequenceElement.parent = self + if len(self.tqchildren) > 0: + self.tqchildren[0] = sequenceElement + sequenceElement.tqparent = self else: self.addChild(sequenceElement) @@ -292,23 +292,23 @@ class SequenceElement (BasicElement): the cursor) with the given element. The replaced sequence becomes the main child of the new element.""" - # it is essential to set up the parent pointer for + # it is essential to set up the tqparent pointer for # the notification to work. - element.parent = self + element.tqparent = self seq = element.makeSequence() if cursor.isSelection(): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) seq.addChild(child) - self.children.insert(f, element) + self.tqchildren.insert(f, element) cursor.setMarkPos(-1) cursor.set(self, f+1) elif cursor.pos() > 0: - seq.addChild(self.children[cursor.pos()-1]) + seq.addChild(self.tqchildren[cursor.pos()-1]) self.replaceChild(cursor, element) else: self.insertChild(cursor, element) @@ -319,48 +319,48 @@ class SequenceElement (BasicElement): def replaceElementByMainChild(self, cursor, element): """Replaces the given element with the content of its main child. (The main child is always a SequenceElement.)""" - assert element.parent == self + assert element.tqparent == self self.formula().elementRemoved(element) seq = element.mainChild() - pos = self.children.index(element) - self.children.remove(element) - for child in seq.children: - self.children.insert(pos, child) - child.parent = self + pos = self.tqchildren.index(element) + self.tqchildren.remove(element) + for child in seq.tqchildren: + self.tqchildren.insert(pos, child) + child.tqparent = self pos += 1 cursor.set(self, pos) self.formula().changed() def addChild(self, element): - self.children.append(element) - element.parent = self + self.tqchildren.append(element) + element.tqparent = self self.formula().changed() def insertChild(self, cursor, element): """Inserts the new element at the cursor position. The cursor is placed behind the new element.""" pos = cursor.pos() - self.children.insert(pos, element) - element.parent = self + self.tqchildren.insert(pos, element) + element.tqparent = self cursor.set(self, pos+1) self.formula().changed() def replaceChild(self, cursor, element): """Replaces the element before the cursor with the new one. No range checking. Be careful.""" - self.children[cursor.pos()-1] = element - element.parent = self + self.tqchildren[cursor.pos()-1] = element + element.tqparent = self self.formula().changed() def removeChild(self, cursor, element): self.formula().elementRemoved(element) - cursor.set(self, self.children.index(element)) - self.children.remove(element) - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + cursor.set(self, self.tqchildren.index(element)) + self.tqchildren.remove(element) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) return self.formula().changed() @@ -370,18 +370,18 @@ class SequenceElement (BasicElement): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) cursor.setMarkPos(-1) cursor.set(self, f) self.formula().changed() - elif pos < len(self.children): - self.children.pop(pos) + elif pos < len(self.tqchildren): + self.tqchildren.pop(pos) self.formula().changed() else: - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) def removeChildBefore(self, cursor): pos = cursor.pos()-1 @@ -389,29 +389,29 @@ class SequenceElement (BasicElement): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) cursor.setMarkPos(-1) cursor.set(self, f) self.formula().changed() elif pos >= 0: - self.children.pop(pos) + self.tqchildren.pop(pos) cursor.set(self, pos) self.formula().changed() else: - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) def globalCursorPos(self, pos): """Returns the position after the child at the position in global Coords.""" point = self.globalPos() - if pos < len(self.children): - d = self.children[pos].x() + if pos < len(self.tqchildren): + d = self.tqchildren[pos].x() else: - if len(self.children) > 0: + if len(self.tqchildren) > 0: d = self.width() else: d = 2 @@ -420,13 +420,13 @@ class SequenceElement (BasicElement): return point def countChildren(self): - return len(self.children) + return len(self.tqchildren) class FormulaElement (SequenceElement): """The main element. - A formula consists of a FormulaElement and its children. - The only element that has no parent.""" + A formula consists of a FormulaElement and its tqchildren. + The only element that has no tqparent.""" def __init__(self, document): SequenceElement.__init__(self, None) @@ -436,7 +436,7 @@ class FormulaElement (SequenceElement): return self def changed(self): - """Is called by its children if the formula changed in any way.""" + """Is called by its tqchildren if the formula changed in any way.""" self.document.changed() def elementRemoved(self, element): @@ -452,15 +452,15 @@ class FormulaElement (SequenceElement): class TextElement (BasicElement): """One char.""" - def __init__(self, parent, char): - BasicElement.__init__(self, parent) + def __init__(self, tqparent, char): + BasicElement.__init__(self, tqparent) self.char = char def moveLeft(self, cursor, fromElement): - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) def moveRight(self, cursor, fromElement): - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) def draw(self, painter, styleContext, startPoint): styleContext.setupPainter(painter) @@ -480,8 +480,8 @@ class IndexElement (BasicElement): def __init__(self, contentElement): if contentElement != None: - BasicElement.__init__(self, contentElement.parent) - contentElement.parent = self + BasicElement.__init__(self, contentElement.tqparent) + contentElement.tqparent = self else: BasicElement.__init__(self, None) @@ -525,9 +525,9 @@ class IndexElement (BasicElement): assert fromElement != None if cursor.isSelection(): - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) - elif fromElement == self.parent: + elif fromElement == self.tqparent: if self.lowerRight != None: self.lowerRight.moveLeft(cursor, self) elif self.upperRight != None: @@ -550,25 +550,25 @@ class IndexElement (BasicElement): elif self.upperLeft != None: self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) elif fromElement == self.lowerLeft: if self.upperLeft != None: self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) def moveRight(self, cursor, fromElement): assert fromElement != None if cursor.isSelection(): - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) - elif fromElement == self.parent: + elif fromElement == self.tqparent: if self.upperLeft != None: self.upperLeft.moveRight(cursor, self) elif self.lowerLeft != None: @@ -591,26 +591,26 @@ class IndexElement (BasicElement): elif self.lowerRight != None: self.lowerRight.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) elif fromElement == self.upperRight: if self.lowerRight != None: self.lowerRight.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) def moveUp(self, cursor, fromElement): assert fromElement != None - if fromElement == self.parent: + if fromElement == self.tqparent: self.content.moveRight(cursor, self) elif fromElement == self.upperLeft or fromElement == self.upperRight: - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) elif fromElement == self.content: if self.upperRight != None: @@ -619,7 +619,7 @@ class IndexElement (BasicElement): #self.upperLeft.moveRight(cursor, self) self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) elif fromElement == self.lowerLeft: self.content.moveRight(cursor, self) @@ -628,17 +628,17 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) else: # should never happen. - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) def moveDown(self, cursor, fromElement): assert fromElement != None - if fromElement == self.parent: + if fromElement == self.tqparent: self.content.moveRight(cursor, self) elif fromElement == self.lowerLeft or fromElement == self.lowerRight: - self.parent.moveDown(cursor, fromElement) + self.tqparent.moveDown(cursor, fromElement) elif fromElement == self.content: if self.lowerRight != None: @@ -647,7 +647,7 @@ class IndexElement (BasicElement): #self.lowerLeft.moveRight(cursor, self) self.lowerLeft.moveLeft(cursor, self) else: - self.parent.moveDown(cursor, self) + self.tqparent.moveDown(cursor, self) elif fromElement == self.upperLeft: self.content.moveRight(cursor, self) @@ -656,7 +656,7 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) else: # should never happen. - self.parent.moveDown(cursor, self) + self.tqparent.moveDown(cursor, self) def draw(self, painter, styleContext, startPoint): @@ -783,7 +783,7 @@ class IndexElement (BasicElement): def setMainChild(self, sequenceElement): self.content = sequenceElement - self.content.parent = self + self.content.tqparent = self self.formula().changed() def removeChild(self, cursor, element): @@ -804,12 +804,12 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) self.lowerRight = None elif element == self.content: - self.parent.removeChild(cursor, self) + self.tqparent.removeChild(cursor, self) return if self.upperLeft == None and self.lowerLeft == None and \ self.upperRight == None and self.lowerRight == None: - self.parent.replaceElementByMainChild(cursor, self) + self.tqparent.replaceElementByMainChild(cursor, self) else: self.formula().changed() @@ -876,7 +876,7 @@ class Cursor: return self.currentMarkPos def setMarkPos(self, markPos): - """Gets called by elements if the cursor moves up to the parent.""" + """Gets called by elements if the cursor moves up to the tqparent.""" self.selectionFlag = (markPos != -1) self.currentMarkPos = markPos @@ -916,10 +916,10 @@ class Cursor: if isinstance(element, IndexElement): return element if self.pos() == self.sequenceElement.countChildren(): - parent = self.sequenceElement.parent - if isinstance(parent, IndexElement): - if self.sequenceElement == parent.mainChild(): - return parent + tqparent = self.sequenceElement.tqparent + if isinstance(tqparent, IndexElement): + if self.sequenceElement == tqparent.mainChild(): + return tqparent def addUpperRightIndex(self): @@ -929,7 +929,7 @@ class Cursor: self.sequenceElement.replaceCurrentSelection(self, indexElement) index = indexElement.requireUpperRight() - index.moveRight(self, index.parent) + index.moveRight(self, index.tqparent) def addLowerRightIndex(self): @@ -939,7 +939,7 @@ class Cursor: self.sequenceElement.replaceCurrentSelection(self, indexElement) index = indexElement.requireLowerRight() - index.moveRight(self, index.parent) + index.moveRight(self, index.tqparent) def addTextElement(self, char): @@ -1018,8 +1018,8 @@ class Cursor: formula = self.sequenceElement.formula() element = formula.elementAt(mouseEvent.pos(), QPoint(0, 0)) if element != None: - if element.parent != None: - element.moveLeft(self, element.parent) + if element.tqparent != None: + element.moveLeft(self, element.tqparent) self.selectionFlag = 0 self.mouseMarkFlag = 1 self.setMarkPos(self.pos()) @@ -1034,8 +1034,8 @@ class Cursor: formula = self.sequenceElement.formula() element = formula.elementAt(mouseEvent.pos(), QPoint(0, 0)) if element != None: - if element.parent != None: - element.parent.moveLeft(self, element) + if element.tqparent != None: + element.tqparent.moveLeft(self, element) def elementRemoved(self, element): @@ -1046,10 +1046,10 @@ class Cursor: if e == element: # This is meant to catch all cursors that did not # cause the deletion. - e.parent.moveRight(self, e) + e.tqparent.moveRight(self, e) self.sequenceElement.moveHome(self) return - e = e.parent + e = e.tqparent class StyleContext: diff --git a/lib/kformula/prototype/gensymbolfontmap.py b/lib/kformula/prototype/gensymbolfontmap.py index a1373815..c06376d8 100644 --- a/lib/kformula/prototype/gensymbolfontmap.py +++ b/lib/kformula/prototype/gensymbolfontmap.py @@ -3,7 +3,7 @@ import time from xml.sax import saxutils, handler, make_parser -unicodetable = { "normal":{}, "bold":{}, "italic":{}, +tqunicodetable = { "normal":{}, "bold":{}, "italic":{}, "slant":{}, "boldItalic":{} } fonttable = {} @@ -14,7 +14,7 @@ class ContentGenerator(handler.ContentHandler): self.font = None def startElement(self, name, attrs): - if name == 'unicodetable': + if name == 'tqunicodetable': self.font = None for (name, value) in attrs.items(): if name == "font" and value: @@ -31,7 +31,7 @@ class ContentGenerator(handler.ContentHandler): elif name == "style": style = value if number != '': - unicodetable[style][number] = (latexName, charClass) + tqunicodetable[style][number] = (latexName, charClass) fonttable[self.font].append((key, number, style)) def fontkey(font, style, number): @@ -43,9 +43,9 @@ def fontkey(font, style, number): def writeFontTable(fontname, f): f.write('\n\nstatic InternFontTable ' + fontname + 'Map[] = {\n') - for style in unicodetable: - for key in unicodetable[style]: - latexName, charClass = unicodetable[style][key] + for style in tqunicodetable: + for key in tqunicodetable[style]: + latexName, charClass = tqunicodetable[style][key] pos = fontkey(fontname, style, key) if pos: f.write(' { ' + key + ', ' + hex(pos) + ', ' + charClass + ', ' + style + 'Char },\n') @@ -107,14 +107,14 @@ def main(): writeFontTable(fn, f) f.close() - f = open('../unicodenames.cc', 'w') + f = open('../tqunicodenames.cc', 'w') write_header(f) - print >>f, 'struct UnicodeNameTable { short unicode; const char* name; };' + print >>f, 'struct UnicodeNameTable { short tqunicode; const char* name; };' print >>f, 'static UnicodeNameTable nameTable[] = {' nameDir = {} table = {} - for style in unicodetable: - table.update(unicodetable[style]) + for style in tqunicodetable: + table.update(tqunicodetable[style]) for key in table: latexName, charClass = table[key] @@ -128,10 +128,10 @@ def main(): -def make_unicode_table(): +def make_tqunicode_table(): header = [] codes = {} - f = open('../config/unicode.tbl', 'r') + f = open('../config/tqunicode.tbl', 'r') for line in f.xreadlines(): if line[0] == '#': header.append(line.strip()) @@ -142,14 +142,14 @@ def make_unicode_table(): codes[line.split(',')[0].strip()] = line f.close() - for key in unicodetable: - latexName, charClass = unicodetable[key] + for key in tqunicodetable: + latexName, charClass = tqunicodetable[key] if len(latexName) > 0: - codes[key] = key + ', ' + charClass + ', ' + latexName.replace('\\', '') + codes[key] = key + ', ' + charClass + ', ' + latexName.tqreplace('\\', '') else: codes[key] = key + ', ' + charClass - f = open('../config/unicode.tbl', 'w') + f = open('../config/tqunicode.tbl', 'w') for line in header: print >> f, line for key in codes: @@ -174,8 +174,8 @@ def make_font_table(font): ## for line in header: ## print >> f, line #print >> f, "name = " + font - for key in unicodetable: - latexName, charClass = unicodetable[key] + for key in tqunicodetable: + latexName, charClass = tqunicodetable[key] pos = fontkey(font, key) if pos: print >> f, str(pos), key, charClass, latexName @@ -186,30 +186,30 @@ def make_all_font_tables(): make_font_table(font) -def symbol_entry(pos, unicode, charClass, name): +def symbol_entry(pos, tqunicode, charClass, name): return ' ' % \ - (pos, unicode, name, charClass) + (pos, tqunicode, name, charClass) def compare_font(font): for line in file(font+".font"): list = line.split() pos = int(list[0]) - unicode = list[1] + tqunicode = list[1] charClass = list[2] if len(list)>3: name = list[3] else: name = "" - if (pos, unicode) not in fonttable[font]: - print "not in font", font, (pos, unicode) - print symbol_entry(pos, unicode, charClass, name) - if unicode not in unicodetable: - print font, unicode, (name, charClass) - print symbol_entry(pos, unicode, charClass, name) - elif unicodetable[unicode] != (name, charClass): - print font, unicode, pos, unicodetable[unicode], "!=", (name, charClass) + if (pos, tqunicode) not in fonttable[font]: + print "not in font", font, (pos, tqunicode) + print symbol_entry(pos, tqunicode, charClass, name) + if tqunicode not in tqunicodetable: + print font, tqunicode, (name, charClass) + print symbol_entry(pos, tqunicode, charClass, name) + elif tqunicodetable[tqunicode] != (name, charClass): + print font, tqunicode, pos, tqunicodetable[tqunicode], "!=", (name, charClass) def compare(): fontnames = [ "symbol", @@ -241,10 +241,10 @@ if __name__ == '__main__': parser.parse("symbol.xml") #print fonttable - #print unicodetable + #print tqunicodetable #compare() main() - #make_unicode_table() + #make_tqunicode_table() #make_all_font_tables() diff --git a/lib/kformula/prototype/unicode.py b/lib/kformula/prototype/unicode.py index 3559711d..5f5f2138 100755 --- a/lib/kformula/prototype/unicode.py +++ b/lib/kformula/prototype/unicode.py @@ -5,8 +5,8 @@ from qt import * from xml.sax import saxutils, handler, make_parser class Form1(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) + def __init__(self,tqparent = None,name = None,fl = 0): + QWidget.__init__(self,tqparent,name,fl) if name == None: self.setName('Form1') @@ -48,7 +48,7 @@ class Form1(QWidget): return list def setFont(self, fontName, font): - fontName = fontName.replace("%20", " ") + fontName = fontName.tqreplace("%20", " ") self.fontName = fontName for i in self.chars: charLabel, number, latexName, charClass = self.chars[i] @@ -130,7 +130,7 @@ class Widget(QWidget): print >> f, '' print >> f, '' for font in self.fonts: - print >> f, ' ' + print >> f, ' ' for (key, number, latexName, charClass) in self.fonts[font]: if not charClass or charClass == '': charClass = 'ORDINARY' @@ -140,7 +140,7 @@ class Widget(QWidget): '" class="' + str(charClass) + \ '"/>' - print >> f, ' ' + print >> f, ' ' print >> f, '
' f.close() @@ -152,7 +152,7 @@ class ContentGenerator(handler.ContentHandler): self.currentFont = None def startElement(self, name, attrs): - if name == 'unicodetable': + if name == 'tqunicodetable': for (name, value) in attrs.items(): if name == "font": self.currentFont = value diff --git a/lib/kformula/rootelement.cc b/lib/kformula/rootelement.cc index 08a738f2..098d069f 100644 --- a/lib/kformula/rootelement.cc +++ b/lib/kformula/rootelement.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -38,7 +38,7 @@ class RootSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - RootSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + RootSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual RootSequenceElement* clone() { return new RootSequenceElement( *this ); } @@ -92,8 +92,8 @@ KCommand* RootSequenceElement::buildCommand( Container* container, Request* requ } -RootElement::RootElement(BasicElement* parent) - : BasicElement(parent) +RootElement::RootElement(BasicElement* tqparent) + : BasicElement(tqparent) { content = new RootSequenceElement( this ); index = 0; @@ -138,12 +138,12 @@ void RootElement::entered( SequenceElement* child ) BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -176,7 +176,7 @@ BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void RootElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -234,18 +234,18 @@ void RootElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void RootElement::draw( QPainter& painter, const LuPixelRect& r, +void RootElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -264,28 +264,28 @@ void RootElement::draw( QPainter& painter, const LuPixelRect& r, luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); luPixel unit = (content->getHeight() + distY)/ 3; - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), - context.layoutUnitToPixelY( y+distY/3 ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/2 ), - context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+unit+unit/2 ) ); + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/2 ), + context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+unit+unit/2 ) ); } @@ -415,7 +415,7 @@ void RootElement::moveDown(FormulaCursor* cursor, BasicElement* from) * Reinserts the index if it has been removed. */ void RootElement::insert(FormulaCursor* cursor, - QPtrList& newChildren, + TQPtrList& newChildren, Direction direction) { if (cursor->getPos() == upperLeftPos) { @@ -434,13 +434,13 @@ void RootElement::insert(FormulaCursor* cursor, } /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ void RootElement::remove(FormulaCursor* cursor, - QPtrList& removedChildren, + TQPtrList& removedChildren, Direction direction) { switch (cursor->getPos()) { @@ -476,7 +476,7 @@ void RootElement::normalize(FormulaCursor* cursor, Direction direction) // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. SequenceElement* RootElement::getMainChild() { @@ -528,18 +528,18 @@ void RootElement::setToIndex(FormulaCursor* cursor) /** * Appends our attributes to the dom element. */ -void RootElement::writeDom(QDomElement element) +void RootElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); if(hasIndex()) { - QDomElement ind = doc.createElement("ROOTINDEX"); + TQDomElement ind = doc.createElement("ROOTINDEX"); ind.appendChild(index->getElementDom(doc)); element.appendChild(ind); } @@ -549,7 +549,7 @@ void RootElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool RootElement::readAttributesFromDom(QDomElement element) +bool RootElement::readAttributesFromDom(TQDomElement element) { return BasicElement::readAttributesFromDom(element); } @@ -559,7 +559,7 @@ bool RootElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool RootElement::readContentFromDom(QDomNode& node) +bool RootElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -592,7 +592,7 @@ bool RootElement::readContentFromDom(QDomNode& node) * Also checks whether it's a msqrt or mroot. * Returns false if it failed. */ -bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) +bool RootElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( element.tagName().lower() == "mroot" ) square = false; @@ -607,7 +607,7 @@ bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -int RootElement::readContentFromMathMLDom(QDomNode& node) +int RootElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -644,9 +644,9 @@ int RootElement::readContentFromMathMLDom(QDomNode& node) return 1; } -QString RootElement::toLatex() +TQString RootElement::toLatex() { - QString root; + TQString root; root="\\sqrt"; if(hasIndex()) { root+="["; @@ -660,7 +660,7 @@ QString RootElement::toLatex() return root; } -QString RootElement::formulaString() +TQString RootElement::formulaString() { if ( hasIndex() ) { return "(" + content->formulaString() + ")**(1.0/(" + index->formulaString() + "))"; @@ -668,7 +668,7 @@ QString RootElement::formulaString() return "sqrt(" + content->formulaString() + ")"; } -void RootElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void RootElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { content->writeMathML( doc, element, oasisFormat ); if( hasIndex() ) diff --git a/lib/kformula/rootelement.h b/lib/kformula/rootelement.h index 0d579fd8..b836228e 100644 --- a/lib/kformula/rootelement.h +++ b/lib/kformula/rootelement.h @@ -21,7 +21,7 @@ #ifndef ROOTELEMENT_H #define ROOTELEMENT_H -#include +#include #include "basicelement.h" @@ -38,7 +38,7 @@ public: //enum { contentPos, indexPos }; - RootElement(BasicElement* parent = 0); + RootElement(BasicElement* tqparent = 0); ~RootElement(); RootElement( const RootElement& ); @@ -62,11 +62,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -74,19 +74,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -121,15 +121,15 @@ public: /** * Reinserts the index if it has been removed. */ - virtual void insert(FormulaCursor*, QPtrList&, Direction); + virtual void insert(FormulaCursor*, TQPtrList&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ - virtual void remove(FormulaCursor*, QPtrList&, Direction); + virtual void remove(FormulaCursor*, TQPtrList&, Direction); /** * Moves the cursor to a normal place where new elements @@ -139,7 +139,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); SequenceElement* getRadiant() { return index; } @@ -170,16 +170,16 @@ public: ElementIndexPtr getIndex() { return ElementIndexPtr( new RootElementIndex( this ) ); } // Save&load - //virtual QDomElement getElementDom(QDomDocument *doc); - //virtual bool buildFromDom(QDomElement *elem); + //virtual TQDomElement getElementDom(TQDomDocument *doc); + //virtual bool buildFromDom(TQDomElement *elem); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -188,59 +188,59 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "ROOT"; } + virtual TQString getTagName() const { return "ROOT"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our attributes from the MathML element. * Also checks whether it's a msqrt or mroot. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - virtual QString getElementName() const { return hasIndex() ? "mroot" : "msqrt"; } - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return hasIndex() ? "mroot" : "msqrt"; } + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; class RootElementIndex : public ElementIndex { public: - RootElementIndex(RootElement* p) : parent(p) {} + RootElementIndex(RootElement* p) : tqparent(p) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToIndex(cursor, direction); } + { tqparent->moveToIndex(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToIndex(cursor); } + { tqparent->setToIndex(cursor); } virtual bool hasIndex() const - { return parent->hasIndex(); } - virtual RootElement* getElement() { return parent; } + { return tqparent->hasIndex(); } + virtual RootElement* getElement() { return tqparent; } protected: - RootElement* parent; + RootElement* tqparent; }; diff --git a/lib/kformula/scripts/bycodes.py b/lib/kformula/scripts/bycodes.py index 16d71959..f5da0ae0 100755 --- a/lib/kformula/scripts/bycodes.py +++ b/lib/kformula/scripts/bycodes.py @@ -23,35 +23,35 @@ import string import qt def decode( fd, font, line ): - begin = string.find( line, '"' ) - end = string.find( line, '"', begin + 1) - unicode = line[begin + 2:end] # Remove 'U' from string aswell + begin = string.tqfind( line, '"' ) + end = string.tqfind( line, '"', begin + 1) + tqunicode = line[begin + 2:end] # Remove 'U' from string aswell char_list = [] - separation = string.find( unicode, '-' ) + separation = string.tqfind( tqunicode, '-' ) if separation != -1: - second = unicode + second = tqunicode while separation != -1: first = second[0:separation] second = second[separation + 2:] char_list.append( string.atoi( first, 16 ) ) - separation = string.find( second, '-' ) + separation = string.tqfind( second, '-' ) if separation == -1: char_list.append( string.atoi( second, 16 ) ) else: - char_list.append( string.atoi ( unicode, 16 ) ) + char_list.append( string.atoi ( tqunicode, 16 ) ) fm = qt.QFontMetrics( qt.QFont( font ) ) in_font = True for c in char_list: if not fm.inFont( qt.QChar( c ) ): in_font = False - fd.write( unicode + ' ' + str( in_font ) + '\n') + fd.write( tqunicode + ' ' + str( in_font ) + '\n') def parse( file, font ): fd = open( file ) fd2 = open( 'mathml.list', 'w' ) line = fd.readline() while line != "": - if string.find( line, 'name' ) != -1: + if string.tqfind( line, 'name' ) != -1: decode( fd2, font, line ) line = fd.readline() diff --git a/lib/kformula/scripts/bynames.py b/lib/kformula/scripts/bynames.py index afb9ece5..50fac994 100755 --- a/lib/kformula/scripts/bynames.py +++ b/lib/kformula/scripts/bynames.py @@ -66,7 +66,7 @@ struct entityMap { return qstrcmp( name, right ) < 0; } const char* name; - const uint unicode; + const uint tqunicode; }; extern const entityMap entities[]; @@ -109,14 +109,14 @@ def name_cmp( a, b ): def parse( fr, fw ): line = fr.readline() - while line != "" and string.find( line, '
' ) == -1:
+	while line != "" and string.tqfind( line, '
' ) == -1:
 		line = fr.readline()
-	pos = string.find( line, '
' ) ### Ad-hoc detection
+	pos = string.tqfind( line, '
' ) ### Ad-hoc detection
 	if pos == -1:
 		return
 	line = line[pos + len('
'):].strip() ### Ad-hoc detection
 	entries = []
-	while line != "" and string.find( line, ',' ) != -1:
+	while line != "" and string.tqfind( line, ',' ) != -1:
 		fields = line.split(',')
 		name = fields[0].strip()
 		number = fields[1].strip()
@@ -124,7 +124,7 @@ def parse( fr, fw ):
 		# TODO: Support multicharacter entities, should also be supported by
 		# application. The best solution would probably to map to a single
 		# character provided by the font in the private area of Unicode
-		if string.find( number, '-' ) == -1:
+		if string.tqfind( number, '-' ) == -1:
 			entries.append( [name, '0x' + number[1:]] )
 		line = fr.readline().strip()
 
diff --git a/lib/kformula/scripts/oper-dict.py b/lib/kformula/scripts/oper-dict.py
index 49191ef6..a91a7971 100755
--- a/lib/kformula/scripts/oper-dict.py
+++ b/lib/kformula/scripts/oper-dict.py
@@ -190,12 +190,12 @@ def parse( fr, fw, entities ):
 				attr_list[10]: '"false"'
 				}
 			fields = line.split()
-			name = string.replace( fields[0], '&', '&' )
+			name = string.tqreplace( fields[0], '&', '&' )
 			fields.pop(0) # Remove name
 			entities_found = True
 			while True:
-				begin = string.find( name, '&' )
-				end = string.find( name, ';' )
+				begin = string.tqfind( name, '&' )
+				end = string.tqfind( name, ';' )
 				if begin == -1 or end == -1:
 					break
 				###
@@ -204,7 +204,7 @@ def parse( fr, fw, entities ):
 				# character provided by the font in the private area of Unicode
 				entity_name = name[begin + 1:end]
 				if entities.has_key( entity_name ) :
-					name = name.replace( '&' + entity_name + ';', unichr(entities[entity_name]));
+					name = name.tqreplace( '&' + entity_name + ';', unichr(entities[entity_name]));
 				else:
 					entities_found = False
 					break
diff --git a/lib/kformula/scrollview.h b/lib/kformula/scrollview.h
index 200ade2a..3ed2bbcb 100644
--- a/lib/kformula/scrollview.h
+++ b/lib/kformula/scrollview.h
@@ -2,7 +2,7 @@
 #ifndef SCROLLVIEW_H
 #define SCROLLVIEW_H
 
-#include 
+#include 
 
 #include "kformuladefs.h"
 
@@ -11,15 +11,16 @@ class KFormulaWidget;
 using namespace KFormula;
 
 
-class ScrollView : public QScrollView {
+class ScrollView : public TQScrollView {
     Q_OBJECT
+  TQ_OBJECT
 public:
     ScrollView();
 
     virtual void addChild(KFormulaWidget* c, int x=0, int y=0);
 
 protected:
-    virtual void focusInEvent(QFocusEvent* event);
+    virtual void focusInEvent(TQFocusEvent* event);
 
 protected slots:
 
diff --git a/lib/kformula/sequenceelement.cc b/lib/kformula/sequenceelement.cc
index b57125bd..eb64a13e 100644
--- a/lib/kformula/sequenceelement.cc
+++ b/lib/kformula/sequenceelement.cc
@@ -21,9 +21,9 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -72,11 +72,11 @@ void SequenceElement::setStyle( StyleElement *st )
     style = st;
 }
 
-SequenceElement::SequenceElement(BasicElement* parent)
-        : BasicElement(parent), parseTree(0), textSequence(true),singlePipe(true), style(0)
+SequenceElement::SequenceElement(BasicElement* tqparent)
+        : BasicElement(tqparent), parseTree(0), textSequence(true),singlePipe(true), style(0)
 {
     assert( creationStrategy != 0 );
-    children.setAutoDelete(true);
+    tqchildren.setAutoDelete(true);
 }
 
 
@@ -88,12 +88,12 @@ SequenceElement::~SequenceElement()
 SequenceElement::SequenceElement( const SequenceElement& other )
     : BasicElement( other )
 {
-    children.setAutoDelete(true);
-    uint count = other.children.count();
+    tqchildren.setAutoDelete(true);
+    uint count = other.tqchildren.count();
     for (uint i = 0; i < count; i++) {
-        BasicElement* child = children.at(i)->clone();
+        BasicElement* child = tqchildren.at(i)->clone();
         child->setParent( this );
-        children.append( child );
+        tqchildren.append( child );
     }
 }
 
@@ -114,25 +114,25 @@ bool SequenceElement::readOnly( const FormulaCursor* ) const
  * Returns the element the point is in.
  */
 BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled,
-                                        const LuPixelPoint& point, const LuPixelPoint& parentOrigin )
+                                        const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin )
 {
-    BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin);
+    BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin);
     if (e != 0) {
-        LuPixelPoint myPos(parentOrigin.x() + getX(),
-                           parentOrigin.y() + getY());
+        LuPixelPoint myPos(tqparentOrigin.x() + getX(),
+                           tqparentOrigin.y() + getY());
 
-        uint count = children.count();
+        uint count = tqchildren.count();
         for (uint i = 0; i < count; i++) {
-            BasicElement* child = children.at(i);
+            BasicElement* child = tqchildren.at(i);
             e = child->goToPos(cursor, handled, point, myPos);
             if (e != 0) {
                 if (!handled) {
                     handled = true;
                     if ((point.x() - myPos.x()) < (e->getX() + e->getWidth()*2/3)) {
-                        cursor->setTo(this, children.find(e));
+                        cursor->setTo(this, tqchildren.tqfind(e));
                     }
                     else {
-                        cursor->setTo(this, children.find(e)+1);
+                        cursor->setTo(this, tqchildren.tqfind(e)+1);
                     }
                 }
                 return e;
@@ -143,11 +143,11 @@ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled,
         //int dy = point.y() - myPos.y();
 
         for (uint i = 0; i < count; i++) {
-            BasicElement* child = children.at(i);
+            BasicElement* child = tqchildren.at(i);
             if (dx < child->getX()) {
                 cursor->setTo( this, i );
                 handled = true;
-                return children.at( i );
+                return tqchildren.at( i );
             }
         }
 
@@ -161,9 +161,9 @@ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled,
 
 bool SequenceElement::isEmpty()
 {
-    uint count = children.count();
+    uint count = tqchildren.count();
     for (uint i = 0; i < count; i++) {
-        BasicElement* child = children.at(i);
+        BasicElement* child = tqchildren.at(i);
         if (!child->isInvisible()) {
             return false;
         }
@@ -174,7 +174,7 @@ bool SequenceElement::isEmpty()
 
 /**
  * Calculates our width and height and
- * our children's parentPosition.
+ * our tqchildren's tqparentPosition.
  */
 void SequenceElement::calcSizes( const ContextStyle& context,
 								 ContextStyle::TextStyle tstyle,
@@ -190,7 +190,7 @@ void SequenceElement::calcSizes( const ContextStyle& context,
         width += context.ptToPixelX( getSpaceBefore( context, tstyle, factor ) );
 
         // Let's do all normal elements that have a base line.
-        QPtrListIterator it( children );
+        TQPtrListIterator it( tqchildren );
         for ( ; it.current(); ++it ) {
             BasicElement* child = it.current();
 
@@ -201,14 +201,14 @@ void SequenceElement::calcSizes( const ContextStyle& context,
 
                 luPixel childBaseline = child->getBaseline();
                 if ( childBaseline > -1 ) {
-                    toBaseline = QMAX( toBaseline, childBaseline );
-                    fromBaseline = QMAX( fromBaseline,
+                    toBaseline = TQMAX( toBaseline, childBaseline );
+                    fromBaseline = TQMAX( fromBaseline,
                                          child->getHeight() - childBaseline );
                 }
                 else {
                     luPixel bl = child->getHeight()/2 + context.axisHeight( tstyle, factor );
-                    toBaseline = QMAX( toBaseline, bl );
-                    fromBaseline = QMAX( fromBaseline, child->getHeight() - bl );
+                    toBaseline = TQMAX( toBaseline, bl );
+                    fromBaseline = TQMAX( fromBaseline, child->getHeight() - bl );
                 }
             }
             else {
@@ -237,7 +237,7 @@ void SequenceElement::calcSizes( const ContextStyle& context,
 
 void SequenceElement::setChildrenPositions()
 {
-    QPtrListIterator it( children );
+    TQPtrListIterator it( tqchildren );
     for ( ; it.current(); ++it ) {
         BasicElement* child = it.current();
         child->setY(getBaseline() - child->getBaseline());
@@ -246,25 +246,25 @@ void SequenceElement::setChildrenPositions()
 
 
 /**
- * Draws the whole element including its children.
- * The `parentOrigin' is the point this element's parent starts.
- * We can use our parentPosition to get our own origin then.
+ * Draws the whole element including its tqchildren.
+ * The `tqparentOrigin' is the point this element's tqparent starts.
+ * We can use our tqparentPosition to get our own origin then.
  */
-void SequenceElement::draw( QPainter& painter, const LuPixelRect& r,
+void SequenceElement::draw( TQPainter& painter, const LuPixelRect& r,
                             const ContextStyle& context,
                             ContextStyle::TextStyle tstyle,
                             ContextStyle::IndexStyle istyle,
                             StyleAttributes& style,
-                            const LuPixelPoint& parentOrigin )
+                            const LuPixelPoint& tqparentOrigin )
 {
-    LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() );
+    LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() );
     // There might be zero sized elements that still want to be drawn at least
     // in edit mode. (EmptyElement)
     //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
     //    return;
 
     if (!isEmpty()) {
-        QPtrListIterator it( children );
+        TQPtrListIterator it( tqchildren );
         for (int i = 0 ; it.current(); i++) {
             BasicElement* child = it.current();
             if (!child->isInvisible()) {
@@ -291,24 +291,24 @@ void SequenceElement::draw( QPainter& painter, const LuPixelRect& r,
         drawEmptyRect( painter, context, style.sizeFactor(), myPos );
     }
     // Debug
-    //painter.setPen(Qt::green);
-    //painter.drawRect(parentOrigin.x() + getX(), parentOrigin.y() + getY(),
+    //painter.setPen(TQt::green);
+    //painter.drawRect(tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY(),
     //                 getWidth(), getHeight());
-//     painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ),
-//                       context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ),
-//                       context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ),
-//                       context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ) );
-//     painter.setPen(Qt::red);
-//     painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ),
-//                       context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ),
-//                       context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ),
-//                       context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ) );
+//     painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ),
+//                       context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ),
+//                       context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ),
+//                       context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ) );
+//     painter.setPen(TQt::red);
+//     painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ),
+//                       context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ),
+//                       context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ),
+//                       context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ) );
 }
 
 
 void SequenceElement::dispatchFontCommand( FontCommand* cmd )
 {
-    QPtrListIterator it( children );
+    TQPtrListIterator it( tqchildren );
     for ( ; it.current(); ++it ) {
         BasicElement* child = it.current();
         child->dispatchFontCommand( cmd );
@@ -316,17 +316,17 @@ void SequenceElement::dispatchFontCommand( FontCommand* cmd )
 }
 
 
-void SequenceElement::drawEmptyRect( QPainter& painter, const ContextStyle& context,
+void SequenceElement::drawEmptyRect( TQPainter& painter, const ContextStyle& context,
                                      double factor, const LuPixelPoint& upperLeft )
 {
     if ( context.edit() ) {
-        painter.setBrush(Qt::NoBrush);
-        painter.setPen( QPen( context.getEmptyColor(),
-                              context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) );
-        painter.drawRect( context.layoutUnitToPixelX( upperLeft.x() ),
-                          context.layoutUnitToPixelY( upperLeft.y() ),
-                          context.layoutUnitToPixelX( getWidth() ),
-                          context.layoutUnitToPixelY( getHeight() ) );
+        painter.setBrush(TQt::NoBrush);
+        painter.setPen( TQPen( context.getEmptyColor(),
+                              context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) );
+        painter.drawRect( context.tqlayoutUnitToPixelX( upperLeft.x() ),
+                          context.tqlayoutUnitToPixelY( upperLeft.y() ),
+                          context.tqlayoutUnitToPixelX( getWidth() ),
+                          context.tqlayoutUnitToPixelY( getHeight() ) );
     }
 }
 
@@ -347,7 +347,7 @@ void SequenceElement::calcCursorSize( const ContextStyle& context,
     if ( cursor->isSelection() ) {
         uint mark = cursor->getMark();
         luPixel markX = getChildPosition( context, mark );
-        luPixel x = QMIN(posX, markX);
+        luPixel x = TQMIN(posX, markX);
         luPixel width = abs(posX - markX);
 
         if ( smallCursor ) {
@@ -377,21 +377,21 @@ void SequenceElement::calcCursorSize( const ContextStyle& context,
 /**
  * If the cursor is inside a sequence it needs to be drawn.
  */
-void SequenceElement::drawCursor( QPainter& painter, const ContextStyle& context,
+void SequenceElement::drawCursor( TQPainter& painter, const ContextStyle& context,
                                   StyleAttributes& style, FormulaCursor* cursor,
                                   bool smallCursor, bool activeCursor )
 {
-    painter.setRasterOp( Qt::XorROP );
+    painter.setRasterOp( TQt::XorROP );
     if ( cursor->isSelection() ) {
         const LuPixelRect& r = cursor->cursorSize;
-        painter.fillRect( context.layoutUnitToPixelX( r.x() ),
-                          context.layoutUnitToPixelY( r.y() ),
-                          context.layoutUnitToPixelX( r.width() ),
-                          context.layoutUnitToPixelY( r.height() ),
-                          Qt::white );
-    }
-    painter.setPen( QPen( Qt::white,
-                          context.layoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) );
+        painter.fillRect( context.tqlayoutUnitToPixelX( r.x() ),
+                          context.tqlayoutUnitToPixelY( r.y() ),
+                          context.tqlayoutUnitToPixelX( r.width() ),
+                          context.tqlayoutUnitToPixelY( r.height() ),
+                          TQt::white );
+    }
+    painter.setPen( TQPen( TQt::white,
+                          context.tqlayoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) );
     const LuPixelPoint& point = cursor->getCursorPoint();
     const LuPixelRect& size = cursor->getCursorSize();
     if ( activeCursor )
@@ -399,33 +399,33 @@ void SequenceElement::drawCursor( QPainter& painter, const ContextStyle& context
         int offset = 0;
         if ( cursor->isSelection() && cursor->getPos() > cursor->getMark() )
             offset = -1;
-        painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset,
-                          context.layoutUnitToPixelY( size.top() ),
-                          context.layoutUnitToPixelX( point.x() ) + offset,
-                          context.layoutUnitToPixelY( size.bottom() )-1 );
-        painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset + 1,
-                          context.layoutUnitToPixelY( size.top() ),
-                          context.layoutUnitToPixelX( point.x() ) + offset + 1,
-                          context.layoutUnitToPixelY( size.bottom() )-1 );
+        painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset,
+                          context.tqlayoutUnitToPixelY( size.top() ),
+                          context.tqlayoutUnitToPixelX( point.x() ) + offset,
+                          context.tqlayoutUnitToPixelY( size.bottom() )-1 );
+        painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset + 1,
+                          context.tqlayoutUnitToPixelY( size.top() ),
+                          context.tqlayoutUnitToPixelX( point.x() ) + offset + 1,
+                          context.tqlayoutUnitToPixelY( size.bottom() )-1 );
     }
     if ( !smallCursor && !cursor->isSelection() )
-        painter.drawLine( context.layoutUnitToPixelX( size.left() ),
-                          context.layoutUnitToPixelY( size.bottom() )-1,
-                          context.layoutUnitToPixelX( size.right() )-1,
-                          context.layoutUnitToPixelY( size.bottom() )-1 );
+        painter.drawLine( context.tqlayoutUnitToPixelX( size.left() ),
+                          context.tqlayoutUnitToPixelY( size.bottom() )-1,
+                          context.tqlayoutUnitToPixelX( size.right() )-1,
+                          context.tqlayoutUnitToPixelY( size.bottom() )-1 );
     // This might be wrong but probably isn't.
-    painter.setRasterOp( Qt::CopyROP );
+    painter.setRasterOp( TQt::CopyROP );
 }
 
 
 luPixel SequenceElement::getChildPosition( const ContextStyle& context, uint child )
 {
-    if (child < children.count()) {
-        return children.at(child)->getX();
+    if (child < tqchildren.count()) {
+        return tqchildren.at(child)->getX();
     }
     else {
-        if (children.count() > 0) {
-            return children.at(child-1)->getX() + children.at(child-1)->getWidth();
+        if (tqchildren.count() > 0) {
+            return tqchildren.at(child-1)->getX() + tqchildren.at(child-1)->getWidth();
         }
         else {
             return context.ptToLayoutUnitPixX( 2 );
@@ -449,11 +449,11 @@ luPixel SequenceElement::getChildPosition( const ContextStyle& context, uint chi
  */
 void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from)
 {
-    // Our parent asks us for a cursor position. Found.
+    // Our tqparent asks us for a cursor position. Found.
     if (from == getParent()) {
-        cursor->setTo(this, children.count());
+        cursor->setTo(this, tqchildren.count());
         if ( cursor->isSelectionMode() ) {
-            cursor->setMark( children.count() );
+            cursor->setMark( tqchildren.count() );
         }
         from->entered( this );
     }
@@ -464,7 +464,7 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from)
             cursor->setTo(this, cursor->getPos()-1);
 
             // invisible elements are not visible so we move on.
-            if (children.at(cursor->getPos())->isInvisible()) {
+            if (tqchildren.at(cursor->getPos())->isInvisible()) {
                 moveLeft(cursor, this);
             }
         }
@@ -479,12 +479,12 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from)
         }
     }
 
-    // The cursor came from one of our children or
+    // The cursor came from one of our tqchildren or
     // something is wrong.
     else {
-        int fromPos = children.find(from);
+        int fromPos = tqchildren.tqfind(from);
         if ( fromPos > 0 ) {
-            children.at( fromPos - 1)->moveLeft( cursor, this );
+            tqchildren.at( fromPos - 1)->moveLeft( cursor, this );
         }
 
         // invisible elements are not visible so we move on.
@@ -502,7 +502,7 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from)
  */
 void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from)
 {
-    // Our parent asks us for a cursor position. Found.
+    // Our tqparent asks us for a cursor position. Found.
     if (from == getParent()) {
         cursor->setTo(this, 0);
         from->entered( this );
@@ -511,11 +511,11 @@ void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from)
     // We already owned the cursor. Ask next child then.
     else if (from == this) {
         uint pos = cursor->getPos();
-        if (pos < children.count()) {
+        if (pos < tqchildren.count()) {
             cursor->setTo(this, pos+1);
             
             // invisible elements are not visible so we move on.
-            if (children.at(pos)->isInvisible()) {
+            if (tqchildren.at(pos)->isInvisible()) {
                 moveRight(cursor, this);
             }
         }
@@ -530,12 +530,12 @@ void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from)
         }
     }
 
-    // The cursor came from one of our children or
+    // The cursor came from one of our tqchildren or
     // something is wrong.
     else {
-        int fromPos = children.find(from);
-        if ( fromPos < children.count() - 1 ) {
-            children.at( fromPos + 1 )->moveDown( cursor, this );
+        int fromPos = tqchildren.tqfind(from);
+        if ( fromPos < tqchildren.count() - 1 ) {
+            tqchildren.at( fromPos + 1 )->moveDown( cursor, this );
         }
         else {
             cursor->setTo(this, fromPos+1);
@@ -557,7 +557,7 @@ void SequenceElement::moveWordLeft(FormulaCursor* cursor)
 {
     uint pos = cursor->getPos();
     if (pos > 0) {
-        ElementType* type = children.at(pos-1)->getElementType();
+        ElementType* type = tqchildren.at(pos-1)->getElementType();
         if (type != 0) {
             cursor->setTo(this, type->start());
         }
@@ -571,8 +571,8 @@ void SequenceElement::moveWordLeft(FormulaCursor* cursor)
 void SequenceElement::moveWordRight(FormulaCursor* cursor)
 {
     uint pos = cursor->getPos();
-    if (pos < children.count()) {
-        ElementType* type = children.at(pos)->getElementType();
+    if (pos < tqchildren.count()) {
+        ElementType* type = tqchildren.at(pos)->getElementType();
         if (type != 0) {
             cursor->setTo(this, type->end());
         }
@@ -596,7 +596,7 @@ void SequenceElement::moveUp(FormulaCursor* cursor, BasicElement* from)
     else if ( from == this ) {
         if ( getParent() != 0 ) {
             uint pos = cursor->getPos();
-            if ( pos < (children.count() - 1) / 2 ) {
+            if ( pos < (tqchildren.count() - 1) / 2 ) {
                 getParent()->moveLeft( cursor, this );
             }
             else {
@@ -630,8 +630,8 @@ void SequenceElement::moveDown(FormulaCursor* cursor, BasicElement* from)
     }
     else if (from == this) {
         uint pos = cursor->getPos();
-        if (pos < children.count()) {
-                children.at(pos)->moveDown(cursor, this);
+        if (pos < tqchildren.count()) {
+                tqchildren.at(pos)->moveDown(cursor, this);
         }
     }
     else {
@@ -639,7 +639,7 @@ void SequenceElement::moveDown(FormulaCursor* cursor, BasicElement* from)
             getParent()->moveDown(cursor, this);
         }
         else {
-            cursor->setTo( this, children.count() );
+            cursor->setTo( this, tqchildren.count() );
             from->entered( this );
 //            formula()->moveOutBelow( cursor );
         }
@@ -658,7 +658,7 @@ void SequenceElement::moveHome(FormulaCursor* cursor)
             while (element->getParent() != this) {
                 element = element->getParent();
             }
-            cursor->setMark(children.find(element)+1);
+            cursor->setMark(tqchildren.tqfind(element)+1);
         }
     }
     cursor->setTo(this, 0);
@@ -676,16 +676,16 @@ void SequenceElement::moveEnd(FormulaCursor* cursor)
             while (element->getParent() != this) {
                 element = element->getParent();
                 if (element == 0) {
-                    cursor->setMark(children.count());
+                    cursor->setMark(tqchildren.count());
                     break;
                 }
             }
             if (element != 0) {
-                cursor->setMark(children.find(element));
+                cursor->setMark(tqchildren.tqfind(element));
             }
         }
     }
-    cursor->setTo(this, children.count());
+    cursor->setTo(this, tqchildren.count());
 }
 
 /**
@@ -705,11 +705,11 @@ void SequenceElement::goInside(FormulaCursor* cursor)
 void SequenceElement::goInsideLast(FormulaCursor* cursor)
 {
     cursor->setSelection(false);
-    cursor->setTo(this, children.count());
+    cursor->setTo(this, tqchildren.count());
 }
 
 
-// children
+// tqchildren
 
     /**
      * Insert a new child in the sequence
@@ -723,7 +723,7 @@ void SequenceElement::goInsideLast(FormulaCursor* cursor)
 
 bool SequenceElement::insert( uint index, BasicElement *child )
 {
-    return children.insert( index, child );
+    return tqchildren.insert( index, child );
 }
 
 /**
@@ -735,14 +735,14 @@ bool SequenceElement::insert( uint index, BasicElement *child )
  */
 // void SequenceElement::removeChild(FormulaCursor* cursor, BasicElement* child)
 // {
-//     int pos = children.find(child);
+//     int pos = tqchildren.tqfind(child);
 //     formula()->elementRemoval(child, pos);
 //     cursor->setTo(this, pos);
-//     children.remove(pos);
+//     tqchildren.remove(pos);
 //     /*
-//         if len(self.children) == 0:
-//             if self.parent != None:
-//                 self.parent.removeChild(cursor, self)
+//         if len(self.tqchildren) == 0:
+//             if self.tqparent != None:
+//                 self.tqparent.removeChild(cursor, self)
 //                 return
 //     */
 //     formula()->changed();
@@ -750,14 +750,14 @@ bool SequenceElement::insert( uint index, BasicElement *child )
 
 
 /**
- * Inserts all new children at the cursor position. Places the
+ * Inserts all new tqchildren at the cursor position. Places the
  * cursor according to the direction. The inserted elements will
  * be selected.
  *
  * The list will be emptied but stays the property of the caller.
  */
 void SequenceElement::insert(FormulaCursor* cursor,
-                             QPtrList& newChildren,
+                             TQPtrList& newChildren,
                              Direction direction)
 {
     int pos = cursor->getPos();
@@ -765,7 +765,7 @@ void SequenceElement::insert(FormulaCursor* cursor,
     for (uint i = 0; i < count; i++) {
         BasicElement* child = newChildren.take(0);
         child->setParent(this);
-        children.insert(pos+i, child);
+        tqchildren.insert(pos+i, child);
     }
     if (direction == beforeCursor) {
         cursor->setTo(this, pos+count, pos);
@@ -780,13 +780,13 @@ void SequenceElement::insert(FormulaCursor* cursor,
 
 
 /**
- * Removes all selected children and returns them. Places the
- * cursor to where the children have been.
+ * Removes all selected tqchildren and returns them. Places the
+ * cursor to where the tqchildren have been.
  *
  * The ownership of the list is passed to the caller.
  */
 void SequenceElement::remove(FormulaCursor* cursor,
-                             QPtrList& removedChildren,
+                             TQPtrList& removedChildren,
                              Direction direction)
 {
     if (cursor->isSelection()) {
@@ -803,9 +803,9 @@ void SequenceElement::remove(FormulaCursor* cursor,
             int pos = cursor->getPos() - 1;
             if (pos >= 0) {
                 while (pos >= 0) {
-                    BasicElement* child = children.at(pos);
+                    BasicElement* child = tqchildren.at(pos);
                     formula()->elementRemoval(child);
-                    children.take(pos);
+                    tqchildren.take(pos);
                     removedChildren.prepend(child);
                     if (!child->isInvisible()) {
                         break;
@@ -818,11 +818,11 @@ void SequenceElement::remove(FormulaCursor* cursor,
         }
         else {
             uint pos = cursor->getPos();
-            if (pos < children.count()) {
-                while (pos < children.count()) {
-                    BasicElement* child = children.at(pos);
+            if (pos < tqchildren.count()) {
+                while (pos < tqchildren.count()) {
+                    BasicElement* child = tqchildren.at(pos);
                     formula()->elementRemoval(child);
-                    children.take(pos);
+                    tqchildren.take(pos);
                     removedChildren.append(child);
                     if (!child->isInvisible()) {
                         break;
@@ -841,13 +841,13 @@ void SequenceElement::remove(FormulaCursor* cursor,
 
 
 /**
- * Removes the children at pos and appends it to the list.
+ * Removes the tqchildren at pos and appends it to the list.
  */
-void SequenceElement::removeChild(QPtrList& removedChildren, int pos)
+void SequenceElement::removeChild(TQPtrList& removedChildren, int pos)
 {
-    BasicElement* child = children.at(pos);
+    BasicElement* child = tqchildren.at(pos);
     formula()->elementRemoval(child);
-    children.take(pos);
+    tqchildren.take(pos);
     removedChildren.append(child);
     //cerr << *removedChildren.at(0) << endl;
     formula()->changed();
@@ -872,12 +872,12 @@ BasicElement* SequenceElement::getChild( FormulaCursor* cursor, Direction direct
 {
     if ( direction == beforeCursor ) {
         if ( cursor->getPos() > 0 ) {
-            return children.at( cursor->getPos() - 1 );
+            return tqchildren.at( cursor->getPos() - 1 );
         }
     }
     else {
-        if ( cursor->getPos() < qRound( children.count() ) ) {
-            return children.at( cursor->getPos() );
+        if ( cursor->getPos() < tqRound( tqchildren.count() ) ) {
+            return tqchildren.at( cursor->getPos() );
         }
     }
     return 0;
@@ -890,7 +890,7 @@ BasicElement* SequenceElement::getChild( FormulaCursor* cursor, Direction direct
  */
 void SequenceElement::selectChild(FormulaCursor* cursor, BasicElement* child)
 {
-    int pos = children.find(child);
+    int pos = tqchildren.tqfind(child);
     if (pos > -1) {
         cursor->setTo(this, pos+1, pos);
     }
@@ -898,7 +898,7 @@ void SequenceElement::selectChild(FormulaCursor* cursor, BasicElement* child)
 
 void SequenceElement::childWillVanish(FormulaCursor* cursor, BasicElement* child)
 {
-    int childPos = children.find(child);
+    int childPos = tqchildren.tqfind(child);
     if (childPos > -1) {
         int pos = cursor->getPos();
         if (pos > childPos) {
@@ -914,21 +914,21 @@ void SequenceElement::childWillVanish(FormulaCursor* cursor, BasicElement* child
 
 
 /**
- * Selects all children. The cursor is put behind, the mark before them.
+ * Selects all tqchildren. The cursor is put behind, the mark before them.
  */
 void SequenceElement::selectAllChildren(FormulaCursor* cursor)
 {
-    cursor->setTo(this, children.count(), 0);
+    cursor->setTo(this, tqchildren.count(), 0);
 }
 
 bool SequenceElement::onlyTextSelected( FormulaCursor* cursor )
 {
     if ( cursor->isSelection() ) {
-        uint from = QMIN( cursor->getPos(), cursor->getMark() );
-        uint to = QMAX( cursor->getPos(), cursor->getMark() );
+        uint from = TQMIN( cursor->getPos(), cursor->getMark() );
+        uint to = TQMAX( cursor->getPos(), cursor->getMark() );
         for ( uint i = from; i < to; i++ ) {
             BasicElement* element = getChild( i );
-            if ( element->getCharacter() == QChar::null ) {
+            if ( element->getCharacter() == TQChar::null ) {
                 return false;
             }
         }
@@ -1116,7 +1116,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
     case req_addIndex: {
         if ( cursor->getPos() > 0 && !cursor->isSelection() ) {
             IndexElement* element =
-                dynamic_cast( children.at( cursor->getPos()-1 ) );
+                dynamic_cast( tqchildren.at( cursor->getPos()-1 ) );
             if ( element != 0 ) {
                 element->goInside( cursor );
                 return element->buildCommand( container, request );
@@ -1182,9 +1182,9 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
         if ((element != 0) && !element->isSymbol()) {
             cursor->selectActiveElement();
             const SymbolTable& table = container->document()->getSymbolTable();
-            if (table.greekLetters().find(element->getCharacter()) != -1) {
+            if (table.greekLetters().tqfind(element->getCharacter()) != -1) {
                 KFCReplace* command = new KFCReplace( i18n( "Change Char to Symbol" ), container );
-                TextElement* symbol = creationStrategy->createTextElement( table.unicodeFromSymbolFont( element->getCharacter() ), true );
+                TextElement* symbol = creationStrategy->createTextElement( table.tqunicodeFromSymbolFont( element->getCharacter() ), true );
                 command->addElement( symbol );
                 return command;
             }
@@ -1206,7 +1206,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
             CharStyleCommand* cmd = new CharStyleCommand( cs, i18n( "Change Char Style" ), container );
             int end = cursor->getSelectionEnd();
             for ( int i = cursor->getSelectionStart(); iaddElement( children.at( i ) );
+                cmd->addElement( tqchildren.at( i ) );
             }
             return cmd;
         }
@@ -1219,7 +1219,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
             CharFamilyCommand* cmd = new CharFamilyCommand( cf, i18n( "Change Char Family" ), container );
             int end = cursor->getSelectionEnd();
             for ( int i = cursor->getSelectionStart(); iaddElement( children.at( i ) );
+                cmd->addElement( tqchildren.at( i ) );
             }
             return cmd;
         }
@@ -1232,9 +1232,9 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
 }
 
 
-KCommand* SequenceElement::input( Container* container, QKeyEvent* event )
+KCommand* SequenceElement::input( Container* container, TQKeyEvent* event )
 {
-    QChar ch = event->text().at( 0 );
+    TQChar ch = event->text().at( 0 );
     if ( ch.isPrint() ) {
         return input( container, ch );
     }
@@ -1244,58 +1244,58 @@ KCommand* SequenceElement::input( Container* container, QKeyEvent* event )
         MoveFlag flag = movementFlag(state);
 
 	switch ( action ) {
-        case Qt::Key_BackSpace: {
+        case TQt::Key_BackSpace: {
             DirectedRemove r( req_remove, beforeCursor );
             return buildCommand( container, &r );
         }
-        case Qt::Key_Delete: {
+        case TQt::Key_Delete: {
             DirectedRemove r( req_remove, afterCursor );
             return buildCommand( container, &r );
         }
-	case Qt::Key_Left: {
+	case TQt::Key_Left: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveLeft( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
-        case Qt::Key_Right: {
+        case TQt::Key_Right: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveRight( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
-        case Qt::Key_Up: {
+        case TQt::Key_Up: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveUp( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
-        case Qt::Key_Down: {
+        case TQt::Key_Down: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveDown( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
-        case Qt::Key_Home: {
+        case TQt::Key_Home: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveHome( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
-        case Qt::Key_End: {
+        case TQt::Key_End: {
             FormulaCursor* cursor = container->activeCursor();
             cursor->moveEnd( flag );
             formula()->cursorHasMoved( cursor );
             break;
         }
         default:
-            if ( state & Qt::ControlButton ) {
+            if ( state & TQt::ControlButton ) {
                 switch ( event->key() ) {
-                case Qt::Key_AsciiCircum: {
+                case TQt::Key_AsciiCircum: {
                     IndexRequest r( upperLeftPos );
                     return buildCommand( container, &r );
                 }
-                case Qt::Key_Underscore: {
+                case TQt::Key_Underscore: {
                     IndexRequest r( lowerLeftPos );
                     return buildCommand( container, &r );
                 }
@@ -1309,10 +1309,10 @@ KCommand* SequenceElement::input( Container* container, QKeyEvent* event )
 }
 
 
-KCommand* SequenceElement::input( Container* container, QChar ch )
+KCommand* SequenceElement::input( Container* container, TQChar ch )
 {
-    int unicode = ch.unicode();
-    switch (unicode) {
+    int tqunicode = ch.tqunicode();
+    switch (tqunicode) {
     case '(': {
         BracketRequest r( container->document()->leftBracketChar(),
                           container->document()->rightBracketChar() );
@@ -1397,25 +1397,25 @@ KCommand* SequenceElement::input( Container* container, QChar ch )
 }
 
 /**
- * Stores the given childrens dom in the element.
+ * Stores the given tqchildrens dom in the element.
  */
-void SequenceElement::getChildrenDom( QDomDocument& doc, QDomElement elem,
+void SequenceElement::getChildrenDom( TQDomDocument& doc, TQDomElement elem,
                                      uint from, uint to)
 {
     for (uint i = from; i < to; i++) {
-        QDomElement tmpEleDom=children.at(i)->getElementDom(doc);
+        TQDomElement tmpEleDom=tqchildren.at(i)->getElementDom(doc);
         elem.appendChild(tmpEleDom);
     }
 }
 
 /**
- * Stores the given childrens MathML dom in the element.
+ * Stores the given tqchildrens MathML dom in the element.
  */
-void SequenceElement::getChildrenMathMLDom( QDomDocument& doc, QDomNode& parent,
+void SequenceElement::getChildrenMathMLDom( TQDomDocument& doc, TQDomNode& tqparent,
                                             uint from, uint to)
 {
     for ( uint i = from; i < to; i++ ) {
-        children.at( i )->writeMathML( doc, parent, false );
+        tqchildren.at( i )->writeMathML( doc, tqparent, false );
     }
 }
 
@@ -1425,13 +1425,13 @@ void SequenceElement::getChildrenMathMLDom( QDomDocument& doc, QDomNode& parent,
  * puts them into the list.
  * Returns false if an error occures.
  */
-bool SequenceElement::buildChildrenFromDom(QPtrList& list, QDomNode n)
+bool SequenceElement::buildChildrenFromDom(TQPtrList& list, TQDomNode n)
 {
     while (!n.isNull()) {
         if (n.isElement()) {
-            QDomElement e = n.toElement();
+            TQDomElement e = n.toElement();
             BasicElement* child = 0;
-            QString tag = e.tagName().upper();
+            TQString tag = e.tagName().upper();
 
             child = createElement(tag, e);
             if (child != 0) {
@@ -1455,7 +1455,7 @@ bool SequenceElement::buildChildrenFromDom(QPtrList& list, QDomNod
 }
 
 
-BasicElement* SequenceElement::createElement( QString type, const QDomElement& element )
+BasicElement* SequenceElement::createElement( TQString type, const TQDomElement& element )
 {
     return creationStrategy->createElement( type, element );
 }
@@ -1463,12 +1463,12 @@ BasicElement* SequenceElement::createElement( QString type, const QDomElement& e
 /**
  * Appends our attributes to the dom element.
  */
-void SequenceElement::writeDom(QDomElement element)
+void SequenceElement::writeDom(TQDomElement element)
 {
     BasicElement::writeDom(element);
 
-    uint count = children.count();
-    QDomDocument doc = element.ownerDocument();
+    uint count = tqchildren.count();
+    TQDomDocument doc = element.ownerDocument();
     getChildrenDom(doc, element, 0, count);
 }
 
@@ -1476,7 +1476,7 @@ void SequenceElement::writeDom(QDomElement element)
  * Reads our attributes from the element.
  * Returns false if it failed.
  */
-bool SequenceElement::readAttributesFromDom(QDomElement element)
+bool SequenceElement::readAttributesFromDom(TQDomElement element)
 {
     if (!BasicElement::readAttributesFromDom(element)) {
         return false;
@@ -1489,13 +1489,13 @@ bool SequenceElement::readAttributesFromDom(QDomElement element)
  * that needs to be read.
  * Returns false if it failed.
  */
-bool SequenceElement::readContentFromDom(QDomNode& node)
+bool SequenceElement::readContentFromDom(TQDomNode& node)
 {
     if (!BasicElement::readContentFromDom(node)) {
         return false;
     }
 
-    return buildChildrenFromDom(children, node);
+    return buildChildrenFromDom(tqchildren, node);
 }
 
 
@@ -1504,9 +1504,9 @@ void SequenceElement::parse()
     delete parseTree;
 
     textSequence = true;
-    for (BasicElement* element = children.first();
+    for (BasicElement* element = tqchildren.first();
          element != 0;
-         element = children.next()) {
+         element = tqchildren.next()) {
 
         // Those types are gone. Make sure they won't
         // be used.
@@ -1519,10 +1519,10 @@ void SequenceElement::parse()
 
     const SymbolTable& symbols = formula()->getSymbolTable();
     SequenceParser parser(symbols);
-    parseTree = parser.parse(children);
+    parseTree = parser.parse(tqchildren);
 
     // With the IndexElement dynamically changing its text/non-text
-    // behaviour we need to reparse your parent, too. Hacky!
+    // behaviour we need to reparse your tqparent, too. Hacky!
     BasicElement* p = getParent();
     if ( p != 0 ) {
         SequenceElement* seq = dynamic_cast( p->getParent() );
@@ -1541,12 +1541,12 @@ bool SequenceElement::isFirstOfToken( BasicElement* child )
 }
 
 
-QString SequenceElement::toLatex()
+TQString SequenceElement::toLatex()
 {
-    QString content;
-    uint count = children.count();
+    TQString content;
+    uint count = tqchildren.count();
     for ( uint i = 0; i < count; i++ ) {
-        BasicElement* child = children.at( i );
+        BasicElement* child = tqchildren.at( i );
 //         if ( isFirstOfToken( child ) ) {
 //             content += "";
 //         }
@@ -1556,12 +1556,12 @@ QString SequenceElement::toLatex()
 }
 
 
-QString SequenceElement::formulaString()
+TQString SequenceElement::formulaString()
 {
-    QString content;
-    uint count = children.count();
+    TQString content;
+    uint count = tqchildren.count();
     for ( uint i = 0; i < count; i++ ) {
-        BasicElement* child = children.at( i );
+        BasicElement* child = tqchildren.at( i );
         //if ( isFirstOfToken( child ) ) {
         //    content += " ";
         //}
@@ -1571,9 +1571,9 @@ QString SequenceElement::formulaString()
 }
 
 
-void SequenceElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const
+void SequenceElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const
 {
-    for ( QPtrListIterator it( children ); it.current(); ++it ) {
+    for ( TQPtrListIterator it( tqchildren ); it.current(); ++it ) {
         it.current()->writeMathML( doc, element, oasisFormat );
     }
 }
@@ -1581,7 +1581,7 @@ void SequenceElement::writeMathMLContent( QDomDocument& doc, QDomElement& elemen
 
 const BasicElement* SequenceElement::getChild( uint i ) const
 {
-    QPtrListIterator it( children );
+    TQPtrListIterator it( tqchildren );
     it += i;
     return it.current();
 }
@@ -1589,7 +1589,7 @@ const BasicElement* SequenceElement::getChild( uint i ) const
 
 int SequenceElement::childPos( const BasicElement* child ) const
 {
-    QPtrListIterator it( children );
+    TQPtrListIterator it( tqchildren );
     uint count = it.count();
     for ( uint i=0; i" )    return new SpaceElement( MEDIUM );
     if ( name == ";" )    return new SpaceElement( THICK );
-    if ( name == "quad" ) return new SpaceElement( QUAD );
+    if ( name == "quad" ) return new SpaceElement( TQUAD );
 
     if ( name == "frac" ) return new FractionElement();
     if ( name == "atop" ) {
@@ -1774,7 +1774,7 @@ BasicElement* NameSequence::replaceElement( const SymbolTable& table )
     return 0;
 }
 
-BasicElement* NameSequence::createElement( QString type )
+BasicElement* NameSequence::createElement( TQString type )
 {
     if      ( type == "TEXT" )         return new TextElement();
     return 0;
@@ -1782,16 +1782,16 @@ BasicElement* NameSequence::createElement( QString type )
 
 // void NameSequence::parse()
 // {
-//     // A name sequence is known as name and so are its children.
+//     // A name sequence is known as name and so are its tqchildren.
 //     // Caution: this is fake!
 //     for ( int i = 0; i < countChildren(); i++ ) {
 //         getChild( i )->setElementType( getElementType() );
 //     }
 // }
 
-QString NameSequence::buildName()
+TQString NameSequence::buildName()
 {
-    QString name;
+    TQString name;
     for ( uint i = 0; i < countChildren(); i++ ) {
         name += getChild( i )->getCharacter();
     }
@@ -1807,18 +1807,18 @@ bool NameSequence::isValidSelection( FormulaCursor* cursor )
     return sequence->onlyTextSelected( cursor );
 }
 
-int SequenceElement::buildChildrenFromMathMLDom(QPtrList& list, QDomNode n) 
+int SequenceElement::buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n) 
 {
     while (!n.isNull()) {
         int nodeNumber = 1;
         if (n.isElement()) {
-            QDomElement e = n.toElement();
+            TQDomElement e = n.toElement();
             BasicElement* child = 0;
-            QString tag = e.tagName().lower();
+            TQString tag = e.tagName().lower();
 
 			kdDebug( DEBUGID ) << "Sequence Tag: " << tag << endl;
             if ( tag == "semantics" ) { // Special case, just pick the first child
-                QDomNode node = e.firstChild();
+                TQDomNode node = e.firstChild();
                 while( ! node.isElement() ) {
                     node = node.nextSibling();
                     if ( node.isNull() ) {
@@ -1885,16 +1885,16 @@ int SequenceElement::buildChildrenFromMathMLDom(QPtrList& list, QD
 
 /**
  */
-int SequenceElement::readContentFromMathMLDom(QDomNode& node)
+int SequenceElement::readContentFromMathMLDom(TQDomNode& node)
 {
     if ( BasicElement::readContentFromMathMLDom(node) == -1 ) {
         return -1;
     }
 
-    return buildChildrenFromMathMLDom(children, node);
+    return buildChildrenFromMathMLDom(tqchildren, node);
 }
 
-int SequenceElement::buildMathMLChild( QDomNode node )
+int SequenceElement::buildMathMLChild( TQDomNode node )
 {
     int nodeCounter = 1;
     while ( ! node.isElement() ) {
@@ -1904,9 +1904,9 @@ int SequenceElement::buildMathMLChild( QDomNode node )
             return -1;
         }
     }
-    QDomElement e = node.toElement();
+    TQDomElement e = node.toElement();
     BasicElement* child = 0;
-    QString tag = e.tagName().lower();
+    TQString tag = e.tagName().lower();
 
     child = creationStrategy->createElement(tag, e);
     if (child != 0) {
@@ -1915,7 +1915,7 @@ int SequenceElement::buildMathMLChild( QDomNode node )
             child->setStyle(style);
         }
         if (child->buildFromMathMLDom(e) != -1) {
-            children.append(child);
+            tqchildren.append(child);
         }
         else {
             delete child;
diff --git a/lib/kformula/sequenceelement.h b/lib/kformula/sequenceelement.h
index 9bc3c500..167c1ae3 100644
--- a/lib/kformula/sequenceelement.h
+++ b/lib/kformula/sequenceelement.h
@@ -21,12 +21,12 @@
 #ifndef SEQUENCEELEMENT_H
 #define SEQUENCEELEMENT_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "basicelement.h"
 
-class QKeyEvent;
+class TQKeyEvent;
 
 KFORMULA_NAMESPACE_BEGIN
 
@@ -34,14 +34,14 @@ class SymbolTable;
 class ElementCreationStrategy;
 
 /**
- * The element that contains a number of children.
- * The children are aligned in one line.
+ * The element that contains a number of tqchildren.
+ * The tqchildren are aligned in one line.
  */
 class SequenceElement : public BasicElement {
     SequenceElement& operator=( const SequenceElement& ) { return *this; }
 public:
 
-    SequenceElement(BasicElement* parent = 0);
+    SequenceElement(BasicElement* tqparent = 0);
     ~SequenceElement();
 
     SequenceElement( const SequenceElement& );
@@ -70,7 +70,7 @@ public:
      */
     virtual BasicElement* goToPos( FormulaCursor*, bool& handled,
                                    const LuPixelPoint& point,
-                                   const LuPixelPoint& parentOrigin );
+                                   const LuPixelPoint& tqparentOrigin );
 
     // drawing
     //
@@ -92,7 +92,7 @@ public:
 
     /**
      * Calculates our width and height and
-     * our children's parentPosition.
+     * our tqchildren's tqparentPosition.
      */
     virtual void calcSizes( const ContextStyle& cstyle,
 						    ContextStyle::TextStyle tstyle,
@@ -100,23 +100,23 @@ public:
 							StyleAttributes& style );
 
     /**
-     * Draws the whole element including its children.
-     * The `parentOrigin' is the point this element's parent starts.
-     * We can use our parentPosition to get our own origin then.
+     * Draws the whole element including its tqchildren.
+     * The `tqparentOrigin' is the point this element's tqparent starts.
+     * We can use our tqparentPosition to get our own origin then.
      */
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
 					   StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
     /**
-     * Dispatch this FontCommand to all our TextElement children.
+     * Dispatch this FontCommand to all our TextElement tqchildren.
      */
     virtual void dispatchFontCommand( FontCommand* cmd );
 
-    virtual void drawEmptyRect( QPainter& painter, const ContextStyle& context,
+    virtual void drawEmptyRect( TQPainter& painter, const ContextStyle& context,
 								double factor, const LuPixelPoint& upperLeft );
 
     virtual void calcCursorSize( const ContextStyle& context,
@@ -125,7 +125,7 @@ public:
     /**
      * If the cursor is inside a sequence it needs to be drawn.
      */
-    virtual void drawCursor( QPainter& painter, const ContextStyle& context,
+    virtual void drawCursor( TQPainter& painter, const ContextStyle& context,
 							 StyleAttributes& style, FormulaCursor* cursor,
 							 bool smallCursor, bool activeCursor );
 
@@ -202,22 +202,22 @@ public:
     virtual void goInsideLast(FormulaCursor* cursor);
 
 
-    // children
+    // tqchildren
 
     /**
-     * Inserts all new children at the cursor position. Places the
+     * Inserts all new tqchildren at the cursor position. Places the
      * cursor according to the direction. The inserted elements will
      * be selected.
      *
      * The list will be emptied but stays the property of the caller.
      */
-    virtual void insert(FormulaCursor*, QPtrList&, Direction);
+    virtual void insert(FormulaCursor*, TQPtrList&, Direction);
 
     /**
-     * Removes all selected children and returns them. Places the
-     * cursor to where the children have been.
+     * Removes all selected tqchildren and returns them. Places the
+     * cursor to where the tqchildren have been.
      */
-    virtual void remove(FormulaCursor*, QPtrList&, Direction);
+    virtual void remove(FormulaCursor*, TQPtrList&, Direction);
 
     /**
      * Moves the cursor to a normal place where new elements
@@ -244,18 +244,18 @@ public:
     virtual void childWillVanish(FormulaCursor* cursor, BasicElement* child);
 
     /**
-     * @returns the number of children we have.
+     * @returns the number of tqchildren we have.
      */
-    uint countChildren() const { return children.count(); }
+    uint countChildren() const { return tqchildren.count(); }
 
     /**
      * @returns whether the child has the given number.
      */
     bool isChildNumber( uint pos, BasicElement* child )
-        { return children.at( pos ) == child; }
+        { return tqchildren.at( pos ) == child; }
 
     /**
-     * Selects all children. The cursor is put behind, the mark before them.
+     * Selects all tqchildren. The cursor is put behind, the mark before them.
      */
     void selectAllChildren(FormulaCursor* cursor);
 
@@ -278,8 +278,8 @@ public:
      * new elements because it owns the undo stack. But only the
      * sequence knows what chars are allowed.
      */
-    virtual KCommand* input( Container* container, QChar ch );
-    virtual KCommand* input( Container* container, QKeyEvent* event );
+    virtual KCommand* input( Container* container, TQChar ch );
+    virtual KCommand* input( Container* container, TQKeyEvent* event );
 
     /**
      * Parses the sequence and generates a new syntax tree.
@@ -288,37 +288,37 @@ public:
     virtual void parse();
 
     /**
-     * Stores the given childrens dom in the element.
+     * Stores the given tqchildrens dom in the element.
      */
-    void getChildrenDom( QDomDocument& doc, QDomElement elem, uint from, uint to);
+    void getChildrenDom( TQDomDocument& doc, TQDomElement elem, uint from, uint to);
 
     /**
-     * Stores the given childrens MathML dom in the element.
+     * Stores the given tqchildrens MathML dom in the element.
      */
-    void getChildrenMathMLDom( QDomDocument& doc, QDomNode& elem, uint from, uint to );
+    void getChildrenMathMLDom( TQDomDocument& doc, TQDomNode& elem, uint from, uint to );
 
     /**
      * Builds elements from the given node and its siblings and
      * puts them into the list.
      * Returns false if an error occures.
      */
-    bool buildChildrenFromDom(QPtrList& list, QDomNode n);
+    bool buildChildrenFromDom(TQPtrList& list, TQDomNode n);
 
     /**
      * @returns the latex representation of the element and
-     * of the element's children
+     * of the element's tqchildren
      */
-    virtual QString toLatex();
+    virtual TQString toLatex();
 
-    virtual QString formulaString();
+    virtual TQString formulaString();
 
     /**
      * @returns the child at position i.
      */
-    BasicElement* getChild(uint i) { return children.at(i); }
+    BasicElement* getChild(uint i) { return tqchildren.at(i); }
     const BasicElement* getChild(uint i) const;
 
-    int childPos( BasicElement* child ) { return children.find( child ); }
+    int childPos( BasicElement* child ) { return tqchildren.tqfind( child ); }
     int childPos( const BasicElement* child ) const;
 
     class ChildIterator {
@@ -371,9 +371,9 @@ public:
     static void setCreationStrategy( ElementCreationStrategy* strategy );
 
 	virtual void setStyle(StyleElement *style);
-	virtual int buildChildrenFromMathMLDom(QPtrList& list, QDomNode n);
-	virtual int readContentFromMathMLDom(QDomNode& node);
-	int buildMathMLChild( QDomNode node );
+	virtual int buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n);
+	virtual int readContentFromMathMLDom(TQDomNode& node);
+	int buildMathMLChild( TQDomNode node );
 
 protected:
 
@@ -382,32 +382,32 @@ protected:
     /**
      * Returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "SEQUENCE"; }
+    virtual TQString getTagName() const { return "SEQUENCE"; }
 
     /**
      * Appends our attributes to the dom element.
      */
-    virtual void writeDom(QDomElement element);
+    virtual void writeDom(TQDomElement element);
 
-    virtual QString getElementName() const { return "mrow"; }
-    virtual void writeMathMLContent( QDomDocument& doc, 
-                                     QDomElement& element,
+    virtual TQString getElementName() const { return "mrow"; }
+    virtual void writeMathMLContent( TQDomDocument& doc, 
+                                     TQDomElement& element,
                                      bool oasisFormat ) const;
     /**
      * Reads our attributes from the element.
      * Returns false if it failed.
      */
-    virtual bool readAttributesFromDom(QDomElement element);
+    virtual bool readAttributesFromDom(TQDomElement element);
 
     /**
      * Reads our content from the node. Sets the node to the next node
      * that needs to be read.
      * Returns false if it failed.
      */
-    virtual bool readContentFromDom(QDomNode& node);
+    virtual bool readContentFromDom(TQDomNode& node);
 
     /**
-     * Sets the childrens' positions after their size has been
+     * Sets the tqchildrens' positions after their size has been
      * calculated.
      *
      * @see #calcSizes
@@ -419,7 +419,7 @@ protected:
      *
      * @param type the desired type of the element
      */
-    virtual BasicElement* createElement(QString type, const QDomElement &element);
+    virtual BasicElement* createElement(TQString type, const TQDomElement &element);
 
     /**
      * @returns the position where the child starts.
@@ -458,16 +458,16 @@ protected:
 private:
 
     /**
-     * Removes the children at pos and appends it to the list.
+     * Removes the tqchildren at pos and appends it to the list.
      */
-    void removeChild(QPtrList& removedChildren, int pos);
+    void removeChild(TQPtrList& removedChildren, int pos);
 
 
     /**
-     * Our children. Be sure to notify the rootElement before
+     * Our tqchildren. Be sure to notify the rootElement before
      * you remove any.
      */
-    QPtrList children;
+    TQPtrList tqchildren;
 
     /**
      * the syntax tree of the sequence
@@ -493,7 +493,7 @@ class NameSequence : public SequenceElement {
     typedef SequenceElement inherited;
 public:
 
-    NameSequence( BasicElement* parent = 0 );
+    NameSequence( BasicElement* tqparent = 0 );
 
     virtual NameSequence* clone() {
         return new NameSequence( *this );
@@ -509,9 +509,9 @@ public:
     /**
      * @returns the character that represents this element. Used for
      * parsing a sequence.
-     * This is guaranteed to be QChar::null for all non-text elements.
+     * This is guaranteed to be TQChar::null for all non-text elements.
      */
-    virtual QChar getCharacter() const { return '\\'; }
+    virtual TQChar getCharacter() const { return '\\'; }
 
     /**
      * @returns the type of this element. Used for
@@ -530,7 +530,7 @@ public:
     /**
      * If the cursor is inside a sequence it needs to be drawn.
      */
-    virtual void drawCursor( QPainter& painter, const ContextStyle& context,
+    virtual void drawCursor( TQPainter& painter, const ContextStyle& context,
 							 StyleAttributes& style, FormulaCursor* cursor, 
 							 bool smallCursor, bool activeCursor );
 
@@ -562,7 +562,7 @@ public:
      * new elements because it owns the undo stack. But only the
      * sequence knows what chars are allowed.
      */
-    virtual KCommand* input( Container* container, QChar ch );
+    virtual KCommand* input( Container* container, TQChar ch );
 
     /**
      * Sets a new type. This is done during parsing.
@@ -585,15 +585,15 @@ protected:
     /**
      * Returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "NAMESEQUENCE"; }
+    virtual TQString getTagName() const { return "NAMESEQUENCE"; }
 
-    virtual QString getElementName() const { return "mi"; }
+    virtual TQString getElementName() const { return "mi"; }
     /**
      * Creates a new element with the given type.
      *
      * @param type the desired type of the element
      */
-    virtual BasicElement* createElement( QString type );
+    virtual BasicElement* createElement( TQString type );
 
     /**
      * Parses the sequence and generates a new syntax tree.
@@ -603,7 +603,7 @@ protected:
 
     /**
      * @returns whether the child is the first element of its token.
-     * This can never happen here. Our children reuse our own
+     * This can never happen here. Our tqchildren reuse our own
      * element type.
      */
     virtual bool isFirstOfToken( BasicElement* ) { return false; }
@@ -612,7 +612,7 @@ private:
 
     KCommand* compactExpressionCmd( Container* container );
 
-    QString buildName();
+    TQString buildName();
 };
 
 KFORMULA_NAMESPACE_END
diff --git a/lib/kformula/sequenceparser.cc b/lib/kformula/sequenceparser.cc
index 55c8dec7..9a4ee8a2 100644
--- a/lib/kformula/sequenceparser.cc
+++ b/lib/kformula/sequenceparser.cc
@@ -41,7 +41,7 @@ void SequenceParser::setElementType( uint pos, ElementType* type )
 }
 
 
-ElementType* SequenceParser::parse( QPtrList& elements )
+ElementType* SequenceParser::parse( TQPtrList& elements )
 {
     list = elements;
     return new SequenceType( this );
@@ -60,7 +60,7 @@ void SequenceParser::nextToken()
     type = element->getTokenType();
     if ( type == SEPARATOR ) {
         if ( tokenEnd < list.count() ) {
-            QChar ch = getEndChar();
+            TQChar ch = getEndChar();
             switch ( ch ) {
             case ',':
             case '>':
@@ -95,7 +95,7 @@ void SequenceParser::readNumber()
     type = NUMBER;
     readDigits();
     if ( tokenEnd < list.count()-1 ) {
-        QChar ch = getEndChar();
+        TQChar ch = getEndChar();
 
         // Look for a dot.
         if ( ch == '.' ) {
@@ -147,7 +147,7 @@ void SequenceParser::readNumber()
 void SequenceParser::readDigits()
 {
     for ( ; tokenEnd < list.count(); tokenEnd++ ) {
-        QChar ch = getEndChar();
+        TQChar ch = getEndChar();
         if ( !ch.isNumber() ) {
             break;
         }
@@ -182,7 +182,7 @@ void SequenceParser::readText()
     }
 }
 
-QChar SequenceParser::getEndChar()
+TQChar SequenceParser::getEndChar()
 {
     BasicElement* element = list.at( tokenEnd );
     return element->getCharacter();
@@ -195,8 +195,8 @@ ElementType* SequenceParser::getPrimitive()
     //     << tokenStart << " " << tokenEnd << endl;
     switch ( type ) {
     case ORDINARY: {
-//         QString text = getText();
-//         if ( table.contains( text ) || ( text == "\\quad" ) ) {
+//         TQString text = getText();
+//         if ( table.tqcontains( text ) || ( text == "\\quad" ) ) {
 //             return new NameType( this, text );
 //         }
 //         else {
@@ -228,9 +228,9 @@ ElementType* SequenceParser::getPrimitive()
 }
 
 
-QString SequenceParser::text()
+TQString SequenceParser::text()
 {
-    QString text;
+    TQString text;
     for ( uint i = tokenStart; i < tokenEnd; i++ ) {
         BasicElement* element = list.at( i );
         text.append( element->getCharacter() );
diff --git a/lib/kformula/sequenceparser.h b/lib/kformula/sequenceparser.h
index 1051ec12..f710e4cb 100644
--- a/lib/kformula/sequenceparser.h
+++ b/lib/kformula/sequenceparser.h
@@ -21,8 +21,8 @@
 #ifndef SEQUENCEPARSER_H
 #define SEQUENCEPARSER_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "kformuladefs.h"
 
@@ -43,7 +43,7 @@ public:
     /**
      * @returns a parse tree.
      */
-    ElementType* parse(QPtrList& elements);
+    ElementType* parse(TQPtrList& elements);
 
     /**
      * Reads the next token.
@@ -70,7 +70,7 @@ public:
     /**
      * @returns the current token's text
      */
-    QString text();
+    TQString text();
 
 private:
 
@@ -92,13 +92,13 @@ private:
     /**
      * @returns the char at tokenEnd.
      */
-    QChar getEndChar();
+    TQChar getEndChar();
 
     /**
      * The elements we want to parse. The parser must not change
      * it!
      */
-    QPtrList list;
+    TQPtrList list;
 
     /**
      * The position up to which we have read. The current
diff --git a/lib/kformula/spaceelement.cc b/lib/kformula/spaceelement.cc
index 1ff62da7..7bc21d24 100644
--- a/lib/kformula/spaceelement.cc
+++ b/lib/kformula/spaceelement.cc
@@ -19,8 +19,8 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
-#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -33,8 +33,8 @@
 KFORMULA_NAMESPACE_BEGIN
 
 
-SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* parent )
-    : BasicElement( parent ), 
+SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* tqparent )
+    : BasicElement( tqparent ), 
       m_tab( tab ),
       m_widthType( NoSize ),
       m_heightType( NoSize ),
@@ -55,7 +55,7 @@ SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* parent )
     case THICK:
         m_widthType = ThickMathSpace;
         break;
-    case QUAD:
+    case TQUAD:
         m_widthType = VeryVeryThickMathSpace;
         break;
     }
@@ -88,35 +88,35 @@ void SpaceElement::calcSizes( const ContextStyle& context,
 {
     double factor = style.sizeFactor();
     luPt mySize = context.getAdjustedSize( tstyle, factor );
-    QFont font = context.getDefaultFont();
+    TQFont font = context.getDefaultFont();
     font.setPointSize( mySize );
 
-    QFontMetrics fm( font );
-    QChar w = 'M';
+    TQFontMetrics fm( font );
+    TQChar w = 'M';
     LuPixelRect hbound = fm.boundingRect( w );
-    QChar h = 'x';
+    TQChar h = 'x';
     LuPixelRect vbound = fm.boundingRect( h );
 
     double width = style.getSpace( m_widthType, m_width );
     if ( m_widthType == AbsoluteSize ) {
-        width = m_width / context.layoutUnitPtToPt( context.getBaseSize() );
+        width = m_width / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
     else if ( m_widthType == PixelSize ) {
-        width = context.pixelYToPt( m_width ) / context.layoutUnitPtToPt( context.getBaseSize() );
+        width = context.pixelYToPt( m_width ) / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
     double height = style.getSpace( m_heightType, m_height );
     if ( m_heightType == AbsoluteSize ) {
-        height = m_height / context.layoutUnitPtToPt( context.getBaseSize() );
+        height = m_height / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
     else if ( m_heightType == PixelSize ) {
-        height = context.pixelYToPt( m_height ) / context.layoutUnitPtToPt( context.getBaseSize() );
+        height = context.pixelYToPt( m_height ) / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
     double depth = style.getSpace( m_depthType, m_depth );
     if ( m_depthType == AbsoluteSize ) {
-        depth = m_depth / context.layoutUnitPtToPt( context.getBaseSize() );
+        depth = m_depth / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
     else if ( m_depthType == PixelSize ) {
-        depth = context.pixelYToPt( m_depth ) / context.layoutUnitPtToPt( context.getBaseSize() );
+        depth = context.pixelYToPt( m_depth ) / context.tqlayoutUnitPtToPt( context.getBaseSize() );
     }
 
     setWidth( hbound.width() * width );
@@ -128,37 +128,37 @@ void SpaceElement::calcSizes( const ContextStyle& context,
     }
 }
 
-void SpaceElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
+void SpaceElement::draw( TQPainter& painter, const LuPixelRect& /*r*/,
                          const ContextStyle& context,
                          ContextStyle::TextStyle /*tstyle*/,
                          ContextStyle::IndexStyle /*istyle*/,
                          StyleAttributes& /*style*/,
-                         const LuPixelPoint& parentOrigin )
+                         const LuPixelPoint& tqparentOrigin )
 {
-    LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY());
+    LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY());
     // there is such a thing as negative space!
     //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
     //    return;
 
     if ( context.edit() ) {
         painter.setPen( context.getEmptyColor() );
-        painter.drawLine( context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight() ),
-                          context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight() ) );
-        painter.drawLine( context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight() ),
-                          context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) );
-        painter.drawLine( context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight() ),
-                          context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) );
+        painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ),
+                          context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) );
+        painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ),
+                          context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) );
+        painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ),
+                          context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) );
     }
 }
 
 
-void SpaceElement::writeDom(QDomElement element)
+void SpaceElement::writeDom(TQDomElement element)
 {
     BasicElement::writeDom(element);
     switch ( m_widthType ) {
@@ -203,12 +203,12 @@ void SpaceElement::writeDom(QDomElement element)
     }
 }
 
-bool SpaceElement::readAttributesFromDom( QDomElement element )
+bool SpaceElement::readAttributesFromDom( TQDomElement element )
 {
     if ( !BasicElement::readAttributesFromDom( element ) ) {
         return false;
     }
-    QString widthStr = element.attribute( "WIDTH" );
+    TQString widthStr = element.attribute( "WIDTH" );
     if( !widthStr.isNull() ) {
         if ( widthStr.lower() == "quad" ) {
             m_widthType = VeryVeryThickMathSpace;
@@ -229,38 +229,38 @@ bool SpaceElement::readAttributesFromDom( QDomElement element )
     else {
         return false;
     }
-    QString tabStr = element.attribute( "TAB" );
+    TQString tabStr = element.attribute( "TAB" );
     m_tab = !tabStr.isNull();
     return true;
 }
 
-bool SpaceElement::readContentFromDom(QDomNode& node)
+bool SpaceElement::readContentFromDom(TQDomNode& node)
 {
     return BasicElement::readContentFromDom( node );
 }
 
-bool SpaceElement::readAttributesFromMathMLDom(const QDomElement& element)
+bool SpaceElement::readAttributesFromMathMLDom(const TQDomElement& element)
 {
     if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) {
         return false;
     }
 
-    QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower();
+    TQString widthStr = element.attribute( "width" ).stripWhiteSpace().lower();
     if ( ! widthStr.isNull() ) {
         m_width = getSize( widthStr, &m_widthType );
         if ( m_widthType == NoSize ) {
             m_widthType = getSpace( widthStr );
         }
     }
-    QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower();
+    TQString heightStr = element.attribute( "height" ).stripWhiteSpace().lower();
     if ( ! heightStr.isNull() ) {
         m_height = getSize( heightStr, &m_heightType );
     }
-    QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower();
+    TQString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower();
     if ( ! depthStr.isNull() ) {
         m_depth = getSize( depthStr, &m_depthType );
     }
-    QString linebreakStr = element.attribute( "linebreak" ).stripWhiteSpace().lower();
+    TQString linebreakStr = element.attribute( "linebreak" ).stripWhiteSpace().lower();
     if ( ! linebreakStr.isNull() ) {
         if ( linebreakStr == "auto" ) {
             m_lineBreak = AutoBreak;
@@ -284,17 +284,17 @@ bool SpaceElement::readAttributesFromMathMLDom(const QDomElement& element)
     return true;
 }
 
-void SpaceElement::writeMathMLAttributes( QDomElement& element ) const
+void SpaceElement::writeMathMLAttributes( TQDomElement& element ) const
 {
     switch ( m_widthType ) {
     case AbsoluteSize:
-        element.setAttribute( "width", QString( "%1pt" ).arg( m_width ) );
+        element.setAttribute( "width", TQString( "%1pt" ).tqarg( m_width ) );
         break;
     case RelativeSize:
-        element.setAttribute( "width", QString( "%1%" ).arg( m_width * 100.0 ) );
+        element.setAttribute( "width", TQString( "%1%" ).tqarg( m_width * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( "width", QString( "%1px" ).arg( m_width ) );
+        element.setAttribute( "width", TQString( "%1px" ).tqarg( m_width ) );
         break;
     case NegativeVeryVeryThinMathSpace:
         element.setAttribute( "width", "negativeveryverythinmathspace" );
@@ -343,26 +343,26 @@ void SpaceElement::writeMathMLAttributes( QDomElement& element ) const
     }
     switch ( m_heightType ) {
     case AbsoluteSize:
-        element.setAttribute( "height", QString( "%1pt" ).arg( m_height ) );
+        element.setAttribute( "height", TQString( "%1pt" ).tqarg( m_height ) );
         break;
     case RelativeSize:
-        element.setAttribute( "height", QString( "%1%" ).arg( m_height * 100.0 ) );
+        element.setAttribute( "height", TQString( "%1%" ).tqarg( m_height * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( "height", QString( "%1px" ).arg( m_height ) );
+        element.setAttribute( "height", TQString( "%1px" ).tqarg( m_height ) );
         break;
     default:
         break;
     }
     switch ( m_depthType ) {
     case AbsoluteSize:
-        element.setAttribute( "depth", QString( "%1pt" ).arg( m_depth ) );
+        element.setAttribute( "depth", TQString( "%1pt" ).tqarg( m_depth ) );
         break;
     case RelativeSize:
-        element.setAttribute( "depth", QString( "%1%" ).arg( m_depth * 100.0 ) );
+        element.setAttribute( "depth", TQString( "%1%" ).tqarg( m_depth * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( "depth", QString( "%1px" ).arg( m_depth ) );
+        element.setAttribute( "depth", TQString( "%1px" ).tqarg( m_depth ) );
         break;
     default:
         break;
@@ -391,7 +391,7 @@ void SpaceElement::writeMathMLAttributes( QDomElement& element ) const
     }
 }
 
-QString SpaceElement::toLatex()
+TQString SpaceElement::toLatex()
 {
     switch ( m_widthType ) {
     case NegativeVeryVeryThinMathSpace:
diff --git a/lib/kformula/spaceelement.h b/lib/kformula/spaceelement.h
index 52a666d1..0f5db35d 100644
--- a/lib/kformula/spaceelement.h
+++ b/lib/kformula/spaceelement.h
@@ -22,8 +22,8 @@
 #ifndef SPACEELEMENT_H
 #define SPACEELEMENT_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "basicelement.h"
 
@@ -48,7 +48,7 @@ class SpaceElement : public BasicElement {
     SpaceElement operator=( const SpaceElement& ) { return *this; }
 public:
 
-    SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* parent = 0 );
+    SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* tqparent = 0 );
     SpaceElement( const SpaceElement& );
 
     virtual SpaceElement* clone() {
@@ -67,7 +67,7 @@ public:
      * @returns the character that represents this element. Used for
      * parsing a sequence.
      */
-    virtual QChar getCharacter() const { return ' '; }
+    virtual TQChar getCharacter() const { return ' '; }
 
     // drawing
     //
@@ -78,7 +78,7 @@ public:
 
     /**
      * Calculates our width and height and
-     * our children's parentPosition.
+     * our tqchildren's tqparentPosition.
      */
     virtual void calcSizes( const ContextStyle& cstyle,
 						    ContextStyle::TextStyle tstyle,
@@ -86,16 +86,16 @@ public:
 							StyleAttributes& style );
 
     /**
-     * Draws the whole element including its children.
-     * The `parentOrigin' is the point this element's parent starts.
-     * We can use our parentPosition to get our own origin then.
+     * Draws the whole element including its tqchildren.
+     * The `tqparentOrigin' is the point this element's tqparent starts.
+     * We can use our tqparentPosition to get our own origin then.
      */
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
 					   StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
     /**
      * Moves the cursor away from the given child. The cursor is
@@ -105,9 +105,9 @@ public:
 
     /**
      * @returns the latex representation of the element and
-     * of the element's children
+     * of the element's tqchildren
      */
-    virtual QString toLatex();
+    virtual TQString toLatex();
 
 protected:
 
@@ -116,36 +116,36 @@ protected:
     /**
      * @returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "SPACE"; }
+    virtual TQString getTagName() const { return "SPACE"; }
 
     /**
      * Appends our attributes to the dom element.
      */
-    virtual void writeDom(QDomElement element);
+    virtual void writeDom(TQDomElement element);
 
     /**
      * Reads our attributes from the element.
      * Returns false if it failed.
      */
-    virtual bool readAttributesFromDom(QDomElement element);
+    virtual bool readAttributesFromDom(TQDomElement element);
 
     /**
      * Reads our content from the node. Sets the node to the next node
      * that needs to be read.
      * Returns false if it failed.
      */
-    virtual bool readContentFromDom(QDomNode& node);
+    virtual bool readContentFromDom(TQDomNode& node);
 
     /**
      * Reads our attributes from the MathML element.
      * Returns false if it failed.
      */
-	virtual bool readAttributesFromMathMLDom(const QDomElement& element);
+	virtual bool readAttributesFromMathMLDom(const TQDomElement& element);
 
 private:
 
-    virtual QString getElementName() const { return "mspace"; }
-    virtual void writeMathMLAttributes( QDomElement& element ) const ;
+    virtual TQString getElementName() const { return "mspace"; }
+    virtual void writeMathMLAttributes( TQDomElement& element ) const ;
 
     /**
      * Whether this space behaves like a tab.
diff --git a/lib/kformula/stringelement.cc b/lib/kformula/stringelement.cc
index 8e7b54c4..2f13ad77 100644
--- a/lib/kformula/stringelement.cc
+++ b/lib/kformula/stringelement.cc
@@ -22,11 +22,11 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-StringElement::StringElement( BasicElement* parent ) : TokenElement( parent ) 
+StringElement::StringElement( BasicElement* tqparent ) : TokenElement( tqparent ) 
 {
 }
 
-bool StringElement::readAttributesFromMathMLDom(const QDomElement& element)
+bool StringElement::readAttributesFromMathMLDom(const TQDomElement& element)
 {
     if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) {
         return false;
@@ -48,7 +48,7 @@ bool StringElement::readAttributesFromMathMLDom(const QDomElement& element)
     return true;
 }
 
-int StringElement::buildChildrenFromMathMLDom(QPtrList& list, QDomNode n) 
+int StringElement::buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n) 
 {
     int count = inherited::buildChildrenFromMathMLDom( list, n );
     if ( count == -1 )
@@ -66,7 +66,7 @@ int StringElement::buildChildrenFromMathMLDom(QPtrList& list, QDom
     return count;
 }
 
-void StringElement::writeMathMLAttributes( QDomElement& element ) const
+void StringElement::writeMathMLAttributes( TQDomElement& element ) const
 {
     inherited::writeMathMLAttributes( element );
     if ( m_customLquote ) {
@@ -77,7 +77,7 @@ void StringElement::writeMathMLAttributes( QDomElement& element ) const
     }
 }
 
-void StringElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const
+void StringElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const
 {
     for ( uint i = 1; i < countChildren() - 1; ++i ) {
         const BasicElement* e = getChild( i );
diff --git a/lib/kformula/stringelement.h b/lib/kformula/stringelement.h
index e3542204..447895db 100644
--- a/lib/kformula/stringelement.h
+++ b/lib/kformula/stringelement.h
@@ -27,19 +27,19 @@ KFORMULA_NAMESPACE_BEGIN
 class StringElement : public TokenElement {
     typedef TokenElement inherited;
 public:
-    StringElement( BasicElement* parent = 0 );
-	virtual int buildChildrenFromMathMLDom(QPtrList& list, QDomNode n);
+    StringElement( BasicElement* tqparent = 0 );
+	virtual int buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n);
 
 protected:
-    virtual bool readAttributesFromMathMLDom(const QDomElement& element);
+    virtual bool readAttributesFromMathMLDom(const TQDomElement& element);
 
 private:
-    virtual QString getElementName() const { return "ms"; }
-    virtual void writeMathMLAttributes( QDomElement& element ) const ;
-    virtual void writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const ;
+    virtual TQString getElementName() const { return "ms"; }
+    virtual void writeMathMLAttributes( TQDomElement& element ) const ;
+    virtual void writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const ;
 
-    QString m_lquote;
-    QString m_rquote;
+    TQString m_lquote;
+    TQString m_rquote;
     bool m_customLquote;
     bool m_customRquote;
 };
diff --git a/lib/kformula/styleelement.cc b/lib/kformula/styleelement.cc
index 8475a1da..1a8f20ae 100644
--- a/lib/kformula/styleelement.cc
+++ b/lib/kformula/styleelement.cc
@@ -22,7 +22,7 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent ),
+StyleElement::StyleElement( BasicElement* tqparent ) : TokenStyleElement( tqparent ),
                                                      m_scriptMinSizeType( NoSize ),
                                                      m_veryVeryThinMathSpaceType( NoSize ),
                                                      m_veryThinMathSpaceType( NoSize ),
@@ -39,13 +39,13 @@ StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent )
 {
 }
 
-bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element )
+bool StyleElement::readAttributesFromMathMLDom( const TQDomElement& element )
 {
     if ( !BasicElement::readAttributesFromMathMLDom( element ) ) {
         return false;
     }
     
-    QString scriptlevelStr = element.attribute( "scriptlevel" );
+    TQString scriptlevelStr = element.attribute( "scriptlevel" );
     if ( ! scriptlevelStr.isNull() ) {
         if ( scriptlevelStr[0] == '+' || scriptlevelStr[0] == '-' ) {
             m_relativeScriptLevel = true;
@@ -60,7 +60,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element )
             m_customScriptLevel = true;
         }
     }
-    QString displaystyleStr = element.attribute( "displaystyle" );
+    TQString displaystyleStr = element.attribute( "displaystyle" );
     if ( ! displaystyleStr.isNull() ) {
         if ( displaystyleStr.lower() == "true" ) {
             m_displayStyle = true;
@@ -70,7 +70,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element )
         }
         m_customDisplayStyle = true;
     }
-    QString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" );
+    TQString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" );
     if ( ! scriptsizemultiplierStr.isNull() ) {
         bool ok;
         m_scriptSizeMultiplier = scriptsizemultiplierStr.toDouble( &ok );
@@ -82,66 +82,66 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element )
             m_customScriptSizeMultiplier = true;
         }
     }
-    QString scriptminsizeStr = element.attribute( "scriptminsize" );
+    TQString scriptminsizeStr = element.attribute( "scriptminsize" );
     if ( ! scriptminsizeStr.isNull() ) {
         readSizeAttribute( scriptminsizeStr, &m_scriptMinSizeType, &m_scriptMinSize );
     }
-    QString backgroundStr = element.attribute( "background" );
+    TQString backgroundStr = element.attribute( "background" );
     if ( ! backgroundStr.isNull() ) {
-        // TODO: tranparent background
+        // TODO: trantqparent background
         m_customBackground = true;
         if ( backgroundStr[0] != '#' ) {
-            m_background = QColor( getHtmlColor( backgroundStr ) );
+            m_background = TQColor( getHtmlColor( backgroundStr ) );
         }
         else {
-            m_background = QColor( backgroundStr );
+            m_background = TQColor( backgroundStr );
         }
     }
-    QString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" );
+    TQString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" );
     if ( ! veryverythinmathspaceStr.isNull() ) {
         readSizeAttribute( veryverythinmathspaceStr, &m_veryVeryThinMathSpaceType, &m_veryVeryThinMathSpace );
     }
-    QString verythinmathspaceStr = element.attribute( "verythinmathspace" );
+    TQString verythinmathspaceStr = element.attribute( "verythinmathspace" );
     if ( ! verythinmathspaceStr.isNull() ) {
         readSizeAttribute( verythinmathspaceStr, &m_veryThinMathSpaceType, &m_veryThinMathSpace );
     }
-    QString thinmathspaceStr = element.attribute( "thinmathspace" );
+    TQString thinmathspaceStr = element.attribute( "thinmathspace" );
     if ( ! thinmathspaceStr.isNull() ) {
         readSizeAttribute( thinmathspaceStr, &m_thinMathSpaceType, &m_thinMathSpace );
     }
-    QString mediummathspaceStr = element.attribute( "mediummathspace" );
+    TQString mediummathspaceStr = element.attribute( "mediummathspace" );
     if ( ! mediummathspaceStr.isNull() ) {
         readSizeAttribute( mediummathspaceStr, &m_mediumMathSpaceType, &m_mediumMathSpace );
     }
-    QString thickmathspaceStr = element.attribute( "thickmathspace" );
+    TQString thickmathspaceStr = element.attribute( "thickmathspace" );
     if ( ! thickmathspaceStr.isNull() ) {
         readSizeAttribute( thickmathspaceStr, &m_thickMathSpaceType, &m_thickMathSpace );
     }
-    QString verythickmathspaceStr = element.attribute( "verythickmathspace" );
+    TQString verythickmathspaceStr = element.attribute( "verythickmathspace" );
     if ( ! verythickmathspaceStr.isNull() ) {
         readSizeAttribute( verythickmathspaceStr, &m_veryThickMathSpaceType, &m_veryThickMathSpace );
     }
-    QString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" );
+    TQString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" );
     if ( ! veryverythickmathspaceStr.isNull() ) {
         readSizeAttribute( veryverythickmathspaceStr, &m_veryVeryThickMathSpaceType, &m_veryVeryThickMathSpace );
     }
     return inherited::readAttributesFromMathMLDom( element );
 }
 
-void StyleElement::writeMathMLAttributes( QDomElement& element ) const
+void StyleElement::writeMathMLAttributes( TQDomElement& element ) const
 {
     if ( m_customScriptLevel ) {
-        QString prefix;
+        TQString prefix;
         if ( m_relativeScriptLevel && m_scriptLevel >= 0 ) {
             prefix = "+";
         }
-        element.setAttribute( "scriptlevel", prefix + QString( "%1" ).arg( m_scriptLevel ) );
+        element.setAttribute( "scriptlevel", prefix + TQString( "%1" ).tqarg( m_scriptLevel ) );
     }
     if ( m_customDisplayStyle ) {
         element.setAttribute( "displaystyle", m_displayStyle ? "true" : "false" );
     }
     if ( m_customScriptSizeMultiplier ) {
-        element.setAttribute( "scriptsizemultiplier", QString( "%1" ).arg( m_scriptSizeMultiplier ) );
+        element.setAttribute( "scriptsizemultiplier", TQString( "%1" ).tqarg( m_scriptSizeMultiplier ) );
     }
     writeSizeAttribute( element, "scriptminsize", m_scriptMinSizeType, m_scriptMinSize );
     if ( m_customBackground ) {
@@ -193,7 +193,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s
 
     // Get scriptminsize attribute in absolute units, so we don't depend on 
     // context to get the default value
-    double basesize = context.layoutUnitPtToPt( context.getBaseSize() );
+    double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() );
     double size = style.scriptMinSize();
     switch ( m_scriptMinSizeType ) {
     case AbsoluteSize:
@@ -236,7 +236,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s
 double StyleElement::sizeFactor( const ContextStyle& context, SizeType st, 
                                  double length, double defvalue )
 {
-    double basesize = context.layoutUnitPtToPt( context.getBaseSize() );
+    double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() );
     switch ( st ) {
     case AbsoluteSize:
         return length / basesize;
@@ -270,7 +270,7 @@ void StyleElement::setStyleVariant( StyleAttributes& style )
         style.setCustomMathVariant( false );
         if ( customFontFamily() ) {
             style.setCustomFont( true );
-            style.setFont( QFont(fontFamily()) );
+            style.setFont( TQFont(fontFamily()) );
         }
 
         bool fontweight = false;
@@ -347,7 +347,7 @@ void StyleElement::resetStyle( StyleAttributes& style )
     style.resetDisplayStyle();
 }
 
-void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double* s )
+void StyleElement::readSizeAttribute( const TQString& str, SizeType* st, double* s )
 {
     if ( st == 0 || s == 0 ){
         return;
@@ -369,17 +369,17 @@ void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double*
     }
 }
 
-void StyleElement::writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const
+void StyleElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, double s ) const
 {
     switch ( st ) {
     case AbsoluteSize:
-        element.setAttribute( str, QString( "%1pt" ).arg( s ) );
+        element.setAttribute( str, TQString( "%1pt" ).tqarg( s ) );
         break;
     case RelativeSize:
-        element.setAttribute( str, QString( "%1%" ).arg( s * 100.0 ) );
+        element.setAttribute( str, TQString( "%1%" ).tqarg( s * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( str, QString( "%1px" ).arg( s ) );
+        element.setAttribute( str, TQString( "%1px" ).tqarg( s ) );
         break;
     default:
         break;
diff --git a/lib/kformula/styleelement.h b/lib/kformula/styleelement.h
index b497a241..7751a19a 100644
--- a/lib/kformula/styleelement.h
+++ b/lib/kformula/styleelement.h
@@ -29,11 +29,11 @@ class StyleElement : public TokenStyleElement {
     typedef TokenStyleElement inherited;
 public:
 	
-    StyleElement( BasicElement* parent = 0 );
+    StyleElement( BasicElement* tqparent = 0 );
 
 protected:
 
-    virtual bool readAttributesFromMathMLDom( const QDomElement &element );
+    virtual bool readAttributesFromMathMLDom( const TQDomElement &element );
 
     virtual void setStyleSize( const ContextStyle& context, StyleAttributes& style );
     virtual void setStyleVariant( StyleAttributes& style );
@@ -41,11 +41,11 @@ protected:
     virtual void resetStyle( StyleAttributes& style );
 
 private:
-    virtual QString getElementName() const { return "mstyle"; }
-    virtual void writeMathMLAttributes( QDomElement& element ) const ;
+    virtual TQString getElementName() const { return "mstyle"; }
+    virtual void writeMathMLAttributes( TQDomElement& element ) const ;
 
-    void readSizeAttribute( const QString& str, SizeType* st, double* s );
-    void writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const ;
+    void readSizeAttribute( const TQString& str, SizeType* st, double* s );
+    void writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, double s ) const ;
 
     double sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue );
 
@@ -53,7 +53,7 @@ private:
     SizeType m_scriptMinSizeType;
     double m_scriptSizeMultiplier;
     double m_scriptMinSize;
-    QColor m_background;
+    TQColor m_background;
     SizeType m_veryVeryThinMathSpaceType;
     double m_veryVeryThinMathSpace;
     SizeType m_veryThinMathSpaceType;
diff --git a/lib/kformula/symbolaction.cc b/lib/kformula/symbolaction.cc
index 7939f231..6a80eeec 100644
--- a/lib/kformula/symbolaction.cc
+++ b/lib/kformula/symbolaction.cc
@@ -17,8 +17,8 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
-#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -34,64 +34,64 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-class SymbolComboItem : public QListBoxItem
+class SymbolComboItem : public TQListBoxItem
 {
 public:
-    SymbolComboItem( const QString&, const QFont& , QChar, QComboBox* combo );
+    SymbolComboItem( const TQString&, const TQFont& , TQChar, TQComboBox* combo );
     virtual ~SymbolComboItem();
 
-    virtual int width( const QListBox* ) const;
-    virtual int height( const QListBox* ) const;
+    virtual int width( const TQListBox* ) const;
+    virtual int height( const TQListBox* ) const;
 
 protected:
-    virtual void paint( QPainter *p );
+    virtual void paint( TQPainter *p );
 
 private:
-    QComboBox *m_combo;
-    QString m_name;
-    QFont m_font;
-    QChar m_symbol;
+    TQComboBox *m_combo;
+    TQString m_name;
+    TQFont m_font;
+    TQChar m_symbol;
 
     static int widest;
 };
 
 int SymbolComboItem::widest = 0;
 
-SymbolComboItem::SymbolComboItem( const QString &name, const QFont& font, 
-                                  QChar symbol, QComboBox *combo )
-    : QListBoxItem( combo->listBox() ),
+SymbolComboItem::SymbolComboItem( const TQString &name, const TQFont& font, 
+                                  TQChar symbol, TQComboBox *combo )
+    : TQListBoxItem( combo->listBox() ),
       m_combo( combo ),
       m_name( name ),
       m_font( font ),
       m_symbol( symbol )
 {
     setText( name );
-    int charWidth = QFontMetrics( m_font ).width( QChar( m_symbol ) );
-    widest = QMAX( widest, charWidth );
+    int charWidth = TQFontMetrics( m_font ).width( TQChar( m_symbol ) );
+    widest = TQMAX( widest, charWidth );
 }
 
 SymbolComboItem::~SymbolComboItem()
 {
 }
 
-int SymbolComboItem::width( const QListBox * /*lb*/ ) const
+int SymbolComboItem::width( const TQListBox * /*lb*/ ) const
 {
-    return widest + QFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12;
+    return widest + TQFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12;
 }
 
-int SymbolComboItem::height( const QListBox * /*lb*/ ) const
+int SymbolComboItem::height( const TQListBox * /*lb*/ ) const
 {
-    int generalHeight = QFontMetrics( KGlobalSettings::generalFont() ).lineSpacing();
-    int fontHeight = QFontMetrics( m_font ).lineSpacing();
-    return QMAX( generalHeight, fontHeight ) + 2;
+    int generalHeight = TQFontMetrics( KGlobalSettings::generalFont() ).lineSpacing();
+    int fontHeight = TQFontMetrics( m_font ).lineSpacing();
+    return TQMAX( generalHeight, fontHeight ) + 2;
 }
 
-void SymbolComboItem::paint( QPainter *p )
+void SymbolComboItem::paint( TQPainter *p )
 {
     p->setFont( m_font );
-    QFontMetrics fm( p->fontMetrics() );
+    TQFontMetrics fm( p->fontMetrics() );
     p->drawText( 3, fm.ascent() + fm.leading() / 2,
-                 QString( "%1" ).arg( QChar( m_symbol ) ) );
+                 TQString( "%1" ).tqarg( TQChar( m_symbol ) ) );
 
     p->setFont( KGlobalSettings::generalFont() );
     fm = p->fontMetrics();
@@ -101,21 +101,21 @@ void SymbolComboItem::paint( QPainter *p )
 /*
  * The symbol action *
  */
-SymbolAction::SymbolAction( QObject* parent, const char* name )
-    : KSelectAction( parent, name )
+SymbolAction::SymbolAction( TQObject* tqparent, const char* name )
+    : KSelectAction( tqparent, name )
 {
     setEditable( FALSE );
 }
 
-SymbolAction::SymbolAction( const QString& text, const KShortcut& cut,
-                            const QObject* receiver, const char* slot,
-                            QObject* parent, const char* name )
-    : KSelectAction( text, cut, receiver, slot, parent, name )
+SymbolAction::SymbolAction( const TQString& text, const KShortcut& cut,
+                            const TQObject* receiver, const char* slot,
+                            TQObject* tqparent, const char* name )
+    : KSelectAction( text, cut, receiver, slot, tqparent, name )
 {
     setEditable( FALSE );
 }
 
-int SymbolAction::plug( QWidget* w, int index )
+int SymbolAction::plug( TQWidget* w, int index )
 {
     if (kapp && !kapp->authorizeKAction(name()))
         return -1;
@@ -124,15 +124,15 @@ int SymbolAction::plug( QWidget* w, int index )
         KToolBar* bar = static_cast( w );
         int id_ = KAction::getToolButtonID();
         KComboBox *cb = new KComboBox( bar );
-        connect( cb, SIGNAL( activated( const QString & ) ),
-                 SLOT( slotActivated( const QString & ) ) );
+        connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+                 TQT_SLOT( slotActivated( const TQString & ) ) );
         cb->setEnabled( isEnabled() );
         bar->insertWidget( id_, comboWidth(), cb, index );
-        cb->setMinimumWidth( cb->sizeHint().width() );
+        cb->setMinimumWidth( cb->tqsizeHint().width() );
 
         addContainer( bar, id_ );
 
-        connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+        connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
 
         updateItems( containerCount() - 1 );
 
@@ -141,9 +141,9 @@ int SymbolAction::plug( QWidget* w, int index )
     else return KSelectAction::plug( w, index );
 }
 
-void SymbolAction::setSymbols( const QStringList &names,
-                               const QFont& font,
-                               const QMemArray& chars )
+void SymbolAction::setSymbols( const TQStringList &names,
+                               const TQFont& font,
+                               const TQMemArray& chars )
 {
     m_chars = chars;
     m_font = font;
@@ -156,17 +156,17 @@ void SymbolAction::setSymbols( const QStringList &names,
 
 void SymbolAction::updateItems( int id )
 {
-    QWidget *w = container( id );
+    TQWidget *w = container( id );
     if ( w->inherits( "KToolBar" ) ) {
-        QWidget *r = static_cast( w )->getWidget( itemId( id ) );
-        if ( r->inherits( "QComboBox" ) ) {
-            QComboBox *cb = static_cast( r );
+        TQWidget *r = static_cast( w )->getWidget( itemId( id ) );
+        if ( r->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
+            TQComboBox *cb = static_cast( r );
             cb->clear();
 
             for( uint i = 0; i < items().count(); ++i ) {
                 new SymbolComboItem( *items().at( i ), m_font, m_chars.at( i ), cb );
             }
-            cb->setMinimumWidth( cb->sizeHint().width() );
+            cb->setMinimumWidth( cb->tqsizeHint().width() );
         }
     }
 }
diff --git a/lib/kformula/symbolaction.h b/lib/kformula/symbolaction.h
index 704afa2e..a8e7eadf 100644
--- a/lib/kformula/symbolaction.h
+++ b/lib/kformula/symbolaction.h
@@ -21,9 +21,9 @@
 #define _SYMBOLACTION_H_
 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "kformuladefs.h"
 
@@ -32,19 +32,19 @@ KFORMULA_NAMESPACE_BEGIN
 class SymbolAction : public KSelectAction
 {
 public:
-    SymbolAction( QObject* parent = 0, const char* name = 0 );
-    SymbolAction( const QString& text, const KShortcut& cut,
-                 const QObject* receiver, const char* slot, QObject* parent,
+    SymbolAction( TQObject* tqparent = 0, const char* name = 0 );
+    SymbolAction( const TQString& text, const KShortcut& cut,
+                 const TQObject* receiver, const char* slot, TQObject* tqparent,
                  const char* name = 0 );
 
-    int plug( QWidget*, int index = -1 );
-    void setSymbols( const QStringList&, const QFont& font, const QMemArray& );
+    int plug( TQWidget*, int index = -1 );
+    void setSymbols( const TQStringList&, const TQFont& font, const TQMemArray& );
     void updateItems( int );
 
 private:
-    QValueList m_fonts;
-    QMemArray m_chars;
-    QFont m_font;
+    TQValueList m_fonts;
+    TQMemArray m_chars;
+    TQFont m_font;
 };
 
 KFORMULA_NAMESPACE_END
diff --git a/lib/kformula/symbolelement.cc b/lib/kformula/symbolelement.cc
index 49932bee..518fba2f 100644
--- a/lib/kformula/symbolelement.cc
+++ b/lib/kformula/symbolelement.cc
@@ -18,7 +18,7 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
+#include 
 
 #include 
 
@@ -36,7 +36,7 @@ class SymbolSequenceElement : public SequenceElement {
     typedef SequenceElement inherited;
 public:
 
-    SymbolSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {}
+    SymbolSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {}
 
     /**
      * This is called by the container to get a command depending on
@@ -87,8 +87,8 @@ KCommand* SymbolSequenceElement::buildCommand( Container* container, Request* re
 }
 
 
-SymbolElement::SymbolElement(SymbolType type, BasicElement* parent)
-    : BasicElement(parent), symbol( 0 ), symbolType( type )
+SymbolElement::SymbolElement(SymbolType type, BasicElement* tqparent)
+    : BasicElement(tqparent), symbol( 0 ), symbolType( type )
 {
     content = new SymbolSequenceElement( this );
     upper = 0;
@@ -134,12 +134,12 @@ bool SymbolElement::accept( ElementVisitor* visitor )
 
 
 BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled,
-                                      const LuPixelPoint& point, const LuPixelPoint& parentOrigin )
+                                      const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin )
 {
-    BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin);
+    BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin);
     if (e != 0) {
-        LuPixelPoint myPos(parentOrigin.x() + getX(),
-                           parentOrigin.y() + getY());
+        LuPixelPoint myPos(tqparentOrigin.x() + getX(),
+                           tqparentOrigin.y() + getY());
 
         e = content->goToPos(cursor, handled, point, myPos);
         if (e != 0) {
@@ -192,7 +192,7 @@ BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled,
 
 /**
  * Calculates our width and height and
- * our children's parentPosition.
+ * our tqchildren's tqparentPosition.
  */
 void SymbolElement::calcSizes( const ContextStyle& context,
                                ContextStyle::TextStyle tstyle,
@@ -212,7 +212,7 @@ void SymbolElement::calcSizes( const ContextStyle& context,
     symbol->calcSizes(context, tstyle, factor, mySize);
     content->calcSizes( context, tstyle, istyle, style );
 
-    //symbol->scale(((double)parentSize)/symbol->getHeight()*2);
+    //symbol->scale(((double)tqparentSize)/symbol->getHeight()*2);
 
     luPixel upperWidth = 0;
     luPixel upperHeight = 0;
@@ -233,7 +233,7 @@ void SymbolElement::calcSizes( const ContextStyle& context,
     }
 
     // widths
-    luPixel xOffset = QMAX(symbol->getWidth(), QMAX(upperWidth, lowerWidth));
+    luPixel xOffset = TQMAX(symbol->getWidth(), TQMAX(upperWidth, lowerWidth));
     if (context.getCenterSymbol()) {
         symbol->setX((xOffset - symbol->getWidth()) / 2);
     }
@@ -245,15 +245,15 @@ void SymbolElement::calcSizes( const ContextStyle& context,
                   static_cast( symbol->slant()*symbol->getHeight()/2 ) +
                   distX/2);
 
-    setWidth(QMAX(content->getX() + content->getWidth(),
-                  QMAX(upperWidth, lowerWidth)));
+    setWidth(TQMAX(content->getX() + content->getWidth(),
+                  TQMAX(upperWidth, lowerWidth)));
 
     // heights
-    //int toMidline = QMAX(content->getHeight() / 2,
-    luPixel toMidline = QMAX(content->axis( context, tstyle, factor ),
+    //int toMidline = TQMAX(content->getHeight() / 2,
+    luPixel toMidline = TQMAX(content->axis( context, tstyle, factor ),
                              upperHeight + symbol->getHeight()/2);
-    //int fromMidline = QMAX(content->getHeight() / 2,
-    luPixel fromMidline = QMAX(content->getHeight() - content->axis( context, tstyle, factor ),
+    //int fromMidline = TQMAX(content->getHeight() / 2,
+    luPixel fromMidline = TQMAX(content->getHeight() - content->axis( context, tstyle, factor ),
                                lowerHeight + symbol->getHeight()/2);
     setHeight(toMidline + fromMidline);
     //setMidline(toMidline);
@@ -299,18 +299,18 @@ void SymbolElement::calcSizes( const ContextStyle& context,
 }
 
 /**
- * Draws the whole element including its children.
- * The `parentOrigin' is the point this element's parent starts.
- * We can use our parentPosition to get our own origin then.
+ * Draws the whole element including its tqchildren.
+ * The `tqparentOrigin' is the point this element's tqparent starts.
+ * We can use our tqparentPosition to get our own origin then.
  */
-void SymbolElement::draw( QPainter& painter, const LuPixelRect& r,
+void SymbolElement::draw( TQPainter& painter, const LuPixelRect& r,
                           const ContextStyle& context,
                           ContextStyle::TextStyle tstyle,
                           ContextStyle::IndexStyle istyle,
                           StyleAttributes& style,
-                          const LuPixelPoint& parentOrigin )
+                          const LuPixelPoint& tqparentOrigin )
 {
-    LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() );
+    LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() );
     //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
     //    return;
 
@@ -328,21 +328,21 @@ void SymbolElement::draw( QPainter& painter, const LuPixelRect& r,
 
     // Debug
 #if 0
-    painter.setBrush(Qt::NoBrush);
-    painter.setPen(Qt::red);
-//     painter.drawRect( context.layoutUnitToPixelX( myPos.x() ),
-//                       context.layoutUnitToPixelY( myPos.y() ),
-//                       context.layoutUnitToPixelX( getWidth() ),
-//                       context.layoutUnitToPixelY( getHeight() ) );
-    painter.drawRect( context.layoutUnitToPixelX( myPos.x()+symbol->getX() ),
-                      context.layoutUnitToPixelY( myPos.y()+symbol->getY() ),
-                      context.layoutUnitToPixelX( symbol->getWidth() ),
-                      context.layoutUnitToPixelY( symbol->getHeight() ) );
-    painter.setPen(Qt::green);
-    painter.drawLine( context.layoutUnitToPixelX( myPos.x() ),
-                      context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ),
-                      context.layoutUnitToPixelX( myPos.x()+getWidth() ),
-                      context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) );
+    painter.setBrush(TQt::NoBrush);
+    painter.setPen(TQt::red);
+//     painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ),
+//                       context.tqlayoutUnitToPixelY( myPos.y() ),
+//                       context.tqlayoutUnitToPixelX( getWidth() ),
+//                       context.tqlayoutUnitToPixelY( getHeight() ) );
+    painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+symbol->getX() ),
+                      context.tqlayoutUnitToPixelY( myPos.y()+symbol->getY() ),
+                      context.tqlayoutUnitToPixelX( symbol->getWidth() ),
+                      context.tqlayoutUnitToPixelY( symbol->getHeight() ) );
+    painter.setPen(TQt::green);
+    painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ),
+                      context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ),
+                      context.tqlayoutUnitToPixelX( myPos.x()+getWidth() ),
+                      context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) );
 #endif
 }
 
@@ -502,11 +502,11 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from)
     }
 }
 
-// children
+// tqchildren
 
 // main child
 //
-// If an element has children one has to become the main one.
+// If an element has tqchildren one has to become the main one.
 
 // void SymbolElement::setMainChild(SequenceElement* child)
 // {
@@ -518,7 +518,7 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from)
 
 
 /**
- * Inserts all new children at the cursor position. Places the
+ * Inserts all new tqchildren at the cursor position. Places the
  * cursor according to the direction.
  *
  * You only can insert one index at a time. So the list must contain
@@ -528,7 +528,7 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from)
  * The list will be emptied but stays the property of the caller.
  */
 void SymbolElement::insert(FormulaCursor* cursor,
-                           QPtrList& newChildren,
+                           TQPtrList& newChildren,
                            Direction direction)
 {
     SequenceElement* index = static_cast(newChildren.take(0));
@@ -557,8 +557,8 @@ void SymbolElement::insert(FormulaCursor* cursor,
 }
 
 /**
- * Removes all selected children and returns them. Places the
- * cursor to where the children have been.
+ * Removes all selected tqchildren and returns them. Places the
+ * cursor to where the tqchildren have been.
  *
  * The cursor has to be inside one of our indexes which is supposed
  * to be empty. The index will be removed and the cursor will
@@ -568,7 +568,7 @@ void SymbolElement::insert(FormulaCursor* cursor,
  * The ownership of the list is passed to the caller.
  */
 void SymbolElement::remove(FormulaCursor* cursor,
-                           QPtrList& removedChildren,
+                           TQPtrList& removedChildren,
                            Direction direction)
 {
     int pos = cursor->getPos();
@@ -586,9 +586,9 @@ void SymbolElement::remove(FormulaCursor* cursor,
         setToLower(cursor);
         break;
     case contentPos: {
-        BasicElement* parent = getParent();
-        parent->selectChild(cursor, this);
-        parent->remove(cursor, removedChildren, direction);
+        BasicElement* tqparent = getParent();
+        tqparent->selectChild(cursor, this);
+        tqparent->remove(cursor, removedChildren, direction);
         break;
     }
     }
@@ -705,25 +705,25 @@ ElementIndexPtr SymbolElement::getIndex( int position )
 /**
  * Appends our attributes to the dom element.
  */
-void SymbolElement::writeDom(QDomElement element)
+void SymbolElement::writeDom(TQDomElement element)
 {
     BasicElement::writeDom(element);
 
     element.setAttribute("TYPE", symbolType);
 
-    QDomDocument doc = element.ownerDocument();
+    TQDomDocument doc = element.ownerDocument();
 
-    QDomElement con = doc.createElement("CONTENT");
+    TQDomElement con = doc.createElement("CONTENT");
     con.appendChild(content->getElementDom(doc));
     element.appendChild(con);
 
     if(hasLower()) {
-        QDomElement ind = doc.createElement("LOWER");
+        TQDomElement ind = doc.createElement("LOWER");
         ind.appendChild(lower->getElementDom(doc));
         element.appendChild(ind);
     }
     if(hasUpper()) {
-        QDomElement ind = doc.createElement("UPPER");
+        TQDomElement ind = doc.createElement("UPPER");
         ind.appendChild(upper->getElementDom(doc));
         element.appendChild(ind);
     }
@@ -733,13 +733,13 @@ void SymbolElement::writeDom(QDomElement element)
  * Reads our attributes from the element.
  * Returns false if it failed.
  */
-bool SymbolElement::readAttributesFromDom(QDomElement element)
+bool SymbolElement::readAttributesFromDom(TQDomElement element)
 {
     if (!BasicElement::readAttributesFromDom(element)) {
         return false;
     }
 
-    QString typeStr = element.attribute("TYPE");
+    TQString typeStr = element.attribute("TYPE");
     if(!typeStr.isNull()) {
         symbolType = static_cast(typeStr.toInt());
     }
@@ -752,7 +752,7 @@ bool SymbolElement::readAttributesFromDom(QDomElement element)
  * that needs to be read.
  * Returns false if it failed.
  */
-bool SymbolElement::readContentFromDom(QDomNode& node)
+bool SymbolElement::readContentFromDom(TQDomNode& node)
 {
     if (!BasicElement::readContentFromDom(node)) {
         return false;
@@ -784,9 +784,9 @@ bool SymbolElement::readContentFromDom(QDomNode& node)
     return true;
 }
 
-QString SymbolElement::toLatex()
+TQString SymbolElement::toLatex()
 {
-    QString sym;
+    TQString sym;
 
     switch(symbolType) {
 
@@ -826,9 +826,9 @@ QString SymbolElement::toLatex()
     return sym;
 }
 
-QString SymbolElement::formulaString()
+TQString SymbolElement::formulaString()
 {
-    QString sym;
+    TQString sym;
     switch ( symbolType ) {
     case 1001:
         sym="int(";
@@ -852,12 +852,12 @@ QString SymbolElement::formulaString()
     return sym + ")";
 }
 
-void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const
+void SymbolElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const
 {
-    QDomElement de = doc.createElement( oasisFormat ? "math:mrow" : "mrow" );
-    QDomElement mo = doc.createElement( oasisFormat ? "math:mo" : "mo" );
+    TQDomElement de = doc.createElement( oasisFormat ? "math:mrow" : "mrow" );
+    TQDomElement mo = doc.createElement( oasisFormat ? "math:mo" : "mo" );
 
-    QString value;
+    TQString value;
 
     switch( symbolType )
     {
@@ -871,10 +871,10 @@ void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasis
     case Product:
         mo.appendChild( doc.createEntityReference( "prod" ) ); break;
     default:
-        mo.appendChild( doc.createTextNode( QChar( symbolType ) ) );
+        mo.appendChild( doc.createTextNode( TQChar( symbolType ) ) );
     }
 
-    QDomElement between;
+    TQDomElement between;
     if ( hasUpper() && hasLower() )
     {
         between = doc.createElement( oasisFormat ? "math:msubsup" : "msubsup" );
@@ -900,7 +900,7 @@ void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasis
     de.appendChild( between );
     content->writeMathML( doc, de, oasisFormat );
 
-    parent.appendChild( de );
+    tqparent.appendChild( de );
 }
 
 KFORMULA_NAMESPACE_END
diff --git a/lib/kformula/symbolelement.h b/lib/kformula/symbolelement.h
index cb908034..799703a6 100644
--- a/lib/kformula/symbolelement.h
+++ b/lib/kformula/symbolelement.h
@@ -36,7 +36,7 @@ public:
 
     //enum { contentPos, upperPos, lowerPos };
 
-    SymbolElement(SymbolType type = EmptyBracket, BasicElement* parent = 0);
+    SymbolElement(SymbolType type = EmptyBracket, BasicElement* tqparent = 0);
     ~SymbolElement();
 
     SymbolElement( const SymbolElement& );
@@ -54,7 +54,7 @@ public:
      * is allowed to set the cursor.
      */
     virtual BasicElement* goToPos( FormulaCursor*, bool& handled,
-                                   const LuPixelPoint& point, const LuPixelPoint& parentOrigin );
+                                   const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin );
 
     // drawing
     //
@@ -65,7 +65,7 @@ public:
 
     /**
      * Calculates our width and height and
-     * our children's parentPosition.
+     * our tqchildren's tqparentPosition.
      */
     virtual void calcSizes( const ContextStyle& cstyle,
 						    ContextStyle::TextStyle tstyle,
@@ -73,19 +73,19 @@ public:
 							StyleAttributes& style );
 
     /**
-     * Draws the whole element including its children.
-     * The `parentOrigin' is the point this element's parent starts.
-     * We can use our parentPosition to get our own origin then.
+     * Draws the whole element including its tqchildren.
+     * The `tqparentOrigin' is the point this element's tqparent starts.
+     * We can use our tqparentPosition to get our own origin then.
      */
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
 					   StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
     /**
-     * Dispatch this FontCommand to all our TextElement children.
+     * Dispatch this FontCommand to all our TextElement tqchildren.
      */
     virtual void dispatchFontCommand( FontCommand* cmd );
 
@@ -125,7 +125,7 @@ public:
      */
     virtual void moveDown(FormulaCursor* cursor, BasicElement* from);
 
-    // children
+    // tqchildren
 
     /**
      * Removes the child. If this was the main child this element might
@@ -139,14 +139,14 @@ public:
 
     // main child
     //
-    // If an element has children one has to become the main one.
+    // If an element has tqchildren one has to become the main one.
 
     virtual SequenceElement* getMainChild() { return content; }
     //virtual void setMainChild(SequenceElement*);
 
 
     /**
-     * Inserts all new children at the cursor position. Places the
+     * Inserts all new tqchildren at the cursor position. Places the
      * cursor according to the direction.
      *
      * You only can insert one index at a time. So the list must contain
@@ -155,11 +155,11 @@ public:
      *
      * The list will be emptied but stays the property of the caller.
      */
-    virtual void insert(FormulaCursor*, QPtrList&, Direction);
+    virtual void insert(FormulaCursor*, TQPtrList&, Direction);
 
     /**
-     * Removes all selected children and returns them. Places the
-     * cursor to where the children have been.
+     * Removes all selected tqchildren and returns them. Places the
+     * cursor to where the tqchildren have been.
      *
      * The cursor has to be inside one of our indexes which is supposed
      * to be empty. The index will be removed and the cursor will
@@ -168,7 +168,7 @@ public:
      *
      * The ownership of the list is passed to the caller.
      */
-    virtual void remove(FormulaCursor*, QPtrList&, Direction);
+    virtual void remove(FormulaCursor*, TQPtrList&, Direction);
 
     /**
      * Moves the cursor to a normal place where new elements
@@ -216,18 +216,18 @@ public:
     ElementIndexPtr getIndex( int position );
 
     // Save&load
-    //virtual QDomElement getElementDom(QDomDocument *doc);
-    //virtual bool buildFromDom(QDomElement *elem);
+    //virtual TQDomElement getElementDom(TQDomDocument *doc);
+    //virtual bool buildFromDom(TQDomElement *elem);
 
     /**
      * @returns the latex representation of the element and
-     * of the element's children
+     * of the element's tqchildren
      */
-    virtual QString toLatex();
+    virtual TQString toLatex();
 
-    virtual QString formulaString();
+    virtual TQString formulaString();
 
-    virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ;
+    virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ;
 
 protected:
 
@@ -236,25 +236,25 @@ protected:
     /**
      * Returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "SYMBOL"; }
+    virtual TQString getTagName() const { return "SYMBOL"; }
 
     /**
      * Appends our attributes to the dom element.
      */
-    virtual void writeDom(QDomElement element);
+    virtual void writeDom(TQDomElement element);
 
     /**
      * Reads our attributes from the element.
      * Returns false if it failed.
      */
-    virtual bool readAttributesFromDom(QDomElement element);
+    virtual bool readAttributesFromDom(TQDomElement element);
 
     /**
      * Reads our content from the node. Sets the node to the next node
      * that needs to be read.
      * Returns false if it failed.
      */
-    virtual bool readContentFromDom(QDomNode& node);
+    virtual bool readContentFromDom(TQDomNode& node);
 
 private:
 
@@ -263,34 +263,34 @@ private:
      */
     class SymbolElementIndex : public ElementIndex {
     public:
-        SymbolElementIndex(SymbolElement* p) : parent(p) {}
-        virtual SymbolElement* getElement() { return parent; }
+        SymbolElementIndex(SymbolElement* p) : tqparent(p) {}
+        virtual SymbolElement* getElement() { return tqparent; }
     protected:
-        SymbolElement* parent;
+        SymbolElement* tqparent;
     };
 
     // We have a (very simple) type for every index.
 
     class UpperIndex : public SymbolElementIndex {
     public:
-        UpperIndex(SymbolElement* parent) : SymbolElementIndex(parent) {}
+        UpperIndex(SymbolElement* tqparent) : SymbolElementIndex(tqparent) {}
         virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
-            { parent->moveToUpper(cursor, direction); }
+            { tqparent->moveToUpper(cursor, direction); }
         virtual void setToIndex(FormulaCursor* cursor)
-            { parent->setToUpper(cursor); }
+            { tqparent->setToUpper(cursor); }
         virtual bool hasIndex() const
-            { return parent->hasUpper(); }
+            { return tqparent->hasUpper(); }
     };
 
     class LowerIndex : public SymbolElementIndex {
     public:
-        LowerIndex(SymbolElement* parent) : SymbolElementIndex(parent) {}
+        LowerIndex(SymbolElement* tqparent) : SymbolElementIndex(tqparent) {}
         virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
-            { parent->moveToLower(cursor, direction); }
+            { tqparent->moveToLower(cursor, direction); }
         virtual void setToIndex(FormulaCursor* cursor)
-            { parent->setToLower(cursor); }
+            { tqparent->setToLower(cursor); }
         virtual bool hasIndex() const
-            { return parent->hasLower(); }
+            { return tqparent->hasLower(); }
     };
 
 
diff --git a/lib/kformula/symboltable.cc b/lib/kformula/symboltable.cc
index 0a444519..74f160e6 100644
--- a/lib/kformula/symboltable.cc
+++ b/lib/kformula/symboltable.cc
@@ -19,12 +19,12 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -42,19 +42,19 @@ KFORMULA_NAMESPACE_BEGIN
 #include "symbolfontmapping.cc"
 
 SymbolFontHelper::SymbolFontHelper()
-    : greek("abgdezhqiklmnxpvrstufjcywGDQLXPSUFYVW")
+    : greek("abgdezhqiklmnxpvrstufjcywGDTQLXPSUFYVW")
 {
-    for ( uint i = 0; symbolMap[ i ].unicode != 0; i++ ) {
-        compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].unicode;
+    for ( uint i = 0; symbolMap[ i ].tqunicode != 0; i++ ) {
+        compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].tqunicode;
     }
 }
 
-QChar SymbolFontHelper::unicodeFromSymbolFont( QChar pos ) const
+TQChar SymbolFontHelper::tqunicodeFromSymbolFont( TQChar pos ) const
 {
-    if ( compatibility.contains( pos ) ) {
+    if ( compatibility.tqcontains( pos ) ) {
         return compatibility[ pos.latin1() ];
     }
-    return QChar::null;
+    return TQChar::null;
 }
 
 
@@ -63,48 +63,48 @@ SymbolTable::SymbolTable()
 }
 
 
-void SymbolTable::init( const QFont& font )
+void SymbolTable::init( const TQFont& font )
 {
     backupFont = font;
-    for ( int i=0; operatorTable[i].unicode != 0; ++i ) {
-        names[QChar( operatorTable[i].unicode )] = get_name( operatorTable[i] );
-        entries[get_name( operatorTable[i] )] = QChar( operatorTable[i].unicode );
+    for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) {
+        names[TQChar( operatorTable[i].tqunicode )] = get_name( operatorTable[i] );
+        entries[get_name( operatorTable[i] )] = TQChar( operatorTable[i].tqunicode );
     }
-    for ( int i=0; arrowTable[i].unicode != 0; ++i ) {
-        names[QChar( arrowTable[i].unicode )] = get_name( arrowTable[i] );
-        entries[get_name( arrowTable[i] )] = QChar( arrowTable[i].unicode );
+    for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) {
+        names[TQChar( arrowTable[i].tqunicode )] = get_name( arrowTable[i] );
+        entries[get_name( arrowTable[i] )] = TQChar( arrowTable[i].tqunicode );
     }
-    for ( int i=0; greekTable[i].unicode != 0; ++i ) {
-        names[QChar( greekTable[i].unicode )] = get_name( greekTable[i] );
-        entries[get_name( greekTable[i] )] = QChar( greekTable[i].unicode );
+    for ( int i=0; greekTable[i].tqunicode != 0; ++i ) {
+        names[TQChar( greekTable[i].tqunicode )] = get_name( greekTable[i] );
+        entries[get_name( greekTable[i] )] = TQChar( greekTable[i].tqunicode );
     }
 }
 
-bool SymbolTable::contains(QString name) const
+bool SymbolTable::tqcontains(TQString name) const
 {
-    return entries.find( name ) != entries.end();
+    return entries.tqfind( name ) != entries.end();
 }
 
-QChar SymbolTable::unicode(QString name) const
+TQChar SymbolTable::tqunicode(TQString name) const
 {
     return entries[ name ];
 }
 
 
-QString SymbolTable::name( QChar symbol ) const
+TQString SymbolTable::name( TQChar symbol ) const
 {
     return names[symbol];
 }
 
-QFont SymbolTable::font( QChar symbol, const QFont& f ) const {
-    QFontMetrics fm( f );
+TQFont SymbolTable::font( TQChar symbol, const TQFont& f ) const {
+    TQFontMetrics fm( f );
     if ( fm.inFont( symbol ) ) {
         return f;
     }
-    return QFont("Arev Sans");
+    return TQFont("Arev Sans");
 }
 
-CharClass SymbolTable::charClass( QChar symbol ) const
+CharClass SymbolTable::charClass( TQChar symbol ) const
 {
     return ORDINARY;
     // FIXME
@@ -112,39 +112,39 @@ CharClass SymbolTable::charClass( QChar symbol ) const
 }
 
 
-QChar SymbolTable::unicodeFromSymbolFont( QChar pos ) const
+TQChar SymbolTable::tqunicodeFromSymbolFont( TQChar pos ) const
 {
-    return symbolFontHelper.unicodeFromSymbolFont( pos );
+    return symbolFontHelper.tqunicodeFromSymbolFont( pos );
 }
 
 
-QString SymbolTable::greekLetters() const
+TQString SymbolTable::greekLetters() const
 {
     return symbolFontHelper.greekLetters();
 }
 
 
-QStringList SymbolTable::allNames() const
+TQStringList SymbolTable::allNames() const
 {
-    QStringList list;
+    TQStringList list;
 
-    for ( int i=0; operatorTable[i].unicode != 0; ++i ) {
+    for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) {
         list.append( get_name( operatorTable[i] ));
     }
-    for ( int i=0; arrowTable[i].unicode != 0; ++i ) {
+    for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) {
         list.append( get_name( arrowTable[i] ));
     }
-    for ( int i=0; greekTable[i].unicode != 0; ++i ) {
+    for ( int i=0; greekTable[i].tqunicode != 0; ++i ) {
         list.append( get_name( greekTable[i] ) );
     }
     return list;
 }
 
 
-QString SymbolTable::get_name( struct UnicodeNameTable entry ) const
+TQString SymbolTable::get_name( struct UnicodeNameTable entry ) const
 {
     if ( !*entry.name ) {
-        return "U" + QString( "%1" ).arg( entry.unicode, 4, 16 ).upper();
+        return "U" + TQString( "%1" ).tqarg( entry.tqunicode, 4, 16 ).upper();
     }
     return entry.name;
 }
diff --git a/lib/kformula/symboltable.h b/lib/kformula/symboltable.h
index 9218e6b4..a7776adc 100644
--- a/lib/kformula/symboltable.h
+++ b/lib/kformula/symboltable.h
@@ -22,11 +22,11 @@
 #ifndef SYMBOLTABLE_H
 #define SYMBOLTABLE_H
 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include "kformuladefs.h"
 
@@ -48,24 +48,24 @@ public:
     /**
      * @returns a string with all greek letters.
      */
-    QString greekLetters() const { return greek; }
+    TQString greekLetters() const { return greek; }
 
     /**
-     * @returns the unicode value of the symbol font char.
+     * @returns the tqunicode value of the symbol font char.
      */
-    QChar unicodeFromSymbolFont( QChar pos ) const;
+    TQChar tqunicodeFromSymbolFont( TQChar pos ) const;
 
 private:
 
     /**
-     * symbol font char -> unicode mapping.
+     * symbol font char -> tqunicode mapping.
      */
-    QMap compatibility;
+    TQMap compatibility;
 
     /**
      * All greek letters that are known.
      */
-    QString greek;
+    TQString greek;
 };
 
 
@@ -83,50 +83,50 @@ public:
      * lazy init support. Needs to be run before anything else.
      * @param install if true fonts may be installed if needed
      */
-    void init( const QFont& font );
+    void init( const TQFont& font );
 
-    bool contains( QString name ) const;
+    bool tqcontains( TQString name ) const;
 
     /**
      * @returns the char in the symbol font that belongs to
      * the given name.
      */
-    QChar unicode( QString name ) const;
-    QString name( QChar symbol ) const;
+    TQChar tqunicode( TQString name ) const;
+    TQString name( TQChar symbol ) const;
 
-    QFont font( QChar symbol, const QFont& f ) const;
+    TQFont font( TQChar symbol, const TQFont& f ) const;
 
-    CharClass charClass( QChar symbol ) const;
+    CharClass charClass( TQChar symbol ) const;
 
     /**
      * @returns a string with all greek letters.
      */
-    QString greekLetters() const;
+    TQString greekLetters() const;
 
     /**
-     * @returns the unicode value of the symbol font char.
+     * @returns the tqunicode value of the symbol font char.
      */
-    QChar unicodeFromSymbolFont( QChar pos ) const;
+    TQChar tqunicodeFromSymbolFont( TQChar pos ) const;
 
     /**
      * @returns all known names as strings.
      */
-    QStringList allNames() const;
+    TQStringList allNames() const;
 
-    typedef QMap NameTable;
-    typedef QMap EntryTable;
+    typedef TQMap NameTable;
+    typedef TQMap EntryTable;
 
 private:
 
-    QString get_name( UnicodeNameTable entry ) const;
+    TQString get_name( UnicodeNameTable entry ) const;
 
     /**
-     * unicode -> name mapping.
+     * tqunicode -> name mapping.
      */
     NameTable names;
 
     /**
-     * Name -> unicode mapping.
+     * Name -> tqunicode mapping.
      */
     EntryTable entries;
 
@@ -140,7 +140,7 @@ private:
      * this table is present in this font. If user selected font doesn't have
      * the needed glyph this font will be used instead.
      */
-    QFont backupFont;
+    TQFont backupFont;
 };
 
 KFORMULA_NAMESPACE_END
diff --git a/lib/kformula/textelement.cc b/lib/kformula/textelement.cc
index 7526acb6..24eae2d8 100644
--- a/lib/kformula/textelement.cc
+++ b/lib/kformula/textelement.cc
@@ -18,8 +18,8 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
-#include 
+#include 
+#include 
 
 #include 
 
@@ -37,8 +37,8 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-TextElement::TextElement(QChar ch, bool beSymbol, BasicElement* parent)
-        : BasicElement(parent), character(ch), symbol(beSymbol)
+TextElement::TextElement(TQChar ch, bool beSymbol, BasicElement* tqparent)
+        : BasicElement(tqparent), character(ch), symbol(beSymbol)
 {
     charStyle( anyChar );
     charFamily( anyFamily );
@@ -66,7 +66,7 @@ TokenType TextElement::getTokenType() const
         return getSymbolTable().charClass( character );
     }
 
-    switch ( character.unicode() ) {
+    switch ( character.tqunicode() ) {
     case '+':
     case '-':
     case '*':
@@ -106,7 +106,7 @@ bool TextElement::isInvisible() const
 
 /**
  * Calculates our width and height and
- * our children's parentPosition.
+ * our tqchildren's tqparentPosition.
  */
 void TextElement::calcSizes( const ContextStyle& context, 
                              ContextStyle::TextStyle tstyle, 
@@ -119,27 +119,27 @@ void TextElement::calcSizes( const ContextStyle& context,
     setCharStyle( style.charStyle() );
     setCharFamily( style.charFamily() );
 
-    QFont font = getFont( context, style );
-    double fontsize = context.layoutUnitPtToPt( mySize );
+    TQFont font = getFont( context, style );
+    double fontsize = context.tqlayoutUnitPtToPt( mySize );
     double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() );
     double size = fontsize * scriptsize;
     font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size );
 
-    QFontMetrics fm( font );
+    TQFontMetrics fm( font );
     if ( character == applyFunctionChar || character == invisibleTimes || character == invisibleComma ) {
         setWidth( 0 );
         setHeight( 0 );
         setBaseline( getHeight() );
     }
     else {
-        QChar ch = getRealCharacter(context);
-        if ( ch == QChar::null ) {
-            setWidth( qRound( context.getEmptyRectWidth( factor ) * 2./3. ) );
-            setHeight( qRound( context.getEmptyRectHeight( factor ) * 2./3. ) );
+        TQChar ch = getRealCharacter(context);
+        if ( ch == TQChar::null ) {
+            setWidth( tqRound( context.getEmptyRectWidth( factor ) * 2./3. ) );
+            setHeight( tqRound( context.getEmptyRectHeight( factor ) * 2./3. ) );
             setBaseline( getHeight() );
         }
         else {
-            QRect bound = fm.boundingRect( ch );
+            TQRect bound = fm.boundingRect( ch );
             setWidth( context.ptToLayoutUnitPt( fm.width( ch ) ) );
             setHeight( context.ptToLayoutUnitPt( bound.height() ) );
             setBaseline( context.ptToLayoutUnitPt( -bound.top() ) );
@@ -155,22 +155,22 @@ void TextElement::calcSizes( const ContextStyle& context,
 }
 
 /**
- * Draws the whole element including its children.
- * The `parentOrigin' is the point this element's parent starts.
- * We can use our parentPosition to get our own origin then.
+ * Draws the whole element including its tqchildren.
+ * The `tqparentOrigin' is the point this element's tqparent starts.
+ * We can use our tqparentPosition to get our own origin then.
  */
-void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
+void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/,
                         const ContextStyle& context,
                         ContextStyle::TextStyle tstyle,
                         ContextStyle::IndexStyle /*istyle*/,
                         StyleAttributes& style,
-                        const LuPixelPoint& parentOrigin )
+                        const LuPixelPoint& tqparentOrigin )
 {
     if ( character == applyFunctionChar || character == invisibleTimes || character == invisibleComma ) {
         return;
     }
 
-    LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() );
+    LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() );
     //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
     //    return;
 
@@ -183,8 +183,8 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
 
     double factor = style.sizeFactor();
     luPt mySize = context.getAdjustedSize( tstyle, factor );
-    QFont font = getFont( context, style );
-    double fontsize = context.layoutUnitPtToPt( mySize );
+    TQFont font = getFont( context, style );
+    double fontsize = context.tqlayoutUnitPtToPt( mySize );
     double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() );
     double size = fontsize * scriptsize;
     font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size );
@@ -192,7 +192,7 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
 
     //kdDebug( DEBUGID ) << "TextElement::draw font=" << font.rawName() << endl;
     //kdDebug( DEBUGID ) << "TextElement::draw size=" << mySize << endl;
-    //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.layoutUnitToFontSize( mySize, false ) << endl;
+    //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.tqlayoutUnitToFontSize( mySize, false ) << endl;
     //kdDebug( DEBUGID ) << "TextElement::draw height: " << getHeight() << endl;
     //kdDebug( DEBUGID ) << "TextElement::draw width: " << getWidth() << endl;
     //kdDebug( DEBUGID ) << endl;
@@ -201,23 +201,23 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
     /*
     ElementType* token = getElementType();
     if ( ( token != 0 ) && !symbol ) {
-        QString text = token->text( static_cast( getParent() ) );
-//         kdDebug() << "draw text: " << text[0].unicode()
+        TQString text = token->text( static_cast( getParent() ) );
+//         kdDebug() << "draw text: " << text[0].tqunicode()
 //                   << " " << painter.font().family().latin1()
 //                   << endl;
-        painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() ),
-                          context.layoutUnitToPixelY( parentOrigin.y() ),
-                          context.layoutUnitToPixelX( getParent()->getWidth() ),
-                          context.layoutUnitToPixelY( getParent()->getHeight() ),
+        painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() ),
+                          context.tqlayoutUnitToPixelY( tqparentOrigin.y() ),
+                          context.tqlayoutUnitToPixelX( getParent()->getWidth() ),
+                          context.tqlayoutUnitToPixelY( getParent()->getHeight() ),
                           style.background() );
-        painter.drawText( context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y()+getBaseline() ),
+        painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ),
                           text );
     }
     else {
     */
-        QChar ch = getRealCharacter(context);
-        if ( ch != QChar::null ) {
+        TQChar ch = getRealCharacter(context);
+        if ( ch != TQChar::null ) {
             luPixel bl = getBaseline();
             if ( bl == -1 ) {
                 // That's quite hacky and actually not the way it's
@@ -226,29 +226,29 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
                 // baseline==0 glyphs without yet another flag.
                 bl = -( getHeight()/2 + context.axisHeight( tstyle, factor ) );
             }
-            painter.drawText( context.layoutUnitToPixelX( myPos.x() ),
-                              context.layoutUnitToPixelY( myPos.y()+bl ),
-                              ch );
+            painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ),
+                              context.tqlayoutUnitToPixelY( myPos.y()+bl ),
+                              TQString(ch) );
         }
         else {
-            painter.setPen( QPen( context.getErrorColor(),
-                                  context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) );
-            painter.drawRect( context.layoutUnitToPixelX( myPos.x() ),
-                              context.layoutUnitToPixelY( myPos.y() ),
-                              context.layoutUnitToPixelX( getWidth() ),
-                              context.layoutUnitToPixelY( getHeight() ) );
+            painter.setPen( TQPen( context.getErrorColor(),
+                                  context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) );
+            painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ),
+                              context.tqlayoutUnitToPixelY( myPos.y() ),
+                              context.tqlayoutUnitToPixelX( getWidth() ),
+                              context.tqlayoutUnitToPixelY( getHeight() ) );
         }
 //    }
 
     // Debug
-    //painter.setBrush(Qt::NoBrush);
+    //painter.setBrush(TQt::NoBrush);
 //     if ( isSymbol() ) {
-//         painter.setPen( Qt::red );
-//         painter.drawRect( context.layoutUnitToPixelX( myPos.x() ),
-//                           context.layoutUnitToPixelX( myPos.y() ),
-//                           context.layoutUnitToPixelX( getWidth() ),
-//                           context.layoutUnitToPixelX( getHeight() ) );
-//         painter.setPen(Qt::green);
+//         painter.setPen( TQt::red );
+//         painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ),
+//                           context.tqlayoutUnitToPixelX( myPos.y() ),
+//                           context.tqlayoutUnitToPixelX( getWidth() ),
+//                           context.tqlayoutUnitToPixelX( getHeight() ) );
+//         painter.setPen(TQt::green);
 //         painter.drawLine(myPos.x(), myPos.y()+axis( context, tstyle ),
 //                          myPos.x()+getWidth(), myPos.y()+axis( context, tstyle ));
 //     }
@@ -272,7 +272,7 @@ void TextElement::setCharFamily( CharFamily cf )
     formula()->changed();
 }
 
-QChar TextElement::getRealCharacter(const ContextStyle& context)
+TQChar TextElement::getRealCharacter(const ContextStyle& context)
 {
     return character;
 /*
@@ -296,10 +296,10 @@ QChar TextElement::getRealCharacter(const ContextStyle& context)
 }
 
 
-QFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& style)
+TQFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& style)
 {
     const FontStyle& fontStyle = context.fontStyle();
-    QFont font;
+    TQFont font;
     if ( style.customFont() ) {
         font = style.font();
     }
@@ -335,13 +335,13 @@ QFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& s
 }
 
 
-void TextElement::setUpPainter(const ContextStyle& context, QPainter& painter)
+void TextElement::setUpPainter(const ContextStyle& context, TQPainter& painter)
 {
     if (getElementType() != 0) {
         getElementType()->setUpPainter(context, painter);
     }
     else {
-        painter.setPen(Qt::red);
+        painter.setPen(TQt::red);
     }
 }
 
@@ -351,19 +351,19 @@ const SymbolTable& TextElement::getSymbolTable() const
 }
 
 
-void TextElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool ) const
+void TextElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool ) const
 {
-    parent.appendChild( doc.createTextNode( getCharacter() ) );
+    tqparent.appendChild( doc.createTextNode( getCharacter() ) );
 }
 
 /**
  * Appends our attributes to the dom element.
  */
-void TextElement::writeDom(QDomElement element)
+void TextElement::writeDom(TQDomElement element)
 {
     BasicElement::writeDom(element);
-    element.setAttribute("CHAR", QString(character));
-    //QString s;
+    element.setAttribute("CHAR", TQString(character));
+    //TQString s;
     //element.setAttribute("CHAR", s.sprintf( "#x%05X", character ) );
     if (symbol) element.setAttribute("SYMBOL", "3");
 
@@ -388,23 +388,23 @@ void TextElement::writeDom(QDomElement element)
  * Reads our attributes from the element.
  * Returns false if it failed.
  */
-bool TextElement::readAttributesFromDom(QDomElement element)
+bool TextElement::readAttributesFromDom(TQDomElement element)
 {
     if (!BasicElement::readAttributesFromDom(element)) {
         return false;
     }
-    QString charStr = element.attribute("CHAR");
+    TQString charStr = element.attribute("CHAR");
     if(!charStr.isNull()) {
         character = charStr.at(0);
     }
-    QString symbolStr = element.attribute("SYMBOL");
+    TQString symbolStr = element.attribute("SYMBOL");
     if(!symbolStr.isNull()) {
         int symbolInt = symbolStr.toInt();
         if ( symbolInt == 1 ) {
-            character = getSymbolTable().unicodeFromSymbolFont(character);
+            character = getSymbolTable().tqunicodeFromSymbolFont(character);
         }
         if ( symbolInt == 2 ) {
-            switch ( character.unicode() ) {
+            switch ( character.tqunicode() ) {
             case 0x03D5: character = 0x03C6; break;
             case 0x03C6: character = 0x03D5; break;
             case 0x03Ba: character = 0x03BA; break;
@@ -423,7 +423,7 @@ bool TextElement::readAttributesFromDom(QDomElement element)
         symbol = symbolInt != 0;
     }
 
-    QString styleStr = element.attribute("STYLE");
+    TQString styleStr = element.attribute("STYLE");
     if ( styleStr == "normal" ) {
         charStyle( normalChar );
     }
@@ -440,7 +440,7 @@ bool TextElement::readAttributesFromDom(QDomElement element)
         charStyle( anyChar );
     }
 
-    QString familyStr = element.attribute( "FAMILY" );
+    TQString familyStr = element.attribute( "FAMILY" );
     if ( familyStr == "normal" ) {
         charFamily( normalFamily );
     }
@@ -469,28 +469,28 @@ bool TextElement::readAttributesFromDom(QDomElement element)
  * that needs to be read.
  * Returns false if it failed.
  */
-bool TextElement::readContentFromDom(QDomNode& node)
+bool TextElement::readContentFromDom(TQDomNode& node)
 {
     return BasicElement::readContentFromDom(node);
 }
 
-QString TextElement::toLatex()
+TQString TextElement::toLatex()
 {
     if ( isSymbol() ) {
-        QString texName = getSymbolTable().name( character );
+        TQString texName = getSymbolTable().name( character );
         if ( !texName.isNull() )
             return " \\" + texName + " ";
         return  " ? ";
     }
     else {
-        return QString(character);
+        return TQString(character);
     }
 }
 
-QString TextElement::formulaString()
+TQString TextElement::formulaString()
 {
     if ( isSymbol() ) {
-        QString texName = getSymbolTable().name( character );
+        TQString texName = getSymbolTable().name( character );
         if ( !texName.isNull() )
             return " " + texName + " ";
         return " ? ";
@@ -501,8 +501,8 @@ QString TextElement::formulaString()
 }
 
 
-EmptyElement::EmptyElement( BasicElement* parent )
-    : BasicElement( parent )
+EmptyElement::EmptyElement( BasicElement* tqparent )
+    : BasicElement( tqparent )
 {
 }
 
@@ -526,25 +526,25 @@ void EmptyElement::calcSizes( const ContextStyle& context,
     luPt mySize = context.getAdjustedSize( tstyle, style.sizeFactor() );
     //kdDebug( DEBUGID ) << "TextElement::calcSizes size=" << mySize << endl;
 
-    QFont font = context.getDefaultFont();
-    font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
+    TQFont font = context.getDefaultFont();
+    font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) );
 
-    QFontMetrics fm( font );
-    QChar ch = 'A';
-    QRect bound = fm.boundingRect( ch );
+    TQFontMetrics fm( font );
+    TQChar ch = 'A';
+    TQRect bound = fm.boundingRect( ch );
     setWidth( 0 );
     setHeight( context.ptToLayoutUnitPt( bound.height() ) );
     setBaseline( context.ptToLayoutUnitPt( -bound.top() ) );
 }
 
-void EmptyElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
+void EmptyElement::draw( TQPainter& painter, const LuPixelRect& /*r*/,
                          const ContextStyle& context,
                          ContextStyle::TextStyle /*tstyle*/,
                          ContextStyle::IndexStyle /*istyle*/,
                          StyleAttributes& /*style*/ ,
-                         const LuPixelPoint& parentOrigin )
+                         const LuPixelPoint& tqparentOrigin )
 {
-    LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() );
+    LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() );
     /*
     if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
         return;
@@ -552,14 +552,14 @@ void EmptyElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
 
     if ( context.edit() ) {
         painter.setPen( context.getHelpColor() );
-        painter.drawLine( context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y() ),
-                          context.layoutUnitToPixelX( myPos.x() ),
-                          context.layoutUnitToPixelY( myPos.y()+getHeight() ) );
+        painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y() ),
+                          context.tqlayoutUnitToPixelX( myPos.x() ),
+                          context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) );
     }
 }
 
-QString EmptyElement::toLatex()
+TQString EmptyElement::toLatex()
 {
     return "{}";
 }
diff --git a/lib/kformula/textelement.h b/lib/kformula/textelement.h
index bac10acc..0b97f441 100644
--- a/lib/kformula/textelement.h
+++ b/lib/kformula/textelement.h
@@ -21,8 +21,8 @@
 #ifndef TEXTELEMENT_H
 #define TEXTELEMENT_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "basicelement.h"
 
@@ -38,7 +38,7 @@ class TextElement : public BasicElement {
     TextElement operator=( const TextElement& ) { return *this; }
 public:
 
-    TextElement(QChar ch = ' ', bool beSymbol = false, BasicElement* parent = 0);
+    TextElement(TQChar ch = ' ', bool beSymbol = false, BasicElement* tqparent = 0);
     TextElement( const TextElement& );
 
     virtual TextElement* clone() {
@@ -62,7 +62,7 @@ public:
      * @returns the character that represents this element. Used for
      * parsing a sequence.
      */
-    virtual QChar getCharacter() const { return character; }
+    virtual TQChar getCharacter() const { return character; }
 
     // drawing
     //
@@ -73,7 +73,7 @@ public:
 
     /**
      * Calculates our width and height and
-     * our children's parentPosition.
+     * our tqchildren's tqparentPosition.
      */
     virtual void calcSizes( const ContextStyle& cstyle,
 						    ContextStyle::TextStyle tstyle,
@@ -81,26 +81,26 @@ public:
 							StyleAttributes& style );
 
     /**
-     * Draws the whole element including its children.
-     * The `parentOrigin' is the point this element's parent starts.
-     * We can use our parentPosition to get our own origin then.
+     * Draws the whole element including its tqchildren.
+     * The `tqparentOrigin' is the point this element's tqparent starts.
+     * We can use our tqparentPosition to get our own origin then.
      */
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
 					   StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
     /**
-     * Dispatch this FontCommand to all our TextElement children.
+     * Dispatch this FontCommand to all our TextElement tqchildren.
      */
     virtual void dispatchFontCommand( FontCommand* cmd );
 
     /**
      * Set the color to use to display
      */
-	void setColor( QColor c ) { color = c; }
+	void setColor( TQColor c ) { color = c; }
 
     CharStyle getCharStyle() const { return charStyle(); }
     void setCharStyle( CharStyle cs );
@@ -123,13 +123,13 @@ public:
 
     /**
      * @returns the latex representation of the element and
-     * of the element's children
+     * of the element's tqchildren
      */
-    virtual QString toLatex();
+    virtual TQString toLatex();
 
-    virtual QString formulaString();
+    virtual TQString formulaString();
 
-    virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ;
+    virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ;
 
 protected:
 
@@ -138,40 +138,40 @@ protected:
     /**
      * @returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "TEXT"; }
+    virtual TQString getTagName() const { return "TEXT"; }
 
     /**
      * Appends our attributes to the dom element.
      */
-    virtual void writeDom(QDomElement element);
+    virtual void writeDom(TQDomElement element);
 
     /**
      * Reads our attributes from the element.
      * Returns false if it failed.
      */
-    virtual bool readAttributesFromDom(QDomElement element);
+    virtual bool readAttributesFromDom(TQDomElement element);
 
     /**
      * Reads our content from the node. Sets the node to the next node
      * that needs to be read.
      * Returns false if it failed.
      */
-    virtual bool readContentFromDom(QDomNode& node);
+    virtual bool readContentFromDom(TQDomNode& node);
 
     /**
      * @returns the char that is used to draw with the given font.
      */
-    QChar getRealCharacter(const ContextStyle& context);
+    TQChar getRealCharacter(const ContextStyle& context);
 
     /**
      * @returns the font to be used for the element.
      */
-    QFont getFont(const ContextStyle& context, const StyleAttributes& style);
+    TQFont getFont(const ContextStyle& context, const StyleAttributes& style);
 
     /**
      * Sets up the painter to be used for drawing.
      */
-    void setUpPainter(const ContextStyle& context, QPainter& painter);
+    void setUpPainter(const ContextStyle& context, TQPainter& painter);
 
     const SymbolTable& getSymbolTable() const;
 
@@ -180,7 +180,7 @@ private:
     /**
      * Our content.
      */
-    QChar character;
+    TQChar character;
 
     /**
      * Whether this character is a symbol.
@@ -190,7 +190,7 @@ private:
 	/**
 	 * Color to display. Set by container.
 	 */
-	QColor color;
+	TQColor color;
 
     /**
      * The attribute of the char. "anyChar" means leave the default.
@@ -226,7 +226,7 @@ class EmptyElement : public BasicElement {
     EmptyElement& operator=( const EmptyElement& ) { return *this; }
 public:
 
-    EmptyElement( BasicElement* parent = 0 );
+    EmptyElement( BasicElement* tqparent = 0 );
     EmptyElement( const EmptyElement& );
 
     virtual EmptyElement* clone() {
@@ -240,11 +240,11 @@ public:
      * parsing a sequence.
      * Here we use a dummy so an EmptyElement pretends to be a letter.
      */
-    virtual QChar getCharacter() const { return 'A'; }
+    virtual TQChar getCharacter() const { return 'A'; }
 
     /**
      * Calculates our width and height and
-     * our children's parentPosition.
+     * our tqchildren's tqparentPosition.
      */
     virtual void calcSizes( const ContextStyle& cstyle,
 						    ContextStyle::TextStyle tstyle,
@@ -252,23 +252,23 @@ public:
 							StyleAttributes& style );
 
     /**
-     * Draws the whole element including its children.
-     * The `parentOrigin' is the point this element's parent starts.
-     * We can use our parentPosition to get our own origin then.
+     * Draws the whole element including its tqchildren.
+     * The `tqparentOrigin' is the point this element's tqparent starts.
+     * We can use our tqparentPosition to get our own origin then.
      */
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
 					   StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
 
     /**
      * @returns the latex representation of the element and
-     * of the element's children
+     * of the element's tqchildren
      */
-    virtual QString toLatex();
+    virtual TQString toLatex();
 
 protected:
 
@@ -277,7 +277,7 @@ protected:
     /**
      * @returns the tag name of this element type.
      */
-    virtual QString getTagName() const { return "EMPTY"; }
+    virtual TQString getTagName() const { return "EMPTY"; }
 
 };
 
diff --git a/lib/kformula/tokenelement.cc b/lib/kformula/tokenelement.cc
index 6c849e9c..bb63c05f 100644
--- a/lib/kformula/tokenelement.cc
+++ b/lib/kformula/tokenelement.cc
@@ -19,7 +19,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include 
 
@@ -38,16 +38,16 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-TokenElement::TokenElement( BasicElement* parent ) : TokenStyleElement( parent ),
+TokenElement::TokenElement( BasicElement* tqparent ) : TokenStyleElement( tqparent ),
                                                      m_textOnly( true )
 {
 }
 
-int TokenElement::buildChildrenFromMathMLDom(QPtrList& list, QDomNode n) 
+int TokenElement::buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n) 
 {
     while ( ! n.isNull() ) {
         if ( n.isText() ) {
-            QString textelements = n.toText().data();
+            TQString textelements = n.toText().data();
             textelements = textelements.stripWhiteSpace();
                 
             for (uint i = 0; i < textelements.length(); i++) {
@@ -59,15 +59,15 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList& list, QDomN
             }
         }
         else if ( n.isEntityReference() ) {
-            QString entity = n.toEntityReference().nodeName();
+            TQString entity = n.toEntityReference().nodeName();
             const entityMap* begin = entities;
             const entityMap* end = entities + entityMap::size();
             const entityMap* pos = std::lower_bound( begin, end, entity.ascii() );
-            if ( pos == end || QString( pos->name ) != entity ) {
+            if ( pos == end || TQString( pos->name ) != entity ) {
                 kdWarning() << "Invalid entity refererence: " << entity << endl;
             }
             else {
-                TextElement* child = new TextElement( QChar( pos->unicode ) );
+                TextElement* child = new TextElement( TQChar( pos->tqunicode ) );
                 child->setParent(this);
                 child->setCharFamily( charFamily() );
                 child->setCharStyle( charStyle() );
@@ -77,7 +77,7 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList& list, QDomN
         else if ( n.isElement() ) {
             m_textOnly = false;
             // Only mglyph element is allowed
-            QDomElement e = n.toElement();
+            TQDomElement e = n.toElement();
             if ( e.tagName().lower() != "mglyph" ) {
                 kdWarning( DEBUGID ) << "Invalid element inside Token Element\n";
                 return -1;
@@ -97,7 +97,7 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList& list, QDomN
         n = n.nextSibling();
     }
 //	parse();
-	kdWarning() << "Num of children " << list.count() << endl;
+	kdWarning() << "Num of tqchildren " << list.count() << endl;
     return 1;
 }
 
diff --git a/lib/kformula/tokenelement.h b/lib/kformula/tokenelement.h
index 8a64bb99..9982225b 100644
--- a/lib/kformula/tokenelement.h
+++ b/lib/kformula/tokenelement.h
@@ -30,13 +30,13 @@ KFORMULA_NAMESPACE_BEGIN
 class TokenElement : public TokenStyleElement {
     typedef TokenStyleElement inherited;
 public:
-    TokenElement( BasicElement* parent = 0 );
+    TokenElement( BasicElement* tqparent = 0 );
 
-	virtual int buildChildrenFromMathMLDom(QPtrList& list, QDomNode n);
+	virtual int buildChildrenFromMathMLDom(TQPtrList& list, TQDomNode n);
 
-    virtual QString getElementName() const { return "mtext"; }
+    virtual TQString getElementName() const { return "mtext"; }
 protected:
-    QString getCharFromEntity( const QString& entity );
+    TQString getCharFromEntity( const TQString& entity );
 
     /**
      * @returns true if the sequence contains only text.
diff --git a/lib/kformula/tokenstyleelement.cc b/lib/kformula/tokenstyleelement.cc
index d205f70d..43731425 100644
--- a/lib/kformula/tokenstyleelement.cc
+++ b/lib/kformula/tokenstyleelement.cc
@@ -17,14 +17,14 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include 
+#include 
 
 #include "basicelement.h"
 #include "tokenstyleelement.h"
 
 KFORMULA_NAMESPACE_BEGIN
 
-TokenStyleElement::TokenStyleElement( BasicElement* parent ) : SequenceElement( parent ),
+TokenStyleElement::TokenStyleElement( BasicElement* tqparent ) : SequenceElement( tqparent ),
                                                      m_mathSizeType ( NoSize ),
                                                      m_charStyle( anyChar ),
                                                      m_charFamily( anyFamily ),
@@ -54,36 +54,36 @@ void TokenStyleElement::calcSizes( const ContextStyle& context,
     resetStyle( style );
 }
 
-void TokenStyleElement::draw( QPainter& painter, const LuPixelRect& r,
+void TokenStyleElement::draw( TQPainter& painter, const LuPixelRect& r,
                          const ContextStyle& context,
                          ContextStyle::TextStyle tstyle,
                          ContextStyle::IndexStyle istyle,
                          StyleAttributes& style,
-                         const LuPixelPoint& parentOrigin )
+                         const LuPixelPoint& tqparentOrigin )
 {
     setStyleSize( context, style );
     setStyleVariant( style );
     setStyleColor( style );
     setStyleBackground( style );
-    if ( style.background() != Qt::color0 ) {
-        painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() + getX() ),
-                          context.layoutUnitToPixelY( parentOrigin.y() + getY() ),
-                          context.layoutUnitToPixelX( getWidth() ),
-                          context.layoutUnitToPixelY( getHeight() ),
+    if ( style.background() != TQt::color0 ) {
+        painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ),
+                          context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() ),
+                          context.tqlayoutUnitToPixelX( getWidth() ),
+                          context.tqlayoutUnitToPixelY( getHeight() ),
                           style.background() );
     }
-    inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin );
+    inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin );
     resetStyle( style );
 }
 
-bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element )
+bool TokenStyleElement::readAttributesFromMathMLDom( const TQDomElement& element )
 {
     if ( !BasicElement::readAttributesFromMathMLDom( element ) ) {
         return false;
     }
 
     // MathML Section 3.2.2
-    QString variantStr = element.attribute( "mathvariant" );
+    TQString variantStr = element.attribute( "mathvariant" );
     if ( !variantStr.isNull() ) {
         if ( variantStr == "normal" ) {
             setCharStyle( normalChar );
@@ -143,7 +143,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
         }
     }
 
-    QString sizeStr = element.attribute( "mathsize" );
+    TQString sizeStr = element.attribute( "mathsize" );
     if ( !sizeStr.isNull() ) {
         if ( sizeStr == "small" ) {
             setRelativeSize( 0.8 ); // ### Arbitrary size
@@ -172,22 +172,22 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
         }
     }
 
-    QString colorStr = element.attribute( "mathcolor" );
+    TQString colorStr = element.attribute( "mathcolor" );
     if ( !colorStr.isNull() ) {
         if ( colorStr[0] != '#' ) {
-            setMathColor( QColor( getHtmlColor( colorStr ) ) );
+            setMathColor( TQColor( getHtmlColor( colorStr ) ) );
         }
         else {
-            setMathColor( QColor( colorStr ) );
+            setMathColor( TQColor( colorStr ) );
         }
 	}
-    QString backgroundStr = element.attribute( "mathbackground" );
+    TQString backgroundStr = element.attribute( "mathbackground" );
     if ( !backgroundStr.isNull() ) {
         if ( backgroundStr[0] != '#' ) {
-            setMathBackground( QColor( getHtmlColor( backgroundStr ) ) );
+            setMathBackground( TQColor( getHtmlColor( backgroundStr ) ) );
         }
         else {
-            setMathBackground( QColor( backgroundStr ) );
+            setMathBackground( TQColor( backgroundStr ) );
         }
 	}
 
@@ -222,7 +222,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
         }
     }
 
-    QString styleStr = element.attribute( "fontstyle" );
+    TQString styleStr = element.attribute( "fontstyle" );
     if ( ! styleStr.isNull() ) {
         if ( styleStr.lower() == "italic" ) {
             setFontStyle( true );
@@ -232,7 +232,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
         }
     }
 
-    QString weightStr = element.attribute( "fontweight" );
+    TQString weightStr = element.attribute( "fontweight" );
     if ( ! weightStr.isNull() ) {
         if ( weightStr.lower() == "bold" ) {
             setFontWeight( true );
@@ -242,7 +242,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
         }
     }
 
-    QString familyStr =  element.attribute( "fontfamily" );
+    TQString familyStr =  element.attribute( "fontfamily" );
     if ( ! familyStr.isNull() ) {
         setFontFamily( familyStr );
     }
@@ -250,17 +250,17 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element
     colorStr = element.attribute( "color" );
     if ( ! colorStr.isNull() ) {
         if ( colorStr[0] != '#' ) {
-            setColor( QColor( getHtmlColor( colorStr ) ) );
+            setColor( TQColor( getHtmlColor( colorStr ) ) );
         }
         else {
-            setColor( QColor( colorStr  ) );
+            setColor( TQColor( colorStr  ) );
         }
 	}
 
     return true;
 }
 
-void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const
+void TokenStyleElement::writeMathMLAttributes( TQDomElement& element ) const
 {
     // mathvariant attribute
     if ( customMathVariant() ) {
@@ -344,13 +344,13 @@ void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const
     // mathsize attribute
     switch ( m_mathSizeType ) {
     case AbsoluteSize:
-        element.setAttribute( "mathsize", QString( "%1pt" ).arg( m_mathSize ) );
+        element.setAttribute( "mathsize", TQString( "%1pt" ).tqarg( m_mathSize ) );
         break;
     case RelativeSize:
-        element.setAttribute( "mathsize", QString( "%1%" ).arg( m_mathSize * 100.0 ) );
+        element.setAttribute( "mathsize", TQString( "%1%" ).tqarg( m_mathSize * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( "mathsize", QString( "%1px" ).arg( m_mathSize ) );
+        element.setAttribute( "mathsize", TQString( "%1px" ).tqarg( m_mathSize ) );
         break;
     default:
         break;
@@ -370,13 +370,13 @@ void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const
     // fontsize attribute
     switch ( m_fontSizeType ) {
     case AbsoluteSize:
-        element.setAttribute( "fontsize", QString( "%1pt" ).arg( m_fontSize ) );
+        element.setAttribute( "fontsize", TQString( "%1pt" ).tqarg( m_fontSize ) );
         break;
     case RelativeSize:
-        element.setAttribute( "fontsize", QString( "%1%" ).arg( m_fontSize * 100.0 ) );
+        element.setAttribute( "fontsize", TQString( "%1%" ).tqarg( m_fontSize * 100.0 ) );
         break;
     case PixelSize:
-        element.setAttribute( "fontsize", QString( "%3px" ).arg( m_fontSize ) );
+        element.setAttribute( "fontsize", TQString( "%3px" ).tqarg( m_fontSize ) );
         break;
     default:
         break;
@@ -467,7 +467,7 @@ void TokenStyleElement::setStyleVariant( StyleAttributes& style )
         style.setCustomMathVariant( false );
         if ( customFontFamily() ) {
             style.setCustomFont( true );
-            style.setFont( QFont(fontFamily()) );
+            style.setFont( TQFont(fontFamily()) );
         }
 
         bool fontweight = false;
@@ -550,7 +550,7 @@ void TokenStyleElement::resetStyle( StyleAttributes& style )
 
 double TokenStyleElement::sizeFactor( const ContextStyle& context, double factor )
 {
-    double basesize = context.layoutUnitPtToPt( context.getBaseSize() );
+    double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() );
     switch ( m_mathSizeType ) {
     case AbsoluteSize:
         return m_mathSize / basesize;
@@ -580,9 +580,9 @@ double TokenStyleElement::sizeFactor( const ContextStyle& context, double factor
 /**
  * Return RGB string from HTML Colors. See HTML Spec, section 6.5
  */
-QString TokenStyleElement::getHtmlColor( const QString& colorStr ){
+TQString TokenStyleElement::getHtmlColor( const TQString& colorStr ){
 
-    QString colorname = colorStr.lower();
+    TQString colorname = colorStr.lower();
 
     if ( colorname ==  "black" ) 
         return "#000000";
diff --git a/lib/kformula/tokenstyleelement.h b/lib/kformula/tokenstyleelement.h
index 9f17b19c..db7d14f6 100644
--- a/lib/kformula/tokenstyleelement.h
+++ b/lib/kformula/tokenstyleelement.h
@@ -36,23 +36,23 @@ class TokenStyleElement : public SequenceElement {
     typedef SequenceElement inherited;
 public:
 
-    TokenStyleElement( BasicElement* parent = 0 );
+    TokenStyleElement( BasicElement* tqparent = 0 );
 
     virtual void calcSizes( const ContextStyle& context,
                             ContextStyle::TextStyle tstyle,
                             ContextStyle::IndexStyle istyle,
                             StyleAttributes& style );
 
-    virtual void draw( QPainter& painter, const LuPixelRect& r,
+    virtual void draw( TQPainter& painter, const LuPixelRect& r,
                        const ContextStyle& context,
                        ContextStyle::TextStyle tstyle,
                        ContextStyle::IndexStyle istyle,
                        StyleAttributes& style,
-                       const LuPixelPoint& parentOrigin );
+                       const LuPixelPoint& tqparentOrigin );
 
 protected:
-    virtual bool readAttributesFromMathMLDom( const QDomElement &element );
-    virtual void writeMathMLAttributes( QDomElement& element ) const ;
+    virtual bool readAttributesFromMathMLDom( const TQDomElement &element );
+    virtual void writeMathMLAttributes( TQDomElement& element ) const ;
 
     void setAbsoluteSize( double s, bool fontsize = false );
     void setRelativeSize( double s, bool fontsize = false );
@@ -70,17 +70,17 @@ protected:
     }
     CharFamily charFamily() const { return m_charFamily; }
 
-    void setMathColor( const QColor& c ) {
+    void setMathColor( const TQColor& c ) {
         m_mathColor = c; 
         m_customMathColor = true;
     }
-    QColor mathColor() const { return m_mathColor; }
+    TQColor mathColor() const { return m_mathColor; }
 
-    void setMathBackground( const QColor& bg ) { 
+    void setMathBackground( const TQColor& bg ) { 
         m_mathBackground = bg; 
         m_customMathBackground = true;
     }
-    QColor mathBackground() const { return m_mathBackground; }
+    TQColor mathBackground() const { return m_mathBackground; }
 
     void setFontWeight( bool w ) { 
         m_fontWeight = w;
@@ -94,17 +94,17 @@ protected:
     }
     bool fontStyle() const { return m_fontStyle; }
 
-    void setFontFamily( const QString& s ) { 
+    void setFontFamily( const TQString& s ) { 
         m_fontFamily = s;
         m_customFontFamily = true;
     }
-    QString fontFamily() const { return m_fontFamily; }
+    TQString fontFamily() const { return m_fontFamily; }
 
-    void setColor( const QColor& c ) { 
+    void setColor( const TQColor& c ) { 
         m_color = c; 
         m_customColor = true;
     }
-    QColor color() const { return m_color; }
+    TQColor color() const { return m_color; }
 
     bool customMathVariant() const { return m_customMathVariant; }
     bool customMathColor() const { return m_customMathColor; }
@@ -129,7 +129,7 @@ protected:
     /**
      * Return RGB string from HTML Colors. See HTML Spec, section 6.5
      */
-    QString getHtmlColor( const QString& colorStr );
+    TQString getHtmlColor( const TQString& colorStr );
 
 private:
 
@@ -140,14 +140,14 @@ private:
     double m_mathSize;
     CharStyle m_charStyle;
     CharFamily m_charFamily;
-    QColor m_mathColor;
-    QColor m_mathBackground;
+    TQColor m_mathColor;
+    TQColor m_mathBackground;
 
     // Deprecated MathML 1.01 attributes
     SizeType m_fontSizeType;
     double m_fontSize;
-    QString m_fontFamily;
-    QColor m_color;
+    TQString m_fontFamily;
+    TQColor m_color;
     bool m_fontWeight;
     bool m_fontStyle;
 
diff --git a/lib/kformula/unicodetable.cc b/lib/kformula/unicodetable.cc
index 23dc8636..ad9a7f74 100644
--- a/lib/kformula/unicodetable.cc
+++ b/lib/kformula/unicodetable.cc
@@ -19,7 +19,7 @@
 
 KFORMULA_NAMESPACE_BEGIN
 
-struct UnicodeNameTable { short unicode; const char* name; };
+struct UnicodeNameTable { short tqunicode; const char* name; };
 
 static UnicodeNameTable greekTable[] = {
     { 0x03B1, "alpha" },
diff --git a/lib/kofficecore/KoApplication.cpp b/lib/kofficecore/KoApplication.cpp
index 3f2f6b23..2be62bbe 100644
--- a/lib/kofficecore/KoApplication.cpp
+++ b/lib/kofficecore/KoApplication.cpp
@@ -19,8 +19,8 @@
 
 #include "KoApplication.h"
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -106,9 +106,9 @@ bool KoApplication::start()
     int argsCount = args->count();
 
     KCmdLineArgs *koargs = KCmdLineArgs::parsedArgs("koffice");
-    QCString dpiValues = koargs->getOption( "dpi" );
+    TQCString dpiValues = koargs->getOption( "dpi" );
     if ( !dpiValues.isEmpty() ) {
-        int sep = dpiValues.find( QRegExp( "[x, ]" ) );
+        int sep = dpiValues.tqfind( TQRegExp( "[x, ]" ) );
         int dpiX;
         int dpiY = 0;
         bool ok = true;
@@ -132,7 +132,7 @@ bool KoApplication::start()
             return false;
         KoMainWindow *shell = new KoMainWindow( doc->instance() );
         shell->show();
-        QObject::connect(doc, SIGNAL(sigProgress(int)), shell, SLOT(slotProgress(int)));
+        TQObject::connect(doc, TQT_SIGNAL(sigProgress(int)), shell, TQT_SLOT(slotProgress(int)));
         // for initDoc to fill in the recent docs list
         // and for KoDocument::slotStarted
         doc->addShell( shell );
@@ -144,7 +144,7 @@ bool KoApplication::start()
         }
 
         // FIXME This needs to be moved someplace else
-	QObject::disconnect(doc, SIGNAL(sigProgress(int)), shell, SLOT(slotProgress(int)));
+	TQObject::disconnect(doc, TQT_SIGNAL(sigProgress(int)), shell, TQT_SLOT(slotProgress(int)));
     } else {
         bool print = koargs->isSet("print");
 	bool doTemplate = koargs->isSet("template");
@@ -166,24 +166,24 @@ bool KoApplication::start()
                     shell->show();
 		// are we just trying to open a template?
 		if ( doTemplate ) {
-		  QStringList paths;
-		  if ( args->url(i).isLocalFile() && QFile::exists(args->url(i).path()) )
+		  TQStringList paths;
+		  if ( args->url(i).isLocalFile() && TQFile::exists(args->url(i).path()) )
 		  {
-		    paths << QString(args->url(i).path());
+		    paths << TQString(args->url(i).path());
 		    kdDebug(30003) << "using full path..." << endl;
 		  } else {
-		     QString desktopName(args->arg(i));
-		     QString appName = KGlobal::instance()->instanceName();
+		     TQString desktopName(args->arg(i));
+		     TQString appName = KGlobal::instance()->instanceName();
 
 		     paths = KGlobal::dirs()->findAllResources("data", appName +"/templates/*/" + desktopName );
 		     if ( paths.isEmpty()) {
 			   paths = KGlobal::dirs()->findAllResources("data", appName +"/templates/" + desktopName );
 	             }
 		     if ( paths.isEmpty()) {
-		        KMessageBox::error(0L, i18n("No template found for: %1 ").arg(desktopName) );
+		        KMessageBox::error(0L, i18n("No template found for: %1 ").tqarg(desktopName) );
 		        delete shell;
 		     } else if ( paths.count() > 1 ) {
-		        KMessageBox::error(0L,  i18n("Too many templates found for: %1").arg(desktopName) );
+		        KMessageBox::error(0L,  i18n("Too many templates found for: %1").tqarg(desktopName) );
 		        delete shell;
 		     }
 		  }
@@ -193,7 +193,7 @@ bool KoApplication::start()
 		     templateBase.setPath(paths[0]);
 		     KDesktopFile templateInfo(paths[0]);
 
-		     QString templateName = templateInfo.readURL();
+		     TQString templateName = templateInfo.readURL();
 		     KURL templateURL;
 		     templateURL.setPath( templateBase.directory() + "/" + templateName );
 		     if ( shell->openDocument(doc, templateURL )) {
@@ -203,7 +203,7 @@ bool KoApplication::start()
 		       kdDebug(30003) << "Template loaded..." << endl;
 		       n++;
 		     } else {
-		        KMessageBox::error(0L, i18n("Template %1 failed to load.").arg(templateURL.prettyURL()) );
+		        KMessageBox::error(0L, i18n("Template %1 failed to load.").tqarg(templateURL.prettyURL()) );
  		        delete shell;
 		     }
 		  }
diff --git a/lib/kofficecore/KoApplication.h b/lib/kofficecore/KoApplication.h
index ecd9b943..d6f44929 100644
--- a/lib/kofficecore/KoApplication.h
+++ b/lib/kofficecore/KoApplication.h
@@ -37,11 +37,12 @@ class KoApplicationPrivate;
  *  can find their images etc.
  *
  *  If the last mainwindow becomes closed, KoApplication automatically
- *  calls QApplication::quit.
+ *  calls TQApplication::quit.
  */
 class KOFFICECORE_EXPORT KoApplication : public KApplication
 {
     Q_OBJECT
+  TQ_OBJECT
 
 public:
     /**
@@ -62,7 +63,7 @@ public:
      * Parses command line arguments and creates the initial shells and docs
      * from them (or an empty doc if no cmd-line argument is specified ).
      *
-     * You must call this method directly before calling QApplication::exec.
+     * You must call this method directly before calling TQApplication::exec.
      *
      * It is valid behaviour not to call this method at all. In this case you
      * have to process your command line parameters by yourself.
diff --git a/lib/kofficecore/KoApplicationIface.cc b/lib/kofficecore/KoApplicationIface.cc
index eb6f4d2d..042a39a8 100644
--- a/lib/kofficecore/KoApplicationIface.cc
+++ b/lib/kofficecore/KoApplicationIface.cc
@@ -40,41 +40,41 @@ KoApplicationIface::~KoApplicationIface()
 {
 }
 
-DCOPRef KoApplicationIface::createDocument( const QString &nativeFormat )
+DCOPRef KoApplicationIface::createDocument( const TQString &nativeFormat )
 {
     KoDocumentEntry entry = KoDocumentEntry::queryByMimeType( nativeFormat );
     if ( entry.isEmpty() )
     {
-        KMessageBox::questionYesNo( 0, i18n( "Unknown KOffice MimeType %s. Check your installation." ).arg( nativeFormat ) );
+        KMessageBox::questionYesNo( 0, i18n( "Unknown KOffice MimeType %s. Check your installation." ).tqarg( nativeFormat ) );
         return DCOPRef();
     }
     KoDocument* doc = entry.createDoc( 0 );
     return DCOPRef( kapp->dcopClient()->appId(), doc->dcopObject()->objId() );
 }
 
-QValueList KoApplicationIface::getDocuments()
+TQValueList KoApplicationIface::getDocuments()
 {
-    QValueList lst;
-    QPtrList *documents = KoDocument::documentList();
+    TQValueList lst;
+    TQPtrList *documents = KoDocument::documentList();
     if ( documents )
     {
-      QPtrListIterator it( *documents );
+      TQPtrListIterator it( *documents );
       for (; it.current(); ++it )
         lst.append( DCOPRef( kapp->dcopClient()->appId(), it.current()->dcopObject()->objId() ) );
     }
     return lst;
 }
 
-QValueList KoApplicationIface::getViews()
+TQValueList KoApplicationIface::getViews()
 {
-    QValueList lst;
-    QPtrList *documents = KoDocument::documentList();
+    TQValueList lst;
+    TQPtrList *documents = KoDocument::documentList();
     if ( documents )
     {
-      QPtrListIterator it( *documents );
+      TQPtrListIterator it( *documents );
       for (; it.current(); ++it )
       {
-          QPtrListIterator itview( it.current()->views() );
+          TQPtrListIterator itview( it.current()->views() );
           for ( ; itview.current(); ++itview )
               lst.append( DCOPRef( kapp->dcopClient()->appId(), itview.current()->dcopObject()->objId() ) );
       }
@@ -82,13 +82,13 @@ QValueList KoApplicationIface::getViews()
     return lst;
 }
 
-QValueList KoApplicationIface::getWindows()
+TQValueList KoApplicationIface::getWindows()
 {
-    QValueList lst;
-    QPtrList *mainWindows = KMainWindow::memberList;
+    TQValueList lst;
+    TQPtrList *mainWindows = KMainWindow::memberList;
     if ( mainWindows )
     {
-      QPtrListIterator it( *mainWindows );
+      TQPtrListIterator it( *mainWindows );
       for (; it.current(); ++it )
         lst.append( DCOPRef( kapp->dcopClient()->appId(),
                              static_cast(it.current())->dcopObject()->objId() ) );
diff --git a/lib/kofficecore/KoApplicationIface.h b/lib/kofficecore/KoApplicationIface.h
index ac72f09a..6d8b9e99 100644
--- a/lib/kofficecore/KoApplicationIface.h
+++ b/lib/kofficecore/KoApplicationIface.h
@@ -21,7 +21,7 @@
 #define __KoApplicationIface_h__
 
 #include 
-#include 
+#include 
 #include 
 
 /**
@@ -40,26 +40,26 @@ k_dcop:
    * Creates a new document for the given native mimetype
    * Use it to create a shell and to load an existing file, if any
    */
-  DCOPRef createDocument( const QString &nativeFormat );
+  DCOPRef createDocument( const TQString &nativeFormat );
 
   /**
    * @return a list of references to all the documents
    * (see KoDocumentIface)
    */
-  QValueList getDocuments();
+  TQValueList getDocuments();
 
   /**
    * @return a list of references to all the views
    * (see KoViewIface)
    * Convenience method to avoid iterating over all documents to get all the views.
    */
-  QValueList getViews();
+  TQValueList getViews();
 
   /**
    * @return a list of references to all the windows
    * (see KoMainWindowIface)
    */
-  QValueList getWindows();
+  TQValueList getWindows();
 };
 
 #endif
diff --git a/lib/kofficecore/KoChild.cpp b/lib/kofficecore/KoChild.cpp
index 8207d086..85d54939 100644
--- a/lib/kofficecore/KoChild.cpp
+++ b/lib/kofficecore/KoChild.cpp
@@ -19,7 +19,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include 
 
@@ -34,24 +34,24 @@ public:
   {
   }
 
-  QRect m_geometry;
+  TQRect m_tqgeometry;
 
   double m_rotation;
   double m_shearX;
   double m_shearY;
-  QPoint m_rotationPoint;
+  TQPoint m_rotationPoint;
   double m_scaleX;
   double m_scaleY;
-  QWMatrix m_matrix;
+  TQWMatrix m_matrix;
   bool m_lock;
-  QPointArray m_old;
+  TQPointArray m_old;
   bool m_transparent;
   int m_contentsX;
   int m_contentsY;
 };
 
-KoChild::KoChild( QObject *parent, const char *name )
-: QObject( parent, name )
+KoChild::KoChild( TQObject *tqparent, const char *name )
+: TQObject( tqparent, name )
 {
   d = new KoChildPrivate;
 
@@ -69,19 +69,19 @@ KoChild::~KoChild()
   delete d;
 }
 
-void KoChild::setGeometry( const QRect &rect, bool noEmit )
+void KoChild::setGeometry( const TQRect &rect, bool noEmit )
 {
   if ( !d->m_lock )
     d->m_old = framePointArray();
 
-  d->m_geometry = rect;
+  d->m_tqgeometry = rect;
 
   // Embedded objects should have a minimum size of 3, so they can be selected
-  if( d->m_geometry.width() < 3 )
-    d->m_geometry.setWidth( 3 );
+  if( d->m_tqgeometry.width() < 3 )
+    d->m_tqgeometry.setWidth( 3 );
 
-  if( d->m_geometry.height() < 3 )
-    d->m_geometry.setHeight( 3 );
+  if( d->m_tqgeometry.height() < 3 )
+    d->m_tqgeometry.setHeight( 3 );
 
   updateMatrix();
 
@@ -89,27 +89,27 @@ void KoChild::setGeometry( const QRect &rect, bool noEmit )
     emit changed( this );
 }
 
-QRect KoChild::geometry() const
+TQRect KoChild::tqgeometry() const
 {
-  return d->m_geometry;
+  return d->m_tqgeometry;
 }
 
-QRegion KoChild::region( const QWMatrix &matrix ) const
+TQRegion KoChild::region( const TQWMatrix &matrix ) const
 {
-  return QRegion( pointArray( matrix ) );
+  return TQRegion( pointArray( matrix ) );
 }
 
-QPointArray KoChild::pointArray( const QWMatrix &matrix ) const
+TQPointArray KoChild::pointArray( const TQWMatrix &matrix ) const
 {
-  return pointArray( QRect( 0, 0, d->m_geometry.width(), d->m_geometry.height() ), matrix );
+  return pointArray( TQRect( 0, 0, d->m_tqgeometry.width(), d->m_tqgeometry.height() ), matrix );
 }
 
-//bool KoChild::contains( const QPoint &point ) const
+//bool KoChild::tqcontains( const TQPoint &point ) const
 //{
-//  return region().contains( point );
+//  return region().tqcontains( point );
 //}
 
-QRect KoChild::boundingRect() const
+TQRect KoChild::boundingRect() const
 {
   return pointArray().boundingRect();
 }
@@ -119,13 +119,13 @@ bool KoChild::isRectangle() const
   return !( d->m_shearX != 0.0 || d->m_shearY != 0.0 || d->m_rotation != 0.0 );
 }
 
-void KoChild::setClipRegion( QPainter &painter, bool combine )
+void KoChild::setClipRegion( TQPainter &painter, bool combine )
 {
   painter.setClipping( true );
   if ( combine && !painter.clipRegion().isEmpty() )
-    painter.setClipRegion( region( painter.worldMatrix() ).intersect( painter.clipRegion() ) );
+    painter.setClipRegion( region( painter.tqworldMatrix() ).intersect( painter.clipRegion() ) );
   else
-    painter.setClipRegion( region( painter.worldMatrix() ) );
+    painter.setClipRegion( region( painter.tqworldMatrix() ) );
 }
 
 void KoChild::setScaling( double x, double y )
@@ -197,7 +197,7 @@ double KoChild::rotation() const
   return d->m_rotation;
 }
 
-void KoChild::setRotationPoint( const QPoint &pos )
+void KoChild::setRotationPoint( const TQPoint &pos )
 {
   if ( !d->m_lock )
     d->m_old = framePointArray();
@@ -209,16 +209,16 @@ void KoChild::setRotationPoint( const QPoint &pos )
     emit changed( this );
 }
 
-QPoint KoChild::rotationPoint() const
+TQPoint KoChild::rotationPoint() const
 {
   return d->m_rotationPoint;
 }
 
-void KoChild::transform( QPainter &painter )
+void KoChild::transform( TQPainter &painter )
 {
     setClipRegion( painter, true );
 
-    QWMatrix m = painter.worldMatrix();
+    TQWMatrix m = painter.tqworldMatrix();
     m = d->m_matrix * m;
     m.scale( d->m_scaleX, d->m_scaleY );
     painter.setWorldMatrix( m );
@@ -230,37 +230,37 @@ void KoChild::setContentsPos( int x, int y )
     d->m_contentsY = y;
 }
 
-QRect KoChild::contentRect() const
+TQRect KoChild::contentRect() const
 {
-  return QRect( d->m_contentsX, d->m_contentsY, int(d->m_geometry.width() / d->m_scaleX),
-                int(d->m_geometry.height() / d->m_scaleY) );
+  return TQRect( d->m_contentsX, d->m_contentsY, int(d->m_tqgeometry.width() / d->m_scaleX),
+                int(d->m_tqgeometry.height() / d->m_scaleY) );
 }
 
-QPointArray KoChild::framePointArray( const QWMatrix &matrix ) const
+TQPointArray KoChild::framePointArray( const TQWMatrix &matrix ) const
 {
-  return pointArray( QRect( -6, -6, d->m_geometry.width() + 12, d->m_geometry.height() + 12 ), matrix );
+  return pointArray( TQRect( -6, -6, d->m_tqgeometry.width() + 12, d->m_tqgeometry.height() + 12 ), matrix );
 }
 
-QRegion KoChild::frameRegion( const QWMatrix &matrix, bool solid ) const
+TQRegion KoChild::frameRegion( const TQWMatrix &matrix, bool solid ) const
 {
-  const QPointArray arr = framePointArray( matrix );
-  const QRegion frameReg( arr );
+  const TQPointArray arr = framePointArray( matrix );
+  const TQRegion frameReg( arr );
 
   if ( solid )
     return frameReg;
 
-  const QRegion reg = region( matrix );
+  const TQRegion reg = region( matrix );
   return frameReg.subtract( reg );
 }
 
-QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const
+TQPointArray KoChild::pointArray( const TQRect &r, const TQWMatrix &matrix ) const
 {
-  QPoint topleft = d->m_matrix.map( QPoint( r.left(), r.top() ) );
-  QPoint topright = d->m_matrix.map( QPoint( r.right(), r.top() ) );
-  QPoint bottomleft = d->m_matrix.map( QPoint( r.left(), r.bottom() ) );
-  QPoint bottomright = d->m_matrix.map( QPoint( r.right(), r.bottom() ) );
+  TQPoint topleft = d->m_matrix.map( TQPoint( r.left(), r.top() ) );
+  TQPoint topright = d->m_matrix.map( TQPoint( r.right(), r.top() ) );
+  TQPoint bottomleft = d->m_matrix.map( TQPoint( r.left(), r.bottom() ) );
+  TQPoint bottomright = d->m_matrix.map( TQPoint( r.right(), r.bottom() ) );
 
-  QPointArray arr( 4 );
+  TQPointArray arr( 4 );
   arr.setPoint( 0, topleft );
   arr.setPoint( 1, topright );
   arr.setPoint( 2, bottomright );
@@ -274,21 +274,21 @@ QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const
 
 void KoChild::updateMatrix()
 {
-  QWMatrix r;
+  TQWMatrix r;
   r.rotate( - d->m_rotation );
-  QPoint p = r.map( QPoint( d->m_rotationPoint.x(),
+  TQPoint p = r.map( TQPoint( d->m_rotationPoint.x(),
 			    d->m_rotationPoint.y() ) );
 
-  QWMatrix m;
+  TQWMatrix m;
   m.rotate( d->m_rotation );
-  m.translate( -d->m_rotationPoint.x() + d->m_geometry.x(), -d->m_rotationPoint.y() + d->m_geometry.y() );
+  m.translate( -d->m_rotationPoint.x() + d->m_tqgeometry.x(), -d->m_rotationPoint.y() + d->m_tqgeometry.y() );
   m.translate( p.x(), p.y() );
   m.shear( d->m_shearX, d->m_shearY );
 
   d->m_matrix = m;
 }
 
-QWMatrix KoChild::matrix() const
+TQWMatrix KoChild::matrix() const
 {
   return d->m_matrix;
 }
@@ -316,9 +316,9 @@ bool KoChild::locked() const
   return d->m_lock;
 }
 
-QPointArray KoChild::oldPointArray( const QWMatrix &matrix )
+TQPointArray KoChild::oldPointArray( const TQWMatrix &matrix )
 {
-  QPointArray arr = d->m_old;
+  TQPointArray arr = d->m_old;
 
   for( int i = 0; i < 4; ++i )
       arr.setPoint( i, matrix.map( arr.point( i ) ) );
@@ -336,28 +336,28 @@ bool KoChild::isTransparent() const
   return d->m_transparent;
 }
 
-KoChild::Gadget KoChild::gadgetHitTest( const QPoint &p )
+KoChild::Gadget KoChild::gadgetHitTest( const TQPoint &p )
 {
-  if ( !frameRegion().contains( p ) )
+  if ( !frameRegion().tqcontains( p ) )
     return NoGadget;
 
-  if ( QRegion( pointArray( QRect( -5, -5, 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( -5, -5, 5, 5 ) ) ).tqcontains( p ) )
       return TopLeft;
-  if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3, -5, 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3, -5, 5, 5 ) ) ).tqcontains( p ) )
       return TopMid;
-  if ( QRegion( pointArray( QRect( d->m_geometry.width(), -5, 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), -5, 5, 5 ) ) ).tqcontains( p ) )
       return TopRight;
-  if ( QRegion( pointArray( QRect( -5, d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) )
       return MidLeft;
-  if ( QRegion( pointArray( QRect( -5, d->m_geometry.height(), 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) )
       return BottomLeft;
-  if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3,
-				   d->m_geometry.height(), 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3,
+				   d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) )
     return BottomMid;
-  if ( QRegion( pointArray( QRect( d->m_geometry.width(), d->m_geometry.height(), 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) )
       return BottomRight;
-  if ( QRegion( pointArray( QRect( d->m_geometry.width(),
-				   d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) )
+  if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(),
+				   d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) )
     return MidRight;
 
   return Move;
diff --git a/lib/kofficecore/KoChild.h b/lib/kofficecore/KoChild.h
index 26ad4a08..64f41064 100644
--- a/lib/kofficecore/KoChild.h
+++ b/lib/kofficecore/KoChild.h
@@ -19,18 +19,18 @@
 #ifndef __koChild_h__
 #define __koChild_h__
 
-#include 
-#include 
+#include 
+#include 
 #include 
 
 /**
- * KoChild is an abstract base class that represents the geometry
+ * KoChild is an abstract base class that represents the tqgeometry
  * associated with an embedded document. In general it handles its position
- * relative to the embedded document's parent.
+ * relative to the embedded document's tqparent.
  *
  * In detail it handles size, matrix operations and can give you
  * a clip region. It can deal with scaling, rotation etc. because it
- * makes heavy usage of QWMatrix.
+ * makes heavy usage of TQWMatrix.
  *
  * After applying the matrix, viewGeometry() applies zooming, but can be
  * reimplemented to also apply e.g. some translation by the application
@@ -38,9 +38,10 @@
  *
  * @see KoDocumentChild KoViewChild
  */
-class KOFFICECORE_EXPORT KoChild : public QObject
+class KOFFICECORE_EXPORT KoChild : public TQObject
 {
   Q_OBJECT
+  TQ_OBJECT
 public:
 
   /**
@@ -55,54 +56,54 @@ public:
   enum Gadget { NoGadget, TopLeft, TopMid, TopRight, MidLeft, MidRight,
 		BottomLeft, BottomMid, BottomRight, Move };
 
-  KoChild( QObject *parent = 0, const char *name = 0 );
+  KoChild( TQObject *tqparent = 0, const char *name = 0 );
   virtual ~KoChild();
 
   /**
-   *  Sets a new geometry for this child document.
+   *  Sets a new tqgeometry for this child document.
    *  Use noEmit = true if you do not want the 'changed'-signal to be emitted
    */
-  void setGeometry( const QRect &rect, bool noEmit = false );
+  void setGeometry( const TQRect &rect, bool noEmit = false );
 
   /**
    * @return the rectangle that would be used to display this
    *         child document if the child is not rotated or
    *         subject to some other geometric transformation.
-   *         The rectangle is in the coordinate system of the parent,
+   *         The rectangle is in the coordinate system of the tqparent,
    *         using unzoomed coordinates in points.
    *
    * @see #setGeometry
    */
-  QRect geometry() const;
+  TQRect tqgeometry() const;
 
   /**
    * @return the region of this child part relative to the
-   *         coordinate system of the parent.
+   *         coordinate system of the tqparent.
    *         The region is transformed with the passed
    *         matrix.
    */
-  virtual QRegion region( const QWMatrix& = QWMatrix() ) const;
+  virtual TQRegion region( const TQWMatrix& = TQWMatrix() ) const;
 
   /**
    * @return the polygon which surrounds the child part. The points
-   *         are in coordinates of the parent.
+   *         are in coordinates of the tqparent.
    *         The points are transformed with the
    *         passed matrix.
    */
-  virtual QPointArray pointArray( const QWMatrix &matrix = QWMatrix() ) const;
+  virtual TQPointArray pointArray( const TQWMatrix &matrix = TQWMatrix() ) const;
 
   /**
    * Tests whether the part contains a certain point. The point is
-   * in the coordinate system of the parent.
+   * in the coordinate system of the tqparent.
    */
-  //virtual bool contains( const QPoint& ) const;
+  //virtual bool tqcontains( const TQPoint& ) const;
 
   /**
    * @return the effective bounding rect after all transformations.
    *         The coordinates of the rectangle are in the coordinate system
-   *         of the parent.
+   *         of the tqparent.
    */
-  QRect boundingRect() const;
+  TQRect boundingRect() const;
 
   /**
    * Scales the content of the child part. However, that does not
@@ -148,16 +149,16 @@ public:
   /**
    * Sets the center of the rotation to the point @p pos.
    */
-  virtual void setRotationPoint( const QPoint& pos );
+  virtual void setRotationPoint( const TQPoint& pos );
 
   /**
    * @return the center of the rotation
    */
-  virtual QPoint rotationPoint() const;
+  virtual TQPoint rotationPoint() const;
 
   /**
    * @return true if the child part is an orthogonal rectangle relative
-   *         to its parents coordinate system.
+   *         to its tqparents coordinate system.
    */
   bool isRectangle() const;
 
@@ -170,14 +171,14 @@ public:
    *        of the current region with the childs region or whether only
    *        the childs region is set.
    */
-  virtual void setClipRegion( QPainter& painter, bool combine = true );
+  virtual void setClipRegion( TQPainter& painter, bool combine = true );
 
   /**
    * Transforms the painter (its worldmatrix and the clipping)
    * in such a way that the painter can be passed to the child part
    * for drawing.
    */
-  virtual void transform( QPainter& painter );
+  virtual void transform( TQPainter& painter );
 
   /**
    * Sets the position of the content relative to the child frame.
@@ -188,25 +189,25 @@ public:
 
   /**
    * @return the contents rectangle that is visible.
-   *         This value depends on the scaling and the geometry.
+   *         This value depends on the scaling and the tqgeometry.
    *         This is the value that is passed to KoDocument::paintContent.
    *
-   * @see #xScaling #geometry
+   * @see #xScaling #tqgeometry
    */
-  virtual QRect contentRect() const;
+  virtual TQRect contentRect() const;
 
   /**
    * @return the region of the child frame.
    *         If solid is set to true the complete area of the child region
    *         is returned, otherwise only the child border is returned.
    */
-  virtual QRegion frameRegion( const QWMatrix& matrix = QWMatrix(), bool solid = false ) const;
+  virtual TQRegion frameRegion( const TQWMatrix& matrix = TQWMatrix(), bool solid = false ) const;
 
   /**
-   * @return the frame geometry including a border (6 pixels) as a point
+   * @return the frame tqgeometry including a border (6 pixels) as a point
    *         array with 4 points, one for each corner, transformed by given matrix.
    */
-  virtual QPointArray framePointArray( const QWMatrix &matrix = QWMatrix() ) const;
+  virtual TQPointArray framePointArray( const TQWMatrix &matrix = TQWMatrix() ) const;
 
   /**
    * @return the current transformation of this child as matrix.
@@ -214,7 +215,7 @@ public:
    *
    * @see #updateMatrix
    */
-  virtual QWMatrix matrix() const;
+  virtual TQWMatrix matrix() const;
 
   /**
    * Locks this child and stores the current transformation.
@@ -233,11 +234,11 @@ public:
   void unlock();
 
   /**
-   * If the child is locked, geometry changes
+   * If the child is locked, tqgeometry changes
    * (including scaling, rotation, ...) are not backed up.
    *
    * As long as this child is locked, the backed up
-   * geometry state can be recovered with oldPointArray.
+   * tqgeometry state can be recovered with oldPointArray.
    *
    * @return true when this child is locked.
    *
@@ -246,9 +247,9 @@ public:
   bool locked() const;
 
   /**
-   * @return the backed up geometry transformed by given matrix.
+   * @return the backed up tqgeometry transformed by given matrix.
    */
-  virtual QPointArray oldPointArray( const QWMatrix &matrix );
+  virtual TQPointArray oldPointArray( const TQWMatrix &matrix );
 
   /**
    * Marks this child as either transparent or not.
@@ -260,7 +261,7 @@ public:
   virtual void setTransparent( bool transparent );
 
   /**
-   * It might be interesting for view updates and repainting in general
+   * It might be interesting for view updates and tqrepainting in general
    * whether a child is transparent or not.
    * @return true when this child is marked as transparent.
    */
@@ -275,7 +276,7 @@ public:
    *
    * @see #Gadget
    */
-  virtual Gadget gadgetHitTest( const QPoint& p );
+  virtual Gadget gadgetHitTest( const TQPoint& p );
 
 signals:
 
@@ -295,7 +296,7 @@ protected:
    *  @param matrix the transformation of r.
    *  @param r the rectangle for which the point array should be created.
    */
-  virtual QPointArray pointArray( const QRect& r, const QWMatrix& matrix = QWMatrix() ) const;
+  virtual TQPointArray pointArray( const TQRect& r, const TQWMatrix& matrix = TQWMatrix() ) const;
 
   /**
    * Stores the current transformation of this child into a matrix.
diff --git a/lib/kofficecore/KoContainerHandler.cpp b/lib/kofficecore/KoContainerHandler.cpp
index 78060592..1f21df24 100644
--- a/lib/kofficecore/KoContainerHandler.cpp
+++ b/lib/kofficecore/KoContainerHandler.cpp
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-KoEventHandler::KoEventHandler( QObject* target )
+KoEventHandler::KoEventHandler( TQObject* target )
 {
     m_target = target;
 
@@ -34,7 +34,7 @@ KoEventHandler::~KoEventHandler()
 {
 }
 
-QObject* KoEventHandler::target()
+TQObject* KoEventHandler::target()
 {
     return m_target;
 }
@@ -43,11 +43,11 @@ QObject* KoEventHandler::target()
 
 class KoPartResizeHandlerPrivate {
 public:
-    KoPartResizeHandlerPrivate( const QWMatrix& matrix, KoView *view, KoChild* child,
-                              KoChild::Gadget gadget, const QPoint& point ) :
+    KoPartResizeHandlerPrivate( const TQWMatrix& matrix, KoView *view, KoChild* child,
+                              KoChild::Gadget gadget, const TQPoint& point ) :
         m_gadget(gadget), m_view(view), m_child(child), m_parentMatrix(matrix) {
 
-        m_geometryStart = child->geometry();
+        m_tqgeometryStart = child->tqgeometry();
         m_matrix = child->matrix() * matrix;
         m_invertParentMatrix = matrix.invert();
 
@@ -59,19 +59,19 @@ public:
     ~KoPartResizeHandlerPrivate() {}
 
     KoChild::Gadget m_gadget;
-    QPoint m_mouseStart;
-    QRect m_geometryStart;
+    TQPoint m_mouseStart;
+    TQRect m_tqgeometryStart;
     KoView* m_view;
     KoChild* m_child;
-    QWMatrix m_invert;
-    QWMatrix m_matrix;
-    QWMatrix m_parentMatrix;
-    QWMatrix m_invertParentMatrix;
+    TQWMatrix m_invert;
+    TQWMatrix m_matrix;
+    TQWMatrix m_parentMatrix;
+    TQWMatrix m_invertParentMatrix;
 };
 
-KoPartResizeHandler::KoPartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
-                                      KoChild::Gadget gadget, const QPoint& point )
-    : KoEventHandler( widget )
+KoPartResizeHandler::KoPartResizeHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
+                                      KoChild::Gadget gadget, const TQPoint& point )
+    : KoEventHandler( TQT_TQOBJECT(widget) )
 {
     child->lock();
     d=new KoPartResizeHandlerPrivate(matrix, view, child, gadget, point);
@@ -84,25 +84,25 @@ KoPartResizeHandler::~KoPartResizeHandler()
     d=0L;
 }
 
-void KoPartResizeHandler::repaint(QRegion &rgn)
+void KoPartResizeHandler::tqrepaint(TQRegion &rgn)
 {
   rgn = rgn.unite( d->m_child->frameRegion( d->m_parentMatrix, true ) );
  // rgn.translate(- d->m_view->canvasXOffset(), - d->m_view->canvasYOffset());
-  ((QWidget*)target())->repaint( rgn );
+  ((TQWidget*)target())->tqrepaint( rgn );
 }
 
-bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev )
+bool KoPartResizeHandler::eventFilter( TQObject*, TQEvent* ev )
 {
-    if ( ev->type() == QEvent::MouseButtonRelease )
+    if ( ev->type() == TQEvent::MouseButtonRelease )
     {
         delete this;
         return true;
     }
-    else if ( ev->type() == QEvent::MouseMove )
+    else if ( ev->type() == TQEvent::MouseMove )
     {
-        QMouseEvent* e = (QMouseEvent*)ev;
-        QPoint p = d->m_invert.map( d->m_invertParentMatrix.map( e->pos() /*+ QPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ) );
-        QRegion rgn( d->m_child->frameRegion( d->m_parentMatrix, true ) );
+        TQMouseEvent* e = (TQMouseEvent*)ev;
+        TQPoint p = d->m_invert.map( d->m_invertParentMatrix.map( e->pos() /*+ TQPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ) );
+        TQRegion rgn( d->m_child->frameRegion( d->m_parentMatrix, true ) );
 
         double x1_x, x1_y, x2_x, x2_y;
         d->m_matrix.map( double( p.x() ), 0.0, &x1_x, &x1_y );
@@ -123,78 +123,78 @@ bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev )
         {
         case KoChild::TopLeft:
             {
-                x = QMIN( d->m_geometryStart.width() - 1, x );
-                y = QMIN( d->m_geometryStart.height() - 1, y );
+                x = TQMIN( d->m_tqgeometryStart.width() - 1, x );
+                y = TQMIN( d->m_tqgeometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width() - x, d->m_geometryStart.height() - y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y() + y,
+                                             d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() - y ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::TopMid:
             {
-                y = QMIN( d->m_geometryStart.height() - 1, y );
+                y = TQMIN( d->m_tqgeometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width(), d->m_geometryStart.height() - y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y() + y,
+                                             d->m_tqgeometryStart.width(), d->m_tqgeometryStart.height() - y ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::TopRight:
             {
-                x = QMAX( -d->m_geometryStart.width() + 1, x );
-                y = QMIN( d->m_geometryStart.height() - 1, y );
+                x = TQMAX( -d->m_tqgeometryStart.width() + 1, x );
+                y = TQMIN( d->m_tqgeometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width() + x, d->m_geometryStart.height() - y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y() + y,
+                                             d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() - y ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::MidLeft:
             {
-                x = QMIN( d->m_geometryStart.width() - 1, x );
+                x = TQMIN( d->m_tqgeometryStart.width() - 1, x );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() - x, d->m_geometryStart.height() ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y(),
+                                             d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::MidRight:
             {
-                x = QMAX( -d->m_geometryStart.width() + 1, x );
+                x = TQMAX( -d->m_tqgeometryStart.width() + 1, x );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() + x, d->m_geometryStart.height() ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(),
+                                             d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::BottomLeft:
             {
-                x = QMIN( d->m_geometryStart.width() - 1, x );
-                y = QMAX( -d->m_geometryStart.height() + 1, y );
+                x = TQMIN( d->m_tqgeometryStart.width() - 1, x );
+                y = TQMAX( -d->m_tqgeometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() - x, d->m_geometryStart.height() + y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y(),
+                                             d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() + y ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::BottomMid:
             {
-                y = QMAX( -d->m_geometryStart.height() + 1, y );
+                y = TQMAX( -d->m_tqgeometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(),
-                                             d->m_geometryStart.width(), d->m_geometryStart.height() + y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(),
+                                             d->m_tqgeometryStart.width(), d->m_tqgeometryStart.height() + y ) );
+                tqrepaint(rgn);
             }
             break;
         case KoChild::BottomRight:
             {
-                x = QMAX( -d->m_geometryStart.width() + 1, x );
-                y = QMAX( -d->m_geometryStart.height() + 1, y );
+                x = TQMAX( -d->m_tqgeometryStart.width() + 1, x );
+                y = TQMAX( -d->m_tqgeometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() + x, d->m_geometryStart.height() + y ) );
-                repaint(rgn);
+                d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(),
+                                             d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() + y ) );
+                tqrepaint(rgn);
             }
             break;
         default:
@@ -209,28 +209,28 @@ bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev )
 
 class KoPartMoveHandlerPrivate {
 public:
-    KoPartMoveHandlerPrivate( const QWMatrix& matrix, KoView* view, KoChild* child,
-                            const QPoint& point) : m_view(view), m_dragChild(child),
+    KoPartMoveHandlerPrivate( const TQWMatrix& matrix, KoView* view, KoChild* child,
+                            const TQPoint& point) : m_view(view), m_dragChild(child),
                                                    m_parentMatrix(matrix) {
         m_invertParentMatrix = matrix.invert();
         m_mouseDragStart = m_invertParentMatrix.map( point );
-        m_geometryDragStart = m_dragChild->geometry();
+        m_tqgeometryDragStart = m_dragChild->tqgeometry();
         m_rotationDragStart = m_dragChild->rotationPoint();
     }
     ~KoPartMoveHandlerPrivate() {}
 
     KoView* m_view;
     KoChild* m_dragChild;
-    QPoint m_mouseDragStart;
-    QRect m_geometryDragStart;
-    QPoint m_rotationDragStart;
-    QWMatrix m_invertParentMatrix;
-    QWMatrix m_parentMatrix;
+    TQPoint m_mouseDragStart;
+    TQRect m_tqgeometryDragStart;
+    TQPoint m_rotationDragStart;
+    TQWMatrix m_invertParentMatrix;
+    TQWMatrix m_parentMatrix;
 };
 
-KoPartMoveHandler::KoPartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
-                                  const QPoint& point )
-    : KoEventHandler( widget )
+KoPartMoveHandler::KoPartMoveHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
+                                  const TQPoint& point )
+    : KoEventHandler( TQT_TQOBJECT(widget) )
 {
     child->lock();
     d=new KoPartMoveHandlerPrivate(matrix, view, child, point);
@@ -243,27 +243,27 @@ KoPartMoveHandler::~KoPartMoveHandler()
     d=0L;
 }
 
-bool KoPartMoveHandler::eventFilter( QObject*, QEvent* ev )
+bool KoPartMoveHandler::eventFilter( TQObject*, TQEvent* ev )
 {
-    if ( ev->type() == QEvent::MouseButtonRelease )
+    if ( ev->type() == TQEvent::MouseButtonRelease )
     {
         delete this;
         return true;
     }
-    else if ( ev->type() == QEvent::MouseMove )
+    else if ( ev->type() == TQEvent::MouseMove )
     {
-        QMouseEvent* e = (QMouseEvent*)ev;
-
-        QRegion bound = d->m_dragChild->frameRegion( d->m_parentMatrix, true );
-        QPoint pos = d->m_invertParentMatrix.map( e->pos() /* + QPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ );
-        d->m_dragChild->setGeometry( QRect( d->m_geometryDragStart.x() + pos.x() - d->m_mouseDragStart.x(),
-                                             d->m_geometryDragStart.y() + pos.y() - d->m_mouseDragStart.y(),
-                                             d->m_geometryDragStart.width(), d->m_geometryDragStart.height() ) );
-        d->m_dragChild->setRotationPoint( QPoint( d->m_rotationDragStart.x() + pos.x() - d->m_mouseDragStart.x(),
+        TQMouseEvent* e = (TQMouseEvent*)ev;
+
+        TQRegion bound = d->m_dragChild->frameRegion( d->m_parentMatrix, true );
+        TQPoint pos = d->m_invertParentMatrix.map( e->pos() /* + TQPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ );
+        d->m_dragChild->setGeometry( TQRect( d->m_tqgeometryDragStart.x() + pos.x() - d->m_mouseDragStart.x(),
+                                             d->m_tqgeometryDragStart.y() + pos.y() - d->m_mouseDragStart.y(),
+                                             d->m_tqgeometryDragStart.width(), d->m_tqgeometryDragStart.height() ) );
+        d->m_dragChild->setRotationPoint( TQPoint( d->m_rotationDragStart.x() + pos.x() - d->m_mouseDragStart.x(),
                                                d->m_rotationDragStart.y() + pos.y() - d->m_mouseDragStart.y() ) );
         bound = bound.unite( d->m_dragChild->frameRegion( d->m_parentMatrix, false ) );
       //  bound.translate(- d->m_view->canvasXOffset(), - d->m_view->canvasYOffset());
-        ((QWidget*)target())->repaint( bound );
+        ((TQWidget*)target())->tqrepaint( bound );
 
         return true;
     }
@@ -273,8 +273,8 @@ bool KoPartMoveHandler::eventFilter( QObject*, QEvent* ev )
 
 // -------------------------------------------------------
 
-KoContainerHandler::KoContainerHandler( KoView* view, QWidget* widget )
-    : KoEventHandler( widget )
+KoContainerHandler::KoContainerHandler( KoView* view, TQWidget* widget )
+    : KoEventHandler( TQT_TQOBJECT(widget) )
 {
     m_view = view;
 }
@@ -283,51 +283,51 @@ KoContainerHandler::~KoContainerHandler()
 {
 }
 
-bool KoContainerHandler::eventFilter( QObject*, QEvent* ev )
+bool KoContainerHandler::eventFilter( TQObject*, TQEvent* ev )
 {
-    if ( ev->type() == QEvent::KeyPress )
+    if ( ev->type() == TQEvent::KeyPress )
     {
-	QKeyEvent* keyEvent=(QKeyEvent*)ev;
+	TQKeyEvent* keyEvent=(TQKeyEvent*)ev;
 
 	KoChild* child=m_view->selectedChild();
 
 	if (child != 0)
 	{
-		if (keyEvent->key()==Qt::Key_Delete)
+		if (keyEvent->key()==TQt::Key_Delete)
 			emit deleteChild(child);
 	}
     }
 
-    if ( ev->type() == QEvent::MouseButtonPress )
+    if ( ev->type() == TQEvent::MouseButtonPress )
     {
         KoChild::Gadget gadget;
-        QPoint pos;
-        QMouseEvent *e=static_cast(ev);
+        TQPoint pos;
+        TQMouseEvent *e=TQT_TQMOUSEEVENT(ev);
         KoChild *ch=child(gadget, pos, e);
 
-	if ( e->button() == RightButton && gadget != KoChild::NoGadget )
+	if ( e->button() == Qt::RightButton && gadget != KoChild::NoGadget )
         {
 	    emit popupMenu( ch, e->globalPos() );
             return true;
         }
-        else if ( e->button() == LeftButton && gadget == KoChild::Move )
+        else if ( e->button() == Qt::LeftButton && gadget == KoChild::Move )
         {
-            (void)new KoPartMoveHandler( static_cast(target()), m_view->matrix(), m_view, ch, pos );
+            (void)new KoPartMoveHandler( TQT_TQWIDGET(target()), m_view->matrix(), m_view, ch, pos );
             return true;
         }
-        else if ( e->button() == LeftButton && gadget != KoChild::NoGadget )
+        else if ( e->button() == Qt::LeftButton && gadget != KoChild::NoGadget )
         {
-            (void)new KoPartResizeHandler( static_cast(target()), m_view->matrix(), m_view, ch, gadget, pos );
+            (void)new KoPartResizeHandler( TQT_TQWIDGET(target()), m_view->matrix(), m_view, ch, gadget, pos );
             return true;
         }
         return false;
     }
-    else if ( ev->type() == QEvent::MouseMove )
+    else if ( ev->type() == TQEvent::MouseMove )
     {
-        QWidget *targetWidget = static_cast( target() );
+        TQWidget *targetWidget = TQT_TQWIDGET( target() );
         KoChild::Gadget gadget;
-        QPoint pos;
-        QMouseEvent *e=static_cast(ev);
+        TQPoint pos;
+        TQMouseEvent *e=TQT_TQMOUSEEVENT(ev);
         child(gadget, pos, e);
 
         bool retval = true;
@@ -354,9 +354,9 @@ bool KoContainerHandler::eventFilter( QObject*, QEvent* ev )
     return false;
 }
 
-KoChild *KoContainerHandler::child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev) {
+KoChild *KoContainerHandler::child(KoChild::Gadget &gadget, TQPoint &pos, const TQMouseEvent *ev) {
 
-    pos = ev->pos(); //+ QPoint(m_view->canvasXOffset(), m_view->canvasYOffset());
+    pos = ev->pos(); //+ TQPoint(m_view->canvasXOffset(), m_view->canvasYOffset());
 
     pos = m_view->reverseViewTransformations( pos );
 
diff --git a/lib/kofficecore/KoContainerHandler.h b/lib/kofficecore/KoContainerHandler.h
index d34d0500..0ea9ba35 100644
--- a/lib/kofficecore/KoContainerHandler.h
+++ b/lib/kofficecore/KoContainerHandler.h
@@ -20,10 +20,10 @@
 #ifndef HANDLER_H
 #define HANDLER_H
 
-#include 
+#include 
 #include 
 
-class QWMatrix;
+class TQWMatrix;
 
 class KoView;
 class KoPartResizeHandlerPrivate;
@@ -40,17 +40,18 @@ class KoPartMoveHandlerPrivate;
  * This design pattern helps you to keep your event filters
  * and your mousePressEvent, mouseMoveEvent etc. methods clean.
  */
-class KOFFICECORE_EXPORT KoEventHandler : public QObject
+class KOFFICECORE_EXPORT KoEventHandler : public TQObject
 {
     Q_OBJECT
+  TQ_OBJECT
 public:
-    KoEventHandler( QObject* target );
+    KoEventHandler( TQObject* target );
     ~KoEventHandler();
 
-    QObject* target();
+    TQObject* target();
 
 private:
-    QObject* m_target;
+    TQObject* m_target;
 };
 
 /**
@@ -60,14 +61,15 @@ private:
 class KoPartResizeHandler : public KoEventHandler
 {
     Q_OBJECT
+  TQ_OBJECT
 public:
-    KoPartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
-                       KoChild::Gadget gadget, const QPoint& point );
+    KoPartResizeHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
+                       KoChild::Gadget gadget, const TQPoint& point );
     ~KoPartResizeHandler();
 
 protected:
-    void repaint(QRegion &rgn);
-    bool eventFilter( QObject*, QEvent* );
+    void tqrepaint(TQRegion &rgn);
+    bool eventFilter( TQObject*, TQEvent* );
 
 private:
     KoPartResizeHandlerPrivate *d;
@@ -80,13 +82,14 @@ private:
 class KoPartMoveHandler : public KoEventHandler
 {
     Q_OBJECT
+  TQ_OBJECT
 public:
-    KoPartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
-                     const QPoint& point );
+    KoPartMoveHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
+                     const TQPoint& point );
     ~KoPartMoveHandler();
 
 protected:
-    bool eventFilter( QObject*, QEvent* );
+    bool eventFilter( TQObject*, TQEvent* );
 
 private:
     KoPartMoveHandlerPrivate *d;
@@ -109,8 +112,9 @@ private:
 class KOFFICECORE_EXPORT KoContainerHandler : public KoEventHandler
 {
     Q_OBJECT
+  TQ_OBJECT
 public:
-    KoContainerHandler( KoView* view, QWidget* widget );
+    KoContainerHandler( KoView* view, TQWidget* widget );
     ~KoContainerHandler();
 
 signals:
@@ -118,7 +122,7 @@ signals:
      * Emitted if the user wants to open the popup menu for some
      * child object.
      */
-    void popupMenu( KoChild*, const QPoint& global_pos );
+    void popupMenu( KoChild*, const TQPoint& global_pos );
 
     /**
       * Emitted if the user pressed the delete key whilst a child was selected
@@ -126,11 +130,11 @@ signals:
     void deleteChild( KoChild* );
 
 protected:
-    bool eventFilter( QObject*, QEvent* );
+    bool eventFilter( TQObject*, TQEvent* );
 
 private:
     /// This is a little helper function to get rid of some duplicated code
-    KoChild *child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev);
+    KoChild *child(KoChild::Gadget &gadget, TQPoint &pos, const TQMouseEvent *ev);
     KoView* m_view;
 };
 
diff --git a/lib/kofficecore/KoDetailsPane.cpp b/lib/kofficecore/KoDetailsPane.cpp
index d94a01f7..85d9c3d6 100644
--- a/lib/kofficecore/KoDetailsPane.cpp
+++ b/lib/kofficecore/KoDetailsPane.cpp
@@ -18,17 +18,17 @@
 */
 #include "KoDetailsPane.h"
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -47,8 +47,8 @@
 class KoFileListItem : public KListViewItem
 {
   public:
-    KoFileListItem(KListView* listView, QListViewItem* after, const QString& filename,
-                   const QString& fullPath, KFileItem* fileItem)
+    KoFileListItem(KListView* listView, TQListViewItem* after, const TQString& filename,
+                   const TQString& fullPath, KFileItem* fileItem)
       : KListViewItem(listView, after, filename, fullPath), m_fileItem(fileItem)
     {
     }
@@ -77,13 +77,13 @@ class KoTemplatesPanePrivate
 
     KInstance* m_instance;
     bool m_selected;
-    QString m_alwaysUseTemplate;
+    TQString m_alwaysUseTemplate;
 };
 
 
-KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance,
+KoTemplatesPane::KoTemplatesPane(TQWidget* tqparent, KInstance* instance,
                                  KoTemplateGroup *group, KoTemplate* /*defaultTemplate*/)
-  : KoDetailsPaneBase(parent, "TemplatesPane")
+  : KoDetailsPaneBase(tqparent, "TemplatesPane")
 {
   d = new KoTemplatesPanePrivate;
   d->m_instance = instance;
@@ -98,24 +98,24 @@ KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance,
   m_openButton->setGuiItem(openGItem);
   m_documentList->header()->hide();
   KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog");
-  QString fullTemplateName = cfgGrp.readPathEntry("FullTemplateName");
+  TQString fullTemplateName = cfgGrp.readPathEntry("FullTemplateName");
   d->m_alwaysUseTemplate = cfgGrp.readPathEntry("AlwaysUseTemplate");
-  connect(m_alwaysUseCheckBox, SIGNAL(clicked()), this, SLOT(alwaysUseClicked()));
+  connect(m_alwaysUseCheckBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(alwaysUseClicked()));
   changePalette();
 
   if(kapp) {
-    connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette()));
+    connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), this, TQT_SLOT(changePalette()));
   }
 
   KListViewItem* selectItem = 0;
 
   for (KoTemplate* t = group->first(); t != 0L; t = group->next()) {
     KListViewItem* item = new KListViewItem(m_documentList, t->name(), t->description(), t->file());
-    QImage icon = t->loadPicture(instance).convertToImage();
-    icon = icon.smoothScale(64, 64, QImage::ScaleMin);
+    TQImage icon = t->loadPicture(instance).convertToImage();
+    icon = icon.smoothScale(64, 64, TQ_ScaleMin);
     icon.setAlphaBuffer(true);
     icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64);
-    item->setPixmap(0, QPixmap(icon));
+    item->setPixmap(0, TQPixmap(icon));
     item->setPixmap(2, t->loadPicture(instance));
 
     if(d->m_alwaysUseTemplate == t->file()) {
@@ -125,13 +125,13 @@ KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance,
     }
   }
 
-  connect(m_documentList, SIGNAL(selectionChanged(QListViewItem*)),
-          this, SLOT(selectionChanged(QListViewItem*)));
-  connect(m_documentList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)),
-          this, SLOT(openTemplate(QListViewItem*)));
-  connect(m_documentList, SIGNAL(returnPressed(QListViewItem*)),
-          this, SLOT(openTemplate(QListViewItem*)));
-  connect(m_openButton, SIGNAL(clicked()), this, SLOT(openTemplate()));
+  connect(m_documentList, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+          this, TQT_SLOT(selectionChanged(TQListViewItem*)));
+  connect(m_documentList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)),
+          this, TQT_SLOT(openTemplate(TQListViewItem*)));
+  connect(m_documentList, TQT_SIGNAL(returnPressed(TQListViewItem*)),
+          this, TQT_SLOT(openTemplate(TQListViewItem*)));
+  connect(m_openButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(openTemplate()));
 
   if(selectItem) {
     m_documentList->setSelected(selectItem, true);
@@ -146,7 +146,7 @@ KoTemplatesPane::~KoTemplatesPane()
   delete d;
 }
 
-void KoTemplatesPane::selectionChanged(QListViewItem* item)
+void KoTemplatesPane::selectionChanged(TQListViewItem* item)
 {
   if(item) {
     m_openButton->setEnabled(true);
@@ -159,18 +159,18 @@ void KoTemplatesPane::selectionChanged(QListViewItem* item)
     m_openButton->setEnabled(false);
     m_alwaysUseCheckBox->setEnabled(false);
     m_alwaysUseCheckBox->setChecked(false);
-    m_titleLabel->setText(QString::null);
-    m_previewLabel->setPixmap(QPixmap());
+    m_titleLabel->setText(TQString());
+    m_previewLabel->setPixmap(TQPixmap());
   }
 }
 
 void KoTemplatesPane::openTemplate()
 {
-  QListViewItem* item = m_documentList->selectedItem();
+  TQListViewItem* item = m_documentList->selectedItem();
   openTemplate(item);
 }
 
-void KoTemplatesPane::openTemplate(QListViewItem* item)
+void KoTemplatesPane::openTemplate(TQListViewItem* item)
 {
   if(item) {
     KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog");
@@ -183,9 +183,9 @@ void KoTemplatesPane::openTemplate(QListViewItem* item)
 
 void KoTemplatesPane::changePalette()
 {
-  QPalette p = kapp ? kapp->palette() : palette();
-  p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background));
-  p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground));
+  TQPalette p = kapp ? kapp->palette() : palette();
+  p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background));
+  p.setColor(TQColorGroup::Text, p.color(TQPalette::Normal, TQColorGroup::Foreground));
   m_detailsLabel->setPalette(p);
 }
 
@@ -196,12 +196,12 @@ bool KoTemplatesPane::isSelected()
 
 void KoTemplatesPane::alwaysUseClicked()
 {
-  QListViewItem* item = m_documentList->selectedItem();
+  TQListViewItem* item = m_documentList->selectedItem();
 
   if(!m_alwaysUseCheckBox->isChecked()) {
     KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog");
-    cfgGrp.writeEntry("AlwaysUseTemplate", QString::null);
-    d->m_alwaysUseTemplate = QString::null;
+    cfgGrp.writeEntry("AlwaysUseTemplate", TQString());
+    d->m_alwaysUseTemplate = TQString();
   } else {
     d->m_alwaysUseTemplate = item->text(2);
   }
@@ -209,12 +209,12 @@ void KoTemplatesPane::alwaysUseClicked()
   emit alwaysUseChanged(this, d->m_alwaysUseTemplate);
 }
 
-void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const QString& alwaysUse)
+void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const TQString& alwaysUse)
 {
   if(this == sender)
     return;
 
-  QListViewItem* item = m_documentList->selectedItem();
+  TQListViewItem* item = m_documentList->selectedItem();
 
   // If the old always use template is selected uncheck the checkbox
   if(item && (item->text(2) == d->m_alwaysUseTemplate)) {
@@ -224,16 +224,16 @@ void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const QSt
   d->m_alwaysUseTemplate = alwaysUse;
 }
 
-bool KoTemplatesPane::eventFilter(QObject* watched, QEvent* e)
+bool KoTemplatesPane::eventFilter(TQObject* watched, TQEvent* e)
 {
-  if(watched == m_previewLabel) {
-    if(e->type() == QEvent::MouseButtonDblClick) {
+  if(TQT_BASE_OBJECT(watched) == m_previewLabel) {
+    if(e->type() == TQEvent::MouseButtonDblClick) {
       openTemplate();
     }
   }
 
-  if(watched == m_documentList) {
-    if((e->type() == QEvent::Resize) && isShown()) {
+  if(TQT_BASE_OBJECT(watched) == m_documentList) {
+    if((e->type() == TQEvent::Resize) && isShown()) {
       emit splitterResized(this, m_splitter->sizes());
     }
   }
@@ -241,7 +241,7 @@ bool KoTemplatesPane::eventFilter(QObject* watched, QEvent* e)
   return false;
 }
 
-void KoTemplatesPane::resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes)
+void KoTemplatesPane::resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes)
 {
   if(sender == this)
     return;
@@ -268,8 +268,8 @@ class KoRecentDocumentsPanePrivate
     KInstance* m_instance;
 };
 
-KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instance)
-  : KoDetailsPaneBase(parent, "RecentDocsPane")
+KoRecentDocumentsPane::KoRecentDocumentsPane(TQWidget* tqparent, KInstance* instance)
+  : KoDetailsPaneBase(tqparent, "RecentDocsPane")
 {
   d = new KoRecentDocumentsPanePrivate;
   d->m_instance = instance;
@@ -284,28 +284,28 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc
   changePalette();
 
   if(kapp) {
-    connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette()));
+    connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), this, TQT_SLOT(changePalette()));
   }
 
-  QString oldGroup = instance->config()->group();
+  TQString oldGroup = instance->config()->group();
   instance->config()->setGroup("RecentFiles");
 
   int i = 0;
-  QString value;
+  TQString value;
   KFileItemList fileList;
   fileList.setAutoDelete(false);
 
   do {
-    QString key = QString("File%1").arg(i);
+    TQString key = TQString("File%1").tqarg(i);
     value = instance->config()->readPathEntry(key);
 
     if(!value.isEmpty()) {
-      QString path = value;
-      QString name;
+      TQString path = value;
+      TQString name;
 
       // Support for kdelibs-3.5's new RecentFiles format: name[url]
       if(path.endsWith("]")) {
-        int pos = path.find("[");
+        int pos = path.tqfind("[");
         name = path.mid(0, pos - 1);
         path = path.mid(pos + 1, path.length() - pos - 2);
       }
@@ -315,16 +315,16 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc
       if(name.isEmpty())
         name = url.filename();
 
-      if(!url.isLocalFile() || QFile::exists(url.path())) {
+      if(!url.isLocalFile() || TQFile::exists(url.path())) {
         KFileItem* fileItem = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url);
         fileList.append(fileItem);
         KoFileListItem* item = new KoFileListItem(m_documentList,
             m_documentList->lastItem(), name, url.url(), fileItem);
         //center all icons in 64x64 area
-        QImage icon = fileItem->pixmap(64).convertToImage();
+        TQImage icon = fileItem->pixmap(64).convertToImage();
         icon.setAlphaBuffer(true);
         icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64);
-        item->setPixmap(0, QPixmap(icon));
+        item->setPixmap(0, TQPixmap(icon));
         item->setPixmap(2, fileItem->pixmap(128));
       }
     }
@@ -334,23 +334,23 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc
 
   instance->config()->setGroup( oldGroup );
 
-  connect(m_documentList, SIGNAL(selectionChanged(QListViewItem*)),
-          this, SLOT(selectionChanged(QListViewItem*)));
-  connect(m_documentList, SIGNAL(clicked(QListViewItem*)),
-          this, SLOT(selectionChanged(QListViewItem*)));
-  connect(m_documentList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)),
-          this, SLOT(openFile(QListViewItem*)));
-  connect(m_documentList, SIGNAL(returnPressed(QListViewItem*)),
-          this, SLOT(openFile(QListViewItem*)));
-  connect(m_openButton, SIGNAL(clicked()), this, SLOT(openFile()));
+  connect(m_documentList, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+          this, TQT_SLOT(selectionChanged(TQListViewItem*)));
+  connect(m_documentList, TQT_SIGNAL(clicked(TQListViewItem*)),
+          this, TQT_SLOT(selectionChanged(TQListViewItem*)));
+  connect(m_documentList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)),
+          this, TQT_SLOT(openFile(TQListViewItem*)));
+  connect(m_documentList, TQT_SIGNAL(returnPressed(TQListViewItem*)),
+          this, TQT_SLOT(openFile(TQListViewItem*)));
+  connect(m_openButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(openFile()));
 
   m_documentList->setSelected(m_documentList->firstChild(), true);
 
   d->m_previewJob = KIO::filePreview(fileList, 200, 200);
 
-  connect(d->m_previewJob, SIGNAL(result(KIO::Job*)), this, SLOT(previewResult(KIO::Job*)));
-  connect(d->m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
-          this, SLOT(updatePreview(const KFileItem*, const QPixmap&)));
+  connect(d->m_previewJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(previewResult(KIO::Job*)));
+  connect(d->m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)),
+          this, TQT_SLOT(updatePreview(const KFileItem*, const TQPixmap&)));
 }
 
 KoRecentDocumentsPane::~KoRecentDocumentsPane()
@@ -358,7 +358,7 @@ KoRecentDocumentsPane::~KoRecentDocumentsPane()
   delete d;
 }
 
-void KoRecentDocumentsPane::selectionChanged(QListViewItem* item)
+void KoRecentDocumentsPane::selectionChanged(TQListViewItem* item)
 {
   if(item) {
     m_openButton->setEnabled(true);
@@ -367,31 +367,31 @@ void KoRecentDocumentsPane::selectionChanged(QListViewItem* item)
 
     if(static_cast(item)->fileItem()) {
       KFileItem* fileItem = static_cast(item)->fileItem();
-      QString details = "
"; + TQString details = "
"; details += i18n("File modification date and time. %1 is date time", "") - .arg(fileItem->timeString(KIO::UDS_MODIFICATION_TIME)); + .tqarg(fileItem->timeString(KIO::UDS_MODIFICATION_TIME)); details += i18n("File access date and time. %1 is date time", "") - .arg(fileItem->timeString(KIO::UDS_ACCESS_TIME)); + .tqarg(fileItem->timeString(KIO::UDS_ACCESS_TIME)); details += "
Modified:%1
Accessed:%1
"; m_detailsLabel->setText(details); } else { - m_detailsLabel->setText(QString::null); + m_detailsLabel->setText(TQString()); } } else { m_openButton->setEnabled(false); - m_titleLabel->setText(QString::null); - m_previewLabel->setPixmap(QPixmap()); - m_detailsLabel->setText(QString::null); + m_titleLabel->setText(TQString()); + m_previewLabel->setPixmap(TQPixmap()); + m_detailsLabel->setText(TQString()); } } void KoRecentDocumentsPane::openFile() { - QListViewItem* item = m_documentList->selectedItem(); + TQListViewItem* item = m_documentList->selectedItem(); openFile(item); } -void KoRecentDocumentsPane::openFile(QListViewItem* item) +void KoRecentDocumentsPane::openFile(TQListViewItem* item) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); cfgGrp.writeEntry("LastReturnType", "File"); @@ -406,22 +406,22 @@ void KoRecentDocumentsPane::previewResult(KIO::Job* job) d->m_previewJob = 0; } -void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const QPixmap& preview) +void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const TQPixmap& preview) { if(preview.isNull()) { return; } - QListViewItemIterator it(m_documentList); + TQListViewItemIterator it(m_documentList); while(it.current()) { if(it.current()->text(1) == fileItem->url().url()) { it.current()->setPixmap(2, preview); - QImage icon = preview.convertToImage(); - icon = icon.smoothScale(64, 64, QImage::ScaleMin); + TQImage icon = preview.convertToImage(); + icon = icon.smoothScale(64, 64, TQ_ScaleMin); icon.setAlphaBuffer(true); icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64); - it.current()->setPixmap(0, QPixmap(icon)); + it.current()->setPixmap(0, TQPixmap(icon)); if(it.current()->isSelected()) { m_previewLabel->setPixmap(preview); @@ -436,22 +436,22 @@ void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const QPixm void KoRecentDocumentsPane::changePalette() { - QPalette p = kapp ? kapp->palette() : palette(); - p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background)); - p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground)); + TQPalette p = kapp ? kapp->palette() : palette(); + p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background)); + p.setColor(TQColorGroup::Text, p.color(TQPalette::Normal, TQColorGroup::Foreground)); m_detailsLabel->setPalette(p); } -bool KoRecentDocumentsPane::eventFilter(QObject* watched, QEvent* e) +bool KoRecentDocumentsPane::eventFilter(TQObject* watched, TQEvent* e) { - if(watched == m_previewLabel) { - if(e->type() == QEvent::MouseButtonDblClick) { + if(TQT_BASE_OBJECT(watched) == m_previewLabel) { + if(e->type() == TQEvent::MouseButtonDblClick) { openFile(); } } - if(watched == m_documentList) { - if((e->type() == QEvent::Resize) && isShown()) { + if(TQT_BASE_OBJECT(watched) == m_documentList) { + if((e->type() == TQEvent::Resize) && isShown()) { emit splitterResized(this, m_splitter->sizes()); } } @@ -459,7 +459,7 @@ bool KoRecentDocumentsPane::eventFilter(QObject* watched, QEvent* e) return false; } -void KoRecentDocumentsPane::resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes) +void KoRecentDocumentsPane::resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes) { if(sender == this) return; diff --git a/lib/kofficecore/KoDetailsPane.h b/lib/kofficecore/KoDetailsPane.h index 96a92b98..bee6f14a 100644 --- a/lib/kofficecore/KoDetailsPane.h +++ b/lib/kofficecore/KoDetailsPane.h @@ -26,11 +26,11 @@ class KoTemplateGroup; class KoTemplate; class KInstance; -class QListViewItem; +class TQListViewItem; class KoRecentDocumentsPanePrivate; class KoRichTextListItemPrivate; class KFileItem; -class QPixmap; +class TQPixmap; namespace KIO { class Job; @@ -40,46 +40,47 @@ class KoTemplatesPanePrivate; /** * This widget is the right-side part of the template opening widget. - * The parent widget is initial widget in the document space of each KOffice component. + * The tqparent widget is initial widget in the document space of each KOffice component. * This widget shows a list of templates and can show their details or open it. */ class KoTemplatesPane : public KoDetailsPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the instance object for the app * @param group the group of templates this widget will show. * @param defaultTemplate pointer to the default template. Used to select a * template when none has been selected before. */ - KoTemplatesPane(QWidget* parent, KInstance* instance, + KoTemplatesPane(TQWidget* tqparent, KInstance* instance, KoTemplateGroup* group, KoTemplate* defaultTemplate); ~KoTemplatesPane(); /// Returns true if a template in this group was the last one selected bool isSelected(); - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); signals: - void openTemplate(const QString&); + void openTemplate(const TQString&); /// Emited when the always use checkbox is selected - void alwaysUseChanged(KoTemplatesPane* sender, const QString& alwaysUse); + void alwaysUseChanged(KoTemplatesPane* sender, const TQString& alwaysUse); - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); public slots: - void resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes); + void resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes); protected slots: - void selectionChanged(QListViewItem* item); + void selectionChanged(TQListViewItem* item); void openTemplate(); - void openTemplate(QListViewItem* item); + void openTemplate(TQListViewItem* item); void alwaysUseClicked(); - void changeAlwaysUseTemplate(KoTemplatesPane* sender, const QString& alwaysUse); + void changeAlwaysUseTemplate(KoTemplatesPane* sender, const TQString& alwaysUse); void changePalette(); @@ -90,38 +91,39 @@ class KoTemplatesPane : public KoDetailsPaneBase /** * This widget is the recent doc part of the template opening widget. - * The parent widget is initial widget in the document space of each KOffice component. + * The tqparent widget is initial widget in the document space of each KOffice component. * This widget shows a list of recent documents and can show their details or open it. */ class KoRecentDocumentsPane : public KoDetailsPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the instance object for the app */ - KoRecentDocumentsPane(QWidget* parent, KInstance* instance); + KoRecentDocumentsPane(TQWidget* tqparent, KInstance* instance); ~KoRecentDocumentsPane(); - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); signals: - void openFile(const QString&); + void openFile(const TQString&); - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); public slots: - void resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes); + void resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes); protected slots: - void selectionChanged(QListViewItem* item); + void selectionChanged(TQListViewItem* item); void openFile(); - void openFile(QListViewItem* item); + void openFile(TQListViewItem* item); void previewResult(KIO::Job* job); - void updatePreview(const KFileItem* fileItem, const QPixmap& preview); + void updatePreview(const KFileItem* fileItem, const TQPixmap& preview); void changePalette(); diff --git a/lib/kofficecore/KoDocument.cpp b/lib/kofficecore/KoDocument.cpp index 50003627..695599d2 100644 --- a/lib/kofficecore/KoDocument.cpp +++ b/lib/kofficecore/KoDocument.cpp @@ -49,17 +49,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -76,7 +76,7 @@ #define INTERNAL_PREFIX "intern:/" // Warning, keep it sync in koStore.cc and koDocumentChild.cc -QPtrList *KoDocument::s_documentList=0L; +TQPtrList *KoDocument::s_documentList=0L; using namespace std; class KoViewWrapperWidget; @@ -103,7 +103,7 @@ public: m_shouldCheckAutoSaveFile( true ), m_autoErrorHandlingEnabled( true ), m_backupFile( true ), - m_backupPath( QString::null ), + m_backupPath( TQString() ), m_doNotSaveExtDoc( false ), m_current( false ), m_storeInternal( false ), @@ -119,10 +119,10 @@ public: } } - QPtrList m_views; - QPtrList m_children; - QPtrList m_shells; - QValueList m_viewBuildDocuments; + TQPtrList m_views; + TQPtrList m_tqchildren; + TQPtrList m_shells; + TQValueList m_viewBuildDocuments; KoViewWrapperWidget *m_wrapperWidget; KoDocumentIface * m_dcopObject; @@ -133,16 +133,16 @@ public: KoFilterManager * filterManager; // The filter-manager to use when loading/saving [for the options] - QCString mimeType; // The actual mimetype of the document - QCString outputMimeType; // The mimetype to use when saving + TQCString mimeType; // The actual mimetype of the document + TQCString outputMimeType; // The mimetype to use when saving bool m_confirmNonNativeSave [2]; // used to pop up a dialog when saving for the // first time if the file is in a foreign format // (Save/Save As, Export) int m_specialOutputFlag; // See KoFileDialog in koMainWindow.cc bool m_isImporting, m_isExporting; // File --> Import/Export vs File --> Open/Save - QTimer m_autoSaveTimer; - QString lastErrorMessage; // see openFile() + TQTimer m_autoSaveTimer; + TQString lastErrorMessage; // see openFile() int m_autoSaveDelay; // in seconds, 0 to disable. int m_numOperations; bool modifiedAfterAutosave; @@ -151,45 +151,45 @@ public: bool m_shouldCheckAutoSaveFile; // usually true bool m_autoErrorHandlingEnabled; // usually true bool m_backupFile; - QString m_backupPath; + TQString m_backupPath; bool m_doNotSaveExtDoc; // makes it possible to save only internally stored child documents bool m_current; bool m_storeInternal; // Store this doc internally even if url is external bool m_bLoading; // True while loading (openURL is async) KoOpenPane* m_startUpWidget; - QString m_templateType; + TQString m_templateType; }; // Used in singleViewMode -class KoViewWrapperWidget : public QWidget +class KoViewWrapperWidget : public TQWidget { public: - KoViewWrapperWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) + KoViewWrapperWidget( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { KGlobal::locale()->insertCatalogue("koffice"); // Tell the iconloader about share/apps/koffice/icons KGlobal::iconLoader()->addAppDir("koffice"); m_view = 0L; // Avoid warning from KParts - we'll have the KoView as focus proxy anyway - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); } virtual ~KoViewWrapperWidget() { setFocusProxy( 0 ); // to prevent a crash due to clearFocus (#53466) } - virtual void resizeEvent( QResizeEvent * ) + virtual void resizeEvent( TQResizeEvent * ) { - QObject *wid = child( 0, "QWidget" ); + TQObject *wid = child( 0, TQWIDGET_OBJECT_NAME_STRING ); if ( wid ) - static_cast(wid)->setGeometry( 0, 0, width(), height() ); + TQT_TQWIDGET(wid)->setGeometry( 0, 0, width(), height() ); } - virtual void childEvent( QChildEvent *ev ) + virtual void childEvent( TQChildEvent *ev ) { - if ( ev->type() == QEvent::ChildInserted ) + if ( ev->type() == TQEvent::ChildInserted ) resizeEvent( 0L ); } @@ -211,7 +211,7 @@ KoBrowserExtension::KoBrowserExtension( KoDocument * doc, const char * name ) void KoBrowserExtension::print() { - KoDocument * doc = static_cast( parent() ); + KoDocument * doc = static_cast( tqparent() ); KoViewWrapperWidget * wrapper = static_cast( doc->widget() ); KoView * view = wrapper->koView(); // TODO remove code duplication (KoMainWindow), by moving this to KoView @@ -222,32 +222,32 @@ void KoBrowserExtension::print() view->print( printer ); } -KoDocument::KoDocument( QWidget * parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode ) - : KParts::ReadWritePart( parent, name ) +KoDocument::KoDocument( TQWidget * tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode ) + : KParts::ReadWritePart( tqparent, name ) { if(s_documentList==0L) - s_documentList=new QPtrList; + s_documentList=new TQPtrList; s_documentList->append(this); d = new Private; m_bEmpty = TRUE; - connect( &d->m_autoSaveTimer, SIGNAL( timeout() ), this, SLOT( slotAutoSave() ) ); + connect( &d->m_autoSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoSave() ) ); setAutoSave( s_defaultAutoSave ); d->m_bSingleViewMode = singleViewMode; - // the parent setting *always* overrides! (Simon) - if ( parent ) + // the tqparent setting *always* overrides! (Simon) + if ( tqparent ) { - if ( parent->inherits( "KoDocument" ) ) - d->m_bSingleViewMode = ((KoDocument *)parent)->isSingleViewMode(); - else if ( parent->inherits( "KParts::Part" ) ) + if ( tqparent->inherits( "KoDocument" ) ) + d->m_bSingleViewMode = ((KoDocument *)tqparent)->isSingleViewMode(); + else if ( tqparent->inherits( "KParts::Part" ) ) d->m_bSingleViewMode = true; } if ( singleViewMode ) { - d->m_wrapperWidget = new KoViewWrapperWidget( parentWidget, widgetName ); + d->m_wrapperWidget = new KoViewWrapperWidget( tqparentWidget, widgetName ); setWidget( d->m_wrapperWidget ); kdDebug(30003) << "creating KoBrowserExtension" << endl; (void) new KoBrowserExtension( this ); // ## only if embedded into a browser? @@ -264,29 +264,29 @@ KoDocument::KoDocument( QWidget * parentWidget, const char *widgetName, QObject* // A way to 'fix' the job's window, since we have no widget known to KParts if ( !singleViewMode ) - connect( this, SIGNAL( started( KIO::Job* ) ), SLOT( slotStarted( KIO::Job* ) ) ); + connect( this, TQT_SIGNAL( started( KIO::Job* ) ), TQT_SLOT( slotStarted( KIO::Job* ) ) ); } KoDocument::~KoDocument() { d->m_autoSaveTimer.stop(); - QPtrListIterator childIt( d->m_children ); + TQPtrListIterator childIt( d->m_tqchildren ); for (; childIt.current(); ++childIt ) - disconnect( childIt.current(), SIGNAL( destroyed() ), - this, SLOT( slotChildDestroyed() ) ); + disconnect( childIt.current(), TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( slotChildDestroyed() ) ); // Tell our views that the document is already destroyed and // that they shouldn't try to access it. - QPtrListIterator vIt( d->m_views ); + TQPtrListIterator vIt( d->m_views ); for (; vIt.current(); ++vIt ) vIt.current()->setDocumentDeleted(); delete d->m_startUpWidget; d->m_startUpWidget = 0; - d->m_children.setAutoDelete( true ); - d->m_children.clear(); + d->m_tqchildren.setAutoDelete( true ); + d->m_tqchildren.clear(); d->m_shells.setAutoDelete( true ); d->m_shells.clear(); @@ -309,12 +309,12 @@ bool KoDocument::isSingleViewMode() const bool KoDocument::isEmbedded() const { - return dynamic_cast( parent() ) != 0; + return dynamic_cast( tqparent() ) != 0; } -KoView *KoDocument::createView( QWidget *parent, const char *name ) +KoView *KoDocument::createView( TQWidget *tqparent, const char *name ) { - KoView *view=createViewInstance(parent, name); + KoView *view=createViewInstance(tqparent, name); addView(view); return view; } @@ -334,10 +334,10 @@ bool KoDocument::exp0rt( const KURL & _url ) // non-virtual). // KURL oldURL = m_url; - QString oldFile = m_file; + TQString oldFile = m_file; bool wasModified = isModified (); - QCString oldMimeType = mimeType (); + TQCString oldMimeType = mimeType (); // save... @@ -382,12 +382,12 @@ bool KoDocument::saveFile() const bool wasModified = isModified (); // The output format is set by koMainWindow, and by openFile - QCString outputMimeType = d->outputMimeType; + TQCString outputMimeType = d->outputMimeType; //Q_ASSERT( !outputMimeType.isEmpty() ); // happens when using the DCOP method saveAs if ( outputMimeType.isEmpty() ) outputMimeType = d->outputMimeType = nativeFormatMimeType(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); if ( backupFile() ) { if ( url().isLocalFile() ) @@ -401,7 +401,7 @@ bool KoDocument::saveFile() backup = url(); else backup = d->m_backupPath +"/"+url().fileName(); - backup.setPath( backup.path() + QString::fromLatin1("~") ); + backup.setPath( backup.path() + TQString::tqfromLatin1("~") ); KFileItem item( entry, url() ); Q_ASSERT( item.name() == url().fileName() ); KIO::NetAccess::file_copy( url(), backup, item.permissions(), true /*overwrite*/, false /*resume*/, shells().current() ); @@ -418,7 +418,7 @@ bool KoDocument::saveFile() if ( !d->filterManager ) d->filterManager = new KoFilterManager( this ); - KoFilter::ConversionStatus status = d->filterManager->exp0rt( m_file, outputMimeType ); + KoFilter::ConversiontqStatus status = d->filterManager->exp0rt( m_file, outputMimeType ); ret = status == KoFilter::OK; suppressErrorDialog = (status == KoFilter::UserCancelled || status == KoFilter::BadConversionGraph ); } else { @@ -434,7 +434,7 @@ bool KoDocument::saveFile() setAutoSave( d->m_autoSaveDelay ); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( !ret ) { if ( !suppressErrorDialog ) @@ -468,23 +468,23 @@ bool KoDocument::saveFile() return ret; } -QCString KoDocument::mimeType() const +TQCString KoDocument::mimeType() const { return d->mimeType; } -void KoDocument::setMimeType( const QCString & mimeType ) +void KoDocument::setMimeType( const TQCString & mimeType ) { d->mimeType = mimeType; } -void KoDocument::setOutputMimeType( const QCString & mimeType, int specialOutputFlag ) +void KoDocument::setOutputMimeType( const TQCString & mimeType, int specialOutputFlag ) { d->outputMimeType = mimeType; d->m_specialOutputFlag = specialOutputFlag; } -QCString KoDocument::outputMimeType() const +TQCString KoDocument::outputMimeType() const { return d->outputMimeType; } @@ -540,7 +540,7 @@ void KoDocument::slotAutoSave() { if ( isModified() && d->modifiedAfterAutosave && !d->m_bLoading ) { - connect( this, SIGNAL( sigProgress( int ) ), shells().current(), SLOT( slotProgress( int ) ) ); + connect( this, TQT_SIGNAL( sigProgress( int ) ), shells().current(), TQT_SLOT( slotProgress( int ) ) ); emit sigStatusBarMessage( i18n("Autosaving...") ); d->m_autosaving = true; bool ret = saveNativeFormat( autoSaveFile( m_file ) ); @@ -551,13 +551,13 @@ void KoDocument::slotAutoSave() } d->m_autosaving = false; emit sigClearStatusBarMessage(); - disconnect( this, SIGNAL( sigProgress( int ) ), shells().current(), SLOT( slotProgress( int ) ) ); + disconnect( this, TQT_SIGNAL( sigProgress( int ) ), shells().current(), TQT_SLOT( slotProgress( int ) ) ); if ( !ret ) emit sigStatusBarMessage( i18n("Error during autosave! Partition full?") ); } } -KAction *KoDocument::action( const QDomElement &element ) const +KAction *KoDocument::action( const TQDomElement &element ) const { // First look in the document itself KAction* act = KParts::ReadWritePart::action( element ); @@ -572,13 +572,13 @@ KAction *KoDocument::action( const QDomElement &element ) const return 0L; } -QDomDocument KoDocument::domDocument() const +TQDomDocument KoDocument::domDocument() const { // When embedded into e.g. konqueror, we want the view's GUI (hopefully a reduced one) // to be used. Q_ASSERT( d->m_bSingleViewMode ); if ( d->m_views.isEmpty() ) - return QDomDocument(); + return TQDomDocument(); else return d->m_views.getFirst()->domDocument(); } @@ -591,7 +591,7 @@ void KoDocument::setManager( KParts::PartManager *manager ) if ( manager ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) if ( it.current()->document() ) manager->addPart( it.current()->document(), false ); @@ -602,11 +602,11 @@ void KoDocument::setReadWrite( bool readwrite ) { KParts::ReadWritePart::setReadWrite( readwrite ); - QPtrListIterator vIt( d->m_views ); + TQPtrListIterator vIt( d->m_views ); for (; vIt.current(); ++vIt ) vIt.current()->updateReadWrite( readwrite ); - QPtrListIterator dIt( d->m_children ); + TQPtrListIterator dIt( d->m_tqchildren ); for (; dIt.current(); ++dIt ) if ( dIt.current()->document() ) dIt.current()->document()->setReadWrite( readwrite ); @@ -637,7 +637,7 @@ void KoDocument::removeView( KoView *view ) d->m_views.removeRef( view ); } -const QPtrList& KoDocument::views() const +const TQPtrList& KoDocument::views() const { return d->m_views; } @@ -651,12 +651,12 @@ void KoDocument::insertChild( KoDocumentChild *child ) { setModified( true ); - d->m_children.append( child ); + d->m_tqchildren.append( child ); - connect( child, SIGNAL( changed( KoChild * ) ), - this, SLOT( slotChildChanged( KoChild * ) ) ); - connect( child, SIGNAL( destroyed() ), - this, SLOT( slotChildDestroyed() ) ); + connect( child, TQT_SIGNAL( changed( KoChild * ) ), + this, TQT_SLOT( slotChildChanged( KoChild * ) ) ); + connect( child, TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( slotChildDestroyed() ) ); // It may be that insertChild is called without the KoDocumentChild // having a KoDocument attached, yet. This happens for example @@ -681,23 +681,23 @@ void KoDocument::slotChildDestroyed() setModified( true ); const KoDocumentChild *child = static_cast( sender() ); - d->m_children.removeRef( child ); + d->m_tqchildren.removeRef( child ); } -const QPtrList& KoDocument::children() const +const TQPtrList& KoDocument::tqchildren() const { - return d->m_children; + return d->m_tqchildren; } -KParts::Part *KoDocument::hitTest( QWidget *widget, const QPoint &globalPos ) +KParts::Part *KoDocument::hitTest( TQWidget *widget, const TQPoint &globalPos ) { - QPtrListIterator it( d->m_views ); + TQPtrListIterator it( d->m_views ); for (; it.current(); ++it ) - if ( static_cast(it.current()) == widget ) + if ( static_cast(it.current()) == widget ) { KoView* view = it.current(); d->hitTestView = view; // koffice-1.x hack - QPoint canvasPos( view->canvas()->mapFromGlobal( globalPos ) ); + TQPoint canvasPos( view->canvas()->mapFromGlobal( globalPos ) ); canvasPos.rx() += view->canvasXOffset(); canvasPos.ry() += view->canvasYOffset(); @@ -715,10 +715,10 @@ KoView* KoDocument::hitTestView() return d->hitTestView; } -KoDocument* KoDocument::hitTest( const QPoint &pos, const QWMatrix &matrix ) +KoDocument* KoDocument::hitTest( const TQPoint &pos, const TQWMatrix &matrix ) { // Call KoDocumentChild::hitTest for any child document - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) { KoDocument *doc = it.current()->hitTest( pos, matrix ); @@ -732,7 +732,7 @@ KoDocument* KoDocument::hitTest( const QPoint &pos, const QWMatrix &matrix ) KoDocumentChild *KoDocument::child( KoDocument *doc ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) if ( it.current()->document() == doc ) return it.current(); @@ -745,9 +745,9 @@ KoDocumentInfo *KoDocument::documentInfo() const return d->m_docInfo; } -void KoDocument::setViewBuildDocument( KoView *view, const QDomDocument &doc ) +void KoDocument::setViewBuildDocument( KoView *view, const TQDomDocument &doc ) { - if ( d->m_views.find( view ) == -1 ) + if ( d->m_views.tqfind( view ) == -1 ) return; uint viewIdx = d->m_views.at(); @@ -758,11 +758,11 @@ void KoDocument::setViewBuildDocument( KoView *view, const QDomDocument &doc ) d->m_viewBuildDocuments[ viewIdx ] = doc; } -QDomDocument KoDocument::viewBuildDocument( KoView *view ) +TQDomDocument KoDocument::viewBuildDocument( KoView *view ) { - QDomDocument res; + TQDomDocument res; - if ( d->m_views.find( view ) == -1 ) + if ( d->m_views.tqfind( view ) == -1 ) return res; uint viewIdx = d->m_views.at(); @@ -772,21 +772,21 @@ QDomDocument KoDocument::viewBuildDocument( KoView *view ) res = d->m_viewBuildDocuments[ viewIdx ]; - // make this entry empty. otherwise we get a segfault in QMap ;-( - d->m_viewBuildDocuments[ viewIdx ] = QDomDocument(); + // make this entry empty. otherwise we get a segfault in TQMap ;-( + d->m_viewBuildDocuments[ viewIdx ] = TQDomDocument(); return res; } -void KoDocument::paintEverything( QPainter &painter, const QRect &rect, bool transparent, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintEverything( TQPainter &painter, const TQRect &rect, bool transparent, KoView *view, double zoomX, double zoomY ) { paintContent( painter, rect, transparent, zoomX, zoomY ); paintChildren( painter, rect, view, zoomX, zoomY ); } -void KoDocument::paintChildren( QPainter &painter, const QRect &/*rect*/, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintChildren( TQPainter &painter, const TQRect &/*rect*/, KoView *view, double zoomX, double zoomY ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) { // #### todo: paint only if child is visible inside rect @@ -796,12 +796,12 @@ void KoDocument::paintChildren( QPainter &painter, const QRect &/*rect*/, KoView } } -void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintChild( KoDocumentChild *child, TQPainter &painter, KoView *view, double zoomX, double zoomY ) { if ( child->isDeleted() ) return; - // QRegion rgn = painter.clipRegion(); + // TQRegion rgn = painter.clipRegion(); child->transform( painter ); child->document()->paintEverything( painter, child->contentRect(), child->isTransparent(), view, zoomX, zoomY ); @@ -816,9 +816,9 @@ void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView * int w = int( (double)child->contentRect().width() * child->xScaling() ); int h = int( (double)child->contentRect().height() * child->yScaling() ); if ( ( manager->selectedPart() == (KParts::Part *)child->document() && - manager->selectedWidget() == (QWidget *)view ) || + manager->selectedWidget() == (TQWidget *)view ) || ( manager->activePart() == (KParts::Part *)child->document() && - manager->activeWidget() == (QWidget *)view ) ) + manager->activeWidget() == (TQWidget *)view ) ) { // painter.setClipRegion( rgn ); painter.setClipping( FALSE ); @@ -834,9 +834,9 @@ void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView * painter.fillRect( w, -5, 5, h + 10, BDiagPattern ); if ( manager->selectedPart() == (KParts::Part *)child->document() && - manager->selectedWidget() == (QWidget *)view ) + manager->selectedWidget() == (TQWidget *)view ) { - QColor color; + TQColor color; if ( view->koDocument() == this ) color = black; else @@ -863,8 +863,8 @@ bool KoDocument::isModified() const //kdDebug(30003)< it( children() ); + TQPtrListIterator it( tqchildren() ); for( ; it.current(); ++it ) { KoDocument* childDoc = it.current()->document(); if (childDoc && !it.current()->isDeleted()) @@ -886,7 +886,7 @@ bool KoDocument::saveChildren( KoStore* _store ) if ( !childDoc->isStoredExtern() ) { //kdDebug(30003) << "KoDocument::saveChildren internal url: /" << i << endl; - if ( !childDoc->saveToStore( _store, QString::number( i++ ) ) ) + if ( !childDoc->saveToStore( _store, TQString::number( i++ ) ) ) return FALSE; if (!isExporting ()) @@ -900,8 +900,8 @@ bool KoDocument::saveChildren( KoStore* _store ) bool KoDocument::saveChildrenOasis( KoStore* store, KoXmlWriter* manifestWriter ) { - //kdDebug(30003)< it( children() ); + //kdDebug(30003)< it( tqchildren() ); for( ; it.current(); ++it ) { KoDocument* childDoc = it.current()->document(); if ( childDoc && !it.current()->isDeleted() ) @@ -924,9 +924,9 @@ bool KoDocument::saveExternalChildren() return true; } - //kdDebug(30003)< it = children(); + TQPtrListIterator it = tqchildren(); for (; (ch = it.current()); ++it ) { if ( !ch->isDeleted() ) @@ -935,7 +935,7 @@ bool KoDocument::saveExternalChildren() if ( doc && doc->isStoredExtern() && doc->isModified() ) { kdDebug(30003)<<" save external doc='"<setDoNotSaveExtDoc(); // Only save doc + it's internal children + doc->setDoNotSaveExtDoc(); // Only save doc + it's internal tqchildren if ( !doc->save() ) return false; // error } @@ -948,9 +948,9 @@ bool KoDocument::saveExternalChildren() return true; } -bool KoDocument::saveNativeFormat( const QString & file ) +bool KoDocument::saveNativeFormat( const TQString & file ) { - d->lastErrorMessage = QString::null; + d->lastErrorMessage = TQString(); //kdDebug(30003) << "Saving to store" << endl; KoStore::Backend backend = KoStore::Auto; @@ -971,10 +971,10 @@ bool KoDocument::saveNativeFormat( const QString & file ) else if ( d->m_specialOutputFlag == SaveAsFlatXML ) { kdDebug(30003) << "Saving as a flat XML file." << endl; - QFile f( file ); + TQFile f( file ); if ( f.open( IO_WriteOnly | IO_Translate ) ) { - bool success = saveToStream( &f ); + bool success = saveToStream( TQT_TQIODEVICE(&f) ); f.close(); return success; } @@ -984,9 +984,9 @@ bool KoDocument::saveNativeFormat( const QString & file ) kdDebug(30003) << "KoDocument::saveNativeFormat nativeFormatMimeType=" << nativeFormatMimeType() << endl; // OLD: bool oasis = d->m_specialOutputFlag == SaveAsOASIS; - // OLD: QCString mimeType = oasis ? nativeOasisMimeType() : nativeFormatMimeType(); - QCString mimeType = d->outputMimeType; - QCString nativeOasisMime = nativeOasisMimeType(); + // OLD: TQCString mimeType = oasis ? nativeOasisMimeType() : nativeFormatMimeType(); + TQCString mimeType = d->outputMimeType; + TQCString nativeOasisMime = nativeOasisMimeType(); bool oasis = !mimeType.isEmpty() && ( mimeType == nativeOasisMime || mimeType == nativeOasisMime + "-template" ); // TODO: use std::auto_ptr or create store on stack [needs API fixing], // to remove all the 'delete store' in all the branches @@ -1031,7 +1031,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "meta.xml" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "meta.xml" ); delete store; return false; } @@ -1039,7 +1039,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) if ( store->open( "Thumbnails/thumbnail.png" ) ) { if ( !saveOasisPreview( store, manifestWriter ) || !store->close() ) { - d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).arg( "Thumbnails/thumbnail.png" ); + d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).tqarg( "Thumbnails/thumbnail.png" ); delete store; return false; } @@ -1047,7 +1047,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "Thumbnails/thumbnail.png" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "Thumbnails/thumbnail.png" ); delete store; return false; } @@ -1055,7 +1055,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) // Write out manifest file if ( !oasisStore.closeManifestWriter() ) { - d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).arg( "META-INF/manifest.xml" ); + d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).tqarg( "META-INF/manifest.xml" ); delete store; return false; } @@ -1064,7 +1064,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - // Save internal children first since they might get a new url + // Save internal tqchildren first since they might get a new url if ( !saveChildren( store ) && !oasis ) { if ( d->lastErrorMessage.isEmpty() ) @@ -1086,16 +1086,16 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "maindoc.xml" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "maindoc.xml" ); delete store; return false; } if ( store->open( "documentinfo.xml" ) ) { - QDomDocument doc = d->m_docInfo->save(); + TQDomDocument doc = d->m_docInfo->save(); KoStoreDevice dev( store ); - QCString s = doc.toCString(); // this is already Utf8! + TQCString s = doc.toCString(); // this is already Utf8! (void)dev.writeBlock( s.data(), s.size()-1 ); (void)store->close(); } @@ -1122,13 +1122,13 @@ bool KoDocument::saveNativeFormat( const QString & file ) return true; } -bool KoDocument::saveToStream( QIODevice * dev ) +bool KoDocument::saveToStream( TQIODevice * dev ) { - QDomDocument doc = saveXML(); + TQDomDocument doc = saveXML(); // Save to buffer - QCString s = doc.toCString(); // utf8 already - // We use QCString::size()-1 here, not the official QCString::length - // It works here, as we are not modifying QCString as QByteArray + TQCString s = doc.toCString(); // utf8 already + // We use TQCString::size()-1 here, not the official TQCString::length + // It works here, as we are not modifying TQCString as TQByteArray int nwritten = dev->writeBlock( s.data(), s.size()-1 ); if ( nwritten != (int)s.size()-1 ) kdWarning(30003) << "KoDocument::saveToStream wrote " << nwritten << " - expected " << s.size()-1 << endl; @@ -1136,7 +1136,7 @@ bool KoDocument::saveToStream( QIODevice * dev ) } // Called for embedded documents -bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) +bool KoDocument::saveToStore( KoStore* _store, const TQString & _path ) { kdDebug(30003) << "Saving document to store " << _path << endl; @@ -1146,7 +1146,7 @@ bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) else // ugly hack to pass a relative URI m_url = KURL( INTERNAL_PREFIX + _path ); - // To make the children happy cd to the correct directory + // To make the tqchildren happy cd to the correct directory _store->pushDirectory(); _store->enterDirectory( _path ); @@ -1180,8 +1180,8 @@ bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) bool KoDocument::saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ) { - const QPixmap pix = generatePreview( QSize( 128, 128 ) ); - QImage preview ( pix.convertToImage().convertDepth( 32, Qt::ColorOnly ) ); + const TQPixmap pix = generatePreview( TQSize( 128, 128 ) ); + TQImage preview ( pix.convertToImage().convertDepth( 32, Qt::ColorOnly ) ); if ( !preview.hasAlphaBuffer() ) { preview.setAlphaBuffer( true ); @@ -1200,9 +1200,9 @@ bool KoDocument::saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ) bool KoDocument::savePreview( KoStore* store ) { - QPixmap pix = generatePreview(QSize(256, 256)); + TQPixmap pix = generatePreview(TQSize(256, 256)); // Reducing to 8bpp reduces file sizes quite a lot. - const QImage preview ( pix.convertToImage().convertDepth( 8, Qt::AvoidDither | Qt::DiffuseDither) ); + const TQImage preview ( pix.convertToImage().convertDepth( 8, Qt::AvoidDither | Qt::DiffuseDither) ); KoStoreDevice io ( store ); if ( !io.open( IO_WriteOnly ) ) return false; @@ -1212,24 +1212,24 @@ bool KoDocument::savePreview( KoStore* store ) return true; } -QPixmap KoDocument::generatePreview( const QSize& size ) +TQPixmap KoDocument::generatePreview( const TQSize& size ) { double docWidth, docHeight; - int pixmapSize = QMAX(size.width(), size.height()); + int pixmapSize = TQMAX(size.width(), size.height()); if (m_pageLayout.ptWidth > 1.0) { docWidth = m_pageLayout.ptWidth / 72 * KoGlobal::dpiX(); docHeight = m_pageLayout.ptHeight / 72 * KoGlobal::dpiY(); } else { - // If we don't have a page layout, just draw the top left hand corner + // If we don't have a page tqlayout, just draw the top left hand corner docWidth = 500.0; docHeight = 500.0; } double ratio = docWidth / docHeight; - QPixmap pix; + TQPixmap pix; int previewWidth, previewHeight; if (ratio > 1.0) { @@ -1244,22 +1244,22 @@ QPixmap KoDocument::generatePreview( const QSize& size ) pix.resize((int)docWidth, (int)docHeight); - pix.fill( QColor( 245, 245, 245 ) ); + pix.fill( TQColor( 245, 245, 245 ) ); - QRect rc(0, 0, pix.width(), pix.height()); + TQRect rc(0, 0, pix.width(), pix.height()); - QPainter p; + TQPainter p; p.begin(&pix); paintEverything(p, rc, false); p.end(); - // ### TODO: why re-convert it to a QPixmap, when mostly it will be re-converted back to a QImage in the calling function + // ### TODO: why re-convert it to a TQPixmap, when mostly it will be re-converted back to a TQImage in the calling function pix.convertFromImage(pix.convertToImage().smoothScale(previewWidth, previewHeight)); return pix; } -QString KoDocument::autoSaveFile( const QString & path ) const +TQString KoDocument::autoSaveFile( const TQString & path ) const { // set local again as it can happen that it gets resetted // so that all saved numbers have a . and not e.g a , as a @@ -1268,36 +1268,36 @@ QString KoDocument::autoSaveFile( const QString & path ) const // Using the extension allows to avoid relying on the mime magic when opening KMimeType::Ptr mime = KMimeType::mimeType( nativeFormatMimeType() ); - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); if ( path.isEmpty() ) { // Never saved? Use a temp file in $HOME then // Yes, two open unnamed docs will overwrite each other's autosave file, // but hmm, we can only do something if that's in the same process anyway... - QString ret = QDir::homeDirPath() + "/." + QString::fromLatin1(instance()->instanceName()) + ".autosave" + extension; + TQString ret = TQDir::homeDirPath() + "/." + TQString::tqfromLatin1(instance()->instanceName()) + ".autosave" + extension; return ret; } else { KURL url( path ); Q_ASSERT( url.isLocalFile() ); - QString dir = url.directory(false); - QString filename = url.fileName(); + TQString dir = url.directory(false); + TQString filename = url.fileName(); return dir + "." + filename + ".autosave" + extension; } } bool KoDocument::checkAutoSaveFile() { - QString asf = autoSaveFile( QString::null ); // the one in $HOME + TQString asf = autoSaveFile( TQString() ); // the one in $HOME //kdDebug(30003) << "asf=" << asf << endl; - if ( QFile::exists( asf ) ) + if ( TQFile::exists( asf ) ) { - QDateTime date = QFileInfo(asf).lastModified(); - QString dateStr = date.toString(Qt::LocalDate); + TQDateTime date = TQFileInfo(asf).lastModified(); + TQString dateStr = date.toString(Qt::LocalDate); int res = KMessageBox::warningYesNoCancel( 0, i18n( "An autosaved file for an unnamed document exists in %1.\nThis file is dated %2\nDo you want to open it?" ) - .arg(asf, dateStr) ); + .tqarg(asf, dateStr) ); switch(res) { case KMessageBox::Yes : { KURL url; @@ -1308,7 +1308,7 @@ bool KoDocument::checkAutoSaveFile() return ret; } case KMessageBox::No : - QFile::remove( asf ); + TQFile::remove( asf ); return false; default: // Cancel return false; @@ -1344,12 +1344,12 @@ bool KoDocument::import( const KURL & _url ) bool KoDocument::openURL( const KURL & _url ) { kdDebug(30003) << "KoDocument::openURL url=" << _url.url() << endl; - d->lastErrorMessage = QString::null; + d->lastErrorMessage = TQString(); // Reimplemented, to add a check for autosave files and to improve error reporting if ( !_url.isValid() ) { - d->lastErrorMessage = i18n( "Malformed URL\n%1" ).arg( _url.url() ); // ## used anywhere ? + d->lastErrorMessage = i18n( "Malformed URL\n%1" ).tqarg( _url.url() ); // ## used anywhere ? return false; } if ( !closeURL() ) @@ -1360,9 +1360,9 @@ bool KoDocument::openURL( const KURL & _url ) d->m_bLoading = true; if ( url.isLocalFile() && d->m_shouldCheckAutoSaveFile ) { - QString file = url.path(); - QString asf = autoSaveFile( file ); - if ( QFile::exists( asf ) ) + TQString file = url.path(); + TQString asf = autoSaveFile( file ); + if ( TQFile::exists( asf ) ) { //kdDebug(30003) << "KoDocument::openURL asf=" << asf << endl; // ## TODO compare timestamps ? @@ -1374,7 +1374,7 @@ bool KoDocument::openURL( const KURL & _url ) autosaveOpened = true; break; case KMessageBox::No : - QFile::remove( asf ); + TQFile::remove( asf ); break; default: // Cancel d->m_bLoading = false; @@ -1393,7 +1393,7 @@ bool KoDocument::openURL( const KURL & _url ) //if ( d->m_shells.isEmpty() ) // kdWarning(30003) << "KoDocument::openURL no shell yet !" << endl; // Add to recent actions list in our shells - QPtrListIterator it( d->m_shells ); + TQPtrListIterator it( d->m_shells ); for (; it.current(); ++it ) it.current()->addRecentURL( _url ); } @@ -1403,33 +1403,33 @@ bool KoDocument::openURL( const KURL & _url ) bool KoDocument::openFile() { //kdDebug(30003) << "KoDocument::openFile for " << m_file << endl; - if ( !QFile::exists(m_file) ) + if ( !TQFile::exists(m_file) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( d->m_autoErrorHandlingEnabled ) // Maybe offer to create a new document with that name ? - KMessageBox::error(0L, i18n("The file %1 does not exist.").arg(m_file) ); + KMessageBox::error(0L, i18n("The file %1 does not exist.").tqarg(m_file) ); d->m_bLoading = false; return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); d->m_specialOutputFlag = 0; - QCString _native_format = nativeFormatMimeType(); + TQCString _native_format = nativeFormatMimeType(); KURL u; u.setPath( m_file ); - QString typeName = KMimeType::findByURL( u, 0, true )->name(); + TQString typeName = KMimeType::findByURL( u, 0, true )->name(); // Allow to open backup files, don't keep the mimetype application/x-trash. if ( typeName == "application/x-trash" ) { - QString path = u.path(); - QStringList patterns = KMimeType::mimeType( typeName )->patterns(); + TQString path = u.path(); + TQStringList patterns = KMimeType::mimeType( typeName )->patterns(); // Find the extension that makes it a backup file, and remove it - for( QStringList::Iterator it = patterns.begin(); it != patterns.end(); ++it ) { - QString ext = *it; + for( TQStringList::Iterator it = patterns.begin(); it != patterns.end(); ++it ) { + TQString ext = *it; if ( !ext.isEmpty() && ext[0] == '*' ) { ext.remove(0, 1); @@ -1451,18 +1451,18 @@ bool KoDocument::openFile() } kdDebug(30003) << "KoDocument::openFile " << m_file << " type:" << typeName << endl; - QString importedFile = m_file; + TQString importedFile = m_file; if ( !isNativeFormat( typeName.latin1() ) ) { if ( !d->filterManager ) d->filterManager = new KoFilterManager( this ); - KoFilter::ConversionStatus status; + KoFilter::ConversiontqStatus status; importedFile = d->filterManager->import( m_file, status ); if ( status != KoFilter::OK ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QString msg; + TQString msg; switch( status ) { case KoFilter::OK: break; @@ -1514,9 +1514,9 @@ bool KoDocument::openFile() if( d->m_autoErrorHandlingEnabled && !msg.isEmpty()) { - QString errorMsg( i18n( "Could not open\n%2.\nReason: %1" ) ); - QString docUrl = url().prettyURL( 0, KURL::StripFileProtocol ); - KMessageBox::error( 0L, errorMsg.arg(msg).arg(docUrl) ); + TQString errorMsg( i18n( "Could not open\n%2.\nReason: %1" ) ); + TQString docUrl = url().prettyURL( 0, KURL::StripFileProtocol ); + KMessageBox::error( 0L, errorMsg.tqarg(msg).tqarg(docUrl) ); } d->m_bLoading = false; @@ -1526,7 +1526,7 @@ bool KoDocument::openFile() << "', status: " << static_cast( status ) << endl; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); bool ok = true; @@ -1563,7 +1563,7 @@ bool KoDocument::openFile() // remove temp file - uncomment this to debug import filters if(!importedFile.isEmpty()) { - QFile::remove( importedFile ); + TQFile::remove( importedFile ); } } @@ -1604,7 +1604,7 @@ bool KoDocument::openFile() } // shared between openFile and koMainWindow's "create new empty document" code -void KoDocument::setMimeTypeAfterLoading( const QString& mimeType ) +void KoDocument::setMimeTypeAfterLoading( const TQString& mimeType ) { d->mimeType = mimeType.latin1(); @@ -1616,18 +1616,18 @@ void KoDocument::setMimeTypeAfterLoading( const QString& mimeType ) } // The caller must call store->close() if loadAndParse returns true. -bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDocument& doc) +bool KoDocument::oldLoadAndParse(KoStore* store, const TQString& filename, TQDomDocument& doc) { //kdDebug(30003) << "oldLoadAndParse: Trying to open " << filename << endl; if (!store->open(filename)) { kdWarning(30003) << "Entry " << filename << " not found!" << endl; - d->lastErrorMessage = i18n( "Could not find %1" ).arg( filename ); + d->lastErrorMessage = i18n( "Could not tqfind %1" ).tqarg( filename ); return false; } - // Error variables for QDomDocument::setContent - QString errorMsg; + // Error variables for TQDomDocument::setContent + TQString errorMsg; int errorLine, errorColumn; bool ok = doc.setContent( store->device(), &errorMsg, &errorLine, &errorColumn ); if ( !ok ) @@ -1636,8 +1636,8 @@ bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDo << " In line: " << errorLine << ", column: " << errorColumn << endl << " Error message: " << errorMsg << endl; d->lastErrorMessage = i18n( "Parsing error in %1 at line %2, column %3\nError message: %4" ) - .arg( filename ).arg( errorLine ).arg( errorColumn ) - .arg( i18n ( "QXml", errorMsg.utf8() ) ); + .tqarg( filename ).tqarg( errorLine ).tqarg( errorColumn ) + .tqarg( i18n ( "TQXml", errorMsg.utf8() ) ); store->close(); return false; } @@ -1645,32 +1645,32 @@ bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDo return true; } -bool KoDocument::loadNativeFormat( const QString & file ) +bool KoDocument::loadNativeFormat( const TQString & file ) { - QFileInfo fileInfo( file ); + TQFileInfo fileInfo( file ); if ( !fileInfo.exists() ) // check duplicated from openURL, but this is useful for templates { - d->lastErrorMessage = i18n("The file %1 does not exist.").arg(file); + d->lastErrorMessage = i18n("The file %1 does not exist.").tqarg(file); return false; } if ( !fileInfo.isFile() ) { - d->lastErrorMessage = i18n( "%1 is not a file." ).arg(file); + d->lastErrorMessage = i18n( "%1 is not a file." ).tqarg(file); return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); kdDebug(30003) << "KoDocument::loadNativeFormat( " << file << " )" << endl; - QFile in; + TQFile in; bool isRawXML = false; if ( d->m_specialOutputFlag != SaveAsDirectoryStore ) // Don't try to open a directory ;) { in.setName(file); if ( !in.open( IO_ReadOnly ) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); d->lastErrorMessage = i18n( "Could not open the file for reading (check read permissions)." ); return false; } @@ -1679,7 +1679,7 @@ bool KoDocument::loadNativeFormat( const QString & file ) char buf[5]; if ( in.readBlock( buf, 4 ) < 4 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; @@ -1693,16 +1693,16 @@ bool KoDocument::loadNativeFormat( const QString & file ) do { if ( in.readBlock( buf , 1 ) < 1 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; } - } while ( QChar( buf[0] ).isSpace() ); + } while ( TQChar( buf[0] ).isSpace() ); if ( buf[0] == '<' ) { // First not-space character if ( in.readBlock( buf , 4 ) < 4 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; @@ -1716,28 +1716,28 @@ bool KoDocument::loadNativeFormat( const QString & file ) if ( isRawXML ) { in.at(0); - QString errorMsg; + TQString errorMsg; int errorLine; int errorColumn; - QDomDocument doc; + TQDomDocument doc; bool res; if ( doc.setContent( &in, true, &errorMsg, &errorLine, &errorColumn ) ) { - res = loadXML( &in, doc ); + res = loadXML( TQT_TQIODEVICE(&in), doc ); if ( res ) res = completeLoading( 0L ); } else { - kdError (30003) << "Parsing Error! Aborting! (in KoDocument::loadNativeFormat (QFile))" << endl + kdError (30003) << "Parsing Error! Aborting! (in KoDocument::loadNativeFormat (TQFile))" << endl << " Line: " << errorLine << " Column: " << errorColumn << endl << " Message: " << errorMsg << endl; d->lastErrorMessage = i18n( "parsing error in the main document at line %1, column %2\nError message: %3" ) - .arg( errorLine ).arg( errorColumn ).arg( i18n ( errorMsg.utf8() ) ); + .tqarg( errorLine ).tqarg( errorColumn ).tqarg( i18n ( errorMsg.utf8() ) ); res=false; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); m_bEmpty = false; return res; @@ -1749,16 +1749,16 @@ bool KoDocument::loadNativeFormat( const QString & file ) } } -bool KoDocument::loadNativeFormatFromStore( const QString& file ) +bool KoDocument::loadNativeFormatFromStore( const TQString& file ) { KoStore::Backend backend = (d->m_specialOutputFlag == SaveAsDirectoryStore) ? KoStore::Directory : KoStore::Auto; KoStore * store = KoStore::createStore( file, KoStore::Read, "", backend ); if ( store->bad() ) { - d->lastErrorMessage = i18n( "Not a valid KOffice file: %1" ).arg( file ); + d->lastErrorMessage = i18n( "Not a valid KOffice file: %1" ).tqarg( file ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } @@ -1773,7 +1773,7 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) if ( !loadOasisFromStore( store ) ) { delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } @@ -1781,21 +1781,21 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) { oasis = false; - QDomDocument doc; + TQDomDocument doc; bool ok = oldLoadAndParse( store, "root", doc ); if ( ok ) ok = loadXML( store->device(), doc ); if ( !ok ) { delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } store->close(); if ( !loadChildren( store ) ) { - kdError(30003) << "ERROR: Could not load children" << endl; + kdError(30003) << "ERROR: Could not load tqchildren" << endl; // Don't abort, proceed nonetheless } @@ -1804,12 +1804,12 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) kdError(30003) << "ERROR: No maindoc.xml" << endl; d->lastErrorMessage = i18n( "Invalid document: no file 'maindoc.xml'." ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } if ( oasis && store->hasFile( "meta.xml" ) ) { - QDomDocument metaDoc; + TQDomDocument metaDoc; KoOasisStore oasisStore( store ); if ( oasisStore.loadAndParse( "meta.xml", metaDoc, d->lastErrorMessage ) ) { d->m_docInfo->loadOasis( metaDoc ); @@ -1817,7 +1817,7 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) } else if ( !oasis && store->hasFile( "documentinfo.xml" ) ) { - QDomDocument doc; + TQDomDocument doc; if ( oldLoadAndParse( store, "documentinfo.xml", doc ) ) { store->close(); d->m_docInfo->load( doc ); @@ -1832,17 +1832,17 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) bool res = completeLoading( store ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); m_bEmpty = false; return res; } // For embedded documents -bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) +bool KoDocument::loadFromStore( KoStore* _store, const TQString& url ) { if ( _store->open( url ) ) { - QDomDocument doc; + TQDomDocument doc; doc.setContent( _store->device() ); if ( !loadXML( _store->device(), doc ) ) { @@ -1865,7 +1865,7 @@ bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) if ( !loadChildren( _store ) ) { - kdError(30003) << "ERROR: Could not load children" << endl; + kdError(30003) << "ERROR: Could not load tqchildren" << endl; #if 0 return false; #endif @@ -1882,14 +1882,14 @@ bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) bool KoDocument::loadOasisFromStore( KoStore* store ) { KoOasisStyles oasisStyles; - QDomDocument contentDoc; - QDomDocument settingsDoc; + TQDomDocument contentDoc; + TQDomDocument settingsDoc; KoOasisStore oasisStore( store ); bool ok = oasisStore.loadAndParse( "content.xml", contentDoc, d->lastErrorMessage ); if ( !ok ) return false; - QDomDocument stylesDoc; + TQDomDocument stylesDoc; (void)oasisStore.loadAndParse( "styles.xml", stylesDoc, d->lastErrorMessage ); // Load styles from style.xml oasisStyles.createStyleMap( stylesDoc, true ); @@ -1898,7 +1898,7 @@ bool KoDocument::loadOasisFromStore( KoStore* store ) // TODO post 1.4, pass manifestDoc to the apps so that they don't have to do it themselves // (when calling KoDocumentChild::loadOasisDocument) - //QDomDocument manifestDoc; + //TQDomDocument manifestDoc; //KoOasisStore oasisStore( store ); //if ( !oasisStore.loadAndParse( "tar:/META-INF/manifest.xml", manifestDoc, d->lastErrorMessage ) ) // return false; @@ -1967,7 +1967,7 @@ void KoDocument::setModified( bool mod ) m_bEmpty = FALSE; } else { // When saving this document, all non-external child documents get saved too. - QPtrListIterator it = children(); + TQPtrListIterator it = tqchildren(); for (; it.current(); ++it ) { KoDocument *doc = it.current()->document(); @@ -1990,7 +1990,7 @@ int KoDocument::queryCloseDia() { //kdDebug(30003)<title(); @@ -2002,7 +2002,7 @@ int KoDocument::queryCloseDia() name = i18n( "Untitled" ); int res = KMessageBox::warningYesNoCancel( 0L, - i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).arg(name)); + i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).tqarg(name)); switch(res) { @@ -2023,9 +2023,9 @@ int KoDocument::queryCloseDia() int KoDocument::queryCloseExternalChildren() { - //kdDebug(30003)< it( children() ); + TQPtrListIterator it( tqchildren() ); for (; it.current(); ++it ) { if ( !it.current()->isDeleted() ) @@ -2053,17 +2053,17 @@ int KoDocument::queryCloseExternalChildren() return KMessageBox::Ok; } -void KoDocument::setTitleModified( const QString caption, bool mod ) +void KoDocument::setTitleModified( const TQString caption, bool mod ) { //kdDebug(30003)<( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { doc->setTitleModified( caption, mod ); return; } // we must be root doc so update caption in all related windows - QPtrListIterator it( d->m_shells ); + TQPtrListIterator it( d->m_shells ); for (; it.current(); ++it ) { it.current()->updateCaption(); @@ -2075,14 +2075,14 @@ void KoDocument::setTitleModified( const QString caption, bool mod ) void KoDocument::setTitleModified() { //kdDebug(30003)<m_current<( parent() ); - QString caption; + KoDocument *doc = dynamic_cast( tqparent() ); + TQString caption; if ( (url().isEmpty() || isStoredExtern()) && d->m_current ) { // Get caption from document info (title(), in about page) if ( documentInfo() ) { - KoDocumentInfoPage * page = documentInfo()->page( QString::fromLatin1("about") ); + KoDocumentInfoPage * page = documentInfo()->page( TQString::tqfromLatin1("about") ); if (page) caption = static_cast(page)->title(); } @@ -2124,27 +2124,27 @@ bool KoDocument::completeSaving( KoStore* ) return true; } -QDomDocument KoDocument::createDomDocument( const QString& tagName, const QString& version ) const +TQDomDocument KoDocument::createDomDocument( const TQString& tagName, const TQString& version ) const { return createDomDocument( instance()->instanceName(), tagName, version ); } //static -QDomDocument KoDocument::createDomDocument( const QString& appName, const QString& tagName, const QString& version ) +TQDomDocument KoDocument::createDomDocument( const TQString& appName, const TQString& tagName, const TQString& version ) { - QDomImplementation impl; - QString url = QString("http://www.koffice.org/DTD/%1-%1.dtd").arg(appName).arg(version); - QDomDocumentType dtype = impl.createDocumentType( tagName, - QString("-//KDE//DTD %1 %1//EN").arg(appName).arg(version), + TQDomImplementation impl; + TQString url = TQString("http://www.koffice.org/DTD/%1-%1.dtd").tqarg(appName).tqarg(version); + TQDomDocumentType dtype = impl.createDocumentType( tagName, + TQString("-//KDE//DTD %1 %1//EN").tqarg(appName).tqarg(version), url ); // The namespace URN doesn't need to include the version number. - QString namespaceURN = QString("http://www.koffice.org/DTD/%1").arg(appName); - QDomDocument doc = impl.createDocument( namespaceURN, tagName, dtype ); + TQString namespaceURN = TQString("http://www.koffice.org/DTD/%1").tqarg(appName); + TQDomDocument doc = impl.createDocument( namespaceURN, tagName, dtype ); doc.insertBefore( doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ), doc.documentElement() ); return doc; } -KoXmlWriter* KoDocument::createOasisXmlWriter( QIODevice* dev, const char* rootElementName ) +KoXmlWriter* KoDocument::createOasisXmlWriter( TQIODevice* dev, const char* rootElementName ) { KoXmlWriter* writer = new KoXmlWriter( dev ); writer->startDocument( rootElementName ); @@ -2176,11 +2176,11 @@ KoXmlWriter* KoDocument::createOasisXmlWriter( QIODevice* dev, const char* rootE return writer; } -QDomDocument KoDocument::saveXML() +TQDomDocument KoDocument::saveXML() { kdError(30003) << "KoDocument::saveXML not implemented" << endl; d->lastErrorMessage = i18n( "Internal error: saveXML not implemented" ); - return QDomDocument(); + return TQDomDocument(); } KService::Ptr KoDocument::nativeService() @@ -2191,15 +2191,15 @@ KService::Ptr KoDocument::nativeService() return m_nativeService; } -QCString KoDocument::nativeFormatMimeType() const +TQCString KoDocument::nativeFormatMimeType() const { KService::Ptr service = const_cast(this)->nativeService(); if ( !service ) - return QCString(); - QCString nativeMimeType = service->property( "X-KDE-NativeMimeType" ).toString().latin1(); + return TQCString(); + TQCString nativeMimeType = service->property( "X-KDE-NativeMimeType" ).toString().latin1(); if ( nativeMimeType.isEmpty() ) { // shouldn't happen, let's find out why it happened - if ( !service->serviceTypes().contains( "KOfficePart" ) ) + if ( !service->serviceTypes().tqcontains( "KOfficePart" ) ) kdWarning(30003) << "Wrong desktop file, KOfficePart isn't mentionned" << endl; else if ( !KServiceType::serviceType( "KOfficePart" ) ) kdWarning(30003) << "The KOfficePart service type isn't installed!" << endl; @@ -2207,11 +2207,11 @@ QCString KoDocument::nativeFormatMimeType() const return nativeMimeType; } -QCString KoDocument::nativeOasisMimeType() const +TQCString KoDocument::nativeOasisMimeType() const { KService::Ptr service = const_cast(this)->nativeService(); if ( !service ) - return QCString(); + return TQCString(); return service->property( "X-KDE-NativeOasisMimeType" ).toString().latin1(); } @@ -2219,10 +2219,10 @@ QCString KoDocument::nativeOasisMimeType() const //static KService::Ptr KoDocument::readNativeService( KInstance *instance ) { - QString instname = instance ? instance->instanceName() : kapp->instanceName(); + TQString instname = instance ? instance->instanceName() : kapp->instanceName(); // The new way is: we look for a foopart.desktop in the kde_services dir. - QString servicepartname = instname + "part.desktop"; + TQString servicepartname = instname + "part.desktop"; KService::Ptr service = KService::serviceByDesktopPath( servicepartname ); if ( service ) kdDebug(30003) << servicepartname << " found." << endl; @@ -2233,7 +2233,7 @@ KService::Ptr KoDocument::readNativeService( KInstance *instance ) // Try by path first, so that we find the global one (which has the native mimetype) // even if the user created a kword.desktop in ~/.kde/share/applnk or any subdir of it. // If he created it under ~/.kde/share/applnk/Office/ then no problem anyway. - service = KService::serviceByDesktopPath( QString::fromLatin1("Office/%1.desktop").arg(instname) ); + service = KService::serviceByDesktopPath( TQString::tqfromLatin1("Office/%1.desktop").tqarg(instname) ); } if ( !service ) service = KService::serviceByDesktopName( instname ); @@ -2241,11 +2241,11 @@ KService::Ptr KoDocument::readNativeService( KInstance *instance ) return service; } -QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static +TQCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static { KService::Ptr service = readNativeService( instance ); if ( !service ) - return QCString(); + return TQCString(); if ( service->property( "X-KDE-NativeMimeType" ).toString().isEmpty() ) { @@ -2253,7 +2253,7 @@ QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static if ( KServiceType::serviceType( "KOfficePart" ) == 0L ) kdError(30003) << "The serviceType KOfficePart is missing. Check that you have a kofficepart.desktop file in the share/servicetypes directory." << endl; else { - QString instname = instance ? instance->instanceName() : kapp->instanceName(); + TQString instname = instance ? instance->instanceName() : kapp->instanceName(); if ( instname != "koshell" ) // hack for koshell kdWarning(30003) << service->desktopEntryPath() << ": no X-KDE-NativeMimeType entry!" << endl; } @@ -2262,15 +2262,15 @@ QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static return service->property( "X-KDE-NativeMimeType" ).toString().latin1(); } -QStringList KoDocument::readExtraNativeMimeTypes( KInstance *instance ) //static +TQStringList KoDocument::readExtraNativeMimeTypes( KInstance *instance ) //static { KService::Ptr service = readNativeService( instance ); if ( !service ) - return QStringList(); + return TQStringList(); return service->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); } -void KoDocument::setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcessing ) +void KoDocument::setupXmlReader( TQXmlSimpleReader& reader, bool namespaceProcessing ) { if ( namespaceProcessing ) { @@ -2286,16 +2286,16 @@ void KoDocument::setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcess } -bool KoDocument::isNativeFormat( const QCString& mimetype ) const +bool KoDocument::isNativeFormat( const TQCString& mimetype ) const { if ( mimetype == nativeFormatMimeType() ) return true; - return extraNativeMimeTypes().contains( mimetype ); + return extraNativeMimeTypes().tqcontains( mimetype ); } -QStringList KoDocument::extraNativeMimeTypes() const +TQStringList KoDocument::extraNativeMimeTypes() const { - QStringList lst; + TQStringList lst; // This implementation is temporary while we treat both koffice-1.3 and OASIS formats as native. // But it's good to have this virtual method, in case some app want to // support more than one native format. @@ -2315,7 +2315,7 @@ int KoDocument::supportedSpecialFormats() const void KoDocument::addShell( KoMainWindow *shell ) { - if ( d->m_shells.findRef( shell ) == -1 ) + if ( d->m_shells.tqfindRef( shell ) == -1 ) { //kdDebug(30003) << "addShell: shell " << (void*)shell << " added to doc " << this << endl; d->m_shells.append( shell ); @@ -2328,7 +2328,7 @@ void KoDocument::removeShell( KoMainWindow *shell ) d->m_shells.removeRef( shell ); } -const QPtrList& KoDocument::shells() const +const TQPtrList& KoDocument::shells() const { return d->m_shells; } @@ -2345,17 +2345,17 @@ DCOPObject * KoDocument::dcopObject() return d->m_dcopObject; } -QCString KoDocument::dcopObjectId() const +TQCString KoDocument::dcopObjectId() const { return const_cast(this)->dcopObject()->objId(); } -void KoDocument::setErrorMessage( const QString& errMsg ) +void KoDocument::setErrorMessage( const TQString& errMsg ) { d->lastErrorMessage = errMsg; } -QString KoDocument::errorMessage() const +TQString KoDocument::errorMessage() const { return d->lastErrorMessage; } @@ -2364,11 +2364,11 @@ void KoDocument::showSavingErrorDialog() { if ( d->lastErrorMessage.isEmpty() ) { - KMessageBox::error( 0L, i18n( "Could not save\n%1" ).arg( m_file ) ); + KMessageBox::error( 0L, i18n( "Could not save\n%1" ).tqarg( m_file ) ); } else if ( d->lastErrorMessage != "USER_CANCELED" ) { - KMessageBox::error( 0L, i18n( "Could not save %1\nReason: %2" ).arg( m_file, d->lastErrorMessage ) ); + KMessageBox::error( 0L, i18n( "Could not save %1\nReason: %2" ).tqarg( m_file, d->lastErrorMessage ) ); } } @@ -2376,11 +2376,11 @@ void KoDocument::showLoadingErrorDialog() { if ( d->lastErrorMessage.isEmpty() ) { - KMessageBox::error( 0L, i18n( "Could not open\n%1" ).arg( url().prettyURL( 0, KURL::StripFileProtocol ) ) ); + KMessageBox::error( 0L, i18n( "Could not open\n%1" ).tqarg( url().prettyURL( 0, KURL::StripFileProtocol ) ) ); } else if ( d->lastErrorMessage != "USER_CANCELED" ) { - KMessageBox::error( 0L, i18n( "Could not open %1\nReason: %2" ).arg( url().prettyURL( 0, KURL::StripFileProtocol ), d->lastErrorMessage ) ); + KMessageBox::error( 0L, i18n( "Could not open %1\nReason: %2" ).tqarg( url().prettyURL( 0, KURL::StripFileProtocol ), d->lastErrorMessage ) ); } } @@ -2397,12 +2397,12 @@ bool KoDocument::isLoading() const void KoDocument::removeAutoSaveFiles() { // Eliminate any auto-save file - QString asf = autoSaveFile( m_file ); // the one in the current dir - if ( QFile::exists( asf ) ) - QFile::remove( asf ); - asf = autoSaveFile( QString::null ); // and the one in $HOME - if ( QFile::exists( asf ) ) - QFile::remove( asf ); + TQString asf = autoSaveFile( m_file ); // the one in the current dir + if ( TQFile::exists( asf ) ) + TQFile::remove( asf ); + asf = autoSaveFile( TQString() ); // and the one in $HOME + if ( TQFile::exists( asf ) ) + TQFile::remove( asf ); } void KoDocument::setBackupFile( bool _b ) @@ -2416,12 +2416,12 @@ bool KoDocument::backupFile()const } -void KoDocument::setBackupPath( const QString & _path) +void KoDocument::setBackupPath( const TQString & _path) { d->m_backupPath = _path; } -QString KoDocument::backupPath()const +TQString KoDocument::backupPath()const { return d->m_backupPath; } @@ -2429,7 +2429,7 @@ QString KoDocument::backupPath()const void KoDocument::setCurrent( bool on ) { //kdDebug(30003)<( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { if ( !isStoredExtern() ) @@ -2442,7 +2442,7 @@ void KoDocument::setCurrent( bool on ) d->m_current = on; if ( !on ) { - doc->setCurrent( true ); // let my next external parent take over + doc->setCurrent( true ); // let my next external tqparent take over return; } doc->forceCurrent( false ); // everybody else should keep off @@ -2457,7 +2457,7 @@ void KoDocument::forceCurrent( bool on ) { //kdDebug(30003)<m_current = on; - KoDocument *doc = dynamic_cast( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { doc->forceCurrent( false ); @@ -2505,7 +2505,7 @@ static const struct { }; static const unsigned int numTN2DT = sizeof( TN2DTArray ) / sizeof( *TN2DTArray ); -QString KoDocument::tagNameToDocumentType( const QString& localName ) +TQString KoDocument::tagNameToDocumentType( const TQString& localName ) { for ( unsigned int i = 0 ; i < numTN2DT ; ++i ) if ( localName == TN2DTArray[i].localName ) @@ -2513,9 +2513,9 @@ QString KoDocument::tagNameToDocumentType( const QString& localName ) return localName; } -QValueList KoDocument::allTextDocuments() const +TQValueList KoDocument::allTextDocuments() const { - return QValueList(); + return TQValueList(); } KoPageLayout KoDocument::pageLayout(int /*pageNumber*/) const @@ -2537,16 +2537,16 @@ void KoDocument::setUnit( KoUnit::Unit unit ) } } -QString KoDocument::unitName() const +TQString KoDocument::unitName() const { return KoUnit::unitName( unit() ); } -void KoDocument::showStartUpWidget( KoMainWindow* parent, bool alwaysShow ) +void KoDocument::showStartUpWidget( KoMainWindow* tqparent, bool alwaysShow ) { if(!alwaysShow) { KConfigGroup cfgGrp( instance()->config(), "TemplateChooserDialog" ); - QString fullTemplateName = cfgGrp.readPathEntry( "AlwaysUseTemplate" ); + TQString fullTemplateName = cfgGrp.readPathEntry( "AlwaysUseTemplate" ); if( !fullTemplateName.isEmpty() ) { openTemplate( fullTemplateName ); @@ -2558,24 +2558,24 @@ void KoDocument::showStartUpWidget( KoMainWindow* parent, bool alwaysShow ) if(d->m_startUpWidget){ d->m_startUpWidget->show(); } else { - d->m_startUpWidget = createOpenPane( parent->centralWidget(), instance(), templateType() ); + d->m_startUpWidget = createOpenPane( tqparent->centralWidget(), instance(), templateType() ); } - parent->setDocToOpen( this ); - parent->factory()->container("mainToolBar", parent)->hide(); + tqparent->setDocToOpen( this ); + tqparent->factory()->container("mainToolBar", tqparent)->hide(); } -void KoDocument::openExistingFile( const QString& file ) +void KoDocument::openExistingFile( const TQString& file ) { KURL url( file ); bool ok = openURL( url ); setModified( false ); if( ok ) - QTimer::singleShot( 0, this, SLOT( deleteOpenPane() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteOpenPane() ) ); } -void KoDocument::openTemplate( const QString& file ) +void KoDocument::openTemplate( const TQString& file ) { bool ok = loadNativeFormat( file ); setModified( false ); @@ -2600,31 +2600,31 @@ void KoDocument::startCustomDocument() { deleteOpenPane(); } -KoOpenPane* KoDocument::createOpenPane( QWidget* parent, KInstance* instance, - const QString& templateType ) +KoOpenPane* KoDocument::createOpenPane( TQWidget* tqparent, KInstance* instance, + const TQString& templateType ) { - KoOpenPane* openPane = new KoOpenPane( parent, instance, templateType ); - QWidget *customDoc = createCustomDocumentWidget(openPane); + KoOpenPane* openPane = new KoOpenPane( tqparent, instance, templateType ); + TQWidget *customDoc = createCustomDocumentWidget(openPane); if(customDoc) { openPane->setCustomDocumentWidget( customDoc ); - connect( customDoc, SIGNAL( documentSelected() ), this, SLOT( startCustomDocument() ) ); + connect( customDoc, TQT_SIGNAL( documentSelected() ), this, TQT_SLOT( startCustomDocument() ) ); } openPane->show(); - connect( openPane, SIGNAL( openExistingFile( const QString& ) ), - this, SLOT( openExistingFile( const QString& ) ) ); - connect( openPane, SIGNAL( openTemplate( const QString& ) ), - this, SLOT( openTemplate( const QString& ) ) ); + connect( openPane, TQT_SIGNAL( openExistingFile( const TQString& ) ), + this, TQT_SLOT( openExistingFile( const TQString& ) ) ); + connect( openPane, TQT_SIGNAL( openTemplate( const TQString& ) ), + this, TQT_SLOT( openTemplate( const TQString& ) ) ); return openPane; } -void KoDocument::setTemplateType( const QString& _templateType ) +void KoDocument::setTemplateType( const TQString& _templateType ) { d->m_templateType = _templateType; } -QString KoDocument::templateType() const +TQString KoDocument::templateType() const { return d->m_templateType; } @@ -2633,7 +2633,7 @@ void KoDocument::deleteOpenPane() { if( d->m_startUpWidget ) { d->m_startUpWidget->hide(); - QTimer::singleShot(1000, this, SLOT(deleteOpenPaneDelayed())); + TQTimer::singleShot(1000, this, TQT_SLOT(deleteOpenPaneDelayed())); shells().getFirst()->factory()->container("mainToolBar", shells().getFirst())->show(); shells().getFirst()->setRootDocument( this ); @@ -2648,20 +2648,20 @@ void KoDocument::deleteOpenPaneDelayed() d->m_startUpWidget = 0; } -QWidget* KoDocument::createCustomDocumentWidget(QWidget */*parent*/) { +TQWidget* KoDocument::createCustomDocumentWidget(TQWidget */*tqparent*/) { return 0; } -bool KoDocument::showEmbedInitDialog(QWidget* parent) +bool KoDocument::showEmbedInitDialog(TQWidget* tqparent) { - KDialogBase dlg(parent, "EmbedInitDialog", true, i18n("Embedding Object"), 0, KDialogBase::NoDefault); + KDialogBase dlg(tqparent, "EmbedInitDialog", true, i18n("Embedding Object"), 0, KDialogBase::NoDefault); KoOpenPane* pane = createOpenPane(&dlg, instance(), templateType()); - pane->layout()->setMargin(0); + pane->tqlayout()->setMargin(0); dlg.setMainWidget(pane); dlg.setInitialSize(dlg.configDialogSize("EmbedInitDialog")); - connect(this, SIGNAL(closeEmbedInitDialog()), &dlg, SLOT(slotOk())); + connect(this, TQT_SIGNAL(closeEmbedInitDialog()), &dlg, TQT_SLOT(slotOk())); - bool ok = dlg.exec() == QDialog::Accepted; + bool ok = dlg.exec() == TQDialog::Accepted; dlg.saveDialogSize("EmbedInitDialog"); diff --git a/lib/kofficecore/KoDocument.h b/lib/kofficecore/KoDocument.h index 1e8f1f83..0499ab6c 100644 --- a/lib/kofficecore/KoDocument.h +++ b/lib/kofficecore/KoDocument.h @@ -25,7 +25,7 @@ class KoTextDocument; namespace std { } using namespace std; -#include +#include #include #include @@ -35,9 +35,9 @@ using namespace std; #include #include -class QDomElement; -class QDomDocument; -class QXmlSimpleReader; +class TQDomElement; +class TQDomDocument; +class TQXmlSimpleReader; class KoStore; class KoMainWindow; @@ -61,8 +61,9 @@ class KoOpenPane; class KOFFICECORE_EXPORT KoDocument : public KParts::ReadWritePart { Q_OBJECT - Q_PROPERTY( QCString dcopObjectId READ dcopObjectId) - Q_PROPERTY( bool backupFile READ backupFile WRITE setBackupFile ) + TQ_OBJECT + TQ_PROPERTY( TQCString dcopObjectId READ dcopObjectId) + TQ_PROPERTY( bool backupFile READ backupFile WRITE setBackupFile ) public: @@ -70,24 +71,24 @@ public: * Constructor. * The first 4 arguments are the same as the ones passed to KParts::Factory::createPart. * - * @param parentWidget the parent widget, in case we create a wrapper widget + * @param tqparentWidget the tqparent widget, in case we create a wrapper widget * (in single view mode). * Usually the first argument passed by KParts::Factory::createPart. * @param widgetName name of the widget. - * @param parent may be another KoDocument, or anything else. + * @param tqparent may be another KoDocument, or anything else. * Usually the third argument of KParts::Factory::createPart. * @param name is used to identify this document via DCOP so you may want to * pass a meaningful name here which matches the pattern [A-Za-z_][A-Za-z_0-9]*. * @param singleViewMode determines whether the document may only have one view. In this case - * the @p parent must be a QWidget derived class. KoDocument will then create a wrapper widget - * (KoViewWrapperWidget) which is a child of @p parentWidget. + * the @p tqparent must be a TQWidget derived class. KoDocument will then create a wrapper widget + * (KoViewWrapperWidget) which is a child of @p tqparentWidget. * This widget can be retrieved by calling widget(). * * @todo explain what the purpose of widgetName is. */ - KoDocument( QWidget* parentWidget, + KoDocument( TQWidget* tqparentWidget, const char* widgetName, - QObject* parent, + TQObject* tqparent, const char* name, bool singleViewMode = false ); @@ -125,13 +126,13 @@ public: * @see KXMLGUIClient::actionCollection * @see KoView::action */ - virtual KAction *action( const QDomElement &element ) const; + virtual KAction *action( const TQDomElement &element ) const; /** * Returns the DOM document which describes the GUI of the * first view. */ - virtual QDomDocument domDocument() const; + virtual TQDomDocument domDocument() const; /** * @internal @@ -187,7 +188,7 @@ public: * @see KService * @see KDesktopFile */ - static QCString readNativeFormatMimeType( KInstance *instance = 0 ); + static TQCString readNativeFormatMimeType( KInstance *instance = 0 ); /** * Used by KoMainWindow, when no document exists yet. @@ -199,7 +200,7 @@ public: * @see KService * @see KDesktopFile */ - static QStringList readExtraNativeMimeTypes( KInstance *instance = 0 ); + static TQStringList readExtraNativeMimeTypes( KInstance *instance = 0 ); /** * With the help of @p instance or KApplication::instance() this @@ -211,7 +212,7 @@ public: /** * setup the XML reader, so that we don't have to duplicate the code. */ - static void setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcessing = false ); + static void setupXmlReader( TQXmlSimpleReader& reader, bool namespaceProcessing = false ); /** * To be preferred when a document exists. It is fast when calling @@ -220,20 +221,20 @@ public: * This comes from the X-KDE-NativeMimeType key in the .desktop file * You do NOT have to reimplement this (it is only virtual for kounavail). */ - virtual QCString nativeFormatMimeType() const; + virtual TQCString nativeFormatMimeType() const; /** * Returns the OASIS OpenDocument mimetype of the document, if supported * This comes from the X-KDE-NativeOasisMimeType key in the .desktop file */ - QCString nativeOasisMimeType() const; + TQCString nativeOasisMimeType() const; /// Checks whether a given mimetype can be handled natively. - bool isNativeFormat( const QCString& mimetype ) const; + bool isNativeFormat( const TQCString& mimetype ) const; /// Returns a list of the mimetypes considered "native", i.e. which can /// be saved by KoDocument without a filter, in *addition* to the main one - virtual QStringList extraNativeMimeTypes() const; + virtual TQStringList extraNativeMimeTypes() const; /// Enum values used by specialOutputFlag - note that it's a bitfield for supportedSpecialFormats enum { /*SaveAsKOffice1dot1 = 1,*/ // old and removed @@ -251,7 +252,7 @@ public: /** * Returns the actual mimetype of the document */ - QCString mimeType() const; + TQCString mimeType() const; /** * @brief Sets the mime type for the document. @@ -259,7 +260,7 @@ public: * When choosing "save as" this is also the mime type * selected by default. */ - void setMimeType( const QCString & mimeType ); + void setMimeType( const TQCString & mimeType ); /** * @brief Set the format in which the document should be saved. @@ -270,8 +271,8 @@ public: * @param mimeType the mime type (format) to use. * @param specialOutputFlag is for "save as older version" etc. */ - void setOutputMimeType( const QCString & mimeType, int specialOutputFlag = 0 ); - QCString outputMimeType() const; + void setOutputMimeType( const TQCString & mimeType, int specialOutputFlag = 0 ); + TQCString outputMimeType() const; int specialOutputFlag() const; /** @@ -298,14 +299,14 @@ public: * If you asked the user about something and he chose "Cancel", * set the message to the magic string "USER_CANCELED", to skip the error dialog. */ - void setErrorMessage( const QString& errMsg ); + void setErrorMessage( const TQString& errMsg ); /** * Return the last error message. Usually KoDocument takes care of * showing it; this method is mostly provided for non-interactive use. * @since 1.4 */ - QString errorMessage() const; + TQString errorMessage() const; /** * Show the last error message in a message box. @@ -327,7 +328,7 @@ public: /** * Create a new view for the document. */ - KoView *createView( QWidget *parent = 0, const char *name = 0 ); + KoView *createView( TQWidget *tqparent = 0, const char *name = 0 ); /** * Adds a view to the document. @@ -345,7 +346,7 @@ public: /** * @return a list of views this document is displayed in */ - const QPtrList & views() const; + const TQPtrList & views() const; /** * @return number of views this document is displayed in @@ -355,7 +356,7 @@ public: /** * Reimplemented from KParts::Part */ - virtual KParts::Part *hitTest( QWidget *widget, const QPoint &globalPos ); + virtual KParts::Part *hitTest( TQWidget *widget, const TQPoint &globalPos ); /** * Find the most nested child document which contains the @@ -372,7 +373,7 @@ public: * * @return Pointer to the document under the mouse at that position */ - virtual KoDocument *hitTest( const QPoint &pos, const QWMatrix& matrix = QWMatrix() ); + virtual KoDocument *hitTest( const TQPoint &pos, const TQWMatrix& matrix = TQWMatrix() ); /// Temporary API for accessing the view that calls hitTest. /// Will be passed to hitTest() in 2.x. /// Only call this from within hitTest()! @@ -384,21 +385,21 @@ public: * @param painter The painter object onto which will be drawn. * @param rect The rect that should be used in the painter object. * @param transparent If true then the entire rectangle is erased before painting. - * @param view The KoView is needed to fiddle about with the active widget, when painting children. + * @param view The KoView is needed to fiddle about with the active widget, when painting tqchildren. * @param zoomX The zoom value to be applied to X coordinates when painting. * @param zoomY The zoom value to be applied to Y coordinates when painting. */ - virtual void paintEverything( QPainter &painter, const QRect &rect, bool transparent = false, + virtual void paintEverything( TQPainter &painter, const TQRect &rect, bool transparent = false, KoView *view = 0L, double zoomX = 1.0, double zoomY = 1.0 ); /** * @brief Generates a preview picture of the document * @note The preview is used in the File Dialog and also to create the Thumbnail */ - virtual QPixmap generatePreview( const QSize& size ); + virtual TQPixmap generatePreview( const TQSize& size ); /** - * Paints all of the documents children into the given painter object. + * Paints all of the documents tqchildren into the given painter object. * * @param painter The painter object onto which will be drawn. * @param rect The rect that should be used in the painter object. @@ -408,7 +409,7 @@ public: * * @see #paintChild #paintEverything #paintContent */ - virtual void paintChildren( QPainter &painter, const QRect &rect, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); + virtual void paintChildren( TQPainter &painter, const TQRect &rect, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); /** * Paint a given child. Normally called by paintChildren(). @@ -421,12 +422,12 @@ public: * * @see #paintEverything #paintChildren #paintContent */ - virtual void paintChild( KoDocumentChild *child, QPainter &painter, KoView *view, + virtual void paintChild( KoDocumentChild *child, TQPainter &painter, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); /** * Paints the data itself. Normally called by paintEverything(). It does not - * paint the children. + * paint the tqchildren. * It's this method that %KOffice Parts have to implement. * * @param painter The painter object onto which will be drawn. @@ -437,7 +438,7 @@ public: * * @see #paintEverything */ - virtual void paintContent( QPainter &painter, const QRect &rect, bool transparent = false, + virtual void paintContent( TQPainter &painter, const TQRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 ) = 0; /** @@ -458,17 +459,17 @@ public: * Initializes an empty document (display the template dialog!). * You have to overload this method to initialize all your document variables. * @param flags see InitDocFlags - * @param parentWidget the widget this document belongs with + * @param tqparentWidget the widget this document belongs with */ - virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0) = 0; + virtual bool initDoc(InitDocFlags flags, TQWidget* tqparentWidget=0) = 0; /** * Creates and shows the start up widget. - * @param parent the KoMainWindow used as parent for the widget. + * @param tqparent the KoMainWindow used as tqparent for the widget. * @param alwaysShow always show the widget even if the user has configured it to not show. * @since 1.5 */ - virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false); + virtual void showStartUpWidget(KoMainWindow* tqparent, bool alwaysShow = false); /** * Sets the modified flag on the document. This means that it has @@ -506,7 +507,7 @@ public: * @param store The store to load from * @param url An internal url, like tar:/1/2 */ - virtual bool loadFromStore( KoStore* store, const QString& url ); + virtual bool loadFromStore( KoStore* store, const TQString& url ); /** * @brief Loads an OASIS document from a store. @@ -519,17 +520,17 @@ public: * * You should not have to reimplement this - but call it in saveChildren(). */ - virtual bool saveToStore( KoStore* store, const QString& path ); + virtual bool saveToStore( KoStore* store, const TQString& path ); /** * Reimplement this method to load the contents of your %KOffice document, * from the XML document. This is for the pre-Oasis file format (maindoc.xml). * - * You are supposed to use the QDomDocument. The QIODevice is provided only + * You are supposed to use the TQDomDocument. The TQIODevice is provided only * for the cases where some pre-processing is needed, like kpresenter's kprconverter. - * Note that the QIODevice could be 0L, when called from an import filter. + * Note that the TQIODevice could be 0L, when called from an import filter. */ - virtual bool loadXML( QIODevice *, const QDomDocument & doc ) = 0; + virtual bool loadXML( TQIODevice *, const TQDomDocument & doc ) = 0; /** * Reimplement this method to load the contents of your %KOffice document, @@ -537,8 +538,8 @@ public: * you can find them in the oasisStyles parameter. The store can be used * to load images and embedded documents. */ - virtual bool loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, - const QDomDocument & settings, KoStore* store ) = 0; + virtual bool loadOasis( const TQDomDocument & doc, KoOasisStyles& oasisStyles, + const TQDomDocument & settings, KoStore* store ) = 0; /** * Reimplement this method to save the contents of your %KOffice document, @@ -548,18 +549,18 @@ public: /** * Reimplement this to save the contents of the %KOffice document into - * a QDomDocument. The framework takes care of saving it to the store. + * a TQDomDocument. The framework takes care of saving it to the store. */ - virtual QDomDocument saveXML(); + virtual TQDomDocument saveXML(); /** - * Return a correctly created QDomDocument for this KoDocument, + * Return a correctly created TQDomDocument for this KoDocument, * including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element. * @param tagName the name of the tag for the root element * @param version the DTD version (usually the application's version). * @deprecated use createOasisXmlWriter instead */ - QDomDocument createDomDocument( const QString& tagName, const QString& version ) const; + TQDomDocument createDomDocument( const TQString& tagName, const TQString& version ) const; /** * Return an XML writer for saving Oasis XML into the device @p dev, @@ -578,17 +579,17 @@ public: * will need to call endElement(); endDocument(); before destroying the KoXmlWriter. * @note OASIS-specific */ - static KoXmlWriter* createOasisXmlWriter( QIODevice* dev, const char* rootElementName ); + static KoXmlWriter* createOasisXmlWriter( TQIODevice* dev, const char* rootElementName ); /** - * Return a correctly created QDomDocument for an old (1.3-style) %KOffice document, + * Return a correctly created TQDomDocument for an old (1.3-style) %KOffice document, * including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element. * This static method can be used e.g. by filters. * @param appName the app's instance name, e.g. kword, kspread, kpresenter etc. * @param tagName the name of the tag for the root element, e.g. DOC for kword/kpresenter. * @param version the DTD version (usually the application's version). */ - static QDomDocument createDomDocument( const QString& appName, const QString& tagName, const QString& version ); + static TQDomDocument createDomDocument( const TQString& appName, const TQString& tagName, const TQString& version ); /** * The first thing to do in loadOasis is get hold of the office:body tag, then its child. @@ -596,14 +597,14 @@ public: * This method returns a translated name for the type of document, * e.g. i18n("Word Processing") for office:text. */ - static QString tagNameToDocumentType( const QString& localName ); + static TQString tagNameToDocumentType( const TQString& localName ); /** * Save the document. The default implementation is to call * saveXML(). This method exists only for applications that - * don't use QDomDocument for saving, i.e. kword and kpresenter. + * don't use TQDomDocument for saving, i.e. kword and kpresenter. */ - virtual bool saveToStream( QIODevice * dev ); + virtual bool saveToStream( TQIODevice * dev ); /** * Loads a document in the native format from a given URL. @@ -611,14 +612,14 @@ public: * * @param file the file to load - usually KReadOnlyPart::m_file or the result of a filter */ - virtual bool loadNativeFormat( const QString & file ); + virtual bool loadNativeFormat( const TQString & file ); /** * Saves the document in native format, to a given file * You should never have to reimplement. * Made public for writing templates. */ - virtual bool saveNativeFormat( const QString & file ); + virtual bool saveNativeFormat( const TQString & file ); /** * Activate/deactivate/configure the autosave feature. @@ -658,17 +659,17 @@ public: static int defaultAutoSave() { return s_defaultAutoSave; } /** - * @return the list of all children. Do not modify the + * @return the list of all tqchildren. Do not modify the * returned list. */ - const QPtrList& children() const; + const TQPtrList& tqchildren() const; /** * @return the KoDocumentChild associated with the given Document, but only if * @p doc is a direct child of this document. * * This is a convenience function. You could get the same result - * by traversing the list returned by children(). + * by traversing the list returned by tqchildren(). */ KoDocumentChild *child( KoDocument *doc ); @@ -678,8 +679,8 @@ public: */ KoDocumentInfo *documentInfo() const; - void setViewBuildDocument( KoView *view, const QDomDocument &doc ); - QDomDocument viewBuildDocument( KoView *view ); + void setViewBuildDocument( KoView *view, const TQDomDocument &doc ); + TQDomDocument viewBuildDocument( KoView *view ); /** * Appends the shell to the list of shells which show this @@ -699,7 +700,7 @@ public: /** * @return the list of shells for the main window */ - const QPtrList& shells() const; + const TQPtrList& shells() const; /** * @return the number of shells for the main window @@ -709,7 +710,7 @@ public: /** * @return the list of all the currently opened documents */ - static QPtrList *documentList() { return s_documentList; } + static TQPtrList *documentList() { return s_documentList; } /** * @brief Return a DCOP interface for this document @@ -722,7 +723,7 @@ public: /** * @return the ID of the DCOP interface for this document. **/ - QCString dcopObjectId() const; + TQCString dcopObjectId() const; /** * Signal the progress of operations such as loading or saving. @@ -740,7 +741,7 @@ public: virtual bool isStoredExtern() const; /** - * @return the page layout associated with this document (margins, pageSize, etc). + * @return the page tqlayout associated with this document (margins, pageSize, etc). * Override this if you want to provide different sized pages. * * @see KoPageLayout @@ -770,14 +771,14 @@ public: int queryCloseDia(); /** - * @brief Set when we do not want to save external children when saving our 'main' doc. + * @brief Set when we do not want to save external tqchildren when saving our 'main' doc. * - * This makes it possible to save 'main' doc + all its internal children first, then - * go on to save external children. Typically used by query close. + * This makes it possible to save 'main' doc + all its internal tqchildren first, then + * go on to save external tqchildren. Typically used by query close. * Use: * @code * doc->setDoNotSaveExtDoc(); - * doc->save(); // saves doc and its internal children, + * doc->save(); // saves doc and its internal tqchildren, * //also calls saveExternalChildren() which sets setDoNotSaveExtDoc(false) * doc->saveExternalChildren(); * @endcode @@ -787,27 +788,27 @@ public: /** * Sets the backup path of the document */ - void setBackupPath( const QString & _path ); + void setBackupPath( const TQString & _path ); /** * @return path to the backup document */ - QString backupPath()const; + TQString backupPath()const; /** * Indicates that this document is currently viewed * and thus should control the title caption. - * Also resets current flag for all parents. + * Also resets current flag for all tqparents. */ void setCurrent( bool on = true ); /** - * Sets current flag for this document and all its parents + * Sets current flag for this document and all its tqparents */ void forceCurrent( bool on ); bool isCurrent() const; - void setTitleModified( const QString caption, bool mod ); + void setTitleModified( const TQString caption, bool mod ); /** * Sets the document URL to empty URL @@ -815,7 +816,7 @@ public: * After using loadNativeFormat on a template, one wants * to set the url to KURL() */ - void resetURL() { m_url = KURL(); m_file = QString::null; } + void resetURL() { m_url = KURL(); m_file = TQString(); } /** * Set when you want an external embedded document to be stored internally @@ -843,7 +844,7 @@ public: * * @internal */ - QString &file() { return m_file; } + TQString &file() { return m_file; } /** * _Only_ use these functions to restore m_file (in KoMainWindow) after a @@ -853,12 +854,12 @@ public: * * @internal */ - void setFile( const QString &file ) { m_file = file; } + void setFile( const TQString &file ) { m_file = file; } /** * @internal (public for KoMainWindow) */ - void setMimeTypeAfterLoading( const QString& mimeType ); + void setMimeTypeAfterLoading( const TQString& mimeType ); /** * @return returns the number of pages in the document. @@ -870,7 +871,7 @@ public: * This is used by some text-analyzer plugins. * @since 1.5 */ - virtual QValueList allTextDocuments() const; + virtual TQValueList allTextDocuments() const; /** * Returns the unit used to display all measures/distances. @@ -890,27 +891,27 @@ public: * unit() for everything else (conversions etc.) * @since 1.5 */ - QString unitName() const; + TQString unitName() const; /** * Set the template type used. This is used by the start up widget to show * the correct templates. * @since 1.5 */ - void setTemplateType(const QString& _templateType); + void setTemplateType(const TQString& _templateType); /** * Template type used. This is used by the start up widget to show * the correct templates. * @since 1.5 */ - QString templateType() const; + TQString templateType() const; /** * Shows the init dialog when embeding - * @param parent the parent widget + * @param tqparent the tqparent widget * @since 1.5 */ - virtual bool showEmbedInitDialog(QWidget* parent); + virtual bool showEmbedInitDialog(TQWidget* tqparent); public slots: /** @@ -949,7 +950,7 @@ signals: * Emitted e.g. at the beginning of a save operation * This is emitted by KoDocument and used by KoView to display a statusbar message */ - void sigStatusBarMessage( const QString& text ); + void sigStatusBarMessage( const TQString& text ); /** * Emitted e.g. at the end of a save operation @@ -973,21 +974,21 @@ protected slots: * @param file the file to load (including path) * @since 1.5 */ - virtual void openExistingFile( const QString& file ); + virtual void openExistingFile( const TQString& file ); /** * This slot loads a template and deletes the start up widget. * @param file the template to load * @since 1.5 */ - virtual void openTemplate( const QString& file ); + virtual void openTemplate( const TQString& file ); void deleteOpenPaneDelayed(); protected: - QString autoSaveFile( const QString & path ) const; + TQString autoSaveFile( const TQString & path ) const; - virtual KoView *createViewInstance( QWidget *parent, const char *name ) = 0; + virtual KoView *createViewInstance( TQWidget *tqparent, const char *name ) = 0; /** * Loads a document from KReadOnlyPart::m_file (KParts takes care of downloading @@ -1015,9 +1016,9 @@ protected: * implement the logic to implement the document instance correctly. * After initializing the widget should emit a signal called 'documentSelected()' which * will remove the startupWidget and show the document. - * @param parent the parent of the to be created widget. + * @param tqparent the tqparent of the to be created widget. */ - virtual QWidget* createCustomDocumentWidget(QWidget *parent); + virtual TQWidget* createCustomDocumentWidget(TQWidget *tqparent); /** * OLD XML method. For OASIS just call KoDocumentChild::loadOasisDocument @@ -1028,7 +1029,7 @@ protected: * * An example implementation may look like this: * @code - * QPtrListIterator it( children() ); + * TQPtrListIterator it( tqchildren() ); * for( ; it.current(); ++it ) * { * if ( !it.current()->loadDocument( _store ) ) @@ -1042,16 +1043,16 @@ protected: virtual bool loadChildren( KoStore* ); /** - * Saves all internal children (only!). - * @see saveExternalChildren if you have external children. + * Saves all internal tqchildren (only!). + * @see saveExternalChildren if you have external tqchildren. * Returns true on success. */ virtual bool saveChildren( KoStore* store ); /** - * Saves all internal children (only!), to the store, using the OASIS format. + * Saves all internal tqchildren (only!), to the store, using the OASIS format. * This is called automatically during saveNativeFormat. - * @see saveExternalChildren if you have external children. + * @see saveExternalChildren if you have external tqchildren. * Returns true on success. */ virtual bool saveChildrenOasis( KoStore* store, KoXmlWriter* manifestWriter ); @@ -1076,7 +1077,7 @@ protected: virtual bool completeSaving( KoStore* store ); /** - * Inserts the new child in the list of children and emits the + * Inserts the new child in the list of tqchildren and emits the * childChanged() signal. * * At the same time this method marks this document as modified. @@ -1092,14 +1093,14 @@ protected: virtual void setModified() { KParts::ReadWritePart::setModified(); } /** @internal */ - virtual void insertChild(QObject *o) { QObject::insertChild(o); } + virtual void insertChild(TQObject *o) { TQObject::insertChild(o); } KoPageLayout m_pageLayout; /** - * Saves all externally stored children. + * Saves all externally stored tqchildren. * Returns true on success. - * @see #saveChildren for internal children + * @see #saveChildren for internal tqchildren */ virtual bool saveExternalChildren(); @@ -1121,13 +1122,13 @@ protected: /** * Creates the open widget showed at application start up. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the KInstance to be used for KConfig data * @param templateType the template-type (group) that should be selected on creation. * @since 1.5 */ - KoOpenPane* createOpenPane( QWidget* parent, KInstance* instance, - const QString& templateType = QString::null); + KoOpenPane* createOpenPane( TQWidget* tqparent, KInstance* instance, + const TQString& templateType = TQString()); private slots: void slotChildChanged( KoChild *c ); @@ -1143,15 +1144,15 @@ private slots: private: KService::Ptr nativeService(); - bool oldLoadAndParse( KoStore* store, const QString& filename, QDomDocument& doc ); - bool loadNativeFormatFromStore( const QString& file ); + bool oldLoadAndParse( KoStore* store, const TQString& filename, TQDomDocument& doc ); + bool loadNativeFormatFromStore( const TQString& file ); bool savePreview( KoStore* store ); bool saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ); class Private; Private *d; KService::Ptr m_nativeService; bool m_bEmpty; - static QPtrList *s_documentList; + static TQPtrList *s_documentList; static const int s_defaultAutoSave; }; diff --git a/lib/kofficecore/KoDocumentChild.cpp b/lib/kofficecore/KoDocumentChild.cpp index 8157b95a..308493ad 100644 --- a/lib/kofficecore/KoDocumentChild.cpp +++ b/lib/kofficecore/KoDocumentChild.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include @@ -67,32 +67,32 @@ public: bool m_deleted; }; -KoDocumentChild::KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRect& geometry ) - : KoChild( parent ) +KoDocumentChild::KoDocumentChild( KoDocument* tqparent, KoDocument* doc, const TQRect& tqgeometry ) + : KoChild( tqparent ) { d = new KoDocumentChildPrivate; - d->m_parent = parent; + d->m_parent = tqparent; d->m_doc = doc; - setGeometry( geometry ); + setGeometry( tqgeometry ); d->m_deleted = false; if ( doc ) doc->setStoreInternal( !doc->hasExternURL() ); } -KoDocumentChild::KoDocumentChild( KoDocument* parent ) - : KoChild( parent ) +KoDocumentChild::KoDocumentChild( KoDocument* tqparent ) + : KoChild( tqparent ) { d = new KoDocumentChildPrivate; - d->m_parent = parent; + d->m_parent = tqparent; d->m_doc = 0L; d->m_deleted = false; } -void KoDocumentChild::setDocument( KoDocument *doc, const QRect &geometry ) +void KoDocumentChild::setDocument( KoDocument *doc, const TQRect &tqgeometry ) { kdDebug()<url().url()<m_doc = doc; - setGeometry( geometry ); + setGeometry( tqgeometry ); updateMatrix(); } @@ -102,45 +102,45 @@ KoDocument *KoDocumentChild::document() const return d->m_doc; } -KoDocument* KoDocumentChild::parentDocument() const +KoDocument* KoDocumentChild::tqparentDocument() const { return d->m_parent; } -KoDocument* KoDocumentChild::hitTest( const QPoint &p, const QWMatrix &_matrix ) +KoDocument* KoDocumentChild::hitTest( const TQPoint &p, const TQWMatrix &_matrix ) { - if ( !region( _matrix ).contains( p ) || !d->m_doc ) + if ( !region( _matrix ).tqcontains( p ) || !d->m_doc ) return 0L; - QWMatrix m( _matrix ); + TQWMatrix m( _matrix ); m = matrix() * m; m.scale( xScaling(), yScaling() ); return d->m_doc->hitTest( p, m ); } -void KoDocumentChild::loadOasis( const QDomElement &frameElement, const QDomElement& objectElement ) +void KoDocumentChild::loadOasis( const TQDomElement &frameElement, const TQDomElement& objectElement ) { double x, y, w, h; - x = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "x", QString::null ) ); - y = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "y", QString::null ) ); - w = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "width", QString::null ) ); - h = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "height", QString::null ) ); - m_tmpGeometry = QRect((int)x, (int)y, (int)w, (int)h); // #### double->int conversion + x = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "x", TQString() ) ); + y = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "y", TQString() ) ); + w = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "width", TQString() ) ); + h = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "height", TQString() ) ); + m_tmpGeometry = TQRect((int)x, (int)y, (int)w, (int)h); // #### double->int conversion setGeometry(m_tmpGeometry); - QString url = objectElement.attributeNS( KoXmlNS::xlink, "href", QString::null ); + TQString url = objectElement.attributeNS( KoXmlNS::xlink, "href", TQString() ); if ( url[0] == '#' ) url = url.mid( 1 ); if ( url.startsWith( "./" ) ) - m_tmpURL = QString( INTERNAL_PROTOCOL ) + ":/" + url.mid( 2 ); + m_tmpURL = TQString( INTERNAL_PROTOCOL ) + ":/" + url.mid( 2 ); else m_tmpURL = url; kdDebug() << k_funcinfo << m_tmpURL << endl; } -bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) +bool KoDocumentChild::load( const TQDomElement& element, bool uppercase ) { if ( element.hasAttribute( "url" ) ) m_tmpURL = element.attribute("url"); @@ -159,10 +159,10 @@ bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) } bool brect = FALSE; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "rect" || ( uppercase && e.tagName() == "RECT" ) ) { @@ -177,7 +177,7 @@ bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) w = e.attribute( "w" ).toInt(&brect); if ( e.hasAttribute( "h" ) ) h = e.attribute( "h" ).toInt(&brect); - m_tmpGeometry = QRect(x, y, w, h); + m_tmpGeometry = TQRect(x, y, w, h); setGeometry(m_tmpGeometry); } } @@ -209,11 +209,11 @@ bool KoDocumentChild::loadDocument( KoStore* store ) if ( res ) { // Try to turn the mimetype name into its comment - QString mimeName = m_tmpMimeType; + TQString mimeName = m_tmpMimeType; KMimeType::Ptr mime = KMimeType::mimeType( m_tmpMimeType ); if ( mime->name() != KMimeType::defaultMimeType() ) mimeName = mime->comment(); - d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).arg( mimeName ) ); + d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).tqarg( mimeName ) ); } return res; } @@ -221,19 +221,19 @@ bool KoDocumentChild::loadDocument( KoStore* store ) return loadDocumentInternal( store, e, true /*open url*/, false /*not oasis*/ ); } -bool KoDocumentChild::loadOasisDocument( KoStore* store, const QDomDocument& manifestDoc ) +bool KoDocumentChild::loadOasisDocument( KoStore* store, const TQDomDocument& manifestDoc ) { - QString path = m_tmpURL; + TQString path = m_tmpURL; if ( m_tmpURL.startsWith( INTERNAL_PROTOCOL ) ) { path = store->currentDirectory(); if ( !path.isEmpty() ) path += '/'; - QString relPath = KURL( m_tmpURL ).path(); + TQString relPath = KURL( m_tmpURL ).path(); path += relPath.mid( 1 ); // remove leading '/' } if ( !path.endsWith( "/" ) ) path += '/'; - const QString mimeType = KoOasisStore::mimeForPath( manifestDoc, path ); + const TQString mimeType = KoOasisStore::mimeForPath( manifestDoc, path ); kdDebug() << k_funcinfo << "path for manifest file=" << path << " mimeType=" << mimeType << endl; if ( mimeType.isEmpty() ) { kdError(30003) << "Manifest doesn't have media-type for " << path << endl; @@ -248,11 +248,11 @@ bool KoDocumentChild::loadOasisDocument( KoStore* store, const QDomDocument& man if ( res ) { // Try to turn the mimetype name into its comment - QString mimeName = mimeType; + TQString mimeName = mimeType; KMimeType::Ptr mime = KMimeType::mimeType( mimeType ); if ( mime->name() != KMimeType::defaultMimeType() ) mimeName = mime->comment(); - d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).arg( mimeName ) ); + d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).tqarg( mimeName ) ); } return res; } @@ -284,7 +284,7 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr if ( oasis ) { store->pushDirectory(); assert( m_tmpURL.startsWith( INTERNAL_PROTOCOL ) ); - QString relPath = KURL( m_tmpURL ).path().mid( 1 ); + TQString relPath = KURL( m_tmpURL ).path().mid( 1 ); store->enterDirectory( relPath ); res = d->m_doc->loadOasisFromStore( store ); store->popDirectory(); @@ -303,10 +303,10 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr KURL url( m_tmpURL ); if ( !url.isLocalFile() ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); // For security reasons we need to ask confirmation if the url is remote int result = KMessageBox::warningYesNoCancel( - 0, i18n( "This document contains an external link to a remote document\n%1").arg(m_tmpURL), + 0, i18n( "This document contains an external link to a remote document\n%1").tqarg(m_tmpURL), i18n( "Confirmation Required" ), i18n( "Download" ), i18n( "Skip" ) ); if ( result == KMessageBox::Cancel ) @@ -324,10 +324,10 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr if ( !res ) { // Keep the error message from the attempted loading - QString errorMessage = d->m_doc->errorMessage(); + TQString errorMessage = d->m_doc->errorMessage(); delete d->m_doc; d->m_doc = 0; - QString tmpURL = m_tmpURL; // keep a copy, createUnavailDocument will erase it + TQString tmpURL = m_tmpURL; // keep a copy, createUnavailDocument will erase it // Not found -> use a kounavail instead res = createUnavailDocument( store, false /* the URL doesn't exist, don't try to open it */, m_tmpMimeType ); if ( res ) @@ -335,40 +335,40 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr d->m_doc->setProperty( "realURL", tmpURL ); // so that it gets saved correctly d->m_doc->setStoreInternal( true ); if ( internalURL ) - d->m_doc->setProperty( "unavailReason", i18n( "Could not load embedded object:\n%1" ).arg( errorMessage ) ); + d->m_doc->setProperty( "unavailReason", i18n( "Could not load embedded object:\n%1" ).tqarg( errorMessage ) ); else - d->m_doc->setProperty( "unavailReason", i18n( "Could not load external document %1:\n%2" ).arg( tmpURL, errorMessage ) ); + d->m_doc->setProperty( "unavailReason", i18n( "Could not load external document %1:\n%2" ).tqarg( tmpURL, errorMessage ) ); } return res; } // Still waiting... - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); } - m_tmpURL = QString::null; + m_tmpURL = TQString(); // see KoDocument::insertChild for an explanation what's going on // now :-) - if ( parentDocument() ) + if ( tqparentDocument() ) { - KoDocument *parent = parentDocument(); + KoDocument *tqparent = tqparentDocument(); - if ( parent->manager() && parent->manager()->parts() ) + if ( tqparent->manager() && tqparent->manager()->parts() ) { - KParts::PartManager *manager = parent->manager(); + KParts::PartManager *manager = tqparent->manager(); - if ( !manager->parts()->containsRef( d->m_doc ) && - !parent->isSingleViewMode() ) + if ( !manager->parts()->tqcontainsRef( d->m_doc ) && + !tqparent->isSingleViewMode() ) manager->addPart( d->m_doc, false ); } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return res; } -bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, const QString& mimeType ) +bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, const TQString& mimeType ) { // We don't need a trader query here. We're looking for a very specific component. KService::Ptr serv = KService::serviceByDesktopName( "kounavail" ); @@ -386,7 +386,7 @@ bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, con bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) { - QString path; + TQString path; if ( d->m_doc->isStoredExtern() ) { kdDebug(30003)<m_doc->url().url()<m_doc->url().protocol() == INTERNAL_PROTOCOL ); - const QString name = d->m_doc->url().path(); + const TQString name = d->m_doc->url().path(); kdDebug() << k_funcinfo << "saving " << name << endl; if ( d->m_doc->nativeOasisMimeType().isEmpty() ) { @@ -409,7 +409,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) } else { - // To make the children happy cd to the correct directory + // To make the tqchildren happy cd to the correct directory store->pushDirectory(); store->enterDirectory( name ); @@ -433,7 +433,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) // OOo uses a trailing slash for the path to embedded objects (== directories) if ( !path.endsWith( "/" ) ) path += '/'; - QCString mimetype = d->m_doc->nativeOasisMimeType(); + TQCString mimetype = d->m_doc->nativeOasisMimeType(); if ( mimetype.isEmpty() ) mimetype = d->m_doc->nativeFormatMimeType(); manifestWriter->addManifestEntry( path, mimetype ); @@ -441,7 +441,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) return true; } -void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const QString& name ) +void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const TQString& name ) { if ( !d->m_doc->isStoredExtern() ) { @@ -454,21 +454,21 @@ void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const QString d->m_doc->setURL( u ); } - // + // xmlWriter.addAttribute( "xlink:type", "simple" ); xmlWriter.addAttribute( "xlink:show", "embed" ); xmlWriter.addAttribute( "xlink:actuate", "onLoad" ); - const QString ref = d->m_doc->isStoredExtern() ? d->m_doc->url().url() : "./"+ name; + const TQString ref = d->m_doc->isStoredExtern() ? d->m_doc->url().url() : "./"+ name; kdDebug(30003) << "KoDocumentChild::saveOasis saving reference to embedded document as " << ref << endl; xmlWriter.addAttribute( "xlink:href", /*"#" + */ref ); } -QDomElement KoDocumentChild::save( QDomDocument& doc, bool uppercase ) +TQDomElement KoDocumentChild::save( TQDomDocument& doc, bool uppercase ) { if( d->m_doc ) { - QDomElement e = doc.createElement( ( uppercase ? "OBJECT" : "object" ) ); + TQDomElement e = doc.createElement( ( uppercase ? "OBJECT" : "object" ) ); if ( d->m_doc->url().protocol() != INTERNAL_PROTOCOL ) { e.setAttribute( "url", d->m_doc->url().url() ); kdDebug() << "KoDocumentChild::save url=" << d->m_doc->url().url() << endl; @@ -477,17 +477,17 @@ QDomElement KoDocumentChild::save( QDomDocument& doc, bool uppercase ) e.setAttribute( "url", d->m_doc->url().path().mid( 1 ) ); kdDebug() << "KoDocumentChild::save url=" << d->m_doc->url().path().mid( 1 ) << endl; } - e.setAttribute( "mime", d->m_doc->nativeFormatMimeType() ); + e.setAttribute( "mime", d->m_doc->nativeFormatMimeType().data() ); kdDebug() << "KoDocumentChild::save mime=" << d->m_doc->nativeFormatMimeType() << endl; - QDomElement rect = doc.createElement( ( uppercase ? "RECT" : "rect" ) ); - rect.setAttribute( "x", geometry().left() ); - rect.setAttribute( "y", geometry().top() ); - rect.setAttribute( "w", geometry().width() ); - rect.setAttribute( "h", geometry().height() ); + TQDomElement rect = doc.createElement( ( uppercase ? "RECT" : "rect" ) ); + rect.setAttribute( "x", tqgeometry().left() ); + rect.setAttribute( "y", tqgeometry().top() ); + rect.setAttribute( "w", tqgeometry().width() ); + rect.setAttribute( "h", tqgeometry().height() ); e.appendChild(rect); return e; } - return QDomElement(); + return TQDomElement(); } bool KoDocumentChild::isStoredExtern() const diff --git a/lib/kofficecore/KoDocumentChild.h b/lib/kofficecore/KoDocumentChild.h index 349961ed..228122dc 100644 --- a/lib/kofficecore/KoDocumentChild.h +++ b/lib/kofficecore/KoDocumentChild.h @@ -21,8 +21,8 @@ #include #include -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; class KURL; class KoStore; class KoDocument; @@ -43,22 +43,23 @@ class KoXmlWriter; class KOFFICECORE_EXPORT KoDocumentChild : public KoChild { Q_OBJECT + TQ_OBJECT public: - KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRect& geometry ); + KoDocumentChild( KoDocument* tqparent, KoDocument* doc, const TQRect& tqgeometry ); /** * When using this constructor you must call @ref #setDocument before * you can call any other function of this class. */ - KoDocumentChild( KoDocument* parent ); + KoDocumentChild( KoDocument* tqparent ); virtual ~KoDocumentChild(); /** * Call this function only directly after calling the constructor - * that takes only a parent as argument. + * that takes only a tqparent as argument. */ - virtual void setDocument( KoDocument *doc, const QRect &geometry ); + virtual void setDocument( KoDocument *doc, const TQRect &tqgeometry ); /** * @return document contained in this child @@ -68,13 +69,13 @@ public: KoDocument *document() const; /** - * @return parent document of this child + * @return tqparent document of this child * * @see KoDocument */ - virtual KoDocument *parentDocument() const; // TODO: remove virtual, makes no sense + virtual KoDocument *tqparentDocument() const; // TODO: remove virtual, makes no sense - virtual KoDocument* hitTest( const QPoint& p, const QWMatrix& _matrix = QWMatrix() ); + virtual KoDocument* hitTest( const TQPoint& p, const TQWMatrix& _matrix = TQWMatrix() ); /** * @note Can be empty (which is why it doesn't return a const KURL &) @@ -93,20 +94,20 @@ public: * * @return the element containing the "object" tag. */ - virtual QDomElement save( QDomDocument& doc, bool uppercase=false ); + virtual TQDomElement save( TQDomDocument& doc, bool uppercase=false ); /** * Save an embedded object to OASIS. - * This method sets the attributes for the draw:object element in the parent XML document. + * This method sets the attributes for the draw:object element in the tqparent XML document. * It also prepares the embedded object for being saved into the store at * the end of saving (see saveOasisToStore). * Note that @p name is only used for "internal" documents (not extern). */ - void saveOasisAttributes( KoXmlWriter &xmlWriter, const QString& name ); + void saveOasisAttributes( KoXmlWriter &xmlWriter, const TQString& name ); /** * Save an embedded object to an OASIS store. - * This is called automatically by the parent KoDocument's saveOasis + * This is called automatically by the tqparent KoDocument's saveOasis */ virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter ); @@ -120,9 +121,9 @@ public: * @ref KoDocument::loadChildren, respectively from your implementation * of these methods. */ - virtual bool load( const QDomElement& element, bool uppercase=false ); + virtual bool load( const TQDomElement& element, bool uppercase=false ); - void loadOasis( const QDomElement &frameElement, const QDomElement& objectElement ); + void loadOasis( const TQDomElement &frameElement, const TQDomElement& objectElement ); /** * Actually loads the document from the disk/net or from the store, @@ -134,7 +135,7 @@ public: * Actually loads the document from the disk/net or from the store * depending on the document's url */ - virtual bool loadOasisDocument( KoStore* store, const QDomDocument& manifestDoc ); + virtual bool loadOasisDocument( KoStore* store, const TQDomDocument& manifestDoc ); virtual bool isStoredExtern() const; @@ -153,24 +154,24 @@ protected: // Should be private, but KWord needs access to the variables * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QString m_tmpURL; + TQString m_tmpURL; /** * This variable is * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QRect m_tmpGeometry; + TQRect m_tmpGeometry; /** * This variable is * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QString m_tmpMimeType; + TQString m_tmpMimeType; private: - bool createUnavailDocument( KoStore* store, bool doOpenURL, const QString& mimeType ); + bool createUnavailDocument( KoStore* store, bool doOpenURL, const TQString& mimeType ); bool loadDocumentInternal( KoStore* _store, const KoDocumentEntry& e, bool doOpenURL, bool oasis ); private: diff --git a/lib/kofficecore/KoDocumentIface.cc b/lib/kofficecore/KoDocumentIface.cc index 2ff2f5fb..2c9dbe70 100644 --- a/lib/kofficecore/KoDocumentIface.cc +++ b/lib/kofficecore/KoDocumentIface.cc @@ -30,15 +30,15 @@ #include //static -QCString KoDocumentIface::newIfaceName() +TQCString KoDocumentIface::newIfaceName() { static int s_docIFNumber = 0; - QCString name; name.setNum( s_docIFNumber++ ); name.prepend("Document-"); + TQCString name; name.setNum( s_docIFNumber++ ); name.prepend("Document-"); return name; } KoDocumentIface::KoDocumentIface( KoDocument * doc, const char * name ) - : DCOPObject( name ? QCString(name) : newIfaceName() ) + : DCOPObject( name ? TQCString(name) : newIfaceName() ) { m_pDoc = doc; m_actionProxy = new KDCOPActionProxy( doc->actionCollection(), this ); @@ -49,7 +49,7 @@ KoDocumentIface::~KoDocumentIface() delete m_actionProxy; } -void KoDocumentIface::openURL( QString url ) +void KoDocumentIface::openURL( TQString url ) { m_pDoc->openURL( KURL( url ) ); } @@ -59,7 +59,7 @@ bool KoDocumentIface::isLoading() return m_pDoc->isLoading(); } -QString KoDocumentIface::url() +TQString KoDocumentIface::url() { return m_pDoc->url().url(); } @@ -76,7 +76,7 @@ int KoDocumentIface::viewCount() DCOPRef KoDocumentIface::view( int idx ) { - QPtrList views = m_pDoc->views(); + TQPtrList views = m_pDoc->views(); KoView *v = views.at( idx ); if ( !v ) return DCOPRef(); @@ -89,7 +89,7 @@ DCOPRef KoDocumentIface::view( int idx ) return DCOPRef( kapp->dcopClient()->appId(), obj->objId() ); } -DCOPRef KoDocumentIface::action( const QCString &name ) +DCOPRef KoDocumentIface::action( const TQCString &name ) { return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) ); } @@ -97,16 +97,16 @@ DCOPRef KoDocumentIface::action( const QCString &name ) QCStringList KoDocumentIface::actions() { QCStringList res; - QValueList lst = m_actionProxy->actions(); - QValueList::ConstIterator it = lst.begin(); - QValueList::ConstIterator end = lst.end(); + TQValueList lst = m_actionProxy->actions(); + TQValueList::ConstIterator it = lst.begin(); + TQValueList::ConstIterator end = lst.end(); for (; it != end; ++it ) res.append( (*it)->name() ); return res; } -QMap KoDocumentIface::actionMap() +TQMap KoDocumentIface::actionMap() { return m_actionProxy->actionMap(); } @@ -116,236 +116,236 @@ void KoDocumentIface::save() m_pDoc->save(); } -void KoDocumentIface::saveAs( const QString & url ) +void KoDocumentIface::saveAs( const TQString & url ) { m_pDoc->saveAs( KURL( url ) ); m_pDoc->waitSaveComplete(); // see ReadWritePart } -void KoDocumentIface::setOutputMimeType( const QCString & mimetype ) +void KoDocumentIface::setOutputMimeType( const TQCString & mimetype ) { m_pDoc->setOutputMimeType( mimetype ); } -QString KoDocumentIface::documentInfoAuthorName() const +TQString KoDocumentIface::documentInfoAuthorName() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fullName(); } -QString KoDocumentIface::documentInfoEmail() const +TQString KoDocumentIface::documentInfoEmail() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->email(); } -QString KoDocumentIface::documentInfoCompanyName() const +TQString KoDocumentIface::documentInfoCompanyName() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->company(); } -QString KoDocumentIface::documentInfoTelephone() const +TQString KoDocumentIface::documentInfoTelephone() const { kdDebug()<<" Keep compatibility with koffice <= 1.3 : use documentInfoTelephoneWork\n"; return documentInfoTelephoneWork(); } -QString KoDocumentIface::documentInfoTelephoneWork() const +TQString KoDocumentIface::documentInfoTelephoneWork() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->telephoneWork(); } -QString KoDocumentIface::documentInfoTelephoneHome() const +TQString KoDocumentIface::documentInfoTelephoneHome() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->telephoneHome(); } -QString KoDocumentIface::documentInfoFax() const +TQString KoDocumentIface::documentInfoFax() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fax(); } -QString KoDocumentIface::documentInfoCountry() const +TQString KoDocumentIface::documentInfoCountry() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->country(); } -QString KoDocumentIface::documentInfoPostalCode() const +TQString KoDocumentIface::documentInfoPostalCode() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->postalCode(); } -QString KoDocumentIface::documentInfoCity() const +TQString KoDocumentIface::documentInfoCity() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->city(); } -QString KoDocumentIface::documentInfoInitial() const +TQString KoDocumentIface::documentInfoInitial() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->initial(); } -QString KoDocumentIface::documentInfoAuthorPostion() const +TQString KoDocumentIface::documentInfoAuthorPostion() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->position(); } -QString KoDocumentIface::documentInfoStreet() const +TQString KoDocumentIface::documentInfoStreet() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->street(); } -QString KoDocumentIface::documentInfoTitle() const +TQString KoDocumentIface::documentInfoTitle() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->title(); } -QString KoDocumentIface::documentInfoAbstract() const +TQString KoDocumentIface::documentInfoAbstract() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->abstract(); } -QString KoDocumentIface::documentInfoKeywords() const +TQString KoDocumentIface::documentInfoKeywords() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->keywords(); } -QString KoDocumentIface::documentInfoSubject() const +TQString KoDocumentIface::documentInfoSubject() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->subject(); } -void KoDocumentIface::setDocumentInfoKeywords(const QString & text ) +void KoDocumentIface::setDocumentInfoKeywords(const TQString & text ) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -357,7 +357,7 @@ void KoDocumentIface::setDocumentInfoKeywords(const QString & text ) aboutPage->setKeywords(text); } -void KoDocumentIface::setDocumentInfoSubject(const QString & text) +void KoDocumentIface::setDocumentInfoSubject(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -369,7 +369,7 @@ void KoDocumentIface::setDocumentInfoSubject(const QString & text) aboutPage->setSubject(text); } -void KoDocumentIface::setDocumentInfoAuthorName(const QString & text) +void KoDocumentIface::setDocumentInfoAuthorName(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -382,7 +382,7 @@ void KoDocumentIface::setDocumentInfoAuthorName(const QString & text) } -void KoDocumentIface::setDocumentInfoEmail(const QString &text) +void KoDocumentIface::setDocumentInfoEmail(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -394,7 +394,7 @@ void KoDocumentIface::setDocumentInfoEmail(const QString &text) authorPage->setEmail(text); } -void KoDocumentIface::setDocumentInfoCompanyName(const QString &text) +void KoDocumentIface::setDocumentInfoCompanyName(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -406,7 +406,7 @@ void KoDocumentIface::setDocumentInfoCompanyName(const QString &text) authorPage->setCompany(text); } -void KoDocumentIface::setDocumentInfoAuthorPosition(const QString &text) +void KoDocumentIface::setDocumentInfoAuthorPosition(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -419,13 +419,13 @@ void KoDocumentIface::setDocumentInfoAuthorPosition(const QString &text) } -void KoDocumentIface::setDocumentInfoTelephone(const QString &text) +void KoDocumentIface::setDocumentInfoTelephone(const TQString &text) { kdDebug()<<"Keep compatibility with koffice <= 1.3 : use setDocumentInfoTelephoneWork\n"; setDocumentInfoTelephoneWork(text); } -void KoDocumentIface::setDocumentInfoTelephoneWork(const QString &text) +void KoDocumentIface::setDocumentInfoTelephoneWork(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -437,7 +437,7 @@ void KoDocumentIface::setDocumentInfoTelephoneWork(const QString &text) authorPage->setTelephoneWork(text); } -void KoDocumentIface::setDocumentInfoTelephoneHome(const QString &text) +void KoDocumentIface::setDocumentInfoTelephoneHome(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -450,7 +450,7 @@ void KoDocumentIface::setDocumentInfoTelephoneHome(const QString &text) } -void KoDocumentIface::setDocumentInfoFax(const QString &text) +void KoDocumentIface::setDocumentInfoFax(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -462,7 +462,7 @@ void KoDocumentIface::setDocumentInfoFax(const QString &text) authorPage->setFax(text); } -void KoDocumentIface::setDocumentInfoCountry(const QString &text) +void KoDocumentIface::setDocumentInfoCountry(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -475,7 +475,7 @@ void KoDocumentIface::setDocumentInfoCountry(const QString &text) } -void KoDocumentIface::setDocumentInfoTitle(const QString & text) +void KoDocumentIface::setDocumentInfoTitle(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -487,7 +487,7 @@ void KoDocumentIface::setDocumentInfoTitle(const QString & text) aboutPage->setTitle(text); } -void KoDocumentIface::setDocumentInfoPostalCode(const QString &text) +void KoDocumentIface::setDocumentInfoPostalCode(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -501,7 +501,7 @@ void KoDocumentIface::setDocumentInfoPostalCode(const QString &text) } -void KoDocumentIface::setDocumentInfoCity(const QString & text) +void KoDocumentIface::setDocumentInfoCity(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -513,7 +513,7 @@ void KoDocumentIface::setDocumentInfoCity(const QString & text) authorPage->setCity(text); } -void KoDocumentIface::setDocumentInfoInitial(const QString & text) +void KoDocumentIface::setDocumentInfoInitial(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -526,7 +526,7 @@ void KoDocumentIface::setDocumentInfoInitial(const QString & text) } -void KoDocumentIface::setDocumentInfoStreet(const QString &text) +void KoDocumentIface::setDocumentInfoStreet(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -540,7 +540,7 @@ void KoDocumentIface::setDocumentInfoStreet(const QString &text) } -void KoDocumentIface::setDocumentInfoAbstract(const QString &text) +void KoDocumentIface::setDocumentInfoAbstract(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -557,8 +557,8 @@ QCStringList KoDocumentIface::functionsDynamic() return DCOPObject::functionsDynamic() + KDCOPPropertyProxy::functions( m_pDoc ); } -bool KoDocumentIface::processDynamic( const QCString &fun, const QByteArray &data, - QCString& replyType, QByteArray &replyData ) +bool KoDocumentIface::processDynamic( const TQCString &fun, const TQByteArray &data, + TQCString& replyType, TQByteArray &replyData ) { if ( KDCOPPropertyProxy::isPropertyRequest( fun, m_pDoc ) ) return KDCOPPropertyProxy::processPropertyRequest( fun, data, replyType, replyData, m_pDoc ); diff --git a/lib/kofficecore/KoDocumentIface.h b/lib/kofficecore/KoDocumentIface.h index 2713cb43..546859ce 100644 --- a/lib/kofficecore/KoDocumentIface.h +++ b/lib/kofficecore/KoDocumentIface.h @@ -21,7 +21,7 @@ #define __KoDocumentIface_h__ #include -#include +#include #include #include class KoDocument; @@ -48,20 +48,20 @@ public: * Generate a name for this interface. Automatically used if name=0 is * passed to the constructor */ - static QCString newIfaceName(); + static TQCString newIfaceName(); k_dcop: /** * Returns the URL for this document (empty, real URL, or internal one) */ - QString url(); + TQString url(); /** * Opens a document stored in @p url * Warning: this is asynchronous. The document might not be loaded yet when * this call returns. See isLoading. */ - void openURL( QString url ); + void openURL( TQString url ); /** * @return TRUE is the document is still loading @@ -86,7 +86,7 @@ k_dcop: /** * DCOP-action proxy */ - DCOPRef action( const QCString &name ); + DCOPRef action( const TQCString &name ); /** * @return list of actions */ @@ -94,7 +94,7 @@ k_dcop: /** * @return a map of (action name, DCOP reference) */ - QMap actionMap(); + TQMap actionMap(); /** * Saves the document under its existing filename @@ -104,49 +104,49 @@ k_dcop: /** * Saves the document under a new name */ - void saveAs( const QString & url ); - - void setOutputMimeType( const QCString & mimetype ); - - QString documentInfoAuthorName() const; - QString documentInfoEmail() const; - QString documentInfoCompanyName() const; - QString documentInfoTitle() const; - QString documentInfoAbstract() const; - QString documentInfoKeywords() const; - QString documentInfoSubject() const; - QString documentInfoTelephone() const; - QString documentInfoTelephoneWork() const; - QString documentInfoTelephoneHome() const; - QString documentInfoFax() const; - QString documentInfoCountry() const; - QString documentInfoPostalCode() const; - QString documentInfoCity() const; - QString documentInfoStreet() const; - QString documentInfoInitial() const; - QString documentInfoAuthorPostion() const; - void setDocumentInfoAuthorName(const QString & text); - void setDocumentInfoEmail(const QString &text); - void setDocumentInfoCompanyName(const QString &text); - void setDocumentInfoTelephone(const QString &text); - void setDocumentInfoTelephoneWork(const QString &text); - void setDocumentInfoTelephoneHome(const QString &text); - void setDocumentInfoFax(const QString &text); - void setDocumentInfoCountry(const QString &text); - void setDocumentInfoTitle(const QString & text); - void setDocumentInfoPostalCode(const QString &text); - void setDocumentInfoCity(const QString & text); - void setDocumentInfoStreet(const QString &text); - void setDocumentInfoAbstract(const QString &text); - void setDocumentInfoInitial(const QString & text); - void setDocumentInfoKeywords(const QString & text ); - void setDocumentInfoSubject(const QString & text); - void setDocumentInfoAuthorPosition(const QString & text); + void saveAs( const TQString & url ); + + void setOutputMimeType( const TQCString & mimetype ); + + TQString documentInfoAuthorName() const; + TQString documentInfoEmail() const; + TQString documentInfoCompanyName() const; + TQString documentInfoTitle() const; + TQString documentInfoAbstract() const; + TQString documentInfoKeywords() const; + TQString documentInfoSubject() const; + TQString documentInfoTelephone() const; + TQString documentInfoTelephoneWork() const; + TQString documentInfoTelephoneHome() const; + TQString documentInfoFax() const; + TQString documentInfoCountry() const; + TQString documentInfoPostalCode() const; + TQString documentInfoCity() const; + TQString documentInfoStreet() const; + TQString documentInfoInitial() const; + TQString documentInfoAuthorPostion() const; + void setDocumentInfoAuthorName(const TQString & text); + void setDocumentInfoEmail(const TQString &text); + void setDocumentInfoCompanyName(const TQString &text); + void setDocumentInfoTelephone(const TQString &text); + void setDocumentInfoTelephoneWork(const TQString &text); + void setDocumentInfoTelephoneHome(const TQString &text); + void setDocumentInfoFax(const TQString &text); + void setDocumentInfoCountry(const TQString &text); + void setDocumentInfoTitle(const TQString & text); + void setDocumentInfoPostalCode(const TQString &text); + void setDocumentInfoCity(const TQString & text); + void setDocumentInfoStreet(const TQString &text); + void setDocumentInfoAbstract(const TQString &text); + void setDocumentInfoInitial(const TQString & text); + void setDocumentInfoKeywords(const TQString & text ); + void setDocumentInfoSubject(const TQString & text); + void setDocumentInfoAuthorPosition(const TQString & text); public: virtual QCStringList functionsDynamic(); - virtual bool processDynamic( const QCString &fun, const QByteArray &data, - QCString& replyType, QByteArray &replyData ); + virtual bool processDynamic( const TQCString &fun, const TQByteArray &data, + TQCString& replyType, TQByteArray &replyData ); protected: KoDocument * m_pDoc; diff --git a/lib/kofficecore/KoDocumentInfo.cpp b/lib/kofficecore/KoDocumentInfo.cpp index 3d4e0505..ccec3424 100644 --- a/lib/kofficecore/KoDocumentInfo.cpp +++ b/lib/kofficecore/KoDocumentInfo.cpp @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include #include "KoXmlNS.h" /***************************************** @@ -42,8 +42,8 @@ * *****************************************/ -KoDocumentInfo::KoDocumentInfo( QObject* parent, const char* name ) - : QObject( parent, name ) +KoDocumentInfo::KoDocumentInfo( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { (void)new KoDocumentInfoUserMetadata( this ); (void)new KoDocumentInfoAuthor( this ); @@ -55,10 +55,10 @@ KoDocumentInfo::~KoDocumentInfo() } // KOffice-1.3 format -bool KoDocumentInfo::load( const QDomDocument& doc ) +bool KoDocumentInfo::load( const TQDomDocument& doc ) { - QStringList lst = pages(); - QStringList::ConstIterator it = lst.begin(); + TQStringList lst = pages(); + TQStringList::ConstIterator it = lst.begin(); for( ; it != lst.end(); ++it ) { KoDocumentInfoPage* p = page( *it ); @@ -70,18 +70,18 @@ bool KoDocumentInfo::load( const QDomDocument& doc ) return true; } -bool KoDocumentInfo::loadOasis( const QDomDocument& metaDoc ) +bool KoDocumentInfo::loadOasis( const TQDomDocument& metaDoc ) { //kdDebug()<<" metaDoc.toString() :"<save( doc ); + TQDomElement s = p->save( doc ); if ( s.isNull() ) continue; e.appendChild( s ); } if ( e.isNull() ) - return QDomDocument(); + return TQDomDocument(); return doc; } @@ -122,10 +122,10 @@ bool KoDocumentInfo::saveOasis( KoStore* store ) xmlWriter->startElement( "office:meta" ); xmlWriter->startElement( "meta:generator"); - xmlWriter->addTextNode( QString( "KOffice/%1" ).arg( KOFFICE_VERSION_STRING ) ); + xmlWriter->addTextNode( TQString( "KOffice/%1" ).tqarg( KOFFICE_VERSION_STRING ) ); xmlWriter->endElement(); - QStringList lst = pages(); - QStringList::ConstIterator it = lst.begin(); + TQStringList lst = pages(); + TQStringList::ConstIterator it = lst.begin(); for( ; it != lst.end(); ++it ) { KoDocumentInfoPage* p = page( *it ); @@ -140,22 +140,22 @@ bool KoDocumentInfo::saveOasis( KoStore* store ) return true; } -KoDocumentInfoPage* KoDocumentInfo::page( const QString& name ) const +KoDocumentInfoPage* KoDocumentInfo::page( const TQString& name ) const { - QObject* obj = const_cast(this)->child( name.latin1() ); + TQObject* obj = const_cast(this)->child( name.latin1() ); return (KoDocumentInfoPage*)obj; } -QStringList KoDocumentInfo::pages() const +TQStringList KoDocumentInfo::pages() const { - QStringList ret; + TQStringList ret; - const QObjectList *list = children(); - if ( list ) + const TQObjectList list = childrenListObject(); + if ( !list.isEmpty() ) { - QObjectListIt it( *list ); - QObject *obj; + TQObjectListIt it( list ); + TQObject *obj; while ( ( obj = it.current() ) ) { ret.prepend( obj->name() ); @@ -166,23 +166,23 @@ QStringList KoDocumentInfo::pages() const return ret; } -QString KoDocumentInfo::title() const +TQString KoDocumentInfo::title() const { KoDocumentInfoAbout * aboutPage = static_cast(page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->title(); } -QString KoDocumentInfo::creator() const +TQString KoDocumentInfo::creator() const { KoDocumentInfoAuthor * authorPage = static_cast(page( "author" )); if ( !authorPage ) { kdWarning() << "'Author' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fullName(); @@ -194,8 +194,8 @@ QString KoDocumentInfo::creator() const * *****************************************/ -KoDocumentInfoPage::KoDocumentInfoPage( QObject* parent, const char* name ) - : QObject( parent, name ) +KoDocumentInfoPage::KoDocumentInfoPage( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { } @@ -231,18 +231,18 @@ void KoDocumentInfoAuthor::initParameters() m_emailCfg = new KConfig( "emaildefaults", true ); m_emailCfg->setGroup( "Defaults" ); - QString group = m_emailCfg->readEntry("Profile","Default"); - m_emailCfg->setGroup(QString("PROFILE_%1").arg(group)); + TQString group = m_emailCfg->readEntry("Profile","Default"); + m_emailCfg->setGroup(TQString("PROFILE_%1").tqarg(group)); if ( m_fullName.isNull() ) // only if null. Empty means the user made it explicitly empty. { - QString name = m_emailCfg->readEntry( "FullName" ); + TQString name = m_emailCfg->readEntry( "FullName" ); if ( !name.isEmpty() ) m_fullName = name; } if ( m_company.isNull() ) { - QString name = m_emailCfg->readEntry( "Organization" ); + TQString name = m_emailCfg->readEntry( "Organization" ); if ( !name.isEmpty() ) m_company = name; } @@ -343,20 +343,20 @@ bool KoDocumentInfoAuthor::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoAuthor::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoAuthor::loadOasis( const TQDomNode& metaDoc ) { - QDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "creator" ); + TQDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "creator" ); if ( !e.isNull() && !e.text().isEmpty() ) m_fullName = e.text(); - QDomNode n = metaDoc.firstChild(); + TQDomNode n = metaDoc.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.namespaceURI() == KoXmlNS::meta && e.localName() == "user-defined" && !e.text().isEmpty() ) { - QString name = e.attributeNS( KoXmlNS::meta, "name", QString::null ); + TQString name = e.attributeNS( KoXmlNS::meta, "name", TQString() ); if ( name == "initial" ) m_initial = e.text(); else if ( name == "author-title" ) @@ -388,12 +388,12 @@ bool KoDocumentInfoAuthor::loadOasis( const QDomNode& metaDoc ) } // KOffice-1.3 format -bool KoDocumentInfoAuthor::load( const QDomElement& e ) +bool KoDocumentInfoAuthor::load( const TQDomElement& e ) { - QDomNode n = e.namedItem( "author" ).firstChild(); + TQDomNode n = e.namedItem( "author" ).firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "full-name" ) m_fullName = e.text(); @@ -425,11 +425,11 @@ bool KoDocumentInfoAuthor::load( const QDomElement& e ) return true; } -QDomElement KoDocumentInfoAuthor::save( QDomDocument& doc ) +TQDomElement KoDocumentInfoAuthor::save( TQDomDocument& doc ) { - QDomElement e = doc.createElement( "author" ); + TQDomElement e = doc.createElement( "author" ); - QDomElement t = doc.createElement( "full-name" ); + TQDomElement t = doc.createElement( "full-name" ); e.appendChild( t ); t.appendChild( doc.createTextNode( m_fullName ) ); @@ -485,132 +485,132 @@ QDomElement KoDocumentInfoAuthor::save( QDomDocument& doc ) return e; } -QString KoDocumentInfoAuthor::fullName() const +TQString KoDocumentInfoAuthor::fullName() const { return m_fullName; } -QString KoDocumentInfoAuthor::initial() const +TQString KoDocumentInfoAuthor::initial() const { return m_initial; } -QString KoDocumentInfoAuthor::title() const +TQString KoDocumentInfoAuthor::title() const { return m_title; } -QString KoDocumentInfoAuthor::company() const +TQString KoDocumentInfoAuthor::company() const { return m_company; } -QString KoDocumentInfoAuthor::email() const +TQString KoDocumentInfoAuthor::email() const { return m_email; } -QString KoDocumentInfoAuthor::telephoneHome() const +TQString KoDocumentInfoAuthor::telephoneHome() const { return m_telephoneHome; } -QString KoDocumentInfoAuthor::telephoneWork() const +TQString KoDocumentInfoAuthor::telephoneWork() const { return m_telephoneWork; } -QString KoDocumentInfoAuthor::fax() const +TQString KoDocumentInfoAuthor::fax() const { return m_fax; } -QString KoDocumentInfoAuthor::country() const +TQString KoDocumentInfoAuthor::country() const { return m_country; } -QString KoDocumentInfoAuthor::postalCode() const +TQString KoDocumentInfoAuthor::postalCode() const { return m_postalCode; } -QString KoDocumentInfoAuthor::city() const +TQString KoDocumentInfoAuthor::city() const { return m_city; } -QString KoDocumentInfoAuthor::street() const +TQString KoDocumentInfoAuthor::street() const { return m_street; } -QString KoDocumentInfoAuthor::position() const +TQString KoDocumentInfoAuthor::position() const { return m_position; } -void KoDocumentInfoAuthor::setFullName( const QString& n ) +void KoDocumentInfoAuthor::setFullName( const TQString& n ) { m_fullName = n; } -void KoDocumentInfoAuthor::setInitial( const QString& n ) +void KoDocumentInfoAuthor::setInitial( const TQString& n ) { m_initial = n; } -void KoDocumentInfoAuthor::setTitle( const QString& n ) +void KoDocumentInfoAuthor::setTitle( const TQString& n ) { m_title = n; } -void KoDocumentInfoAuthor::setCompany( const QString& n ) +void KoDocumentInfoAuthor::setCompany( const TQString& n ) { m_company = n; } -void KoDocumentInfoAuthor::setEmail( const QString& n ) +void KoDocumentInfoAuthor::setEmail( const TQString& n ) { m_email = n; } -void KoDocumentInfoAuthor::setTelephoneHome( const QString& n ) +void KoDocumentInfoAuthor::setTelephoneHome( const TQString& n ) { m_telephoneHome = n; } -void KoDocumentInfoAuthor::setTelephoneWork( const QString& n ) +void KoDocumentInfoAuthor::setTelephoneWork( const TQString& n ) { m_telephoneWork = n; } -void KoDocumentInfoAuthor::setFax( const QString& n ) +void KoDocumentInfoAuthor::setFax( const TQString& n ) { m_fax = n; } -void KoDocumentInfoAuthor::setCountry( const QString& n ) +void KoDocumentInfoAuthor::setCountry( const TQString& n ) { m_country = n; } -void KoDocumentInfoAuthor::setPostalCode( const QString& n ) +void KoDocumentInfoAuthor::setPostalCode( const TQString& n ) { m_postalCode = n; } -void KoDocumentInfoAuthor::setCity( const QString& n ) +void KoDocumentInfoAuthor::setCity( const TQString& n ) { m_city = n; } -void KoDocumentInfoAuthor::setStreet( const QString& n ) +void KoDocumentInfoAuthor::setStreet( const TQString& n ) { m_street = n; } -void KoDocumentInfoAuthor::setPosition( const QString& n ) +void KoDocumentInfoAuthor::setPosition( const TQString& n ) { m_position = n; } @@ -629,15 +629,15 @@ KoDocumentInfoAbout::KoDocumentInfoAbout( KoDocumentInfo* info ) m_docInfo = info; m_editingCycles = 0; m_initialCreator = m_docInfo->creator(); - m_creationDate = QDateTime::currentDateTime(); + m_creationDate = TQDateTime::tqcurrentDateTime(); } void KoDocumentInfoAbout::saveParameters() { - KoDocument* doc = dynamic_cast< KoDocument* >( m_docInfo->parent() ); + KoDocument* doc = dynamic_cast< KoDocument* >( m_docInfo->tqparent() ); if ( m_firstSave && doc && !doc->isAutosaving() ) m_editingCycles++; - m_modificationDate = QDateTime::currentDateTime(); + m_modificationDate = TQDateTime::tqcurrentDateTime(); m_firstSave = false; } @@ -676,7 +676,7 @@ bool KoDocumentInfoAbout::saveOasis( KoXmlWriter &xmlWriter ) } xmlWriter.startElement( "meta:editing-cycles" ); - xmlWriter.addTextNode( QString::number( m_editingCycles ) ); + xmlWriter.addTextNode( TQString::number( m_editingCycles ) ); xmlWriter.endElement(); if ( m_creationDate.isValid() ) @@ -695,9 +695,9 @@ bool KoDocumentInfoAbout::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoAbout::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoAbout::loadOasis( const TQDomNode& metaDoc ) { - QDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "title" ); + TQDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "title" ); if ( !e.isNull() && !e.text().isEmpty() ) { m_title = e.text(); @@ -729,23 +729,23 @@ bool KoDocumentInfoAbout::loadOasis( const QDomNode& metaDoc ) e = KoDom::namedItemNS( metaDoc, KoXmlNS::meta, "creation-date" ); if ( !e.isNull() && !e.text().isEmpty() ) - m_creationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_creationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); else - m_creationDate = QDateTime(); + m_creationDate = TQDateTime(); e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "date" ); if ( !e.isNull() && !e.text().isEmpty() ) - m_modificationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_modificationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); return true; } // KOffice-1.3 format -bool KoDocumentInfoAbout::load( const QDomElement& e ) +bool KoDocumentInfoAbout::load( const TQDomElement& e ) { - QDomNode n = e.namedItem( "about" ).firstChild(); + TQDomNode n = e.namedItem( "about" ).firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "abstract" ) m_abstract = e.text(); @@ -760,21 +760,21 @@ bool KoDocumentInfoAbout::load( const QDomElement& e ) else if ( e.tagName() == "editing-cycles" ) m_editingCycles = e.text().toInt(); else if ( e.tagName() == "creation-date" ) - m_creationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_creationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); else if ( e.tagName() == "date" ) - m_modificationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_modificationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); } return true; } // KOffice-1.3 format -QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) +TQDomElement KoDocumentInfoAbout::save( TQDomDocument& doc ) { saveParameters(); - QDomElement e = doc.createElement( "about" ); + TQDomElement e = doc.createElement( "about" ); - QDomElement t = doc.createElement( "abstract" ); + TQDomElement t = doc.createElement( "abstract" ); e.appendChild( t ); t.appendChild( doc.createCDATASection( m_abstract ) ); @@ -796,7 +796,7 @@ QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) t = doc.createElement( "editing-cycles" ); e.appendChild( t ); - t.appendChild( doc.createTextNode( QString::number( m_editingCycles ) ) ); + t.appendChild( doc.createTextNode( TQString::number( m_editingCycles ) ) ); t = doc.createElement( "creation-date" ); e.appendChild( t ); @@ -808,68 +808,68 @@ QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) return e; } -QString KoDocumentInfoAbout::title() const +TQString KoDocumentInfoAbout::title() const { return m_title; } -QString KoDocumentInfoAbout::abstract() const +TQString KoDocumentInfoAbout::abstract() const { return m_abstract; } -QString KoDocumentInfoAbout::initialCreator() const +TQString KoDocumentInfoAbout::initialCreator() const { return m_initialCreator; } -QString KoDocumentInfoAbout::editingCycles() const +TQString KoDocumentInfoAbout::editingCycles() const { - return QString::number( m_editingCycles ); + return TQString::number( m_editingCycles ); } -QString KoDocumentInfoAbout::creationDate() const +TQString KoDocumentInfoAbout::creationDate() const { if ( m_creationDate.isValid() ) return KGlobal::locale()->formatDateTime( m_creationDate ); else - return QString::null; + return TQString(); } -QString KoDocumentInfoAbout::modificationDate() const +TQString KoDocumentInfoAbout::modificationDate() const { if ( m_modificationDate.isValid() ) return KGlobal::locale()->formatDateTime( m_modificationDate ); else - return QString::null; + return TQString(); } -void KoDocumentInfoAbout::setTitle( const QString& n ) +void KoDocumentInfoAbout::setTitle( const TQString& n ) { m_title = n; } -void KoDocumentInfoAbout::setAbstract( const QString& n ) +void KoDocumentInfoAbout::setAbstract( const TQString& n ) { m_abstract = n; } -QString KoDocumentInfoAbout::keywords() const +TQString KoDocumentInfoAbout::keywords() const { return m_keywords; } -QString KoDocumentInfoAbout::subject() const +TQString KoDocumentInfoAbout::subject() const { return m_subject; } -void KoDocumentInfoAbout::setKeywords( const QString& n ) +void KoDocumentInfoAbout::setKeywords( const TQString& n ) { m_keywords = n; } -void KoDocumentInfoAbout::setSubject( const QString& n ) +void KoDocumentInfoAbout::setSubject( const TQString& n ) { m_subject = n; } @@ -878,8 +878,8 @@ void KoDocumentInfoAbout::resetMetaData() { m_editingCycles = 0; m_initialCreator = m_docInfo->creator(); - m_creationDate = QDateTime::currentDateTime(); - m_modificationDate = QDateTime(); + m_creationDate = TQDateTime::tqcurrentDateTime(); + m_modificationDate = TQDateTime(); } /***************************************** @@ -898,7 +898,7 @@ KoDocumentInfoUserMetadata::KoDocumentInfoUserMetadata( KoDocumentInfo* info ) bool KoDocumentInfoUserMetadata::saveOasis( KoXmlWriter &xmlWriter ) { - QMap::iterator it; + TQMap::iterator it; for ( it = m_metaList.begin(); it != m_metaList.end(); ++it ) { xmlWriter.startElement( "meta:user-defined"); @@ -909,18 +909,18 @@ bool KoDocumentInfoUserMetadata::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoUserMetadata::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoUserMetadata::loadOasis( const TQDomNode& metaDoc ) { - QDomNode n = metaDoc.firstChild(); + TQDomNode n = metaDoc.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.namespaceURI() == KoXmlNS::meta && e.localName() == "user-defined" && !e.text().isEmpty() ) { - QString name = e.attributeNS( KoXmlNS::meta, "name", QString::null ); - if ( !m_reserved.contains( name ) ) + TQString name = e.attributeNS( KoXmlNS::meta, "name", TQString() ); + if ( !m_reserved.tqcontains( name ) ) m_metaList[ name ] = e.text(); } } @@ -929,15 +929,15 @@ bool KoDocumentInfoUserMetadata::loadOasis( const QDomNode& metaDoc ) } // KOffice-1.3 format -bool KoDocumentInfoUserMetadata::load( const QDomElement& ) +bool KoDocumentInfoUserMetadata::load( const TQDomElement& ) { return true; } // KOffice-1.3 format -QDomElement KoDocumentInfoUserMetadata::save( QDomDocument& ) +TQDomElement KoDocumentInfoUserMetadata::save( TQDomDocument& ) { - return QDomElement(); + return TQDomElement(); } #include diff --git a/lib/kofficecore/KoDocumentInfo.h b/lib/kofficecore/KoDocumentInfo.h index 30e74cf7..b94a2de0 100644 --- a/lib/kofficecore/KoDocumentInfo.h +++ b/lib/kofficecore/KoDocumentInfo.h @@ -21,142 +21,145 @@ #ifndef KO_DOCUMENT_INFO_H #define KO_DOCUMENT_INFO_H -#include -#include +#include +#include #include #include -class QString; -class QStringList; -class QDomDocument; -class QDomElement; -class QDomNode; -class QDateTime; +class TQString; +class TQStringList; +class TQDomDocument; +class TQDomElement; +class TQDomNode; +class TQDateTime; class KoStore; class KoDocumentInfoPage; class KoXmlWriter; -class KOFFICECORE_EXPORT KoDocumentInfo : public QObject +class KOFFICECORE_EXPORT KoDocumentInfo : public TQObject { Q_OBJECT + TQ_OBJECT public: - KoDocumentInfo( QObject* parent = 0, const char* name = 0 ); + KoDocumentInfo( TQObject* tqparent = 0, const char* name = 0 ); virtual ~KoDocumentInfo(); - bool load( const QDomDocument& doc ); - bool loadOasis( const QDomDocument& metaDoc ); + bool load( const TQDomDocument& doc ); + bool loadOasis( const TQDomDocument& metaDoc ); - QDomDocument save(); + TQDomDocument save(); bool saveOasis( KoStore* store ); /** * This info has an accessor because it's the most commonly used. * Equivalent to page("about")->title() (but checking that the page exists) */ - QString title() const; - QString creator() const; + TQString title() const; + TQString creator() const; - KoDocumentInfoPage* page( const QString& name ) const; - QStringList pages() const; + KoDocumentInfoPage* page( const TQString& name ) const; + TQStringList pages() const; void documentInfochanged() { emit sigDocumentInfoModifed();} signals: void sigDocumentInfoModifed(); }; -class KOFFICECORE_EXPORT KoDocumentInfoPage : public QObject +class KOFFICECORE_EXPORT KoDocumentInfoPage : public TQObject { public: - KoDocumentInfoPage( QObject *parent, const char* name ); + KoDocumentInfoPage( TQObject *tqparent, const char* name ); - virtual bool load( const QDomElement& e ) = 0; - virtual QDomElement save( QDomDocument& doc ) = 0; - virtual bool loadOasis( const QDomNode& metaDoc ) = 0; + virtual bool load( const TQDomElement& e ) = 0; + virtual TQDomElement save( TQDomDocument& doc ) = 0; + virtual bool loadOasis( const TQDomNode& metaDoc ) = 0; virtual bool saveOasis( KoXmlWriter &xmlWriter ) = 0; }; class KOFFICECORE_EXPORT KoDocumentInfoAuthor : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoAuthor( KoDocumentInfo* info ); ~KoDocumentInfoAuthor(); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QString fullName() const; - QString initial() const; - QString title() const; - QString company() const; - QString email() const; - QString telephoneHome() const; - QString telephoneWork() const; - QString fax() const; - QString country() const; - QString postalCode() const; - QString city() const; - QString street() const; - QString position() const; - - void setFullName( const QString& n ); - void setTitle( const QString& n ); - void setCompany( const QString& n ); - void setEmail( const QString& n ); - void setTelephoneHome( const QString& n ); - void setTelephoneWork( const QString& n ); - void setFax( const QString& n ); - void setCountry( const QString& n ); - void setPostalCode( const QString& n ); - void setCity( const QString& n ); - void setStreet( const QString& n ); - void setInitial( const QString& n ); - void setPosition( const QString& n ); + TQString fullName() const; + TQString initial() const; + TQString title() const; + TQString company() const; + TQString email() const; + TQString telephoneHome() const; + TQString telephoneWork() const; + TQString fax() const; + TQString country() const; + TQString postalCode() const; + TQString city() const; + TQString street() const; + TQString position() const; + + void setFullName( const TQString& n ); + void setTitle( const TQString& n ); + void setCompany( const TQString& n ); + void setEmail( const TQString& n ); + void setTelephoneHome( const TQString& n ); + void setTelephoneWork( const TQString& n ); + void setFax( const TQString& n ); + void setCountry( const TQString& n ); + void setPostalCode( const TQString& n ); + void setCity( const TQString& n ); + void setStreet( const TQString& n ); + void setInitial( const TQString& n ); + void setPosition( const TQString& n ); void initParameters(); private: - QString m_fullName; - QString m_title; - QString m_company; - QString m_email; - QString m_telephoneHome; - QString m_telephoneWork; - QString m_fax; - QString m_country; - QString m_postalCode; - QString m_city; - QString m_street; - QString m_initial; - QString m_position; + TQString m_fullName; + TQString m_title; + TQString m_company; + TQString m_email; + TQString m_telephoneHome; + TQString m_telephoneWork; + TQString m_fax; + TQString m_country; + TQString m_postalCode; + TQString m_city; + TQString m_street; + TQString m_initial; + TQString m_position; KConfig *m_emailCfg; }; class KOFFICECORE_EXPORT KoDocumentInfoAbout : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoAbout( KoDocumentInfo* info ); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QString title() const; - QString abstract() const; - QString subject() const; - QString keywords() const; - QString initialCreator() const; - QString editingCycles() const; - QString creationDate() const; - QString modificationDate() const; + TQString title() const; + TQString abstract() const; + TQString subject() const; + TQString keywords() const; + TQString initialCreator() const; + TQString editingCycles() const; + TQString creationDate() const; + TQString modificationDate() const; - void setKeywords( const QString &n ); - void setSubject( const QString& n ); + void setKeywords( const TQString &n ); + void setSubject( const TQString& n ); - void setTitle( const QString& n ); - void setAbstract( const QString& n ); + void setTitle( const TQString& n ); + void setAbstract( const TQString& n ); void saveParameters(); public slots: @@ -164,13 +167,13 @@ public slots: private: KoDocumentInfo* m_docInfo; - QString m_title; - QString m_abstract; - QString m_keywords; - QString m_subject; - QString m_initialCreator; - QDateTime m_creationDate; - QDateTime m_modificationDate; + TQString m_title; + TQString m_abstract; + TQString m_keywords; + TQString m_subject; + TQString m_initialCreator; + TQDateTime m_creationDate; + TQDateTime m_modificationDate; int m_editingCycles; bool m_firstSave; }; @@ -178,19 +181,20 @@ private: class KOFFICECORE_EXPORT KoDocumentInfoUserMetadata : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoUserMetadata( KoDocumentInfo* info ); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QMap* metadataList() { return &m_metaList; } + TQMap* metadataList() { return &m_metaList; } private: - QMap m_metaList; - QStringList m_reserved; + TQMap m_metaList; + TQStringList m_reserved; }; #endif diff --git a/lib/kofficecore/KoDocumentInfoDlg.cpp b/lib/kofficecore/KoDocumentInfoDlg.cpp index f9ad8904..8fa70f07 100644 --- a/lib/kofficecore/KoDocumentInfoDlg.cpp +++ b/lib/kofficecore/KoDocumentInfoDlg.cpp @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,10 +49,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include @@ -79,9 +79,9 @@ public: KDialogBase *m_dialog; }; -KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, const char *name, +KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *tqparent, const char *name, KDialogBase *dialog ) -: QObject( parent, "docinfodlg" ) +: TQObject( tqparent, "docinfodlg" ) { d = new KoDocumentInfoDlgPrivate; d->m_info = docInfo; @@ -94,14 +94,14 @@ KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, d->m_dialog = new KDialogBase( KDialogBase::Tabbed, i18n( "Document Information" ), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name, true, false ); - d->m_dialog->setInitialSize( QSize( 500, 500 ) ); + KDialogBase::Ok, tqparent, name, true, false ); + d->m_dialog->setInitialSize( TQSize( 500, 500 ) ); d->m_bDeleteDialog = true; } - QStringList pages = docInfo->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = docInfo->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); for (; it != end; ++it ) { KoDocumentInfoPage *pg = docInfo->page( *it ); @@ -174,24 +174,24 @@ void KoDocumentInfoDlg::loadFromKABC() void KoDocumentInfoDlg::deleteInfo() { - d->m_authorWidget->leFullName->setText( QString::null ); - d->m_authorWidget->leInitial->setText( QString::null ); - d->m_authorWidget->leAuthorTitle->setText( QString::null ); - d->m_authorWidget->leCompany->setText( QString::null ); - d->m_authorWidget->leEmail->setText( QString::null ); - d->m_authorWidget->leTelephoneHome->setText( QString::null ); - d->m_authorWidget->leTelephoneWork->setText( QString::null ); - d->m_authorWidget->leFax->setText( QString::null ); - d->m_authorWidget->leCountry->setText( QString::null ); - d->m_authorWidget->lePostalCode->setText( QString::null ); - d->m_authorWidget->leCity->setText( QString::null ); - d->m_authorWidget->leStreet->setText( QString::null ); + d->m_authorWidget->leFullName->setText( TQString() ); + d->m_authorWidget->leInitial->setText( TQString() ); + d->m_authorWidget->leAuthorTitle->setText( TQString() ); + d->m_authorWidget->leCompany->setText( TQString() ); + d->m_authorWidget->leEmail->setText( TQString() ); + d->m_authorWidget->leTelephoneHome->setText( TQString() ); + d->m_authorWidget->leTelephoneWork->setText( TQString() ); + d->m_authorWidget->leFax->setText( TQString() ); + d->m_authorWidget->leCountry->setText( TQString() ); + d->m_authorWidget->lePostalCode->setText( TQString() ); + d->m_authorWidget->leCity->setText( TQString() ); + d->m_authorWidget->leStreet->setText( TQString() ); emit changed(); } void KoDocumentInfoDlg::resetMetaData() { - QString s = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime() ); + TQString s = KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime() ); d->m_aboutWidget->labelCreated->setText( s + ", " + d->m_info->creator() ); d->m_aboutWidget->labelModified->setText( "" ); d->m_aboutWidget->labelRevision->setText( "0" ); @@ -200,11 +200,11 @@ void KoDocumentInfoDlg::resetMetaData() void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); d->m_authorWidget = new KoDocumentInfoAuthorWidget( page ); d->m_authorWidget->labelAuthor->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 48 ) ); - d->m_authorWidget->pbLoadKABC->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); - d->m_authorWidget->pbDelete->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); + d->m_authorWidget->pbLoadKABC->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); + d->m_authorWidget->pbDelete->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); d->m_authorWidget->leFullName->setText( authorInfo->fullName() ); d->m_authorWidget->leInitial->setText( authorInfo->initial() ); @@ -220,53 +220,53 @@ void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) d->m_authorWidget->leStreet->setText( authorInfo->street() ); d->m_authorWidget->leAuthorPosition->setText( authorInfo->position() ); - connect( d->m_authorWidget->leFullName, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leInitial, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCompany, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leEmail, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneWork, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneHome, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leFax, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCountry, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->lePostalCode, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCity, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leStreet, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorPosition, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->pbLoadKABC, SIGNAL( clicked() ), - this, SLOT( loadFromKABC() ) ); - connect( d->m_authorWidget->pbDelete, SIGNAL( clicked() ), - this, SLOT( deleteInfo() ) ); + connect( d->m_authorWidget->leFullName, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leInitial, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCompany, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leEmail, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneWork, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneHome, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leFax, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCountry, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->lePostalCode, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCity, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leStreet, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorPosition, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->pbLoadKABC, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( loadFromKABC() ) ); + connect( d->m_authorWidget->pbDelete, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( deleteInfo() ) ); } void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); d->m_aboutWidget = new KoDocumentInfoAboutWidget( page ); - d->m_aboutWidget->pbReset->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); - KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->parent() ); + d->m_aboutWidget->pbReset->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); + KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->tqparent() ); if ( doc ) { d->m_aboutWidget->leDocFile->setText( doc->file() ); d->m_aboutWidget->labelType->setText( KMimeType::mimeType( doc->mimeType() )->comment() ); d->m_aboutWidget->pixmapLabel->setPixmap( KMimeType::mimeType( doc->mimeType() )->pixmap( KIcon::Desktop, 48 ) ); } - if ( aboutInfo->creationDate() != QString::null ) + if ( aboutInfo->creationDate() != TQString() ) d->m_aboutWidget->labelCreated->setText( aboutInfo->creationDate() + ", " + aboutInfo->initialCreator() ); - if ( aboutInfo->modificationDate() != QString::null ) + if ( aboutInfo->modificationDate() != TQString() ) d->m_aboutWidget->labelModified->setText( aboutInfo->modificationDate() + ", " + d->m_info->creator() ); d->m_aboutWidget->labelRevision->setText( aboutInfo->editingCycles() ); d->m_aboutWidget->leDocTitle->setText( aboutInfo->title() ); @@ -274,33 +274,33 @@ void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) d->m_aboutWidget->leDocKeywords->setText( aboutInfo->keywords() ); d->m_aboutWidget->meDocAbstract->setText( aboutInfo->abstract() ); - connect( d->m_aboutWidget->leDocTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->meDocAbstract, SIGNAL( textChanged() ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocSubject, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocKeywords, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - aboutInfo, SLOT( resetMetaData() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - this, SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->leDocTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->meDocAbstract, TQT_SIGNAL( textChanged() ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocSubject, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocKeywords, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + aboutInfo, TQT_SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( resetMetaData() ) ); } void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMetadataInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); d->m_metaWidget = new KoDocumentInfoUserMetadataWidget( page ); d->m_metaWidget->metaListView->addColumn( "Name" ); d->m_metaWidget->metaListView->setFullWidth( true ); - QMap::iterator it; + TQMap::iterator it; for ( it = userMetadataInfo->metadataList()->begin(); it != userMetadataInfo->metadataList()->end(); ++it ) { - QString name = it.key(); - QString value = it.data(); + TQString name = it.key(); + TQString value = it.data(); KListViewItem* it = new KListViewItem( d->m_metaWidget->metaListView, name, value ); it->setPixmap( 0, KGlobal::iconLoader()->loadIcon( "text", KIcon::Small ) ); } @@ -308,9 +308,9 @@ void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMet void KoDocumentInfoDlg::save() { - QStringList pages = d->m_info->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = d->m_info->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); bool saveInfo=false; for (; it != end; ++it ) { @@ -385,7 +385,7 @@ public: KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, const char *, - const QStringList & ) + const TQStringList & ) : KPropsDlgPlugin( props ) { d = new KoDocumentInfoPropsPagePrivate; @@ -416,18 +416,18 @@ KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, { d->m_docInfoFile = static_cast( entry ); - QBuffer buffer( d->m_docInfoFile->data() ); + TQBuffer buffer( d->m_docInfoFile->data() ); buffer.open( IO_ReadOnly ); - QDomDocument doc; + TQDomDocument doc; doc.setContent( &buffer ); d->m_info->load( doc ); } d->m_dlg = new KoDocumentInfoDlg( d->m_info, 0, 0, props ); - connect( d->m_dlg, SIGNAL( changed() ), - this, SIGNAL( changed() ) ); + connect( d->m_dlg, TQT_SIGNAL( changed() ), + this, TQT_SIGNAL( changed() ) ); } KoDocumentInfoPropsPage::~KoDocumentInfoPropsPage() @@ -447,10 +447,10 @@ void KoDocumentInfoPropsPage::applyChanges() struct stat statBuff; - if ( stat( QFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) + if ( stat( TQFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) return; - KTempFile tempFile( d->m_url.path(), QString::null, statBuff.st_mode ); + KTempFile tempFile( d->m_url.path(), TQString(), statBuff.st_mode ); tempFile.setAutoDelete( true ); @@ -468,7 +468,7 @@ void KoDocumentInfoPropsPage::applyChanges() KMimeType::Ptr mimeType = KMimeType::findByURL( d->m_url, 0, true ); if ( mimeType && dynamic_cast( d->m_dst->device() ) != 0 ) { - QCString appIdentification( "KOffice " ); // We are limited in the number of chars. + TQCString appIdentification( "KOffice " ); // We are limited in the number of chars. appIdentification += mimeType->name().latin1(); appIdentification += '\004'; // Two magic bytes to make the identification appIdentification += '\006'; // more reliable (DF) @@ -477,9 +477,9 @@ void KoDocumentInfoPropsPage::applyChanges() bool docInfoSaved = false; - QStringList entries = root->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = root->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) { const KTarEntry *entry = root->entry( *it ); @@ -487,13 +487,13 @@ void KoDocumentInfoPropsPage::applyChanges() assert( entry ); if ( entry->name() == "documentinfo.xml" || - ( !docInfoSaved && !entries.contains( "documentinfo.xml" ) ) ) + ( !docInfoSaved && !entries.tqcontains( "documentinfo.xml" ) ) ) { d->m_dlg->save(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream str( &buffer ); + TQTextStream str( &buffer ); str << d->m_info->save(); buffer.close(); @@ -504,19 +504,19 @@ void KoDocumentInfoPropsPage::applyChanges() docInfoSaved = true; } else - copy( QString::null, entry ); + copy( TQString(), entry ); } d->m_dst->close(); - QDir dir; + TQDir dir; dir.rename( tempFile.name(), d->m_url.path() ); delete d->m_dst; d->m_dst = 0; } -void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *entry ) +void KoDocumentInfoPropsPage::copy( const TQString &path, const KArchiveEntry *entry ) { kdDebug( 30003 ) << "copy " << entry->name() << endl; if ( entry->isFile() ) @@ -534,16 +534,16 @@ void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *en kdDebug( 30003 ) << "dir : " << entry->name() << endl; kdDebug( 30003 ) << "full path is: " << path << entry->name() << endl; - QString p = path + entry->name(); + TQString p = path + entry->name(); if ( p != "/" ) { d->m_dst->writeDir( p, entry->user(), entry->group() ); p.append( "/" ); } - QStringList entries = dir->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = dir->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) copy( p, dir->entry( *it ) ); } diff --git a/lib/kofficecore/KoDocumentInfoDlg.h b/lib/kofficecore/KoDocumentInfoDlg.h index d3e1e9a3..d346c4c1 100644 --- a/lib/kofficecore/KoDocumentInfoDlg.h +++ b/lib/kofficecore/KoDocumentInfoDlg.h @@ -32,11 +32,12 @@ class KoDocumentInfoAbout; class KoDocumentInfoUserMetadata; class KArchiveEntry; -class KOFFICECORE_EXPORT KoDocumentInfoDlg : public QObject +class KOFFICECORE_EXPORT KoDocumentInfoDlg : public TQObject { Q_OBJECT + TQ_OBJECT public: - KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent = 0, const char *name = 0, + KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *tqparent = 0, const char *name = 0, KDialogBase *dialog = 0 ); virtual ~KoDocumentInfoDlg(); @@ -69,15 +70,16 @@ private: class KOFFICECORE_EXPORT KoDocumentInfoPropsPage : public KPropsDlgPlugin { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoPropsPage( KPropertiesDialog *props, const char *name = 0, - const QStringList & = QStringList() ); + const TQStringList & = TQStringList() ); virtual ~KoDocumentInfoPropsPage(); virtual void applyChanges(); private: - void copy( const QString &path, const KArchiveEntry *entry ); + void copy( const TQString &path, const KArchiveEntry *entry ); class KoDocumentInfoPropsPagePrivate; KoDocumentInfoPropsPagePrivate *d; }; diff --git a/lib/kofficecore/KoDocument_p.h b/lib/kofficecore/KoDocument_p.h index 1b21f69a..5ad03317 100644 --- a/lib/kofficecore/KoDocument_p.h +++ b/lib/kofficecore/KoDocument_p.h @@ -30,6 +30,7 @@ class KoDocument; class KoBrowserExtension : public KParts::BrowserExtension { Q_OBJECT + TQ_OBJECT public: KoBrowserExtension( KoDocument * doc, const char * name = 0 ); diff --git a/lib/kofficecore/KoDom.cpp b/lib/kofficecore/KoDom.cpp index 45b00acd..72151c10 100644 --- a/lib/kofficecore/KoDom.cpp +++ b/lib/kofficecore/KoDom.cpp @@ -19,12 +19,12 @@ #include "KoDom.h" -QDomElement KoDom::namedItemNS( const QDomNode& node, const char* nsURI, const char* localName ) +TQDomElement KoDom::namedItemNS( const TQDomNode& node, const char* nsURI, const char* localName ) { - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if ( n.isElement() && n.localName() == localName && n.namespaceURI() == nsURI ) return n.toElement(); } - return QDomElement(); + return TQDomElement(); } diff --git a/lib/kofficecore/KoDom.h b/lib/kofficecore/KoDom.h index 4d95a42b..688110f0 100644 --- a/lib/kofficecore/KoDom.h +++ b/lib/kofficecore/KoDom.h @@ -20,28 +20,28 @@ #ifndef KODOM_H #define KODOM_H -#include +#include #include /** - * This namespace contains a few convenience functions to simplify code using QDom + * This namespace contains a few convenience functions to simplify code using TQDom * (when loading OASIS documents, in particular). * * To find the child element with a given name, use KoDom::namedItemNS. * * To find all child elements with a given name, use - * QDomElement e; - * forEachElement( e, parent ) + * TQDomElement e; + * forEachElement( e, tqparent ) * { * if ( e.localName() == "..." && e.namespaceURI() == KoXmlNS::... ) * { * ... * } * } - * Note that this means you don't ever need to use QDomNode nor toElement anymore! + * Note that this means you don't ever need to use TQDomNode nor toElement anymore! * Also note that localName is the part without the prefix, this is the whole point * of namespace-aware methods. * - * To find the attribute with a given name, use QDomElement::attributeNS. + * To find the attribute with a given name, use TQDomElement::attributeNS. * * Do not use getElementsByTagNameNS, it's recursive (which is never needed in KOffice). * Do not use tagName() or nodeName() or prefix(), since the prefix isn't fixed. @@ -51,19 +51,19 @@ namespace KoDom { /** - * A namespace-aware version of QDomNode::namedItem(), - * which also takes care of casting to a QDomElement. + * A namespace-aware version of TQDomNode::namedItem(), + * which also takes care of casting to a TQDomElement. * Use this when a domelement is known to have only *one* child element * with a given tagname. * * Note: do *NOT* use getElementsByTagNameNS, it's recursive! */ - KOFFICECORE_EXPORT QDomElement namedItemNS( const QDomNode& node, const char* nsURI, const char* localName ); + KOFFICECORE_EXPORT TQDomElement namedItemNS( const TQDomNode& node, const char* nsURI, const char* localName ); } -#define forEachElement( elem, parent ) \ - for ( QDomNode _node = parent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) \ +#define forEachElement( elem, tqparent ) \ + for ( TQDomNode _node = tqparent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) \ if ( !( elem = _node.toElement() ).isNull() ) #endif /* KODOM_H */ diff --git a/lib/kofficecore/KoFactory.cpp b/lib/kofficecore/KoFactory.cpp index d858e8e9..9e6a4a18 100644 --- a/lib/kofficecore/KoFactory.cpp +++ b/lib/kofficecore/KoFactory.cpp @@ -31,8 +31,8 @@ public: } }; -KoFactory::KoFactory( QObject *parent, const char *name ) - : KParts::Factory( parent, name ) +KoFactory::KoFactory( TQObject *tqparent, const char *name ) + : KParts::Factory( tqparent, name ) { //d = new KoFactoryPrivate; } diff --git a/lib/kofficecore/KoFactory.h b/lib/kofficecore/KoFactory.h index bcc77439..e0d6b2b7 100644 --- a/lib/kofficecore/KoFactory.h +++ b/lib/kofficecore/KoFactory.h @@ -27,8 +27,9 @@ class KInstance; class KOFFICECORE_EXPORT KoFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: - KoFactory( QObject *parent = 0, const char *name = 0 ); + KoFactory( TQObject *tqparent = 0, const char *name = 0 ); virtual ~KoFactory(); private: diff --git a/lib/kofficecore/KoFileDialog.cpp b/lib/kofficecore/KoFileDialog.cpp index b80c23e0..9f581a4e 100644 --- a/lib/kofficecore/KoFileDialog.cpp +++ b/lib/kofficecore/KoFileDialog.cpp @@ -25,13 +25,13 @@ #include #include -KoFileDialog::KoFileDialog(const QString& startDir, const QString& filter, - QWidget *parent, const char *name, +KoFileDialog::KoFileDialog(const TQString& startDir, const TQString& filter, + TQWidget *tqparent, const char *name, bool modal) - : KFileDialog( startDir, filter, parent, name, modal ) + : KFileDialog( startDir, filter, tqparent, name, modal ) { - connect( filterWidget, SIGNAL( activated( int) ), - this, SLOT( slotChangedfilter( int ) ) ); + connect( filterWidget, TQT_SIGNAL( activated( int) ), + this, TQT_SLOT( slotChangedfilter( int ) ) ); } void KoFileDialog::slotChangedfilter( int index ) @@ -50,9 +50,9 @@ void KoFileDialog::slotChangedfilter( int index ) } } -void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, - const QString& currentFormat, const int specialOutputFlag, - const QString& nativeFormat, +void KoFileDialog::setSpecialMimeFilter( TQStringList& mimeFilter, + const TQString& currentFormat, const int specialOutputFlag, + const TQString& nativeFormat, int supportedSpecialFormats ) { Q_ASSERT( !mimeFilter.isEmpty() ); @@ -77,7 +77,7 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, } // Insert numSpecialEntries entries with native mimetypes, for the special entries. - QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); + TQStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); mimeFilter.insert( mimeFilterIt /* before 1 -> after 0 */, numSpecialEntries, nativeFormat ); // Fill in filter combo @@ -90,9 +90,9 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, int idx = 1; // 0 is the native format if ( addUncompressed ) - filterWidget->changeItem( i18n("%1 (Uncompressed XML Files)").arg( type->comment() ), idx++ ); + filterWidget->changeItem( i18n("%1 (Uncompressed XML Files)").tqarg( type->comment() ), idx++ ); if ( addFlatXML ) - filterWidget->changeItem( i18n("%1 (Flat XML File)").arg( type->comment() ), idx++ ); + filterWidget->changeItem( i18n("%1 (Flat XML File)").tqarg( type->comment() ), idx++ ); // if you add an entry here, update numSpecialEntries above and specialEntrySelected() below // For native format... @@ -107,9 +107,9 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, for (mimeFilterIt = mimeFilter.begin (); mimeFilterIt != mimeFilter.end (); ++mimeFilterIt, i++) { KMimeType::Ptr mime = KMimeType::mimeType (*mimeFilterIt); - QString compatString = mime->property ("X-KDE-CompatibleApplication").toString (); + TQString compatString = mime->property ("X-KDE-CompatibleApplication").toString (); if (!compatString.isEmpty ()) - filterWidget->changeItem (i18n ("%1 (%2 Compatible)").arg (mime->comment ()).arg (compatString), i); + filterWidget->changeItem (i18n ("%1 (%2 Compatible)").tqarg (mime->comment ()).tqarg (compatString), i); } } diff --git a/lib/kofficecore/KoFileDialog.h b/lib/kofficecore/KoFileDialog.h index fc3b61e2..1482bf36 100644 --- a/lib/kofficecore/KoFileDialog.h +++ b/lib/kofficecore/KoFileDialog.h @@ -22,7 +22,7 @@ #define KOFILEDIALOG_H #include -#include +#include /** * Extension to KFileDialog in order to add special entries to the filter combo, @@ -35,13 +35,14 @@ class KoFileDialog : public KFileDialog { Q_OBJECT + TQ_OBJECT public: - KoFileDialog( const QString& startDir, const QString& filter, - QWidget *parent, const char *name, + KoFileDialog( const TQString& startDir, const TQString& filter, + TQWidget *tqparent, const char *name, bool modal ); - void setSpecialMimeFilter( QStringList& mimeFilter, - const QString& currentFormat, const int specialOutputFlag, - const QString& nativeFormat, + void setSpecialMimeFilter( TQStringList& mimeFilter, + const TQString& currentFormat, const int specialOutputFlag, + const TQString& nativeFormat, int supportedSpecialFormats ); int specialEntrySelected(); @@ -49,7 +50,7 @@ private slots: void slotChangedfilter( int index ); private: - QValueVector m_specialFormats; + TQValueVector m_specialFormats; }; #endif /* KOFILEDIALOG_H */ diff --git a/lib/kofficecore/KoFilter.cpp b/lib/kofficecore/KoFilter.cpp index 5b1d4898..ba37191c 100644 --- a/lib/kofficecore/KoFilter.cpp +++ b/lib/kofficecore/KoFilter.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include @@ -28,7 +28,7 @@ #include -KoFilter::KoFilter() : QObject( 0, 0 ), m_chain( 0 ) +KoFilter::KoFilter() : TQObject( 0, 0 ), m_chain( 0 ) { } @@ -49,12 +49,12 @@ int KoEmbeddingFilter::lruPartIndex() const return m_partStack.top()->m_lruPartIndex; } -QString KoEmbeddingFilter::mimeTypeByExtension( const QString& extension ) +TQString KoEmbeddingFilter::mimeTypeByExtension( const TQString& extension ) { // We need to resort to an ugly hack to determine the mimetype // from the extension, as kservicetypefactory.h isn't installed KURL url; - url.setPath( QString( "dummy.%1" ).arg( extension ) ); + url.setPath( TQString( "dummy.%1" ).tqarg( extension ) ); KMimeType::Ptr m( KMimeType::findByURL( url, 0, true, true ) ); return m->name(); } @@ -64,31 +64,31 @@ KoEmbeddingFilter::KoEmbeddingFilter() : KoFilter() m_partStack.push( new PartState() ); } -int KoEmbeddingFilter::embedPart( const QCString& from, QCString& to, - KoFilter::ConversionStatus& status, const QString& key ) +int KoEmbeddingFilter::embedPart( const TQCString& from, TQCString& to, + KoFilter::ConversiontqStatus& status, const TQString& key ) { ++( m_partStack.top()->m_lruPartIndex ); KTempFile tempIn; tempIn.setAutoDelete( true ); - savePartContents( tempIn.file() ); + savePartContents( TQT_TQIODEVICE(tempIn.file()) ); tempIn.file()->close(); KoFilterManager *manager = new KoFilterManager( tempIn.name(), from, m_chain ); - status = manager->exp0rt( QString::null, to ); + status = manager->exp0rt( TQString(), to ); delete manager; // Add the part to the current "stack frame", using the number as key // if the key string is empty PartReference ref( lruPartIndex(), to ); - m_partStack.top()->m_partReferences.insert( key.isEmpty() ? QString::number( lruPartIndex() ) : key, ref ); + m_partStack.top()->m_partReferences.insert( key.isEmpty() ? TQString::number( lruPartIndex() ) : key, ref ); return lruPartIndex(); } -void KoEmbeddingFilter::startInternalEmbedding( const QString& key, const QCString& mimeType ) +void KoEmbeddingFilter::startInternalEmbedding( const TQString& key, const TQCString& mimeType ) { - filterChainEnterDirectory( QString::number( ++( m_partStack.top()->m_lruPartIndex ) ) ); + filterChainEnterDirectory( TQString::number( ++( m_partStack.top()->m_lruPartIndex ) ) ); PartReference ref( lruPartIndex(), mimeType ); m_partStack.top()->m_partReferences.insert( key, ref ); m_partStack.push( new PartState() ); @@ -104,23 +104,23 @@ void KoEmbeddingFilter::endInternalEmbedding() filterChainLeaveDirectory(); } -int KoEmbeddingFilter::internalPartReference( const QString& key ) const +int KoEmbeddingFilter::internalPartReference( const TQString& key ) const { - QMapConstIterator it = m_partStack.top()->m_partReferences.find( key ); + TQMapConstIterator it = m_partStack.top()->m_partReferences.tqfind( key ); if ( it == m_partStack.top()->m_partReferences.end() ) return -1; return it.data().m_index; } -QCString KoEmbeddingFilter::internalPartMimeType( const QString& key ) const +TQCString KoEmbeddingFilter::internalPartMimeType( const TQString& key ) const { - QMapConstIterator it = m_partStack.top()->m_partReferences.find( key ); + TQMapConstIterator it = m_partStack.top()->m_partReferences.tqfind( key ); if ( it == m_partStack.top()->m_partReferences.end() ) - return QCString(); + return TQCString(); return it.data().m_mimeType; } -KoEmbeddingFilter::PartReference::PartReference( int index, const QCString& mimeType ) : +KoEmbeddingFilter::PartReference::PartReference( int index, const TQCString& mimeType ) : m_index( index ), m_mimeType( mimeType ) { } @@ -134,11 +134,11 @@ KoEmbeddingFilter::PartState::PartState() : m_lruPartIndex( 0 ) { } -void KoEmbeddingFilter::savePartContents( QIODevice* ) +void KoEmbeddingFilter::savePartContents( TQIODevice* ) { } -void KoEmbeddingFilter::filterChainEnterDirectory( const QString& directory ) const +void KoEmbeddingFilter::filterChainEnterDirectory( const TQString& directory ) const { m_chain->enterDirectory( directory ); } diff --git a/lib/kofficecore/KoFilter.h b/lib/kofficecore/KoFilter.h index 9d82a34f..0f087252 100644 --- a/lib/kofficecore/KoFilter.h +++ b/lib/kofficecore/KoFilter.h @@ -20,11 +20,11 @@ #ifndef __koffice_filter_h__ #define __koffice_filter_h__ -#include -#include -#include +#include +#include +#include #include -class QIODevice; +class TQIODevice; class KoFilterChain; /** @@ -32,6 +32,7 @@ class KoFilterChain; * * Derive your filter class from this base class and implement * the @ref convert() method. Don't forget to specify the Q_OBJECT + TQ_OBJECT * macro in your class even if you don't use signals or slots. * This is needed as filters are created on the fly. * The m_chain member allows access to the @ref KoFilterChain @@ -45,9 +46,10 @@ class KoFilterChain; * @author Werner Trobin * @todo the class has no constructor and therefore cannot initialize its private class */ -class KOFFICECORE_EXPORT KoFilter : public QObject +class KOFFICECORE_EXPORT KoFilter : public TQObject { Q_OBJECT + TQ_OBJECT friend class KoFilterEntry; // needed for the filter chain pointer :( friend class KoFilterChain; @@ -59,7 +61,7 @@ public: * Feel free to add some more error conditions @em before the last item * if it's needed. */ - enum ConversionStatus { OK, StupidError, UsageError, CreationError, FileNotFound, + enum ConversiontqStatus { OK, StupidError, UsageError, CreationError, FileNotFound, StorageCreationError, BadMimeType, BadConversionGraph, EmbeddedDocError, WrongFormat, NotImplemented, ParsingError, InternalError, UnexpectedEOF, @@ -77,10 +79,10 @@ public: * * @param from The mimetype of the source file/document * @param to The mimetype of the destination file/document - * @return The error status, see the @ref #ConversionStatus enum. + * @return The error status, see the @ref #ConversiontqStatus enum. * KoFilter::OK means that everything is alright. */ - virtual ConversionStatus convert( const QCString& from, const QCString& to ) = 0; + virtual ConversiontqStatus convert( const TQCString& from, const TQCString& to ) = 0; signals: /** @@ -133,7 +135,7 @@ private: * @ref #endInternalEmbedding accordingly. Try to use the previous method if possible. * * If you're using this class you can also setup a signal/slot communication - * between parent and child filter. To make that work you simply have to define + * between tqparent and child filter. To make that work you simply have to define * signals and slots along the following rules: * Signals should be named "commSignal\" where \ is the name of the signal, * slots should be named "commSlot\". The connection will be done automatically @@ -145,6 +147,7 @@ private: class KOFFICECORE_EXPORT KoEmbeddingFilter : public KoFilter { Q_OBJECT + TQ_OBJECT friend class KoFilterChain; @@ -167,7 +170,7 @@ public: * and so on. Note that you should only pass the pure extension * and not a whole pattern like "*.doc" or so. */ - static QString mimeTypeByExtension( const QString& extension ); + static TQString mimeTypeByExtension( const TQString& extension ); protected: /** @@ -197,9 +200,9 @@ protected: * @return The number of the part (can be used to refer to the part from * within the embedding filter). */ - int embedPart( const QCString& from, QCString& to, - KoFilter::ConversionStatus& status, - const QString& key = QString::null ); + int embedPart( const TQCString& from, TQCString& to, + KoFilter::ConversiontqStatus& status, + const TQString& key = TQString() ); /** * Method to perform "internal" embedding of parts in olefilter-style. @@ -211,7 +214,7 @@ protected: * @param key The key we use to store reference/mimetype of your new part * @param mimeType The mimetype of the part you're about to embed */ - void startInternalEmbedding( const QString& key, const QCString& mimeType ); + void startInternalEmbedding( const TQString& key, const TQCString& mimeType ); /** * This method signals the end of an internal embedding session. @@ -230,7 +233,7 @@ protected: * @return The reference or -1 if we didn't find a part with the * given key */ - int internalPartReference( const QString& key ) const; + int internalPartReference( const TQString& key ) const; /** * Query the internal part map for the mimetype of the part @@ -240,7 +243,7 @@ protected: * @return The mimetype, might be empty if the part matching * the given key doesn't exist. */ - QCString internalPartMimeType( const QString& key ) const; + TQCString internalPartMimeType( const TQString& key ) const; private: /** @@ -250,16 +253,16 @@ private: */ struct PartReference { - PartReference( int index = -1, const QCString& mimeType = "" ); + PartReference( int index = -1, const TQCString& mimeType = "" ); bool isValid() const; int m_index; - QCString m_mimeType; + TQCString m_mimeType; }; /** * This struct keeps track of the last used index for a - * child part and all references to existing children + * child part and all references to existing tqchildren * We use it to build a whole stack, one PartState per * embedding level. * @internal @@ -269,7 +272,7 @@ private: PartState(); int m_lruPartIndex; - QMap m_partReferences; + TQMap m_partReferences; }; /// Better do not copy the filters @@ -287,14 +290,14 @@ private: * * @param file An already opened file */ - virtual void savePartContents( QIODevice* file ); + virtual void savePartContents( TQIODevice* file ); /** * Internal methods to support the start/endInternalEmbedding * methods (we have to change directories and stuff). * These methods are declared friends of the KoFilterChain */ - void filterChainEnterDirectory( const QString& directory ) const; + void filterChainEnterDirectory( const TQString& directory ) const; /** * Internal methods to support the start/endInternalEmbedding * methods (we have to change directories and stuff). @@ -306,7 +309,7 @@ private: * A stack which keeps track of the current part references. * We push one PartState structure for every embedding level. */ - QPtrStack m_partStack; + TQPtrStack m_partStack; class Private; Private* d; diff --git a/lib/kofficecore/KoFilterChain.cpp b/lib/kofficecore/KoFilterChain.cpp index 2ab53780..ecade093 100644 --- a/lib/kofficecore/KoFilterChain.cpp +++ b/lib/kofficecore/KoFilterChain.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include @@ -40,13 +40,13 @@ namespace { KoFilterChain::ChainLink::ChainLink( KoFilterChain* chain, KoFilterEntry::Ptr filterEntry, - const QCString& from, const QCString& to ) : + const TQCString& from, const TQCString& to ) : m_chain( chain ), m_filterEntry( filterEntry ), m_from( from ), m_to( to ), m_filter( 0 ), d( 0 ) { } -KoFilter::ConversionStatus KoFilterChain::ChainLink::invokeFilter( const ChainLink* const parentChainLink ) +KoFilter::ConversiontqStatus KoFilterChain::ChainLink::invokeFilter( const ChainLink* const tqparentChainLink ) { if ( !m_filterEntry ) { kdError( 30500 ) << "This filter entry is null. Strange stuff going on." << endl; @@ -60,10 +60,10 @@ KoFilter::ConversionStatus KoFilterChain::ChainLink::invokeFilter( const ChainLi return KoFilter::CreationError; } - if ( parentChainLink ) - setupCommunication( parentChainLink->m_filter ); + if ( tqparentChainLink ) + setupCommunication( tqparentChainLink->m_filter ); - KoFilter::ConversionStatus status = m_filter->convert( m_from, m_to ); + KoFilter::ConversiontqStatus status = m_filter->convert( m_from, m_to ); delete m_filter; m_filter=0; return status; @@ -81,41 +81,41 @@ int KoFilterChain::ChainLink::lruPartIndex() const return -1; } -void KoFilterChain::ChainLink::setupCommunication( const KoFilter* const parentFilter ) const +void KoFilterChain::ChainLink::setupCommunication( const KoFilter* const tqparentFilter ) const { // progress information - QObject::connect( m_filter, SIGNAL( sigProgress( int ) ), - m_chain->manager(), SIGNAL( sigProgress( int ) ) ); + TQObject::connect( m_filter, TQT_SIGNAL( sigProgress( int ) ), + m_chain->manager(), TQT_SIGNAL( sigProgress( int ) ) ); - if ( !parentFilter ) + if ( !tqparentFilter ) return; - const QMetaObject* const parent = parentFilter->metaObject(); - const QMetaObject* const child = m_filter->metaObject(); - if ( !parent || !child ) + const TQMetaObject* const tqparent = tqparentFilter->tqmetaObject(); + const TQMetaObject* const child = m_filter->tqmetaObject(); + if ( !tqparent || !child ) return; - setupConnections( parentFilter, parent->signalNames(), m_filter, child->slotNames() ); - setupConnections( m_filter, child->signalNames(), parentFilter, parent->slotNames() ); + setupConnections( tqparentFilter, tqparent->signalNames(), m_filter, child->slotNames() ); + setupConnections( m_filter, child->signalNames(), tqparentFilter, tqparent->slotNames() ); } -void KoFilterChain::ChainLink::setupConnections( const KoFilter* sender, const QStrList& sigs, - const KoFilter* receiver, const QStrList& sl0ts ) const +void KoFilterChain::ChainLink::setupConnections( const KoFilter* sender, const TQStrList& sigs, + const KoFilter* receiver, const TQStrList& sl0ts ) const { - QStrListIterator signalIt( sigs ); + TQStrListIterator signalIt( sigs ); for ( ; signalIt.current(); ++signalIt ) { if ( strncmp( signalIt.current(), SIGNAL_PREFIX, SIGNAL_PREFIX_LEN ) == 0 ) { - QStrListIterator slotIt( sl0ts ); + TQStrListIterator slotIt( sl0ts ); for ( ; slotIt.current(); ++slotIt ) { if ( strncmp( slotIt.current(), SLOT_PREFIX, SLOT_PREFIX_LEN ) == 0 ) { if ( strcmp( signalIt.current() + SIGNAL_PREFIX_LEN, slotIt.current() + SLOT_PREFIX_LEN ) == 0 ) { - QCString signalString; - signalString.setNum( QSIGNAL_CODE ); + TQCString signalString; + signalString.setNum( TQSIGNAL_CODE ); signalString += signalIt.current(); - QCString slotString; - slotString.setNum( QSLOT_CODE ); + TQCString slotString; + slotString.setNum( TQSLOT_CODE ); slotString += slotIt.current(); - QObject::connect( sender, signalString, receiver, slotString ); + TQObject::connect( sender, signalString, receiver, slotString ); } } } @@ -131,23 +131,23 @@ KoFilterChain::~KoFilterChain() manageIO(); // Called for the 2nd time in a row -> clean up } -KoFilter::ConversionStatus KoFilterChain::invokeChain() +KoFilter::ConversiontqStatus KoFilterChain::invokeChain() { - KoFilter::ConversionStatus status = KoFilter::OK; + KoFilter::ConversiontqStatus status = KoFilter::OK; m_state = Beginning; int count = m_chainLinks.count(); // This is needed due to nasty Microsoft design - const ChainLink* parentChainLink = 0; + const ChainLink* tqparentChainLink = 0; if ( filterManagerParentChain() ) - parentChainLink = filterManagerParentChain()->m_chainLinks.current(); + tqparentChainLink = filterManagerParentChain()->m_chainLinks.current(); // No iterator here, as we need m_chainLinks.current() in outputDocument() m_chainLinks.first(); for ( ; count > 1 && m_chainLinks.current() && status == KoFilter::OK; m_chainLinks.next(), --count ) { - status = m_chainLinks.current()->invokeFilter( parentChainLink ); + status = m_chainLinks.current()->invokeFilter( tqparentChainLink ); m_state = Middle; manageIO(); } @@ -162,7 +162,7 @@ KoFilter::ConversionStatus KoFilterChain::invokeChain() m_state |= End; else m_state = End; - status = m_chainLinks.current()->invokeFilter( parentChainLink ); + status = m_chainLinks.current()->invokeFilter( tqparentChainLink ); manageIO(); } @@ -172,20 +172,20 @@ KoFilter::ConversionStatus KoFilterChain::invokeChain() return status; } -QString KoFilterChain::chainOutput() const +TQString KoFilterChain::chainOutput() const { if ( m_state == Done ) return m_inputFile; // as we already called manageIO() - return QString::null; + return TQString(); } -QString KoFilterChain::inputFile() +TQString KoFilterChain::inputFile() { if ( m_inputQueried == File ) return m_inputFile; else if ( m_inputQueried != Nil ) { kdWarning( 30500 ) << "You already asked for some different source." << endl; - return QString::null; + return TQString(); } m_inputQueried = File; @@ -198,12 +198,12 @@ QString KoFilterChain::inputFile() } else if ( m_inputFile.isEmpty() ) - inputFileHelper( m_inputDocument, QString::null ); + inputFileHelper( m_inputDocument, TQString() ); return m_inputFile; } -QString KoFilterChain::outputFile() +TQString KoFilterChain::outputFile() { // sanity check: No embedded filter should ask for a plain file // ###### CHECK: This will break as soon as we support exporting embedding filters @@ -214,7 +214,7 @@ QString KoFilterChain::outputFile() return m_outputFile; else if ( m_outputQueried != Nil ) { kdWarning( 30500 ) << "You already asked for some different destination." << endl; - return QString::null; + return TQString(); } m_outputQueried = File; @@ -231,7 +231,7 @@ QString KoFilterChain::outputFile() return m_outputFile; } -KoStoreDevice* KoFilterChain::storageFile( const QString& name, KoStore::Mode mode ) +KoStoreDevice* KoFilterChain::storageFile( const TQString& name, KoStore::Mode mode ) { // ###### CHECK: This works only for import filters. Do we want something like // that for export filters too? @@ -308,7 +308,7 @@ KoDocument* KoFilterChain::outputDocument() void KoFilterChain::dump() const { kdDebug( 30500 ) << "########## KoFilterChain with " << m_chainLinks.count() << " members:" << endl; - QPtrListIterator it( m_chainLinks ); + TQPtrListIterator it( m_chainLinks ); for ( ; it.current(); ++it ) it.current()->dump(); kdDebug( 30500 ) << "########## KoFilterChain (done) ##########" << endl; @@ -324,17 +324,17 @@ KoFilterChain::KoFilterChain( const KoFilterManager* manager ) : m_chainLinks.setAutoDelete( true ); } -void KoFilterChain::appendChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ) +void KoFilterChain::appendChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ) { m_chainLinks.append( new ChainLink( this, filterEntry, from, to ) ); } -void KoFilterChain::prependChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ) +void KoFilterChain::prependChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ) { m_chainLinks.prepend( new ChainLink( this, filterEntry, from, to ) ); } -void KoFilterChain::enterDirectory( const QString& directory ) +void KoFilterChain::enterDirectory( const TQString& directory ) { // Only a little bit of checking as we (have to :} ) trust KoEmbeddingFilter // If the output storage isn't initialized yet, we perform that step(s) on init. @@ -351,12 +351,12 @@ void KoFilterChain::leaveDirectory() m_internalEmbeddingDirectories.pop_back(); } -QString KoFilterChain::filterManagerImportFile() const +TQString KoFilterChain::filterManagerImportFile() const { return m_manager->importFile(); } -QString KoFilterChain::filterManagerExportFile() const +TQString KoFilterChain::filterManagerExportFile() const { return m_manager->exportFile(); } @@ -373,7 +373,7 @@ int KoFilterChain::filterManagerDirection() const KoFilterChain* const KoFilterChain::filterManagerParentChain() const { - return m_manager->parentChain(); + return m_manager->tqparentChain(); } void KoFilterChain::manageIO() @@ -393,11 +393,11 @@ void KoFilterChain::manageIO() delete m_inputTempFile; // autodelete m_inputTempFile = 0; } - m_inputFile = QString::null; + m_inputFile = TQString(); if ( !m_outputFile.isEmpty() ) { m_inputFile = m_outputFile; - m_outputFile = QString::null; + m_outputFile = TQString(); m_inputTempFile = m_outputTempFile; m_outputTempFile = 0; @@ -406,7 +406,7 @@ void KoFilterChain::manageIO() if ( m_outputStorage ) { m_outputStorage->close(); // Don't delete the storage if we're just pointing to the - // storage of the parent filter chain + // storage of the tqparent filter chain if ( !filterManagerParentChain() || m_outputStorage->mode() != KoStore::Write ) delete m_outputStorage; m_outputStorage = 0; @@ -444,19 +444,19 @@ bool KoFilterChain::createTempFile( KTempFile** tempFile, bool autoDelete ) return ( *tempFile )->status() == 0; } -void KoFilterChain::inputFileHelper( KoDocument* document, const QString& alternativeFile ) +void KoFilterChain::inputFileHelper( KoDocument* document, const TQString& alternativeFile ) { if ( document ) { if ( !createTempFile( &m_inputTempFile ) ) { delete m_inputTempFile; m_inputTempFile = 0; - m_inputFile = QString::null; + m_inputFile = TQString(); return; } if ( !document->saveNativeFormat( m_inputTempFile->name() ) ) { delete m_inputTempFile; m_inputTempFile = 0; - m_inputFile = QString::null; + m_inputFile = TQString(); return; } m_inputFile = m_inputTempFile->name(); @@ -470,14 +470,14 @@ void KoFilterChain::outputFileHelper( bool autoDelete ) if ( !createTempFile( &m_outputTempFile, autoDelete ) ) { delete m_outputTempFile; m_outputTempFile = 0; - m_outputFile = QString::null; + m_outputFile = TQString(); } else m_outputFile = m_outputTempFile->name(); } KoStoreDevice* KoFilterChain::storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, - const QString& name ) + const TQString& name ) { delete *device; *device = 0; @@ -492,7 +492,7 @@ KoStoreDevice* KoFilterChain::storageNewStreamHelper( KoStore** storage, KoStore return *device; } -KoStoreDevice* KoFilterChain::storageHelper( const QString& file, const QString& streamName, +KoStoreDevice* KoFilterChain::storageHelper( const TQString& file, const TQString& streamName, KoStore::Mode mode, KoStore** storage, KoStoreDevice** device ) { @@ -519,9 +519,9 @@ KoStoreDevice* KoFilterChain::storageHelper( const QString& file, const QString& return storageCreateFirstStream( streamName, storage, device ); } -void KoFilterChain::storageInit( const QString& file, KoStore::Mode mode, KoStore** storage ) +void KoFilterChain::storageInit( const TQString& file, KoStore::Mode mode, KoStore** storage ) { - QCString appIdentification( "" ); + TQCString appIdentification( "" ); if ( mode == KoStore::Write ) { // To create valid storages we also have to add the mimetype // magic "applicationIndentifier" to the storage. @@ -534,7 +534,7 @@ void KoFilterChain::storageInit( const QString& file, KoStore::Mode mode, KoStor *storage = KoStore::createStore( file, mode, appIdentification ); } -KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) +KoStoreDevice* KoFilterChain::storageInitEmbedding( const TQString& name ) { if ( m_outputStorage ) { kdWarning( 30500 ) << "Ooops! Something's really screwed here." << endl; @@ -544,7 +544,7 @@ KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) m_outputStorage = filterManagerParentChain()->m_outputStorage; if ( !m_outputStorage ) { - // If the storage of the parent hasn't been initialized yet, + // If the storage of the tqparent hasn't been initialized yet, // we have to do that here. Quite nasty... storageInit( filterManagerParentChain()->outputFile(), KoStore::Write, &m_outputStorage ); @@ -568,21 +568,21 @@ KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) return storageCleanupHelper( &m_outputStorage ); } - if ( !m_outputStorage->enterDirectory( QString( "part%1" ).arg( lruPartIndex ) ) ) + if ( !m_outputStorage->enterDirectory( TQString( "part%1" ).tqarg( lruPartIndex ) ) ) return storageCleanupHelper( &m_outputStorage ); return storageCreateFirstStream( name, &m_outputStorage, &m_outputStorageDevice ); } -KoStoreDevice* KoFilterChain::storageCreateFirstStream( const QString& streamName, KoStore** storage, +KoStoreDevice* KoFilterChain::storageCreateFirstStream( const TQString& streamName, KoStore** storage, KoStoreDevice** device ) { // Before we go and create the first stream in this storage we // have to perform a little hack in case we're used by any ole-style // filter which utilizes internal embedding. Ugly, but well... if ( !m_internalEmbeddingDirectories.isEmpty() ) { - QStringList::ConstIterator it = m_internalEmbeddingDirectories.begin(); - QStringList::ConstIterator end = m_internalEmbeddingDirectories.end(); + TQStringList::ConstIterator it = m_internalEmbeddingDirectories.begin(); + TQStringList::ConstIterator end = m_internalEmbeddingDirectories.end(); for ( ; it != end && ( *storage )->enterDirectory( *it ); ++it ); } @@ -600,7 +600,7 @@ KoStoreDevice* KoFilterChain::storageCreateFirstStream( const QString& streamNam KoStoreDevice* KoFilterChain::storageCleanupHelper( KoStore** storage ) { - // Take care not to delete the storage of the parent chain + // Take care not to delete the storage of the tqparent chain if ( *storage != m_outputStorage || !filterManagerParentChain() || ( *storage )->mode() != KoStore::Write ) delete *storage; @@ -608,7 +608,7 @@ KoStoreDevice* KoFilterChain::storageCleanupHelper( KoStore** storage ) return 0; } -KoDocument* KoFilterChain::createDocument( const QString& file ) +KoDocument* KoFilterChain::createDocument( const TQString& file ) { KURL url; url.setPath( file ); @@ -618,7 +618,7 @@ KoDocument* KoFilterChain::createDocument( const QString& file ) return 0; } - KoDocument *doc = createDocument( QCString( t->name().latin1() ) ); + KoDocument *doc = createDocument( TQCString( t->name().latin1() ) ); if ( !doc || !doc->loadNativeFormat( file ) ) { kdError( 30500 ) << "Couldn't load from the file" << endl; @@ -628,7 +628,7 @@ KoDocument* KoFilterChain::createDocument( const QString& file ) return doc; } -KoDocument* KoFilterChain::createDocument( const QCString& mimeType ) +KoDocument* KoFilterChain::createDocument( const TQCString& mimeType ) { KoDocumentEntry entry = KoDocumentEntry::queryByMimeType(mimeType); @@ -663,7 +663,7 @@ namespace KOffice { } } - void Edge::dump( const QCString& indent ) const + void Edge::dump( const TQCString& indent ) const { if ( m_vertex ) kdDebug( 30500 ) << indent << "Edge -> '" << m_vertex->mimeType() @@ -674,7 +674,7 @@ namespace KOffice { } - Vertex::Vertex( const QCString& mimeType ) : m_predecessor( 0 ), m_mimeType( mimeType ), + Vertex::Vertex( const TQCString& mimeType ) : m_predecessor( 0 ), m_mimeType( mimeType ), m_weight( UINT_MAX ), m_index( -1 ), d( 0 ) { m_edges.setAutoDelete( true ); // we take ownership of added edges @@ -707,7 +707,7 @@ namespace KOffice { if ( !vertex ) return 0; const Edge* edge = 0; - QPtrListIterator it( m_edges ); + TQPtrListIterator it( m_edges ); for ( ; it.current(); ++it ) { if ( it.current()->vertex() == vertex && @@ -723,17 +723,17 @@ namespace KOffice { e->relax( this, queue ); } - void Vertex::dump( const QCString& indent ) const + void Vertex::dump( const TQCString& indent ) const { kdDebug( 30500 ) << indent << "Vertex: " << m_mimeType << " (" << m_weight << "):" << endl; - const QCString i( indent + " " ); - QPtrListIterator it( m_edges ); + const TQCString i( indent + " " ); + TQPtrListIterator it( m_edges ); for ( ; it.current(); ++it ) it.current()->dump( i ); } - Graph::Graph( const QCString& from ) : m_vertices( 47 ), m_from( from ), + Graph::Graph( const TQCString& from ) : m_vertices( 47 ), m_from( from ), m_graphValid( false ), d( 0 ) { m_vertices.setAutoDelete( true ); @@ -741,7 +741,7 @@ namespace KOffice { shortestPaths(); // Will return after a single lookup if "from" is invalid (->no check here) } - void Graph::setSourceMimeType( const QCString& from ) + void Graph::setSourceMimeType( const TQCString& from ) { if ( from == m_from ) return; @@ -749,7 +749,7 @@ namespace KOffice { m_graphValid = false; // Initialize with "infinity" ... - QAsciiDictIterator it( m_vertices ); + TQAsciiDictIterator it( m_vertices ); for ( ; it.current(); ++it ) it.current()->reset(); @@ -757,7 +757,7 @@ namespace KOffice { shortestPaths(); } - KoFilterChain::Ptr Graph::chain( const KoFilterManager* manager, QCString& to ) const + KoFilterChain::Ptr Graph::chain( const KoFilterManager* manager, TQCString& to ) const { if ( !isValid() || !manager ) return 0; @@ -790,7 +790,7 @@ namespace KOffice { { kdDebug( 30500 ) << "+++++++++ Graph::dump +++++++++" << endl; kdDebug( 30500 ) << "From: " << m_from << endl; - QAsciiDictIterator it( m_vertices ); + TQAsciiDictIterator it( m_vertices ); for ( ; it.current(); ++it ) it.current()->dump( " " ); kdDebug( 30500 ) << "+++++++++ Graph::dump (done) +++++++++" << endl; @@ -801,31 +801,31 @@ namespace KOffice { void Graph::buildGraph() { // Make sure that all available parts are added to the graph - QValueList parts( KoDocumentEntry::query() ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query() ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) m_vertices.insert( (*it).latin1(), new Vertex( (*it).latin1() ) ); ++partIt; } - QValueList filters( KoFilterEntry::query() ); // no constraint here - we want *all* :) - QValueList::ConstIterator it = filters.begin(); - QValueList::ConstIterator end = filters.end(); + TQValueList filters( KoFilterEntry::query() ); // no constraint here - we want *all* :) + TQValueList::ConstIterator it = filters.begin(); + TQValueList::ConstIterator end = filters.end(); for ( ; it != end; ++it ) { // First add the "starting points" to the dict - QStringList::ConstIterator importIt = ( *it )->import.begin(); - QStringList::ConstIterator importEnd = ( *it )->import.end(); + TQStringList::ConstIterator importIt = ( *it )->import.begin(); + TQStringList::ConstIterator importEnd = ( *it )->import.end(); for ( ; importIt != importEnd; ++importIt ) { - const QCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) + const TQCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) // already there? if ( !m_vertices[ key ] ) m_vertices.insert( key, new Vertex( key ) ); @@ -833,12 +833,12 @@ namespace KOffice { // Are we allowed to use this filter at all? if ( KoFilterManager::filterAvailable( *it ) ) { - QStringList::ConstIterator exportIt = ( *it )->export_.begin(); - QStringList::ConstIterator exportEnd = ( *it )->export_.end(); + TQStringList::ConstIterator exportIt = ( *it )->export_.begin(); + TQStringList::ConstIterator exportEnd = ( *it )->export_.end(); for ( ; exportIt != exportEnd; ++exportIt ) { // First make sure the export vertex is in place - const QCString key = ( *exportIt ).latin1(); // latin1 is okay here + const TQCString key = ( *exportIt ).latin1(); // latin1 is okay here Vertex* exp = m_vertices[ key ]; if ( !exp ) { exp = new Vertex( key ); @@ -886,21 +886,21 @@ namespace KOffice { m_graphValid = true; } - QCString Graph::findKOfficePart() const + TQCString Graph::findKOfficePart() const { // Here we simply try to find the closest KOffice mimetype - QValueList parts( KoDocumentEntry::query() ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query() ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); const Vertex *v = 0; // Be sure that v gets initialized correctly while ( !v && partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !v && it != end; ++it ) if ( !(*it).isEmpty() ) v = m_vertices[ ( *it ).latin1() ]; @@ -911,12 +911,12 @@ namespace KOffice { // Now we try to find the "cheapest" KOffice vertex while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !v && it != end; ++it ) { - QString key = *it; + TQString key = *it; if ( !key.isEmpty() ) { Vertex* tmp = m_vertices[ key.latin1() ]; if ( !v || ( tmp && tmp->key() < v->key() ) ) diff --git a/lib/kofficecore/KoFilterChain.h b/lib/kofficecore/KoFilterChain.h index 5b8dd3dd..2936ae40 100644 --- a/lib/kofficecore/KoFilterChain.h +++ b/lib/kofficecore/KoFilterChain.h @@ -19,10 +19,10 @@ #ifndef __koffice_filter_chain_h__ #define __koffice_filter_chain_h__ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -32,7 +32,7 @@ class KTempFile; class KoFilterManager; class KoDocument; -class QStrList; +class TQStrList; namespace KOffice { class Graph; @@ -69,25 +69,25 @@ public: * @return The return status of the conversion. KoFilter::OK * if everything is alright. */ - KoFilter::ConversionStatus invokeChain(); + KoFilter::ConversiontqStatus invokeChain(); /** * Tells the @ref KoFilterManager the output file of the * filter chain in case of an import operation. If it's - * QString::null we directly manipulated the document. + * TQString() we directly manipulated the document. */ - QString chainOutput() const; + TQString chainOutput() const; /** * Get the current file to read from. This part of the API * is for the filters in our chain. */ - QString inputFile(); + TQString inputFile(); /** * Get the current file to write to. This part of the API * is for the filters in our chain. */ - QString outputFile(); + TQString outputFile(); /** * Get a file from a storage. May return 0! @@ -99,7 +99,7 @@ public: * @param mode Whether we want to read or write from/to the stream * @return The storage device to access the stream. May be 0! */ - KoStoreDevice* storageFile( const QString& name = "root", KoStore::Mode mode = KoStore::Read ); + KoStoreDevice* storageFile( const TQString& name = "root", KoStore::Mode mode = KoStore::Read ); /** * This method allows your filter to work directly on the @@ -123,27 +123,27 @@ public: private: // ### API for KOffice::Graph: // Construct a filter chain belonging to some KoFilterManager. - // The parent filter manager may be 0. + // The tqparent filter manager may be 0. KoFilterChain( const KoFilterManager* manager ); - void appendChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ); - void prependChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ); + void appendChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ); + void prependChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ); // ### API for KoEmbeddingFilter // This is needed as the embedding filter might have to influence // the way we change directories (e.g. in the olefilter case) // The ugly friend methods are needed, but I'd welcome and suggestions for // better design :} - friend void KoEmbeddingFilter::filterChainEnterDirectory( const QString& directory ) const; - void enterDirectory( const QString& directory ); + friend void KoEmbeddingFilter::filterChainEnterDirectory( const TQString& directory ) const; + void enterDirectory( const TQString& directory ); friend void KoEmbeddingFilter::filterChainLeaveDirectory() const; void leaveDirectory(); // These methods are friends of KoFilterManager and provide access // to a private part of its API. As I don't want to include // koFilterManager.h in this header the direction is "int" here. - QString filterManagerImportFile() const; - QString filterManagerExportFile() const; + TQString filterManagerImportFile() const; + TQString filterManagerExportFile() const; KoDocument* filterManagerKoDocument() const; int filterManagerDirection() const; KoFilterChain* const filterManagerParentChain() const; @@ -157,18 +157,18 @@ private: bool createTempFile( KTempFile** tempFile, bool autoDelete = true ); - void inputFileHelper( KoDocument* document, const QString& alternativeFile ); + void inputFileHelper( KoDocument* document, const TQString& alternativeFile ); void outputFileHelper( bool autoDelete ); - KoStoreDevice* storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, const QString& name ); - KoStoreDevice* storageHelper( const QString& file, const QString& streamName, + KoStoreDevice* storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, const TQString& name ); + KoStoreDevice* storageHelper( const TQString& file, const TQString& streamName, KoStore::Mode mode, KoStore** storage, KoStoreDevice** device ); - void storageInit( const QString& file, KoStore::Mode mode, KoStore** storage ); - KoStoreDevice* storageInitEmbedding( const QString& name ); - KoStoreDevice* storageCreateFirstStream( const QString& streamName, KoStore** storage, KoStoreDevice** device ); + void storageInit( const TQString& file, KoStore::Mode mode, KoStore** storage ); + KoStoreDevice* storageInitEmbedding( const TQString& name ); + KoStoreDevice* storageCreateFirstStream( const TQString& streamName, KoStore** storage, KoStoreDevice** device ); KoStoreDevice* storageCleanupHelper( KoStore** storage ); - KoDocument* createDocument( const QString& file ); - KoDocument* createDocument( const QCString& mimeType ); + KoDocument* createDocument( const TQString& file ); + KoDocument* createDocument( const TQCString& mimeType ); /** * A small private helper class with represents one single filter @@ -180,12 +180,12 @@ private: public: ChainLink( KoFilterChain* chain, KoFilterEntry::Ptr filterEntry, - const QCString& from, const QCString& to ); + const TQCString& from, const TQCString& to ); - KoFilter::ConversionStatus invokeFilter( const ChainLink* const parentChainLink ); + KoFilter::ConversiontqStatus invokeFilter( const ChainLink* const tqparentChainLink ); - QCString from() const { return m_from; } - QCString to() const { return m_to; } + TQCString from() const { return m_from; } + TQCString to() const { return m_to; } // debugging void dump() const; @@ -198,13 +198,13 @@ private: ChainLink( const ChainLink& rhs ); ChainLink& operator=( const ChainLink& rhs ); - void setupCommunication( const KoFilter* const parentFilter ) const; - void setupConnections( const KoFilter* sender, const QStrList& sigs, - const KoFilter* receiver, const QStrList& sl0ts ) const; + void setupCommunication( const KoFilter* const tqparentFilter ) const; + void setupConnections( const KoFilter* sender, const TQStrList& sigs, + const KoFilter* receiver, const TQStrList& sl0ts ) const; KoFilterChain* m_chain; KoFilterEntry::Ptr m_filterEntry; - QCString m_from, m_to; + TQCString m_from, m_to; // This hack is only needed due to crappy Microsoft design and // circular dependencies in their embedded files :} @@ -223,13 +223,13 @@ private: KoFilterChain& operator=( const KoFilterChain& rhs ); const KoFilterManager* const m_manager; - QPtrList m_chainLinks; + TQPtrList m_chainLinks; // stuff needed for bookkeeping int m_state; - QString m_inputFile; // Did we pass around plain files? - QString m_outputFile; + TQString m_inputFile; // Did we pass around plain files? + TQString m_outputFile; KoStore* m_inputStorage; // ...or was it a storage+device? KoStoreDevice* m_inputStorageDevice; @@ -252,7 +252,7 @@ private: // as a kind of "memory" even if we didn't initialize the store yet. // I know that it's ugly, and I'll try to clean up that hack // sooner or later (Werner) - QStringList m_internalEmbeddingDirectories; + TQStringList m_internalEmbeddingDirectories; class Private; Private* d; @@ -289,7 +289,7 @@ namespace KOffice void relax( const Vertex* predecessor, PriorityQueue& queue ); // debugging - void dump( const QCString& indent ) const; + void dump( const TQCString& indent ) const; private: Edge( const Edge& rhs ); @@ -311,10 +311,10 @@ namespace KOffice { public: - Vertex( const QCString& mimeType ); + Vertex( const TQCString& mimeType ); ~Vertex() {} - QCString mimeType() const { return m_mimeType; } + TQCString mimeType() const { return m_mimeType; } // Current "weight" of the vertex - will be "relaxed" when // running the shortest path algorithm. Returns true if it @@ -345,15 +345,15 @@ namespace KOffice void relaxVertices( PriorityQueue& queue ); // debugging - void dump( const QCString& indent ) const; + void dump( const TQCString& indent ) const; private: Vertex( const Vertex& rhs ); Vertex& operator=( const Vertex& rhs ); - QPtrList m_edges; + TQPtrList m_edges; const Vertex* m_predecessor; - QCString m_mimeType; + TQCString m_mimeType; unsigned int m_weight; // "key" inside the queue int m_index; // position inside the queue, needed for a fast keyDecreased() @@ -371,20 +371,20 @@ namespace KOffice { public: - Graph( const QCString& from ); + Graph( const TQCString& from ); ~Graph() {} bool isValid() const { return m_graphValid; } - QCString sourceMimeType() const { return m_from; } - void setSourceMimeType( const QCString& from ); + TQCString sourceMimeType() const { return m_from; } + void setSourceMimeType( const TQCString& from ); // Creates a chain from "from" to the "to" mimetype // If the "to" mimetype isEmpty() then we try to find the // closest KOffice mimetype and use that as destination. // After such a search "to" will contain the dest. mimetype (return value) // if the search was successful. Might return 0! - KoFilterChain::Ptr chain( const KoFilterManager* manager, QCString& to ) const; + KoFilterChain::Ptr chain( const KoFilterManager* manager, TQCString& to ) const; // debugging void dump() const; @@ -395,10 +395,10 @@ namespace KOffice void buildGraph(); void shortestPaths(); - QCString findKOfficePart() const; + TQCString findKOfficePart() const; - QAsciiDict m_vertices; - QCString m_from; + TQAsciiDict m_vertices; + TQCString m_from; bool m_graphValid; class Private; diff --git a/lib/kofficecore/KoFilterManager.cpp b/lib/kofficecore/KoFilterManager.cpp index f3db5c73..46c20c2f 100644 --- a/lib/kofficecore/KoFilterManager.cpp +++ b/lib/kofficecore/KoFilterManager.cpp @@ -23,11 +23,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,27 +48,27 @@ public: }; -KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, const QString &nativeFormat) - : KDialogBase (parent, "kofilterchooser", true, i18n ("Choose Filter"), +KoFilterChooser::KoFilterChooser (TQWidget *tqparent, const TQStringList &mimeTypes, const TQString &nativeFormat) + : KDialogBase (tqparent, "kofilterchooser", true, i18n ("Choose Filter"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true), m_mimeTypes (mimeTypes) { - setInitialSize (QSize (300, 350)); + setInitialSize (TQSize (300, 350)); - QWidget *page = new QWidget (this); + TQWidget *page = new TQWidget (this); setMainWidget (page); // looks too squashed together without * 2 - QVBoxLayout *layout = new QVBoxLayout (page, marginHint (), spacingHint () * 2); + TQVBoxLayout *tqlayout = new TQVBoxLayout (page, marginHint (), spacingHint () * 2); - QLabel *filterLabel = new QLabel (i18n ("Select a filter:"), page, "filterlabel"); - layout->addWidget (filterLabel); + TQLabel *filterLabel = new TQLabel (i18n ("Select a filter:"), page, "filterlabel"); + tqlayout->addWidget (filterLabel); m_filterList = new KListBox (page, "filterlist"); - layout->addWidget (m_filterList); + tqlayout->addWidget (m_filterList); Q_ASSERT (!m_mimeTypes.isEmpty ()); - for (QStringList::ConstIterator it = m_mimeTypes.begin (); + for (TQStringList::ConstIterator it = m_mimeTypes.begin (); it != m_mimeTypes.end (); it++) { @@ -78,7 +78,7 @@ KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, if (nativeFormat == "application/x-kword") { - const int index = m_mimeTypes.findIndex ("text/plain"); + const int index = m_mimeTypes.tqfindIndex ("text/plain"); if (index > -1) m_filterList->setCurrentItem (index); } @@ -89,26 +89,26 @@ KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, m_filterList->centerCurrentItem (); m_filterList->setFocus (); - connect (m_filterList, SIGNAL (selected (int)), this, SLOT (slotOk ())); + connect (m_filterList, TQT_SIGNAL (selected (int)), this, TQT_SLOT (slotOk ())); } KoFilterChooser::~KoFilterChooser () { } -QString KoFilterChooser::filterSelected () +TQString KoFilterChooser::filterSelected () { const int item = m_filterList->currentItem (); if (item > -1) return m_mimeTypes [item]; else - return QString::null; + return TQString(); } // static cache for filter availability -QMap KoFilterManager::m_filterAvailable; +TQMap KoFilterManager::m_filterAvailable; const int KoFilterManager::s_area = 30500; @@ -119,14 +119,14 @@ KoFilterManager::KoFilterManager( KoDocument* document ) : d = new KoFilterManager::Private; d -> m_batch = false; if ( document ) - QObject::connect( this, SIGNAL( sigProgress( int ) ), - document, SIGNAL( sigProgress( int ) ) ); + TQObject::connect( this, TQT_SIGNAL( sigProgress( int ) ), + document, TQT_SIGNAL( sigProgress( int ) ) ); } -KoFilterManager::KoFilterManager( const QString& url, const QCString& mimetypeHint, - KoFilterChain* const parentChain ) : - m_document( 0 ), m_parentChain( parentChain ), m_importUrl( url ), m_importUrlMimetypeHint( mimetypeHint ), +KoFilterManager::KoFilterManager( const TQString& url, const TQCString& mimetypeHint, + KoFilterChain* const tqparentChain ) : + m_document( 0 ), m_parentChain( tqparentChain ), m_importUrl( url ), m_importUrlMimetypeHint( mimetypeHint ), m_graph( "" ), d( 0 ) { d = new KoFilterManager::Private; @@ -138,7 +138,7 @@ KoFilterManager::~KoFilterManager() delete d; } -QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& status ) +TQString KoFilterManager::import( const TQString& url, KoFilter::ConversiontqStatus& status ) { // Find the mime type for the file to be imported. KURL u; @@ -155,22 +155,22 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& if ( !m_document->isAutoErrorHandlingEnabled() ) { status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } - QCString nativeFormat = m_document->nativeFormatMimeType (); + TQCString nativeFormat = m_document->nativeFormatMimeType (); - QApplication::setOverrideCursor( arrowCursor ); + TQApplication::setOverrideCursor( arrowCursor ); KoFilterChooser chooser(0, KoFilterManager::mimeFilter (nativeFormat, KoFilterManager::Import, m_document->extraNativeMimeTypes()), nativeFormat); if (chooser.exec ()) { - QCString f = chooser.filterSelected ().latin1(); + TQCString f = chooser.filterSelected ().latin1(); if (f == nativeFormat) { status = KoFilter::OK; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return url; } @@ -178,7 +178,7 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& } else userCancelled = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } if (!m_graph.isValid()) @@ -187,15 +187,15 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& << t->name() << endl; importErrorHelper( t->name(), userCancelled ); status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } } KoFilterChain::Ptr chain( 0 ); // Are we owned by a KoDocument? if ( m_document ) { - QCString mimeType = m_document->nativeFormatMimeType(); - QStringList extraMimes = m_document->extraNativeMimeTypes(); + TQCString mimeType = m_document->nativeFormatMimeType(); + TQStringList extraMimes = m_document->extraNativeMimeTypes(); int i=0, n = extraMimes.count(); chain = m_graph.chain( this, mimeType ); while( !chain && iname() ); status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } // Okay, let's invoke the filters one after the other m_direction = Import; // vital information! m_importUrl = url; // We want to load that file - m_exportUrl = QString::null; // This is null for sure, as embedded stuff isn't + m_exportUrl = TQString(); // This is null for sure, as embedded stuff isn't // allowed to use that method status = chain->invokeChain(); - m_importUrl = QString::null; // Reset the import URL + m_importUrl = TQString(); // Reset the import URL if ( status == KoFilter::OK ) return chain->chainOutput(); - return QString::null; + return TQString(); } -KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString& mimeType ) +KoFilter::ConversiontqStatus KoFilterManager::exp0rt( const TQString& url, TQCString& mimeType ) { bool userCancelled = false; @@ -243,11 +243,11 @@ KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString KoFilterChain::Ptr chain = 0; if ( m_document ) { // We have to pick the right native mimetype as source. - QStringList nativeMimeTypes; + TQStringList nativeMimeTypes; nativeMimeTypes.append( m_document->nativeFormatMimeType() ); nativeMimeTypes += m_document->extraNativeMimeTypes(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !chain && it != end; ++it ) { m_graph.setSourceMimeType( (*it).latin1() ); @@ -272,14 +272,14 @@ KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString if ( !m_graph.isValid() ) { kdWarning(s_area) << "Can't open " << t->name () << ", trying filter chooser" << endl; - QApplication::setOverrideCursor( arrowCursor ); + TQApplication::setOverrideCursor( arrowCursor ); KoFilterChooser chooser(0, KoFilterManager::mimeFilter ()); if (chooser.exec ()) m_graph.setSourceMimeType (chooser.filterSelected ().latin1 ()); else userCancelled = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } } @@ -308,28 +308,28 @@ namespace // in order not to mess with the global namespace ;) class Vertex { public: - Vertex( const QCString& mimeType ) : m_color( White ), m_mimeType( mimeType ) {} + Vertex( const TQCString& mimeType ) : m_color( White ), m_mimeType( mimeType ) {} enum Color { White, Gray, Black }; Color color() const { return m_color; } void setColor( Color color ) { m_color = color; } - QCString mimeType() const { return m_mimeType; } + TQCString mimeType() const { return m_mimeType; } void addEdge( Vertex* vertex ) { if ( vertex ) m_edges.append( vertex ); } - QPtrList edges() const { return m_edges; } + TQPtrList edges() const { return m_edges; } private: Color m_color; - QCString m_mimeType; - QPtrList m_edges; + TQCString m_mimeType; + TQPtrList m_edges; }; // Some helper methods for the static stuff // This method builds up the graph in the passed ascii dict - void buildGraph( QAsciiDict& vertices, KoFilterManager::Direction direction ) + void buildGraph( TQAsciiDict& vertices, KoFilterManager::Direction direction ) { - QStringList stopList; // Lists of mimetypes that are considered end of chains + TQStringList stopList; // Lists of mimetypes that are considered end of chains stopList << "text/plain"; stopList << "text/csv"; stopList << "text/x-tex"; @@ -339,38 +339,38 @@ namespace // in order not to mess with the global namespace ;) // partly copied from build graph, but I don't see any other // way without crude hacks, as we have to obey the direction here - QValueList parts( KoDocumentEntry::query(false, QString::null) ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query(false, TQString()) ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) vertices.insert( (*it).latin1(), new Vertex( (*it).latin1() ) ); ++partIt; } - QValueList filters = KoFilterEntry::query(); // no constraint here - we want *all* :) - QValueList::ConstIterator it = filters.begin(); - const QValueList::ConstIterator end = filters.end(); + TQValueList filters = KoFilterEntry::query(); // no constraint here - we want *all* :) + TQValueList::ConstIterator it = filters.begin(); + const TQValueList::ConstIterator end = filters.end(); for ( ; it != end; ++it ) { - QStringList impList; // Import list - QStringList expList; // Export list + TQStringList impList; // Import list + TQStringList expList; // Export list - const QStringList::Iterator stopEnd = stopList.end(); + const TQStringList::Iterator stopEnd = stopList.end(); // Now we have to exclude the "stop" mimetypes (in the right direction!) if ( direction == KoFilterManager::Import ) { // Import: "stop" mime type should not appear in export - QStringList::ConstIterator testIt = ( *it )->export_.begin(); - QStringList::ConstIterator testEnd = ( *it )->export_.end(); + TQStringList::ConstIterator testIt = ( *it )->export_.begin(); + TQStringList::ConstIterator testEnd = ( *it )->export_.end(); for ( ; testIt != testEnd ; ++testIt ) { - if ( stopList.find( *testIt ) == stopEnd ) { + if ( stopList.tqfind( *testIt ) == stopEnd ) { expList.append( *testIt ); } } @@ -378,10 +378,10 @@ namespace // in order not to mess with the global namespace ;) } else { // Export: "stop" mime type should not appear in import - QStringList::ConstIterator testIt = ( *it )->import.begin(); - const QStringList::ConstIterator testEnd = ( *it )->import.end(); + TQStringList::ConstIterator testIt = ( *it )->import.begin(); + const TQStringList::ConstIterator testEnd = ( *it )->import.end(); for ( ; testIt != testEnd ; ++testIt ) { - if ( stopList.find( *testIt ) == stopEnd ) { + if ( stopList.tqfind( *testIt ) == stopEnd ) { impList.append( *testIt ); } } @@ -396,10 +396,10 @@ namespace // in order not to mess with the global namespace ;) } // First add the "starting points" to the dict - QStringList::ConstIterator importIt = impList.begin(); - const QStringList::ConstIterator importEnd = impList.end(); + TQStringList::ConstIterator importIt = impList.begin(); + const TQStringList::ConstIterator importEnd = impList.end(); for ( ; importIt != importEnd; ++importIt ) { - const QCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) + const TQCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) // already there? if ( !vertices[ key ] ) vertices.insert( key, new Vertex( key ) ); @@ -407,12 +407,12 @@ namespace // in order not to mess with the global namespace ;) // Are we allowed to use this filter at all? if ( KoFilterManager::filterAvailable( *it ) ) { - QStringList::ConstIterator exportIt = expList.begin(); - const QStringList::ConstIterator exportEnd = expList.end(); + TQStringList::ConstIterator exportIt = expList.begin(); + const TQStringList::ConstIterator exportEnd = expList.end(); for ( ; exportIt != exportEnd; ++exportIt ) { // First make sure the export vertex is in place - const QCString key = ( *exportIt ).latin1(); // latin1 is okay here + const TQCString key = ( *exportIt ).latin1(); // latin1 is okay here Vertex* exp = vertices[ key ]; if ( !exp ) { exp = new Vertex( key ); @@ -440,24 +440,24 @@ namespace // in order not to mess with the global namespace ;) // This method runs a BFS on the graph to determine the connected // nodes. Make sure that the graph is "cleared" (the colors of the // nodes are all white) - QStringList connected( const QAsciiDict& vertices, const QCString& mimetype ) + TQStringList connected( const TQAsciiDict& vertices, const TQCString& mimetype ) { if ( mimetype.isEmpty() ) - return QStringList(); + return TQStringList(); Vertex *v = vertices[ mimetype ]; if ( !v ) - return QStringList(); + return TQStringList(); v->setColor( Vertex::Gray ); std::queue queue; queue.push( v ); - QStringList connected; + TQStringList connected; while ( !queue.empty() ) { v = queue.front(); queue.pop(); - QPtrList edges = v->edges(); - QPtrListIterator it( edges ); + TQPtrList edges = v->edges(); + TQPtrListIterator it( edges ); for ( ; it.current(); ++it ) { if ( it.current()->color() == Vertex::White ) { it.current()->setColor( Vertex::Gray ); @@ -473,45 +473,45 @@ namespace // in order not to mess with the global namespace ;) // The static method to figure out to which parts of the // graph this mimetype has a connection to. -QStringList KoFilterManager::mimeFilter( const QCString& mimetype, Direction direction, const QStringList& extraNativeMimeTypes ) +TQStringList KoFilterManager::mimeFilter( const TQCString& mimetype, Direction direction, const TQStringList& extraNativeMimeTypes ) { //kdDebug(s_area) << "mimetype=" << mimetype << " extraNativeMimeTypes=" << extraNativeMimeTypes << endl; - QAsciiDict vertices; + TQAsciiDict vertices; buildGraph( vertices, direction ); // TODO maybe use the fake vertex trick from the method below, to make the search faster? - QStringList nativeMimeTypes; - nativeMimeTypes.append( QString::fromLatin1( mimetype ) ); + TQStringList nativeMimeTypes; + nativeMimeTypes.append( TQString::tqfromLatin1( mimetype ) ); nativeMimeTypes += extraNativeMimeTypes; // Add the native mimetypes first so that they are on top. - QStringList lst = nativeMimeTypes; + TQStringList lst = nativeMimeTypes; // Now look for filters which output each of those natives mimetypes - for( QStringList::ConstIterator natit = nativeMimeTypes.begin(); natit != nativeMimeTypes.end(); ++natit ) { - const QStringList outMimes = connected( vertices, (*natit).latin1() ); + for( TQStringList::ConstIterator natit = nativeMimeTypes.begin(); natit != nativeMimeTypes.end(); ++natit ) { + const TQStringList outMimes = connected( vertices, (*natit).latin1() ); //kdDebug(s_area) << k_funcinfo << "output formats connected to mime " << *natit << " : " << outMimes << endl; - for ( QStringList::ConstIterator mit = outMimes.begin(); mit != outMimes.end(); ++mit ) - if ( lst.find( *mit ) == lst.end() ) // append only if not there already. Qt4: QSet? + for ( TQStringList::ConstIterator mit = outMimes.begin(); mit != outMimes.end(); ++mit ) + if ( lst.tqfind( *mit ) == lst.end() ) // append only if not there already. TQt4: TQSet? lst.append( *mit ); } return lst; } -QStringList KoFilterManager::mimeFilter() +TQStringList KoFilterManager::mimeFilter() { - QAsciiDict vertices; + TQAsciiDict vertices; buildGraph( vertices, KoFilterManager::Import ); - QValueList parts( KoDocumentEntry::query(false, QString::null) ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query(false, TQString()) ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); if ( partIt == partEnd ) - return QStringList(); + return TQStringList(); - // To find *all* reachable mimetypes, we have to resort to + // To tqfind *all* reachable mimetypes, we have to resort to // a small hat trick, in order to avoid multiple searches: // We introduce a fake vertex, which is connected to every // single KOffice mimetype. Due to that one BFS is enough :) @@ -519,16 +519,16 @@ QStringList KoFilterManager::mimeFilter() Vertex *v = new Vertex( "supercalifragilistic/x-pialadocious" ); vertices.insert( "supercalifragilistic/x-pialadocious", v ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) v->addEdge( vertices[ (*it).latin1() ] ); ++partIt; } - QStringList result = connected( vertices, "supercalifragilistic/x-pialadocious" ); + TQStringList result = connected( vertices, "supercalifragilistic/x-pialadocious" ); // Finally we have to get rid of our fake mimetype again result.remove( "supercalifragilistic/x-pialadocious" ); @@ -546,14 +546,14 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) //kdDebug( 30500 ) << "Checking whether " << entry->service()->name() << " applies." << endl; // generate some "unique" key - QString key( entry->service()->name() ); + TQString key( entry->service()->name() ); key += " - "; key += entry->service()->library(); - if ( !m_filterAvailable.contains( key ) ) { + if ( !m_filterAvailable.tqcontains( key ) ) { //kdDebug( 30500 ) << "Not cached, checking..." << endl; - KLibrary* library = KLibLoader::self()->library( QFile::encodeName( entry->service()->library() ) ); + KLibrary* library = KLibLoader::self()->library( TQFile::encodeName( entry->service()->library() ) ); if ( !library ) { kdWarning( 30500 ) << "Huh?? Couldn't load the lib: " << KLibLoader::self()->lastErrorMessage() << endl; @@ -562,7 +562,7 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) } // This code is "borrowed" from klibloader ;) - QCString symname; + TQCString symname; symname.sprintf("check_%s", library->name().latin1() ); void* sym = library->symbol( symname ); if ( !sym ) @@ -581,9 +581,9 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) return m_filterAvailable[ key ]; } -void KoFilterManager::importErrorHelper( const QString& mimeType, const bool suppressDialog ) +void KoFilterManager::importErrorHelper( const TQString& mimeType, const bool suppressDialog ) { - QString tmp = i18n("Could not import file of type\n%1").arg( mimeType ); + TQString tmp = i18n("Could not import file of type\n%1").tqarg( mimeType ); // ###### FIXME: use KLibLoader::lastErrorMessage() here if (!suppressDialog) KMessageBox::error( 0L, tmp, i18n("Missing Import Filter") ); } diff --git a/lib/kofficecore/KoFilterManager.h b/lib/kofficecore/KoFilterManager.h index 952c8475..8405f49b 100644 --- a/lib/kofficecore/KoFilterManager.h +++ b/lib/kofficecore/KoFilterManager.h @@ -22,8 +22,8 @@ #ifndef __koffice_filter_manager_h__ #define __koffice_filter_manager_h__ -#include -#include +#include +#include #include #include class KoDocument; @@ -41,9 +41,10 @@ class KoDocument; * @author Torben Weis * @author Werner Trobin */ -class KOFFICECORE_EXPORT KoFilterManager : public QObject +class KOFFICECORE_EXPORT KoFilterManager : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * This enum is used to distinguish the import/export cases @@ -65,11 +66,11 @@ public: * to specify this information only if the automatic detection will * fail because e.g. you saved an embedded stream to a *.tmp file. * Most likely you do not have to care about that. - * @param parentChain The parent filter chain of this filter manager. Used + * @param tqparentChain The tqparent filter chain of this filter manager. Used * to allow embedding for filters. Most likely you do not have to care. */ - KoFilterManager( const QString& url, const QCString& mimetypeHint = "", - KoFilterChain* const parentChain = 0 ); + KoFilterManager( const TQString& url, const TQCString& mimetypeHint = "", + KoFilterChain* const tqparentChain = 0 ); virtual ~KoFilterManager(); @@ -77,10 +78,10 @@ public: * Imports the passed URL and returns the resultant filename * (most likely some file in /tmp). * The @p status variable signals the success/error of the conversion - * If the QString which is returned isEmpty() and the status is OK, + * If the TQString which is returned isEmpty() and the status is OK, * then we imported the file directly into the document. */ - QString import( const QString& url, KoFilter::ConversionStatus& status ); + TQString import( const TQString& url, KoFilter::ConversiontqStatus& status ); /** * @brief Exports the given file/document to the specified URL/mimetype. * @@ -88,7 +89,7 @@ public: * and when the method returns @p mimeType contains this mimetype. * Oh, well, export is a C++ keyword ;) */ - KoFilter::ConversionStatus exp0rt( const QString& url, QCString& mimeType ); + KoFilter::ConversiontqStatus exp0rt( const TQString& url, TQCString& mimeType ); @@ -100,8 +101,8 @@ public: * information here. * Optionally, @p extraNativeMimeTypes are added after the native mimetype. */ - KOFFICECORE_EXPORT static QStringList mimeFilter( const QCString& mimetype, Direction direction, - const QStringList& extraNativeMimeTypes = QStringList() ); + KOFFICECORE_EXPORT static TQStringList mimeFilter( const TQCString& mimetype, Direction direction, + const TQStringList& extraNativeMimeTypes = TQStringList() ); /** * The same method as KoFilterManager::mimeFilter but suited for KoShell. @@ -110,7 +111,7 @@ public: * call this for importing. When saving from KoShell we already * know the KOffice part we are using. */ - static QStringList mimeFilter(); + static TQStringList mimeFilter(); /** * Method used to check if that filter is available at all. @@ -142,34 +143,34 @@ private: // The friend methods are private in KoFilterChain and // just forward calls to the methods here. Should be // pretty save. - friend QString KoFilterChain::filterManagerImportFile() const; - QString importFile() const { return m_importUrl; } - friend QString KoFilterChain::filterManagerExportFile() const; - QString exportFile() const { return m_exportUrl; } + friend TQString KoFilterChain::filterManagerImportFile() const; + TQString importFile() const { return m_importUrl; } + friend TQString KoFilterChain::filterManagerExportFile() const; + TQString exportFile() const { return m_exportUrl; } friend KoDocument* KoFilterChain::filterManagerKoDocument() const; KoDocument* document() const { return m_document; } friend int KoFilterChain::filterManagerDirection() const; int direction() const { return static_cast( m_direction ); } friend KoFilterChain* const KoFilterChain::filterManagerParentChain() const; - KoFilterChain* const parentChain() const { return m_parentChain; } + KoFilterChain* const tqparentChain() const { return m_parentChain; } // Private API KoFilterManager( const KoFilterManager& rhs ); KoFilterManager &operator=( const KoFilterManager& rhs ); - void importErrorHelper( const QString& mimeType, const bool suppressDialog = false ); + void importErrorHelper( const TQString& mimeType, const bool suppressDialog = false ); static const int s_area; KoDocument* m_document; KoFilterChain* const m_parentChain; - QString m_importUrl, m_exportUrl; - QCString m_importUrlMimetypeHint; ///< suggested mimetype + TQString m_importUrl, m_exportUrl; + TQCString m_importUrlMimetypeHint; ///< suggested mimetype KOffice::Graph m_graph; Direction m_direction; /// A static cache for the availability checks of filters - static QMap m_filterAvailable; + static TQMap m_filterAvailable; class Private; Private *d; diff --git a/lib/kofficecore/KoFilterManager_p.h b/lib/kofficecore/KoFilterManager_p.h index 20c6cac8..358c25cd 100644 --- a/lib/kofficecore/KoFilterManager_p.h +++ b/lib/kofficecore/KoFilterManager_p.h @@ -19,8 +19,8 @@ #ifndef __koFilterManager_p_h__ #define __koFilterManager_p_h__ -#include -#include +#include +#include #include @@ -30,16 +30,17 @@ class KListBox; class KoFilterChooser : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, - const QString &nativeFormat = QString::null); + KoFilterChooser (TQWidget *tqparent, const TQStringList &mimeTypes, + const TQString &nativeFormat = TQString()); ~KoFilterChooser (); - QString filterSelected (); + TQString filterSelected (); private: - QStringList m_mimeTypes; + TQStringList m_mimeTypes; KListBox *m_filterList; }; diff --git a/lib/kofficecore/KoFrame.cpp b/lib/kofficecore/KoFrame.cpp index 4c07d5c1..b6f77b8a 100644 --- a/lib/kofficecore/KoFrame.cpp +++ b/lib/kofficecore/KoFrame.cpp @@ -20,12 +20,12 @@ #include #include -#include +#include #include #include #include -#define QMAX32767(a,b) QMAX(QMAX(32767,a),b) +#define TQMAX32767(a,b) TQMAX(TQMAX(32767,a),b) class KoFramePrivate { @@ -39,8 +39,8 @@ public: KoView *m_view; - QPoint m_mousePressPos; - QPoint m_framePos; + TQPoint m_mousePressPos; + TQPoint m_framePos; int m_width; int m_height; int m_mode; @@ -48,8 +48,8 @@ public: KoFrame::State m_state; }; -KoFrame::KoFrame( QWidget *parent, const char *name ) - : QWidget( parent, name ) +KoFrame::KoFrame( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { d = new KoFramePrivate; d->m_state = Inactive; @@ -97,12 +97,12 @@ void KoFrame::setState( State s ) { /* kdDebug(30003) << "KoFrame::setView setMaximumSize " - << "QMAX32767(" << d->m_view->maximumWidth() + 2 * border() << "," << d->m_view->maximumWidth() << "), " - << "QMAX32767(" << d->m_view->maximumHeight() + 2 * border() << "," << d->m_view->maximumHeight() << ")" + << "TQMAX32767(" << d->m_view->maximumWidth() + 2 * border() << "," << d->m_view->maximumWidth() << "), " + << "TQMAX32767(" << d->m_view->maximumHeight() + 2 * border() << "," << d->m_view->maximumHeight() << ")" << endl; */ - setMaximumSize( QMAX32767( d->m_view->maximumWidth() + 2 * border(), d->m_view->maximumWidth() ), - QMAX32767( d->m_view->maximumHeight() + 2 * border(), d->m_view->maximumHeight() ) ); + setMaximumSize( TQMAX32767( d->m_view->maximumWidth() + 2 * border(), d->m_view->maximumWidth() ), + TQMAX32767( d->m_view->maximumHeight() + 2 * border(), d->m_view->maximumHeight() ) ); setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder(), d->m_view->minimumHeight() + topBorder() + bottomBorder() ); } @@ -183,9 +183,9 @@ int KoFrame::border() const return 5; } -void KoFrame::paintEvent( QPaintEvent* ) +void KoFrame::paintEvent( TQPaintEvent* ) { - QPainter painter; + TQPainter painter; painter.begin( this ); painter.setPen( black ); @@ -206,32 +206,32 @@ void KoFrame::paintEvent( QPaintEvent* ) painter.end(); } -void KoFrame::mousePressEvent( QMouseEvent* ev ) +void KoFrame::mousePressEvent( TQMouseEvent* ev ) { - QRect r1( 0, 0, 5, 5 ); - QRect r2( 0, height() - 5, 5, 5 ); - QRect r3( width() - 5, height() - 5, 5, 5 ); - QRect r4( width() - 5, 0, 5, 5 ); - QRect r5( width() / 2 - 3, 0, 5, 5 ); - QRect r6( width() / 2 - 3, height() - 5, 5, 5 ); - QRect r7( 0, height() / 2 - 3, 5, 5 ); - QRect r8( width()- 5, height() / 2 - 3, 5, 5 ); - - if ( r1.contains( ev->pos() ) ) + TQRect r1( 0, 0, 5, 5 ); + TQRect r2( 0, height() - 5, 5, 5 ); + TQRect r3( width() - 5, height() - 5, 5, 5 ); + TQRect r4( width() - 5, 0, 5, 5 ); + TQRect r5( width() / 2 - 3, 0, 5, 5 ); + TQRect r6( width() / 2 - 3, height() - 5, 5, 5 ); + TQRect r7( 0, height() / 2 - 3, 5, 5 ); + TQRect r8( width()- 5, height() / 2 - 3, 5, 5 ); + + if ( r1.tqcontains( ev->pos() ) ) d->m_mode = 1; - else if ( r2.contains( ev->pos() ) ) + else if ( r2.tqcontains( ev->pos() ) ) d->m_mode = 2; - else if ( r3.contains( ev->pos() ) ) + else if ( r3.tqcontains( ev->pos() ) ) d->m_mode = 3; - else if ( r4.contains( ev->pos() ) ) + else if ( r4.tqcontains( ev->pos() ) ) d->m_mode = 4; - else if ( r5.contains( ev->pos() ) ) + else if ( r5.tqcontains( ev->pos() ) ) d->m_mode = 5; - else if ( r6.contains( ev->pos() ) ) + else if ( r6.tqcontains( ev->pos() ) ) d->m_mode = 6; - else if ( r7.contains( ev->pos() ) ) + else if ( r7.tqcontains( ev->pos() ) ) d->m_mode = 7; - else if ( r8.contains( ev->pos() ) ) + else if ( r8.tqcontains( ev->pos() ) ) d->m_mode = 8; else d->m_mode = 0; @@ -242,98 +242,98 @@ void KoFrame::mousePressEvent( QMouseEvent* ev ) kdDebug(30003) << "---- MODE=" << d->m_mode << endl; d->m_mousePressPos = mapToParent( ev->pos() ); - d->m_framePos = mapToParent( QPoint( 0, 0 ) ); + d->m_framePos = mapToParent( TQPoint( 0, 0 ) ); d->m_width = width(); d->m_height = height(); } -void KoFrame::mouseMoveEvent( QMouseEvent* ev ) +void KoFrame::mouseMoveEvent( TQMouseEvent* ev ) { if ( d->m_mode == 0 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - move( QPoint( p.x() + d->m_framePos.x() - d->m_mousePressPos.x(), + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + move( TQPoint( p.x() + d->m_framePos.x() - d->m_mousePressPos.x(), p.y() + d->m_framePos.y() - d->m_mousePressPos.y() ) ); - // The other modes change the geometry so they call resizeEvent. - // This one doesn't, so it has to emit geometryChangedby itself. - emit geometryChanged(); + // The other modes change the tqgeometry so they call resizeEvent. + // This one doesn't, so it has to emit tqgeometryChangedby itself. + emit tqgeometryChanged(); //kdDebug() << "KoFrame::mouseMoveEvent koFrame position is " << x() << "," << y() << endl; } else if ( d->m_mode == 1 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y() - h + d->m_height, w, h ); } else if ( d->m_mode == 2 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y(), w, h ); } else if ( d->m_mode == 3 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); resize( w, h ); } else if ( d->m_mode == 4 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x(), d->m_framePos.y() - h + d->m_height, w, h ); } else if ( d->m_mode == 5 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x(), d->m_framePos.y() - h + d->m_height, d->m_width, h ); } else if ( d->m_mode == 6 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); resize( d->m_width, h ); } else if ( d->m_mode == 7 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y(), w, d->m_height ); } else if ( d->m_mode == 8 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); resize( w, d->m_height ); } else if ( d->m_state == Selected || d->m_state == Active ) { - QRect r1( 0, 0, 5, 5 ); - QRect r2( 0, height() - 5, 5, 5 ); - QRect r3( width() - 5, height() - 5, 5, 5 ); - QRect r4( width() - 5, 0, 5, 5 ); - QRect r5( width() / 2 - 3, 0, 5, 5 ); - QRect r6( width() / 2 - 3, height() - 5, 5, 5 ); - QRect r7( 0, height() / 2 - 3, 5, 5 ); - QRect r8( width()- 5, height() / 2 - 3, 5, 5 ); - - if ( r1.contains( ev->pos() ) || r3.contains( ev->pos() ) ) + TQRect r1( 0, 0, 5, 5 ); + TQRect r2( 0, height() - 5, 5, 5 ); + TQRect r3( width() - 5, height() - 5, 5, 5 ); + TQRect r4( width() - 5, 0, 5, 5 ); + TQRect r5( width() / 2 - 3, 0, 5, 5 ); + TQRect r6( width() / 2 - 3, height() - 5, 5, 5 ); + TQRect r7( 0, height() / 2 - 3, 5, 5 ); + TQRect r8( width()- 5, height() / 2 - 3, 5, 5 ); + + if ( r1.tqcontains( ev->pos() ) || r3.tqcontains( ev->pos() ) ) setCursor( sizeFDiagCursor ); - else if ( r2.contains( ev->pos() ) || r4.contains( ev->pos() ) ) + else if ( r2.tqcontains( ev->pos() ) || r4.tqcontains( ev->pos() ) ) setCursor( sizeBDiagCursor ); - else if ( r5.contains( ev->pos() ) || r6.contains( ev->pos() ) ) + else if ( r5.tqcontains( ev->pos() ) || r6.tqcontains( ev->pos() ) ) setCursor( sizeVerCursor ); - else if ( r7.contains( ev->pos() ) || r8.contains( ev->pos() ) ) + else if ( r7.tqcontains( ev->pos() ) || r8.tqcontains( ev->pos() ) ) setCursor( sizeHorCursor ); else setCursor( KCursor::handCursor() ); @@ -342,12 +342,12 @@ void KoFrame::mouseMoveEvent( QMouseEvent* ev ) setCursor( KCursor::handCursor() ); } -void KoFrame::mouseReleaseEvent( QMouseEvent* ) +void KoFrame::mouseReleaseEvent( TQMouseEvent* ) { d->m_mode = -1; } -void KoFrame::resizeEvent( QResizeEvent* ) +void KoFrame::resizeEvent( TQResizeEvent* ) { if ( !d->m_view ) return; @@ -357,12 +357,12 @@ void KoFrame::resizeEvent( QResizeEvent* ) else d->m_view->setGeometry( 0, 0, width(), height() ); - emit geometryChanged(); + emit tqgeometryChanged(); } -bool KoFrame::eventFilter( QObject* obj, QEvent* ev ) +bool KoFrame::eventFilter( TQObject* obj, TQEvent* ev ) { - if ( obj == d->m_view && KParts::PartActivateEvent::test( ev ) ) + if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->m_view) && KParts::PartActivateEvent::test( ev ) ) { kdDebug(30003) << "Activate event"<< endl; KParts::PartActivateEvent* e = (KParts::PartActivateEvent*)ev; @@ -374,7 +374,7 @@ bool KoFrame::eventFilter( QObject* obj, QEvent* ev ) setState( Inactive ); } } - else if ( obj == d->m_view && KParts::PartSelectEvent::test( ev ) ) + else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->m_view) && KParts::PartSelectEvent::test( ev ) ) { kdDebug(30003) << "Selected event" << endl; KParts::PartSelectEvent* e = (KParts::PartSelectEvent*)ev; diff --git a/lib/kofficecore/KoFrame.h b/lib/kofficecore/KoFrame.h index 7f729bdb..7b372b98 100644 --- a/lib/kofficecore/KoFrame.h +++ b/lib/kofficecore/KoFrame.h @@ -20,18 +20,19 @@ #ifndef __koFrame_h__ #define __koFrame_h__ -#include +#include class KoView; class KoFramePrivate; -class KoFrame : public QWidget +class KoFrame : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum State { Inactive, Selected, Active }; - KoFrame( QWidget *parent, const char *name = 0 ); + KoFrame( TQWidget *tqparent, const char *name = 0 ); virtual ~KoFrame(); virtual void setView( KoView *view ); @@ -48,15 +49,15 @@ public: virtual int border() const; signals: - void geometryChanged(); + void tqgeometryChanged(); protected: - virtual void paintEvent( QPaintEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); - virtual void mouseReleaseEvent( QMouseEvent* ); - virtual void resizeEvent( QResizeEvent* ); - virtual bool eventFilter( QObject*, QEvent* ); + virtual void paintEvent( TQPaintEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void mouseMoveEvent( TQMouseEvent* ); + virtual void mouseReleaseEvent( TQMouseEvent* ); + virtual void resizeEvent( TQResizeEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); private: KoFramePrivate *d; diff --git a/lib/kofficecore/KoGenStyles.cpp b/lib/kofficecore/KoGenStyles.cpp index 503b6802..0ee2e730 100644 --- a/lib/kofficecore/KoGenStyles.cpp +++ b/lib/kofficecore/KoGenStyles.cpp @@ -29,39 +29,39 @@ KoGenStyles::~KoGenStyles() { } -QString KoGenStyles::lookup( const KoGenStyle& style, const QString& name, int flags ) +TQString KoGenStyles::lookup( const KoGenStyle& style, const TQString& name, int flags ) { - StyleMap::iterator it = m_styleMap.find( style ); + StyleMap::iterator it = m_styleMap.tqfind( style ); if ( it == m_styleMap.end() ) { - // Not found, try if this style is in fact equal to its parent (the find above + // Not found, try if this style is in fact equal to its tqparent (the find above // wouldn't have found it, due to m_parentName being set). - if ( !style.parentName().isEmpty() ) { + if ( !style.tqparentName().isEmpty() ) { KoGenStyle testStyle( style ); - const KoGenStyle* parentStyle = this->style( style.parentName() ); // ## linear search - if( !parentStyle ) { - kdDebug(30003) << "KoGenStyles::lookup(" << name << "): parent style '" << style.parentName() << "' not found in collection" << endl; + const KoGenStyle* tqparentStyle = this->style( style.tqparentName() ); // ## linear search + if( !tqparentStyle ) { + kdDebug(30003) << "KoGenStyles::lookup(" << name << "): tqparent style '" << style.tqparentName() << "' not found in collection" << endl; } else { - if ( testStyle.m_familyName != parentStyle->m_familyName ) + if ( testStyle.m_familyName != tqparentStyle->m_familyName ) { - kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") parent style '" << style.parentName() << "' has a different family: " << parentStyle->m_familyName << endl; + kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") tqparent style '" << style.tqparentName() << "' has a different family: " << tqparentStyle->m_familyName << endl; } - testStyle.m_parentName = parentStyle->m_parentName; + testStyle.m_parentName = tqparentStyle->m_parentName; // Exclude the type from the comparison. It's ok for an auto style - // to have a user style as parent; they can still be identical - testStyle.m_type = parentStyle->m_type; - // Also it's ok to not have the display name of the parent style + // to have a user style as tqparent; they can still be identical + testStyle.m_type = tqparentStyle->m_type; + // Also it's ok to not have the display name of the tqparent style // in the auto style - QMap::const_iterator it = parentStyle->m_attributes.find( "style:display-name" ); - if ( it != parentStyle->m_attributes.end() ) + TQMap::const_iterator it = tqparentStyle->m_attributes.tqfind( "style:display-name" ); + if ( it != tqparentStyle->m_attributes.end() ) testStyle.addAttribute( "style:display-name", *it ); - if ( *parentStyle == testStyle ) - return style.parentName(); + if ( *tqparentStyle == testStyle ) + return style.tqparentName(); } } - QString styleName( name ); + TQString styleName( name ); if ( styleName.isEmpty() ) { styleName = 'A'; // for "auto". flags &= ~DontForceNumbering; // i.e. force numbering @@ -80,39 +80,39 @@ QString KoGenStyles::lookup( const KoGenStyle& style, const QString& name, int f return it.data(); } -QString KoGenStyles::makeUniqueName( const QString& base, int flags ) const +TQString KoGenStyles::makeUniqueName( const TQString& base, int flags ) const { // If this name is not used yet, and numbering isn't forced, then the given name is ok. if ( ( flags & DontForceNumbering ) - && m_autoStylesInStylesDotXml.find( base ) == m_autoStylesInStylesDotXml.end() - && m_styleNames.find( base ) == m_styleNames.end() ) + && m_autoStylesInStylesDotXml.tqfind( base ) == m_autoStylesInStylesDotXml.end() + && m_styleNames.tqfind( base ) == m_styleNames.end() ) return base; int num = 1; - QString name; + TQString name; do { name = base; - name += QString::number( num++ ); - } while ( m_autoStylesInStylesDotXml.find( name ) != m_autoStylesInStylesDotXml.end() - || m_styleNames.find( name ) != m_styleNames.end() ); + name += TQString::number( num++ ); + } while ( m_autoStylesInStylesDotXml.tqfind( name ) != m_autoStylesInStylesDotXml.end() + || m_styleNames.tqfind( name ) != m_styleNames.end() ); return name; } -QValueList KoGenStyles::styles( int type, bool markedForStylesXml ) const +TQValueList KoGenStyles::styles( int type, bool markedForStylesXml ) const { - QValueList lst; + TQValueList lst; const NameMap& nameMap = markedForStylesXml ? m_autoStylesInStylesDotXml : m_styleNames; StyleArray::const_iterator it = m_styleArray.begin(); const StyleArray::const_iterator end = m_styleArray.end(); for ( ; it != end ; ++it ) { // Look up if it's marked for styles.xml or not by looking up in the corresponding style map. - if ( (*it).style->type() == type && nameMap.find((*it).name) != nameMap.end() ) { + if ( (*it).style->type() == type && nameMap.tqfind((*it).name) != nameMap.end() ) { lst.append( *it ); } } return lst; } -const KoGenStyle* KoGenStyles::style( const QString& name ) const +const KoGenStyle* KoGenStyles::style( const TQString& name ) const { StyleArray::const_iterator it = m_styleArray.begin(); const StyleArray::const_iterator end = m_styleArray.end(); @@ -123,14 +123,14 @@ const KoGenStyle* KoGenStyles::style( const QString& name ) const return 0; } -KoGenStyle* KoGenStyles::styleForModification( const QString& name ) +KoGenStyle* KoGenStyles::styleForModification( const TQString& name ) { return const_cast( style( name ) ); } -void KoGenStyles::markStyleForStylesXml( const QString& name ) +void KoGenStyles::markStyleForStylesXml( const TQString& name ) { - Q_ASSERT( m_styleNames.find( name ) != m_styleNames.end() ); + Q_ASSERT( m_styleNames.tqfind( name ) != m_styleNames.end() ); m_styleNames.remove( name ); m_autoStylesInStylesDotXml.insert( name, true ); styleForModification( name )->setAutoStyleInStylesDotXml( true ); @@ -156,10 +156,10 @@ void KoGenStyles::dump() } // Returns -1, 0 (equal) or 1 -static int compareMap( const QMap& map1, const QMap& map2 ) +static int compareMap( const TQMap& map1, const TQMap& map2 ) { - QMap::const_iterator it = map1.begin(); - QMap::const_iterator oit = map2.begin(); + TQMap::const_iterator it = map1.begin(); + TQMap::const_iterator oit = map2.begin(); for ( ; it != map1.end(); ++it, ++oit ) { // both maps have been checked for size already if ( it.key() != oit.key() ) return it.key() < oit.key() ? -1 : +1; @@ -173,8 +173,8 @@ static int compareMap( const QMap& map1, const QMapstartElement( elementName ); - QMap::const_iterator it = m_properties[i].begin(); - const QMap::const_iterator end = m_properties[i].end(); + TQMap::const_iterator it = m_properties[i].begin(); + const TQMap::const_iterator end = m_properties[i].end(); for ( ; it != end; ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); } writer->endElement(); } } -void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const QString& name, const char* propertiesElementName, bool closeElement, bool drawElement ) const +void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const TQString& name, const char* propertiesElementName, bool closeElement, bool drawElement ) const { //kdDebug(30003) << "writing out style " << name << " display-name=" << m_attributes["style:display-name"] << " family=" << m_familyName << endl; writer->startElement( elementName ); - const KoGenStyle* parentStyle = 0; + const KoGenStyle* tqparentStyle = 0; if ( !m_defaultStyle ) { if ( !drawElement ) writer->addAttribute( "style:name", name ); else writer->addAttribute( "draw:name", name ); if ( !m_parentName.isEmpty() ) { - parentStyle = styles.style( m_parentName ); - if ( parentStyle && m_familyName.isEmpty() ) { - // get family from parent style, just in case + tqparentStyle = styles.style( m_parentName ); + if ( tqparentStyle && m_familyName.isEmpty() ) { + // get family from tqparent style, just in case // Note: this is saving code, don't convert to attributeNS! const_cast( this )-> - m_familyName = parentStyle->attribute( "style:family" ).latin1(); - //kdDebug(30003) << "Got familyname " << m_familyName << " from parent" << endl; + m_familyName = tqparentStyle->attribute( "style:family" ).latin1(); + //kdDebug(30003) << "Got familyname " << m_familyName << " from tqparent" << endl; } - writer->addAttribute( "style:parent-style-name", m_parentName ); + writer->addAttribute( "style:tqparent-style-name", m_parentName ); } } else { // default-style Q_ASSERT( qstrcmp( elementName, "style:default-style" ) == 0 ); @@ -225,7 +225,7 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha } if ( !m_familyName.isEmpty() ) const_cast( this )-> - addAttribute( "style:family", QString::fromLatin1( m_familyName ) ); + addAttribute( "style:family", TQString::tqfromLatin1( m_familyName ) ); else { if ( qstrcmp( elementName, "style:style" ) == 0 ) kdWarning(30003) << "User style " << name << " is without family - invalid. m_type=" << m_type << endl; @@ -234,21 +234,21 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha #if 0 // #ifndef NDEBUG kdDebug() << "style: " << name << endl; printDebug(); - if ( parentStyle ) { - kdDebug() << " parent: " << m_parentName << endl; - parentStyle->printDebug(); + if ( tqparentStyle ) { + kdDebug() << " tqparent: " << m_parentName << endl; + tqparentStyle->printDebug(); } #endif - // Write attributes [which differ from the parent style] - // We only look at the direct parent style because we assume + // Write attributes [which differ from the tqparent style] + // We only look at the direct tqparent style because we assume // that styles are fully specified, i.e. the inheritance is // only in the final file, not in the caller's code. - QMap::const_iterator it = m_attributes.begin(); + TQMap::const_iterator it = m_attributes.begin(); for ( ; it != m_attributes.end(); ++it ) { bool writeit = true; - if ( parentStyle && it.key() != "style:family" // always write the family out - && parentStyle->attribute( it.key() ) == it.data() ) + if ( tqparentStyle && it.key() != "style:family" // always write the family out + && tqparentStyle->attribute( it.key() ) == it.data() ) writeit = false; if ( writeit ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); @@ -261,31 +261,31 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha writer->startElement( propertiesElementName ); // e.g. paragraph-properties it = m_properties[i].begin(); for ( ; it != m_properties[i].end(); ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); } i = KoGenStyle::ChildElement; it = m_properties[i].begin(); for ( ; it != m_properties[i].end(); ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) { + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) { writer->addCompleteElement( it.data().utf8() ); } } if ( createPropertiesTag ) writer->endElement(); } - writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", parentStyle ); - writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", parentStyle ); - writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", parentStyle ); + writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", tqparentStyle ); + writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", tqparentStyle ); + writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", tqparentStyle ); // And now the style maps for ( uint i = 0; i < m_maps.count(); ++i ) { bool writeit = true; - if ( parentStyle && compareMap( m_maps[i], parentStyle->m_maps[i] ) == 0 ) + if ( tqparentStyle && compareMap( m_maps[i], tqparentStyle->m_maps[i] ) == 0 ) writeit = false; if ( writeit ) { writer->startElement( "style:map" ); - QMap::const_iterator it = m_maps[i].begin(); + TQMap::const_iterator it = m_maps[i].begin(); for ( ; it != m_maps[i].end(); ++it ) { writer->addAttribute( it.key().utf8(), it.data().utf8() ); } @@ -296,17 +296,17 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha writer->endElement(); } -void KoGenStyle::addPropertyPt( const QString& propName, double propValue, PropertyType type ) +void KoGenStyle::addPropertyPt( const TQString& propName, double propValue, PropertyType type ) { - QString str; + TQString str; str.setNum( propValue, 'g', DBL_DIG ); str += "pt"; m_properties[type].insert( propName, str ); } -void KoGenStyle::addAttributePt( const QString& attrName, double attrValue ) +void KoGenStyle::addAttributePt( const TQString& attrName, double attrValue ) { - QString str; + TQString str; str.setNum( attrValue, 'g', DBL_DIG ); str += "pt"; m_attributes.insert( attrName, str ); @@ -317,32 +317,32 @@ void KoGenStyle::printDebug() const { int i = DefaultType; kdDebug() << m_properties[i].count() << " properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = TextType; kdDebug() << m_properties[i].count() << " text properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = ParagraphType; kdDebug() << m_properties[i].count() << " paragraph properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = ChildElement; kdDebug() << m_properties[i].count() << " child elements." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } kdDebug() << m_attributes.count() << " attributes." << endl; - for( QMap::ConstIterator it = m_attributes.begin(); it != m_attributes.end(); ++it ) { + for( TQMap::ConstIterator it = m_attributes.begin(); it != m_attributes.end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } kdDebug() << m_maps.count() << " maps." << endl; for ( uint i = 0; i < m_maps.count(); ++i ) { kdDebug() << "map " << i << ":" << endl; - for( QMap::ConstIterator it = m_maps[i].begin(); it != m_maps[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_maps[i].begin(); it != m_maps[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } } diff --git a/lib/kofficecore/KoGenStyles.h b/lib/kofficecore/KoGenStyles.h index ad05d6e0..17771c69 100644 --- a/lib/kofficecore/KoGenStyles.h +++ b/lib/kofficecore/KoGenStyles.h @@ -19,9 +19,9 @@ #ifndef KOGENSTYLES_H #define KOGENSTYLES_H -#include -#include -#include +#include +#include +#include #include @@ -76,7 +76,7 @@ public: ForceNumbering = 0, // it's the default anyway DontForceNumbering = 1 }; - // KDE4 TODO: use QFlags and change the arg type in lookup + // KDE4 TODO: use TQFlags and change the arg type in lookup /** * Look up a style in the collection, inserting it if necessary. @@ -94,9 +94,9 @@ public: * @return the name for this style * @todo ### rename lookup to insert */ - QString lookup( const KoGenStyle& style, const QString& name = QString::null, int flags = NoFlag ); + TQString lookup( const KoGenStyle& style, const TQString& name = TQString(), int flags = NoFlag ); - typedef QMap StyleMap; + typedef TQMap StyleMap; /** * Return the entire collection of styles * Use this for saving the styles @@ -105,7 +105,7 @@ public: struct NamedStyle { const KoGenStyle* style; ///< @note owned by the collection - QString name; + TQString name; }; /** * Return all styles of a given type @@ -116,12 +116,12 @@ public: * otherwise only those NOT marked for styles.xml. * @see lookup */ - QValueList styles( int type, bool markedForStylesXml = false ) const; + TQValueList styles( int type, bool markedForStylesXml = false ) const; /** * @return an existing style by name */ - const KoGenStyle* style( const QString& name ) const; + const KoGenStyle* style( const TQString& name ) const; /** * @return an existing style by name, which can be modified. @@ -130,7 +130,7 @@ public: * Only do this if you know for sure no other 'user' of that style will * be affected. */ - KoGenStyle* styleForModification( const QString& name ); + KoGenStyle* styleForModification( const TQString& name ); /** * Mark a given automatic style as being needed in styles.xml. @@ -144,7 +144,7 @@ public: * * @see styles, KoGenStyle::setAutoStyleInStylesDotXml */ - void markStyleForStylesXml( const QString& name ); + void markStyleForStylesXml( const TQString& name ); /** * Outputs debug information @@ -152,7 +152,7 @@ public: void dump(); private: - QString makeUniqueName( const QString& base, int flags ) const; + TQString makeUniqueName( const TQString& base, int flags ) const; /// style definition -> name StyleMap m_styleMap; @@ -160,12 +160,12 @@ private: /// Map with the style name as key. /// This map is mainly used to check for name uniqueness /// The value of the bool doesn't matter. - typedef QMap NameMap; // KDE4: QSet + typedef TQMap NameMap; // KDE4: TQSet NameMap m_styleNames; NameMap m_autoStylesInStylesDotXml; /// List of styles (used to preserve ordering) - typedef QValueVector StyleArray; + typedef TQValueVector StyleArray; StyleArray m_styleArray; class Private; @@ -216,10 +216,10 @@ public: * @param familyName The value for style:family, e.g. text, paragraph, graphic etc. * The family is for style:style elements only; number styles and list styles don't have one. * - * @param parentName If set, name of the parent style from which this one inherits. + * @param tqparentName If set, name of the tqparent style from which this one inherits. */ explicit KoGenStyle( int type = 0, const char* familyName = 0, - const QString& parentName = QString::null ); + const TQString& tqparentName = TQString() ); ~KoGenStyle(); /* @@ -249,8 +249,8 @@ public: /// Return the family name const char* familyName() const { return m_familyName.data(); } - /// Return the name of style's parent, if set - QString parentName() const { return m_parentName; } + /// Return the name of style's tqparent, if set + TQString tqparentName() const { return m_parentName; } /** * @brief The types of properties @@ -274,7 +274,7 @@ public: { /** * DefaultType depends on family: e.g. paragraph-properties if family=paragraph - * or on the type of style (e.g. page-layout -> page-layout-properties). + * or on the type of style (e.g. page-tqlayout -> page-tqlayout-properties). * (In fact that tag name is the one passed to writeStyle) */ DefaultType = 0, @@ -291,80 +291,80 @@ public: }; /// Add a property to the style - void addProperty( const QString& propName, const QString& propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, const TQString& propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ); } /// Overloaded version of addProperty that takes a char*, usually for "..." - void addProperty( const QString& propName, const char* propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::fromUtf8( propValue ) ); + void addProperty( const TQString& propName, const char* propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::fromUtf8( propValue ) ); } /// Overloaded version of addProperty that converts an int to a string - void addProperty( const QString& propName, int propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::number( propValue ) ); + void addProperty( const TQString& propName, int propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::number( propValue ) ); } /// Overloaded version of addProperty that converts a bool to a string (false/true) - void addProperty( const QString& propName, bool propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, bool propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ? "true" : "false" ); } /** * Add a property which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addPropertyPt( const QString& propName, double propValue, PropertyType type = DefaultType ); + void addPropertyPt( const TQString& propName, double propValue, PropertyType type = DefaultType ); /** * Add an attribute to the style * The difference between property and attributes is a bit oasis-format-specific: * attributes are for the style element itself, and properties are in the style:properties child element */ - void addAttribute( const QString& attrName, const QString& attrValue ) { + void addAttribute( const TQString& attrName, const TQString& attrValue ) { m_attributes.insert( attrName, attrValue ); } /// Overloaded version of addAttribute that takes a char*, usually for "..." - void addAttribute( const QString& attrName, const char* attrValue ) { - m_attributes.insert( attrName, QString::fromUtf8( attrValue ) ); + void addAttribute( const TQString& attrName, const char* attrValue ) { + m_attributes.insert( attrName, TQString::fromUtf8( attrValue ) ); } /// Overloaded version of addAttribute that converts an int to a string - void addAttribute( const QString& attrName, int attrValue ) { - m_attributes.insert( attrName, QString::number( attrValue ) ); + void addAttribute( const TQString& attrName, int attrValue ) { + m_attributes.insert( attrName, TQString::number( attrValue ) ); } /// Overloaded version of addAttribute that converts a bool to a string - void addAttribute( const QString& attrName, bool attrValue ) { + void addAttribute( const TQString& attrName, bool attrValue ) { m_attributes.insert( attrName, attrValue ? "true" : "false" ); } /** * Add an attribute which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addAttributePt( const QString& attrName, double attrValue ); + void addAttributePt( const TQString& attrName, double attrValue ); /** * @brief Add a child element to the style properties. * - * What is meant here is that the contents of the QString + * What is meant here is that the contents of the TQString * will be written out literally. This means you should use * KoXmlWriter to generate it: * @code - * QBuffer buffer; + * TQBuffer buffer; * buffer.open( IO_WriteOnly ); * KoXmlWriter elementWriter( &buffer ); // TODO pass indentation level * elementWriter.startElement( "..." ); * ... * elementWriter.endElement(); - * QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + * TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); * gs.addChildElement( "...", elementContents ); * @endcode * * The value of @p elementName isn't used, except that it must be unique. */ - void addChildElement( const QString& elementName, const QString& elementContents ) { + void addChildElement( const TQString& elementName, const TQString& elementContents ) { m_properties[ChildElement].insert( elementName, elementContents ); } @@ -372,14 +372,14 @@ public: * @brief Add a style:map to the style. * @param styleMap the attributes for the map, associated as (name,value). */ - void addStyleMap( const QMap& styleMap ) { + void addStyleMap( const TQMap& styleMap ) { m_maps.append( styleMap ); } /** * @return true if the style has no attributes, no properties, no style map etc. * This can be used by applications which do not save all attributes unconditionally, - * but only those that differ from the parent. But note that lookup() can't find this out... + * but only those that differ from the tqparent. But note that lookup() can't find this out... */ bool isEmpty() const { if ( !m_attributes.isEmpty() || ! m_maps.isEmpty() ) @@ -393,7 +393,7 @@ public: /** * Write the definition of this style to @p writer, using the OASIS format. * @param writer the KoXmlWriter in which @p elementName will be created and filled in - * @param styles the styles collection, used to look up the parent style + * @param styles the styles collection, used to look up the tqparent style * @param elementName the name of the XML element, e.g. "style:style". Don't forget to * pass style:default-style if isDefaultStyle(). * @param name must come from the collection. It will be ignored if isDefaultStyle() is true. @@ -403,11 +403,11 @@ public: * @param closeElement set it to false to be able to add more child elements to the style element * @param drawElement set it to true to add "draw:name" (used for gradient/hatch style) otherwise add "style:name" */ - void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const QString& name, + void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const TQString& name, const char* propertiesElementName, bool closeElement = true, bool drawElement = false ) const; /** - * QMap requires a complete sorting order. + * TQMap requires a complete sorting order. * Another solution would have been a qdict and a key() here, a la KoTextFormat, * but the key was difficult to generate. * Solutions with only a hash value (not representative of the whole data) @@ -415,26 +415,26 @@ public: */ bool operator<( const KoGenStyle &other ) const; - /// Not needed for QMap, but can still be useful + /// Not needed for TQMap, but can still be useful bool operator==( const KoGenStyle &other ) const; private: - QString property( const QString& propName, PropertyType type ) const { - QMap::const_iterator it = m_properties[type].find( propName ); + TQString property( const TQString& propName, PropertyType type ) const { + TQMap::const_iterator it = m_properties[type].tqfind( propName ); if ( it != m_properties[type].end() ) return it.data(); - return QString::null; + return TQString(); } - QString attribute( const QString& propName ) const { - QMap::const_iterator it = m_attributes.find( propName ); + TQString attribute( const TQString& propName ) const { + TQMap::const_iterator it = m_attributes.tqfind( propName ); if ( it != m_attributes.end() ) return it.data(); - return QString::null; + return TQString(); } void writeStyleProperties( KoXmlWriter* writer, PropertyType i, - const char* elementName, const KoGenStyle* parentStyle ) const; + const char* elementName, const KoGenStyle* tqparentStyle ) const; #ifndef NDEBUG void printDebug() const; @@ -444,13 +444,13 @@ private: // Note that the copy constructor and assignment operator are allowed. // Better not use pointers below! int m_type; - QCString m_familyName; - QString m_parentName; - /// We use QMaps since they provide automatic sorting on the key (important for unicity!) - QMap m_properties[N_NumTypes]; - QMap m_attributes; - typedef QMap StyleMap; - QValueVector m_maps; // we can't really sort the maps between themselves... + TQCString m_familyName; + TQString m_parentName; + /// We use TQMaps since they provide automatic sorting on the key (important for unicity!) + TQMap m_properties[N_NumTypes]; + TQMap m_attributes; + typedef TQMap StyleMap; + TQValueVector m_maps; // we can't really sort the maps between themselves... bool m_autoStyleInStylesDotXml; bool m_defaultStyle; diff --git a/lib/kofficecore/KoGlobal.cpp b/lib/kofficecore/KoGlobal.cpp index 87717172..53c9e4fe 100644 --- a/lib/kofficecore/KoGlobal.cpp +++ b/lib/kofficecore/KoGlobal.cpp @@ -21,8 +21,8 @@ #include "config.h" #include #include -#include -#include +#include +#include #include #include #include @@ -47,7 +47,7 @@ KoGlobal* KoGlobal::self() KoGlobal::KoGlobal() : m_pointSize( -1 ), m_kofficeConfig( 0L ) { - // Make sure that QCString::setNum doesn't give us "," as decimal point, e.g. when saving to OpenDocument. + // Make sure that TQCString::setNum doesn't give us "," as decimal point, e.g. when saving to OpenDocument. setlocale( LC_NUMERIC, "C" ); // Install the libkoffice* translations @@ -61,12 +61,12 @@ KoGlobal::KoGlobal() // Tell the iconloader about share/apps/koffice/icons KGlobal::iconLoader()->addAppDir("koffice"); - // Another way to get the DPI of the display would be QPaintDeviceMetrics, + // Another way to get the DPI of the display would be TQPaintDeviceMetrics, // but we have no widget here (and moving this to KoView wouldn't allow // using this from the document easily). -#ifdef Q_WS_X11 - m_dpiX = QPaintDevice::x11AppDpiX(); - m_dpiY = QPaintDevice::x11AppDpiY(); +#ifdef TQ_WS_X11 + m_dpiX = TQPaintDevice::x11AppDpiX(); + m_dpiY = TQPaintDevice::x11AppDpiY(); #else m_dpiX = 75; m_dpiY = 75; @@ -78,31 +78,31 @@ KoGlobal::~KoGlobal() delete m_kofficeConfig; } -QFont KoGlobal::_defaultFont() +TQFont KoGlobal::_defaultFont() { - QFont font = KGlobalSettings::generalFont(); - // we have to use QFontInfo, in case the font was specified with a pixel size + TQFont font = KGlobalSettings::generalFont(); + // we have to use TQFontInfo, in case the font was specified with a pixel size if ( font.pointSize() == -1 ) { - // cache size into m_pointSize, since QFontInfo loads the font -> slow + // cache size into m_pointSize, since TQFontInfo loads the font -> slow if ( m_pointSize == -1 ) - m_pointSize = QFontInfo(font).pointSize(); + m_pointSize = TQFontInfo(font).pointSize(); Q_ASSERT( m_pointSize != -1 ); font.setPointSize( m_pointSize ); } - //kdDebug()< seenLanguages; - const QStringList langlist = config.groupList(); - for ( QStringList::ConstIterator itall = langlist.begin(); + TQMap seenLanguages; + const TQStringList langlist = config.groupList(); + for ( TQStringList::ConstIterator itall = langlist.begin(); itall != langlist.end(); ++itall ) { - const QString tag = *itall; + const TQString tag = *itall; config.setGroup( tag ); - const QString name = config.readEntry("Name", tag); + const TQString name = config.readEntry("Name", tag); // e.g. name is "French" and tag is "fr" - // The QMap does the sorting on the display-name, so that + // The TQMap does the sorting on the display-name, so that // comboboxes are sorted. m_langMap.insert( name, tag ); @@ -135,23 +135,23 @@ void KoGlobal::createListOfLanguages() // Many of them are already in all_languages but all_languages doesn't // currently have en_GB or en_US etc. - const QStringList translationList = KGlobal::dirs()->findAllResources("locale", - QString::fromLatin1("*/entry.desktop")); - for ( QStringList::ConstIterator it = translationList.begin(); + const TQStringList translationList = KGlobal::dirs()->findAllResources("locale", + TQString::tqfromLatin1("*/entry.desktop")); + for ( TQStringList::ConstIterator it = translationList.begin(); it != translationList.end(); ++it ) { // Extract the language tag from the directory name - QString tag = *it; - int index = tag.findRev('/'); + TQString tag = *it; + int index = tag.tqfindRev('/'); tag = tag.left(index); - index = tag.findRev('/'); + index = tag.tqfindRev('/'); tag = tag.mid(index+1); - if ( seenLanguages.find( tag ) == seenLanguages.end() ) { + if ( seenLanguages.tqfind( tag ) == seenLanguages.end() ) { KSimpleConfig entry(*it); entry.setGroup("KCM Locale"); - const QString name = entry.readEntry("Name", tag); + const TQString name = entry.readEntry("Name", tag); // e.g. name is "US English" and tag is "en_US" m_langMap.insert( name, tag ); @@ -166,20 +166,20 @@ void KoGlobal::createListOfLanguages() // How to add them? } -QString KoGlobal::tagOfLanguage( const QString & _lang) +TQString KoGlobal::tagOfLanguage( const TQString & _lang) { const LanguageMap& map = self()->m_langMap; - QMap::ConstIterator it = map.find( _lang ); + TQMap::ConstIterator it = map.tqfind( _lang ); if ( it != map.end() ) return *it; - return QString::null; + return TQString(); } -QString KoGlobal::languageFromTag( const QString &langTag ) +TQString KoGlobal::languageFromTag( const TQString &langTag ) { const LanguageMap& map = self()->m_langMap; - QMap::ConstIterator it = map.begin(); - const QMap::ConstIterator end = map.end(); + TQMap::ConstIterator it = map.begin(); + const TQMap::ConstIterator end = map.end(); for ( ; it != end; ++it ) if ( it.data() == langTag ) return it.key(); diff --git a/lib/kofficecore/KoGlobal.h b/lib/kofficecore/KoGlobal.h index bab9c261..367a150b 100644 --- a/lib/kofficecore/KoGlobal.h +++ b/lib/kofficecore/KoGlobal.h @@ -22,9 +22,9 @@ #ifndef koGlobal_h #define koGlobal_h -#include -#include -#include +#include +#include +#include class KConfig; #include @@ -39,9 +39,9 @@ public: * Return the default font for KOffice programs. * This is (currently) the same as the KDE-global default font, * except that it is guaranteed to have a point size set, - * never a pixel size (see @ref QFont). + * never a pixel size (see @ref TQFont). */ - static QFont defaultFont() { + static TQFont defaultFont() { return self()->_defaultFont(); } @@ -66,32 +66,32 @@ public: /// Return the list of available languages, in their displayable form /// (translated names) - static QStringList listOfLanguages() { + static TQStringList listOfLanguages() { return self()->_listOfLanguages(); } /// Return the list of available languages, in their internal form /// e.g. "fr" or "en_US", here called "tag" - static QStringList listTagOfLanguages() { // TODO rename to listOfLanguageTags + static TQStringList listTagOfLanguages() { // TODO rename to listOfLanguageTags return self()->_listOfLanguageTags(); } /// For a given language display name, return its tag - static QString tagOfLanguage( const QString & _lang ); + static TQString tagOfLanguage( const TQString & _lang ); /// For a given language tag, return its display name - static QString languageFromTag( const QString &_lang ); + static TQString languageFromTag( const TQString &_lang ); ~KoGlobal(); private: static KoGlobal* self(); KoGlobal(); - QFont _defaultFont(); - QStringList _listOfLanguages(); - QStringList _listOfLanguageTags(); + TQFont _defaultFont(); + TQStringList _listOfLanguages(); + TQStringList _listOfLanguageTags(); KConfig* _kofficeConfig(); void createListOfLanguages(); int m_pointSize; - typedef QMap LanguageMap; + typedef TQMap LanguageMap; LanguageMap m_langMap; // display-name -> language tag KConfig* m_kofficeConfig; int m_dpiX; diff --git a/lib/kofficecore/KoMainWindow.cpp b/lib/kofficecore/KoMainWindow.cpp index bdcfaa6a..b78677f4 100644 --- a/lib/kofficecore/KoMainWindow.cpp +++ b/lib/kofficecore/KoMainWindow.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include @@ -63,20 +63,20 @@ class KoPartManager : public KParts::PartManager { public: - KoPartManager( QWidget * parent, const char * name = 0L ) - : KParts::PartManager( parent, name ) + KoPartManager( TQWidget * tqparent, const char * name = 0L ) + : KParts::PartManager( tqparent, name ) { setSelectionPolicy( KParts::PartManager::TriState ); setAllowNestedParts( true ); setIgnoreScrollBars( true ); // Allow right-click on embedded objects (without activating them) - // But beware: this means right-click on parent, from embedded object, - // doesn't make the parent active first... + // But beware: this means right-click on tqparent, from embedded object, + // doesn't make the tqparent active first... setActivationButtonMask( Qt::LeftButton | Qt::MidButton ); } - virtual bool eventFilter( QObject *obj, QEvent *ev ) + virtual bool eventFilter( TQObject *obj, TQEvent *ev ) { - if ( !obj->isWidgetType() || ::qt_cast( obj ) ) + if ( !obj->isWidgetType() || ::tqqt_cast( obj ) ) return false; return KParts::PartManager::eventFilter( obj, ev ); } @@ -135,25 +135,25 @@ public: KoDocument *m_rootDoc; KoDocument *m_docToOpen; - QPtrList m_rootViews; + TQPtrList m_rootViews; KParts::PartManager *m_manager; KParts::Part *m_activePart; KoView *m_activeView; - QLabel * statusBarLabel; + TQLabel * statusBarLabel; KProgress *m_progress; - QPtrList m_splitViewActionList; + TQPtrList m_splitViewActionList; // This additional list is needed, because we don't plug // the first list, when an embedded view gets activated (Werner) - QPtrList m_veryHackyActionList; - QSplitter *m_splitter; + TQPtrList m_veryHackyActionList; + TQSplitter *m_splitter; KSelectAction *m_orientation; KAction *m_removeView; KoMainWindowIface *m_dcopObject; - QPtrList m_toolbarList; + TQPtrList m_toolbarList; bool bMainWindowGUIBuilt; bool m_splitted; @@ -177,7 +177,7 @@ public: bool m_isExporting; KURL m_lastExportURL; - QCString m_lastExportFormat; + TQCString m_lastExportFormat; int m_lastExportSpecialOutputFlag; KSharedPtr m_koSpeaker; @@ -192,54 +192,54 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name ) d->m_manager = new KoPartManager( this ); - connect( d->m_manager, SIGNAL( activePartChanged( KParts::Part * ) ), - this, SLOT( slotActivePartChanged( KParts::Part * ) ) ); + connect( d->m_manager, TQT_SIGNAL( activePartChanged( KParts::Part * ) ), + TQT_TQOBJECT(this), TQT_SLOT( slotActivePartChanged( KParts::Part * ) ) ); if ( instance ) setInstance( instance, false ); // don't load plugins! we don't want // the part's plugins with this shell, even though we are using the // part's instance! (Simon) - QString doc; - QStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" ); + TQString doc; + TQStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" ); setXMLFile( findMostRecentXMLFile( allFiles, doc ) ); setLocalXMLFile( locateLocal( "data", "koffice/koffice_shell.rc" ) ); - KStdAction::openNew( this, SLOT( slotFileNew() ), actionCollection(), "file_new" ); - KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection(), "file_open" ); - m_recent = KStdAction::openRecent( this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection() ); - d->m_paSave = KStdAction::save( this, SLOT( slotFileSave() ), actionCollection(), "file_save" ); - d->m_paSaveAs = KStdAction::saveAs( this, SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" ); - d->m_paPrint = KStdAction::print( this, SLOT( slotFilePrint() ), actionCollection(), "file_print" ); - d->m_paPrintPreview = KStdAction::printPreview( this, SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" ); - d->m_sendfile = KStdAction::mail( this, SLOT( slotEmailFile() ), actionCollection(), "file_send_file"); + KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ), actionCollection(), "file_new" ); + KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection(), "file_open" ); + m_recent = KStdAction::openRecent( TQT_TQOBJECT(this), TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection() ); + d->m_paSave = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ), actionCollection(), "file_save" ); + d->m_paSaveAs = KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" ); + d->m_paPrint = KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrint() ), actionCollection(), "file_print" ); + d->m_paPrintPreview = KStdAction::printPreview( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" ); + d->m_sendfile = KStdAction::mail( TQT_TQOBJECT(this), TQT_SLOT( slotEmailFile() ), actionCollection(), "file_send_file"); - d->m_paCloseFile = KStdAction::close( this, SLOT( slotFileClose() ), actionCollection(), "file_close" ); - KStdAction::quit( this, SLOT( slotFileQuit() ), actionCollection(), "file_quit" ); + d->m_paCloseFile = KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( slotFileClose() ), actionCollection(), "file_close" ); + KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotFileQuit() ), actionCollection(), "file_quit" ); d->m_reloadfile = new KAction( i18n( "Reload"), 0, - this, SLOT( slotReloadFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotReloadFile() ), actionCollection(), "file_reload_file"); d->m_versionsfile = new KAction( i18n( "Versions..."), 0, - this, SLOT( slotVersionsFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotVersionsFile() ), actionCollection(), "file_versions_file"); d->m_importFile = new KAction( i18n( "I&mport..." ), 0, // clashing accel key :( - this, SLOT( slotImportFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotImportFile() ), actionCollection(), "file_import_file"); d->m_exportFile = new KAction( i18n( "E&xport..." ), 0, - this, SLOT( slotExportFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotExportFile() ), actionCollection(), "file_export_file"); /* The following entry opens the document information dialog. Since the action is named so it intends to show data this entry should not have a trailing ellipses (...). */ d->m_paDocInfo = new KAction( i18n( "&Document Information" ), "documentinfo", 0, - this, SLOT( slotDocumentInfo() ), + TQT_TQOBJECT(this), TQT_SLOT( slotDocumentInfo() ), actionCollection(), "file_documentinfo" ); - KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() ); - KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection() ); + KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureKeys() ), actionCollection() ); + KStdAction::configureToolbars( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureToolbars() ), actionCollection() ); d->m_paDocInfo->setEnabled( false ); d->m_paSaveAs->setEnabled( false ); @@ -253,35 +253,35 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name ) d->m_sendfile->setEnabled( false); d->m_paCloseFile->setEnabled( false); - d->m_splitter=new QSplitter(Qt::Vertical, this, "mw-splitter"); + d->m_splitter=new TQSplitter(Qt::Vertical, this, "mw-splitter"); setCentralWidget( d->m_splitter ); // Keyboard accessibility enhancements. new KKbdAccessExtensions(this, "mw-panelSizer"); // set up the action "list" for "Close all Views" (hacky :) (Werner) d->m_veryHackyActionList.append( new KAction(i18n("&Close All Views"), "fileclose", - "ctrl+shift+w", this, SLOT(slotCloseAllViews()), + "ctrl+shift+w", TQT_TQOBJECT(this), TQT_SLOT(slotCloseAllViews()), actionCollection(), "view_closeallviews") ); // set up the action list for the splitter stuff d->m_splitViewActionList.append(new KAction(i18n("&Split View"), "view_split", 0, - this, SLOT(slotSplitView()), + TQT_TQOBJECT(this), TQT_SLOT(slotSplitView()), actionCollection(), "view_split")); d->m_removeView=new KAction(i18n("&Remove View"), "view_remove", 0, - this, SLOT(slotRemoveView()), + TQT_TQOBJECT(this), TQT_SLOT(slotRemoveView()), actionCollection(), "view_rm_splitter"); d->m_splitViewActionList.append(d->m_removeView); d->m_removeView->setEnabled(false); - d->m_orientation=new KSelectAction(i18n("Splitter &Orientation"), "view_orientation", 0, - this, SLOT(slotSetOrientation()), + d->m_orientation=new KSelectAction(i18n("Splitter &Qt::Orientation"), "view_orientation", 0, + TQT_TQOBJECT(this), TQT_SLOT(slotSetOrientation()), actionCollection(), "view_splitter_orientation"); - QStringList items; + TQStringList items; items << i18n("&Vertical") << i18n("&Horizontal"); d->m_orientation->setItems(items); d->m_orientation->setCurrentItem(static_cast(d->m_splitter->orientation())); d->m_splitViewActionList.append(d->m_orientation); - d->m_splitViewActionList.append(new KActionSeparator(this)); + d->m_splitViewActionList.append(new KActionSeparator(TQT_TQOBJECT(this))); // Load list of recent files KConfig * config = instance ? instance->config() : KGlobal::config(); @@ -322,7 +322,7 @@ KoMainWindow::~KoMainWindow() // safety first ;) d->m_manager->setActivePart(0); - if(d->m_rootViews.findRef(d->m_activeView)==-1) { + if(d->m_rootViews.tqfindRef(d->m_activeView)==-1) { delete d->m_activeView; d->m_activeView=0L; } @@ -357,7 +357,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc ) } //kdDebug(30003) << "KoMainWindow::setRootDocument this = " << this << " doc = " << doc << endl; - QPtrList oldRootViews = d->m_rootViews; + TQPtrList oldRootViews = d->m_rootViews; d->m_rootViews.clear(); KoDocument *oldRootDoc = d->m_rootDoc; @@ -375,7 +375,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc ) d->m_rootViews.current()->show(); // The addShell has been done already if using openURL - if ( !d->m_rootDoc->shells().contains( this ) ) + if ( !d->m_rootDoc->shells().tqcontains( this ) ) d->m_rootDoc->addShell( this ); d->m_removeView->setEnabled(false); d->m_orientation->setEnabled(false); @@ -417,7 +417,7 @@ void KoMainWindow::updateVersionsFileAction(KoDocument *doc) } -void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const QPtrList & views ) +void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const TQPtrList & views ) { d->m_rootDoc = doc; d->m_rootViews = views; @@ -442,10 +442,10 @@ void KoMainWindow::addRecentURL( const KURL& url ) bool ok = true; if ( url.isLocalFile() ) { - QString path = url.path( -1 ); - QStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); - for ( QStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) - if ( path.contains( *it ) ) + TQString path = url.path( -1 ); + TQStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); + for ( TQStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) + if ( path.tqcontains( *it ) ) ok = false; // it's in the tmp resource if ( ok ) KRecentDocument::add(path); @@ -492,32 +492,32 @@ void KoMainWindow::updateCaption() { //kdDebug(30003) << "KoMainWindow::updateCaption()" << endl; if ( !d->m_rootDoc ) - setCaption(QString::null); + setCaption(TQString()); else if ( rootDocument()->isCurrent() ) { - QString caption; + TQString caption; // Get caption from document info (title(), in about page) if ( rootDocument()->documentInfo() ) { - KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( QString::fromLatin1("about") ); + KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( TQString::tqfromLatin1("about") ); if (page) caption = static_cast(page)->title(); } - const QString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol ); + const TQString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol ); if ( !caption.isEmpty() && !url.isEmpty() ) - caption = QString( "%1 - %2" ).arg( caption ).arg( url ); + caption = TQString( "%1 - %2" ).tqarg( caption ).tqarg( url ); else if ( caption.isEmpty() ) caption = url; setCaption( caption, rootDocument()->isModified() ); if ( !rootDocument()->url().fileName(false).isEmpty() ) - d->m_paSave->setToolTip( i18n("Save as %1").arg(rootDocument()->url().fileName(false)) ); + d->m_paSave->setToolTip( i18n("Save as %1").tqarg(rootDocument()->url().fileName(false)) ); else d->m_paSave->setToolTip( i18n("Save") ); } } -void KoMainWindow::updateCaption( QString caption, bool mod ) +void KoMainWindow::updateCaption( TQString caption, bool mod ) { //kdDebug(30003)<<"KoMainWindow::updateCaption("<m_rootViews.find(d->m_activeView)!=-1) + if(d->m_rootViews.tqfind(d->m_activeView)!=-1) return d->m_activeView; return d->m_rootViews.first(); } @@ -544,7 +544,7 @@ bool KoMainWindow::openDocument( const KURL & url ) { if ( !KIO::NetAccess::exists(url,true,0) ) { - KMessageBox::error(0L, i18n("The file %1 does not exist.").arg(url.url()) ); + KMessageBox::error(0L, i18n("The file %1 does not exist.").tqarg(url.url()) ); m_recent->removeURL(url); //remove the file from the recent-opened-file-list saveRecentFiles(); return false; @@ -564,7 +564,7 @@ bool KoMainWindow::openDocument( KoDocument *newdoc, const KURL & url ) setRootDocument( newdoc ); newdoc->setURL(url); - QString mime = KMimeType::findByURL(url)->name(); + TQString mime = KMimeType::findByURL(url)->name(); if ( mime.isEmpty() || mime == KMimeType::defaultMimeType() ) mime = newdoc->nativeFormatMimeType(); if ( url.isLocalFile() ) // workaround for kde<=3.3 kparts bug, fixed for 3.4 @@ -587,9 +587,9 @@ bool KoMainWindow::openDocumentInternal( const KURL & url, KoDocument *newdoc ) return false; d->m_firstTime=true; - connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - connect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - connect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + connect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + connect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); newdoc->addShell( this ); // used by openURL bool openRet = (!isImporting ()) ? newdoc->openURL(url) : newdoc->import(url); if(!openRet) @@ -630,12 +630,12 @@ void KoMainWindow::slotLoadCompleted() // We had no document, set the new one setRootDocument( newdoc ); } - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); } -void KoMainWindow::slotLoadCanceled( const QString & errMsg ) +void KoMainWindow::slotLoadCanceled( const TQString & errMsg ) { kdDebug(30003) << "KoMainWindow::slotLoadCanceled" << endl; if ( !errMsg.isEmpty() ) // empty when canceled by user @@ -643,15 +643,15 @@ void KoMainWindow::slotLoadCanceled( const QString & errMsg ) // ... can't delete the document, it's the one who emitted the signal... KoDocument* newdoc = (KoDocument *)(sender()); - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); newdoc->removeShell(this); delete newdoc; } -void KoMainWindow::slotSaveCanceled( const QString &errMsg ) +void KoMainWindow::slotSaveCanceled( const TQString &errMsg ) { kdDebug(30003) << "KoMainWindow::slotSaveCanceled" << endl; if ( !errMsg.isEmpty() ) // empty when canceled by user @@ -663,21 +663,21 @@ void KoMainWindow::slotSaveCompleted() { kdDebug(30003) << "KoMainWindow::slotSaveCompleted" << endl; KoDocument* pDoc = (KoDocument *)(sender()); - disconnect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted())); - disconnect(pDoc, SIGNAL(canceled( const QString & )), - this, SLOT(slotSaveCanceled( const QString & ))); + disconnect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted())); + disconnect(pDoc, TQT_SIGNAL(canceled( const TQString & )), + TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & ))); } // returns true if we should save, false otherwise. -bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) +bool KoMainWindow::exportConfirmation( const TQCString &outputFormat ) { if (!rootDocument()->wantExportConfirmation()) return true; KMimeType::Ptr mime = KMimeType::mimeType( outputFormat ); const bool neverHeardOfIt = ( mime->name() == KMimeType::defaultMimeType() ); - QString comment = neverHeardOfIt ? - i18n( "%1 (unknown file type)" ).arg( outputFormat ) + TQString comment = neverHeardOfIt ? + i18n( "%1 (unknown file type)" ).tqarg( outputFormat.data() ) : mime->comment(); // Warn the user @@ -689,7 +689,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) this, i18n( "Saving as a %1 may result in some loss of formatting." "

Do you still want to save in this format?" ) - .arg( QString( "%1" ).arg( comment ) ), // in case we want to remove the bold later + .tqarg( TQString( "%1" ).tqarg( comment ) ), // in case we want to remove the bold later i18n( "Confirm Save" ), KStdGuiItem::save (), "NonNativeSaveConfirmation", @@ -703,7 +703,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) this, i18n( "Exporting as a %1 may result in some loss of formatting." "

Do you still want to export to this format?" ) - .arg( QString( "%1" ).arg( comment ) ), // in case we want to remove the bold later + .tqarg( TQString( "%1" ).tqarg( comment ) ), // in case we want to remove the bold later i18n( "Confirm Export" ), i18n ("Export"), "NonNativeExportConfirmation", // different to the one used for Save (above) @@ -730,20 +730,20 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) else reset_url = false; - connect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - connect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted())); - connect(pDoc, SIGNAL(canceled( const QString & )), - this, SLOT(slotSaveCanceled( const QString & ))); + connect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + connect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted())); + connect(pDoc, TQT_SIGNAL(canceled( const TQString & )), + TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & ))); KURL oldURL = pDoc->url(); - QString oldFile = pDoc->file(); - QCString _native_format = pDoc->nativeFormatMimeType(); - QCString oldOutputFormat = pDoc->outputMimeType(); + TQString oldFile = pDoc->file(); + TQCString _native_format = pDoc->nativeFormatMimeType(); + TQCString oldOutputFormat = pDoc->outputMimeType(); int oldSpecialOutputFlag = pDoc->specialOutputFlag(); KURL suggestedURL = pDoc->url(); - QStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() ); - if (mimeFilter.findIndex (oldOutputFormat) < 0 && !isExporting()) + TQStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() ); + if (mimeFilter.tqfindIndex (oldOutputFormat) < 0 && !isExporting()) { kdDebug(30003) << "KoMainWindow::saveDocument no export filter for '" << oldOutputFormat << "'" << endl; @@ -751,13 +751,13 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // dialog and then tries to just plain Save --- // suggest a different filename extension (yes, we fortunately don't all live in a world of magic :)) - QString suggestedFilename = suggestedURL.fileName (); + TQString suggestedFilename = suggestedURL.fileName (); if ( !suggestedFilename.isEmpty () ) // ".kwd" looks strange for a name { - int c = suggestedFilename.findRev ('.'); + int c = suggestedFilename.tqfindRev ('.'); KMimeType::Ptr mime = KMimeType::mimeType( _native_format ); - QString ext = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString ext = mime->property( "X-KDE-NativeExtension" ).toString(); if (!ext.isEmpty ()) { if (c < 0) @@ -790,7 +790,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) bool justChangingFilterOptions = false; KoFileDialog *dialog = new KoFileDialog( (isExporting() && !d->m_lastExportURL.isEmpty() )? d->m_lastExportURL.url () : suggestedURL.url (), - QString::null, this, "file dialog", true); + TQString(), this, "file dialog", true); if (!isExporting()) dialog->setCaption( i18n("Save Document As") ); @@ -805,12 +805,12 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) pDoc->supportedSpecialFormats() ); KURL newURL; - QCString outputFormat = _native_format; + TQCString outputFormat = _native_format; int specialOutputFlag = 0; bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter().latin1(); specialOutputFlag = dialog->specialEntrySelected(); @@ -839,7 +839,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // adjust URL before doing checks on whether the file exists. if ( specialOutputFlag == KoDocument::SaveAsDirectoryStore ) { - QString fileName = newURL.fileName(); + TQString fileName = newURL.fileName(); if ( fileName != "content.xml" ) { newURL.addPath( "content.xml" ); } @@ -884,7 +884,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // (not Save As) they won't be expecting that they are // using their File/Export settings // - // As a bad side-effect of this, the modified flag will not + // As a bad side-effect of TQT_TQOBJECT(this), the modified flag will not // be updated and it is possible that what is currently on // their screen is not what is stored on disk (through loss // of formatting). But if you are dumb enough to change @@ -979,7 +979,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) return ret; } -void KoMainWindow::closeEvent(QCloseEvent *e) { +void KoMainWindow::closeEvent(TQCloseEvent *e) { if(queryClose()) { saveWindowSettings(); setRootDocument(0L); @@ -1004,7 +1004,7 @@ void KoMainWindow::saveWindowSettings() } } -void KoMainWindow::resizeEvent( QResizeEvent * e ) +void KoMainWindow::resizeEvent( TQResizeEvent * e ) { d->m_windowSizeDirty = true; KParts::MainWindow::resizeEvent( e ); @@ -1027,7 +1027,7 @@ bool KoMainWindow::queryClose() // main doc + internally stored child documents if ( d->m_rootDoc->isModified() ) { - QString name; + TQString name; if ( rootDocument()->documentInfo() ) { name = rootDocument()->documentInfo()->title(); @@ -1039,8 +1039,8 @@ bool KoMainWindow::queryClose() name = i18n( "Untitled" ); int res = KMessageBox::warningYesNoCancel( this, - i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).arg(name), - QString::null, + i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).tqarg(name), + TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); @@ -1079,8 +1079,8 @@ void KoMainWindow::chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFl return; //FIXME: This needs to be handled differently - connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); + connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); if ( ( !doc && ( initDocFlags == KoDocument::InitDocFileNew ) ) || ( doc && !doc->isEmpty() ) ) { @@ -1108,18 +1108,18 @@ void KoMainWindow::slotFileNew() void KoMainWindow::slotFileOpen() { - KFileDialog *dialog = new KFileDialog(":OpenDialog", QString::null, this, "file dialog", true); + KFileDialog *dialog = new KFileDialog(":OpenDialog", TQString(), this, "file dialog", true); if (!isImporting()) dialog->setCaption( i18n("Open Document") ); else dialog->setCaption( i18n("Import Document") ); // The few lines below need to be kept in sync with KoTemplateChooseDia::setupFileDialog - const QStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(), + const TQStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(), KoFilterManager::Import, KoDocument::readExtraNativeMimeTypes() ); dialog->setMimeFilter( mimeFilter ); - if(dialog->exec()!=QDialog::Accepted) { + if(dialog->exec()!=TQDialog::Accepted) { delete dialog; return; } @@ -1194,14 +1194,14 @@ void KoMainWindow::print(bool quick) { return; } - KPrinter printer( true /*, QPrinter::HighResolution*/ ); - QString title = rootView()->koDocument()->documentInfo()->title(); - QString fileName = rootView()->koDocument()->url().fileName(); + KPrinter printer( true /*, TQPrinter::HighResolution*/ ); + TQString title = rootView()->koDocument()->documentInfo()->title(); + TQString fileName = rootView()->koDocument()->url().fileName(); // strip off the native extension (I don't want foobar.kwd.ps when printing into a file) KMimeType::Ptr mime = KMimeType::mimeType( rootView()->koDocument()->outputMimeType() ); if ( mime ) { - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); if ( fileName.endsWith( extension ) ) fileName.truncate( fileName.length() - extension.length() ); @@ -1211,8 +1211,8 @@ void KoMainWindow::print(bool quick) { title = fileName; if ( title.isEmpty() ) { // #139905 - breaks message freeze though - //const QString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName(); - //title = i18n("%1 unsaved document (%2)").arg(programName).arg(KGlobal::locale()->formatDate(QDate::currentDate(), true/*short*/)); + //const TQString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName(); + //title = i18n("%1 unsaved document (%2)").tqarg(programName).tqarg(KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), true/*short*/)); } printer.setDocName( title ); printer.setDocFileName( fileName ); @@ -1249,13 +1249,13 @@ void KoMainWindow::slotFilePrintPreview() printer.setPreviewOnly( true ); rootView()->setupPrinter( printer ); - QString oldFileName = printer.outputFileName(); + TQString oldFileName = printer.outputFileName(); printer.setOutputFileName( tmpFile.name() ); int oldNumCopies = printer.numCopies(); printer.setNumCopies( 1 ); // Disable kdeprint's own preview, we'd get two. This shows that KPrinter needs // a "don't use the previous settings" mode. The current way is really too much of a hack. - QString oldKDEPreview = printer.option( "kde-preview" ); + TQString oldKDEPreview = printer.option( "kde-preview" ); printer.setOption( "kde-preview", "0" ); rootView()->print(printer); @@ -1277,7 +1277,7 @@ void KoMainWindow::slotConfigureToolbars() if (rootDocument()) saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() ); KEditToolbar edit(factory(), this); - connect(&edit,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig())); + connect(&edit,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(slotNewToolbarConfig())); (void) edit.exec(); } @@ -1296,7 +1296,7 @@ void KoMainWindow::slotNewToolbarConfig() d->m_veryHackyActionList); // This one only for root views - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) factory->plugActionList(d->m_activeView, "view_split", d->m_splitViewActionList ); plugActionList( "toolbarlist", d->m_toolbarList ); @@ -1306,7 +1306,7 @@ void KoMainWindow::slotToolbarToggled( bool toggle ) { //kdDebug(30003) << "KoMainWindow::slotToolbarToggled " << sender()->name() << " toggle=" << true << endl; // The action (sender) and the toolbar have the same name - KToolBar * bar = toolBar( sender()->name() ); + KToolBar * bar = toolBar( TQT_TQOBJECT(const_cast(sender()))->name() ); if (bar) { if (toggle) @@ -1318,18 +1318,18 @@ void KoMainWindow::slotToolbarToggled( bool toggle ) saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() ); } else - kdWarning(30003) << "slotToolbarToggled : Toolbar " << sender()->name() << " not found!" << endl; + kdWarning(30003) << "slotToolbarToggled : Toolbar " << TQT_TQOBJECT(const_cast(sender()))->name() << " not found!" << endl; } bool KoMainWindow::toolbarIsVisible(const char *tbName) { - QWidget *tb = toolBar( tbName); + TQWidget *tb = toolBar( tbName); return !tb->isHidden(); } void KoMainWindow::showToolbar( const char * tbName, bool shown ) { - QWidget * tb = toolBar( tbName ); + TQWidget * tb = toolBar( tbName ); if ( !tb ) { kdWarning(30003) << "KoMainWindow: toolbar " << tbName << " not found." << endl; @@ -1341,7 +1341,7 @@ void KoMainWindow::showToolbar( const char * tbName, bool shown ) tb->hide(); // Update the action appropriately - QPtrListIterator it( d->m_toolbarList ); + TQPtrListIterator it( d->m_toolbarList ); for ( ; it.current() ; ++it ) if ( !strcmp( it.current()->name(), tbName ) ) { @@ -1370,7 +1370,7 @@ void KoMainWindow::slotCloseAllViews() { if(d->m_rootDoc && d->m_rootDoc->isEmbedded()) { hide(); d->m_rootDoc->removeShell(this); - QPtrListIterator it(d->m_rootDoc->shells()); + TQPtrListIterator it(d->m_rootDoc->shells()); while (it.current()) { it.current()->hide(); delete it.current(); // this updates the lists' current pointer and thus @@ -1388,7 +1388,7 @@ void KoMainWindow::slotCloseAllViews() { void KoMainWindow::slotRemoveView() { KoView *view; - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) view=d->m_rootViews.current(); else view=d->m_rootViews.first(); @@ -1435,10 +1435,10 @@ void KoMainWindow::slotProgress(int value) { { // The statusbar might not even be created yet. // So check for that first, and create it if necessary - QObjectList *l = queryList( "QStatusBar" ); + TQObjectList *l = queryList( "TQStatusBar" ); if ( !l || !l->first() ) { statusBar()->show(); - QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + TQApplication::sendPostedEvents( TQT_TQOBJECT(this), TQEvent::ChildInserted ); setUpLayout(); } delete l; @@ -1467,7 +1467,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) // This looks very much like KParts::MainWindow::createGUI, but we have // to reimplement it because it works with an active part, whereas we work // with an active view _and_ an active part, depending for what. - // Both are KXMLGUIClients, but e.g. the plugin query needs a QObject. + // Both are KXMLGUIClients, but e.g. the plugin query needs a TQObject. //kdDebug(30003) << "KoMainWindow::slotActivePartChanged( Part * newPart) newPart = " << newPart << endl; //kdDebug(30003) << "current active part is " << d->m_activePart << endl; @@ -1484,8 +1484,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) if ( d->m_activeView ) { KParts::GUIActivateEvent ev( false ); - QApplication::sendEvent( d->m_activePart, &ev ); - QApplication::sendEvent( d->m_activeView, &ev ); + TQApplication::sendEvent( d->m_activePart, &ev ); + TQApplication::sendEvent( d->m_activeView, &ev ); factory->removeClient( d->m_activeView ); @@ -1497,7 +1497,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) if ( !d->bMainWindowGUIBuilt ) { // Load mainwindow plugins - KParts::Plugin::loadPlugins( this, this, instance(), true ); + KParts::Plugin::loadPlugins( TQT_TQOBJECT(this), this, instance(), true ); createShellGUI(); } @@ -1514,25 +1514,25 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) factory->plugActionList(d->m_activeView, "view_closeallviews", d->m_veryHackyActionList); // This one only for root views - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) factory->plugActionList(d->m_activeView, "view_split", d->m_splitViewActionList ); // Position and show toolbars according to user's preference setAutoSaveSettings( newPart->instance()->instanceName(), false ); // Create and plug toolbar list for Settings menu - //QPtrListIterator it = toolBarIterator(); - QPtrList toolBarList = factory->containers( "ToolBar" ); - QPtrListIterator it( toolBarList ); + //TQPtrListIterator it = toolBarIterator(); + TQPtrList toolBarList = factory->containers( "ToolBar" ); + TQPtrListIterator it( toolBarList ); for ( ; it.current() ; ++it ) { if ( it.current()->inherits("KToolBar") ) { KToolBar * tb = static_cast(it.current()); - KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").arg( tb->text() ), 0, + KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").tqarg( tb->text() ), 0, actionCollection(), tb->name() ); - act->setCheckedState(i18n("Hide %1 Toolbar").arg( tb->text() )); - connect( act, SIGNAL( toggled( bool ) ), this, SLOT( slotToolbarToggled( bool ) ) ); + act->setCheckedState(i18n("Hide %1 Toolbar").tqarg( tb->text() )); + connect( act, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( slotToolbarToggled( bool ) ) ); act->setChecked ( !tb->isHidden() ); d->m_toolbarList.append( act ); } @@ -1544,8 +1544,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) // Send the GUIActivateEvent only now, since it might show/hide toolbars too // (and this has priority over applyMainWindowSettings) KParts::GUIActivateEvent ev( true ); - QApplication::sendEvent( d->m_activePart, &ev ); - QApplication::sendEvent( d->m_activeView, &ev ); + TQApplication::sendEvent( d->m_activePart, &ev ); + TQApplication::sendEvent( d->m_activeView, &ev ); } else { @@ -1555,11 +1555,11 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) setUpdatesEnabled( true ); } -QLabel * KoMainWindow::statusBarLabel() +TQLabel * KoMainWindow::statusBarLabel() { if ( !d->statusBarLabel ) { - d->statusBarLabel = new QLabel( statusBar() ); + d->statusBarLabel = new TQLabel( statusBar() ); statusBar()->addWidget( d->statusBarLabel, 1, true ); } return d->statusBarLabel; @@ -1588,16 +1588,16 @@ void KoMainWindow::slotEmailFile() // Subject = Document file name // Attachment = The current file // Message Body = The current document in HTML export? <-- This may be an option. - QString theSubject; - QStringList urls; - QString fileURL; + TQString theSubject; + TQStringList urls; + TQString fileURL; if (rootDocument()->url ().isEmpty () || rootDocument()->isModified()) { //Save the file as a temporary file bool const tmp_modified = rootDocument()->isModified(); KURL const tmp_url = rootDocument()->url(); - QCString const tmp_mimetype = rootDocument()->outputMimeType(); + TQCString const tmp_mimetype = rootDocument()->outputMimeType(); KTempFile tmpfile; //TODO: The temorary file should be deleted when the mail program is closed KURL u; u.setPath(tmpfile.name()); @@ -1618,7 +1618,7 @@ void KoMainWindow::slotEmailFile() else { fileURL = rootDocument()->url().url(); - theSubject = i18n("Document - %1").arg(rootDocument()->url().fileName(false)); + theSubject = i18n("Document - %1").tqarg(rootDocument()->url().fileName(false)); urls.append( fileURL ); } @@ -1626,9 +1626,9 @@ void KoMainWindow::slotEmailFile() if (!fileURL.isEmpty()) { - kapp->invokeMailer(QString::null, QString::null, QString::null, theSubject, - QString::null, //body - QString::null, + kapp->invokeMailer(TQString(), TQString(), TQString(), theSubject, + TQString(), //body + TQString(), urls); // attachments } } diff --git a/lib/kofficecore/KoMainWindow.h b/lib/kofficecore/KoMainWindow.h index 2b738db9..f1dd6419 100644 --- a/lib/kofficecore/KoMainWindow.h +++ b/lib/kofficecore/KoMainWindow.h @@ -26,7 +26,7 @@ #include #include "KoDocument.h" -class QLabel; +class TQLabel; class KoView; class KoMainWindowPrivate; class KURL; @@ -43,7 +43,7 @@ namespace KParts * @brief Main window for a KOffice application * * This class is used to represent a main window - * of a KOffice component. Each main window contains + * of a KOffice component. Each main window tqcontains * a menubar and some toolbars. * * @note This class does NOT need to be subclassed in your application. @@ -51,6 +51,7 @@ namespace KParts class KOFFICECORE_EXPORT KoMainWindow : public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: /** @@ -111,9 +112,9 @@ public: /** * Get hold of the label in the statusbar, to write messages to it. - * You can also insert other items in the status bar by using QStatusBar::addWidget. + * You can also insert other items in the status bar by using TQStatusBar::addWidget. */ - QLabel * statusBarLabel(); + TQLabel * statusBarLabel(); /** * Sets the maximum number of recent documents entries. @@ -150,7 +151,7 @@ public: /** * Updates the window caption based on the document info and path. */ - virtual void updateCaption( const QString caption, bool mod ); + virtual void updateCaption( const TQString caption, bool mod ); void updateReloadFileAction(KoDocument *doc); void updateVersionsFileAction(KoDocument *doc); @@ -298,7 +299,7 @@ protected: // protected methods are mostly for koshell, it's the only one derivi * Special method for KOShell, to allow switching the root * document (and its views) among a set of them. */ - void setRootDocumentDirect( KoDocument *doc, const QPtrList & views ); + void setRootDocumentDirect( KoDocument *doc, const TQPtrList & views ); /** * Create a new empty document. @@ -318,8 +319,8 @@ protected: // protected methods are mostly for koshell, it's the only one derivi */ virtual bool saveDocument( bool saveas = false, bool silent = false ); - virtual void closeEvent( QCloseEvent * e ); - virtual void resizeEvent( QResizeEvent * e ); + virtual void closeEvent( TQCloseEvent * e ); + virtual void resizeEvent( TQResizeEvent * e ); /** * Ask user about saving changes to the document upon exit. @@ -363,7 +364,7 @@ private: * * @return true if the document should be saved */ - bool exportConfirmation( const QCString &outputFormat ); + bool exportConfirmation( const TQCString &outputFormat ); void saveWindowSettings(); @@ -375,9 +376,9 @@ protected slots: private slots: void slotProgress(int value); void slotLoadCompleted(); - void slotLoadCanceled (const QString &); + void slotLoadCanceled (const TQString &); void slotSaveCompleted(); - void slotSaveCanceled(const QString &); + void slotSaveCanceled(const TQString &); private: KoMainWindowPrivate *d; diff --git a/lib/kofficecore/KoMainWindowIface.cc b/lib/kofficecore/KoMainWindowIface.cc index 356bd80b..6d38fae0 100644 --- a/lib/kofficecore/KoMainWindowIface.cc +++ b/lib/kofficecore/KoMainWindowIface.cc @@ -27,7 +27,7 @@ #include KoMainWindowIface::KoMainWindowIface( KoMainWindow *mainwindow ) - : DCOPObject( mainwindow ) + : DCOPObject( TQT_TQOBJECT(mainwindow) ) { m_pMainWindow = mainwindow; m_actionProxy = new KDCOPActionProxy( mainwindow->actionCollection(), this ); @@ -38,7 +38,7 @@ KoMainWindowIface::~KoMainWindowIface() delete m_actionProxy; } -DCOPRef KoMainWindowIface::action( const QCString &name ) +DCOPRef KoMainWindowIface::action( const TQCString &name ) { return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) ); } @@ -46,16 +46,16 @@ DCOPRef KoMainWindowIface::action( const QCString &name ) QCStringList KoMainWindowIface::actions() { QCStringList res; - QValueList lst = m_actionProxy->actions(); - QValueList::ConstIterator it = lst.begin(); - QValueList::ConstIterator end = lst.end(); + TQValueList lst = m_actionProxy->actions(); + TQValueList::ConstIterator it = lst.begin(); + TQValueList::ConstIterator end = lst.end(); for (; it != end; ++it ) res.append( (*it)->name() ); return res; } -QMap KoMainWindowIface::actionMap() +TQMap KoMainWindowIface::actionMap() { return m_actionProxy->actionMap(); } diff --git a/lib/kofficecore/KoMainWindowIface.h b/lib/kofficecore/KoMainWindowIface.h index 6b7c3cb6..9a81bc4b 100644 --- a/lib/kofficecore/KoMainWindowIface.h +++ b/lib/kofficecore/KoMainWindowIface.h @@ -35,9 +35,9 @@ public: virtual ~KoMainWindowIface(); k_dcop: - DCOPRef action( const QCString &name ); + DCOPRef action( const TQCString &name ); QCStringList actions(); - QMap actionMap(); + TQMap actionMap(); ASYNC print(bool quick); protected: diff --git a/lib/kofficecore/KoOasisLoadingContext.cpp b/lib/kofficecore/KoOasisLoadingContext.cpp index fdad0ecc..e5082dc8 100644 --- a/lib/kofficecore/KoOasisLoadingContext.cpp +++ b/lib/kofficecore/KoOasisLoadingContext.cpp @@ -31,7 +31,7 @@ KoOasisLoadingContext::KoOasisLoadingContext( KoDocument* doc, { // Ideally this should be done by KoDocument and passed as argument here... KoOasisStore oasisStore( store ); - QString dummy; + TQString dummy; (void)oasisStore.loadAndParse( "tar:/META-INF/manifest.xml", m_manifestDoc, dummy ); } @@ -41,12 +41,12 @@ KoOasisLoadingContext::~KoOasisLoadingContext() } -void KoOasisLoadingContext::fillStyleStack( const QDomElement& object, const char* nsURI, const char* attrName, const char* family ) +void KoOasisLoadingContext::fillStyleStack( const TQDomElement& object, const char* nsURI, const char* attrName, const char* family ) { // find all styles associated with an object and push them on the stack if ( object.hasAttributeNS( nsURI, attrName ) ) { - const QString styleName = object.attributeNS( nsURI, attrName, QString::null ); - const QDomElement* style = 0; + const TQString styleName = object.attributeNS( nsURI, attrName, TQString() ); + const TQDomElement* style = 0; bool isStyleAutoStyle = false; if ( m_useStylesAutoStyles ) { // When loading something from styles.xml, look into the styles.xml auto styles first @@ -64,39 +64,39 @@ void KoOasisLoadingContext::fillStyleStack( const QDomElement& object, const cha } } -void KoOasisLoadingContext::addStyles( const QDomElement* style, const char* family, bool usingStylesAutoStyles ) +void KoOasisLoadingContext::addStyles( const TQDomElement* style, const char* family, bool usingStylesAutoStyles ) { Q_ASSERT( style ); if ( !style ) return; - // this recursive function is necessary as parent styles can have parents themselves - if ( style->hasAttributeNS( KoXmlNS::style, "parent-style-name" ) ) { - const QString parentStyleName = style->attributeNS( KoXmlNS::style, "parent-style-name", QString::null ); - const QDomElement* parentStyle = 0; + // this recursive function is necessary as tqparent styles can have tqparents themselves + if ( style->hasAttributeNS( KoXmlNS::style, "tqparent-style-name" ) ) { + const TQString tqparentStyleName = style->attributeNS( KoXmlNS::style, "tqparent-style-name", TQString() ); + const TQDomElement* tqparentStyle = 0; if ( usingStylesAutoStyles ) { // When loading something from styles.xml, look into the styles.xml auto styles first - parentStyle = m_styles.findStyleAutoStyle( parentStyleName, family ); + tqparentStyle = m_styles.findStyleAutoStyle( tqparentStyleName, family ); // and fallback to looking at styles(), which includes the user styles from styles.xml } - if ( !parentStyle ) - parentStyle = m_styles.findStyle( parentStyleName, family ); - if ( parentStyle ) - addStyles( parentStyle, family, usingStylesAutoStyles ); + if ( !tqparentStyle ) + tqparentStyle = m_styles.findStyle( tqparentStyleName, family ); + if ( tqparentStyle ) + addStyles( tqparentStyle, family, usingStylesAutoStyles ); else - kdWarning(32500) << "Parent style not found: " << parentStyleName << endl; + kdWarning(32500) << "Parent style not found: " << tqparentStyleName << endl; } else if ( family ) { - const QDomElement* def = m_styles.defaultStyle( family ); + const TQDomElement* def = m_styles.defaultStyle( family ); if ( def ) { // on top of all, the default style for this family - //kdDebug(32500) << "pushing default style " << style->attributeNS( KoXmlNS::style, "name", QString::null ) << endl; + //kdDebug(32500) << "pushing default style " << style->attributeNS( KoXmlNS::style, "name", TQString() ) << endl; m_styleStack.push( *def ); } } - //kdDebug(32500) << "pushing style " << style->attributeNS( KoXmlNS::style, "name", QString::null ) << endl; + //kdDebug(32500) << "pushing style " << style->attributeNS( KoXmlNS::style, "name", TQString() ) << endl; m_styleStack.push( *style ); } -QString KoOasisLoadingContext::generator() const +TQString KoOasisLoadingContext::generator() const { parseMeta(); return m_generator; @@ -108,13 +108,13 @@ void KoOasisLoadingContext::parseMeta() const { if ( m_store->hasFile( "meta.xml" ) ) { - QDomDocument metaDoc; + TQDomDocument metaDoc; KoOasisStore oasisStore( m_store ); - QString errorMsg; + TQString errorMsg; if ( oasisStore.loadAndParse( "meta.xml", metaDoc, errorMsg ) ) { - QDomNode meta = KoDom::namedItemNS( metaDoc, KoXmlNS::office, "document-meta" ); - QDomNode office = KoDom::namedItemNS( meta, KoXmlNS::office, "meta" ); - QDomElement generator = KoDom::namedItemNS( office, KoXmlNS::meta, "generator" ); + TQDomNode meta = KoDom::namedItemNS( metaDoc, KoXmlNS::office, "document-meta" ); + TQDomNode office = KoDom::namedItemNS( meta, KoXmlNS::office, "meta" ); + TQDomElement generator = KoDom::namedItemNS( office, KoXmlNS::meta, "generator" ); if ( !generator.isNull() ) m_generator = generator.text(); } diff --git a/lib/kofficecore/KoOasisLoadingContext.h b/lib/kofficecore/KoOasisLoadingContext.h index cac1786b..880d4117 100644 --- a/lib/kofficecore/KoOasisLoadingContext.h +++ b/lib/kofficecore/KoOasisLoadingContext.h @@ -20,15 +20,15 @@ #define KOOASISLOADINGCONTEXT_H class KoXmlWriter; -class QDomElement; +class TQDomElement; class KoDocument; class KoOasisStyles; class KoPictureCollection; class KoStore; -#include +#include #include -#include +#include #include /** @@ -57,10 +57,10 @@ public: KoOasisStyles& oasisStyles() { return m_styles; } KoStyleStack& styleStack() { return m_styleStack; } - const QDomDocument& manifestDocument() const { return m_manifestDoc; } + const TQDomDocument& manifestDocument() const { return m_manifestDoc; } /// Return the of the document, e.g. "KOffice/1.4.0a" - QString generator() const; + TQString generator() const; /** * Convenience method for loading the style of an object @@ -68,21 +68,21 @@ public: * * Read attribute (nsURI,attrName) from the given dom element, * treat that attribute as a style name, and load that style - * including all its parent styles. + * including all its tqparent styles. * @param element the dom element to read the attribute from * @param nsURI the namespace URI of the attribute to read * @param attrName the name of the attribute to read * @param family the style family used for this object */ - void fillStyleStack( const QDomElement& element, const char* nsURI, const char* attrName, const char* family ); + void fillStyleStack( const TQDomElement& element, const char* nsURI, const char* attrName, const char* family ); /** - * Add @p style to the stack, as well as all its parent styles + * Add @p style to the stack, as well as all its tqparent styles * and the default style for this style family. * * @param style the dom element containing the style to add to the stack - * @param family the family to use when looking up parent styles - * @param usingStylesAutoStyles if true, the parent styles are looked up + * @param family the family to use when looking up tqparent styles + * @param usingStylesAutoStyles if true, the tqparent styles are looked up * in the automatic styles from styles.xml, instead of looking up * in the automatic styles from content.xml as we usually do. * This is useful for loading headers and footers for instance. @@ -90,7 +90,7 @@ public: * * Usually you would call fillStyleStack() instead. */ - void addStyles( const QDomElement* style, const char* family, bool usingStylesAutoStyles = false ); + void addStyles( const TQDomElement* style, const char* family, bool usingStylesAutoStyles = false ); /// Set to true while loading headers and footers, to remember to use auto styles /// from styles.xml @@ -106,13 +106,13 @@ private: KoOasisStyles& m_styles; KoStyleStack m_styleStack; - mutable QString m_generator; + mutable TQString m_generator; mutable bool m_metaXmlParsed; bool m_useStylesAutoStyles; bool m_unused1; // padding, can be used later bool m_unused2; // padding, can be used later - QDomDocument m_manifestDoc; + TQDomDocument m_manifestDoc; class Private; Private *d; diff --git a/lib/kofficecore/KoOasisSettings.cpp b/lib/kofficecore/KoOasisSettings.cpp index 99f63524..37a0acec 100644 --- a/lib/kofficecore/KoOasisSettings.cpp +++ b/lib/kofficecore/KoOasisSettings.cpp @@ -22,74 +22,74 @@ #include "KoDom.h" #include -KoOasisSettings::KoOasisSettings( const QDomDocument& doc ) +KoOasisSettings::KoOasisSettings( const TQDomDocument& doc ) : m_settingsElement( KoDom::namedItemNS( doc.documentElement(), KoXmlNS::office, "settings" ) ), m_configNSURI( KoXmlNS::config ) { - const QDomElement contents = doc.documentElement(); + const TQDomElement contents = doc.documentElement(); if ( m_settingsElement.isNull() ) kdDebug() << " document doesn't have tag 'office:settings'\n"; } -KoOasisSettings::KoOasisSettings( const QDomDocument& doc, const char* officeNSURI, const char* configNSURI ) +KoOasisSettings::KoOasisSettings( const TQDomDocument& doc, const char* officeNSURI, const char* configNSURI ) : m_settingsElement( KoDom::namedItemNS( doc.documentElement(), officeNSURI, "settings" ) ), m_configNSURI( configNSURI ) { - const QDomElement contents = doc.documentElement(); + const TQDomElement contents = doc.documentElement(); if ( m_settingsElement.isNull() ) kdDebug() << " document doesn't have tag 'office:settings'\n"; } -KoOasisSettings::Items KoOasisSettings::itemSet( const QString& itemSetName ) const +KoOasisSettings::Items KoOasisSettings::itemSet( const TQString& itemSetName ) const { - QDomElement e; + TQDomElement e; forEachElement( e, m_settingsElement ) { if ( e.localName() == "config-item-set" && e.namespaceURI() == m_configNSURI && - e.attributeNS( m_configNSURI, "name", QString::null ) == itemSetName ) + e.attributeNS( m_configNSURI, "name", TQString() ) == itemSetName ) { return Items( e, this ); } } - return Items( QDomElement(), this ); + return Items( TQDomElement(), this ); } -KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const QString& itemMapName ) const +KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const TQString& itemMapName ) const { - QDomElement configItem; + TQDomElement configItem; forEachElement( configItem, m_element ) { if ( configItem.localName() == "config-item-map-indexed" && configItem.namespaceURI() == m_settings->m_configNSURI && - configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName ) + configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName ) { return IndexedMap( configItem, m_settings ); } } - return IndexedMap( QDomElement(), m_settings ); + return IndexedMap( TQDomElement(), m_settings ); } -KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const QString& itemMapName ) const +KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const TQString& itemMapName ) const { - QDomElement configItem; + TQDomElement configItem; forEachElement( configItem, m_element ) { if ( configItem.localName() == "config-item-map-named" && configItem.namespaceURI() == m_settings->m_configNSURI && - configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName ) + configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName ) { return NamedMap( configItem, m_settings ); } } - return NamedMap( QDomElement(), m_settings ); + return NamedMap( TQDomElement(), m_settings ); } KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) const { int i = 0; - QDomElement entry; + TQDomElement entry; forEachElement( entry, m_element ) { if ( entry.localName() == "config-item-map-entry" && @@ -101,51 +101,51 @@ KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) cons ++i; } } - return Items( QDomElement(), m_settings ); + return Items( TQDomElement(), m_settings ); } -KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const QString& entryName ) const +KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const TQString& entryName ) const { - QDomElement entry; + TQDomElement entry; forEachElement( entry, m_element ) { if ( entry.localName() == "config-item-map-entry" && entry.namespaceURI() == m_settings->m_configNSURI && - entry.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == entryName ) + entry.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == entryName ) { return Items( entry, m_settings ); } } - return Items( QDomElement(), m_settings ); + return Items( TQDomElement(), m_settings ); } // helper method -QString KoOasisSettings::Items::findConfigItem( const QDomElement& element, - const QString& item, bool* ok ) const +TQString KoOasisSettings::Items::findConfigItem( const TQDomElement& element, + const TQString& item, bool* ok ) const { - QDomElement it; + TQDomElement it; forEachElement( it, element ) { if ( it.localName() == "config-item" && it.namespaceURI() == m_settings->m_configNSURI && - it.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == item ) + it.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == item ) { *ok = true; return it.text(); } } *ok = false; - return QString::null; + return TQString(); } -QString KoOasisSettings::Items::findConfigItem( const QString& item, bool* ok ) const +TQString KoOasisSettings::Items::findConfigItem( const TQString& item, bool* ok ) const { return findConfigItem( m_element, item, ok ); } #if 0 // does anyone need this one? passing a default value does the job, too -bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const +bool KoOasisSettings::Items::hasConfigItem( const TQString& configName ) const { bool ok; (void)findConfigItem( configName, &ok ); @@ -153,17 +153,17 @@ bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const } #endif -QString KoOasisSettings::Items::parseConfigItemString( const QString& configName, const QString& defValue ) const +TQString KoOasisSettings::Items::parseConfigItemString( const TQString& configName, const TQString& defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); return ok ? str : defValue; } -int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int defValue ) const +int KoOasisSettings::Items::parseConfigItemInt( const TQString& configName, int defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); int value; if ( ok ) { value = str.toInt( &ok ); @@ -173,10 +173,10 @@ int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int d return defValue; } -double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName, double defValue ) const +double KoOasisSettings::Items::parseConfigItemDouble( const TQString& configName, double defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); double value; if ( ok ) { value = str.toDouble( &ok ); @@ -186,10 +186,10 @@ double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName, return defValue; } -bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, bool defValue ) const +bool KoOasisSettings::Items::parseConfigItemBool( const TQString& configName, bool defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); if ( str == "true" ) return true; else if ( str == "false" ) @@ -197,10 +197,10 @@ bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, boo return defValue; } -short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, short defValue ) const +short KoOasisSettings::Items::parseConfigItemShort( const TQString& configName, short defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); short value; if ( ok ) { value = str.toShort( &ok ); @@ -210,10 +210,10 @@ short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, s return defValue; } -long KoOasisSettings::Items::parseConfigItemLong( const QString& configName, long defValue ) const +long KoOasisSettings::Items::parseConfigItemLong( const TQString& configName, long defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); long value; if ( ok ) { value = str.toLong( &ok ); diff --git a/lib/kofficecore/KoOasisSettings.h b/lib/kofficecore/KoOasisSettings.h index cd1ae112..4a213ca4 100644 --- a/lib/kofficecore/KoOasisSettings.h +++ b/lib/kofficecore/KoOasisSettings.h @@ -22,7 +22,7 @@ #ifndef KOOASISSETTINGS_H #define KOOASISSETTINGS_H -#include +#include #include /** @@ -73,12 +73,12 @@ public: /** * Normal KoOasisSettings constructor, for an OASIS settings.xml */ - explicit KoOasisSettings( const QDomDocument& doc ); + explicit KoOasisSettings( const TQDomDocument& doc ); /** * KoOasisSettings constructor for an OpenOffice-1.1 file */ - KoOasisSettings( const QDomDocument& doc, const char* officeNSURI, const char* configNSURI ); + KoOasisSettings( const TQDomDocument& doc, const char* officeNSURI, const char* configNSURI ); class Items; @@ -86,7 +86,7 @@ public: * Returns the toplevel item-set named @p itemSetName. * If not found, the returned items instance is null. */ - Items itemSet( const QString& itemSetName ) const; + Items itemSet( const TQString& itemSetName ) const; class IndexedMap; class NamedMap; @@ -96,7 +96,7 @@ public: friend class KoOasisSettings; friend class IndexedMap; friend class NamedMap; - Items( const QDomElement& elem, const KoOasisSettings* settings ) + Items( const TQDomElement& elem, const KoOasisSettings* settings ) : m_element( elem ), m_settings( settings ) {} public: bool isNull() const { return m_element.isNull(); } @@ -107,7 +107,7 @@ public: * An indexed map is an array (or sequence), i.e. items are supposed to * be retrieved by index. This is useful for e.g. "view 0", "view 1" etc. */ - IndexedMap indexedMap( const QString& itemMapName ) const; + IndexedMap indexedMap( const TQString& itemMapName ) const; /** * Look for the config-item-map-named named @p mapItemName and return it. @@ -115,21 +115,21 @@ public: * A named map is a map where items are retrieved by entry name, @see selectItemMapEntry * @return false if no such map was found */ - NamedMap namedMap( const QString& itemMapName ) const; - - int parseConfigItemInt( const QString& configName, int defValue = 0 ) const; - double parseConfigItemDouble( const QString& configName, double defValue = 0 ) const; - QString parseConfigItemString( const QString& configName, const QString& defValue = QString::null ) const; - bool parseConfigItemBool( const QString& configName, bool defValue = false ) const; - short parseConfigItemShort( const QString& configName, short defValue = 0 ) const; - long parseConfigItemLong( const QString& configName, long defValue = 0 ) const; + NamedMap namedMap( const TQString& itemMapName ) const; + + int parseConfigItemInt( const TQString& configName, int defValue = 0 ) const; + double parseConfigItemDouble( const TQString& configName, double defValue = 0 ) const; + TQString parseConfigItemString( const TQString& configName, const TQString& defValue = TQString() ) const; + bool parseConfigItemBool( const TQString& configName, bool defValue = false ) const; + short parseConfigItemShort( const TQString& configName, short defValue = 0 ) const; + long parseConfigItemLong( const TQString& configName, long defValue = 0 ) const; private: /// @internal - QString findConfigItem( const QString& item, bool* ok ) const; + TQString findConfigItem( const TQString& item, bool* ok ) const; /// @internal - QString findConfigItem( const QDomElement& element, const QString& item, bool* ok ) const; + TQString findConfigItem( const TQDomElement& element, const TQString& item, bool* ok ) const; - QDomElement m_element; + TQDomElement m_element; const KoOasisSettings* m_settings; }; @@ -139,16 +139,16 @@ public: public: bool isNull() const { return m_element.isNull(); } protected: - Map( const QDomElement& elem, const KoOasisSettings* settings ) + Map( const TQDomElement& elem, const KoOasisSettings* settings ) : m_element( elem ), m_settings( settings ) {} - const QDomElement m_element; + const TQDomElement m_element; const KoOasisSettings* m_settings; }; class KOFFICECORE_EXPORT IndexedMap : public Map { friend class Items; - IndexedMap( const QDomElement& elem, const KoOasisSettings* settings ) + IndexedMap( const TQDomElement& elem, const KoOasisSettings* settings ) : Map( elem, settings ) {} public: /// Returns an entry in an indexed map @@ -158,18 +158,18 @@ public: class KOFFICECORE_EXPORT NamedMap : public Map { friend class Items; - NamedMap( const QDomElement& elem, const KoOasisSettings* settings ) + NamedMap( const TQDomElement& elem, const KoOasisSettings* settings ) : Map( elem, settings ) {} public: /// Returns an entry in a named map - Items entry( const QString& entryName ) const; + Items entry( const TQString& entryName ) const; }; private: friend class Items; friend class IndexedMap; friend class NamedMap; - const QDomElement m_settingsElement; + const TQDomElement m_settingsElement; const char* m_configNSURI; class Private; diff --git a/lib/kofficecore/KoOasisStore.cpp b/lib/kofficecore/KoOasisStore.cpp index 1b7537ae..7eec46a5 100644 --- a/lib/kofficecore/KoOasisStore.cpp +++ b/lib/kofficecore/KoOasisStore.cpp @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include KoOasisStore::KoOasisStore( KoStore* store ) : m_store( store ), @@ -78,7 +78,7 @@ KoXmlWriter* KoOasisStore::bodyWriter() Q_ASSERT( !m_contentTmpFile ); m_contentTmpFile = new KTempFile; m_contentTmpFile->setAutoDelete( true ); - m_bodyWriter = new KoXmlWriter( m_contentTmpFile->file(), 1 ); + m_bodyWriter = new KoXmlWriter( TQT_TQIODEVICE(m_contentTmpFile->file()), 1 ); } return m_bodyWriter; } @@ -90,9 +90,9 @@ bool KoOasisStore::closeContentWriter() delete m_bodyWriter; m_bodyWriter = 0; // copy over the contents from the tempfile to the real one - QFile* tmpFile = m_contentTmpFile->file(); + TQFile* tmpFile = m_contentTmpFile->file(); tmpFile->close(); - m_contentWriter->addCompleteElement( tmpFile ); + m_contentWriter->addCompleteElement( TQT_TQIODEVICE(tmpFile) ); m_contentTmpFile->close(); delete m_contentTmpFile; m_contentTmpFile = 0; @@ -111,9 +111,9 @@ KoXmlWriter* KoOasisStore::manifestWriter( const char* mimeType ) if ( !m_manifestWriter ) { // the pointer to the buffer is already stored in the KoXmlWriter, no need to store it here as well - QBuffer *manifestBuffer = new QBuffer; + TQBuffer *manifestBuffer = new TQBuffer; manifestBuffer->open( IO_WriteOnly ); - m_manifestWriter = new KoXmlWriter( manifestBuffer ); + m_manifestWriter = new KoXmlWriter( TQT_TQIODEVICE(manifestBuffer) ); m_manifestWriter->startDocument( "manifest:manifest" ); m_manifestWriter->startElement( "manifest:manifest" ); m_manifestWriter->addAttribute( "xmlns:manifest", KoXmlNS::manifest ); @@ -126,39 +126,39 @@ bool KoOasisStore::closeManifestWriter() { m_manifestWriter->endElement(); m_manifestWriter->endDocument(); - QBuffer* buffer = static_cast( m_manifestWriter->device() ); + TQBuffer* buffer = TQT_TQBUFFER( static_cast(m_manifestWriter->device()) ); delete m_manifestWriter; m_manifestWriter = 0; bool ok = false; if ( m_store->open( "META-INF/manifest.xml" ) ) { - Q_LONG written = m_store->write( buffer->buffer() ); - ok = ( written == (Q_LONG)buffer->buffer().size() && m_store->close() ); + TQ_LONG written = m_store->write( buffer->buffer() ); + ok = ( written == (TQ_LONG)buffer->buffer().size() && m_store->close() ); } delete buffer; return ok; } -bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QString& errorMessage ) +bool KoOasisStore::loadAndParse( const TQString& fileName, TQDomDocument& doc, TQString& errorMessage ) { //kdDebug(30003) << "loadAndParse: Trying to open " << fileName << endl; if (!m_store->open(fileName)) { kdWarning(30003) << "Entry " << fileName << " not found!" << endl; - errorMessage = i18n( "Could not find %1" ).arg( fileName ); + errorMessage = i18n( "Could not tqfind %1" ).tqarg( fileName ); return false; } - // Error variables for QDomDocument::setContent - QString errorMsg; + // Error variables for TQDomDocument::setContent + TQString errorMsg; int errorLine, errorColumn; // We need to be able to see the space in , this is why // we activate the "report-whitespace-only-CharData" feature. // Unfortunately this leads to lots of whitespace text nodes in between real // elements in the rest of the document, watch out for that. - QXmlInputSource source( m_store->device() ); - // Copied from QDomDocumentPrivate::setContent, to change the whitespace thing - QXmlSimpleReader reader; + TQXmlInputSource source( m_store->device() ); + // Copied from TQDomDocumentPrivate::setContent, to change the whitespace thing + TQXmlSimpleReader reader; KoDocument::setupXmlReader( reader, true /*namespaceProcessing*/ ); bool ok = doc.setContent( &source, &reader, &errorMsg, &errorLine, &errorColumn ); @@ -168,7 +168,7 @@ bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QSt << " In line: " << errorLine << ", column: " << errorColumn << endl << " Error message: " << errorMsg << endl; errorMessage = i18n( "Parsing error in the main document at line %1, column %2\nError message: %3" ) - .arg( errorLine ).arg( errorColumn ).arg( i18n ( "QXml", errorMsg.utf8() ) ); + .tqarg( errorLine ).tqarg( errorColumn ).tqarg( i18n ( "TQXml", errorMsg.utf8() ) ); } else { @@ -178,17 +178,17 @@ bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QSt return ok; } -QString KoOasisStore::mimeForPath( const QDomDocument& doc, const QString& fullPath ) +TQString KoOasisStore::mimeForPath( const TQDomDocument& doc, const TQString& fullPath ) { - QDomElement docElem = doc.documentElement(); - QDomElement elem; + TQDomElement docElem = doc.documentElement(); + TQDomElement elem; forEachElement( elem, docElem ) { if ( elem.localName() == "file-entry" && elem.namespaceURI() == KoXmlNS::manifest ) { - if ( elem.attributeNS( KoXmlNS::manifest, "full-path", QString::null ) == fullPath ) - return elem.attributeNS( KoXmlNS::manifest, "media-type", QString::null ); + if ( elem.attributeNS( KoXmlNS::manifest, "full-path", TQString() ) == fullPath ) + return elem.attributeNS( KoXmlNS::manifest, "media-type", TQString() ); } } - return QString::null; + return TQString(); } diff --git a/lib/kofficecore/KoOasisStore.h b/lib/kofficecore/KoOasisStore.h index 506700b0..e33e9526 100644 --- a/lib/kofficecore/KoOasisStore.h +++ b/lib/kofficecore/KoOasisStore.h @@ -18,13 +18,13 @@ #ifndef KOOASISSTORE_H #define KOOASISSTORE_H -class QString; -class QDomDocument; +class TQString; +class TQDomDocument; class KTempFile; class KoXmlWriter; class KoStore; class KoStoreDevice; -class QIODevice; +class TQIODevice; /** * Helper class around KoStore for writing out OASIS files. @@ -79,10 +79,10 @@ public: bool closeManifestWriter(); /// A completely unrelated method, for loading a file from an oasis store - bool loadAndParse( const QString& fileName, QDomDocument& doc, QString& errorMessage ); + bool loadAndParse( const TQString& fileName, TQDomDocument& doc, TQString& errorMessage ); /// Another method for loading: get mimetype from full path, using the manifest - static QString mimeForPath( const QDomDocument& doc, const QString& fullPath ); + static TQString mimeForPath( const TQDomDocument& doc, const TQString& fullPath ); private: KoStore* m_store; diff --git a/lib/kofficecore/KoOasisStyles.cpp b/lib/kofficecore/KoOasisStyles.cpp index 3a018767..d135a501 100644 --- a/lib/kofficecore/KoOasisStyles.cpp +++ b/lib/kofficecore/KoOasisStyles.cpp @@ -19,22 +19,22 @@ #include "KoOasisStyles.h" #include #include -#include +#include #include "KoDom.h" #include "KoXmlNS.h" #include "KoGenStyles.h" -#include +#include #include #include -#include +#include #include class KoOasisStyles::Private { public: // The key of the map is the family - QMap > m_styles; - QMap > m_stylesAutoStyles; + TQMap > m_styles; + TQMap > m_stylesAutoStyles; }; KoOasisStyles::KoOasisStyles() @@ -51,11 +51,11 @@ KoOasisStyles::~KoOasisStyles() delete d; } -void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) +void KoOasisStyles::createStyleMap( const TQDomDocument& doc, bool stylesDotXml ) { - const QDomElement docElement = doc.documentElement(); + const TQDomElement docElement = doc.documentElement(); // We used to have the office:version check here, but better let the apps do that - QDomElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-decls" ); + TQDomElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-decls" ); if ( !fontStyles.isNull() ) { //kdDebug(30003) << "Starting reading in font-decl..." << endl; @@ -65,7 +65,7 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Starting reading in office:automatic-styles. stylesDotXml=" << stylesDotXml << endl; - QDomElement autoStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "automatic-styles" ); + TQDomElement autoStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "automatic-styles" ); if ( !autoStyles.isNull() ) { insertStyles( autoStyles, stylesDotXml ); }// else @@ -74,17 +74,17 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Reading in master styles" << endl; - QDomNode masterStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "master-styles" ); + TQDomNode masterStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "master-styles" ); if ( !masterStyles.isNull() ) { - QDomElement master; + TQDomElement master; forEachElement( master, masterStyles ) { if ( master.localName() == "master-page" && master.namespaceURI() == KoXmlNS::style ) { - const QString name = master.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString name = master.attributeNS( KoXmlNS::style, "name", TQString() ); kdDebug(30003) << "Master style: '" << name << "' loaded " << endl; - m_masterPages.insert( name, new QDomElement( master ) ); + m_masterPages.insert( name, new TQDomElement( master ) ); } else // OASIS docu mentions style:handout-master and draw:layer-set here kdWarning(30003) << "Unknown tag " << master.tagName() << " in office:master-styles" << endl; @@ -94,7 +94,7 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) kdDebug(30003) << "Starting reading in office:styles" << endl; - const QDomElement officeStyle = KoDom::namedItemNS( docElement, KoXmlNS::office, "styles" ); + const TQDomElement officeStyle = KoDom::namedItemNS( docElement, KoXmlNS::office, "styles" ); if ( !officeStyle.isNull() ) { m_officeStyle = officeStyle; @@ -105,12 +105,12 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Styles read in." << endl; } -QValueVector KoOasisStyles::userStyles() const +TQValueVector KoOasisStyles::userStyles() const { - QValueVector vec; + TQValueVector vec; // Collect user styles unsigned int i = 0; - QDomElement e; + TQDomElement e; forEachElement( e, m_officeStyle ) { if ( e.localName() == "style" && @@ -123,20 +123,20 @@ QValueVector KoOasisStyles::userStyles() const return vec; } -const QDict& KoOasisStyles::styles(const QString& family) const +const TQDict& KoOasisStyles::styles(const TQString& family) const { // hmm this can create an empty item in the map, but otherwise we couldn't // return a const reference. return d->m_styles[family]; } -void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) +void KoOasisStyles::insertOfficeStyles( const TQDomElement& styles ) { - QDomElement e; + TQDomElement e; forEachElement( e, styles ) { - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); if ( ( ns == KoXmlNS::svg && ( localName == "linearGradient" || localName == "radialGradient" ) ) @@ -149,9 +149,9 @@ void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) || localName == "opacity" ) ) ) { - const QString name = e.attributeNS( KoXmlNS::draw, "name", QString::null ); + const TQString name = e.attributeNS( KoXmlNS::draw, "name", TQString() ); Q_ASSERT( !name.isEmpty() ); - QDomElement* ep = new QDomElement( e ); + TQDomElement* ep = new TQDomElement( e ); m_drawStyles.insert( name, ep ); } else @@ -160,53 +160,53 @@ void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) } -void KoOasisStyles::insertStyles( const QDomElement& styles, bool styleAutoStyles ) +void KoOasisStyles::insertStyles( const TQDomElement& styles, bool styleAutoStyles ) { //kdDebug(30003) << "Inserting styles from " << styles.tagName() << endl; - QDomElement e; + TQDomElement e; forEachElement( e, styles ) insertStyle( e, styleAutoStyles ); } -void KoOasisStyles::insertStyle( const QDomElement& e, bool styleAutoStyles ) +void KoOasisStyles::insertStyle( const TQDomElement& e, bool styleAutoStyles ) { - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); - const QString name = e.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString name = e.attributeNS( KoXmlNS::style, "name", TQString() ); if ( ns == KoXmlNS::style && localName == "style" ) { - const QString family = e.attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString family = e.attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleAutoStyles ) { - QDict& dict = d->m_stylesAutoStyles[ family ]; + TQDict& dict = d->m_stylesAutoStyles[ family ]; dict.setAutoDelete( true ); - if ( dict.find( name ) != 0 ) + if ( dict.tqfind( name ) != 0 ) kdDebug(30003) << "Auto-style: '" << name << "' already exists" << endl; - dict.insert( name, new QDomElement( e ) ); + dict.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "Style: '" << name << "' loaded as a style auto style" << endl; } else { - QDict& dict = d->m_styles[ family ]; + TQDict& dict = d->m_styles[ family ]; dict.setAutoDelete( true ); - if ( dict.find( name ) != 0 ) + if ( dict.tqfind( name ) != 0 ) kdDebug(30003) << "Style: '" << name << "' already exists" << endl; - dict.insert( name, new QDomElement( e ) ); + dict.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "Style: '" << name << "' loaded " << endl; } } else if ( ns == KoXmlNS::style && ( - localName == "page-layout" + localName == "page-tqlayout" || localName == "font-decl" - || localName == "presentation-page-layout" ) ) + || localName == "presentation-page-tqlayout" ) ) { - if ( m_styles.find( name ) != 0 ) + if ( m_styles.tqfind( name ) != 0 ) kdDebug(30003) << "Style: '" << name << "' already exists" << endl; - m_styles.insert( name, new QDomElement( e ) ); + m_styles.insert( name, new TQDomElement( e ) ); } else if ( localName == "default-style" && ns == KoXmlNS::style ) { - const QString family = e.attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString family = e.attributeNS( KoXmlNS::style, "family", TQString() ); if ( !family.isEmpty() ) - m_defaultStyle.insert( family, new QDomElement( e ) ); + m_defaultStyle.insert( family, new TQDomElement( e ) ); } else if ( localName == "list-style" && ns == KoXmlNS::text ) { - m_listStyles.insert( name, new QDomElement( e ) ); + m_listStyles.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "List style: '" << name << "' loaded " << endl; } else if ( ns == KoXmlNS::number && ( localName == "number-style" @@ -221,14 +221,14 @@ void KoOasisStyles::insertStyle( const QDomElement& e, bool styleAutoStyles ) // The rest (text:*-configuration and text:outline-style) is to be done by the apps. } -// OO spec 2.5.4. p68. Conversion to Qt format: see qdate.html +// OO spec 2.5.4. p68. Conversion to TQt format: see qdate.html // OpenCalcImport::loadFormat has similar code, but slower, intermixed with other stuff, // lacking long-textual forms. -void KoOasisStyles::importDataStyle( const QDomElement& parent ) +void KoOasisStyles::importDataStyle( const TQDomElement& tqparent ) { NumericStyleFormat dataStyle; - const QString localName = parent.localName(); + const TQString localName = tqparent.localName(); if (localName == "number-style") dataStyle.type = NumericStyleFormat::Number; else if (localName == "currency-style") @@ -244,7 +244,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) else if (localName == "time-style") dataStyle.type = NumericStyleFormat::Time; - QString format; + TQString format; int precision = -1; int leadingZ = 1; bool thousandsSep = false; @@ -252,26 +252,26 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) //bool negRed = false; bool ok = false; int i = 0; - QDomElement e; - QString prefix; - QString suffix; - forEachElement( e, parent ) + TQDomElement e; + TQString prefix; + TQString suffix; + forEachElement( e, tqparent ) { if ( e.namespaceURI() != KoXmlNS::number ) continue; - QString localName = e.localName(); - const QString numberStyle = e.attributeNS( KoXmlNS::number, "style", QString::null ); + TQString localName = e.localName(); + const TQString numberStyle = e.attributeNS( KoXmlNS::number, "style", TQString() ); const bool shortForm = numberStyle == "short" || numberStyle.isEmpty(); if ( localName == "day" ) { format += shortForm ? "d" : "dd"; } else if ( localName == "day-of-week" ) { format += shortForm ? "ddd" : "dddd"; } else if ( localName == "month" ) { - if ( e.attributeNS( KoXmlNS::number, "possessive-form", QString::null ) == "true" ) { + if ( e.attributeNS( KoXmlNS::number, "possessive-form", TQString() ) == "true" ) { format += shortForm ? "PPP" : "PPPP"; } // TODO the spec has a strange mention of number:format-source - else if ( e.attributeNS( KoXmlNS::number, "textual", QString::null ) == "true" ) { + else if ( e.attributeNS( KoXmlNS::number, "textual", TQString() ) == "true" ) { format += shortForm ? "MMM" : "MMMM"; } else { // month number format += shortForm ? "M" : "MM"; @@ -281,7 +281,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } else if ( localName == "era" ) { //TODO I don't know what is it... (define into oo spec) } else if ( localName == "week-of-year" || localName == "quarter") { - // ### not supported in Qt + // ### not supported in TQt } else if ( localName == "hours" ) { format += shortForm ? "h" : "hh"; } else if ( localName == "minutes" ) { @@ -309,13 +309,13 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) // TODO: number:grouping="true" if ( e.hasAttributeNS( KoXmlNS::number, "decimal-places" ) ) { - int d = e.attributeNS( KoXmlNS::number, "decimal-places", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "decimal-places", TQString() ).toInt( &ok ); if ( ok ) precision = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) leadingZ = d; } @@ -345,21 +345,21 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) if ( e.hasAttributeNS( KoXmlNS::number, "decimal-places" ) ) { - int d = e.attributeNS( KoXmlNS::number, "decimal-places", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "decimal-places", TQString() ).toInt( &ok ); if ( ok ) precision = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) leadingZ = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-exponent-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-exponent-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-exponent-digits", TQString() ).toInt( &ok ); if ( ok ) exp = d; if ( exp <= 0 ) @@ -399,25 +399,25 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) int denominatorValue=0; if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) integer = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-numerator-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-numerator-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-numerator-digits", TQString() ).toInt( &ok ); if ( ok ) numerator = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-denominator-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-denominator-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-denominator-digits", TQString() ).toInt( &ok ); if ( ok ) denominator = d; } if ( e.hasAttributeNS( KoXmlNS::number, "denominator-value" ) ) { - int d = e.attributeNS( KoXmlNS::number, "denominator-value", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "denominator-value", TQString() ).toInt( &ok ); if ( ok ) denominatorValue = d; } @@ -433,7 +433,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format+='/'; if ( denominatorValue != 0 ) - format+=QString::number( denominatorValue ); + format+=TQString::number( denominatorValue ); else { for ( i = 0; i < denominator; ++i ) @@ -446,7 +446,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } - const QString styleName = parent.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString styleName = tqparent.attributeNS( KoXmlNS::style, "name", TQString() ); kdDebug(30003) << "data style: " << styleName << " qt format=" << format << endl; if ( !prefix.isEmpty() ) { @@ -456,7 +456,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format = format.right( format.length()-prefix.length() ); } else - prefix = QString::null; + prefix = TQString(); } if ( !suffix.isEmpty() ) { @@ -466,7 +466,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format = format.left( format.length()-suffix.length() ); } else - suffix = QString::null; + suffix = TQString(); } dataStyle.formatStr = format; @@ -487,9 +487,9 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } \ } -void KoOasisStyles::parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) +void KoOasisStyles::parseOasisTimeKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ) { - kdDebug(30003)<<"parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) :"< 0 ); addTextNumber( text, elementWriter ); } - QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); currentStyle.addChildElement( "number", elementContents ); return mainStyles.lookup( currentStyle, "N" ); } //convert klocale string to good format -void KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) +void KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ) { - kdDebug(30003)<<"KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) :"< // //% // - kdDebug(30003)<<"QString saveOasisPercentageStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< // // //example 000,000e+0000 - kdDebug(30003)<<"QString saveOasisScientificStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< @@ -1230,14 +1230,14 @@ QString KoOasisStyles::saveOasisCurrencyStyle( KoGenStyles &mainStyles, //VEB // - kdDebug(30003)<<"QString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< // /// - kdDebug(30003)<<"QString saveOasisTextStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format<( 1 ) ); @@ -1436,7 +1436,7 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const tmpBrush.setColor(styleStack.attributeNS( KoXmlNS::draw, "fill-color" ) ); if ( styleStack.hasAttributeNS( KoXmlNS::draw, "transparency" ) ) { - QString transparency = styleStack.attributeNS( KoXmlNS::draw, "transparency" ); + TQString transparency = styleStack.attributeNS( KoXmlNS::draw, "transparency" ); if ( transparency == "94%" ) { tmpBrush.setStyle(Qt::Dense1Pattern); @@ -1476,25 +1476,25 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const } else if ( fill == "hatch" ) { - QString style = styleStack.attributeNS( KoXmlNS::draw, "fill-hatch-name" ); + TQString style = styleStack.attributeNS( KoXmlNS::draw, "fill-hatch-name" ); kdDebug()<<" hatch style is : "<hasAttributeNS( KoXmlNS::draw, "rotation" )) { - angle = (draw->attributeNS( KoXmlNS::draw, "rotation", QString::null ).toInt())/10; + angle = (draw->attributeNS( KoXmlNS::draw, "rotation", TQString() ).toInt())/10; kdDebug()<<"angle :"<hasAttributeNS( KoXmlNS::draw, "color" ) ) { - //kdDebug()<<" draw:color :"<attributeNS( KoXmlNS::draw, "color", QString::null )<attributeNS( KoXmlNS::draw, "color", QString::null ) ); + //kdDebug()<<" draw:color :"<attributeNS( KoXmlNS::draw, "color", TQString() )<attributeNS( KoXmlNS::draw, "color", TQString() ) ); } if( draw->hasAttributeNS( KoXmlNS::draw, "distance" )) { @@ -1507,7 +1507,7 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const if( draw->hasAttributeNS( KoXmlNS::draw, "style" )) { //todo implemente it into kpresenter - QString styleHash = draw->attributeNS( KoXmlNS::draw, "style", QString::null ); + TQString styleHash = draw->attributeNS( KoXmlNS::draw, "style", TQString() ); if( styleHash == "single") { switch( angle ) @@ -1567,21 +1567,21 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const return tmpBrush; } -const QDomElement* KoOasisStyles::defaultStyle( const QString& family ) const +const TQDomElement* KoOasisStyles::defaultStyle( const TQString& family ) const { return m_defaultStyle[family]; } -const QDomElement* KoOasisStyles::findStyle( const QString& name ) const +const TQDomElement* KoOasisStyles::findStyle( const TQString& name ) const { return m_styles[ name ]; } -const QDomElement* KoOasisStyles::findStyle( const QString& styleName, const QString& family ) const +const TQDomElement* KoOasisStyles::findStyle( const TQString& styleName, const TQString& family ) const { - const QDomElement* style = d->m_styles[ family ][ styleName ]; + const TQDomElement* style = d->m_styles[ family ][ styleName ]; if ( style && !family.isEmpty() ) { - const QString styleFamily = style->attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString styleFamily = style->attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleFamily != family ) { kdWarning() << "KoOasisStyles: was looking for style " << styleName << " in family " << family << " but got " << styleFamily << endl; @@ -1590,11 +1590,11 @@ const QDomElement* KoOasisStyles::findStyle( const QString& styleName, const QSt return style; } -const QDomElement* KoOasisStyles::findStyleAutoStyle( const QString& styleName, const QString& family ) const +const TQDomElement* KoOasisStyles::findStyleAutoStyle( const TQString& styleName, const TQString& family ) const { - const QDomElement* style = d->m_stylesAutoStyles[ family ][ styleName ]; + const TQDomElement* style = d->m_stylesAutoStyles[ family ][ styleName ]; if ( style ) { - const QString styleFamily = style->attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString styleFamily = style->attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleFamily != family ) { kdWarning() << "KoOasisStyles: was looking for style " << styleName << " in family " << family << " but got " << styleFamily << endl; diff --git a/lib/kofficecore/KoOasisStyles.h b/lib/kofficecore/KoOasisStyles.h index caa8d513..9a8e64e4 100644 --- a/lib/kofficecore/KoOasisStyles.h +++ b/lib/kofficecore/KoOasisStyles.h @@ -19,15 +19,15 @@ #ifndef KOOASISSTYLES_H #define KOOASISSTYLES_H -#include -#include -#include -#include +#include +#include +#include +#include #include class KoGenStyles; class KoXmlWriter; -class QBrush; +class TQBrush; class KoGenStyle; class KoStyleStack; @@ -43,119 +43,119 @@ public: /// Look into @p doc for styles and remember them /// @param doc document to look into /// @param stylesDotXml true when loading styles.xml, false otherwise - void createStyleMap( const QDomDocument& doc, bool stylesDotXml ); + void createStyleMap( const TQDomDocument& doc, bool stylesDotXml ); /** * Look up a style by name. - * This method can find styles defined by the tags "style:page-layout", - * "style:presentation-page-layout", or "style:font-decl". + * This method can find styles defined by the tags "style:page-tqlayout", + * "style:presentation-page-tqlayout", or "style:font-decl". * Do NOT use this method for style:style styles. * * @param name the style name - * @return the dom element representing the style, or QString::null if it wasn't found. + * @return the dom element representing the style, or TQString() if it wasn't found. */ - const QDomElement* findStyle( const QString& name ) const; + const TQDomElement* findStyle( const TQString& name ) const; /** * Look up a style:style by name. * @param name the style name * @param family the style family (for a style:style, use 0 otherwise) - * @return the dom element representing the style, or QString::null if it wasn't found. + * @return the dom element representing the style, or TQString() if it wasn't found. */ - const QDomElement* findStyle( const QString& name, const QString& family ) const; + const TQDomElement* findStyle( const TQString& name, const TQString& family ) const; /// Similar to findStyle but for auto-styles in styles.xml only. - const QDomElement* findStyleAutoStyle( const QString& name, const QString& family ) const; + const TQDomElement* findStyleAutoStyle( const TQString& name, const TQString& family ) const; /// @return the style:styles that are "user styles", i.e. those from office:styles /// findStyle() is used for lookup. userStyles() is used to load all user styles upfront. - QValueVector userStyles() const; + TQValueVector userStyles() const; /// @return the default style for a given family ("graphic","paragraph","table" etc.) /// Returns 0 if no default style for this family is available - const QDomElement* defaultStyle( const QString& family ) const; + const TQDomElement* defaultStyle( const TQString& family ) const; /// @return the office:style element - const QDomElement& officeStyle() const { return m_officeStyle; } + const TQDomElement& officeStyle() const { return m_officeStyle; } /// @return all list styles ("text:list-style" elements), hashed by name - const QDict& listStyles() const { return m_listStyles; } + const TQDict& listStyles() const { return m_listStyles; } /// @return master pages ("style:master-page" elements), hashed by name - const QDict& masterPages() const { return m_masterPages; } + const TQDict& masterPages() const { return m_masterPages; } /// @return draw styles, hashed by name - const QDict& drawStyles() const { return m_drawStyles; } + const TQDict& drawStyles() const { return m_drawStyles; } /// @return all styles ("style:style" elements) for a given family, hashed by name - const QDict& styles(const QString& family) const; + const TQDict& styles(const TQString& family) const; /// Prefix and suffix are always included into formatStr. Having them as separate fields simply /// allows to extract them from formatStr, to display them in separate widgets. struct NumericStyleFormat { - QString formatStr; - QString prefix; - QString suffix; + TQString formatStr; + TQString prefix; + TQString suffix; enum { Number, Scientific, Fraction, Currency, Percentage, Date, Time, Boolean, Text } type; int precision; - QString currencySymbol; + TQString currencySymbol; }; - typedef QMap DataFormatsMap; + typedef TQMap DataFormatsMap; /// Value (date/time/number...) formats found while parsing styles. Used e.g. for fields. /// Key: format name. Value: const DataFormatsMap& dataFormats() const { return m_dataFormats; } - static QString saveOasisDateStyle( KoGenStyles &mainStyles, const QString & _format, bool klocaleFormat, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisTimeStyle( KoGenStyles &mainStyles, const QString & _format, bool klocaleFormat, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisFractionStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisScientificStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisNumberStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisPercentageStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const QString & _format, const QString &symbol, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisTextStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - - static void saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const QBrush & brush ); - static QString saveOasisHatchStyle( KoGenStyles& mainStyles, const QBrush &brush ); - - static QBrush loadOasisFillStyle( const KoStyleStack &styleStack, const QString & fill, const KoOasisStyles & oasisStyles ); + static TQString saveOasisDateStyle( KoGenStyles &mainStyles, const TQString & _format, bool klocaleFormat, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisTimeStyle( KoGenStyles &mainStyles, const TQString & _format, bool klocaleFormat, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisFractionStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisScientificStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisNumberStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisPercentageStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const TQString & _format, const TQString &symbol, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisTextStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + + static void saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const TQBrush & brush ); + static TQString saveOasisHatchStyle( KoGenStyles& mainStyles, const TQBrush &brush ); + + static TQBrush loadOasisFillStyle( const KoStyleStack &styleStack, const TQString & fill, const KoOasisStyles & oasisStyles ); private: /// Add styles to styles map - void insertStyles( const QDomElement& styles, bool styleAutoStyles = false ); + void insertStyles( const TQDomElement& styles, bool styleAutoStyles = false ); private: - void insertOfficeStyles( const QDomElement& styles ); - void insertStyle( const QDomElement& style, bool styleAutoStyles ); - void importDataStyle( const QDomElement& parent ); - static bool saveOasisTimeFormat( KoXmlWriter &elementWriter, QString & format, QString & text, bool &antislash ); - static void parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ); - static bool saveOasisKlocaleTimeFormat( KoXmlWriter &elementWriter, QString & format, QString & text ); - static void parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ); - static void addKofficeNumericStyleExtension( KoXmlWriter & elementWriter, const QString &_suffix, const QString &_prefix ); + void insertOfficeStyles( const TQDomElement& styles ); + void insertStyle( const TQDomElement& style, bool styleAutoStyles ); + void importDataStyle( const TQDomElement& tqparent ); + static bool saveOasisTimeFormat( KoXmlWriter &elementWriter, TQString & format, TQString & text, bool &antislash ); + static void parseOasisDateKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static bool saveOasisKlocaleTimeFormat( KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static void parseOasisTimeKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static void addKofficeNumericStyleExtension( KoXmlWriter & elementWriter, const TQString &_suffix, const TQString &_prefix ); KoOasisStyles( const KoOasisStyles & ); // forbidden KoOasisStyles& operator=( const KoOasisStyles & ); // forbidden private: - QDict m_styles; // page-layout, font-decl etc. - QDict m_defaultStyle; - QDomElement m_officeStyle; + TQDict m_styles; // page-tqlayout, font-decl etc. + TQDict m_defaultStyle; + TQDomElement m_officeStyle; - QDict m_masterPages; - QDict m_listStyles; + TQDict m_masterPages; + TQDict m_listStyles; - QDict m_drawStyles; + TQDict m_drawStyles; DataFormatsMap m_dataFormats; class Private; diff --git a/lib/kofficecore/KoOpenPane.cpp b/lib/kofficecore/KoOpenPane.cpp index 07c9580d..6c7cbb86 100644 --- a/lib/kofficecore/KoOpenPane.cpp +++ b/lib/kofficecore/KoOpenPane.cpp @@ -19,15 +19,15 @@ #include "KoOpenPane.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -45,15 +45,15 @@ #include -class KoSectionListItem : public QListViewItem +class KoSectionListItem : public TQListViewItem { public: - KoSectionListItem(KListView* listView, const QString& name, int sortWeight, int widgetIndex = -1) - : QListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex) + KoSectionListItem(KListView* listView, const TQString& name, int sortWeight, int widgetIndex = -1) + : TQListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex) { } - virtual int compare(QListViewItem* i, int, bool) const + virtual int compare(TQListViewItem* i, int, bool) const { KoSectionListItem* item = dynamic_cast(i); @@ -63,13 +63,13 @@ class KoSectionListItem : public QListViewItem return sortWeight() - item->sortWeight(); } - virtual void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align) + virtual void paintCell(TQPainter* p, const TQColorGroup& cg, int column, int width, int align) { if(widgetIndex() >= 0) { - QListViewItem::paintCell(p, cg, column, width, align); + TQListViewItem::paintCell(p, cg, column, width, align); } else { int ypos = (height() - 2) / 2; - QPen pen(cg.foreground(), 2); + TQPen pen(cg.foreground(), 2); p->setPen(pen); p->drawLine(0, ypos, width, ypos); } @@ -94,8 +94,8 @@ class KoOpenPanePrivate KInstance* m_instance; }; -KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType) - : KoOpenPaneBase(parent, "OpenPane") +KoOpenPane::KoOpenPane(TQWidget *tqparent, KInstance* instance, const TQString& templateType) + : KoOpenPaneBase(tqparent, "OpenPane") { d = new KoOpenPanePrivate; d->m_instance = instance; @@ -105,18 +105,18 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp #if KDE_IS_VERSION(3,4,0) m_sectionList->setShadeSortColumn(false); #endif - connect(m_sectionList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(selectionChanged(QListViewItem*))); - connect(m_sectionList, SIGNAL(pressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); - connect(m_sectionList, SIGNAL(spacePressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); - connect(m_sectionList, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(selectionChanged(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(pressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(spacePressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); KGuiItem openExistingGItem(i18n("Open Existing Document..."), "fileopen"); m_openExistingButton->setGuiItem(openExistingGItem); - connect(m_openExistingButton, SIGNAL(clicked()), this, SLOT(showOpenFileDialog())); + connect(m_openExistingButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showOpenFileDialog())); initRecentDocs(); initTemplates(templateType); @@ -127,7 +127,7 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp m_widgetStack->widget(selectedItem->widgetIndex())->setFocus(); } - QValueList sizes; + TQValueList sizes; sizes << 20 << width() - 20; m_splitter->setSizes(sizes); @@ -136,8 +136,8 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp sizes = cfgGrp.readIntListEntry("DetailsPaneSplitterSizes"); emit splitterResized(0, sizes); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SLOT(saveSplitterSizes(KoDetailsPaneBase*, const QValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SLOT(saveSplitterSizes(KoDetailsPaneBase*, const TQValueList&))); } KoOpenPane::~KoOpenPane() @@ -156,7 +156,7 @@ KoOpenPane::~KoOpenPane() void KoOpenPane::showOpenFileDialog() { - const QStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(), + const TQStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(), KoFilterManager::Import, KoDocument::readExtraNativeMimeTypes()); KURL url = KFileDialog::getOpenURL(":OpenDialog", mimeFilter.join(" "), this); @@ -171,12 +171,12 @@ void KoOpenPane::showOpenFileDialog() void KoOpenPane::initRecentDocs() { KoRecentDocumentsPane* recentDocPane = new KoRecentDocumentsPane(this, d->m_instance); - connect(recentDocPane, SIGNAL(openFile(const QString&)), this, SIGNAL(openExistingFile(const QString&))); - QListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0); - connect(recentDocPane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&))); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - recentDocPane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList&))); + connect(recentDocPane, TQT_SIGNAL(openFile(const TQString&)), this, TQT_SIGNAL(openExistingFile(const TQString&))); + TQListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0); + connect(recentDocPane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + recentDocPane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList&))); KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", 1); separator->setEnabled(false); @@ -186,10 +186,10 @@ void KoOpenPane::initRecentDocs() } } -void KoOpenPane::initTemplates(const QString& templateType) +void KoOpenPane::initTemplates(const TQString& templateType) { - QListViewItem* selectItem = 0; - QListViewItem* firstItem = 0; + TQListViewItem* selectItem = 0; + TQListViewItem* firstItem = 0; const int templateOffset = 1000; if(!templateType.isEmpty()) @@ -203,16 +203,16 @@ void KoOpenPane::initTemplates(const QString& templateType) KoTemplatesPane* pane = new KoTemplatesPane(this, d->m_instance, group, templateTree.defaultTemplate()); - connect(pane, SIGNAL(openTemplate(const QString&)), this, SIGNAL(openTemplate(const QString&))); - connect(pane, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)), - this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&))); - connect(this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)), - pane, SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const QString&))); - connect(pane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&))); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - pane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList&))); - QListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance), + connect(pane, TQT_SIGNAL(openTemplate(const TQString&)), this, TQT_SIGNAL(openTemplate(const TQString&))); + connect(pane, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)), + this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&))); + connect(this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)), + pane, TQT_SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const TQString&))); + connect(pane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + pane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList&))); + TQListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance), pane, group->sortingWeight() + templateOffset); if(!firstItem) { @@ -240,12 +240,12 @@ void KoOpenPane::initTemplates(const QString& templateType) } } -void KoOpenPane::setCustomDocumentWidget(QWidget *widget) { +void KoOpenPane::setCustomDocumentWidget(TQWidget *widget) { Q_ASSERT(widget); KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", INT_MAX-1); separator->setEnabled(false); - QListViewItem* item = addPane(i18n("Custom Document"), QString::null, widget, INT_MAX); + TQListViewItem* item = addPane(i18n("Custom Document"), TQString(), widget, INT_MAX); KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); @@ -256,13 +256,13 @@ void KoOpenPane::setCustomDocumentWidget(QWidget *widget) { } } -QListViewItem* KoOpenPane::addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight) +TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQString& icon, TQWidget* widget, int sortWeight) { return addPane(title, SmallIcon(icon, KIcon::SizeLarge, KIcon::DefaultState, d->m_instance), widget, sortWeight); } -QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight) +TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQPixmap& icon, TQWidget* widget, int sortWeight) { if(!widget) { return 0; @@ -272,21 +272,21 @@ QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QW KoSectionListItem* listItem = new KoSectionListItem(m_sectionList, title, sortWeight, id); if(!icon.isNull()) { - QImage image = icon.convertToImage(); + TQImage image = icon.convertToImage(); if((image.width() > 48) || (image.height() > 48)) { - image = image.smoothScale(48, 48, QImage::ScaleMin); + image = image.smoothScale(48, 48, TQ_ScaleMin); } image.setAlphaBuffer(true); image = image.copy((image.width() - 48) / 2, (image.height() - 48) / 2, 48, 48); - listItem->setPixmap(0, QPixmap(image)); + listItem->setPixmap(0, TQPixmap(image)); } return listItem; } -void KoOpenPane::selectionChanged(QListViewItem* item) +void KoOpenPane::selectionChanged(TQListViewItem* item) { KoSectionListItem* section = dynamic_cast(item); @@ -297,13 +297,13 @@ void KoOpenPane::selectionChanged(QListViewItem* item) m_widgetStack->raiseWidget(section->widgetIndex()); } -void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const QValueList& sizes) +void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const TQValueList& sizes) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); cfgGrp.writeEntry("DetailsPaneSplitterSizes", sizes); } -void KoOpenPane::itemClicked(QListViewItem* item) +void KoOpenPane::itemClicked(TQListViewItem* item) { KoSectionListItem* selectedItem = static_cast(item); diff --git a/lib/kofficecore/KoOpenPane.h b/lib/kofficecore/KoOpenPane.h index 20bd425d..818c6e81 100644 --- a/lib/kofficecore/KoOpenPane.h +++ b/lib/kofficecore/KoOpenPane.h @@ -26,7 +26,7 @@ class KConfig; class KoTemplateGroup; class KoOpenPanePrivate; class KInstance; -class QPixmap; +class TQPixmap; class KListViewItem; class KoTemplatesPane; class KoDetailsPaneBase; @@ -34,19 +34,20 @@ class KoDetailsPaneBase; class KoOpenPane : public KoOpenPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the KInstance to be used for KConfig data * @param templateType the template-type (group) that should be selected on creation. */ - KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType = QString::null); + KoOpenPane(TQWidget *tqparent, KInstance* instance, const TQString& templateType = TQString()); virtual ~KoOpenPane(); - QListViewItem* addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight); - QListViewItem* addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight); + TQListViewItem* addPane(const TQString& title, const TQString& icon, TQWidget* widget, int sortWeight); + TQListViewItem* addPane(const TQString& title, const TQPixmap& icon, TQWidget* widget, int sortWeight); /** * If the application has a way to create a document not based on a template, but on user @@ -54,26 +55,26 @@ class KoOpenPane : public KoOpenPaneBase * @see KoDocument::createCustomDocumentWidget() * @param widget the widget. */ - void setCustomDocumentWidget(QWidget *widget); + void setCustomDocumentWidget(TQWidget *widget); protected slots: void showOpenFileDialog(); - void selectionChanged(QListViewItem* item); - void itemClicked(QListViewItem* item); + void selectionChanged(TQListViewItem* item); + void itemClicked(TQListViewItem* item); /// Saves the splitter sizes for KoDetailsPaneBase based panes - void saveSplitterSizes(KoDetailsPaneBase* sender, const QValueList& sizes); + void saveSplitterSizes(KoDetailsPaneBase* sender, const TQValueList& sizes); signals: - void openExistingFile(const QString&); - void openTemplate(const QString&); + void openExistingFile(const TQString&); + void openTemplate(const TQString&); /// Emitted when the always use template has changed - void alwaysUseChanged(KoTemplatesPane* sender, const QString& alwaysUse); + void alwaysUseChanged(KoTemplatesPane* sender, const TQString& alwaysUse); /// Emitted when one of the detail panes have changed it's splitter - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); protected: void initRecentDocs(); @@ -81,7 +82,7 @@ class KoOpenPane : public KoOpenPaneBase * Populate the list with all templates the user can choose. * @param templateType the template-type (group) that should be selected on creation. */ - void initTemplates(const QString& templateType); + void initTemplates(const TQString& templateType); private: KoOpenPanePrivate* d; diff --git a/lib/kofficecore/KoPageLayout.cpp b/lib/kofficecore/KoPageLayout.cpp index 36e447e9..05eff10b 100644 --- a/lib/kofficecore/KoPageLayout.cpp +++ b/lib/kofficecore/KoPageLayout.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include // paper formats ( mm ) #define PG_A3_WIDTH 297.0 @@ -57,21 +57,21 @@ KoGenStyle KoPageLayout::saveOasis() const return style; } -void KoPageLayout::loadOasis(const QDomElement &style) +void KoPageLayout::loadOasis(const TQDomElement &style) { - QDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-layout-properties" ) ); + TQDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-tqlayout-properties" ) ); if ( !properties.isNull() ) { - ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", QString::null ) ); - ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", QString::null ) ); - if (properties.attributeNS( KoXmlNS::style, "print-orientation", QString::null)=="portrait") + ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", TQString() ) ); + ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", TQString() ) ); + if (properties.attributeNS( KoXmlNS::style, "print-orientation", TQString())=="portrait") orientation=PG_PORTRAIT; else orientation=PG_LANDSCAPE; - ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", QString::null ) ); - ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", QString::null ) ); - ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", QString::null ) ); - ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", QString::null ) ); + ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", TQString() ) ); + ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", TQString() ) ); + ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", TQString() ) ); + ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", TQString() ) ); // guessFormat takes millimeters if ( orientation == PG_LANDSCAPE ) format = KoPageFormat::guessFormat( POINT_TO_MM(ptHeight), POINT_TO_MM(ptWidth) ); @@ -82,18 +82,18 @@ void KoPageLayout::loadOasis(const QDomElement &style) KoPageLayout KoPageLayout::standardLayout() { - KoPageLayout layout; - layout.format = KoPageFormat::defaultFormat(); - layout.orientation = PG_PORTRAIT; - layout.ptWidth = MM_TO_POINT( KoPageFormat::width( layout.format, layout.orientation ) ); - layout.ptHeight = MM_TO_POINT( KoPageFormat::height( layout.format, layout.orientation ) ); - layout.ptLeft = MM_TO_POINT( 20.0 ); - layout.ptRight = MM_TO_POINT( 20.0 ); - layout.ptTop = MM_TO_POINT( 20.0 ); - layout.ptBottom = MM_TO_POINT( 20.0 ); - layout.ptPageEdge = -1; - layout.ptBindingSide = -1; - return layout; + KoPageLayout tqlayout; + tqlayout.format = KoPageFormat::defaultFormat(); + tqlayout.orientation = PG_PORTRAIT; + tqlayout.ptWidth = MM_TO_POINT( KoPageFormat::width( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptHeight = MM_TO_POINT( KoPageFormat::height( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptLeft = MM_TO_POINT( 20.0 ); + tqlayout.ptRight = MM_TO_POINT( 20.0 ); + tqlayout.ptTop = MM_TO_POINT( 20.0 ); + tqlayout.ptBottom = MM_TO_POINT( 20.0 ); + tqlayout.ptPageEdge = -1; + tqlayout.ptBindingSide = -1; + return tqlayout; } struct PageFormatInfo @@ -149,12 +149,12 @@ int KoPageFormat::printerPageSize( KoFormat format ) { if ( format == PG_SCREEN ) { - kdWarning() << "You use the page layout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; + kdWarning() << "You use the page tqlayout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; return KPrinter::A4; } else if ( format == PG_CUSTOM ) { - kdWarning() << "The used page layout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; + kdWarning() << "The used page tqlayout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; return KPrinter::A4; } else if ( format <= PG_LAST_FORMAT ) @@ -195,18 +195,18 @@ KoFormat KoPageFormat::guessFormat( double width, double height ) return PG_CUSTOM; } -QString KoPageFormat::formatString( KoFormat format ) +TQString KoPageFormat::formatString( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) - return QString::fromLatin1( pageFormatInfo[ format ].shortName ); - return QString::fromLatin1( "A4" ); + return TQString::tqfromLatin1( pageFormatInfo[ format ].shortName ); + return TQString::tqfromLatin1( "A4" ); } -KoFormat KoPageFormat::formatFromString( const QString & string ) +KoFormat KoPageFormat::formatFromString( const TQString & string ) { for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { - if (string == QString::fromLatin1( pageFormatInfo[ i ].shortName )) + if (string == TQString::tqfromLatin1( pageFormatInfo[ i ].shortName )) return pageFormatInfo[ i ].format; } // We do not know the format name, so we have a custom format @@ -224,16 +224,16 @@ KoFormat KoPageFormat::defaultFormat() return PG_DIN_A4; } -QString KoPageFormat::name( KoFormat format ) +TQString KoPageFormat::name( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) return i18n( pageFormatInfo[ format ].descriptiveName ); return i18n( pageFormatInfo[ PG_DIN_A4 ].descriptiveName ); } -QStringList KoPageFormat::allFormats() +TQStringList KoPageFormat::allFormats() { - QStringList lst; + TQStringList lst; for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { lst << i18n( pageFormatInfo[ i ].descriptiveName ); diff --git a/lib/kofficecore/KoPageLayout.h b/lib/kofficecore/KoPageLayout.h index f9f98fc6..4d4dc6cc 100644 --- a/lib/kofficecore/KoPageLayout.h +++ b/lib/kofficecore/KoPageLayout.h @@ -23,15 +23,15 @@ #define KOPAGELAYOUT_H #include -#include +#include #include -class QDomElement; +class TQDomElement; /** * @brief Represents the paper format a document shall be printed on. * * For compatibility reasons, and because of screen and custom, - * this enum doesn't map to QPrinter::PageSize but KoPageFormat::printerPageSize + * this enum doesn't map to TQPrinter::PageSize but KoPageFormat::printerPageSize * does the conversion. * * @todo convert DIN to ISO in the names @@ -108,13 +108,13 @@ namespace KoPageFormat * Returns the internal name of the given page format. * Use for saving. */ - KOFFICECORE_EXPORT QString formatString( KoFormat format ); + KOFFICECORE_EXPORT TQString formatString( KoFormat format ); /** * Convert a format string (internal name) to a page format value. * Use for loading. */ - KOFFICECORE_EXPORT KoFormat formatFromString( const QString & string ); + KOFFICECORE_EXPORT KoFormat formatFromString( const TQString & string ); /** * Returns the default format (based on the KControl settings) @@ -125,12 +125,12 @@ namespace KoPageFormat * Returns the translated name of the given page format. * Use for showing the user. */ - KOFFICECORE_EXPORT QString name( KoFormat format ); + KOFFICECORE_EXPORT TQString name( KoFormat format ); /** * Lists the translated names of all the available formats */ - KOFFICECORE_EXPORT QStringList allFormats(); + KOFFICECORE_EXPORT TQStringList allFormats(); /** * Try to find the paper format for the given width and height (in mm). @@ -154,7 +154,7 @@ enum KoHFType { }; /** - * This structure defines the page layout, including + * This structure defines the page tqlayout, including * its size in pt, its format (e.g. A4), orientation, unit, margins etc. */ struct KoPageLayout @@ -194,17 +194,17 @@ struct KoPageLayout } /** - * Save this page layout to OASIS. + * Save this page tqlayout to OASIS. */ KOFFICECORE_EXPORT KoGenStyle saveOasis() const; /** - * Load this page layout from OASIS + * Load this page tqlayout from OASIS */ - KOFFICECORE_EXPORT void loadOasis(const QDomElement &style); + KOFFICECORE_EXPORT void loadOasis(const TQDomElement &style); /** - * @return a page layout with the default page size depending on the locale settings, + * @return a page tqlayout with the default page size depending on the locale settings, * default margins (2 cm), and portrait orientation. * @since 1.4 */ @@ -214,12 +214,12 @@ struct KoPageLayout /** structure for header-footer */ struct KoHeadFoot { - QString headLeft; - QString headMid; - QString headRight; - QString footLeft; - QString footMid; - QString footRight; + TQString headLeft; + TQString headMid; + TQString headRight; + TQString footLeft; + TQString footMid; + TQString footRight; }; /** structure for columns */ @@ -229,11 +229,11 @@ struct KoColumns double ptColumnSpacing; bool operator==( const KoColumns& rhs ) const { return columns == rhs.columns && - QABS(ptColumnSpacing - rhs.ptColumnSpacing) <= 1E-10; + TQABS(ptColumnSpacing - rhs.ptColumnSpacing) <= 1E-10; } bool operator!=( const KoColumns& rhs ) const { return columns != rhs.columns || - QABS(ptColumnSpacing - rhs.ptColumnSpacing) > 1E-10; + TQABS(ptColumnSpacing - rhs.ptColumnSpacing) > 1E-10; } }; @@ -247,9 +247,9 @@ struct KoKWHeaderFooter double ptFootNoteBodySpacing; bool operator==( const KoKWHeaderFooter& rhs ) const { return header == rhs.header && footer == rhs.footer && - QABS(ptHeaderBodySpacing - rhs.ptHeaderBodySpacing) <= 1E-10 && - QABS(ptFooterBodySpacing - rhs.ptFooterBodySpacing) <= 1E-10 && - QABS(ptFootNoteBodySpacing - rhs.ptFootNoteBodySpacing) <= 1E-10; + TQABS(ptHeaderBodySpacing - rhs.ptHeaderBodySpacing) <= 1E-10 && + TQABS(ptFooterBodySpacing - rhs.ptFooterBodySpacing) <= 1E-10 && + TQABS(ptFootNoteBodySpacing - rhs.ptFootNoteBodySpacing) <= 1E-10; } bool operator!=( const KoKWHeaderFooter& rhs ) const { return !( *this == rhs ); diff --git a/lib/kofficecore/KoPicture.cpp b/lib/kofficecore/KoPicture.cpp index 11bb89dd..8e74c0b5 100644 --- a/lib/kofficecore/KoPicture.cpp +++ b/lib/kofficecore/KoPicture.cpp @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -35,7 +35,7 @@ uint KoPicture::uniqueValue = 0; KoPicture::KoPicture(void) : m_sharedData(NULL) { - m_uniqueName = "Pictures"+ QString::number(uniqueValue++); + m_uniqueName = "Pictures"+ TQString::number(uniqueValue++); } KoPicture::~KoPicture(void) @@ -43,7 +43,7 @@ KoPicture::~KoPicture(void) unlinkSharedData(); } -QString KoPicture::uniqueName() const +TQString KoPicture::uniqueName() const { return m_uniqueName; } @@ -60,12 +60,12 @@ void KoPicture::assignPictureId( uint _id) m_sharedData->assignPictureId(_id); } -QString KoPicture::uniquePictureId() const +TQString KoPicture::uniquePictureId() const { if ( m_sharedData ) return m_sharedData->uniquePictureId(); else - return QString::null; + return TQString(); } KoPicture& KoPicture::operator=( const KoPicture &other ) @@ -129,7 +129,7 @@ bool KoPicture::isNull(void) const return true; } -void KoPicture::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPicture::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if (m_sharedData) m_sharedData->draw(painter, x, y, width, height, sx, sy, sw, sh, fastMode); @@ -138,25 +138,25 @@ void KoPicture::draw(QPainter& painter, int x, int y, int width, int height, int // Draw a white box kdWarning(30003) << "Drawing white rectangle! (KoPicture::draw)" << endl; painter.save(); - painter.setBrush(QColor(255, 255, 255)); + painter.setBrush(TQColor(255, 255, 255)); painter.drawRect(x,y,width,height); painter.restore(); } } -bool KoPicture::loadXpm(QIODevice* io) +bool KoPicture::loadXpm(TQIODevice* io) { kdDebug(30003) << "KoPicture::loadXpm" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } createSharedData(); return m_sharedData->loadXpm(io); } -bool KoPicture::save(QIODevice* io) const +bool KoPicture::save(TQIODevice* io) const { if (!io) return false; @@ -177,66 +177,66 @@ void KoPicture::clear(void) unlinkSharedData(); } -void KoPicture::clearAndSetMode(const QString& newMode) +void KoPicture::clearAndSetMode(const TQString& newMode) { createSharedData(); m_sharedData->clearAndSetMode(newMode); } -QString KoPicture::getExtension(void) const +TQString KoPicture::getExtension(void) const { if (m_sharedData) return m_sharedData->getExtension(); return "null"; // Just a dummy } -QString KoPicture::getMimeType(void) const +TQString KoPicture::getMimeType(void) const { if (m_sharedData) return m_sharedData->getMimeType(); - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } -bool KoPicture::load(QIODevice* io, const QString& extension) +bool KoPicture::load(TQIODevice* io, const TQString& extension) { - kdDebug(30003) << "KoPicture::load(QIODevice*, const QString&) " << extension << endl; + kdDebug(30003) << "KoPicture::load(TQIODevice*, const TQString&) " << extension << endl; createSharedData(); return m_sharedData->load(io,extension); } -bool KoPicture::loadFromFile(const QString& fileName) +bool KoPicture::loadFromFile(const TQString& fileName) { kdDebug(30003) << "KoPicture::loadFromFile " << fileName << endl; createSharedData(); return m_sharedData->loadFromFile(fileName); } -bool KoPicture::loadFromBase64( const QCString& str ) +bool KoPicture::loadFromBase64( const TQCString& str ) { createSharedData(); return m_sharedData->loadFromBase64( str ); } -QSize KoPicture::getOriginalSize(void) const +TQSize KoPicture::getOriginalSize(void) const { if (m_sharedData) return m_sharedData->getOriginalSize(); - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPicture::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPicture::generatePixmap(const TQSize& size, bool smoothScale) { if (m_sharedData) return m_sharedData->generatePixmap(size, smoothScale); - return QPixmap(); + return TQPixmap(); } -bool KoPicture::setKeyAndDownloadPicture(const KURL& url, QWidget *window) +bool KoPicture::setKeyAndDownloadPicture(const KURL& url, TQWidget *window) { bool result=false; - QString tmpFileName; + TQString tmpFileName; if ( KIO::NetAccess::download(url, tmpFileName, window) ) { KoPictureKey key; @@ -249,18 +249,18 @@ bool KoPicture::setKeyAndDownloadPicture(const KURL& url, QWidget *window) return result; } -QDragObject* KoPicture::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPicture::dragObject( TQWidget *dragSource, const char *name ) { if (m_sharedData) return m_sharedData->dragObject( dragSource, name ); return 0L; } -QImage KoPicture::generateImage(const QSize& size) +TQImage KoPicture::generateImage(const TQSize& size) { if (m_sharedData) return m_sharedData->generateImage( size ); - return QImage(); + return TQImage(); } bool KoPicture::hasAlphaBuffer() const @@ -276,11 +276,11 @@ void KoPicture::setAlphaBuffer(bool enable) m_sharedData->setAlphaBuffer(enable); } -QImage KoPicture::createAlphaMask(int conversion_flags) const +TQImage KoPicture::createAlphaMask(int conversion_flags) const { if (m_sharedData) return m_sharedData->createAlphaMask(conversion_flags); - return QImage(); + return TQImage(); } void KoPicture::clearCache(void) diff --git a/lib/kofficecore/KoPicture.h b/lib/kofficecore/KoPicture.h index e4ed1d5d..3fa355f8 100644 --- a/lib/kofficecore/KoPicture.h +++ b/lib/kofficecore/KoPicture.h @@ -20,17 +20,17 @@ #ifndef __koPicture_h__ #define __koPicture_h__ -#include -#include -#include +#include +#include +#include #include #include "KoPictureKey.h" class KoXmlWriter; -class QPainter; -class QSize; -class QDragObject; +class TQPainter; +class TQSize; +class TQDragObject; class KURL; class KoPictureShared; @@ -87,31 +87,31 @@ public: * * The parameters @p width, @p height define the desired size for the picture * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in picture that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the picture that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. * */ - void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, + void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard - * @param name name for the QDragObject + * @param name name for the TQDragObject * @return 0L if the picture is null, or if a dragobject for it isn't implemented [yet] */ - QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - bool load(QIODevice* io, const QString& extension); + bool load(TQIODevice* io, const TQString& extension); /** - * Save picture into a QIODevice - * @param io QIODevice used for saving + * Save picture into a TQIODevice + * @param io TQIODevice used for saving */ - bool save(QIODevice* io) const; + bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -128,24 +128,24 @@ public: /** * @return the image extension (e.g. png) */ - QString getExtension(void) const; + TQString getExtension(void) const; /** * @return the image MIME type */ - QString getMimeType(void) const; + TQString getMimeType(void) const; /** * @return the original image size */ - QSize getOriginalSize(void) const; + TQSize getOriginalSize(void) const; /** * Clear and set the mode of this KoPicture * * @param newMode a file extension (like "png") giving the wanted mode */ - void clearAndSetMode(const QString& newMode); + void clearAndSetMode(const TQString& newMode); /** * Reset the KoPicture (but not the key!) @@ -155,43 +155,43 @@ public: /** * Load the picture from a file named @p fileName */ - bool loadFromFile(const QString& fileName); + bool loadFromFile(const TQString& fileName); /** * Load the picture from base64-encoded data */ - bool loadFromBase64(const QCString& str); + bool loadFromBase64(const TQCString& str); /** * Load a potentially broken XPM file (for old files of KPresenter) */ - bool loadXpm(QIODevice* io); + bool loadXpm(TQIODevice* io); /** * @deprecated To be replaced by @ref KoPicture::draw * - * Returns a QPixmap from an image - * Returns an empty QPixmap if the KoPicture is not an image. + * Returns a TQPixmap from an image + * Returns an empty TQPixmap if the KoPicture is not an image. */ - QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); /** * Download and set the key for a possibly remote file. * * @param url the url to download from - * @param window the parent widget for the download. You can pass - * NULL (0) if you absolutely cannot find a parent + * @param window the tqparent widget for the download. You can pass + * NULL (0) if you absolutely cannot find a tqparent * widget to use. */ - bool setKeyAndDownloadPicture(const KURL& url, QWidget *window); + bool setKeyAndDownloadPicture(const KURL& url, TQWidget *window); /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) * - * @param size the wanted size for the QImage + * @param size the wanted size for the TQImage */ - QImage generateImage(const QSize& size); + TQImage generateImage(const TQSize& size); /** * @return TRUE if the alpha channel processing has been enabled @@ -204,12 +204,12 @@ public: void setAlphaBuffer(bool enable); /** - * Creates an alpha mask for the picture + * Creates an alpha tqmask for the picture * (first you have to call @ref #setAlphaBuffer). * * @see hasAlphaBuffer() setAlphaBuffer() */ - QImage createAlphaMask(int conversion_flags = 0) const; + TQImage createAlphaMask(int conversion_flags = 0) const; /** * @brief Clear any cache @@ -219,7 +219,7 @@ public: */ void clearCache(void); - QString uniquePictureId() const; + TQString uniquePictureId() const; void assignPictureId( uint _id); protected: @@ -238,7 +238,7 @@ protected: * Creare the shared data if needed */ void createSharedData(void); - QString uniqueName() const; + TQString uniqueName() const; protected: /** @@ -253,7 +253,7 @@ protected: KoPictureShared* m_sharedData; static uint uniqueValue; - QString m_uniqueName; + TQString m_uniqueName; }; #endif /* __koPicture_h__ */ diff --git a/lib/kofficecore/KoPictureBase.cpp b/lib/kofficecore/KoPictureBase.cpp index e608abc2..29ec51b9 100644 --- a/lib/kofficecore/KoPictureBase.cpp +++ b/lib/kofficecore/KoPictureBase.cpp @@ -27,10 +27,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include static int s_useSlowResizeMode = -1; // unset @@ -64,28 +64,28 @@ bool KoPictureBase::isNull(void) const return true; // A KoPictureBase is always null. } -void KoPictureBase::draw(QPainter& painter, int x, int y, int width, int height, int, int, int, int, bool /*fastMode*/) +void KoPictureBase::draw(TQPainter& painter, int x, int y, int width, int height, int, int, int, int, bool /*fastMode*/) { // Draw a light red box (easier DEBUG) kdWarning(30003) << "Drawing light red rectangle! (KoPictureBase::draw)" << endl; painter.save(); - painter.setBrush(QColor(128,0,0)); + painter.setBrush(TQColor(128,0,0)); painter.drawRect(x,y,width,height); painter.restore(); } -bool KoPictureBase::load(QIODevice* io, const QString& extension) +bool KoPictureBase::load(TQIODevice* io, const TQString& extension) { return loadData(io->readAll(), extension); } -bool KoPictureBase::loadData(const QByteArray&, const QString&) +bool KoPictureBase::loadData(const TQByteArray&, const TQString&) { // Nothing to load! return false; } -bool KoPictureBase::save(QIODevice*) const +bool KoPictureBase::save(TQIODevice*) const { // Nothing to save! return false; @@ -93,28 +93,28 @@ bool KoPictureBase::save(QIODevice*) const bool KoPictureBase::saveAsBase64( KoXmlWriter& writer ) const { - QBuffer buffer; + TQBuffer buffer; buffer.open(IO_ReadWrite); - if ( !save( &buffer ) ) + if ( !save( TQT_TQIODEVICE(&buffer) ) ) return false; - QCString encoded = KCodecs::base64Encode( buffer.buffer() ); + TQCString encoded = KCodecs::base64Encode( buffer.buffer() ); writer.addTextNode( encoded ); return true; } -QSize KoPictureBase::getOriginalSize(void) const +TQSize KoPictureBase::getOriginalSize(void) const { - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPictureBase::generatePixmap(const QSize&, bool /*smoothScale*/) +TQPixmap KoPictureBase::generatePixmap(const TQSize&, bool /*smoothScale*/) { - return QPixmap(); + return TQPixmap(); } -QString KoPictureBase::getMimeType(const QString&) const +TQString KoPictureBase::getMimeType(const TQString&) const { - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } bool KoPictureBase::isSlowResizeModeAllowed(void) const @@ -122,16 +122,16 @@ bool KoPictureBase::isSlowResizeModeAllowed(void) const return s_useSlowResizeMode != 0; } -QDragObject* KoPictureBase::dragObject( QWidget * dragSource, const char * name ) +TQDragObject* KoPictureBase::dragObject( TQWidget * dragSource, const char * name ) { - QImage image (generateImage(getOriginalSize())); + TQImage image (generateImage(getOriginalSize())); if (image.isNull()) return 0L; else - return new QImageDrag( image, dragSource, name ); + return new TQImageDrag( image, dragSource, name ); } -QImage KoPictureBase::generateImage(const QSize& size) +TQImage KoPictureBase::generateImage(const TQSize& size) { return generatePixmap(size,true).convertToImage(); } diff --git a/lib/kofficecore/KoPictureBase.h b/lib/kofficecore/KoPictureBase.h index 17a7df96..73056aa6 100644 --- a/lib/kofficecore/KoPictureBase.h +++ b/lib/kofficecore/KoPictureBase.h @@ -22,14 +22,14 @@ #include "KoPictureKey.h" // for KoPictureType -#include -#include +#include +#include class KoXmlWriter; -class QPainter; -class QSize; -class QIODevice; -class QDragObject; +class TQPainter; +class TQSize; +class TQIODevice; +class TQDragObject; const char NULL_MIME_TYPE[]="application/x-zerosize"; @@ -70,30 +70,30 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard * @return 0L if the picture is null! */ - virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + virtual TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - virtual bool load(QIODevice* io, const QString& extension); + virtual bool load(TQIODevice* io, const TQString& extension); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -101,26 +101,26 @@ public: */ virtual bool saveAsBase64( KoXmlWriter& writer ) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; bool isSlowResizeModeAllowed(void) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual bool hasAlphaBuffer() const { return false; } virtual void setAlphaBuffer(bool /*enable*/) { } - virtual QImage createAlphaMask(int /*conversion_flags*/ = 0) const - { return QImage(); } + virtual TQImage createAlphaMask(int /*conversion_flags*/ = 0) const + { return TQImage(); } virtual void clearCache(void); }; diff --git a/lib/kofficecore/KoPictureClipart.cpp b/lib/kofficecore/KoPictureClipart.cpp index f4d94fd2..d5c482f8 100644 --- a/lib/kofficecore/KoPictureClipart.cpp +++ b/lib/kofficecore/KoPictureClipart.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -34,7 +34,7 @@ #include "KoPictureBase.h" #include "KoPictureClipart.h" -KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -57,15 +57,15 @@ bool KoPictureClipart::isNull(void) const return m_clipart.isNull(); } -void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureClipart::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureClipart " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -77,17 +77,17 @@ void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureClipart::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureClipart::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureClipart::loadData(const QByteArray& array, const QString& extension) +bool KoPictureClipart::loadData(const TQByteArray& array, const TQString& extension) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << m_rawData.size() << ")" << endl; m_rawData=array; - QBuffer buffer(m_rawData); + TQBuffer buffer(m_rawData); buffer.open(IO_ReadOnly); bool check = true; if (extension=="svg") @@ -102,7 +102,7 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio { if (!m_clipart.load(&buffer, NULL)) { - kdWarning(30003) << "Loading QPicture has failed! (KoPictureClipart::load)" << endl; + kdWarning(30003) << "Loading TQPicture has failed! (KoPictureClipart::load)" << endl; check = false; } } @@ -110,29 +110,29 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio return check; } -bool KoPictureClipart::save(QIODevice* io) const +bool KoPictureClipart::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureClipart::getOriginalSize(void) const +TQSize KoPictureClipart::getOriginalSize(void) const { return m_clipart.boundingRect().size(); } -QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureClipart::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); - QRect br = m_clipart.boundingRect(); + TQRect br = m_clipart.boundingRect(); if ( br.width() && br.height() ) p.scale( (double)pixmap.width() / (double)br.width(), (double)pixmap.height() / (double)br.height() ); p.drawPicture( m_clipart ); @@ -140,7 +140,7 @@ QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/ return pixmap; } -QString KoPictureClipart::getMimeType(const QString& extension) const +TQString KoPictureClipart::getMimeType(const TQString& extension) const { if (extension=="svg") return "image/svg+xml"; diff --git a/lib/kofficecore/KoPictureClipart.h b/lib/kofficecore/KoPictureClipart.h index 9784c673..b390bca3 100644 --- a/lib/kofficecore/KoPictureClipart.h +++ b/lib/kofficecore/KoPictureClipart.h @@ -20,11 +20,11 @@ #ifndef __koPictureClipart_h__ #define __koPictureClipart_h__ -#include -#include +#include +#include -class QPainter; -class QSize; +class TQPainter; +class TQSize; // TODO: fix documentation @@ -64,39 +64,39 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; protected: - QPixmap getPixmap(QImage& image); + TQPixmap getPixmap(TQImage& image); /** * @internal - * Draw a QPicture + * Draw a TQPicture */ - void drawQPicture(QPicture& clipart, QPainter& painter, + void drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh); protected: - QPicture m_clipart; ///< The clipart as QPicture - QByteArray m_rawData; ///< Copy of the loaded image file + TQPicture m_clipart; ///< The clipart as TQPicture + TQByteArray m_rawData; ///< Copy of the loaded image file }; #endif /* __koPictureClipart_h__ */ diff --git a/lib/kofficecore/KoPictureCollection.cpp b/lib/kofficecore/KoPictureCollection.cpp index 8941f32e..3d680bf7 100644 --- a/lib/kofficecore/KoPictureCollection.cpp +++ b/lib/kofficecore/KoPictureCollection.cpp @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -37,7 +37,7 @@ KoPicture KoPictureCollection::findPicture(const KoPictureKey& key) const #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::findPicture " << key.toString() << endl; #endif - ConstIterator it = find( key ); + ConstIterator it = tqfind( key ); if ( it == end() ) { KoPicture picture; @@ -72,7 +72,7 @@ KoPicture KoPictureCollection::insertPicture(const KoPicture& picture) return insertPicture(picture.getKey(), picture); } -KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) +KoPicture KoPictureCollection::downloadPicture(const KURL& url, TQWidget *window) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::downloadPicture " << url.prettyURL() << endl; @@ -99,7 +99,7 @@ KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) return pic; } -KoPicture KoPictureCollection::loadPicture(const QString& fileName) +KoPicture KoPictureCollection::loadPicture(const TQString& fileName) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::loadPicture " << fileName << endl; @@ -122,23 +122,23 @@ KoPicture KoPictureCollection::loadPicture(const QString& fileName) return c; } -QString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) +TQString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) { - QString storeURL; + TQString storeURL; // ### TODO: remove "cliparts" when KPresenter is ready for it if (pictureType==CollectionClipart) storeURL="cliparts/clipart"; else storeURL="pictures/picture"; - storeURL+=QString::number(++counter); + storeURL+=TQString::number(++counter); storeURL+='.'; storeURL+=picture.getExtension(); return storeURL; } -QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const +TQString KoPictureCollection::getOasisFileName(const KoPicture& picture) const { - QString storeURL( "Pictures/"); + TQString storeURL( "Pictures/"); if ( !picture.uniquePictureId().isEmpty() ) storeURL+=picture.uniquePictureId(); else @@ -148,10 +148,10 @@ QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const return storeURL; } -bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const QValueList& keys) +bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const TQValueList& keys) { int counter=0; - QValueList::const_iterator it = keys.begin(); + TQValueList::const_iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -159,7 +159,7 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString storeURL=getFileName(pictureType, c, counter); + TQString storeURL=getFileName(pictureType, c, counter); if (store->open(storeURL)) { @@ -174,9 +174,9 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co return true; } -bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys, KoXmlWriter* manifestWriter ) +bool KoPictureCollection::saveOasisToStore( KoStore *store, TQValueList keys, KoXmlWriter* manifestWriter ) { - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -184,7 +184,7 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueListopen(storeURL)) { KoStoreDevice dev(store); @@ -199,16 +199,16 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys) +TQDomElement KoPictureCollection::saveXML(const Type pictureType, TQDomDocument &doc, TQValueList keys) { - QString strElementName("PICTURES"); + TQString strElementName("PICTURES"); if (pictureType==CollectionImage) strElementName="PIXMAPS"; else if (pictureType==CollectionClipart) strElementName="CLIPARTS"; - QDomElement cliparts = doc.createElement( strElementName ); + TQDomElement cliparts = doc.createElement( strElementName ); int counter=0; - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture picture = findPicture( *it ); @@ -216,8 +216,8 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString pictureName=getFileName(pictureType, picture, counter); - QDomElement keyElem = doc.createElement( "KEY" ); + TQString pictureName=getFileName(pictureType, picture, counter); + TQDomElement keyElem = doc.createElement( "KEY" ); cliparts.appendChild(keyElem); (*it).saveAttributes(keyElem); keyElem.setAttribute("name", pictureName); @@ -226,13 +226,13 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d return cliparts; } -void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap & map ) +void KoPictureCollection::readXML( TQDomElement& pixmapsElem, TQMap & map ) { - for( QDomNode n = pixmapsElem.firstChild(); + for( TQDomNode n = pixmapsElem.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement keyElement = n.toElement(); + TQDomElement keyElement = n.toElement(); if (keyElement.isNull()) continue; if (keyElement.tagName()=="KEY") { @@ -244,7 +244,7 @@ void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap -#include -#include +#include +#include +#include #include "KoPicture.h" @@ -37,7 +37,7 @@ class KoXmlWriter; * A collection of pictures (a key and the picture itself). * */ -class KOFFICECORE_EXPORT KoPictureCollection : public QMap +class KOFFICECORE_EXPORT KoPictureCollection : public TQMap { public: enum Type { @@ -71,10 +71,10 @@ public: * If this file is really remote, it is always downloaded. * If the file is local, it acts as @ref #loadPicture. * @param url the URL to download from - * @param window the parent window for the download. You can pass NULL (0) + * @param window the tqparent window for the download. You can pass NULL (0) * if you absolutely cannot find anything to use. */ - KoPicture downloadPicture(const KURL& url, QWidget *window); + KoPicture downloadPicture(const KURL& url, TQWidget *window); /** * @brief Load a clipart from a file (and insert into the collection). @@ -83,7 +83,7 @@ public: * for this clipart. If this key maps to an existing clipart in the * collection, then this picture is returned, otherwise the file is loaded. */ - KoPicture loadPicture( const QString &fileName ); + KoPicture loadPicture( const TQString &fileName ); /** * Save the used picturess from the collection into the store @@ -96,7 +96,7 @@ public: * * @todo Reduce lameness of dox for pictureType. */ - bool saveToStore(const Type pictureType, KoStore * store, const QValueList& keys ); + bool saveToStore(const Type pictureType, KoStore * store, const TQValueList& keys ); /** * Generate the <PICTURES>, <PIXMAPS> or <CLIPARTS> tag, that saves the key and the related @@ -106,26 +106,26 @@ public: * @param doc the DOM document in which the tags are to be generated * @param keys the list of keys */ - QDomElement saveXML(const Type pictureType, QDomDocument &doc, - QValueList keys ); + TQDomElement saveXML(const Type pictureType, TQDomDocument &doc, + TQValueList keys ); - bool saveOasisToStore( KoStore *store, QValueList keys, KoXmlWriter* manifestWriter ); + bool saveOasisToStore( KoStore *store, TQValueList keys, KoXmlWriter* manifestWriter ); - typedef QMap StoreMap; + typedef TQMap StoreMap; /** * Read the <PICTURES>, <PIXMAPS> or <CLIPARTS> tag, and save the result (key<->store-filename associations) - * into the QMap. You may want to 'new' a QMap in loadXML, and to use and then delete + * into the TQMap. You may want to 'new' a TQMap in loadXML, and to use and then delete * it in completeLoading (to save memory). * * @param pixmapsElem the <PICTURES>, <PIXMAPS> or <CLIPARTS> element */ - StoreMap readXML( QDomElement &pixmapsElem ); + StoreMap readXML( TQDomElement &pixmapsElem ); /** * Helper method for @ref #readFromStore */ - void readXML( QDomElement& pixmapsElem, QMap & map ); + void readXML( TQDomElement& pixmapsElem, TQMap & map ); /** * Read all pictures from the store, into this collection @@ -144,13 +144,13 @@ public: * * Formerly, an invalid date/time meant to read the file from disk. This is not the case anymore. */ - KoPicture findOrLoad(const QString& fileName, const QDateTime& dateTime); + KoPicture findOrLoad(const TQString& fileName, const TQDateTime& dateTime); /** * Return filename as url for picture * */ - QString getOasisFileName(const KoPicture& picture) const; + TQString getOasisFileName(const KoPicture& picture) const; /** * Call it before to save Oasis file @@ -162,7 +162,7 @@ private: /** * @internal */ - QString getFileName(const Type pictureType, KoPicture& picture, int& counter); + TQString getFileName(const Type pictureType, KoPicture& picture, int& counter); class Private; Private* d; diff --git a/lib/kofficecore/KoPictureEps.cpp b/lib/kofficecore/KoPictureEps.cpp index 752e2a45..4b47b228 100644 --- a/lib/kofficecore/KoPictureEps.cpp +++ b/lib/kofficecore/KoPictureEps.cpp @@ -21,16 +21,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,8 +48,8 @@ KoPictureEps::KoPictureEps(void) : m_psStreamStart(0), m_psStreamLength(0), m_cacheIsInFastMode(true) { - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } KoPictureEps::~KoPictureEps(void) @@ -71,12 +71,12 @@ bool KoPictureEps::isNull(void) const return m_rawData.isNull(); } -QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutionx, const int resolutiony ) +TQImage KoPictureEps::scaleWithGhostScript(const TQSize& size, const int resolutionx, const int resolutiony ) { if (!m_boundingBox.width() || !m_boundingBox.height()) { kdDebug(30003) << "EPS image has a null size! (in KoPictureEps::scaleWithGhostScript)" << endl; - return QImage(); + return TQImage(); } // ### TODO: do not call GhostScript up to three times for each re-scaling (one call of GhostScript should be enough to know which device is available: gs --help) @@ -86,7 +86,7 @@ QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutio const char* deviceTable[] = { "png16m", "bmp16m", "ppm", 0 }; - QImage img; + TQImage img; for ( int i = 0; deviceTable[i]; ++i) { @@ -103,7 +103,7 @@ QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutio // Helper method for scaleWithGhostScript. Returns 1 on success, 0 on error, -1 if nothing generated // (in which case another 'output device' can be tried) -int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device ) +int KoPictureEps::tryScaleWithGhostScript(TQImage &image, const TQSize& size, const int resolutionx, const int resolutiony, const char* device ) // Based on the code of the file kdelibs/kimgio/eps.cpp { kdDebug(30003) << "Sampling with GhostScript, using device \"" << device << "\" (in KoPictureEps::tryScaleWithGhostScript)" << endl; @@ -124,12 +124,12 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // create GS command line - QString cmdBuf ( "gs -sOutputFile=" ); + TQString cmdBuf ( "gs -sOutputFile=" ); cmdBuf += KProcess::quote(tmpFile.name()); cmdBuf += " -q -g"; - cmdBuf += QString::number( wantedWidth ); + cmdBuf += TQString::number( wantedWidth ); cmdBuf += "x"; - cmdBuf += QString::number( wantedHeight ); + cmdBuf += TQString::number( wantedHeight ); if ( ( resolutionx > 0) && ( resolutiony > 0) ) { @@ -137,9 +137,9 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // Do not play with resolution for now. // It brings more problems at print than solutions cmdBuf += " -r"; - cmdBuf += QString::number( resolutionx ); + cmdBuf += TQString::number( resolutionx ); cmdBuf += "x"; - cmdBuf += QString::number( resolutiony ); + cmdBuf += TQString::number( resolutiony ); #endif } @@ -151,7 +151,7 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // run ghostview - FILE* ghostfd = popen (QFile::encodeName(cmdBuf), "w"); + FILE* ghostfd = popen (TQFile::encodeName(cmdBuf), "w"); if ( ghostfd == 0 ) { @@ -160,7 +160,7 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons } // The translation is needed as GhostScript (7.07) cannot handle negative values in the bounding box otherwise. - fprintf (ghostfd, "\n%d %d translate\n", -qRound(m_boundingBox.left()*xScale), -qRound(m_boundingBox.top()*yScale)); + fprintf (ghostfd, "\n%d %d translate\n", -tqRound(m_boundingBox.left()*xScale), -tqRound(m_boundingBox.top()*yScale)); fprintf (ghostfd, "%g %g scale\n", xScale, yScale); // write image to gs @@ -185,9 +185,9 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons return 1; // success } -void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony ) +void KoPictureEps::scaleAndCreatePixmap(const TQSize& size, bool fastMode, const int resolutionx, const int resolutiony ) { - kdDebug(30003) << "KoPictureEps::scaleAndCreatePixmap " << size << " " << (fastMode?QString("fast"):QString("slow")) + kdDebug(30003) << "KoPictureEps::scaleAndCreatePixmap " << size << " " << (fastMode?TQString("fast"):TQString("slow")) << " resolutionx: " << resolutionx << " resolutiony: " << resolutiony << endl; if ((size==m_cachedSize) && ((fastMode) || (!m_cacheIsInFastMode))) @@ -211,20 +211,20 @@ void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const if ( fastMode && !m_cachedSize.isEmpty()) { kdDebug(30003) << "Fast scaling!" << endl; - // Slower than caching a QImage, but faster than re-sampling! - QImage image( m_cachedPixmap.convertToImage() ); + // Slower than caching a TQImage, but faster than re-sampling! + TQImage image( m_cachedPixmap.convertToImage() ); m_cachedPixmap=image.scale( size ); m_cacheIsInFastMode=true; m_cachedSize=size; } else { - QTime time; + TQTime time; time.start(); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); m_cachedPixmap = scaleWithGhostScript( size, resolutionx, resolutiony ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); m_cacheIsInFastMode=false; m_cachedSize=size; @@ -233,22 +233,22 @@ void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const kdDebug(30003) << "New size: " << size << endl; } -void KoPictureEps::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureEps::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if ( !width || !height ) return; - QSize screenSize( width, height ); + TQSize screenSize( width, height ); //kdDebug() << "KoPictureEps::draw screenSize=" << screenSize.width() << "x" << screenSize.height() << endl; - QPaintDeviceMetrics metrics (painter.device()); + TQPaintDeviceMetrics metrics (painter.device()); kdDebug(30003) << "Metrics: X: " << metrics.logicalDpiX() << " x Y: " << metrics.logicalDpiX() << " (in KoPictureEps::draw)" << endl; - if ( painter.device()->isExtDev() ) // Is it an external device (i.e. printer) + if ( painter.tqdevice()->isExtDev() ) // Is it an external device (i.e. printer) { kdDebug(30003) << "Drawing for a printer (in KoPictureEps::draw)" << endl; // For printing, always re-sample the image, as a printer has never the same resolution than a display. - QImage image( scaleWithGhostScript( screenSize, metrics.logicalDpiX(), metrics.logicalDpiY() ) ); + TQImage image( scaleWithGhostScript( screenSize, metrics.logicalDpiX(), metrics.logicalDpiY() ) ); // sx,sy,sw,sh is meant to be used as a cliprect on the pixmap, but drawImage // translates it to the (x,y) point -> we need (x+sx, y+sy). painter.drawImage( x + sx, y + sy, image, sx, sy, sw, sh ); @@ -266,9 +266,9 @@ void KoPictureEps::draw(QPainter& painter, int x, int y, int width, int height, bool KoPictureEps::extractPostScriptStream( void ) { kdDebug(30003) << "KoPictureEps::extractPostScriptStream" << endl; - QDataStream data( m_rawData, IO_ReadOnly ); - data.setByteOrder( QDataStream::LittleEndian ); - Q_UINT32 magic, offset, length; + TQDataStream data( m_rawData, IO_ReadOnly ); + data.setByteOrder( TQDataStream::LittleEndian ); + TQ_UINT32 magic, offset, length; data >> magic; data >> offset; data >> length; @@ -287,10 +287,10 @@ bool KoPictureEps::extractPostScriptStream( void ) return true; } -QString KoPictureEps::readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ) +TQString KoPictureEps::readLine( const TQByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ) { - QString strLine; - const uint finish = kMin( start + length, array.size() ); + TQString strLine; + const uint finish = kMin( start + length, (uint)array.size() ); for ( ; pos < finish; ++pos ) // We are starting at pos { const char ch = array[ pos ]; // Read one character @@ -330,7 +330,7 @@ QString KoPictureEps::readLine( const QByteArray& array, const uint start, const } -bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension */ ) +bool KoPictureEps::loadData(const TQByteArray& array, const TQString& /* extension */ ) { kdDebug(30003) << "KoPictureEps::load" << endl; @@ -356,17 +356,17 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension m_psStreamLength = m_rawData.size(); } - QString lineBox; // Line with the bounding box + TQString lineBox; // Line with the bounding box bool lastWasCr = false; // Was the last character of the line a carriage return? uint pos = m_psStreamStart; // We start to search the bounding box at the start of the PostScript stream - QString line( readLine( m_rawData, m_psStreamStart, m_psStreamLength, pos, lastWasCr ) ); + TQString line( readLine( m_rawData, m_psStreamStart, m_psStreamLength, pos, lastWasCr ) ); kdDebug(30003) << "Header: " << line << endl; if (!line.startsWith("%!")) { kdError(30003) << "Not a PostScript file!" << endl; return false; } - QRect rect; + TQRect rect; bool lineIsBoundingBox = false; // Does "line" has a %%BoundingBox line? for(;;) { @@ -390,7 +390,7 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension return false; } // Floating point values are not allowed in a Bounding Box, but ther are many such files out there... - QRegExp exp("(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)"); + TQRegExp exp("(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)"); if ( exp.search(line) == -1 ) { // ### TODO: it might be an "(atend)" and the bounding box is in the trailer @@ -399,7 +399,7 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension kdError(30003) << "Not standard bounding box: " << line << endl; return false; } - kdDebug(30003) << "Reg. Exp. Found: " << exp.capturedTexts() << endl; + kdDebug(30003) << "Reg. Exp. Found: " << exp.tqcapturedTexts() << endl; rect.setLeft((int)exp.cap(1).toDouble()); rect.setTop((int)exp.cap(2).toDouble()); rect.setRight((int)exp.cap(3).toDouble()); @@ -410,30 +410,30 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension return true; } -bool KoPictureEps::save(QIODevice* io) const +bool KoPictureEps::save(TQIODevice* io) const { // We save the raw data, to avoid damaging the file by many load/save cycles - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureEps::getOriginalSize(void) const +TQSize KoPictureEps::getOriginalSize(void) const { return m_originalSize; } -QPixmap KoPictureEps::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureEps::generatePixmap(const TQSize& size, bool smoothScale) { scaleAndCreatePixmap(size,!smoothScale, 0, 0); return m_cachedPixmap; } -QString KoPictureEps::getMimeType(const QString&) const +TQString KoPictureEps::getMimeType(const TQString&) const { return "image/x-eps"; } -QImage KoPictureEps::generateImage(const QSize& size) +TQImage KoPictureEps::generateImage(const TQSize& size) { // 0, 0 == resolution unknown return scaleWithGhostScript(size, 0, 0); @@ -443,5 +443,5 @@ void KoPictureEps::clearCache(void) { m_cachedPixmap.resize(0, 0); m_cacheIsInFastMode=true; - m_cachedSize=QSize(); + m_cachedSize=TQSize(); } diff --git a/lib/kofficecore/KoPictureEps.h b/lib/kofficecore/KoPictureEps.h index ba2a4cb9..23dfdaf4 100644 --- a/lib/kofficecore/KoPictureEps.h +++ b/lib/kofficecore/KoPictureEps.h @@ -20,10 +20,10 @@ #ifndef __koPictureEps_h__ #define __koPictureEps_h__ -#include +#include -class QPainter; -class QSize; +class TQPainter; +class TQSize; class KoPictureEpsPrivate; // TODO: fix documentation @@ -66,43 +66,43 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual void clearCache(void); protected: - QPixmap getPixmap(QImage& image); - void scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony ); - QImage scaleWithGhostScript( const QSize& size, const int resolutionx, const int resolutiony ); + TQPixmap getPixmap(TQImage& image); + void scaleAndCreatePixmap(const TQSize& size, bool fastMode, const int resolutionx, const int resolutiony ); + TQImage scaleWithGhostScript( const TQSize& size, const int resolutionx, const int resolutiony ); bool extractPostScriptStream( void ); private: - int tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device ); + int tryScaleWithGhostScript(TQImage &image, const TQSize& size, const int resolutionx, const int resolutiony, const char* device ); /** - * @brief Read a line from a PostScript stream in a QByteArray + * @brief Read a line from a PostScript stream in a TQByteArray * - * The PostScript stream is somewhere in the QByteArray and therefore has to be + * The PostScript stream is somewhere in the TQByteArray and therefore has to be * determined by the start and length of this stream and the current position * * @param array the array which is read @@ -113,17 +113,17 @@ private: * to skip an eventual Line Feed at the start of this line * @return the read line */ - QString readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ); + TQString readLine( const TQByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ); private: /** * Copy of the loaded EPS file */ - QByteArray m_rawData; - QPixmap m_cachedPixmap; ///< Cached pixmap - QSize m_originalSize; ///< Original size of the EPS picture - QSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap - QRect m_boundingBox; ///< Bounding box, as read from the EPS file + TQByteArray m_rawData; + TQPixmap m_cachedPixmap; ///< Cached pixmap + TQSize m_originalSize; ///< Original size of the EPS picture + TQSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap + TQRect m_boundingBox; ///< Bounding box, as read from the EPS file uint m_psStreamStart; ///< Start position of the PostScript stream (like if it was a MS-DOS EPS file) uint m_psStreamLength; ///< Lenght of the PostScript stream (like if it was a MS-DOS EPS file) /** diff --git a/lib/kofficecore/KoPictureImage.cpp b/lib/kofficecore/KoPictureImage.cpp index 02110760..c0775ac7 100644 --- a/lib/kofficecore/KoPictureImage.cpp +++ b/lib/kofficecore/KoPictureImage.cpp @@ -24,17 +24,17 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include KoPictureImage::KoPictureImage(void) : m_cacheIsInFastMode(true) { - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } KoPictureImage::~KoPictureImage(void) @@ -56,7 +56,7 @@ bool KoPictureImage::isNull(void) const return m_originalImage.isNull(); } -void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode) +void KoPictureImage::scaleAndCreatePixmap(const TQSize& size, bool fastMode) { if ((size==m_cachedSize) && ((fastMode) || (!m_cacheIsInFastMode))) @@ -75,27 +75,27 @@ void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode) fastMode = true; } - // Use QImage::scale if we have fastMode==true + // Use TQImage::scale if we have fastMode==true if ( fastMode ) { - m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), QPixmap::Color); // Always color or else B/W can be reversed + m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), TQPixmap::Color); // Always color or else B/W can be reversed m_cacheIsInFastMode=true; } else { - m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), QPixmap::Color); // Always color or else B/W can be reversed + m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), TQPixmap::Color); // Always color or else B/W can be reversed m_cacheIsInFastMode=false; } m_cachedSize=size; } -void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureImage::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { //kdDebug() << "KoImage::draw currentSize:" << currentSize.width() << "x" << currentSize.height() << endl; if ( !width || !height ) return; - QSize origSize = getOriginalSize(); - const bool scaleImage = painter.device()->isExtDev() // we are printing + TQSize origSize = getOriginalSize(); + const bool scaleImage = painter.tqdevice()->isExtDev() // we are printing && ((width <= origSize.width()) || (height <= origSize.height())); if( scaleImage ) { @@ -107,14 +107,14 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height painter.translate( x, y ); painter.scale( xScale, yScale ); // Note that sx, sy, sw and sh are unused in this case. Not a problem, since it's about printing. - // Note 2: we do not cache the QPixmap. As we are printing, the next time we will probably + // Note 2: we do not cache the TQPixmap. As we are printing, the next time we will probably // need again the screen version. painter.drawImage(0, 0, m_originalImage); painter.restore(); } else { - QSize screenSize( width, height ); + TQSize screenSize( width, height ); //kdDebug() << "KoPictureImage::draw screenSize=" << screenSize.width() << "x" << screenSize.height() << endl; scaleAndCreatePixmap(screenSize, fastMode); @@ -125,13 +125,13 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height } } -bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extension*/ ) +bool KoPictureImage::loadData(const TQByteArray& array, const TQString& /* extension*/ ) { m_rawData=array; // Second, create the original image - QBuffer buffer(m_rawData); + TQBuffer buffer(m_rawData); buffer.open(IO_ReadWrite); - QImageIO imageIO(&buffer,NULL); + TQImageIO imageIO(&buffer,NULL); if (!imageIO.read()) { @@ -145,42 +145,42 @@ bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extensi return true; } -bool KoPictureImage::save(QIODevice* io) const +bool KoPictureImage::save(TQIODevice* io) const { kdDebug() << k_funcinfo << "writing raw data. size=" << m_rawData.size() << endl; // We save the raw data, to avoid damaging the file by many load/save cycles (especially for JPEG) - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureImage::getOriginalSize(void) const +TQSize KoPictureImage::getOriginalSize(void) const { return m_originalImage.size(); } -QPixmap KoPictureImage::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureImage::generatePixmap(const TQSize& size, bool smoothScale) { scaleAndCreatePixmap(size,!smoothScale); return m_cachedPixmap; } -QString KoPictureImage::getMimeType(const QString& extension) const +TQString KoPictureImage::getMimeType(const TQString& extension) const { - QString fileName("/tmp/temp."); + TQString fileName("/tmp/temp."); fileName+=extension; // Find the mimetype only by the extension, not by file content (as the file is empty!) - const QString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() ); + const TQString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() ); // ### TODO: use KMimeType::findByContent (but then the mimetype probably need to be cached) kdDebug(30003) << "Image is mime type: " << mimetype << endl; return mimetype; } -QDragObject* KoPictureImage::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPictureImage::dragObject( TQWidget *dragSource, const char *name ) { - return new QImageDrag( m_originalImage, dragSource, name ); + return new TQImageDrag( m_originalImage, dragSource, name ); } -QImage KoPictureImage::generateImage(const QSize& size) +TQImage KoPictureImage::generateImage(const TQSize& size) { // We do not cache the image, as we will seldom need it again. return m_originalImage.smoothScale( size ); @@ -190,5 +190,5 @@ void KoPictureImage::clearCache(void) { m_cachedPixmap.resize(0, 0); m_cacheIsInFastMode=true; - m_cachedSize=QSize(); + m_cachedSize=TQSize(); } diff --git a/lib/kofficecore/KoPictureImage.h b/lib/kofficecore/KoPictureImage.h index 98d7d588..4647ba42 100644 --- a/lib/kofficecore/KoPictureImage.h +++ b/lib/kofficecore/KoPictureImage.h @@ -21,14 +21,14 @@ #define __koPictureImage_h__ #include "KoPictureBase.h" -#include +#include class KoPictureImagePrivate; // TODO: fix documentation /** * @internal - * KoPictureImage is a container class for a QImage-based picture + * KoPictureImage is a container class for a TQImage-based picture * \todo remove private class, as the header is not installed */ class KoPictureImage : public KoPictureBase @@ -65,31 +65,31 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + virtual TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual bool hasAlphaBuffer() const { return m_originalImage.hasAlphaBuffer(); } @@ -97,20 +97,20 @@ public: virtual void setAlphaBuffer(bool enable) { m_originalImage.setAlphaBuffer(enable); } - virtual QImage createAlphaMask(int conversion_flags = 0) const - { return m_originalImage.createAlphaMask(conversion_flags); } + virtual TQImage createAlphaMask(int conversion_flags = 0) const + { return m_originalImage.createAlphaMask((Qt::ImageConversionFlags)conversion_flags); } virtual void clearCache(void); protected: - QPixmap getPixmap(QImage& image); - void scaleAndCreatePixmap(const QSize& size, bool fastMode=false); + TQPixmap getPixmap(TQImage& image); + void scaleAndCreatePixmap(const TQSize& size, bool fastMode=false); private: - QImage m_originalImage; ///< Image as Qimage - QByteArray m_rawData; ///< Binary copy of the loaded image file - QPixmap m_cachedPixmap; ///< Cached pixmap - QSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap + TQImage m_originalImage; ///< Image as Qimage + TQByteArray m_rawData; ///< Binary copy of the loaded image file + TQPixmap m_cachedPixmap; ///< Cached pixmap + TQSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap /** * true, if the last cached image was done using fast mode. * false, if the last cached image was done using slow mode. diff --git a/lib/kofficecore/KoPictureKey.cpp b/lib/kofficecore/KoPictureKey.cpp index ef60cfed..0badb429 100644 --- a/lib/kofficecore/KoPictureKey.cpp +++ b/lib/kofficecore/KoPictureKey.cpp @@ -19,20 +19,20 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include "KoPictureKey.h" -static void resetDateTimeToEpoch(QDateTime& dt) +static void resetDateTimeToEpoch(TQDateTime& dt) { // set the time point to 1970-01-01 - dt.setDate(QDate(1970,1,1)); - dt.setTime(QTime(0,0)); - // Note: we cannot use QDateTime;;setTime_t as it makes a local time correction! (### TODO: not true anymore with recent Qt versions) + dt.setDate(TQDate(1970,1,1)); + dt.setTime(TQTime(0,0)); + // Note: we cannot use TQDateTime;;setTime_t as it makes a local time correction! (### TODO: not true anymore with recent TQt versions) } KoPictureKey::KoPictureKey() @@ -40,7 +40,7 @@ KoPictureKey::KoPictureKey() resetDateTimeToEpoch(m_lastModified); } -KoPictureKey::KoPictureKey( const QString &fn, const QDateTime &mod ) +KoPictureKey::KoPictureKey( const TQString &fn, const TQDateTime &mod ) : m_filename( fn ), m_lastModified( mod ) { if (!m_lastModified.isValid()) @@ -50,7 +50,7 @@ KoPictureKey::KoPictureKey( const QString &fn, const QDateTime &mod ) } } -KoPictureKey::KoPictureKey( const QString &fn ) +KoPictureKey::KoPictureKey( const TQString &fn ) : m_filename( fn ) { resetDateTimeToEpoch(m_lastModified); @@ -79,10 +79,10 @@ bool KoPictureKey::operator<( const KoPictureKey &key ) const return key.toString() < toString(); } -void KoPictureKey::saveAttributes( QDomElement &elem ) const +void KoPictureKey::saveAttributes( TQDomElement &elem ) const { - QDate date = m_lastModified.date(); - QTime time = m_lastModified.time(); + TQDate date = m_lastModified.date(); + TQTime time = m_lastModified.time(); elem.setAttribute( "filename", m_filename ); elem.setAttribute( "year", date.year() ); elem.setAttribute( "month", date.month() ); @@ -93,7 +93,7 @@ void KoPictureKey::saveAttributes( QDomElement &elem ) const elem.setAttribute( "msec", time.msec() ); } -void KoPictureKey::loadAttributes( const QDomElement &elem ) +void KoPictureKey::loadAttributes( const TQDomElement &elem ) { // Default date/time is the *nix epoch: 1970-01-01 00:00:00,000 int year=1970, month=1, day=1; @@ -125,8 +125,8 @@ void KoPictureKey::loadAttributes( const QDomElement &elem ) if( elem.hasAttribute( "msec" ) ) msec=elem.attribute( "msec" ).toInt(); - m_lastModified.setDate( QDate( year, month, day ) ); - m_lastModified.setTime( QTime( hour, minute, second, msec ) ); + m_lastModified.setDate( TQDate( year, month, day ) ); + m_lastModified.setTime( TQTime( hour, minute, second, msec ) ); if (!m_lastModified.isValid()) { @@ -136,16 +136,16 @@ void KoPictureKey::loadAttributes( const QDomElement &elem ) } } -QString KoPictureKey::toString() const +TQString KoPictureKey::toString() const { - // We do not use the default QDateTime::toString has it does not show microseconds - return QString::fromLatin1( "%1 %2" ) - .arg( m_filename, m_lastModified.toString("yyyy-MM-dd hh:mm:ss.zzz") ); + // We do not use the default TQDateTime::toString has it does not show microseconds + return TQString::tqfromLatin1( "%1 %2" ) + .tqarg( m_filename, m_lastModified.toString("yyyy-MM-dd hh:mm:ss.zzz") ); } -void KoPictureKey::setKeyFromFile (const QString& filename) +void KoPictureKey::setKeyFromFile (const TQString& filename) { - QFileInfo inf(filename); + TQFileInfo inf(filename); m_filename = filename; m_lastModified = inf.lastModified(); } diff --git a/lib/kofficecore/KoPictureKey.h b/lib/kofficecore/KoPictureKey.h index d336215b..09cf6320 100644 --- a/lib/kofficecore/KoPictureKey.h +++ b/lib/kofficecore/KoPictureKey.h @@ -20,35 +20,35 @@ #ifndef __koPictureKey_h__ #define __koPictureKey_h__ -#include -#include +#include +#include #include /** * \file koPictureKey.h * \todo correct documentation (for example: sed "s/image/picture/g") */ -class QDomElement; +class TQDomElement; namespace KoPictureType { /** - * QPicture version used by KoPictureClipart + * TQPicture version used by KoPictureClipart * * Possible values: - * \li 3 for Qt 2.1.x and later Qt 2.x - * \li 4 for Qt 3.0 - * \li 5 for Qt 3.1 and later Qt 3.x - * \li -1 for current Qt + * \li 3 for TQt 2.1.x and later TQt 2.x + * \li 4 for TQt 3.0 + * \li 5 for TQt 3.1 and later TQt 3.x + * \li -1 for current TQt */ - const int formatVersionQPicture=-1; + const int formatVersionTQPicture=-1; enum Type { TypeUnknown = 0, ///< Unknown or not-an-image @see KoPictureBase - TypeImage, ///< Image, QImage-based @see KoPictureImage + TypeImage, ///< Image, TQImage-based @see KoPictureImage TypeEps, ///< Encapsulated Postscript @see KoPictureEps - TypeClipart, ///< Clipart, QPicture-based @see KoPictureClipart + TypeClipart, ///< Clipart, TQPicture-based @see KoPictureClipart TypeWmf ///< WMF (Windows Meta File) @see KoPictureWmf }; } @@ -61,8 +61,8 @@ namespace KoPictureType * @short Structure describing a picture on disk * * @note We use the *nix epoch (1970-01-01) as a time base because it is a valid date. - * That way we do not depend on a behaviour of the current QDateTime that might change in future versions of Qt - * and we are also nice to non-Qt programs wanting to read KOffice's files. + * That way we do not depend on a behaviour of the current TQDateTime that might change in future versions of TQt + * and we are also nice to non-TQt programs wanting to read KOffice's files. * * @note This behaviour is also needed for re-saving KWord files having \. When saving again, * these files get a \ element as child of \ but not one as child of \ and \. @@ -87,13 +87,13 @@ public: * to update the file and import it into the application again, without * the application reusing the old copy from the collection. */ - KoPictureKey( const QString &fn, const QDateTime &mod ); + KoPictureKey( const TQString &fn, const TQDateTime &mod ); /** * Constructs a key from a filename * @note The modification date is set to 1970-01-01 */ - KoPictureKey( const QString &fn ); + KoPictureKey( const TQString &fn ); /** * Copy constructor @@ -119,36 +119,36 @@ public: /** * Convert this key into a string representation of it */ - QString toString() const; + TQString toString() const; /** * Save this key in XML (as %KOffice 1.3) */ - void saveAttributes( QDomElement &elem ) const; + void saveAttributes( TQDomElement &elem ) const; /** * Load this key from XML (as %KOffice 1.3) */ - void loadAttributes( const QDomElement &elem ); + void loadAttributes( const TQDomElement &elem ); /** * First part of the key: the filename */ - QString filename() const { return m_filename; } + TQString filename() const { return m_filename; } /** * Second part of the key: the modification date */ - QDateTime lastModified() const { return m_lastModified; } + TQDateTime lastModified() const { return m_lastModified; } /** * Sets the key according to @p filename, including modification time */ - void setKeyFromFile (const QString& filename); + void setKeyFromFile (const TQString& filename); protected: - QString m_filename; - QDateTime m_lastModified; + TQString m_filename; + TQDateTime m_lastModified; }; #endif /* __koPictureKey_h__ */ diff --git a/lib/kofficecore/KoPictureShared.cpp b/lib/kofficecore/KoPictureShared.cpp index 5c2ff2a2..16fea2ef 100644 --- a/lib/kofficecore/KoPictureShared.cpp +++ b/lib/kofficecore/KoPictureShared.cpp @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -45,9 +45,9 @@ void KoPictureShared::assignPictureId( uint _id) m_pictureId = _id; } -QString KoPictureShared::uniquePictureId() const +TQString KoPictureShared::uniquePictureId() const { - return "Pictures"+ QString::number(m_pictureId); + return "Pictures"+ TQString::number(m_pictureId); } KoPictureShared::~KoPictureShared(void) @@ -56,7 +56,7 @@ KoPictureShared::~KoPictureShared(void) } KoPictureShared::KoPictureShared(const KoPictureShared &other) - : QShared() // Some compilers want it explicitly! + : TQShared() // Some compilers want it explicitly! { // We need to use newCopy, because we want a real copy, not just a copy of the part of KoPictureBase if (other.m_base) @@ -89,7 +89,7 @@ bool KoPictureShared::isNull(void) const return true; } -void KoPictureShared::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureShared::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if (m_base) m_base->draw(painter, x, y, width, height, sx, sy, sw, sh, fastMode); @@ -98,27 +98,27 @@ void KoPictureShared::draw(QPainter& painter, int x, int y, int width, int heigh // Draw a red box (easier DEBUG) kdWarning(30003) << "Drawing red rectangle! (KoPictureShared::draw)" << endl; painter.save(); - painter.setBrush(QColor(255,0,0)); + painter.setBrush(TQColor(255,0,0)); painter.drawRect(x,y,width,height); painter.restore(); } } -bool KoPictureShared::loadWmf(QIODevice* io) +bool KoPictureShared::loadWmf(TQIODevice* io) { kdDebug(30003) << "KoPictureShared::loadWmf" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } clear(); - // The extension .wmf was used (KOffice 1.1.x) for QPicture files + // The extension .wmf was used (KOffice 1.1.x) for TQPicture files // For an extern file or in the storage, .wmf can mean a real Windows Meta File. - QByteArray array ( io->readAll() ); + TQByteArray array ( io->readAll() ); if ((array[0]=='Q') && (array[1]=='P') &&(array[2]=='I') && (array[3]=='C')) { @@ -133,25 +133,25 @@ bool KoPictureShared::loadWmf(QIODevice* io) return m_base->loadData(array, m_extension); } -bool KoPictureShared::loadTmp(QIODevice* io) +bool KoPictureShared::loadTmp(TQIODevice* io) // We have a temp file, probably from a downloaded file // We must check the file type { kdDebug(30003) << "KoPictureShared::loadTmp" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } - // The extension .wmf was used (KOffice 1.1.x) for QPicture files + // The extension .wmf was used (KOffice 1.1.x) for TQPicture files // For an extern file or in the storage, .wmf can mean a real Windows Meta File. - QByteArray array ( io->readAll() ); + TQByteArray array ( io->readAll() ); return identifyAndLoad( array ); } -bool KoPictureShared::identifyAndLoad( QByteArray array ) +bool KoPictureShared::identifyAndLoad( TQByteArray array ) { if ( array.size() < 5 ) { @@ -159,11 +159,11 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) return false; } - QString strExtension; + TQString strExtension; bool flag=false; // Try to find the file type by comparing magic on the first few bytes! - // ### TODO: could not QImageIO::imageFormat do it too? (At least most of them?) + // ### TODO: could not TQImageIO::imageFormat do it too? (At least most of them?) if ((array[0]==char(0x89)) && (array[1]=='P') &&(array[2]=='N') && (array[3]=='G')) { strExtension="png"; @@ -205,19 +205,19 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) else if ( ( array[0] == char( 0037 ) ) && ( array[1] == char( 0213 ) ) ) { // Gzip - QBuffer buffer(array); + TQBuffer buffer(array); buffer.open(IO_ReadOnly); - const bool flag = loadCompressed( &buffer, "application/x-gzip", "tmp" ); + const bool flag = loadCompressed( TQT_TQIODEVICE(&buffer), "application/x-gzip", "tmp" ); buffer.close(); return flag; } else if ( ( array[0] == 'B' ) && ( array[1] == 'Z' ) && ( array[2] == 'h') ) { // BZip2 - QBuffer buffer(array); + TQBuffer buffer(array); buffer.open(IO_ReadOnly); - const bool flag = loadCompressed( &buffer, "application/x-bzip2", "tmp" ); + const bool flag = loadCompressed( TQT_TQIODEVICE(&buffer), "application/x-bzip2", "tmp" ); buffer.close(); return flag; } @@ -226,17 +226,17 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) kdDebug(30003) << "Cannot identify the type of temp file!" << " Trying to convert to PNG! (in KoPictureShared::loadTmp" << endl; - // Do not trust QBuffer and do not work directly on the QByteArray array + // Do not trust TQBuffer and do not work directly on the TQByteArray array // DF: It would be faster to work on array here, and to create a completely - // different QBuffer for the writing code! - QBuffer buf( array.copy() ); + // different TQBuffer for the writing code! + TQBuffer buf( array.copy() ); if (!buf.open(IO_ReadOnly)) { kdError(30003) << "Could not open read buffer!" << endl; return false; } - QImageIO imageIO(&buf,NULL); + TQImageIO imageIO(&buf,NULL); if (!imageIO.read()) { @@ -252,7 +252,7 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) return false; } - imageIO.setIODevice(&buf); + imageIO.setIODevice(TQT_TQIODEVICE(&buf)); imageIO.setFormat("PNG"); if (!imageIO.write()) @@ -279,12 +279,12 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) -bool KoPictureShared::loadXpm(QIODevice* io) +bool KoPictureShared::loadXpm(TQIODevice* io) { kdDebug(30003) << "KoPictureShared::loadXpm" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } @@ -293,13 +293,13 @@ bool KoPictureShared::loadXpm(QIODevice* io) // Old KPresenter XPM files have char(1) instead of some " // Therefore we need to treat XPM separately - QByteArray array=io->readAll(); + TQByteArray array=io->readAll(); // As XPM files are normally only ASCII files, we can replace it without problems int pos=0; - while ((pos=array.find(char(1),pos))!=-1) + while ((pos=array.tqfind(char(1),pos))!=-1) { array[pos]='"'; } @@ -308,13 +308,13 @@ bool KoPictureShared::loadXpm(QIODevice* io) m_base=new KoPictureImage(); - QBuffer buffer(array); - bool check = m_base->load(&buffer,"xpm"); + TQBuffer buffer(array); + bool check = m_base->load(TQT_TQIODEVICE(&buffer),"xpm"); setExtension("xpm"); return check; } -bool KoPictureShared::save(QIODevice* io) const +bool KoPictureShared::save(TQIODevice* io) const { if (!io) return false; @@ -337,12 +337,12 @@ void KoPictureShared::clear(void) m_base=NULL; } -void KoPictureShared::clearAndSetMode(const QString& newMode) +void KoPictureShared::clearAndSetMode(const TQString& newMode) { delete m_base; m_base=NULL; - const QString mode=newMode.lower(); + const TQString mode=newMode.lower(); if ((mode=="svg") || (mode=="qpic")) { @@ -357,42 +357,42 @@ void KoPictureShared::clearAndSetMode(const QString& newMode) m_base=new KoPictureEps(); } else - { // TODO: test if QImageIO really knows the file format + { // TODO: test if TQImageIO really knows the file format m_base=new KoPictureImage(); } } -QString KoPictureShared::getExtension(void) const +TQString KoPictureShared::getExtension(void) const { return m_extension; } -void KoPictureShared::setExtension(const QString& extension) +void KoPictureShared::setExtension(const TQString& extension) { m_extension = extension; } -QString KoPictureShared::getMimeType(void) const +TQString KoPictureShared::getMimeType(void) const { if (m_base) return m_base->getMimeType(m_extension); - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } -bool KoPictureShared::loadFromBase64( const QCString& str ) +bool KoPictureShared::loadFromBase64( const TQCString& str ) { clear(); - QByteArray data; + TQByteArray data; KCodecs::base64Decode( str, data ); return identifyAndLoad( data ); } -bool KoPictureShared::load(QIODevice* io, const QString& extension) +bool KoPictureShared::load(TQIODevice* io, const TQString& extension) { - kdDebug(30003) << "KoPictureShared::load(QIODevice*, const QString&) " << extension << endl; + kdDebug(30003) << "KoPictureShared::load(TQIODevice*, const TQString&) " << extension << endl; bool flag=false; - QString ext(extension.lower()); + TQString ext(extension.lower()); if (ext=="wmf") flag=loadWmf(io); else if (ext=="tmp") // ### TODO: also remote scripts need this, don't they? @@ -423,7 +423,7 @@ bool KoPictureShared::load(QIODevice* io, const QString& extension) return flag; } -bool KoPictureShared::loadFromFile(const QString& fileName) +bool KoPictureShared::loadFromFile(const TQString& fileName) { kdDebug(30003) << "KoPictureShared::loadFromFile " << fileName << endl; if ( fileName.isEmpty() ) @@ -431,54 +431,54 @@ bool KoPictureShared::loadFromFile(const QString& fileName) kdError(30003) << "Cannot load file with empty name!" << endl; return false; } - QFile file(fileName); + TQFile file(fileName); if (!file.open(IO_ReadOnly)) return false; bool flag = false; - const int pos=fileName.findRev('.'); + const int pos=fileName.tqfindRev('.'); if (pos==-1) { kdDebug(30003) << "File with no extension!" << endl; // As we have no extension, consider it like a temporary file - flag = loadTmp( &file ); + flag = loadTmp( TQT_TQIODEVICE(&file) ); } else { - const QString extension( fileName.mid( pos+1 ) ); + const TQString extension( fileName.mid( pos+1 ) ); // ### TODO: check if the extension if gz or bz2 and find the previous extension - flag = load( &file, extension ); + flag = load( TQT_TQIODEVICE(&file), extension ); } file.close(); return flag; } -QSize KoPictureShared::getOriginalSize(void) const +TQSize KoPictureShared::getOriginalSize(void) const { if (m_base) return m_base->getOriginalSize(); - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPictureShared::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureShared::generatePixmap(const TQSize& size, bool smoothScale) { if (m_base) return m_base->generatePixmap(size, smoothScale); - return QPixmap(); + return TQPixmap(); } -QDragObject* KoPictureShared::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPictureShared::dragObject( TQWidget *dragSource, const char *name ) { if (m_base) return m_base->dragObject( dragSource, name ); return 0L; } -QImage KoPictureShared::generateImage(const QSize& size) +TQImage KoPictureShared::generateImage(const TQSize& size) { if (m_base) return m_base->generateImage( size ); - return QImage(); + return TQImage(); } bool KoPictureShared::hasAlphaBuffer() const @@ -494,11 +494,11 @@ void KoPictureShared::setAlphaBuffer(bool enable) m_base->setAlphaBuffer(enable); } -QImage KoPictureShared::createAlphaMask(int conversion_flags) const +TQImage KoPictureShared::createAlphaMask(int conversion_flags) const { if (m_base) return m_base->createAlphaMask(conversion_flags); - return QImage(); + return TQImage(); } void KoPictureShared::clearCache(void) @@ -507,10 +507,10 @@ void KoPictureShared::clearCache(void) m_base->clearCache(); } -bool KoPictureShared::loadCompressed( QIODevice* io, const QString& mimeType, const QString& extension ) +bool KoPictureShared::loadCompressed( TQIODevice* io, const TQString& mimeType, const TQString& extension ) { // ### TODO: check that we do not have an endless recursion - QIODevice* in = KFilterDev::device( io, mimeType, false); + TQIODevice* in = KFilterDev::device( io, mimeType, false); if ( !in ) { diff --git a/lib/kofficecore/KoPictureShared.h b/lib/kofficecore/KoPictureShared.h index da286368..f90c91e4 100644 --- a/lib/kofficecore/KoPictureShared.h +++ b/lib/kofficecore/KoPictureShared.h @@ -20,16 +20,16 @@ #ifndef __koPictureShared_h__ #define __koPictureShared_h__ -#include -#include -#include -#include +#include +#include +#include +#include #include "KoPictureKey.h" class KoXmlWriter; -class QPainter; -class QSize; +class TQPainter; +class TQSize; class KURL; @@ -39,9 +39,9 @@ class KoPictureBase; * @internal * KoPictureShared is the class that contains the shared part for KoPicture * - * @warning As with all QShared objects, the sharing is neither automatic nor transparent! + * @warning As with all TQShared objects, the sharing is neither automatic nor transparent! */ -class KoPictureShared : public QShared +class KoPictureShared : public TQShared { public: /** @@ -82,29 +82,29 @@ public: * * The parameters @p width, @p height define the desired size for the picture * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard * @return 0L if the picture is null! */ - QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - bool load(QIODevice* io, const QString& extension); - bool loadFromBase64( const QCString& str ); + bool load(TQIODevice* io, const TQString& extension); + bool loadFromBase64( const TQCString& str ); /** - * Save picture into a QIODevice - * @param io QIODevice used for saving + * Save picture into a TQIODevice + * @param io TQIODevice used for saving */ - bool save(QIODevice* io) const; + bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -112,18 +112,18 @@ public: */ bool saveAsBase64( KoXmlWriter& writer ) const; - void setExtension(const QString& extension); + void setExtension(const TQString& extension); - QString getExtension(void) const; + TQString getExtension(void) const; - QSize getOriginalSize(void) const; + TQSize getOriginalSize(void) const; /** * Clear and set the mode of this KoPictureShared * * @param newMode file extension (like "png") giving the wanted mode */ - void clearAndSetMode(const QString& newMode); + void clearAndSetMode(const TQString& newMode); /** * Reset the KoPictureShared (but not the key!) @@ -135,35 +135,35 @@ public: * * @param fileName the name of the file to load */ - bool loadFromFile(const QString& fileName); + bool loadFromFile(const TQString& fileName); /** * Load a potentially broken XPM file (for KPresenter) */ - bool loadXpm(QIODevice* io); + bool loadXpm(TQIODevice* io); /** * @deprecated - * Returns a QPixmap from an image + * Returns a TQPixmap from an image * - * @param size the wanted size for the QPixmap + * @param size the wanted size for the TQPixmap */ - QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - QString getMimeType(void) const; + TQString getMimeType(void) const; /** - * Generate a QImage + * Generate a TQImage * * (always in slow mode) * - * @param size the wanted size for the QImage + * @param size the wanted size for the TQImage */ - QImage generateImage(const QSize& size); + TQImage generateImage(const TQSize& size); bool hasAlphaBuffer() const; void setAlphaBuffer(bool enable); - QImage createAlphaMask(int conversion_flags = 0) const; + TQImage createAlphaMask(int conversion_flags = 0) const; /** * Clear any cache @@ -173,25 +173,25 @@ public: */ void clearCache(void); - QString uniquePictureId() const; + TQString uniquePictureId() const; void assignPictureId( uint _id); protected: /** * @internal * Load a WMF file - * \note In %KOffice 1.1, a .wmf file was a QPicture file + * \note In %KOffice 1.1, a .wmf file was a TQPicture file */ - bool loadWmf(QIODevice* io); + bool loadWmf(TQIODevice* io); /** * @internal * Loads a temporary file, probably from a downloaded file */ - bool loadTmp(QIODevice* io); + bool loadTmp(TQIODevice* io); /// Find type of image, create base accordingly, and load data - bool identifyAndLoad( QByteArray data ); + bool identifyAndLoad( TQByteArray data ); /** * @internal @@ -199,15 +199,15 @@ protected: * * @warning risk of endless recurision, be careful when it is called from @see load * - * @param io QIODevice of the compressed file/strea, + * @param io TQIODevice of the compressed file/strea, * @param mimeType mimetype of the (de-)compressor * @param extension extension of the uncompressed file */ - bool loadCompressed( QIODevice* io, const QString& mimeType, const QString& extension ); + bool loadCompressed( TQIODevice* io, const TQString& mimeType, const TQString& extension ); protected: KoPictureBase* m_base; - QString m_extension; + TQString m_extension; uint m_pictureId; }; diff --git a/lib/kofficecore/KoPictureWmf.cpp b/lib/kofficecore/KoPictureWmf.cpp index 96872af7..ccbab362 100644 --- a/lib/kofficecore/KoPictureWmf.cpp +++ b/lib/kofficecore/KoPictureWmf.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ #include "KoPictureBase.h" #include "KoPictureWmf.h" -KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -58,15 +58,15 @@ bool KoPictureWmf::isNull(void) const return m_clipart.isNull(); } -void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureWmf::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureWmf " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -78,12 +78,12 @@ void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureWmf::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureWmf::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension */) +bool KoPictureWmf::loadData(const TQByteArray& array, const TQString& /* extension */) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << array.size() << ")" << endl; @@ -97,32 +97,32 @@ bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension } m_originalSize = wmf.boundingRect().size(); // draw wmf file with relative coordinate - wmf.play(m_clipart, true); + wmf.play(*TQT_TQPAINTDEVICE(&m_clipart), true); return true; } -bool KoPictureWmf::save(QIODevice* io) const +bool KoPictureWmf::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureWmf::getOriginalSize(void) const +TQSize KoPictureWmf::getOriginalSize(void) const { return m_originalSize; } -QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureWmf::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); if ( m_originalSize.width() && m_originalSize.height() ) p.scale( (double)pixmap.width() / (double)m_originalSize.width(), (double)pixmap.height() / (double)m_originalSize.height() ); @@ -131,7 +131,7 @@ QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) return pixmap; } -QString KoPictureWmf::getMimeType(const QString& /* extension */) const +TQString KoPictureWmf::getMimeType(const TQString& /* extension */) const { return "image/x-wmf"; } diff --git a/lib/kofficecore/KoPictureWmf.h b/lib/kofficecore/KoPictureWmf.h index f1924d9c..dfe158bf 100644 --- a/lib/kofficecore/KoPictureWmf.h +++ b/lib/kofficecore/KoPictureWmf.h @@ -20,12 +20,12 @@ #ifndef __koPictureWmf_h__ #define __koPictureWmf_h__ -#include -#include +#include +#include #include -class QPainter; -class QSize; +class TQPainter; +class TQSize; /** * \file koPictureWmf.h @@ -68,41 +68,41 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; protected: - QPixmap getPixmap(QImage& image); + TQPixmap getPixmap(TQImage& image); /** * @internal - * Draw a QPicture + * Draw a TQPicture */ - void drawQPicture(QPicture& clipart, QPainter& painter, + void drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh); protected: - QPicture m_clipart; - QByteArray m_rawData; - QSize m_size; - QSize m_originalSize; + TQPicture m_clipart; + TQByteArray m_rawData; + TQSize m_size; + TQSize m_originalSize; }; #endif /* __koPictureWmf_h__ */ diff --git a/lib/kofficecore/KoPoint.h b/lib/kofficecore/KoPoint.h index 5f39e6c6..a5251638 100644 --- a/lib/kofficecore/KoPoint.h +++ b/lib/kofficecore/KoPoint.h @@ -20,23 +20,23 @@ #ifndef koPoint_h #define koPoint_h -#include +#include #include /** * A point whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QPoint. + * The API isn't documented, it's a perfect mirror of TQPoint. */ class KoPoint { public: KoPoint() { m_x = 0; m_y = 0; } KoPoint(const double &x, const double &y) : m_x(x), m_y(y) {} - explicit KoPoint(const QPoint & p) : m_x(p.x()), m_y(p.y()) {} + explicit KoPoint(const TQPoint & p) : m_x(p.x()), m_y(p.y()) {} ~KoPoint() {} - bool operator==(const KoPoint &rhs) const { return QABS(m_x-rhs.x()) < 1E-10 && QABS(m_y-rhs.y()) < 1E-10; } - bool operator!=(const KoPoint &rhs) const { return QABS(m_x-rhs.x()) > 1E-10 || QABS(m_y-rhs.y()) > 1E-10; } + bool operator==(const KoPoint &rhs) const { return TQABS(m_x-rhs.x()) < 1E-10 && TQABS(m_y-rhs.y()) < 1E-10; } + bool operator!=(const KoPoint &rhs) const { return TQABS(m_x-rhs.x()) > 1E-10 || TQABS(m_y-rhs.y()) > 1E-10; } bool isNull() const { return m_x == 0 && m_y == 0; } @@ -59,9 +59,9 @@ public: friend inline KoPoint operator*( const double &, const KoPoint & ); friend inline double operator*( const KoPoint &a, const KoPoint &b ); - // Not in QPoint: + // Not in TQPoint: void setCoords(const double &x, const double &y) { m_x = x; m_y = y; } - KoPoint transform (const QWMatrix &m) const + KoPoint transform (const TQWMatrix &m) const { double x, y; m.map(m_x, m_y, &x, &y); @@ -80,13 +80,13 @@ public: double manhattanLength() const { - return QABS( m_x ) + QABS( m_y ); + return TQABS( m_x ) + TQABS( m_y ); } - /// Convert to a QPoint - with precision loss! - QPoint toQPoint() const + /// Convert to a TQPoint - with precision loss! + TQPoint toTQPoint() const { - return QPoint( qRound( m_x ), qRound( m_y ) ); + return TQPoint( tqRound( m_x ), tqRound( m_y ) ); } private: @@ -115,7 +115,7 @@ inline double operator*( const KoPoint &a, const KoPoint &b ) #include /** Show a floating point value with great precision (use within kdDebug) */ -#define DEBUGDOUBLE(d) QString::number( (d), 'g', 20 ) +#define DEBUGDOUBLE(d) TQString::number( (d), 'g', 20 ) inline kdbgstream operator<<( kdbgstream str, const KoPoint & r ) { // should this use DEBUGDOUBLE? diff --git a/lib/kofficecore/KoQueryTrader.cpp b/lib/kofficecore/KoQueryTrader.cpp index 00f4379b..e164aa1a 100644 --- a/lib/kofficecore/KoQueryTrader.cpp +++ b/lib/kofficecore/KoQueryTrader.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include // UINT_MAX @@ -48,21 +48,21 @@ KoDocumentEntry::KoDocumentEntry( KService::Ptr service ) { } -KoDocument* KoDocumentEntry::createDoc( KoDocument* parent, const char* name ) const +KoDocument* KoDocumentEntry::createDoc( KoDocument* tqparent, const char* name ) const { - KLibFactory* factory = KLibLoader::self()->factory( QFile::encodeName(m_service->library()) ); + KLibFactory* factory = KLibLoader::self()->factory( TQFile::encodeName(m_service->library()) ); if( !factory ) { kdWarning(30003) << KLibLoader::self()->lastErrorMessage() << endl; return 0; } - QObject* obj; + TQObject* obj; if ( factory->inherits( "KParts::Factory" ) ) - obj = static_cast(factory)->createPart( 0L, "", parent, name, "KoDocument" ); + obj = static_cast(factory)->createPart( 0L, "", tqparent, name, "KoDocument" ); else { kdWarning(30003) << "factory doesn't inherit KParts::Factory ! It is a " << factory->className() << endl; // This shouldn't happen... - obj = factory->create( parent, name, "KoDocument" ); + obj = factory->create( tqparent, name, "KoDocument" ); } if ( !obj || !obj->inherits( "KoDocument" ) ) @@ -74,16 +74,16 @@ KoDocument* KoDocumentEntry::createDoc( KoDocument* parent, const char* name ) c return static_cast(obj); } -KoDocumentEntry KoDocumentEntry::queryByMimeType( const QString & mimetype ) +KoDocumentEntry KoDocumentEntry::queryByMimeType( const TQString & mimetype ) { - QString constr = QString::fromLatin1( "[X-KDE-NativeMimeType] == '%1' or '%2' in [X-KDE-ExtraNativeMimeTypes]" ).arg( mimetype ).arg( mimetype ); + TQString constr = TQString::tqfromLatin1( "[X-KDE-NativeMimeType] == '%1' or '%2' in [X-KDE-ExtraNativeMimeTypes]" ).tqarg( mimetype ).tqarg( mimetype ); - QValueList vec = query( false,constr ); + TQValueList vec = query( false,constr ); if ( vec.isEmpty() ) { kdWarning(30003) << "Got no results with " << constr << endl; // Fallback to the old way (which was probably wrong, but better be safe) - QString constr = QString::fromLatin1( "'%1' in ServiceTypes" ).arg( mimetype ); + TQString constr = TQString::tqfromLatin1( "'%1' in ServiceTypes" ).tqarg( mimetype ); vec = query( constr ); if ( vec.isEmpty() ) { @@ -105,16 +105,16 @@ KoDocumentEntry KoDocumentEntry::queryByMimeType( const QString & mimetype ) return vec[0]; } -QValueList KoDocumentEntry::query( const QString & _constr ) +TQValueList KoDocumentEntry::query( const TQString & _constr ) { return query(true,_constr); } -QValueList KoDocumentEntry::query( bool _onlyDocEmb, const QString & _constr ) +TQValueList KoDocumentEntry::query( bool _onlyDocEmb, const TQString & _constr ) { - QValueList lst; - QString constr; + TQValueList lst; + TQString constr; if ( !_constr.isEmpty() ) { constr = "("; constr += _constr; @@ -169,10 +169,10 @@ KoFilterEntry::KoFilterEntry( KService::Ptr service ) available = service->property( "X-KDE-Available" ).toString(); } -QValueList KoFilterEntry::query( const QString & _constr ) +TQValueList KoFilterEntry::query( const TQString & _constr ) { kdDebug(30500) << "KoFilterEntry::query( " << _constr << " )" << endl; - QValueList lst; + TQValueList lst; KTrader::OfferList offers = KTrader::self()->query( "KOfficeFilter", _constr ); @@ -192,16 +192,16 @@ QValueList KoFilterEntry::query( const QString & _constr ) return lst; } -KoFilter* KoFilterEntry::createFilter( KoFilterChain* chain, QObject* parent, const char* name ) +KoFilter* KoFilterEntry::createFilter( KoFilterChain* chain, TQObject* tqparent, const char* name ) { - KLibFactory* factory = KLibLoader::self()->factory( QFile::encodeName( m_service->library() ) ); + KLibFactory* factory = KLibLoader::self()->factory( TQFile::encodeName( m_service->library() ) ); if ( !factory ) { kdWarning(30003) << KLibLoader::self()->lastErrorMessage() << endl; return 0; } - QObject* obj = factory->create( parent, name, "KoFilter" ); + TQObject* obj = factory->create( tqparent, name, "KoFilter" ); if ( !obj || !obj->inherits( "KoFilter" ) ) { delete obj; diff --git a/lib/kofficecore/KoQueryTrader.h b/lib/kofficecore/KoQueryTrader.h index 55ab8dbe..ff2a5100 100644 --- a/lib/kofficecore/KoQueryTrader.h +++ b/lib/kofficecore/KoQueryTrader.h @@ -22,11 +22,11 @@ #include #include -#include +#include #include -class QObject; -class QStringList; +class TQObject; +class TQStringList; class KoDocument; class KoFilter; class KoFilterChain; @@ -39,7 +39,7 @@ class KOFFICECORE_EXPORT KoDocumentEntry { public: - KoDocumentEntry() { m_service = 0L; } // for QValueList + KoDocumentEntry() { m_service = 0L; } // for TQValueList KoDocumentEntry( KService::Ptr service ); ~KoDocumentEntry() { } @@ -53,24 +53,24 @@ public: /** * @return name of the associated service */ - QString name() const { return m_service->name(); } + TQString name() const { return m_service->name(); } /** * Mimetypes (and other service types) which this document can handle. */ - QStringList mimeTypes() const { return m_service->serviceTypes(); } + TQStringList mimeTypes() const { return m_service->serviceTypes(); } /** * @return TRUE if the document can handle the requested mimetype. */ - bool supportsMimeType( const QString & _mimetype ) const - { return mimeTypes().contains( _mimetype ); } + bool supportsMimeType( const TQString & _mimetype ) const + { return mimeTypes().tqcontains( _mimetype ); } /** * Uses the factory of the component to create * a document. If that is not possible, 0 is returned. */ - KoDocument* createDoc( KoDocument* parent = 0, const char* name = 0 ) const; + KoDocument* createDoc( KoDocument* tqparent = 0, const char* name = 0 ) const; /** * This function will query ksycoca to find all available components. @@ -80,7 +80,7 @@ public: * You can use it to set additional restrictions on the available * components. */ - static QValueList query( const QString & _constr = QString::null ); + static TQValueList query( const TQString & _constr = TQString() ); /** * This function will query the system to find all available filters. @@ -94,9 +94,9 @@ public: * components. */ // ### TODO: MERGE WITH ABOVE METHODE WHEN BIC+SIC CHANGES ARE ALLOWED - static QValueList query( bool _onlyDocEmb,const QString& _constr); + static TQValueList query( bool _onlyDocEmb,const TQString& _constr); /* this is how the signature should be looking after merging - static QValueList query( bool _onlyDocEmb =true, const QString& _constr = QString::null ); + static TQValueList query( bool _onlyDocEmb =true, const TQString& _constr = TQString() ); or better: use an enum for the first arg. */ @@ -107,7 +107,7 @@ public: * @return a document entry for the KOffice component that supports * the requested mimetype and fits the user best. */ - static KoDocumentEntry queryByMimeType( const QString & mimetype ); + static KoDocumentEntry queryByMimeType( const TQString & mimetype ); private: KService::Ptr m_service; @@ -122,21 +122,21 @@ class KoFilterEntry : public KShared public: typedef KSharedPtr Ptr; - KoFilterEntry() : weight( 0 ) { m_service = 0L; } // for QValueList + KoFilterEntry() : weight( 0 ) { m_service = 0L; } // for TQValueList KoFilterEntry( KService::Ptr service ); ~KoFilterEntry() { } - KoFilter* createFilter( KoFilterChain* chain, QObject* parent = 0, const char* name = 0 ); + KoFilter* createFilter( KoFilterChain* chain, TQObject* tqparent = 0, const char* name = 0 ); /** * The imported mimetype(s). */ - QStringList import; + TQStringList import; /** * The exported mimetype(s). */ - QStringList export_; + TQStringList export_; /** * The "weight" of this filter path. Has to be > 0 to be valid. @@ -146,19 +146,19 @@ public: /** * Do we have to check during runtime? */ - QString available; + TQString available; /** * @return TRUE if the filter can import the requested mimetype. */ - bool imports( const QString& _mimetype ) const - { return ( import.contains( _mimetype ) ); } + bool imports( const TQString& _mimetype ) const + { return ( import.tqcontains( _mimetype ) ); } /** * @return TRUE if the filter can export the requested mimetype. */ - bool exports( const QString& _m ) const - { return ( export_.contains( _m ) ); } + bool exports( const TQString& _m ) const + { return ( export_.tqcontains( _m ) ); } /** * This function will query KDED to find all available filters. @@ -167,7 +167,7 @@ public: * You can use it to set additional restrictions on the available * components. */ - static QValueList query( const QString& _constr = QString::null ); + static TQValueList query( const TQString& _constr = TQString() ); KService::Ptr service() const { return m_service; } diff --git a/lib/kofficecore/KoRect.cpp b/lib/kofficecore/KoRect.cpp index b93a577d..78a63992 100644 --- a/lib/kofficecore/KoRect.cpp +++ b/lib/kofficecore/KoRect.cpp @@ -166,15 +166,15 @@ KoRect &KoRect::operator&=(const KoRect &rhs) { return *this; } -bool KoRect::contains(const KoPoint &p) const { +bool KoRect::tqcontains(const KoPoint &p) const { return (p.x() >= m_tl.x() && p.x() <= m_br.x() && p.y() >= m_tl.y() && p.y() <= m_br.y()); } -bool KoRect::contains(const double &x, const double &y) const { +bool KoRect::tqcontains(const double &x, const double &y) const { return (x >= m_tl.x() && x <= m_br.x() && y >= m_tl.y() && y <= m_br.y()); } -bool KoRect::contains(const KoRect &r) const { +bool KoRect::tqcontains(const KoRect &r) const { return (r.left() >= m_tl.x() && r.right() <= m_br.x() && r.top() >= m_tl.y() && r.bottom() <= m_br.y()); } @@ -188,8 +188,8 @@ KoRect KoRect::intersect(const KoRect &r) const { } bool KoRect::intersects(const KoRect &r) const { - return ( QMAX(m_tl.x(), r.left()) <= QMIN(m_br.x(), r.right()) && - QMAX(m_tl.y(), r.top()) <= QMIN(m_br.y(), r.bottom()) ); + return ( TQMAX(m_tl.x(), r.left()) <= TQMIN(m_br.x(), r.right()) && + TQMAX(m_tl.y(), r.top()) <= TQMIN(m_br.y(), r.bottom()) ); } KoRect operator|(const KoRect &lhs, const KoRect &rhs) { @@ -226,7 +226,7 @@ bool operator!=(const KoRect &lhs, const KoRect &rhs) { lhs.bottomRight()!=rhs.bottomRight() ); } -KoRect KoRect::transform(const QWMatrix &m) const +KoRect KoRect::transform(const TQWMatrix &m) const { KoRect result; if(m.m12() == 0.0F && m.m21() == 0.0F) @@ -248,10 +248,10 @@ KoRect KoRect::transform(const QWMatrix &m) const for(int i = 1; i < 4; i++) { - result.setLeft(QMIN(p[i].x(), result.left())); - result.setTop(QMIN(p[i].y(), result.top())); - result.setRight(QMAX(p[i].x(), result.right())); - result.setBottom(QMAX(p[i].y(), result.bottom())); + result.setLeft(TQMIN(p[i].x(), result.left())); + result.setTop(TQMIN(p[i].y(), result.top())); + result.setRight(TQMAX(p[i].x(), result.right())); + result.setBottom(TQMAX(p[i].y(), result.bottom())); } } return result; @@ -262,13 +262,13 @@ KoRect KoRect::translate(double dx, double dy) const return KoRect(left() + dx, top() + dy, width(), height()); } -QRect KoRect::toQRect() const +TQRect KoRect::toTQRect() const { - return QRect( qRound( left() ), qRound( top() ), qRound( width() ), qRound( height() ) ); + return TQRect( tqRound( left() ), tqRound( top() ), tqRound( width() ), tqRound( height() ) ); } //static -KoRect KoRect::fromQRect( const QRect &rect ) +KoRect KoRect::fromTQRect( const TQRect &rect ) { return KoRect( rect.left(), rect.top(), rect.width(), rect.height() ); } diff --git a/lib/kofficecore/KoRect.h b/lib/kofficecore/KoRect.h index dfc63946..b4289088 100644 --- a/lib/kofficecore/KoRect.h +++ b/lib/kofficecore/KoRect.h @@ -21,12 +21,12 @@ #include "KoPoint.h" #include "KoSize.h" -#include +#include #include "koffice_export.h" /** * A rect whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QRect. + * The API isn't documented, it's a perfect mirror of TQRect. */ class KOFFICEUI_EXPORT KoRect { @@ -42,9 +42,9 @@ public: ~KoRect() {} bool isNull() const { return m_tl == m_br; } - // Like QRect, a null KoRect is empty. + // Like TQRect, a null KoRect is empty. bool isEmpty() const { return m_tl.x() > m_br.x() || m_tl.y() > m_br.y() || isNull(); } - // Unlike QRect, a null KoRect is valid (0-sized). + // Unlike TQRect, a null KoRect is valid (0-sized). bool isValid() const { return m_tl.x() <= m_br.x() && m_tl.y() <= m_br.y(); } KoRect normalize() const; @@ -108,20 +108,20 @@ public: * Note that for KoRect(0, 0, 100, 100) the KoPoint(0, 0) as well as KoPoint(100, 100) are * mathmatically contained in the rect, this in contrary to pixel based rectangles. */ - bool contains(const KoPoint &p) const; + bool tqcontains(const KoPoint &p) const; /// Helper function for the above function. - bool contains(const double &x, const double &y) const; + bool tqcontains(const double &x, const double &y) const; /// Helper function for the above function. - bool contains(const KoRect &r) const; + bool tqcontains(const KoRect &r) const; KoRect unite(const KoRect &r) const; KoRect intersect(const KoRect &r) const; bool intersects(const KoRect &r) const; - KoRect transform(const QWMatrix &m) const; + KoRect transform(const TQWMatrix &m) const; KoRect translate(double dx, double dy) const; - QRect toQRect() const; - static KoRect fromQRect( const QRect &rect ); + TQRect toTQRect() const; + static KoRect fromTQRect( const TQRect &rect ); private: KoPoint m_tl, m_br; @@ -141,7 +141,7 @@ inline kdbgstream operator<<( kdbgstream str, const KoRect & r ) { str << "[" < inline kndbgstream operator<<( kndbgstream str, const KoRect & ) { return str; } /** Show the rectangles that form a region (use as a standalone statement) */ -#define DEBUGREGION(reg) { QMemArrayrs=reg.rects(); for (int i=0;irs=reg.rects(); for (int i=0;i class KoSetBasicPropCommand : public KNamedCommand { public: - KoSetBasicPropCommand(Object *object, const QString &name) : KNamedCommand(name), m_object(object) {} - KoSetBasicPropCommand(Object *object, const QString &name, + KoSetBasicPropCommand(Object *object, const TQString &name) : KNamedCommand(name), m_object(object) {} + KoSetBasicPropCommand(Object *object, const TQString &name, const Property &oldProperty, const Property &newProperty) : KNamedCommand(name), m_object(object), m_oldProperty(oldProperty), m_newProperty(newProperty) {} virtual ~KoSetBasicPropCommand() {} @@ -59,8 +59,8 @@ private: template class KoSetPropCommand : public KNamedCommand { public: - KoSetPropCommand(Object *object, const QString &name) : KNamedCommand(name), m_object(object) {} - KoSetPropCommand(Object *object, const QString &name, + KoSetPropCommand(Object *object, const TQString &name) : KNamedCommand(name), m_object(object) {} + KoSetPropCommand(Object *object, const TQString &name, const Property &oldProperty, const Property &newProperty) : KNamedCommand(name), m_object(object), m_oldProperty(oldProperty), m_newProperty(newProperty) {} virtual ~KoSetPropCommand() {} diff --git a/lib/kofficecore/KoSize.h b/lib/kofficecore/KoSize.h index 3cdc30bc..6f8aa253 100644 --- a/lib/kofficecore/KoSize.h +++ b/lib/kofficecore/KoSize.h @@ -16,19 +16,19 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - This file borrows from the QSize class; + This file borrows from the TQSize class; Copyright (C) 1992-2000 Trolltech AS. All rights reserved. */ #ifndef koSize_h #define koSize_h -#include -#include +#include +#include /** * A size whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QSize. + * The API isn't documented, it's a perfect mirror of TQSize. */ class KoSize { @@ -69,21 +69,21 @@ public: friend inline const KoSize operator/( const KoSize &, int ); friend inline const KoSize operator/( const KoSize &, double ); - inline QSize toQSize() const; - static KoSize fromQSize( const QSize &size ) + inline TQSize toTQSize() const; + static KoSize fromTQSize( const TQSize &size ) { return KoSize(size.width(), size.height()); } void transpose() { - qSwap(wd, ht); + tqSwap(wd, ht); } private: static void warningDivByZero() { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) qWarning( "KoSize: Division by zero error" ); #endif } @@ -168,7 +168,7 @@ inline const KoSize operator*( double c, const KoSize &s ) inline KoSize &KoSize::operator/=( int c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0 ) warningDivByZero(); #endif @@ -178,7 +178,7 @@ inline KoSize &KoSize::operator/=( int c ) inline KoSize &KoSize::operator/=( double c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0.0 ) warningDivByZero(); #endif @@ -188,7 +188,7 @@ inline KoSize &KoSize::operator/=( double c ) inline const KoSize operator/( const KoSize &s, int c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0 ) KoSize::warningDivByZero(); #endif @@ -197,7 +197,7 @@ inline const KoSize operator/( const KoSize &s, int c ) inline const KoSize operator/( const KoSize &s, double c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0.0 ) KoSize::warningDivByZero(); #endif @@ -206,17 +206,17 @@ inline const KoSize operator/( const KoSize &s, double c ) inline KoSize KoSize::expandedTo( const KoSize & otherSize ) const { - return KoSize( QMAX(wd,otherSize.wd), QMAX(ht,otherSize.ht) ); + return KoSize( TQMAX(wd,otherSize.wd), TQMAX(ht,otherSize.ht) ); } inline KoSize KoSize::boundedTo( const KoSize & otherSize ) const { - return KoSize( QMIN(wd,otherSize.wd), QMIN(ht,otherSize.ht) ); + return KoSize( TQMIN(wd,otherSize.wd), TQMIN(ht,otherSize.ht) ); } -inline QSize KoSize::toQSize() const +inline TQSize KoSize::toTQSize() const { - return QSize(qRound(wd), qRound(ht)); + return TQSize(tqRound(wd), tqRound(ht)); } /****************************** diff --git a/lib/kofficecore/KoSpeaker.cpp b/lib/kofficecore/KoSpeaker.cpp index db975623..b8c0c098 100644 --- a/lib/kofficecore/KoSpeaker.cpp +++ b/lib/kofficecore/KoSpeaker.cpp @@ -21,26 +21,26 @@ * Boston, MA 02110-1301, USA. */ -// Qt includes. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// TQt includes. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KDE includes. #include @@ -76,29 +76,29 @@ public: {} // List of text jobs. - QValueList m_jobNums; + TQValueList m_jobNums; // Whether the version of KTTSD has been requested from the daemon. bool m_versionChecked; // KTTSD version string. - QString m_kttsdVersion; + TQString m_kttsdVersion; // Language code of last spoken text. - QString m_langCode; + TQString m_langCode; // Word used before speaking an accelerator letter. - QString m_acceleratorPrefix; + TQString m_acceleratorPrefix; // Whether TTS service is available or not. bool m_enabled; // TTS options. uint m_speakFlags; // Timer which implements the polling interval. int m_timeout; - QTimer* m_timer; + TQTimer* m_timer; // Widget and part of widget for 1) last widget under mouse pointer, 2) last widget with focus, and // last widget spoken. - QWidget* m_prevPointerWidget; + TQWidget* m_prevPointerWidget; int m_prevPointerId; - QWidget* m_prevFocusWidget; + TQWidget* m_prevFocusWidget; int m_prevFocusId; - QWidget* m_prevWidget; + TQWidget* m_prevWidget; int m_prevId; // True when cancelSpeakWidget has been called in response to customSpeakWidget signal. bool m_cancelSpeakWidget; @@ -132,11 +132,11 @@ bool KoSpeaker::isEnabled() const { return d->m_enabled; } void KoSpeaker::probe() { d->m_timer->stop(); - QWidget* w; - QPoint pos; + TQWidget* w; + TQPoint pos; bool spoke = false; if ( d->m_speakFlags & SpeakFocusWidget ) { - w = kapp->focusWidget(); + w = kapp->tqfocusWidget(); if (w) { spoke = maybeSayWidget(w); if (!spoke) @@ -144,7 +144,7 @@ void KoSpeaker::probe() } } if ( !spoke && d->m_speakFlags & SpeakPointerWidget ) { - pos = QCursor::pos(); + pos = TQCursor::pos(); w = kapp->widgetAt(pos, true); if (w) { if (!maybeSayWidget(w, pos)) @@ -154,7 +154,7 @@ void KoSpeaker::probe() d->m_timer->start(d->m_timeout); } -void KoSpeaker::queueSpeech(const QString& msg, const QString& langCode /*= QString()*/, bool first /*= true*/) +void KoSpeaker::queueSpeech(const TQString& msg, const TQString& langCode /*= TQString()*/, bool first /*= true*/) { if (!startKttsd()) return; int jobCount = d->m_jobNums.count(); @@ -164,11 +164,11 @@ void KoSpeaker::queueSpeech(const QString& msg, const QString& langCode /*= QStr d->m_jobNums.clear(); jobCount = 0; } - QString s = msg.stripWhiteSpace(); + TQString s = msg.stripWhiteSpace(); if (s.isEmpty()) return; // kdDebug() << "KoSpeaker::queueSpeech: s = [" << s << "]" << endl; // If no language code given, assume desktop setting. - QString languageCode = langCode; + TQString languageCode = langCode; if (langCode.isEmpty()) languageCode = KGlobal::locale()->language(); // kdDebug() << "KoSpeaker::queueSpeech:languageCode = " << languageCode << endl; @@ -209,45 +209,45 @@ void KoSpeaker::readConfig(KConfig* config) d->m_acceleratorPrefix = config->readEntry("AcceleratorPrefixWord", i18n("Accelerator")); if (d->m_speakFlags & (SpeakPointerWidget | SpeakFocusWidget)) { if (startKttsd()) { - d->m_timer = new QTimer( this ); - connect( d->m_timer, SIGNAL(timeout()), this, SLOT(probe()) ); + d->m_timer = new TQTimer( this ); + connect( d->m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(probe()) ); d->m_timer->start( d->m_timeout ); } } } -bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) +bool KoSpeaker::maybeSayWidget(TQWidget* w, const TQPoint& pos /*=TQPoint()*/) { if (!w) return false; int id = -1; - QString text; + TQString text; - if (w->inherits("QViewportWidget")) { - w = w->parentWidget(); + if (w->inherits("TQViewportWidget")) { + w = w->tqparentWidget(); if (!w) return false; } // Handle widgets that have multiple parts. - if ( w->inherits("QMenuBar") ) { - QMenuBar* menuBar = dynamic_cast(w); - if (pos == QPoint()) { + if ( w->inherits(TQMENUBAR_OBJECT_NAME_STRING) ) { + TQMenuBar* menuBar = dynamic_cast(w); + if (pos == TQPoint()) { for (uint i = 0; i < menuBar->count(); ++i) if (menuBar->isItemActive(menuBar->idAt(i))) { id = menuBar->idAt(i); break; } } - // TODO: This doesn't work. Need way to figure out the QMenuItem underneath mouse pointer. + // TODO: This doesn't work. Need way to figure out the TQMenuItem underneath mouse pointer. // id = menuBarItemAt(menuBar, pos); if ( id != -1 ) text = menuBar->text(id); } else - if (w->inherits("QPopupMenu")) { - QPopupMenu* popupMenu = dynamic_cast(w); - if (pos == QPoint()) { + if (w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) { + TQPopupMenu* popupMenu = dynamic_cast(w); + if (pos == TQPoint()) { for (uint i = 0; i < popupMenu->count(); ++i) if (popupMenu->isItemActive(popupMenu->idAt(i))) { id = popupMenu->idAt(i); @@ -259,10 +259,10 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) text = popupMenu->text(id); } else - if (w->inherits("QTabBar")) { - QTabBar* tabBar = dynamic_cast(w); - QTab* tab = 0; - if (pos == QPoint()) + if (w->inherits(TQTABBAR_OBJECT_NAME_STRING)) { + TQTabBar* tabBar = dynamic_cast(w); + TQTab* tab = 0; + if (pos == TQPoint()) tab = tabBar->tabAt(tabBar->currentTab()); else tab = tabBar->selectTab(tabBar->mapFromGlobal(pos)); @@ -272,10 +272,10 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QListView")) { - QListView* lv = dynamic_cast(w); - QListViewItem* item = 0; - if (pos == QPoint()) + if (w->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) { + TQListView* lv = dynamic_cast(w); + TQListViewItem* item = 0; + if (pos == TQPoint()) item = lv->currentItem(); else item = lv->itemAt(lv->viewport()->mapFromGlobal(pos)); @@ -287,11 +287,11 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QListBox")) { - QListBox* lb = dynamic_cast(w); + if (w->inherits(TQLISTBOX_OBJECT_NAME_STRING)) { + TQListBox* lb = dynamic_cast(w); // qt docs say coordinates are in "on-screen" coordinates. What does that mean? - QListBoxItem* item = 0; - if (pos == QPoint()) + TQListBoxItem* item = 0; + if (pos == TQPoint()) item = lb->item(lb->currentItem()); else item = lb->itemAt(lb->mapFromGlobal(pos)); @@ -301,28 +301,28 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QIconView")) { - QIconView* iv = dynamic_cast(w); - QIconViewItem* item = 0; - if (pos == QPoint()) + if (w->inherits(TQICONVIEW_OBJECT_NAME_STRING)) { + TQIconView* iv = dynamic_cast(w); + TQIconViewItem* item = 0; + if (pos == TQPoint()) item = iv->currentItem(); else - item = iv->findItem(iv->viewportToContents(iv->viewport()->mapFromGlobal(pos))); + item = iv->tqfindItem(iv->viewportToContents(iv->viewport()->mapFromGlobal(pos))); if (item) { id = item->index(); text = item->text(); } } else - if (w->inherits("QTable")) { - QTable* tbl = dynamic_cast(w); + if (w->inherits(TQTABLE_OBJECT_NAME_STRING)) { + TQTable* tbl = dynamic_cast(w); int row = -1; int col = -1; - if (pos == QPoint()) { + if (pos == TQPoint()) { row = tbl->currentRow(); col = tbl->currentColumn(); } else { - QPoint p = tbl->viewportToContents(tbl->viewport()->mapFromGlobal(pos)); + TQPoint p = tbl->viewportToContents(tbl->viewport()->mapFromGlobal(pos)); row = tbl->rowAt(p.y()); col = tbl->columnAt(p.x()); } @@ -332,13 +332,13 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QGridView")) { - QGridView* gv = dynamic_cast(w); - // TODO: QGridView does not have a "current" row or column. Don't think they can even get focus? + if (w->inherits(TQGRIDVIEW_OBJECT_NAME_STRING)) { + TQGridView* gv = dynamic_cast(w); + // TODO: TQGridView does not have a "current" row or column. Don't think they can even get focus? int row = -1; int col = -1; - if (pos != QPoint()) { - QPoint p = gv->viewportToContents(gv->viewport()->mapFromGlobal(pos)); + if (pos != TQPoint()) { + TQPoint p = gv->viewportToContents(gv->viewport()->mapFromGlobal(pos)); row = gv->rowAt(p.y()); col = gv->columnAt(p.x()); } @@ -346,7 +346,7 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) id = (row * gv->numCols()) + col; } - if (pos == QPoint()) { + if (pos == TQPoint()) { if ( w == d->m_prevFocusWidget && id == d->m_prevFocusId) return false; d->m_prevFocusWidget = w; d->m_prevFocusId = id; @@ -366,29 +366,29 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) if (d->m_cancelSpeakWidget) return true; // Handle simple, single-part widgets. - if ( w->inherits("QButton") ) - text = dynamic_cast(w)->text(); + if ( w->inherits(TQBUTTON_OBJECT_NAME_STRING) ) + text = dynamic_cast(w)->text(); else - if (w->inherits("QComboBox")) - text = dynamic_cast(w)->currentText(); + if (w->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->currentText(); else - if (w->inherits("QLineEdit")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QTextEdit")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQTEXTEDIT_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QLabel")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQLABEL_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QGroupBox")) { + if (w->inherits(TQGROUPBOX_OBJECT_NAME_STRING)) { // TODO: Should calculate this number from font size? if (w->mapFromGlobal(pos).y() < 30) - text = dynamic_cast(w)->title(); + text = dynamic_cast(w)->title(); } // else -// if (w->inherits("QWhatsThat")) { -// text = dynamic_cast(w)->text(); +// if (w->inherits("TQWhatsThat")) { +// text = dynamic_cast(w)->text(); // } text = text.stripWhiteSpace(); @@ -400,9 +400,9 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } if (d->m_speakFlags & SpeakTooltip || text.isEmpty()) { // kdDebug() << "pos = " << pos << endl; - // QPoint p = w->mapFromGlobal(pos); + // TQPoint p = w->mapFromGlobal(pos); // kdDebug() << "p = " << p << endl; - QString t = QToolTip::textFor(w, pos); + TQString t = TQToolTip::textFor(w, pos); t = t.stripWhiteSpace(); if (!t.isEmpty()) { if (t.right(1) != ".") t += "."; @@ -411,7 +411,7 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } if (d->m_speakFlags & SpeakWhatsThis || text.isEmpty()) { - QString t = QWhatsThis::textFor(w, pos); + TQString t = TQWhatsThis::textFor(w, pos); t = t.stripWhiteSpace(); if (!t.isEmpty()) { if (t.right(1) != ".") t += "."; @@ -427,48 +427,48 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) return sayWidget(text); } -bool KoSpeaker::sayWidget(const QString& msg) +bool KoSpeaker::sayWidget(const TQString& msg) { - QString s = msg; + TQString s = msg; if (d->m_speakFlags & SpeakAccelerator) { - int amp = s.find("&"); + int amp = s.tqfind("&"); if (amp >= 0) { - QString acc = s.mid(++amp,1); + TQString acc = s.mid(++amp,1); acc = acc.stripWhiteSpace(); if (!acc.isEmpty()) s += ". " + d->m_acceleratorPrefix + " " + acc + "."; } } s.remove("&"); - if (QStyleSheet::mightBeRichText(s)) { + if (TQStyleSheet::mightBeRichText(s)) { // kdDebug() << "richtext" << endl; - s.replace(QRegExp(""), ""); - s.replace(QRegExp(""), ""); - s.replace(QRegExp("<(br|hr)>"), " "); - s.replace(QRegExp( + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp("<(br|hr)>"), " "); + s.tqreplace(TQRegExp( ""), ""); - s.replace(QRegExp(""), ""); - s.replace(QRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); // Replace with "small frame_text image. " - s.replace(QRegExp(""), "\\1 \\2 image. "); + s.tqreplace(TQRegExp(""), "\\1 \\2 image. "); } if (s.isEmpty()) return false; - s.replace("Ctrl+", i18n("control plus ")); - s.replace("Alt+", i18n("alt plus ")); - s.replace("+", i18n(" plus ")); + s.tqreplace("Ctrl+", i18n("control plus ")); + s.tqreplace("Alt+", i18n("alt plus ")); + s.tqreplace("+", i18n(" plus ")); sayScreenReaderOutput(s, ""); return true; } // This doesn't work. Anybody know how to find the menu item underneath mouse pointer -// in a QMenuBar? -// int KoSpeaker::menuBarItemAt(QMenuBar* m, const QPoint& p) +// in a TQMenuBar? +// int KoSpeaker::menuBarItemAt(TQMenuBar* m, const TQPoint& p) // { // for (uint i = 0; i < m->count(); i++) { // int id = m->idAt(i); -// QMenuItem* mi = m->findItem(id); -// QWidget* w = mi->widget(); -// if (w->rect().contains(w->mapFromGlobal(p))) return id; +// TQMenuItem* mi = m->findItem(id); +// TQWidget* w = mi->widget(); +// if (w->rect().tqcontains(w->mapFromGlobal(p))) return id; // } // return -1; // } @@ -485,8 +485,8 @@ bool KoSpeaker::startKttsd() // If KTTSD not running, start it. if (!client->isApplicationRegistered("kttsd")) { - QString error; - if (kapp->startServiceByDesktopName("kttsd", QStringList(), &error)) { + TQString error; + if (kapp->startServiceByDesktopName("kttsd", TQStringList(), &error)) { kdDebug() << "KoSpeaker::startKttsd: error starting KTTSD service: " << error << endl; d->m_enabled = false; } else @@ -496,18 +496,18 @@ bool KoSpeaker::startKttsd() return d->m_enabled; } -QString KoSpeaker::getKttsdVersion() +TQString KoSpeaker::getKttsdVersion() { // Determine which version of KTTSD is running. Note that earlier versions of KSpeech interface // did not support version() method, so we must manually marshall this call ourselves. if (d->m_enabled) { if (!d->m_versionChecked) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; + TQByteArray data; + TQCString replyType; + TQByteArray replyData; if ( client->call("kttsd", "KSpeech", "version()", data, replyType, replyData, true) ) { - QDataStream arg(replyData, IO_ReadOnly); + TQDataStream arg(replyData, IO_ReadOnly); arg >> d->m_kttsdVersion; kdDebug() << "KoSpeaker::startKttsd: KTTSD version = " << d->m_kttsdVersion << endl; } @@ -517,56 +517,56 @@ QString KoSpeaker::getKttsdVersion() return d->m_kttsdVersion; } -void KoSpeaker::sayScreenReaderOutput(const QString &msg, const QString &talker) +void KoSpeaker::sayScreenReaderOutput(const TQString &msg, const TQString &talker) { if (msg.isEmpty()) return; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << msg << talker; - if ( !client->call("kttsd", "KSpeech", "sayScreenReaderOutput(QString,QString)", + if ( !client->call("kttsd", "KSpeech", "sayScreenReaderOutput(TQString,TQString)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::sayScreenReaderOutput: failed" << endl; } } -uint KoSpeaker::setText(const QString &text, const QString &talker) +uint KoSpeaker::setText(const TQString &text, const TQString &talker) { if (text.isEmpty()) return 0; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << text << talker; uint jobNum = 0; - if ( !client->call("kttsd", "KSpeech", "setText(QString,QString)", + if ( !client->call("kttsd", "KSpeech", "setText(TQString,TQString)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::sayText: failed" << endl; } else { - QDataStream arg2(replyData, IO_ReadOnly); + TQDataStream arg2(replyData, IO_ReadOnly); arg2 >> jobNum; } return jobNum; } -int KoSpeaker::appendText(const QString &text, uint jobNum /*=0*/) +int KoSpeaker::appendText(const TQString &text, uint jobNum /*=0*/) { if (text.isEmpty()) return 0; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << text << jobNum; int partNum = 0; - if ( !client->call("kttsd", "KSpeech", "appendText(QString,uint)", + if ( !client->call("kttsd", "KSpeech", "appendText(TQString,uint)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::appendText: failed" << endl; } else { - QDataStream arg2(replyData, IO_ReadOnly); + TQDataStream arg2(replyData, IO_ReadOnly); arg2 >> partNum; } return partNum; @@ -575,10 +575,10 @@ int KoSpeaker::appendText(const QString &text, uint jobNum /*=0*/) void KoSpeaker::startText(uint jobNum /*=0*/) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << jobNum; if ( !client->call("kttsd", "KSpeech", "startText(uint)", data, replyType, replyData, true) ) { @@ -589,10 +589,10 @@ void KoSpeaker::startText(uint jobNum /*=0*/) void KoSpeaker::removeText(uint jobNum /*=0*/) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << jobNum; if ( !client->call("kttsd", "KSpeech", "removeText(uint)", data, replyType, replyData, true) ) { diff --git a/lib/kofficecore/KoSpeaker.h b/lib/kofficecore/KoSpeaker.h index 6f8b430f..1e2d3188 100644 --- a/lib/kofficecore/KoSpeaker.h +++ b/lib/kofficecore/KoSpeaker.h @@ -24,9 +24,9 @@ #ifndef KOSPEAKER_H #define KOSPEAKER_H -// Qt includes. -#include -#include +// TQt includes. +#include +#include // KDE includes. #include @@ -34,8 +34,8 @@ // KOffice includes. #include -class QWidget; -class QPoint; +class TQWidget; +class TQPoint; class KConfig; class KoSpeakerPrivate; @@ -51,7 +51,7 @@ class KoSpeakerPrivate; * It will be replaced with a proper screen reading capability using the AT-SPI. * * This is quite a hack and doesn't work reliably. The following are current problems: - * 1. Cannot speak menu items in a QMenuBar (top menu of app). + * 1. Cannot speak menu items in a TQMenuBar (top menu of app). * 2. Doesn't understand every possible widget. * * This capability is @em not intended for completely blind users. Such users cannot use @@ -60,9 +60,10 @@ class KoSpeakerPrivate; * * KOffice applications can access this object using the kospeaker global. */ -class KOFFICECORE_EXPORT KoSpeaker : public QObject, public KShared +class KOFFICECORE_EXPORT KoSpeaker : public TQObject, public KShared { Q_OBJECT + TQ_OBJECT public: KoSpeaker(); ~KoSpeaker(); @@ -96,21 +97,21 @@ public: /** * Given a widget @p w and its @p pos screen coordinates, tries to extract the text of the widget * and speak it. If @p pos is not specified, and the widget has multiple parts (such as - * a QListView), uses the current part. + * a TQListView), uses the current part. * Call @ref isEnabled to ensure TTS is available before calling this method. */ - bool maybeSayWidget(QWidget* w, const QPoint& pos = QPoint()); + bool maybeSayWidget(TQWidget* w, const TQPoint& pos = TQPoint()); /** * Speak a @p msg that came from a widget, such as the widget's text label, tool tip, etc. * Speaks using ScreenReaderOutput, which has highest priority, and therefore, should only be * be used in very time-sensitive contexts and for short messages. * Certain standard substitutions are performed on the message. For example, "Ctrl+" becomes - * "control plus". "Qt" markup is stripped. + * "control plus". "TQt" markup is stripped. * @returns true if anything is actually spoken. * Call @ref isEnabled to ensure TTS is available before calling this method. */ - bool sayWidget(const QString& msg); + bool sayWidget(const TQString& msg); /** * Cancels speaking of widget. Usually called by slots that receive @ref customSpeakNewWidget @@ -125,7 +126,7 @@ public: * If @p first is false, appends to the already queued job. * If the KTTSD daemon is not already running, it is started. */ - void queueSpeech(const QString& msg, const QString& langCode = QString(), bool first = true); + void queueSpeech(const TQString& msg, const TQString& langCode = TQString(), bool first = true); /** * Start speaking queued text job (if any). @@ -156,7 +157,7 @@ signals: * IMPORTANT: This signal is emitted from the @ref maybeSayWidget method. Slots who * call maybeSayWidget should take care to avoid infinite recursion. */ - void customSpeakNewWidget(QWidget* w, const QPoint& p, uint flags); + void customSpeakNewWidget(TQWidget* w, const TQPoint& p, uint flags); /** * This signal is emitted each polling interval when KoSpeaker did not speak the widget @@ -169,7 +170,7 @@ signals: * * IMPORTANT: This signal is emitted frequently. Receivers should be coded efficiently. */ - void customSpeakWidget(QWidget* w, const QPoint& p, uint flags); + void customSpeakWidget(TQWidget* w, const TQPoint& p, uint flags); protected: static KoSpeaker* KSpkr; @@ -182,19 +183,19 @@ private slots: void probe(); private: - // int menuBarItemAt(QMenuBar* m, const QPoint& p); + // int menuBarItemAt(TQMenuBar* m, const TQPoint& p); // Start the KTTSD daemon if not already running. bool startKttsd(); // Return the KTTSD daemon version string. - QString getKttsdVersion(); + TQString getKttsdVersion(); // These methods correspond to dcop interface in kdelibs/interfaces/kspeech/kspeech.h. // They use manual marshalling, instead of using kspeech_stub, because KOffice // supports KDE 3.3 and above and kspeech.h didn't appear until 3.4. - void sayScreenReaderOutput(const QString &msg, const QString &talker); - uint setText(const QString &text, const QString &talker); - int appendText(const QString &text, uint jobNum=0); + void sayScreenReaderOutput(const TQString &msg, const TQString &talker); + uint setText(const TQString &text, const TQString &talker); + int appendText(const TQString &text, uint jobNum=0); void startText(uint jobNum=0); void removeText(uint jobNum=0); diff --git a/lib/kofficecore/KoStyleStack.cpp b/lib/kofficecore/KoStyleStack.cpp index 4b5b807b..22799209 100644 --- a/lib/kofficecore/KoStyleStack.cpp +++ b/lib/kofficecore/KoStyleStack.cpp @@ -81,27 +81,27 @@ void KoStyleStack::pop() #endif } -void KoStyleStack::push( const QDomElement& style ) +void KoStyleStack::push( const TQDomElement& style ) { m_stack.append( style ); #ifdef DEBUG_STYLESTACK - kdDebug(30003) << "pushed " << style.attributeNS( m_styleNSURI, "name", QString::null ) << " -> count=" << m_stack.count() << endl; + kdDebug(30003) << "pushed " << style.attributeNS( m_styleNSURI, "name", TQString() ) << " -> count=" << m_stack.count() << endl; #endif } -bool KoStyleStack::hasAttribute( const QString& name, const QString& detail ) const +bool KoStyleStack::hasAttribute( const TQString& name, const TQString& detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( !detail.isEmpty() ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( properties.hasAttribute( name ) || ( !detail.isEmpty() && properties.hasAttribute( fullName ) ) ) return true; @@ -109,61 +109,61 @@ bool KoStyleStack::hasAttribute( const QString& name, const QString& detail ) co return false; } -QString KoStyleStack::attribute( const QString& name, const QString& detail ) const +TQString KoStyleStack::attribute( const TQString& name, const TQString& detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( !detail.isEmpty() ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( properties.hasAttribute( name ) ) return properties.attribute( name ); if ( !detail.isEmpty() && properties.hasAttribute( fullName ) ) return properties.attribute( fullName ); } - return QString::null; + return TQString(); } -QString KoStyleStack::attributeNS( const char* nsURI, const char* name, const char* detail ) const +TQString KoStyleStack::attributeNS( const char* nsURI, const char* name, const char* detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( detail ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( properties.hasAttributeNS( nsURI, name ) ) - return properties.attributeNS( nsURI, name, QString::null ); + return properties.attributeNS( nsURI, name, TQString() ); if ( detail && properties.hasAttributeNS( nsURI, fullName ) ) - return properties.attributeNS( nsURI, fullName, QString::null ); + return properties.attributeNS( nsURI, fullName, TQString() ); } - return QString::null; + return TQString(); } bool KoStyleStack::hasAttributeNS( const char* nsURI, const char* name, const char* detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( detail ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( properties.hasAttributeNS( nsURI, name ) || ( detail && properties.hasAttributeNS( nsURI, fullName ) ) ) return true; @@ -171,21 +171,21 @@ bool KoStyleStack::hasAttributeNS( const char* nsURI, const char* name, const ch return false; } -// Font size is a bit special. "115%" applies to "the fontsize of the parent style". +// Font size is a bit special. "115%" applies to "the fontsize of the tqparent style". // This can be generalized though (hasAttributeThatCanBePercentOfParent() ? :) // Although, if we also add support for fo:font-size-rel here then it's not general anymore. double KoStyleStack::fontSize() const { - const QString name = "font-size"; + const TQString name = "font-size"; double percent = 1; - QValueList::ConstIterator it = m_stack.end(); // reverse iterator + TQValueList::ConstIterator it = m_stack.end(); // reverse iterator while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ).toElement(); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ).toElement(); if ( properties.hasAttributeNS( m_foNSURI, name ) ) { - const QString value = properties.attributeNS( m_foNSURI, name, QString::null ); + const TQString value = properties.attributeNS( m_foNSURI, name, TQString() ); if ( value.endsWith( "%" ) ) percent *= value.left( value.length() - 1 ).toDouble() / 100.0; else @@ -195,13 +195,13 @@ double KoStyleStack::fontSize() const return 0; } -bool KoStyleStack::hasChildNode(const QString & name) const +bool KoStyleStack::hasChildNode(const TQString & name) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( !properties.namedItem( name ).isNull() ) return true; } @@ -209,28 +209,28 @@ bool KoStyleStack::hasChildNode(const QString & name) const return false; } -QDomElement KoStyleStack::childNode(const QString & name) const +TQDomElement KoStyleStack::childNode(const TQString & name) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( !properties.namedItem( name ).isNull() ) return properties.namedItem( name ).toElement(); } - return QDomElement(); // a null element + return TQDomElement(); // a null element } bool KoStyleStack::hasChildNodeNS( const char* nsURI, const char* localName ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( !KoDom::namedItemNS( properties, nsURI, localName ).isNull() ) return true; } @@ -238,59 +238,59 @@ bool KoStyleStack::hasChildNodeNS( const char* nsURI, const char* localName ) co return false; } -QDomElement KoStyleStack::childNodeNS( const char* nsURI, const char* localName) const +TQDomElement KoStyleStack::childNodeNS( const char* nsURI, const char* localName) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); - QDomElement e = KoDom::namedItemNS( properties, nsURI, localName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement e = KoDom::namedItemNS( properties, nsURI, localName ); if ( !e.isNull() ) return e; } - return QDomElement(); // a null element + return TQDomElement(); // a null element } -bool KoStyleStack::isUserStyle( const QDomElement& e, const QString& family ) const +bool KoStyleStack::isUserStyle( const TQDomElement& e, const TQString& family ) const { - if ( e.attributeNS( m_styleNSURI, "family", QString::null ) != family ) + if ( e.attributeNS( m_styleNSURI, "family", TQString() ) != family ) return false; - const QDomElement parent = e.parentNode().toElement(); - //kdDebug(30003) << k_funcinfo << "tagName=" << e.tagName() << " parent-tagName=" << parent.tagName() << endl; - return parent.localName() == "styles" /*&& parent.namespaceURI() == KoXmlNS::office*/; + const TQDomElement tqparent = e.tqparentNode().toElement(); + //kdDebug(30003) << k_funcinfo << "tagName=" << e.tagName() << " tqparent-tagName=" << tqparent.tagName() << endl; + return tqparent.localName() == "styles" /*&& tqparent.namespaceURI() == KoXmlNS::office*/; } -QString KoStyleStack::userStyleName( const QString& family ) const +TQString KoStyleStack::userStyleName( const TQString& family ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "name", QString::null) << endl; + //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "name", TQString()) << endl; if ( isUserStyle( *it, family ) ) - return (*it).attributeNS( m_styleNSURI, "name", QString::null ); + return (*it).attributeNS( m_styleNSURI, "name", TQString() ); } // Can this ever happen? return "Standard"; } -QString KoStyleStack::userStyleDisplayName( const QString& family ) const +TQString KoStyleStack::userStyleDisplayName( const TQString& family ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "display-name") << endl; if ( isUserStyle( *it, family ) ) - return (*it).attributeNS( m_styleNSURI, "display-name", QString::null ); + return (*it).attributeNS( m_styleNSURI, "display-name", TQString() ); } - return QString::null; // no display name, this can happen since it's optional + return TQString(); // no display name, this can happen since it's optional } void KoStyleStack::setTypeProperties( const char* typeProperties ) { - m_propertiesTagName = typeProperties == 0 ? QCString( "properties" ) : ( QCString( typeProperties ) + "-properties" ); + m_propertiesTagName = typeProperties == 0 ? TQCString( "properties" ) : ( TQCString( typeProperties ) + "-properties" ); } diff --git a/lib/kofficecore/KoStyleStack.h b/lib/kofficecore/KoStyleStack.h index f3c5faf1..4e6cfa7e 100644 --- a/lib/kofficecore/KoStyleStack.h +++ b/lib/kofficecore/KoStyleStack.h @@ -22,9 +22,9 @@ #define KOSTYLESTACK_H -#include -#include -#include +#include +#include +#include #include @@ -36,7 +36,7 @@ * There can be several styles that are valid for one object. For example * a textobject on a page has styles 'pr3' and 'P7' and a paragraph in * that textobject has styles 'P1' and 'T3'. And some styles even have - * parent-styles... + * tqparent-styles... * * If you want to know if there is, for example, the attribute 'fo:font-family' * for this paragraph, you have to look into style 'T3', 'P1', 'P7' and 'pr3'. @@ -54,7 +54,7 @@ * * In general though, you wouldn't use push/pop directly, but KoOasisLoadingContext::fillStyleStack * or KoOasisLoadingContext::addStyles to automatically push a style and all its - * parent styles onto the stack. + * tqparent styles onto the stack. */ class KOFFICECORE_EXPORT KoStyleStack { @@ -93,25 +93,25 @@ public: /** * Pushes the new style onto the stack. */ - void push( const QDomElement& style ); + void push( const TQDomElement& style ); /** * Check if any of the styles on the stack has an attribute called 'name'-'detail' * where detail is e.g. left, right, top or bottom. - * This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) + * This allows to also tqfind 'name' alone (e.g. padding implies padding-left, padding-right etc.) */ - bool hasAttribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED; + bool hasAttribute( const TQString& name, const TQString& detail = TQString() ) const KDE_DEPRECATED; /** * Search for the attribute called 'name', starting on top of the stack, * and return it. */ - QString attribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED; + TQString attribute( const TQString& name, const TQString& detail = TQString() ) const KDE_DEPRECATED; /** * Check if any of the styles on the stack has an attribute called 'name'-'detail' * where detail is e.g. left, right, top or bottom. - * This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) + * This allows to also tqfind 'name' alone (e.g. padding implies padding-left, padding-right etc.) */ bool hasAttributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; @@ -119,18 +119,18 @@ public: * Search for the attribute called 'name', starting on top of the stack, * and return it. */ - QString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; + TQString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; /** * Check if any of the styles on the stack has a child node called 'name'. */ - bool hasChildNode( const QString & name ) const KDE_DEPRECATED; + bool hasChildNode( const TQString & name ) const KDE_DEPRECATED; /** * Search for a child node called 'name', starting on top of the stack, * and return it. */ - QDomElement childNode( const QString & name ) const KDE_DEPRECATED; + TQDomElement childNode( const TQString & name ) const KDE_DEPRECATED; /** * Check if any of the styles on the stack has a child element called 'localName' in the namespace 'nsURI'. @@ -142,7 +142,7 @@ public: * in the namespace 'nsURI' starting on top of the stack, * and return it. */ - QDomElement childNodeNS( const char* nsURI, const char* localName ) const; + TQDomElement childNodeNS( const char* nsURI, const char* localName ) const; /** * Special case for the current font size, due to special handling of fo:font-size="115%". @@ -155,13 +155,13 @@ public: * This is used to know e.g. which user-style is associated with the current paragraph. * There could be none though. */ - QString userStyleName( const QString& family ) const; + TQString userStyleName( const TQString& family ) const; /** * Return the display name of the style specified by the user, * i.e. not an auto style */ - QString userStyleDisplayName( const QString& family ) const; + TQString userStyleDisplayName( const TQString& family ) const; /** * Set the type of properties that will be looked for. @@ -173,19 +173,19 @@ public: void setTypeProperties( const char* typeProperties ); private: - bool isUserStyle( const QDomElement& e, const QString& family ) const; + bool isUserStyle( const TQDomElement& e, const TQString& family ) const; private: /// For save/restore: stack of "marks". Each mark is an index in m_stack. - QValueStack m_marks; + TQValueStack m_marks; /** - * We use QValueList instead of QValueStack because we need access to all styles + * We use TQValueList instead of TQValueStack because we need access to all styles * not only the top one. */ - QValueList m_stack; + TQValueList m_stack; - QCString m_propertiesTagName; + TQCString m_propertiesTagName; const char* m_styleNSURI; const char* m_foNSURI; diff --git a/lib/kofficecore/KoTemplates.cpp b/lib/kofficecore/KoTemplates.cpp index 7fbf3a99..178c6271 100644 --- a/lib/kofficecore/KoTemplates.cpp +++ b/lib/kofficecore/KoTemplates.cpp @@ -19,9 +19,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -37,31 +37,31 @@ #include -KoTemplate::KoTemplate(const QString &name, const QString &description, const QString &file, - const QString &picture, const QString &fileName, const QString &_measureSystem, +KoTemplate::KoTemplate(const TQString &name, const TQString &description, const TQString &file, + const TQString &picture, const TQString &fileName, const TQString &_measureSystem, bool hidden, bool touched) : m_name(name), m_descr(description), m_file(file), m_picture(picture), m_fileName(fileName), m_hidden(hidden), m_touched(touched), m_cached(false), m_measureSystem(_measureSystem) { } -const QPixmap &KoTemplate::loadPicture( KInstance* instance ) { +const TQPixmap &KoTemplate::loadPicture( KInstance* instance ) { if(m_cached) return m_pixmap; m_cached=true; if ( m_picture[ 0 ] == '/' ) { - // ### TODO: use the class KoPicture instead of QImage to support non-image pictures - QImage img( m_picture ); + // ### TODO: use the class KoPicture instead of TQImage to support non-image pictures + TQImage img( m_picture ); if (img.isNull()) { kdWarning() << "Couldn't find icon " << m_picture << endl; - m_pixmap=QPixmap(); + m_pixmap=TQPixmap(); return m_pixmap; } const int maxHeightWidth = 128; // ### TODO: some people would surely like to have 128x128 if (img.width() > maxHeightWidth || img.height() > maxHeightWidth) { - img = img.smoothScale( maxHeightWidth, maxHeightWidth, QImage::ScaleMax ); + img = img.smoothScale( maxHeightWidth, maxHeightWidth, TQ_ScaleMax ); } m_pixmap.convertFromImage(img); return m_pixmap; @@ -72,7 +72,7 @@ const QPixmap &KoTemplate::loadPicture( KInstance* instance ) { } -KoTemplateGroup::KoTemplateGroup(const QString &name, const QString &dir, +KoTemplateGroup::KoTemplateGroup(const TQString &name, const TQString &dir, int _sortingWeight, bool touched) : m_name(name), m_touched(touched), m_sortingWeight(_sortingWeight) { @@ -82,7 +82,7 @@ KoTemplateGroup::KoTemplateGroup(const QString &name, const QString &dir, bool KoTemplateGroup::isHidden() const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); bool hidden=true; while(it.current()!=0L && hidden) { hidden=it.current()->isHidden(); @@ -93,7 +93,7 @@ bool KoTemplateGroup::isHidden() const { void KoTemplateGroup::setHidden(bool hidden) const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); for( ; it.current()!=0L; ++it) it.current()->setHidden(hidden); m_touched=true; @@ -101,7 +101,7 @@ void KoTemplateGroup::setHidden(bool hidden) const { bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { - KoTemplate *myTemplate=find(t->name()); + KoTemplate *myTemplate=tqfind(t->name()); if(myTemplate==0L) { m_templates.append(t); m_touched=touch; @@ -109,9 +109,9 @@ bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { } else if(myTemplate && force) { //kdDebug() << "removing :" << myTemplate->fileName() << endl; - QFile::remove( myTemplate->fileName() ); - QFile::remove( myTemplate->picture() ); - QFile::remove( myTemplate->file() ); + TQFile::remove( myTemplate->fileName() ); + TQFile::remove( myTemplate->picture() ); + TQFile::remove( myTemplate->file() ); m_templates.removeRef(myTemplate); m_templates.append(t); m_touched=touch; @@ -120,16 +120,16 @@ bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { return false; } -KoTemplate *KoTemplateGroup::find(const QString &name) const { +KoTemplate *KoTemplateGroup::tqfind(const TQString &name) const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); while(it.current() && it.current()->name()!=name) ++it; return it.current(); } -KoTemplateTree::KoTemplateTree(const QCString &templateType, +KoTemplateTree::KoTemplateTree(const TQCString &templateType, KInstance *instance, bool readTree) : m_templateType(templateType), m_instance(instance), m_defaultGroup(0L), m_defaultTemplate(0L) { @@ -146,7 +146,7 @@ void KoTemplateTree::readTemplateTree() { } void KoTemplateTree::writeTemplateTree() { - QString localDir=m_instance->dirs()->saveLocation(m_templateType); + TQString localDir=m_instance->dirs()->saveLocation(m_templateType); for(KoTemplateGroup *group=m_groups.first(); group!=0L; group=m_groups.next()) { //kdDebug() << "---------------------------------" << endl; @@ -183,8 +183,8 @@ void KoTemplateTree::writeTemplateTree() { if(t->isHidden() && t->touched() ) { //kdDebug() << "+++ delete local template ##############" << endl; writeTemplate(t, group, localDir); - QFile::remove(t->file()); - QFile::remove(t->picture()); + TQFile::remove(t->file()); + TQFile::remove(t->picture()); } } } @@ -192,16 +192,16 @@ void KoTemplateTree::writeTemplateTree() { void KoTemplateTree::add(KoTemplateGroup *g) { - KoTemplateGroup *group=find(g->name()); + KoTemplateGroup *group=tqfind(g->name()); if(group==0L) m_groups.append(g); else group->addDir(g->dirs().first()); // "...there can be only one..." (Queen) } -KoTemplateGroup *KoTemplateTree::find(const QString &name) const { +KoTemplateGroup *KoTemplateTree::tqfind(const TQString &name) const { - QPtrListIterator it(m_groups); + TQPtrListIterator it(m_groups); while(it.current() && it.current()->name()!=name) ++it; return it.current(); @@ -209,21 +209,21 @@ KoTemplateGroup *KoTemplateTree::find(const QString &name) const { void KoTemplateTree::readGroups() { - QStringList dirs = m_instance->dirs()->resourceDirs(m_templateType); - for(QStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { + TQStringList dirs = m_instance->dirs()->resourceDirs(m_templateType); + for(TQStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { //kdDebug() << "dir: " << *it << endl; - QDir dir(*it); + TQDir dir(*it); // avoid the annoying warning if(!dir.exists()) continue; - dir.setFilter(QDir::Dirs); - QStringList templateDirs=dir.entryList(); - for(QStringList::ConstIterator tdirIt=templateDirs.begin(); tdirIt!=templateDirs.end(); ++tdirIt) { + dir.setFilter(TQDir::Dirs); + TQStringList templateDirs=dir.entryList(); + for(TQStringList::ConstIterator tdirIt=templateDirs.begin(); tdirIt!=templateDirs.end(); ++tdirIt) { if(*tdirIt=="." || *tdirIt=="..") // we don't want to check those dirs :) continue; - QDir templateDir(*it+*tdirIt); - QString name=*tdirIt; - QString defaultTab; + TQDir templateDir(*it+*tdirIt); + TQString name=*tdirIt; + TQString defaultTab; int sortingWeight = 1000; if(templateDir.exists(".directory")) { KSimpleConfig config(templateDir.absPath()+"/.directory", true); @@ -233,7 +233,7 @@ void KoTemplateTree::readGroups() { sortingWeight=config.readNumEntry("X-KDE-SortingWeight", 1000); //kdDebug() << "name: " << name <pageSize() == QPrinter::Letter) { + if(KGlobal::locale()->pageSize() == TQPrinter::Letter) { dontShow = "metric"; } - QPtrListIterator groupIt(m_groups); + TQPtrListIterator groupIt(m_groups); for( ; groupIt.current()!=0L; ++groupIt) { - QStringList dirs=groupIt.current()->dirs(); - for(QStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { - QDir d(*it); + TQStringList dirs=groupIt.current()->dirs(); + for(TQStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { + TQDir d(*it); if( !d.exists() ) continue; - QStringList files=d.entryList( QDir::Files | QDir::Readable, QDir::Name ); + TQStringList files=d.entryList( TQDir::Files | TQDir::Readable, TQDir::Name ); for(unsigned int i=0; i