summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--animations/source/animcore/targetpropertiescreator.cxx1
-rw-r--r--basctl/source/basicide/macrodlg.cxx7
-rw-r--r--basctl/source/basicide/moduldl2.cxx2
-rw-r--r--basctl/source/basicide/moduldlg.cxx7
-rw-r--r--basctl/source/basicide/objdlg.cxx7
-rw-r--r--basic/source/sbx/sbxbool.cxx2
-rw-r--r--bridges/source/remote/urp/urp_job.hxx1
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx2
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx12
-rw-r--r--comphelper/inc/comphelper/optionalvalue.hxx187
-rw-r--r--comphelper/inc/comphelper/property.hxx8
-rw-r--r--comphelper/inc/comphelper/querydeep.hxx484
-rw-r--r--comphelper/inc/comphelper/scopeguard.hxx16
-rw-r--r--comphelper/inc/comphelper/servicedecl.hxx4
-rw-r--r--comphelper/source/misc/makefile.mk1
-rw-r--r--comphelper/source/misc/namedvaluecollection.cxx49
-rw-r--r--comphelper/source/misc/querydeep.cxx76
-rw-r--r--comphelper/source/property/propagg.cxx24
-rw-r--r--configmgr/source/access.cxx10
-rw-r--r--configmgr/source/childaccess.cxx17
-rw-r--r--configmgr/source/components.cxx6
-rw-r--r--configmgr/source/components.hxx4
-rw-r--r--configmgr/source/configurationprovider.cxx24
-rw-r--r--configmgr/source/configurationregistry.cxx58
-rw-r--r--configmgr/source/configurationregistry.hxx22
-rw-r--r--configmgr/source/defaultprovider.cxx68
-rw-r--r--configmgr/source/defaultprovider.hxx22
-rw-r--r--configmgr/source/node.cxx4
-rw-r--r--configmgr/source/node.hxx5
-rw-r--r--configmgr/source/services.cxx15
-rw-r--r--configmgr/source/update.cxx86
-rw-r--r--configmgr/source/update.hxx22
-rw-r--r--configure.in6
-rw-r--r--connectivity/inc/connectivity/filtermanager.hxx7
-rw-r--r--connectivity/source/commontools/FValue.cxx30
-rw-r--r--connectivity/source/commontools/dbtools2.cxx1
-rw-r--r--connectivity/source/commontools/filtermanager.cxx60
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx31
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx19
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx28
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx38
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx26
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx3
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx118
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx3
-rwxr-xr-xconnectivity/source/drivers/mozab/mozab.xcu2
-rwxr-xr-xconnectivity/source/drivers/mozab/mozab2.xcu2
-rw-r--r--connectivity/source/inc/file/fcomp.hxx2
-rw-r--r--cppcanvas/inc/cppcanvas/renderer.hxx18
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx46
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx20
-rw-r--r--cppu/source/threadpool/jobqueue.cxx4
-rw-r--r--cppuhelper/inc/cppuhelper/propshlp.hxx35
-rwxr-xr-xcppuhelper/source/cc5_solaris_sparc.map6
-rw-r--r--cppuhelper/source/gcc3.map7
-rw-r--r--cppuhelper/source/msvc_win32_intel.map6
-rw-r--r--cppuhelper/source/propshlp.cxx109
-rwxr-xr-xcrashrep/source/win32/soreport.cpp2
-rw-r--r--cui/source/customize/acccfg.cxx4
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/customize/cfgutil.cxx4
-rw-r--r--cui/source/customize/selector.cxx4
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx2
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx4
-rw-r--r--cui/source/dialogs/scriptdlg.cxx2
-rw-r--r--cui/source/dialogs/srchxtra.cxx2
-rwxr-xr-xcui/source/dialogs/thesdlg.cxx2
-rw-r--r--cui/source/options/dbregister.cxx2
-rw-r--r--cui/source/options/fontsubs.cxx2
-rwxr-xr-xcui/source/options/optdict.cxx2
-rw-r--r--cui/source/options/optfltr.cxx2
-rw-r--r--cui/source/options/optlingu.cxx8
-rw-r--r--cui/source/options/optpath.cxx1
-rw-r--r--cui/source/options/treeopt.cxx4
-rw-r--r--[-rwxr-xr-x]cui/source/options/webconninfo.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx8
-rw-r--r--dbaccess/qa/complex/dbaccess/DataSource.java4
-rw-r--r--dbaccess/source/ext/macromigration/macromigration.src2
-rw-r--r--dbaccess/source/ext/macromigration/migrationlog.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailView.hxx2
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ExtensionNotPresent.cxx218
-rw-r--r--dbaccess/source/ui/dlg/ExtensionNotPresent.src90
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx19
-rw-r--r--dbaccess/source/ui/dlg/adminpages.hxx4
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbadmin2.src40
-rw-r--r--dbaccess/source/ui/dlg/makefile.mk2
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx2
-rw-r--r--dbaccess/source/ui/inc/ExtensionNotPresent.hxx101
-rw-r--r--dbaccess/source/ui/inc/dbu_dlg.hrc22
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx6
-rw-r--r--dbaccess/source/ui/misc/dbumiscres.src2
-rw-r--r--desktop/source/app/app.cxx125
-rw-r--r--desktop/source/app/cmdlineargs.cxx281
-rw-r--r--desktop/source/app/cmdlineargs.hxx129
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx54
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/registry/package/dp_package.cxx16
-rw-r--r--desktop/source/migration/wizard.cxx1
-rw-r--r--editeng/inc/editeng/svxrtf.hxx7
-rw-r--r--editeng/source/editeng/eertfpar.cxx1
-rw-r--r--editeng/source/rtf/makefile.mk3
-rw-r--r--editeng/source/rtf/rtfgrf.cxx36
-rw-r--r--extensions/prj/build.lst2
-rw-r--r--extensions/source/bibliography/datman.cxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx2
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.cxx2
-rw-r--r--extensions/source/scanner/sanedlg.cxx13
-rw-r--r--filter/source/config/fragments/filters/MS_PowerPoint_97.xcu2
-rw-r--r--filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/Rich_Text_Format.xcu4
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx2
-rw-r--r--forms/qa/integration/forms/ListSelection.java5
-rw-r--r--forms/qa/unoapi/knownissues.xcl4
-rw-r--r--forms/source/component/Filter.cxx48
-rw-r--r--forms/source/component/Filter.hxx5
-rw-r--r--forms/source/component/FormComponent.cxx54
-rw-r--r--forms/source/component/ListBox.cxx24
-rw-r--r--forms/source/helper/windowstateguard.cxx28
-rw-r--r--formula/source/ui/dlg/structpg.cxx2
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx33
-rw-r--r--jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java13
-rwxr-xr-x[-rw-r--r--]odk/configure.pl23
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu7
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu10
-rw-r--r--package/inc/ZipPackageFolder.hxx7
-rw-r--r--package/source/xstor/owriteablestream.cxx20
-rw-r--r--package/source/xstor/xstorage.cxx20
-rw-r--r--package/source/zippackage/ZipPackage.cxx16
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx15
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx15
-rw-r--r--package/source/zippackage/ZipPackageStream.hxx6
-rw-r--r--qadevOOo/runner/stats/Summarizer.java2
-rw-r--r--qadevOOo/tests/java/mod/_forms/GenericModelTest.java28
-rw-r--r--reportdesign/source/core/sdr/UndoEnv.cxx110
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx183
-rw-r--r--sal/inc/osl/diagnose.h10
-rw-r--r--sal/inc/rtl/math.h8
-rw-r--r--sal/osl/unx/file_misc.cxx57
-rw-r--r--sal/prj/build.lst1
-rw-r--r--sal/qa/OStringBuffer/makefile.mk2
-rw-r--r--sal/qa/osl/process/makefile.mk2
-rw-r--r--sal/qa/osl/profile/makefile.mk1
-rwxr-xr-xsal/qa/rtl/alloc/makefile.mk2
-rwxr-xr-xsal/qa/rtl/crc32/makefile.mk2
-rw-r--r--sal/qa/rtl/digest/makefile.mk2
-rw-r--r--sal/qa/rtl/doublelock/makefile.mk2
-rw-r--r--sal/qa/rtl/locale/makefile.mk2
-rw-r--r--sal/qa/rtl/math/export.exp1
-rw-r--r--sal/qa/rtl/math/makefile.mk84
-rw-r--r--sal/qa/rtl/math/rtl_math.cxx626
-rw-r--r--sal/qa/rtl/math/rtl_old_testint64.cxx122
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx76
-rw-r--r--sal/qa/rtl/math/test_rtl_math.cxx674
-rw-r--r--sal/qa/rtl/random/makefile.mk2
-rw-r--r--sal/qa/rtl_strings/makefile.mk1
-rw-r--r--sal/rtl/source/math.cxx2
-rw-r--r--sal/systools/win32/kill/kill.cxx2
-rw-r--r--sal/textenc/convertiscii.tab2
-rw-r--r--sal/textenc/tencinfo.c5
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/view/drawvie4.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/gridwin3.cxx2
-rwxr-xr-xscp2/source/ooo/file_library_ooo.scp2
-rw-r--r--scripting/source/basprov/basscript.cxx22
-rw-r--r--scripting/source/basprov/basscript.hxx6
-rw-r--r--scripting/source/basprov/makefile.mk1
-rwxr-xr-xsd/source/filter/ppt/propread.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/animations/CustomAnimationList.cxx2
-rwxr-xr-xsd/source/ui/dlg/dlgassim.cxx4
-rwxr-xr-xsd/source/ui/dlg/sdtreelb.cxx9
-rwxr-xr-xsd/source/ui/inc/sdtreelb.hxx1
-rwxr-xr-xsd/source/ui/toolpanel/ToolPanelViewShell.cxx24
-rw-r--r--sdext/source/pdfimport/config/pdf_import_filter.xcu6
-rw-r--r--setup_native/scripts/install_solaris.sh2
-rw-r--r--sfx2/inc/sfx2/mgetempl.hxx5
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx7
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc2
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/dialog/mailmodel.cxx137
-rw-r--r--sfx2/source/dialog/mgetempl.cxx12
-rw-r--r--sfx2/source/dialog/mgetempl.hrc1
-rw-r--r--sfx2/source/dialog/mgetempl.src8
-rw-r--r--sfx2/source/dialog/templdlg.cxx8
-rw-r--r--sfx2/source/dialog/versdlg.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx13
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx4
-rw-r--r--sfx2/source/view/viewsh.cxx3
-rwxr-xr-xshell/qa/makefile.mk2
-rw-r--r--shell/source/win32/simplemail/senddoc.cxx2
-rw-r--r--smoketestoo_native/data/Events.xml22
-rw-r--r--smoketestoo_native/data/Global.xml36
-rw-r--r--smoketestoo_native/data/OptionsDlg.xml20
-rw-r--r--smoketestoo_native/data/Test_10er.xml161
-rw-r--r--smoketestoo_native/data/content.xml2
-rw-r--r--solenv/inc/_tg_shl.mk100
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/pstrules.mk21
-rw-r--r--solenv/inc/settings.mk6
-rw-r--r--solenv/inc/tg_shl.mk10
-rw-r--r--sot/source/sdstor/stgdir.cxx5
-rw-r--r--svtools/inc/rtfkeywd.hxx13
-rw-r--r--svtools/inc/rtftoken.h2
-rw-r--r--svtools/inc/svtools/svicnvw.hxx3
-rw-r--r--svtools/inc/svtools/svlbox.hxx30
-rw-r--r--svtools/inc/svtools/svtreebx.hxx12
-rw-r--r--svtools/source/contnr/svicnvw.cxx11
-rw-r--r--svtools/source/contnr/svimpbox.cxx70
-rw-r--r--svtools/source/contnr/svimpicn.cxx19
-rw-r--r--svtools/source/contnr/svlbox.cxx73
-rw-r--r--svtools/source/contnr/svtreebx.cxx37
-rwxr-xr-x[-rw-r--r--]svtools/source/control/ruler.cxx42
-rw-r--r--svtools/source/inc/svimpbox.hxx4
-rw-r--r--svtools/source/inc/svimpicn.hxx3
-rw-r--r--svtools/source/svrtf/rtfkey2.cxx1
-rw-r--r--svtools/source/svrtf/rtfkeywd.cxx1
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx24
-rw-r--r--svx/inc/svx/sdrpagewindow.hxx1
-rw-r--r--svx/inc/svx/svdpagv.hxx3
-rw-r--r--svx/inc/svx/svdpntv.hxx3
-rw-r--r--svx/sdi/svx.sdi28
-rw-r--r--svx/source/dialog/docrecovery.hrc4
-rw-r--r--svx/source/dialog/simptabl.cxx1
-rw-r--r--svx/source/fmcomp/gridcell.cxx6
-rw-r--r--svx/source/form/datanavi.cxx2
-rw-r--r--svx/source/form/fmshimp.cxx115
-rw-r--r--svx/source/form/fmvwimp.cxx244
-rw-r--r--svx/source/form/formcontroller.cxx107
-rw-r--r--svx/source/inc/fmvwimp.hxx23
-rw-r--r--svx/source/inc/formcontroller.hxx3
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx4
-rw-r--r--svx/source/svdraw/svdpagv.cxx15
-rw-r--r--[-rwxr-xr-x]svx/source/svdraw/svdpntv.cxx8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx2
-rw-r--r--svx/source/xml/xmlgrhlp.cxx13
-rw-r--r--sw/inc/cmdid.h2
-rw-r--r--sw/inc/doc.hxx1
-rw-r--r--sw/inc/ring.hxx3
-rw-r--r--sw/inc/unoframe.hxx2
-rw-r--r--sw/qa/core/makefile.mk2
-rwxr-xr-xsw/sdi/_annotsh.sdi6
-rw-r--r--sw/sdi/_docsh.sdi5
-rw-r--r--sw/sdi/_textsh.sdi2
-rw-r--r--[-rwxr-xr-x]sw/sdi/swriter.sdi27
-rw-r--r--sw/source/core/doc/doc.cxx110
-rw-r--r--sw/source/core/unocore/unosrch.cxx62
-rw-r--r--sw/source/filter/rtf/makefile.mk6
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx4356
-rw-r--r--sw/source/filter/rtf/rtffly.cxx23
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx330
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx44
-rw-r--r--sw/source/filter/rtf/swparrtf.hxx2
-rw-r--r--sw/source/filter/rtf/wrtrtf.cxx1810
-rw-r--r--sw/source/filter/rtf/wrtrtf.hxx254
-rw-r--r--sw/source/filter/ww8/README-rtf.txt227
-rw-r--r--sw/source/filter/ww8/docxexport.cxx125
-rw-r--r--sw/source/filter/ww8/docxexport.hxx22
-rw-r--r--sw/source/filter/ww8/docxexportfilter.cxx19
-rw-r--r--sw/source/filter/ww8/makefile.mk14
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx3447
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx590
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx1269
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx212
-rw-r--r--sw/source/filter/ww8/rtfexportfilter.cxx226
-rw-r--r--sw/source/filter/ww8/rtfexportfilter.hxx85
-rw-r--r--sw/source/filter/ww8/rtfimportfilter.cxx137
-rw-r--r--sw/source/filter/ww8/rtfimportfilter.hxx75
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx586
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.hxx115
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx16
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx66
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx134
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx36
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx3
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx71
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx25
-rw-r--r--sw/source/ui/app/docsh.cxx17
-rw-r--r--sw/source/ui/app/docsh2.cxx14
-rw-r--r--sw/source/ui/app/mn.src6
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx2
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx2
-rw-r--r--sw/source/ui/config/optcomp.cxx2
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx27
-rw-r--r--sw/source/ui/dbui/dbtree.cxx2
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx2
-rw-r--r--sw/source/ui/docvw/AnnotationMenuButton.cxx11
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx1
-rw-r--r--sw/source/ui/envelp/envlop1.cxx6
-rw-r--r--sw/source/ui/envelp/label1.cxx2
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx2
-rw-r--r--sw/source/ui/fldui/changedb.cxx2
-rw-r--r--sw/source/ui/fldui/flddinf.cxx2
-rw-r--r--sw/source/ui/fldui/fldref.cxx2
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx26
-rw-r--r--sw/source/ui/misc/glosbib.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx2
-rw-r--r--sw/source/ui/misc/redlndlg.cxx2
-rwxr-xr-xsw/source/ui/shells/annotsh.cxx14
-rw-r--r--sw/source/ui/shells/textfld.cxx6
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx3
-rw-r--r--sw/source/ui/utlui/content.cxx1
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--[-rwxr-xr-x]sw/util/msword.map3
-rw-r--r--testautomation/dbaccess/optional/includes/ctrl_General.inc92
-rw-r--r--testautomation/dbaccess/optional/includes/ctrl_Several2.inc4
-rw-r--r--testautomation/dbaccess/optional/includes/ctrl_Wizards.inc8
-rw-r--r--testautomation/dbaccess/tools/dbcreatetools.inc11
-rwxr-xr-xtestautomation/extensions/optional/input/extension_sources/TaskPaneComponent/src/toolpanels/TaskPaneComponentUI.xdl2
-rwxr-xr-xtestautomation/global/hid/hid.lst2
-rw-r--r--testautomation/global/required/includes/g_printing.inc2
-rw-r--r--testautomation/global/system/includes/master.inc4
-rw-r--r--testautomation/global/tools/includes/optional/t_control_objects.inc2
-rw-r--r--testautomation/global/win/dial_d_h.win2
-rw-r--r--testautomation/global/win/edia_i_o.win1
-rw-r--r--testautomation/global/win/sys_dial.win5
-rw-r--r--testautomation/graphics/required/includes/impress/im_003_.inc6
-rw-r--r--testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc27
-rw-r--r--testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc6
-rw-r--r--testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc13
-rw-r--r--testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc37
-rw-r--r--testautomation/writer/optional/includes/fields/w_fields1.inc12
-rw-r--r--testautomation/writer/required/includes/w_001b_.inc1
-rwxr-xr-xtestautomation/writer/tools/includes/w_tools.inc24
-rw-r--r--toolkit/source/controls/unocontrols.cxx14
-rw-r--r--tools/inc/tools/wintypes.hxx13
-rw-r--r--unotools/source/config/pathoptions.cxx13
-rw-r--r--vcl/inc/vcl/ilstbox.hxx16
-rw-r--r--vcl/inc/vcl/mnemonicengine.hxx6
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx95
-rw-r--r--vcl/inc/vcl/window.hxx1
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/control/ilstbox.cxx145
-rw-r--r--vcl/source/control/makefile.mk3
-rw-r--r--vcl/source/control/quickselectionengine.cxx183
-rwxr-xr-xvcl/source/window/window.cxx6
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx62
-rw-r--r--writerfilter/qa/cppunittests/doctok/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/qname/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/sl/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/xxml/makefile.mk2
-rw-r--r--writerfilter/source/filter/RtfFilter.cxx146
-rw-r--r--writerfilter/source/filter/RtfFilter.hxx102
-rw-r--r--writerfilter/source/filter/WriterFilter.cxx2
-rw-r--r--writerfilter/source/filter/makefile.mk3
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx3
-rw-r--r--xmloff/prj/build.lst3
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx6
-rw-r--r--xmloff/source/core/xmltoken.cxx3
-rw-r--r--xmloff/source/core/xmluconv.cxx88
-rw-r--r--xmloff/source/forms/controlelement.cxx2
-rw-r--r--xmloff/source/forms/controlelement.hxx2
-rw-r--r--xmloff/source/forms/elementexport.cxx125
-rw-r--r--xmloff/source/forms/elementexport.hxx7
-rw-r--r--xmloff/source/forms/elementimport.cxx511
-rw-r--r--xmloff/source/forms/elementimport.hxx65
-rwxr-xr-xxmloff/source/forms/form_handler_factory.hxx50
-rwxr-xr-xxmloff/source/forms/handler/form_handler_factory.cxx90
-rwxr-xr-xxmloff/source/forms/handler/makefile.mk55
-rwxr-xr-xxmloff/source/forms/handler/property_handler_base.cxx61
-rwxr-xr-xxmloff/source/forms/handler/property_handler_base.hxx64
-rwxr-xr-xxmloff/source/forms/handler/vcl_date_handler.cxx114
-rwxr-xr-xxmloff/source/forms/handler/vcl_date_handler.hxx55
-rwxr-xr-xxmloff/source/forms/handler/vcl_time_handler.cxx115
-rwxr-xr-xxmloff/source/forms/handler/vcl_time_handler.hxx55
-rw-r--r--xmloff/source/forms/makefile.mk2
-rwxr-xr-xxmloff/source/forms/property_description.hxx140
-rwxr-xr-x[-rw-r--r--]xmloff/source/forms/property_group.hxx (renamed from dbaccess/source/ui/dlg/ExtensionNotPresent.hrc)37
-rwxr-xr-xxmloff/source/forms/property_handler.hxx84
-rwxr-xr-xxmloff/source/forms/property_ids.hxx56
-rwxr-xr-xxmloff/source/forms/property_meta_data.cxx270
-rwxr-xr-xxmloff/source/forms/property_meta_data.hxx65
-rw-r--r--xmloff/source/forms/propertyexport.cxx27
-rw-r--r--xmloff/source/forms/propertyexport.hxx19
-rw-r--r--xmloff/source/forms/propertyimport.cxx11
-rw-r--r--xmloff/source/forms/propertyimport.hxx2
-rw-r--r--xmloff/source/forms/valueproperties.cxx36
-rw-r--r--xmloff/util/makefile.mk1
394 files changed, 12693 insertions, 12484 deletions
diff --git a/animations/source/animcore/targetpropertiescreator.cxx b/animations/source/animcore/targetpropertiescreator.cxx
index 0bba7b55d918..b36694bac0ab 100644
--- a/animations/source/animcore/targetpropertiescreator.cxx
+++ b/animations/source/animcore/targetpropertiescreator.cxx
@@ -42,7 +42,6 @@
#include <cppuhelper/compbase3.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
-#include <comphelper/optionalvalue.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/sequence.hxx>
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 24bc5beacb30..996e98f52ce4 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -121,9 +121,10 @@ MacroChooser::MacroChooser( Window* pParnt, BOOL bCreateEntries ) :
aMacroBox.SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) );
aBasicBox.SetMode( BROWSEMODE_MODULES );
- aBasicBox.SetWindowBits( WB_HASLINES | WB_HASLINESATROOT |
- WB_HASBUTTONS | WB_HASBUTTONSATROOT |
- WB_HSCROLL );
+ aBasicBox.SetStyle( WB_TABSTOP | WB_BORDER |
+ WB_HASLINES | WB_HASLINESATROOT |
+ WB_HASBUTTONS | WB_HASBUTTONSATROOT |
+ WB_HSCROLL );
BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 714fc6656941..35bc94e24fca 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -521,7 +521,7 @@ LibPage::LibPage( Window * pParent )
aLibBox.SetMode( LIBMODE_MANAGER );
aLibBox.EnableInplaceEditing( TRUE );
- aLibBox.SetWindowBits( WB_HSCROLL );
+ aLibBox.SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
aCloseButton.GrabFocus();
long aTabs[] = { 2, 30, 120 };
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 0f66a6ebe120..c877b2f35bb2 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -596,9 +596,10 @@ ObjectPage::ObjectPage( Window * pParent, const ResId& rResId, USHORT nMode ) :
aBasicBox.SetDragDropMode( SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY );
aBasicBox.EnableInplaceEditing( TRUE );
aBasicBox.SetMode( nMode );
- aBasicBox.SetWindowBits( WB_HASLINES | WB_HASLINESATROOT |
- WB_HASBUTTONS | WB_HASBUTTONSATROOT |
- WB_HSCROLL );
+ aBasicBox.SetStyle( WB_BORDER | WB_TABSTOP |
+ WB_HASLINES | WB_HASLINESATROOT |
+ WB_HASBUTTONS | WB_HASBUTTONSATROOT |
+ WB_HSCROLL );
aBasicBox.ScanAllEntries();
aEditButton.GrabFocus();
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index ac7a2c28531d..82030adfccee 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -102,9 +102,10 @@ ObjectCatalog::ObjectCatalog( Window * pParent )
aToolBox.SetSizePixel( aToolBox.CalcWindowSizePixel() );
aToolBox.SetSelectHdl( LINK( this, ObjectCatalog, ToolBoxHdl ) );
- aMacroTreeList.SetWindowBits( WB_HASLINES | WB_HASLINESATROOT |
- WB_HASBUTTONS | WB_HASBUTTONSATROOT |
- WB_HSCROLL );
+ aMacroTreeList.SetStyle( WB_BORDER | WB_TABSTOP |
+ WB_HASLINES | WB_HASLINESATROOT |
+ WB_HASBUTTONS | WB_HASBUTTONSATROOT |
+ WB_HSCROLL );
aMacroTreeList.SetSelectHdl( LINK( this, ObjectCatalog, TreeListHighlightHdl ) );
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 3216e401b707..c3ed0d09b134 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -91,7 +91,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
{
if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) )
nRes = SbxTRUE;
- else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) )
+ else if( !p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) )
{
// Jetzt kann es noch in eine Zahl konvertierbar sein
BOOL bError = TRUE;
diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx
index ce58b1f3f779..1bafaf9f5162 100644
--- a/bridges/source/remote/urp/urp_job.hxx
+++ b/bridges/source/remote/urp/urp_job.hxx
@@ -303,6 +303,7 @@ inline ClientJob::ClientJob(
uno_Any **ppException )
: Job(
pEnvRemote, pContext, pBridgeImpl, ::bridges_remote::RTC_HOLDENVWEAK )
+ , m_bExceptionOccured( false )
, m_ppArgs( ppArgs )
, m_pReturn( pReturn )
, m_pInterfaceType( pInterfaceType ) // weak
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 7c5f0fb3967b..70a478ea8c39 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -311,7 +311,7 @@ DataSourceTabPage::DataSourceTabPage(
// set handlers
m_apLB_SERIES->SetSelectHdl( LINK( this, DataSourceTabPage, SeriesSelectionChangedHdl ));
- m_aLB_ROLE.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN );
+ m_aLB_ROLE.SetStyle( m_aLB_ROLE.GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
m_aLB_ROLE.SetSelectionMode( SINGLE_SELECTION );
m_aLB_ROLE.SetSelectHdl( LINK( this, DataSourceTabPage, RoleSelectionChangedHdl ));
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx
index 72cd0e7cdfbe..e13059361b0a 100644
--- a/comphelper/inc/comphelper/namedvaluecollection.hxx
+++ b/comphelper/inc/comphelper/namedvaluecollection.hxx
@@ -39,6 +39,7 @@
#include <memory>
#include <algorithm>
+#include <vector>
//........................................................................
namespace comphelper
@@ -91,6 +92,11 @@ namespace comphelper
~NamedValueCollection();
+ inline void assign( const ::com::sun::star::uno::Any& i_rWrappedElements )
+ {
+ impl_assign( i_rWrappedElements );
+ }
+
inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments )
{
impl_assign( _rArguments );
@@ -117,6 +123,11 @@ namespace comphelper
/// determines whether the collection is empty
bool empty() const;
+ /** returns the names of all elements in the collection
+ */
+ ::std::vector< ::rtl::OUString >
+ getNames() const;
+
/** merges the content of another collection into |this|
@param _rAdditionalValues
the collection whose values are to be merged
@@ -312,6 +323,7 @@ namespace comphelper
}
private:
+ void impl_assign( const ::com::sun::star::uno::Any& i_rWrappedElements );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
diff --git a/comphelper/inc/comphelper/optionalvalue.hxx b/comphelper/inc/comphelper/optionalvalue.hxx
deleted file mode 100644
index f63e1cde51aa..000000000000
--- a/comphelper/inc/comphelper/optionalvalue.hxx
+++ /dev/null
@@ -1,187 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _COMPHELPER_OPTIONALVALUE_HXX
-#define _COMPHELPER_OPTIONALVALUE_HXX
-
-#include <com/sun/star/uno/Any.hxx>
-
-namespace comphelper
-{
-
-/** @deprecated
- Use boost/optional.hpp instead.
-*/
-
-
-
- /* Definition of OptionalValue template */
-
- /** This template provides 'optionality' for the given value type.
-
- Especially for PODs, optionality either needs to be achieved
- by special 'magic' values (i.e. an int value is not set when
- -1 etc.), or an additional bool denoting value
- validity. This template encapsulates the latter into an atomic
- data type.
-
- @tpl Element
- The value type that should be made optional
- */
- template< typename Element > class OptionalValue
- {
- public:
- typedef Element ValueType;
-
- /** Default-construct the value.
-
- A default-constructed value is not valid. You have to
- explicitely set a value.
- */
- OptionalValue() :
- maValue(),
- mbValid( false )
- {
- }
-
- /** Construct the value.
-
- An explicitely constructed value is valid. To create an
- invalid value, you have to default-construct it.
- */
- OptionalValue( const Element& rValue ) :
- maValue( rValue ),
- mbValid( true )
- {
- }
-
- // default copy/assignment operators are okay here
- //OptionalValue(const OptionalValue&);
- //OptionalValue& operator=( const OptionalValue& );
-
- /** Query whether the value is valid
-
- @return true, if this object contains a valid value.
- */
- bool isValid() const
- {
- return mbValid;
- }
-
- /** Set a value.
-
- After this call, the object contains a valid value.
- */
- void setValue( const Element& rValue )
- {
- maValue = rValue;
- mbValid = true;
- }
-
- /** Get the value.
-
- The return value of this method is undefined, if the
- object does not contain a valid value.
- */
- Element getValue() const
- {
- return maValue;
- }
-
- /** Clear the value.
-
- After this call, the object no longer contains a valid
- value.
- */
- void clearValue()
- {
- mbValid = false;
- }
-
- // NOTE: The following two methods would optimally have been
- // implemented as operator>>=/operator<<=
- // overloads. Unfortunately, there's already a templatized
- // version for those two methods, namely for UNO interface
- // types. Adding a second would lead to ambiguities.
-
- /** Export the value into an Any.
-
- This method extracts the value into an Any. If the value
- is invalid, the Any will be cleared.
-
- @return true, if the value has been successfully
- transferred to the Any. Clearing the Any from an invalid
- object is also considered a successful operation.
- */
- bool exportValue( ::com::sun::star::uno::Any& o_rAny )
- {
- o_rAny.clear();
-
- if( isValid() )
- {
- if( !(o_rAny <<= getValue()) )
- return false;
- }
-
- return true;
- }
-
- /** Import the value from an Any.
-
- This method imports the value from an Any. If the Any
- is invalid, the object will get an invalid value.
-
- @return true, if the value has been successfully
- transferred from the Any. Setting the value to invalid
- from an empty Any is also considered a successful
- operation.
- */
- bool importValue( const ::com::sun::star::uno::Any& rAny )
- {
- clearValue();
-
- if( rAny.hasValue() )
- {
- Element tmp;
-
- if( !(rAny >>= tmp) )
- return false;
-
- setValue( tmp );
- }
-
- return true;
- }
-
- private:
- Element maValue;
- bool mbValid;
- };
-
-}
-
-#endif /* _COMPHELPER_OPTIONALVALUE_HXX */
diff --git a/comphelper/inc/comphelper/property.hxx b/comphelper/inc/comphelper/property.hxx
index 5631cf5670f2..9b5b1a9804fe 100644
--- a/comphelper/inc/comphelper/property.hxx
+++ b/comphelper/inc/comphelper/property.hxx
@@ -150,11 +150,11 @@ COMPHELPER_DLLPUBLIC void copyProperties(const staruno::Reference<starbeans::XPr
sal_False, if the value could be converted and has not changed
@exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
*/
-template <class TYPE>
-sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const TYPE& _rCurrentValue)
+template <typename T>
+sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const T& _rCurrentValue)
{
sal_Bool bModified(sal_False);
- TYPE aNewValue;
+ T aNewValue = T();
::cppu::convertPropertyValue(aNewValue, _rValueToSet);
if (aNewValue != _rCurrentValue)
{
@@ -207,7 +207,7 @@ sal_Bool tryPropertyValueEnum(staruno::Any& /*out*/_rConvertedValue, staruno::An
inline sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, sal_Bool _bCurrentValue)
{
sal_Bool bModified(sal_False);
- sal_Bool bNewValue;
+ sal_Bool bNewValue(sal_False);
::cppu::convertPropertyValue(bNewValue, _rValueToSet);
if (bNewValue != _bCurrentValue)
{
diff --git a/comphelper/inc/comphelper/querydeep.hxx b/comphelper/inc/comphelper/querydeep.hxx
deleted file mode 100644
index 4115412d8d6c..000000000000
--- a/comphelper/inc/comphelper/querydeep.hxx
+++ /dev/null
@@ -1,484 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _COMPHELPER_QUERYDEEPINTERFACE_HXX
-#define _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-/** */ //for docpp
-namespace comphelper
-{
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interfaces types whether they are related by inheritance.
- *<BR>
- * @return true if rType is derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param rType a <type>Type</type> of an interface.
- */
-sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType );
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interface types whether they are related by inheritance.
- *<BR>
- * @return true if p is of a type derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param p a pointer to an interface.
- */
-template <class Interface>
-inline sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type& rBaseType,
- Interface* /*p*/)
-{
- return isDerivedFrom(rBaseType, Interface::static_type());
-}
-
-//--------------------------------------------------------------------------------------------------------
-// possible optimization ?
-// Any aRet(::cppu::queryInterface(rType, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
-// if (aRet.hasValue())
-// return aRet;
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- */
-template< class Interface1 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- */
-template< class Interface1, class Interface2 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- * @param p12 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11, class Interface12 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11, Interface12 * p12 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else if (isDerivedFrom(rType, Interface12::static_type()))
- return ::com::sun::star::uno::Any( &p12, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-} // namespace comphelper
-
-#endif // _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
diff --git a/comphelper/inc/comphelper/scopeguard.hxx b/comphelper/inc/comphelper/scopeguard.hxx
index 4841a564ae61..1fdd179404a2 100644
--- a/comphelper/inc/comphelper/scopeguard.hxx
+++ b/comphelper/inc/comphelper/scopeguard.hxx
@@ -33,6 +33,7 @@
#endif
#include "boost/function.hpp"
#include "boost/noncopyable.hpp"
+#include "boost/bind.hpp"
namespace comphelper {
@@ -66,6 +67,21 @@ private:
exc_handling const m_excHandling;
};
+class COMPHELPER_DLLPUBLIC FlagGuard : ScopeGuard
+{
+public:
+ explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+ {
+ }
+
+private:
+ static void ResetFlag( bool& i_flagRef )
+ {
+ i_flagRef = false;
+ }
+};
+
} // namespace comphelper
#endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx
index adf120b3bae2..5ea7972e29a2 100644
--- a/comphelper/inc/comphelper/servicedecl.hxx
+++ b/comphelper/inc/comphelper/servicedecl.hxx
@@ -67,7 +67,7 @@ typedef ::boost::function3<
The declaration can be done in various ways, the (simplest) form is
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Reference<uno::XComponentContext> const& xContext )
[...]
@@ -85,7 +85,7 @@ typedef ::boost::function3<
context:
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Sequence<uno::Any> const& args,
uno::Reference<uno:XComponentContext> const& xContext )
diff --git a/comphelper/source/misc/makefile.mk b/comphelper/source/misc/makefile.mk
index cecba554b332..0bb4defb4165 100644
--- a/comphelper/source/misc/makefile.mk
+++ b/comphelper/source/misc/makefile.mk
@@ -74,7 +74,6 @@ SLOFILES= \
$(SLO)$/officeresourcebundle.obj \
$(SLO)$/officerestartmanager.obj \
$(SLO)$/proxyaggregation.obj \
- $(SLO)$/querydeep.obj \
$(SLO)$/regpathhelper.obj \
$(SLO)$/scopeguard.obj \
$(SLO)$/SelectionMultiplex.obj \
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx
index 8bab7fa3d7c7..566e5526019c 100644
--- a/comphelper/source/misc/namedvaluecollection.cxx
+++ b/comphelper/source/misc/namedvaluecollection.cxx
@@ -99,21 +99,7 @@ namespace comphelper
NamedValueCollection::NamedValueCollection( const Any& _rElements )
:m_pImpl( new NamedValueCollection_Impl )
{
- Sequence< NamedValue > aNamedValues;
- Sequence< PropertyValue > aPropertyValues;
- NamedValue aNamedValue;
- PropertyValue aPropertyValue;
-
- if ( _rElements >>= aNamedValues )
- impl_assign( aNamedValues );
- else if ( _rElements >>= aPropertyValues )
- impl_assign( aPropertyValues );
- else if ( _rElements >>= aNamedValue )
- impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
- else if ( _rElements >>= aPropertyValue )
- impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
- else
- OSL_ENSURE( !_rElements.hasValue(), "NamedValueCollection::NamedValueCollection(Any): unsupported type!" );
+ impl_assign( _rElements );
}
//--------------------------------------------------------------------
@@ -170,6 +156,39 @@ namespace comphelper
}
//--------------------------------------------------------------------
+ ::std::vector< ::rtl::OUString > NamedValueCollection::getNames() const
+ {
+ ::std::vector< ::rtl::OUString > aNames( m_pImpl->aValues.size() );
+ ::std::transform(
+ m_pImpl->aValues.begin(),
+ m_pImpl->aValues.end(),
+ aNames.begin(),
+ ::std::select1st< NamedValueRepository::value_type >()
+ );
+ return aNames;
+ }
+
+ //--------------------------------------------------------------------
+ void NamedValueCollection::impl_assign( const Any& i_rWrappedElements )
+ {
+ Sequence< NamedValue > aNamedValues;
+ Sequence< PropertyValue > aPropertyValues;
+ NamedValue aNamedValue;
+ PropertyValue aPropertyValue;
+
+ if ( i_rWrappedElements >>= aNamedValues )
+ impl_assign( aNamedValues );
+ else if ( i_rWrappedElements >>= aPropertyValues )
+ impl_assign( aPropertyValues );
+ else if ( i_rWrappedElements >>= aNamedValue )
+ impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
+ else if ( i_rWrappedElements >>= aPropertyValue )
+ impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
+ else
+ OSL_ENSURE( !i_rWrappedElements.hasValue(), "NamedValueCollection::impl_assign(Any): unsupported type!" );
+ }
+
+ //--------------------------------------------------------------------
void NamedValueCollection::impl_assign( const Sequence< Any >& _rArguments )
{
{
diff --git a/comphelper/source/misc/querydeep.cxx b/comphelper/source/misc/querydeep.cxx
deleted file mode 100644
index 92e475686783..000000000000
--- a/comphelper/source/misc/querydeep.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_comphelper.hxx"
-#include <comphelper/querydeep.hxx>
-#include <typelib/typedescription.h>
-
-//__________________________________________________________________________________________________
-
-sal_Bool comphelper::isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType )
-{
- using namespace ::com::sun::star::uno;
-
- TypeClass eClass = rBaseType.getTypeClass();
-
- if (eClass != TypeClass_INTERFACE)
- return sal_False;
-
- // supported TypeClass - do the types match ?
- if (eClass != rType.getTypeClass())
- return sal_False;
-
- sal_Bool bRet;
-
- // shortcut for simple case
- if (rBaseType == ::getCppuType(static_cast<const Reference< XInterface > *>(0)))
- {
- bRet = sal_True;
- }
- else
- {
- // now ask in cppu (aka typelib)
- ::typelib_TypeDescription *pBaseTD = 0, *pTD = 0;
-
- rBaseType. getDescription(&pBaseTD);
- rType. getDescription(&pTD);
-
- // interfaces are assignable to a base
- bRet = ::typelib_typedescription_isAssignableFrom(pBaseTD, pTD);
-
- ::typelib_typedescription_release(pBaseTD);
- ::typelib_typedescription_release(pTD);
- }
-
- return bRet;
-}
-
-
-
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index e796c29eba90..9c2fd868d973 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -87,20 +87,36 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
const Property* pDelegateProps = _rProperties.getConstArray();
Property* pMergedProps = m_aProperties.getArray();
+ // if properties are present both at the delegatee and the aggregate, then the former are supposed to win.
+ // So, we'll need an existence check.
+ ::std::set< ::rtl::OUString > aDelegatorProps;
+
// create the map for the delegator properties
sal_Int32 nMPLoop = 0;
for ( ; nMPLoop < nDelegatorProps; ++nMPLoop, ++pDelegateProps )
+ {
m_aPropertyAccessors[ pDelegateProps->Handle ] = OPropertyAccessor( -1, nMPLoop, sal_False );
+ OSL_ENSURE( aDelegatorProps.find( pDelegateProps->Name ) == aDelegatorProps.end(),
+ "OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper: duplicate delegatee property!" );
+ aDelegatorProps.insert( pDelegateProps->Name );
+ }
// create the map for the aggregate properties
sal_Int32 nAggregateHandle = _nFirstAggregateId;
pMergedProps += nDelegatorProps;
- for ( ; nMPLoop < nMergedProps; ++nMPLoop, ++pMergedProps, ++pAggregateProps )
+ for ( ; nMPLoop < nMergedProps; ++pAggregateProps )
{
+ // if the aggregate property is present at the delegatee already, ignore it
+ if ( aDelegatorProps.find( pAggregateProps->Name ) != aDelegatorProps.end() )
+ {
+ --nMergedProps;
+ continue;
+ }
+
// next aggregate property - remember it
*pMergedProps = *pAggregateProps;
- // determine the handle for the property which we will expose to the ourside world
+ // determine the handle for the property which we will expose to the outside world
sal_Int32 nHandle = -1;
// ask the infor service first
if ( _pInfoService )
@@ -123,7 +139,11 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
// remember the accessor for this property
m_aPropertyAccessors[ nHandle ] = OPropertyAccessor( pMergedProps->Handle, nMPLoop, sal_True );
pMergedProps->Handle = nHandle;
+
+ ++nMPLoop;
+ ++pMergedProps;
}
+ m_aProperties.realloc( nMergedProps );
pMergedProps = m_aProperties.getArray(); // reset, needed again below
// sortieren der Properties nach Namen
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index eda60e6d612a..933a414d331c 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -909,11 +909,8 @@ rtl::OUString Access::getImplementationName() throw (css::uno::RuntimeException)
OSL_ASSERT(thisIs(IS_ANY));
osl::MutexGuard g(lock);
checkLocalizedPropertyAccess();
- throw css::uno::RuntimeException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "configmgr Access has no service implementation name")),
- static_cast< cppu::OWeakObject * >(this));
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("org.openoffice-configmgr::Access"));
}
sal_Bool Access::supportsService(rtl::OUString const & ServiceName)
@@ -2092,7 +2089,8 @@ css::beans::Property Access::asProperty() {
default:
type = cppu::UnoType< css::uno::XInterface >::get(); //TODO: correct?
nillable = false;
- removable = getParentNode()->kind() == Node::KIND_SET;
+ rtl::Reference< Node > parent(getParentNode());
+ removable = parent.is() && parent->kind() == Node::KIND_SET;
break;
}
return css::beans::Property(
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index ef2b213d4ef1..c20fa49fb18c 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -283,8 +283,9 @@ css::uno::Any ChildAccess::asValue() {
// Find best match using an adaption of RFC 4647 lookup matching
// rules, removing "-" or "_" delimited segments from the end;
// defaults are the empty string locale, the "en-US" locale, the
- // first child (if any), or a nil value (even though it may be
- // illegal for the given property), in that order:
+ // "en" locale, the first child (if any), or a nil value (even
+ // though it may be illegal for the given property), in that
+ // order:
rtl::Reference< ChildAccess > child;
for (;;) {
child = getChild(locale);
@@ -301,10 +302,14 @@ css::uno::Any ChildAccess::asValue() {
child = getChild(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")));
if (!child.is()) {
- std::vector< rtl::Reference< ChildAccess > > all(
- getAllChildren());
- if (!all.empty()) {
- child = all.front();
+ child = getChild(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")));
+ if (!child.is()) {
+ std::vector< rtl::Reference< ChildAccess > > all(
+ getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
}
}
}
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 32478e96813d..2d148959edfc 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -214,7 +214,7 @@ void Components::WriteThread::run() {
reference_->clear();
}
-void Components::initSingleton(
+Components & Components::getSingleton(
css::uno::Reference< css::uno::XComponentContext > const & context)
{
OSL_ASSERT(context.is());
@@ -223,10 +223,6 @@ void Components::initSingleton(
static Components theSingleton(context);
singleton = &theSingleton;
}
-}
-
-Components & Components::getSingleton() {
- OSL_ASSERT(singletonCreated);
if (singleton == 0) {
throw css::uno::RuntimeException(
rtl::OUString(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 1c735efca6ba..34b693c7e585 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -65,12 +65,10 @@ class RootAccess;
class Components: private boost::noncopyable {
public:
- static void initSingleton(
+ static Components & getSingleton(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context);
- static Components & getSingleton();
-
static bool allLocales(rtl::OUString const & locale);
rtl::Reference< Node > resolvePathRepresentation(
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index 3cd58b145bff..999253118f11 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -55,7 +55,7 @@
#include "cppu/unotype.hxx"
#include "cppuhelper/compbase5.hxx"
#include "cppuhelper/factory.hxx"
-#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/interfacecontainer.hxx"
#include "cppuhelper/weak.hxx"
#include "osl/diagnose.h"
@@ -127,7 +127,6 @@ private:
virtual css::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames() throw (css::uno::RuntimeException)
{ return configuration_provider::getSupportedServiceNames(); }
- //TODO: DefaultProvider?
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
rtl::OUString const & aServiceSpecifier)
@@ -276,8 +275,7 @@ Service::createInstanceWithArguments(
static_cast< cppu::OWeakObject * >(this));
}
osl::MutexGuard guard(lock);
- Components::initSingleton(context_);
- Components & components = Components::getSingleton();
+ Components & components = Components::getSingleton(context_);
rtl::Reference< RootAccess > root(
new RootAccess(components, nodepath, locale, update));
if (root->isValue()) {
@@ -388,14 +386,14 @@ void Service::flushModifications() const {
Components * components;
{
osl::MutexGuard guard(lock);
- Components::initSingleton(context_);
- components = &Components::getSingleton();
+ components = &Components::getSingleton(context_);
}
components->flushModifications();
}
class Factory:
- public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ public cppu::WeakImplHelper2<
+ css::lang::XSingleComponentFactory, css::lang::XServiceInfo >,
private boost::noncopyable
{
public:
@@ -414,6 +412,18 @@ private:
css::uno::Sequence< css::uno::Any > const & Arguments,
css::uno::Reference< css::uno::XComponentContext > const & Context)
throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return configuration_provider::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return configuration_provider::getSupportedServiceNames(); }
};
css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx
index ffd7174c0ad7..f4810eb34ff8 100644
--- a/configmgr/source/configurationregistry.cxx
+++ b/configmgr/source/configurationregistry.cxx
@@ -36,7 +36,6 @@
#include "com/sun/star/lang/XMultiComponentFactory.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
#include "com/sun/star/registry/InvalidRegistryException.hpp"
#include "com/sun/star/registry/InvalidValueException.hpp"
#include "com/sun/star/registry/MergeConflictException.hpp"
@@ -56,13 +55,11 @@
#include "com/sun/star/uno/XInterface.hpp"
#include "com/sun/star/util/XFlushable.hpp"
#include "cppu/unotype.hxx"
-#include "cppuhelper/factory.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase3.hxx"
#include "cppuhelper/weak.hxx"
#include "osl/diagnose.h"
#include "osl/mutex.hxx"
-#include "rtl/unload.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
@@ -877,53 +874,12 @@ rtl::OUString RegistryKey::getResolvedName(rtl::OUString const & aKeyName)
return aKeyName;
}
-class Factory:
- public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
- private boost::noncopyable
-{
-public:
- Factory() {}
-
-private:
- virtual ~Factory() {}
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-};
-
-css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException)
-{
- return createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any >(), Context);
}
-css::uno::Reference< css::uno::XInterface >
-Factory::createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > create(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
{
- if (Arguments.getLength() != 0) {
- throw css::uno::Exception(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationRegistry must be"
- " instantiated without arguments")),
- static_cast< cppu::OWeakObject * >(this));
- }
- return static_cast< cppu::OWeakObject * >(new Service(Context));
-}
-
+ return static_cast< cppu::OWeakObject * >(new Service(context));
}
rtl::OUString getImplementationName() {
@@ -939,12 +895,4 @@ css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
return css::uno::Sequence< rtl::OUString >(&name, 1);
}
-css::uno::Reference< css::lang::XSingleComponentFactory > createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(())
-{
- return new Factory;
-}
-
} }
diff --git a/configmgr/source/configurationregistry.hxx b/configmgr/source/configurationregistry.hxx
index 6cba122188b1..417c519b97f4 100644
--- a/configmgr/source/configurationregistry.hxx
+++ b/configmgr/source/configurationregistry.hxx
@@ -30,28 +30,28 @@
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
-#include "cppuhelper/factory.hxx"
-#include "rtl/unload.h"
#include "sal/types.h"
-namespace com { namespace sun { namespace star { namespace lang {
- class XSingleComponentFactory;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
namespace rtl { class OUString; }
namespace configmgr { namespace configuration_registry {
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
+create(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
rtl::OUString SAL_CALL getImplementationName();
com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames();
-com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
-SAL_CALL createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(());
-
} }
#endif
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx
index d069663290e8..9079d4736a6c 100644
--- a/configmgr/source/defaultprovider.cxx
+++ b/configmgr/source/defaultprovider.cxx
@@ -28,24 +28,16 @@
#include "precompiled_configmgr.hxx"
#include "sal/config.h"
-#include "boost/noncopyable.hpp"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XInterface.hpp"
-#include "cppuhelper/factory.hxx"
-#include "cppuhelper/implbase1.hxx"
-#include "cppuhelper/weak.hxx"
-#include "sal/types.h"
-#include "rtl/unload.h"
+#include "osl/mutex.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "configurationprovider.hxx"
+#include "defaultprovider.hxx"
#include "lock.hxx"
namespace configmgr { namespace default_provider {
@@ -54,58 +46,17 @@ namespace {
namespace css = com::sun::star;
-class Factory:
- public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
- private boost::noncopyable
-{
-public:
- Factory() {}
-
-private:
- virtual ~Factory() {}
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-};
-
-css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException)
-{
- return createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any >(), Context);
}
-css::uno::Reference< css::uno::XInterface >
-Factory::createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > create(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
{
- if (Arguments.getLength() != 0) {
- throw css::uno::Exception(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.DefaultProvider must be"
- " instantiated without arguments")),
- static_cast< cppu::OWeakObject * >(this));
- }
osl::MutexGuard guard(lock);
static css::uno::Reference< css::uno::XInterface > singleton(
- configuration_provider::createDefault(Context));
+ configuration_provider::createDefault(context));
return singleton;
}
-}
-
rtl::OUString getImplementationName() {
return rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
@@ -119,13 +70,4 @@ css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
return css::uno::Sequence< rtl::OUString >(&name, 1);
}
-css::uno::Reference< css::lang::XSingleComponentFactory >
-SAL_CALL createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(())
-{
- return new Factory;
-}
-
} }
diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx
index 7b267a80b42e..f678931d35fe 100644
--- a/configmgr/source/defaultprovider.hxx
+++ b/configmgr/source/defaultprovider.hxx
@@ -32,28 +32,28 @@
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
-#include "cppuhelper/factory.hxx"
-#include "rtl/unload.h"
#include "sal/types.h"
-namespace com { namespace sun { namespace star { namespace lang {
- class XSingleComponentFactory;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
namespace rtl { class OUString; }
namespace configmgr { namespace default_provider {
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
+create(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
rtl::OUString SAL_CALL getImplementationName();
com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames();
-com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
-SAL_CALL createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(());
-
} }
#endif
diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx
index a5a089106b2a..5473b6b1de0c 100644
--- a/configmgr/source/node.cxx
+++ b/configmgr/source/node.cxx
@@ -101,8 +101,4 @@ Node::~Node() {}
void Node::clear() {}
-rtl::Reference< Node > Node::findMember(rtl::OUString const &) {
- return rtl::Reference< Node >();
-}
-
}
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index 7c9417e68ea9..f79e7ba296fa 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -31,11 +31,12 @@
#include "sal/config.h"
#include "rtl/ref.hxx"
-#include "rtl/ustring.hxx"
#include "salhelper/simplereferenceobject.hxx"
#include "nodemap.hxx"
+namespace rtl { class OUString; }
+
namespace configmgr {
class Node: public salhelper::SimpleReferenceObject {
@@ -75,8 +76,6 @@ protected:
virtual void clear();
- virtual rtl::Reference< Node > findMember(rtl::OUString const & name);
-
int layer_;
int finalized_;
};
diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
index b1ef8d2169bb..dd01189be6e2 100644
--- a/configmgr/source/services.cxx
+++ b/configmgr/source/services.cxx
@@ -32,6 +32,7 @@
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/factory.hxx"
#include "cppuhelper/implementationentry.hxx"
#include "osl/diagnose.h"
#include "uno/lbnames.h"
@@ -58,15 +59,17 @@ static cppu::ImplementationEntry const services[] = {
{ &dummy, &configmgr::configuration_provider::getImplementationName,
&configmgr::configuration_provider::getSupportedServiceNames,
&configmgr::configuration_provider::createFactory, 0, 0 },
- { &dummy, &configmgr::default_provider::getImplementationName,
+ { &configmgr::default_provider::create,
+ &configmgr::default_provider::getImplementationName,
&configmgr::default_provider::getSupportedServiceNames,
- &configmgr::default_provider::createFactory, 0, 0 },
- { &dummy, &configmgr::configuration_registry::getImplementationName,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &configmgr::configuration_registry::create,
+ &configmgr::configuration_registry::getImplementationName,
&configmgr::configuration_registry::getSupportedServiceNames,
- &configmgr::configuration_registry::createFactory, 0, 0 },
- { &dummy, &configmgr::update::getImplementationName,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &configmgr::update::create, &configmgr::update::getImplementationName,
&configmgr::update::getSupportedServiceNames,
- &configmgr::update::createFactory, 0, 0 },
+ &cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
index 403b761a5abd..258765158aa3 100644
--- a/configmgr/source/update.cxx
+++ b/configmgr/source/update.cxx
@@ -32,20 +32,15 @@
#include "boost/noncopyable.hpp"
#include "com/sun/star/configuration/XUpdate.hpp"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XInterface.hpp"
-#include "cppuhelper/factory.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/weak.hxx"
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
-#include "rtl/unload.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
@@ -76,7 +71,11 @@ class Service:
private boost::noncopyable
{
public:
- Service() {}
+ Service(css::uno::Reference< css::uno::XComponentContext > const context):
+ context_(context)
+ {
+ OSL_ASSERT(context.is());
+ }
private:
virtual ~Service() {}
@@ -97,6 +96,8 @@ private:
css::uno::Sequence< rtl::OUString > const & includedPaths,
css::uno::Sequence< rtl::OUString > const & excludedPaths)
throw (css::uno::RuntimeException);
+
+ css::uno::Reference< css::uno::XComponentContext > context_;
};
void Service::insertExtensionXcsFile(
@@ -104,7 +105,7 @@ void Service::insertExtensionXcsFile(
throw (css::uno::RuntimeException)
{
osl::MutexGuard g(lock);
- Components::getSingleton().insertExtensionXcsFile(shared, fileUri);
+ Components::getSingleton(context_).insertExtensionXcsFile(shared, fileUri);
}
void Service::insertExtensionXcuFile(
@@ -114,10 +115,10 @@ void Service::insertExtensionXcuFile(
Broadcaster bc;
{
osl::MutexGuard g(lock);
+ Components & components = Components::getSingleton(context_);
Modifications mods;
- Components::getSingleton().insertExtensionXcuFile(
- shared, fileUri, &mods);
- Components::getSingleton().initGlobalBroadcaster(
+ components.insertExtensionXcuFile(shared, fileUri, &mods);
+ components.initGlobalBroadcaster(
mods, rtl::Reference< RootAccess >(), &bc);
}
bc.send();
@@ -129,9 +130,10 @@ void Service::removeExtensionXcuFile(rtl::OUString const & fileUri)
Broadcaster bc;
{
osl::MutexGuard g(lock);
+ Components & components = Components::getSingleton(context_);
Modifications mods;
- Components::getSingleton().removeExtensionXcuFile(fileUri, &mods);
- Components::getSingleton().initGlobalBroadcaster(
+ components.removeExtensionXcuFile(fileUri, &mods);
+ components.initGlobalBroadcaster(
mods, rtl::Reference< RootAccess >(), &bc);
}
bc.send();
@@ -146,62 +148,22 @@ void Service::insertModificationXcuFile(
Broadcaster bc;
{
osl::MutexGuard g(lock);
+ Components & components = Components::getSingleton(context_);
Modifications mods;
- Components::getSingleton().insertModificationXcuFile(
+ components.insertModificationXcuFile(
fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods);
- Components::getSingleton().initGlobalBroadcaster(
+ components.initGlobalBroadcaster(
mods, rtl::Reference< RootAccess >(), &bc);
}
bc.send();
}
-class Factory:
- public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
- private boost::noncopyable
-{
-public:
- Factory() {}
-
-private:
- virtual ~Factory() {}
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException);
-};
-
-css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
- css::uno::Reference< css::uno::XComponentContext > const & Context)
- throw (css::uno::Exception, css::uno::RuntimeException)
-{
- return createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any >(), Context);
}
-css::uno::Reference< css::uno::XInterface >
-Factory::createInstanceWithArgumentsAndContext(
- css::uno::Sequence< css::uno::Any > const & Arguments,
- css::uno::Reference< css::uno::XComponentContext > const &)
- throw (css::uno::Exception, css::uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > create(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
{
- if (Arguments.getLength() != 0) {
- throw css::uno::Exception(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.Update must be"
- " instantiated without arguments")),
- static_cast< cppu::OWeakObject * >(this));
- }
- return static_cast< cppu::OWeakObject * >(new Service);
-}
-
+ return static_cast< cppu::OWeakObject * >(new Service(context));
}
rtl::OUString getImplementationName() {
@@ -216,12 +178,4 @@ css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
return css::uno::Sequence< rtl::OUString >(&name, 1);
}
-css::uno::Reference< css::lang::XSingleComponentFactory > createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(())
-{
- return new Factory;
-}
-
} }
diff --git a/configmgr/source/update.hxx b/configmgr/source/update.hxx
index faa5c86b15fa..a60264e67ac3 100644
--- a/configmgr/source/update.hxx
+++ b/configmgr/source/update.hxx
@@ -32,28 +32,28 @@
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
-#include "cppuhelper/factory.hxx"
-#include "rtl/unload.h"
#include "sal/types.h"
-namespace com { namespace sun { namespace star { namespace lang {
- class XSingleComponentFactory;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
namespace rtl { class OUString; }
namespace configmgr { namespace update {
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
+create(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const &);
+
rtl::OUString SAL_CALL getImplementationName();
com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames();
-com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
-SAL_CALL createFactory(
- cppu::ComponentFactoryFunc, rtl::OUString const &,
- com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
- SAL_THROW(());
-
} }
#endif
diff --git a/configure.in b/configure.in
index df50904f7157..0eeb5b8482a1 100644
--- a/configure.in
+++ b/configure.in
@@ -3639,10 +3639,8 @@ if test -n "$with_system_cppunit" -o -n "$with_system_libs" && \
test "$with_system_cppunit" != "no"; then
AC_MSG_RESULT([external])
SYSTEM_CPPUNIT=YES
- # might work for earlier, too but go sure. We didn't have
- # a system-cppunit before the first version using a proper cppunit
- # (and that being 1.12.1) anyway
- PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.1 )
+ # might work for earlier, too but go sure:
+ PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
else
AC_MSG_RESULT([internal])
SYSTEM_CPPUNIT=NO
diff --git a/connectivity/inc/connectivity/filtermanager.hxx b/connectivity/inc/connectivity/filtermanager.hxx
index 71494de67b38..c9d1e95cfac4 100644
--- a/connectivity/inc/connectivity/filtermanager.hxx
+++ b/connectivity/inc/connectivity/filtermanager.hxx
@@ -33,7 +33,8 @@
#include <com/sun/star/sdb/XSQLQueryComposer.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
/** === end UNO includes === **/
-#include <rtl/ustring.hxx>
+
+#include <rtl/ustrbuf.hxx>
#include <vector>
#include "connectivity/dbtoolsdllapi.hxx"
@@ -111,10 +112,10 @@ namespace dbtools
/** appends one filter component to the statement in our composer
*/
- void appendFilterComponent( ::rtl::OUString& /* [inout] */ _rAppendTo, const ::rtl::OUString& _rComponent ) const;
+ void appendFilterComponent( ::rtl::OUStringBuffer& io_appendTo, const ::rtl::OUString& i_component ) const;
/// checks whether there is only one (or even no) non-empty filter component
- bool isThereAtMostOneComponent( ::rtl::OUString& _rOnlyComponent ) const;
+ bool isThereAtMostOneComponent( ::rtl::OUStringBuffer& o_singleComponent ) const;
/// returns the index of the first filter component which should be considered when building the composed filter
inline sal_Int32 getFirstApplicableFilterIndex() const
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index aca181916b47..1e39befaf5f7 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -1753,7 +1753,7 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
}
// -----------------------------------------------------------------------------
-::com::sun::star::util::Date ORowSetValue::getDate() const
+::com::sun::star::util::Date ORowSetValue::getDate() const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDate" );
::com::sun::star::util::Date aValue;
@@ -1768,8 +1768,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
break;
case DataType::DECIMAL:
case DataType::NUMERIC:
- aValue = DBTypeConversion::toDate((double)*this);
- break;
case DataType::FLOAT:
case DataType::DOUBLE:
case DataType::REAL:
@@ -1787,12 +1785,28 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aValue.Year = pDateTime->Year;
}
break;
+ case DataType::BIT:
+ case DataType::BOOLEAN:
+ case DataType::TINYINT:
+ case DataType::SMALLINT:
+ case DataType::INTEGER:
+ case DataType::BIGINT:
+ aValue = DBTypeConversion::toDate( double( sal_Int64( *this ) ) );
+ break;
+
+ case DataType::BLOB:
+ case DataType::CLOB:
+ case DataType::OBJECT:
default:
- {
- Any aAnyValue = getAny();
- aAnyValue >>= aValue;
- break;
- }
+ OSL_ENSURE( false, "ORowSetValue::getDate: cannot retrieve the data!" );
+ // NO break!
+
+ case DataType::BINARY:
+ case DataType::VARBINARY:
+ case DataType::LONGVARBINARY:
+ case DataType::TIME:
+ aValue = DBTypeConversion::toDate( (double)0 );
+ break;
}
}
return aValue;
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index c9a878fe1840..67f1b9130862 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -585,7 +585,6 @@ bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl::
try
{
const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY );
- OSL_ENSURE( xDataSourceProperties.is(), "getDataSourceSetting: invalid data source object!" );
if ( !xDataSourceProperties.is() )
return false;
diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx
index bab2ec4ed144..6b9ac603a722 100644
--- a/connectivity/source/commontools/filtermanager.cxx
+++ b/connectivity/source/commontools/filtermanager.cxx
@@ -35,6 +35,8 @@
#include "TConnection.hxx"
#include <osl/diagnose.h>
#include "connectivity/dbtools.hxx"
+#include <tools/diagnose_ex.h>
+#include <rtl/ustrbuf.hxx>
//........................................................................
namespace dbtools
@@ -92,7 +94,7 @@ namespace dbtools
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "FilterManager::setFilterComponent: setting the filter failed!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -113,44 +115,30 @@ namespace dbtools
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "FilterManager::setApplyPublicFilter: setting the filter failed!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
//--------------------------------------------------------------------
- namespace
+ void FilterManager::appendFilterComponent( ::rtl::OUStringBuffer& io_appendTo, const ::rtl::OUString& i_component ) const
{
- void lcl_ensureBracketed( ::rtl::OUString& /* [inout] */ _rExpression )
+ if ( io_appendTo.getLength() > 0 )
{
- OSL_ENSURE( _rExpression.getLength(), "lcl_ensureBracketed: expression is empty!" );
- if ( _rExpression.getLength() )
- {
- if ( ( _rExpression.getStr()[0] != '(' ) || ( _rExpression.getStr()[ _rExpression.getLength() - 1 ] != ')' ) )
- {
- ::rtl::OUString sComposed( RTL_CONSTASCII_USTRINGPARAM( "(" ) );
- sComposed += _rExpression;
- sComposed += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" ) );
- _rExpression = sComposed;
- }
- }
+ io_appendTo.insert( 0, sal_Unicode( '(' ) );
+ io_appendTo.insert( 1, sal_Unicode( ' ' ) );
+ io_appendTo.appendAscii( " ) AND " );
}
- }
- //--------------------------------------------------------------------
- void FilterManager::appendFilterComponent( ::rtl::OUString& /* [inout] */ _rAppendTo, const ::rtl::OUString& _rComponent ) const
- {
- if ( _rAppendTo.getLength() )
- _rAppendTo += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " AND " ) );
- ::rtl::OUString sComponent( _rComponent );
- lcl_ensureBracketed( sComponent );
- _rAppendTo += sComponent;
+ io_appendTo.appendAscii( "( " );
+ io_appendTo.append( i_component );
+ io_appendTo.appendAscii( " )" );
}
//--------------------------------------------------------------------
- bool FilterManager::isThereAtMostOneComponent( ::rtl::OUString& _rOnlyComponent ) const
+ bool FilterManager::isThereAtMostOneComponent( ::rtl::OUStringBuffer& o_singleComponent ) const
{
sal_Int32 nOnlyNonEmpty = -1;
- sal_Int32 i;
+ sal_Int32 i;
for ( i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i )
{
if ( m_aFilterComponents[ i ].getLength() )
@@ -164,14 +152,14 @@ namespace dbtools
}
if ( nOnlyNonEmpty == -1 )
{
- _rOnlyComponent = ::rtl::OUString();
+ o_singleComponent.makeStringAndClear();
return true;
}
if ( i == FC_COMPONENT_COUNT )
{
// we found only one non-empty filter component
- _rOnlyComponent = m_aFilterComponents[ nOnlyNonEmpty ];
+ o_singleComponent = m_aFilterComponents[ nOnlyNonEmpty ];
return true;
}
return false;
@@ -180,17 +168,17 @@ namespace dbtools
//--------------------------------------------------------------------
::rtl::OUString FilterManager::getComposedFilter( ) const
{
- ::rtl::OUString sComposedFilter;
+ ::rtl::OUStringBuffer aComposedFilter;
// if we have only one non-empty component, then there's no need to compose anything
- if ( isThereAtMostOneComponent( sComposedFilter ) )
- return sComposedFilter;
-
- // append the single components
- for ( sal_Int32 i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i )
- appendFilterComponent( sComposedFilter, m_aFilterComponents[ i ] );
+ if ( !isThereAtMostOneComponent( aComposedFilter ) )
+ {
+ // append the single components
+ for ( sal_Int32 i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i )
+ appendFilterComponent( aComposedFilter, m_aFilterComponents[ i ] );
+ }
- return sComposedFilter;
+ return aComposedFilter.makeStringAndClear();
}
//........................................................................
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 305e26d386e0..c516b325ad9a 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -937,9 +937,13 @@ again:
{
m_pTable->fetchRow(m_aEvaluateRow, rTableCols, sal_True,bRetrieveData || bHasRestriction);
- if ( (!m_bShowDeleted && m_aEvaluateRow->isDeleted())
- || (bHasRestriction && //!bShowDeleted && m_aEvaluateRow->isDeleted() ||// keine Anzeige von geloeschten Saetzen
- !m_pSQLAnalyzer->evaluateRestriction())) // Auswerten der Bedingungen
+ if ( ( !m_bShowDeleted
+ && m_aEvaluateRow->isDeleted()
+ )
+ || ( bHasRestriction
+ && !m_pSQLAnalyzer->evaluateRestriction()
+ )
+ )
{ // naechsten Satz auswerten
// aktuelle Zeile loeschen im Keyset
if (m_pEvaluationKeySet)
@@ -988,12 +992,14 @@ again:
// Evaluate darf nur gesetzt sein,
// wenn der Keyset weiter aufgebaut werden soll
- if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount() &&
- (m_pFileSet.isValid() || m_pSortIndex) && bEvaluate)
+ if ( ( m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT )
+ && !isCount()
+ && bEvaluate
+ )
{
if (m_pSortIndex)
{
- OKeyValue* pKeyValue = GetOrderbyKeyValue(m_aEvaluateRow);
+ OKeyValue* pKeyValue = GetOrderbyKeyValue( m_aSelectRow );
m_pSortIndex->AddKeyValue(pKeyValue);
}
else if (m_pFileSet.isValid())
@@ -1294,8 +1300,8 @@ void OResultSet::sortRows()
::std::vector<sal_Int32>::iterator aOrderByIter = m_aOrderbyColumnNumber.begin();
for (::std::vector<sal_Int16>::size_type i=0;aOrderByIter != m_aOrderbyColumnNumber.end(); ++aOrderByIter,++i)
{
- OSL_ENSURE((sal_Int32)m_aRow->get().size() > *aOrderByIter,"Invalid Index");
- switch ((*(m_aRow->get().begin()+*aOrderByIter))->getValue().getTypeKind())
+ OSL_ENSURE((sal_Int32)m_aSelectRow->get().size() > *aOrderByIter,"Invalid Index");
+ switch ((*(m_aSelectRow->get().begin()+*aOrderByIter))->getValue().getTypeKind())
{
case DataType::CHAR:
case DataType::VARCHAR:
@@ -1324,7 +1330,7 @@ void OResultSet::sortRows()
OSL_ASSERT("OFILECursor::Execute: Datentyp nicht implementiert");
break;
}
- (m_aEvaluateRow->get())[*aOrderByIter]->setBound(sal_True);
+ (m_aSelectRow->get())[*aOrderByIter]->setBound(sal_True);
}
m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending);
@@ -1341,8 +1347,13 @@ void OResultSet::sortRows()
}
else
{
- while (ExecuteRow(IResultSetHelper::NEXT,1,TRUE))
+ while ( ExecuteRow( IResultSetHelper::NEXT, 1, FALSE, TRUE ) )
{
+ m_aSelectRow->get()[0]->setValue( m_aRow->get()[0]->getValue() );
+ if ( m_pSQLAnalyzer->hasFunctions() )
+ m_pSQLAnalyzer->setSelectionEvaluationResult( m_aSelectRow, m_aColMapping );
+ const sal_Int32 nBookmark = (*m_aRow->get().begin())->getValue();
+ ExecuteRow( IResultSetHelper::BOOKMARK, nBookmark, TRUE, FALSE );
}
}
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index acc2059f15c7..52200553d042 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -451,19 +451,12 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
return;
// Alles geprueft und wir haben den Namen der Column.
// Die wievielte Column ist das?
- try
- {
- m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName));
- }
- catch(Exception)
- {
- ::vos::ORef<OSQLColumns> aSelectColumns = m_aSQLIterator.getSelectColumns();
- ::comphelper::UStringMixEqual aCase;
- OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),aColumnName,aCase);
- if ( aFind == aSelectColumns->get().end() )
- throw SQLException();
- m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1);
- }
+ ::vos::ORef<OSQLColumns> aSelectColumns = m_aSQLIterator.getSelectColumns();
+ ::comphelper::UStringMixEqual aCase;
+ OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),aColumnName,aCase);
+ if ( aFind == aSelectColumns->get().end() )
+ throw SQLException();
+ m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1);
// Ascending or Descending?
m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC);
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index 7abf10191f21..8211e954a49f 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -103,7 +103,26 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode)
m_pConnection->throwGenericSQLException(STR_QUERY_COMPLEX_COUNT,NULL);
}
else
- m_aSelectionEvaluations.push_back( TPredicates() );
+ {
+ if ( SQL_ISPUNCTUATION( pColumnRef, "*" )
+ || ( SQL_ISRULE( pColumnRef, column_ref )
+ && ( pColumnRef->count() == 3 )
+ && ( pColumnRef->getChild(0)->getNodeType() == SQL_NODE_NAME )
+ && SQL_ISPUNCTUATION( pColumnRef->getChild(1), "." )
+ && SQL_ISRULE( pColumnRef->getChild(2), column_val )
+ && SQL_ISPUNCTUATION( pColumnRef->getChild(2)->getChild(0), "*" )
+ )
+ )
+ {
+ // push one element for each column of our table
+ const Reference< XNameAccess > xColumnNames( m_aCompiler->getOrigColumns() );
+ const Sequence< ::rtl::OUString > aColumnNames( xColumnNames->getElementNames() );
+ for ( sal_Int32 j=0; j<aColumnNames.getLength(); ++j )
+ m_aSelectionEvaluations.push_back( TPredicates() );
+ }
+ else
+ m_aSelectionEvaluations.push_back( TPredicates() );
+ }
}
}
}
@@ -291,11 +310,12 @@ void OSQLAnalyzer::setSelectionEvaluationResult(OValueRefRow& _pRow,const ::std:
{
if ( aIter->second.isValid() )
{
- sal_Int32 map = nPos;
// the first column (index 0) is for convenience only. The first real select column is no 1.
- if ( (nPos > 0) && (nPos < static_cast<sal_Int32>(_rColumnMapping.size())) )
+ sal_Int32 map = nPos;
+ if ( nPos < static_cast< sal_Int32 >( _rColumnMapping.size() ) )
map = _rColumnMapping[nPos];
- aIter->second->startSelection((_pRow->get())[map]);
+ if ( map > 0 )
+ aIter->second->startSelection( (_pRow->get())[map] );
}
}
}
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 14758afafb3f..a0b755c107c9 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -273,22 +273,38 @@ namespace connectivity
if ( pStream.get() )
{
ByteString sLine;
+ ByteString sVersionString;
while ( pStream->ReadLine(sLine) )
{
- if ( sLine.Equals("version=",0,sizeof("version=")-1) )
+ if ( sLine.Len() == 0 )
+ continue;
+ const ByteString sIniKey = sLine.GetToken( 0, '=' );
+ const ByteString sValue = sLine.GetToken( 1, '=' );
+ if ( sIniKey.Equals( "hsqldb.compatible_version" ) )
{
- sLine = sLine.GetToken(1,'=');
- const sal_Int32 nMajor = sLine.GetToken(0,'.').ToInt32();
- const sal_Int32 nMinor = sLine.GetToken(1,'.').ToInt32();
- const sal_Int32 nMicro = sLine.GetToken(2,'.').ToInt32();
- if ( nMajor > 1
- || ( nMajor == 1 && nMinor > 8 )
- || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
+ sVersionString = sValue;
+ }
+ else
+ {
+ if ( sIniKey.Equals( "version" )
+ && ( sVersionString.Len() == 0 )
+ )
{
- ::connectivity::SharedResources aResources;
- sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
+ sVersionString = sValue;
}
- break;
+ }
+ }
+ if ( sVersionString.Len() )
+ {
+ const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
+ const sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
+ const sal_Int32 nMicro = sVersionString.GetToken(2,'.').ToInt32();
+ if ( nMajor > 1
+ || ( nMajor == 1 && nMinor > 8 )
+ || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
+ {
+ ::connectivity::SharedResources aResources;
+ sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
}
}
}
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
index a5d3211fecab..90ba51c29d4d 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
@@ -51,14 +51,6 @@ using namespace ::com::sun::star::mozilla;
namespace
{
- #if defined(XP_MAC) || defined(XP_MACOSX) || defined(MACOSX)
- #define APP_REGISTRY_NAME "Application Registry"
- #elif defined(XP_WIN) || defined(XP_OS2)
- #define APP_REGISTRY_NAME "registry.dat"
- #else
- #define APP_REGISTRY_NAME "appreg"
- #endif
-
// -------------------------------------------------------------------
static ::rtl::OUString lcl_getUserDataDirectory()
{
@@ -73,15 +65,15 @@ namespace
static const char* DefaultProductDir[3][3] =
{
#if defined(XP_WIN)
- { "Mozilla/", NULL, NULL },
+ { "Mozilla/SeaMonkey/", NULL, NULL },
{ "Mozilla/Firefox/", NULL, NULL },
{ "Thunderbird/", "Mozilla/Thunderbird/", NULL }
#elif(MACOSX)
- { "../Mozilla/", NULL, NULL },
+ { "../Mozilla/SeaMonkey/", NULL, NULL },
{ "Firefox/", NULL, NULL },
{ "../Thunderbird/", NULL, NULL }
#else
- { ".mozilla/", NULL, NULL },
+ { ".mozilla/seamonkey/", NULL, NULL },
{ ".mozilla/firefox/", NULL, NULL },
{ ".thunderbird/", ".mozilla-thunderbird/", ".mozilla/thunderbird/" }
#endif
@@ -115,7 +107,7 @@ namespace
else
{
::rtl::OUString sProductDirCandidate;
- const char* pProfileRegistry = ( _product == MozillaProductType_Mozilla ) ? APP_REGISTRY_NAME : "profiles.ini";
+ const char* pProfileRegistry = "profiles.ini";
// check all possible candidates
for ( size_t i=0; i<3; ++i )
@@ -159,13 +151,3 @@ namespace
return lcl_guessProfileRoot( product );
}
-#ifndef MINIMAL_PROFILEDISCOVER
-// -----------------------------------------------------------------------
-::rtl::OUString getRegistryFileName(MozillaProductType product)
-{
- if (product == MozillaProductType_Default)
- return ::rtl::OUString();
-
- return getRegistryDir(product) + ::rtl::OUString::createFromAscii(APP_REGISTRY_NAME);
-}
-#endif
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx
index d69a5e3435bf..c12894d30684 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx
@@ -38,9 +38,6 @@
#include <rtl/ustring.hxx>
::rtl::OUString getRegistryDir(::com::sun::star::mozilla::MozillaProductType product);
-#ifndef MINIMAL_PROFILEDISCOVER
-::rtl::OUString getRegistryFileName(::com::sun::star::mozilla::MozillaProductType product);
-#endif
#endif
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index aa20fb04a089..a9cd5c62fe0b 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -144,11 +144,8 @@ namespace connectivity
sal_Int32 ProfileAccess::LoadProductsInfo()
{
-#ifndef MINIMAL_PROFILEDISCOVER
- //load mozilla profiles to m_ProductProfileList
- LoadMozillaProfiles();
-#endif
- sal_Int32 count=static_cast<sal_Int32>(m_ProductProfileList[MozillaProductType_Mozilla].mProfileList.size());
+ //load SeaMonkey 2 profiles to m_ProductProfileList
+ sal_Int32 count = LoadXPToolkitProfiles(MozillaProductType_Mozilla);
//load thunderbird profiles to m_ProductProfileList
count += LoadXPToolkitProfiles(MozillaProductType_Thunderbird);
@@ -158,117 +155,6 @@ namespace connectivity
count += LoadXPToolkitProfiles(MozillaProductType_Firefox);
return count;
}
-#ifndef MINIMAL_PROFILEDISCOVER
- nsresult ProfileAccess::LoadMozillaProfiles()
- {
- sal_Int32 index=MozillaProductType_Mozilla;
- ProductStruct &m_Product = m_ProductProfileList[index];
- nsresult rv = NS_OK;
-
- //step 1 : get mozilla registry file
- nsCOMPtr<nsILocalFile> localFile;
- ::rtl::OUString regDir( getRegistryFileName( MozillaProductType_Mozilla ) );
- // PRUnichar != sal_Unicode in mingw
- nsAutoString registryDir(reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()));
- rv = NS_NewLocalFile(registryDir, PR_TRUE,
- getter_AddRefs(localFile));
- NS_ENSURE_SUCCESS(rv,rv);
- PRBool bExist;
- rv = localFile->Exists(&bExist);
- NS_ENSURE_SUCCESS(rv,rv);
- if (!bExist)
- return rv;
- nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
- NS_ENSURE_SUCCESS(rv,rv);
- //step 2: open mozilla registry file
- rv = registry->Open(localFile);
- NS_ENSURE_SUCCESS(rv,rv);
-
- nsCOMPtr<nsIEnumerator> enumKeys;
- nsRegistryKey profilesTreeKey;
-
- //step 3:Enumerator it
- rv = registry->GetKey(nsIRegistry::Common,
- // PRUnichar != sal_Unicode in mingw
- reinterpret_cast_mingw_only<const PRUnichar *>(szProfileSubtreeString.getStr()),
- &profilesTreeKey);
- if (NS_FAILED(rv)) return rv;
-
- nsXPIDLString tmpCurrentProfile;
-
- // Get the current profile
- rv = registry->GetString(profilesTreeKey,
- // PRUnichar != sal_Unicode in mingw
- reinterpret_cast_mingw_only<const PRUnichar *>(szCurrentProfileString.getStr()),
- getter_Copies(tmpCurrentProfile));
-
- if (tmpCurrentProfile)
- {
- // PRUnichar != sal_Unicode in mingw
- m_Product.setCurrentProfile ( reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile)));
- }
-
-
- rv = registry->EnumerateSubtrees( profilesTreeKey, getter_AddRefs(enumKeys));
- NS_ENSURE_SUCCESS(rv,rv);
-
- rv = enumKeys->First();
- NS_ENSURE_SUCCESS(rv,rv);
-
- while (NS_OK != enumKeys->IsDone())
- {
- nsCOMPtr<nsISupports> base;
-
- rv = enumKeys->CurrentItem( getter_AddRefs(base) );
- NS_ENSURE_SUCCESS(rv,rv);
- rv = enumKeys->Next();
- NS_ENSURE_SUCCESS(rv,rv);
-
- // Get specific interface.
- nsCOMPtr <nsIRegistryNode> node;
- nsIID nodeIID = NS_IREGISTRYNODE_IID;
-
- rv = base->QueryInterface( nodeIID, getter_AddRefs(node));
- if (NS_FAILED(rv)) continue;
-
- // Get node name.
- nsXPIDLString profile;
- rv = node->GetName(getter_Copies(profile));
- if (NS_FAILED(rv)) continue;
-
- nsRegistryKey profKey;
- rv = node->GetKey(&profKey);
- if (NS_FAILED(rv)) continue;
-
-
- nsCOMPtr<nsILocalFile> tempLocal;
-
- nsXPIDLString regData;
- rv = registry->GetString(profKey,
- // PRUnichar != sal_Unicode in mingw
- reinterpret_cast_mingw_only<const PRUnichar *>(szDirectoryString.getStr()),
- getter_Copies(regData));
- if (NS_FAILED(rv)) continue;
-
-#if defined(XP_MAC) || defined(XP_MACOSX) || defined(MACOSX)
- rv = NS_NewNativeLocalFile(nsCString(), PR_TRUE, getter_AddRefs(tempLocal));
- if (NS_SUCCEEDED(rv))
- rv = tempLocal->SetPersistentDescriptor(NS_LossyConvertUCS2toASCII(regData));
-#else
- rv = NS_NewLocalFile(regData, PR_TRUE, getter_AddRefs(tempLocal));
-#endif
- //Add found profile to profile lists
- if (NS_SUCCEEDED(rv) && tempLocal)
- {
- // PRUnichar != sal_Unicode in mingw
- ProfileStruct* profileItem = new ProfileStruct(MozillaProductType_Mozilla,reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, profile)),tempLocal);
- m_Product.mProfileList[profileItem->getProfileName()] = profileItem;
- }
-
- }
- return rv;
- }
-#endif
//Thunderbird and firefox profiles are saved in profiles.ini
sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
{
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
index 9358cd65e650..6c88f04b1cf8 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
@@ -116,9 +116,6 @@ namespace connectivity
protected:
ProductStruct m_ProductProfileList[4];
sal_Int32 LoadProductsInfo();
-#ifndef MINIMAL_PROFILEDISCOVER
- nsresult LoadMozillaProfiles();
-#endif
sal_Int32 LoadXPToolkitProfiles(MozillaProductType product);
#ifndef MINIMAL_PROFILEDISCOVER
//used by isProfileLocked
diff --git a/connectivity/source/drivers/mozab/mozab.xcu b/connectivity/source/drivers/mozab/mozab.xcu
index c92209e09e5a..fa732d6257ae 100755
--- a/connectivity/source/drivers/mozab/mozab.xcu
+++ b/connectivity/source/drivers/mozab/mozab.xcu
@@ -62,7 +62,7 @@
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Mozilla Address Book</value>
+ <value xml:lang="en-US">SeaMonkey Address Book</value>
</prop>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
diff --git a/connectivity/source/drivers/mozab/mozab2.xcu b/connectivity/source/drivers/mozab/mozab2.xcu
index e7c24143f5a1..d1a620dc73d0 100755
--- a/connectivity/source/drivers/mozab/mozab2.xcu
+++ b/connectivity/source/drivers/mozab/mozab2.xcu
@@ -32,7 +32,7 @@
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Mozilla Address Book</value>
+ <value xml:lang="en-US">SeaMonkey Address Book</value>
</prop>
<node oor:name="MetaData">
<node oor:name="SupportsBrowsing" oor:op="replace">
diff --git a/connectivity/source/inc/file/fcomp.hxx b/connectivity/source/inc/file/fcomp.hxx
index b46d24ddd089..7cbdb730258a 100644
--- a/connectivity/source/inc/file/fcomp.hxx
+++ b/connectivity/source/inc/file/fcomp.hxx
@@ -109,7 +109,7 @@ namespace connectivity
inline void startSelection(ORowSetValueDecoratorRef& _rVal)
{
- return evaluateSelection(m_rCompiler->m_aCodeList,_rVal);
+ evaluateSelection(m_rCompiler->m_aCodeList,_rVal);
}
diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx
index 780a27f31503..0b8bb43d7e3e 100644
--- a/cppcanvas/inc/cppcanvas/renderer.hxx
+++ b/cppcanvas/inc/cppcanvas/renderer.hxx
@@ -32,7 +32,7 @@
#include <rtl/ustring.hxx>
#include <boost/shared_ptr.hpp>
-#include <comphelper/optionalvalue.hxx>
+#include <boost/optional.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <cppcanvas/canvasgraphic.hxx>
#include <cppcanvas/color.hxx>
@@ -109,16 +109,16 @@ namespace cppcanvas
struct Parameters
{
/// Optionally forces the fill color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maFillColor;
+ ::boost::optional< Color::IntSRGBA > maFillColor;
/// Optionally forces the line color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maLineColor;
+ ::boost::optional< Color::IntSRGBA > maLineColor;
/// Optionally forces the text color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maTextColor;
+ ::boost::optional< Color::IntSRGBA > maTextColor;
/// Optionally forces the given fontname for all text actions
- ::comphelper::OptionalValue< ::rtl::OUString > maFontName;
+ ::boost::optional< ::rtl::OUString > maFontName;
/** Optionally transforms all text output actions with the
given matrix (in addition to the overall canvas
@@ -128,16 +128,16 @@ namespace cppcanvas
rect coordinate system, i.e. the metafile is assumed
to be contained in the unit rect.
*/
- ::comphelper::OptionalValue< ::basegfx::B2DHomMatrix > maTextTransformation;
+ ::boost::optional< ::basegfx::B2DHomMatrix > maTextTransformation;
/// Optionally forces the given font weight for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontWeight;
+ ::boost::optional< sal_Int8 > maFontWeight;
/// Optionally forces the given font letter form (italics etc.) for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontLetterForm;
+ ::boost::optional< sal_Int8 > maFontLetterForm;
/// Optionally forces underlining for all text actions
- ::comphelper::OptionalValue< bool > maFontUnderline;
+ ::boost::optional< bool > maFontUnderline;
};
};
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 1423cd42ed93..006d55a01de6 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -831,8 +831,8 @@ namespace cppcanvas
{
rendering::FontRequest aFontRequest;
- if( rParms.mrParms.maFontName.isValid() )
- aFontRequest.FontDescription.FamilyName = rParms.mrParms.maFontName.getValue();
+ if( rParms.mrParms.maFontName.is_initialized() )
+ aFontRequest.FontDescription.FamilyName = *rParms.mrParms.maFontName;
else
aFontRequest.FontDescription.FamilyName = rFont.GetName();
@@ -843,12 +843,12 @@ namespace cppcanvas
// TODO(F2): improve vclenum->panose conversion
aFontRequest.FontDescription.FontDescription.Weight =
- rParms.mrParms.maFontWeight.isValid() ?
- rParms.mrParms.maFontWeight.getValue() :
+ rParms.mrParms.maFontWeight.is_initialized() ?
+ *rParms.mrParms.maFontWeight :
::canvas::tools::numeric_cast<sal_Int8>( ::basegfx::fround( rFont.GetWeight() ) );
aFontRequest.FontDescription.FontDescription.Letterform =
- rParms.mrParms.maFontLetterForm.isValid() ?
- rParms.mrParms.maFontLetterForm.getValue() :
+ rParms.mrParms.maFontLetterForm.is_initialized() ?
+ *rParms.mrParms.maFontLetterForm :
(rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
LanguageType aLang = rFont.GetLanguage();
@@ -1445,7 +1445,7 @@ namespace cppcanvas
break;
case META_LINECOLOR_ACTION:
- if( !rParms.maLineColor.isValid() )
+ if( !rParms.maLineColor.is_initialized() )
{
setStateColor( static_cast<MetaLineColorAction*>(pCurrAct),
getState( rStates ).isLineColorSet,
@@ -1455,7 +1455,7 @@ namespace cppcanvas
break;
case META_FILLCOLOR_ACTION:
- if( !rParms.maFillColor.isValid() )
+ if( !rParms.maFillColor.is_initialized() )
{
setStateColor( static_cast<MetaFillColorAction*>(pCurrAct),
getState( rStates ).isFillColorSet,
@@ -1466,7 +1466,7 @@ namespace cppcanvas
case META_TEXTCOLOR_ACTION:
{
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
// Text color is set unconditionally, thus, no
// use of setStateColor here
@@ -1486,7 +1486,7 @@ namespace cppcanvas
break;
case META_TEXTFILLCOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextFillColorAction*>(pCurrAct),
getState( rStates ).isTextFillColorSet,
@@ -1496,7 +1496,7 @@ namespace cppcanvas
break;
case META_TEXTLINECOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextLineColorAction*>(pCurrAct),
getState( rStates ).isTextLineColorSet,
@@ -1526,8 +1526,8 @@ namespace cppcanvas
// TODO(Q2): define and use appropriate enumeration types
rState.textReliefStyle = (sal_Int8)rFont.GetRelief();
rState.textOverlineStyle = (sal_Int8)rFont.GetOverline();
- rState.textUnderlineStyle = rParms.maFontUnderline.isValid() ?
- (rParms.maFontUnderline.getValue() ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
+ rState.textUnderlineStyle = rParms.maFontUnderline.is_initialized() ?
+ (*rParms.maFontUnderline ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
(sal_Int8)rFont.GetUnderline();
rState.textStrikeoutStyle = (sal_Int8)rFont.GetStrikeout();
rState.textEmphasisMarkStyle = (sal_Int8)rFont.GetEmphasisMark();
@@ -2946,28 +2946,28 @@ namespace cppcanvas
getState( aStateStack ).textLineColor = pColor->getDeviceColor( 0x000000FF );
// apply overrides from the Parameters struct
- if( rParams.maFillColor.isValid() )
+ if( rParams.maFillColor.is_initialized() )
{
getState( aStateStack ).isFillColorSet = true;
- getState( aStateStack ).fillColor = pColor->getDeviceColor( rParams.maFillColor.getValue() );
+ getState( aStateStack ).fillColor = pColor->getDeviceColor( *rParams.maFillColor );
}
- if( rParams.maLineColor.isValid() )
+ if( rParams.maLineColor.is_initialized() )
{
getState( aStateStack ).isLineColorSet = true;
- getState( aStateStack ).lineColor = pColor->getDeviceColor( rParams.maLineColor.getValue() );
+ getState( aStateStack ).lineColor = pColor->getDeviceColor( *rParams.maLineColor );
}
- if( rParams.maTextColor.isValid() )
+ if( rParams.maTextColor.is_initialized() )
{
getState( aStateStack ).isTextFillColorSet = true;
getState( aStateStack ).isTextLineColorSet = true;
getState( aStateStack ).textColor =
getState( aStateStack ).textFillColor =
- getState( aStateStack ).textLineColor = pColor->getDeviceColor( rParams.maTextColor.getValue() );
+ getState( aStateStack ).textLineColor = pColor->getDeviceColor( *rParams.maTextColor );
}
- if( rParams.maFontName.isValid() ||
- rParams.maFontWeight.isValid() ||
- rParams.maFontLetterForm.isValid() ||
- rParams.maFontUnderline.isValid() )
+ if( rParams.maFontName.is_initialized() ||
+ rParams.maFontWeight.is_initialized() ||
+ rParams.maFontLetterForm.is_initialized() ||
+ rParams.maFontUnderline.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index bc4cf6688ca3..56ce197b7e8e 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -2069,7 +2069,7 @@ namespace cppcanvas
rCanvas->getUNOCanvas()->getDevice(),
aResultingPolyPolygon ) );
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr(
new OutlineAction(
@@ -2085,7 +2085,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2186,7 +2186,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr( new TextAction(
aStartPoint,
@@ -2195,7 +2195,7 @@ namespace cppcanvas
nLen,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2211,7 +2211,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
aReliefOffset,
@@ -2224,7 +2224,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
@@ -2250,7 +2250,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
rText,
@@ -2259,7 +2259,7 @@ namespace cppcanvas
aCharWidths,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
@@ -2273,7 +2273,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
aReliefOffset,
@@ -2287,7 +2287,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx
index 6029505fe4ee..333a350c0b23 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -98,6 +98,10 @@ namespace cppu_threadpool {
if( 0 == m_lstCallstack.front() )
{
// disposed !
+ if( m_lstJob.empty() )
+ {
+ osl_resetCondition( m_cndWait );
+ }
break;
}
diff --git a/cppuhelper/inc/cppuhelper/propshlp.hxx b/cppuhelper/inc/cppuhelper/propshlp.hxx
index 98103e58185b..82bbd2bdcdbe 100644
--- a/cppuhelper/inc/cppuhelper/propshlp.hxx
+++ b/cppuhelper/inc/cppuhelper/propshlp.hxx
@@ -595,6 +595,29 @@ protected:
::com::sun::star::uno::Any& rValue,
sal_Int32 nHandle ) const = 0;
+ /** sets an dependent property's value
+
+ <p>Sometimes setting a given property needs to implicitly modify another property's value. Calling |setPropertyValue|
+ from within |setFastPropertyValue_NoBroadcast| is not an option here, as it would notify the property listeners
+ while our mutex is still locked. Setting the dependent property's value directly (e.g. by calling |setFastPropertyValue_NoBroadcast|
+ recursively) is not an option, too, since it would miss firing the property change event.</p>
+
+ <p>So, in such cases, you use |setDependentFastPropertyValue| from within |setFastPropertyValue_NoBroadcast|.
+ It will convert and actually set the property value (invoking |convertFastPropertyValue| and |setFastPropertyValue_NoBroadcast|
+ for the given handle and value), and add the property change event to the list of events to be notified
+ when the bottom-most |setFastPropertyValue_NoBroadcast| on the stack returns.</p>
+
+ <p><strong>Note</strong>: The method will <em>not</em> invoke veto listeners for the property.</p>
+
+ <p><strong>Note</strong>: It's the caller's responsibility to ensure that our mutex is locked. This is
+ canonically given when the method is invoked from within |setFastPropertyValue_NoBroadcast|, in other
+ contexts, you might need to take own measures.</p>
+ */
+ void setDependentFastPropertyValue(
+ sal_Int32 i_handle,
+ const ::com::sun::star::uno::Any& i_value
+ );
+
/** The common data of a broadcaster. Use the mutex, disposing state and the listener container. */
OBroadcastHelper &rBHelper;
/**
@@ -610,12 +633,22 @@ protected:
/** reserved for future use. finally, the future has arrived...
*/
- const std::auto_ptr<const Impl> m_pReserved;
+ const std::auto_ptr<Impl> m_pReserved;
private:
OPropertySetHelper( const OPropertySetHelper & ) SAL_THROW( () );
OPropertySetHelper & operator = ( const OPropertySetHelper & ) SAL_THROW( () );
+ /** notifies the given changes in property's values, <em>plus</em> all property changes collected during recent
+ |setDependentFastPropertyValue| calls.
+ */
+ void impl_fireAll(
+ sal_Int32* i_handles,
+ const ::com::sun::star::uno::Any * i_newValues,
+ const ::com::sun::star::uno::Any * i_oldValues,
+ sal_Int32 i_count
+ );
+
public:
// Suppress warning about virtual functions but non-virtual destructor:
#if defined __GNUC__
diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map
index d43ea690e11a..5dd703cf9fc9 100755
--- a/cppuhelper/source/cc5_solaris_sparc.map
+++ b/cppuhelper/source/cc5_solaris_sparc.map
@@ -387,3 +387,9 @@ UDK_3.7 { # OOo 3.3
__1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_;
__1cEcppubHcreateOneInstanceComponentFactory6FpFrknDcomDsunEstarDunoJReference4n0ERXComponentContext____n0EJReference4n0EKXInterface___rknDrtlIOUString_rkn0EISequence4n0K___pnQ_rtl_ModuleCount__n0EJReference4n0DElangXXSingleComponentFactory____;
} UDK_3.6;
+
+UDK_3.8 { # OOo 3.4
+ global:
+ __1cEcppuSOPropertySetHelperbDsetDependentFastPropertyValue6MlrknDcomDsunEstarDunoDAny__v_;
+} UDK_3.7;
+
diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 59ab83e34e82..eef6053b7595 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -382,3 +382,10 @@ UDK_3.6 { # OOo 3.3
_ZN4cppu33createOneInstanceComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount;
} UDK_3.5;
+
+UDK_3.7 { # OOo 3.4
+ global:
+ _ZN4cppu18OPropertySetHelper29setDependentFastPropertyValueElRKN3com3sun4star3uno3AnyE;
+ _ZN4cppu18OPropertySetHelper29setDependentFastPropertyValueEiRKN3com3sun4star3uno3AnyE;
+} UDK_3.6;
+
diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map
index 6d5a491ab925..7069276e2baa 100644
--- a/cppuhelper/source/msvc_win32_intel.map
+++ b/cppuhelper/source/msvc_win32_intel.map
@@ -278,3 +278,9 @@ UDK_3.6 { # OOo 3.3
?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ;
?createOneInstanceComponentFactory@cppu@@YA?AV?$Reference@VXSingleComponentFactory@lang@star@sun@com@@@uno@star@sun@com@@P6A?AV?$Reference@VXInterface@uno@star@sun@com@@@3456@ABV?$Reference@VXComponentContext@uno@star@sun@com@@@3456@@ZABVOUString@rtl@@ABV?$Sequence@VOUString@rtl@@@3456@PAU_rtl_ModuleCount@@@Z;
} UDK_3.5;
+
+UDK_3.7 { # OOo 3.4
+ global:
+ ?setDependentFastPropertyValue@OPropertySetHelper@cppu@@IAEXJABVAny@uno@star@sun@com@@@Z;
+} UDK_3.6;
+
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index fe455781a1a7..e43f93272e16 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -32,6 +32,7 @@
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/weak.hxx"
#include "cppuhelper/propshlp.hxx"
+#include "cppuhelper/exc_hlp.hxx"
#include "com/sun/star/beans/PropertyAttribute.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
@@ -144,15 +145,20 @@ sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & Proper
class OPropertySetHelper::Impl {
public:
- Impl ( bool i_bIgnoreRuntimeExceptionsWhileFiring,
- IEventNotificationHook *i_pFireEvents)
- : m_bIgnoreRuntimeExceptionsWhileFiring(
- i_bIgnoreRuntimeExceptionsWhileFiring ),
- m_pFireEvents( i_pFireEvents )
- { }
+ Impl( bool i_bIgnoreRuntimeExceptionsWhileFiring,
+ IEventNotificationHook *i_pFireEvents
+ )
+ :m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring )
+ ,m_pFireEvents( i_pFireEvents )
+ {
+ }
bool m_bIgnoreRuntimeExceptionsWhileFiring;
class IEventNotificationHook * const m_pFireEvents;
+
+ ::std::vector< sal_Int32 > m_handles;
+ ::std::vector< Any > m_newValues;
+ ::std::vector< Any > m_oldValues;
};
@@ -432,6 +438,57 @@ void OPropertySetHelper::removeVetoableChangeListener(
}
}
+void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, const ::com::sun::star::uno::Any& i_value )
+{
+ //OSL_PRECOND( rBHelper.rMutex.isAcquired(), "OPropertySetHelper::setDependentFastPropertyValue: to be called with a locked mutex only!" );
+ // there is no such thing as Mutex.isAcquired, sadly ...
+
+ sal_Int16 nAttributes(0);
+ IPropertyArrayHelper& rInfo = getInfoHelper();
+ if ( !rInfo.fillPropertyMembersByHandle( NULL, &nAttributes, i_handle ) )
+ // unknown property
+ throw UnknownPropertyException();
+
+ // no need to check for READONLY-ness of the property. The method is intended to be called internally, which
+ // implies it might be invoked for properties which are read-only to the instance's clients, but well allowed
+ // to change their value.
+
+ Any aConverted, aOld;
+ sal_Bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value );
+ if ( !bChanged )
+ return;
+
+ // don't fire vetoable events. This method is called with our mutex locked, so calling into listeners would not be
+ // a good idea. The caler is responsible for not invoking this for constrained properties.
+ OSL_ENSURE( ( nAttributes & PropertyAttribute::CONSTRAINED ) == 0,
+ "OPropertySetHelper::setDependentFastPropertyValue: not to be used for constrained properties!" );
+ (void)nAttributes;
+
+ // actually set the new value
+ try
+ {
+ setFastPropertyValue_NoBroadcast( i_handle, aConverted );
+ }
+ catch (const UnknownPropertyException& ) { throw; /* allowed to leave */ }
+ catch (const PropertyVetoException& ) { throw; /* allowed to leave */ }
+ catch (const IllegalArgumentException& ) { throw; /* allowed to leave */ }
+ catch (const WrappedTargetException& ) { throw; /* allowed to leave */ }
+ catch (const RuntimeException& ) { throw; /* allowed to leave */ }
+ catch (const Exception& )
+ {
+ // not allowed to leave this meathod
+ WrappedTargetException aWrapped;
+ aWrapped.TargetException <<= ::cppu::getCaughtException();
+ aWrapped.Context = static_cast< XPropertySet* >( this );
+ throw aWrapped;
+ }
+
+ // remember the handle/values, for the events to be fired later
+ m_pReserved->m_handles.push_back( i_handle );
+ m_pReserved->m_newValues.push_back( aConverted ); // TODO: setFastPropertyValue notifies the unconverted value here ...?
+ m_pReserved->m_oldValues.push_back( aOld );
+}
+
// XFastPropertySet
void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue )
throw(::com::sun::star::beans::UnknownPropertyException,
@@ -498,7 +555,7 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa
// release guard to fire events
}
// file a change event, if the value changed
- fire( &nHandle, &rValue, &aOldVal, 1, sal_False );
+ impl_fireAll( &nHandle, &rValue, &aOldVal, 1 );
}
}
@@ -521,6 +578,42 @@ Any OPropertySetHelper::getFastPropertyValue( sal_Int32 nHandle )
}
//--------------------------------------------------------------------------
+void OPropertySetHelper::impl_fireAll( sal_Int32* i_handles, const Any* i_newValues, const Any* i_oldValues, sal_Int32 i_count )
+{
+ ClearableMutexGuard aGuard( rBHelper.rMutex );
+ if ( m_pReserved->m_handles.empty() )
+ {
+ aGuard.clear();
+ fire( i_handles, i_newValues, i_oldValues, i_count, sal_False );
+ return;
+ }
+
+ const size_t additionalEvents = m_pReserved->m_handles.size();
+ OSL_ENSURE( additionalEvents == m_pReserved->m_newValues.size()
+ && additionalEvents == m_pReserved->m_oldValues.size(),
+ "OPropertySetHelper::impl_fireAll: inconsistency!" );
+
+ ::std::vector< sal_Int32 > allHandles( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_handles.begin(), m_pReserved->m_handles.end(), allHandles.begin() );
+ ::std::copy( i_handles, i_handles + i_count, allHandles.begin() + additionalEvents );
+
+ ::std::vector< Any > allNewValues( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_newValues.begin(), m_pReserved->m_newValues.end(), allNewValues.begin() );
+ ::std::copy( i_newValues, i_newValues + i_count, allNewValues.begin() + additionalEvents );
+
+ ::std::vector< Any > allOldValues( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_oldValues.begin(), m_pReserved->m_oldValues.end(), allOldValues.begin() );
+ ::std::copy( i_oldValues, i_oldValues + i_count, allOldValues.begin() + additionalEvents );
+
+ m_pReserved->m_handles.clear();
+ m_pReserved->m_newValues.clear();
+ m_pReserved->m_oldValues.clear();
+
+ aGuard.clear();
+ fire( &allHandles[0], &allNewValues[0], &allOldValues[0], additionalEvents + i_count, sal_False );
+}
+
+//--------------------------------------------------------------------------
void OPropertySetHelper::fire
(
sal_Int32 * pnHandles,
@@ -803,7 +896,7 @@ void OPropertySetHelper::setFastPropertyValues(
}
// fire change events
- fire( pHandles, pConvertedValues, pOldValues, n, sal_False );
+ impl_fireAll( pHandles, pConvertedValues, pOldValues, n );
}
catch( ... )
{
diff --git a/crashrep/source/win32/soreport.cpp b/crashrep/source/win32/soreport.cpp
index f3d19ca98790..abca528dc987 100755
--- a/crashrep/source/win32/soreport.cpp
+++ b/crashrep/source/win32/soreport.cpp
@@ -1847,7 +1847,7 @@ bool WriteChecksumFile( FILE *fchksum, const hash_map< string, string >& rLibrar
for ( int i = 0; i < sizeof(checksum); fprintf( fchksum, "%02X", checksum[i++] ) );
fprintf( fchksum, "\" bytes=\"%d\" file=\"%s\"/>\n",
nBytesProcessed,
- GetFileName( iter->first ) );
+ GetFileName( iter->first ).c_str() );
}
}
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index c0869ce94f30..e074c0a19ff5 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -744,7 +744,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt
aModuleButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
// initialize Entriesbox
- aEntriesBox.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN);
+ aEntriesBox.SetStyle(aEntriesBox.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
aEntriesBox.SetSelectionMode(SINGLE_SELECTION);
aEntriesBox.SetTabs(&AccCfgTabs[0], MAP_APPFONT);
aEntriesBox.Resize(); // OS: Hack for right selection
@@ -768,7 +768,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt
pGroupLBox->SetFunctionListBox(pFunctionBox);
// initialize KeyBox
- aKeyBox.SetWindowBits(WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT);
+ aKeyBox.SetStyle(aKeyBox.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT);
}
//-----------------------------------------------
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index a2ee0d977f67..858564af4e40 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1465,7 +1465,7 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox(
, pPage( (SvxMenuConfigPage*) pParent )
, m_bIsInternalDrag( FALSE )
{
- SetWindowBits(
+ SetStyle(
GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HIDESELECTION );
SetSpaceBetweenEntries( 3 );
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index da294a4526b0..b85ec24adee2 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -287,7 +287,7 @@ SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, c
, pCurEntry( 0 )
, pStylesInfo( 0 )
{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
GetModel()->SetSortMode( SortAscending );
// Timer f"ur die BallonHelp
@@ -488,7 +488,7 @@ SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl(
: SvTreeListBox( pParent, rResId )
, pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), bShowSF( FALSE ), bShowBasic( TRUE ), pStylesInfo(0)
{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage, BMP_COLOR_NORMAL );
SetNodeBitmaps( pImp->m_collapsedImage_hc, pImp->m_expandedImage_hc, BMP_COLOR_HIGHCONTRAST );
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 833dc0f32c82..3defe910f5a5 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -90,7 +90,7 @@ SvxConfigFunctionListBox_Impl::SvxConfigFunctionListBox_Impl( Window* pParent, c
, pCurEntry( 0 )
, m_pDraggingEntry( 0 )
{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
GetModel()->SetSortMode( SortAscending );
// Timer f"ur die BallonHelp
@@ -226,7 +226,7 @@ SvxConfigGroupListBox_Impl::SvxConfigGroupListBox_Impl(
m_xFrame.set( xFrame );
}
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 32e62d3e7f80..169c88aebe71 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1158,7 +1158,7 @@ namespace svx
,m_pCheckButtonData ( NULL )
,m_xConversionDictionaryList( NULL )
{
- m_aDictsLB.SetWindowBits( WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
+ m_aDictsLB.SetStyle( m_aDictsLB.GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
m_aDictsLB.SetSelectionMode( SINGLE_SELECTION );
m_aDictsLB.SetHighlightRange();
// m_aDictsLB.SetHelpId( xxx );
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index e7f40766d836..5d29e652a7d2 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -145,9 +145,9 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
maLbTree.SetDoubleClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) );
// Tree-ListBox mit Linien versehen
- maLbTree.SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES |
+ maLbTree.SetStyle( maLbTree.GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
WB_HASBUTTONS | //WB_HASLINESATROOT |
- WB_HSCROLL | WB_HASBUTTONSATROOT ) );
+ WB_HSCROLL | WB_HASBUTTONSATROOT );
}
SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 62ec77c3c26a..139ef0071d37 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -99,7 +99,7 @@ SFTreeListBox::SFTreeListBox( Window* pParent, const ResId& rResId ) :
FreeResource();
SetSelectionMode( SINGLE_SELECTION );
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HIDESELECTION |
WB_HASLINES | WB_HASLINESATROOT );
SetNodeDefaultImages();
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index dafec167af2c..6c670fc08e69 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -151,7 +151,7 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent,
{
FreeResource();
- aAttrLB.SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
+ aAttrLB.SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
aAttrLB.GetModel()->SetSortMode( SortAscending );
aOKBtn.SetClickHdl( LINK( this, SvxSearchAttributeDialog, OKHdl ) );
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index c1811b196895..5ad431567a72 100755
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -180,7 +180,7 @@ ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl(
SvxCheckListBox( pParent, CUI_RES( CT_THES_ALTERNATIVES ) ),
m_rDialogImpl( rImpl )
{
- SetWindowBits( WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
+ SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
SetHighlightRange();
}
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 7bfc72d1181e..cc199054d131 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -159,7 +159,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
Size aHeadSize = pHeaderBar->GetSizePixel();
aPathCtrl.SetFocusControl( pPathBox );
- pPathBox->SetWindowBits( nBits );
+ pPathBox->SetStyle( pPathBox->GetStyle()|nBits );
pPathBox->SetDoubleClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
pPathBox->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) );
pPathBox->SetSelectionMode( SINGLE_SELECTION );
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 36e43a88ecce..749b92ed54cc 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -98,7 +98,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent,
aNewDelTBX.SetPosPixel( aNewPnt );
aCheckLB.SetHelpId(HID_OFA_FONT_SUBST_CLB);
- aCheckLB.SetWindowBits(aCheckLB.GetStyle()|WB_HSCROLL|WB_VSCROLL);
+ aCheckLB.SetStyle(aCheckLB.GetStyle()|WB_HSCROLL|WB_VSCROLL);
aCheckLB.SetSelectionMode(MULTIPLE_SELECTION);
aCheckLB.SortByCol(2);
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index c9ee53ca13fb..7867c5de68b0 100755
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -256,7 +256,7 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
aWordsLB.SetTabs(nStaticTabs);
//! we use an algorithm of our own to insert elements sorted
- aWordsLB.SetWindowBits(/*WB_SORT|*/WB_HSCROLL|WB_CLIPCHILDREN);
+ aWordsLB.SetStyle(aWordsLB.GetStyle()|/*WB_SORT|*/WB_HSCROLL|WB_CLIPCHILDREN);
nWidth=aWordED.GetSizePixel().Width();
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 637230587e6b..811a421223e9 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -165,7 +165,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( Window* pParent,
HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED );
aCheckLB.SetHelpId( HID_OFAPAGE_MSFLTR2_CLB );
- aCheckLB.SetWindowBits( WB_HSCROLL| WB_VSCROLL );
+ aCheckLB.SetStyle( aCheckLB.GetStyle()|WB_HSCROLL| WB_VSCROLL );
}
OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index f5bfd351ae45..dd7f3ddb840f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1140,7 +1140,7 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
{
pCheckButtonData = NULL;
- aLinguModulesCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
+ aLinguModulesCLB.SetStyle( aLinguModulesCLB.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
aLinguModulesCLB.SetHelpId(HID_CLB_LINGU_MODULES );
aLinguModulesCLB.SetHighlightRange();
aLinguModulesCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
@@ -1150,7 +1150,7 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
aLinguModulesEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
aLinguOptionsEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
- aLinguDicsCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
+ aLinguDicsCLB.SetStyle( aLinguDicsCLB.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
aLinguDicsCLB.SetHelpId(HID_CLB_EDIT_MODULES_DICS );
aLinguDicsCLB.SetHighlightRange();
aLinguDicsCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
@@ -1160,7 +1160,7 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
aLinguDicsEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
aLinguDicsDelPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
- aLinguOptionsCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
+ aLinguOptionsCLB.SetStyle( aLinguOptionsCLB.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
aLinguOptionsCLB.SetHelpId(HID_CLB_LINGU_OPTIONS );
aLinguOptionsCLB.SetHighlightRange();
aLinguOptionsCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
@@ -2050,7 +2050,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData)
pDefaultLinguData = new SvxLinguData_Impl( rLinguData );
- aModulesCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
+ aModulesCLB.SetStyle( aModulesCLB.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
aModulesCLB.SetHighlightRange();
aModulesCLB.SetHelpId(HID_CLB_EDIT_MODULES_MODULES );
aModulesCLB.SetSelectHdl( LINK( this, SvxEditModulesDlg, SelectHdl_Impl ));
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index d4997cc6f4f9..3a7bb6328bdf 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -253,7 +253,6 @@ SvxPathTabPage::SvxPathTabPage( Window* pParent, const SfxItemSet& rSet ) :
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
pPathBox = new svx::OptHeaderTabListBox( &aPathCtrl, nBits );
aPathCtrl.SetFocusControl( pPathBox );
- pPathBox->SetWindowBits( nBits );
pPathBox->SetDoubleClickHdl( aLink );
pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
pPathBox->SetSelectionMode( MULTIPLE_SELECTION );
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 581ab33ad467..ee82e89b93b3 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -891,9 +891,9 @@ void OfaTreeOptionsDialog::InitTreeAndHandler()
delete pIsoRes;
aTreeLB.SetHelpId( HID_OFADLG_TREELISTBOX );
- aTreeLB.SetWindowBits( WB_HASBUTTONS | WB_HASBUTTONSATROOT |
+ aTreeLB.SetStyle( aTreeLB.GetStyle()|WB_HASBUTTONS | WB_HASBUTTONSATROOT |
WB_HASLINES | WB_HASLINESATROOT |
- WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
+ WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE | WB_QUICK_SEARCH );
aTreeLB.SetSpaceBetweenEntries( 0 );
aTreeLB.SetSelectionMode( SINGLE_SELECTION );
aTreeLB.SetSublistOpenWithLeftRight( TRUE );
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index c52168fb1ab6..dc59e4ce986d 100755..100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -52,7 +52,7 @@ namespace svx
PasswordTable::PasswordTable( Window* pParent, const ResId& rResId ) :
SvxSimpleTable( pParent, rResId )
{
- SetWindowBits( GetStyle() | WB_NOINITIALSELECTION );
+ SetStyle( GetStyle() | WB_NOINITIALSELECTION );
}
void PasswordTable::InsertHeaderItem( USHORT nColumn, const String& rText, HeaderBarItemBits nBits )
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 0ee3c38c1e1d..05ec88e5aa7f 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -493,7 +493,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( Window* pParent,
SvtSysLocale aSysLcl;
aCheckLB.SetHelpId(HID_OFAPAGE_AUTOFORMAT_CLB);
- aCheckLB.SetWindowBits(WB_HSCROLL| WB_VSCROLL);
+ aCheckLB.SetStyle(aCheckLB.GetStyle()|WB_HSCROLL| WB_VSCROLL);
aCheckLB.SetSelectHdl(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl));
aCheckLB.SetDoubleClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl));
@@ -1022,7 +1022,7 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent,
static long nTabs[] = { 2 /* Tab-Count */, 1, 61 };
aReplaceTLB.SetTabs( &nTabs[0], MAP_APPFONT );
- aReplaceTLB.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN);
+ aReplaceTLB.SetStyle(aReplaceTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
aReplaceTLB.SetSelectHdl(LINK(this, OfaAutocorrReplacePage, SelectHdl));
aNewReplacePB.SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl));
aDeleteReplacePB.SetClickHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl));
@@ -2076,7 +2076,7 @@ OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
3, 0, 20, 40
};
- aSwCheckLB.SetWindowBits(WB_HSCROLL| WB_VSCROLL);
+ aSwCheckLB.SetStyle(aSwCheckLB.GetStyle() | WB_HSCROLL| WB_VSCROLL);
aSwCheckLB.SvxSimpleTable::SetTabs(aStaticTabs);
String sHeader( sHeader1 );
@@ -2647,7 +2647,7 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( Window* pParent,
FreeResource();
// some options for the list box:
- m_aSmartTagTypesLB.SetWindowBits( m_aSmartTagTypesLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
+ m_aSmartTagTypesLB.SetStyle( m_aSmartTagTypesLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
m_aSmartTagTypesLB.SetHighlightRange();
// set the handlers:
diff --git a/dbaccess/qa/complex/dbaccess/DataSource.java b/dbaccess/qa/complex/dbaccess/DataSource.java
index ce1e6db28e99..e8f8f7a41d77 100644
--- a/dbaccess/qa/complex/dbaccess/DataSource.java
+++ b/dbaccess/qa/complex/dbaccess/DataSource.java
@@ -26,6 +26,7 @@
************************************************************************/
package complex.dbaccess;
+import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
@@ -110,6 +111,9 @@ public class DataSource extends TestCase
dataSourceName = "someDataSource";
final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface(
XNamingService.class, getMSF().createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations );
+ if ( existenceCheck.hasByName( "someDataSource" ) )
+ dataSourceRegistrations.revokeObject( "someDataSource" );
dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource());
assertEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName());
}
diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src
index 1039377321d5..757c181c48cf 100644
--- a/dbaccess/source/ext/macromigration/macromigration.src
+++ b/dbaccess/source/ext/macromigration/macromigration.src
@@ -453,7 +453,7 @@ String STR_INVALID_NUMBER_ARGS
};
String STR_NO_DATABASE
{
- Text [ en-US ] = "No database document found in the initializatin arguments.";
+ Text [ en-US ] = "No database document found in the initialization arguments.";
};
String STR_NOT_READONLY
{
diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx
index 79cd4f02c8d1..d2a97b995ffc 100644
--- a/dbaccess/source/ext/macromigration/migrationlog.cxx
+++ b/dbaccess/source/ext/macromigration/migrationlog.cxx
@@ -372,7 +372,7 @@ namespace dbmm
break;
case ERR_NEW_STYLE_REPORT:
- pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Sun Report Builder (TM) extension installed.";
+ pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Oracle Report Builder (TM) extension installed.";
aAsciiParameterNames.push_back( "#doc#" );
break;
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 2a5eb22549b8..1ecac8e25604 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -891,7 +891,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons
{
WaitObject aWaitCursor(this);
- _pTreeView->SetWindowBits(WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP);
+ _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP);
_pTreeView->GetModel()->SetSortMode(SortAscending);
_pTreeView->EnableCheckButton( NULL ); // do not show any buttons
_pTreeView->SetSelectionMode(MULTIPLE_SELECTION);
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 9908134b8e1c..dbe9ad112458 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -193,7 +193,7 @@ void OCreationList::SelectSearchEntry( const void* _pEntry )
}
// -----------------------------------------------------------------------------
-void OCreationList::ExecuteSearchEntry( const void* _pEntry )
+void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
DBG_ASSERT( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" );
diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx
index 5626db6dc157..460a4d1bc399 100644
--- a/dbaccess/source/ui/app/AppDetailView.hxx
+++ b/dbaccess/source/ui/app/AppDetailView.hxx
@@ -111,7 +111,7 @@ namespace dbaui
// IMnemonicEntryList
virtual void SelectSearchEntry( const void* _pEntry );
- virtual void ExecuteSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
private:
void onSelected( SvLBoxEntry* _pEntry ) const;
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 6664a96e3ec0..bc7d5d7d6364 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -140,6 +140,8 @@ void DBTreeListBox::init()
SetNodeDefaultImages( );
EnableContextMenuHandling();
+
+ SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
//------------------------------------------------------------------------
DBTreeListBox::~DBTreeListBox()
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index b2607ebc9f98..a1a146cd7b4b 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -220,6 +220,8 @@ namespace dbaui
m_aTestJavaDriver.SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl));
FreeResource();
+
+ LayoutHelper::fitSizeRightAligned( m_aTestConnection );
}
// -----------------------------------------------------------------------
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index c340e3576f34..cfc3deda1149 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -844,6 +844,8 @@ DBG_NAME(OAuthentificationPageSetup)
m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink());
m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl));
FreeResource();
+
+ LayoutHelper::fitSizeRightAligned( m_aPBTestConnection );
}
diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx
deleted file mode 100644
index 49d4182d9ef8..000000000000
--- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx
+++ /dev/null
@@ -1,218 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "precompiled_dbaccess.hxx"
-
-#include "dbaccess_helpid.hrc"
-#include "dbu_resource.hrc"
-#include "ExtensionNotPresent.hrc"
-#include "ExtensionNotPresent.hxx"
-#include "moduledbu.hxx"
-#include "UITools.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-/** === end UNO includes === **/
-
-#include <connectivity/dbconversion.hxx>
-#include <unotools/syslocale.hxx>
-#include <svx/globlmn.hrc>
-#include <svx/svxids.hrc>
-#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
-#include <unotools/confignode.hxx>
-#include <vcl/msgbox.hxx>
-
-
-namespace dbaui
-{
-using namespace ::com::sun::star;
-using namespace ::comphelper;
-
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-DBG_NAME( dbu_OExtensionNotPresentDialog )
-//========================================================================
-// class OExtensionNotPresentDialog
-//========================================================================
- OExtensionNotPresentDialog::OExtensionNotPresentDialog( Window* _pParent, uno::Reference< lang::XMultiServiceFactory > _xORB)
- : ModalDialog( _pParent, ModuleRes(RID_EXTENSION_NOT_PRESENT_DLG) )
- ,m_aFI_WARNING(this, ModuleRes(FI_WARNING))
- ,m_aFT_TEXT(this, ModuleRes(FT_TEXT ) )
- ,m_aPB_DOWNLOAD(this, ModuleRes(PB_DOWNLOAD))
- ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL))
- ,m_xMultiServiceFactory(_xORB)
-{
- DBG_CTOR( dbu_OExtensionNotPresentDialog, NULL);
-
- try
- {
- SvtSysLocale aSysLocale;
- m_nLocale = aSysLocale.GetLocaleData().getLocale();
- }
- catch(uno::Exception&)
- {
- }
-
- // set a ClickHandler for the 'Download' button
- m_aPB_DOWNLOAD.SetClickHdl( LINK( this, OExtensionNotPresentDialog, Download_Click ) );
-
- // get message string out of the resource
- String sText = String( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) );
- // String sExtensionName = String( ModuleRes( RID_STR_EXTENSION_NAME ) );
- String sExtensionName = getFromConfigurationExtension("Name");
- sText.SearchAndReplaceAscii("%RPT_EXTENSION_NAME", sExtensionName);
-
- m_aFT_TEXT.SetText(sText);
-
- // calulate the size of the text field
- Rectangle aPrimaryRect( Point(0,0), m_aFT_TEXT.GetSizePixel() );
- Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT ) );
-
- Size aTempSize = LogicToPixel( Size(LEFT_PADDING + RIGHT_PADDING, 1), MAP_APPFONT); // real pixel size of LEFT and RIGHT_PADDING
- sal_Int32 nWidthWithoutFixedText = aTempSize.getWidth() ;
- sal_Int32 nHeightWithoutFixedText = GetSizePixel().getHeight() - m_aFT_TEXT.GetSizePixel().getHeight();
-
- Size aNewSize = aSuggestedRect.GetSize();
- m_aFT_TEXT.SetSizePixel( aNewSize );
- sal_Int32 nNewWidth = nWidthWithoutFixedText + aSuggestedRect.GetWidth();
- sal_Int32 nNewHeight = nHeightWithoutFixedText + aSuggestedRect.GetHeight();
-
- // set new window width & height
- Size aDialogWindowSize = GetSizePixel();
- aDialogWindowSize.setWidth( nNewWidth );
- aDialogWindowSize.setHeight( nNewHeight );
- SetSizePixel(aDialogWindowSize);
-
- // move Action items
- sal_Int32 nWindowWidth = GetSizePixel().getWidth();
- sal_Int32 nWindowHeight = GetSizePixel().getHeight();
-
- Size aButtonSize = LogicToPixel( Size(BUTTON_WIDTH, BUTTON_HEIGHT), MAP_APPFONT); // real pixel size of a button
-
- Point aNewPos = m_aPB_DOWNLOAD.GetPosPixel();
- aNewPos.setX(nWindowWidth / 2 - m_aPB_DOWNLOAD.GetSizePixel().getWidth() - 8);
- aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5);
- m_aPB_DOWNLOAD.SetPosPixel(aNewPos );
-
- aNewPos = m_aPB_CANCEL.GetPosPixel();
- aNewPos.setX(nWindowWidth / 2 + 8);
- aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5);
- m_aPB_CANCEL.SetPosPixel(aNewPos );
-
- m_aFI_WARNING.SetImage(WarningBox::GetStandardImage());
-
- // set an image in high contrast
- // m_aFI_WARNING.SetModeImage(Image(BMP_EXCEPTION_WARNING_SCH), BMP_COLOR_HIGHCONTRAST);
-
- // to resize images
- // WinBits aBits = m_aFI_WARNING.GetStyle();
- // aBits |= WB_SCALE;
- // m_aFI_WARNING.SetStyle(aBits);
- //
- // Size aImageSize = m_aFI_WARNING.GetSizePixel();
- // (void) aImageSize;
- // m_aFI_WARNING.Resize();
-
-
- Resize();
- FreeResource();
-}
-
-//------------------------------------------------------------------------
-OExtensionNotPresentDialog::~OExtensionNotPresentDialog()
-{
- DBG_DTOR( dbu_OExtensionNotPresentDialog, NULL);
-}
-// -----------------------------------------------------------------------------
-short OExtensionNotPresentDialog::Execute()
-{
- DBG_CHKTHIS( dbu_OExtensionNotPresentDialog,NULL);
- short nRet = ModalDialog::Execute();
- // RET_OK
- // RET_NO
- return nRet;
-}
-
-//------------------------------------------------------------------------------
-
-uno::Reference< com::sun::star::system::XSystemShellExecute > OExtensionNotPresentDialog::getShellExecuter() const
-{
- uno::Reference<com::sun::star::system::XSystemShellExecute> xExecuter( m_xMultiServiceFactory->createInstance( UNISTRING( "com.sun.star.system.SystemShellExecute" )), uno::UNO_QUERY_THROW);
- return xExecuter;
-}
-// -----------------------------------------------------------------------------
-rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const
-{
- // get the URL to open in a browser from Configuration
- static const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/Extension" ) );
-
- ::utl::OConfigurationTreeRoot aConfiguration( ::utl::OConfigurationTreeRoot::createWithServiceFactory( m_xMultiServiceFactory, sConfigName ) );
-
- rtl::OUString aValue;
- aConfiguration.getNodeValue( _sPropertyName ) >>= aValue;
- return aValue;
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OString const& _sPropertyName) const
-{
- return getFromConfigurationExtension(rtl::OStringToOUString( _sPropertyName, RTL_TEXTENCODING_UTF8) );
-}
-
-// -----------------------------------------------------------------------------
-// handle the click on the download button
-IMPL_LINK( OExtensionNotPresentDialog, Download_Click, PushButton*, EMPTYARG )
-{
- try
- {
- EndDialog( TRUE );
-
- rtl::OUString suDownloadURL = getFromConfigurationExtension("DownloadURL");
- if (suDownloadURL.getLength() == 0)
- {
- // fallback
- suDownloadURL = UNISTRING("http://extensions.services.openoffice.org");
- }
-
- // open such URL in a browser
- uno::Reference< com::sun::star::system::XSystemShellExecute > xShellExecute( getShellExecuter() );
- xShellExecute->execute( suDownloadURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return 0;
-}
-
-// =============================================================================
-} // rptui
-// =============================================================================
-
diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.src b/dbaccess/source/ui/dlg/ExtensionNotPresent.src
deleted file mode 100644
index e7a36fa8d3f4..000000000000
--- a/dbaccess/source/ui/dlg/ExtensionNotPresent.src
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "ExtensionNotPresent.hrc"
-#include "dbaccess_helpid.hrc"
-#include "dbu_resource.hrc"
-#include <svx/globlmn.hrc>
-#include <svx/svxids.hrc>
-
-
-String RID_STR_EXTENSION_NOT_PRESENT
-{
- // #i96130# use hard coded name
- Text [ en-US ] = "To open a report you require the extension Sunâ„¢ Report Builder.\n\nClick 'Download...' to download and install the extension.";
- // OLD: Text [ en-US ] = "To open a report you require the extension %RPT_EXTENSION_NAME.\n\nClick 'Download...' to download and install the extension.";
-};
-// To open a report you require the extension Sun Report Designer weiss der Geier Hauptsache extra langer Name
-// String RID_STR_EXTENSION_NAME
-// {
-// Text = "Sun(TM) Report Builder";
-// };
-
-ModalDialog RID_EXTENSION_NOT_PRESENT_DLG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ;
- Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ;
- HelpId = HID_EXTENSION_NOT_PRESENT_DLG;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- // most of the calulated values here are overridden by the ExtensionNotPresent ctor itself.
- FixedImage FI_WARNING
- {
- Pos = MAP_APPFONT (CELL_PADDING / 2, CELL_PADDING) ;
- Size = (32, 32);
- Fixed=BMP_EXCEPTION_WARNING;
- };
-
-
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 32 , CELL_PADDING ) ;
- Size = MAP_APPFONT ( DLG_WIDTH - LEFT_PADDING - RIGHT_PADDING , 3 * (FIXEDTEXT_HEIGHT + 2) ) ;
- // Border = TRUE ;
- // Text will set outside from RID_STR_EXTENSION_NOT_PRESENT
- };
-
- PushButton PB_DOWNLOAD
- {
- HelpID = "dbaccess:PushButton:RID_EXTENSION_NOT_PRESENT_DLG:PB_DOWNLOAD";
- Pos = MAP_APPFONT ( DLG_WIDTH / 2 - (CELL_PADDING/2) - BUTTON_WIDTH, ACTION_LINE_START ) ;
- Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
- DefButton = TRUE ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Download..." ;
- };
-
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT ( DLG_WIDTH / 2 + (CELL_PADDING/2), ACTION_LINE_START) ;
- Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
-};
-
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 8e5b61dc9076..d19052525a76 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -313,7 +313,6 @@ namespace dbaui
SetControlFontWeight(m_pFT_HeaderText);
}
-
//=========================================================================
//= LayoutHelper
//=========================================================================
@@ -331,6 +330,24 @@ namespace dbaui
_rControl.SetPosPixel( aControlPos );
}
+ //-------------------------------------------------------------------------
+ void LayoutHelper::fitSizeRightAligned( PushButton& io_button )
+ {
+ const Point aOldPos = io_button.GetPosPixel();
+ const Size aOldSize = io_button.GetSizePixel();
+ const Size aMinSize( io_button.CalcMinimumSize() );
+ if ( aMinSize.Width() > aOldSize.Width() )
+ {
+ io_button.SetPosSizePixel(
+ aOldPos.X() + aOldSize.Width() - aMinSize.Width(),
+ 0,
+ aMinSize.Width(),
+ 0,
+ WINDOW_POSSIZE_X | WINDOW_POSSIZE_WIDTH
+ );
+ }
+ }
+
//.........................................................................
} // namespace dbaui
//.........................................................................
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index 32ba0064a824..be6b923c2997 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -288,6 +288,10 @@ namespace dbaui
const ControlRelation _eRelation,
const long _nIndentAppFont
);
+ /** fits the button size to be large enough to contain the buttons text
+ */
+ static void fitSizeRightAligned( PushButton& io_button );
+ // why is CalcMinimumSize not a virtual method of ::Window?
};
//.........................................................................
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index a4914cd45cc5..4ef32efcc7ac 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -377,7 +377,7 @@ OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext )
//////////////////////////////////////////////////////////////////////
m_aTableList.EnableInplaceEditing( FALSE );
- m_aTableList.SetWindowBits(WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL );
+ m_aTableList.SetStyle(m_aTableList.GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL );
m_aTableList.EnableCheckButton( NULL ); // do not show any buttons
m_aTableList.SetSelectionMode( SINGLE_SELECTION );
m_aTableList.notifyHiContrastChanged();
diff --git a/dbaccess/source/ui/dlg/dbadmin2.src b/dbaccess/source/ui/dlg/dbadmin2.src
index a698d63e7635..76cfebb8dcb0 100644
--- a/dbaccess/source/ui/dlg/dbadmin2.src
+++ b/dbaccess/source/ui/dlg/dbadmin2.src
@@ -52,11 +52,6 @@ String STR_ENTER_CONNECTION_PASSWORD
Text [ en-US ] = "A password is needed to connect to the data source \"$name$\".";
};
-String STR_QUERY_DROP_ALL
-{
- Text[ en-US ] = "Do you want to delete all selected items?";
-};
-
String STR_ASK_FOR_DIRECTORY_CREATION
{
Text [ en-US ] = "The directory\n\n$path$\n\ndoes not exist. Should it be created?";
@@ -67,41 +62,6 @@ String STR_COULD_NOT_CREATE_DIRECTORY
Text [ en-US ] = "The directory $name$ could not be created.";
};
-String STR_ADDRESSBOOK_SYSTEM
-{
- Text[ en-US ] = "Windows address book";
-};
-String STR_ADDRESSBOOK_OUTLOOK
-{
- Text[ en-US ] = "MS Outlook";
-};
-String STR_ADDRESSBOOK_MOZILLA
-{
- Text[ en-US ] = "Mozilla address book";
-};
-String STR_ADDRESSBOOK_THUNDERBIRD
-{
- Text[ en-US ] = "Thunderbird address book";
-};
-String STR_ADDRESSBOOK_EVOLUTION
-{
- Text[ en-US ] = "Evolution address book";
-};
-String STR_ADDRESSBOOK_LDAP
-{
- Text[ en-US ] = "LDAP address book";
-};
-
-String STR_HINT_READONLY_CONNECTION
-{
- Text [ en-US ] = "(Connection is read-only)";
-};
-
-String STR_HINT_CONNECTION_NOT_CAPABLE
-{
- Text [ en-US ] = "(Not supported by this connection)";
-};
-
#define EDIT_SIZE_X 50
#define FT_SIZE_X 90
#define WIN_X 220
diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk
index 270741d00857..ca0d3ab8cde7 100644
--- a/dbaccess/source/ui/dlg/makefile.mk
+++ b/dbaccess/source/ui/dlg/makefile.mk
@@ -137,8 +137,6 @@ SLOFILES+= $(SLO)$/adodatalinks.obj
.ENDIF
# --- Targets ----------------------------------
-#LOCALIZE_ME=AutoControls_tmpl.hrc
-
.INCLUDE : target.mk
$(SLO)$/ConnectionHelper.obj : $(LOCALIZE_ME_DEST)
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 9015704d2878..f19f65313a0d 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -401,7 +401,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi
m_aExceptionList.SetSelectionMode(SINGLE_SELECTION);
m_aExceptionList.SetDragDropMode(0);
m_aExceptionList.EnableInplaceEditing(sal_False);
- m_aExceptionList.SetWindowBits(WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
+ m_aExceptionList.SetStyle(m_aExceptionList.GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
m_aExceptionList.SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected));
m_aExceptionList.SetNodeDefaultImages( );
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index a48b08de740d..6523e0f17cd6 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -162,7 +162,7 @@ DBG_NAME(OTableSubscriptionPage)
m_aTablesList.SetSelectionMode( MULTIPLE_SELECTION );
m_aTablesList.SetDragDropMode( 0 );
m_aTablesList.EnableInplaceEditing( sal_False );
- m_aTablesList.SetWindowBits(WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
+ m_aTablesList.SetStyle(m_aTablesList.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
m_aTablesList.Clear();
diff --git a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx b/dbaccess/source/ui/inc/ExtensionNotPresent.hxx
deleted file mode 100644
index 0c64214d4c37..000000000000
--- a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef DBU_EXTENSIONNOTPRESENT_HXX
-#define DBU_EXTENSIONNOTPRESENT_HXX
-
-#ifndef _DIALOG_HXX //autogen
-#include <vcl/dialog.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _SV_LSTBOX_HXX
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _SV_FIELD_HXX
-#include <vcl/field.hxx>
-#endif
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
-#include <com/sun/star/report/XReportDefinition.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
-#include <com/sun/star/lang/Locale.hpp>
-#endif
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-
-namespace dbaui
-{
-
-/*************************************************************************
-|*
-|* Groups and Sorting dialog
-|*
-\************************************************************************/
-class OExtensionNotPresentDialog : public ModalDialog
-{
- FixedImage m_aFI_WARNING;
- FixedText m_aFT_TEXT;
-
- PushButton m_aPB_DOWNLOAD;
- CancelButton m_aPB_CANCEL;
-
- ::com::sun::star::lang::Locale m_nLocale;
- com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
-
- /** returns the format string.
- */
- // ::rtl::OUString getFormatString(::sal_Int16 _nNumberFormatIndex);
-
- DECL_LINK(Download_Click,PushButton*);
-
- // not CopyCTOR, no self assignment
- OExtensionNotPresentDialog(const OExtensionNotPresentDialog&);
- void operator =(const OExtensionNotPresentDialog&);
-
- // get some values out of the configuration
- rtl::OUString getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const;
- rtl::OUString getFromConfigurationExtension(rtl::OString const& _sPropertyName) const; // syntactic sugar
-
- ::com::sun::star::uno::Reference< ::com::sun::star::system::XSystemShellExecute > getShellExecuter() const;
-
-public:
- OExtensionNotPresentDialog( Window* pParent, com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > );
- virtual ~OExtensionNotPresentDialog();
- virtual short Execute();
-
- inline String getText() const { return m_aFT_TEXT.GetText(); }
-};
-// =============================================================================
-} // namespace rptui
-// =============================================================================
-#endif // DBU_EXTENSIONNOTPRESENT_HXX
-
diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc
index 7e1b7df0d100..b107a0014dbb 100644
--- a/dbaccess/source/ui/inc/dbu_dlg.hrc
+++ b/dbaccess/source/ui/inc/dbu_dlg.hrc
@@ -64,24 +64,24 @@
#define STR_ADABAS_ERROR_SYSTEMTABLES RID_STR_DLG_START + 6
#define STR_ERROR_PASSWORDS_NOT_IDENTICAL RID_STR_DLG_START + 7
#define STR_INDEXDESIGN_DOUBLE_COLUMN_NAME RID_STR_DLG_START + 8
-#define STR_DATASOURCE_DEFAULTNAME RID_STR_DLG_START + 9
-#define STR_ERR_EMPTY_DSN_NAME RID_STR_DLG_START + 10
+ // FREE
+ // FREE
#define STR_ERR_USE_CONNECT_TO RID_STR_DLG_START + 11
#define STR_ALREADYEXISTOVERWRITE RID_STR_DLG_START + 12
-#define STR_QUERY_DROP_ALL RID_STR_DLG_START + 13
+ // FREE
#define STR_INDEX_NAME_ALREADY_USED RID_STR_DLG_START + 14
#define STR_ASK_FOR_DIRECTORY_CREATION RID_STR_DLG_START + 15
#define STR_COULD_NOT_CREATE_DIRECTORY RID_STR_DLG_START + 16
-#define STR_ADDRESSBOOK_SYSTEM RID_STR_DLG_START + 17
-#define STR_ADDRESSBOOK_MOZILLA RID_STR_DLG_START + 18
-#define STR_ADDRESSBOOK_EVOLUTION RID_STR_DLG_START + 19
// FREE
-#define STR_ADDRESSBOOK_LDAP RID_STR_DLG_START + 21
-#define STR_ADDRESSBOOK_OUTLOOK RID_STR_DLG_START + 22
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
#define STR_COMMAND_EXECUTED_SUCCESSFULLY RID_STR_DLG_START + 23
#define STR_DIRECTSQL_CONNECTIONLOST RID_STR_DLG_START + 24
-#define STR_HINT_READONLY_CONNECTION RID_STR_DLG_START + 25
-#define STR_HINT_CONNECTION_NOT_CAPABLE RID_STR_DLG_START + 26
+ // FREE
+ // FREE
#define STR_USERADMIN_NOT_AVAILABLE RID_STR_DLG_START + 27
#define STR_TAB_INDEX_SORTORDER RID_STR_DLG_START + 28
#define STR_TAB_INDEX_FIELD RID_STR_DLG_START + 29
@@ -110,7 +110,7 @@
#define STR_NO_ADABASE_DATASOURCES RID_STR_DLG_START + 55
#define STR_NO_ADDITIONAL_SETTINGS RID_STR_DLG_START + 56
#define STR_HOSTNAME RID_STR_DLG_START + 57
-#define STR_ADDRESSBOOK_THUNDERBIRD RID_STR_DLG_START + 58
+ // FREE
#define STR_MOZILLA_PROFILE_NAME RID_STR_DLG_START + 59
#define STR_THUNDERBIRD_PROFILE_NAME RID_STR_DLG_START + 60
#define STR_EXPLAN_STRINGCONVERSION_ERROR RID_STR_DLG_START + 61
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index d54a056f863e..803554a0094f 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -92,8 +92,8 @@ OWizNameMatching::OWizNameMatching( Window* pParent)
m_CTRL_RIGHT.SetSelectHdl(LINK(this,OWizNameMatching,TableListRightSelectHdl));
m_CTRL_RIGHT.EnableCheckButton( NULL );
- m_CTRL_LEFT.SetWindowBits( WB_FORCE_MAKEVISIBLE );
- m_CTRL_RIGHT.SetWindowBits( WB_FORCE_MAKEVISIBLE );
+ m_CTRL_LEFT.SetStyle( m_CTRL_LEFT.GetStyle() | WB_FORCE_MAKEVISIBLE );
+ m_CTRL_RIGHT.SetStyle( m_CTRL_RIGHT.GetStyle() | WB_FORCE_MAKEVISIBLE );
m_sSourceText = m_FT_TABLE_LEFT.GetText();
m_sSourceText.AppendAscii("\n");
@@ -405,7 +405,7 @@ OColumnTreeBox::OColumnTreeBox( Window* pParent, const ResId& rResId )
{
SetDragDropMode( 0 );
EnableInplaceEditing( sal_False );
- SetWindowBits(WB_BORDER | WB_HASBUTTONS | WB_HSCROLL);
+ SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL);
SetSelectionMode( SINGLE_SELECTION );
}
//------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src
index 552a076147d5..22bc80670cf6 100644
--- a/dbaccess/source/ui/misc/dbumiscres.src
+++ b/dbaccess/source/ui/misc/dbumiscres.src
@@ -96,5 +96,5 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS
String RID_STR_EXTENSION_NOT_PRESENT
{
// #i96130# use hard coded name
- Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder.";
+ Text [ en-US ] = "The report, \"$file$\", requires the extension Oracle Report Builder.";
};
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d80aa37fdece..a49cabc90bed 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -121,6 +121,7 @@
#include <osl/module.h>
#include <osl/file.hxx>
#include <osl/signal.h>
+#include <osl/thread.hxx>
#include <rtl/uuid.h>
#include <rtl/uri.hxx>
#include <unotools/pathoptions.hxx>
@@ -347,10 +348,8 @@ CommandLineArgs* Desktop::GetCommandLineArgs()
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if ( !pArgs )
- {
pArgs = new CommandLineArgs;
}
- }
return pArgs;
}
@@ -1552,7 +1551,7 @@ void Desktop::Main()
Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
sal_Bool bRestartRequested( sal_False );
sal_Bool bUseSystemFileDialog(sal_True);
- int nAcquireCount( 0 );
+ int nAcquireCount( 0 );
Reference < css::document::XEventListener > xGlobalBroadcaster;
try
{
@@ -1619,25 +1618,6 @@ void Desktop::Main()
}
String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
delete pLabelResMgr;
-/*
- // locale and UI locale in AppSettings are now retrieved from configuration or system directly via SvtSysLocale
- // no reason to set while starting
- // set UI language and locale
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ set locale settings" );
- //LanguageSelection langselect;
- OUString aUILocaleString = LanguageSelection::getLanguageString();
- Locale aUILocale = LanguageSelection::IsoStringToLocale(aUILocaleString);
- LanguageType eLanguage = SvtSysLocale().GetLanguage();
-
- // #i39040#, do not call anything between GetSettings and SetSettings that might have
- // a side effect on the settings (like, eg, SvtSysLocaleOptions().GetLocaleLanguageType(),
- // which changes the MiscSettings !!! )
- AllSettings aSettings( Application::GetSettings() );
- aSettings.SetUILocale( aUILocale );
- aSettings.SetLanguage( eLanguage );
- Application::SetSettings( aSettings );
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" );
-*/
// Check for StarOffice/Suite specific extensions runs also with OpenOffice installation sets
OUString aTitleString( aTitle );
@@ -1657,12 +1637,9 @@ void Desktop::Main()
#endif
SetDisplayName( aTitle );
-// SetSplashScreenProgress(30);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" );
pPathOptions.reset( new SvtPathOptions);
-// SetSplashScreenProgress(40);
-// pLanguageOptions = new SvtLanguageOptions(sal_True);
-// SetSplashScreenProgress(45);
+ SetSplashScreenProgress(40);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" );
// Check special env variable #111015#
@@ -1744,6 +1721,7 @@ void Desktop::Main()
}
SetSplashScreenProgress(50);
+
// Backing Component
sal_Bool bCrashed = sal_False;
sal_Bool bExistsRecoveryData = sal_False;
@@ -1773,43 +1751,37 @@ void Desktop::Main()
if ( !bRestartRequested )
{
- if (
- (pCmdLineArgs->IsEmptyOrAcceptOnly() ) &&
+ if ((!pCmdLineArgs->WantsToLoadDocument() ) &&
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
(!bExistsRecoveryData ) &&
(!bExistsSessionData ) &&
- (!Application::AnyInput( INPUT_APPEVENT ) )
- )
+ (!Application::AnyInput( INPUT_APPEVENT ) ))
{
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
- Reference< XFrame > xDesktopFrame( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
- if (xDesktopFrame.is())
- {
- // SetSplashScreenProgress(60);
- Reference< XFrame > xBackingFrame;
- Reference< ::com::sun::star::awt::XWindow > xContainerWindow;
-
- xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0);
- if (xBackingFrame.is())
- xContainerWindow = xBackingFrame->getContainerWindow();
- if (xContainerWindow.is())
- {
- // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
- // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
- // otherwise documents loaded into this frame will later on miss functionality depending on the style.
- Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
- OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
- pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
-
- SetSplashScreenProgress(75);
- Sequence< Any > lArgs(1);
- lArgs[0] <<= xContainerWindow;
-
- Reference< XController > xBackingComp(
- xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs),
- UNO_QUERY);
- // SetSplashScreenProgress(80);
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
+ Reference< XFrame > xDesktopFrame( xSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
+ if (xDesktopFrame.is())
+ {
+ Reference< XFrame > xBackingFrame;
+ Reference< ::com::sun::star::awt::XWindow > xContainerWindow;
+
+ xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0);
+ if (xBackingFrame.is())
+ xContainerWindow = xBackingFrame->getContainerWindow();
+ if (xContainerWindow.is())
+ {
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+
+ SetSplashScreenProgress(75);
+ Sequence< Any > lArgs(1);
+ lArgs[0] <<= xContainerWindow;
+
+ Reference< XController > xBackingComp(
+ xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), UNO_QUERY);
if (xBackingComp.is())
{
Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY);
@@ -1840,16 +1812,6 @@ void Desktop::Main()
FatalError( MakeStartupErrorMessage(e.Message) );
return;
}
- /*
- catch ( ... )
- {
- FatalError( MakeStartupErrorMessage(
- OUString::createFromAscii(
- "Unknown error during startup (Office wrapper service).\nInstallation could be damaged.")));
- return;
- }
- */
-// SetSplashScreenProgress(55);
SvtFontSubstConfig().Apply();
@@ -1858,7 +1820,6 @@ void Desktop::Main()
aAppearanceCfg.SetApplicationDefaults( this );
SvtAccessibilityOptions aOptions;
aOptions.SetVCLSettings();
-// SetSplashScreenProgress(60);
if ( !bRestartRequested )
{
@@ -1892,15 +1853,6 @@ void Desktop::Main()
FatalError( MakeStartupErrorMessage(e.Message) );
return;
}
- /*
- catch ( ... )
- {
- FatalError( MakeStartupErrorMessage(
- OUString::createFromAscii(
- "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged.")));
- return;
- }
- */
// Post user event to startup first application component window
// We have to send this OpenClients message short before execute() to
@@ -2219,12 +2171,7 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, EMPTYARG )
// CloseStartupScreen();
CloseSplashScreen();
-
CheckFirstRun( );
-
- // allow ipc interaction
-// OfficeIPCThread::SetReady();
-
EnableOleAutomation();
if (getenv ("OOO_EXIT_POST_STARTUP"))
@@ -2721,16 +2668,6 @@ void Desktop::OpenClients()
if ( ! bAllowRecoveryAndSessionManagement )
{
- /*
- ::comphelper::ConfigurationHelper::writeDirectKey(
- ::comphelper::getProcessServiceFactory(),
- ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery"),
- ::rtl::OUString::createFromAscii("AutoSave"),
- ::rtl::OUString::createFromAscii("Enabled"),
- ::com::sun::star::uno::makeAny(sal_False),
- ::comphelper::ConfigurationHelper::E_STANDARD);
-
- */
try
{
Reference< XDispatch > xRecovery(
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 0625191ee2ea..14b4fd1d6ddc 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -142,15 +142,16 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
UNO_QUERY);
// parse command line arguments
- sal_Bool bPrintEvent = sal_False;
- sal_Bool bOpenEvent = sal_True;
- sal_Bool bViewEvent = sal_False;
- sal_Bool bStartEvent = sal_False;
- sal_Bool bPrintToEvent = sal_False;
- sal_Bool bPrinterName = sal_False;
- sal_Bool bForceOpenEvent = sal_False;
- sal_Bool bForceNewEvent = sal_False;
- sal_Bool bDisplaySpec = sal_False;
+ bool bOpenEvent(true);
+ bool bPrintEvent(false);
+ bool bViewEvent(false);
+ bool bStartEvent(false);
+ bool bPrintToEvent(false);
+ bool bPrinterName(false);
+ bool bForceOpenEvent(false);
+ bool bForceNewEvent(false);
+ bool bDisplaySpec(false);
+ bool bOpenDoc(false);
m_eArgumentCount = NONE;
@@ -169,8 +170,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
if (tmp.getLength() > 0)
aArg = tmp;
}
- String aArgStr = aArg;
+ String aArgStr = aArg;
if ( aArg.getLength() > 0 )
{
m_eArgumentCount = m_eArgumentCount == NONE ? ONE : MANY;
@@ -182,98 +183,98 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
if ( aArgStr.EqualsIgnoreCaseAscii( "-n" ))
{
// force new documents based on the following documents
- bForceNewEvent = sal_True;
- bOpenEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bPrintEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
- }
+ bForceNewEvent = true;
+ bOpenEvent = false;
+ bForceOpenEvent = false;
+ bPrintToEvent = false;
+ bPrintEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
+ }
else if ( aArgStr.EqualsIgnoreCaseAscii( "-o" ))
{
- // force open documents regards if they are templates or not
- bForceOpenEvent = sal_True;
- bOpenEvent = sal_False;
- bForceNewEvent = sal_False;
- bPrintToEvent = sal_False;
- bPrintEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
- }
+ // force open documents regardless if they are templates or not
+ bForceOpenEvent = true;
+ bOpenEvent = false;
+ bForceNewEvent = false;
+ bPrintToEvent = false;
+ bPrintEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
+ }
else if ( aArgStr.EqualsIgnoreCaseAscii( "-pt" ))
{
// Print to special printer
- bPrintToEvent = sal_True;
- bPrinterName = sal_True;
- bPrintEvent = sal_False;
- bOpenEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
- bForceOpenEvent = sal_False;
- }
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" ))
- {
+ bPrintToEvent = true;
+ bPrinterName = true;
+ bPrintEvent = false;
+ bOpenEvent = false;
+ bForceNewEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
+ bForceOpenEvent = false;
+ }
+ else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" ))
+ {
// Print to default printer
- bPrintEvent = sal_True;
- bPrintToEvent = sal_False;
- bOpenEvent = sal_False;
- bForceNewEvent = sal_False;
- bForceOpenEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
- }
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" ))
- {
+ bPrintEvent = true;
+ bPrintToEvent = false;
+ bOpenEvent = false;
+ bForceNewEvent = false;
+ bForceOpenEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
+ }
+ else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" ))
+ {
// open in viewmode
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bForceOpenEvent = sal_False;
- bViewEvent = sal_True;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
- }
+ bOpenEvent = false;
+ bPrintEvent = false;
+ bPrintToEvent = false;
+ bForceNewEvent = false;
+ bForceOpenEvent = false;
+ bViewEvent = true;
+ bStartEvent = false;
+ bDisplaySpec = false;
+ }
else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" ))
{
// open in viewmode
- bOpenEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_True;
- bPrintEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bForceOpenEvent = sal_False;
- bDisplaySpec = sal_False;
+ bOpenEvent = false;
+ bViewEvent = false;
+ bStartEvent = true;
+ bPrintEvent = false;
+ bPrintToEvent = false;
+ bForceNewEvent = false;
+ bForceOpenEvent = false;
+ bDisplaySpec = false;
}
else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" ))
{
// set display
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_True;
+ bOpenEvent = false;
+ bPrintEvent = false;
+ bForceOpenEvent = false;
+ bPrintToEvent = false;
+ bForceNewEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = true;
}
else if ( aArgStr.EqualsIgnoreCaseAscii( "-language" ))
{
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
+ bOpenEvent = false;
+ bPrintEvent = false;
+ bForceOpenEvent = false;
+ bPrintToEvent = false;
+ bForceNewEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
}
#ifdef MACOSX
@@ -285,14 +286,14 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
else if ( aArgStr.CompareToAscii( "-psn", 4 ) == COMPARE_EQUAL )
{
// finder argument from MacOSX
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
+ bOpenEvent = false;
+ bPrintEvent = false;
+ bForceOpenEvent = false;
+ bPrintToEvent = false;
+ bForceNewEvent = false;
+ bViewEvent = false;
+ bStartEvent = false;
+ bDisplaySpec = false;
}
#endif
}
@@ -308,29 +309,54 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{
// handle this argument as a filename
if ( bOpenEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bViewEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bStartEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bPrintEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bPrintToEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bForceNewEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArgStr );
+ bOpenDoc = true;
+ }
else if ( bForceOpenEvent )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArgStr );
- else if ( bDisplaySpec ){
+ bOpenDoc = true;
+ }
+ else if ( bDisplaySpec )
+ {
AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArgStr );
- bDisplaySpec = sal_False; // only one display, not a lsit
- bOpenEvent = sal_True; // set back to standard
+ bDisplaySpec = false; // only one display, not a lsit
+ bOpenEvent = true; // set back to standard
}
}
}
}
}
}
+
+ if ( bOpenDoc )
+ m_bDocumentArgs = true;
}
void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam )
@@ -432,8 +458,8 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-help" ))
- || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
- || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
+ || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
+ || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELP, sal_True );
return sal_True;
@@ -473,18 +499,18 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True );
return sal_True;
}
- #ifdef MACOSX
- /* #i84053# ignore -psn on Mac
- Platform dependent #ifdef here is ugly, however this is currently
- the only platform dependent parameter. Should more appear
- we should find a better solution
- */
+#ifdef MACOSX
+ /* #i84053# ignore -psn on Mac
+ Platform dependent #ifdef here is ugly, however this is currently
+ the only platform dependent parameter. Should more appear
+ we should find a better solution
+ */
else if ( aArg.compareToAscii( "-psn", 4 ) == 0 )
{
SetBoolParam_Impl( CMD_BOOLPARAM_PSN, sal_True );
return sal_True;
}
- #endif
+#endif
else if ( aArgStr.Copy(0, 8).EqualsIgnoreCaseAscii( "-accept=" ))
{
AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, aArgStr.Copy( 8 ) );
@@ -496,7 +522,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
return sal_True;
}
else if ( aArgStr.CompareIgnoreCaseToAscii( "-portal," ,
- RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL )
+ RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL )
{
AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, aArgStr.Copy( RTL_CONSTASCII_LENGTH( "-portal," )) );
return sal_True;
@@ -504,13 +530,10 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
else if ( aArgStr.Copy( 0, 7 ).EqualsIgnoreCaseAscii( "-userid" ))
{
if ( aArgStr.Len() > 8 )
- {
- rtl::OUString aUserDir = aArgStr;
- AddStringListParam_Impl(
- CMD_STRINGPARAM_USERDIR,
- ::rtl::Uri::decode( aUserDir.copy( 8 ),
- rtl_UriDecodeWithCharset,
- RTL_TEXTENCODING_UTF8 ) );
+ {
+ rtl::OUString aUserDir = aArgStr;
+ AddStringListParam_Impl( CMD_STRINGPARAM_USERDIR,
+ ::rtl::Uri::decode( aUserDir.copy( 8 ), rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ) );
}
return sal_True;
}
@@ -533,56 +556,64 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WRITER );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-calc" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_CALC );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-draw" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_DRAW );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-impress" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_IMPRESS );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-base" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_BASE );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-global" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_GLOBAL );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-math" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_MATH );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-web" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WEB );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
+ m_bDocumentArgs = true;
return sal_True;
}
@@ -605,12 +636,12 @@ sal_Bool CommandLineArgs::CheckGroupMembers( GroupParamId nGroupId, BoolParam nE
void CommandLineArgs::ResetParamValues()
{
int i;
-
for ( i = 0; i < CMD_BOOLPARAM_COUNT; i++ )
m_aBoolParams[i] = sal_False;
for ( i = 0; i < CMD_STRINGPARAM_COUNT; i++ )
m_aStrSetParams[i] = sal_False;
m_eArgumentCount = NONE;
+ m_bDocumentArgs = false;
}
void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
@@ -897,4 +928,10 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const
( ( m_eArgumentCount == ONE ) && m_aBoolParams[ CMD_BOOLPARAM_PSN ] );
}
+sal_Bool CommandLineArgs::WantsToLoadDocument() const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ return m_bDocumentArgs;
+}
+
} // namespace desktop
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index 615577098c2d..a1c70bf5df72 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -38,7 +38,7 @@ namespace desktop
class CommandLineArgs
{
public:
- enum BoolParam // must be zero based!
+ enum BoolParam // must be zero based!
{
CMD_BOOLPARAM_MINIMIZED,
CMD_BOOLPARAM_INVISIBLE,
@@ -71,7 +71,7 @@ class CommandLineArgs
CMD_BOOLPARAM_HELPIMPRESS,
CMD_BOOLPARAM_HELPBASE,
CMD_BOOLPARAM_PSN,
- CMD_BOOLPARAM_COUNT // must be last element!
+ CMD_BOOLPARAM_COUNT // must be last element!
};
enum StringParam // must be zero based!
@@ -92,7 +92,7 @@ class CommandLineArgs
CMD_STRINGPARAM_PRINTERNAME,
CMD_STRINGPARAM_DISPLAY,
CMD_STRINGPARAM_LANGUAGE,
- CMD_STRINGPARAM_COUNT // must be last element!
+ CMD_STRINGPARAM_COUNT // must be last element!
};
enum GroupParamId
@@ -101,7 +101,8 @@ class CommandLineArgs
CMD_GRPID_COUNT
};
- struct Supplier {
+ struct Supplier
+ {
// Thrown from constructors and next:
class Exception {
public:
@@ -122,86 +123,88 @@ class CommandLineArgs
boost::optional< rtl::OUString > getCwdUrl() const { return m_cwdUrl; }
// generic methods to access parameter
- void SetBoolParam( BoolParam eParam, sal_Bool bNewValue );
+ void SetBoolParam( BoolParam eParam, sal_Bool bNewValue );
// Access to bool parameters
- sal_Bool IsMinimized() const;
- sal_Bool IsInvisible() const;
- sal_Bool IsNoRestore() const;
- sal_Bool IsNoDefault() const;
- sal_Bool IsBean() const;
- sal_Bool IsServer() const;
- sal_Bool IsHeadless() const;
- sal_Bool IsQuickstart() const;
- sal_Bool IsNoQuickstart() const;
- sal_Bool IsTerminateAfterInit() const;
- sal_Bool IsNoFirstStartWizard() const;
- sal_Bool IsNoLogo() const;
- sal_Bool IsNoLockcheck() const;
- sal_Bool IsHelp() const;
- sal_Bool IsHelpWriter() const;
- sal_Bool IsHelpCalc() const;
- sal_Bool IsHelpDraw() const;
- sal_Bool IsHelpImpress() const;
- sal_Bool IsHelpBase() const;
- sal_Bool IsHelpMath() const;
- sal_Bool IsHelpBasic() const;
- sal_Bool IsWriter() const;
- sal_Bool IsCalc() const;
- sal_Bool IsDraw() const;
- sal_Bool IsImpress() const;
- sal_Bool IsBase() const;
- sal_Bool IsGlobal() const;
- sal_Bool IsMath() const;
- sal_Bool IsWeb() const;
- sal_Bool HasModuleParam() const;
+ sal_Bool IsMinimized() const;
+ sal_Bool IsInvisible() const;
+ sal_Bool IsNoRestore() const;
+ sal_Bool IsNoDefault() const;
+ sal_Bool IsBean() const;
+ sal_Bool IsServer() const;
+ sal_Bool IsHeadless() const;
+ sal_Bool IsQuickstart() const;
+ sal_Bool IsNoQuickstart() const;
+ sal_Bool IsTerminateAfterInit() const;
+ sal_Bool IsNoFirstStartWizard() const;
+ sal_Bool IsNoLogo() const;
+ sal_Bool IsNoLockcheck() const;
+ sal_Bool IsHelp() const;
+ sal_Bool IsHelpWriter() const;
+ sal_Bool IsHelpCalc() const;
+ sal_Bool IsHelpDraw() const;
+ sal_Bool IsHelpImpress() const;
+ sal_Bool IsHelpBase() const;
+ sal_Bool IsHelpMath() const;
+ sal_Bool IsHelpBasic() const;
+ sal_Bool IsWriter() const;
+ sal_Bool IsCalc() const;
+ sal_Bool IsDraw() const;
+ sal_Bool IsImpress() const;
+ sal_Bool IsBase() const;
+ sal_Bool IsGlobal() const;
+ sal_Bool IsMath() const;
+ sal_Bool IsWeb() const;
+ sal_Bool HasModuleParam() const;
+ sal_Bool WantsToLoadDocument() const;
// Access to string parameters
- sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const;
- sal_Bool GetAcceptString( ::rtl::OUString& rPara) const;
- sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const;
- sal_Bool GetOpenList( ::rtl::OUString& rPara) const;
- sal_Bool GetViewList( ::rtl::OUString& rPara) const;
- sal_Bool GetStartList( ::rtl::OUString& rPara) const;
- sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const;
- sal_Bool GetForceNewList( ::rtl::OUString& rPara) const;
- sal_Bool GetPrintList( ::rtl::OUString& rPara) const;
- sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const;
- sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const;
- sal_Bool GetLanguage( ::rtl::OUString& rPara ) const;
+ sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const;
+ sal_Bool GetAcceptString( ::rtl::OUString& rPara) const;
+ sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const;
+ sal_Bool GetOpenList( ::rtl::OUString& rPara) const;
+ sal_Bool GetViewList( ::rtl::OUString& rPara) const;
+ sal_Bool GetStartList( ::rtl::OUString& rPara) const;
+ sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const;
+ sal_Bool GetForceNewList( ::rtl::OUString& rPara) const;
+ sal_Bool GetPrintList( ::rtl::OUString& rPara) const;
+ sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const;
+ sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const;
+ sal_Bool GetLanguage( ::rtl::OUString& rPara ) const;
// Special analyzed states (does not match directly to a command line parameter!)
- sal_Bool IsPrinting() const;
- sal_Bool IsEmpty() const;
- sal_Bool IsEmptyOrAcceptOnly() const;
+ sal_Bool IsPrinting() const;
+ sal_Bool IsEmpty() const;
+ sal_Bool IsEmptyOrAcceptOnly() const;
private:
enum Count { NONE, ONE, MANY };
struct GroupDefinition
{
- sal_Int32 nCount;
- BoolParam* pGroupMembers;
+ sal_Int32 nCount;
+ BoolParam* pGroupMembers;
};
// no copy and operator=
CommandLineArgs( const CommandLineArgs& );
CommandLineArgs operator=( const CommandLineArgs& );
- sal_Bool InterpretCommandLineParameter( const ::rtl::OUString& );
- void ParseCommandLine_Impl( Supplier& supplier );
- void ResetParamValues();
- sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const;
+ sal_Bool InterpretCommandLineParameter( const ::rtl::OUString& );
+ void ParseCommandLine_Impl( Supplier& supplier );
+ void ResetParamValues();
+ sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const;
- void AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam );
- void SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue );
+ void AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam );
+ void SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue );
boost::optional< rtl::OUString > m_cwdUrl;
- sal_Bool m_aBoolParams[ CMD_BOOLPARAM_COUNT ]; // Stores boolean parameters
- rtl::OUString m_aStrParams[ CMD_STRINGPARAM_COUNT ]; // Stores string parameters
- sal_Bool m_aStrSetParams[ CMD_STRINGPARAM_COUNT ]; // Stores if string parameters are provided on cmdline
- Count m_eArgumentCount; // Number of Args
- mutable ::osl::Mutex m_aMutex;
+ sal_Bool m_aBoolParams[ CMD_BOOLPARAM_COUNT ]; // Stores boolean parameters
+ rtl::OUString m_aStrParams[ CMD_STRINGPARAM_COUNT ]; // Stores string parameters
+ sal_Bool m_aStrSetParams[ CMD_STRINGPARAM_COUNT ]; // Stores if string parameters are provided on cmdline
+ Count m_eArgumentCount; // Number of Args
+ bool m_bDocumentArgs; // A document creation/open/load arg is used
+ mutable ::osl::Mutex m_aMutex;
// static definition for groups where only one member can be true
static GroupDefinition m_pGroupDefinitions[ CMD_GRPID_COUNT ];
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 24b47aa223e3..5f9de3965199 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -71,29 +71,34 @@ Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
m_pPublisher( NULL ),
m_xPackage( xPackage )
{
- m_sTitle = xPackage->getDisplayName();
- m_sVersion = xPackage->getVersion();
- m_sDescription = xPackage->getDescription();
-
- beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
- m_sPublisher = aInfo.First;
- m_sPublisherURL = aInfo.Second;
-
- // get the icons for the package if there are any
- uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
- if ( xGraphic.is() )
- m_aIcon = Image( xGraphic );
-
- xGraphic = xPackage->getIcon( true );
- if ( xGraphic.is() )
- m_aIconHC = Image( xGraphic );
- else
- m_aIconHC = m_aIcon;
+ try
+ {
+ m_sTitle = xPackage->getDisplayName();
+ m_sVersion = xPackage->getVersion();
+ m_sDescription = xPackage->getDescription();
+
+ beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
+ m_sPublisher = aInfo.First;
+ m_sPublisherURL = aInfo.Second;
+
+ // get the icons for the package if there are any
+ uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
+ if ( xGraphic.is() )
+ m_aIcon = Image( xGraphic );
+
+ xGraphic = xPackage->getIcon( true );
+ if ( xGraphic.is() )
+ m_aIconHC = Image( xGraphic );
+ else
+ m_aIconHC = m_aIcon;
- if ( eState == AMBIGUOUS )
- m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
- else if ( eState == NOT_REGISTERED )
- checkDependencies();
+ if ( eState == AMBIGUOUS )
+ m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
+ else if ( eState == NOT_REGISTERED )
+ checkDependencies();
+ }
+ catch (deployment::ExtensionRemovedException &) {}
+ catch (uno::RuntimeException &) {}
}
//------------------------------------------------------------------------------
@@ -963,6 +968,11 @@ long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &
bool bLocked = m_pManager->isReadOnly( xPackage );
TEntry_Impl pEntry( new Entry_Impl( xPackage, eState, bLocked ) );
+
+ // Don't add empty entries
+ if ( ! pEntry->m_sTitle.Len() )
+ return 0;
+
xPackage->addEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
::osl::ClearableMutexGuard guard(m_entriesMutex);
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index feb55d0af3bf..7f262d66684b 100644..100755
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -986,16 +986,20 @@ OUString BackendImpl::PackageImpl::getDescription()
if (sRelativeURL.getLength())
{
OUString sURL = m_url_expanded + OUSTR("/") + sRelativeURL;
- sDescription = getTextFromURL(
- css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL);
+ try
+ {
+ sDescription = getTextFromURL( css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL );
+ }
+ catch ( css::deployment::DeploymentException& )
+ {
+ OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
}
+
if (sDescription.getLength())
return sDescription;
- else if(m_oldDescription.getLength())
- return m_oldDescription;
- else
- return OUString();
+ return m_oldDescription;
}
//______________________________________________________________________________
diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx
index 81a789a613b9..5cc90577aaff 100644
--- a/desktop/source/migration/wizard.cxx
+++ b/desktop/source/migration/wizard.cxx
@@ -209,7 +209,6 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
m_aDefaultPath = defineWizardPagesDependingFromContext();
activatePath(m_aDefaultPath, sal_True);
- enterState(STATE_WELCOME);
ActivatePage();
// set text of finish putton:
diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx
index f1214f1283a6..10864b1850f1 100644
--- a/editeng/inc/editeng/svxrtf.hxx
+++ b/editeng/inc/editeng/svxrtf.hxx
@@ -38,7 +38,8 @@
#include <editeng/editengdllapi.h>
#include <deque>
-
+#include <utility>
+#include <vector>
class Font;
class Color;
class Graphic;
@@ -109,7 +110,7 @@ struct SvxRTFStyleType
// Bitmap - Mode
-
+typedef ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > PictPropertyNameValuePairs;
struct EDITENG_DLLPUBLIC SvxRTFPictureType
{
// Format der Bitmap
@@ -140,7 +141,7 @@ struct EDITENG_DLLPUBLIC SvxRTFPictureType
USHORT nWidthBytes;
USHORT nScalX, nScalY;
short nCropT, nCropB, nCropL, nCropR;
-
+ PictPropertyNameValuePairs aPropertyPairs;
SvxRTFPictureType() { ResetValues(); }
// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
void ResetValues();
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 9f919afb39d6..817949294444 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -54,6 +54,7 @@ void SvxRTFPictureType::ResetValues()
nBitsPerPixel = nPlanes = 1;
nScalX = nScalY = 100; // Skalierung in Prozent
nCropT = nCropB = nCropL = nCropR = 0;
+ aPropertyPairs.clear();
}
ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
diff --git a/editeng/source/rtf/makefile.mk b/editeng/source/rtf/makefile.mk
index 38b2ef7b45bc..081cd5b506cd 100644
--- a/editeng/source/rtf/makefile.mk
+++ b/editeng/source/rtf/makefile.mk
@@ -29,12 +29,11 @@ PRJ=..$/..
PRJNAME=editeng
TARGET=rtf
-
+ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
# --- Files --------------------------------------------------------
EXCEPTIONSFILES= \
diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index 24fd4465b031..4b0051cd3c81 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -39,6 +39,7 @@
#include <editeng/svxrtf.hxx>
+using namespace ::rtl;
#ifndef DBG_UTIL
#undef DEBUG_JP
@@ -316,14 +317,26 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
if( RTF_SHPPICT == GetStackPtr(0)->nTokenId )
++nValidDataBraket;
-
+ OUString sShapePropertyName, sShapePropertyValue;
+ int nShapePropertyBracket = -1;
while( _nOpenBrakets && IsParserWorking() && bValidBmp )
{
nToken = GetNextToken();
USHORT nVal = USHORT( nTokenValue );
switch( nToken )
{
- case '}': --_nOpenBrakets; break;
+ case '}':
+ --_nOpenBrakets;
+ if( nShapePropertyBracket > 0 && nShapePropertyBracket > _nOpenBrakets )
+ {
+ nShapePropertyBracket = -1;
+ if( sShapePropertyName.getLength() )
+ {
+ rPicType.aPropertyPairs.push_back( ::std::pair< OUString, OUString >( sShapePropertyName, sShapePropertyValue ) );
+ sShapePropertyName = sShapePropertyValue = ::rtl::OUString();
+ }
+ }
+ break;
case '{':
{
if( RTF_IGNOREFLAG != GetNextToken() )
@@ -439,7 +452,24 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
case RTF_PICCROPB: rPicType.nCropB = (short)nTokenValue; break;
case RTF_PICCROPL: rPicType.nCropL = (short)nTokenValue; break;
case RTF_PICCROPR: rPicType.nCropR = (short)nTokenValue; break;
-
+ case RTF_SP:
+ //read pairs of {\sn Name}{\sv Value}
+ nShapePropertyBracket = _nOpenBrakets;
+ break;
+ case RTF_SN:
+ nToken = GetNextToken();
+ if( nToken != '}' )
+ sShapePropertyName = aToken;
+ else
+ nToken = SkipToken( -1 );
+ break;
+ case RTF_SV:
+ nToken = GetNextToken();
+ if( nToken != '}' )
+ sShapePropertyValue = aToken;
+ else
+ nToken = SkipToken( -1 );
+ break;
case RTF_TEXTTOKEN:
// JP 26.06.98: Bug #51719# - nur TextToken auf 1. Ebene
// auswerten. Alle anderen sind irgendwelche
diff --git a/extensions/prj/build.lst b/extensions/prj/build.lst
index e6a4e02a8096..c6f83f789b92 100644
--- a/extensions/prj/build.lst
+++ b/extensions/prj/build.lst
@@ -1,4 +1,4 @@
-ex extensions : officecfg l10n rdbmaker svx SANE:sane TWAIN:twain np_sdk offuh stoc ZLIB:zlib NULL
+ex extensions : officecfg l10n rdbmaker svx SANE:sane TWAIN:twain np_sdk offuh stoc ZLIB:zlib CURL:curl NULL
ex extensions usr1 - all ex_mkout NULL
ex extensions\inc nmake - all ex_inc NULL
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index e338eeff3b2e..e903707a74ec 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -646,7 +646,7 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
aSelectionHB.Show();
aSelectionLB.SetTabs( &nTabs[0], MAP_PIXEL );
- aSelectionLB.SetWindowBits(WB_CLIPCHILDREN|WB_SORT);
+ aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT);
aSelectionLB.GetModel()->SetSortMode(SortAscending);
::rtl::OUString sActiveSource = pDatMan->getActiveDataSource();
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 99eabba56275..7ad5d944ce43 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -1342,7 +1342,7 @@ namespace pcr
if ( nPropId == PROPERTY_ID_MAXTEXTLEN )
aMinValue.Value = -1;
- else if ( ( nPropId == PROPERTY_ID_BOUNDCOLUMN ) || ( nPropId == PROPERTY_ID_VISIBLESIZE ) )
+ else if ( nPropId == PROPERTY_ID_VISIBLESIZE )
aMinValue.Value = 1;
else
aMinValue.Value = 0;
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 8beb5c557785..5fbbe57dc11b 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -79,7 +79,7 @@ namespace pcr
m_aControlTree.SetSelectionMode( SINGLE_SELECTION );
m_aControlTree.SetDragDropMode( 0 );
m_aControlTree.EnableInplaceEditing( sal_False );
- m_aControlTree.SetWindowBits(WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
+ m_aControlTree.SetStyle(m_aControlTree.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
m_aControlTree.SetNodeBitmaps( m_aModelImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ), m_aModelImages.GetImage( RID_SVXIMG_EXPANDEDNODE ) );
m_aControlTree.SetSelectHdl(LINK(this, OSelectLabelDialog, OnEntrySelected));
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 2889257a1f1c..7b4b258ea43f 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -120,12 +120,13 @@ SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) :
Bitmap( SaneResId( RID_SCAN_BITMAP_PLUS ) ),
Bitmap( SaneResId( RID_SCAN_BITMAP_MINUS ) )
);
- maOptionBox.SetWindowBits( WB_HASLINES |
- WB_HASBUTTONS |
- WB_NOINITIALSELECTION |
- WB_HASBUTTONSATROOT |
- WB_HASLINESATROOT
- );
+ maOptionBox.SetStyle( maOptionBox.GetStyle()|
+ WB_HASLINES |
+ WB_HASBUTTONS |
+ WB_NOINITIALSELECTION |
+ WB_HASBUTTONSATROOT |
+ WB_HASLINESATROOT
+ );
FreeResource();
}
diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
index 7c61f7c14084..20c55429e465 100644
--- a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
+++ b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
@@ -1,5 +1,5 @@
<node oor:name="MS PowerPoint 97" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>sdfilt</value></prop>
diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
index 505084d4d39f..b0776fda9500 100644
--- a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="MS PowerPoint 97 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>sdfilt</value></prop>
diff --git a/filter/source/config/fragments/filters/Rich_Text_Format.xcu b/filter/source/config/fragments/filters/Rich_Text_Format.xcu
index dc8b07e45536..d8fb18c96d06 100644
--- a/filter/source/config/fragments/filters/Rich_Text_Format.xcu
+++ b/filter/source/config/fragments/filters/Rich_Text_Format.xcu
@@ -1,7 +1,7 @@
<node oor:name="Rich Text Format" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"/>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.RtfFilter</value></prop>
<prop oor:name="UserData"><value>RTF</value></prop>
<prop oor:name="UIName">
<value xml:lang="x-default">Rich Text Format</value>
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 46cab18f6c77..9334c892028e 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1433,9 +1433,7 @@ XMLFilterListBox::XMLFilterListBox( SvxPathControl_Impl * pParent )
static long nTabs[] = {3, 0, nTabSize, 2*nTabSize };
Size aHeadSize( mpHeaderBar->GetSizePixel() );
- WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
pParent->SetFocusControl( this );
- SetWindowBits( nBits );
// SetDoubleClickHdl( aLink );
// SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
SetSelectionMode( MULTIPLE_SELECTION );
diff --git a/forms/qa/integration/forms/ListSelection.java b/forms/qa/integration/forms/ListSelection.java
index 24a5290dc1d4..17026c09906e 100644
--- a/forms/qa/integration/forms/ListSelection.java
+++ b/forms/qa/integration/forms/ListSelection.java
@@ -136,8 +136,8 @@ public class ListSelection extends integration.forms.TestCase
}
catch( com.sun.star.uno.Exception e )
{
- System.err.println( e );
e.printStackTrace( System.err );
+ failed( "caught an exception: " + e.toString() );
}
}
@@ -183,6 +183,7 @@ public class ListSelection extends integration.forms.TestCase
catch( com.sun.star.uno.Exception e )
{
e.printStackTrace( System.err );
+ failed( "caught an exception: " + e.toString() );
}
}
@@ -217,6 +218,7 @@ public class ListSelection extends integration.forms.TestCase
catch( com.sun.star.uno.Exception e )
{
e.printStackTrace( System.err );
+ failed( "caught an exception: " + e.toString() );
}
}
@@ -275,6 +277,7 @@ public class ListSelection extends integration.forms.TestCase
catch( java.lang.Throwable e )
{
e.printStackTrace();
+ failed( "caught an exception: " + e.toString() );
}
}
diff --git a/forms/qa/unoapi/knownissues.xcl b/forms/qa/unoapi/knownissues.xcl
index eb8efe91b4f0..66e02dc8d8c4 100644
--- a/forms/qa/unoapi/knownissues.xcl
+++ b/forms/qa/unoapi/knownissues.xcl
@@ -121,10 +121,6 @@ forms.OComboBoxModel::com::sun::star::form::XUpdateBroadcaster
forms.OFileControlModel::com::sun::star::beans::XFastPropertySet
forms.OFileControlModel::com::sun::star::form::FormControlModel
-### i111148 ###
-forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet
-forms.OImageControlModel::com::sun::star::beans::XPropertySet
-
### i113201 ###
forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index 9cbc5237cf95..d664be8e4a86 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/awt/XItemList.hpp>
/** === end UNO includes === **/
#include <comphelper/numbers.hxx>
@@ -342,11 +343,28 @@ namespace frm
case FormComponentType::LISTBOX:
{
- Sequence< ::rtl::OUString> aValueSelection;
- Reference< XPropertySet > aPropertyPointer(getModel(), UNO_QUERY);
- aPropertyPointer->getPropertyValue(PROPERTY_VALUE_SEQ) >>= aValueSelection;
- if (rEvent.Selected <= aValueSelection.getLength())
- aText.append( aValueSelection[ rEvent.Selected ] );
+ try
+ {
+ const Reference< XItemList > xItemList( getModel(), UNO_QUERY_THROW );
+ ::rtl::OUString sItemText( xItemList->getItemText( rEvent.Selected ) );
+
+ const MapString2String::const_iterator itemPos = m_aDisplayItemToValueItem.find( sItemText );
+ if ( itemPos != m_aDisplayItemToValueItem.end() )
+ {
+ sItemText = itemPos->second;
+ if ( sItemText.getLength() )
+ {
+ ::dbtools::OPredicateInputController aPredicateInput( m_aContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
+ ::rtl::OUString sErrorMessage;
+ OSL_VERIFY( aPredicateInput.normalizePredicateString( sItemText, m_xField, &sErrorMessage ) );
+ }
+ }
+ aText.append( sItemText );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
break;
@@ -614,6 +632,16 @@ namespace frm
{
m_aText = aText;
xListBox->selectItem(m_aText, sal_True);
+ if ( xListBox->getSelectedItemPos() >= 0 )
+ {
+ const bool isQuoted = ( aText.getLength() > 0 )
+ && ( aText[0] == '\'' )
+ && ( aText[aText.getLength() - 1] == '\'' );
+ if ( isQuoted )
+ {
+ xListBox->selectItem( aText.copy( 1, aText.getLength() - 2 ), sal_True );
+ }
+ }
}
} break;
default:
@@ -804,6 +832,16 @@ namespace frm
case FormComponentType::LISTBOX:
case FormComponentType::COMBOBOX:
m_nControlClass = nClassId;
+ if ( FormComponentType::LISTBOX == nClassId )
+ {
+ Sequence< ::rtl::OUString > aDisplayItems;
+ OSL_VERIFY( xControlModel->getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= aDisplayItems );
+ Sequence< ::rtl::OUString > aValueItems;
+ OSL_VERIFY( xControlModel->getPropertyValue( PROPERTY_VALUE_SEQ ) >>= aValueItems );
+ OSL_ENSURE( aDisplayItems.getLength() == aValueItems.getLength(), "OFilterControl::initialize: inconsistent item lists!" );
+ for ( sal_Int32 i=0; i < ::std::min( aDisplayItems.getLength(), aValueItems.getLength() ); ++i )
+ m_aDisplayItemToValueItem[ aDisplayItems[i] ] = aValueItems[i];
+ }
break;
default:
m_bMultiLine = ::comphelper::hasProperty( PROPERTY_MULTILINE, xControlModel ) && ::comphelper::getBOOL( xControlModel->getPropertyValue( PROPERTY_MULTILINE ) );
diff --git a/forms/source/component/Filter.hxx b/forms/source/component/Filter.hxx
index 8e2933e93158..99c621d6cdf6 100644
--- a/forms/source/component/Filter.hxx
+++ b/forms/source/component/Filter.hxx
@@ -45,7 +45,7 @@
#include <connectivity/sqlparse.hxx>
#include <svx/ParseContext.hxx>
-class Window;
+#include <hash_map>
//.........................................................................
namespace frm
@@ -75,6 +75,9 @@ namespace frm
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xMessageParent;
+ typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > MapString2String;
+ MapString2String m_aDisplayItemToValueItem;
+
::rtl::OUString m_aText;
::connectivity::OSQLParser m_aParser;
sal_Int16 m_nControlClass; // which kind of control do we use?
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index f9d3ffab9709..de2dda9ca388 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -296,11 +296,11 @@ Sequence< ::rtl::OUString > SAL_CALL OControl::getSupportedServiceNames_Static()
//------------------------------------------------------------------------------
void SAL_CALL OControl::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (RuntimeException)
{
- InterfaceRef xAggAsIface;
+ Reference< XInterface > xAggAsIface;
query_aggregation(m_xAggregate, xAggAsIface);
// does the disposing come from the aggregate ?
- if (xAggAsIface != InterfaceRef(_rEvent.Source, UNO_QUERY))
+ if (xAggAsIface != Reference< XInterface >(_rEvent.Source, UNO_QUERY))
{ // no -> forward it
Reference<com::sun::star::lang::XEventListener> xListener;
if (query_aggregation(m_xAggregate, xListener))
@@ -310,16 +310,16 @@ void SAL_CALL OControl::disposing(const com::sun::star::lang::EventObject& _rEve
// XControl
//------------------------------------------------------------------------------
-void SAL_CALL OControl::setContext(const InterfaceRef& Context) throw (RuntimeException)
+void SAL_CALL OControl::setContext(const Reference< XInterface >& Context) throw (RuntimeException)
{
if (m_xControl.is())
m_xControl->setContext(Context);
}
//------------------------------------------------------------------------------
-InterfaceRef SAL_CALL OControl::getContext() throw (RuntimeException)
+Reference< XInterface > SAL_CALL OControl::getContext() throw (RuntimeException)
{
- return m_xControl.is() ? m_xControl->getContext() : InterfaceRef();
+ return m_xControl.is() ? m_xControl->getContext() : Reference< XInterface >();
}
//------------------------------------------------------------------------------
@@ -711,13 +711,13 @@ void OControlModel::doSetDelegator()
// XChild
//------------------------------------------------------------------------------
-InterfaceRef SAL_CALL OControlModel::getParent() throw(RuntimeException)
+Reference< XInterface > SAL_CALL OControlModel::getParent() throw(RuntimeException)
{
return m_xParent;
}
//------------------------------------------------------------------------------
-void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException)
+void SAL_CALL OControlModel::setParent(const Reference< XInterface >& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException)
{
osl::MutexGuard aGuard(m_aMutex);
@@ -1867,30 +1867,24 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
throw com::sun::star::lang::IllegalArgumentException();
case PROPERTY_ID_CONTROLLABEL:
{
- DBG_ASSERT(!rValue.hasValue() || (rValue.getValueType().getTypeClass() == TypeClass_INTERFACE),
- "OBoundControlModel::setFastPropertyValue_NoBroadcast : invalid argument !");
- if (!rValue.hasValue())
+ if ( rValue.hasValue() && ( rValue.getValueTypeClass() != TypeClass_INTERFACE ) )
+ throw com::sun::star::lang::IllegalArgumentException();
+
+ Reference< XInterface > xNewValue( rValue, UNO_QUERY );
+ if ( !xNewValue.is() )
{ // set property to "void"
- Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY);
- if (xComp.is())
- xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this)));
+ Reference< XComponent > xComp( m_xLabelControl, UNO_QUERY );
+ if ( xComp.is() )
+ xComp->removeEventListener( static_cast< XPropertyChangeListener* >( this ) );
m_xLabelControl = NULL;
break;
}
- InterfaceRef xNewValue;
- rValue >>= xNewValue;
-
- Reference<XControlModel> xAsModel(xNewValue, UNO_QUERY);
- Reference<com::sun::star::lang::XServiceInfo> xAsServiceInfo(xNewValue, UNO_QUERY);
- Reference<XPropertySet> xAsPropSet(xNewValue, UNO_QUERY);
- Reference<XChild> xAsChild(xNewValue, UNO_QUERY);
- if (!xAsModel.is() || !xAsServiceInfo.is() || !xAsPropSet.is() || !xAsChild.is())
- {
- throw com::sun::star::lang::IllegalArgumentException();
- }
-
- if (!xAsServiceInfo->supportsService(m_aLabelServiceName))
+ Reference< XControlModel > xAsModel ( xNewValue, UNO_QUERY );
+ Reference< XServiceInfo > xAsServiceInfo ( xAsModel, UNO_QUERY );
+ Reference< XPropertySet > xAsPropSet ( xAsServiceInfo, UNO_QUERY );
+ Reference< XChild > xAsChild ( xAsPropSet, UNO_QUERY );
+ if ( !xAsChild.is() || !xAsServiceInfo->supportsService( m_aLabelServiceName ) )
{
throw com::sun::star::lang::IllegalArgumentException();
}
@@ -1898,7 +1892,7 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
// check if weself and the given model have a common anchestor (up to the forms collection)
Reference<XChild> xCont;
query_interface(static_cast<XWeak*>(this), xCont);
- InterfaceRef xMyTopLevel = xCont->getParent();
+ Reference< XInterface > xMyTopLevel = xCont->getParent();
while (xMyTopLevel.is())
{
Reference<XForm> xAsForm(xMyTopLevel, UNO_QUERY);
@@ -1907,9 +1901,9 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
break;
Reference<XChild> xLoopAsChild(xMyTopLevel, UNO_QUERY);
- xMyTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : InterfaceRef();
+ xMyTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : Reference< XInterface >();
}
- InterfaceRef xNewTopLevel = xAsChild->getParent();
+ Reference< XInterface > xNewTopLevel = xAsChild->getParent();
while (xNewTopLevel.is())
{
Reference<XForm> xAsForm(xNewTopLevel, UNO_QUERY);
@@ -1917,7 +1911,7 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
break;
Reference<XChild> xLoopAsChild(xNewTopLevel, UNO_QUERY);
- xNewTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : InterfaceRef();
+ xNewTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : Reference< XInterface >();
}
if (xNewTopLevel != xMyTopLevel)
{
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index da335308933e..909cc1f23659 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -64,6 +64,8 @@
#include <unotools/sharedunocomponent.hxx>
#include <vcl/svapp.hxx>
+#include <boost/optional.hpp>
+
#include <algorithm>
#include <functional>
@@ -677,9 +679,13 @@ namespace frm
return;
}
- sal_Int16 nBoundColumn = 0;
- if (m_aBoundColumn.getValueType().getTypeClass() == TypeClass_SHORT)
+ ::boost::optional< sal_Int16 > aBoundColumn;
+ if ( m_aBoundColumn.getValueType().getTypeClass() == TypeClass_SHORT )
+ {
+ sal_Int16 nBoundColumn( 0 );
m_aBoundColumn >>= nBoundColumn;
+ aBoundColumn.reset( nBoundColumn );
+ }
::utl::SharedUNOComponent< XResultSet > xListCursor;
try
@@ -703,14 +709,14 @@ namespace frm
::rtl::OUString aFieldName;
::rtl::OUString aBoundFieldName;
- if ((nBoundColumn > 0) && xFieldsByIndex.is())
+ if ( !!aBoundColumn && ( *aBoundColumn >= 0 ) && xFieldsByIndex.is() )
{
- if (xFieldsByIndex->getCount() <= nBoundColumn)
+ if ( *aBoundColumn >= xFieldsByIndex->getCount() )
break;
- Reference<XPropertySet> xFieldAsSet(xFieldsByIndex->getByIndex(nBoundColumn),UNO_QUERY);
+ Reference<XPropertySet> xFieldAsSet(xFieldsByIndex->getByIndex( *aBoundColumn ),UNO_QUERY);
xFieldAsSet->getPropertyValue(PROPERTY_NAME) >>= aBoundFieldName;
- nBoundColumn = 1;
+ aBoundColumn.reset( 1 );
xFieldAsSet.set(xFieldsByIndex->getByIndex(0),UNO_QUERY);
xFieldAsSet->getPropertyValue(PROPERTY_NAME) >>= aFieldName;
@@ -840,11 +846,11 @@ namespace frm
// Feld der BoundColumn des ResultSets holen
m_nBoundColumnType = DataType::SQLNULL;
- if ( ( nBoundColumn > 0 ) && m_xColumn.is() )
+ if ( !!aBoundColumn && ( *aBoundColumn >= 0 ) && m_xColumn.is() )
{ // don't look for a bound column if we're not connected to a field
try
{
- Reference< XPropertySet > xBoundField( xColumns->getByIndex( nBoundColumn ), UNO_QUERY_THROW );
+ Reference< XPropertySet > xBoundField( xColumns->getByIndex( *aBoundColumn ), UNO_QUERY_THROW );
OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= m_nBoundColumnType );
}
catch( const Exception& )
@@ -868,7 +874,7 @@ namespace frm
if ( impl_hasBoundComponent() )
{
- aBoundValue.fill( nBoundColumn + 1, m_nBoundColumnType, xCursorRow );
+ aBoundValue.fill( *aBoundColumn + 1, m_nBoundColumnType, xCursorRow );
aValueList.push_back( aBoundValue );
}
diff --git a/forms/source/helper/windowstateguard.cxx b/forms/source/helper/windowstateguard.cxx
index c4bb6154a4d5..1bbc8e4242f6 100644
--- a/forms/source/helper/windowstateguard.cxx
+++ b/forms/source/helper/windowstateguard.cxx
@@ -98,7 +98,7 @@ namespace frm
@precond
our mutex is locked
*/
- void impl_ensureEnabledState_nothrow() const;
+ void impl_ensureEnabledState_nothrow_nolck();
};
//--------------------------------------------------------------------
@@ -129,16 +129,24 @@ namespace frm
}
//--------------------------------------------------------------------
- void WindowStateGuard_Impl::impl_ensureEnabledState_nothrow() const
+ void WindowStateGuard_Impl::impl_ensureEnabledState_nothrow_nolck()
{
try
{
- sal_Bool bEnabled = m_xWindow->isEnabled();
+ Reference< XWindow2 > xWindow;
+ sal_Bool bEnabled = sal_False;
sal_Bool bShouldBeEnabled = sal_False;
- OSL_VERIFY( m_xModelProps->getPropertyValue( PROPERTY_ENABLED ) >>= bShouldBeEnabled );
-
- if ( !bShouldBeEnabled && bEnabled )
- m_xWindow->setEnable( sal_False );
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() || !m_xModelProps.is() )
+ return;
+ xWindow = m_xWindow;
+ bEnabled = xWindow->isEnabled();
+ OSL_VERIFY( m_xModelProps->getPropertyValue( PROPERTY_ENABLED ) >>= bShouldBeEnabled );
+ }
+
+ if ( !bShouldBeEnabled && bEnabled && xWindow.is() )
+ xWindow->setEnable( sal_False );
}
catch( const Exception& )
{
@@ -149,15 +157,13 @@ namespace frm
//--------------------------------------------------------------------
void SAL_CALL WindowStateGuard_Impl::windowEnabled( const EventObject& /*e*/ ) throw (RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_ensureEnabledState_nothrow();
+ impl_ensureEnabledState_nothrow_nolck();
}
//--------------------------------------------------------------------
void SAL_CALL WindowStateGuard_Impl::windowDisabled( const EventObject& /*e*/ ) throw (RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_ensureEnabledState_nothrow();
+ impl_ensureEnabledState_nothrow_nolck();
}
//--------------------------------------------------------------------
diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx
index 3c7da5a3f8b0..3f86b4ba21eb 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ -112,7 +112,7 @@ StructPage::StructPage(Window* pParent):
maImgErrorHC ( ModuleRes( BMP_STR_ERROR_H ) ),
pSelectedToken ( NULL )
{
- aTlbStruct.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|
+ aTlbStruct.SetStyle(aTlbStruct.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|
WB_HASBUTTONS|WB_HSCROLL|WB_NOINITIALSELECTION);
aTlbStruct.SetNodeDefaultImages();
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 058005ffdc40..d17ffcb78f9d 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -261,19 +261,30 @@ void ComboboxToolbarController::LoseFocus()
long ComboboxToolbarController::PreNotify( NotifyEvent& rNEvt )
{
- if( rNEvt.GetType() == EVENT_KEYINPUT )
+ switch ( rNEvt.GetType() )
{
- const ::KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
- const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
- if(( rKeyCode.GetModifier() | rKeyCode.GetCode()) == KEY_RETURN )
- {
- // Call execute only with non-empty text
- if ( m_pComboBox->GetText().Len() > 0 )
- execute( rKeyCode.GetModifier() );
- return 1;
- }
+ case EVENT_KEYINPUT :
+ {
+ const ::KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
+ if(( rKeyCode.GetModifier() | rKeyCode.GetCode()) == KEY_RETURN )
+ {
+ // Call execute only with non-empty text
+ if ( m_pComboBox->GetText().Len() > 0 )
+ execute( rKeyCode.GetModifier() );
+ return 1;
+ }
+ }
+ break;
+ case EVENT_GETFOCUS :
+ notifyFocusGet();
+ break;
+ case EVENT_LOSEFOCUS :
+ notifyFocusLost();
+ break;
+ default :
+ break;
}
-
return 0;
}
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
index b81db391966f..ae2719f1c07d 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
@@ -148,11 +148,22 @@ final class ProxyFactory {
private Object request(String operation, Object[] args) throws Throwable
{
- return requestHandler.sendRequest(oid, type, operation, args);
+ Object res = requestHandler.sendRequest(oid, type, operation, args);
+ // Avoid early finalization of this object, while an invoke ->
+ // request call is still ongoing; as finalize also calls request,
+ // this should fulfil the condition from The Java Language
+ // Specification, 3rd ed., that "if an object's finalizer can result
+ // in synchronization on that object, then that object must be alive
+ // and considered reachable whenever a lock is held on it:"
+ synchronized (this) {
+ ++dummy;
+ }
+ return res;
}
private final String oid;
private final Type type;
+ private int dummy = 0;
}
private static final Method METHOD_EQUALS;
diff --git a/odk/configure.pl b/odk/configure.pl
index 789cfac7cd76..e1a1cfb99924 100644..100755
--- a/odk/configure.pl
+++ b/odk/configure.pl
@@ -5,6 +5,7 @@
#
use IO::File;
+use File::Basename;
$main::hostname= $ARGV[0];
$main::sdkpath= $ARGV[1];
@@ -35,7 +36,7 @@ if ( $main::operatingSystem =~ m/darwin/ )
{
# $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`;
} else {
- $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../../ure && pwd`;
+ $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`;
}
chomp($main::OO_SDK_URE_HOME);
@@ -554,15 +555,26 @@ sub resolveLink
{
my $base= shift;
my $link= shift;
- my $linktarget = readlink "$base/$link";
+
+ my $resolvedpath = "$base/$link";
+ my $linktarget = readlink "$resolvedpath";
my $resolvedlink = "";
while ( $linktarget ne "") {
- $link = $linktarget;
- $linktarget = readlink "$base/$link";
+
+ if ( $linktarget =~ m/^\/.*/ )
+ {
+ $resolvedpath = "$linktarget";
+ } else {
+ $resolvedpath = `cd $base/$linktarget; pwd`;
+ chop $resolvedpath;
}
+ $base = dirname("$resolvedpath");
- $resolvedlink = `cd $base/$link; pwd`;
+ $linktarget = readlink "$resolvedpath";
+ }
+
+ $resolvedlink = `cd $resolvedpath; pwd`;
chop $resolvedlink;
return $resolvedlink;
}
@@ -578,6 +590,7 @@ sub searchprog
{
if ( $main::operatingSystem =~ m/darwin/ ) {
$progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK");
+
if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
{
return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 479827565775..ed1c8d587762 100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -5197,7 +5197,12 @@
<value xml:lang="en-US">Delete All Comments by This Author</value>
</prop>
</node>
- <node oor:name=".uno:DeleteNote" oor:op="replace">
+ <node oor:name=".uno:ReplyComment" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Reply Comment</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteComment" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Delete Comment</value>
</prop>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 4fa236666b6b..465c6b37c0cd 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -166,6 +166,16 @@
<value xml:lang="en-US">~Protect Records...</value>
</prop>
</node>
+ <node oor:name=".uno:RejectTracedChange" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Reject Change</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AcceptTracedChange" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Accept Change</value>
+ </prop>
+ </node>
<node oor:name=".uno:UpdateAllLinks" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Links</value>
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 89414f18ce65..037c27f1fdd7 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -53,8 +53,6 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2
::com::sun::star::container::XEnumerationAccess
>
{
- static com::sun::star::uno::Sequence < sal_Int8 > aImplementationId;
-
protected:
ContentHash maContents;
const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
@@ -82,10 +80,7 @@ public:
throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
static void copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource);
- static ::com::sun::star::uno::Sequence < sal_Int8 > static_getImplementationId()
- {
- return aImplementationId;
- }
+ static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId();
void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index be11586bc4fb..2f58595ab4a3 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -54,6 +54,7 @@
#include <rtl/digest.h>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
// since the copying uses 32000 blocks usually, it makes sense to have a smaller size
#define MAX_STORCACHE_SIZE 30000
@@ -2173,25 +2174,14 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
return m_pData->m_pTypeCollection->getTypes() ;
}
+namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
+
//-----------------------------------------------
uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId()
throw( uno::RuntimeException )
{
- static ::cppu::OImplementationId* pID = NULL ;
-
- if ( pID == NULL )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ;
-
- if ( pID == NULL )
- {
- static ::cppu::OImplementationId aID( sal_False ) ;
- pID = &aID ;
- }
- }
-
- return pID->getImplementationId() ;
-
+ ::cppu::OImplementationId &rId = lcl_ImplId::get();
+ return rId.getImplementationId();
}
//-----------------------------------------------
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 9c90c4ce35dd..01489c5b4f5d 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -49,6 +49,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
@@ -2368,25 +2369,14 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes()
return m_pData->m_pTypeCollection->getTypes() ;
}
+namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
+
//-----------------------------------------------
uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId()
throw( uno::RuntimeException )
{
- static ::cppu::OImplementationId* pID = NULL ;
-
- if ( pID == NULL )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ;
-
- if ( pID == NULL )
- {
- static ::cppu::OImplementationId aID( sal_False ) ;
- pID = &aID ;
- }
- }
-
- return pID->getImplementationId() ;
-
+ ::cppu::OImplementationId &rID = lcl_ImplId::get();
+ return rID.getImplementationId();
}
//____________________________________________________________________________________________________
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 9ba26e0100c5..c99cd22d3b4c 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -69,6 +69,7 @@
#include <rtl/uri.hxx>
#include <rtl/random.h>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
#include <osl/time.h>
#include <osl/file.hxx>
#include "com/sun/star/io/XAsyncOutputMonitor.hpp"
@@ -1607,21 +1608,14 @@ uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno::
static_getSupportedServiceNames());
}
+namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
+
// XUnoTunnel
Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId( void )
throw (RuntimeException)
{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ ::cppu::OImplementationId &rId = lcl_ImplId::get();
+ return rId.getImplementationId();
}
sal_Int64 SAL_CALL ZipPackage::getSomething( const Sequence< sal_Int8 >& aIdentifier )
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index f0c4a11d22f4..903191deb6be 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <EncryptedDataHeader.hxx>
#include <rtl/random.h>
+#include <rtl/instance.hxx>
#include <memory>
using namespace com::sun::star::packages::zip::ZipConstants;
@@ -59,7 +60,7 @@ using namespace std;
using namespace ::com::sun::star;
using vos::ORef;
-Sequence < sal_Int8 > ZipPackageFolder::aImplementationId = Sequence < sal_Int8 > ();
+namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory,
sal_Int32 nFormat,
@@ -80,10 +81,9 @@ ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xF
aEntry.nCompressedSize = 0;
aEntry.nSize = 0;
aEntry.nOffset = -1;
- if ( !aImplementationId.getLength() )
- {
- aImplementationId = getImplementationId();
- }
+ Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get();
+ if ( !rCachedImplId.getLength() )
+ rCachedImplId = getImplementationId();
}
@@ -187,6 +187,11 @@ void ZipPackageFolder::copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource)
rDest.nExtraLen = rSource.nExtraLen;
}
+const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageFolder::static_getImplementationId()
+{
+ return lcl_CachedImplId::get();
+}
+
// XNameContainer
void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 6343607c8711..da44dafa000b 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -46,6 +46,8 @@
#include <comphelper/seekableinput.hxx>
#include <comphelper/storagehelper.hxx>
+#include <rtl/instance.hxx>
+
#include <PackageConstants.hxx>
using namespace com::sun::star::packages::zip::ZipConstants;
@@ -56,8 +58,12 @@ using namespace com::sun::star;
using namespace cppu;
using namespace rtl;
-Sequence < sal_Int8 > ZipPackageStream::aImplementationId = Sequence < sal_Int8 > ();
+namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
+const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId()
+{
+ return lcl_CachedImplId::get();
+}
ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
const Reference< XMultiServiceFactory >& xFactory,
@@ -92,10 +98,9 @@ ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
aEntry.nPathLen = -1;
aEntry.nExtraLen = -1;
- if ( !aImplementationId.getLength() )
- {
- aImplementationId = getImplementationId();
- }
+ Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get();
+ if ( !rCachedImplId.getLength() )
+ rCachedImplId = getImplementationId();
}
ZipPackageStream::~ZipPackageStream( void )
diff --git a/package/source/zippackage/ZipPackageStream.hxx b/package/source/zippackage/ZipPackageStream.hxx
index a0d5fad6e4da..38301d5e7d12 100644
--- a/package/source/zippackage/ZipPackageStream.hxx
+++ b/package/source/zippackage/ZipPackageStream.hxx
@@ -55,7 +55,6 @@ class ZipPackageStream : public cppu::ImplInheritanceHelper2
::com::sun::star::packages::XDataSinkEncrSupport
>
{
- static com::sun::star::uno::Sequence < sal_Int8 > aImplementationId;
protected:
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
@@ -146,10 +145,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData()
throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId()
- {
- return aImplementationId;
- }
+ static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId();
// XActiveDataSink
virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream )
diff --git a/qadevOOo/runner/stats/Summarizer.java b/qadevOOo/runner/stats/Summarizer.java
index b1fe5fe61dd3..5f4a58cc31f8 100644
--- a/qadevOOo/runner/stats/Summarizer.java
+++ b/qadevOOo/runner/stats/Summarizer.java
@@ -78,7 +78,7 @@ public class Summarizer
{
if (states.elementAt(j).equals("not part of the job"))
{
- state = "Not possible since not all Interfaces/Services have been checked";
+ state = "PASSED(some interfaces/services not tested).OK";
}
else
{
diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
index dce88234885f..5ac071c38eb5 100644
--- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
+++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
@@ -27,6 +27,7 @@
package mod._forms;
import com.sun.star.beans.NamedValue;
import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
import java.io.PrintWriter;
import lib.StatusException;
@@ -251,11 +252,10 @@ public class GenericModelTest extends TestCase {
if (m_ConnectionColsed) return;
try {
+ XIndexAccess forms = UnoRuntime.queryInterface( XIndexAccess.class,
+ FormTools.getForms( WriterTools.getDrawPage( m_xTextDoc ) ) );
XForm myForm = (XForm) AnyConverter.toObject(new Type(XForm.class),
- (FormTools.getForms(
- WriterTools.getDrawPage(
- m_xTextDoc)))
- .getByName("Standard"));
+ forms.getByIndex(0));
if (debug){
if (myForm == null){
@@ -269,18 +269,20 @@ public class GenericModelTest extends TestCase {
}
- XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, myForm);
- XConnection connection = (XConnection) AnyConverter.toObject(
- new Type(XConnection.class),
- xSetProp.getPropertyValue("ActiveConnection"));
- if (debug && connection == null){
- log.println("ERROR: could not get property 'ActiveConnection' from the XForm");
+ XPropertySet xSetProp = UnoRuntime.queryInterface( XPropertySet.class, myForm );
+ XConnection connection = UnoRuntime.queryInterface( XConnection.class, xSetProp.getPropertyValue( "ActiveConnection" ) );
+ if ( connection == null )
+ {
+ if ( debug )
+ log.println("ERROR: could not get property 'ActiveConnection' from the XForm");
+ }
+ else
+ {
+ connection.close();
}
-
- connection.close();
} catch (Exception e) {
log.println("ERROR: Can't close the connection: " + e.toString());
+ e.printStackTrace( log );
}
log.println("closing data source...");
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 911279ed6f71..f4dd0a7f8645 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -44,12 +44,15 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+#include <com/sun/star/beans/XIntrospection.hpp>
/** === end UNO includes === **/
#include <connectivity/dbtools.hxx>
#include <svl/smplhint.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/stl_types.hxx>
+#include <comphelper/componentcontext.hxx>
#include <vcl/svapp.hxx>
#include <dbaccess/singledoccontroller.hxx>
#include <svx/unoshape.hxx>
@@ -69,8 +72,36 @@ namespace rptui
//----------------------------------------------------------------------------
-DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties);
-DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache);
+struct PropertyInfo
+{
+ bool bIsReadonlyOrTransient;
+
+ PropertyInfo()
+ :bIsReadonlyOrTransient( false )
+ {
+ }
+
+ PropertyInfo( const bool i_bIsTransientOrReadOnly )
+ :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly )
+ {
+ }
+};
+
+typedef ::std::hash_map< ::rtl::OUString, PropertyInfo, ::rtl::OUStringHash > PropertiesInfo;
+
+struct ObjectInfo
+{
+ PropertiesInfo aProperties;
+ Reference< XPropertySet > xPropertyIntrospection;
+
+ ObjectInfo()
+ :aProperties()
+ ,xPropertyIntrospection()
+ {
+ }
+};
+
+typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > > PropertySetInfoCache;
// -----------------------------------------------------------------------------
@@ -85,6 +116,7 @@ public:
ConditionUpdater m_aConditionUpdater;
::osl::Mutex m_aMutex;
::std::vector< uno::Reference< container::XChild> > m_aSections;
+ Reference< XIntrospection > m_xIntrospection;
oslInterlockedCount m_nLocks;
sal_Bool m_bReadOnly;
sal_Bool m_bIsUndo;
@@ -154,7 +186,7 @@ void OXUndoEnvironment::Clear(const Accessor& /*_r*/)
{
uno::Reference<beans::XPropertySet> xProp(aIter->first,uno::UNO_QUERY);
xProp->getPropertySetInfo();
- int nlen = aIter->second.size();
+ int nlen = aIter->second.aProperties.size();
nlen = nlen;
}
#endif
@@ -240,29 +272,73 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
int nlen = m_pImpl->m_aPropertySetCache.size();
nlen = nlen;
#endif
- PropertySetInfoCache::iterator aSetPos = m_pImpl->m_aPropertySetCache.find(xSet);
- if (aSetPos == m_pImpl->m_aPropertySetCache.end())
+ PropertySetInfoCache::iterator objectPos = m_pImpl->m_aPropertySetCache.find(xSet);
+ if (objectPos == m_pImpl->m_aPropertySetCache.end())
{
- AllProperties aNewEntry;
- aSetPos = m_pImpl->m_aPropertySetCache.insert(PropertySetInfoCache::value_type(xSet,aNewEntry)).first;
- DBG_ASSERT(aSetPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
+ objectPos = m_pImpl->m_aPropertySetCache.insert( PropertySetInfoCache::value_type(
+ xSet, ObjectInfo()
+ ) ).first;
+ DBG_ASSERT(objectPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
}
- if ( aSetPos == m_pImpl->m_aPropertySetCache.end() )
+ if ( objectPos == m_pImpl->m_aPropertySetCache.end() )
return;
// now we have access to the cached info about the set
// let's see what we know about the property
- AllProperties& rPropInfos = aSetPos->second;
- AllPropertiesIterator aPropertyPos = rPropInfos.find( _rEvent.PropertyName );
- if (aPropertyPos == rPropInfos.end())
+ ObjectInfo& rObjectInfo = objectPos->second;
+ PropertiesInfo::iterator aPropertyPos = rObjectInfo.aProperties.find( _rEvent.PropertyName );
+ if ( aPropertyPos == rObjectInfo.aProperties.end() )
{ // nothing 'til now ... have to change this ....
// the attributes
- INT32 nAttributes = xSet->getPropertySetInfo()->getPropertyByName( _rEvent.PropertyName ).Attributes;
- bool bTransReadOnly = ((nAttributes & PropertyAttribute::READONLY) != 0) || ((nAttributes & PropertyAttribute::TRANSIENT) != 0);
+ Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW );
+ INT32 nPropertyAttributes = 0;
+ try
+ {
+ if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) )
+ {
+ nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes;
+ }
+ else
+ {
+ // it's perfectly valid for a component to notify a change in a property which it doesn't have - as long
+ // as it has an attribute with this name
+ if ( !rObjectInfo.xPropertyIntrospection.is() )
+ {
+ if ( !m_pImpl->m_xIntrospection.is() )
+ {
+ ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() );
+ OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) );
+ }
+ if ( m_pImpl->m_xIntrospection.is() )
+ {
+ Reference< XIntrospectionAccess > xIntrospection(
+ m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ),
+ UNO_SET_THROW
+ );
+ rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW );
+ }
+ }
+ if ( rObjectInfo.xPropertyIntrospection.is() )
+ {
+ xPSI.set( rObjectInfo.xPropertyIntrospection->getPropertySetInfo(), UNO_SET_THROW );
+ nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ const bool bTransReadOnly =
+ ( ( nPropertyAttributes & PropertyAttribute::READONLY ) != 0 )
+ || ( ( nPropertyAttributes & PropertyAttribute::TRANSIENT ) != 0 );
// insert the new entry
- aPropertyPos = rPropInfos.insert( AllProperties::value_type( _rEvent.PropertyName, bTransReadOnly ) ).first;
- DBG_ASSERT(aPropertyPos != rPropInfos.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
+ aPropertyPos = rObjectInfo.aProperties.insert( PropertiesInfo::value_type(
+ _rEvent.PropertyName,
+ PropertyInfo( bTransReadOnly )
+ ) ).first;
+ DBG_ASSERT(aPropertyPos != rObjectInfo.aProperties.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
}
implSetModified();
@@ -271,7 +347,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
// and are able to decide wether or not we need an undo action
// no UNDO for transient/readonly properties
- if ( aPropertyPos->second )
+ if ( aPropertyPos->second.bIsReadonlyOrTransient )
return;
// give components with sub responsibilities a chance
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 6d13804fe7fa..4ed0e3cd2842 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -984,37 +984,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
::osl::MutexGuard aGuard( getMutex() );
- if ( !getView() )
- {
- switch(_nId)
- {
- case SID_RULER:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_bShowRuler;
- break;
- case SID_HELPLINES_MOVE:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_bHelplinesMove;
- break;
- case SID_GRID_VISIBLE:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_bGridVisible;
- break;
- case SID_SHOW_PROPERTYBROWSER:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_bShowProperties;
- break;
- case SID_PROPERTYBROWSER_LAST_PAGE:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_sLastActivePage;
- break;
- case SID_SPLIT_POSITION:
- OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
- aArgs[0].Value >>= m_nSplitPos;
- break;
- }
- return; // return without execution
- }
+
sal_Bool bForceBroadcast = sal_False;
switch(_nId)
{
@@ -1686,6 +1656,7 @@ short OReportController::saveModified()
{
return RET_NO;
}
+
// -----------------------------------------------------------------------------
void OReportController::impl_initialize( )
{
@@ -1783,7 +1754,7 @@ void OReportController::impl_initialize( )
}
catch(const SQLException&)
{
- OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
// -----------------------------------------------------------------------------
@@ -2745,35 +2716,38 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report:
uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException )
{
::osl::MutexGuard aGuard( getMutex() );
- typedef ::std::pair< ::rtl::OUString,sal_uInt16> TStringIntPair;
- const TStringIntPair pViewDataList[] =
+
+ sal_Int32 nCommandIDs[] =
{
- TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridVisible")), SID_GRID_VISIBLE)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridUse")), SID_GRID_USE)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelplinesMove")), SID_HELPLINES_MOVE)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRuler")), SID_RULER)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlProperties")), SID_SHOW_PROPERTYBROWSER)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LastPropertyBrowserPage")),SID_PROPERTYBROWSER_LAST_PAGE)
- ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitPosition")), SID_SPLIT_POSITION)
+ SID_GRID_VISIBLE,
+ SID_GRID_USE,
+ SID_HELPLINES_MOVE,
+ SID_RULER,
+ SID_SHOW_PROPERTYBROWSER,
+ SID_PROPERTYBROWSER_LAST_PAGE,
+ SID_SPLIT_POSITION
};
- uno::Sequence<beans::PropertyValue> aCommandProps(sizeof(pViewDataList)/sizeof(pViewDataList[0]));
- beans::PropertyValue* pIter = aCommandProps.getArray();
- beans::PropertyValue* pEnd = pIter + aCommandProps.getLength();
- for (sal_Int32 i = 0; pIter != pEnd; ++pIter,++i)
+ ::comphelper::NamedValueCollection aCommandProperties;
+ for ( size_t i=0; i < sizeof( nCommandIDs ) / sizeof( nCommandIDs[0] ); ++i )
{
- FeatureState aFeatureState = GetState(pViewDataList[i].second);
- pIter->Name = pViewDataList[i].first;
+ const FeatureState aFeatureState = GetState( nCommandIDs[i] );
+
+ ::rtl::OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main );
+ OSL_ENSURE( sCommandURL.indexOfAsciiL( ".uno:", 5 ) == 0, "OReportController::getViewData: illegal command URL!" );
+ sCommandURL = sCommandURL.copy( 5 );
+
+ Any aCommandState;
if ( !!aFeatureState.bChecked )
- pIter->Value <<= (*aFeatureState.bChecked) ? sal_True : sal_False;
+ aCommandState <<= (*aFeatureState.bChecked) ? sal_True : sal_False;
else if ( aFeatureState.aValue.hasValue() )
- pIter->Value = aFeatureState.aValue;
+ aCommandState = aFeatureState.aValue;
- } // for (; pIter != pEnd; ++pIter)
+ aCommandProperties.put( sCommandURL, aCommandState );
+ }
- uno::Sequence<beans::PropertyValue> aProps(1);
- aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties"));
- aProps[0].Value <<= aCommandProps;
+ ::comphelper::NamedValueCollection aViewData;
+ aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() );
if ( getDesignView() )
{
@@ -2790,68 +2764,83 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i);
pCollapsedIter->Value <<= static_cast<sal_Int32>(*aIter);
}
- const sal_Int32 nCount = aProps.getLength();
- aProps.realloc( nCount + 1 );
- aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CollapsedSections"));
- aProps[nCount].Value <<= aCollapsedSections;
+
+ aViewData.put( "CollapsedSections", aCollapsedSections );
}
::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow.get() )
{
- const sal_Int32 nCount = aProps.getLength();
- aProps.realloc( nCount + 1 );
- aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection"));
- aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum();
+ aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() );
} // if ( pSectionWindow.get() )
} // if ( getDesignView() )
- const sal_Int32 nCount = aProps.getLength();
- aProps.realloc( nCount + 1 );
- aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor"));
- aProps[nCount].Value <<= m_nZoomValue;
- return uno::makeAny(aProps);
+
+ aViewData.put( "ZoomFactor", m_nZoomValue );
+ return uno::makeAny( aViewData.getPropertyValues() );
}
// -----------------------------------------------------------------------------
-void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException )
+void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data) throw( uno::RuntimeException )
{
::osl::MutexGuard aGuard( getMutex() );
- uno::Sequence<beans::PropertyValue> aProps;
- if ( Data >>= aProps )
+
+ try
{
- const beans::PropertyValue* pPropsIter = aProps.getConstArray();
- const beans::PropertyValue* pPropsEnd = pPropsIter + aProps.getLength();
- for (sal_Int32 i = 0; pPropsIter != pPropsEnd; ++pPropsIter,++i)
+ const ::comphelper::NamedValueCollection aViewData( i_data );
+
+ m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections );
+ m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum );
+ m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue );
+ // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the
+ // view is fully alive, so we need to reflect those 3 values in the view.
+ // (At the moment, the method is called only during construction phase)
+
+
+ ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) );
+ const ::std::vector< ::rtl::OUString > aCommandNames( aCommandProperties.getNames() );
+
+ for ( ::std::vector< ::rtl::OUString >::const_iterator commandName = aCommandNames.begin();
+ commandName != aCommandNames.end();
+ ++commandName
+ )
{
- if ( pPropsIter->Name.equalsAscii("CommandProperties") )
+ const Any& rCommandValue = aCommandProperties.get( *commandName );
+ if ( !rCommandValue.hasValue() )
+ continue;
+
+ if ( getView() )
{
util::URL aCommand;
- uno::Sequence< beans::PropertyValue> aArgs(1);
- beans::PropertyValue* pArg = aArgs.getArray();
- pArg->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"));
- uno::Sequence< beans::PropertyValue> aCommandProps;
- if ( pPropsIter->Value >>= aCommandProps )
- {
- const beans::PropertyValue* pIter = aCommandProps.getConstArray();
- const beans::PropertyValue* pEnd = pIter + aCommandProps.getLength();
- for (; pIter != pEnd; ++pIter)
- {
- pArg->Value = pIter->Value;
- if ( pArg->Value.hasValue() )
- {
- aCommand.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:")) + pIter->Name;
- executeUnChecked(aCommand,aArgs);
- }
- }
- }
+ aCommand.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + *commandName;
+
+ Sequence< PropertyValue > aCommandArgs(1);
+ aCommandArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) );
+ aCommandArgs[0].Value = rCommandValue;
+
+ executeUnChecked( aCommand, aCommandArgs );
+ }
+ else
+ {
+ if ( commandName->equalsAscii( "ShowRuler" ) )
+ OSL_VERIFY( rCommandValue >>= m_bShowRuler );
+ else if ( commandName->equalsAscii( "HelplinesMove" ) )
+ OSL_VERIFY( rCommandValue >>= m_bHelplinesMove );
+ else if ( commandName->equalsAscii( "GridVisible" ) )
+ OSL_VERIFY( rCommandValue >>= m_bGridVisible );
+ else if ( commandName->equalsAscii( "GridUse" ) )
+ OSL_VERIFY( rCommandValue >>= m_bGridUse );
+ else if ( commandName->equalsAscii( "ControlProperties" ) )
+ OSL_VERIFY( rCommandValue >>= m_bShowProperties );
+ else if ( commandName->equalsAscii( "LastPropertyBrowserPage" ) )
+ OSL_VERIFY( rCommandValue >>= m_sLastActivePage );
+ else if ( commandName->equalsAscii( "SplitPosition" ) )
+ OSL_VERIFY( rCommandValue >>= m_nSplitPos );
}
- else if ( pPropsIter->Name.equalsAscii("CollapsedSections") )
- pPropsIter->Value >>= m_aCollapsedSections;
- else if ( pPropsIter->Name.equalsAscii("MarkedSection") )
- pPropsIter->Value >>= m_nPageNum;
- else if ( pPropsIter->Name.equalsAscii("ZoomFactor") )
- pPropsIter->Value >>= m_nZoomValue;
}
}
+ catch ( const IllegalArgumentException& e )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
// -----------------------------------------------------------------------------
void OReportController::updateFloater()
diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h
index 055a7971e7b6..033b24c84360 100644
--- a/sal/inc/osl/diagnose.h
+++ b/sal/inc/osl/diagnose.h
@@ -78,15 +78,7 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf
#define OSL_THIS_FILE __FILE__
/* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */
-#ifdef __func__
-#define OSL_THIS_FUNC __func__
-#elifdef __PRETTY_FUNCTION__
-#define OSL_THIS_FUNC __PRETTY_FUNCTION__
-#elifdef __FUNCTION__
-#define OSL_THIS_FUNC __FUNCTION__
-#else
-#define OSL_THIS_FUNC " "
-#endif
+#define OSL_THIS_FUNC "<unknown>"
/* the macro OSL_TO_STRING is intended to be an office internal macro for now */
#define OSL_TO_STRING( x ) #x
diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h
index 985ce700b049..fa81108df29f 100644
--- a/sal/inc/rtl/math.h
+++ b/sal/inc/rtl/math.h
@@ -319,7 +319,9 @@ void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult,
@param pParsedEnd
If non-null, returns one past the position of the last character parsed
away. Thus if [pBegin..pEnd) only contains the numerical string to be
- parsed, *pParsedEnd == pEnd on return.
+ parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is
+ found, *pParsedEnd == pBegin on return, even if there was leading
+ whitespace.
*/
double SAL_CALL rtl_math_stringToDouble(
sal_Char const * pBegin, sal_Char const * pEnd, sal_Char cDecSeparator,
@@ -357,7 +359,9 @@ double SAL_CALL rtl_math_stringToDouble(
@param pParsedEnd
If non-null, returns one past the position of the last character parsed
away. Thus if [pBegin..pEnd) only contains the numerical string to be
- parsed, *pParsedEnd == pEnd on return.
+ parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is
+ found, *pParsedEnd == pBegin on return, even if there was leading
+ whitespace.
*/
double SAL_CALL rtl_math_uStringToDouble(
sal_Unicode const * pBegin, sal_Unicode const * pEnd,
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 331b91cb1626..452d3eb2db70 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -1022,66 +1022,31 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD
return nRet;
}
- /* HACK: because memory mapping fails on various
- platforms if the size of the source file is 0 byte */
- if (0 == nSourceSize)
- {
- close(SourceFileFD);
- close(DestFileFD);
- return 0;
- }
-
- // read and lseek are used to check the possibility to access the data
- // not a nice solution, but it allows to avoid a crash in case it is an opened samba file
- // generally, reading of one byte should not affect the performance
- char nCh;
- if ( 1 != read( SourceFileFD, &nCh, 1 )
- || -1 == lseek( SourceFileFD, 0, SEEK_SET ) )
- {
- nRet = errno;
- close( SourceFileFD );
- close( DestFileFD );
- return nRet;
- }
-
size_t nWritten = 0;
size_t nRemains = nSourceSize;
- /* mmap file -- open dest file -- write -- fsync it at the end */
- void* pSourceFile = mmap( 0, nSourceSize, PROT_READ, MAP_SHARED, SourceFileFD, 0 );
- if ( pSourceFile != MAP_FAILED )
- {
- nWritten = write( DestFileFD, pSourceFile, nSourceSize );
- nRemains -= nWritten;
- munmap( (char*)pSourceFile, nSourceSize );
- }
-
if ( nRemains )
{
/* mmap has problems, try the direct streaming */
- char pBuffer[32000];
+ char pBuffer[0x8000];
size_t nRead = 0;
nRemains = nSourceSize;
- if ( -1 != lseek( SourceFileFD, 0, SEEK_SET )
- && -1 != lseek( DestFileFD, 0, SEEK_SET ) )
+ do
{
- do
- {
- nRead = 0;
- nWritten = 0;
+ nRead = 0;
+ nWritten = 0;
- size_t nToRead = std::min( (size_t)32000, nRemains );
- nRead = read( SourceFileFD, pBuffer, nToRead );
- if ( (size_t)-1 != nRead )
- nWritten = write( DestFileFD, pBuffer, nRead );
+ size_t nToRead = std::min( (size_t)0x8000, nRemains );
+ nRead = read( SourceFileFD, pBuffer, nToRead );
+ if ( (size_t)-1 != nRead )
+ nWritten = write( DestFileFD, pBuffer, nRead );
- if ( (size_t)-1 != nWritten )
- nRemains -= nWritten;
- }
- while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
+ if ( (size_t)-1 != nWritten )
+ nRemains -= nWritten;
}
+ while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
}
if ( nRemains )
diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index c96c3977f725..06e3958443e9 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -20,3 +20,4 @@ sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util
sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL
sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL
sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL
+sa sal\qa\rtl\math nmake - all sa_qa_rtl_math sa_cppunittester sa_util NULL
diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk
index d46168dc4d0e..e0c1a81d66e3 100644
--- a/sal/qa/OStringBuffer/makefile.mk
+++ b/sal/qa/OStringBuffer/makefile.mk
@@ -33,8 +33,6 @@ PRJ=..$/..
PRJNAME=sal
TARGET=qa_ostringbuffer
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk
index 6bbee03b6aaf..e113ac86edee 100644
--- a/sal/qa/osl/process/makefile.mk
+++ b/sal/qa/osl/process/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_osl_process
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk
index a95db211c2a6..67ad60057c07 100644
--- a/sal/qa/osl/profile/makefile.mk
+++ b/sal/qa/osl/profile/makefile.mk
@@ -33,7 +33,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_osl_profile
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk
index 37ae3718b40d..db4f01eb439b 100755
--- a/sal/qa/rtl/alloc/makefile.mk
+++ b/sal/qa/rtl/alloc/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_alloc
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk
index 6bd3bd89d5a6..704c149d45cd 100755
--- a/sal/qa/rtl/crc32/makefile.mk
+++ b/sal/qa/rtl/crc32/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_crc32
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/digest/makefile.mk b/sal/qa/rtl/digest/makefile.mk
index 415183b7e9a0..7798004ed854 100644
--- a/sal/qa/rtl/digest/makefile.mk
+++ b/sal/qa/rtl/digest/makefile.mk
@@ -29,8 +29,6 @@ INCPRE+= $(PRJ)$/qa$/inc
PRJNAME=sal
TARGET=rtl_digest
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk
index b13ccf420c06..45259fd3cba0 100644
--- a/sal/qa/rtl/doublelock/makefile.mk
+++ b/sal/qa/rtl/doublelock/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_doublelock
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk
index 329769b5d3ec..d6c9c6b674a3 100644
--- a/sal/qa/rtl/locale/makefile.mk
+++ b/sal/qa/rtl/locale/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_locale
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/math/export.exp b/sal/qa/rtl/math/export.exp
deleted file mode 100644
index a13529da5876..000000000000
--- a/sal/qa/rtl/math/export.exp
+++ /dev/null
@@ -1 +0,0 @@
-registerAllTestFunction
diff --git a/sal/qa/rtl/math/makefile.mk b/sal/qa/rtl/math/makefile.mk
index 3b35e52ab1f4..59f2ecc495bb 100644
--- a/sal/qa/rtl/math/makefile.mk
+++ b/sal/qa/rtl/math/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,75 +23,33 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-PRJ=..$/..$/..
-INCPRE+= $(PRJ)$/qa$/inc
+#***********************************************************************/
-PRJNAME=sal
-TARGET=rtl_math
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-ENABLE_EXCEPTIONS=TRUE
+PRJ = ../../..
+PRJNAME = sal
+TARGET = qa_rtl_profile
-# --- Settings -----------------------------------------------------
+ENABLE_EXCEPTIONS = TRUE
-.INCLUDE : settings.mk
-
-CFLAGS+= $(LFS_CFLAGS)
-CXXFLAGS+= $(LFS_CFLAGS)
+.INCLUDE: settings.mk
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-#----------------------------------- OStringBuffer -----------------------------------
-
-SHL1OBJS= \
- $(SLO)$/test_rtl_math.obj
-
-SHL1TARGET= rtl_math
-SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME =$(SHL1TARGET)
-# DEF1EXPORTFILE= export.exp
-SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-
-# --- BEGIN --------------------------------------------------------
-SHL2OBJS= \
- $(SLO)$/rtl_math.obj
-SHL2TARGET= rtl_math2
-SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-
-SHL2IMPLIB= i$(SHL2TARGET)
-DEF2NAME= $(SHL2TARGET)
-SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
-
-
-
-# # --- BEGIN --------------------------------------------------------
-# LLA: this is an old test, which seems not to work
-# sal_setInt64()
-# sal_getInt64()
-# does not exist.
-#
-# SHL3OBJS= \
-# $(SLO)$/rtl_old_testint64.obj
-# SHL3TARGET= rtl_old_testint64
-# SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-#
-# SHL3IMPLIB= i$(SHL3TARGET)
-# DEF3NAME= $(SHL3TARGET)
-# SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
-#
-
-#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLO)/test-rtl-math.obj
+SHL1RPATH = NONE
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1TARGET = test-rtl-math
+SHL1VERSIONMAP = $(PRJ)/qa/export.map
+DEF1NAME = $(SHL1TARGET)
-# --- Targets ------------------------------------------------------
+SLOFILES = $(SHL1OBJS)
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
+.INCLUDE: target.mk
+.INCLUDE: _cppunit.mk
+.END
diff --git a/sal/qa/rtl/math/rtl_math.cxx b/sal/qa/rtl/math/rtl_math.cxx
deleted file mode 100644
index 653106ce0e30..000000000000
--- a/sal/qa/rtl/math/rtl_math.cxx
+++ /dev/null
@@ -1,626 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-#ifdef WIN32
-// LLA: take a look into Microsofts math.h implementation, why this define is need
-#define _USE_MATH_DEFINES
-#endif
-
-#include <math.h>
-#include <testshl/simpleheader.hxx>
-#include <rtl/math.h>
-#include <rtl/string.hxx>
-
-#include "valueequal.hxx"
-
-namespace rtl_math
-{
-
-class test : public CppUnit::TestFixture
-{
-public:
- // initialise your test code values here.
- void setUp()
- {
- }
-
- void tearDown()
- {
- }
-
-
- void equalCheck(double _nResult, double _nExpect) /* throws Exception */
- {
- bool bEqualResult = is_double_equal(_nResult, _nExpect);
-
- rtl::OString sError = "rtl_math_round expected result is wrong should:(";
- sError += rtl::OString::valueOf(_nExpect);
- sError += ") but is:(";
- sError += rtl::OString::valueOf(_nResult);
- sError += ")";
-
- CPPUNIT_ASSERT_MESSAGE(sError.getStr(), bEqualResult == true);
- }
-
- // insert your test code here.
- void round_000()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nValue = M_PI;
- double nResult = 0.0;
-
- nResult = rtl_math_round(nValue, 0, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.0));
-
- nResult = rtl_math_round(nValue, 2, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.14));
-
- nResult = rtl_math_round(nValue, 3, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.142));
-
- nResult = rtl_math_round(nValue, 10, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.1415926536));
- }
-
- // insert your test code here.
- void round_001_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
- }
-
- void round_001_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_002_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
- }
-
- void round_002_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
- }
-// -----------------------------------------------------------------------------
- void round_003_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
- }
-
- void round_003_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_004_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
- }
-
- void round_004_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_005_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
- }
-
- void round_005_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
- }
-// -----------------------------------------------------------------------------
- void round_006_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
- }
-
- void round_006_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_007_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
- }
-
- void round_007_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
- }
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
-
- CPPUNIT_TEST_SUITE(test);
- CPPUNIT_TEST(round_000);
-
- CPPUNIT_TEST(round_001_positiv);
- CPPUNIT_TEST(round_001_negativ);
-
- CPPUNIT_TEST(round_002_positiv);
- CPPUNIT_TEST(round_002_negativ);
-
- CPPUNIT_TEST(round_003_positiv);
- CPPUNIT_TEST(round_003_negativ);
-
- CPPUNIT_TEST(round_004_positiv);
- CPPUNIT_TEST(round_004_negativ);
-
- CPPUNIT_TEST(round_005_positiv);
- CPPUNIT_TEST(round_005_negativ);
-
- CPPUNIT_TEST(round_006_positiv);
- CPPUNIT_TEST(round_006_negativ);
-
- CPPUNIT_TEST(round_007_positiv);
- CPPUNIT_TEST(round_007_negativ);
-
- CPPUNIT_TEST_SUITE_END();
-}; // class test
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_math::test, "rtl_math");
-} // namespace rtl_math
-
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-NOADDITIONAL;
-
diff --git a/sal/qa/rtl/math/rtl_old_testint64.cxx b/sal/qa/rtl/math/rtl_old_testint64.cxx
deleted file mode 100644
index e1f30ac03be6..000000000000
--- a/sal/qa/rtl/math/rtl_old_testint64.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-
-// LLA:
-// this file is converted to use with testshl2
-// original was placed in sal/test/textenc.cxx
-
-// fndef _OSL_DIAGNOSE_H_
-// nclude <osl/diagnose.h>
-// #endif
-
-#include <sal/types.h>
-
-#define TEST_ENSURE(c, m) CPPUNIT_ASSERT_MESSAGE((m), (c))
-
-// #if OSL_DEBUG_LEVEL > 0
-// #define TEST_ENSURE(c, m) OSL_ENSURE(c, m)
-// #else
-// #define TEST_ENSURE(c, m) OSL_VERIFY(c)
-// #endif
-
-#include <testshl/simpleheader.hxx>
-
-// -----------------------------------------------------------------------------
-namespace rtl_math
-{
- class int64 : public CppUnit::TestFixture
- {
- public:
- void test_int64();
-
- CPPUNIT_TEST_SUITE( int64 );
- CPPUNIT_TEST( test_int64 );
- CPPUNIT_TEST_SUITE_END( );
- };
-
-void int64::test_int64()
-{
-#ifndef SAL_INT64_IS_STRUCT
-#ifdef UNX
- sal_Int64 i1 = -3223372036854775807LL;
- sal_uInt64 u1 = 5223372036854775807ULL;
-#else
- sal_Int64 i1 = -3223372036854775807;
- sal_uInt64 u1 = 5223372036854775807;
-#endif
- sal_Int64 i2 = 0;
- sal_uInt64 u2 = 0;
-#else
- sal_Int64 i1;
- sal_setInt64(&i1, 3965190145L, -750499787L);
-
- sal_Int64 i2 = { 0, 0 };
-
- sal_uInt64 u1;
- sal_setUInt64(&u1, 1651507199UL, 1216161073UL);
-
- sal_uInt64 u2 = {0, 0 };
-
-#endif
- sal_uInt32 low = 0;
- sal_Int32 high = 0;
-
- sal_getInt64(i1, &low, &high);
- sal_setInt64(&i2, low, high);
-
- sal_uInt32 ulow = 0;
- sal_uInt32 uhigh = 0;
-
- sal_getUInt64(u1, &ulow, &uhigh);
- sal_setUInt64(&u2, ulow, uhigh);
-
-#ifndef SAL_INT64_IS_STRUCT
- TEST_ENSURE( i1 == i2, "test_int64 error 1");
-
- TEST_ENSURE( u1 == u2, "test_int64 error 2");
-#else
- TEST_ENSURE( (i1.Part1 == i2.Part1) && (i1.Part2 == i2.Part2),
- "test_int64 error 1");
-
- TEST_ENSURE( (u1.Part1 == u2.Part1) && (u1.Part2 == u2.Part2),
- "test_int64 error 2");
-#endif
- return;
-}
-
-} // namespace rtl_math
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_math::int64, "rtl_math" );
-
-// -----------------------------------------------------------------------------
-NOADDITIONAL;
-
-
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
new file mode 100644
index 000000000000..8e9875444280
--- /dev/null
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_sal.hxx"
+#include "sal/config.h"
+
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "rtl/math.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+namespace {
+
+class Test: public CppUnit::TestFixture {
+public:
+ void test_stringToDouble_good() {
+ rtl_math_ConversionStatus status;
+ sal_Int32 end;
+ double res = rtl::math::stringToDouble(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +1.E01foo")),
+ sal_Unicode('.'), sal_Unicode(','), &status, &end);
+ CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RTL_CONSTASCII_LENGTH(" +1.E01")), end);
+ CPPUNIT_ASSERT_EQUAL(10.0, res);
+ }
+
+ void test_stringToDouble_bad() {
+ rtl_math_ConversionStatus status;
+ sal_Int32 end;
+ double res = rtl::math::stringToDouble(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +Efoo")),
+ sal_Unicode('.'), sal_Unicode(','), &status, &end);
+ CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), end);
+ CPPUNIT_ASSERT_EQUAL(0.0, res);
+ }
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(test_stringToDouble_good);
+ CPPUNIT_TEST(test_stringToDouble_bad);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sal/qa/rtl/math/test_rtl_math.cxx b/sal/qa/rtl/math/test_rtl_math.cxx
deleted file mode 100644
index 887e3ddd1214..000000000000
--- a/sal/qa/rtl/math/test_rtl_math.cxx
+++ /dev/null
@@ -1,674 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-
-#include "rtl/math.h"
-#include "rtl/math.hxx"
-#include "rtl/strbuf.hxx"
-#include "rtl/string.h"
-#include "rtl/string.hxx"
-#include "rtl/textenc.h"
-// #include "rtl/tres.h"
-#include <testshl/tresstatewrapper.hxx>
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-#include <stdlib.h>
-
-namespace {
-
-struct FloatTraits
-{
- typedef float Number;
-
- static inline char const * getPrefix() { return "float"; }
-};
-
-struct DoubleTraits
-{
- typedef double Number;
-
- static inline char const * getPrefix() { return "double"; }
-};
-
-struct StringTraits
-{
- typedef rtl::OString String;
-
- static inline char const * getPrefix() { return "OString"; }
-
- static inline rtl::OString createFromAscii(char const * pString)
- { return rtl::OString(pString); }
-
- static inline void appendBuffer(rtl::OStringBuffer & rBuffer,
- rtl::OString const & rString)
- { rBuffer.append(rString); }
-
- static inline rtl::OString doubleToString(double fValue,
- rtl_math_StringFormat eFormat,
- sal_Int32 nDecPlaces,
- sal_Char cDecSeparator,
- bool bEraseTrailingDecZeros)
- {
- return rtl::math::doubleToString(fValue, eFormat, nDecPlaces,
- cDecSeparator, bEraseTrailingDecZeros);
- }
-};
-
-struct UStringTraits
-{
- typedef rtl::OUString String;
-
- static inline char const * getPrefix() { return "OUString"; }
-
- static inline rtl::OUString createFromAscii(char const * pString)
- { return rtl::OUString::createFromAscii(pString); }
-
- static inline void appendBuffer(rtl::OStringBuffer & rBuffer,
- rtl::OUString const & rString)
- { rBuffer.append(rtl::OUStringToOString(rString, RTL_TEXTENCODING_UTF8)); }
-
- static inline rtl::OUString doubleToString(double fValue,
- rtl_math_StringFormat eFormat,
- sal_Int32 nDecPlaces,
- sal_Unicode cDecSeparator,
- bool bEraseTrailingDecZeros)
- {
- return rtl::math::doubleToUString(fValue, eFormat, nDecPlaces,
- cDecSeparator,
- bEraseTrailingDecZeros);
- }
-};
-
-struct TestNumberToString
-{
- double fValue;
- rtl_math_StringFormat eFormat;
- sal_Int32 nDecPlaces;
- char cDecSeparator;
- bool bEraseTrailingDecZeros;
- char const * pResult;
-};
-
-template< typename StringT, typename NumberT >
-bool testNumberToString(hTestResult pTestResult,
- TestNumberToString const & rTest)
-{
- typename NumberT::Number fValue = static_cast< typename NumberT::Number >(rTest.fValue);
- if (fValue != rTest.fValue)
- return true;
-
- // LLA: t_print("size: %d ", sizeof(fValue));
- typename StringT::String aResult1;
-
- aResult1 = StringT::doubleToString(fValue, rTest.eFormat, rTest.nDecPlaces,
- rTest.cDecSeparator,
- rTest.bEraseTrailingDecZeros);
-
- typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult));
-
- // LLA: rtl::OStringBuffer aBuf;
- // LLA: StringT::appendBuffer(aBuf, aResult1);
- // LLA: t_print("aResult1: %s ", aBuf.getStr());
- // LLA:
- // LLA: rtl::OStringBuffer aBuf2;
- // LLA: StringT::appendBuffer(aBuf2, aResult2);
- // LLA: t_print("aResult2: %s\n", aBuf2.getStr());
-
- bool bSuccess = aResult1 == aResult2;
-
- rtl::OStringBuffer aBuffer;
- aBuffer.append(StringT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("/"));
- aBuffer.append(NumberT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" doubleToString("));
- aBuffer.append(fValue);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.nDecPlaces);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): "));
- StringT::appendBuffer(aBuffer, aResult1);
- if (!bSuccess)
- {
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != "));
- StringT::appendBuffer(aBuffer, aResult2);
- }
- // call to the real test checker
- // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math",
- // aBuffer.getStr(), false);
- c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testNumberToString");
- return bSuccess;
-}
-
-template< typename StringT, typename NumberT >
-bool testNumberToString(hTestResult pTestResult,
- TestNumberToString const * pTests, size_t nCount)
-{
- bool bSuccess = true;
- for (size_t i = 0; i < nCount; ++i)
- bSuccess &= testNumberToString< StringT, NumberT >(pTestResult,
- pTests[i]);
- return bSuccess;
-}
-
-struct TestStringToNumberToString
-{
- char const * pValue;
- rtl_math_StringFormat eFormat;
- sal_Int32 nDecPlaces;
- char cDecSeparator;
- bool bEraseTrailingDecZeros;
- char const * pResult;
-};
-
-template< typename StringT >
-bool testStringToNumberToString(hTestResult pTestResult,
- TestStringToNumberToString const & rTest)
-{
- double d = rtl::math::stringToDouble(StringT::createFromAscii(rTest.pValue),
- rTest.cDecSeparator, 0, 0, 0);
- typename StringT::String aResult1(
- StringT::doubleToString(d, rTest.eFormat, rTest.nDecPlaces,
- rTest.cDecSeparator,
- rTest.bEraseTrailingDecZeros));
- typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult));
- bool bSuccess = aResult1 == aResult2;
- rtl::OStringBuffer aBuffer;
- aBuffer.append(StringT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(
- " doubleToString(stringToDouble("));
- aBuffer.append(rTest.pValue);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("), "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.nDecPlaces);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): "));
- StringT::appendBuffer(aBuffer, aResult1);
- if (!bSuccess)
- {
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != "));
- StringT::appendBuffer(aBuffer, aResult2);
- }
- // call to the real test checker
- // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math",
- // aBuffer.getStr(), false);
- c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testStringToNumberToString");
-
- return bSuccess;
-}
-
-template< typename StringT >
-bool testStringToNumberToString(hTestResult pTestResult,
- TestStringToNumberToString const * pTests,
- size_t nCount)
-{
- bool bSuccess = true;
- for (size_t i = 0; i < nCount; ++i)
- bSuccess &= testStringToNumberToString< StringT >(pTestResult,
- pTests[i]);
- return bSuccess;
-}
-
-}
-
-extern "C" sal_Bool SAL_CALL test_rtl_math(hTestResult pTestResult)
-{
- bool bReturn = true;
-
- {
- static TestNumberToString const aTest[]
- = { // 1, 1+2^-1, ..., 1+2^-52
- // Too few decimal digits are printed, so that various different
- // double values lead to the same output:
- { 1, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { 1.5, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.5" },
- { 1.25, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.25" },
- { 1.125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.125" },
- { 1.0625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0625" },
- { 1.03125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.03125" },
- { 1.015625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.015625" },
- { 1.0078125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0078125" },
- { 1.00390625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00390625" },
- { 1.001953125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.001953125" },
- { 1.0009765625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0009765625" },
- { 1.00048828125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00048828125" },
- { 1.000244140625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.000244140625" },
- { 1.0001220703125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0001220703125" },
- { 1.00006103515625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00006103515625" },
- { 1.000030517578125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00003051757813" },
- { 1.0000152587890625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00001525878906" },
- { 1.00000762939453125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000762939453" },
- { 1.000003814697265625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000381469727" },
- { 1.0000019073486328125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000190734863" },
- { 1.00000095367431640625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000095367432" },
- { 1.000000476837158203125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000047683716" },
- { 1.0000002384185791015625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000023841858" },
- { 1.00000011920928955078125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000011920929" },
- { 1.000000059604644775390625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000005960464" },
- { 1.0000000298023223876953125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000002980232" },
- { 1.00000001490116119384765625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000001490116" },
- { 1.000000007450580596923828125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000745058" },
- { 1.0000000037252902984619140625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000372529" },
- { 1.00000000186264514923095703125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000186265" },
- { 1.000000000931322574615478515625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000093132" },
- { 1.0000000004656612873077392578125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000046566" },
- { 1.00000000023283064365386962890625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000023283" },
- { 1.000000000116415321826934814453125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000011642" },
- { 1.0000000000582076609134674072265625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000005821" },
- { 1.00000000002910383045673370361328125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.0000000000291" },
- { 1.000000000014551915228366851806640625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000001455" },
- { 1.0000000000072759576141834259033203125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000728" },
- { 1.00000000000363797880709171295166015625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000364" },
- { 1.000000000001818989403545856475830078125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000182" },
- { 1.0000000000009094947017729282379150390625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000091" },
- { 1.00000000000045474735088646411895751953125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000045" },
- { 1.000000000000227373675443232059478759765625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000023" },
- { 1.0000000000001136868377216160297393798828125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000011" },
- { 1.00000000000005684341886080801486968994140625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000006" },
- { 1.000000000000028421709430404007434844970703125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000003" },
- { 1.0000000000000142108547152020037174224853515625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000001" },
- { 1.00000000000000710542735760100185871124267578125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000001" },
- { 1.000000000000003552713678800500929355621337890625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.0000000000000017763568394002504646778106689453125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.00000000000000088817841970012523233890533447265625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.000000000000000444089209850062616169452667236328125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.0000000000000002220446049250313080847263336181640625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
-
- // 1, 1+2^-1, ..., 1+2^-52
- // Too few decimal digits are printed, so that various different
- // double values lead to the same output:
- { 1, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.5, rtl_math_StringFormat_F, 53, '.', false,
- "1.50000000000000000000000000000000000000000000000000000" },
- { 1.25, rtl_math_StringFormat_F, 53, '.', false,
- "1.25000000000000000000000000000000000000000000000000000" },
- { 1.125, rtl_math_StringFormat_F, 53, '.', false,
- "1.12500000000000000000000000000000000000000000000000000" },
- { 1.0625, rtl_math_StringFormat_F, 53, '.', false,
- "1.06250000000000000000000000000000000000000000000000000" },
- { 1.03125, rtl_math_StringFormat_F, 53, '.', false,
- "1.03125000000000000000000000000000000000000000000000000" },
- { 1.015625, rtl_math_StringFormat_F, 53, '.', false,
- "1.01562500000000000000000000000000000000000000000000000" },
- { 1.0078125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00781250000000000000000000000000000000000000000000000" },
- { 1.00390625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00390625000000000000000000000000000000000000000000000" },
- { 1.001953125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00195312500000000000000000000000000000000000000000000" },
- { 1.0009765625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00097656250000000000000000000000000000000000000000000" },
- { 1.00048828125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00048828125000000000000000000000000000000000000000000" },
- { 1.000244140625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00024414062500000000000000000000000000000000000000000" },
- { 1.0001220703125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00012207031250000000000000000000000000000000000000000" },
- { 1.00006103515625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00006103515625000000000000000000000000000000000000000" },
- { 1.000030517578125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00003051757813000000000000000000000000000000000000000" },
- { 1.0000152587890625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00001525878906000000000000000000000000000000000000000" },
- { 1.00000762939453125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000762939453000000000000000000000000000000000000000" },
- { 1.000003814697265625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000381469727000000000000000000000000000000000000000" },
- { 1.0000019073486328125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000190734863000000000000000000000000000000000000000" },
- { 1.00000095367431640625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000095367432000000000000000000000000000000000000000" },
- { 1.000000476837158203125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000047683716000000000000000000000000000000000000000" },
- { 1.0000002384185791015625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000023841858000000000000000000000000000000000000000" },
- { 1.00000011920928955078125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000011920929000000000000000000000000000000000000000" },
- { 1.000000059604644775390625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000005960464000000000000000000000000000000000000000" },
- { 1.0000000298023223876953125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000002980232000000000000000000000000000000000000000" },
- { 1.00000001490116119384765625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000001490116000000000000000000000000000000000000000" },
- { 1.000000007450580596923828125, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000745058000000000000000000000000000000000000000" },
- { 1.0000000037252902984619140625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000372529000000000000000000000000000000000000000" },
- { 1.00000000186264514923095703125, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000186265000000000000000000000000000000000000000" },
- { 1.000000000931322574615478515625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000093132000000000000000000000000000000000000000" },
- { 1.0000000004656612873077392578125, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000046566000000000000000000000000000000000000000" },
- { 1.00000000023283064365386962890625, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000023283000000000000000000000000000000000000000" },
- { 1.000000000116415321826934814453125, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000011642000000000000000000000000000000000000000" },
- { 1.0000000000582076609134674072265625, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000005821000000000000000000000000000000000000000" },
- { 1.00000000002910383045673370361328125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000002910000000000000000000000000000000000000000" },
- { 1.000000000014551915228366851806640625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000001455000000000000000000000000000000000000000" },
- { 1.0000000000072759576141834259033203125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000728000000000000000000000000000000000000000" },
- { 1.00000000000363797880709171295166015625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000364000000000000000000000000000000000000000" },
- { 1.000000000001818989403545856475830078125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000182000000000000000000000000000000000000000" },
- { 1.0000000000009094947017729282379150390625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000091000000000000000000000000000000000000000" },
- { 1.00000000000045474735088646411895751953125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000045000000000000000000000000000000000000000" },
- { 1.000000000000227373675443232059478759765625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000023000000000000000000000000000000000000000" },
- { 1.0000000000001136868377216160297393798828125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000011000000000000000000000000000000000000000" },
- { 1.00000000000005684341886080801486968994140625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000006000000000000000000000000000000000000000" },
- { 1.000000000000028421709430404007434844970703125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000003000000000000000000000000000000000000000" },
- { 1.0000000000000142108547152020037174224853515625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000001000000000000000000000000000000000000000" },
- { 1.00000000000000710542735760100185871124267578125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000001000000000000000000000000000000000000000" },
- { 1.000000000000003552713678800500929355621337890625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.0000000000000017763568394002504646778106689453125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.00000000000000088817841970012523233890533447265625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.000000000000000444089209850062616169452667236328125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.0000000000000002220446049250313080847263336181640625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" } };
- size_t const nCount = sizeof aTest / sizeof aTest[0];
-
-//LLA: the float tests are wrong here, due to the fact that
-// we calculate with too less digits after the point
-
-// bReturn &= testNumberToString< StringTraits, FloatTraits >(
-// pTestResult, aTest, nCount);
- bReturn &= testNumberToString< StringTraits, DoubleTraits >(
- pTestResult, aTest, nCount);
-// bReturn &= testNumberToString< UStringTraits, FloatTraits >(
-// pTestResult, aTest, nCount);
- bReturn &= testNumberToString< UStringTraits, DoubleTraits >(
- pTestResult, aTest, nCount);
- }
-
- {
- static TestStringToNumberToString const aTest[]
- = { { "1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { "\t1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { "\t 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " \t1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
-
- { "-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { "\t-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { "\t -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " \t-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
-
- { "1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { "\t1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { "\t 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " \t1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
-
- { "-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { "\t-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { "\t -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " \t-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
-
- { "1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { "\t1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { "\t 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " \t1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
-
- { "-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { "\t-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { "\t -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " \t-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
-
- { "3.14E-2000", rtl_math_StringFormat_E, 4, '.', false,
- "0.0000E+000" },
- { "3.14E-200", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-200" },
- { "3.14E-20", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-020" },
- { "3.14E-2", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-002" },
- { "3.14E2", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+002" },
- { "3.14E20", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+020" },
- { "3.14E200", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+200" },
- { "3.14E2000", rtl_math_StringFormat_E, 4, '.', false,
- "1.#INF" },
- };
- size_t const nCount = sizeof aTest / sizeof aTest[0];
- bReturn &= testStringToNumberToString< StringTraits >(
- pTestResult, aTest, nCount);
- bReturn &= testStringToNumberToString< UStringTraits >(
- pTestResult, aTest, nCount);
- }
-
- return bReturn;
-}
-
-// -----------------------------------------------------------------------------
-extern "C" void /* sal_Bool */ SAL_CALL test_rtl_math2( hTestResult hRtlTestResult )
-{
- c_rtl_tres_state_start(hRtlTestResult, "rtl_math" );
-
- test_rtl_math( hRtlTestResult );
-
- c_rtl_tres_state_end(hRtlTestResult, "rtl_math" );
-}
-// -----------------------------------------------------------------------------
-void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
-{
- if (_pFunc)
- {
- (_pFunc)(&test_rtl_math2, "");
- }
-}
diff --git a/sal/qa/rtl/random/makefile.mk b/sal/qa/rtl/random/makefile.mk
index cd57ec9bcc13..ef8616a90916 100644
--- a/sal/qa/rtl/random/makefile.mk
+++ b/sal/qa/rtl/random/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_random
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl_strings/makefile.mk b/sal/qa/rtl_strings/makefile.mk
index 387f0675ace8..708a41a87887 100644
--- a/sal/qa/rtl_strings/makefile.mk
+++ b/sal/qa/rtl_strings/makefile.mk
@@ -28,7 +28,6 @@ PRJ=..$/..
PRJNAME=sal
TARGET=qa_rtl_strings
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx
index d983c5726230..34b940a301c9 100644
--- a/sal/rtl/source/math.cxx
+++ b/sal/rtl/source/math.cxx
@@ -923,7 +923,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd,
if (pStatus != 0)
*pStatus = eStatus;
if (pParsedEnd != 0)
- *pParsedEnd = p;
+ *pParsedEnd = p == p0 ? pBegin : p;
return fVal;
}
diff --git a/sal/systools/win32/kill/kill.cxx b/sal/systools/win32/kill/kill.cxx
index dd7ae85a0af2..ec1379ccfa6b 100644
--- a/sal/systools/win32/kill/kill.cxx
+++ b/sal/systools/win32/kill/kill.cxx
@@ -272,7 +272,7 @@ static void ParseCommandArgs( LPDWORD lpProcesses, LPDWORD lpdwNumProcesses, int
{
for ( int n = 0; n < NumSupportedSignals; n++ )
{
- _tprintf( _T("%s "), SupportedSignals[n] );
+ _tprintf( _T("%s "), SupportedSignals[n].lpSignalName );
}
_tprintf( _T("\n") );
ExitProcess( 0 );
diff --git a/sal/textenc/convertiscii.tab b/sal/textenc/convertiscii.tab
index 60672b8c0188..96f5dc8582c5 100644
--- a/sal/textenc/convertiscii.tab
+++ b/sal/textenc/convertiscii.tab
@@ -108,5 +108,5 @@ static ImplTextEncodingData const aImplIsciiDevanagariTextEncodingData
1,
1,
NULL,
- NULL,
+ "x-iscii-de",
RTL_TEXTENCODING_INFO_ASCII };
diff --git a/sal/textenc/tencinfo.c b/sal/textenc/tencinfo.c
index 0c51a98206e5..30a2fef0da72 100644
--- a/sal/textenc/tencinfo.c
+++ b/sal/textenc/tencinfo.c
@@ -910,6 +910,9 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( const sal_Char* pM
{ "csptcp154", RTL_TEXTENCODING_PT154 },
{ "pt154", RTL_TEXTENCODING_PT154 },
{ "cp154", RTL_TEXTENCODING_PT154 },
+ { "xisciide", RTL_TEXTENCODING_ISCII_DEVANAGARI },
+ /* This is no official MIME character set name, but is in use by
+ various windows APIs. */
{ NULL, RTL_TEXTENCODING_DONTKNOW }
};
@@ -1072,6 +1075,7 @@ rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage)
case 51932: return RTL_TEXTENCODING_EUC_JP;
case 51936: return RTL_TEXTENCODING_EUC_CN;
case 51949: return RTL_TEXTENCODING_EUC_KR;
+ case 57002: return RTL_TEXTENCODING_ISCII_DEVANAGARI;
case 65000: return RTL_TEXTENCODING_UTF7;
case 65001: return RTL_TEXTENCODING_UTF8;
default: return RTL_TEXTENCODING_DONTKNOW;
@@ -1147,6 +1151,7 @@ rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding)
case RTL_TEXTENCODING_EUC_JP: return 51932;
case RTL_TEXTENCODING_EUC_CN: return 51936;
case RTL_TEXTENCODING_EUC_KR: return 51949;
+ case RTL_TEXTENCODING_ISCII_DEVANAGARI: return 57002;
case RTL_TEXTENCODING_UTF7: return 65000;
case RTL_TEXTENCODING_UTF8: return 65001;
default: return 0;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 6f59b64c52fc..d2cc5a7390cf 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -179,7 +179,7 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
pTPView->SetRejectAllClickHdl( LINK( this, ScAcceptChgDlg,RejectAllHandle));
pTPView->SetAcceptAllClickHdl( LINK(this, ScAcceptChgDlg, AcceptAllHandle));
pTheView->SetCalcView();
- pTheView->SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ pTheView->SetStyle(pTheView->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
pTheView->SetExpandingHdl( LINK(this, ScAcceptChgDlg, ExpandingHandle));
pTheView->SetSelectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
pTheView->SetDeselectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 89f818e21928..5ff5ca570ee4 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -514,7 +514,7 @@ ScConflictsDlg::ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocume
aHeader += maStrTitleDate;
maLbConflicts.InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER );
- maLbConflicts.SetWindowBits( WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ maLbConflicts.SetStyle( maLbConflicts.GetStyle() | WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
maLbConflicts.SetSelectionMode( MULTIPLE_SELECTION );
maLbConflicts.SetHighlightRange();
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 418a88b3cbea..d165c2362d7e 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -145,7 +145,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
maBtnEdit.SetClickHdl( LINK( this, ScSolverOptionsDialog, ButtonHdl ) );
- maLbSettings.SetWindowBits( WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
+ maLbSettings.SetStyle( maLbSettings.GetStyle()|WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
maLbSettings.SetHelpId( HID_SC_SOLVEROPTIONS_LB );
maLbSettings.SetHighlightRange();
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index a417621bb303..0b991bb83220 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -145,6 +145,8 @@ ScContentTree::ScContentTree( Window* pParent, const ResId& rResId ) :
SetNodeDefaultImages();
SetDoubleClickHdl( LINK( this, ScContentTree, ContentDoubleClickHdl ) );
+
+ SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
ScContentTree::~ScContentTree()
@@ -1327,11 +1329,11 @@ BOOL ScContentTree::LoadFile( const String& rUrl )
void ScContentTree::InitWindowBits( BOOL bButtons )
{
- WinBits nFlags = WB_CLIPCHILDREN|WB_HSCROLL;
+ WinBits nFlags = GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL;
if (bButtons)
nFlags |= WB_HASBUTTONS|WB_HASBUTTONSATROOT;
- SetWindowBits( nFlags );
+ SetStyle( nFlags );
}
void ScContentTree::SetRootType( USHORT nNew )
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c92525b8ca57..86a8b4d42530 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1275,6 +1275,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
rBookmarks.clear();
}
+ if ( pDrawView )
+ pDrawView->HideSdrPage();
delete pDrawView;
}
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 3a28096d2853..d4c5d714b2ee 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -282,7 +282,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20)
nEndCol = 20;
- if (nEndRow<1000)
+ if (nEndRow<20)
nEndRow = 1000;
Fraction aZoom(1,1);
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 1d2b797b3a9b..489da0cc4899 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -376,7 +376,7 @@ void ScDrawView::RecalcScale()
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20)
nEndCol = 20;
- if (nEndRow<1000)
+ if (nEndRow<20)
nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY,
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index f16c2fe1ada7..cdb7e8acfba7 100755..100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -265,7 +265,7 @@ MapMode ScGridWindow::GetDrawMapMode( BOOL bForce )
SCROW nEndRow = 0;
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20) nEndCol = 20;
- if (nEndRow<1000) nEndRow = 1000;
+ if (nEndRow<20) nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, this,
pViewData->GetZoomX(),pViewData->GetZoomY(),
pViewData->GetPPTX(),pViewData->GetPPTY(),
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index cacfb19cad6b..7718cce4d4f5 100755
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1346,7 +1346,7 @@ STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter)
STD_LIB_FILE( gid_File_Lib_Sw , sw)
STD_LIB_FILE( gid_File_Lib_Swui, swui)
-STD_LIB_FILE( gid_File_Lib_Msword, msword )
+STD_UNO_LIB_FILE( gid_File_Lib_Msword, msword )
#if ! defined UNX
File gid_File_Lib_Sysdtrans
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index c6de155e3ed0..24bba1e7bff6 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -80,11 +80,33 @@ namespace basprov
,m_documentBasicManager( &documentBasicManager )
,m_xDocumentScriptContext( documentScriptContext )
{
+ StartListening( *m_documentBasicManager );
}
// -----------------------------------------------------------------------------
BasicScriptImpl::~BasicScriptImpl()
{
+ if ( m_documentBasicManager )
+ EndListening( *m_documentBasicManager );
+ }
+
+ // -----------------------------------------------------------------------------
+ // SfxListener
+ // -----------------------------------------------------------------------------
+ void BasicScriptImpl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+ {
+ if ( &rBC != m_documentBasicManager )
+ {
+ OSL_ENSURE( false, "BasicScriptImpl::Notify: where does this come from?" );
+ // not interested in
+ return;
+ }
+ const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ if ( pSimpleHint && ( pSimpleHint->GetId() == SFX_HINT_DYING ) )
+ {
+ m_documentBasicManager = NULL;
+ EndListening( rBC ); // prevent multiple notifications
+ }
}
// -----------------------------------------------------------------------------
diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx
index 4a3d6f1ab61d..772a9166cde3 100644
--- a/scripting/source/basprov/basscript.hxx
+++ b/scripting/source/basprov/basscript.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <cppuhelper/implbase1.hxx>
#include <basic/sbmeth.hxx>
+#include <svl/lstner.hxx>
class BasicManager;
@@ -49,7 +50,7 @@ namespace basprov
::com::sun::star::script::provider::XScript > BasicScriptImpl_BASE;
- class BasicScriptImpl : public BasicScriptImpl_BASE
+ class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener
{
private:
SbMethodRef m_xMethod;
@@ -80,6 +81,9 @@ namespace basprov
::com::sun::star::script::provider::ScriptFrameworkErrorException,
::com::sun::star::reflection::InvocationTargetException,
::com::sun::star::uno::RuntimeException );
+
+ // SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
};
//.........................................................................
diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk
index c98f961e6bd3..bde15f95d5a4 100644
--- a/scripting/source/basprov/makefile.mk
+++ b/scripting/source/basprov/makefile.mk
@@ -58,6 +58,7 @@ SHL1STDLIBS= \
$(SFX2LIB) \
$(BASICLIB) \
$(VCLLIB) \
+ $(SVLLIB) \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
$(COMPHELPERLIB) \
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index ff1250bdf090..2be4b9f9055d 100755
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -99,7 +99,7 @@ static xub_StrLen lcl_getMaxSafeStrLen(sal_uInt32 nSize)
if (nSize > STRING_MAXLEN)
nSize = STRING_MAXLEN;
- return nSize;
+ return xub_StrLen( nSize );
}
BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign )
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 7c07ec76127a..8dbb9fd95c41 100644..100755
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -477,7 +477,7 @@ CustomAnimationList::CustomAnimationList( ::Window* pParent, const ResId& rResId
, mpController( pController )
, mpLastParentEntry(0)
{
- SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT ) );
+ SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT );
EnableContextMenuHandling();
SetSelectionMode( MULTIPLE_SELECTION );
diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx
index f9dcf5046189..aa2e234b0868 100755
--- a/sd/source/ui/dlg/dlgassim.cxx
+++ b/sd/source/ui/dlg/dlgassim.cxx
@@ -49,10 +49,10 @@ SdPageListControl::SdPageListControl(
: SvTreeListBox(pParent, rResId)
{
// Tree-ListBox mit Linien versehen
- SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES |
+ SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
WB_HASBUTTONS | WB_HASLINESATROOT |
WB_HSCROLL | // #31562#
- WB_HASBUTTONSATROOT ) );
+ WB_HASBUTTONSATROOT );
SetNodeDefaultImages ();
m_pCheckButton = new SvLBoxButtonData(this);
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 275d39af4ea5..c0a72d539add 100755
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -258,10 +258,11 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId )
{
// Tree-ListBox mit Linien versehen
- SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES |
- WB_HASBUTTONS | // WB_HASLINESATROOT |
- WB_HSCROLL | // #31562#
- WB_HASBUTTONSATROOT ) );
+ SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
+ WB_HASBUTTONS | // WB_HASLINESATROOT |
+ WB_HSCROLL | // #31562#
+ WB_HASBUTTONSATROOT |
+ WB_QUICK_SEARCH /* i31275 */ );
SetNodeBitmaps( Bitmap( SdResId( BMP_EXPAND ) ),
Bitmap( SdResId( BMP_COLLAPSE ) ) );
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index dc98929a9ed1..1aea2d34156e 100755
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -218,6 +218,7 @@ public:
static BOOL IsInDrag();
using SvLBox::ExecuteDrop;
+ using SvTreeListBox::SelectEntry;
private:
/** This flag controls whether all shapes are shown as children of pages
and group shapes or only the named shapes.
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
index f499e10b418c..fbbcebe7ab7f 100755
--- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
@@ -512,13 +512,18 @@ ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rVi
SetName( String( RTL_CONSTASCII_USTRINGPARAM( "ToolPanelViewShell" ) ) );
- // Some recent changes to the toolpanel make it necessary to create the
- // accessibility object now. Creating it on demand would lead to a
- // pointer cycle in the tree of accessibility objects and would lead
- // e.g. the accerciser AT tool into an infinite loop.
- // It would be nice to get rid of this workaround in the future.
+ // enforce the creation of the Accessible object here.
+ // In some not-always-to-reproduce situations, creating the accessible on demand only leads to some
+ // cycliy parenthood references between the involved objects, which make some AT tools (accerciser, in particular)
+ // loop (which is /not/ a bug in the tool, of course).
+ // However, since those situations were not reproducible anymore, we deliberately leave the Accessible creation
+ // (which originally was intended as a workaround) herein. Better to be safe ...
+ // Note that this is not a performance problem: The implementation of the ToolPanelDeck's Accessible
+ // is separated from the implementation of its AccessibleContext (which even is in a separate library) - we only
+ // create the former here, the latter is still created on demand, when somebody requests it.
+ // #i113671# / 2010-09-17 / frank.schoenheit@oracle.com
if (mpContentWindow.get())
- mpContentWindow->SetAccessible(mpImpl->CreateAccessible(*mpContentWindow));
+ mpContentWindow->GetAccessible( TRUE );
// For accessibility we have to shortly hide the content window. This
// triggers the construction of a new accessibility object for the new
@@ -629,12 +634,7 @@ DockingWindow* ToolPanelViewShell::GetDockingWindow()
Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow )
{
ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL );
- // As said above, we have to create the accessibility object
- // (unconditionally) in the constructor, not here on demand, or
- // otherwise we would create a cycle in the tree of accessible objects
- // which could lead to infinite loops in AT tools.
- // return mpImpl->CreateAccessible( *i_pWindow );
- return Reference<XAccessible>();
+ return mpImpl->CreateAccessible( *i_pWindow );
}
// ---------------------------------------------------------------------------------------------------------------------
diff --git a/sdext/source/pdfimport/config/pdf_import_filter.xcu b/sdext/source/pdfimport/config/pdf_import_filter.xcu
index 89ad84b7a6cf..628be6db8be9 100644
--- a/sdext/source/pdfimport/config/pdf_import_filter.xcu
+++ b/sdext/source/pdfimport/config/pdf_import_filter.xcu
@@ -20,7 +20,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
- <value xml:lang="x-default">PDF - Portable Document Format</value>
+ <value xml:lang="x-default">PDF - Portable Document Format (Draw)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
@@ -49,7 +49,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
- <value xml:lang="x-default">PDF - Portable Document Format</value>
+ <value xml:lang="x-default">PDF - Portable Document Format (Impress)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
@@ -78,7 +78,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
- <value xml:lang="x-default">PDF - Portable Document Format</value>
+ <value xml:lang="x-default">PDF - Portable Document Format (Writer)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
diff --git a/setup_native/scripts/install_solaris.sh b/setup_native/scripts/install_solaris.sh
index 624999f44f37..bb792bcf2618 100644
--- a/setup_native/scripts/install_solaris.sh
+++ b/setup_native/scripts/install_solaris.sh
@@ -244,7 +244,7 @@ else
CMD=/tmp/userinstall.$$; echo "" > $CMD
fi
-sed -e 's|"/|"${PKG_INSTALL_ROOT}/|g' > $CMD
+sed -e 's|/opt/|${PKG_INSTALL_ROOT}/opt/|g' > $CMD
/bin/sh -e $CMD
rm -f $CMD
EOF
diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx
index ba6a9b844b7a..a63f665c1071 100644
--- a/sfx2/inc/sfx2/mgetempl.hxx
+++ b/sfx2/inc/sfx2/mgetempl.hxx
@@ -37,6 +37,9 @@
#include <sfx2/tabdlg.hxx>
+#include <svtools/svmedit2.hxx>
+#include <svtools/svmedit.hxx>
+
/* erwartet:
SID_TEMPLATE_NAME : In: StringItem, Name der Vorlage
SID_TEMPLATE_FAMILY : In: Familie der Vorlage
@@ -54,6 +57,8 @@ class SfxManageStyleSheetPage : public SfxTabPage
{
FixedText aNameFt;
Edit aNameEd;
+ ExtMultiLineEdit aNameMLE;
+
CheckBox aAutoCB;
FixedText aFollowFt;
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 578dd1fd33bb..00ee49a18004 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -1484,8 +1484,8 @@ public:
*/
SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
- sal_Bool IsDisposed() const ;
sal_Bool IsInitialized() const;
+ void MethodEntryCheck( const bool i_mustBeInitialized ) const;
::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ) throw (::com::sun::star::uno::RuntimeException);
@@ -1573,10 +1573,7 @@ public:
SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
:m_aGuard( Application::GetSolarMutex() )
{
- if ( i_rModel.IsDisposed() )
- throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *&i_rModel );
- if ( ( i_eState != E_INITIALIZING ) && !i_rModel.IsInitialized() )
- throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_rModel );
+ i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
}
~SfxModelGuard()
{
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 9ab4a50b63d8..895748db6c20 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -93,6 +93,8 @@
#define SID_MAIL_PRIORITY (SID_SFX_START + 337)
#define SID_MAIL_ATTACH_FILE (SID_SFX_START + 375)
+#define SID_MAIL_PREPAREEXPORT (SID_SFX_START + 385)
+#define SID_MAIL_NEEDS_PREPAREEXPORT (SID_SFX_START + 386)
#define SID_MAIL_EXPORT_FINISHED (SID_SFX_START + 388)
#define SID_WEBHTML (SID_SFX_START + 393)
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 9235777e0d5a..1d79b89a776d 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -300,7 +300,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId )
aDocumentImage = Image( SfxResId( IMG_HELP_CONTENT_DOC_HC ) );
}
- SetWindowBits( WB_HIDESELECTION | WB_HSCROLL );
+ SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL );
SetEntryHeight( 16 );
SetSelectionMode( SINGLE_SELECTION );
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 0e0c6ec22ee1..dfd099f6cf45 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -53,13 +53,11 @@
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/document/XExporter.hpp>
-#ifndef _RTL_TEXTENC_H
-#include <rtl/textench.h>
-#endif
#include <rtl/uri.h>
#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
@@ -84,6 +82,7 @@
#include <comphelper/mediadescriptor.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
+#include <cppuhelper/implbase1.hxx>
// --------------------------------------------------------------
using namespace ::com::sun::star;
@@ -98,6 +97,54 @@ using namespace ::com::sun::star::system;
using namespace ::rtl;
namespace css = ::com::sun::star;
+// - class PrepareListener_Impl ------------------------------------------
+class PrepareListener_Impl : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
+{
+ bool m_bState;
+public:
+ PrepareListener_Impl();
+ virtual ~PrepareListener_Impl();
+
+ // css.frame.XStatusListener
+ virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& aEvent)
+ throw(css::uno::RuntimeException);
+
+ // css.lang.XEventListener
+ virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
+ throw(css::uno::RuntimeException);
+
+ bool IsSet() const {return m_bState;}
+};
+
+/*-- 25.08.2010 14:32:49---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+PrepareListener_Impl::PrepareListener_Impl() :
+ m_bState( false )
+{
+}
+/*-- 25.08.2010 14:32:51---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+PrepareListener_Impl::~PrepareListener_Impl()
+{
+}
+/*-- 25.08.2010 14:32:51---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void PrepareListener_Impl::statusChanged(const css::frame::FeatureStateEvent& rEvent) throw(css::uno::RuntimeException)
+{
+ if( rEvent.IsEnabled )
+ rEvent.State >>= m_bState;
+ else
+ m_bState = sal_False;
+}
+/*-- 25.08.2010 14:32:52---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/) throw(css::uno::RuntimeException)
+{
+}
// class AddressList_Impl ------------------------------------------------
@@ -547,46 +594,68 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
aArgs[nNumArgs-1].Value = css::uno::makeAny( aPassword );
}
- if ( bModified || !bHasLocation || bStoreTo )
+ bool bNeedsPreparation = false;
+ css::util::URL aPrepareURL;
+ css::uno::Reference< css::frame::XDispatch > xPrepareDispatch;
+ css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY );
+ css::uno::Reference< css::util::XURLTransformer > xURLTransformer(
+ xSMGR->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
+ css::uno::UNO_QUERY );
+ if( !bSendAsPDF )
{
- // Document is modified, is newly created or should be stored in a special format
try
{
- css::uno::Reference< css::util::XURLTransformer > xURLTransformer(
- xSMGR->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- css::uno::UNO_QUERY );
-
- css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY );
- css::uno::Reference< css::frame::XDispatch > xDispatch;
+ // check if the document needs to be prepared for sending as mail (embedding of links, removal of invisible content)
- css::util::URL aURL;
- css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
+ if ( xURLTransformer.is() )
+ {
+ aPrepareURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" ));
+ xURLTransformer->parseStrict( aPrepareURL );
+ }
- if( !bSendAsPDF )
+ if ( xDispatchProvider.is() )
{
- if ( xURLTransformer.is() )
+ xPrepareDispatch = css::uno::Reference< css::frame::XDispatch >(
+ xDispatchProvider->queryDispatch( aPrepareURL, ::rtl::OUString(), 0 ));
+ if ( xPrepareDispatch.is() )
{
- aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" ));
- xURLTransformer->parseStrict( aURL );
+ PrepareListener_Impl* pPrepareListener;
+ uno::Reference< css::frame::XStatusListener > xStatusListener = pPrepareListener = new PrepareListener_Impl;
+ xPrepareDispatch->addStatusListener( xStatusListener, aPrepareURL );
+ bNeedsPreparation = pPrepareListener->IsSet();
+ xPrepareDispatch->removeStatusListener( xStatusListener, aPrepareURL );
}
+ }
+ }
+ catch ( css::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( css::uno::Exception& )
+ {
+ }
+ }
- if ( xDispatchProvider.is() )
+ if ( bModified || !bHasLocation || bStoreTo || bNeedsPreparation )
+ {
+ // Document is modified, is newly created or should be stored in a special format
+ try
+ {
+ if( bNeedsPreparation && xPrepareDispatch.is() )
+ {
+ if ( xPrepareDispatch.is() )
{
- xDispatch = css::uno::Reference< css::frame::XDispatch >(
- xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
- if ( xDispatch.is() )
+ try
+ {
+ css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
+ xPrepareDispatch->dispatch( aPrepareURL, aDispatchArgs );
+ }
+ catch ( css::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( css::uno::Exception& )
{
- try
- {
- xDispatch->dispatch( aURL, aDispatchArgs );
- }
- catch ( css::uno::RuntimeException& )
- {
- throw;
- }
- catch ( css::uno::Exception& )
- {
- }
}
}
}
@@ -608,6 +677,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
if( !bSendAsPDF )
{
+ css::util::URL aURL;
// #i30432# notify that export is finished - the Writer may want to restore removed content
if ( xURLTransformer.is() )
{
@@ -617,12 +687,13 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
if ( xDispatchProvider.is() )
{
- xDispatch = css::uno::Reference< css::frame::XDispatch >(
+ css::uno::Reference< css::frame::XDispatch > xDispatch = css::uno::Reference< css::frame::XDispatch >(
xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ));
if ( xDispatch.is() )
{
try
{
+ css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
xDispatch->dispatch( aURL, aDispatchArgs );
}
catch ( css::uno::RuntimeException& )
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 1f5472cf2052..1666916b0c0b 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -65,6 +65,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem
aNameFt ( this, SfxResId( FT_NAME ) ),
aNameEd ( this, SfxResId( ED_NAME ) ),
+ aNameMLE ( this, SfxResId( MLE_NAME ) ),
aAutoCB ( this, SfxResId( CB_AUTO ) ),
aFollowFt ( this, SfxResId( FT_NEXT ) ),
@@ -147,8 +148,17 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem
}
aNameEd.SetText(pStyle->GetName());
- if ( !pStyle->IsUserDefined() )
+ // Set the field read-only if it is NOT an user-defined style
+ // but allow selecting and copying
+ if ( !pStyle->IsUserDefined() ) {
aNameEd.SetReadOnly();
+ aNameEd.Hide();
+
+ aNameMLE.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
+ aNameMLE.SetText( pStyle->GetName() );
+ aNameMLE.EnableCursor( FALSE );
+ aNameMLE.Show();
+ }
if ( pStyle->HasFollowSupport() && pPool )
{
diff --git a/sfx2/source/dialog/mgetempl.hrc b/sfx2/source/dialog/mgetempl.hrc
index e998baba939d..a34700846f9c 100644
--- a/sfx2/source/dialog/mgetempl.hrc
+++ b/sfx2/source/dialog/mgetempl.hrc
@@ -25,6 +25,7 @@
*
************************************************************************/
#define ED_NAME 2
+#define MLE_NAME 13
#define LB_NEXT 4
#define FT_BASE 5
#define LB_BASE 6
diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src
index bfa3948d90ac..c478ed715646 100644
--- a/sfx2/source/dialog/mgetempl.src
+++ b/sfx2/source/dialog/mgetempl.src
@@ -49,6 +49,14 @@ TabPage TP_MANAGE_STYLES
Pos = MAP_APPFONT ( 70 , 6 ) ;
Size = MAP_APPFONT ( 184 , 12 ) ;
};
+ MultiLineEdit MLE_NAME
+ {
+ Pos = MAP_APPFONT ( 70 , 8 ) ;
+ Size = MAP_APPFONT ( 80 , 12 ) ;
+ Border = FALSE;
+ ReadOnly = TRUE;
+ Hide = TRUE;
+ };
CheckBox CB_AUTO
{
HelpID = "sfx2:CheckBox:TP_MANAGE_STYLES:CB_AUTO";
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index a3d9fd7b4ed2..88801d95f0d5 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -756,7 +756,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ),
pbDeleted ( NULL ),
- aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT ),
+ aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH ),
aFilterLb ( pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP ),
nActFamily ( 0xffff ),
@@ -780,7 +780,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
{
aFmtLb.SetHelpId( HID_TEMPLATE_FMT );
aFilterLb.SetHelpId( HID_TEMPLATE_FILTER );
- aFmtLb.SetWindowBits( WB_SORT | WB_HIDESELECTION );
+ aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION );
Font aFont = aFmtLb.GetFont();
aFont.SetWeight( WEIGHT_NORMAL );
aFmtLb.SetFont( aFont );
@@ -823,7 +823,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod
bBindingUpdate ( TRUE )
{
- aFmtLb.SetWindowBits( WB_SORT );
+ aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT );
}
//-------------------------------------------------------------------------
@@ -1776,7 +1776,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
pTreeBox = new StyleTreeListBox_Impl(
this, WB_HASBUTTONS | WB_HASLINES |
WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT |
- WB_HASBUTTONSATROOT | WB_HIDESELECTION );
+ WB_HASBUTTONSATROOT | WB_HIDESELECTION | WB_QUICK_SEARCH );
pTreeBox->SetFont( aFmtLb.GetFont() );
pTreeBox->SetPosSizePixel(aFmtLb.GetPosPixel(), aFmtLb.GetSizePixel());
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index beb43c192810..8e440de0757c 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -239,7 +239,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, BOOL bIsSaveVersion
aVersionBox.SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) );
aVersionBox.GrabFocus();
- aVersionBox.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN );
+ aVersionBox.SetStyle( aVersionBox.GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
aVersionBox.SetSelectionMode( SINGLE_SELECTION );
aVersionBox.SetTabs( &nTabs_Impl[0], MAP_APPFONT );
aVersionBox.Resize(); // OS: Hack fuer richtige Selektion
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 846cc669b9a7..ee449d15b419 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2599,11 +2599,6 @@ SfxObjectShell* SfxBaseModel::impl_getObjectShell() const
// public impl.
//________________________________________________________________________________________________________
-sal_Bool SfxBaseModel::IsDisposed() const
-{
- return ( m_pData == NULL ) ;
-}
-
sal_Bool SfxBaseModel::IsInitialized() const
{
if ( !m_pData || !m_pData->m_pObjectShell )
@@ -2615,6 +2610,14 @@ sal_Bool SfxBaseModel::IsInitialized() const
return m_pData->m_pObjectShell->GetMedium() != NULL;
}
+void SfxBaseModel::MethodEntryCheck( const bool i_mustBeInitialized ) const
+{
+ if ( impl_isDisposed() )
+ throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *const_cast< SfxBaseModel* >( this ) );
+ if ( i_mustBeInitialized && !IsInitialized() )
+ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *const_cast< SfxBaseModel* >( this ) );
+}
+
sal_Bool SfxBaseModel::impl_isDisposed() const
{
return ( m_pData == NULL ) ;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 93c4eeb33cee..19aa4b75ee0f 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1438,11 +1438,11 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
try
{
Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
- Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW );
+ Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData() );
// find the view data item whose ViewId matches the ID of the view we're just connecting to
const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
- const sal_Int32 nCount = xViewData->getCount();
+ const sal_Int32 nCount = xViewData.is() ? xViewData->getCount() : 0;
sal_Int32 nViewDataIndex = 0;
for ( sal_Int32 i=0; i<nCount; ++i )
{
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 5c41ba167c55..968d0cbe8676 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -252,7 +252,7 @@ SfxViewShell_Impl::SfxViewShell_Impl(USHORT const nFlags)
, m_bGotOwnership(false)
, m_bGotFrameOwnership(false)
, m_eScroll(SCROLLING_DEFAULT)
-, m_nFamily(-1) // undefined, default set by TemplateDialog
+, m_nFamily(0xFFFF) // undefined, default set by TemplateDialog
, m_pController(0)
, m_pAccExec(0)
{}
@@ -2061,6 +2061,7 @@ void Change( Menu* pMenu, SfxViewShell* pView )
if ( pSlot )
{
pMenu->InsertItem( pSlot->GetSlotId(), pMenu->GetItemText( nId ), pMenu->GetItemBits( nId ), nPos );
+ pMenu->SetItemCommand( pSlot->GetSlotId(), aCmd );
pMenu->RemoveItem( nPos+1 );
break;
}
diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk
index cc91a6b1ad5c..290798bab18e 100755
--- a/shell/qa/makefile.mk
+++ b/shell/qa/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..
PRJNAME=shell
TARGET=qa
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index c8ac40799cea..bb743960afc5 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -170,7 +170,7 @@ void initMapiMessage(
pMapiMessage->lpszSubject = const_cast<char*>(gSubject.c_str());
pMapiMessage->lpszNoteText = (gBody.length() ? const_cast<char*>(gBody.c_str()) : NULL);
pMapiMessage->lpOriginator = aMapiOriginator;
- pMapiMessage->lpRecips = &aMapiRecipientList[0];
+ pMapiMessage->lpRecips = aMapiRecipientList.size() ? &aMapiRecipientList[0] : 0;
pMapiMessage->nRecipCount = aMapiRecipientList.size();
pMapiMessage->lpFiles = &aMapiAttachmentList[0];
pMapiMessage->nFileCount = aMapiAttachmentList.size();
diff --git a/smoketestoo_native/data/Events.xml b/smoketestoo_native/data/Events.xml
index 6536c1c5eafc..61272293f633 100644
--- a/smoketestoo_native/data/Events.xml
+++ b/smoketestoo_native/data/Events.xml
@@ -28,28 +28,6 @@
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Events" script:language="StarBasic">REM ***** BASIC *****
-Sub InitEvents
- call ClickCutTest
-End Sub
-
-Sub ClickSaveTest
- if not OptionsDlg.cbSaveTest.Value then
- OptionsDlg.cbOpenTest.Value = false
- OptionsDlg.cbOpenTest.Enabled = false
- else
- OptionsDlg.cbOpenTest.Enabled = true
- end If
-End Sub
-
-Sub ClickCutTest
- if not OptionsDlg.cbCutTest.Value then
- OptionsDlg.cbPasteTest.Value = false
- OptionsDlg.cbPasteTest.Enabled = false
- else
- OptionsDlg.cbPasteTest.Enabled = true
- end If
-End Sub
-
Sub PressCancel
gDlgState = cDlgCancel
end Sub
diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml
index 364d2e2efcfb..1ff082b0a1eb 100644
--- a/smoketestoo_native/data/Global.xml
+++ b/smoketestoo_native/data/Global.xml
@@ -35,7 +35,7 @@ const cParagraphBreak = 0
global const cExtensionFileName = &quot;TestExtension.oxt&quot;
-global const cDocNew = 0, cDocCut = 1, cDocPaste = 2, cDocSaveOpen8 = 3, cDocSaveOpenXML = 4, cDocSaveOpen50 = 5, cDocClose = 6, cDocWrite = 7
+global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4, cDocWrite = 5
global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5
global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2
global const cLogfileFailed = 255
@@ -83,8 +83,8 @@ Global const cUserFieldTestWriter = &quot;Writer&quot;, cUserFieldTestCalc = &qu
Global const cUserFieldTestDraw = &quot;Draw&quot;, cUserFieldTestMath = &quot;Math&quot;, cUserFieldTestChart = &quot;Chart&quot;
Global const cUserFieldTestHTML = &quot;HTML&quot;, cUserFieldTestJava = &quot;Java&quot;, cUserFieldTestDatabase = &quot;Database&quot;
Global const cUserFieldTestExtension = &quot;Extension&quot;
-Global const cUserFieldTestOpenSaveXML = &quot;SaveOpenXML&quot;, cUserFieldTestOpenSave50 = &quot;SaveOpen50&quot;, cUserFieldTestCut = &quot;Cut&quot;
-Global const cUserFieldTestPaste = &quot;Paste&quot;, cUserFieldTestTerminateAfterTest = &quot;Terminate&quot;, cUserFieldTestOpenSave8 = &quot;SaveOpen8&quot;
+Global const cUserFieldTestOpenSaveXML = &quot;SaveOpenXML&quot;, cUserFieldTestOpenSave50 = &quot;SaveOpen50&quot;
+Global const cUserFieldTestTerminateAfterTest = &quot;Terminate&quot;, cUserFieldTestOpenSave8 = &quot;SaveOpen8&quot;
Global const cOptionsDialogName = &quot;OptionsDlg&quot;, cTest10Modul = &quot;Standard&quot;
@@ -100,8 +100,8 @@ Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest a
Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean
Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean
Global bMakeExtensionTest as boolean
-Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean, bMakeCutTest as boolean
-Global bMakePasteTest as boolean, bMakeTerminateAfterTest as boolean, bShowTable as boolean
+Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean
+Global bMakeTerminateAfterTest as boolean, bShowTable as boolean
Global bMakeSaveOpen8Test as boolean
global sExtensionURL as string
@@ -156,10 +156,8 @@ Sub CreateStatusTable
tableHeaders(cStHTML) = &quot;HTML&quot;
tableHeaders(cStJava) = &quot;Java&quot;
- dim tableColums(5) as string
+ dim tableColums(3) as string
tableColums(cDocNew) = &quot;new&quot;
- tableColums(cDocCut) = &quot;cut&quot;
- tableColums(cDocPaste) = &quot;paste&quot;
tableColums(cDocSaveOpen8) = &quot;V8.0&quot;
tableColums(cDocSaveOpenXML) = &quot;XML&quot;
tableColums(cDocSaveOpen50) = &quot;V5.0&quot;
@@ -211,7 +209,7 @@ Sub CreateStatusTable
xCell.BackTransparent = False
xCell.BackColor = cCoGrey
- for i% = 0 to 5
+ for i% = 0 to 3
tableCursor.goDown(1,FALSE)
cName = tableCursor.getRangeName()
xCell = table.getCellByName(cName)
@@ -509,8 +507,6 @@ Sub SetOptions
SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).getState), gOutPutDoc)
SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).getState), gOutPutDoc)
SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestCut, -(gOptionsDialog.getControl(&quot;cbCutTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestPaste, -(gOptionsDialog.getControl(&quot;cbPasteTest&quot;).getState), gOutPutDoc)
SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).getState), gOutPutDoc)
end Sub
@@ -529,8 +525,6 @@ Sub GetOptions
gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)))
gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)))
gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbCutTest&quot;).setState( -( GetUserFieldState (cUserFieldTestCut, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbPasteTest&quot;).setState( -( GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)))
gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)))
End Sub
@@ -549,8 +543,6 @@ Sub ReadOptions
bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)
bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)
bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)
- bMakeCutTest = GetUserFieldState (cUserFieldTestCut, gOutPutDoc)
- bMakePasteTest = GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)
bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)
end Sub
@@ -579,8 +571,6 @@ Sub SetDefaultOptions
bMakeSaveOpen50Test = true
End If
bMakeSaveOpen8Test = true
- bMakeCutTest = true
- bMakePasteTest = true
bMakeTerminateAfterTest = false
end Sub
@@ -614,10 +604,8 @@ Function StartTestWithDefaultOptions
component(cStJava) = &quot;Java&quot;
component(cStDataBase) = &quot;Base&quot;
component(cStExtension) = &quot;Extensions&quot;
- dim action(5) as string
+ dim action(3) as string
action(cDocNew) = &quot;new&quot;
- action(cDocCut) = &quot;cut&quot;
- action(cDocPaste) = &quot;paste&quot;
action(cDocSaveOpen8) = &quot;V8.0&quot;
action(cDocSaveOpenXML) = &quot;XML&quot;
action(cDocSaveOpen50) = &quot;V5.0&quot;
@@ -700,14 +688,6 @@ Sub ExecuteSlot( SlotNr As String, oDoc as Object )
End Sub
-Sub CutText (oDoc as Object)
- ExecuteSlot (&quot;5710&quot;, oDoc)
-End Sub
-
-Sub PasteText (oDoc as Object)
- ExecuteSlot (&quot;5712&quot;, oDoc)
-End Sub
-
Sub DelAllUserFields (aDoc as Object)
Dim aFieldType as Object
Dim aElements as Variant
diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml
index b993a31c9a27..213c880d4d51 100644
--- a/smoketestoo_native/data/OptionsDlg.xml
+++ b/smoketestoo_native/data/OptionsDlg.xml
@@ -43,22 +43,20 @@
<dlg:checkbox dlg:id="cbChartTest" dlg:tab-index="8" dlg:left="126" dlg:top="105" dlg:width="80" dlg:height="8" dlg:value="Chart" dlg:checked="false"/>
<dlg:checkbox dlg:id="cbSaveOpenXMLTest" dlg:tab-index="9" dlg:left="19" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Save / Open XML" dlg:checked="false"/>
<dlg:checkbox dlg:id="cbSaveOpen50Test" dlg:tab-index="10" dlg:left="19" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Save / Open V5.0" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbCutTest" dlg:tab-index="11" dlg:left="19" dlg:top="77" dlg:width="80" dlg:height="8" dlg:value="Cut" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbPasteTest" dlg:tab-index="12" dlg:left="19" dlg:top="91" dlg:width="80" dlg:height="8" dlg:value="Paste" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbTerminateAfterTest" dlg:tab-index="13" dlg:disabled="true" dlg:left="19" dlg:top="174" dlg:width="190" dlg:height="8" dlg:value="Terminate Office after test" dlg:checked="false"/>
- <dlg:titledbox dlg:id="fmBroker" dlg:tab-index="14" dlg:left="7" dlg:top="169" dlg:width="208" dlg:height="17"/>
- <dlg:button dlg:id="btOk" dlg:tab-index="15" dlg:left="7" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Ok" dlg:button-type="ok">
+ <dlg:checkbox dlg:id="cbTerminateAfterTest" dlg:tab-index="11" dlg:disabled="true" dlg:left="19" dlg:top="174" dlg:width="190" dlg:height="8" dlg:value="Terminate Office after test" dlg:checked="false"/>
+ <dlg:titledbox dlg:id="fmBroker" dlg:tab-index="12" dlg:left="7" dlg:top="169" dlg:width="208" dlg:height="17"/>
+ <dlg:button dlg:id="btOk" dlg:tab-index="13" dlg:left="7" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Ok" dlg:button-type="ok">
<script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressOk" script:language="StarBasic"/>
</dlg:button>
- <dlg:button dlg:id="btCancel" dlg:tab-index="16" dlg:left="80" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Cancel" dlg:button-type="ok">
+ <dlg:button dlg:id="btCancel" dlg:tab-index="14" dlg:left="80" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Cancel" dlg:button-type="ok">
<script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressCancel" script:language="StarBasic"/>
</dlg:button>
- <dlg:button dlg:id="btStart" dlg:tab-index="17" dlg:left="152" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Smoketest">
+ <dlg:button dlg:id="btStart" dlg:tab-index="15" dlg:left="152" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Smoketest">
<script:event script:event-name="on-performaction" script:location="vnd.sun.star.script" script:macro-name="Standard.Events.PressTest?language=Basic&amp;location=document" script:language="Script"/>
</dlg:button>
- <dlg:checkbox dlg:id="cbJavaTest" dlg:tab-index="18" dlg:left="126" dlg:top="119" dlg:width="80" dlg:height="8" dlg:value="Java" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbSaveOpen8Test" dlg:tab-index="19" dlg:left="19" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Save / Open V8.0" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbDatabaseTest" dlg:tab-index="20" dlg:left="126" dlg:top="133" dlg:width="80" dlg:height="8" dlg:value="Database" dlg:checked="false"/>
- <dlg:checkbox dlg:id="cbExtensionTest" dlg:tab-index="21" dlg:left="126" dlg:top="147" dlg:width="80" dlg:height="8" dlg:value="Extension" dlg:checked="false"/>
+ <dlg:checkbox dlg:id="cbJavaTest" dlg:tab-index="16" dlg:left="126" dlg:top="119" dlg:width="80" dlg:height="8" dlg:value="Java" dlg:checked="false"/>
+ <dlg:checkbox dlg:id="cbSaveOpen8Test" dlg:tab-index="17" dlg:left="19" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Save / Open V8.0" dlg:checked="false"/>
+ <dlg:checkbox dlg:id="cbDatabaseTest" dlg:tab-index="18" dlg:left="126" dlg:top="133" dlg:width="80" dlg:height="8" dlg:value="Database" dlg:checked="false"/>
+ <dlg:checkbox dlg:id="cbExtensionTest" dlg:tab-index="19" dlg:left="126" dlg:top="147" dlg:width="80" dlg:height="8" dlg:value="Extension" dlg:checked="false"/>
</dlg:bulletinboard>
</dlg:window>
diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml
index 636dc2129120..e39a39eae2aa 100644
--- a/smoketestoo_native/data/Test_10er.xml
+++ b/smoketestoo_native/data/Test_10er.xml
@@ -42,8 +42,6 @@ const cMessageSaveOpenXMLDoc = &quot;Save/Open Document XML (6/7)&quot;
const cMessageSaveOpen50Doc = &quot;Save/Open Document 5.0&quot;
const cMessageNewDoc = &quot;New Document&quot;
const cMessageCloseDoc = &quot;Close Document&quot;
-const cMessageCutObj = &quot;Cut Object&quot;
-const cMessagePasteObj = &quot;Paste Object&quot;
Global sWorkPath$
Global sWorkPathURL$
@@ -294,12 +292,6 @@ Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer)
sWriteStr = sText
sWriteStr = sWriteStr + &quot;new&quot;
if bTestAll then
- if bMakeCutTest then
- sWriteStr = sWriteStr + &quot;, cut&quot;
- end if
- if bMakePasteTest then
- sWriteStr = sWriteStr + &quot;, paste&quot;
- end if
if bMakeSaveOpen8Test then
sWriteStr = sWriteStr + &quot;, save 8.0&quot;
end if
@@ -364,9 +356,6 @@ Sub MakeDocTest (FilterType as Integer)
LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
SetStatus (FilterType, cDocNew, not IsNull (oDoc))
if not IsNull (oDoc) then
- nCurrentAction = cDocCut
- call CutAndPaste(FilterType, oDoc)
-&apos; bError = oDoc.CurrentController.frame.close
nCurrentAction = cDocSaveOpen8
if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then
sFileName8 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt8)
@@ -674,10 +663,6 @@ Function GetErrorMessageOnAction (nAction as Integer) as String
Select Case ( nAction )
case cDocNew
GetErrorMessageOnAction = cMessageNewDoc
- case cDocCut
- GetErrorMessageOnAction = cMessageCutObj
- case cDocPaste
- GetErrorMessageOnAction = cMessagePasteObj
case cDocSaveOpen8
GetErrorMessageOnAction = cMessageSaveOpen8Doc
case cDocSaveOpenXML
@@ -712,152 +697,6 @@ Function TestJava (FilterType as Integer) as boolean
TestJava = not IsNull (oObj)
End Function
-Sub CutAndPaste (DocType as Integer, oDoc as Object)
- Dim sText as String
- Dim oWin as Object
- Dim oText as Object
- Dim oView as Object
- Dim bCutState as boolean, bPasteState as boolean
- Select Case ( DocType )
- case frmWriter
- Dim oCursor as Object
-
- sText = &quot;AutomaticText&quot;
- oText = oDoc.GetText
- oCursor = oText.CreateTextCursor
- oText.InsertString(oCursor, sText, true) &apos; Cursor selektiert den Text
- oView = oDoc.getCurrentController
- oView.Select(oCursor)
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if oText.GetString = &quot;&quot; Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if oText.GetString = sText Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
-
- case frmCalc
- DIM oCell as Object
-
- sText = &quot;AutomaticText&quot;
- oCell = oDoc.Sheets(0).GetCellByPosition(0, 0)
- oCell.String = sText
- oView = oDoc.getCurrentController
- oView.Select(oCell)
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if oCell.String = &quot;&quot; Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if oCell.String = sText Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
- case frmMessage
- case frmImpress, frmDraw
- Dim oPage as Object
- Dim oRect as Object
- Dim xSize as Object
- Dim xPoint as Object
- Dim bObjState as Boolean
-
- xSize = CreateUnoStruct (&quot;com.sun.star.awt.Size&quot;)
- xPoint = CreateUnoStruct (&quot;com.sun.star.awt.Point&quot;)
- xSize.Width = 2000
- xSize.Height = 2000
- xPoint.x = 10000
- xPoint.y = 10000
- oPage = oDoc.DrawPages(0)
-
- if DocType = frmImpress Then
- oPage.Layout = 20 &apos; set page layot to none
- end If
-
- oRect = oDoc.CreateInstance(&quot;com.sun.star.drawing.RectangleShape&quot;)
- oRect.Size = xSize
- oRect.Position = xPoint
- oPage.add(oRect)
-
- oView = oDoc.getCurrentController
- oView.Select(oRect)
-
- &apos; Prüft ob überhaupt ein Object angelegt wurde
- if oPage.count = 1 Then
- bObjState = True
- else
- bObjState = False
- end If
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if (oPage.count = 0) and bObjState Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- wait (1000) &apos;wait after cut
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if (oPage.count = 1) and bObjState Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
- case frmMath
- case frmImage
- case frmHyperText
- case frmChart
- end Select
-end Sub
-
Sub LoadLibrary( LibName as String )
dim args(1)
diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml
index bc63d1d2c551..dcd31b1759e4 100644
--- a/smoketestoo_native/data/content.xml
+++ b/smoketestoo_native/data/content.xml
@@ -25,4 +25,4 @@
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
-<office:document-content xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2" grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl" office:class="text"><office:script/><office:font-decls><style:font-decl style:name="Arial Unicode MS" fo:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-decl style:name="HG Mincho Light J" fo:font-family="&apos;HG Mincho Light J&apos;, &apos;MS Mincho&apos;, &apos;HG Mincho J&apos;, &apos;HG Mincho L&apos;, &apos;HG Mincho&apos;, Mincho, &apos;MS PMincho&apos;, &apos;MS Gothic&apos;, &apos;HG Gothic J&apos;, &apos;HG Gothic B&apos;, &apos;HG Gothic&apos;, Gothic, &apos;MS PGothic&apos;, &apos;Andale Sans UI&apos;, &apos;Arial Unicode MS&apos;, &apos;Lucida Sans Unicode&apos;, Tahoma" style:font-pitch="variable"/><style:font-decl style:name="Thorndale" fo:font-family="Thorndale, &apos;Times New Roman&apos;, Times, &apos;Lucida Serif&apos;, &apos;Lucida Bright&apos;, Timmons, &apos;New York&apos;, Serif" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-decl style:name="Arial" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph"><style:properties fo:text-align="center"/></style:style><style:style style:name="gr1" style:family="graphics"><style:properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/></style:style></office:automatic-styles><office:body><office:forms form:automatic-focus="false" form:apply-design-mode="false"><form:form form:name="Standard" form:apply-filter="true" form:command-type="table" form:service-name="com.sun.star.form.component.Form" office:target-frame="" xlink:href=""><form:control form:name="options" form:service-name="com.sun.star.form.component.CommandButton" form:id="control1"><form:button form:label="options" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ShowOptionsDlg" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="start" form:service-name="com.sun.star.form.component.CommandButton" form:id="control2"><form:button form:label="start smoketest" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.StartTestByOptions" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="table" form:service-name="com.sun.star.form.component.CommandButton" form:id="control3"><form:button form:label="delete table" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ClearAllText" script:location="document" script:library="document"/></office:events></form:button></form:control></form:form></office:forms><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:user-field-decls><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Writer"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Calc"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Impress"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Draw"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="HTML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Math"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Chart"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpenXML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen50"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Cut"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Paste"/><text:user-field-decl text:value-type="string" text:string-value="n" text:name="Terminate"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Java"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen8"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Database"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Extension"/></text:user-field-decls><text:p text:style-name="Standard"><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control2"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control1"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control3"/></text:p><text:p text:style-name="Standard"/></office:body></office:document-content>
+<office:document-content xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2" grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl" office:class="text"><office:script/><office:font-decls><style:font-decl style:name="Arial Unicode MS" fo:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-decl style:name="HG Mincho Light J" fo:font-family="&apos;HG Mincho Light J&apos;, &apos;MS Mincho&apos;, &apos;HG Mincho J&apos;, &apos;HG Mincho L&apos;, &apos;HG Mincho&apos;, Mincho, &apos;MS PMincho&apos;, &apos;MS Gothic&apos;, &apos;HG Gothic J&apos;, &apos;HG Gothic B&apos;, &apos;HG Gothic&apos;, Gothic, &apos;MS PGothic&apos;, &apos;Andale Sans UI&apos;, &apos;Arial Unicode MS&apos;, &apos;Lucida Sans Unicode&apos;, Tahoma" style:font-pitch="variable"/><style:font-decl style:name="Thorndale" fo:font-family="Thorndale, &apos;Times New Roman&apos;, Times, &apos;Lucida Serif&apos;, &apos;Lucida Bright&apos;, Timmons, &apos;New York&apos;, Serif" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-decl style:name="Arial" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph"><style:properties fo:text-align="center"/></style:style><style:style style:name="gr1" style:family="graphics"><style:properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/></style:style></office:automatic-styles><office:body><office:forms form:automatic-focus="false" form:apply-design-mode="false"><form:form form:name="Standard" form:apply-filter="true" form:command-type="table" form:service-name="com.sun.star.form.component.Form" office:target-frame="" xlink:href=""><form:control form:name="options" form:service-name="com.sun.star.form.component.CommandButton" form:id="control1"><form:button form:label="options" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ShowOptionsDlg" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="start" form:service-name="com.sun.star.form.component.CommandButton" form:id="control2"><form:button form:label="start smoketest" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.StartTestByOptions" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="table" form:service-name="com.sun.star.form.component.CommandButton" form:id="control3"><form:button form:label="delete table" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ClearAllText" script:location="document" script:library="document"/></office:events></form:button></form:control></form:form></office:forms><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:user-field-decls><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Writer"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Calc"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Impress"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Draw"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="HTML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Math"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Chart"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpenXML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen50"/><text:user-field-decl text:value-type="string" text:string-value="n" text:name="Terminate"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Java"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen8"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Database"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Extension"/></text:user-field-decls><text:p text:style-name="Standard"><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control2"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control1"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control3"/></text:p><text:p text:style-name="Standard"/></office:body></office:document-content>
diff --git a/solenv/inc/_tg_shl.mk b/solenv/inc/_tg_shl.mk
index 3d91783988b9..14a64e2b54ab 100644
--- a/solenv/inc/_tg_shl.mk
+++ b/solenv/inc/_tg_shl.mk
@@ -538,16 +538,6 @@ $(SHL1TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL1TARGET)
-
-runtest_$(SHL1TARGET) : $(SHL1TARGETN)
- testshl $(SHL1TARGETN) sce/$(SHL1TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL1TARGETN)"!=""
# unroll begin
@@ -1090,16 +1080,6 @@ $(SHL2TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL2TARGET)
-
-runtest_$(SHL2TARGET) : $(SHL2TARGETN)
- testshl $(SHL2TARGETN) sce/$(SHL2TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL2TARGETN)"!=""
# unroll begin
@@ -1642,16 +1622,6 @@ $(SHL3TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL3TARGET)
-
-runtest_$(SHL3TARGET) : $(SHL3TARGETN)
- testshl $(SHL3TARGETN) sce/$(SHL3TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL3TARGETN)"!=""
# unroll begin
@@ -2194,16 +2164,6 @@ $(SHL4TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL4TARGET)
-
-runtest_$(SHL4TARGET) : $(SHL4TARGETN)
- testshl $(SHL4TARGETN) sce/$(SHL4TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL4TARGETN)"!=""
# unroll begin
@@ -2746,16 +2706,6 @@ $(SHL5TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL5TARGET)
-
-runtest_$(SHL5TARGET) : $(SHL5TARGETN)
- testshl $(SHL5TARGETN) sce/$(SHL5TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL5TARGETN)"!=""
# unroll begin
@@ -3298,16 +3248,6 @@ $(SHL6TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL6TARGET)
-
-runtest_$(SHL6TARGET) : $(SHL6TARGETN)
- testshl $(SHL6TARGETN) sce/$(SHL6TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL6TARGETN)"!=""
# unroll begin
@@ -3850,16 +3790,6 @@ $(SHL7TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL7TARGET)
-
-runtest_$(SHL7TARGET) : $(SHL7TARGETN)
- testshl $(SHL7TARGETN) sce/$(SHL7TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL7TARGETN)"!=""
# unroll begin
@@ -4402,16 +4332,6 @@ $(SHL8TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL8TARGET)
-
-runtest_$(SHL8TARGET) : $(SHL8TARGETN)
- testshl $(SHL8TARGETN) sce/$(SHL8TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL8TARGETN)"!=""
# unroll begin
@@ -4954,16 +4874,6 @@ $(SHL9TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL9TARGET)
-
-runtest_$(SHL9TARGET) : $(SHL9TARGETN)
- testshl $(SHL9TARGETN) sce/$(SHL9TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL9TARGETN)"!=""
# unroll begin
@@ -5506,16 +5416,6 @@ $(SHL10TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL10TARGET)
-
-runtest_$(SHL10TARGET) : $(SHL10TARGETN)
- testshl $(SHL10TARGETN) sce/$(SHL10TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL10TARGETN)"!=""
# unroll begin
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 884208e18051..4d5665886448 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m92(Build:9541)
-BUILD=9541
-LAST_MINOR=m92
+RSCREVISION=300m93(Build:9544)
+BUILD=9544
+LAST_MINOR=m93
SOURCEVERSION=DEV300
diff --git a/solenv/inc/pstrules.mk b/solenv/inc/pstrules.mk
index 74c50ae9616d..a845b9ae86fe 100644
--- a/solenv/inc/pstrules.mk
+++ b/solenv/inc/pstrules.mk
@@ -153,24 +153,3 @@ $(PAR)/%.par :
# $(COMMAND_ECHO)$(SCPCOMP) -l $(@:b).$(LANGFILEEXT) -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
.ENDIF # "$(PARFILES)"!=""
-
-.IF "$(TESTDIR)"!=""
-
-# workaround for strange dmake bug:
-# if the previous block was a rule or a target, "\#" isn't recognized
-# as an escaped "#". if it was an assignment, escaping works...
-some_unique_variable_name:=1
-
-.IF "$(OS)" == "WNT"
-REGEXP:="s/^[\#].*//"
-.ELSE
-REGEXP:='s/^[\#].*//'
-.ENDIF
-
-$(MISC)/%.exp : sce/%.sce
- @@-$(RM) $@
- @@-$(RM) $(@:d)$(@:b).tst
- $(COMMAND_ECHO)$(TYPE) $< | sed $(REGEXP) | sed "s/^/test_/" > $(@:d)$(@:b).tst
- $(COMMAND_ECHO)$(TYPE) $(@:d)$(@:b).tst | sed "/test_./ w $@"
-
-.ENDIF # "$(TESTDIR)"!=""
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
index c6374cf39321..c44e845ffd71 100644
--- a/solenv/inc/settings.mk
+++ b/solenv/inc/settings.mk
@@ -1020,9 +1020,9 @@ LNTFLAGSOUTOBJ=-os
.IF "$(OOO_LIBRARY_PATH_VAR)" != ""
# Add SOLARLIBDIR at the begin of a (potentially previously undefined) library
# path (LD_LIBRARY_PATH, PATH, etc.; prepending avoids fetching libraries from
-# an existing office/URE installation ; the ": &&" in the bash case enables this to
-# work at the start of a recipe line that is not prefixed by "+" as well as in
-# the middle of an existing && chain:
+# an existing office/URE installation; the ": &&" enables this to work at the
+# start of a recipe line that is not prefixed by "+" as well as in the middle of
+# an existing && chain:
AUGMENT_LIBRARY_PATH = : && \
$(OOO_LIBRARY_PATH_VAR)=$(normpath, $(SOLARSHAREDBIN))$${{$(OOO_LIBRARY_PATH_VAR):+:$${{$(OOO_LIBRARY_PATH_VAR)}}}}
AUGMENT_LIBRARY_PATH_LOCAL = : && \
diff --git a/solenv/inc/tg_shl.mk b/solenv/inc/tg_shl.mk
index 170947c21c4a..930ea0f8886e 100644
--- a/solenv/inc/tg_shl.mk
+++ b/solenv/inc/tg_shl.mk
@@ -567,16 +567,6 @@ $(SHL$(TNR)TARGETN) : \
.ENDIF # "$(GUI)" == "OS2"
-
-.IF "$(TESTDIR)"!=""
-.IF "$(NO_TESTS)"==""
-
-ALLTAR : runtest_$(SHL$(TNR)TARGET)
-
-runtest_$(SHL$(TNR)TARGET) : $(SHL$(TNR)TARGETN)
- testshl $(SHL$(TNR)TARGETN) sce/$(SHL$(TNR)TARGET).sce -msg -skip
-.ENDIF # "$(NO_TESTS)"==""
-.ENDIF # "$(TESTDIR)"!=""
.ENDIF # "$(SHL$(TNR)TARGETN)"!=""
# unroll end
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index f093dc60cbe7..039a29fd2683 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -936,8 +936,11 @@ BOOL StgDirStrm::Store()
void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty )
{
+ if( n < 0 )
+ return NULL;
+
n *= STGENTRY_SIZE;
- if( n >= nSize )
+ if( n < 0 && n >= nSize )
return NULL;
return GetPtr( n, TRUE, bDirty );
}
diff --git a/svtools/inc/rtfkeywd.hxx b/svtools/inc/rtfkeywd.hxx
index 5ccd9149bd68..de59e1d8faf9 100644
--- a/svtools/inc/rtfkeywd.hxx
+++ b/svtools/inc/rtfkeywd.hxx
@@ -39,6 +39,7 @@
#define OOO_STRING_SVTOOLS_RTF_ALT "\\alt"
#define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation"
#define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi"
+#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate"
#define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid"
#define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author"
#define OOO_STRING_SVTOOLS_RTF_B "\\b"
@@ -976,12 +977,15 @@
#define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn"
#define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore"
#define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore"
#define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt"
#define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr"
#define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp"
+#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst"
#define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft"
#define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid"
#define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor"
@@ -993,6 +997,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk"
#define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr"
#define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
#define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm"
@@ -1116,6 +1121,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHP "\\shp"
#define OOO_STRING_SVTOOLS_RTF_SN "\\sn"
#define OOO_STRING_SVTOOLS_RTF_SV "\\sv"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
// Support for overline attributes
#define OOO_STRING_SVTOOLS_RTF_OL "\\ol"
@@ -1138,4 +1144,11 @@
#define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave"
#define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave"
+// Support for nested tables
+#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap"
+#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell"
+#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops"
+#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow"
+#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables"
+
#endif // _RTFKEYWD_HXX
diff --git a/svtools/inc/rtftoken.h b/svtools/inc/rtftoken.h
index e75254487312..f292682a0236 100644
--- a/svtools/inc/rtftoken.h
+++ b/svtools/inc/rtftoken.h
@@ -1258,7 +1258,7 @@ enum RTF_TOKEN_IDS {
RTF_SOUTLVL,
// shapes
- RTF_SHP, RTF_SN, RTF_SV
+ RTF_SHP, RTF_SN, RTF_SV, RTF_SP
/*
RTF_SHPLEFT,
RTF_SHPTOP,
diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx
index ac15f0b55be6..68a76d25e108 100644
--- a/svtools/inc/svtools/svicnvw.hxx
+++ b/svtools/inc/svtools/svicnvw.hxx
@@ -89,7 +89,6 @@ class SvIconView : public SvLBox
SvImpIconView* pImp;
Image aCollapsedEntryBmp;
Image aExpandedEntryBmp;
- WinBits nWinBits;
USHORT nIcnVwFlags;
void SetModel( SvLBoxTreeList* );
@@ -111,6 +110,7 @@ protected:
virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
virtual void Command( const CommandEvent& rCEvt );
virtual void PreparePaint( SvLBoxEntry* );
+ virtual void StateChanged( StateChangedType nStateChange );
public:
@@ -203,7 +203,6 @@ public:
SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const;
- void SetWindowBits( WinBits nWinStyle );
virtual void PaintEntry( SvLBoxEntry* );
virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos );
Rectangle GetFocusRect( SvLBoxEntry* );
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx
index f33784f45397..95fbd9f014d1 100644
--- a/svtools/inc/svtools/svlbox.hxx
+++ b/svtools/inc/svtools/svlbox.hxx
@@ -47,6 +47,7 @@
#include <vcl/accel.hxx>
#endif
#include <vcl/mnemonicengine.hxx>
+#include <vcl/quickselectionengine.hxx>
#include <tools/gen.hxx>
#include <svtools/treelist.hxx>
#include <svl/svarray.hxx>
@@ -253,10 +254,12 @@ DECLARE_SVTREELIST(SvLBoxTreeList, SvLBoxEntry*)
class SvLBox;
struct SvLBox_Impl
{
- bool m_bIsEmptyTextAllowed;
- bool m_bEntryMnemonicsEnabled;
- Link* m_pLink;
- ::vcl::MnemonicEngine m_aMnemonicEngine;
+ bool m_bIsEmptyTextAllowed;
+ bool m_bEntryMnemonicsEnabled;
+ bool m_bDoingQuickSelection;
+ Link* m_pLink;
+ ::vcl::MnemonicEngine m_aMnemonicEngine;
+ ::vcl::QuickSelectionEngine m_aQuickSelectionEngine;
SvLBox_Impl( SvLBox& _rBox );
};
@@ -267,6 +270,7 @@ class SVT_DLLPUBLIC SvLBox
,public DropTargetHelper
,public DragSourceHelper
,public ::vcl::IMnemonicEntryList
+ ,public ::vcl::ISearchableStringList
{
friend class SvLBoxEntry;
@@ -290,7 +294,6 @@ class SVT_DLLPUBLIC SvLBox
protected:
- WinBits nWindowStyle;
Link aExpandedHdl;
Link aExpandingHdl;
Link aSelectHdl;
@@ -376,11 +379,18 @@ protected:
// for asynchronous D&D
sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView );
- // IMnemonicEntryList
- virtual const void* FirstSearchEntry( String& _rEntryText );
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText );
- virtual void SelectSearchEntry( const void* _pEntry );
- virtual void ExecuteSearchEntry( const void* _pEntry );
+ void OnCurrentEntryChanged();
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const;
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
+
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
public:
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
index 787e0956888f..79402cb13f23 100644
--- a/svtools/inc/svtools/svtreebx.hxx
+++ b/svtools/inc/svtools/svtreebx.hxx
@@ -39,11 +39,6 @@ class TabBar;
#define SV_TAB_BORDER 8
-#define WB_HASBUTTONSATROOT ((WinBits)0x0800)
-#define WB_NOINITIALSELECTION WB_DROPDOWN
-#define WB_HIDESELECTION WB_NOHIDESELECTION
-#define WB_FORCE_MAKEVISIBLE WB_SPIN
-
#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
#define SV_ENTRYHEIGHTOFFS_PIXEL 2
@@ -97,9 +92,11 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
USHORT nTabFlagMask=0xffff,
BOOL bHasClipRegion=FALSE );
- SVT_DLLPRIVATE void InitTreeView( WinBits nWinStyle );
+ SVT_DLLPRIVATE void InitTreeView();
SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
USHORT nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
#endif
protected:
@@ -318,9 +315,6 @@ public:
SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
- void SetWindowBits( WinBits nWinStyle );
- WinBits GetWindowBits() const { return nWindowStyle; }
-
void PaintEntry( SvLBoxEntry* );
long PaintEntry( SvLBoxEntry*, long nLine,
USHORT nTabFlagMask=0xffff );
diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx
index b16cd67d12a5..6fd0f5bf0c9c 100644
--- a/svtools/source/contnr/svicnvw.cxx
+++ b/svtools/source/contnr/svicnvw.cxx
@@ -50,7 +50,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry()
SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
SvLBox( pParent, nWinStyle | WB_BORDER )
{
- nWinBits = nWinStyle;
nIcnVwFlags = 0;
pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
pImp->mpViewData = 0;
@@ -72,8 +71,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
SetDefaultFont();
pImp->SetSelectionMode( GetSelectionMode() );
- pImp->SetWindowBits( nWindowStyle );
- nWinBits = nWindowStyle;
}
SvIconView::~SvIconView()
@@ -403,10 +400,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
}
-void SvIconView::SetWindowBits( WinBits nWinStyle )
+void SvIconView::StateChanged( StateChangedType i_nStateChange )
{
- nWinBits = nWinStyle;
- pImp->SetWindowBits( nWinStyle );
+ SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ pImp->SetStyle( GetStyle() );
}
void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
@@ -469,6 +467,7 @@ void SvIconView::SelectAll( BOOL bSelect, BOOL )
void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
{
pImp->SetCursor( _pEntry );
+ OnCurrentEntryChanged();
}
SvLBoxEntry* SvIconView::GetCurEntry() const
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 35324d551858..c251903d02bd 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -45,6 +45,7 @@
#include <svimpbox.hxx>
#include <rtl/instance.hxx>
#include <svtools/svtdata.hxx>
+#include <tools/wintypes.hxx>
#ifndef _SVTOOLS_HRC
#include <svtools/svtools.hrc>
@@ -83,7 +84,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pTree = pLBTree;
aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
aSelEng.ExpandSelectionOnMouseMove( FALSE );
- SetWindowBits( nWinStyle );
+ SetStyle( nWinStyle );
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( 0 );
@@ -253,10 +254,10 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect )
}
}
-void SvImpLBox::SetWindowBits( WinBits nWinStyle )
+void SvImpLBox::SetStyle( WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
- if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION)
+ m_nStyle = i_nWinStyle;
+ if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
aSelEng.AddAlways( TRUE );
}
@@ -683,6 +684,8 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
}
}
nFlags &= (~F_DESEL_ALL);
+
+ pView->OnCurrentEntryChanged();
}
void SvImpLBox::ShowCursor( BOOL bShow )
@@ -952,7 +955,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
// erst die Linien Zeichnen, dann clippen!
pView->SetClipRegion();
- if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) )
+ if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) )
DrawNet();
pView->SetClipRegion( aClipRegion );
@@ -969,7 +972,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
{
// do not select if multiselection or explicit set
BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
- || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
+ || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
SetCursor( pStartEntry, bNotSelect );
}
@@ -994,7 +997,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
return; // ist schon sichtbar
- if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) )
+ if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
nFlags &= (~F_FILLING);
if( !bInView )
{
@@ -1132,7 +1135,7 @@ void SvImpLBox::DrawNet()
pView->DrawLine( aPos1, aPos2 );
}
// Sichtbar im Control ?
- if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
+ if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
{
// kann aPos1 recyclet werden ?
if( !pView->IsExpanded(pEntry) )
@@ -1154,7 +1157,7 @@ void SvImpLBox::DrawNet()
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- if( nWinBits & WB_HASLINESATROOT )
+ if( m_nStyle & WB_HASLINESATROOT )
{
pEntry = pView->First();
aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
@@ -1248,7 +1251,8 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
Size aOSize( pView->Control::GetOutputSizePixel() );
- BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
+ const WinBits nWindowStyle = pView->GetStyle();
+ BOOL bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
BOOL bHorBar = FALSE;
long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
Point aOrigin( pView->GetMapMode().GetOrigin() );
@@ -1256,7 +1260,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight += aOrigin.X() - 1;
long nVis = nMostRight - aOrigin.X();
if( pTabBar || (
- (pView->nWindowStyle & WB_HSCROLL) &&
+ (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) ))
bHorBar = TRUE;
@@ -1274,7 +1278,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight -= nVerSBarWidth;
if( !bHorBar )
{
- if( (pView->nWindowStyle & WB_HSCROLL) &&
+ if( (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) )
bHorBar = TRUE;
}
@@ -1439,7 +1443,7 @@ void SvImpLBox::FillView()
void SvImpLBox::ShowVerSBar()
{
- BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
+ BOOL bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0;
ULONG nVis = 0;
if( !bVerBar )
nVis = pView->GetVisibleCount();
@@ -1681,7 +1685,7 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
return;
/*
- if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
+ if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
{
SvViewData* pViewData = pView->GetViewData( pEntry );
pViewData->SetCursored( bSelect );
@@ -1943,7 +1947,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// die Linien invalidieren
/*
if( (bEntryVisible || bPrevEntryVisible) &&
- (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) )
+ (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) )
{
SvLBoxTab* pTab = pView->GetFirstDynamicTab();
if( pTab )
@@ -2265,6 +2269,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
SvLBoxEntry* pNewCursor;
+ const WinBits nWindowStyle = pView->GetStyle();
switch( aCode )
{
case KEY_UP:
@@ -2348,7 +2353,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if( pView->nWindowStyle & WB_HSCROLL )
+ else if( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb += aHorSBar.GetLineSize();
@@ -2379,7 +2384,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if ( pView->nWindowStyle & WB_HSCROLL )
+ else if ( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb -= aHorSBar.GetLineSize();
@@ -2481,13 +2486,17 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if ( !bShift /*&& !bMod1*/ )
{
if ( aSelEng.IsAddMode() )
+ {
// toggle selection
pView->Select( pCursor, !pView->IsSelected( pCursor ) );
- else
+ }
+ else if ( !pView->IsSelected( pCursor ) )
{
SelAllDestrAnch( FALSE );
pView->Select( pCursor, TRUE );
}
+ else
+ bKeyUsed = FALSE;
}
else
bKeyUsed = FALSE;
@@ -2520,7 +2529,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_F8:
if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION &&
- !(nWinBits & WB_SIMPLEMODE))
+ !(m_nStyle & WB_SIMPLEMODE))
{
if( aSelEng.IsAlwaysAdding() )
aSelEng.AddAlways( FALSE );
@@ -2568,8 +2577,8 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_A:
if( bMod1 )
SelAllDestrAnch( TRUE );
-// else
-// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled!
+ else
+ bKeyUsed = FALSE;
break;
case KEY_SUBTRACT:
@@ -2680,10 +2689,15 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
break;
default:
- if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS )
- // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch...
- // if there are groups of keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ // is there any reason why we should eat the events here? The only place where this is called
+ // is from SvTreeListBox::KeyInput. If we set bKeyUsed to TRUE here, then the key input
+ // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
+ // handling.
+ // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search"
+ // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
+ // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
+ bKeyUsed = FALSE;
+ break;
}
return bKeyUsed;
}
@@ -2698,7 +2712,7 @@ void __EXPORT SvImpLBox::GetFocus()
// if( bSimpleTravel && !pView->IsSelected(pCursor) )
// pView->Select( pCursor, TRUE );
}
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -2731,7 +2745,7 @@ void __EXPORT SvImpLBox::LoseFocus()
pView->SetEntryFocus( pCursor,FALSE );
ShowCursor( FALSE );
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -3029,7 +3043,7 @@ void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
bSimpleTravel = TRUE;
else
bSimpleTravel = FALSE;
- if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
+ if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
aSelEng.AddAlways( TRUE );
}
diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx
index d1e471953663..0d335429d564 100644
--- a/svtools/source/contnr/svimpicn.cxx
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -708,7 +708,7 @@ public:
SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
- WinBits nWinStyle ) :
+ WinBits i_nWinStyle ) :
aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ),
aHorSBar( pCurView, WB_DRAG | WB_HSCROLL )
{
@@ -716,7 +716,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
pModel = pTree;
pCurParent = 0;
pZOrderList = new SvPtrarr;
- SetWindowBits( nWinStyle );
+ SetStyle( i_nWinStyle );
nHorDist = 0;
nVerDist = 0;
nFlags = 0;
@@ -785,13 +785,12 @@ void SvImpIconView::Clear( BOOL bInCtor )
AdjustScrollBars();
}
-void SvImpIconView::SetWindowBits( WinBits nWinStyle )
+void SvImpIconView::SetStyle( const WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
nViewMode = VIEWMODE_TEXT;
- if( nWinStyle & WB_NAME )
+ if( i_nWinStyle & WB_NAME )
nViewMode = VIEWMODE_NAME;
- if( nWinStyle & WB_ICON )
+ if( i_nWinStyle & WB_ICON )
nViewMode = VIEWMODE_ICON;
}
@@ -1754,8 +1753,8 @@ void SvImpIconView::AdjustScrollBars()
else
nVisibleHeight = nRealHeight;
- bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false;
- bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false;
+ bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false;
+ bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false;
USHORT nResult = 0;
if( nVirtHeight )
@@ -1903,7 +1902,7 @@ BOOL SvImpIconView::CheckHorScrollBar()
return FALSE;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() )
+ if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
USHORT nCount = pZOrderList->Count();
@@ -1941,7 +1940,7 @@ BOOL SvImpIconView::CheckVerScrollBar()
return FALSE;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() )
+ if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index a69253c69629..11e19c6bab3c 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -685,6 +685,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
,m_bEntryMnemonicsEnabled( false )
,m_pLink( NULL )
,m_aMnemonicEngine( _rBox )
+ ,m_aQuickSelectionEngine( _rBox )
{
}
@@ -699,7 +700,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvLBox,0);
- nWindowStyle = nWinStyle;
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nImpFlags = 0;
pTargetEntry = 0;
@@ -724,7 +724,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
DBG_CTOR(SvLBox,0);
pTargetEntry = 0;
nImpFlags = 0;
- nWindowStyle = 0;
pLBoxImpl = new SvLBox_Impl( *this );
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nDragDropMode = 0;
@@ -1251,6 +1250,12 @@ ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL )
return 0;
}
+void SvLBox::OnCurrentEntryChanged()
+{
+ if ( !pLBoxImpl->m_bDoingQuickSelection )
+ pLBoxImpl->m_aQuickSelectionEngine.Reset();
+}
+
void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ )
{
DBG_CHKTHIS(SvLBox,0);
@@ -1535,15 +1540,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
-const void* SvLBox::FirstSearchEntry( String& _rEntryText )
+const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const
{
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
else
{
- if ( !pEntry )
- pEntry = FirstSelected();
+ pEntry = FirstSelected();
if ( !pEntry )
pEntry = First();
}
@@ -1554,11 +1558,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText )
return pEntry;
}
-const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText )
+const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
- pEntry = Next( pEntry );
+ if ( ( ( GetChildCount( pEntry ) > 0 )
+ || ( pEntry->HasChildsOnDemand() )
+ )
+ && !IsExpanded( pEntry )
+ )
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ else
+ {
+ pEntry = Next( pEntry );
+ }
+
if ( !pEntry )
pEntry = First();
@@ -1572,7 +1588,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" );
- if ( pEntry )
+ if ( !pEntry )
return;
SelectAll( FALSE );
@@ -1580,17 +1596,50 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
Select( pEntry );
}
-void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ )
+void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
{
// nothing to do here, we have no "execution"
}
+::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const
+{
+ // always accept the current entry if there is one
+ SvLBoxEntry* pCurrentEntry( GetCurEntry() );
+ if ( pCurrentEntry )
+ {
+ _out_entryText = GetEntryText( pCurrentEntry );
+ return pCurrentEntry;
+ }
+ return FirstSearchEntry( _out_entryText );
+}
+
+::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ return NextSearchEntry( _currentEntry, _out_entryText );
+}
+
+void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ SelectSearchEntry( _entry );
+}
+
bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt )
{
- if ( !IsEntryMnemonicsEnabled() )
- return false;
+ if ( IsEntryMnemonicsEnabled()
+ && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
+ )
+ return true;
+
+ if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
+ {
+ pLBoxImpl->m_bDoingQuickSelection = true;
+ const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
+ pLBoxImpl->m_bDoingQuickSelection = false;
+ if ( bHandled )
+ return true;
+ }
- return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt );
+ return false;
}
SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index a8635c99d127..f4780fbf08ad 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -65,10 +65,10 @@ DBG_NAME(SvTreeListBox)
#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox(pParent,nWinStyle )
+ : SvLBox( pParent, nWinStyle )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( nWinStyle );
+ InitTreeView();
SetSublistOpenWithLeftRight();
}
@@ -78,13 +78,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( 0 );
+ InitTreeView();
Resize();
SetSublistOpenWithLeftRight();
}
-void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
pCheckButtonData = NULL;
@@ -102,7 +102,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
nTreeFlags = TREEFLAG_RECALCTABS;
nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
- pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+ pImp = new SvImpLBox( this, GetModel(), GetStyle() );
aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
nContextBmpWidthMax = 0;
@@ -110,7 +110,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
SetSpaceBetweenEntries( 0 );
SetLineColor();
InitSettings( TRUE, TRUE, TRUE );
- SetWindowBits( nWinStyle );
+ ImplInitStyle();
SetTabs();
}
@@ -227,8 +227,9 @@ void SvTreeListBox::SetTabs()
EndEditing( TRUE );
nTreeFlags &= (~TREEFLAG_RECALCTABS);
nFocusWidth = -1;
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nStyle( GetStyle() );
+ BOOL bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
+ BOOL bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -1492,12 +1493,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const
return pImp->GetCurEntry();
}
-void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+void SvTreeListBox::ImplInitStyle()
{
DBG_CHKTHIS(SvTreeListBox,0);
- nWindowStyle = nWinStyle;
+
+ const WinBits nWindowStyle = GetStyle();
+
nTreeFlags |= TREEFLAG_RECALCTABS;
- if( nWinStyle & WB_SORT )
+ if( nWindowStyle & WB_SORT )
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
@@ -1508,9 +1511,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
GetModel()->SetCompareHdl( Link() );
}
#ifdef OS2
- nWinStyle |= WB_VSCROLL;
+ nWindowStyle |= WB_VSCROLL;
#endif
- pImp->SetWindowBits( nWinStyle );
+ pImp->SetStyle( nWindowStyle );
pImp->Resize();
Invalidate();
}
@@ -1578,8 +1581,9 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
BOOL bInUse = pEntry->HasInUseEmphasis();
// wenn eine ClipRegion von aussen gesetzt wird, dann
// diese nicht zuruecksetzen
- BOOL bResetClipRegion = !bHasClipRegion;
- BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const WinBits nWindowStyle = GetStyle();
+ const BOOL bResetClipRegion = !bHasClipRegion;
+ const BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Font aHighlightFont( GetFont() );
@@ -2367,6 +2371,7 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
long SvTreeListBox::GetTextOffset() const
{
DBG_CHKTHIS(SvTreeListBox,0);
+ const WinBits nWindowStyle = GetStyle();
BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
@@ -2519,6 +2524,8 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
{
SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ ImplInitStyle();
}
void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 6fcbd92597ba..011dd4cd7956 100644..100755
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -468,6 +468,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
BOOL bNoTicks = FALSE;
// Groessenvorberechnung
+ // Sizes calculation
BOOL bVertRight = FALSE;
if ( mnWinStyle & WB_HORZ )
nTickWidth = aPixSize.Width();
@@ -486,19 +487,21 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
if ( nMaxWidth < 0 )
- nMaxWidth *= -1;
+ nMaxWidth = -nMaxWidth;
nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) );
long nTxtWidth = GetTextWidth( aNumStr );
- if ( (nTxtWidth*2) > nTickWidth )
+
+ const long nTextOff = 4;
+ if ( nTickWidth < nTxtWidth+nTextOff )
{
+ // Calculate the scale of the ruler
long nMulti = 1;
long nOrgTick3 = nTick3;
- long nTextOff = 2;
while ( nTickWidth < nTxtWidth+nTextOff )
{
long nOldMulti = nMulti;
- if ( !nTickWidth )
+ if ( !nTickWidth ) //If nTickWidth equals 0
nMulti *= 10;
else if ( nMulti < 10 )
nMulti++;
@@ -516,8 +519,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
bNoTicks = TRUE;
break;
}
- if ( nMulti >= 100 )
- nTextOff = 4;
+
nTick3 = nOrgTick3 * nMulti;
aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
if ( mnWinStyle & WB_HORZ )
@@ -541,7 +543,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
{
if ( nStart > nMin )
{
- // Nur 0 malen, wenn Margin1 nicht gleich dem NullPunkt ist
+ // 0 is only painted when Margin1 is not equal to zero
if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) )
{
aNumStr = (sal_Unicode)'0';
@@ -564,7 +566,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
else
n = aPixSize.Height();
- // Tick3 - Ausgabe (Text)
+ // Tick3 - Output (Text)
if ( !(nTick % nTick3) )
{
aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
@@ -573,7 +575,9 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
nX = nStart+n;
//different orientation needs a different starting position
nY = bVertRight ? nCenter+nTxtHeight2 : nCenter-nTxtHeight2;
- if ( nX < nMax )
+
+ // Check if we can display full number
+ if ( nX < (nMax-nTxtWidth2) )
{
if ( mnWinStyle & WB_HORZ )
nX -= nTxtWidth2;
@@ -582,7 +586,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
ImplVDrawText( nX, nY, aNumStr );
}
nX = nStart-n;
- if ( nX > nMin )
+ if ( nX > (nMin+nTxtWidth2) )
{
if ( mnWinStyle & WB_HORZ )
nX -= nTxtWidth2;
@@ -591,7 +595,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
ImplVDrawText( nX, nY, aNumStr );
}
}
- // Tick/Tick2 - Ausgabe (Striche)
+ // Tick/Tick2 - Output (Strokes)
else
{
if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) )
@@ -1258,7 +1262,7 @@ void Ruler::ImplFormat()
Size aVirDevSize;
BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
- // VirtualDevice initialisieren
+ // VirtualDevice initialize
if ( mnWinStyle & WB_HORZ )
{
aVirDevSize.Width() = mnVirWidth;
@@ -1387,15 +1391,15 @@ void Ruler::ImplFormat()
if ( nP2 < nVirRight )
nMax--;
- // Beschriftung ausgeben
+ // Draw captions
ImplDrawTicks( nMin, nMax, nStart, nCenter );
}
- // Spalten ausgeben
+ // Draw borders
if ( mpData->pBorders )
ImplDrawBorders( nVirLeft, nP2, nVirTop, nVirBottom );
- // Einzuege ausgeben
+ // Draw indents
if ( mpData->pIndents )
ImplDrawIndents( nVirLeft, nP2, nVirTop-1, nVirBottom+1 );
@@ -2888,7 +2892,7 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
{
- // Testen, ob sich was geaendert hat
+ // To determine if what has changed
if ( mpData->nLines == n )
{
USHORT i = n;
@@ -2907,18 +2911,18 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
return;
}
- // Neue Werte setzen und neu ausgeben
+ // New values and new share issue
BOOL bMustUpdate;
if ( IsReallyVisible() && IsUpdateMode() )
bMustUpdate = TRUE;
else
bMustUpdate = FALSE;
- // Alte Linien loeschen
+ // Delete old lines
if ( bMustUpdate )
ImplInvertLines();
- // Neue Daten setzen
+ // New data set
if ( !n || !pLineAry )
{
if ( !mpData->pLines )
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 92b9f960b65c..6919944daef4 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -153,7 +153,7 @@ private:
USHORT nFlags;
USHORT nCurTabPos;
- WinBits nWinBits;
+ WinBits m_nStyle;
ExtendedWinBits nExtendedWinBits;
BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION
BOOL bUpdateMode : 1;
@@ -264,7 +264,7 @@ public:
~SvImpLBox();
void Clear();
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( WinBits i_nWinStyle );
void SetExtendedWindowBits( ExtendedWinBits _nBits );
ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; }
void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;}
diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx
index 20f98d2bcbbd..7d5c2b1b41e3 100644
--- a/svtools/source/inc/svimpicn.hxx
+++ b/svtools/source/inc/svimpicn.hxx
@@ -96,7 +96,6 @@ class SvImpIconView
nGridDY;
long nHorSBarHeight,
nVerSBarWidth;
- WinBits nWinBits;
int nViewMode;
long nHorDist;
long nVerDist;
@@ -171,7 +170,7 @@ public:
~SvImpIconView();
void Clear( BOOL bInCtor = FALSE );
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( const WinBits i_nWinStyle );
void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent )
{ pModel = pTree; SetCurParent(pParent); }
void EntryInserted( SvLBoxEntry*);
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
index 03a7667f48e2..a4335302f475 100644
--- a/svtools/source/svrtf/rtfkey2.cxx
+++ b/svtools/source/svrtf/rtfkey2.cxx
@@ -1128,6 +1128,7 @@ sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHP, "\\shp" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SN, "\\sn" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SV, "\\sv" );
+sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SP, "\\sp" );
/*
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
index 27ce3643f8cf..9b29951ddbbf 100644
--- a/svtools/source/svrtf/rtfkeywd.cxx
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -1160,6 +1160,7 @@ static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = {
*/
{{OOO_STRING_SVTOOLS_RTF_SN}, RTF_SN},
{{OOO_STRING_SVTOOLS_RTF_SV}, RTF_SV},
+ {{OOO_STRING_SVTOOLS_RTF_SP}, RTF_SP},
// Support for overline attributes
{{OOO_STRING_SVTOOLS_RTF_OL}, RTF_OL},
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index d1ea854cce61..f37d5f80ed68 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -1327,12 +1327,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = sal_False;
if ( aValue >>= bEnabled )
{
- WinBits nStyle = rTree.GetWindowBits();
+ WinBits nStyle = rTree.GetStyle();
if ( bEnabled )
nStyle |= WB_HIDESELECTION;
else
nStyle &= ~WB_HIDESELECTION;
- rTree.SetWindowBits( nStyle );
+ rTree.SetStyle( nStyle );
}
}
break;
@@ -1390,11 +1390,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINES);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINES);
if( bEnabled )
nBits |= WB_HASLINES;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1403,11 +1403,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINESATROOT);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINESATROOT);
if( bEnabled )
nBits |= WB_HASLINESATROOT;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1428,7 +1428,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
switch(nPropId)
{
case BASEPROPERTY_HIDEINACTIVESELECTION:
- return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+ return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SELECTIONTYPE:
{
@@ -1456,9 +1456,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
case BASEPROPERTY_TREE_ROOTDISPLAYED:
return Any( mbIsRootDisplayed );
case BASEPROPERTY_TREE_SHOWSHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINES) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINES) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SHOWSROOTHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
}
}
return VCLXWindow::getProperty( PropertyName );
@@ -1527,7 +1527,7 @@ UnoTreeListBoxImpl::UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent,
: SvTreeListBox( pParent, nWinStyle )
, mxPeer( pPeer )
{
- SetWindowBits( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ SetStyle( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
SetNodeDefaultImages();
SetSelectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
SetDeselectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
diff --git a/svx/inc/svx/sdrpagewindow.hxx b/svx/inc/svx/sdrpagewindow.hxx
index a3e50fadc599..29c08d6335e3 100644
--- a/svx/inc/svx/sdrpagewindow.hxx
+++ b/svx/inc/svx/sdrpagewindow.hxx
@@ -117,6 +117,7 @@ public:
void PrepareRedraw(const Region& rReg);
void RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const;
void RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const;
+ void PostPaint();
// Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
void InvalidatePageWindow(const basegfx::B2DRange& rRange);
diff --git a/svx/inc/svx/svdpagv.hxx b/svx/inc/svx/svdpagv.hxx
index 4ad30c2958f3..cd7b8a6de81e 100644
--- a/svx/inc/svx/svdpagv.hxx
+++ b/svx/inc/svx/svdpagv.hxx
@@ -184,6 +184,9 @@ public:
// PrePaint call forwarded from app windows
void PrePaint();
+ // PostPaint call forwarded from app windows
+ void PostPaint();
+
// rReg bezieht sich auf's OutDev, nicht auf die Page
void CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const;
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index bd6c7ea554cc..69f32ad327e5 100644
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -375,6 +375,9 @@ public:
// PrePaint call forwarded from app windows
void PrePaint();
+ // PostPaint call forwarded from app windows
+ void PostPaint();
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// used internally for Draw/Impress/sch/chart2
virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 87eb3062833b..a3b4c9a9ca21 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -15108,3 +15108,31 @@ SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG
ToolBoxConfig = FALSE,
GroupId = GID_TABLE;
]
+//--------------------------------------------------------------------------
+SfxVoidItem PrepareMailExport SID_MAIL_PREPAREEXPORT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* status: */
+ SlotType = SfxBoolItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
diff --git a/svx/source/dialog/docrecovery.hrc b/svx/source/dialog/docrecovery.hrc
index 18148131f6aa..acf1a1631c6b 100644
--- a/svx/source/dialog/docrecovery.hrc
+++ b/svx/source/dialog/docrecovery.hrc
@@ -36,7 +36,7 @@
// TabDialog
#define TABDLG_WIDTH 290
-#define TABDLG_HEIGHT 278
+#define TABDLG_HEIGHT 238
// TabPage CrashSave
@@ -52,7 +52,7 @@
#define SAVE_WIDTH 290
-#define SAVE_HEIGHT 278
+#define SAVE_HEIGHT 238
#define SAVE_TITLEWINHEIGHT 36
#define SAVE_DESCRHEIGHT 48
#define SAVE_COL0 (RSC_SP_DLG_INNERBORDER_LEFT)
diff --git a/svx/source/dialog/simptabl.cxx b/svx/source/dialog/simptabl.cxx
index ab5533513000..0545161e858d 100644
--- a/svx/source/dialog/simptabl.cxx
+++ b/svx/source/dialog/simptabl.cxx
@@ -152,7 +152,6 @@ SvxSimpleTable::SvxSimpleTable( Window* pParent,const ResId& rResId):
InitHeaderBar( &aHeaderBar );
aHeaderBar.Show();
- SetWindowBits(WB_CLIPCHILDREN | WB_HSCROLL);
SvHeaderTabListBox::Show();
}
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index bb8afd502d43..76c700ae4221 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2953,13 +2953,13 @@ sal_Bool DbFilterField::commitControl()
case ::com::sun::star::form::FormComponentType::CHECKBOX:
return sal_True;
case ::com::sun::star::form::FormComponentType::LISTBOX:
+ aText.Erase();
if (static_cast<ListBox*>(m_pWindow)->GetSelectEntryCount())
{
sal_Int16 nPos = (sal_Int16)static_cast<ListBox*>(m_pWindow)->GetSelectEntryPos();
- aText = (const sal_Unicode*)m_aValueList.getConstArray()[nPos];
+ if ( ( nPos >= 0 ) && ( nPos < m_aValueList.getLength() ) )
+ aText = (const sal_Unicode*)m_aValueList.getConstArray()[nPos];
}
- else
- aText.Erase();
if (m_aText != aText)
{
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 8ce3d6e7ba7c..9412c715b2b5 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -352,7 +352,7 @@ namespace svxform
WinBits nBits = WB_BORDER | WB_TABSTOP | WB_HIDESELECTION | WB_NOINITIALSELECTION;
if ( DGTInstance == m_eGroup || DGTSubmission == m_eGroup )
nBits |= WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT;
- m_aItemList.SetWindowBits( m_aItemList.GetStyle() | nBits );
+ m_aItemList.SetStyle( m_aItemList.GetStyle() | nBits );
m_aItemList.Show();
ItemSelectHdl( &m_aItemList );
}
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index c080f5b7a7fa..e627624d8102 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -538,7 +538,6 @@ sal_Bool IsSearchableControl( const ::com::sun::star::uno::Reference< ::com::sun
//------------------------------------------------------------------------------
sal_Bool FmXBoundFormFieldIterator::ShouldStepInto(const Reference< XInterface>& _rContainer) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXBoundFormFieldIterator::ShouldStepInto" );
if (_rContainer == m_xStartingPoint)
// would be quite stupid to step over the root ....
return sal_True;
@@ -549,7 +548,6 @@ sal_Bool FmXBoundFormFieldIterator::ShouldStepInto(const Reference< XInterface>&
//------------------------------------------------------------------------------
sal_Bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterface>& _rElement)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXBoundFormFieldIterator::ShouldHandleElement" );
if (!_rElement.is())
// NULL element
return sal_False;
@@ -675,7 +673,6 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
,m_bPreparedClose( sal_False )
,m_bFirstActivation( sal_True )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::FmXFormShell" );
DBG_CTOR(FmXFormShell,NULL);
m_aMarkTimer.SetTimeout(100);
m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut));
@@ -707,7 +704,6 @@ FmXFormShell::~FmXFormShell()
//------------------------------------------------------------------
Reference< XModel > FmXFormShell::getContextDocument() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getContextDocument" );
Reference< XModel > xModel;
// determine the type of document we live in
@@ -729,14 +725,12 @@ Reference< XModel > FmXFormShell::getContextDocument() const
//------------------------------------------------------------------
bool FmXFormShell::isEnhancedForm() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::isEnhancedForm" );
return getDocumentType() == eEnhancedForm;
}
//------------------------------------------------------------------
bool FmXFormShell::impl_checkDisposed() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_checkDisposed" );
if ( !m_pShell )
{
OSL_ENSURE( false, "FmXFormShell::impl_checkDisposed: already disposed!" );
@@ -748,7 +742,6 @@ bool FmXFormShell::impl_checkDisposed() const
//------------------------------------------------------------------
::svxform::DocumentType FmXFormShell::getDocumentType() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getDocumentType" );
if ( m_eDocumentType != eUnknownDocumentType )
return m_eDocumentType;
@@ -769,7 +762,6 @@ bool FmXFormShell::impl_checkDisposed() const
//------------------------------------------------------------------
bool FmXFormShell::IsReadonlyDoc() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::IsReadonlyDoc" );
if ( impl_checkDisposed() )
return true;
@@ -782,19 +774,16 @@ bool FmXFormShell::IsReadonlyDoc() const
//------------------------------------------------------------------
Any SAL_CALL FmXFormShell::queryInterface( const Type& type) throw ( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::queryInterface" );
return FmXFormShell_BASE::queryInterface(type);
}
//------------------------------------------------------------------------------
Sequence< Type > SAL_CALL FmXFormShell::getTypes( ) throw(RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getTypes" );
return FmXFormShell_BASE::getTypes();
}
//------------------------------------------------------------------------------
Sequence< sal_Int8 > SAL_CALL FmXFormShell::getImplementationId() throw(RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getImplementationId" );
static ::cppu::OImplementationId* pId = 0;
if (! pId)
{
@@ -811,7 +800,6 @@ Sequence< sal_Int8 > SAL_CALL FmXFormShell::getImplementationId() throw(RuntimeE
//------------------------------------------------------------------------------
void SAL_CALL FmXFormShell::disposing(const EventObject& e) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::disposing" );
impl_checkDisposed();
if (m_xActiveController == e.Source)
@@ -851,7 +839,6 @@ void SAL_CALL FmXFormShell::disposing(const EventObject& e) throw( RuntimeExcept
//------------------------------------------------------------------------------
void SAL_CALL FmXFormShell::propertyChange(const PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::propertyChange" );
if ( impl_checkDisposed() )
return;
@@ -888,7 +875,6 @@ void SAL_CALL FmXFormShell::propertyChange(const PropertyChangeEvent& evt) throw
//------------------------------------------------------------------------------
void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatures )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::invalidateFeatures" );
if ( impl_checkDisposed() )
return;
@@ -918,7 +904,6 @@ void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatu
//------------------------------------------------------------------------------
void SAL_CALL FmXFormShell::formActivated(const EventObject& rEvent) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::formActivated" );
if ( impl_checkDisposed() )
return;
@@ -930,7 +915,6 @@ void SAL_CALL FmXFormShell::formActivated(const EventObject& rEvent) throw( Runt
//------------------------------------------------------------------------------
void SAL_CALL FmXFormShell::formDeactivated(const EventObject& rEvent) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::formDeactivated" );
if ( impl_checkDisposed() )
return;
@@ -941,7 +925,6 @@ void SAL_CALL FmXFormShell::formDeactivated(const EventObject& rEvent) throw( Ru
//------------------------------------------------------------------------------
void FmXFormShell::disposing()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::disposing" );
impl_checkDisposed();
FmXFormShell_BASE::disposing();
@@ -1019,7 +1002,6 @@ void FmXFormShell::disposing()
//------------------------------------------------------------------------------
void FmXFormShell::UpdateSlot( sal_Int16 _nId )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::UpdateSlot" );
if ( impl_checkDisposed() )
return;
@@ -1041,7 +1023,6 @@ void FmXFormShell::UpdateSlot( sal_Int16 _nId )
//------------------------------------------------------------------------------
void FmXFormShell::InvalidateSlot( sal_Int16 nId, sal_Bool bWithId )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::InvalidateSlot" );
if ( impl_checkDisposed() )
return;
@@ -1062,7 +1043,6 @@ void FmXFormShell::InvalidateSlot( sal_Int16 nId, sal_Bool bWithId )
//------------------------------------------------------------------------------
void FmXFormShell::LockSlotInvalidation(sal_Bool bLock)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::LockSlotInvalidation" );
if ( impl_checkDisposed() )
return;
@@ -1109,7 +1089,6 @@ IMPL_LINK(FmXFormShell, OnInvalidateSlots, void*, EMPTYARG)
//------------------------------------------------------------------------------
void FmXFormShell::ForceUpdateSelection(sal_Bool bAllowInvalidation)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ForceUpdateSelection" );
if ( impl_checkDisposed() )
return;
@@ -1131,7 +1110,6 @@ void FmXFormShell::ForceUpdateSelection(sal_Bool bAllowInvalidation)
//------------------------------------------------------------------------------
PopupMenu* FmXFormShell::GetConversionMenu()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetConversionMenu" );
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
BOOL bIsHiContrastMode = rSettings.GetHighContrastMode();
@@ -1150,7 +1128,6 @@ PopupMenu* FmXFormShell::GetConversionMenu()
//------------------------------------------------------------------------------
bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::isControlConversionSlot" );
for ( size_t i = 0; i < sizeof( nConvertSlots ) / sizeof( nConvertSlots[0] ); ++i )
if (nConvertSlots[i] == nSlotId)
return true;
@@ -1160,7 +1137,6 @@ bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
//------------------------------------------------------------------------------
bool FmXFormShell::executeControlConversionSlot( sal_uInt16 _nSlotId )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::executeControlConversionSlot" );
OSL_PRECOND( canConvertCurrentSelectionToControl( _nSlotId ), "FmXFormShell::executeControlConversionSlot: illegal call!" );
InterfaceBag::const_iterator aSelectedElement = m_aCurrentSelection.begin();
if ( aSelectedElement == m_aCurrentSelection.end() )
@@ -1172,7 +1148,6 @@ bool FmXFormShell::executeControlConversionSlot( sal_uInt16 _nSlotId )
//------------------------------------------------------------------------------
bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent >& _rxObject, sal_uInt16 _nSlotId )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::executeControlConversionSlot" );
if ( impl_checkDisposed() )
return false;
@@ -1379,7 +1354,6 @@ bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent
//------------------------------------------------------------------------------
bool FmXFormShell::canConvertCurrentSelectionToControl( sal_Int16 nConversionSlot )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::canConvertCurrentSelectionToControl" );
if ( m_aCurrentSelection.empty() )
return false;
@@ -1418,7 +1392,6 @@ bool FmXFormShell::canConvertCurrentSelectionToControl( sal_Int16 nConversionSlo
//------------------------------------------------------------------------------
void FmXFormShell::checkControlConversionSlotsForCurrentSelection( Menu& rMenu )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::checkControlConversionSlotsForCurrentSelection" );
for (sal_Int16 i=0; i<rMenu.GetItemCount(); ++i)
// der Context ist schon von einem Typ, der dem Eitnrag entspricht -> disable
rMenu.EnableItem( rMenu.GetItemId(i), canConvertCurrentSelectionToControl( rMenu.GetItemId( i ) ) );
@@ -1427,7 +1400,6 @@ void FmXFormShell::checkControlConversionSlotsForCurrentSelection( Menu& rMenu )
//------------------------------------------------------------------------------
void FmXFormShell::LoopGrids(sal_Int16 nWhat)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::LoopGrids" );
if ( impl_checkDisposed() )
return;
@@ -1497,7 +1469,6 @@ void FmXFormShell::LoopGrids(sal_Int16 nWhat)
//------------------------------------------------------------------------------
Reference< XControlContainer > FmXFormShell::getControlContainerForView()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getControlContainerForView" );
if ( impl_checkDisposed() )
return NULL;
@@ -1515,7 +1486,6 @@ Reference< XControlContainer > FmXFormShell::getControlContainerForView()
//------------------------------------------------------------------------------
void FmXFormShell::ExecuteTabOrderDialog( const Reference< XTabControllerModel >& _rxForForm )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ExecuteTabOrderDialog" );
if ( impl_checkDisposed() )
return;
@@ -1564,7 +1534,6 @@ void FmXFormShell::ExecuteTabOrderDialog( const Reference< XTabControllerModel >
//------------------------------------------------------------------------------
void FmXFormShell::ExecuteSearch()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ExecuteSearch" );
if ( impl_checkDisposed() )
return;
@@ -1711,7 +1680,6 @@ void FmXFormShell::ExecuteSearch()
//------------------------------------------------------------------------------
sal_Bool FmXFormShell::GetY2KState(sal_uInt16& n)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetY2KState" );
if ( impl_checkDisposed() )
return sal_False;
@@ -1751,7 +1719,6 @@ sal_Bool FmXFormShell::GetY2KState(sal_uInt16& n)
//------------------------------------------------------------------------------
void FmXFormShell::SetY2KState(sal_uInt16 n)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetY2KState" );
if ( impl_checkDisposed() )
return;
@@ -1826,7 +1793,6 @@ void FmXFormShell::SetY2KState(sal_uInt16 n)
//------------------------------------------------------------------------------
void FmXFormShell::CloseExternalFormViewer()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CloseExternalFormViewer" );
if ( impl_checkDisposed() )
return;
@@ -1848,7 +1814,6 @@ void FmXFormShell::CloseExternalFormViewer()
//------------------------------------------------------------------------------
Reference< XResultSet> FmXFormShell::getInternalForm(const Reference< XResultSet>& _xForm) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getInternalForm" );
if ( impl_checkDisposed() )
return NULL;
@@ -1864,7 +1829,6 @@ Reference< XResultSet> FmXFormShell::getInternalForm(const Reference< XResultSet
//------------------------------------------------------------------------------
Reference< XForm> FmXFormShell::getInternalForm(const Reference< XForm>& _xForm) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getInternalForm" );
if ( impl_checkDisposed() )
return NULL;
@@ -1893,7 +1857,6 @@ namespace
//------------------------------------------------------------------------------
bool FmXFormShell::IsFormSlotEnabled( sal_Int32 _nSlot, FeatureState* _pCompleteState )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::IsFormSlotEnabled" );
const ::svx::ControllerFeatures& rController =
lcl_isNavigationRelevant( _nSlot )
? getNavControllerFeatures()
@@ -1909,7 +1872,6 @@ bool FmXFormShell::IsFormSlotEnabled( sal_Int32 _nSlot, FeatureState* _pComplete
//------------------------------------------------------------------------------
void FmXFormShell::ExecuteFormSlot( sal_Int32 _nSlot )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ExecuteFormSlot" );
const ::svx::ControllerFeatures& rController =
lcl_isNavigationRelevant( _nSlot )
? getNavControllerFeatures()
@@ -1945,7 +1907,6 @@ void FmXFormShell::ExecuteFormSlot( sal_Int32 _nSlot )
//------------------------------------------------------------------------------
void FmXFormShell::impl_switchActiveControllerListening( const bool _bListen )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_switchActiveControllerListening" );
Reference< XComponent> xComp( m_xActiveController, UNO_QUERY );
if ( !xComp.is() )
return;
@@ -1959,7 +1920,6 @@ void FmXFormShell::impl_switchActiveControllerListening( const bool _bListen )
//------------------------------------------------------------------------------
void FmXFormShell::setActiveController( const Reference< runtime::XFormController >& xController, sal_Bool _bNoSaveOldContent )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setActiveController" );
if ( impl_checkDisposed() )
return;
@@ -2068,14 +2028,12 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle
//------------------------------------------------------------------------------
void FmXFormShell::getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::getCurrentSelection" );
_rSelection = m_aCurrentSelection;
}
//------------------------------------------------------------------------------
bool FmXFormShell::setCurrentSelectionFromMark( const SdrMarkList& _rMarkList )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setCurrentSelectionFromMark" );
m_aLastKnownMarkedControls.clear();
if ( ( _rMarkList.GetMarkCount() > 0 ) && isControlList( _rMarkList ) )
@@ -2087,14 +2045,12 @@ bool FmXFormShell::setCurrentSelectionFromMark( const SdrMarkList& _rMarkList )
//------------------------------------------------------------------------------
bool FmXFormShell::selectLastMarkedControls()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::selectLastMarkedControls" );
return setCurrentSelection( m_aLastKnownMarkedControls );
}
//------------------------------------------------------------------------------
bool FmXFormShell::setCurrentSelection( const InterfaceBag& _rSelection )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setCurrentSelection" );
if ( impl_checkDisposed() )
return false;
@@ -2176,14 +2132,12 @@ bool FmXFormShell::setCurrentSelection( const InterfaceBag& _rSelection )
//------------------------------------------------------------------------------
bool FmXFormShell::isSolelySelected( const Reference< XInterface >& _rxObject )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::isSolelySelected" );
return ( m_aCurrentSelection.size() == 1 ) && ( *m_aCurrentSelection.begin() == _rxObject );
}
//------------------------------------------------------------------------------
void FmXFormShell::forgetCurrentForm()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::forgetCurrentForm" );
if ( !m_xCurrentForm.is() )
return;
@@ -2198,7 +2152,6 @@ void FmXFormShell::forgetCurrentForm()
//------------------------------------------------------------------------------
void FmXFormShell::impl_updateCurrentForm( const Reference< XForm >& _rxNewCurForm )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_updateCurrentForm" );
if ( impl_checkDisposed() )
return;
@@ -2217,7 +2170,6 @@ void FmXFormShell::impl_updateCurrentForm( const Reference< XForm >& _rxNewCurFo
//------------------------------------------------------------------------------
void FmXFormShell::startListening()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::startListening" );
if ( impl_checkDisposed() )
return;
@@ -2297,7 +2249,6 @@ void FmXFormShell::startListening()
//------------------------------------------------------------------------------
void FmXFormShell::stopListening()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::stopListening" );
if ( impl_checkDisposed() )
return;
@@ -2321,7 +2272,6 @@ void FmXFormShell::stopListening()
//------------------------------------------------------------------------------
void FmXFormShell::ShowSelectionProperties( sal_Bool bShow )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ShowSelectionProperties" );
if ( impl_checkDisposed() )
return;
@@ -2652,7 +2602,6 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
//------------------------------------------------------------------------------
void FmXFormShell::elementInserted(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::elementInserted" );
if ( impl_checkDisposed() )
return;
@@ -2666,7 +2615,6 @@ void FmXFormShell::elementInserted(const ContainerEvent& evt) throw(::com::sun::
//------------------------------------------------------------------------------
void FmXFormShell::elementReplaced(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::elementReplaced" );
if ( impl_checkDisposed() )
return;
@@ -2680,7 +2628,6 @@ void FmXFormShell::elementReplaced(const ContainerEvent& evt) throw(::com::sun::
//------------------------------------------------------------------------------
void FmXFormShell::elementRemoved(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::elementRemoved" );
if ( impl_checkDisposed() )
return;
@@ -2693,7 +2640,6 @@ void FmXFormShell::elementRemoved(const ContainerEvent& evt) throw(::com::sun::s
//------------------------------------------------------------------------------
void FmXFormShell::UpdateForms( sal_Bool _bInvalidate )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::UpdateForms" );
if ( impl_checkDisposed() )
return;
@@ -2719,7 +2665,6 @@ void FmXFormShell::UpdateForms( sal_Bool _bInvalidate )
//------------------------------------------------------------------------------
void FmXFormShell::AddElement(const Reference< XInterface>& _xElement)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::AddElement" );
if ( impl_checkDisposed() )
return;
impl_AddElement_nothrow(_xElement);
@@ -2752,7 +2697,6 @@ void FmXFormShell::impl_AddElement_nothrow(const Reference< XInterface>& Element
//------------------------------------------------------------------------------
void FmXFormShell::RemoveElement(const Reference< XInterface>& Element)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::RemoveElement" );
if ( impl_checkDisposed() )
return;
impl_RemoveElement_nothrow(Element);
@@ -2789,7 +2733,6 @@ void FmXFormShell::impl_RemoveElement_nothrow(const Reference< XInterface>& Elem
//------------------------------------------------------------------------------
void FmXFormShell::selectionChanged(const EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::selectionChanged" );
if ( impl_checkDisposed() )
return;
@@ -2831,7 +2774,6 @@ IMPL_LINK(FmXFormShell, OnTimeOut, void*, /*EMPTYTAG*/)
//------------------------------------------------------------------------
void FmXFormShell::SetSelectionDelayed()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetSelectionDelayed" );
if ( impl_checkDisposed() )
return;
@@ -2842,7 +2784,6 @@ void FmXFormShell::SetSelectionDelayed()
//------------------------------------------------------------------------
void FmXFormShell::SetSelection(const SdrMarkList& rMarkList)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetSelection" );
if ( impl_checkDisposed() )
return;
@@ -2853,7 +2794,6 @@ void FmXFormShell::SetSelection(const SdrMarkList& rMarkList)
//------------------------------------------------------------------------
void FmXFormShell::DetermineSelection(const SdrMarkList& rMarkList)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DetermineSelection" );
if ( setCurrentSelectionFromMark( rMarkList ) && IsPropBrwOpen() )
ShowSelectionProperties( sal_True );
}
@@ -2861,7 +2801,6 @@ void FmXFormShell::DetermineSelection(const SdrMarkList& rMarkList)
//------------------------------------------------------------------------------
sal_Bool FmXFormShell::IsPropBrwOpen() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::IsPropBrwOpen" );
if ( impl_checkDisposed() )
return sal_False;
@@ -2898,7 +2837,6 @@ public:
//------------------------------------------------------------------------------
void FmXFormShell::SetDesignMode(sal_Bool bDesign)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetDesignMode" );
if ( impl_checkDisposed() )
return;
@@ -3031,7 +2969,6 @@ Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlMod
void FmXFormShell::impl_collectFormSearchContexts_nothrow( const Reference< XInterface>& _rxStartingPoint,
const ::rtl::OUString& _rCurrentLevelPrefix, FmFormArray& _out_rForms, ::std::vector< String >& _out_rNames )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_collectFormSearchContexts_nothrow" );
try
{
Reference< XIndexAccess> xContainer( _rxStartingPoint, UNO_QUERY );
@@ -3086,7 +3023,6 @@ void FmXFormShell::impl_collectFormSearchContexts_nothrow( const Reference< XInt
//------------------------------------------------------------------------------
void FmXFormShell::startFiltering()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::startFiltering" );
if ( impl_checkDisposed() )
return;
@@ -3103,12 +3039,14 @@ void FmXFormShell::startFiltering()
else
xContainer = getActiveController()->getContainer();
- FmWinRecList::iterator i = pXView->findWindow(xContainer);
- if (i != pXView->getWindowList().end())
+ PFormViewPageWindowAdapter pAdapter = pXView->findWindow( xContainer );
+ if ( pAdapter.is() )
{
- const ::std::vector< Reference< runtime::XFormController> >& rControllerList = (*i)->GetList();
- for (::std::vector< Reference< runtime::XFormController> >::const_iterator j = rControllerList.begin();
- j != rControllerList.end(); ++j)
+ const ::std::vector< Reference< runtime::XFormController> >& rControllerList = pAdapter->GetList();
+ for ( ::std::vector< Reference< runtime::XFormController> >::const_iterator j = rControllerList.begin();
+ j != rControllerList.end();
+ ++j
+ )
{
Reference< XModeSelector> xModeSelector(*j, UNO_QUERY);
if (xModeSelector.is())
@@ -3161,7 +3099,6 @@ void saveFilter(const Reference< runtime::XFormController >& _rxController)
//------------------------------------------------------------------------------
void FmXFormShell::stopFiltering(sal_Bool bSave)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::stopFiltering" );
if ( impl_checkDisposed() )
return;
@@ -3179,10 +3116,10 @@ void FmXFormShell::stopFiltering(sal_Bool bSave)
else
xContainer = getActiveController()->getContainer();
- FmWinRecList::iterator i = pXView->findWindow(xContainer);
- if (i != pXView->getWindowList().end())
+ PFormViewPageWindowAdapter pAdapter = pXView->findWindow(xContainer);
+ if ( pAdapter.is() )
{
- const ::std::vector< Reference< runtime::XFormController > >& rControllerList = (*i)->GetList();
+ const ::std::vector< Reference< runtime::XFormController > >& rControllerList = pAdapter->GetList();
::std::vector < ::rtl::OUString > aOriginalFilters;
::std::vector < sal_Bool > aOriginalApplyFlags;
@@ -3223,7 +3160,7 @@ void FmXFormShell::stopFiltering(sal_Bool bSave)
}
if (bSave) // execute the filter
{
- const ::std::vector< Reference< runtime::XFormController > > & rControllers = (*i)->GetList();
+ const ::std::vector< Reference< runtime::XFormController > > & rControllers = pAdapter->GetList();
for (::std::vector< Reference< runtime::XFormController > > ::const_iterator j = rControllers.begin();
j != rControllers.end(); ++j)
{
@@ -3300,7 +3237,6 @@ void clearFilter(const Reference< runtime::XFormController >& _rxController)
//------------------------------------------------------------------------------
void FmXFormShell::clearFilter()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::clearFilter" );
if ( impl_checkDisposed() )
return;
@@ -3316,12 +3252,14 @@ void FmXFormShell::clearFilter()
else
xContainer = getActiveController()->getContainer();
- FmWinRecList::iterator i = pXView->findWindow(xContainer);
- if (i != pXView->getWindowList().end())
+ PFormViewPageWindowAdapter pAdapter = pXView->findWindow(xContainer);
+ if ( pAdapter.is() )
{
- const ::std::vector< Reference< runtime::XFormController > > & rControllerList = (*i)->GetList();
- for (::std::vector< Reference< runtime::XFormController > > ::const_iterator j = rControllerList.begin();
- j != rControllerList.end(); ++j)
+ const ::std::vector< Reference< runtime::XFormController > > & rControllerList = pAdapter->GetList();
+ for ( ::std::vector< Reference< runtime::XFormController > > ::const_iterator j = rControllerList.begin();
+ j != rControllerList.end();
+ ++j
+ )
{
::clearFilter(*j);
}
@@ -3331,7 +3269,6 @@ void FmXFormShell::clearFilter()
//------------------------------------------------------------------------------
void FmXFormShell::CreateExternalView()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CreateExternalView" );
if ( impl_checkDisposed() )
return;
@@ -3746,7 +3683,6 @@ void FmXFormShell::CreateExternalView()
//------------------------------------------------------------------------
void FmXFormShell::implAdjustConfigCache()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::implAdjustConfigCache" );
// get (cache) the wizard usage flag
Sequence< ::rtl::OUString > aNames(1);
aNames[0] = ::rtl::OUString::createFromAscii("FormControlPilotsEnabled");
@@ -3758,7 +3694,6 @@ void FmXFormShell::implAdjustConfigCache()
//------------------------------------------------------------------------
void FmXFormShell::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::Notify" );
if ( impl_checkDisposed() )
return;
@@ -3779,7 +3714,6 @@ void FmXFormShell::Commit()
//------------------------------------------------------------------------
void FmXFormShell::SetWizardUsing(sal_Bool _bUseThem)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetWizardUsing" );
m_bUseWizards = _bUseThem;
Sequence< ::rtl::OUString > aNames(1);
@@ -3792,7 +3726,6 @@ void FmXFormShell::SetWizardUsing(sal_Bool _bUseThem)
//------------------------------------------------------------------------
void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeactivateController /* = sal_True */ )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewDeactivated" );
if ( _rCurrentView.GetImpl() && !_rCurrentView.IsDesignMode() )
{
@@ -3864,7 +3797,6 @@ IMPL_LINK( FmXFormShell, OnFormsCreated, FmFormPage*, /*_pPage*/ )
//------------------------------------------------------------------------
void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncAction /* = sal_False */ )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewActivated" );
FmFormPage* pPage = _rCurrentView.GetCurPage();
@@ -3913,7 +3845,6 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi
//------------------------------------------------------------------------------
void FmXFormShell::impl_defaultCurrentForm_nothrow()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_defaultCurrentForm_nothrow" );
if ( impl_checkDisposed() )
return;
@@ -3944,7 +3875,6 @@ void FmXFormShell::impl_defaultCurrentForm_nothrow()
//------------------------------------------------------------------------------
void FmXFormShell::smartControlReset( const Reference< XIndexAccess >& _rxModels )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::smartControlReset" );
if (!_rxModels.is())
{
DBG_ERROR("FmXFormShell::smartControlReset: invalid container!");
@@ -4052,7 +3982,6 @@ namespace
//------------------------------------------------------------------------
void FmXFormShell::loadForms( FmFormPage* _pPage, const sal_uInt16 _nBehaviour /* FORMS_LOAD | FORMS_SYNC */ )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::loadForms" );
DBG_ASSERT( ( _nBehaviour & ( FORMS_ASYNC | FORMS_UNLOAD ) ) != ( FORMS_ASYNC | FORMS_UNLOAD ),
"FmXFormShell::loadForms: async loading not supported - this will heavily fail!" );
@@ -4130,41 +4059,35 @@ void FmXFormShell::loadForms( FmFormPage* _pPage, const sal_uInt16 _nBehaviour /
//------------------------------------------------------------------------
void FmXFormShell::ExecuteTextAttribute( SfxRequest& _rReq )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ExecuteTextAttribute" );
m_pTextShell->ExecuteTextAttribute( _rReq );
}
//------------------------------------------------------------------------
void FmXFormShell::GetTextAttributeState( SfxItemSet& _rSet )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetTextAttributeState" );
m_pTextShell->GetTextAttributeState( _rSet );
}
//------------------------------------------------------------------------
bool FmXFormShell::IsActiveControl( bool _bCountRichTextOnly ) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::IsActiveControl" );
return m_pTextShell->IsActiveControl( _bCountRichTextOnly );
}
//------------------------------------------------------------------------
void FmXFormShell::ForgetActiveControl()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::ForgetActiveControl" );
m_pTextShell->ForgetActiveControl();
}
//------------------------------------------------------------------------
void FmXFormShell::SetControlActivationHandler( const Link& _rHdl )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::SetControlActivationHandler" );
m_pTextShell->SetControlActivationHandler( _rHdl );
}
//------------------------------------------------------------------------
void FmXFormShell::handleShowPropertiesRequest()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::handleShowPropertiesRequest" );
if ( onlyControlsAreMarked() )
ShowSelectionProperties( sal_True );
}
@@ -4172,7 +4095,6 @@ void FmXFormShell::handleShowPropertiesRequest()
//------------------------------------------------------------------------
void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::handleMouseButtonDown" );
// catch simple double clicks
if ( ( _rViewEvent.nMouseClicks == 2 ) && ( _rViewEvent.nMouseCode == MOUSE_LEFT ) )
{
@@ -4284,7 +4206,6 @@ ControlConversionMenuController::ControlConversionMenuController( sal_uInt16 _nI
//------------------------------------------------------------------------------
ControlConversionMenuController::~ControlConversionMenuController()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "ControlConversionMenuController::~ControlConversionMenuController" );
m_pMainMenu->SetPopupMenu(SID_FM_CHANGECONTROLTYPE, NULL);
delete m_pConversionMenu;
}
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 0bf6a35abd98..2bf00300a5a5 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -173,20 +173,19 @@ public:
};
//========================================================================
-DBG_NAME(FmXPageViewWinRec)
+DBG_NAME(FormViewPageWindowAdapter)
//------------------------------------------------------------------------
-FmXPageViewWinRec::FmXPageViewWinRec( const ::comphelper::ComponentContext& _rContext, const SdrPageWindow& _rWindow, FmXFormView* _pViewImpl )
+FormViewPageWindowAdapter::FormViewPageWindowAdapter( const ::comphelper::ComponentContext& _rContext, const SdrPageWindow& _rWindow, FmXFormView* _pViewImpl )
: m_xControlContainer( _rWindow.GetControlContainer() ),
m_aContext( _rContext ),
m_pViewImpl( _pViewImpl ),
m_pWindow( dynamic_cast< Window* >( &_rWindow.GetPaintWindow().GetOutputDevice() ) )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::FmXPageViewWinRec" );
- DBG_CTOR(FmXPageViewWinRec,NULL);
+ DBG_CTOR(FormViewPageWindowAdapter,NULL);
// create an XFormController for every form
FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( _rWindow.GetPageView().GetPage() );
- DBG_ASSERT( pFormPage, "FmXPageViewWinRec::FmXPageViewWinRec: no FmFormPage found!" );
+ DBG_ASSERT( pFormPage, "FormViewPageWindowAdapter::FormViewPageWindowAdapter: no FmFormPage found!" );
if ( pFormPage )
{
try
@@ -207,15 +206,14 @@ FmXPageViewWinRec::FmXPageViewWinRec( const ::comphelper::ComponentContext& _rCo
}
}
// -----------------------------------------------------------------------------
-FmXPageViewWinRec::~FmXPageViewWinRec()
+FormViewPageWindowAdapter::~FormViewPageWindowAdapter()
{
- DBG_DTOR(FmXPageViewWinRec,NULL);
+ DBG_DTOR(FormViewPageWindowAdapter,NULL);
}
//------------------------------------------------------------------
-void FmXPageViewWinRec::dispose()
+void FormViewPageWindowAdapter::dispose()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::dispose" );
for ( ::std::vector< Reference< XFormController > >::const_iterator i = m_aControllerList.begin();
i != m_aControllerList.end();
++i
@@ -249,39 +247,34 @@ void FmXPageViewWinRec::dispose()
//------------------------------------------------------------------------------
-sal_Bool SAL_CALL FmXPageViewWinRec::hasElements(void) throw( RuntimeException )
+sal_Bool SAL_CALL FormViewPageWindowAdapter::hasElements(void) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::hasElements" );
return getCount() != 0;
}
//------------------------------------------------------------------------------
-Type SAL_CALL FmXPageViewWinRec::getElementType(void) throw( RuntimeException )
+Type SAL_CALL FormViewPageWindowAdapter::getElementType(void) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::getElementType" );
return ::getCppuType((const Reference< XFormController>*)0);
}
// XEnumerationAccess
//------------------------------------------------------------------------------
-Reference< XEnumeration > SAL_CALL FmXPageViewWinRec::createEnumeration(void) throw( RuntimeException )
+Reference< XEnumeration > SAL_CALL FormViewPageWindowAdapter::createEnumeration(void) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::createEnumeration" );
return new ::comphelper::OEnumerationByIndex(this);
}
// XIndexAccess
//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL FmXPageViewWinRec::getCount(void) throw( RuntimeException )
+sal_Int32 SAL_CALL FormViewPageWindowAdapter::getCount(void) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::getCount" );
return m_aControllerList.size();
}
//------------------------------------------------------------------------------
-Any SAL_CALL FmXPageViewWinRec::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
+Any SAL_CALL FormViewPageWindowAdapter::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::getByIndex" );
if (nIndex < 0 ||
nIndex >= getCount())
throw IndexOutOfBoundsException();
@@ -292,7 +285,7 @@ Any SAL_CALL FmXPageViewWinRec::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBo
}
//------------------------------------------------------------------------
-void SAL_CALL FmXPageViewWinRec::makeVisible( const Reference< XControl >& _Control ) throw (RuntimeException)
+void SAL_CALL FormViewPageWindowAdapter::makeVisible( const Reference< XControl >& _Control ) throw (RuntimeException)
{
::vos::OGuard aSolarGuard(Application::GetSolarMutex());
@@ -331,9 +324,8 @@ Reference< XFormController > getControllerSearchChilds( const Reference< XIndex
// Search the according controller
//------------------------------------------------------------------------
-Reference< XFormController > FmXPageViewWinRec::getController( const Reference< XForm > & xForm ) const
+Reference< XFormController > FormViewPageWindowAdapter::getController( const Reference< XForm > & xForm ) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::getController" );
Reference< XTabControllerModel > xModel(xForm, UNO_QUERY);
for (::std::vector< Reference< XFormController > >::const_iterator i = m_aControllerList.begin();
i != m_aControllerList.end(); i++)
@@ -350,9 +342,9 @@ Reference< XFormController > FmXPageViewWinRec::getController( const Reference<
}
//------------------------------------------------------------------------
-void FmXPageViewWinRec::setController(const Reference< XForm > & xForm, const Reference< XFormController >& _rxParentController )
+void FormViewPageWindowAdapter::setController(const Reference< XForm > & xForm, const Reference< XFormController >& _rxParentController )
{
- DBG_ASSERT( xForm.is(), "FmXPageViewWinRec::setController: there should be a form!" );
+ DBG_ASSERT( xForm.is(), "FormViewPageWindowAdapter::setController: there should be a form!" );
Reference< XIndexAccess > xFormCps(xForm, UNO_QUERY);
if (!xFormCps.is())
return;
@@ -410,10 +402,9 @@ void FmXPageViewWinRec::setController(const Reference< XForm > & xForm, const Re
}
//------------------------------------------------------------------------
-void FmXPageViewWinRec::updateTabOrder( const Reference< XForm >& _rxForm )
+void FormViewPageWindowAdapter::updateTabOrder( const Reference< XForm >& _rxForm )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::updateTabOrder" );
- OSL_PRECOND( _rxForm.is(), "FmXPageViewWinRec::updateTabOrder: illegal argument!" );
+ OSL_PRECOND( _rxForm.is(), "FormViewPageWindowAdapter::updateTabOrder: illegal argument!" );
if ( !_rxForm.is() )
return;
@@ -457,13 +448,11 @@ FmXFormView::FmXFormView(const ::comphelper::ComponentContext& _rContext, FmForm
,m_bFirstActivation( true )
,m_isTabOrderUpdateSuspended( false )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::FmXFormView" );
}
//------------------------------------------------------------------------
void FmXFormView::cancelEvents()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::cancelEvents" );
if ( m_nActivationEvent )
{
Application::RemoveUserEvent( m_nActivationEvent );
@@ -492,7 +481,6 @@ void FmXFormView::cancelEvents()
//------------------------------------------------------------------------
void FmXFormView::notifyViewDying( )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::notifyViewDying" );
DBG_ASSERT( m_pView, "FmXFormView::notifyViewDying: my view already died!" );
m_pView = NULL;
cancelEvents();
@@ -501,7 +489,17 @@ void FmXFormView::notifyViewDying( )
//------------------------------------------------------------------------
FmXFormView::~FmXFormView()
{
- DBG_ASSERT(m_aWinList.size() == 0, "FmXFormView::~FmXFormView: Window list not empty!");
+ DBG_ASSERT( m_aPageWindowAdapters.empty(), "FmXFormView::~FmXFormView: Window list not empty!" );
+ if ( !m_aPageWindowAdapters.empty() )
+ {
+ for ( PageWindowAdapterList::const_iterator loop = m_aPageWindowAdapters.begin();
+ loop != m_aPageWindowAdapters.end();
+ ++loop
+ )
+ {
+ (*loop)->dispose();
+ }
+ }
cancelEvents();
@@ -513,7 +511,6 @@ FmXFormView::~FmXFormView()
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::disposing(const EventObject& Source) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::disposing" );
if ( m_xWindow.is() && Source.Source == m_xWindow )
removeGridWindowListening();
}
@@ -522,7 +519,6 @@ void SAL_CALL FmXFormView::disposing(const EventObject& Source) throw( RuntimeEx
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::formActivated(const EventObject& rEvent) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::formActivated" );
if ( m_pView && m_pView->GetFormShell() && m_pView->GetFormShell()->GetImpl() )
m_pView->GetFormShell()->GetImpl()->formActivated( rEvent );
}
@@ -530,7 +526,6 @@ void SAL_CALL FmXFormView::formActivated(const EventObject& rEvent) throw( Runti
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::formDeactivated(const EventObject& rEvent) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::formDeactivated" );
if ( m_pView && m_pView->GetFormShell() && m_pView->GetFormShell()->GetImpl() )
m_pView->GetFormShell()->GetImpl()->formDeactivated( rEvent );
}
@@ -539,7 +534,6 @@ void SAL_CALL FmXFormView::formDeactivated(const EventObject& rEvent) throw( Run
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::elementInserted(const ContainerEvent& evt) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::elementInserted" );
try
{
Reference< XControlContainer > xControlContainer( evt.Source, UNO_QUERY_THROW );
@@ -554,11 +548,9 @@ void SAL_CALL FmXFormView::elementInserted(const ContainerEvent& evt) throw( Run
}
else
{
- FmWinRecList::iterator pos = findWindow( xControlContainer );
- if ( pos != m_aWinList.end() )
- {
- (*pos)->updateTabOrder( xForm );
- }
+ PFormViewPageWindowAdapter pAdapter = findWindow( xControlContainer );
+ if ( pAdapter.is() )
+ pAdapter->updateTabOrder( xForm );
}
}
catch( const Exception& )
@@ -570,92 +562,80 @@ void SAL_CALL FmXFormView::elementInserted(const ContainerEvent& evt) throw( Run
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::elementReplaced(const ContainerEvent& evt) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::elementReplaced" );
elementInserted(evt);
}
//------------------------------------------------------------------------------
void SAL_CALL FmXFormView::elementRemoved(const ContainerEvent& /*evt*/) throw( RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::elementRemoved" );
}
//------------------------------------------------------------------------------
-FmWinRecList::const_iterator FmXFormView::findWindow( const Reference< XControlContainer >& _rxCC ) const
+PFormViewPageWindowAdapter FmXFormView::findWindow( const Reference< XControlContainer >& _rxCC ) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::findWindow" );
- for (FmWinRecList::const_iterator i = m_aWinList.begin();
- i != m_aWinList.end(); i++)
- {
- if ( _rxCC == (*i)->getControlContainer() )
- return i;
- }
- return m_aWinList.end();
-}
-
-//------------------------------------------------------------------------------
-FmWinRecList::iterator FmXFormView::findWindow( const Reference< XControlContainer >& _rxCC )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::findWindow" );
- for (FmWinRecList::iterator i = m_aWinList.begin();
- i != m_aWinList.end(); i++)
+ for ( PageWindowAdapterList::const_iterator i = m_aPageWindowAdapters.begin();
+ i != m_aPageWindowAdapters.end();
+ ++i
+ )
{
if ( _rxCC == (*i)->getControlContainer() )
- return i;
+ return *i;
}
- return m_aWinList.end();
+ return NULL;
}
//------------------------------------------------------------------------------
void FmXFormView::addWindow(const SdrPageWindow& rWindow)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::addWindow" );
FmFormPage* pFormPage = PTR_CAST( FmFormPage, rWindow.GetPageView().GetPage() );
if ( !pFormPage )
return;
Reference< XControlContainer > xCC = rWindow.GetControlContainer();
- if ( xCC.is() && findWindow( xCC ) == m_aWinList.end())
+ if ( xCC.is()
+ && ( !findWindow( xCC ).is() )
+ )
{
- FmXPageViewWinRec *pFmRec = new FmXPageViewWinRec( m_aContext, rWindow, this );
- pFmRec->acquire();
-
- m_aWinList.push_back(pFmRec);
+ PFormViewPageWindowAdapter pAdapter = new FormViewPageWindowAdapter( m_aContext, rWindow, this );
+ m_aPageWindowAdapters.push_back( pAdapter );
// Am ControlContainer horchen um Aenderungen mitzbekommen
Reference< XContainer > xContainer( xCC, UNO_QUERY );
- if (xContainer.is())
- xContainer->addContainerListener(this);
+ if ( xContainer.is() )
+ xContainer->addContainerListener( this );
}
}
//------------------------------------------------------------------------------
void FmXFormView::removeWindow( const Reference< XControlContainer >& _rxCC )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::removeWindow" );
// Wird gerufen, wenn
// - in den Design-Modus geschaltet wird
// - ein Window geloescht wird, waehrend man im Design-Modus ist
// - der Control-Container fuer ein Window entfernt wird, waehrend
// der aktive Modus eingeschaltet ist.
- FmWinRecList::iterator i = findWindow( _rxCC );
- if (i != m_aWinList.end())
+
+ for ( PageWindowAdapterList::iterator i = m_aPageWindowAdapters.begin();
+ i != m_aPageWindowAdapters.end();
+ ++i
+ )
{
- // Am ControlContainer horchen um Aenderungen mitzbekommen
+ if ( _rxCC != (*i)->getControlContainer() )
+ continue;
+
Reference< XContainer > xContainer( _rxCC, UNO_QUERY );
- if (xContainer.is())
- xContainer->removeContainerListener(this);
+ if ( xContainer.is() )
+ xContainer->removeContainerListener( this );
(*i)->dispose();
- (*i)->release();
- m_aWinList.erase(i);
+ m_aPageWindowAdapters.erase( i );
+ break;
}
}
//------------------------------------------------------------------------------
void FmXFormView::displayAsyncErrorMessage( const SQLErrorEvent& _rEvent )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::displayAsyncErrorMessage" );
DBG_ASSERT( 0 == m_nErrorMessageEvent, "FmXFormView::displayAsyncErrorMessage: not too fast, please!" );
// This should not happen - usually, the PostUserEvent is faster than any possible user
// interaction which could trigger a new error. If it happens, we need a queue for the events.
@@ -674,7 +654,6 @@ IMPL_LINK(FmXFormView, OnDelayedErrorMessage, void*, /*EMPTYTAG*/)
//------------------------------------------------------------------------------
void FmXFormView::onFirstViewActivation( const FmFormModel* _pDocModel )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::onFirstViewActivation" );
if ( _pDocModel && _pDocModel->GetAutoControlFocus() )
m_nAutoFocusEvent = Application::PostUserEvent( LINK( this, FmXFormView, OnAutoFocus ) );
}
@@ -682,7 +661,6 @@ void FmXFormView::onFirstViewActivation( const FmFormModel* _pDocModel )
//------------------------------------------------------------------------------
void FmXFormView::suspendTabOrderUpdate()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::suspendTabOrderUpdate" );
OSL_ENSURE( !m_isTabOrderUpdateSuspended, "FmXFormView::suspendTabOrderUpdate: nesting not allowed!" );
m_isTabOrderUpdateSuspended = true;
}
@@ -690,7 +668,6 @@ void FmXFormView::suspendTabOrderUpdate()
//------------------------------------------------------------------------------
void FmXFormView::resumeTabOrderUpdate()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::resumeTabOrderUpdate" );
OSL_ENSURE( m_isTabOrderUpdateSuspended, "FmXFormView::resumeTabOrderUpdate: not suspended!" );
m_isTabOrderUpdateSuspended = false;
@@ -700,8 +677,8 @@ void FmXFormView::resumeTabOrderUpdate()
++container
)
{
- FmWinRecList::iterator pos = findWindow( container->first );
- if ( pos == m_aWinList.end() )
+ PFormViewPageWindowAdapter pAdapter = findWindow( container->first );
+ if ( !pAdapter.is() )
continue;
for ( SetOfForms::const_iterator form = container->second.begin();
@@ -709,7 +686,7 @@ void FmXFormView::resumeTabOrderUpdate()
++form
)
{
- (*pos)->updateTabOrder( *form );
+ pAdapter->updateTabOrder( *form );
}
}
m_aNeedTabOrderUpdate.clear();
@@ -730,41 +707,42 @@ IMPL_LINK(FmXFormView, OnActivate, void*, /*EMPTYTAG*/)
if (m_pView->GetFormShell() && m_pView->GetActualOutDev() && m_pView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
{
Window* pWindow = const_cast<Window*>(static_cast<const Window*>(m_pView->GetActualOutDev()));
- FmXPageViewWinRec* pFmRec = m_aWinList.size() ? m_aWinList[0] : NULL;
- for (FmWinRecList::const_iterator i = m_aWinList.begin();
- i != m_aWinList.end(); i++)
+ PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
+ for ( PageWindowAdapterList::const_iterator i = m_aPageWindowAdapters.begin();
+ i != m_aPageWindowAdapters.end();
+ ++i
+ )
{
- if (pWindow == (*i)->getWindow())
- pFmRec =*i;
+ if ( pWindow == (*i)->getWindow() )
+ pAdapter =*i;
}
- if (pFmRec)
+ if ( pAdapter.get() )
{
- for (::std::vector< Reference< XFormController > >::const_iterator i = pFmRec->GetList().begin();
- i != pFmRec->GetList().end(); i++)
+ for ( ::std::vector< Reference< XFormController > >::const_iterator i = pAdapter->GetList().begin();
+ i != pAdapter->GetList().end();
+ ++i
+ )
{
const Reference< XFormController > & xController = *i;
- if (xController.is())
+ if ( !xController.is() )
+ continue;
+
+ // only database forms are to be activated
+ Reference< XRowSet > xForm(xController->getModel(), UNO_QUERY);
+ if ( !xForm.is() || !OStaticDataAccessTools().getRowSetConnection( xForm ).is() )
+ continue;
+
+ Reference< XPropertySet > xFormSet( xForm, UNO_QUERY );
+ ENSURE_OR_CONTINUE( xFormSet.is(), "FmXFormView::OnActivate: a form which does not have properties?" );
+
+ const ::rtl::OUString aSource = ::comphelper::getString( xFormSet->getPropertyValue( FM_PROP_COMMAND ) );
+ if ( aSource.getLength() )
{
- // Nur bei Datenbankformularen erfolgt eine aktivierung
- Reference< XRowSet > xForm(xController->getModel(), UNO_QUERY);
- if (xForm.is() && OStaticDataAccessTools().getRowSetConnection(xForm).is())
- {
- Reference< XPropertySet > xFormSet(xForm, UNO_QUERY);
- if (xFormSet.is())
- {
- // wenn es eine Datenquelle gibt, dann als aktive ::com::sun::star::form setzen
- ::rtl::OUString aSource = ::comphelper::getString(xFormSet->getPropertyValue(FM_PROP_COMMAND));
- if (aSource.getLength())
- {
- // benachrichtigung der Shell
- FmXFormShell* pShImpl = m_pView->GetFormShell()->GetImpl();
- if (pShImpl)
- pShImpl->setActiveController(xController);
- break;
- }
- }
- }
+ FmXFormShell* pShImpl = m_pView->GetFormShell()->GetImpl();
+ if ( pShImpl )
+ pShImpl->setActiveController( xController );
+ break;
}
}
}
@@ -775,7 +753,6 @@ IMPL_LINK(FmXFormView, OnActivate, void*, /*EMPTYTAG*/)
//------------------------------------------------------------------------------
void FmXFormView::Activate(sal_Bool bSync)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::Activate" );
if (m_nActivationEvent)
{
Application::RemoveUserEvent(m_nActivationEvent);
@@ -793,7 +770,6 @@ void FmXFormView::Activate(sal_Bool bSync)
//------------------------------------------------------------------------------
void FmXFormView::Deactivate(BOOL bDeactivateController)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::Deactivate" );
if (m_nActivationEvent)
{
Application::RemoveUserEvent(m_nActivationEvent);
@@ -808,13 +784,11 @@ void FmXFormView::Deactivate(BOOL bDeactivateController)
//------------------------------------------------------------------------------
FmFormShell* FmXFormView::GetFormShell() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::GetFormShell" );
return m_pView ? m_pView->GetFormShell() : NULL;
}
// -----------------------------------------------------------------------------
void FmXFormView::AutoFocus( sal_Bool _bSync )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::AutoFocus" );
if (m_nAutoFocusEvent)
Application::RemoveUserEvent(m_nAutoFocusEvent);
@@ -927,18 +901,20 @@ namespace
// -----------------------------------------------------------------------------
Reference< XFormController > FmXFormView::getFormController( const Reference< XForm >& _rxForm, const OutputDevice& _rDevice ) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::getFormController" );
Reference< XFormController > xController;
- for ( FmWinRecList::const_iterator rec = m_aWinList.begin(); rec != m_aWinList.end(); ++rec )
+ for ( PageWindowAdapterList::const_iterator pos = m_aPageWindowAdapters.begin();
+ pos != m_aPageWindowAdapters.end();
+ ++pos
+ )
{
- const FmXPageViewWinRec* pViewWinRec( *rec );
- OSL_ENSURE( pViewWinRec, "FmXFormView::getFormController: invalid PageViewWinRec!" );
- if ( !pViewWinRec || ( pViewWinRec->getWindow() != &_rDevice ) )
+ const PFormViewPageWindowAdapter pAdapter( *pos );
+ ENSURE_OR_CONTINUE( pAdapter.get(), "FmXFormView::getFormController: invalid page window adapter!" );
+ if ( pAdapter->getWindow() != &_rDevice )
// wrong device
continue;
- xController = pViewWinRec->getController( _rxForm );
+ xController = pAdapter->getController( _rxForm );
if ( xController.is() )
break;
}
@@ -960,12 +936,10 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
FmFormPage* pPage = m_pView ? PTR_CAST( FmFormPage, m_pView->GetSdrPageView()->GetPage() ) : NULL;
Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() );
- const FmXPageViewWinRec* pViewWinRec = m_aWinList.size() ? m_aWinList[0] : NULL;
- const Window* pWindow = pViewWinRec ? pViewWinRec->getWindow() : NULL;
+ const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
+ const Window* pWindow = pAdapter.get() ? pAdapter->getWindow() : NULL;
- OSL_ENSURE( xForms.is() && pWindow, "FmXFormView::OnAutoFocus: could not collect all essentials!" );
- if ( !xForms.is() || !pWindow )
- return 0L;
+ ENSURE_OR_RETURN( xForms.is() && pWindow, "FmXFormView::OnAutoFocus: could not collect all essentials!", 0L );
try
{
@@ -973,7 +947,7 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
if ( !xForms->getCount() )
break;
Reference< XForm > xForm( xForms->getByIndex( 0 ), UNO_QUERY_THROW );
- Reference< XTabController > xTabController( pViewWinRec->getController( xForm ), UNO_QUERY_THROW );
+ Reference< XTabController > xTabController( pAdapter->getController( xForm ), UNO_QUERY_THROW );
// go for the first control of the controller
Sequence< Reference< XControl > > aControls( xTabController->getControls() );
@@ -1024,7 +998,6 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
// -----------------------------------------------------------------------------
void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::onCreatedFormObject" );
FmFormShell* pShell = m_pView ? m_pView->GetFormShell() : NULL;
FmXFormShell* pShellImpl = pShell ? pShell->GetImpl() : NULL;
OSL_ENSURE( pShellImpl, "FmXFormView::onCreatedFormObject: no form shell!" );
@@ -1155,7 +1128,6 @@ namespace
// -----------------------------------------------------------------------------
SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescriptor& _rColumnDescriptor )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::implCreateFieldControl" );
// not if we're in design mode
if ( !m_pView->IsDesignMode() )
return NULL;
@@ -1387,7 +1359,6 @@ SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescript
// -----------------------------------------------------------------------------
SdrObject* FmXFormView::implCreateXFormsControl( const ::svx::OXFormsDescriptor &_rDesc )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::implCreateXFormsControl" );
// not if we're in design mode
if ( !m_pView->IsDesignMode() )
return NULL;
@@ -1523,7 +1494,6 @@ bool FmXFormView::createControlLabelPair( OutputDevice& _rOutDev, sal_Int32 _nXO
const Reference< XDataSource >& _rxDataSource, const ::rtl::OUString& _rDataSourceName,
const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::createControlLabelPair" );
if ( !createControlLabelPair( m_aContext, _rOutDev, _nXOffsetMM, _nYOffsetMM,
_rxField, _rxNumberFormats, _nControlObjectID, _rFieldPostfix, FmFormInventor, OBJ_FM_FIXEDTEXT,
NULL, NULL, NULL, _rpLabel, _rpControl )
@@ -1551,7 +1521,6 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
const ::rtl::OUString& _rFieldPostfix, UINT32 _nInventor, UINT16 _nLabelObjectID,
SdrPage* _pLabelPage, SdrPage* _pControlPage, SdrModel* _pModel, SdrUnoObj*& _rpLabel, SdrUnoObj*& _rpControl)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::createControlLabelPair" );
sal_Int32 nDataType = 0;
::rtl::OUString sFieldName;
Any aFieldName;
@@ -1717,7 +1686,6 @@ void FmXFormView::ObjectRemoveListener::Notify( SfxBroadcaster& /*rBC*/, const S
//------------------------------------------------------------------------------
void FmXFormView::ObjectRemovedInAliveMode( const SdrObject* pObject )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::ObjectRemovedInAliveMode" );
// wenn das entfernte Objekt in meiner MarkList, die ich mir beim Umschalten in den Alive-Mode gemerkt habe, steht,
// muss ich es jetzt da rausnehmen, da ich sonst beim Zurueckschalten versuche, die Markierung wieder zu setzen
// (interesanterweise geht das nur bei gruppierten Objekten schief (beim Zugriff auf deren ObjList GPF), nicht bei einzelnen)
@@ -1740,7 +1708,6 @@ void FmXFormView::ObjectRemovedInAliveMode( const SdrObject* pObject )
//------------------------------------------------------------------------------
void FmXFormView::stopMarkListWatching()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::stopMarkListWatching" );
if ( m_pWatchStoredList )
{
m_pWatchStoredList->EndListeningAll();
@@ -1752,7 +1719,6 @@ void FmXFormView::stopMarkListWatching()
//------------------------------------------------------------------------------
void FmXFormView::startMarkListWatching()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::startMarkListWatching" );
if ( !m_pWatchStoredList )
{
m_pWatchStoredList = new ObjectRemoveListener( this );
@@ -1769,7 +1735,6 @@ void FmXFormView::startMarkListWatching()
//------------------------------------------------------------------------------
void FmXFormView::saveMarkList( sal_Bool _bSmartUnmark )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::saveMarkList" );
if ( m_pView )
{
m_aMark = m_pView->GetMarkedObjectList();
@@ -1828,7 +1793,6 @@ static sal_Bool lcl_hasObject( SdrObjListIter& rIter, SdrObject* pObj )
//------------------------------------------------------------------------------
void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::restoreMarkList" );
if ( !m_pView )
return;
@@ -1916,7 +1880,6 @@ void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList )
// -----------------------------------------------------------------------------
void SAL_CALL FmXFormView::focusGained( const FocusEvent& /*e*/ ) throw (RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::focusGained" );
if ( m_xWindow.is() && m_pView )
{
m_pView->SetMoveOutside( TRUE, FmFormView::ImplAccess() );
@@ -1925,7 +1888,6 @@ void SAL_CALL FmXFormView::focusGained( const FocusEvent& /*e*/ ) throw (Runtime
// -----------------------------------------------------------------------------
void SAL_CALL FmXFormView::focusLost( const FocusEvent& /*e*/ ) throw (RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::focusLost" );
// when switch the focus outside the office the mark didn't change
// so we can not remove us as focus listener
if ( m_xWindow.is() && m_pView )
@@ -1936,7 +1898,6 @@ void SAL_CALL FmXFormView::focusLost( const FocusEvent& /*e*/ ) throw (RuntimeEx
// -----------------------------------------------------------------------------
void FmXFormView::removeGridWindowListening()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::removeGridWindowListening" );
if ( m_xWindow.is() )
{
m_xWindow->removeFocusListener(this);
@@ -1951,7 +1912,6 @@ void FmXFormView::removeGridWindowListening()
// -----------------------------------------------------------------------------
DocumentType FmXFormView::impl_getDocumentType() const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::impl_getDocumentType" );
if ( GetFormShell() && GetFormShell()->GetImpl() )
return GetFormShell()->GetImpl()->getDocumentType();
return eUnknownDocumentType;
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index b8292785b457..f43233ae08ba 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -62,6 +62,7 @@
#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/form/runtime/FormOperations.hpp>
#include <com/sun/star/form/runtime/FormFeature.hpp>
@@ -80,6 +81,7 @@
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/uno3.hxx>
+#include <comphelper/scopeguard.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/controls/unocontrol.hxx>
@@ -208,6 +210,7 @@ namespace svxform
namespace FocusChangeReason = ::com::sun::star::awt::FocusChangeReason;
namespace RowChangeAction = ::com::sun::star::sdb::RowChangeAction;
namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
+ namespace DataType = ::com::sun::star::sdbc::DataType;
//==============================================================================
// ColumnInfo
@@ -583,6 +586,7 @@ FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB
,m_bAttachEvents(sal_True)
,m_bDetachEvents(sal_True)
,m_bAttemptedHandlerCreation( false )
+ ,m_bSuspendFilterTextListening( false )
{
DBG_CTOR( FormController, NULL );
@@ -782,6 +786,9 @@ namespace
// -----------------------------------------------------------------------------
void FormController::impl_setTextOnAllFilter_throw()
{
+ m_bSuspendFilterTextListening = true;
+ ::comphelper::FlagGuard aResetFlag( m_bSuspendFilterTextListening );
+
// reset the text for all controls
::std::for_each( m_aFilterComponents.begin(), m_aFilterComponents.end(), ResetComponentText() );
@@ -855,32 +862,38 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons
if ( rRow.empty() )
continue;
- if ( aFilter.getLength() )
- aFilter.appendAscii( " OR " );
-
- aFilter.appendAscii( "( " );
+ ::rtl::OUStringBuffer aRowFilter;
for ( FmFilterRow::const_iterator condition = rRow.begin(); condition != rRow.end(); ++condition )
{
// get the field of the controls map
Reference< XControl > xControl( condition->first, UNO_QUERY_THROW );
Reference< XPropertySet > xModelProps( xControl->getModel(), UNO_QUERY_THROW );
Reference< XPropertySet > xField( xModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ), UNO_QUERY_THROW );
- if ( condition != rRow.begin() )
- aFilter.appendAscii( " AND " );
::rtl::OUString sFilterValue( condition->second );
::rtl::OUString sErrorMsg, sCriteria;
- ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree( sErrorMsg, sFilterValue, xFormatter, xField );
+ const ::rtl::Reference< ISQLParseNode > xParseNode =
+ predicateTree( sErrorMsg, sFilterValue, xFormatter, xField );
OSL_ENSURE( xParseNode.is(), "FormController::getFastPropertyValue: could not parse the field value predicate!" );
if ( xParseNode.is() )
{
// don't use a parse context here, we need it unlocalized
xParseNode->parseNodeToStr( sCriteria, xConnection, NULL );
- aFilter.append( sCriteria );
+ if ( condition != rRow.begin() )
+ aRowFilter.appendAscii( " AND " );
+ aRowFilter.append( sCriteria );
}
}
- aFilter.appendAscii( " )" );
+ if ( aRowFilter.getLength() > 0 )
+ {
+ if ( aFilter.getLength() )
+ aFilter.appendAscii( " OR " );
+
+ aFilter.appendAscii( "( " );
+ aFilter.append( aRowFilter.makeStringAndClear() );
+ aFilter.appendAscii( " )" );
+ }
}
}
catch( const Exception& )
@@ -1494,50 +1507,54 @@ void SAL_CALL FormController::textChanged(const TextEvent& e) throw( RuntimeExce
// SYNCHRONIZED -->
::osl::ClearableMutexGuard aGuard( m_aMutex );
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
- if (m_bFiltering)
+ if ( !m_bFiltering )
{
- Reference< XTextComponent > xText(e.Source,UNO_QUERY);
- ::rtl::OUString aText = xText->getText();
-
- if ( m_aFilterRows.empty() )
- appendEmptyDisjunctiveTerm();
+ impl_onModify();
+ return;
+ }
- // Suchen der aktuellen Row
- if ( ( (size_t)m_nCurrentFilterPosition >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) )
- {
- OSL_ENSURE( false, "FormController::textChanged: m_nCurrentFilterPosition is wrong!" );
- return;
- }
+ if ( m_bSuspendFilterTextListening )
+ return;
- FmFilterRow& rRow = m_aFilterRows[ m_nCurrentFilterPosition ];
+ Reference< XTextComponent > xText(e.Source,UNO_QUERY);
+ ::rtl::OUString aText = xText->getText();
- // do we have a new filter
- if (aText.getLength())
- rRow[xText] = aText;
- else
- {
- // do we have the control in the row
- FmFilterRow::iterator iter = rRow.find(xText);
- // erase the entry out of the row
- if (iter != rRow.end())
- rRow.erase(iter);
- }
+ if ( m_aFilterRows.empty() )
+ appendEmptyDisjunctiveTerm();
- // multiplex the event to our FilterControllerListeners
- FilterEvent aEvent;
- aEvent.Source = *this;
- aEvent.FilterComponent = ::std::find( m_aFilterComponents.begin(), m_aFilterComponents.end(), xText ) - m_aFilterComponents.begin();
- aEvent.DisjunctiveTerm = getActiveTerm();
- aEvent.PredicateExpression = aText;
+ // Suchen der aktuellen Row
+ if ( ( (size_t)m_nCurrentFilterPosition >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) )
+ {
+ OSL_ENSURE( false, "FormController::textChanged: m_nCurrentFilterPosition is wrong!" );
+ return;
+ }
- aGuard.clear();
- // <-- SYNCHRONIZED
+ FmFilterRow& rRow = m_aFilterRows[ m_nCurrentFilterPosition ];
- // notify the changed filter expression
- m_aFilterListeners.notifyEach( &XFilterControllerListener::predicateExpressionChanged, aEvent );
- }
+ // do we have a new filter
+ if (aText.getLength())
+ rRow[xText] = aText;
else
- impl_onModify();
+ {
+ // do we have the control in the row
+ FmFilterRow::iterator iter = rRow.find(xText);
+ // erase the entry out of the row
+ if (iter != rRow.end())
+ rRow.erase(iter);
+ }
+
+ // multiplex the event to our FilterControllerListeners
+ FilterEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.FilterComponent = ::std::find( m_aFilterComponents.begin(), m_aFilterComponents.end(), xText ) - m_aFilterComponents.begin();
+ aEvent.DisjunctiveTerm = getActiveTerm();
+ aEvent.PredicateExpression = aText;
+
+ aGuard.clear();
+ // <-- SYNCHRONIZED
+
+ // notify the changed filter expression
+ m_aFilterListeners.notifyEach( &XFilterControllerListener::predicateExpressionChanged, aEvent );
}
// XItemListener
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index 1131209a384a..8bb682690b36 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -51,6 +51,7 @@
#include <cppuhelper/implbase3.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/componentcontext.hxx>
+#include <rtl/ref.hxx>
//class SdrPageViewWinRec;
class SdrPageWindow;
@@ -79,13 +80,13 @@ namespace svx {
}
//==================================================================
-// FmXPageViewWinRec
+// FormViewPageWindowAdapter
//==================================================================
typedef ::cppu::WeakImplHelper2 < ::com::sun::star::container::XIndexAccess
, ::com::sun::star::form::runtime::XFormControllerContext
- > FmXPageViewWinRec_Base;
+ > FormViewPageWindowAdapter_Base;
-class FmXPageViewWinRec : public FmXPageViewWinRec_Base
+class FormViewPageWindowAdapter : public FormViewPageWindowAdapter_Base
{
friend class FmXFormView;
@@ -96,10 +97,10 @@ class FmXPageViewWinRec : public FmXPageViewWinRec_Base
Window* m_pWindow;
protected:
- ~FmXPageViewWinRec();
+ ~FormViewPageWindowAdapter();
public:
- FmXPageViewWinRec( const ::comphelper::ComponentContext& _rContext,
+ FormViewPageWindowAdapter( const ::comphelper::ComponentContext& _rContext,
const SdrPageWindow&, FmXFormView* pView);
//const SdrPageViewWinRec*, FmXFormView* pView);
@@ -130,7 +131,8 @@ protected:
Window* getWindow() const {return m_pWindow;}
};
-typedef ::std::vector<FmXPageViewWinRec*> FmWinRecList;
+typedef ::rtl::Reference< FormViewPageWindowAdapter > PFormViewPageWindowAdapter;
+typedef ::std::vector< PFormViewPageWindowAdapter > PageWindowAdapterList;
typedef ::std::set < ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
, ::comphelper::OInterfaceCompare< ::com::sun::star::form::XForm >
> SetOfForms;
@@ -150,7 +152,7 @@ class FmXFormView : public ::cppu::WeakImplHelper3<
friend class FmFormView;
friend class FmFormShell;
friend class FmXFormShell;
- friend class FmXPageViewWinRec;
+ friend class FormViewPageWindowAdapter;
class ObjectRemoveListener;
friend class ObjectRemoveListener;
@@ -168,7 +170,8 @@ class FmXFormView : public ::cppu::WeakImplHelper3<
::com::sun::star::sdb::SQLErrorEvent
m_aAsyncError; // error event which is to be displayed asyn. See m_nErrorMessageEvent.
- FmWinRecList m_aWinList; // to be filled in alive mode only
+ PageWindowAdapterList
+ m_aPageWindowAdapters; // to be filled in alive mode only
MapControlContainerToSetOfForms
m_aNeedTabOrderUpdate;
@@ -215,8 +218,7 @@ public:
virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException);
FmFormView* getView() const {return m_pView;}
- FmWinRecList::const_iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC ) const;
- const FmWinRecList& getWindowList() const {return m_aWinList;}
+ PFormViewPageWindowAdapter findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC ) const;
::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >
getFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
@@ -246,7 +248,6 @@ public:
);
private:
- FmWinRecList::iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
//void addWindow(const SdrPageViewWinRec*);
void addWindow(const SdrPageWindow&);
void removeWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
diff --git a/svx/source/inc/formcontroller.hxx b/svx/source/inc/formcontroller.hxx
index 82a3516584f7..b0f42a0e97ea 100644
--- a/svx/source/inc/formcontroller.hxx
+++ b/svx/source/inc/formcontroller.hxx
@@ -214,7 +214,8 @@ namespace svxform
sal_Bool m_bFiltering : 1;
sal_Bool m_bAttachEvents : 1;
sal_Bool m_bDetachEvents : 1;
- sal_Bool m_bAttemptedHandlerCreation : 1;
+ bool m_bAttemptedHandlerCreation : 1;
+ bool m_bSuspendFilterTextListening; // no bit field, passed around as reference
// as we want to intercept dispatches of _all_ controls we're responsible for, and an object implementing
// the ::com::sun::star::frame::XDispatchProviderInterceptor interface can intercept only _one_ objects dispatches, we need a helper class
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 85513fb3b926..6c9c72930603 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -192,6 +192,10 @@ void SdrPageWindow::PrePaint()
}
}
+void SdrPageWindow::PostPaint()
+{
+}
+
void SdrPageWindow::PrepareRedraw(const Region& rReg)
{
// evtl. give OC the chance to do ProcessDisplay preparations
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 03e3dc31a94f..0ccfd1e01346 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -358,6 +358,21 @@ void SdrPageView::PrePaint()
}
}
+void SdrPageView::PostPaint()
+{
+ const sal_uInt32 nCount(PageWindowCount());
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ SdrPageWindow* pCandidate = GetPageWindow(a);
+
+ if(pCandidate)
+ {
+ pCandidate->PostPaint();
+ }
+ }
+}
+
void SdrPageView::CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) const
{
if(GetPage())
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 998c687608fc..feaf859c3b21 100755..100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -733,6 +733,14 @@ void SdrPaintView::PrePaint()
}
}
+void SdrPaintView::PostPaint()
+{
+ if(mpPageView)
+ {
+ mpPageView->PostPaint();
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// #define SVX_REPAINT_TIMER_TEST
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index dda324cb98d1..4b9e68650180 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -116,7 +116,7 @@ String DictionaryList::makeTabString( const DictionaryEntry& rEntry ) const
void DictionaryList::initDictionaryControl( const Reference< linguistic2::XConversionDictionary>& xDictionary
, ListBox* pPropertyTypeNameListBox )
{
- SetWindowBits( WB_VSCROLL );
+ SetStyle( WB_VSCROLL | WB_TABSTOP );
SetSelectionMode( SINGLE_SELECTION );
SetBorderStyle( WINDOW_BORDER_MONO );
SetHighlightRange();
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index bda709dc4abd..45ecf71b5aff 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -707,8 +707,8 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
else
{
const String aGraphicObjectId( aPictureStreamName );
- const GraphicObject aGrfObject( ByteString( aGraphicObjectId, RTL_TEXTENCODING_ASCII_US ) );
-
+ const ByteString aAsciiObjectID( aGraphicObjectId, RTL_TEXTENCODING_ASCII_US );
+ const GraphicObject aGrfObject( aAsciiObjectID );
if( aGrfObject.GetType() != GRAPHIC_NONE )
{
String aStreamName( aGraphicObjectId );
@@ -782,6 +782,15 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
rURLPair.second = sPictures;
rURLPair.second += aStreamName;
}
+#if OSL_DEBUG_LEVEL > 0
+ else
+ {
+ ByteString sMessage = "graphic object with ID '";
+ sMessage += aAsciiObjectID;
+ sMessage += "' has an unknown type";
+ OSL_ENSURE( false, sMessage.GetBuffer() );
+ }
+#endif
}
maURLSet.insert( aURLString );
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index a206392aad3b..e0667dc17c99 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -1058,7 +1058,7 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
#define FN_ENVELOP (FN_ENVELP )
-#define FN_DELETE_NOTE (FN_NOTES+0)
+
#define FN_DELETE_NOTE_AUTHOR (FN_NOTES+1)
#define FN_DELETE_ALL_NOTES (FN_NOTES+2)
#define FN_HIDE_NOTE (FN_NOTES+3)
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1e26b0f0e2bd..874004826379 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1902,6 +1902,7 @@ public:
// loesche den nicht sichtbaren ::com::sun::star::ucb::Content aus dem Document, wie z.B.:
// versteckte Bereiche, versteckte Absaetze
sal_Bool RemoveInvisibleContent();
+ sal_Bool HasInvisibleContent() const;
//restore the invisible content if it's available on the undo stack
sal_Bool RestoreInvisibleContent();
// replace fields by text - mailmerge support
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 9bb171f7c256..db9fe273a229 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -27,9 +27,10 @@
#ifndef _RING_HXX
#define _RING_HXX
+#include <swdllapi.h>
#include <swtypes.hxx>
-class Ring
+class SW_DLLPUBLIC Ring
{
Ring *pNext;
Ring* pPrev; // zur Optimierung, damit das ein/ausketten schneller geht!
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 65de34a4db7f..9323d209c19a 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -161,7 +161,7 @@ public:
void ResetDescriptor();
//copy text from a given source PaM
void SetSelection(SwPaM& rCopySource);
- static SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
+ static SW_DLLPUBLIC SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
};
/*-----------------20.02.98 11:28-------------------
diff --git a/sw/qa/core/makefile.mk b/sw/qa/core/makefile.mk
index 00ebfda8844a..08d009ced68a 100644
--- a/sw/qa/core/makefile.mk
+++ b/sw/qa/core/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..
PRJNAME=sw
TARGET=test-bigptrarray
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 4725f53f3655..d77df897a95a 100755
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -34,12 +34,6 @@ interface _Annotation
StateMethod = GetNoteState ;
]
- FN_DELETE_NOTE
- [
- ExecMethod = NoteExec ;
- StateMethod = GetNoteState ;
- ]
-
FN_DELETE_NOTE_AUTHOR
[
ExecMethod = NoteExec ;
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index cd2d1f850090..1c5b0db4f062 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -132,6 +132,11 @@ interface BaseTextDocument
ExecMethod = Execute;
StateMethod = GetState;
]
+ SID_MAIL_PREPAREEXPORT
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState;
+ ]
}
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 994077d9552b..6ea824eab6cf 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -914,7 +914,7 @@ interface BaseText
ExecMethod = ExecField ;
StateMethod = StateField;
]
- FN_DELETE_NOTE
+ FN_DELETE_COMMENT
[
ExecMethod = ExecField ;
StateMethod = StateField;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index aae7ec7a019c..64f52343cb7b 100755..100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -9916,32 +9916,7 @@ SfxBoolItem SelectionModeDefault FN_SELECTION_MODE_DEFAULT
GroupId = GID_EDIT;
]
-//--------------------------------------------------------------------------
-SfxVoidItem DeleteNote FN_DELETE_NOTE
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-SfxVoidItem ReplyNote FN_REPLY
+SfxVoidItem ReplyComment FN_REPLY
()
[
/* flags: */
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index d4de8d35a87e..68b390ae42b1 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -630,6 +630,8 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
SwPrintData* SwDoc::getPrintData() const
{
+ if(!pPrtData)
+ ((SwDoc*)this)->pPrtData = new SwPrintData;
return pPrtData;
}
@@ -2395,6 +2397,54 @@ BOOL SwDoc::RemoveInvisibleContent()
EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
return bRet;
}
+/*-- 25.08.2010 14:18:12---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+BOOL SwDoc::HasInvisibleContent() const
+{
+ BOOL bRet = sal_False;
+
+ SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
+ if( aIter.First( TYPE( SwFmtFld ) ) )
+ bRet = sal_True;
+
+ //
+ // Search for any hidden paragraph (hidden text attribute)
+ //
+ if( ! bRet )
+ {
+ for( ULONG n = GetNodes().Count(); !bRet && (n > 0); )
+ {
+ SwTxtNode* pTxtNd = GetNodes()[ --n ]->GetTxtNode();
+ if ( pTxtNd )
+ {
+ SwPaM aPam( *pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().Len() );
+ if( pTxtNd->HasHiddenCharAttribute( true ) || ( pTxtNd->HasHiddenCharAttribute( false ) ) )
+ {
+ bRet = sal_True;
+ }
+ }
+ }
+ }
+
+ if( ! bRet )
+ {
+ const SwSectionFmts& rSectFmts = GetSections();
+ USHORT n;
+
+ for( n = rSectFmts.Count(); !bRet && (n > 0); )
+ {
+ SwSectionFmt* pSectFmt = rSectFmts[ --n ];
+ // don't add sections in Undo/Redo
+ if( !pSectFmt->IsInNodesArr())
+ continue;
+ SwSection* pSect = pSectFmt->GetSection();
+ if( pSect->IsHidden() )
+ bRet = sal_True;
+ }
+ }
+ return bRet;
+}
/*-- 11.06.2004 08:34:04---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -2509,26 +2559,17 @@ bool SwDoc::LinksUpdated() const
}
// embedded alle lokalen Links (Bereiche/Grafiken)
-bool SwDoc::EmbedAllLinks()
+::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr )
{
- BOOL bRet = FALSE;
- sfx2::LinkManager& rLnkMgr = GetLinkManager();
- const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
- if( rLnks.Count() )
+ for( USHORT n = 0; n < rLinks.Count(); ++n )
{
- BOOL bDoesUndo = DoesUndo();
- DoUndo( FALSE );
-
- for( USHORT n = 0; n < rLnks.Count(); ++n )
+ ::sfx2::SvBaseLink* pLnk = &(*rLinks[ n ]);
+ if( pLnk &&
+ ( OBJECT_CLIENT_GRF == pLnk->GetObjType() ||
+ OBJECT_CLIENT_FILE == pLnk->GetObjType() ) &&
+ pLnk->ISA( SwBaseLink ) )
{
- ::sfx2::SvBaseLink* pLnk = &(*rLnks[ n ]);
- if( pLnk &&
- ( OBJECT_CLIENT_GRF == pLnk->GetObjType() ||
- OBJECT_CLIENT_FILE == pLnk->GetObjType() ) &&
- pLnk->ISA( SwBaseLink ) )
- {
::sfx2::SvBaseLinkRef xLink = pLnk;
- USHORT nCount = rLnks.Count();
String sFName;
rLnkMgr.GetDisplayNames( xLink, 0, &sFName, 0, 0 );
@@ -2536,20 +2577,33 @@ bool SwDoc::EmbedAllLinks()
INetURLObject aURL( sFName );
if( INET_PROT_FILE == aURL.GetProtocol() ||
INET_PROT_CID == aURL.GetProtocol() )
- {
- // dem Link sagen, das er aufgeloest wird!
- xLink->Closed();
+ return pLnk;
+ }
+ }
+ return 0;
+}
+bool SwDoc::EmbedAllLinks()
+{
+ BOOL bRet = FALSE;
+ sfx2::LinkManager& rLnkMgr = GetLinkManager();
+ const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.GetLinks();
+ if( rLinks.Count() )
+ {
+ BOOL bDoesUndo = DoesUndo();
+ DoUndo( FALSE );
- // falls einer vergessen hat sich auszutragen
- if( xLink.Is() )
- rLnkMgr.Remove( xLink );
+ ::sfx2::SvBaseLink* pLnk = 0;
+ while( 0 != (pLnk = lcl_FindNextRemovableLink( rLinks, rLnkMgr ) ) )
+ {
+ ::sfx2::SvBaseLinkRef xLink = pLnk;
+ // dem Link sagen, das er aufgeloest wird!
+ xLink->Closed();
- if( nCount != rLnks.Count() + 1 )
- n = 0; // wieder von vorne anfangen, es wurden
- // mehrere Links entfernt
- bRet = TRUE;
- }
- }
+ // falls einer vergessen hat sich auszutragen
+ if( xLink.Is() )
+ rLnkMgr.Remove( xLink );
+
+ bRet = TRUE;
}
DelAllUndoObj();
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 277eef1693f5..27eadadc6633 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -185,7 +185,17 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea
*pContourItem = 0,
*pCharColorItem = 0,
*pCasemapItem = 0,
- *pBrushItem = 0;
+ *pBrushItem = 0,
+ *pFontCJKItem = 0,
+ *pFontSizeCJKItem = 0,
+ *pCJKLangItem = 0,
+ *pCJKPostureItem = 0,
+ *pCJKWeightItem = 0,
+ *pFontCTLItem = 0,
+ *pFontSizeCTLItem = 0,
+ *pCTLLangItem = 0,
+ *pCTLPostureItem = 0,
+ *pCTLWeightItem = 0;
PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin();
for(sal_uInt32 i = 0; i < nArrLen; i++, ++aIt)
@@ -370,6 +380,56 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea
pWLineItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
pTempItem = pWLineItem;
break;
+ case RES_CHRATR_CJK_FONT:
+ if(!pFontCJKItem )
+ pFontCJKItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pFontCJKItem;
+ break;
+ case RES_CHRATR_CJK_FONTSIZE:
+ if(!pFontSizeCJKItem )
+ pFontSizeCJKItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pFontSizeCJKItem;
+ break;
+ case RES_CHRATR_CJK_LANGUAGE:
+ if(!pCJKLangItem )
+ pCJKLangItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCJKLangItem;
+ break;
+ case RES_CHRATR_CJK_POSTURE:
+ if(!pCJKPostureItem )
+ pCJKPostureItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCJKPostureItem;
+ break;
+ case RES_CHRATR_CJK_WEIGHT:
+ if(!pCJKWeightItem )
+ pCJKWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCJKWeightItem;
+ break;
+ case RES_CHRATR_CTL_FONT:
+ if(!pFontCTLItem )
+ pFontCTLItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pFontCTLItem;
+ break;
+ case RES_CHRATR_CTL_FONTSIZE:
+ if(!pFontSizeCTLItem )
+ pFontSizeCTLItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pFontSizeCTLItem;
+ break;
+ case RES_CHRATR_CTL_LANGUAGE:
+ if(!pCTLLangItem )
+ pCTLLangItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCTLLangItem;
+ break;
+ case RES_CHRATR_CTL_POSTURE:
+ if(!pCTLPostureItem )
+ pCTLPostureItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCTLPostureItem;
+ break;
+ case RES_CHRATR_CTL_WEIGHT:
+ if(!pCTLWeightItem )
+ pCTLWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone();
+ pTempItem = pCTLWeightItem;
+ break;
}
if(pTempItem)
{
diff --git a/sw/source/filter/rtf/makefile.mk b/sw/source/filter/rtf/makefile.mk
index 5be61050a54d..a81164487af1 100644
--- a/sw/source/filter/rtf/makefile.mk
+++ b/sw/source/filter/rtf/makefile.mk
@@ -48,17 +48,15 @@ EXCEPTIONSFILES= \
$(SLO)$/rtfnum.obj \
$(SLO)$/rtftbl.obj \
$(SLO)$/swparrtf.obj \
- $(SLO)$/wrtrtf.obj
+ $(SLO)$/rtffld.obj
SLOFILES = \
- $(SLO)$/rtfatr.obj \
$(SLO)$/rtffld.obj \
$(SLO)$/rtffly.obj \
$(SLO)$/rtfnum.obj \
$(SLO)$/rtftbl.obj \
- $(SLO)$/swparrtf.obj \
- $(SLO)$/wrtrtf.obj
+ $(SLO)$/swparrtf.obj
# --- Tagets -------------------------------------------------------
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
deleted file mode 100644
index db91ec79d2e7..000000000000
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ /dev/null
@@ -1,4356 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
-/*
- * Dieses File enthaelt alle Ausgabe-Funktionen des RTF-Writers;
- * fuer alle Nodes, Attribute, Formate und Chars.
- */
-#include <hintids.hxx>
-
-#include <com/sun/star/i18n/ScriptType.hdl>
-#include <vcl/cvtgrf.hxx>
-#include <svl/urihelper.hxx>
-#include <svl/stritem.hxx>
-#include <svtools/rtfkeywd.hxx>
-#include <svl/whiter.hxx>
-#include <svtools/rtfout.hxx>
-#include <svl/itemiter.hxx>
-#include <editeng/fontitem.hxx>
-#include <editeng/hyznitem.hxx>
-#include <editeng/tstpitem.hxx>
-#include <editeng/lspcitem.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/keepitem.hxx>
-#include <editeng/udlnitem.hxx>
-#include <editeng/shaditem.hxx>
-#include <editeng/cmapitem.hxx>
-#include <editeng/brshitem.hxx>
-#include <editeng/protitem.hxx>
-#include <editeng/opaqitem.hxx>
-#include <editeng/ulspitem.hxx>
-#include <editeng/prntitem.hxx>
-#include <editeng/colritem.hxx>
-#include <editeng/escpitem.hxx>
-#include <editeng/fhgtitem.hxx>
-#include <editeng/spltitem.hxx>
-#include <editeng/adjitem.hxx>
-#include <editeng/lrspitem.hxx>
-#include <editeng/boxitem.hxx>
-#include <editeng/crsditem.hxx>
-#include <editeng/cntritem.hxx>
-#include <editeng/postitem.hxx>
-#include <editeng/shdditem.hxx>
-#include <editeng/wghtitem.hxx>
-#include <editeng/wrlmitem.hxx>
-#include <editeng/emphitem.hxx>
-#include <editeng/twolinesitem.hxx>
-#include <editeng/charscaleitem.hxx>
-#include <editeng/charrotateitem.hxx>
-#include <editeng/charreliefitem.hxx>
-#include <svx/xoutbmp.hxx>
-#include <editeng/paravertalignitem.hxx>
-#include <editeng/hngpnctitem.hxx>
-#include <editeng/scriptspaceitem.hxx>
-#include <editeng/forbiddenruleitem.hxx>
-#include <editeng/frmdiritem.hxx>
-#include <editeng/charhiddenitem.hxx>
-#include <unotools/charclass.hxx>
-#include <reffld.hxx>
-#include <frmatr.hxx>
-#include <charatr.hxx>
-#include <fmtfsize.hxx>
-#include <fmtpdsc.hxx>
-#include <fmtfld.hxx>
-#include <fmtflcnt.hxx>
-#include <fmtftn.hxx>
-#include <fchrfmt.hxx>
-#include <fmtautofmt.hxx>
-#include <fmtcntnt.hxx>
-#include <fmthdft.hxx>
-#include <fmtclds.hxx>
-#include <txtftn.hxx>
-#include <fmtsrnd.hxx>
-#include <fmtanchr.hxx>
-#include <charfmt.hxx>
-#include <fmtinfmt.hxx>
-#include <txtinet.hxx>
-#include <doc.hxx>
-#include <docary.hxx>
-#include <ndtxt.hxx>
-#include <pam.hxx>
-#include <paratr.hxx>
-#include <fldbas.hxx> // fuer SwField ...
-#include <wrtrtf.hxx>
-#include <rtf.hxx> // fuer SwPictureType
-#include <ndgrf.hxx>
-#include <grfatr.hxx>
-#include <docufld.hxx>
-#include <flddat.hxx>
-#include <pagedesc.hxx> // fuer SwPageDesc ...
-#include <swtable.hxx> // fuer SwPageDesc ...
-#include <docsh.hxx>
-#include <swrect.hxx>
-#include <section.hxx>
-#include <wrtswtbl.hxx>
-#include <htmltbl.hxx>
-#include <fmtclbl.hxx>
-#include <breakit.hxx>
-#include <fmtruby.hxx>
-#include <txtatr.hxx>
-#include <fltini.hxx>
-#include <fmtrowsplt.hxx>
-
-/*
- * um nicht immer wieder nach einem Update festzustellen, das irgendwelche
- * Hint-Ids dazugekommen sind, wird hier definiert, die Groesse der Tabelle
- * definiert und mit der akt. verglichen. Bei unterschieden wird der
- * Compiler schon meckern.
- *
- * diese Section und die dazugeherigen Tabellen muessen in folgenden Files
- * gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
- */
-#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(CSET) && !defined(__MWERKS__) && !defined(WTC) && !defined(__MINGW32__) && !defined(OS2)
-
-#define ATTRFNTAB_SIZE 130
-#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
-#error Attribut-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-
-#ifdef FORMAT_TABELLE
-// da sie nicht benutzt wird!
-#define FORMATTAB_SIZE 7
-#if FORMATTAB_SIZE != RES_FMT_END - RES_FMT_BEGIN
-#error Format-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-#endif
-
-#define NODETAB_SIZE 3
-#if NODETAB_SIZE != RES_NODE_END - RES_NODE_BEGIN
-#error Node-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-
-#endif
-
-#ifdef WNT
-// ueber xoutbmp.hxx wird das winuser.h angezogen. Dort gibt es ein
-// define GetProp das mit unserem SvxEscapement kollidiert!
-#undef GetProp
-#endif
-
-
-using namespace com::sun::star;
-
-//-----------------------------------------------------------------------
-
-static Writer& OutRTF_SwFmtCol( Writer& rWrt, const SfxPoolItem& rHt );
-
-//-----------------------------------------------------------------------
-
-SvStream& OutComment( Writer& rWrt, const sal_Char* pStr )
-{
- return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr);
-}
-
-SvStream& OutComment( Writer& rWrt, const char* pStr, BOOL bSetFlag )
-{
- // setze Flag, damit bei der Ausgabe von Attributen zu erkennen,
- // ob ueberhaupt etwas ausgegeben wurde.
- ((SwRTFWriter&)rWrt).bOutFmtAttr = bSetFlag;
- return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr);
-}
-
-Writer& OutRTF_AsByteString( Writer& rWrt, const String& rStr, rtl_TextEncoding eEncoding)
-{
- ByteString sOutStr( rStr, eEncoding );
- rWrt.Strm() << sOutStr.GetBuffer();
- return rWrt;
-}
-
-void OutRTF_SfxItemSet( SwRTFWriter& rWrt, const SfxItemSet& rSet,
- BOOL bDeep )
-{
- bool bFrameDirOut=false;
- bool bAdjustOut=false;
- // erst die eigenen Attribute ausgeben
- SvPtrarr aAsian( 0, 5 ), aCmplx( 0, 5 ), aLatin( 0, 5 );
-
- const SfxItemPool& rPool = *rSet.GetPool();
- SfxWhichIter aIter( rSet );
- const SfxPoolItem* pItem;
- FnAttrOut pOut;
- USHORT nWhich = aIter.FirstWhich();
- while( nWhich )
- {
- if( SFX_ITEM_SET == rSet.GetItemState( nWhich, bDeep, &pItem ))
- {
- pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
- if( pOut &&
- ( *pItem != rPool.GetDefaultItem( nWhich )
- || ( rSet.GetParent() &&
- *pItem != rSet.GetParent()->Get( nWhich ) )
- || ( rWrt.GetAttrSet() &&
- *pItem != rWrt.GetAttrSet()->Get( nWhich ) )
- ) )
- ;
- else
- pOut = 0;
- }
- else if( !bDeep )
- pOut = 0;
- else if( 0 != ( pItem = rPool.GetPoolDefaultItem( nWhich )) )
- pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
- else
- pOut = 0;
-
- if (!pOut && bDeep)
- {
- switch( nWhich )
- {
- case RES_CHRATR_FONTSIZE:
- case RES_CHRATR_CJK_FONTSIZE:
- case RES_CHRATR_CTL_FONTSIZE:
- case RES_CHRATR_LANGUAGE:
- case RES_CHRATR_CJK_LANGUAGE:
- case RES_CHRATR_CTL_LANGUAGE:
- pItem = &rPool.GetDefaultItem( nWhich );
- pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
- break;
- default:
- break;
- }
- }
-
- if( pOut )
- {
- void* pVoidItem = (void*)pItem;
- switch( nWhich )
- {
- case RES_CHRATR_FONT:
- case RES_CHRATR_FONTSIZE:
- case RES_CHRATR_LANGUAGE:
- case RES_CHRATR_POSTURE:
- case RES_CHRATR_WEIGHT:
- aLatin.Insert( pVoidItem, aLatin.Count() );
- pOut = 0;
- break;
-
- case RES_CHRATR_CJK_FONT:
- case RES_CHRATR_CJK_FONTSIZE:
- case RES_CHRATR_CJK_LANGUAGE:
- case RES_CHRATR_CJK_POSTURE:
- case RES_CHRATR_CJK_WEIGHT:
- aAsian.Insert( pVoidItem, aAsian.Count() );
- pOut = 0;
- break;
-
- case RES_CHRATR_CTL_FONT:
- case RES_CHRATR_CTL_FONTSIZE:
- case RES_CHRATR_CTL_LANGUAGE:
- case RES_CHRATR_CTL_POSTURE:
- case RES_CHRATR_CTL_WEIGHT:
- aCmplx.Insert( pVoidItem, aCmplx.Count() );
- pOut = 0;
- break;
-
- case RES_FRAMEDIR:
- bFrameDirOut=true;
- break;
- case RES_PARATR_ADJUST:
- bAdjustOut=true;
- break;
- }
- }
-
- if (pOut)
- (*pOut)( rWrt, *pItem );
- nWhich = aIter.NextWhich();
- }
-
- //If rtlpar set and no following alignment. And alignment is not rtl then
- //output alignment
- if (bFrameDirOut && !bAdjustOut && !rWrt.pFlyFmt && !rWrt.bOutPageDesc)
- {
- pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_PARATR_ADJUST) - RES_CHRATR_BEGIN];
- if (pOut)
- (*pOut)(rWrt, rSet.Get(RES_PARATR_ADJUST));
- }
- if (rWrt.pFlyFmt && !rWrt.bOutPageDesc && !bFrameDirOut)
- {
- pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_FRAMEDIR) - RES_CHRATR_BEGIN];
- if (pOut)
- (*pOut)(rWrt, rSet.Get(RES_FRAMEDIR));
- }
-
- if (aAsian.Count() || aCmplx.Count() || aLatin.Count())
- {
- SvPtrarr* aArr[4];
- switch (rWrt.GetCurrScriptType())
- {
- case i18n::ScriptType::LATIN:
- aArr[ 0 ] = &aCmplx;
- aArr[ 1 ] = &aAsian;
- aArr[ 2 ] = &aLatin;
- aArr[ 3 ] = &aLatin;
- break;
-
- case i18n::ScriptType::ASIAN:
- aArr[ 0 ] = &aCmplx;
- aArr[ 1 ] = &aLatin;
- aArr[ 2 ] = &aLatin;
- aArr[ 3 ] = &aAsian;
- break;
-
- case i18n::ScriptType::COMPLEX:
- aArr[ 0 ] = &aLatin;
- aArr[ 1 ] = &aLatin;
- aArr[ 2 ] = &aAsian;
- aArr[ 3 ] = &aCmplx;
- break;
-
- default:
- return ;
- }
-
- //The final entry is the one that is actually in use
- //so it uses e.g. \b \i \fs, the others are not in
- //use and so are "associated". Both asian and western
- //are ltr runs, with asian being the dbch varient
- //and western being the loch/hich varient
- bool bOutLTOR = true;
- bool bLowLTOR = false;
- for( int nArrCnt = 0; nArrCnt < 4; ++nArrCnt )
- {
- SvPtrarr* pCurArr = aArr[ nArrCnt ];
- if (pCurArr->Count())
- {
- bool bInUse = (aArr[nArrCnt] == aArr[3]);
- rWrt.SetAssociatedFlag(!bInUse);
- if (pCurArr == &aLatin)
- {
- if (bOutLTOR)
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
- bOutLTOR = false;
- }
-
- if (bLowLTOR)
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH;
- else
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HICH;
- bLowLTOR = true;
- }
- }
- else if( pCurArr == &aAsian )
- {
- if( bOutLTOR )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
- bOutLTOR = false;
- }
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH;
- }
- else
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
-
- for (USHORT n = 0; n < pCurArr->Count(); ++n)
- {
- pItem = (const SfxPoolItem*)(*pCurArr)[ n ];
- pOut = aRTFAttrFnTab[ pItem->Which() - RES_CHRATR_BEGIN];
- (*pOut)( rWrt, *pItem );
- }
- }
- }
- }
-}
-
-// fuer die Formate muesste eine einzige Ausgabe-Funktion genuegen !
-/*
- * Formate wie folgt ausgeben:
- * - gebe alle Attribute vom Format aus
- */
-
-bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet)
-{
- bool bOutItemSet = true;
- rSet.SetParent(rFmt.GetAttrSet().GetParent());
-
- switch( rFmt.Which() )
- {
- case RES_CONDTXTFMTCOLL:
- case RES_TXTFMTCOLL:
- {
- USHORT nId = rWrt.GetId( (const SwTxtFmtColl&)rFmt );
- if (0 == nId )
- return false; // Default-TextStyle nicht ausgeben !!
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_S;
- rWrt.OutULong( nId );
- rWrt.bOutFmtAttr = TRUE;
-// BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel(); //#outline level,zhaojianwei
-// if( MAXLEVEL > nLvl )
-// {
- if(((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
- {
- int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel(); //<-end,zhaojianwei
- USHORT nNumId = rWrt.GetNumRuleId(
- *rWrt.pDoc->GetOutlineNumRule() );
- if( USHRT_MAX != nNumId )
- {
- BYTE nWWLvl = 8 >= nLvl ? static_cast<BYTE>(nLvl) : 8;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LS;
- rWrt.OutULong( nNumId );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ILVL; rWrt.OutULong( nWWLvl );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL; rWrt.OutULong( nWWLvl );
- if( nWWLvl != nLvl ) // RTF-kennt nur 9 Ebenen
- {
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_SOUTLVL );
- rWrt.OutULong( nLvl ) << '}';
- }
- }
-
- const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast<USHORT>(nLvl) );
- if( pNFmt->GetAbsLSpace() )
- {
- SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(),
- rFmt.GetAttrSet().GetRanges() );
- aSet.SetParent( &rFmt.GetAttrSet() );
- SvxLRSpaceItem aLR( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
-
- aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetAbsLSpace() );
- aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineOffset() );
-
- aSet.Put(aLR);
- rSet.Put(aSet);
- bOutItemSet = false;
- }
- }
- }
- break;
- case RES_CHRFMT:
- {
- USHORT nId = rWrt.GetId( (const SwCharFmt&)rFmt );
- if (0 == nId)
- return false; // Default-CharStyle nicht ausgeben !!
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_CS;
- rWrt.OutULong( nId );
- rWrt.bOutFmtAttr = TRUE;
- }
- break;
-
-// case RES_GRFFMTCOLL:
-// ?????
- }
-
- if (bOutItemSet)
- rSet.Put(rFmt.GetAttrSet());
-
- return true;
-}
-
-Writer& OutRTF_SwFmt(Writer& rWrt, const SwFmt& rFmt)
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-
- SfxItemSet aSet(*rFmt.GetAttrSet().GetPool(),
- rFmt.GetAttrSet().GetRanges() );
- if (SwFmtToSet(rRTFWrt, rFmt, aSet))
- OutRTF_SfxItemSet(rRTFWrt, aSet, TRUE);
-
- return rWrt;
-}
-
-void OutRTF_SwFlyFrmFmt( SwRTFWriter& rRTFWrt )
-{
- // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
- // muessen noch die Attribute dafuer ausgegeben werden.
- ASSERT( rRTFWrt.pFlyFmt, "wo ist das Fly-Format?" );
-
- if( rRTFWrt.bOutFmtAttr )
- {
- rRTFWrt.Strm() << ' ';
- rRTFWrt.bOutFmtAttr = false;
- }
- // gebe erstmal alle RTF-Spezifischen Attribute aus
- rRTFWrt.bRTFFlySyntax = TRUE;
- OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt );
-
- // dann gebe alle eigenen Attribute aus
- {
- // dazu erzeuge einen temp strstream, um festzustellen ob es
- // ueberhaupt eigene Attribute gibt !
- SvMemoryStream aTmpStrm;
- SvStream* pSaveStrm = &rRTFWrt.Strm();
- rRTFWrt.SetStream( &aTmpStrm );
-
- rRTFWrt.bRTFFlySyntax = false;
- OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt );
-
- rRTFWrt.SetStream( pSaveStrm ); // Stream-Pointer wieder zurueck
-
- if ( aTmpStrm.GetEndOfData() ) // gibt es SWG spezifische Attribute?
- {
- aTmpStrm.Seek( 0L );
- rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << aTmpStrm << '}';
- }
- }
-// rRTFWrt.pFlyFmt = 0; // wieder zuruecksetzen !!
-}
-
-/* Ausgabe der Nodes */
-
-/*
- * Ausgabe der Texte-Attribute:
- * Die Text-Attribute sind in einem VarArray nach ihren Start-Positionen
- * sortiert. Fuer den RTF-Writer ist aber auch das Ende von Bedeutung.
- * Darum die Idee, sobald im SwpHints-Array ein Attribut mit der Start-
- * Position gefunden wurde, in einem Sortierten-Array die Endposition
- * zu speichern. Sobald der Writer die Position erreicht hat, wird die
- * schliessende Klammer ausgegeben und die Position aus dem Sort.Array
- * geloescht.
- * 15.3.93: Es reicht leider nicht aus nur Start und End zuspeichern, denn
- * im SwpHints Array stehen sie nicht nach Ende sortiert, so dass
- * Attribute die falsche schliessende Klammer bekommen. (z.B
- * Bold von 0..3, dann folgt Underline von 0..4. Dann bekommt Underline
- * die schliessende Klammer von Bold !!)
- * Also muessen erst alle Attribute einer Position gesammelt, nach
- * Ende sortiert und dann erst ausgegeben werden.
- */
-
-SV_DECL_PTRARR( SfxPoolItems, SfxPoolItem*, 4, 4 )
-class RTFEndPosLst;
-
-class SttEndPos
-{
- // falls mehrere Attribute den gleichen Bereich umspannen, sammeln
- SfxPoolItems aArr;
- xub_StrLen nStart, nEnd;
-
- SttEndPos( const SttEndPos & rSEPos );
-
-public:
- SttEndPos( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd );
- ~SttEndPos();
-
- xub_StrLen GetStart() const { return nStart; }
- xub_StrLen GetEnd() const { return nEnd; }
-
- const SfxPoolItems& GetAttrs() const { return aArr; }
- void AddAttr( const SfxPoolItem& rAttr );
- BOOL HasScriptChange() const;
-};
-
-
-SV_DECL_PTRARR_DEL( _EndPosLst, SttEndPos*, 5, 5 )
-SV_IMPL_PTRARR( _EndPosLst, SttEndPos* )
-
-class RTFEndPosLst : private _EndPosLst
-{
- const SwTxtNode& rNode;
- SwRTFWriter& rWrt;
- RTFEndPosLst* pOldPosLst;
- xub_StrLen nCurPos;
- USHORT nCurScript;
-
-public:
- using _EndPosLst::Count;
- using _EndPosLst::operator[];
- using _EndPosLst::DeleteAndDestroy;
-
- RTFEndPosLst( SwRTFWriter& rWrt, const SwTxtNode& rNd, xub_StrLen nStart );
- ~RTFEndPosLst();
-
- USHORT GetCurScript() const { return nCurScript; }
- BOOL MatchScriptToId( USHORT nId ) const;
- int Insert( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd );
-
- void OutAttrs( xub_StrLen nStrPos );
- void EndAttrs( xub_StrLen nStrPos );
- void OutScriptChange( xub_StrLen nStrPos );
-
- const SfxPoolItem* HasItem( USHORT nWhich ) const;
- const SfxPoolItem& GetItem( USHORT nWhich ) const;
- void OutFontAttrs(const SfxPoolItem &rItem);
- void OutFontAttrs(USHORT nScript, bool bRTL);
-
- SfxItemPool& GetPool() {return *rNode.GetSwAttrSet().GetPool(); }
-};
-
-
-SttEndPos::SttEndPos( const SfxPoolItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEd )
- : nStart( nStt ), nEnd( nEd )
-{
- AddAttr( rAttr );
-}
-
-SttEndPos::~SttEndPos()
-{
- for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n )
- if( RES_FLTRATTR_BEGIN <= aArr[ n ]->Which() )
- delete aArr[ n ];
-}
-
-BOOL SttEndPos::HasScriptChange() const
-{
- for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n )
- if( RES_FLTR_SCRIPTTYPE == aArr[ n ]->Which() )
- return TRUE;
- return FALSE;
-}
-
-void SttEndPos::AddAttr( const SfxPoolItem& rAttr )
-{
- const SfxPoolItem* pI = &rAttr;
- aArr.Insert(pI, aArr.Count());
-}
-
-RTFEndPosLst::RTFEndPosLst(SwRTFWriter& rWriter, const SwTxtNode& rNd,
- xub_StrLen nStart)
- : rNode(rNd), rWrt(rWriter), nCurPos(STRING_NOTFOUND)
-{
- pOldPosLst = rWrt.pCurEndPosLst;
- rWrt.pCurEndPosLst = this;
-
- using namespace sw::util;
- CharRuns aCharRuns(GetPseudoCharRuns(rNd, nStart));
- cCharRunIter aEnd = aCharRuns.end();
- xub_StrLen nSttPos = nStart;
- for (cCharRunIter aI = aCharRuns.begin(); aI != aEnd; ++aI)
- {
- if (nSttPos != aI->mnEndPos)
- {
- SfxPoolItem* pChg = new SfxUInt32Item(RES_FLTR_SCRIPTTYPE,
- (sal_uInt32(aI->mnScript) << 16) | static_cast<sal_uInt32>(aI->mbRTL));
- Insert(*pChg, nSttPos, aI->mnEndPos);
- nSttPos = aI->mnEndPos;
- }
- }
-}
-
-RTFEndPosLst::~RTFEndPosLst()
-{
- rWrt.pCurEndPosLst = pOldPosLst;
-}
-
-int RTFEndPosLst::Insert( const SfxPoolItem& rAttr, xub_StrLen nStt,
- xub_StrLen nEnd )
-{
- if (rAttr.Which() == RES_TXTATR_INETFMT)
- return false;
-
- if( nStt == nEnd )
- return false;
-
- USHORT nPos;
- for( nPos = 0; nPos < Count(); ++nPos )
- {
- SttEndPos* pTmp = GetObject( nPos );
- if( pTmp->GetStart() == nStt && pTmp->GetEnd() == nEnd )
- {
- pTmp->AddAttr( rAttr );
- return false; // schon vorhanden
- }
- if( nEnd < pTmp->GetEnd() )
- {
- SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd );
- _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos );
- return TRUE;
- }
- }
-
- SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd );
- _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos );
- return TRUE;
-}
-
-void RTFEndPosLst::OutScriptChange( xub_StrLen nStrPos )
-{
- SttEndPos* pStt;
- for( USHORT n = 0, nEnd = Count(); n < nEnd; ++n )
- if( nStrPos == (pStt = GetObject( n ))->GetStart())
- {
- if( pStt->HasScriptChange() )
- OutAttrs( nStrPos );
- break;
- }
-}
-
-void RTFEndPosLst::OutAttrs( xub_StrLen nStrPos )
-{
- SttEndPos* pStt;
- nCurPos = nStrPos;
- for( USHORT n = Count(); n ; )
- if( nStrPos == (pStt = (*this)[ --n ])->GetStart() )
- {
- rWrt.Strm() << '{';
- for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i )
- {
- const SfxPoolItem* pItem = pStt->GetAttrs()[i];
- if( RES_FLTR_SCRIPTTYPE == pItem->Which() )
- OutFontAttrs(*pItem);
- else
- Out( aRTFAttrFnTab, *pItem, rWrt );
- }
- }
-
- nCurPos = STRING_NOTFOUND;
-}
-
-//Just a little decoding hack for the RES_FLTR_SCRIPTTYPE thing
-void RTFEndPosLst::OutFontAttrs(const SfxPoolItem &rItem)
-{
- sal_uInt32 nValue = ((const SfxUInt32Item&)rItem).GetValue();
- sal_uInt16 nScript = static_cast<sal_uInt16>(nValue >> 16);
- bool bBiDi = nValue & 0x1;
- OutFontAttrs(nScript, bBiDi);
-}
-
-void RTFEndPosLst::OutFontAttrs(USHORT nScript, bool bRTL)
-{
- // script change, write the correct attributes:
- // start first with the Fontname
-
- rWrt.bOutFmtAttr = TRUE;
- nCurScript = nScript;
- rWrt.SetCurrScriptType( nScript );
- rWrt.SetAssociatedFlag(false);
-
- // the font MUST be at the first position !!!
- static const USHORT aLatinIds[] =
- {
- RES_CHRATR_FONT,
- RES_CHRATR_FONTSIZE, RES_CHRATR_LANGUAGE,
- RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT,
- 0
- };
- static const USHORT aAsianIds[] =
- {
- RES_CHRATR_CJK_FONT,
- RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_LANGUAGE,
- RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT,
- 0
- };
- static const USHORT aCmplxIds[] =
- {
- RES_CHRATR_CTL_FONT,
- RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_LANGUAGE,
- RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
- 0
- };
-
- /*
- You would have thought that
- rWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here ,
- but looks like word needs to see the other directional token to be
- satisified that all is kosher, otherwise it seems in ver 2003 to go and
- semi-randomlyly stick strike through about the place. Perhaps
- strikethrough is some ms developers "something is wrong signal" debugging
- code that we're triggering ?
- */
- if (bRTL)
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
- rWrt.Strm() << ' ';
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
- }
- else
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
- rWrt.Strm() << ' ';
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
- }
-
- // size/weight/posture optional
- const USHORT* pIdArr = 0;
- ByteString sOut;
- switch (nScript)
- {
- default: //fall through
- ASSERT(pIdArr, "unknown script, strange");
- case i18n::ScriptType::LATIN:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH;
- pIdArr = aLatinIds;
- break;
- case i18n::ScriptType::ASIAN:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH;
- pIdArr = aAsianIds;
- break;
- case i18n::ScriptType::COMPLEX:
- pIdArr = aCmplxIds;
- break;
- }
-
- for (const USHORT* pId = pIdArr; *pId; ++pId)
- {
- if (FnAttrOut pOut = aRTFAttrFnTab[ *pId - RES_CHRATR_BEGIN])
- {
- const SfxPoolItem* pItem = HasItem(*pId);
- if (!pItem)
- pItem = &GetPool().GetDefaultItem(*pId);
- (*pOut)(rWrt, *pItem);
- }
- }
-}
-
-void RTFEndPosLst::EndAttrs( xub_StrLen nStrPos )
-{
- xub_StrLen nClipStart=STRING_MAXLEN;
- bool bClosed=false;
- SttEndPos* pSEPos;
- while( 0 != Count() && 0 != (pSEPos = GetObject( 0 )) &&
- ( STRING_MAXLEN == nStrPos || nStrPos == pSEPos->GetEnd() ))
- {
- const SfxPoolItems& rAttrs = pSEPos->GetAttrs();
- for( USHORT nAttr = rAttrs.Count(); nAttr; )
- {
- switch( rAttrs[ --nAttr ]->Which() )
- {
- case RES_TXTATR_CJK_RUBY:
- rWrt.Strm() << ")}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}";
- break;
- }
- }
-
- rWrt.Strm() << '}'; // end of all attributes from this position
- if (pSEPos->GetStart() < nClipStart)
- nClipStart = pSEPos->GetStart();
- bClosed=true;
- DeleteAndDestroy( 0, 1 );
- }
-
- if (bClosed)
- {
- //If there are open ranges whose start is before this point, and whose
- //start is after the cliping start then they have been closed whether
- //we wanted this or not. So accept that fact and then restart then
- //again
- USHORT nSize = Count();
- while (nSize > 0)
- {
- pSEPos = GetObject(--nSize);
- if ( pSEPos->GetStart() < nStrPos &&
- pSEPos->GetStart() >= nClipStart)
- {
- rWrt.Strm() << '}';
- }
- }
-
- nSize = Count();
- USHORT n = 0;
- while (n < nSize)
- {
- SttEndPos* pStt = (*this)[n++];
- if (pStt->GetStart() < nStrPos && pStt->GetStart() >= nClipStart)
- {
- rWrt.Strm() << '{';
- for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i )
- {
- const SfxPoolItem* pItem = pStt->GetAttrs()[i];
- if( RES_FLTR_SCRIPTTYPE == pItem->Which() )
- OutFontAttrs(*pItem);
- else
- Out( aRTFAttrFnTab, *pItem, rWrt );
- }
- }
- }
- }
-}
-
-BOOL RTFEndPosLst::MatchScriptToId( USHORT nWhich ) const
-{
- BOOL bRet = false;
- switch( nWhich )
- {
- case RES_CHRATR_FONT:
- case RES_CHRATR_FONTSIZE:
- case RES_CHRATR_LANGUAGE:
- case RES_CHRATR_POSTURE:
- case RES_CHRATR_WEIGHT:
- bRet = nCurScript == i18n::ScriptType::LATIN;
- break;
- case RES_CHRATR_CJK_FONT:
- case RES_CHRATR_CJK_FONTSIZE:
- case RES_CHRATR_CJK_LANGUAGE:
- case RES_CHRATR_CJK_POSTURE:
- case RES_CHRATR_CJK_WEIGHT:
- bRet = nCurScript == i18n::ScriptType::ASIAN;
- break;
- case RES_CHRATR_CTL_FONT:
- case RES_CHRATR_CTL_FONTSIZE:
- case RES_CHRATR_CTL_LANGUAGE:
- case RES_CHRATR_CTL_POSTURE:
- case RES_CHRATR_CTL_WEIGHT:
- bRet = nCurScript == i18n::ScriptType::COMPLEX;
- break;
- }
- return bRet;
-}
-
-const SfxPoolItem& RTFEndPosLst::GetItem( USHORT nWhich ) const
-{
- const SfxPoolItem* pItem = HasItem( nWhich );
- if( !pItem )
- pItem = &rNode.GetSwAttrSet().GetPool()->GetDefaultItem( nWhich );
- return *pItem;
-}
-
-const SfxPoolItem* RTFEndPosLst::HasItem( USHORT nWhich ) const
-{
- const SfxPoolItem* pItem;
- if( RES_TXTATR_END > nWhich )
- {
- // it's a character/text attribute so look into the item array
- for( USHORT n = Count(); n; )
- {
- SttEndPos* pTmp = GetObject( --n );
- for( USHORT i = pTmp->GetAttrs().Count(); i; )
- {
- pItem = pTmp->GetAttrs()[ --i ];
- if( pItem->Which() == nWhich )
- return pItem;
-
- // look into the charfmt?
- if( RES_TXTATR_CHARFMT == pItem->Which() &&
- ((SwFmtCharFmt*) pItem)->GetCharFmt() &&
- SFX_ITEM_SET == ((SwFmtCharFmt*) pItem)->GetCharFmt()->
- GetItemState( nWhich, TRUE, &pItem ))
- return pItem;
- }
- }
- }
-
- if( SFX_ITEM_SET != rNode.GetSwAttrSet().GetItemState(
- nWhich, TRUE, &pItem ))
- pItem = 0;
- return pItem;
-}
-
-const SfxPoolItem& SwRTFWriter::GetItem( USHORT nWhich ) const
-{
- if( pCurEndPosLst )
- return pCurEndPosLst->GetItem( nWhich );
- if( pAttrSet )
- return pAttrSet->Get( nWhich );
-
- return pDoc->GetAttrPool().GetDefaultItem( nWhich );
-}
-
-static void OutSvxFrmDir(SwRTFWriter& rRTFWrt, const SfxPoolItem& rHt )
-{
- // write it only for pasgedesc's - not for frames
- SvxFrameDirectionItem aItem((const SvxFrameDirectionItem&)rHt);
- USHORT nVal = 0;
- const sal_Char* pStr = 0;
- bool bRTL = false;
-
- if (rRTFWrt.pFlyFmt)
- aItem.SetValue(rRTFWrt.TrueFrameDirection(*rRTFWrt.pFlyFmt));
-
- switch (aItem.GetValue())
- {
- case FRMDIR_ENVIRONMENT:
- ASSERT(0, "Not expected to see FRMDIR_ENVIRONMENT here");
- break;
- case FRMDIR_VERT_TOP_RIGHT:
- nVal = 1;
- pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRLV;
- break;
- case FRMDIR_HORI_RIGHT_TOP:
- bRTL = true;
-// nVal = 3;
-// A val of three isn't working as expected in word :-( so leave it
-// as normal ltr 0 textflow with rtl sect property, neither does
-// the frame textflow
-// pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRL;
- break;
- case FRMDIR_VERT_TOP_LEFT:
- nVal = 4;
- pStr = OOO_STRING_SVTOOLS_RTF_FRMTXLRTBV;
- break;
- }
-
- if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax && pStr )
- {
- rRTFWrt.Strm() << pStr;
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- else if( rRTFWrt.bOutPageDesc)
- {
- if (nVal)
- {
- rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STEXTFLOW;
- rRTFWrt.OutULong( nVal );
- }
- if (bRTL)
- rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT;
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- else if (!rRTFWrt.pFlyFmt && !rRTFWrt.bOutPageDesc)
- {
- rRTFWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLPAR : OOO_STRING_SVTOOLS_RTF_LTRPAR);
- rRTFWrt.bOutFmtAttr = TRUE;
- }
-}
-
-void OutRTF_SwRTL(SwRTFWriter& rWrt, const SwTxtNode *pNd)
-{
- if (!pNd)
- return;
- SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
- if (const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*)
- pNd->GetSwAttrSet().GetItem(RES_FRAMEDIR))
- {
- eDir = static_cast<SvxFrameDirection>(pItem->GetValue());
- }
- if (eDir == FRMDIR_ENVIRONMENT)
- {
- SwPosition aPos(*pNd);
- eDir =
- static_cast<SvxFrameDirection>(rWrt.pDoc->GetTextDirection(aPos));
- }
- OutSvxFrmDir(rWrt, SvxFrameDirectionItem(eDir, RES_FRAMEDIR));
-}
-
-static Writer& OutRTF_SwTxtINetFmt( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtINetFmt& rURL = (const SwFmtINetFmt&)rHt;
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( rURL.GetValue().Len() )
- {
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE
- << OOO_STRING_SVTOOLS_RTF_FLDINST << " HYPERLINK ";
-
- String sURL( rURL.GetValue() );
- if( INET_MARK_TOKEN != sURL.GetChar(0) )
- {
- INetURLObject aTmp( URIHelper::simpleNormalizedMakeRelative(rWrt.GetBaseURL(),
- sURL));
-
-
- sURL = aTmp.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS);
-/* if( INET_PROT_FILE == aTmp.GetProtocol() )
- {
- // WW97 wollen keine FILE-URL haben, sondern einen normalen
- // Dateinamen. Aber ab WW2000 kennen sie FileURLs.
- sURL = aTmp.GetFull();
- }
-*/ rWrt.Strm() << '\"';
- RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding,
- rRTFWrt.bWriteHelpFmt ) << "\" ";
- sURL = aTmp.GetMark();
- }
-
- if( sURL.Len() )
- {
- rWrt.Strm() << "\\\\l \"";
- sURL.Erase( 0, 1 );
- RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding,
- rRTFWrt.bWriteHelpFmt ) << "\" ";
- }
-
- if( rURL.GetTargetFrame().Len() )
- {
- rWrt.Strm() << "\\\\t \"";
- RTFOutFuncs::Out_String( rWrt.Strm(), rURL.GetTargetFrame(),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) << "\" ";
- }
-
- rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
- rRTFWrt.bOutFmtAttr = false;
-
- // und dann noch die Attributierung ausgeben
- const SwCharFmt* pFmt;
- const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
- if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() ))
- OutRTF_SwFmt( rWrt, *pFmt );
- }
- return rWrt;
-}
-
-void HandleHyperlinks(Writer& rWrt, const SwpHints* pTxtAttrs, xub_StrLen nPos )
-{
- USHORT nCount = pTxtAttrs ? pTxtAttrs->Count() : 0;
- for(USHORT i = 0; i < nCount; ++i )
- {
- const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- const SfxPoolItem &rItem = pHt->GetAttr();
- if (rItem.Which() == RES_TXTATR_INETFMT)
- {
- const xub_StrLen* pEnd;
- if (nPos == *pHt->GetStart())
- OutRTF_SwTxtINetFmt(rWrt, rItem);
- if (0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd)
- {
- // Hyperlinks werden als Felder geschrieben, aber der
- // "FieldResult" // steht als Text im TextNode. Also muss bei
- // diesen Attributen am // Ende 2 Klammern stehen!
- rWrt.Strm() << "}}";
- }
- }
- }
-}
-
-static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
-{
- SwTxtNode * pNd = &((SwTxtNode&)rNode);
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
- xub_StrLen nStrPos = rRTFWrt.pCurPam->GetPoint()->nContent.GetIndex();
- RTFEndPosLst aEndPosLst( rRTFWrt, *pNd, nStrPos );
- USHORT nAttrPos = 0;
-
- const String& rStr = pNd->GetTxt();
- xub_StrLen nEnde = rStr.Len();
- if( rRTFWrt.pCurPam->GetPoint()->nNode == rRTFWrt.pCurPam->GetMark()->nNode )
- nEnde = Min( nEnde, rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() );
-
- int bNewFmts = rRTFWrt.GetAttrSet() != &pNd->GetSwAttrSet();
- if( bNewFmts )
- {
- // harte Attributierung am Node und am Vorgaenger ?
- const SfxItemSet* pNdSet = pNd->GetpSwAttrSet();
- if( pNdSet && rRTFWrt.GetAttrSet() && rRTFWrt.bAutoAttrSet &&
- pNdSet->GetParent() == rRTFWrt.GetAttrSet()->GetParent() &&
- pNdSet->Count() == rRTFWrt.GetAttrSet()->Count() )
- {
- // die beiden Parents sind gleich, dann teste doch mal die
- // Attribute im Set
-
- int bEqual = TRUE;
- if( pNdSet->Count() )
- {
- SfxItemIter aIter( *rRTFWrt.GetAttrSet() );
- const SfxPoolItem *pItem, *pCurr = aIter.GetCurItem();
- while( TRUE )
- {
- if( SFX_ITEM_SET != pNdSet->GetItemState( pCurr->Which(),
- false, &pItem ) || *pItem != *pCurr )
- {
- bEqual = false;
- break;
- }
-
- if( aIter.IsAtEnd() )
- break;
- pCurr = aIter.NextItem();
- }
- }
- if (bEqual)
- bNewFmts = false;
- }
- rRTFWrt.SetAttrSet( &pNd->GetSwAttrSet() );
- rRTFWrt.bAutoAttrSet = 0 != pNdSet;
- }
-
- // Flag zuruecksetzen, damit nach der Ausgabe der Collection
- // getestet werden kann, ob noch ein Blank auszugeben ist
- rRTFWrt.bOutFmtAttr = false;
-
- // in der Ausgabe eines Flys? Dann vorm ausgeben der AbsatzAttribute
- // den Format-Pointer auf 0 setzen!
- const SwFlyFrmFmt* pSaveFmt = rRTFWrt.pFlyFmt;
-
- SfxItemSet aMergedSet(rRTFWrt.pDoc->GetAttrPool(), POOLATTR_BEGIN,
- POOLATTR_END-1);
- bool bDeep = false;
-
- if( rRTFWrt.bWriteAll )
- {
- rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' '; // alle Attribute zuruecksetzen
- if( rRTFWrt.bOutTable )
- rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_INTBL;
-
- // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
- // muessen noch die Attribute dafuer ausgegeben werden.
- if( pSaveFmt )
- {
- OutRTF_SwFlyFrmFmt( rRTFWrt );
- rRTFWrt.pFlyFmt = 0;
- }
-
- rRTFWrt.OutListNum( *pNd );
- OutRTF_SwRTL(rRTFWrt, pNd);
- SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet);
- bDeep = true;
- }
- else if( !rRTFWrt.bWriteAll && rRTFWrt.bFirstLine )
- {
- OutRTF_SwRTL(rRTFWrt, pNd);
- SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet);
- bDeep = true;
- }
-
- // gibt es harte Attributierung ?
- if( bNewFmts && pNd->HasSwAttrSet())
- {
- rRTFWrt.pFlyFmt = 0;
-
- const SfxItemSet& rNdSet = pNd->GetSwAttrSet();
-
- const SwNumRule* pRule = pNd->GetNumRule();
- // --> OD 2008-03-19 #refactorlists#
- if ( pRule && pNd->IsInList() )
- // <--
- {
- // --> OD 2008-03-18 #refactorlists#
- ASSERT( pNd->GetActualListLevel() >= 0 && pNd->GetActualListLevel() < MAXLEVEL,
- "<OutRTF_SwTxtNode(..)> - text node does not have valid list level. Serious defect -> please inform OD" );
- // <--
- BYTE nLvl = static_cast< BYTE >(pNd->GetActualListLevel());
- const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl );
- if( !pFmt )
- pFmt = &pRule->Get( nLvl );
-
- SfxItemSet aSet( rNdSet );
- SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
-
- aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
- if( MAXLEVEL > pNd->GetActualListLevel() )
- aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
- else
- aSet.ClearItem( RES_PARATR_NUMRULE );
- aSet.Put( aLR );
- aMergedSet.Put(aSet);
- }
- else
- aMergedSet.Put(rNdSet);
- }
-
- SwTxtNode *txtNode=rNode.GetTxtNode();
- if (txtNode!=NULL && !txtNode->IsNumbered())
- {
- aMergedSet.ClearItem(RES_PARATR_NUMRULE);
- }
- OutRTF_SfxItemSet(rRTFWrt, aMergedSet, bDeep);
-
- rRTFWrt.pFlyFmt = pSaveFmt;
-
- rRTFWrt.bTxtAttr = true;
- // erstmal den Start berichtigen. D.h. wird nur ein Teil vom Satz
- // ausgegeben, so muessen auch da die Attribute stimmen!!
- const SwTxtAttr * pHt = 0;
- USHORT nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0;
- if( nCntAttr && nStrPos > *( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() )
- {
- // Ok, es gibt vorher Attribute, die ausgegeben werden muessen
- do {
- nAttrPos++;
- if( RES_TXTATR_FIELD == pHt->Which() ) // Felder nicht
- continue; // ausgeben
-
- if( pHt->GetEnd() )
- {
- xub_StrLen nHtEnd = *pHt->GetEnd(), nHtStt = *pHt->GetStart();
- if( !rRTFWrt.bWriteAll && nHtEnd <= nStrPos )
- continue;
-
- // leere Hints am Anfang nicht beachten, oder ??
- if( nHtEnd == nHtStt )
- continue;
-
- // Attribut in die Liste aufnehemen
- if( !rRTFWrt.bWriteAll )
- {
- if( nHtStt < nStrPos ) nHtStt = nStrPos;
- if( nHtEnd >= nEnde ) nHtEnd = nEnde;
- }
- aEndPosLst.Insert( pHt->GetAttr(), nHtStt, nHtEnd );
- continue;
- // aber nicht ausgeben, das erfolgt spaeter !!
- }
- Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt );
-
- } while( nAttrPos < nCntAttr && nStrPos >
- *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
-
- // dann gebe mal alle gesammelten Attribute von der String-Pos aus
- aEndPosLst.OutAttrs( nStrPos );
- }
-
- if( rRTFWrt.bOutFmtAttr &&
- ( nAttrPos < nCntAttr ? *pHt->GetStart() != nStrPos : TRUE ))
- rRTFWrt.Strm() << ' ';
-
- // das Flag gibt an, ob das SwTxtFld am Ende vom Absatz steht. Denn
- // dann ist vor dem Absatzumbruch die schliessende Klammer auszugeben
- xub_StrLen nChrCnt = 0;
- for( ; nStrPos <= nEnde; nStrPos++ )
- {
- rRTFWrt.bOutFmtAttr = false;
- if( nStrPos != nEnde && aEndPosLst.Count() )
- aEndPosLst.EndAttrs( nStrPos );
-
- // versuche nach ungefaehr 255 Zeichen eine neue Zeile zu beginnen
- if( nChrCnt != ( nStrPos & 0xff00 ))
- {
- rWrt.Strm() << SwRTFWriter::sNewLine;
- nChrCnt = nStrPos & 0xff00;
- }
-
- if( nAttrPos < nCntAttr && *pHt->GetStart() == nStrPos
- && nStrPos != nEnde )
- {
- do {
- BOOL bEmpty = false;
- if( pHt->GetEnd() )
- {
- if (false == (bEmpty = *pHt->GetEnd() == nStrPos))
- {
- aEndPosLst.Insert( pHt->GetAttr(), nStrPos,
- *pHt->GetEnd() );
- continue;
- }
- rRTFWrt.Strm() << '{';
- }
- Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt );
- if( bEmpty )
- {
- rRTFWrt.Strm() << '}';
- rRTFWrt.bOutFmtAttr = false;
- }
- } while( ++nAttrPos < nCntAttr && nStrPos ==
- *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
-
- // dann gebe mal alle gesammelten Attribute von der String-Pos aus
- aEndPosLst.OutAttrs( nStrPos );
-
- }
- else
- aEndPosLst.OutScriptChange( nStrPos );
-
- HandleHyperlinks(rWrt, pNd->GetpSwpHints(), nStrPos);
-
- if( rRTFWrt.bOutFmtAttr )
- rRTFWrt.Strm() << ' ';
-
- rRTFWrt.OutBookmarks( nStrPos );
-
- rRTFWrt.OutRedline( nStrPos);
-
- if (nStrPos != nEnde)
- {
- RTFOutFuncs::Out_String(rWrt.Strm(), String(rStr.GetChar(nStrPos)),
- rRTFWrt.eCurrentEncoding, rRTFWrt.bWriteHelpFmt);
- }
- }
-
- rRTFWrt.bTxtAttr = false;
-
- // noch eine schliesende Klammer da ??
- if( aEndPosLst.Count() )
- aEndPosLst.EndAttrs( USHRT_MAX );
-
- // wenn bis zum Ende vom Node, dann auch das AbsatzEnde ausgeben
- if( rRTFWrt.pCurPam->GetMark()->nNode.GetIndex() ==
- rRTFWrt.pCurPam->GetPoint()->nNode.GetIndex() )
- {
- if( pNd->Len() != rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() )
- return rWrt;
-
- if( rRTFWrt.bOutTable )
- {
- rRTFWrt.Strm() << SwRTFWriter::sNewLine;
- return rWrt;
- }
- }
-
- rRTFWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' ';
- return rRTFWrt;
-}
-
-bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize)
-{
- if (pGraphicAry && (nSize > 0x2c ))
- {
- // check the magic number
- if (
- (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) &&
- (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46)
- )
- {
- //emf detected
- return true;
- }
- }
- return false;
-}
-
-bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize)
-{
- if (rpGraphicAry && (rSize > 0x22))
- {
- if (
- (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) &&
- (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a)
- )
- { // we have to get rid of the metafileheader
- rpGraphicAry += 22;
- rSize -= 22;
- return true;
- }
- }
- return false;
-}
-
-void ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped,
- const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry,
- unsigned long nSize, SwRTFWriter &rWrt)
-{
- bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE)) ? true : false;
- if (pBLIPType && nSize && pGraphicAry)
- {
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_PICT;
-
- long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight());
- long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom());
- /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused
- crashes. */
- if( !nXCroppedSize )
- nXCroppedSize = 100;
- if( !nYCroppedSize )
- nYCroppedSize = 100;
-
- //Given the original size and taking cropping into account
- //first, how much has the original been scaled to get the
- //final rendered size
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEX;
- rWrt.OutLong((100 * rRendered.Width()) / nXCroppedSize);
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEY;
- rWrt.OutLong((100 * rRendered.Height()) / nYCroppedSize);
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPL;
- rWrt.OutLong(rCr.GetLeft());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPR;
- rWrt.OutLong(rCr.GetRight());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPT;
- rWrt.OutLong(rCr.GetTop());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPB;
- rWrt.OutLong(rCr.GetBottom());
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICW;
- rWrt.OutLong(rMapped.Width());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICH;
- rWrt.OutLong(rMapped.Height());
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICWGOAL;
- rWrt.OutLong(rOrig.Width());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICHGOAL;
- rWrt.OutLong(rOrig.Height());
-
- rWrt.Strm() << pBLIPType;
- if (bIsWMF)
- {
- rWrt.OutLong(8);
- StripMetafileHeader(pGraphicAry, nSize);
- }
- rWrt.Strm() << SwRTFWriter::sNewLine;
-
- sal_uInt32 nBreak = 0;
- for (sal_uInt32 nI = 0; nI < nSize; ++nI)
- {
- ByteString sNo = ByteString::CreateFromInt32(pGraphicAry[nI], 16);
- if (sNo.Len() < 2)
- rWrt.Strm() << '0';
- rWrt.Strm() << sNo.GetBuffer();
- if (++nBreak == 64)
- {
- rWrt.Strm() << SwRTFWriter::sNewLine;
- nBreak = 0;
- }
- }
-
- rWrt.Strm() << '}';
- }
-}
-
-static Writer& OutRTF_SwGrfNode(Writer& rWrt, SwCntntNode & rNode)
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
- SwGrfNode &rNd = (SwGrfNode&)rNode;
-
- // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
- // muessen noch die Attribute dafuer ausgegeben werden.
- if (rRTFWrt.pFlyFmt && !ExportAsInline(*rRTFWrt.pFlyFmt))
- OutRTF_SwFlyFrmFmt(rRTFWrt); //"classic" positioning and size export
-
-#if 1
- SvMemoryStream aStream;
- const sal_uInt8* pGraphicAry = 0;
- sal_uInt32 nSize = 0;
-
- Graphic aGraphic(rNd.GetGrf());
-
- // If there is no graphic there is not much point in parsing it
- if(aGraphic.GetType()==GRAPHIC_NONE)
- return rRTFWrt;
-
- GfxLink aGraphicLink;
- const sal_Char* pBLIPType = 0;
- if (aGraphic.IsLink())
- {
- aGraphicLink = aGraphic.GetLink();
- nSize = aGraphicLink.GetDataSize();
- pGraphicAry = aGraphicLink.GetData();
- switch (aGraphicLink.GetType())
- {
- case GFX_LINK_TYPE_NATIVE_JPG:
- pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP;
- break;
- case GFX_LINK_TYPE_NATIVE_PNG:
- pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
- case GFX_LINK_TYPE_NATIVE_WMF:
- pBLIPType =
- IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
- break;
- default:
- break;
- }
- }
-
- GraphicType eGraphicType = aGraphic.GetType();
- if (!pGraphicAry)
- {
- if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic,
- (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF))
- {
- pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ?
- OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
- aStream.Seek(STREAM_SEEK_TO_END);
- nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
- }
- }
-
- Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize());
-
- const SwCropGrf &rCr = (const SwCropGrf &)rNd.GetAttr(RES_GRFATR_CROPGRF);
-
- //Get original size in twips
- Size aSize(sw::util::GetSwappedInSize(rNd));
- Size aRendered(aSize);
- if (rRTFWrt.pFlyFmt)
- {
- const SwFmtFrmSize& rS = rRTFWrt.pFlyFmt->GetFrmSize();
- aRendered.Width() = rS.GetWidth();
- aRendered.Height() = rS.GetHeight();
- }
-
- /*
- If the graphic is not of type WMF then we will have to store two
- graphics, one in the native format wrapped in shppict, and the other in
- the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its
- a wmf already then we don't need any such wrapping
- */
- bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE)) ? true : false;
- if (!bIsWMF)
- OutComment(rRTFWrt, OOO_STRING_SVTOOLS_RTF_SHPPICT);
-
- if (pBLIPType)
- ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, rRTFWrt);
- else
- {
- aStream.Seek(0);
- GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
- pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
- aStream.Seek(STREAM_SEEK_TO_END);
- nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
-
- ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize,
- rRTFWrt);
- }
-
- if (!bIsWMF)
- {
- rRTFWrt.Strm() << '}' << '{' << OOO_STRING_SVTOOLS_RTF_NONSHPPICT;
-
- aStream.Seek(0);
- GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
- pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
- aStream.Seek(STREAM_SEEK_TO_END);
- nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
-
- ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize,
- rRTFWrt);
-
- rRTFWrt.Strm() << '}';
- }
-
-
- rRTFWrt.Strm() << SwRTFWriter::sNewLine;
-#else
- rRTFWrt.Strm() << "{{";
-
- // damit die eigenen Grafik-Attribute nach der PICT / import Anweisung
- // stehen, muessen die am Anfang ausgegeben werden.
- rRTFWrt.bOutFmtAttr = false;
- OutRTF_SwFmt( rRTFWrt, *pNd->GetFmtColl() );
-
- if( rRTFWrt.bOutFmtAttr ) // wurde ueberhaupt ein Attrribut
- rRTFWrt.Strm() << "}{"; // ausgegeben ??
-
- String aGrfNm;
- const SwMirrorGrf& rMirror = pNd->GetSwAttrSet().GetMirrorGrf();
- if( !pNd->IsLinkedFile() || RES_MIRROR_GRAPH_DONT != rMirror.GetValue() )
- {
- USHORT nErr = 1;
- // Grafik als File-Referenz speichern (als JPEG-Grafik speichern)
- // but only if we save into a file and have a URL
- if( rWrt.GetOrigFileName() )
- {
- aGrfNm = *rWrt.GetOrigFileName();
- pNd->SwapIn( TRUE );
- ULONG nFlags = XOUTBMP_USE_NATIVE_IF_POSSIBLE;
- switch( rMirror.GetValue() )
- {
- case RES_MIRROR_GRAPH_VERT: nFlags = XOUTBMP_MIRROR_HORZ; break;
- case RES_MIRROR_GRAPH_HOR: nFlags = XOUTBMP_MIRROR_VERT; break;
- case RES_MIRROR_GRAPH_BOTH:
- nFlags = XOUTBMP_MIRROR_VERT | XOUTBMP_MIRROR_HORZ;
- break;
- }
-
- Size aMM100Size;
- Size* pMM100Size = 0;
- if( rRTFWrt.pFlyFmt )
- {
- const SwFmtFrmSize& rSize = rRTFWrt.pFlyFmt->GetFrmSize();
- aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(),
- MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ));
- pMM100Size = &aMM100Size;
- }
-
- nErr = XOutBitmap::WriteGraphic( pNd->GetGrf(), aGrfNm,
- String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "JPG" )),
- nFlags, pMM100Size );
- }
- if( nErr ) // fehlerhaft, da ist nichts auszugeben
- {
- rRTFWrt.Strm() << "}}";
- return rWrt;
- }
- }
- else
- pNd->GetFileFilterNms( &aGrfNm, 0 );
-
- // MIB->JP: Warum erst AbsToRel und dann das URL-Objekt? So
- // kommt bei relativierbaren URLs als Protokoll "unknown" raus.
- // Ist das Absicht?
- aGrfNm = INetURLObject::AbsToRel( aGrfNm, INetURLObject::WAS_ENCODED,
- INetURLObject::DECODE_UNAMBIGUOUS);
- INetURLObject aUrl( aGrfNm );
- if( aUrl.GetProtocol() == INET_PROT_FILE )
- aGrfNm = aUrl.PathToFileName();
-
- // Bitmap als File-Referenz speichern
- rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FIELD << OOO_STRING_SVTOOLS_RTF_FLDPRIV;
- OutComment( rRTFWrt, OOO_STRING_SVTOOLS_RTF_FLDINST ) << "{\\\\import ";
- RTFOutFuncs::Out_String( rWrt.Strm(), aGrfNm, rRTFWrt.eDefaultEncoding,
- rRTFWrt.bWriteHelpFmt );
- rRTFWrt.Strm() << "}}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}";
- rRTFWrt.Strm() << '}' << SwRTFWriter::sNewLine;
-#endif
- return rRTFWrt;
-}
-
-static Writer& OutRTF_SwOLENode( Writer& rWrt, SwCntntNode & /*rNode*/ )
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-
- // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
- // muessen noch die Attribute dafuer ausgegeben werden.
- if( rRTFWrt.pFlyFmt )
- OutRTF_SwFlyFrmFmt( rRTFWrt );
-
- rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR;
- return rWrt;
-}
-
-static void OutTBLBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine,
- const sal_Char* pStr)
-{
- ByteString sLineStr;
- if( pLine->GetInWidth() )
- {
- // doppelte Linie
- sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRDB;
- switch( pLine->GetInWidth() )
- {
- case DEF_LINE_WIDTH_0:
- ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "15";
- break;
- case DEF_LINE_WIDTH_1:
- ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "30";
- break;
- case DEF_LINE_WIDTH_2:
- case DEF_LINE_WIDTH_3:
- ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "45";
- break;
- }
- }
- else
- {
- // einfache Linie
- if( DEF_LINE_WIDTH_1 >= pLine->GetOutWidth() )
- (( sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRS ) += OOO_STRING_SVTOOLS_RTF_BRDRW ) +=
- ByteString::CreateFromInt32( pLine->GetOutWidth() );
- else
- (( sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRTH ) += OOO_STRING_SVTOOLS_RTF_BRDRW ) +=
- ByteString::CreateFromInt32( pLine->GetOutWidth() / 2 );
- }
-
- rWrt.Strm() << pStr << sLineStr.GetBuffer() << OOO_STRING_SVTOOLS_RTF_BRDRCF;
- rWrt.OutULong( rWrt.GetId( pLine->GetColor() ) );
-}
-
-static void OutBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine,
- const sal_Char* pStr, USHORT nDist)
-{
- OutTBLBorderLine(rWrt, pLine, pStr);
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_BRSP;
- rWrt.OutULong( nDist );
-}
-
-static void OutSwTblBorder(SwRTFWriter& rWrt, const SvxBoxItem& rBox,
- const SvxBoxItem *pDefault)
-{
- static const USHORT aBorders[] =
- {
- BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
- };
-#ifdef __MINGW32__
- static const char* aBorderNames[] __attribute__((section(".data"))) =
-#else
- static const char* aBorderNames[] =
-#endif
- {
- OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR
- };
- //Yes left and top are swapped with eachother for cell padding! Because
- //that's what the thunderingly annoying rtf export/import word xp does.
-#ifdef __MINGW32__
- static const char* aCellPadNames[] __attribute__((section(".data"))) =
-#else
- static const char* aCellPadNames[] =
-#endif
- {
- OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR
- };
-#ifdef __MINGW32__
- static const char* aCellPadUnits[] __attribute__((section(".data"))) =
-#else
- static const char* aCellPadUnits[] =
-#endif
- {
- OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR
- };
- for (int i = 0; i < 4; ++i)
- {
- if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i]))
- OutTBLBorderLine(rWrt, pLn, aBorderNames[i]);
- if (!pDefault || pDefault->GetDistance(aBorders[i]) !=
- rBox.GetDistance(aBorders[i]))
- {
- rWrt.Strm() << aCellPadUnits[i];
- rWrt.OutULong(3);
- rWrt.Strm() << aCellPadNames[i];
- rWrt.OutULong(rBox.GetDistance(aBorders[i]));
- }
- }
-}
-
-static void OutSwTblBackground( SwRTFWriter& rWrt, const SvxBrushItem& rBack )
-{
- if( !rBack.GetColor().GetTransparency() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLCBPAT;
- rWrt.OutULong( rWrt.GetId( rBack.GetColor() ) );
- }
-}
-
-
-Writer& OutRTF_SwTblNode(Writer& rWrt, const SwTableNode & rNode)
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
- const SwTable& rTbl = rNode.GetTable();
- SwTwips nPageSize = 0, nTblOffset = 0;
- const bool bNewTableModel = rTbl.IsNewModel();
-
-/*
-//!!!!!!!!!!!!! for clipboard create any view if the table is complex !!!
- if( rTbl.IsTblComplex() )
- {
- // then we have to create any layout
- SFX_APP()->CreateViewFrame( *xDocSh, 0, TRUE );
- }
-*/
-
- const SwFrmFmt *pFmt = rTbl.GetFrmFmt();
- ASSERT(pFmt, "Impossible");
- {
- Point aPt;
- SwRect aRect( pFmt->FindLayoutRect( false, &aPt ));
- if( aRect.IsEmpty() )
- {
- // dann besorge mal die Seitenbreite ohne Raender !!
- const SwFrmFmt* pFrmFmt = rRTFWrt.pFlyFmt ? rRTFWrt.pFlyFmt :
- const_cast<const SwDoc *>(rWrt.pDoc)
- ->GetPageDesc(0).GetPageFmtOfNode(rNode, false);
-
- aRect = pFrmFmt->FindLayoutRect( TRUE );
- if( 0 == ( nPageSize = aRect.Width() ))
- {
- const SvxLRSpaceItem& rLR = pFrmFmt->GetLRSpace();
- nPageSize = pFrmFmt->GetFrmSize().GetWidth() -
- rLR.GetLeft() - rLR.GetRight();
- }
- }
- else
- nPageSize = aRect.Width();
- }
-
- SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
-
- ByteString aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL );
- switch (pFmt->GetHoriOrient().GetHoriOrient())
- {
- case text::HoriOrientation::CENTER:
- aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQC;
- break;
- case text::HoriOrientation::RIGHT:
- aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQR;
- break;
- case text::HoriOrientation::NONE:
- case text::HoriOrientation::LEFT_AND_WIDTH:
- {
- const SvxLRSpaceItem& rLRSp = pFmt->GetLRSpace();
- nTblOffset = rLRSp.GetLeft();
- nPageSize -= (nTblOffset + rLRSp.GetRight());
- aTblAdjust += OOO_STRING_SVTOOLS_RTF_TRLEFT;
- aTblAdjust += ByteString::CreateFromInt32( nTblOffset );
- }
- break;
- default:
- break;
- }
-
- if (rRTFWrt.TrueFrameDirection(*pFmt) == FRMDIR_HORI_RIGHT_TOP)
- aTblAdjust += OOO_STRING_SVTOOLS_RTF_RTLROW;
-
- // ist die Tabelle wesentlich (PageSize + 10%) groesser als die Seite,
- // dann sind die Box-Breiten relative Angaben.
- BOOL bRelBoxSize = TRUE /*ALWAYS relativ (nPageSize + ( nPageSize / 10 )) < nTblSz*/;
-
- SwWriteTable* pTableWrt;
- const SwHTMLTableLayout *pLayout = rTbl.GetHTMLTableLayout();
- if( pLayout && pLayout->IsExportable() )
- pTableWrt = new SwWriteTable( pLayout );
- else
- pTableWrt = new SwWriteTable(rTbl.GetTabLines(), (USHORT)nPageSize,
- (USHORT)nTblSz, false);
-
- // rCols are the array of all cols of the table
- const SwWriteTableCols& rCols = pTableWrt->GetCols();
- USHORT nColCnt = rCols.Count();
- SwWriteTableCellPtr* pBoxArr = new SwWriteTableCellPtr[ nColCnt ];
- USHORT* pRowSpans = new USHORT[ nColCnt ];
- memset( pBoxArr, 0, sizeof( pBoxArr[0] ) * nColCnt );
- memset( pRowSpans, 0, sizeof( pRowSpans[0] ) * nColCnt );
- const SwWriteTableRows& rRows = pTableWrt->GetRows();
- for( USHORT nLine = 0; nLine < rRows.Count(); ++nLine )
- {
- USHORT nBox;
-
- const SwWriteTableRow *pRow = rRows[ nLine ];
- const SwWriteTableCells& rCells = pRow->GetCells();
-
- BOOL bFixRowHeight = false;
-
- USHORT nBoxes = rCells.Count();
- if (nColCnt < nBoxes)
- nBoxes = nColCnt;
-
- for( nColCnt = 0, nBox = 0; nBox < rCells.Count() && nColCnt < nBoxes; ++nColCnt )
- {
- SwWriteTableCell* pCell = rCells[ nBox ];
- const bool bProcessCoveredCell = bNewTableModel && 0 == pCell->GetRowSpan();
-
- if( !pRowSpans[ nColCnt ] || bProcessCoveredCell )
- {
- // set new BoxPtr
- nBox++;
- pBoxArr[ nColCnt ] = pCell;
- if ( !bProcessCoveredCell )
- pRowSpans[ nColCnt ] = pCell->GetRowSpan();
- for( USHORT nCellSpan = pCell->GetColSpan(), nCS = 1;
- nCS < nCellSpan; ++nCS, ++nColCnt )
- {
- ASSERT( nColCnt+1 < rCols.Count(), "More colspan than columns" );
- if( nColCnt+1 < rCols.Count() ) // robust against wrong colspans
- {
- pBoxArr[ nColCnt+1 ] = pBoxArr[ nColCnt ];
- pRowSpans[ nColCnt+1 ] = pRowSpans[ nColCnt ];
- }
- }
- }
- if( 1 != pRowSpans[ nColCnt ] && !bNewTableModel )
- bFixRowHeight = TRUE;
- }
-
- for( ; nColCnt < rCols.Count() && pRowSpans[ nColCnt ]; ++nColCnt )
- bFixRowHeight = TRUE;
-
- nColCnt = rCols.Count(); // A wrong cellspan-value could cause a nColCnt > rCols.Count()
-
- // Start Tabellendefinition
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TROWD << aTblAdjust.GetBuffer();
-
- if( rTbl.GetRowsToRepeat() > nLine )
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRHDR;
-
- const SwTableLine* pLine = pBoxArr[ 0 ]->GetBox()->GetUpper();
- // Zeilenhoehe ausgeben
- long nHeight = 0;
- if( bFixRowHeight && rWrt.pDoc->GetRootFrm() )
- {
- nHeight = -pRow->GetPos(); //neg. => abs. height!
- if( nLine )
- nHeight += rRows[ nLine - 1 ]->GetPos();
- }
- else
- {
- const SwFmtFrmSize& rLSz = pLine->GetFrmFmt()->GetFrmSize();
- if( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
- nHeight = ATT_MIN_SIZE == rLSz.GetHeightSizeType()
- ? rLSz.GetHeight()
- : -rLSz.GetHeight();
- }
-
- //The rtf default is to allow a row to break, so if we are not
- //splittable export TRKEEP
- const SwFrmFmt *pLineFmt = pLine ? pLine->GetFrmFmt() : 0;
- if (!pLineFmt || pLineFmt->GetRowSplit().GetValue() == 0)
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRKEEP;
-
- if( nHeight )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRRH;
- rWrt.OutLong( nHeight );
- }
-
- const SvxBoxItem *pDefaultBox = 0;
- if (nColCnt)
- {
- pDefaultBox = &(pBoxArr[0]->GetBox()->GetFrmFmt()->GetBox());
-
- static const USHORT aBorders[] =
- {
- BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
- };
-#ifdef __MINGW32__
- static const char* aRowPadNames[] __attribute__((section(".data"))) =
-#else
- static const char* aRowPadNames[] =
-#endif
- {
- OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR
- };
- static const char* aRowPadUnits[] =
- {
- OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR
- };
- for (int i = 0; i < 4; ++i)
- {
- rWrt.Strm() << aRowPadUnits[i];
- rWrt.OutULong(3);
- rWrt.Strm() << aRowPadNames[i];
- rWrt.OutULong(pDefaultBox->GetDistance(aBorders[i]));
- }
- }
-
- // Breite der Boxen ausgeben
- SwTwips nSz = 0, nCalc;
- for( nBox = 0; nBox < nColCnt; ++nBox )
- {
- SwWriteTableCell* pCell = pBoxArr[ nBox ];
- if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || (pCell == NULL) )
- continue;
-
- const SwFrmFmt& rFmt = *pCell->GetBox()->GetFrmFmt();
- if( 1 < pCell->GetRowSpan() || 0 == pCell->GetRowSpan() )
- rWrt.Strm() << ( pCell->GetRowSpan() == pRowSpans[ nBox ]
- ? OOO_STRING_SVTOOLS_RTF_CLVMGF
- : OOO_STRING_SVTOOLS_RTF_CLVMRG );
-
- const SfxPoolItem* pItem;
- if (SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(RES_BOX, TRUE,
- &pItem))
- {
- OutSwTblBorder(rRTFWrt, (SvxBoxItem&)*pItem, pDefaultBox);
- }
-
-// RTF kennt Schattierung in unserem Sinne nicht!
-// if( SFX_ITEM_SET == pBoxFmt->GetAttrSet().GetItemState(
-// RES_SHADOW, TRUE, &pItem ) )
-// OutSwTblShadow( rRTFWrt, *pItem );
-
- if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(
- RES_BACKGROUND, TRUE, &pItem )
- || 0 != ( pItem = pCell->GetBackground() )
- || 0 != ( pItem = pRow->GetBackground() ) )
- OutSwTblBackground( rRTFWrt, (SvxBrushItem&)*pItem );
-
- if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(
- RES_VERT_ORIENT, TRUE, &pItem ) )
- switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() )
- {
- case text::VertOrientation::CENTER: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALC; break;
- case text::VertOrientation::BOTTOM: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALB; break;
- default: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALT; break;
- }
-
- const SwFmtFrmSize& rLSz = rFmt.GetFrmSize();
- nSz += rLSz.GetWidth();
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELLX;
-
- nCalc = nSz;
- if( bRelBoxSize )
- {
- nCalc *= nPageSize;
- nCalc /= nTblSz;
- }
- rWrt.OutLong( nTblOffset + nCalc );
- }
-
- // Inhalt der Boxen ausgeben
- rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_INTBL;
- for( nBox = 0; nBox < nBoxes; ++nBox )
- {
- SwWriteTableCell * pCell = pBoxArr[nBox];
-
- if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || pCell == NULL)
- continue;
-
- if( pCell->GetRowSpan() == pRowSpans[ nBox ] )
- {
- // new Box
- const SwStartNode* pSttNd = pCell->GetBox()->GetSttNd();
- RTFSaveData aSaveData( rRTFWrt,
- pSttNd->GetIndex()+1, pSttNd->EndOfSectionIndex() );
- rRTFWrt.bOutTable = TRUE;
- rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam );
- }
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELL;
- }
-
- // das wars mit der Line
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ROW << OOO_STRING_SVTOOLS_RTF_PARD << ' ';
-
- for( nBox = 0; nBox < nColCnt; ++nBox )
- --pRowSpans[ nBox ];
- }
-
- delete pTableWrt;
- delete[] pBoxArr;
- delete[] pRowSpans;
-
- // Pam hinter die Tabelle verschieben
- rRTFWrt.pCurPam->GetPoint()->nNode = *rNode.EndOfSectionNode();
- rRTFWrt.SetAttrSet( 0 );
-
- return rWrt;
-}
-
-Writer& OutRTF_SwSectionNode( Writer& rWrt, SwSectionNode& rNode )
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
- const SwSection& rSect = rNode.GetSection();
-
- // folgt dahinter noch ein SectionNode? Dann wird erst die innere
- // Section aktiv. Hier wird die Verschachtelung aufgebrochen, weil
- // RTF das nicht kennt
- BOOL bPgDscWrite = false;
- {
- SwNodeIndex aIdx( rNode, 1 );
- const SwNode& rNd = aIdx.GetNode();
- if( rNd.IsSectionNode() /*&& CONTENT_SECTION ==
- aIdx.GetNode().GetSectionNode()->GetSection().GetType()*/ )
- return rWrt;
-
- // falls als erstes Position ein Content- oder Tabellen-Node steht,
- // dann kann dieser einen PageDesc gesetzt haben und der muss vor
- // der Bereichsbeschreibung geschrieben werden!
- // Umgekehrt muss im OutBreaks dann
- if( rNd.IsCntntNode() )
- {
- bPgDscWrite = rRTFWrt.OutBreaks( ((SwCntntNode&)rNd).GetSwAttrSet() );
- rRTFWrt.bIgnoreNextPgBreak = TRUE;
- }
- else if( rNd.IsTableNode() )
- {
- bPgDscWrite = rRTFWrt.OutBreaks( ((SwTableNode&)rNd).GetTable().
- GetFrmFmt()->GetAttrSet() );
- rRTFWrt.bIgnoreNextPgBreak = TRUE;
- }
- }
-
-
-// if( CONTENT_SECTION == rSect.GetType() )
- {
- // als fortlaufenden Abschnittwechsel heraus schreiben
- if( !bPgDscWrite )
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SBKNONE;
- //JP 19.03.99 - es muss fuer den Import auf jedenfall das Cols
- // Token geschrieben werden. Sonst kann nicht erkannt
- // werden, wann ein PageDesc & eine Section gueltig ist
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1';
- rRTFWrt.bOutFmtAttr = TRUE;
- const SfxPoolItem* pItem;
- const SwFrmFmt *pFmt = rSect.GetFmt();
- ASSERT(pFmt, "Impossible");
- const SfxItemSet& rSet = pFmt->GetAttrSet();
- if( SFX_ITEM_SET == rSet.GetItemState( RES_COL, false, &pItem ))
- OutRTF_SwFmtCol( rWrt, *pItem );
- else
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1' << OOO_STRING_SVTOOLS_RTF_COLSX;
- rWrt.OutULong(709);
- }
-
- if( SFX_ITEM_SET == rSet.GetItemState( RES_COLUMNBALANCE,
- false, &pItem ) && ((SwFmtNoBalancedColumns*)pItem)->GetValue() )
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_BALANCEDCOLUMN ) << '}';
-
- if (FRMDIR_HORI_RIGHT_TOP == rRTFWrt.TrueFrameDirection(*pFmt))
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT;
- else
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRSECT;
-
- rWrt.Strm() << SwRTFWriter::sNewLine;
- }
-
- return rWrt;
-}
-
-
-/* File CHRATR.HXX: */
-
-static Writer& OutRTF_SwFont( Writer& rWrt, const SfxPoolItem& rHt )
-{
- /* trage den Font in die Font-Liste vom Writer ein und gebe hier nur
- * die entsprechende Nummer aus. Der Font wird spaeter ueber diese
- * Tabelle im RTF-Dokument referenziert.
- */
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- if( !rRTFWrt.bTxtAttr ||
- ( rRTFWrt.GetEndPosLst() &&
- rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
- {
- rRTFWrt.bOutFmtAttr = true;
- const SvxFontItem&rFont = (const SvxFontItem&)rHt;
- bool bAssoc = rRTFWrt.IsAssociatedFlag();
- /*
- #109522#
- Word is a bit of a silly bugger of a program when its comes to symbol
- font useage. If a symbol font is actually being used, i.e. exported
- here with bTxtAttr true then both AF and F must be set to the same
- value
- */
- if (rRTFWrt.bTxtAttr && (rFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL))
- {
- const sal_Char* pCmd = !bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F;
- rWrt.Strm() << pCmd;
- }
- const sal_Char* pCmd = bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F;
- rWrt.Strm() << pCmd;
- rWrt.OutULong(rRTFWrt.GetId(rFont));
- rRTFWrt.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet()));
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwPosture( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- if( !rRTFWrt.bTxtAttr ||
- ( rRTFWrt.GetEndPosLst() &&
- rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
- {
- if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_POSTURE)
- {
- /*
- #i21422#
- Sadly in word rtf we can't retain CJK italic when we are not
- exporting asian text as it doesn't have a seperate italic for
- western and asian.
- */
- return rWrt;
- }
-
- const FontItalic nPosture = ((const SvxPostureItem&)rHt).GetPosture();
- int bTxtOut = rRTFWrt.bTxtAttr && ITALIC_NONE == nPosture;
- if( ITALIC_NORMAL == nPosture || bTxtOut )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AI : OOO_STRING_SVTOOLS_RTF_I;
- rWrt.Strm() << pCmd;
- }
- if( bTxtOut )
- rWrt.Strm() << '0'; // wieder abschalten
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwWeight( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bTxtAttr ||
- ( rRTFWrt.GetEndPosLst() &&
- rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
- {
- if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_WEIGHT)
- {
- /*
- #i21422#
- Sadly in word rtf we can't retain CJK bold when we are not
- exporting asian text as it doesn't have a seperate bold for western
- and asian.
- */
- return rWrt;
- }
-
- const FontWeight nBold = ((const SvxWeightItem&)rHt).GetWeight();
- int bTxtOut = rRTFWrt.bTxtAttr && WEIGHT_NORMAL == nBold;
- if( WEIGHT_BOLD == nBold || bTxtOut )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AB : OOO_STRING_SVTOOLS_RTF_B;
- rWrt.Strm() << pCmd;
- }
- if( bTxtOut )
- rWrt.Strm() << '0';
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwEmphasisMark( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const sal_Char* pStr;
- switch( ((const SvxEmphasisMarkItem&)rHt).GetEmphasisMark())
- {
- case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break;
- case EMPHASISMARK_SIDE_DOTS: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break;
- default: pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; break;
- }
-
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << pStr;
- return rWrt;
-}
-
-static Writer& OutRTF_SwTwoInOne( Writer& rWrt, const SfxPoolItem& rHt )
-{
- if( ((SvxTwoLinesItem&)rHt).GetValue() )
- {
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- sal_Unicode cStart = ((SvxTwoLinesItem&)rHt).GetStartBracket();
- sal_Unicode cEnd = ((SvxTwoLinesItem&)rHt).GetStartBracket();
-
- USHORT nType;
- if( !cStart && !cEnd )
- nType = 0;
- else if( '{' == cStart || '}' == cEnd )
- nType = 4;
- else if( '<' == cStart || '>' == cEnd )
- nType = 3;
- else if( '[' == cStart || ']' == cEnd )
- nType = 2;
- else // all other kind of brackets
- nType = 1;
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TWOINONE;
- rWrt.OutULong( nType );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwCharRotate( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HORZVERT;
- rWrt.OutLong( ((SvxCharRotateItem&)rHt).IsFitToLine() ? 1 : 0 );
- return rWrt;
-}
-static Writer& OutRTF_SwCharScaleW( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CHARSCALEX;
- rWrt.OutLong( ((SvxCharScaleWidthItem&)rHt).GetValue() );
- return rWrt;
-}
-
-static Writer& OutRTF_SwCharRelief(Writer& rWrt, const SfxPoolItem& rHt)
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxCharReliefItem& rAttr = (const SvxCharReliefItem&)rHt;
- const sal_Char* pStr;
- switch (rAttr.GetValue())
- {
- case RELIEF_EMBOSSED:
- pStr = OOO_STRING_SVTOOLS_RTF_EMBO;
- break;
- case RELIEF_ENGRAVED:
- pStr = OOO_STRING_SVTOOLS_RTF_IMPR;
- break;
- default:
- pStr = 0;
- break;
- }
-
- if (pStr)
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << pStr;
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwChrBckgrnd( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxBrushItem& rBack = (const SvxBrushItem&)rHt;
- if( !rBack.GetColor().GetTransparency() )
- {
- ByteString sOut( OOO_STRING_SVTOOLS_RTF_CHCBPAT );
- sOut += ByteString::CreateFromInt32(
- rRTFWrt.GetId( rBack.GetColor() ));
-
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << sOut.GetBuffer();
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwShadowed( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const BOOL bShadow = ((const SvxShadowedItem&)rHt).GetValue();
- int bTxtOut = rRTFWrt.bTxtAttr && !bShadow;
- if( bShadow || bTxtOut )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SHAD;
- }
- if( bTxtOut )
- rWrt.Strm() << '0';
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwContour( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const BOOL bContour = ((const SvxContourItem&)rHt).GetValue();
- int bTxtOut = rRTFWrt.bTxtAttr && !bContour;
- if( bContour || bTxtOut )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTL;
- }
- if( bTxtOut )
- rWrt.Strm() << '0';
- return rWrt;
-}
-
-static Writer& OutRTF_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const FontStrikeout nStrike = ((const SvxCrossedOutItem&)rHt).GetStrikeout();
- int bTxtOut = rRTFWrt.bTxtAttr && STRIKEOUT_NONE == nStrike;
-
- if( (STRIKEOUT_NONE != nStrike && STRIKEOUT_DONTKNOW != nStrike) || bTxtOut )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- if( STRIKEOUT_DOUBLE == nStrike )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKED;
- if( !bTxtOut )
- rWrt.Strm() << '1';
- }
- else
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKE;
- }
- if( bTxtOut )
- rWrt.Strm() << '0';
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- switch( ((const SvxCaseMapItem&)rHt).GetValue() )
- {
- case SVX_CASEMAP_KAPITAELCHEN:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SCAPS;
- break;
-
- case SVX_CASEMAP_VERSALIEN:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS;
- break;
-
- case SVX_CASEMAP_NOT_MAPPED:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS << '0' << OOO_STRING_SVTOOLS_RTF_SCAPS << '0'; // beide aus !!
- break;
-
- default:
- return rWrt;
- }
-
- rRTFWrt.bOutFmtAttr = TRUE;
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const char* pStr = 0;
- switch( ((const SvxUnderlineItem&)rHt).GetLineStyle() )
- {
- case UNDERLINE_SINGLE:
- pStr = OOO_STRING_SVTOOLS_RTF_UL;
- break;
- case UNDERLINE_DOUBLE:
- pStr = OOO_STRING_SVTOOLS_RTF_ULDB;
- break;
- case UNDERLINE_NONE:
- pStr = OOO_STRING_SVTOOLS_RTF_ULNONE;
- break;
- case UNDERLINE_DOTTED:
- pStr = OOO_STRING_SVTOOLS_RTF_ULD;
- break;
- case UNDERLINE_DASH:
- pStr = OOO_STRING_SVTOOLS_RTF_ULDASH;
- break;
- case UNDERLINE_DASHDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD;
- break;
- case UNDERLINE_DASHDOTDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD;
- break;
- case UNDERLINE_BOLD:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTH;
- break;
- case UNDERLINE_WAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE;
- break;
- case UNDERLINE_BOLDDOTTED:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTHD;
- break;
- case UNDERLINE_BOLDDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH;
- break;
- case UNDERLINE_LONGDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH;
- break;
- case UNDERLINE_BOLDLONGDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH;
- break;
- case UNDERLINE_BOLDDASHDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD;
- break;
- case UNDERLINE_BOLDDASHDOTDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD;
- break;
- case UNDERLINE_BOLDWAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE;
- break;
- case UNDERLINE_DOUBLEWAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE;
- break;
- default:
- break;
- }
-
- if( pStr )
- {
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- if( UNDERLINE_SINGLE == ((const SvxUnderlineItem&)rHt).GetLineStyle()
- && ((SvxWordLineModeItem&)rRTFWrt.GetItem(
- RES_CHRATR_WORDLINEMODE )).GetValue() )
- pStr = OOO_STRING_SVTOOLS_RTF_ULW;
-
- rRTFWrt.Strm() << pStr;
- rRTFWrt.bOutFmtAttr = TRUE;
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ULC;
- rWrt.OutULong( rRTFWrt.GetId(((const SvxUnderlineItem&)rHt).GetColor()) );
-
- }
-
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwOverline( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const char* pStr = 0;
- switch( ((const SvxOverlineItem&)rHt).GetLineStyle() )
- {
- case UNDERLINE_SINGLE:
- pStr = OOO_STRING_SVTOOLS_RTF_OL;
- break;
- case UNDERLINE_DOUBLE:
- pStr = OOO_STRING_SVTOOLS_RTF_OLDB;
- break;
- case UNDERLINE_NONE:
- pStr = OOO_STRING_SVTOOLS_RTF_OLNONE;
- break;
- case UNDERLINE_DOTTED:
- pStr = OOO_STRING_SVTOOLS_RTF_OLD;
- break;
- case UNDERLINE_DASH:
- pStr = OOO_STRING_SVTOOLS_RTF_OLDASH;
- break;
- case UNDERLINE_DASHDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_OLDASHD;
- break;
- case UNDERLINE_DASHDOTDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_OLDASHDD;
- break;
- case UNDERLINE_BOLD:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTH;
- break;
- case UNDERLINE_WAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_OLWAVE;
- break;
- case UNDERLINE_BOLDDOTTED:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTHD;
- break;
- case UNDERLINE_BOLDDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASH;
- break;
- case UNDERLINE_LONGDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_OLLDASH;
- break;
- case UNDERLINE_BOLDLONGDASH:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTHLDASH;
- break;
- case UNDERLINE_BOLDDASHDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHD;
- break;
- case UNDERLINE_BOLDDASHDOTDOT:
- pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHDD;
- break;
- case UNDERLINE_BOLDWAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_OLHWAVE;
- break;
- case UNDERLINE_DOUBLEWAVE:
- pStr = OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE;
- break;
- default:
- break;
- }
-
- if( pStr )
- {
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if ( rRTFWrt.bNonStandard )
- {
- if( UNDERLINE_SINGLE == ((const SvxOverlineItem&)rHt).GetLineStyle()
- && ((SvxWordLineModeItem&)rRTFWrt.GetItem(
- RES_CHRATR_WORDLINEMODE )).GetValue() )
- pStr = OOO_STRING_SVTOOLS_RTF_OLW;
-
- rRTFWrt.Strm() << pStr;
- rRTFWrt.bOutFmtAttr = TRUE;
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OLC;
- rWrt.OutULong( rRTFWrt.GetId(((const SvxOverlineItem&)rHt).GetColor()) );
- }
-
- }
-
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwLanguage( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bTxtAttr ||
- ( rRTFWrt.GetEndPosLst() &&
- rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
- {
-
- rRTFWrt.bOutFmtAttr = TRUE;
- const sal_Char* p = RES_CHRATR_CJK_LANGUAGE == rHt.Which()
- ? OOO_STRING_SVTOOLS_RTF_LANGFE : OOO_STRING_SVTOOLS_RTF_LANG;
- rWrt.Strm() << p;
- rWrt.OutULong( ((const SvxLanguageItem&)rHt).GetLanguage() );
- }
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwEscapement( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxEscapementItem& rEsc = (const SvxEscapementItem&)rHt;
- const char * pUpDn;
-
- SwTwips nH = ((SvxFontHeightItem&)rRTFWrt.GetItem(
- RES_CHRATR_FONTSIZE )).GetHeight();
-
- if( 0 < rEsc.GetEsc() )
- pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
- else if( 0 > rEsc.GetEsc() )
- {
- pUpDn = OOO_STRING_SVTOOLS_RTF_DN;
- nH = -nH; // den negativen Wert herrausrechnen
- }
- else
- return rWrt;
-
- // prozentuale Veraenderung speichern !
- short nEsc = rEsc.GetEsc();
- short nProp = rEsc.GetProp() * 100;
- if( DFLT_ESC_AUTO_SUPER == nEsc )
- {
- nEsc = 100 - rEsc.GetProp();
- ++nProp;
- }
- else if( DFLT_ESC_AUTO_SUB == nEsc )
- {
- nEsc = - 100 + rEsc.GetProp();
- ++nProp;
- }
-
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_UPDNPROP, TRUE );
- rWrt.OutULong( nProp ) << '}' << pUpDn;
-
- /*
- * berechne aus der akt. FontSize und dem ProzentWert die Verschiebung,
- * wobei im RTF File 1/2 Points stehen muessen, waehrend intern
- * mit Twips gerechnet wird.
- * Formel : (FontSize * 1/20 ) pts x * 2
- * ----------------------- = ------------
- * 100% Escapement
- */
-
- rWrt.OutULong( ( (long( nEsc ) * nH) + 500L ) / 1000L );
- // 500L zum Aufrunden !!
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwSize( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bTxtAttr ||
- ( rRTFWrt.GetEndPosLst() &&
- rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
- {
- if (
- rRTFWrt.IsAssociatedFlag() &&
- rHt.Which() == RES_CHRATR_CJK_FONTSIZE
- )
- {
- /*
- #i21422#
- Sadly in word rtf we can't retain CJK fontsize when we are not
- exporting asian text as it doesn't have a seperate fontsize for
- western and asian.
- */
- return rWrt;
- }
-
- rRTFWrt.bOutFmtAttr = TRUE;
-
- const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AFS : OOO_STRING_SVTOOLS_RTF_FS;
- rWrt.Strm() << pCmd;
- rWrt.OutULong( ((const SvxFontHeightItem&)rHt).GetHeight() / 10 );
- }
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwColor( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- /* trage die Color in die Color-Liste vom Writer ein und gebe hier nur
- * die entsprechende Nummer aus. Die Color wird spaeter ueber diese
- * Tabelle im RTF-Dokument referenziert.
- */
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CF;
- rWrt.OutULong( rRTFWrt.GetId( ((const SvxColorItem&)rHt).GetValue() ));
- return rWrt;
-}
-
-static Writer& OutRTF_SvxCharHiddenItem(Writer& rWrt, const SfxPoolItem& rHt)
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- rRTFWrt.bOutFmtAttr = true;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_V;
- if (!((const SvxCharHiddenItem&)rHt).GetValue())
- rWrt.OutULong(0);
- return rWrt;
-}
-
-extern void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
- ULONG& rFmt, ULONG nFFVersion );
-
-static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwFmtFld & rFld = (SwFmtFld&)rHt;
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- const SwField* pFld = rFld.GetFld();
-
- ByteString aFldStt( '{' );
- ((((aFldStt += OOO_STRING_SVTOOLS_RTF_FIELD) += '{' ) += OOO_STRING_SVTOOLS_RTF_IGNORE) += OOO_STRING_SVTOOLS_RTF_FLDINST) += ' ';
- switch( pFld->GetTyp()->Which() )
- {
- case RES_COMBINED_CHARS:
- {
- /*
- We need a font size to fill in the defaults, if these are overridden
- (as they generally are) by character properties then those properties
- win.
-
- The fontsize that is used in MS for determing the defaults is always
- the CJK fontsize even if the text is not in that language, in OOo the
- largest fontsize used in the field is the one we should take, but
- whatever we do, word will actually render using the fontsize set for
- CJK text. Nevertheless we attempt to guess whether the script is in
- asian or western text based up on the first character and use the
- font size of that script as our default.
- */
- const String& rFldPar1 = pFld->GetPar1();
- USHORT nScript;
- if( pBreakIt->GetBreakIter().is() )
- nScript = pBreakIt->GetBreakIter()->getScriptType( rFldPar1, 0);
- else
- nScript = i18n::ScriptType::ASIAN;
-
- long nHeight = ((SvxFontHeightItem&)rRTFWrt.GetItem(
- GetWhichOfScript(RES_CHRATR_FONTSIZE, nScript ))).GetHeight();
- nHeight = (nHeight + 10) / 20; //Font Size in points;
-
- /*
- Divide the combined char string into its up and down part. Get the
- font size and fill in the defaults as up == half the font size and
- down == a fifth the font size
- */
- xub_StrLen nAbove = (rFldPar1.Len()+1)/2;
- rWrt.Strm() << aFldStt.GetBuffer() << "EQ \\\\o (\\\\s\\\\up ";
- rWrt.OutLong( nHeight/2 ) << '(';
- RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy(0,nAbove),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- rWrt.Strm() << "), \\\\s\\\\do ";
- rWrt.OutLong( nHeight/5 ) << '(';
- RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy( nAbove ),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt )
- << "))";
- }
- break;
-
- case RES_DBFLD:
- aFldStt += "MERGEFIELD ";
- // kein break !!
- case RES_USERFLD:
- rWrt.Strm() << aFldStt.GetBuffer();
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->GetTyp()->GetName(),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- break;
- case RES_GETREFFLD:
- {
- BYTE nFldTyp = 0;
- rWrt.Strm() << aFldStt.GetBuffer() << " REF ";
- const SwGetRefField& rRFld = *(SwGetRefField*)pFld;
- switch( pFld->GetSubType() )
- {
- case REF_SETREFATTR:
- case REF_BOOKMARK:
- RTFOutFuncs::Out_String( rWrt.Strm(), rRFld.GetSetRefName(),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- nFldTyp = 3;
- break;
- }
-
- if( nFldTyp )
- {
- switch( pFld->GetFormat() )
- {
- case REF_PAGE_PGDESC:
- case REF_PAGE:
- rWrt.Strm() << "SEITEN";
- nFldTyp = 37;
- break;
- case REF_UPDOWN:
- rWrt.Strm() << " \\p";
- nFldTyp = 3;
- break;
- case REF_CHAPTER:
- rWrt.Strm() << " \\n";
- break;
- case REF_ONLYNUMBER:
- case REF_ONLYCAPTION:
- case REF_ONLYSEQNO:
- break;
- // default:
- // case REF_CONTENT:
- }
- rWrt.Strm() << " \\\\h "; // insert hyperlink
- }
- }
- break;
-// case RES_CHAPTERFLD:
-// rWrt.Strm() << ' ';
-// break;
- case RES_PAGENUMBERFLD:
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\page";
- {
- char __READONLY_DATA
- sNType0[] = "ALPHABETIC", /* CHARS_UPPER_LETTER*/
- sNType1[] = "alphabetic", /* CHARS_LOWER_LETTER*/
- sNType2[] = "ROMAN", /* ROMAN_UPPER */
- sNType3[] = "roman", /* ROMAN_LOWER */
- sNType4[] = "ARABIC"; /* ARABIC */
-
- const char* pFmtStr = 0;
- switch( pFld->GetFormat() )
- {
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: pFmtStr = sNType0; break;
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: pFmtStr = sNType1; break;
- case SVX_NUM_ROMAN_UPPER: pFmtStr = sNType2; break;
- case SVX_NUM_ROMAN_LOWER: pFmtStr = sNType3; break;
- case SVX_NUM_ARABIC: pFmtStr = sNType4; break;
- }
-
- if( pFmtStr )
- rWrt.Strm() << "\\\\* " << pFmtStr;
- }
- break;
- case RES_FILENAMEFLD:
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\filename ";
- break;
- case RES_DBNAMEFLD:
- {
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\data ";
- SwDBData aData = rWrt.pDoc->GetDBData();
- String sOut(aData.sDataSource);
- sOut += DB_DELIM;
- sOut += (String)aData.sCommand;
- RTFOutFuncs::Out_String( rWrt.Strm(), sOut,
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- }
- break;
- case RES_AUTHORFLD:
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\author ";
- break;
-
- case RES_HIDDENTXTFLD:
- if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() )
- RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(true),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- else
- {
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_V << ' ';
- OutRTF_AsByteString( rWrt, pFld->GetPar2(), rRTFWrt.eDefaultEncoding ).Strm()
- << '}' << SwRTFWriter::sNewLine;
- }
- return rWrt; // nicht bis zum Ende, kein RTF-Feld !!
-
- case RES_DATETIMEFLD:
- if (!(pFld->GetSubType() & FIXEDFLD))
- {
- USHORT nWhich = RES_DATETIMEFLD;
- ULONG nFmt = pFld->GetFormat();
- sw3io_ConvertToOldField(pFld, nWhich, nFmt, SOFFICE_FILEFORMAT_40 );
- if (pFld->GetSubType() & DATEFLD)
- {
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\date \\\\@\"";
- switch( nFmt )
- {
- case DF_SSYS: rWrt.Strm() << "tt.MM.yy"; break;
- case DF_LSYS: rWrt.Strm() << "tttt, t. MMMM yyyy"; break;
- case DF_SHORT: rWrt.Strm() << "tt.MM.yy"; break;
- case DF_SCENT: rWrt.Strm() << "tt.MM.yyyy"; break;
- case DF_LMON: rWrt.Strm() << "t. MMM yyyy"; break;
- case DF_LMONTH: rWrt.Strm() << "t. MMMM yyyy"; break;
- case DF_LDAYMON: rWrt.Strm() << "ttt, t. MMMM yyyy"; break;
- case DF_LDAYMONTH: rWrt.Strm() << "tttt, t. MMMM yyyy"; break;
- }
- }
- else
- {
- rWrt.Strm() << aFldStt.GetBuffer() << "\\\\date \\\\@\"";
- switch( nFmt )
- {
- case TF_SSMM_24: rWrt.Strm() << "HH:mm"; break;
- case TF_SSMM_12: rWrt.Strm() << "hh:mm"; break; // ???
- case TF_SYSTEM: rWrt.Strm() << "HH:mm"; break;
- }
- }
- rWrt.Strm() << '\"';
- break;
- }
- // Kein break: in default-Zweig laufen!
-
- default:
- {
- aFldStt.Erase();
-
- // JP 20.07.95: warum nicht das Expandierte rausschreiben ?
- sal_Char cCh;
- rWrt.Strm().SeekRel(-1);
- rWrt.Strm() >> cCh;
- if( ' ' != cCh ) // vorweg immer einen Trenner
- rWrt.Strm() << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(true),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- }
- break;
- }
-
- if( aFldStt.Len() )
- {
- rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(true),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- rWrt.Strm() << "}}";
- rRTFWrt.bOutFmtAttr = FALSE;
- }
-
- return rWrt;
-}
-
-static Writer& OutRTF_SwFlyCntnt( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwFrmFmt* pFmt = ((SwFmtFlyCnt&)rHt).GetFrmFmt();
- if (RES_DRAWFRMFMT != pFmt->Which())
- {
- ((SwRTFWriter&)rWrt).OutRTFFlyFrms( *((SwFlyFrmFmt*)pFmt) );
- ((SwRTFWriter&)rWrt).bOutFmtAttr = false;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFtn( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtFtn& rFtn = (const SwFmtFtn&)rHt;
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- do { // middle-check-loop
- if( !rFtn.GetTxtFtn() || !rFtn.GetTxtFtn()->GetStartNode() )
- break; // es gibt keine Kopf-/Fusszeile/Fussnote
-
- // Hole vom Node und vom letzten Node die Position in der Section
- ULONG nStart = rFtn.GetTxtFtn()->GetStartNode()->GetIndex()+1,
- nEnd = rWrt.pDoc->GetNodes()[ nStart-1 ]->EndOfSectionIndex();
-
- // kein Bereich also kein gueltiger Node
- if( nStart >= nEnd )
- break;
-
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_SUPER << ' ';
- if( !rFtn.GetNumStr().Len() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CHFTN;
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_FOOTNOTE );
- if( rFtn.IsEndNote() )
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FTNALT;
- rWrt.Strm() << ' ' << OOO_STRING_SVTOOLS_RTF_CHFTN;
- }
- else
- {
- OutRTF_AsByteString( rWrt, rFtn.GetNumStr(), rRTFWrt.eDefaultEncoding );
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_FOOTNOTE );
- if( rFtn.IsEndNote() )
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FTNALT;
- rWrt.Strm() << ' ';
- OutRTF_AsByteString( rWrt, rFtn.GetNumStr(), rRTFWrt.eDefaultEncoding );
- }
- RTFSaveData aSaveData( rRTFWrt, nStart, nEnd );
- // damit kein \par ausgegeben wird !!
- rRTFWrt.pCurPam->GetMark()->nContent++;
- rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam );
-
- rWrt.Strm() << "}}" << SwRTFWriter::sNewLine;
- rRTFWrt.bOutFmtAttr = FALSE;
-
- } while( FALSE );
- return rWrt;
-}
-
-static Writer& OutRTF_SwTxtCharFmt( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtCharFmt& rChrFmt = (const SwFmtCharFmt&)rHt;
- const SwCharFmt* pFmt = rChrFmt.GetCharFmt();
-
- if( pFmt )
- OutRTF_SwFmt( rWrt, *pFmt );
- return rWrt;
-}
-
-static Writer& OutRTF_SwTxtAutoFmt( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtAutoFmt& rAutoFmt = (const SwFmtAutoFmt&)rHt;
- const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle();
-
- if( pSet.get() )
- {
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
- OutRTF_SfxItemSet( rRTFWrt, *pSet.get(), FALSE );
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwTxtRuby( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SwFmtRuby& rRuby = (const SwFmtRuby&)rHt;
- const SwTxtRuby* pRubyTxt = rRuby.GetTxtRuby();
- const SwTxtNode* pNd;
-
- if( !pRubyTxt || 0 == (pNd = pRubyTxt->GetpTxtNode() ))
- return rWrt;
-
- sal_Char cDirective = 0, cJC = '0';
- switch( rRuby.GetAdjustment() )
- {
- case 0: cJC = '3'; cDirective = 'l'; break;
- case 2: cJC = '4'; cDirective = 'r'; break;
- case 3: cJC = '1'; cDirective = 'd'; break;
- case 4: cJC = '2'; cDirective = 'd'; break;
- case 1: break; //defaults to 0
- default:
- ASSERT( FALSE, "Unhandled Ruby justication code" );
- break;
- }
-
- /*
- MS needs to know the name and size of the font used in the ruby item,
- but we coud have written it in a mixture of asian and western
- scripts, and each of these can be a different font and size than the
- other, so we make a guess based upon the first character of the text,
- defaulting to asian.
- */
- USHORT nScript;
- if( pBreakIt->GetBreakIter().is() )
- nScript = pBreakIt->GetBreakIter()->getScriptType( rRuby.GetText(), 0);
- else
- nScript = i18n::ScriptType::ASIAN;
-
- const SwCharFmt* pFmt = pRubyTxt->GetCharFmt();
- const SvxFontItem *pFont;
- long nHeight;
-
- if( pFmt )
- {
- const SwAttrSet& rSet = pFmt->GetAttrSet();
- pFont = &(const SvxFontItem&)rSet.Get( GetWhichOfScript(
- RES_CHRATR_FONT, nScript ));
-
- nHeight = ((SvxFontHeightItem&)rSet.Get(
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight();
- }
- else
- {
- /*Get document defaults if no formatting on ruby text*/
- const SfxItemPool *pPool = pNd->GetSwAttrSet().GetPool();
- pFont = &(const SvxFontItem&)pPool->GetDefaultItem(
- GetWhichOfScript( RES_CHRATR_FONT, nScript ));
-
- nHeight = ((SvxFontHeightItem&)pPool->GetDefaultItem(
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight();
- }
- ( nHeight += 5 ) /= 10;
-
- // don't change " EQ " to any other without changing the code in RTFFLD.CXX
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FLDINST
- << " EQ \\\\* jc" << cJC
- << " \\\\* \"Font:";
- RTFOutFuncs::Out_String( rWrt.Strm(), pFont->GetFamilyName(),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- rWrt.Strm() << "\" \\\\* hps";
- rWrt.OutLong( nHeight );
- rWrt.Strm() << " \\\\o";
- if( cDirective )
- rWrt.Strm() << "\\\\a" << cDirective;
- rWrt.Strm() << "(\\\\s\\\\up ";
-
- if( pBreakIt->GetBreakIter().is() )
- nScript = pBreakIt->GetBreakIter()->getScriptType( pNd->GetTxt(),
- *pRubyTxt->GetStart() );
- else
- nScript = i18n::ScriptType::ASIAN;
-
- const SwAttrSet& rSet = pNd->GetSwAttrSet();
- nHeight = ((SvxFontHeightItem&)rSet.Get(
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nScript ))).GetHeight();
- (nHeight += 10) /= 20-1;
- rWrt.OutLong( nHeight ) << '(';
-
- if( pFmt )
- {
- rWrt.Strm() << '{';
- OutRTF_SwFmt( rWrt, *pFmt );
- if( rRTFWrt.bOutFmtAttr )
- rWrt.Strm() << ' ';
- }
- RTFOutFuncs::Out_String( rWrt.Strm(), rRuby.GetText(),
- rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
- if( pFmt )
- rWrt.Strm() << '}';
-
- rWrt.Strm() << "),";
- rRTFWrt.bOutFmtAttr = FALSE;
-
- return rWrt;
-}
-
-
-/* File FRMATR.HXX */
-
-static Writer& OutRTF_SwFrmSize( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SwFmtFrmSize& rSz = (const SwFmtFrmSize&)rHt;
- if( rRTFWrt.pFlyFmt ) // wird das FlyFrmFmt ausgegeben ?
- {
- if( !rRTFWrt.bRTFFlySyntax )
- return rWrt;
-
- if( rSz.GetWidth() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ABSW;
- rWrt.OutLong( rSz.GetWidth() );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
-
- if( rSz.GetHeight() )
- {
- long nH = rSz.GetHeight();
- if( ATT_FIX_SIZE == rSz.GetHeightSizeType() )
- nH = -nH;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ABSH;
- rWrt.OutLong( nH );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- }
- else if( rRTFWrt.bOutPageDesc )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PGWSXN;
- rWrt.OutLong( rSz.GetWidth() );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PGHSXN;
- rWrt.OutLong( rSz.GetHeight() );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtLRSpace( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxLRSpaceItem & rLR = (const SvxLRSpaceItem&) rHt;
- if( !rRTFWrt.pFlyFmt )
- {
- if( rRTFWrt.bOutPageDesc )
- {
- if( rLR.GetLeft() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_MARGLSXN;
- rWrt.OutLong( rLR.GetLeft() );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- if( rLR.GetRight() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_MARGRSXN;
- rWrt.OutLong( rLR.GetRight() );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- }
- else
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LI;
- rWrt.OutLong( rLR.GetTxtLeft() ) << OOO_STRING_SVTOOLS_RTF_RI;
- rWrt.OutLong( rLR.GetRight() );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LIN;
- rWrt.OutLong( rLR.GetTxtLeft() ) << OOO_STRING_SVTOOLS_RTF_RIN;
- rWrt.OutLong( rLR.GetRight() );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FI;
- rWrt.OutLong( rLR.GetTxtFirstLineOfst() );
- }
- }
- else if( rLR.GetLeft() == rLR.GetRight() && rRTFWrt.bRTFFlySyntax )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX;
- rWrt.OutLong( rLR.GetLeft() );
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtULSpace( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxULSpaceItem & rUL = (const SvxULSpaceItem&) rHt;
- if( rRTFWrt.pFlyFmt )
- {
- if( rUL.GetUpper() == rUL.GetLower() && rRTFWrt.bRTFFlySyntax )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTY;
- rWrt.OutLong( rUL.GetLower() );
- }
- }
- else
- {
- const char* p;
- USHORT nValue = rUL.GetUpper();
- if( rRTFWrt.bOutPageDesc )
- {
- p = OOO_STRING_SVTOOLS_RTF_MARGTSXN;
- if( !rRTFWrt.bOutPageDescTbl )
- {
- SwRect aRect;
- const SwFmtHeader* pHdr;
- if( SFX_ITEM_SET == rRTFWrt.pAktPageDesc->GetMaster().
- GetItemState( RES_HEADER, FALSE,
- (const SfxPoolItem**)&pHdr ) && pHdr->IsActive() )
- {
- aRect = pHdr->GetHeaderFmt()->FindLayoutRect( FALSE );
- if( aRect.Height() )
- nValue = nValue + static_cast< USHORT >(aRect.Height());
- else
- {
- const SwFmtFrmSize& rSz = pHdr->GetHeaderFmt()->GetFrmSize();
- if( ATT_VAR_SIZE != rSz.GetHeightSizeType() )
- nValue = nValue + static_cast< USHORT >(rSz.GetHeight());
- else
- nValue = nValue + 274; // defaulten fuer 12pt Schrift
- nValue = nValue + pHdr->GetHeaderFmt()->GetULSpace().GetLower();
- }
- }
- }
- }
- else
- p = OOO_STRING_SVTOOLS_RTF_SB;
-
- if( rRTFWrt.bOutPageDesc || nValue )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << p;
- rWrt.OutLong( nValue );
- }
-
-
- nValue = rUL.GetLower();
- if( rRTFWrt.bOutPageDesc )
- {
- p = OOO_STRING_SVTOOLS_RTF_MARGBSXN;
- if( !rRTFWrt.bOutPageDescTbl )
- {
- SwRect aRect;
- const SwFmtFooter* pFtr;
- if( SFX_ITEM_SET == rRTFWrt.pAktPageDesc->GetMaster().
- GetItemState( RES_FOOTER, FALSE,
- (const SfxPoolItem**)&pFtr ) && pFtr->IsActive() )
- {
- aRect = pFtr->GetFooterFmt()->FindLayoutRect( FALSE );
- if( aRect.Height() )
- nValue = nValue + static_cast< USHORT >(aRect.Height());
- else
- {
- const SwFmtFrmSize& rSz = pFtr->GetFooterFmt()->GetFrmSize();
- if( ATT_VAR_SIZE != rSz.GetHeightSizeType() )
- nValue = nValue + static_cast< USHORT >(rSz.GetHeight());
- else
- nValue += 274; // defaulten fuer 12pt Schrift
- nValue = nValue + pFtr->GetFooterFmt()->GetULSpace().GetUpper();
- }
- }
- }
- }
- else
- p = OOO_STRING_SVTOOLS_RTF_SA;
-
- if( rRTFWrt.bOutPageDesc || nValue )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << p;
- rWrt.OutLong( nValue );
- }
- }
- return rWrt;
-}
-
-// Header-Footer werden auch vom RTF-Writer direkt gerufen, also kein static!
-
-
-Writer& OutRTF_SwFmtHeader( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtHeader& rHd = (const SwFmtHeader&)rHt;
- if( !rHd.IsActive() ) // nicht aktiv, dann nichts weiter ausgeben
- return rWrt;
-
- // hole einen Node zu dem Request
- SwStartNode *pSttNode = 0;
- const SwFmtCntnt& rCntnt = rHd.GetHeaderFmt()->GetCntnt();
- if( rCntnt.GetCntntIdx() )
- pSttNode = rCntnt.GetCntntIdx()->GetNode().GetStartNode();
-
- do { // middle-check-loop
- if( !pSttNode )
- break; // es gibt keine Kopf-/Fusszeile/Fussnote
-
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- // Hole vom Node und vom letzten Node die Position in der Section
- ULONG nStart = pSttNode->GetIndex() + 1,
- nEnd = pSttNode->EndOfSectionIndex();
-
- // kein Bereich also kein gueltiger Node
- if( nStart >= nEnd )
- break;
- ASSERT( rRTFWrt.pAktPageDesc, "Header-Attribut ohne PageDesc" );
-
- const sal_Char * pHdNm = OOO_STRING_SVTOOLS_RTF_HEADER;
- rWrt.Strm() << pHdNm << 'y';
- if( rRTFWrt.bOutPageDescTbl )
- {
- // hole die Ober-/Unterkanten vom Header
- const SvxULSpaceItem& rUL = rHd.GetHeaderFmt()->GetULSpace();
- const SvxLRSpaceItem& rLR = rHd.GetHeaderFmt()->GetLRSpace();
- const SwFmtFrmSize& rSz = rHd.GetHeaderFmt()->GetFrmSize();
-
- rWrt.OutLong( rUL.GetUpper() );
- OutComment( rWrt, pHdNm ) << "yb";
- rWrt.OutLong( rUL.GetLower() ) << pHdNm << "xl";
- rWrt.OutLong( rLR.GetLeft() ) << pHdNm << "xr";
- rWrt.OutLong( rLR.GetRight() ) << pHdNm << "yh";
- rWrt.OutLong( ATT_FIX_SIZE == rSz.GetHeightSizeType()
- ? -rSz.GetHeight()
- : rSz.GetHeight() ) << '}';
- }
- else
- rWrt.OutLong( rRTFWrt.pAktPageDesc->GetMaster().
- GetULSpace().GetUpper() );
-
- // wird nicht die PageDesc-Tabelle ausgegeben und gibt es einen
- // Nachfolger, dann handelt es sich um die "1.Seite" nach RTF.
- sal_Char cTyp = 0;
- if( rRTFWrt.pAktPageDesc->GetFollow() &&
- rRTFWrt.pAktPageDesc->GetFollow() != rRTFWrt.pAktPageDesc )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; //i13107
- cTyp = 'f'; // dann FirstPage-Header
- }
- else if( !rRTFWrt.pAktPageDesc->IsHeaderShared() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FACINGP; //i13107
- cTyp = rRTFWrt.bOutLeftHeadFoot ? 'l' : 'r';
- }
-
- rWrt.Strm() << '{'<< pHdNm;
- if( cTyp ) rWrt.Strm() << cTyp;
- rWrt.Strm() << ' ';
-
- {
- RTFSaveData aSaveData( rRTFWrt, nStart, nEnd );
- rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam );
- }
-
- rWrt.Strm() << '}' << SwRTFWriter::sNewLine;
-
- } while( FALSE );
- return rWrt;
-}
-// Header-Footer werden auch vom RTF-Writer direkt gerufen, also kein static!
-
-
-Writer& OutRTF_SwFmtFooter( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtFooter& rFt = (const SwFmtFooter&)rHt;
- if( !rFt.IsActive() ) // nicht aktiv, dann nichts weiter ausgeben
- return rWrt;
-
- SwStartNode *pSttNode = 0;
- const SwFmtCntnt& rCntnt = rFt.GetFooterFmt()->GetCntnt();
- if( rCntnt.GetCntntIdx() )
- pSttNode = rCntnt.GetCntntIdx()->GetNode().GetStartNode();
-
- do { // middle-check-loop
- if( !pSttNode )
- break; // es gibt keine Kopf-/Fusszeile/Fussnote
-
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- // Hole vom Node und vom letzten Node die Position in der Section
- ULONG nStart = pSttNode->GetIndex()+1,
- nEnd = pSttNode->EndOfSectionIndex();
-
- // kein Bereich also kein gueltiger Node
- if( nStart >= nEnd )
- break;
- ASSERT( rRTFWrt.pAktPageDesc, "Footer-Attribut ohne PageDesc" );
-
- const sal_Char * pFtNm = OOO_STRING_SVTOOLS_RTF_FOOTER;
- rWrt.Strm() << pFtNm << 'y';
- if( rRTFWrt.bOutPageDescTbl )
- {
- // hole die Ober-/Unterkanten vom Footer
- const SvxULSpaceItem& rUL = rFt.GetFooterFmt()->GetULSpace();
- const SvxLRSpaceItem& rLR = rFt.GetFooterFmt()->GetLRSpace();
- const SwFmtFrmSize& rSz = rFt.GetFooterFmt()->GetFrmSize();
-
- rWrt.OutLong( rUL.GetLower() );
- OutComment( rWrt, pFtNm ) << "yt";
- rWrt.OutLong( rUL.GetUpper() ) << pFtNm << "xl";
- rWrt.OutLong( rLR.GetLeft() ) << pFtNm << "xr";
- rWrt.OutLong( rLR.GetRight() ) << pFtNm << "yh";
- rWrt.OutLong( ATT_FIX_SIZE == rSz.GetHeightSizeType()
- ? -rSz.GetHeight()
- : rSz.GetHeight() ) << '}';
- }
- else
- rWrt.OutLong( rRTFWrt.pAktPageDesc->GetMaster().
- GetULSpace().GetLower() );
-
- // wird nicht die PageDesc-Tabelle ausgegeben und gibt es einen
- // Nachfolger, dann handelt es sich um die "1.Seite" nach RTF.
- sal_Char cTyp = 0;
- if( !rRTFWrt.bOutPageDesc && rRTFWrt.pAktPageDesc->GetFollow() &&
- rRTFWrt.pAktPageDesc->GetFollow() != rRTFWrt.pAktPageDesc )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; //i13107
- cTyp = 'f'; // dann FirstPage-Header
- }
- else if( !rRTFWrt.pAktPageDesc->IsFooterShared() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FACINGP; //i13107
- cTyp = rRTFWrt.bOutLeftHeadFoot ? 'l' : 'r';
- }
-
- rWrt.Strm() << '{'<< pFtNm;
- if( cTyp ) rWrt.Strm() << cTyp;
- rWrt.Strm() << ' ';
-
- {
- RTFSaveData aSaveData( rRTFWrt, nStart, nEnd );
- rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam );
- }
-
- rWrt.Strm() << '}' << SwRTFWriter::sNewLine;
-
- } while( FALSE );
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtPrint( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bRTFFlySyntax && !((const SvxPrintItem&)rHt).GetValue() )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPRINT;
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwFmtOpaque( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bRTFFlySyntax && !((const SvxOpaqueItem&)rHt).GetValue() )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYOPAQUE;
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwFmtProtect( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bRTFFlySyntax )
- {
- const SvxProtectItem & rFlyProtect = (const SvxProtectItem&) rHt;
- RTFProtect aP( rFlyProtect.IsCntntProtected(),
- rFlyProtect.IsSizeProtected(),
- rFlyProtect.IsPosProtected() );
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPRTCTD;
- rWrt.OutULong( aP.GetValue() );
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwFmtSurround( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtSurround& rFlySurround = (const SwFmtSurround&) rHt;
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( rRTFWrt.bRTFFlySyntax )
- {
- if( SURROUND_NONE == rFlySurround.GetSurround() )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOWRAP;
- }
- }
- else
- {
- SwSurround eSurround = rFlySurround.GetSurround();
- BOOL bGold = SURROUND_IDEAL == eSurround;
- if( bGold )
- eSurround = SURROUND_PARALLEL;
- RTFSurround aMC( bGold, static_cast< BYTE >(eSurround) );
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYMAINCNT;
- rWrt.OutULong( aMC.GetValue() );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtVertOrient ( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtVertOrient& rFlyVert = (const SwFmtVertOrient&) rHt;
- RTFVertOrient aVO( static_cast< USHORT >(rFlyVert.GetVertOrient()), static_cast< USHORT >(rFlyVert.GetRelationOrient()) );
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- if( rRTFWrt.bRTFFlySyntax && rRTFWrt.pFlyFmt )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- const char* pOrient;
- RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId();
- sal_Int16 eOrient = rFlyVert.GetRelationOrient();
- if (FLY_AT_PAGE == eAnchor)
- {
- if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient )
- pOrient = OOO_STRING_SVTOOLS_RTF_PVPG;
- else
- pOrient = OOO_STRING_SVTOOLS_RTF_PVMRG;
- }
- else
- pOrient = OOO_STRING_SVTOOLS_RTF_PVPARA;
- rWrt.Strm() << pOrient;
-
- switch (rFlyVert.GetVertOrient())
- {
- case text::VertOrientation::TOP:
- case text::VertOrientation::LINE_TOP:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYT;
- break;
- case text::VertOrientation::BOTTOM:
- case text::VertOrientation::LINE_BOTTOM:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYB;
- break;
- case text::VertOrientation::CENTER:
- case text::VertOrientation::LINE_CENTER:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSYC;
- break;
- case text::VertOrientation::NONE:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSY;
- rWrt.OutULong(rFlyVert.GetPos());
- break;
- default:
- break;
- }
- }
- else if( !rRTFWrt.bRTFFlySyntax )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYVERT;
- rWrt.OutULong( aVO.GetValue() );
- }
-
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtHoriOrient( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwFmtHoriOrient& rFlyHori = (const SwFmtHoriOrient&) rHt;
- RTFHoriOrient aHO( static_cast< USHORT >(rFlyHori.GetHoriOrient()),
- static_cast< USHORT >(rFlyHori.GetRelationOrient()) );
-
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( rRTFWrt.bRTFFlySyntax && rRTFWrt.pFlyFmt )
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- const char* pS;
- RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId();
- sal_Int16 eOrient = rFlyHori.GetRelationOrient();
- if (FLY_AT_PAGE == eAnchor)
- {
- if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient )
- pS = OOO_STRING_SVTOOLS_RTF_PHPG;
- else
- pS = OOO_STRING_SVTOOLS_RTF_PHMRG;
- }
- else
- pS = OOO_STRING_SVTOOLS_RTF_PHCOL;
- rWrt.Strm() << pS;
-
- pS = 0;
- switch(rFlyHori.GetHoriOrient())
- {
- case text::HoriOrientation::RIGHT:
- pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXO : OOO_STRING_SVTOOLS_RTF_POSXR;
- break;
- case text::HoriOrientation::LEFT:
- pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXI : OOO_STRING_SVTOOLS_RTF_POSXL;
- break;
- case text::HoriOrientation::CENTER:
- pS = OOO_STRING_SVTOOLS_RTF_POSXC;
- break;
- case text::HoriOrientation::NONE:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_POSX;
- rWrt.OutULong( rFlyHori.GetPos() );
- break;
- default:
- break;
- }
- if (pS)
- rWrt.Strm() << pS;
- }
- else
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYHORZ;
- rWrt.OutULong( aHO.GetValue() );
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtAnchor( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bRTFFlySyntax )
- {
- const SwFmtAnchor& rAnchor = (const SwFmtAnchor&) rHt;
- USHORT nId = static_cast< USHORT >(rAnchor.GetAnchorId());
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYANCHOR;
- rWrt.OutULong( nId );
- rRTFWrt.bOutFmtAttr = TRUE;
- switch( nId )
- {
- case FLY_AT_PAGE:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPAGE;
- rWrt.OutULong( rAnchor.GetPageNum() );
- break;
- case FLY_AT_PARA:
- case FLY_AS_CHAR:
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYCNTNT;
- break;
- }
- }
- return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwFmtBackground( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- // wird das FlyFrmFmt ausgegeben, dann Background nur ausgeben, wenn
- // RTF-Syntax gesetzt ist !
- if( !rRTFWrt.pFlyFmt || !rRTFWrt.bRTFFlySyntax )
- {
- const SvxBrushItem& rBack = (const SvxBrushItem&)rHt;
- if( !rBack.GetColor().GetTransparency() )
- {
- ByteString sOut( OOO_STRING_SVTOOLS_RTF_CBPAT );
- sOut += ByteString::CreateFromInt32(
- rRTFWrt.GetId( rBack.GetColor() ));
-
- if( rRTFWrt.pFlyFmt || rRTFWrt.bOutPageDesc )
- {
- rWrt.Strm() << '{' << sOut.GetBuffer() << '}';
- }
- else
- {
- rRTFWrt.bOutFmtAttr = TRUE;
- rWrt.Strm() << sOut.GetBuffer();
- }
- }
- }
- return rWrt;
-}
-
-
-static Writer& OutRTF_SwFmtShadow( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- // wird das FlyFrmFmt ausgegeben, dann Schatten nur ausgeben, wenn
- // nicht RTF-Syntax gesetzt ist !
- if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax )
- return rWrt;
-
- const SvxShadowItem& rShadow = (const SvxShadowItem&)rHt;
- // FALSE wegen schliessender Klammer !!
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_SHADOW, FALSE );
- rWrt.OutULong( rShadow.GetLocation() ) << OOO_STRING_SVTOOLS_RTF_SHDWDIST;
- rWrt.OutULong( rShadow.GetWidth() ) << OOO_STRING_SVTOOLS_RTF_SHDWSTYLE;
- const Color& rColor = rShadow.GetColor();
- rWrt.OutULong( rColor.GetTransparency() ? SW_SV_BRUSH_NULL : SW_SV_BRUSH_SOLID );
- rWrt.OutULong( rRTFWrt.GetId( rColor ) ) << OOO_STRING_SVTOOLS_RTF_SHDWFCOL;
- rWrt.OutULong( 0 ) << '}';
- return rWrt;
-}
-
-
-static void OutBorderLine( SwRTFWriter& rWrt, const SvxBorderLine* pLine,
- const char* pStr )
-{
- rWrt.Strm() << pStr << OOO_STRING_SVTOOLS_RTF_BRDLNCOL;
- rWrt.OutULong( rWrt.GetId( pLine->GetColor() ) ) << OOO_STRING_SVTOOLS_RTF_BRDLNIN;
- rWrt.OutULong( pLine->GetInWidth() ) << OOO_STRING_SVTOOLS_RTF_BRDLNOUT;
- rWrt.OutULong( pLine->GetOutWidth() ) << OOO_STRING_SVTOOLS_RTF_BRDLNDIST;
- rWrt.OutULong( pLine->GetDistance() );
-}
-
-
-static Writer& OutRTF_SwFmtBox( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
- const SvxBoxItem& rBox = (const SvxBoxItem&)rHt;
-
- static USHORT __READONLY_DATA aBorders[] = {
- BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT };
- static const sal_Char* __READONLY_DATA aBorderNames[] = {
- OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR };
-
- USHORT nDist = rBox.GetDistance();
-
- // wird das FlyFrmFmt ausgegeben, dann Border nur ausgeben, wenn
- // nicht RTF-Syntax gesetzt ist!
- if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax )
- {
-/*
-RTF kennt keine Rahmen Umrandung!
- // die normale RTF-Definition
- if( rBox.GetTop() && rBox.GetBottom() &&
- rBox.GetLeft() && rBox.GetRight() &&
- *rBox.GetTop() == *rBox.GetBottom() &&
- *rBox.GetTop() == *rBox.GetLeft() &&
- *rBox.GetTop() == *rBox.GetRight() )
- OutBorderLine( rRTFWrt, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist );
- else
- {
- OUT_BRDLINE( rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BRDRT, nDist );
- OUT_BRDLINE( rBox.GetBottom(), OOO_STRING_SVTOOLS_RTF_BRDRB, nDist );
- OUT_BRDLINE( rBox.GetLeft(), OOO_STRING_SVTOOLS_RTF_BRDRL, nDist );
- OUT_BRDLINE( rBox.GetRight(), OOO_STRING_SVTOOLS_RTF_BRDRR, nDist );
- }
-*/
- return rWrt;
- }
- else if( !rRTFWrt.pFlyFmt )
- {
- // erst die normale RTF-Definition, dann unsere eigene
- if( rBox.GetTop() && rBox.GetBottom() &&
- rBox.GetLeft() && rBox.GetRight() &&
- *rBox.GetTop() == *rBox.GetBottom() &&
- *rBox.GetTop() == *rBox.GetLeft() &&
- *rBox.GetTop() == *rBox.GetRight() &&
- nDist == rBox.GetDistance( BOX_LINE_TOP ) &&
- nDist == rBox.GetDistance( BOX_LINE_LEFT ) &&
- nDist == rBox.GetDistance( BOX_LINE_BOTTOM ) &&
- nDist == rBox.GetDistance( BOX_LINE_RIGHT ))
- OutBorderLine( rRTFWrt, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist );
- else
- {
- const USHORT* pBrd = aBorders;
- const sal_Char** pBrdNms = (const sal_Char**)aBorderNames;
- for(int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms)
- {
- if (const SvxBorderLine* pLn = rBox.GetLine(*pBrd))
- {
- OutBorderLine(rRTFWrt, pLn, *pBrdNms,
- rBox.GetDistance(*pBrd));
- }
- }
- }
- }
-
- const USHORT* pBrd = aBorders;
- const sal_Char** pBrdNms = (const sal_Char**)aBorderNames;
- for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms )
- {
- const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
- if( pLn )
- {
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE;
- OutBorderLine( rRTFWrt, pLn, *pBrdNms );
- rWrt.Strm() << '}' << OOO_STRING_SVTOOLS_RTF_BRSP;
- rWrt.OutULong( rBox.GetDistance( *pBrd ));
- }
- }
-
- rRTFWrt.bOutFmtAttr = FALSE;
- return rWrt;
-}
-
-static Writer& OutRTF_SwFmtCol( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = ((SwRTFWriter&)rWrt);
- if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax )
- return rWrt;
-
- const SwFmtCol& rCol = (const SwFmtCol&)rHt;
- const SwColumns& rColumns = rCol.GetColumns();
-
- USHORT nCols = rColumns.Count();
- if( 1 < nCols )
- {
- // dann besorge mal die Seitenbreite ohne Raender !!
- const SwFrmFmt* pFmt;
-
- if( rRTFWrt.pFlyFmt )
- pFmt = rRTFWrt.pFlyFmt;
- else if( rRTFWrt.pAktPageDesc )
- pFmt = &rRTFWrt.pAktPageDesc->GetMaster();
- else
- pFmt = &const_cast<const SwDoc *>(rWrt.pDoc)
- ->GetPageDesc(0).GetMaster();
-
- const SvxLRSpaceItem& rLR = pFmt->GetLRSpace();
-
- USHORT nPageSize = static_cast< USHORT >( pFmt->GetFrmSize().GetWidth() -
- rLR.GetLeft() - rLR.GetRight() );
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS;
- rWrt.OutLong( nCols );
-
- if( rCol.IsOrtho() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX;
- rWrt.OutLong( rCol.GetGutterWidth( TRUE ) );
- }
- else
- for( USHORT n = 0; n < nCols; )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO;
- rWrt.OutLong( n+1 );
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLW;
- rWrt.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) );
- if( ++n != nCols )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR;
- rWrt.OutLong( rColumns[ n-1 ]->GetRight() +
- rColumns[ n ]->GetLeft() );
- }
- }
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SvxFmtKeep( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SvxFmtKeepItem& rItem = (const SvxFmtKeepItem&)rHt;
- if( rItem.GetValue() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_KEEPN;
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SvxFrmDir( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = ((SwRTFWriter&)rWrt);
- if (rRTFWrt.pFlyFmt || rRTFWrt.bOutPageDesc)
- OutSvxFrmDir(rRTFWrt, rHt);
- return rWrt;
-}
-
-/* File GRFATR.HXX */
-
-static Writer& OutRTF_SwMirrorGrf( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwMirrorGrf & rMirror = (const SwMirrorGrf&)rHt;
- if( RES_MIRROR_GRAPH_DONT == rMirror.GetValue() )
- return rWrt;
-
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_GRFMIRROR;
- rWrt.OutULong( rMirror.GetValue() );
- return rWrt;
-}
-
-static Writer& OutRTF_SwCropGrf( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SwCropGrf & rCrop = (const SwCropGrf&)rHt;
- ByteString aStr;
- if( rCrop.GetLeft() )
- ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPL ) +=
- ByteString::CreateFromInt32( (short)rCrop.GetLeft() );
- if( rCrop.GetRight() )
- ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPR ) +=
- ByteString::CreateFromInt32( (short)rCrop.GetRight() );
- if( rCrop.GetTop() )
- ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPT ) +=
- ByteString::CreateFromInt32( (short)rCrop.GetTop() );
- if( rCrop.GetBottom() )
- ( aStr += OOO_STRING_SVTOOLS_RTF_PICCROPB ) +=
- ByteString::CreateFromInt32( (short)rCrop.GetBottom() );
- if( aStr.Len() )
- {
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- rWrt.Strm() << aStr.GetBuffer();
- }
- return rWrt;
-}
-
-
-
-/* File PARATR.HXX */
-
-static Writer& OutRTF_SwLineSpacing( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SvxLineSpacingItem &rLs = (const SvxLineSpacingItem&)rHt;
-
- switch (rLs.GetLineSpaceRule())
- {
- default:
- break;
- case SVX_LINE_SPACE_AUTO:
- case SVX_LINE_SPACE_FIX:
- case SVX_LINE_SPACE_MIN:
- {
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SL;
- sal_Char cMult = '0';
- switch (rLs.GetInterLineSpaceRule())
- {
- case SVX_INTER_LINE_SPACE_FIX:
- // unser Durchschuss gibt es aber nicht in WW - also wie
- // kommt man an die MaxLineHeight heran?
- rWrt.OutLong((short)rLs.GetInterLineSpace());
- break;
- case SVX_INTER_LINE_SPACE_PROP:
- rWrt.OutLong((240L * rLs.GetPropLineSpace()) / 100L);
- cMult = '1';
- break;
- default:
- if (SVX_LINE_SPACE_FIX == rLs.GetLineSpaceRule())
- rWrt.Strm() << '-';
- rWrt.OutLong( rLs.GetLineHeight() );
- break;
- }
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SLMULT << cMult;
- }
- break;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwAdjust( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SvxAdjustItem & rAdjust = ((const SvxAdjustItem&)rHt);
- ByteString aAttr( "\\q" );
- switch( rAdjust.GetAdjust() )
- {
- case SVX_ADJUST_LEFT: aAttr += 'l'; break;
- case SVX_ADJUST_RIGHT: aAttr += 'r'; break;
- case SVX_ADJUST_BLOCKLINE:
- case SVX_ADJUST_BLOCK: aAttr += 'j'; break;
- case SVX_ADJUST_CENTER: aAttr += 'c'; break;
-
- default:
- return rWrt; // kein gueltiges Attriut, also returnen
- }
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- rWrt.Strm() << aAttr.GetBuffer();
- return rWrt;
-}
-
-static Writer& OutRTF_SvxFmtSplit( Writer& rWrt, const SfxPoolItem& rHt )
-{
- const SvxFmtSplitItem& rItem = (const SvxFmtSplitItem&)rHt;
- if( !rItem.GetValue() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_KEEP;
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwTabStop( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxTabStopItem & rTStops = (const SvxTabStopItem&)rHt;
- long nOffset = ((SvxLRSpaceItem&)rRTFWrt.GetItem( RES_LR_SPACE )).GetTxtLeft();
- for( USHORT n = 0; n < rTStops.Count(); n++ )
- {
- const SvxTabStop & rTS = rTStops[ n ];
- if( SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment() )
- {
- BOOL bOutDecimal = TRUE;
- const char* pFill = 0;
- switch( rTS.GetFill() )
- {
- case cDfltFillChar:
- break;
-
- case '.': pFill = OOO_STRING_SVTOOLS_RTF_TLDOT; break;
- case '_': pFill = OOO_STRING_SVTOOLS_RTF_TLUL; break;
- case '-': pFill = OOO_STRING_SVTOOLS_RTF_TLTH; break;
- case '=': pFill = OOO_STRING_SVTOOLS_RTF_TLEQ; break;
- default:
- if( !rRTFWrt.bWriteHelpFmt )
- {
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_TLSWG, FALSE );
- rWrt.OutULong( (((USHORT)rTS.GetFill()) << 8 ) +
- rTS.GetDecimal() )
- << '}';
- bOutDecimal = FALSE;
- }
- }
- if( pFill )
- rWrt.Strm() << pFill;
-
- if( !rRTFWrt.bWriteHelpFmt && bOutDecimal &&
- rTS.GetDecimal() != ((SvxTabStopItem&)*GetDfltAttr(
- RES_PARATR_TABSTOP ))[ 0 ].GetDecimal() )
- {
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_TLSWG, FALSE );
- rWrt.OutULong( (((USHORT)rTS.GetFill()) << 8 ) +
- rTS.GetDecimal() ) << '}';
- }
-
- const sal_Char* pAdjStr = 0;
- switch (rTS.GetAdjustment())
- {
- case SVX_TAB_ADJUST_RIGHT:
- pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR;
- break;
- case SVX_TAB_ADJUST_DECIMAL:
- pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC;
- break;
- case SVX_TAB_ADJUST_CENTER:
- pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC;
- break;
- default:
- break;
- }
- if (pAdjStr)
- rWrt.Strm() << pAdjStr;
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TX;
- rWrt.OutLong(rTS.GetTabPos() + nOffset);
- }
- }
- rRTFWrt.bOutFmtAttr = TRUE;
- return rWrt;
-}
-
-static Writer& OutRTF_SwHypenZone( Writer& rWrt, const SfxPoolItem& rHt )
-{
- if( !((SwRTFWriter&)rWrt).bWriteHelpFmt )
- {
- const SvxHyphenZoneItem& rAttr = (const SvxHyphenZoneItem&)rHt;
- USHORT nFlags = rAttr.IsHyphen() ? 1 : 0;
- if( rAttr.IsPageEnd() ) nFlags += 2;
-
- OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_HYPHEN, FALSE );
- rWrt.OutULong( nFlags ) << OOO_STRING_SVTOOLS_RTF_HYPHLEAD;
- rWrt.OutULong( rAttr.GetMinLead() ) << OOO_STRING_SVTOOLS_RTF_HYPHTRAIL;
- rWrt.OutULong( rAttr.GetMinTrail() ) << OOO_STRING_SVTOOLS_RTF_HYPHMAX;
- rWrt.OutULong( rAttr.GetMaxHyphens() ) << '}';
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwNumRule( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- if( !rRTFWrt.bOutListNumTxt )
- {
- const SwNumRuleItem& rAttr = (const SwNumRuleItem&)rHt;
- USHORT nId;
- if( rAttr.GetValue().Len() &&
- USHRT_MAX != (nId = rRTFWrt.GetId( rAttr ) ))
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LS;
- rWrt.OutULong( nId );
- rRTFWrt.bOutFmtAttr = TRUE;
- }
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwScriptSpace( Writer& rWrt, const SfxPoolItem& rHt )
-{
- if( ((const SvxScriptSpaceItem&)rHt).GetValue() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ASPALPHA;
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-static Writer& OutRTF_SwHangPunctuation( Writer& rWrt, const SfxPoolItem& rHt )
-{
- if( !((const SvxHangingPunctuationItem&)rHt).GetValue() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOOVERFLOW;
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-static Writer& OutRTF_SwForbiddenRule( Writer& rWrt, const SfxPoolItem& rHt )
-{
- if( !((const SvxForbiddenRuleItem&)rHt).GetValue() )
- {
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_NOCWRAP;
- ((SwRTFWriter&)rWrt).bOutFmtAttr = TRUE;
- }
- return rWrt;
-}
-
-static Writer& OutRTF_SwFontAlign( Writer& rWrt, const SfxPoolItem& rHt )
-{
- SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
- const SvxParaVertAlignItem & rAttr = (const SvxParaVertAlignItem &)rHt;
- const char* pStr;
- switch ( rAttr.GetValue() )
- {
- case SvxParaVertAlignItem::TOP: pStr = OOO_STRING_SVTOOLS_RTF_FAHANG; break;
- case SvxParaVertAlignItem::BOTTOM: pStr = OOO_STRING_SVTOOLS_RTF_FAVAR; break;
- case SvxParaVertAlignItem::CENTER: pStr = OOO_STRING_SVTOOLS_RTF_FACENTER; break;
- case SvxParaVertAlignItem::BASELINE: pStr = OOO_STRING_SVTOOLS_RTF_FAROMAN; break;
-
-// case SvxParaVertAlignItem::AUTOMATIC:
- default: pStr = OOO_STRING_SVTOOLS_RTF_FAAUTO; break;
- }
- rWrt.Strm() << pStr;
- rRTFWrt.bOutFmtAttr = TRUE;
- return rWrt;
-}
-
-/*
- * lege hier die Tabellen fuer die RTF-Funktions-Pointer auf
- * die Ausgabe-Funktionen an.
- * Es sind lokale Strukturen, die nur innerhalb der RTF-DLL
- * bekannt sein muessen.
- */
-
-SwAttrFnTab aRTFAttrFnTab = {
-/* RES_CHRATR_CASEMAP */ OutRTF_SwCaseMap,
-/* RES_CHRATR_CHARSETCOLOR */ 0,
-/* RES_CHRATR_COLOR */ OutRTF_SwColor,
-/* RES_CHRATR_CONTOUR */ OutRTF_SwContour,
-/* RES_CHRATR_CROSSEDOUT */ OutRTF_SwCrossedOut,
-/* RES_CHRATR_ESCAPEMENT */ OutRTF_SwEscapement,
-/* RES_CHRATR_FONT */ OutRTF_SwFont,
-/* RES_CHRATR_FONTSIZE */ OutRTF_SwSize,
-/* RES_CHRATR_KERNING */ 0, // NOT USED!! OutRTF_SwKerning,
-/* RES_CHRATR_LANGUAGE */ OutRTF_SwLanguage,
-/* RES_CHRATR_POSTURE */ OutRTF_SwPosture,
-/* RES_CHRATR_PROPORTIONALFONTSIZE*/0,
-/* RES_CHRATR_SHADOWED */ OutRTF_SwShadowed,
-/* RES_CHRATR_UNDERLINE */ OutRTF_SwUnderline,
-/* RES_CHRATR_WEIGHT */ OutRTF_SwWeight,
-/* RES_CHRATR_WORDLINEMODE */ 0, // Neu: Wortweises Unter-/Durchstreichen
-/* RES_CHRATR_AUTOKERN */ 0, // Neu: Automatisches Pairkerning
-/* RES_CHRATR_BLINK */ 0, // Neu: Blinkender Text
-/* RES_CHRATR_NOHYPHEN */ 0, // Neu: nicht trennen
-/* RES_CHRATR_NOLINEBREAK */ 0, // Neu: nicht umbrechen
-/* RES_CHRATR_BACKGROUND */ OutRTF_SwChrBckgrnd, // Neu: Zeichenhintergrund
-/* RES_CHRATR_CJK_FONT */ OutRTF_SwFont,
-/* RES_CHRATR_CJK_FONTSIZE */ OutRTF_SwSize,
-/* RES_CHRATR_CJK_LANGUAGE */ OutRTF_SwLanguage,
-/* RES_CHRATR_CJK_POSTURE */ OutRTF_SwPosture,
-/* RES_CHRATR_CJK_WEIGHT */ OutRTF_SwWeight,
-/* RES_CHRATR_CTL_FONT */ OutRTF_SwFont,
-/* RES_CHRATR_CTL_FONTSIZE */ OutRTF_SwSize,
-/* RES_CHRATR_CTL_LANGUAGE */ OutRTF_SwLanguage,
-/* RES_CHRATR_CTL_POSTURE */ OutRTF_SwPosture,
-/* RES_CHRATR_CTL_WEIGHT */ OutRTF_SwWeight,
-/* RES_CHRATR_ROTATE */ OutRTF_SwCharRotate,
-/* RES_CHRATR_EMPHASIS_MARK */ OutRTF_SwEmphasisMark,
-/* RES_CHRATR_TWO_LINES */ OutRTF_SwTwoInOne,
-/* RES_CHRATR_SCALEW */ OutRTF_SwCharScaleW,
-/* RES_CHRATR_RELIEF */ OutRTF_SwCharRelief,
-/* RES_CHRATR_HIDDEN */ OutRTF_SvxCharHiddenItem,
-/* RES_CHRATR_OVERLINE */ OutRTF_SwOverline,
-/* RES_CHRATR_DUMMY1 */ 0,
-/* RES_CHRATR_DUMMY2 */ 0,
-
-/* RES_TXTATR_REFMARK */ 0, // NOT USED!! OutRTF_SwRefMark,
-/* RES_TXTATR_TOXMARK */ 0, // NOT USED!! OutRTF_SwTOXMark,
-/* RES_TXTATR_META */ 0,
-/* RES_TXTATR_METAFIELD */ 0,
-/* RES_TXTATR_AUTOFMT */ OutRTF_SwTxtAutoFmt,
-/* RES_TXTATR_INETFMT */ OutRTF_SwTxtINetFmt,
-/* RES_TXTATR_CHARFMT */ OutRTF_SwTxtCharFmt,
-/* RES_TXTATR_CJK_RUBY */ OutRTF_SwTxtRuby,
-/* RES_TXTATR_UNKNOWN_CONTAINER */ 0,
-/* RES_TXTATR_DUMMY5 */ 0,
-
-/* RES_TXTATR_FIELD */ OutRTF_SwField,
-/* RES_TXTATR_FLYCNT */ OutRTF_SwFlyCntnt,
-/* RES_TXTATR_FTN */ OutRTF_SwFtn,
-/* RES_TXTATR_DUMMY4 */ 0,
-/* RES_TXTATR_DUMMY3 */ 0,
-/* RES_TXTATR_DUMMY1 */ 0, // Dummy:
-/* RES_TXTATR_DUMMY2 */ 0, // Dummy:
-
-/* RES_PARATR_LINESPACING */ OutRTF_SwLineSpacing,
-/* RES_PARATR_ADJUST */ OutRTF_SwAdjust,
-/* RES_PARATR_SPLIT */ OutRTF_SvxFmtSplit,
-/* RES_PARATR_WIDOWS */ 0, // NOT USED!! OutRTF_SwWidows,
-/* RES_PARATR_ORPHANS */ 0, // NOT USED!! OutRTF_SwOrphans,
-/* RES_PARATR_TABSTOP */ OutRTF_SwTabStop,
-/* RES_PARATR_HYPHENZONE*/ OutRTF_SwHypenZone,
-/* RES_PARATR_DROP */ 0,
-/* RES_PARATR_REGISTER */ 0, // neu: Registerhaltigkeit
-/* RES_PARATR_NUMRULE */ OutRTF_SwNumRule,
-/* RES_PARATR_SCRIPTSPACE */ OutRTF_SwScriptSpace,
-/* RES_PARATR_HANGINGPUNCTUATION */ OutRTF_SwHangPunctuation,
-/* RES_PARATR_FORBIDDEN_RULE*/ OutRTF_SwForbiddenRule,
-/* RES_PARATR_VERTALIGN */ OutRTF_SwFontAlign,
-/* RES_PARATR_SNAPTOGRID*/ 0, // new
-/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new
-/* RES_PARATR_OUTLINELEVEL */ 0, // new - outlinelevel
-
-/* RES_PARATR_LIST_ID */ 0, // new
-/* RES_PARATR_LIST_LEVEL */ 0, // new
-/* RES_PARATR_LIST_ISRESTART */ 0, // new
-/* RES_PARATR_LIST_RESTARTVALUE */ 0, // new
-/* RES_PARATR_LIST_ISCOUNTED */ 0, // new
-
-/* RES_FILL_ORDER */ 0, // NOT USED!! OutRTF_SwFillOrder,
-/* RES_FRM_SIZE */ OutRTF_SwFrmSize,
-/* RES_PAPER_BIN */ 0, // NOT USED!! OutRTF_SwFmtPaperBin,
-/* RES_LR_SPACE */ OutRTF_SwFmtLRSpace,
-/* RES_UL_SPACE */ OutRTF_SwFmtULSpace,
-/* RES_PAGEDESC */ 0,
-/* RES_BREAK */ 0,
-/* RES_CNTNT */ 0,
-/* RES_HEADER */ OutRTF_SwFmtHeader,
-/* RES_FOOTER */ OutRTF_SwFmtFooter,
-/* RES_PRINT */ OutRTF_SwFmtPrint,
-/* RES_OPAQUE */ OutRTF_SwFmtOpaque,
-/* RES_PROTECT */ OutRTF_SwFmtProtect,
-/* RES_SURROUND */ OutRTF_SwFmtSurround,
-/* RES_VERT_ORIENT */ OutRTF_SwFmtVertOrient,
-/* RES_HORI_ORIENT */ OutRTF_SwFmtHoriOrient,
-/* RES_ANCHOR */ OutRTF_SwFmtAnchor,
-/* RES_BACKGROUND */ OutRTF_SwFmtBackground,
-/* RES_BOX */ OutRTF_SwFmtBox,
-/* RES_SHADOW */ OutRTF_SwFmtShadow,
-/* RES_FRMMACRO */ 0, // NOT USED!! OutRTF_SwFmtFrmMacro,
-/* RES_COL */ OutRTF_SwFmtCol,
-/* RES_KEEP */ OutRTF_SvxFmtKeep,
-/* RES_URL */ 0, // URL
-/* RES_EDIT_IN_READONLY */ 0,
-/* RES_LAYOUT_SPLIT */ 0,
-/* RES_FRMATR_DUMMY1 */ 0, // Dummy:
-/* RES_FRMATR_DUMMY2 */ 0, // Dummy:
-/* RES_AUTO_STYLE */ 0, // Dummy:
-/* RES_FRMATR_DUMMY4 */ 0, // Dummy:
-/* RES_FRMATR_DUMMY5 */ 0, // Dummy:
-/* RES_FRMATR_DUMMY6 */ 0, // Dummy:
-/* RES_FRAMEDIR*/ OutRTF_SvxFrmDir,
-/* RES_FRMATR_DUMMY8 */ 0, // Dummy:
-/* RES_FRMATR_DUMMY9 */ 0, // Dummy:
-/* RES_FOLLOW_TEXT_FLOW */ 0,
-/* RES_WRAP_INFLUENCE_ON_OBJPOS */ 0,
-/* RES_FRMATR_DUMMY2 */ 0, // Dummy:
-/* RES_AUTO_STYLE */ 0, // Dummy:
-/* RES_FRMATR_DUMMY4 */ 0, // Dummy:
-/* RES_FRMATR_DUMMY5 */ 0, // Dummy:
-
-/* RES_GRFATR_MIRRORGRF */ OutRTF_SwMirrorGrf,
-/* RES_GRFATR_CROPGRF */ OutRTF_SwCropGrf,
-/* RES_GRFATR_ROTATION */ 0,
-/* RES_GRFATR_LUMINANCE */ 0,
-/* RES_GRFATR_CONTRAST */ 0,
-/* RES_GRFATR_CHANNELR */ 0,
-/* RES_GRFATR_CHANNELG */ 0,
-/* RES_GRFATR_CHANNELB */ 0,
-/* RES_GRFATR_GAMMA */ 0,
-/* RES_GRFATR_INVERT */ 0,
-/* RES_GRFATR_TRANSPARENCY */ 0,
-/* RES_GRFATR_DRWAMODE */ 0,
-/* RES_GRFATR_DUMMY1 */ 0,
-/* RES_GRFATR_DUMMY2 */ 0,
-/* RES_GRFATR_DUMMY3 */ 0,
-/* RES_GRFATR_DUMMY4 */ 0,
-/* RES_GRFATR_DUMMY5 */ 0,
-
-/* RES_BOXATR_FORMAT */ 0,
-/* RES_BOXATR_FORMULA */ 0,
-/* RES_BOXATR_VALUE */ 0,
-
-/* RES_UNKNOWNATR_CONTAINER */ 0
-};
-
-SwNodeFnTab aRTFNodeFnTab = {
-/* RES_TXTNODE */ OutRTF_SwTxtNode,
-/* RES_GRFNODE */ OutRTF_SwGrfNode,
-/* RES_OLENODE */ OutRTF_SwOLENode
-};
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 76adc1197305..5303ad26dcba 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -61,6 +61,7 @@
#include <txtflcnt.hxx>
#include <fmtflcnt.hxx>
#include <fltini.hxx>
+#include <unoframe.hxx>
#include <deque>
#include <map>
#include <utility>
@@ -1293,7 +1294,7 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
aFlySet.Put(aSurroundItem);
}
- SwFrmFmt* pFlyFmt = pDoc->Insert( *pPam,
+ SwFlyFrmFmt* pFlyFmt = pDoc->Insert( *pPam,
rGrfNm, aEmptyStr, // Name der Graphic !!
pGrf,
&aFlySet, // Attribute fuer den FlyFrm
@@ -1305,6 +1306,26 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
_SetPictureSize( *pGrfNd, pPos->nNode,
(SfxItemSet&)pFlyFmt->GetAttrSet(),
pPicType );
+ if( pPicType )
+ {
+ PictPropertyNameValuePairs::const_iterator aIt = pPicType->aPropertyPairs.begin();
+ PictPropertyNameValuePairs::const_iterator aEnd = pPicType->aPropertyPairs.end();
+ while( aIt != aEnd)
+ {
+ if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzDescription") ))
+ {
+ SwXFrame::GetOrCreateSdrObject( pFlyFmt );
+ pDoc->SetFlyFrmDescription( *(pFlyFmt), aIt->second );
+ }
+ else if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzName") ))
+ {
+ SwXFrame::GetOrCreateSdrObject( pFlyFmt );
+ pDoc->SetFlyFrmTitle( *(pFlyFmt), aIt->second );
+ }
+ ++aIt;
+ }
+ }
+
}
if( pGrfAttrSet )
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index 26129421013d..80fa0cd7e263 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -47,7 +47,6 @@
#include <fltini.hxx>
#include <swtypes.hxx>
#include <swparrtf.hxx>
-#include <wrtrtf.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
#include <docary.hxx>
@@ -1126,332 +1125,3 @@ BOOL lcl_IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 )
*pEnd = nEnd;
return nLvl != nEnd;
}
-
-void SwRTFWriter::OutRTFListTab()
-{
- ByteString sOverrideList;
- USHORT nId = 1, nTmplId = 1, n;
-
- // prepare the NodeNum to generate the NumString
- SwNumberTree::tNumberVector aNumVector;
- for( n = 0; n < MAXLEVEL; ++n )
- aNumVector.push_back(n);
- BYTE aNumLvlPos[ MAXLEVEL ];
-
- if( !pNumRuleTbl )
- BuildNumRuleTbl();
-
- for( n = 0; n < pNumRuleTbl->Count(); ++n )
- {
- const SwNumRule* pRule = (*pNumRuleTbl)[ n ];
-
- // mit der ersten Rule wird auch die ListTable geschrieben
- if( !sOverrideList.Len() )
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_LISTTABLE );
-
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID;
- OutULong( nTmplId );
- ByteString sTmp;
-
- if( pRule->IsContinusNum() )
- Strm() << OOO_STRING_SVTOOLS_RTF_LISTSIMPLE;
-
- BYTE nLvl, nEnd;
- lcl_IsExportNumRule( *pRule, &nEnd );
-
- for( nLvl = 0; nLvl < nEnd; ++nLvl )
- {
- const SwNumFmt& rFmt = pRule->Get( nLvl );
- Strm() << sNewLine;
- if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_SOUTLVL );
-
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL << OOO_STRING_SVTOOLS_RTF_LEVELNFC;
-
- USHORT nVal = 0;
- switch( rFmt.GetNumberingType() )
- {
- case SVX_NUM_ROMAN_UPPER: nVal = 1; break;
- case SVX_NUM_ROMAN_LOWER: nVal = 2; break;
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break;
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break;
-
- case SVX_NUM_BITMAP:
- case SVX_NUM_CHAR_SPECIAL: nVal = 23; break;
- }
- OutLong( nVal ) << OOO_STRING_SVTOOLS_RTF_LEVELJC;
-
- switch( rFmt.GetNumAdjust() )
- {
- case SVX_ADJUST_CENTER: nVal = 1; break;
- case SVX_ADJUST_RIGHT: nVal = 2; break;
- default: nVal = 0; break;
- }
- OutLong( nVal ) << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT;
- OutLong( rFmt.GetStart() )
- << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW << "0{" << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' ';
-
- BOOL bWriteBulletFont = FALSE;
- memset( aNumLvlPos, 0, MAXLEVEL );
- if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() ||
- SVX_NUM_BITMAP == rFmt.GetNumberingType() )
- {
- Strm() << "\\'01";
- ByteString sNo( ByteString::CreateFromInt32( rFmt.GetBulletChar()));
- Strm() << "\\u" << sNo.GetBuffer() << " ?";
- bWriteBulletFont = TRUE;
- }
- else if( SVX_NUM_NUMBER_NONE == rFmt.GetNumberingType() )
- {
- String sOut( rFmt.GetPrefix() ); sOut += rFmt.GetSuffix();
- if( sOut.Len() )
- {
- Strm() << "\\'";
- OutHex( sOut.Len() );
- RTFOutFuncs::Out_String( Strm(), sOut,
- eDefaultEncoding, bWriteHelpFmt );
- }
- }
- else
- {
- memset( aNumLvlPos, 0, MAXLEVEL );
- BYTE* pLvlPos = aNumLvlPos;
- // --> OD 2005-11-18 #128056#
- // correction of refactoring done by cws swnumtree:
- // - the numbering string has to be restrict to the level
- // currently working on.
- String sNumStr( pRule->MakeNumString( aNumVector, FALSE, TRUE, nLvl ));
- // <--
-
- // now search the nums in the string
- for( BYTE i = 0; i <= nLvl; ++i )
- {
- String sSrch( String::CreateFromInt32( i ));
- xub_StrLen nFnd = sNumStr.Search( sSrch );
- if( STRING_NOTFOUND != nFnd )
- {
- *pLvlPos = (BYTE)(nFnd + rFmt.GetPrefix().Len() + 1 );
- ++pLvlPos;
- sNumStr.SetChar( nFnd, (sal_Unicode)i );
- }
- }
-
- Strm() << "\\'";
- OutHex( sNumStr.Len() + rFmt.GetPrefix().Len() +
- rFmt.GetSuffix().Len() );
-
- if( rFmt.GetPrefix().Len() )
- RTFOutFuncs::Out_String( Strm(), rFmt.GetPrefix(),
- eDefaultEncoding, bWriteHelpFmt );
-
-
- for( xub_StrLen x = 0; x < sNumStr.Len(); ++x )
- if( sNumStr.GetChar( x ) < 0x20 ||
- sNumStr.GetChar( x ) > 0xFF )
- {
- Strm() << "\\'"; OutHex( sNumStr.GetChar( x ) );
- }
- else
- Strm() << (sal_Char)sNumStr.GetChar( x );
-
- if( rFmt.GetSuffix().Len() )
- RTFOutFuncs::Out_String( Strm(), rFmt.GetSuffix(),
- eDefaultEncoding, bWriteHelpFmt );
- }
-
- // write the levelnumbers
- Strm() << ";}{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS;
- for( BYTE i = 0; i <= nLvl && aNumLvlPos[ i ]; ++i )
- {
- Strm() << "\\'"; OutHex( aNumLvlPos[ i ] );
- }
- Strm() << ";}";
-
- if( rFmt.GetCharFmt() )
- Out_SfxItemSet( aRTFAttrFnTab, *this,
- rFmt.GetCharFmt()->GetAttrSet(), TRUE );
-
- if( bWriteBulletFont )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_F;
- const Font* pFont = rFmt.GetBulletFont();
- if( !pFont )
- // --> OD 2006-06-27 #b6440955#
- pFont = &numfunc::GetDefBulletFont();
- // <--
- OutULong( GetId( *pFont ));
- }
-
- Strm() << OOO_STRING_SVTOOLS_RTF_FI;
- OutLong( rFmt.GetFirstLineOffset() ) << OOO_STRING_SVTOOLS_RTF_LI;
- OutLong( rFmt.GetAbsLSpace() );
-
- Strm() << '}';
-
- if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen
- Strm() << '}';
- }
-
- if( !pRule->IsAutoRule() )
- {
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTNAME << ' ';
- RTFOutFuncs::Out_String( Strm(), pRule->GetName(), eDefaultEncoding,
- bWriteHelpFmt ) << ";}" ;
- }
- Strm() << OOO_STRING_SVTOOLS_RTF_LISTID;
- OutULong( nId ) << '}' << sNewLine;
-
- sTmp = '{';
- ((((((( sTmp += OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE ) +=
- OOO_STRING_SVTOOLS_RTF_LISTID ) += ByteString::CreateFromInt32( nId )) +=
- OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT ) += '0' ) +=
- OOO_STRING_SVTOOLS_RTF_LS ) += ByteString::CreateFromInt32( n )) += '}';
- sOverrideList += sTmp;
-
- ++nId, ++nTmplId;
- }
-
- if( sOverrideList.Len() )
- Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE
- << sOverrideList.GetBuffer() << '}' << sNewLine;
-}
-
-USHORT SwRTFWriter::GetId( const SwNumRuleItem& rItem ) const
-{
- USHORT n, nId = USHRT_MAX;
- if( !pNumRuleTbl )
- {
- SwRTFWriter* pThis = (SwRTFWriter*)this;
- pThis->BuildNumRuleTbl();
- }
- const String& rNm = rItem.GetValue();
- for( n = pNumRuleTbl->Count(); n; )
- if( (*pNumRuleTbl)[ --n ]->GetName() == rNm )
- {
- nId = n;
- break;
- }
-
- return nId;
-}
-
-USHORT SwRTFWriter::GetNumRuleId( const SwNumRule& rRule )
-{
- if( !pNumRuleTbl )
- BuildNumRuleTbl();
- SwNumRulePtr pR = (SwNumRulePtr)&rRule;
- return pNumRuleTbl->GetPos( pR );
-}
-
-void SwRTFWriter::BuildNumRuleTbl()
-{
- const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl();
- if( !pNumRuleTbl )
- pNumRuleTbl = new SwNumRuleTbl( (BYTE)rListTbl.Count() );
- for( USHORT n = rListTbl.Count()+1; n; )
- {
- SwNumRule* pRule;
- --n;
- if( n == rListTbl.Count() )
- pRule = (SwNumRule*)pDoc->GetOutlineNumRule();
- else
- {
- pRule = rListTbl[ n ];
- if( !pDoc->IsUsed( *pRule ))
- continue;
- }
-
- if( lcl_IsExportNumRule( *pRule ))
- pNumRuleTbl->Insert( pRule, pNumRuleTbl->Count() );
- }
-}
-
-BOOL SwRTFWriter::OutListNum( const SwTxtNode& rNd )
-{
- BOOL bRet = FALSE;
- const SwNumRule* pRule = rNd.GetNumRule();
-
- // --> OD 2008-03-18 #refactorlists#
-// if( pRule && MAXLEVEL > rNd.GetActualListLevel() )
- if( pRule && rNd.IsInList() )
- // <--
- {
- // --> OD 2008-03-18 #refactorlists#
- ASSERT( rNd.GetActualListLevel() >= 0 && rNd.GetActualListLevel() < MAXLEVEL,
- "<SwRTFWriter::OutListNum(..)> - text node does not have valid list level. Serious defect -> please inform OD" );
- // <--
-
- bOutFmtAttr = FALSE;
- bOutListNumTxt = TRUE;
- bRet = TRUE;
-
- const bool bExportNumRule = USHRT_MAX != GetNumRuleId( *pRule );
- const BYTE nLvl = static_cast< BYTE >(rNd.GetActualListLevel());
- const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl );
- if( !pFmt )
- pFmt = &pRule->Get( nLvl );
-
- const SfxItemSet& rNdSet = rNd.GetSwAttrSet();
-
- SfxItemSet aSet( *rNdSet.GetPool(), rNdSet.GetRanges() );
- aSet.SetParent( &rNdSet );
- SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
- aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
-
- aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
- if ( bExportNumRule )
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTTEXT << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' ';
-
- aSet.Put( aLR );
- Out_SfxItemSet( aRTFAttrFnTab, *this, aSet, TRUE );
-
- if( pFmt->GetCharFmt() )
- Out_SfxItemSet( aRTFAttrFnTab, *this,
- pFmt->GetCharFmt()->GetAttrSet(), TRUE );
-
- {
- String sTxt;
- if( SVX_NUM_CHAR_SPECIAL == pFmt->GetNumberingType() || SVX_NUM_BITMAP == pFmt->GetNumberingType() )
- sTxt = pFmt->GetBulletChar();
- else
- sTxt = rNd.GetNumString();
-
- if( bOutFmtAttr )
- {
- Strm() << ' ';
- bOutFmtAttr = FALSE;
- }
-
- if (sTxt.Len())
- {
- RTFOutFuncs::Out_String(Strm(), sTxt, eDefaultEncoding,
- bWriteHelpFmt);
- }
-
- if( bExportNumRule )
- {
- if( OUTLINE_RULE != pRule->GetRuleType() )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_TAB << '}' << OOO_STRING_SVTOOLS_RTF_ILVL;
- if( nLvl > 8 ) // RTF-kennt nur 9 Ebenen
- {
- OutULong( 8 );
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_SOUTLVL );
- OutULong( nLvl ) << '}';
- }
- else
- OutULong( nLvl );
- Strm() << ' ';
- }
- else
- Strm() << OOO_STRING_SVTOOLS_RTF_TAB << '}';
- }
- else if( sTxt.Len() )
- Strm() << OOO_STRING_SVTOOLS_RTF_TAB;
- }
- bOutListNumTxt = FALSE;
- }
- return bRet;
-}
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index a599ce095488..a4f3063ea05a 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -179,6 +179,12 @@ ULONG RtfReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const S
return nRet;
}
+ULONG RtfReader::Read(SvStream* pStream, SwDoc& rDoc, const String& rBaseURL, SwPaM& rPam)
+{
+ pStrm = pStream;
+ return Read(rDoc, rBaseURL, rPam, rBaseURL);
+}
+
SwRTFParser::SwRTFParser(SwDoc* pD,
uno::Reference<document::XDocumentProperties> i_xDocProps,
const SwPaM& rCrsr, SvStream& rIn, const String& rBaseURL,
@@ -1369,6 +1375,7 @@ void SwRTFParser::ReadShapeObject()
String shpTxt;
bool bshpTxt=false;
int txflTextFlow=0;
+ ::rtl::OUString sDescription, sName;
while (level>0 && IsParserWorking())
@@ -1426,7 +1433,14 @@ void SwRTFParser::ReadShapeObject()
{
txflTextFlow=aToken.ToInt32();
}
-
+ else if (sn.EqualsAscii("wzDescription"))
+ {
+ sDescription = aToken;
+ }
+ else if(sn.EqualsAscii("wzName"))
+ {
+ sName = aToken;
+ }
}
break;
case RTF_PICT:
@@ -1452,6 +1466,7 @@ void SwRTFParser::ReadShapeObject()
}
SkipToken(-1);
+ SdrObject* pSdrObject = 0;
switch(shapeType)
{
case 202: /* Text Box */
@@ -1471,6 +1486,7 @@ void SwRTFParser::ReadShapeObject()
const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
SdrRectObj* pStroke = new SdrRectObj(aRect);
+ pSdrObject = pStroke;
pStroke->SetSnapRect(aRect);
pDoc->GetOrCreateDrawModel(); // create model
InsertShpObject(pStroke, this->nZOrder++);
@@ -1518,6 +1534,7 @@ void SwRTFParser::ReadShapeObject()
aLine.append(aPointRightBottom);
SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aLine));
+ pSdrObject = pStroke;
//pStroke->SetSnapRect(aRect);
InsertShpObject(pStroke, this->nZOrder++);
@@ -1538,11 +1555,17 @@ void SwRTFParser::ReadShapeObject()
const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
SdrRectObj* pStroke = new SdrGrafObj(aGrf);
+ pSdrObject = pStroke;
pStroke->SetSnapRect(aRect);
InsertShpObject(pStroke, this->nZOrder++);
}
}
+ if( pSdrObject )
+ {
+ pSdrObject->SetDescription(sDescription);
+ pSdrObject->SetTitle(sName);
+ }
}
extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
@@ -1605,14 +1628,29 @@ void SwRTFParser::NextToken( int nToken )
switch( nToken )
{
case RTF_FOOTNOTE:
+ {
//We can only insert a footnote if we're not inside a footnote. e.g.
//#i7713#
- if (!mbIsFootnote)
+
+ // in insert mode it's also possible to be inside of a footnote!
+ bool bInsertIntoFootnote = false;
+ if( !IsNewDoc() )
+ {
+ SwStartNode* pSttNode = pPam->GetNode()->StartOfSectionNode();
+ while(pSttNode && pSttNode->IsSectionNode())
+ {
+ pSttNode = pSttNode->StartOfSectionNode();
+ }
+ if( SwFootnoteStartNode == pSttNode->GetStartNodeType() )
+ bInsertIntoFootnote = true;
+ }
+ if (!mbIsFootnote && !bInsertIntoFootnote)
{
ReadHeaderFooter( nToken );
SkipToken( -1 ); // Klammer wieder zurueck
}
- break;
+ }
+ break;
case RTF_SWG_PRTDATA:
ReadPrtData();
break;
diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx
index 0d6a0ce39ca1..1faa2614e815 100644
--- a/sw/source/filter/rtf/swparrtf.hxx
+++ b/sw/source/filter/rtf/swparrtf.hxx
@@ -76,6 +76,8 @@ struct SvxRTFPictureType;
class RtfReader: public Reader
{
virtual ULONG Read( SwDoc &, const String& rBaseURL, SwPaM &,const String &);
+public:
+ virtual ULONG Read( SvStream* pStrm, SwDoc &, const String& rBaseURL, SwPaM &);
};
class SwNodeIdx : public SvxNodeIdx
diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx
deleted file mode 100644
index 8c80d688a2ee..000000000000
--- a/sw/source/filter/rtf/wrtrtf.cxx
+++ /dev/null
@@ -1,1810 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-#include <stdlib.h>
-#include <hintids.hxx>
-
-#include <comphelper/string.hxx>
-#include <tools/stream.hxx>
-#include <tools/datetime.hxx>
-#include <unotools/fontcvt.hxx>
-#include <rtl/tencinfo.h>
-#include <svtools/rtfkeywd.hxx>
-#include <svtools/rtfout.hxx>
-#include <editeng/paperinf.hxx>
-#include <editeng/fontitem.hxx>
-#include <editeng/shaditem.hxx>
-#include <editeng/brshitem.hxx>
-#include <editeng/colritem.hxx>
-#include <editeng/boxitem.hxx>
-#include <editeng/tstpitem.hxx>
-#include <editeng/ulspitem.hxx>
-#include <editeng/lrspitem.hxx>
-#include <editeng/frmdiritem.hxx>
-#include <editeng/udlnitem.hxx>
-#include <fmtpdsc.hxx>
-#include <fmtcntnt.hxx>
-#include <fmtfsize.hxx>
-#include <fmthdft.hxx>
-#include <frmatr.hxx>
-#include <fmtanchr.hxx>
-#include <docary.hxx>
-#include <pam.hxx>
-#include <doc.hxx>
-#include <paratr.hxx>
-#include <fldbas.hxx>
-#include <ndtxt.hxx>
-#include <wrtrtf.hxx>
-#include <flypos.hxx>
-#include <IMark.hxx>
-#include <pagedesc.hxx> // fuer SwPageDesc...
-#include <ftninfo.hxx>
-#include <charfmt.hxx>
-#include <SwStyleNameMapper.hxx>
-#include <section.hxx>
-#include <swtable.hxx> // fuer SwPageDesc ...
-#include <swmodule.hxx>
-#include <swerror.h>
-#include <mdiexp.hxx> // ...Percent()
-#include <statstr.hrc> // ResId fuer Statusleiste
-#include <docsh.hxx>
-
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-
-
-#if defined(UNX)
-const sal_Char SwRTFWriter::sNewLine = '\012';
-#else
-const sal_Char __FAR_DATA SwRTFWriter::sNewLine[] = "\015\012";
-#endif
-
-
-
-SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL ) :
- eDefaultEncoding(
- rtl_getTextEncodingFromWindowsCharset(
- sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))),
- eCurrentEncoding(eDefaultEncoding)
-{
- SetBaseURL( rBaseURL );
- // schreibe Win-RTF-HelpFileFmt
- bWriteHelpFmt = 'W' == rFltName.GetChar( 0 );
- // schreibe nur Gliederungs Absaetze
- bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
- // enable non-standard tags for cut and paste
- bNonStandard = '\0' == rFltName.GetChar( 0 );
-}
-
-
-SwRTFWriter::~SwRTFWriter()
-{}
-
-
-ULONG SwRTFWriter::WriteStream()
-{
- bOutPageAttr = bOutSection = TRUE;
-
- bOutStyleTab = bOutTable = bOutPageDesc = bOutPageDescTbl =
- bAutoAttrSet = bOutListNumTxt = bOutLeftHeadFoot = bIgnoreNextPgBreak =
- bTxtAttr = bAssociated = FALSE;
-
- nCurScript = 1; // latin - ask the doc??
-
- nCurRedline = USHRT_MAX;
- if(pDoc->GetRedlineTbl().Count())
- nCurRedline = 0;
-
-
- pCurEndPosLst = 0;
- nBkmkTabPos = -1;
- pAktPageDesc = 0;
- pAttrSet = 0;
- pFlyFmt = 0; // kein FlyFrmFormat gesetzt
-
- pColTbl = new RTFColorTbl;
- pNumRuleTbl = 0;
-
- BYTE nSz = (BYTE)Min( pDoc->GetSpzFrmFmts()->Count(), USHORT(255) );
- SwPosFlyFrms aFlyPos( nSz, nSz );
-
- //Abkuerzung wenn nur Gliederung ausgegeben werden soll, und keine
- //Gliederungsabsaetze ausserhalb des Body stehen.
- if ( bOutOutlineOnly &&
- pDoc->GetNodes().GetOutLineNds().Count() &&
- pDoc->GetNodes().GetOutLineNds()[0]->GetIndex() >
- pDoc->GetNodes().GetEndOfExtras().GetIndex() )
- {
- nAktFlyPos = 0;
- pFlyPos = 0;
- MakeHeader();
-
- const SwOutlineNodes &rOutLine = pDoc->GetNodes().GetOutLineNds();
- for ( USHORT i = 0; i < rOutLine.Count(); ++i )
- {
- const SwNode *pNd = pDoc->GetNodes()[*rOutLine[i]];
- ASSERT( pNd->IsCntntNode(), "Outlinenode and no CntNode!?" );
-
- SwCntntNode* pCNd = (SwCntntNode*)pNd;
-
- // erfrage den aktuellen PageDescriptor.
- const SwPageDesc* pTmp = pCNd->GetSwAttrSet().GetPageDesc().GetPageDesc();
- if( pTmp )
- pAktPageDesc = pTmp;
- pCurPam->GetPoint()->nContent.Assign( pCNd, 0 );
- Out( aRTFNodeFnTab, *pCNd, *this );
- }
- }
- else
- {
- long nMaxNode = pDoc->GetNodes().Count();
-
- if( bShowProgress )
- ::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, pDoc->GetDocShell() );
-
- // Tabelle am Doc.-Anfang beachten
- {
- SwTableNode * pTNd = pCurPam->GetNode()->FindTableNode();
- if( pTNd && bWriteAll )
- {
- // mit dem TabellenNode anfangen !!
- pCurPam->GetPoint()->nNode = *pTNd;
-
- if( bWriteOnlyFirstTable )
- pCurPam->GetMark()->nNode = *pTNd->EndOfSectionNode();
- }
- }
-
- // Tabelle fuer die freifliegenden Rahmen erzeugen, aber nur wenn
- // das gesamte Dokument geschrieben wird
- nAktFlyPos = 0;
- pDoc->GetAllFlyFmts( aFlyPos, bWriteAll ? 0 : pOrigPam );
-
- // sollten nur Rahmen vorhanden sein?
- // (Moeglich, wenn eine Rahmen-Selektion ins Clipboard
- // gestellt wurde)
- if( bWriteAll &&
- // keine Laenge
- *pCurPam->GetPoint() == *pCurPam->GetMark() &&
- // Rahmen vorhanden
- pDoc->GetSpzFrmFmts()->Count() && !aFlyPos.Count() &&
- // nur ein Node im Array
- pDoc->GetNodes().GetEndOfExtras().GetIndex() + 3 ==
- pDoc->GetNodes().GetEndOfContent().GetIndex() &&
- // und genau der ist selektiert
- pDoc->GetNodes().GetEndOfContent().GetIndex() - 1 ==
- pCurPam->GetPoint()->nNode.GetIndex() )
- {
- // dann den Inhalt vom Rahmen ausgeben.
- // dieser steht immer an Position 0 !!
- SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[ 0 ];
- const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
- if( pIdx )
- {
- SwPosFlyFrm* pFPos = new SwPosFlyFrm( pCurPam->GetPoint()->nNode,
- pFmt, aFlyPos.Count() );
- aFlyPos.Insert( pFPos );
- }
- }
-
- pFlyPos = &aFlyPos;
-
- // schreibe die StyleTabelle, allgemeine Angaben,Header/Footer/Footnotes
- MakeHeader();
-
- Out_SwDoc( pOrigPam );
-
- if( bShowProgress )
- ::EndProgress( pDoc->GetDocShell() );
- }
-
- Strm() << '}';
-
- // loesche die Tabelle mit den freifliegenden Rahmen
- for( USHORT i = aFlyPos.Count(); i > 0; )
- delete aFlyPos[ --i ];
-
- pFlyPos = 0;
- delete pColTbl;
- if( pNumRuleTbl )
- {
- // don't destroy the numrule pointers in the DTOR.
- pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() );
- delete pNumRuleTbl;
- }
- delete pRedlAuthors;
-
- // schreibe Win-RTF-HelpFileFmt
- bOutOutlineOnly = bWriteHelpFmt = FALSE;
- pAttrSet = 0;
-
- return 0;
-}
-
-
-void SwRTFWriter::Out_SwDoc( SwPaM* pPam )
-{
- BOOL bSaveWriteAll = bWriteAll; // sichern
- // suche die naechste Bookmark-Position aus der Bookmark-Tabelle
- nBkmkTabPos = bWriteAll ? FindPos_Bkmk( *pCurPam->GetPoint() ) : -1;
-
- // gebe alle Bereiche des Pams in das RTF-File aus.
- do {
- bWriteAll = bSaveWriteAll;
- bFirstLine = TRUE;
-
- // suche den ersten am Pam-auszugebenen FlyFrame
- // fehlt noch:
-
- while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode ||
- (pCurPam->GetPoint()->nNode == pCurPam->GetMark()->nNode &&
- pCurPam->GetPoint()->nContent.GetIndex() <= pCurPam->GetMark()->nContent.GetIndex()) )
- {
- SwNode& rNd = pCurPam->GetPoint()->nNode.GetNode();
-
- if( &rNd == &pDoc->GetNodes().GetEndOfContent() )
- break;
-
- if( rNd.IsCntntNode() )
- {
- SwCntntNode& rCNd = (SwCntntNode&)rNd;
-
- OutBreaks( rCNd.GetSwAttrSet() );
- OutFlyFrm();
-
- if( !bFirstLine )
- pCurPam->GetPoint()->nContent.Assign( &rCNd, 0 );
-
- if( !bOutOutlineOnly ||
- //( rCNd.IsTxtNode() && NO_NUMBERING != //#outline level,removed by zhaojianwei
- //((SwTxtNode&)rCNd).GetTxtColl()->GetOutlineLevel() ))
- ( rCNd.IsTxtNode() && //->add by zhaojianwei
- ((SwTxtNode&)rCNd).GetTxtColl()->IsAssignedToListLevelOfOutlineStyle()))//<-end,zhaojianwei
- Out( aRTFNodeFnTab, rCNd, *this );
-
- }
- else if( !bOutOutlineOnly )
- {
- if (rNd.IsTableNode())
- {
- bool bAllOk = false;
- if (const SwTableNode *pNd = rNd.GetTableNode())
- {
- if (const SwFrmFmt *pFmt = pNd->GetTable().GetFrmFmt())
- {
- OutBreaks(pFmt->GetAttrSet());
- bAllOk = true;
- }
- OutRTF_SwTblNode(*this, *pNd);
- }
- ASSERT(bAllOk, "Unexpected missing properties from tables");
- }
- else if( rNd.IsSectionNode() )
- {
- OutBreaks( ((SwSectionNode&)rNd).GetSection().GetFmt()
- ->GetAttrSet() );
- OutRTF_SwSectionNode( *this, (SwSectionNode&)rNd );
- }
- else if( rNd.IsEndNode() )
- CheckEndNodeForSection( rNd );
- }
-
- ULONG nPos = pCurPam->GetPoint()->nNode++; // Bewegen
-
- if( bShowProgress )
- ::SetProgressState( nPos, pDoc->GetDocShell() ); // Wie weit ?
-
- /* sollen nur die Selectierten Bereiche gesichert werden, so
- * duerfen nur die vollstaendigen Nodes gespeichert werde,
- * d.H. der 1. und n. Node teilweise, der 2. bis n-1. Node
- * vollstaendig. (vollstaendig heisst mit allen Formaten! )
- */
- bWriteAll = bSaveWriteAll ||
- pCurPam->GetPoint()->nNode != pCurPam->GetMark()->nNode;
- bFirstLine = FALSE;
- }
- } while( CopyNextPam( &pPam ) ); // bis alle PaM's bearbeitet
-
- bWriteAll = bSaveWriteAll; // wieder auf alten Wert zurueck
-}
-
-
-// schreibe die StyleTabelle, algemeine Angaben,Header/Footer/Footnotes
-
-
-void SwRTFWriter::MakeHeader()
-{
- // baue den Vorspann wie Header, ColorTbl, FontTbl
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1'
- << OOO_STRING_SVTOOLS_RTF_ANSI;
- if( bWriteAll )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_DEFF;
- OutULong( GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem(
- RES_CHRATR_FONT ) ));
- }
- // JP 13.02.2001 - if this not exist, MS don't understand our ansi
- // characters (0x80-0xff).
- Strm() << "\\adeflang1025";
-
- OutRTFFontTab();
- OutRTFColorTab();
- OutRTFStyleTab();
- OutRTFListTab();
- OutRTFRevTab();
-
- Strm() << SwRTFWriter::sNewLine; // ein Trenner
-
- // wenn teilweise ausgegeben wird, die globalen Daten nicht speichern
- if( !bWriteAll )
- return;
-
- // Ausgeben der Doc-Info/-Statistik
- OutDocInfoStat();
-
- // einige globale Daten Schreiben
- { // Default-TabSize
- const SvxTabStopItem& rTabs = (const SvxTabStopItem&)
- pDoc->GetAttrPool().GetDefaultItem( RES_PARATR_TABSTOP );
- Strm() << OOO_STRING_SVTOOLS_RTF_DEFTAB;
- OutLong( rTabs[0].GetTabPos() );
- if ( !pDoc->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) )
- Strm() << OOO_STRING_SVTOOLS_RTF_LYTPRTMET;
- }
-
- // PageDescriptor ausgeben (??nur wenn das gesamte Dokument??)
- OutPageDesc();
-
- // gebe die Groesse und die Raender der Seite aus
- if( pDoc->GetPageDescCnt() )
- {
- //JP 06.04.99: Bug 64361 - suche den ersten SwFmtPageDesc. Ist
- // keiner gesetzt, so ist der Standard gueltig
- const SwFmtPageDesc* pSttPgDsc = 0;
- {
- const SwNode& rSttNd = *pDoc->GetNodes()[
- pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ];
- const SfxItemSet* pSet = 0;
-
- if( rSttNd.IsCntntNode() )
- pSet = &rSttNd.GetCntntNode()->GetSwAttrSet();
- else if( rSttNd.IsTableNode() )
- pSet = &rSttNd.GetTableNode()->GetTable().
- GetFrmFmt()->GetAttrSet();
- else if( rSttNd.IsSectionNode() )
- pSet = &rSttNd.GetSectionNode()->GetSection().
- GetFmt()->GetAttrSet();
-
- if( pSet )
- {
- USHORT nPosInDoc;
- pSttPgDsc = (SwFmtPageDesc*)&pSet->Get( RES_PAGEDESC );
- if( !pSttPgDsc->GetPageDesc() )
- pSttPgDsc = 0;
- else if( pDoc->FindPageDescByName( pSttPgDsc->
- GetPageDesc()->GetName(), &nPosInDoc ))
- {
- // FALSE wegen schliessender Klammer !!
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCNO, FALSE );
- OutULong( nPosInDoc ) << '}';
- }
- }
- }
- const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc()
- : const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
- const SwFrmFmt &rFmtPage = rPageDesc.GetMaster();
-
- {
- if( rPageDesc.GetLandscape() )
- Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE;
-
- const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize();
- // Clipboard-Dokument wird immer ohne Drucker angelegt, so ist
- // der Std.PageDesc immer aug LONG_MAX !! Mappe dann auf DIN A4
- if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH;
- Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4);
- OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW;
- OutULong( a4.Width() );
- }
- else
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH;
- OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW;
- OutULong( rSz.GetWidth() );
- }
- }
-
- {
- const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace();
- Strm() << OOO_STRING_SVTOOLS_RTF_MARGL;
- OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR;
- OutLong( rLR.GetRight() );
- }
-
- {
- const SvxULSpaceItem& rUL = rFmtPage.GetULSpace();
- Strm() << OOO_STRING_SVTOOLS_RTF_MARGT;
- OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB;
- OutLong( rUL.GetLower() );
- }
-
- Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE;
- OutRTFPageDescription( rPageDesc, FALSE, TRUE ); // Changed bCheckForFirstPage to TRUE so headers
- // following title page are correctly added - i13107
- if( pSttPgDsc )
- {
- bIgnoreNextPgBreak = TRUE;
- pAktPageDesc = &rPageDesc;
- }
- }
-
-
- {
- // schreibe die Fussnoten- und Endnoten-Info raus
- const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo();
-
- const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos
- ? OOO_STRING_SVTOOLS_RTF_ENDDOC
- : OOO_STRING_SVTOOLS_RTF_FTNBJ;
- Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART;
- OutLong( rFtnInfo.nFtnOffset + 1 );
-
- switch( rFtnInfo.eNum )
- {
- case FTNNUM_PAGE: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTPG; break;
- case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break;
-// case FTNNUM_CHAPTER:
- default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break;
- }
- Strm() << pOut;
-
- switch( rFtnInfo.aFmt.GetNumberingType() )
- {
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNALC; break;
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAUC; break;
- case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRLC; break;
- case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRUC; break;
- case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break;
-// case SVX_NUM_ARABIC:
- default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break;
- }
- Strm() << pOut;
-
-
- const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo();
-
- Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT
- << OOO_STRING_SVTOOLS_RTF_AFTNSTART;
- OutLong( rEndNoteInfo.nFtnOffset + 1 );
-
- switch( rEndNoteInfo.aFmt.GetNumberingType() )
- {
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNALC; break;
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAUC; break;
- case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRLC; break;
- case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRUC; break;
- case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break;
-// case SVX_NUM_ARABIC:
- default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break;
- }
- Strm() << pOut;
- }
-
- if( pDoc->_GetDBDesc().sDataSource.getLength() )
- {
- // stelle erstmal fest, ob ueberhaupt Datenbankfelder benutzt werden!
- const SwFldTypes* pTypes = pDoc->GetFldTypes();
- for( USHORT nCnt = pTypes->Count(); nCnt >= INIT_FLDTYPES; )
- if( RES_DBFLD == (*pTypes)[ --nCnt ]->Which() &&
- (*pTypes)[ nCnt ]->GetDepends() )
- {
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD;
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_FLDINST ) << " DATA ";
- SwDBData aData = pDoc->GetDBData();
- String sOut(aData.sDataSource);
- sOut += DB_DELIM;
- sOut += (String)aData.sCommand;
- RTFOutFuncs::Out_String( Strm(), sOut,
- eDefaultEncoding, bWriteHelpFmt );
- Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}";
- break;
- }
- }
-
- pAttrSet = 0;
-
- Strm() << SwRTFWriter::sNewLine; // ein Trenner
-}
-
-void SwRTFWriter::OutInfoDateTime( const sal_Char* i_pStr,
- const util::DateTime& i_rDT )
-{
- Strm() << '{' << i_pStr << OOO_STRING_SVTOOLS_RTF_YR;
- OutLong( Strm(), i_rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO;
- OutLong( Strm(), i_rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY;
- OutLong( Strm(), i_rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR;
- OutLong( Strm(), i_rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN;
- OutLong( Strm(), i_rDT.Minutes ) << '}';
-}
-
-bool CharsetSufficient(const String &rString, rtl_TextEncoding eChrSet)
-{
- const sal_uInt32 nFlags =
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
- RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
- rtl::OString sDummy;
- rtl::OUString sStr(rString);
- return sStr.convertToString(&sDummy, eChrSet, nFlags);
-}
-
-void SwRTFWriter::OutUnicodeSafeRecord(const sal_Char *pToken,
- const String &rContent)
-{
- if (rContent.Len())
- {
- bool bNeedUnicodeWrapper = !CharsetSufficient(rContent, eDefaultEncoding);
-
- if (bNeedUnicodeWrapper)
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_UPR;
-
- Strm() << '{' << pToken << ' ';
- OutRTF_AsByteString(*this, rContent, eDefaultEncoding);
- Strm() << '}';
-
- if (bNeedUnicodeWrapper)
- {
- OutComment(*this, OOO_STRING_SVTOOLS_RTF_UD);
- Strm() << '{' << pToken << ' ';
- RTFOutFuncs::Out_String(Strm(), rContent, eDefaultEncoding,
- bWriteHelpFmt);
- Strm() << "}}}";
- }
-
- }
-}
-
-void SwRTFWriter::OutDocInfoStat()
-{
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO;
-
- SwDocShell *pDocShell(pDoc->GetDocShell());
- uno::Reference<document::XDocumentProperties> xDocProps;
- if (pDocShell) {
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- pDocShell->GetModel(), uno::UNO_QUERY_THROW);
- xDocProps.set(xDPS->getDocumentProperties());
- }
-
- // may be null (in case of copying)
- if (xDocProps.is())
- {
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle());
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
-
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_KEYWORDS,
- ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
-
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor() );
- OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
-
- OutUnicodeSafeRecord(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy() );
- OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
-
- OutInfoDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
-
- }
-
- // fuer interne Zwecke - Versionsnummer rausschreiben
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " StarWriter}{" << OOO_STRING_SVTOOLS_RTF_VERN;
- OutLong( Strm(), SUPD*10 ) << '}';
-
- Strm() << '}';
-}
-
-static void InsColor( RTFColorTbl& rTbl, const Color& rCol )
-{
- for( size_t n = 0; n < rTbl.size(); ++n )
- if( rTbl[n] == rCol )
- return; // already exists, return
-
- if ( COL_AUTO == rCol.GetColor() )
- {
- rTbl.push_front( rCol );
- }
- else
- {
- rTbl.push_back( rCol );
- }
-}
-
-static void InsColorLine( RTFColorTbl& rTbl, const SvxBoxItem& rBox )
-{
- const SvxBorderLine* pLine = 0;
-
- if( rBox.GetTop() )
- InsColor( rTbl, (pLine = rBox.GetTop())->GetColor() );
- if( rBox.GetBottom() && pLine != rBox.GetBottom() )
- InsColor( rTbl, (pLine = rBox.GetBottom())->GetColor() );
- if( rBox.GetLeft() && pLine != rBox.GetLeft() )
- InsColor( rTbl, (pLine = rBox.GetLeft())->GetColor() );
- if( rBox.GetRight() && pLine != rBox.GetRight() )
- InsColor( rTbl, rBox.GetRight()->GetColor() );
-}
-
-void SwRTFWriter::OutRTFColorTab()
-{
- ASSERT( pColTbl, "Where's table color?" );
-
- // Build the color table from all attributes. The Colors
- // included and registered in the pool are on.
- size_t n;
- sal_uInt32 nMaxItem;
- const SfxItemPool& rPool = pDoc->GetAttrPool();
-
- // the character - Color attribute
- {
- const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr(
- RES_CHRATR_COLOR );
- InsColor( *pColTbl, pCol->GetValue() );
- if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem(
- RES_CHRATR_COLOR ) ))
- InsColor( *pColTbl, pCol->GetValue() );
- nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
- for( n = 0; n < nMaxItem; ++n )
- {
- if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2(
- RES_CHRATR_COLOR, n ) ) )
- InsColor( *pColTbl, pCol->GetValue() );
- }
-
- const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE );
- InsColor( *pColTbl, pUnder->GetColor() );
- nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
- for( n = 0; n < nMaxItem;n++)
- {
- if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) )
- InsColor( *pColTbl, pUnder->GetColor() );
-
- }
-
- const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE );
- InsColor( *pColTbl, pOver->GetColor() );
- nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
- for( n = 0; n < nMaxItem;n++)
- {
- if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) )
- InsColor( *pColTbl, pOver->GetColor() );
-
- }
-
- }
-
- // das Frame Hintergrund - Attribut
- static const USHORT aBrushIds[] = {
- RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
-
- for( const USHORT* pIds = aBrushIds; *pIds; ++pIds )
- {
- const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr( *pIds );
- InsColor( *pColTbl, pBkgrd->GetColor() );
- if( 0 != ( pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem(
- *pIds ) ))
- {
- InsColor( *pColTbl, pBkgrd->GetColor() );
- }
- nMaxItem = rPool.GetItemCount2( *pIds );
- for( n = 0; n < nMaxItem; ++n )
- if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(
- *pIds , n ) ))
- {
- InsColor( *pColTbl, pBkgrd->GetColor() );
- }
- }
-
- // das Frame Schatten - Attribut
- {
- const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr(
- RES_SHADOW );
- InsColor( *pColTbl, pShadow->GetColor() );
- if( 0 != ( pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem(
- RES_SHADOW ) ))
- {
- InsColor( *pColTbl, pShadow->GetColor() );
- }
- nMaxItem = rPool.GetItemCount2(RES_SHADOW);
- for( n = 0; n < nMaxItem; ++n )
- if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(
- RES_SHADOW, n ) ) )
- {
- InsColor( *pColTbl, pShadow->GetColor() );
- }
- }
-
- // das Frame Umrandungs - Attribut
- {
- // Box muesste noch gemacht werden, aber default nie eine Line gesetzt!
- const SvxBoxItem* pBox;
- if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(
- RES_BOX ) ))
- InsColorLine( *pColTbl, *pBox );
- nMaxItem = rPool.GetItemCount2(RES_BOX);
- for( n = 0; n < nMaxItem; ++n )
- if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) ))
- InsColorLine( *pColTbl, *pBox );
- }
-
- // und raus damit
- Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL;
-
- for( n = 0; n < pColTbl->size(); n++ )
- {
- const Color& rCol = (*pColTbl)[ n ];
- if( n || COL_AUTO != rCol.GetColor() )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_RED;
- OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN;
- OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE;
- OutULong( rCol.GetBlue() );
- }
- Strm() << ';';
- }
- Strm() << '}';
-}
-
-bool FontCharsetSufficient(const String &rFntNm, const String &rAltNm,
- rtl_TextEncoding eChrSet)
-{
- bool bRet = CharsetSufficient(rFntNm, eChrSet);
- if (bRet)
- bRet = CharsetSufficient(rAltNm, eChrSet);
- return bRet;
-}
-
-static void _OutFont( SwRTFWriter& rWrt, const SvxFontItem& rFont, USHORT nNo )
-{
- rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F;
-
- const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL;
- switch (rFont.GetFamily())
- {
- case FAMILY_ROMAN:
- pStr = OOO_STRING_SVTOOLS_RTF_FROMAN;
- break;
- case FAMILY_SWISS:
- pStr = OOO_STRING_SVTOOLS_RTF_FSWISS;
- break;
- case FAMILY_MODERN:
- pStr = OOO_STRING_SVTOOLS_RTF_FMODERN;
- break;
- case FAMILY_SCRIPT:
- pStr = OOO_STRING_SVTOOLS_RTF_FSCRIPT;
- break;
- case FAMILY_DECORATIVE:
- pStr = OOO_STRING_SVTOOLS_RTF_FDECOR;
- break;
- default:
- break;
- }
- rWrt.OutULong(nNo) << pStr << OOO_STRING_SVTOOLS_RTF_FPRQ;
-
- USHORT nVal = 0;
- switch (rFont.GetPitch())
- {
- case PITCH_FIXED:
- nVal = 1;
- break;
- case PITCH_VARIABLE:
- nVal = 2;
- break;
- default:
- nVal = 0;
- break;
- }
- rWrt.OutULong(nVal);
-
- sw::util::FontMapExport aRes(rFont.GetFamilyName());
-
- /*
- #i10538#
- In rtf the fontname is in the fontcharset, so if that isn't possible
- then bump the charset up to unicode
- */
- sal_uInt8 nChSet = 0;
- rtl_TextEncoding eChrSet = rFont.GetCharSet();
- nChSet = sw::ms::rtl_TextEncodingToWinCharset(eChrSet);
- eChrSet = rtl_getTextEncodingFromWindowsCharset(nChSet);
- if (!FontCharsetSufficient(aRes.msPrimary, aRes.msSecondary, eChrSet))
- {
- eChrSet = RTL_TEXTENCODING_UNICODE;
- nChSet = sw::ms::rtl_TextEncodingToWinCharset(eChrSet);
- eChrSet = rtl_getTextEncodingFromWindowsCharset(nChSet);
- }
-
- rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET;
- rWrt.OutULong( nChSet );
- rWrt.Strm() << ' ';
- if (aRes.HasDistinctSecondary())
- {
- RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msPrimary, eChrSet,
- rWrt.bWriteHelpFmt);
- OutComment(rWrt, OOO_STRING_SVTOOLS_RTF_FALT) << ' ';
- RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msSecondary, eChrSet,
- rWrt.bWriteHelpFmt) << '}';
- }
- else
- {
- RTFOutFuncs::Out_Fontname(rWrt.Strm(), aRes.msPrimary, eChrSet,
- rWrt.bWriteHelpFmt);
- }
- rWrt.Strm() << ";}";
-}
-
-void SwRTFWriter::OutRTFFontTab()
-{
- USHORT n = 0;
- const SfxItemPool& rPool = pDoc->GetAttrPool();
- const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr(RES_CHRATR_FONT);
-
- Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL;
- _OutFont( *this, *pFont, n++ );
-
- pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem(RES_CHRATR_FONT);
- if (pFont)
- _OutFont(*this, *pFont, n++);
-
- PutNumFmtFontsInAttrPool();
- PutCJKandCTLFontsInAttrPool();
-
- sal_uInt32 nMaxItem = rPool.GetItemCount2(RES_CHRATR_FONT);
- for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet)
- {
- pFont = (const SvxFontItem*)rPool.GetItem2(RES_CHRATR_FONT, nGet);
- if (pFont)
- _OutFont(*this, *pFont, n++);
- }
-
- Strm() << '}';
-}
-
-void RTF_WrtRedlineAuthor::Write(Writer &rWrt)
-{
- SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-
- rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' ';
- typedef std::vector<String>::iterator myiter;
-
- for(std::vector<String>::iterator aIter = maAuthors.begin(); aIter != maAuthors.end(); ++aIter)
- {
- rRTFWrt.Strm() << '{';
- // rWrt.bWriteHelpFmt
- RTFOutFuncs::Out_String( rRTFWrt.Strm(), *aIter, rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) << ";}";
- }
- rRTFWrt.Strm() << '}' << SwRTFWriter::sNewLine;
-}
-
-bool SwRTFWriter::OutRTFRevTab()
-{
- // Writes the revision author table
- int nRevAuthors = pDoc->GetRedlineTbl().Count();
-
- pRedlAuthors = new RTF_WrtRedlineAuthor;
- // RTF always seems to use Unknown as the default first entry
- String sUnknown(RTL_CONSTASCII_STRINGPARAM("Unknown"));
- pRedlAuthors->AddName(sUnknown);
-
- if (nRevAuthors < 1)
- return false;
-
- // pull out all the redlines and make a vector of all the author names
- for( USHORT i = 0; i < pDoc->GetRedlineTbl().Count(); ++i )
- {
- const SwRedline* pRedl = pDoc->GetRedlineTbl()[ i ];
- const String sAuthor = SW_MOD()->GetRedlineAuthor( pRedl->GetAuthor() );
- pRedlAuthors->AddName(sAuthor);
- }
-
- pRedlAuthors->Write(*this);
- return true;
-}
-
-//Takashi Ono for CJK
-const rtl::OUString SwRTFWriter::XlateFmtName( const rtl::OUString &rName, SwGetPoolIdFromName eFlags )
-{
-#define RES_NONE RES_POOLCOLL_DOC_END
-
- static const RES_POOL_COLLFMT_TYPE aArr[]={
- RES_POOLCOLL_STANDARD, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE2,
- RES_POOLCOLL_HEADLINE3, RES_POOLCOLL_HEADLINE4, RES_POOLCOLL_HEADLINE5,
- RES_POOLCOLL_HEADLINE6, RES_POOLCOLL_HEADLINE7, RES_POOLCOLL_HEADLINE8,
- RES_POOLCOLL_HEADLINE9,
-
- RES_POOLCOLL_TOX_IDX1, RES_POOLCOLL_TOX_IDX2, RES_POOLCOLL_TOX_IDX3,
- RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE,
- RES_POOLCOLL_TOX_CNTNT1,
-
- RES_POOLCOLL_TOX_CNTNT2, RES_POOLCOLL_TOX_CNTNT3, RES_POOLCOLL_TOX_CNTNT4,
- RES_POOLCOLL_TOX_CNTNT5, RES_POOLCOLL_TOX_CNTNT6, RES_POOLCOLL_TOX_CNTNT7,
- RES_POOLCOLL_TOX_CNTNT8, RES_POOLCOLL_TOX_CNTNT9,
- RES_POOLCOLL_TEXT_IDENT, RES_POOLCOLL_FOOTNOTE,
-
- RES_NONE, RES_POOLCOLL_HEADER, RES_POOLCOLL_FOOTER, RES_POOLCOLL_TOX_IDXH,
- RES_POOLCOLL_LABEL, RES_POOLCOLL_TOX_ILLUSH, RES_POOLCOLL_JAKETADRESS, RES_POOLCOLL_SENDADRESS,
- RES_NONE, RES_NONE,
-
- RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_ENDNOTE, RES_POOLCOLL_TOX_AUTHORITIESH, RES_NONE, RES_NONE,
- RES_POOLCOLL_BUL_LEVEL1, RES_POOLCOLL_BUL_LEVEL1, RES_POOLCOLL_NUM_LEVEL1,
-
- RES_POOLCOLL_BUL_LEVEL2, RES_POOLCOLL_BUL_LEVEL3, RES_POOLCOLL_BUL_LEVEL4, RES_POOLCOLL_BUL_LEVEL5,
- RES_POOLCOLL_BUL_LEVEL2, RES_POOLCOLL_BUL_LEVEL3, RES_POOLCOLL_BUL_LEVEL4, RES_POOLCOLL_BUL_LEVEL5,
- RES_POOLCOLL_NUM_LEVEL2, RES_POOLCOLL_NUM_LEVEL3, RES_POOLCOLL_NUM_LEVEL4, RES_POOLCOLL_NUM_LEVEL5,
-
- RES_POOLCOLL_DOC_TITEL, RES_NONE, RES_POOLCOLL_SIGNATURE, RES_NONE,
- RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_MOVE, RES_NONE, RES_NONE,
-
- RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_DOC_SUBTITEL };
-
- static const sal_Char *stiName[] = {
- "Normal", "heading 1", "heading 2",
- "heading 3", "heading 4", "heading 5",
- "heading 6", "heading 7", "heading 8",
- "heading 9",
-
- "index 1", "index 2", "index 3",
- "index 4", "index 5", "index 6",
- "index 7", "index 8", "index 9",
-
- "toc 1", "toc 2", "toc 3",
- "toc 4", "toc 5", "toc 6",
- "toc 7", "toc 8", "toc 9",
- "Normal Indent", "footnote text",
-
- "annotation text", "header", "footer", "index heading",
- "caption", "table of figures", "envelope address", "envelope return",
- "footnote reference", "annotation reference",
-
- "line number", "page number", "endnote reference", "endnote text", "table of authorities", "macro", "toa heading",
- "List", "List Bullet", "List Number",
-
- "List 2", "List 3", "List 4", "List 5",
- "List Bullet 2", "List Bullet 3", "List Bullet 4", "List Bullet 5",
- "List Number 2", "List Number 3", "List Number 4", "List Number 5",
-
- "Title", "Closing", "Signature", "Default Paragraph Font",
- "Body Text", "Body Text Indent", "List Continue",
-
- "List Continue 2", "List Continue 3", "List Continue 4", "List Continue 5", "Message Header", "Subtitle"};
-
- ASSERT( ( sizeof( aArr ) / sizeof( RES_POOL_COLLFMT_TYPE ) == 75 ),
- "Style-UEbersetzungstabelle hat falsche Groesse" );
- ASSERT( ( sizeof( stiName ) / sizeof( *stiName ) == 75 ),
- "Style-UEbersetzungstabelle hat falsche Groesse" );
-
- sal_uInt16 idcol = ::SwStyleNameMapper::GetPoolIdFromUIName( rName, eFlags );
- if (idcol==USHRT_MAX) //#i40770# user defined style names get lost
- return rName;
-
- for (size_t i = 0; i < sizeof( aArr ) / sizeof( *aArr ); i++)
- {
- if ( idcol == aArr[i] )
- {
- return rtl::OUString::createFromAscii(stiName[i]);
- }
- }
- return ::SwStyleNameMapper::GetProgName( idcol, String() );
-}
-
-void SwRTFWriter::OutRTFStyleTab()
-{
- USHORT n;
-
- // das 0-Style ist das Default, wird nie ausgegeben !!
- USHORT nArrLen = pDoc->GetTxtFmtColls()->Count();
- if( nArrLen <= 1 && pDoc->GetCharFmts()->Count() <= 1 )
- return;
-
- bOutStyleTab = TRUE;
- Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_STYLESHEET;
-
- // das Default-TextStyle wird nicht mit ausgegeben !!
- for( n = 1; n < nArrLen; ++n )
- {
- const SwTxtFmtColl* pColl = (*pDoc->GetTxtFmtColls())[ n ];
- pAttrSet = &pColl->GetAttrSet();
-
- Strm() << '{';
- // gebe Attribute aus
- OutRTF_SwFmt( *this, *pColl );
-
- if( pColl->DerivedFrom() )
- // suche die Id vom "Parent" Format
- for( USHORT nBasedOn=1; nBasedOn < nArrLen; nBasedOn++)
- if( (*pDoc->GetTxtFmtColls())[ nBasedOn ] ==
- pColl->DerivedFrom() )
- {
- // die Ableitung vom Format
- Strm() << OOO_STRING_SVTOOLS_RTF_SBASEDON;
- OutULong( nBasedOn );
- break;
- }
-
- if( pColl == &pColl->GetNextTxtFmtColl() )
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_SNEXT;
- OutULong( n );
- }
- else
- // suche die Id vom "Naechsten" Format
- for( USHORT nNext=1; nNext < nArrLen; nNext++)
- if( (*pDoc->GetTxtFmtColls())[ nNext ] ==
- &pColl->GetNextTxtFmtColl() )
- {
- // die Ableitung vom Format
- Strm() << OOO_STRING_SVTOOLS_RTF_SNEXT;
- OutULong( nNext );
- break;
- }
-
- //if( NO_NUMBERING != pColl->GetOutlineLevel() )//#outline level,zhaojianwei
- if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
- {
- Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL;
- //OutULong( pColl->GetOutlineLevel() ) << '}';//#outline level,zhaojianwei
- OutULong( pColl->GetAssignedOutlineStyleLevel() ) << '}';//<-end,zhaojianwei
- }
-
- Strm() << ' ';
- RTFOutFuncs::Out_String( Strm(), XlateFmtName( pColl->GetName(), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ), eDefaultEncoding,
- bWriteHelpFmt ) << ";}" << SwRTFWriter::sNewLine;
- }
-
- USHORT nChrArrLen = pDoc->GetCharFmts()->Count();
- for( n = 1; n < nChrArrLen; ++n )
- {
- const SwCharFmt* pFmt = (*pDoc->GetCharFmts())[ n ];
- pAttrSet = &pFmt->GetAttrSet();
-
- Strm() << '{';
- // gebe Attribute aus
- OutRTF_SwFmt( *this, *pFmt );
-
- if( pFmt->DerivedFrom() )
- // suche die Id vom "Parent" Format
- for( USHORT nBasedOn=1; nBasedOn < nChrArrLen; nBasedOn++)
- if( (*pDoc->GetCharFmts())[ nBasedOn ] ==
- pFmt->DerivedFrom() )
- {
- // die Ableitung vom Format
- Strm() << OOO_STRING_SVTOOLS_RTF_SBASEDON;
- OutULong( nArrLen + nBasedOn );
- break;
- }
-
- Strm() << ' ';
- RTFOutFuncs::Out_String( Strm(), XlateFmtName( pFmt->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ), eDefaultEncoding,
- bWriteHelpFmt ) << ";}" << SwRTFWriter::sNewLine;
- }
-
- Strm() << '}';
- bOutStyleTab = FALSE;
-}
-
-bool ExportAsInline(const SwFlyFrmFmt& rFlyFrmFmt)
-{
- //if not an inline element (hack in our limitations here as to only
- //graphics like this!!!!
- return rFlyFrmFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR;
-}
-
-void SwRTFWriter::OutRTFFlyFrms(const SwFlyFrmFmt& rFlyFrmFmt)
-{
- // ein FlyFrame wurde erkannt, gebe erstmal den aus
-
- // Hole vom Node und vom letzten Node die Position in der Section
- const SwFmtCntnt& rFlyCntnt = rFlyFrmFmt.GetCntnt();
-
- ULONG nStt = rFlyCntnt.GetCntntIdx()->GetIndex()+1;
- ULONG nEnd = pDoc->GetNodes()[ nStt - 1 ]->EndOfSectionIndex();
-
- if( nStt >= nEnd ) // kein Bereich, also kein gueltiger Node
- return;
-
- if (!ExportAsInline(rFlyFrmFmt))
- Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN;
- //If we are only exporting an inline graphic/object then we
- //only need the its pFlyFmt for the duration of exporting it
- //for floating objects its a little more complex at the moment
- const SwFlyFrmFmt *pOldFlyFmt = pFlyFmt;
- pFlyFmt = &rFlyFrmFmt;
-
- {
- RTFSaveData aSaveData( *this, nStt, nEnd );
- Out_SwDoc( pCurPam );
- }
-
- if (!ExportAsInline(rFlyFrmFmt))
- Strm() << OOO_STRING_SVTOOLS_RTF_PARD << SwRTFWriter::sNewLine;
-//#i46098#: else
- pFlyFmt = pOldFlyFmt;
-}
-
-
-
-void SwRTFWriter::OutRedline( xub_StrLen nCntntPos )
-{
- const SwRedline *pCurRedline = 0;
- USHORT nCount = pDoc->GetRedlineTbl().Count();
-
- if (nCurRedline < nCount)
- {
- pCurRedline = pDoc->GetRedlineTbl()[nCurRedline];
- if(pCurRedline)
- {
- const SwPosition* pStartPos = pCurRedline->Start();
- const SwPosition* pEndPos = pStartPos == pCurRedline->GetPoint()
- ? pCurRedline->GetMark()
- : pCurRedline->GetPoint();
-
- USHORT nStart = pStartPos->nContent.GetIndex();
- USHORT nEnd = pEndPos->nContent.GetIndex();
-
- ULONG nCurPam = pCurPam->GetPoint()->nNode.GetIndex();
- ULONG nStartIndex = pStartPos->nNode.GetIndex();
- ULONG nEndIndex = pEndPos->nNode.GetIndex();
- const String& rStr = pCurPam->GetNode()->GetTxtNode()->GetTxt();
- xub_StrLen nEnde = rStr.Len();
-
- bool bSpanRedline = (nCurPam >= nStartIndex) && (nCurPam <= nEndIndex) && (nStartIndex != nEndIndex);
-
- if ((bSpanRedline && nCntntPos == 0) ||
- (nStartIndex == nCurPam && nStart == nCntntPos))
- {
- // We are at the start of a redline just need to find out which type
- Strm() << '{';
- if(pCurRedline->GetType() == nsRedlineType_t::REDLINE_INSERT)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_REVISED;
- Strm() << OOO_STRING_SVTOOLS_RTF_REVAUTH;
- String sName = SW_MOD()->GetRedlineAuthor(pCurRedline->GetAuthor());
- OutLong( pRedlAuthors->AddName(sName) );
- Strm() << OOO_STRING_SVTOOLS_RTF_REVDTTM;
- OutLong( sw::ms::DateTime2DTTM(pCurRedline->GetTimeStamp()) );
- Strm() << ' ';
- }
- else if(pCurRedline->GetType() == nsRedlineType_t::REDLINE_DELETE)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_DELETED;
- Strm() << OOO_STRING_SVTOOLS_RTF_REVAUTHDEL;
- String sDelName = SW_MOD()->GetRedlineAuthor(pCurRedline->GetAuthor());
- OutLong( pRedlAuthors->AddName(sDelName) );
- Strm() << OOO_STRING_SVTOOLS_RTF_REVDTTMDEL;
- OutLong( sw::ms::DateTime2DTTM(pCurRedline->GetTimeStamp()) );
- Strm() << ' ';
- }
- }
-
- // this is either then of the end of the node or the end of the redline
- // time to close off this one
- if( (bSpanRedline && nCntntPos == nEnde) ||
- (nEndIndex == nCurPam && nEnd == nCntntPos) )
- {
- Strm() << '}';
- }
-
- // We have come to the end of a redline move to the next one
- // and use resursion to see if another redline starts here
- if (nEndIndex == nCurPam && nEnd == nCntntPos)
- {
- nCurRedline++;
- OutRedline(nCntntPos);
- }
- }
- }
-}
-
-void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos)
-{
- IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- if (-1 == nBkmkTabPos)
- return;
-
- const ::sw::mark::IMark* pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get();
- if(!pBookmark)
- return;
-
- const SwPosition* pStartPos = &pBookmark->GetMarkStart();
- const SwPosition* pEndPos = &pBookmark->GetMarkEnd();
-
- ASSERT(pStartPos && pEndPos, "Impossible");
- if (!(pStartPos && pEndPos))
- return;
-
- if (pStartPos->nNode.GetIndex() == pCurPam->GetPoint()->nNode.GetIndex() &&
- pStartPos->nContent.GetIndex() == nCntntPos)
- {
- // zur Zeit umspannt das SwBookmark keinen Bereich also kann
- // es hier vollstaendig ausgegeben werden.
-
- // erst die SWG spezifischen Daten:
- const ::sw::mark::IBookmark* const pAsBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark);
- if(pAsBookmark && (pAsBookmark->GetShortName().getLength() || pAsBookmark->GetKeyCode().GetCode()))
- {
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKKEY );
- OutULong( ( pAsBookmark->GetKeyCode().GetCode() |
- pAsBookmark->GetKeyCode().GetModifier() ));
- if( !pAsBookmark->GetShortName().getLength() )
- Strm() << " " ;
- else
- {
- Strm() << ' ';
- OutRTF_AsByteString( *this, pAsBookmark->GetShortName(), eDefaultEncoding );
- }
- Strm() << '}';
- }
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKSTART ) << ' ';
- RTFOutFuncs::Out_String( Strm(), pBookmark->GetName(),
- eDefaultEncoding, bWriteHelpFmt ) << '}';
- }
-
- if (pEndPos->nNode.GetIndex() == pCurPam->GetPoint()->nNode.GetIndex() &&
- pEndPos->nContent.GetIndex() == nCntntPos)
- {
- // zur Zeit umspannt das SwBookmark keinen Bereich also kann
- // es hier vollstaendig ausgegeben werden.
-
- // erst die SWG spezifischen Daten:
- const ::sw::mark::IBookmark* const pAsBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pBookmark);
- if(pAsBookmark && (pAsBookmark->GetShortName().getLength() || pAsBookmark->GetKeyCode().GetCode()))
- {
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKKEY );
- OutULong( ( pAsBookmark->GetKeyCode().GetCode() |
- pAsBookmark->GetKeyCode().GetModifier() ));
- if( !pAsBookmark->GetShortName().getLength() )
- Strm() << " " ;
- else
- {
- Strm() << ' ';
- OutRTF_AsByteString( *this, pAsBookmark->GetShortName(), eDefaultEncoding );
- }
- Strm() << '}';
- }
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' ';
-
- {
- ::rtl::OUString aEmpty;
- ::rtl::OUString & rBookmarkName = aEmpty;
-
- if (pAsBookmark)
- rBookmarkName = pAsBookmark->GetName();
-
- RTFOutFuncs::Out_String( Strm(), rBookmarkName,
- eDefaultEncoding, bWriteHelpFmt ) << '}';
- }
-
- if(++nBkmkTabPos >= pMarkAccess->getMarksCount())
- nBkmkTabPos = -1;
- else
- pBookmark = (pMarkAccess->getMarksBegin() + nBkmkTabPos)->get();
- }
-}
-
-void SwRTFWriter::OutFlyFrm()
-{
- USHORT n;
-
- if( !pFlyPos )
- return;
-
- // gebe alle freifliegenden Rahmen die sich auf den akt. Absatz
- // und evt. auf das aktuelle Zeichen beziehen, aus.
-
- // suche nach dem Anfang der FlyFrames
- for( n = 0; n < pFlyPos->Count() &&
- (*pFlyPos)[n]->GetNdIndex().GetIndex() <
- pCurPam->GetPoint()->nNode.GetIndex(); ++n )
- ;
- if( n < pFlyPos->Count() )
- while( n < pFlyPos->Count() &&
- pCurPam->GetPoint()->nNode.GetIndex() ==
- (*pFlyPos)[n]->GetNdIndex().GetIndex() )
- {
- // den Array-Iterator weiterschalten, damit nicht doppelt
- // ausgegeben wird !!
- OutRTFFlyFrms( (const SwFlyFrmFmt&)(*pFlyPos)[n++]->GetFmt() );
- }
-}
-
-
-USHORT SwRTFWriter::GetId( const Color& rColor ) const
-{
- ASSERT( pColTbl, "Where's color table?" );
- for( size_t n = 0; n < pColTbl->size(); n++ )
- if( rColor == (*pColTbl)[ n ] )
- return n;
-
- ASSERT( FALSE, "Color not exists in the pColTbl table" );
- return 0;
-}
-
-USHORT SwRTFWriter::GetId( const SvxFontItem& rFont ) const
-{
- const SfxItemPool& rPool = pDoc->GetAttrPool();
- const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr( RES_CHRATR_FONT );
- if( rFont == *pFont )
- return 0;
-
- USHORT n = 1;
- if( 0 != ( pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem(
- RES_CHRATR_FONT )))
- {
- if( rFont == *pFont )
- return 1;
- ++n;
- }
-
- sal_uInt32 nMaxItem = rPool.GetItemCount2( RES_CHRATR_FONT );
- for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet )
- if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2(
- RES_CHRATR_FONT, nGet )) )
- {
- if( rFont == *pFont )
- return n;
- ++n;
- }
-
- ASSERT( FALSE, "Font nicht in der Tabelle" );
- return 0;
-}
-
-USHORT SwRTFWriter::GetId( const Font& rFont ) const
-{
- return GetId( SvxFontItem( rFont.GetFamily(), rFont.GetName(),
- rFont.GetStyleName(), rFont.GetPitch(),
- rFont.GetCharSet(),
- RES_CHRATR_FONT ) );
-}
-
-USHORT SwRTFWriter::GetId( const SwTxtFmtColl& rColl ) const
-{
- // suche das angegebene Format
- const SvPtrarr & rArr = *pDoc->GetTxtFmtColls();
- for( USHORT n = 0; n < rArr.Count(); n++ )
- if( (SwTxtFmtColl*)rArr[ n ] == &rColl )
- return n;
- ASSERT( FALSE, "TextCollection nicht in der Tabelle" );
- return 0;
-}
-
-USHORT SwRTFWriter::GetId( const SwCharFmt& rFmt ) const
-{
- // suche das angegebene Format
- const SvPtrarr & rArr = *pDoc->GetCharFmts();
- for( USHORT n = 0; n < rArr.Count(); n++ )
- if( (SwCharFmt*)rArr[ n ] == &rFmt )
- return n + pDoc->GetTxtFmtColls()->Count();
- ASSERT( FALSE, "CharDFFormat nicht in der Tabelle" );
- return 0;
-}
-
-void SwRTFWriter::OutPageDesc()
-{
- // Ausgabe der Page-Descriptoren
- USHORT nSize = pDoc->GetPageDescCnt();
- if( !nSize )
- return;
-
- Strm() << SwRTFWriter::sNewLine; // ein Trenner
- bOutPageDesc = bOutPageDescTbl = TRUE;
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCTBL );
- for( USHORT n = 0; n < nSize; ++n )
- {
- const SwPageDesc& rPageDesc =
- const_cast<const SwDoc*>(pDoc)->GetPageDesc( n );
-
- Strm() << SwRTFWriter::sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC;
- OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE;
- OutULong( rPageDesc.ReadUseOn() );
-
- OutRTFPageDescription( rPageDesc, FALSE, FALSE );
-
- // suche den Folge-PageDescriptor:
- USHORT i = nSize;
- while( i )
- if( rPageDesc.GetFollow() ==
- &const_cast<const SwDoc *>(pDoc)->GetPageDesc( --i ) )
- break;
- Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT;
- OutULong( i ) << ' ';
- RTFOutFuncs::Out_String( Strm(), XlateFmtName( rPageDesc.GetName(), nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC ), eDefaultEncoding,
- bWriteHelpFmt ) << ";}";
- }
- Strm() << '}' << SwRTFWriter::sNewLine;
- bOutPageDesc = bOutPageDescTbl = FALSE;
-}
-
-void SwRTFWriter::OutRTFBorder(const SvxBorderLine* aLine, const USHORT nSpace )
-{
- // M.M. This function writes out border lines in RTF similar to what
- // WW8_BRC SwWW8Writer::TranslateBorderLine does in the winword filter
- // Eventually it would be nice if all this functionality was in the one place
- int nDistance = aLine->GetDistance();
- int nOutWidth = aLine->GetOutWidth();
- int nInWidth = aLine->GetInWidth();
- int nWidth = aLine->GetOutWidth();
-
- if(nDistance == 0) // Single Line
- Strm() << OOO_STRING_SVTOOLS_RTF_BRDRS;
- else // Double Line
- {
- if(nOutWidth == nInWidth)
- Strm() << OOO_STRING_SVTOOLS_RTF_BRDRDB;
- else if (nOutWidth > nInWidth)
- Strm() << OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG;
- else if (nOutWidth < nInWidth)
- Strm() << OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG;
- }
- Strm() << OOO_STRING_SVTOOLS_RTF_BRDRW;
- OutULong(nWidth);
-
- Strm() << OOO_STRING_SVTOOLS_RTF_BRSP;
- OutULong(nSpace);
-}
-
-void SwRTFWriter::OutRTFBorders(SvxBoxItem aBox)
-{
- const SvxBorderLine *pLine = aBox.GetTop();
- if(pLine)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRT;
- OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_TOP));
- }
-
- pLine = aBox.GetBottom();
- if(pLine)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRB;
- OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_BOTTOM));
- }
-
- pLine = aBox.GetRight();
- if(pLine)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRR;
- OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_LEFT));
- }
-
- pLine = aBox.GetLeft();
- if(pLine)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_PGBRDRL;
- OutRTFBorder(pLine, aBox.GetDistance(BOX_LINE_RIGHT));
- }
-}
-
-void SwRTFWriter::OutRTFPageDescription( const SwPageDesc& rPgDsc,
- BOOL bWriteReset,
- BOOL bCheckForFirstPage )
-{
- // jetzt noch den Teil fuer alle anderen Applikationen:
- const SwPageDesc *pSave = pAktPageDesc;
- bool bOldOut = bOutPageDesc;
- bool bOldHDFT = bOutLeftHeadFoot;
-
- // falls es einen Follow gibt,
- pAktPageDesc = &rPgDsc;
- if( bCheckForFirstPage && pAktPageDesc->GetFollow() &&
- pAktPageDesc->GetFollow() != pAktPageDesc )
- pAktPageDesc = pAktPageDesc->GetFollow();
-
- bOutPageDesc = TRUE;
- bOutLeftHeadFoot = FALSE;
-
- if( bWriteReset )
- {
- if( bFirstLine && bWriteAll &&
- pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode )
- Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE;
- else
- Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD;
- }
-
- if( pAktPageDesc->GetLandscape() )
- Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN;
-
- const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft();
- OutRTF_SwFmt( *this, *pFmt );
-
- SvxBoxItem aBox = pFmt->GetAttrSet().GetBox();
- OutRTFBorders(pFmt->GetAttrSet().GetBox());
-
- // falls es gesharte Heaer/Footer gibt, so gebe diese auch noch aus
- if (
- (nsUseOnPage::PD_MIRROR & pAktPageDesc->GetUseOn()) &&
- (!pAktPageDesc->IsFooterShared() || !pAktPageDesc->IsHeaderShared())
- )
- {
- bOutLeftHeadFoot = TRUE;
- const SfxPoolItem* pHt;
- if( !pAktPageDesc->IsHeaderShared() &&
- SFX_ITEM_SET == pAktPageDesc->GetLeft().GetAttrSet().
- GetItemState( RES_HEADER, FALSE, &pHt ))
- OutRTF_SwFmtHeader( *this, *pHt );
-
- if( !pAktPageDesc->IsFooterShared() &&
- SFX_ITEM_SET == pAktPageDesc->GetLeft().GetAttrSet().
- GetItemState( RES_FOOTER, FALSE, &pHt ))
- OutRTF_SwFmtFooter( *this, *pHt );
- bOutLeftHeadFoot = FALSE;
- }
-
- if( pAktPageDesc != &rPgDsc )
- {
- pAktPageDesc = &rPgDsc;
- Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG;
-
- // die Header/Footer der 1. Seite ausgeben
- const SfxPoolItem* pHt;
- if( SFX_ITEM_SET == pAktPageDesc->GetMaster().GetAttrSet().
- GetItemState( RES_HEADER, FALSE, &pHt ))
- OutRTF_SwFmtHeader( *this, *pHt );
-
- if( SFX_ITEM_SET == pAktPageDesc->GetMaster().GetAttrSet().
- GetItemState( RES_FOOTER, FALSE, &pHt ))
- OutRTF_SwFmtFooter( *this, *pHt );
- }
-
- pAktPageDesc = pSave;
- bOutPageDesc = bOldOut;
- bOutLeftHeadFoot = bOldHDFT;
-}
-
-BOOL SwRTFWriter::OutBreaks( const SfxItemSet& rSet )
-{
- // dann nie Seitenumbrueche ausgeben
- BOOL bPgDscWrite = FALSE;
-
- if( !bOutOutlineOnly && bOutPageAttr && !bIgnoreNextPgBreak)
- {
- const SfxPoolItem *pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( RES_PAGEDESC, TRUE, &pItem )
- && ((SwFmtPageDesc*)pItem)->GetPageDesc() )
- {
- const SwFmtPageDesc& rPgDsc = *(SwFmtPageDesc*)pItem;
- for( USHORT nPos = pDoc->GetPageDescCnt(); nPos; )
- if( &const_cast<const SwDoc *>(pDoc)
- ->GetPageDesc( --nPos ) == rPgDsc.GetPageDesc() )
- {
- pAktPageDesc = ((SwFmtPageDesc*)pItem)->GetPageDesc();
- // FALSE wegen schliessender Klammer !!
- OutComment( *this, OOO_STRING_SVTOOLS_RTF_PGDSCNO, FALSE );
- OutULong( nPos ) << '}';
-
- // nicht weiter, in Styles gibts keine SectionControls !!
- if( !bOutStyleTab )
- OutRTFPageDescription( *rPgDsc.GetPageDesc(),
- TRUE, TRUE );
- bPgDscWrite = TRUE;
- break;
- }
- }
- else if( SFX_ITEM_SET == rSet.GetItemState( RES_BREAK, TRUE, &pItem ) )
- {
- const SvxFmtBreakItem &rBreak = *(SvxFmtBreakItem*)pItem;
- if( bWriteHelpFmt )
- {
- if( SVX_BREAK_PAGE_BEFORE == rBreak.GetBreak() ||
- SVX_BREAK_PAGE_AFTER == rBreak.GetBreak() ||
- SVX_BREAK_PAGE_BOTH == rBreak.GetBreak() )
- {
- bOutFmtAttr = true;
- Strm() << OOO_STRING_SVTOOLS_RTF_PAGE;
- }
- }
- else
- {
- switch( rBreak.GetBreak() )
- {
- case SVX_BREAK_COLUMN_BEFORE:
- case SVX_BREAK_COLUMN_AFTER:
- case SVX_BREAK_COLUMN_BOTH:
- break;
- case SVX_BREAK_PAGE_BEFORE:
- bOutFmtAttr = true;
- Strm() << OOO_STRING_SVTOOLS_RTF_PAGE;
- break;
- case SVX_BREAK_PAGE_AFTER:
- OutComment(*this, OOO_STRING_SVTOOLS_RTF_PGBRK, false) << "0}";
- break;
- case SVX_BREAK_PAGE_BOTH:
- OutComment(*this, OOO_STRING_SVTOOLS_RTF_PGBRK, false) << "1}";
- break;
- default:
- break;
- }
- }
- }
- }
- bIgnoreNextPgBreak = false;
- return bPgDscWrite;
-}
-
-
-void SwRTFWriter::CheckEndNodeForSection( const SwNode& rNd )
-{
- const SwSectionNode* pSectNd = rNd.StartOfSectionNode()->GetSectionNode();
- if( pSectNd /*&& CONTENT_SECTION == pSectNd->GetSection().GetType()*/ )
- {
- const SwSectionFmt* pSectFmt = pSectNd->GetSection().GetFmt();
-
- // diese Section hatte den akt. Abschnitt bestimmt
- // wer bestimmt den nachsten??
- SwNodeIndex aIdx( rNd, 1 );
- pSectNd = aIdx.GetNode().GetSectionNode();
- if( !( ( pSectNd || (aIdx.GetNode().IsEndNode() &&
- 0 != ( pSectNd = aIdx.GetNode().StartOfSectionNode()->GetSectionNode() )) )
- /*&& CONTENT_SECTION == pSectNd->GetSection().GetType()*/ ))
- {
- // wer bestimmt denn nun den neuen Abschnitt?
- // PageDesc oder eine uebergeordnete Section?
- SwSection* pParent = pSectFmt->GetParentSection();
-// while( pParent /*&& CONTENT_SECTION != pParent->GetType()*/ )
-// pParent = pParent->GetParent();
-
- if( pParent /*&& CONTENT_SECTION == pParent->GetType()*/ )
- OutRTF_SwSectionNode( *this, *pParent->
- GetFmt()->GetSectionNode( TRUE ) );
- else
- {
- if (! bOutPageDesc)
- {
- Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE;
- OutRTFPageDescription( ( pAktPageDesc
- ? *pAktPageDesc
- : const_cast<const SwDoc *>(pDoc)
- ->GetPageDesc(0) ),
- FALSE, TRUE );
- Strm() << SwRTFWriter::sNewLine;
- }
- }
- }
- // else
- // weiter machen, der naechste definiert den neuen Abschnitt
- }
-}
-
-// Struktur speichert die aktuellen Daten des Writers zwischen, um
-// einen anderen Dokument-Teil auszugeben, wie z.B. Header/Footer
-RTFSaveData::RTFSaveData( SwRTFWriter& rWriter, ULONG nStt, ULONG nEnd )
- : rWrt( rWriter ),
- pOldPam( rWrt.pCurPam ), pOldEnd( rWrt.GetEndPaM() ),
- pOldFlyFmt( rWrt.pFlyFmt ), pOldPageDesc( rWrt.pAktPageDesc ),
- pOldAttrSet( rWrt.GetAttrSet() )
-{
- bOldWriteAll = rWrt.bWriteAll;
- bOldOutTable = rWrt.bOutTable;
- bOldOutPageAttr = rWrt.bOutPageAttr;
- bOldAutoAttrSet = rWrt.bAutoAttrSet;
- bOldOutSection = rWrt.bOutSection;
-
- rWrt.pCurPam = rWrt.NewSwPaM( *rWrt.pDoc, nStt, nEnd );
-
- // Tabelle in Sonderbereichen erkennen
- if( nStt != rWrt.pCurPam->GetMark()->nNode.GetIndex() &&
- rWrt.pDoc->GetNodes()[ nStt ]->IsTableNode() )
- rWrt.pCurPam->GetMark()->nNode = nStt;
-
- rWrt.SetEndPaM( rWrt.pCurPam );
- rWrt.pCurPam->Exchange( );
- rWrt.bWriteAll = TRUE;
- rWrt.bOutTable = FALSE;
- rWrt.bOutPageAttr = FALSE;
- rWrt.SetAttrSet( 0 );
- rWrt.bAutoAttrSet = FALSE;
- rWrt.bOutSection = FALSE;
-}
-
-
-RTFSaveData::~RTFSaveData()
-{
- delete rWrt.pCurPam; // Pam wieder loeschen
-
- rWrt.pCurPam = pOldPam;
- rWrt.SetEndPaM( pOldEnd );
- rWrt.bWriteAll = bOldWriteAll;
- rWrt.bOutTable = bOldOutTable;
- rWrt.pFlyFmt = pOldFlyFmt;
- rWrt.pAktPageDesc = pOldPageDesc;
- rWrt.SetAttrSet( pOldAttrSet );
- rWrt.bAutoAttrSet = bOldAutoAttrSet;
- rWrt.bOutPageAttr = bOldOutPageAttr;
- rWrt.bOutSection = bOldOutSection;
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF( const String& rFltName, const String& rBaseURL, WriterRef& xRet )
-{
- xRet = new SwRTFWriter( rFltName, rBaseURL );
-}
-
-short SwRTFWriter::GetCurrentPageDirection() const
-{
- const SwFrmFmt &rFmt = pAktPageDesc
- ? pAktPageDesc->GetMaster()
- : const_cast<const SwDoc *>(pDoc)
- ->GetPageDesc(0).GetMaster();
- const SvxFrameDirectionItem* pItem = &rFmt.GetFrmDir();
-
- if (!pItem)
- {
- pItem = (const SvxFrameDirectionItem*)
- &pDoc->GetAttrPool().GetDefaultItem(RES_FRAMEDIR);
- }
- return pItem->GetValue();
-}
-
-short SwRTFWriter::TrueFrameDirection(const SwFrmFmt &rFlyFmt) const
-{
- const SwFrmFmt *pFlyFmt2 = &rFlyFmt;
- const SvxFrameDirectionItem* pItem = 0;
- while (pFlyFmt2)
- {
- pItem = &pFlyFmt2->GetFrmDir();
- if (FRMDIR_ENVIRONMENT == pItem->GetValue())
- {
- pItem = 0;
- const SwFmtAnchor* pAnchor = &pFlyFmt2->GetAnchor();
- if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) &&
- pAnchor->GetCntntAnchor() )
- {
- pFlyFmt2 = pAnchor->GetCntntAnchor()->nNode.
- GetNode().GetFlyFmt();
- }
- else
- pFlyFmt2 = 0;
- }
- else
- pFlyFmt2 = 0;
- }
-
- short nRet;
- if (pItem)
- nRet = pItem->GetValue();
- else
- nRet = GetCurrentPageDirection();
-
- ASSERT(nRet != FRMDIR_ENVIRONMENT, "leaving with environment direction");
- return nRet;
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/rtf/wrtrtf.hxx b/sw/source/filter/rtf/wrtrtf.hxx
deleted file mode 100644
index 737a3164b95a..000000000000
--- a/sw/source/filter/rtf/wrtrtf.hxx
+++ /dev/null
@@ -1,254 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _WRTRTF_HXX
-#define _WRTRTF_HXX
-
-#include <shellio.hxx>
-#include <wrt_fn.hxx>
-#include "../inc/msfilter.hxx"
-#include <deque>
-
-#include <com/sun/star/util/DateTime.hpp>
-
-// einige Forward Deklarationen
-class Color;
-class Font;
-class SvPtrarr;
-class SwFmt;
-class SwFlyFrmFmt;
-class SwPosFlyFrms;
-class SwPageDesc;
-class SwTableNode;
-class SwTxtFmtColl;
-class SwNumRule;
-class SwNumRuleTbl;
-class DateTime;
-class RTFEndPosLst;
-class SvxBorderLine;
-
-extern SwAttrFnTab aRTFAttrFnTab;
-extern SwNodeFnTab aRTFNodeFnTab;
-
-// the default text encoding for the export, if it doesn't fit unicode will
-// be used
-#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US
-
-typedef std::deque<Color> RTFColorTbl;
-
-class RTF_WrtRedlineAuthor : public sw::util::WrtRedlineAuthor
-{
- public:
- virtual void Write(Writer &rWrt);
-};
-
-// der RTF-Writer
-
-class SwRTFWriter : public Writer
-{
- friend class RTFEndPosLst;
-
- SvPtrarr* pFontRemoveLst;
- RTFColorTbl* pColTbl;
- SwPosFlyFrms* pFlyPos; // Pointer auf die aktuelle "FlyFrmTabelle"
- RTFEndPosLst* pCurEndPosLst;
- const SfxItemSet* pAttrSet; // akt. Format/Collection vom Node
- // fuer den Zugriff auf einige Attribute
- // z.B. Font-Size, LR-Space,..
- SwNumRuleTbl* pNumRuleTbl; // list of all exported numrules
- RTF_WrtRedlineAuthor *pRedlAuthors;
-
- USHORT nAktFlyPos; // Index auf das naechste "FlyFrmFmt"
- void OutRTFColorTab();
- void OutRTFFontTab();
- const rtl::OUString XlateFmtName( const rtl::OUString &rName, SwGetPoolIdFromName eFlags );
- void OutRTFStyleTab();
- void OutRTFListTab();
- bool OutRTFRevTab();
-
- void MakeHeader();
- void OutUnicodeSafeRecord(const sal_Char *pToken,
- const String &rContent);
- void OutDocInfoStat();
- void OutInfoDateTime( const sal_Char*,
- const ::com::sun::star::util::DateTime& );
- void CheckEndNodeForSection( const SwNode& rNd );
-
- void BuildNumRuleTbl();
-
-
-
-public:
- // --- public Member --------------------------------------------------
-
- USHORT nCurRedline;
-
-
- const SwFlyFrmFmt* pFlyFmt; // liegt der Node in einem FlyFrame,
- // ist das Format gesetzt, sonst 0
- const SwPageDesc* pAktPageDesc; // aktuell gesetzter PageDesc.
- sal_Int32 nBkmkTabPos; // akt. Position in der Bookmark-Tabelle
- USHORT nCurScript; // actual scripttype
- rtl_TextEncoding eDefaultEncoding;
- rtl_TextEncoding eCurrentEncoding;
-
-#if defined(UNX)
- static const sal_Char sNewLine; // nur \012 oder \015
-#else
- static const sal_Char __FAR_DATA sNewLine[]; // \015\012
-#endif
-
-
- BOOL bFirstLine : 1; // wird die 1. Zeile ausgegeben ?
- BOOL bOutFmtAttr : 1; // TRUE: beim Schreiben eines Formates
- // existierte mindestens ein Attribut
- BOOL bRTFFlySyntax : 1; // gebe nur original RTFSyntax aus
- // (nur fuer die fliegenden Rahmen)
- BOOL bOutPageDesc: 1; // gebe einen PageDescriptor aus
- BOOL bOutPageDescTbl: 1; // gebe die PageDescriptor-Tabelle aus
- BOOL bOutTable : 1; // gebe eine Tabelle aus
- BOOL bTxtAttr : 1; // werden TextAttribute ausgegeben ?
- BOOL bWriteHelpFmt : 1; // schreibe Win-RTF-HelpFileFmt
- BOOL bOutStyleTab : 1; // gebe die StyleSheet-Tabelle aus
- BOOL bOutPageAttr : 1; // PageDescAttribut ausgeben?
- BOOL bAutoAttrSet : 1; // TRUE: pAttrSet ist harte Attributierung
- // FALSE: pAttrSet ist vom Format/Collection
- BOOL bOutOutlineOnly : 1; // TRUE: nur Gliederungs-Absaetze schreiben
- BOOL bOutListNumTxt : 1; // TRUE: der ListNumText wird ausgegeben
- BOOL bOutLeftHeadFoot : 1; // gebe vom PageDesc. den linkten
- // Header/Footer aus
- BOOL bOutSection : 1; // TRUE: Section PageDesc ausgeben
- BOOL bIgnoreNextPgBreak : 1; // TRUE: naechsten PageDesc/Break ignorieren
- BOOL bAssociated : 1; // use associated tokens
-
- BOOL bNonStandard : 1; // use non-standard tags (for cut and paste)
-
- // --- public Methoden ------------------------------------------------
-
- SwRTFWriter( const String& rFilterName, const String& rBaseURL );
- virtual ~SwRTFWriter();
- virtual ULONG WriteStream();
-
- void Out_SwDoc( SwPaM* ); // schreibe den makierten Bereich
-
- // gebe die evt. an der akt. Position stehenden FlyFrame aus.
- void OutFlyFrm();
- void OutRTFFlyFrms( const SwFlyFrmFmt& );
- // gebe alle an der Position stehenden Bookmarks aus
- void OutBookmarks( xub_StrLen nCntntPos );
- // gebe die PageDesc-Daten im normalen RTF-Format aus
- void OutRTFPageDescription( const SwPageDesc&, BOOL , BOOL );
- void OutRTFBorders( SvxBoxItem aBox );
- void OutRTFBorder( const SvxBorderLine* aLine, const USHORT nSpace );
- BOOL OutBreaks( const SfxItemSet& rSet );
- void OutRedline( xub_StrLen nCntntPos );
-
- // gebe die PageDescriptoren aus
- USHORT GetId( const Color& ) const;
- USHORT GetId( const SvxFontItem& ) const;
- USHORT GetId( const Font& ) const;
- USHORT GetId( const SwTxtFmtColl& ) const;
- USHORT GetId( const SwCharFmt& ) const;
- USHORT GetId( const SwNumRuleItem& rItem ) const;
-
- void OutPageDesc();
-
- BOOL OutListNum( const SwTxtNode& rNd );
- USHORT GetNumRuleId( const SwNumRule& rRule );
-
- // fuer RTFSaveData
- SwPaM* GetEndPaM() { return pOrigPam; }
- void SetEndPaM( SwPaM* pPam ) { pOrigPam = pPam; }
-
- const SfxPoolItem& GetItem( USHORT nWhich ) const;
-
- const SfxItemSet* GetAttrSet() const { return pAttrSet; }
- void SetAttrSet( const SfxItemSet* p ) { pAttrSet = p; }
-
- const RTFEndPosLst* GetEndPosLst() const { return pCurEndPosLst; }
-
- void SetAssociatedFlag( BOOL b ) { bAssociated = b; }
- BOOL IsAssociatedFlag() const { return bAssociated; }
-
- void SetCurrScriptType( USHORT n ) { nCurScript = n; }
- USHORT GetCurrScriptType() const { return nCurScript; }
-
- short TrueFrameDirection(const SwFrmFmt &rFlyFmt) const;
- short GetCurrentPageDirection() const;
-};
-
-
-// Struktur speichert die aktuellen Daten des Writers zwischen, um
-// einen anderen Dokument-Teil auszugeben, wie z.B. Header/Footer
-// Mit den beiden USHORTs im CTOR wird ein neuer PaM erzeugt und auf
-// die Position im Dokument gesetzt.
-// Im Destructor werden alle Daten wieder restauriert und der angelegte
-// Pam wieder geloescht.
-
-struct RTFSaveData
-{
- SwRTFWriter& rWrt;
- SwPaM* pOldPam, *pOldEnd;
- const SwFlyFrmFmt* pOldFlyFmt;
- const SwPageDesc* pOldPageDesc;
- const SfxItemSet* pOldAttrSet; // akt. Attribute vom Node
-
- BOOL bOldWriteAll : 1;
- BOOL bOldOutTable : 1;
- BOOL bOldOutPageAttr : 1;
- BOOL bOldAutoAttrSet : 1;
- BOOL bOldOutSection : 1;
-
- RTFSaveData( SwRTFWriter&, ULONG nStt, ULONG nEnd );
- ~RTFSaveData();
-};
-
-
-// einige Funktions-Deklarationen
-Writer& OutRTF_AsByteString( Writer& rWrt, const String& rStr, rtl_TextEncoding eEncoding);
-Writer& OutRTF_SwFmt( Writer& rWrt, const SwFmt& );
-Writer& OutRTF_SwTblNode(Writer& , const SwTableNode&);
-Writer& OutRTF_SwSectionNode( Writer& , SwSectionNode & );
-
-
-// Augabe von RTF-Bitmaps (steht im File "wrtpict.cxx")
-//struct SvxRTFPictureType;
-//class Bitmap;
-//USHORT WriteRTFPict( const SwPictureType&, Bitmap&, SvStream& );
-
-// Ausagbe von Footer-/Headers
-Writer& OutRTF_SwFmtHeader( Writer& , const SfxPoolItem& );
-Writer& OutRTF_SwFmtFooter( Writer& , const SfxPoolItem& );
-
-// Kommentar und zusaetzlichen String ausgeben
-SvStream& OutComment( Writer& rWrt, const sal_Char* pStr );
- // zusaetzlich das bOutFmtAttr-Flag manipulieren
-SvStream& OutComment( Writer& rWrt, const sal_Char* pStr, BOOL bSetFlag );
-bool ExportAsInline(const SwFlyFrmFmt& rFlyFrmFmt);
-
-#endif // _WRTRTF_HXX
-
-
diff --git a/sw/source/filter/ww8/README-rtf.txt b/sw/source/filter/ww8/README-rtf.txt
new file mode 100644
index 000000000000..2ae4872311b6
--- /dev/null
+++ b/sw/source/filter/ww8/README-rtf.txt
@@ -0,0 +1,227 @@
+
+---------------------------------------------------------------------
+
+Summary of new features in RtfExport
+
+---------------------------------------------------------------------
+
+Miklos Vajna
+
+<vmiklos@frugalware.org>
+---------------------------------------------------------------------
+
+Table of Contents
+
+1. Introduction
+
+ 1.1. Terminology
+ 1.2. General
+
+2. List if fixed bugs
+3. List of new features
+
+ 3.1. Nested tables
+ 3.2. Character properties
+ 3.3. Sections
+ 3.4. Graphics
+ 3.5. Bookmarks
+ 3.6. Fields
+ 3.7. Drawing
+ 3.8. Form fields
+ 3.9. OLE objects
+
+4. Changes in the source code outside RTF
+
+
+---------------------------------------------------------------------
+
+1. Introduction
+
+---------------------------------------------------------------------
+
+The biggest difference is that the new exporter is an UNO component,
+and it?s based on the MSWord base classes, the vision here is that
+this way much less code can achieve the same set of features,
+reducing the amount of duplicated code.
+
+
+1.1. Terminology
+
+--------------
+
+ * The "MSO OK, OOo KO" and similar abbreviations describe if the
+ given new feature is supported by the OOo RTF importer or it can
+ be tested using Microsoft Office.
+ * RtfExport refers to the new UNO-based exporter, RtfWriter refers
+ to the old built-in one.
+
+
+1.2. General
+
+--------------
+
+RtfWriter sometimes created documents where the first { is closed in
+the middle of the document. MSO ignores this problem, but OOo stops
+parsing the rest of the document if this happens, in other words
+everything after such a bug is ignored. This can be reproduced by for
+example parprops.odt, but it?s triggered in several other cases as
+well. RtfExport has no automatic prevention for this, either - but
+during development I primarily test the output with OOo, so hopefully
+the bug will pop up less frequently.
+
+
+---------------------------------------------------------------------
+
+2. List if fixed bugs
+
+---------------------------------------------------------------------
+
+ * http://www.openoffice.org/issues/show_bug.cgi?id=51469 postit
+ fields
+ * http://www.openoffice.org/issues/show_bug.cgi?id=66619 page
+ margins
+ * http://www.openoffice.org/issues/show_bug.cgi?id=69856 page
+ numbers
+ * http://www.openoffice.org/issues/show_bug.cgi?id=81569 { and } in
+ document title
+ * http://www.openoffice.org/issues/show_bug.cgi?id=84703 redlines
+ * http://www.openoffice.org/issues/show_bug.cgi?id=91166 russian
+ chars
+ * http://www.openoffice.org/issues/show_bug.cgi?id=92673 bookmarks
+ across tables
+ * http://www.openoffice.org/issues/show_bug.cgi?id=100507 ole
+ object export
+ * http://www.openoffice.org/issues/show_bug.cgi?id=103993 same as #
+ 81569 just for doc comments
+ * http://www.openoffice.org/issues/show_bug.cgi?id=106677
+ listoverride index starts at zero
+ * http://www.openoffice.org/issues/show_bug.cgi?id=38344 enhanced
+ character space
+
+
+---------------------------------------------------------------------
+
+3. List of new features
+
+---------------------------------------------------------------------
+
+
+3.1. Nested tables
+
+--------------
+
+This was new in Word2000 and it?s now supported by RtfExport (MSO OK,
+OOo KO)
+
+
+3.2. Character properties
+
+--------------
+
+The followings are now supported:
+
+ * blinking (MSO OK, OOo KO)
+ * expanded spacing (MSO OK, OOo OK)
+ * pair kerning (MSO OK, OOo OK)
+
+
+3.3. Sections
+
+--------------
+
+RtfExport writes:
+
+ * column breaks (MSO OK, OOo OK)
+ * special breaks (when the next page should be an odd or an even
+ page; MSO OK, OOo KO)
+ * the write-protected property of sections is experted properly
+ (MSO OK, OOo KO)
+ * better page numbers (inherited type from page styles, restarts;
+ MSO OK, OOo KO)
+ * line numbering (MSO OK, OOo KO)
+
+
+3.4. Graphics
+
+--------------
+
+PNG graphics are exported in WMF format as well, so that not only MSO
+and OOo can display graphics from the output document, but Wordpad as
+well.
+
+
+3.5. Bookmarks
+
+--------------
+
+Implicit bookmarks like reference to a footnote did not work in OOo
+(one got an Error: Reference source not found message when opening
+the result), this now works as expected. (MSO OK - the importer
+previously autocorrected this as well, OO OK)
+
+
+3.6. Fields
+
+--------------
+
+ * Table of contents is now written as a field, so it?s properly
+ read-only (MSO OK, OOo KO)
+ * Postit comments are now exported. (MSO OK, OOo KO)
+
+
+3.7. Drawing
+
+--------------
+
+Drawing objects for Word 97 through Word 2007 (shapes) are now
+implemented:
+
+ * basic shapes (rectangle, ellipse, etc.)
+ * lines, including free-form ones
+ * texts, including vertical ones and their (paragraph and
+ character) formatting
+
+(MSO OK, OOo KO)
+
+
+3.8. Form fields
+
+--------------
+
+All types supported by the RTF format are exported, namely:
+
+ * text boxes
+ * check boxes
+ * list boxes
+
+(MSO OK, OOo KO)
+
+
+3.9. OLE objects
+
+--------------
+
+Their result is exported as a picture - RtfWriter did not export
+anything. (MSO OK, OOo OK)
+
+For math, the native data is written as well, so you can edit the
+object, too. (MSO OK, OOo KO)
+
+
+---------------------------------------------------------------------
+
+4. Changes in the source code outside RTF
+
+---------------------------------------------------------------------
+
+These are refactorings I needed for RTF. To my best knowledge they do
+not change the output of other filters from a user?s point of view.
+
+ * The code that splits runs according to bookmarks is moved from
+ DocxExport to MSWordExportBase
+ * WW8_SdrAttrIter has been refactored to MSWord_SdrAttrIter
+ * MSWordExportBase::SubstituteBullet can avoid replacing bullets
+ * wwFontHelper::InitFontTable can really load all fonts
+ * An obvious typo in WW8AttributeOutput::CharTwoLines has been
+ fixed
+
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 0962edd65085..35c126cd6571 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -116,131 +116,6 @@ bool DocxExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich )
return true;
}
-bool DocxExport::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt,
- xub_StrLen nEnd, IMarkVector& rArr )
-{
- IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- ULONG nNd = rNd.GetIndex( );
-
- const sal_Int32 nMarks = pMarkAccess->getMarksCount();
- for ( sal_Int32 i = 0; i < nMarks; i++ )
- {
- IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get();
-
- // Only keep the bookmarks starting or ending in this node
- if ( pMark->GetMarkStart().nNode == nNd ||
- pMark->GetMarkEnd().nNode == nNd )
- {
- xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex();
- xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex();
-
- // Keep only the bookmars starting or ending in the snippet
- bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd );
- bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
-
- if ( bIsStartOk || bIsEndOk )
- rArr.push_back( pMark );
- }
- }
- return ( rArr.size() > 0 );
-}
-
-class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool >
-{
-public:
- inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const
- {
- xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex();
- xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex();
-
- return nOEnd < nTEnd;
- }
-};
-
-bool DocxExport::NearestBookmark( xub_StrLen& rNearest )
-{
- bool bHasBookmark = false;
-
- if ( m_rSortedMarksStart.size( ) > 0 )
- {
- IMark* pMarkStart = m_rSortedMarksStart.front();
- rNearest = pMarkStart->GetMarkStart().nContent.GetIndex();
- bHasBookmark = true;
- }
-
- if ( m_rSortedMarksEnd.size( ) > 0 )
- {
- IMark* pMarkEnd = m_rSortedMarksEnd[0];
- if ( !bHasBookmark )
- rNearest = pMarkEnd->GetMarkEnd().nContent.GetIndex();
- else
- rNearest = std::min( rNearest, pMarkEnd->GetMarkEnd().nContent.GetIndex() );
- bHasBookmark = true;
- }
-
- return bHasBookmark;
-}
-
-xub_StrLen DocxExport::GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
-{
- // Get the bookmarks for the normal run
- xub_StrLen nNextPos = MSWordExportBase::GetNextPos( pAttrIter, rNode, nAktPos );
-
- GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
-
- xub_StrLen nNextBookmark = nNextPos;
- NearestBookmark( nNextPos );
-
- return std::min( nNextPos, nNextBookmark );
-}
-
-void DocxExport::UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd )
-{
- xub_StrLen nNextPos;
-
- // either no bookmark, or it is not at the current position
- if ( !NearestBookmark( nNextPos ) || nNextPos > nAktPos )
- {
- MSWordExportBase::UpdatePosition( pAttrIter, nAktPos, nEnd );
- }
-}
-
-void DocxExport::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
-{
- IMarkVector aMarksStart;
- if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) )
- {
- IMarkVector aSortedEnd;
- IMarkVector aSortedStart;
- for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end();
- it < end; ++it )
- {
- IMark* pMark = (*it);
-
- // Remove the positions egals to the current pos
- xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex();
- xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex();
-
- if ( nStart > nAktPos )
- aSortedStart.push_back( pMark );
-
- if ( nEnd > nAktPos )
- aSortedEnd.push_back( pMark );
- }
-
- // Sort the bookmarks by end position
- std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() );
-
- m_rSortedMarksStart.swap( aSortedStart );
- m_rSortedMarksEnd.swap( aSortedEnd );
- }
- else
- {
- m_rSortedMarksStart.clear( );
- m_rSortedMarksEnd.clear( );
- }
-}
-
void DocxExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
{
std::vector< OUString > aStarts;
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 4bb9070c3c93..7d20a1da6969 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -76,11 +76,6 @@ class DocxExport : public MSWordExportBase
/// Footer counter.
sal_Int32 m_nFooters;
- /// Used to split the runs according to the bookmarks start and ends
- typedef std::vector< ::sw::mark::IMark* > IMarkVector;
- IMarkVector m_rSortedMarksStart;
- IMarkVector m_rSortedMarksEnd;
-
/// Exporter of the VML shapes.
oox::vml::VMLExport *m_pVMLExport;
@@ -162,24 +157,7 @@ protected:
const SwFmtPageDesc* pNewPgDescFmt = 0,
const SwPageDesc* pNewPgDesc = 0 );
- /// Get the next position in the text node to output
- virtual xub_StrLen GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos );
-
- /// Update the information for GetNextPos().
- virtual void UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd );
-
private:
- /// Find the nearest bookmark from the current position.
- ///
- /// Returns false when there is no bookmark.
- bool NearestBookmark( xub_StrLen& rNearest );
-
- void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos,
- xub_StrLen nLen );
-
- bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd,
- IMarkVector& rArr );
-
/// Setup pStyles and write styles.xml
void InitStyles();
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 0da676da99a1..224f60ef6163 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -26,6 +26,8 @@
************************************************************************/
#include "docxexportfilter.hxx"
+#include "rtfexportfilter.hxx"
+#include "rtfimportfilter.hxx"
#include "docxexport.hxx"
#include <docsh.hxx>
@@ -133,6 +135,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
{
+ OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName);
uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0;
@@ -145,6 +148,22 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplN
DocxExport_getImplementationName(),
DocxExport_createInstance,
DocxExport_getSupportedServiceNames() ) );
+ } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) {
+ const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ RtfExport_getImplementationName(),
+ RtfExport_createInstance,
+ RtfExport_getSupportedServiceNames() ) );
+ } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) {
+ const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ RtfImport_getImplementationName(),
+ RtfImport_createInstance,
+ RtfImport_getSupportedServiceNames() ) );
}
if ( xFactory.is() )
diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk
index b25887e3e2bf..a1d12422f9d3 100644
--- a/sw/source/filter/ww8/makefile.mk
+++ b/sw/source/filter/ww8/makefile.mk
@@ -67,7 +67,12 @@ EXCEPTIONSFILES = \
$(SLO)$/WW8TableInfo.obj \
$(SLO)$/WW8FFData.obj \
$(SLO)$/WW8Sttbf.obj \
- $(SLO)$/WW8FibData.obj
+ $(SLO)$/WW8FibData.obj \
+ $(SLO)$/rtfexportfilter.obj \
+ $(SLO)$/rtfimportfilter.obj \
+ $(SLO)$/rtfattributeoutput.obj \
+ $(SLO)$/rtfsdrexport.obj \
+ $(SLO)$/rtfexport.obj
SLOFILES = \
@@ -96,7 +101,12 @@ SLOFILES = \
$(SLO)$/WW8TableInfo.obj \
$(SLO)$/WW8FFData.obj \
$(SLO)$/WW8Sttbf.obj \
- $(SLO)$/WW8FibData.obj
+ $(SLO)$/WW8FibData.obj \
+ $(SLO)$/rtfexportfilter.obj \
+ $(SLO)$/rtfimportfilter.obj \
+ $(SLO)$/rtfattributeoutput.obj \
+ $(SLO)$/rtfsdrexport.obj \
+ $(SLO)$/rtfexport.obj
# --- Tagets -------------------------------------------------------
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
new file mode 100644
index 000000000000..587a90df4a27
--- /dev/null
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -0,0 +1,3447 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "rtfattributeoutput.hxx"
+#include "rtfexport.hxx"
+#include "rtfsdrexport.hxx"
+#include "writerwordglue.hxx"
+#include "wrtww8.hxx"
+#include "ww8par.hxx"
+#include "fmtcntnt.hxx"
+#include "fmtsrnd.hxx"
+#include "fchrfmt.hxx"
+#include "tgrditem.hxx"
+#include "fmtruby.hxx"
+#include "charfmt.hxx"
+#include "breakit.hxx"
+
+#include <i18npool/mslangid.hxx>
+
+#include <hintids.hxx>
+
+#include <svl/poolitem.hxx>
+#include <svtools/rtfkeywd.hxx>
+
+#include <editeng/fontitem.hxx>
+#include <editeng/tstpitem.hxx>
+#include <editeng/adjitem.hxx>
+#include <editeng/spltitem.hxx>
+#include <editeng/widwitem.hxx>
+#include <editeng/lspcitem.hxx>
+#include <editeng/keepitem.hxx>
+#include <editeng/shaditem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/crsditem.hxx>
+#include <editeng/cmapitem.hxx>
+#include <editeng/wrlmitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/escpitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/hyznitem.hxx>
+#include <editeng/brkitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/cntritem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/akrnitem.hxx>
+#include <editeng/pbinitem.hxx>
+#include <editeng/emphitem.hxx>
+#include <editeng/twolinesitem.hxx>
+#include <editeng/charscaleitem.hxx>
+#include <editeng/charrotateitem.hxx>
+#include <editeng/charreliefitem.hxx>
+#include <editeng/paravertalignitem.hxx>
+#include <editeng/pgrditem.hxx>
+#include <editeng/frmdiritem.hxx>
+#include <editeng/blnkitem.hxx>
+#include <editeng/charhiddenitem.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/fmglob.hxx>
+#include <svx/svdouno.hxx>
+#include <filter/msfilter/msoleexp.hxx>
+
+#include <docufld.hxx>
+#include <flddropdown.hxx>
+#include <format.hxx>
+#include <fmtclds.hxx>
+#include <fmtinfmt.hxx>
+#include <fmtfld.hxx>
+#include <fmtfsize.hxx>
+#include <fmtftn.hxx>
+#include <fmtrowsplt.hxx>
+#include <fmtline.hxx>
+#include <fmtanchr.hxx>
+#include <frmfmt.hxx>
+#include <frmatr.hxx>
+#include <ftninfo.hxx>
+#include <htmltbl.hxx>
+#include <ndgrf.hxx>
+#include <ndtxt.hxx>
+#include <node.hxx>
+#include <pagedesc.hxx>
+#include <paratr.hxx>
+#include <swmodule.hxx>
+#include <swtable.hxx>
+#include <txtftn.hxx>
+#include <txtinet.hxx>
+#include <numrule.hxx>
+#include <grfatr.hxx>
+#include <ndole.hxx>
+#include <lineinfo.hxx>
+#include <rtf.hxx>
+
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.hxx>
+
+#include <tools/color.hxx>
+
+#include <vcl/cvtgrf.hxx>
+
+#include <com/sun/star/i18n/ScriptType.hdl>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+#include <osl/diagnose.h>
+
+using rtl::OString;
+using rtl::OStringBuffer;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+using rtl::OUStringToOString;
+
+using namespace nsSwDocInfoSubType;
+using namespace nsFieldFlags;
+using namespace sw::util;
+using namespace ::com::sun::star;
+
+static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, const sal_Char* pStr)
+{
+ OStringBuffer aRet;
+ aRet.append(pStr);
+ if( pLine->GetInWidth() )
+ {
+ // double line
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
+ switch( pLine->GetInWidth() )
+ {
+ case DEF_LINE_WIDTH_0:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "15");
+ break;
+ case DEF_LINE_WIDTH_1:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "30");
+ break;
+ case DEF_LINE_WIDTH_2:
+ case DEF_LINE_WIDTH_3:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "45");
+ break;
+ }
+ }
+ else
+ {
+ // single line
+ if( DEF_LINE_WIDTH_1 >= pLine->GetOutWidth() )
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth());
+ else
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth() / 2);
+ }
+
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF);
+ aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor()));
+ return aRet.makeStringAndClear();
+}
+
+static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
+ const sal_Char* pStr, USHORT nDist)
+{
+ OStringBuffer aRet;
+ aRet.append(OutTBLBorderLine(rExport, pLine, pStr));
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRSP);
+ aRet.append((sal_Int32)nDist);
+ return aRet.makeStringAndClear();
+}
+
+static OString OutBorderLine( RtfExport &rExport, const SvxBorderLine* pLine,
+ const char* pStr )
+{
+ OStringBuffer aRet;
+ aRet.append(pStr);
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNCOL);
+ aRet.append((sal_Int32)rExport.GetColor( pLine->GetColor() ) );
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNIN);
+ aRet.append((sal_Int32)pLine->GetInWidth());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNOUT);
+ aRet.append((sal_Int32)pLine->GetOutWidth());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNDIST);
+ aRet.append((sal_Int32)pLine->GetDistance());
+ return aRet.makeStringAndClear();
+}
+
+void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ /*
+ You would have thought that
+ m_rExport.Strm() << (bIsRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here ,
+ but looks like word needs to see the other directional token to be
+ satisified that all is kosher, otherwise it seems in ver 2003 to go and
+ semi-randomlyly stick strike through about the place. Perhaps
+ strikethrough is some ms developers "something is wrong signal" debugging
+ code that we're triggering ?
+ */
+ if (bIsRTL) {
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH);
+ m_aStylesEnd.append(' ');
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH);
+ } else {
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH);
+ m_aStylesEnd.append(' ');
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH);
+ }
+
+ switch (nScript) {
+ case i18n::ScriptType::LATIN:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH);
+ break;
+ case i18n::ScriptType::ASIAN:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_DBCH);
+ break;
+ case i18n::ScriptType::COMPLEX:
+ /* noop */
+ break;
+ default:
+ /* should not happen? */
+ break;
+ }
+}
+
+void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // Output table/table row/table cell starts if needed
+ if ( pTextNodeInfo.get() )
+ {
+ sal_uInt32 nRow = pTextNodeInfo->getRow();
+ sal_uInt32 nCell = pTextNodeInfo->getCell();
+
+ // New cell/row?
+ if ( m_nTableDepth > 0 && !m_bTableCellOpen )
+ {
+ ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner( pTextNodeInfo->getInnerForDepth( m_nTableDepth ) );
+ OSL_ENSURE( pDeepInner, "TableNodeInfoInner not found");
+ if ( pDeepInner && pDeepInner->getCell() == 0 )
+ StartTableRow( pDeepInner );
+
+ StartTableCell( pDeepInner );
+ }
+
+ if ( nRow == 0 && nCell == 0 )
+ {
+ // Do we have to start the table?
+ // [If we are at the rigth depth already, it means that we
+ // continue the table cell]
+ sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth();
+
+ if ( nCurrentDepth > m_nTableDepth )
+ {
+ // Start all the tables that begin here
+ for ( sal_uInt32 nDepth = m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth )
+ {
+ ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) );
+
+ m_bLastTable = (nDepth == pTextNodeInfo->getDepth());
+ StartTable( pInner );
+ StartTableRow( pInner );
+ StartTableCell( pInner );
+ }
+
+ m_nTableDepth = nCurrentDepth;
+ }
+ }
+ }
+
+ OSL_ENSURE(m_aRun.getLength() == 0, "m_aRun is not empty");
+}
+
+void RtfAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ FinishTableRowCell( pTextNodeInfoInner );
+
+ OStringBuffer aParagraph;
+
+ aParagraph.append(m_aRun.makeStringAndClear());
+ aParagraph.append(m_aAfterRuns.makeStringAndClear());
+ if (m_bTblAfterCell)
+ m_bTblAfterCell = false;
+ else
+ {
+ aParagraph.append(m_rExport.sNewLine);
+ aParagraph.append(OOO_STRING_SVTOOLS_RTF_PAR);
+ aParagraph.append(' ');
+ }
+ if (m_nColBreakNeeded)
+ {
+ aParagraph.append(OOO_STRING_SVTOOLS_RTF_COLUMN);
+ m_nColBreakNeeded = false;
+ }
+
+ if (!m_bBufferSectionHeaders)
+ m_rExport.Strm() << aParagraph.makeStringAndClear();
+ else
+ m_aSectionHeaders.append(aParagraph.makeStringAndClear());
+}
+
+void RtfAttributeOutput::EmptyParagraph()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << m_rExport.sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' ';
+}
+
+void RtfAttributeOutput::StartParagraphProperties( const SwTxtNode& rNode )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty");
+
+ // output page/section breaks
+ SwNodeIndex aNextIndex( rNode, 1 );
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+ m_bBufferSectionBreaks = true;
+
+ // output section headers / footers
+ if (!m_bBufferSectionHeaders)
+ m_rExport.Strm() << m_aSectionHeaders.makeStringAndClear();
+
+ if ( aNextIndex.GetNode().IsTxtNode() )
+ {
+ const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() );
+ m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode );
+ }
+ else if ( aNextIndex.GetNode().IsTableNode() )
+ {
+ const SwTableNode* pTableNode = static_cast< SwTableNode* >( &aNextIndex.GetNode() );
+ const SwFrmFmt *pFmt = pTableNode->GetTable().GetFrmFmt();
+ m_rExport.OutputSectionBreaks( &(pFmt->GetAttrSet()), *pTableNode );
+ }
+ m_bBufferSectionBreaks = false;
+
+ OStringBuffer aPar;
+ if (!m_rExport.bRTFFlySyntax)
+ {
+ aPar.append(OOO_STRING_SVTOOLS_RTF_PARD);
+ aPar.append(OOO_STRING_SVTOOLS_RTF_PLAIN);
+ aPar.append(' ');
+ }
+ if (!m_bBufferSectionHeaders)
+ m_rExport.Strm() << aPar.makeStringAndClear();
+ else
+ m_aSectionHeaders.append(aPar.makeStringAndClear());
+}
+
+void RtfAttributeOutput::EndParagraphProperties()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_aStyles.append(m_aStylesEnd.makeStringAndClear());
+ m_rExport.Strm() << m_aStyles.makeStringAndClear();
+}
+
+void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aRun.append('{');
+
+ // if there is some redlining in the document, output it
+ Redline( pRedlineData );
+
+ OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
+}
+
+void RtfAttributeOutput::EndRun()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_aRun.append(m_rExport.sNewLine);
+ m_aRun.append(m_aRunText.makeStringAndClear());
+ m_aRun.append('}');
+}
+
+void RtfAttributeOutput::StartRunProperties()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty");
+}
+
+void RtfAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_aStyles.append(m_aStylesEnd.makeStringAndClear());
+ m_aRun.append(m_aStyles.makeStringAndClear());
+}
+
+void RtfAttributeOutput::RunText( const String& rText, rtl_TextEncoding eCharSet )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ RawText( rText, 0, eCharSet );
+}
+
+OStringBuffer& RtfAttributeOutput::RunText()
+{
+ return m_aRunText;
+}
+
+OStringBuffer& RtfAttributeOutput::Styles()
+{
+ return m_aStyles;
+}
+
+void RtfAttributeOutput::RawText( const String& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_aRunText.append(m_rExport.OutString(rText, eCharSet));
+}
+
+void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::EndRuby()
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append('{');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FIELD);
+ m_aStyles.append('{');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST);
+ m_aStyles.append(" HYPERLINK ");
+
+ String sURL( rUrl );
+ if( sURL.Len() )
+ {
+ m_aStyles.append("\"");
+ m_aStyles.append(m_rExport.OutString( sURL, m_rExport.eCurrentEncoding));
+ m_aStyles.append("\" ");
+ }
+
+ if( rTarget.Len() )
+ {
+ m_aStyles.append("\\\\t \"");
+ m_aStyles.append(m_rExport.OutString( rTarget, m_rExport.eCurrentEncoding));
+ m_aStyles.append("\" ");
+ }
+
+ m_aStyles.append("}");
+ return true;
+}
+
+bool RtfAttributeOutput::EndURL()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // close the fldrslt group
+ m_aRunText.append('}');
+ // close the field group
+ m_aRunText.append('}');
+ return true;
+}
+
+void RtfAttributeOutput::FieldVanish( const String& /*rTxt*/, ww::eField /*eType*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::Redline( const SwRedlineData* pRedline )
+{
+ if (!pRedline)
+ return;
+
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (pRedline->GetType() == nsRedlineType_t::REDLINE_INSERT)
+ {
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVISED);
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTH);
+ m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor())));
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTM);
+ }
+ else if(pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE)
+ {
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_DELETED);
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTHDEL);
+ m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor())));
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTMDEL);
+ }
+ m_aRun.append((sal_Int32)sw::ms::DateTime2DTTM(pRedline->GetTimeStamp()));
+ m_aRun.append(' ');
+}
+
+void RtfAttributeOutput::FormatDrop( const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, USHORT /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::ParagraphStyle( USHORT nStyle )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ OString *pStyle = m_rExport.GetStyle(nStyle);
+ OStringBuffer aStyle;
+ aStyle.append(OOO_STRING_SVTOOLS_RTF_S);
+ aStyle.append((sal_Int32)nStyle);
+ if (pStyle)
+ aStyle.append(pStyle->getStr());
+ if (!m_bBufferSectionHeaders)
+ m_rExport.Strm() << aStyle.makeStringAndClear();
+ else
+ m_aSectionHeaders.append(aStyle.makeStringAndClear());
+}
+
+void RtfAttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_INTBL);
+ if ( m_nTableDepth > 1 )
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ITAP);
+ m_aStyles.append((sal_Int32)m_nTableDepth);
+ }
+ m_bWroteCellInfo = true;
+}
+
+void RtfAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfo*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop */
+}
+
+void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( !m_pTableWrt )
+ InitTableHelper( pTableTextNodeInfoInner );
+
+ const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
+ SwFrmFmt *pFmt = pTblBox->GetFrmFmt( );
+
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TROWD);
+ TableOrientation( pTableTextNodeInfoInner );
+ TableBidi( pTableTextNodeInfoInner );
+ TableHeight( pTableTextNodeInfoInner );
+ TableCanSplit( pTableTextNodeInfoInner );
+
+ // Cell margins
+ const SvxBoxItem& rBox = pFmt->GetBox( );
+ static const USHORT aBorders[] =
+ {
+ BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
+ };
+
+ static const char* aRowPadNames[] =
+ {
+ OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR
+ };
+
+ static const char* aRowPadUnits[] =
+ {
+ OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR
+ };
+
+ for (int i = 0; i < 4; ++i)
+ {
+ m_aRowDefs.append(aRowPadUnits[i]);
+ m_aRowDefs.append((sal_Int32)3);
+ m_aRowDefs.append(aRowPadNames[i]);
+ m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i]));
+ }
+
+ // The cell-dependent properties
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
+ SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ SwTwips nSz = 0;
+ Point aPt;
+ SwRect aRect( pFmt->FindLayoutRect( false, &aPt ));
+ SwTwips nPageSize = aRect.Width();
+ SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
+ for( USHORT i = 0; i < pRow->GetCells().Count(); i++ )
+ {
+ SwWriteTableCell *pCell = pRow->GetCells( )[ i ];
+ const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+
+ pTableTextNodeInfoInner->setCell( i );
+ TableCellProperties(pTableTextNodeInfoInner);
+
+ // Right boundary: this can't be in TableCellProperties as the old
+ // value of nSz is needed.
+ nSz += pCellFmt->GetFrmSize().GetWidth();
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CELLX);
+ SwTwips nCalc = nSz;
+ nCalc *= nPageSize;
+ nCalc /= nTblSz;
+ m_aRowDefs.append( (sal_Int32)(pFmt->GetLRSpace().GetLeft() + nCalc) );
+ }
+}
+
+void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /*
+ * The function name is a bit misleading: given that we write borders
+ * before each row, we just have borders, not default ones. Additionally,
+ * this function actually writes borders for a specific cell only and is
+ * called for each cell.
+ */
+
+ const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
+ SwFrmFmt *pFmt = pTblBox->GetFrmFmt( );
+ const SvxBoxItem& rDefault = pFmt->GetBox( );
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
+ SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
+ const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SfxPoolItem* pItem;
+ if (SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState(RES_BOX, TRUE, &pItem))
+ {
+ const SvxBoxItem& rBox = (SvxBoxItem&)*pItem;
+ static const USHORT aBorders[] =
+ {
+ BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
+ };
+ static const char* aBorderNames[] =
+ {
+ OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR
+ };
+ //Yes left and top are swapped with eachother for cell padding! Because
+ //that's what the thunderingly annoying rtf export/import word xp does.
+ static const char* aCellPadNames[] =
+ {
+ OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR
+ };
+ static const char* aCellPadUnits[] =
+ {
+ OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR
+ };
+ for (int i = 0; i < 4; ++i)
+ {
+ if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i]))
+ m_aRowDefs.append(OutTBLBorderLine(m_rExport, pLn, aBorderNames[i]));
+ if (rDefault.GetDistance(aBorders[i]) !=
+ rBox.GetDistance(aBorders[i]))
+ {
+ m_aRowDefs.append(aCellPadUnits[i]);
+ m_aRowDefs.append((sal_Int32)3);
+ m_aRowDefs.append(aCellPadNames[i]);
+ m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i]));
+ }
+ }
+ }
+}
+
+void RtfAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
+ SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
+ const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SfxPoolItem* pItem;
+ if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState(
+ RES_BACKGROUND, TRUE, &pItem ))
+ {
+ const SvxBrushItem& rBack = (SvxBrushItem&)*pItem;
+ if( !rBack.GetColor().GetTransparency() )
+ {
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT);
+ m_aRowDefs.append((sal_Int32)m_rExport.GetColor(rBack.GetColor()));
+ }
+ }
+}
+
+void RtfAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
+ const SwTableLine * pTabLine = pTabBox->GetUpper();
+ const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
+ const SwFmtFrmSize& rLSz = pLineFmt->GetFrmSize();
+
+ if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
+ {
+ sal_Int32 nHeight = 0;
+
+ switch ( rLSz.GetHeightSizeType() )
+ {
+ case ATT_FIX_SIZE: nHeight = -rLSz.GetHeight(); break;
+ case ATT_MIN_SIZE: nHeight = rLSz.GetHeight(); break;
+ default: break;
+ }
+
+ if ( nHeight )
+ {
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRRH);
+ m_aRowDefs.append(nHeight);
+ }
+ }
+}
+
+void RtfAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
+ const SwTableLine * pTabLine = pTabBox->GetUpper();
+ const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
+ const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( );
+
+ // The rtf default is to allow a row to break
+ if (rSplittable.GetValue() == 0)
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRKEEP);
+}
+
+void RtfAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
+ const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt();
+
+ if ( m_rExport.TrueFrameDirection( *pFrmFmt ) != FRMDIR_HORI_RIGHT_TOP )
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_LTRROW);
+ else
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_RTLROW);
+}
+
+void RtfAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
+ SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
+ const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SfxPoolItem* pItem;
+
+ // vertical merges
+ if (pCell->GetRowSpan() > 1)
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMGF);
+ else if (pCell->GetRowSpan() == 0)
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMRG);
+
+ // vertical alignment
+ if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState(
+ RES_VERT_ORIENT, TRUE, &pItem ) )
+ switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() )
+ {
+ case text::VertOrientation::CENTER: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); break;
+ case text::VertOrientation::BOTTOM: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALB); break;
+ default: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALT); break;
+ }
+}
+
+void RtfAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop */
+}
+
+void RtfAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // This is called when the nested table ends in a cell, and there's no
+ // paragraph benhind that; so we must check for the ends of cell, rows,
+ // and tables
+ // ['true' to write an empty paragraph, MS Word insists on that]
+ FinishTableRowCell( pNodeInfoInner, true );
+}
+
+void RtfAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwTable *pTable = pTableTextNodeInfoInner->getTable();
+ SwFrmFmt *pFmt = pTable->GetFrmFmt( );
+
+ OStringBuffer aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL );
+ switch (pFmt->GetHoriOrient().GetHoriOrient())
+ {
+ case text::HoriOrientation::CENTER:
+ aTblAdjust.setLength(0);
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQC);
+ break;
+ case text::HoriOrientation::RIGHT:
+ aTblAdjust.setLength(0);
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQR);
+ break;
+ case text::HoriOrientation::NONE:
+ case text::HoriOrientation::LEFT_AND_WIDTH:
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRLEFT);
+ aTblAdjust.append((sal_Int32)pFmt->GetLRSpace().GetLeft());
+ break;
+ default:
+ break;
+ }
+
+ m_aRowDefs.append(aTblAdjust.makeStringAndClear());
+}
+
+void RtfAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop, see EndTableRow() */
+}
+
+/*
+ * Our private table methods.
+ */
+
+void RtfAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ sal_uInt32 nPageSize = 0;
+ bool bRelBoxSize = false;
+
+ // Create the SwWriteTable instance to use col spans
+ GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize );
+
+ const SwTable* pTable = pTableTextNodeInfoInner->getTable( );
+ const SwFrmFmt *pFmt = pTable->GetFrmFmt( );
+ SwTwips nTblSz = pFmt->GetFrmSize( ).GetWidth( );
+
+ const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout();
+ if( pLayout && pLayout->IsExportable() )
+ m_pTableWrt = new SwWriteTable( pLayout );
+ else
+ m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), (USHORT)nPageSize,
+ (USHORT)nTblSz, false);
+}
+
+void RtfAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // To trigger calling InitTableHelper()
+ delete m_pTableWrt, m_pTableWrt = NULL;
+}
+
+void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth();
+ OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)nCurrentDepth);
+
+ TableDefinition(pTableTextNodeInfoInner);
+
+ if (!m_bLastTable)
+ m_aTables.push_back(m_aRowDefs.makeStringAndClear());
+
+ // We'll write the table definition for nested tables later
+ if ( nCurrentDepth > 1 )
+ return;
+ m_rExport.Strm() << m_aRowDefs.makeStringAndClear();
+}
+
+void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_bTableCellOpen = true;
+}
+
+void RtfAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ TableDefaultBorders(pTableTextNodeInfoInner);
+ TableBackgrounds(pTableTextNodeInfoInner);
+ TableVerticalCell(pTableTextNodeInfoInner);
+}
+
+void RtfAttributeOutput::EndTableCell( )
+{
+ OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth);
+
+ if (!m_bWroteCellInfo)
+ {
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_INTBL);
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ITAP);
+ m_aAfterRuns.append((sal_Int32)m_nTableDepth);
+ }
+ if ( m_nTableDepth > 1 )
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTCELL);
+ else
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL);
+
+ m_bTableCellOpen = false;
+ m_bTblAfterCell = true;
+ m_bWroteCellInfo = false;
+}
+
+void RtfAttributeOutput::EndTableRow( )
+{
+ OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth);
+
+ if ( m_nTableDepth > 1 )
+ {
+ m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS);
+ if (m_aRowDefs.getLength() > 0)
+ m_aAfterRuns.append(m_aRowDefs.makeStringAndClear());
+ else if (m_aTables.size() > 0)
+ {
+ m_aAfterRuns.append(m_aTables.back());
+ m_aTables.pop_back();
+ }
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTROW "}" "{" OOO_STRING_SVTOOLS_RTF_NONESTTABLES OOO_STRING_SVTOOLS_RTF_PAR "}");
+ }
+ else
+ {
+ if (m_aTables.size() > 0)
+ {
+ m_aAfterRuns.append(m_aTables.back());
+ m_aTables.pop_back();
+ }
+ m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ROW);
+ }
+}
+
+void RtfAttributeOutput::EndTable()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_nTableDepth > 0 ) {
+ m_nTableDepth--;
+ delete m_pTableWrt, m_pTableWrt = NULL;
+ }
+
+ // We closed the table; if it is a nested table, the cell that contains it
+ // still continues
+ m_bTableCellOpen = true;
+
+ // Cleans the table helper
+ delete m_pTableWrt, m_pTableWrt = NULL;
+}
+
+void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( pInner.get() )
+ {
+ // Where are we in the table
+ sal_uInt32 nRow = pInner->getRow( );
+
+ const SwTable *pTable = pInner->getTable( );
+ const SwTableLines& rLines = pTable->GetTabLines( );
+ USHORT nLinesCount = rLines.Count( );
+
+ if ( pInner->isEndOfCell() )
+ EndTableCell();
+
+ // This is a line end
+ if ( pInner->isEndOfLine() )
+ EndTableRow();
+
+ // This is the end of the table
+ if ( pInner->isEndOfLine( ) && ( nRow + 1 ) == nLinesCount )
+ EndTable();
+ }
+}
+
+void RtfAttributeOutput::StartStyles()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_rExport.Strm() << m_rExport.sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL;
+ m_rExport.OutColorTable();
+ OSL_ENSURE(m_aStylesheet.getLength() == 0, "m_aStylesheet is not empty");
+ m_aStylesheet.append(m_rExport.sNewLine);
+ m_aStylesheet.append('{');
+ m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_STYLESHEET);
+}
+
+void RtfAttributeOutput::EndStyles( USHORT /*nNumberOfStyles*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_rExport.Strm() << '}';
+ m_rExport.Strm() << m_aStylesheet.makeStringAndClear();
+ m_rExport.Strm() << '}';
+}
+
+void RtfAttributeOutput::DefaultStyle( USHORT /*nStyle*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop, the default style is always 0 in RTF */
+}
+
+void RtfAttributeOutput::StartStyle( const String& rName, bool bPapFmt,
+ USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId )
+{
+ OSL_TRACE("%s, rName = '%s'", OSL_THIS_FUNC,
+ OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ).getStr());
+
+ m_aStylesheet.append('{');
+ if (bPapFmt)
+ m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_S);
+ else
+ m_aStylesheet.append( OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS);
+ m_aStylesheet.append( (sal_Int32)nId );
+
+ if ( nBase != 0x0FFF )
+ {
+ m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SBASEDON);
+ m_aStylesheet.append((sal_Int32)nBase);
+ }
+
+ m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SNEXT);
+ m_aStylesheet.append((sal_Int32)nNext);
+
+ m_rStyleName = rName;
+ m_nStyleId = nId;
+}
+
+void RtfAttributeOutput::EndStyle()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ m_aStyles.append(m_aStylesEnd.makeStringAndClear());
+ OString aStyles = m_aStyles.makeStringAndClear();
+ m_rExport.InsStyle(m_nStyleId, aStyles);
+ m_aStylesheet.append(aStyles);
+ m_aStylesheet.append(' ');
+ m_aStylesheet.append(OUStringToOString( OUString( m_rStyleName ), m_rExport.eCurrentEncoding ));
+ m_aStylesheet.append(";}");
+ m_aStylesheet.append(m_rExport.sNewLine);
+}
+
+void RtfAttributeOutput::StartStyleProperties( bool /*bParProp*/, USHORT /*nStyle*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ /* noop */
+}
+
+void RtfAttributeOutput::EndStyleProperties( bool /*bParProp*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ /* noop */
+}
+
+void RtfAttributeOutput::OutlineNumbering( BYTE nLvl, const SwNumFmt& /*rNFmt*/, const SwFmt& /*rFmt*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( nLvl >= WW8ListManager::nMaxLevel )
+ nLvl = WW8ListManager::nMaxLevel - 1;
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL);
+ m_aStyles.append((sal_Int32)nLvl);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL);
+ m_aStyles.append((sal_Int32)nLvl);
+}
+
+void RtfAttributeOutput::PageBreakBefore( bool bBreak )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (bBreak)
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PAGEBB;
+ }
+}
+
+void RtfAttributeOutput::SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch (nC)
+ {
+ case msword::ColumnBreak:
+ m_nColBreakNeeded = true;
+ break;
+ case msword::PageBreak:
+ if ( pSectionInfo )
+ m_rExport.SectionProperties( *pSectionInfo );
+ break;
+ }
+}
+
+void RtfAttributeOutput::StartSection()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECT OOO_STRING_SVTOOLS_RTF_SECTD);
+ if (!m_bBufferSectionBreaks)
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+}
+
+void RtfAttributeOutput::EndSection()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /*
+ * noop, \sect must go to StartSection or Word won't notice multiple
+ * columns...
+ */
+}
+
+void RtfAttributeOutput::SectionFormProtection( bool bProtected )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED);
+ m_aSectionBreaks.append((sal_Int32)!bProtected);
+}
+
+void RtfAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLineNumberInfo& rLnNumInfo )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEMOD;
+ m_rExport.OutLong(rLnNumInfo.GetCountBy());
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEX;
+ m_rExport.OutLong(rLnNumInfo.GetPosFromLeft());
+ if (!rLnNumInfo.IsRestartEachPage())
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINECONT;
+}
+
+void RtfAttributeOutput::SectionTitlePage()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /*
+ * noop, handled in RtfExport::WriteHeaderFooter()
+ */
+}
+
+void RtfAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* /*pFirstPageFmt*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SvxBoxItem& rBox = pFmt->GetBox();
+ const SvxBorderLine *pLine = rBox.GetTop();
+ if(pLine)
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRT,
+ rBox.GetDistance(BOX_LINE_TOP) ));
+ pLine = rBox.GetBottom();
+ if(pLine)
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRB,
+ rBox.GetDistance(BOX_LINE_BOTTOM) ));
+ pLine = rBox.GetLeft();
+ if(pLine)
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRL,
+ rBox.GetDistance(BOX_LINE_LEFT) ));
+ pLine = rBox.GetRight();
+ if(pLine)
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRR,
+ rBox.GetDistance(BOX_LINE_RIGHT) ));
+}
+
+void RtfAttributeOutput::SectionBiDi( bool bBiDi )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT);
+}
+
+void RtfAttributeOutput::SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (nPageRestartNumber > 0)
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNSTARTS);
+ m_aSectionBreaks.append((sal_Int32)nPageRestartNumber);
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNRESTART);
+ }
+
+ const char* pStr = 0;
+ switch ( nNumType )
+ {
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCLTR; break;
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCLTR; break;
+ case SVX_NUM_ROMAN_UPPER: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCRM; break;
+ case SVX_NUM_ROMAN_LOWER: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCRM; break;
+
+ case SVX_NUM_ARABIC: pStr = OOO_STRING_SVTOOLS_RTF_PGNDEC; break;
+ }
+ if (pStr)
+ m_aSectionBreaks.append(pStr);
+}
+
+void RtfAttributeOutput::SectionType( BYTE nBreakCode )
+{
+ OSL_TRACE("%s, nBreakCode = %d", OSL_THIS_FUNC, nBreakCode);
+
+ /*
+ * break code: 0 No break, 1 New column
+ * 2 New page, 3 Even page, 4 Odd page
+ */
+ const char* sType = NULL;
+ switch ( nBreakCode )
+ {
+ case 1: sType = OOO_STRING_SVTOOLS_RTF_SBKCOL; break;
+ case 2: sType = OOO_STRING_SVTOOLS_RTF_SBKPAGE; break;
+ case 3: sType = OOO_STRING_SVTOOLS_RTF_SBKEVEN; break;
+ case 4: sType = OOO_STRING_SVTOOLS_RTF_SBKODD; break;
+ default: sType = OOO_STRING_SVTOOLS_RTF_SBKNONE; break;
+ }
+ m_aSectionBreaks.append(sType);
+ if (!m_bBufferSectionBreaks)
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+}
+
+void RtfAttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &/*rRule*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE;
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID;
+ m_rExport.OutULong(nId);
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT << '0';
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LS;
+ m_rExport.OutULong(nId) << '}';
+}
+
+void RtfAttributeOutput::StartAbstractNumbering( USHORT nId )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID;
+ m_rExport.OutULong( nId );
+ m_nListId = nId;
+}
+
+void RtfAttributeOutput::EndAbstractNumbering()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID;
+ m_rExport.OutULong( m_nListId ) << '}' << m_rExport.sNewLine;
+}
+
+void RtfAttributeOutput::NumberingLevel( BYTE nLevel,
+ USHORT nStart,
+ USHORT nNumberingType,
+ SvxAdjust eAdjust,
+ const BYTE * pNumLvlPos,
+ BYTE /*nFollow*/,
+ const wwFont * pFont,
+ const SfxItemSet * pOutSet,
+ sal_Int16 nIndentAt,
+ sal_Int16 nFirstLineIndex,
+ sal_Int16 /*nListTabPos*/,
+ const String &rNumberingString )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << m_rExport.sNewLine;
+ if( nLevel > 8 ) // RTF knows only 9 levels
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL;
+
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL;
+
+ USHORT nVal = 0;
+ switch( nNumberingType )
+ {
+ case SVX_NUM_ROMAN_UPPER: nVal = 1; break;
+ case SVX_NUM_ROMAN_LOWER: nVal = 2; break;
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break;
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break;
+
+ case SVX_NUM_BITMAP:
+ case SVX_NUM_CHAR_SPECIAL: nVal = 23; break;
+ }
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELNFC;
+ m_rExport.OutULong( nVal );
+
+ switch( eAdjust )
+ {
+ case SVX_ADJUST_CENTER: nVal = 1; break;
+ case SVX_ADJUST_RIGHT: nVal = 2; break;
+ default: nVal = 0; break;
+ }
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELJC;
+ m_rExport.OutULong( nVal );
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT;
+ m_rExport.OutULong( nStart );
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW << "0";
+
+ // leveltext group
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' ';
+
+ if( SVX_NUM_CHAR_SPECIAL == nNumberingType ||
+ SVX_NUM_BITMAP == nNumberingType )
+ {
+ m_rExport.Strm() << "\\'01";
+ sal_Unicode cChar = rNumberingString.GetChar(0);
+ m_rExport.Strm() << "\\u";
+ m_rExport.OutULong(cChar);
+ m_rExport.Strm() << " ?";
+ }
+ else
+ {
+ m_rExport.Strm() << "\\'" << m_rExport.OutHex( rNumberingString.Len(), 2 );
+ m_rExport.Strm() << m_rExport.OutString( rNumberingString, m_rExport.eDefaultEncoding );
+ }
+
+ m_rExport.Strm() << ";}";
+
+ // write the levelnumbers
+ m_rExport.Strm() << "{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS;
+ for( BYTE i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i )
+ {
+ m_rExport.Strm() << "\\'" << m_rExport.OutHex(pNumLvlPos[ i ], 2).getStr();
+ }
+ m_rExport.Strm() << ";}";
+
+ if( pOutSet )
+ {
+ if (pFont)
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_F;
+ m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont));
+ }
+ m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF );
+ m_rExport.Strm() << m_aStyles.makeStringAndClear();
+ }
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FI;
+ m_rExport.OutLong( nFirstLineIndex ) << OOO_STRING_SVTOOLS_RTF_LI;
+ m_rExport.OutLong( nIndentAt );
+
+ m_rExport.Strm() << '}';
+ if( nLevel > 8 )
+ m_rExport.Strm() << '}';
+}
+
+void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const String& rFldCmd, BYTE /*nMode*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // NEEDSWORK this has beeen tested only with page numbers
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST " ");
+ m_aRunText.append(m_rExport.OutString(rFldCmd, m_rExport.eCurrentEncoding));
+ m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+ if (pFld)
+ m_aRunText.append(m_rExport.OutString(pFld->ExpandField(true), m_rExport.eDefaultEncoding));
+ m_aRunText.append("}}");
+}
+
+void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds )
+{
+ for ( std::vector< OUString >::const_iterator it = rStarts.begin(), end = rStarts.end(); it < end; ++it )
+ {
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKSTART " ");
+ m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+ rStarts.clear();
+
+ for ( std::vector< OUString >::const_iterator it = rEnds.begin(), end = rEnds.end(); it < end; ++it )
+ {
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKEND " ");
+ m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+ rEnds.clear();
+}
+
+void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr )
+{
+ OStringBuffer aSectionBreaks = m_aSectionBreaks;
+ m_aSectionBreaks.setLength(0);
+ OStringBuffer aRun = m_aRun;
+ m_aRun.setLength(0);
+
+ m_aSectionHeaders.append(bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY);
+ m_aSectionHeaders.append((sal_Int32)m_rExport.pAktPageDesc->GetMaster().GetULSpace().GetUpper());
+ m_aSectionHeaders.append('{');
+ m_aSectionHeaders.append(pStr);
+ m_bBufferSectionHeaders = true;
+ m_rExport.WriteHeaderFooterText(rFmt, bHeader);
+ m_bBufferSectionHeaders = false;
+ m_aSectionHeaders.append('}');
+
+ m_aSectionBreaks = aSectionBreaks;
+ m_aRun = aRun;
+}
+
+void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& /*rNdTopLeft*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwNode *pNode = rFrame.GetContent();
+ const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0;
+
+ switch ( rFrame.GetWriterType() )
+ {
+ case sw::Frame::eTxtBox:
+ OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
+ m_rExport.mpParentFrame = &rFrame;
+ m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true;
+ m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
+ m_rExport.Strm() << m_aRunText.makeStringAndClear();
+ m_rExport.Strm() << m_aStyles.makeStringAndClear();
+ m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false;
+ m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE;
+ m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
+ m_rExport.Strm() << m_aRunText.makeStringAndClear();
+ m_rExport.Strm() << m_aStyles.makeStringAndClear();
+ m_rExport.Strm() << '}';
+
+ {
+ /*
+ * Save m_aRun as we should not loose the opening brace.
+ * OTOH, just drop the contents of m_aRunText in case something
+ * would be there, causing a problem later.
+ */
+ OString aSave = m_aRun.makeStringAndClear();
+ m_rExport.bRTFFlySyntax = true;
+
+ const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt( );
+ const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
+ ULONG nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0;
+ ULONG nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
+ m_rExport.SaveData( nStt, nEnd );
+ m_rExport.mpParentFrame = &rFrame;
+ m_rExport.WriteText( );
+ m_rExport.RestoreData();
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PARD;
+ m_rExport.bRTFFlySyntax = false;
+ m_aRun.append(aSave);
+ m_aRunText.setLength(0);
+ }
+
+ m_rExport.mpParentFrame = NULL;
+ m_rExport.Strm() << RtfExport::sNewLine;
+ break;
+ case sw::Frame::eGraphic:
+ if (!rFrame.IsInline())
+ {
+ m_rExport.mpParentFrame = &rFrame;
+ m_rExport.bRTFFlySyntax = true;
+ m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
+ m_rExport.bRTFFlySyntax = false;
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
+ m_aRunText.append('}');
+ m_rExport.mpParentFrame = NULL;
+ }
+
+ if ( pGrfNode )
+ FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), *pGrfNode, rFrame.GetLayoutSize() );
+ break;
+ case sw::Frame::eDrawing:
+ {
+ const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject();
+ if ( pSdrObj )
+ {
+ bool bSwapInPage = false;
+ if ( !pSdrObj->GetPage() )
+ {
+ if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
+ {
+ if ( SdrPage *pPage = pModel->GetPage( 0 ) )
+ {
+ bSwapInPage = true;
+ const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
+ }
+ }
+ }
+
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{");
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLDINST);
+ m_aRunText.append(" SHAPE ");
+ m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_FLDRSLT);
+
+ m_rExport.SdrExporter().AddSdrObject( *pSdrObj );
+
+ m_aRunText.append('}');
+ m_aRunText.append('}');
+
+ if ( bSwapInPage )
+ const_cast< SdrObject* >( pSdrObj )->SetPage( 0 );
+ }
+ }
+ break;
+ case sw::Frame::eFormControl:
+ {
+ const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt();
+ const SdrObject *pObject = rFrmFmt.FindRealSdrObject();
+
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST);
+
+ if (pObject && pObject->GetObjInventor() == FmFormInventor)
+ {
+ if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject))
+ {
+ uno::Reference< awt::XControlModel > xControlModel =
+ pFormObj->GetUnoControlModel();
+ uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
+ OUString sName;
+ if (xInfo->supportsService(C2U("com.sun.star.form.component.CheckBox")))
+ {
+
+ m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding));
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "1"); // 1 = checkbox
+ // checkbox size in half points, this seems to be always 20, see WW8Export::DoCheckBox()
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHPS "20");
+
+ OUString aStr;
+ sName = C2U("Name");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sName = C2U("HelpText");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sName = C2U("HelpF1Text");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sal_Int16 nTemp = 0;
+ xPropSet->getPropertyValue(C2U("DefaultState")) >>= nTemp;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
+ m_aRun.append((sal_Int32)nTemp);
+ xPropSet->getPropertyValue(C2U("State")) >>= nTemp;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES);
+ m_aRun.append((sal_Int32)nTemp);
+
+ m_aRun.append("}}");
+
+ // field result is empty, ffres already contains the form result
+ m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+ }
+ else if (xInfo->supportsService(C2U("com.sun.star.form.component.TextField")))
+ {
+ OStringBuffer aBuf;
+ OString aStr;
+ OUString aTmp;
+ const sal_Char* pStr;
+
+ m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMTEXT)), m_rExport.eCurrentEncoding));
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_DATAFIELD " ");
+ for (int i = 0; i < 8; i++) aBuf.append((sal_Char)0x00);
+ xPropSet->getPropertyValue(C2U("Name")) >>= aTmp;
+ aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding);
+ aBuf.append((sal_Char)aStr.getLength());
+ aBuf.append(aStr);
+ aBuf.append((sal_Char)0x00);
+ xPropSet->getPropertyValue(C2U("DefaultText")) >>= aTmp;
+ aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding);
+ aBuf.append((sal_Char)aStr.getLength());
+ aBuf.append(aStr);
+ for (int i = 0; i < 11; i++) aBuf.append((sal_Char)0x00);
+ aStr = aBuf.makeStringAndClear();
+ pStr = aStr.getStr();
+ for (int i = 0; i < aStr.getLength(); i++, pStr++)
+ m_aRun.append(m_rExport.OutHex(*pStr, 2));
+ m_aRun.append('}');
+ m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+ xPropSet->getPropertyValue(C2U("Text")) >>= aTmp;
+ m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
+ sName = C2U("HelpText");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aTmp;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
+ m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sName = C2U("HelpF1Text");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aTmp;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ");
+ m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+ m_aRun.append("}");
+ }
+ else if (xInfo->supportsService(C2U("com.sun.star.form.component.ListBox")))
+ {
+ OUString aStr;
+ uno::Sequence<sal_Int16> aIntSeq;
+ uno::Sequence<OUString> aStrSeq;
+
+ m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMDROPDOWN)), m_rExport.eCurrentEncoding));
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX);
+
+ xPropSet->getPropertyValue(C2U("DefaultSelection")) >>= aIntSeq;
+ if( aIntSeq.getLength() )
+ {
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
+ // a dropdown list can have only one 'selected item by default'
+ m_aRun.append((sal_Int32)aIntSeq[0]);
+ }
+
+ xPropSet->getPropertyValue(C2U("SelectedItems")) >>= aIntSeq;
+ if( aIntSeq.getLength() )
+ {
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES);
+ // a dropdown list can have only one 'currently selected item'
+ m_aRun.append((sal_Int32)aIntSeq[0]);
+ }
+
+ sName = C2U("Name");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sName = C2U("HelpText");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+ sName = C2U("HelpF1Text");
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ");
+ m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun.append('}');
+ }
+
+
+ xPropSet->getPropertyValue(C2U("StringItemList")) >>= aStrSeq;
+ sal_uInt32 nListItems = aStrSeq.getLength();
+ for (sal_uInt32 i = 0; i < nListItems; i++)
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFL " ")
+ .append(OUStringToOString(aStrSeq[i], m_rExport.eCurrentEncoding)).append('}');
+
+ m_aRun.append("}}");
+
+ // field result is empty, ffres already contains the form result
+ m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+ }
+ else
+ OSL_TRACE("%s unhandled form control: '%s'", OSL_THIS_FUNC,
+ OUStringToOString(xInfo->getImplementationName(), m_rExport.eCurrentEncoding).getStr());
+ m_aRun.append('}');
+ }
+ }
+
+ m_aRun.append('}');
+ }
+ break;
+ case sw::Frame::eOle:
+ {
+ const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt();
+ const SdrObject *pSdrObj = rFrmFmt.FindRealSdrObject();
+ if ( pSdrObj )
+ {
+ SwNodeIndex aIdx(*rFrmFmt.GetCntnt().GetCntntIdx(), 1);
+ SwOLENode& rOLENd = *aIdx.GetNode().GetOLENode();
+ FlyFrameOLE(dynamic_cast<const SwFlyFrmFmt*>( &rFrmFmt ), rOLENd, rFrame.GetLayoutSize());
+ }
+ }
+ break;
+ default:
+ OSL_TRACE("%s: unknown type (%d)", OSL_THIS_FUNC, rFrame.GetWriterType());
+ break;
+ }
+}
+
+void RtfAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch ( rCaseMap.GetValue() )
+ {
+ case SVX_CASEMAP_KAPITAELCHEN:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS);
+ break;
+ case SVX_CASEMAP_VERSALIEN:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS);
+ break;
+ default: // Something that rtf does not support
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS);
+ m_aStyles.append((sal_Int32)0);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS);
+ m_aStyles.append((sal_Int32)0);
+ break;
+ }
+}
+
+void RtfAttributeOutput::CharColor( const SvxColorItem& rColor )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const Color aColor( rColor.GetValue() );
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CF);
+ m_aStyles.append( (sal_Int32)m_rExport.GetColor( aColor ));
+}
+
+void RtfAttributeOutput::CharContour( const SvxContourItem& rContour )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTL);
+ if ( !rContour.GetValue() )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch ( rCrossedOut.GetStrikeout() )
+ {
+ case STRIKEOUT_NONE:
+ if (!m_bStrikeDouble)
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE);
+ else
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED);
+ m_aStyles.append((sal_Int32)0);
+ break;
+ case STRIKEOUT_DOUBLE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED);
+ m_aStyles.append((sal_Int32)1);
+ break;
+ default:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE);
+ break;
+ }
+}
+
+void RtfAttributeOutput::CharEscapement( const SvxEscapementItem& rEsc )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const char * pUpDn;
+
+ SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem( RES_CHRATR_FONTSIZE )).GetHeight();
+
+ if( 0 < rEsc.GetEsc() )
+ pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
+ else if( 0 > rEsc.GetEsc() )
+ {
+ pUpDn = OOO_STRING_SVTOOLS_RTF_DN;
+ nH = -nH;
+ }
+ else
+ return;
+
+ short nEsc = rEsc.GetEsc();
+ short nProp = rEsc.GetProp() * 100;
+ if( DFLT_ESC_AUTO_SUPER == nEsc )
+ {
+ nEsc = 100 - rEsc.GetProp();
+ ++nProp;
+ }
+ else if( DFLT_ESC_AUTO_SUB == nEsc )
+ {
+ nEsc = - 100 + rEsc.GetProp();
+ ++nProp;
+ }
+
+ m_aStyles.append('{');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_UPDNPROP);
+ m_aStyles.append( (sal_Int32)nProp );
+ m_aStyles.append('}');
+ m_aStyles.append(pUpDn);
+
+ /*
+ * Calculate the act. FontSize and the percentage of the displacement;
+ * RTF file expects half points, while internally it's in twips.
+ * Formally : (FontSize * 1/20 ) pts x * 2
+ * ----------------------- = ------------
+ * 100% Escapement
+ */
+
+ m_aStyles.append( (sal_Int32) ( (long( nEsc ) * nH) + 500L ) / 1000L );
+ // 500L to round !!
+}
+
+void RtfAttributeOutput::CharFont( const SvxFontItem& rFont)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH);
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_F);
+ m_aStylesEnd.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont));
+ m_rExport.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet()));
+}
+
+void RtfAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch ( rFontSize.Which() )
+ {
+ case RES_CHRATR_FONTSIZE:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_FS);
+ m_aStylesEnd.append((sal_Int32)(rFontSize.GetHeight() / 10 ));
+ break;
+ case RES_CHRATR_CJK_FONTSIZE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FS);
+ m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 ));
+ break;
+ case RES_CHRATR_CTL_FONTSIZE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AFS);
+ m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 ));
+ break;
+ }
+}
+
+void RtfAttributeOutput::CharKerning( const SvxKerningItem& rKerning )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // in quater points then in twips
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPND);
+ m_aStyles.append((sal_Int32)(rKerning.GetValue() / 5));
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPNDTW);
+ m_aStyles.append((sal_Int32)(rKerning.GetValue()));
+}
+
+void RtfAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch (rLanguage.Which())
+ {
+ case RES_CHRATR_LANGUAGE:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LANG);
+ m_aStylesEnd.append((sal_Int32)rLanguage.GetLanguage());
+ break;
+ case RES_CHRATR_CJK_LANGUAGE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANGFE);
+ m_aStyles.append((sal_Int32)rLanguage.GetLanguage());
+ break;
+ case RES_CHRATR_CTL_LANGUAGE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANG);
+ m_aStyles.append((sal_Int32)rLanguage.GetLanguage());
+ break;
+ }
+}
+
+void RtfAttributeOutput::CharPosture( const SvxPostureItem& rPosture )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I);
+ if ( rPosture.GetPosture() == ITALIC_NONE )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SHAD);
+ if ( !rShadow.GetValue() )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const char* pStr = 0;
+ const SfxPoolItem* pItem = m_rExport.HasItem( RES_CHRATR_WORDLINEMODE );
+ bool bWord = false;
+ if (pItem)
+ bWord = ((const SvxWordLineModeItem*)pItem)->GetValue() ? true : false;
+ switch(rUnderline.GetLineStyle() )
+ {
+ case UNDERLINE_SINGLE:
+ pStr = bWord ? OOO_STRING_SVTOOLS_RTF_ULW : OOO_STRING_SVTOOLS_RTF_UL;
+ break;
+ case UNDERLINE_DOUBLE:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULDB;
+ break;
+ case UNDERLINE_NONE:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULNONE;
+ break;
+ case UNDERLINE_DOTTED:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULD;
+ break;
+ case UNDERLINE_DASH:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULDASH;
+ break;
+ case UNDERLINE_DASHDOT:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD;
+ break;
+ case UNDERLINE_DASHDOTDOT:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD;
+ break;
+ case UNDERLINE_BOLD:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTH;
+ break;
+ case UNDERLINE_WAVE:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE;
+ break;
+ case UNDERLINE_BOLDDOTTED:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTHD;
+ break;
+ case UNDERLINE_BOLDDASH:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH;
+ break;
+ case UNDERLINE_LONGDASH:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH;
+ break;
+ case UNDERLINE_BOLDLONGDASH:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH;
+ break;
+ case UNDERLINE_BOLDDASHDOT:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD;
+ break;
+ case UNDERLINE_BOLDDASHDOTDOT:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD;
+ break;
+ case UNDERLINE_BOLDWAVE:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE;
+ break;
+ case UNDERLINE_DOUBLEWAVE:
+ pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE;
+ break;
+ default:
+ break;
+ }
+
+ if( pStr )
+ {
+ m_aStyles.append(pStr);
+ // NEEDSWORK looks like here rUnderline.GetColor() is always black,
+ // even if the color in the odt is for example green...
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ULC);
+ m_aStyles.append( (sal_Int32)m_rExport.GetColor(rUnderline.GetColor()) );
+ }
+}
+
+void RtfAttributeOutput::CharWeight( const SvxWeightItem& rWeight )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B);
+ if ( rWeight.GetWeight() != WEIGHT_BOLD )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KERNING);
+ m_aStyles.append((sal_Int32) (rAutoKern.GetValue() ? 1 : 0));
+}
+
+void RtfAttributeOutput::CharAnimatedText( const SvxBlinkItem& rBlink )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ANIMTEXT);
+ m_aStyles.append((sal_Int32) (rBlink.GetValue() ? 2 : 0));
+}
+
+void RtfAttributeOutput::CharBackground( const SvxBrushItem& rBrush )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( !rBrush.GetColor().GetTransparency() )
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT);
+ m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor()));
+ }
+}
+
+void RtfAttributeOutput::CharFontCJK( const SvxFontItem& rFont )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HICH);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF);
+ m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont));
+}
+
+void RtfAttributeOutput::CharFontSizeCJK( const SvxFontHeightItem& rFontSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ CharFontSize( rFontSize );
+}
+
+void RtfAttributeOutput::CharLanguageCJK( const SvxLanguageItem& rLanguageItem )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ CharLanguage( rLanguageItem );
+}
+
+void RtfAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I);
+ if ( rPosture.GetPosture() == ITALIC_NONE )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B);
+ if ( rWeight.GetWeight() != WEIGHT_BOLD )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_DBCH);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF);
+ m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont));
+}
+
+void RtfAttributeOutput::CharFontSizeCTL( const SvxFontHeightItem& rFontSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ CharFontSize( rFontSize );
+}
+
+void RtfAttributeOutput::CharLanguageCTL( const SvxLanguageItem& rLanguageItem )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ CharLanguage( rLanguageItem );
+}
+
+void RtfAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AI);
+ if ( rPosture.GetPosture() == ITALIC_NONE )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AB);
+ if ( rWeight.GetWeight() != WEIGHT_BOLD )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HORZVERT);
+ m_aStyles.append((sal_Int32)(rRotate.IsFitToLine() ? 1 : 0));
+}
+
+void RtfAttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const sal_Char* pStr;
+ switch( rEmphasisMark.GetEmphasisMark())
+ {
+ case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break;
+ case EMPHASISMARK_SIDE_DOTS: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break;
+ default: pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; break;
+ }
+ m_aStyles.append(pStr);
+}
+
+void RtfAttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( rTwoLines.GetValue() )
+ {
+ sal_Unicode cStart = rTwoLines.GetStartBracket();
+ sal_Unicode cEnd = rTwoLines.GetEndBracket();
+
+ USHORT nType;
+ if( !cStart && !cEnd )
+ nType = 0;
+ else if( '{' == cStart || '}' == cEnd )
+ nType = 4;
+ else if( '<' == cStart || '>' == cEnd )
+ nType = 3;
+ else if( '[' == cStart || ']' == cEnd )
+ nType = 2;
+ else // all other kind of brackets
+ nType = 1;
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TWOINONE);
+ m_aStyles.append((sal_Int32)nType);
+ }
+}
+
+void RtfAttributeOutput::CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHARSCALEX);
+ m_aStyles.append((sal_Int32)rScaleWidth.GetValue());
+}
+
+void RtfAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const sal_Char* pStr;
+ switch (rRelief.GetValue())
+ {
+ case RELIEF_EMBOSSED:
+ pStr = OOO_STRING_SVTOOLS_RTF_EMBO;
+ break;
+ case RELIEF_ENGRAVED:
+ pStr = OOO_STRING_SVTOOLS_RTF_IMPR;
+ break;
+ default:
+ pStr = 0;
+ break;
+ }
+
+ if (pStr)
+ m_aStyles.append(pStr);
+}
+
+void RtfAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_V);
+ if ( !rHidden.GetValue() )
+ m_aStyles.append((sal_Int32)0);
+}
+
+void RtfAttributeOutput::TextINetFormat( const SwFmtINetFmt& rURL )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( rURL.GetValue().Len() )
+ {
+ const SwCharFmt* pFmt;
+ const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
+
+ m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+ if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() ))
+ {
+ USHORT nStyle = m_rExport.GetId( *pFmt );
+ OString* pString = m_rExport.GetStyle(nStyle);
+ if (pString)
+ m_aStyles.append(*pString);
+ }
+ }
+}
+
+void RtfAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ USHORT nStyle = m_rExport.GetId( *rCharFmt.GetCharFmt() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS);
+ m_aStyles.append((sal_Int32)nStyle);
+ OString* pString = m_rExport.GetStyle(nStyle);
+ if (pString)
+ m_aStyles.append(*pString);
+}
+
+void RtfAttributeOutput::WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote)
+{
+ if (!rFootnote.GetNumStr().Len())
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_CHFTN);
+ else
+ m_aRun.append(m_rExport.OutString(rFootnote.GetNumStr(), m_rExport.eCurrentEncoding));
+}
+
+void RtfAttributeOutput::TextFootnote_Impl( const SwFmtFtn& rFootnote )
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_SUPER " ");
+ WriteTextFootnoteNumStr(rFootnote);
+ m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FOOTNOTE);
+ if( rFootnote.IsEndNote() )
+ m_aRun.append(OOO_STRING_SVTOOLS_RTF_FTNALT);
+ m_aRun.append(' ');
+ WriteTextFootnoteNumStr(rFootnote);
+
+ /*
+ * The footnote contains a whole paragraph, so we have to:
+ * 1) Reset, then later restore the contents of our run buffer.
+ * 2) Buffer the output of the whole paragraph, as we do so for section headers already.
+ */
+ const SwNodeIndex* pIndex = rFootnote.GetTxtFtn()->GetStartNode();
+ OStringBuffer aRun = m_aRun;
+ m_aRun.setLength(0);
+ m_bBufferSectionHeaders = true;
+ m_rExport.WriteSpecialText( pIndex->GetIndex() + 1,
+ pIndex->GetNode().EndOfSectionIndex(),
+ !rFootnote.IsEndNote() ? TXT_FTN : TXT_EDN);
+ m_bBufferSectionHeaders = false;
+ m_aRun = aRun;
+ m_aRun.append(m_aSectionHeaders.makeStringAndClear());
+
+ m_aRun.append("}");
+ m_aRun.append("}");
+
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SL);
+ m_aStyles.append((sal_Int32)nSpace);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SLMULT);
+ m_aStyles.append((sal_Int32)nMulti);
+
+}
+
+void RtfAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ switch ( rAdjust.GetAdjust() )
+ {
+ case SVX_ADJUST_LEFT:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QL);
+ break;
+ case SVX_ADJUST_RIGHT:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QR);
+ break;
+ case SVX_ADJUST_BLOCKLINE:
+ case SVX_ADJUST_BLOCK:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QJ);
+ break;
+ case SVX_ADJUST_CENTER:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QC);
+ break;
+ default:
+ break;
+ }
+}
+
+void RtfAttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( !rSplit.GetValue() )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEP);
+}
+
+void RtfAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (rWidows.GetValue())
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_WIDCTLPAR);
+ else
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOWIDCTLPAR);
+}
+
+void RtfAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ long nOffset = ((SvxLRSpaceItem&)m_rExport.GetItem( RES_LR_SPACE )).GetTxtLeft();
+ for( USHORT n = 0; n < rTabStop.Count(); n++ )
+ {
+ const SvxTabStop & rTS = rTabStop[ n ];
+ if( SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment() )
+ {
+ const char* pFill = 0;
+ switch( rTS.GetFill() )
+ {
+ case cDfltFillChar:
+ break;
+
+ case '.': pFill = OOO_STRING_SVTOOLS_RTF_TLDOT; break;
+ case '_': pFill = OOO_STRING_SVTOOLS_RTF_TLUL; break;
+ case '-': pFill = OOO_STRING_SVTOOLS_RTF_TLTH; break;
+ case '=': pFill = OOO_STRING_SVTOOLS_RTF_TLEQ; break;
+ default:
+ break;
+ }
+ if( pFill )
+ m_aStyles.append(pFill);
+
+ const sal_Char* pAdjStr = 0;
+ switch (rTS.GetAdjustment())
+ {
+ case SVX_TAB_ADJUST_RIGHT:
+ pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR;
+ break;
+ case SVX_TAB_ADJUST_DECIMAL:
+ pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC;
+ break;
+ case SVX_TAB_ADJUST_CENTER:
+ pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC;
+ break;
+ default:
+ break;
+ }
+ if (pAdjStr)
+ m_aStyles.append(pAdjStr);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TX);
+ m_aStyles.append((sal_Int32)(rTS.GetTabPos() + nOffset));
+ }
+ else
+ {
+ m_aTabStop.append( OOO_STRING_SVTOOLS_RTF_DEFTAB );
+ m_aTabStop.append( (sal_Int32)rTabStop[0].GetTabPos() );
+ }
+ }
+}
+
+void RtfAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ sal_Int32 nFlags = rHyphenZone.IsHyphen() ? 1 : 0;
+ if( rHyphenZone.IsPageEnd() )
+ nFlags += 2;
+ m_aStyles.append('{');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHEN);
+ m_aStyles.append((sal_Int32)nFlags);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHLEAD);
+ m_aStyles.append((sal_Int32)rHyphenZone.GetMinLead());
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHTRAIL);
+ m_aStyles.append((sal_Int32)rHyphenZone.GetMinTrail());
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHMAX);
+ m_aStyles.append((sal_Int32)rHyphenZone.GetMaxHyphens());
+ m_aStyles.append('}');
+}
+
+void RtfAttributeOutput::ParaNumRule_Impl( const SwTxtNode* pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( USHRT_MAX == nNumId || 0 == nNumId || 0 == pTxtNd)
+ return;
+
+ const SwNumRule* pRule = pTxtNd->GetNumRule();
+
+ // --> OD 2008-03-18 #refactorlists#
+ // if( pRule && MAXLEVEL > pTxtNd->GetActualListLevel() )
+ if( pRule && pTxtNd->IsInList() )
+ // <--
+ {
+ // --> OD 2008-03-18 #refactorlists#
+ ASSERT( pTxtNd->GetActualListLevel() >= 0 && pTxtNd->GetActualListLevel() < MAXLEVEL,
+ "<SwRTFWriter::OutListNum(..)> - text node does not have valid list level. Serious defect -> please inform OD" );
+ // <--
+
+ const bool bExportNumRule = USHRT_MAX != nNumId;
+ const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl );
+ if( !pFmt )
+ pFmt = &pRule->Get( nLvl );
+
+ const SfxItemSet& rNdSet = pTxtNd->GetSwAttrSet();
+
+ if ( bExportNumRule ) {
+ m_aStyles.append('{');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LISTTEXT);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PARD);
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN);
+ m_aStyles.append(' ');
+ }
+
+ SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
+ aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() );
+ aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
+
+ USHORT nStyle = m_rExport.GetId( *pFmt->GetCharFmt() );
+ OString* pString = m_rExport.GetStyle(nStyle);
+ if (pString)
+ m_aStyles.append(*pString);
+
+ {
+ String sTxt;
+ if( SVX_NUM_CHAR_SPECIAL == pFmt->GetNumberingType() || SVX_NUM_BITMAP == pFmt->GetNumberingType() )
+ sTxt = pFmt->GetBulletChar();
+ else
+ sTxt = pTxtNd->GetNumString();
+
+ m_aStyles.append(' ');
+
+ if (sTxt.Len())
+ {
+ m_aStyles.append(m_rExport.OutString(sTxt, m_rExport.eDefaultEncoding));
+ }
+
+ if( bExportNumRule )
+ {
+ if( OUTLINE_RULE != pRule->GetRuleType() )
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB);
+ m_aStyles.append('}');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL);
+ if( nLvl > 8 ) // RTF knows only 9 levels
+ {
+ m_aStyles.append((sal_Int32)8);
+ m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SOUTLVL);
+ m_aStyles.append((sal_Int32)nLvl);
+ m_aStyles.append('}');
+ }
+ else
+ m_aStyles.append((sal_Int32)nLvl);
+ }
+ else
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB "}");
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LS);
+ m_aStyles.append((sal_Int32)m_rExport.GetId(*pRule)+1);
+ m_aStyles.append(' ');
+ }
+ else if( sTxt.Len() )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB);
+ }
+ FormatLRSpace(aLR);
+ }
+}
+
+void RtfAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (!rScriptSpace.GetValue( ))
+ return;
+ switch ( rScriptSpace.Which( ) )
+ {
+ case RES_PARATR_SCRIPTSPACE:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ASPALPHA);
+ break;
+ /* Is this needed?
+ case RES_PARATR_HANGINGPUNCTUATION:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOOVERFLOW);
+ break;
+ case RES_PARATR_FORBIDDEN_RULES:
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOCWRAP);
+ break;*/
+ default:
+ break;
+ }
+}
+
+void RtfAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const char* pStr;
+ switch ( rAlign.GetValue() )
+ {
+ case SvxParaVertAlignItem::TOP: pStr = OOO_STRING_SVTOOLS_RTF_FAHANG; break;
+ case SvxParaVertAlignItem::BOTTOM: pStr = OOO_STRING_SVTOOLS_RTF_FAVAR; break;
+ case SvxParaVertAlignItem::CENTER: pStr = OOO_STRING_SVTOOLS_RTF_FACENTER; break;
+ case SvxParaVertAlignItem::BASELINE: pStr = OOO_STRING_SVTOOLS_RTF_FAROMAN; break;
+ // default == SvxParaVertAlignItem::AUTOMATIC
+ default: pStr = OOO_STRING_SVTOOLS_RTF_FAAUTO; break;
+ }
+ m_aStyles.append(pStr);
+}
+
+void RtfAttributeOutput::ParaSnapToGrid( const SvxParaGridItem& /*rGrid*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
+ {
+ if( rSize.GetWidth() )
+ {
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSW);
+ m_aRunText.append((sal_Int32)rSize.GetWidth());
+ }
+
+ if( rSize.GetHeight() )
+ {
+ long nH = rSize.GetHeight();
+ if( ATT_FIX_SIZE == rSize.GetHeightSizeType() )
+ nH = -nH;
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSH);
+ m_aRunText.append((sal_Int32)nH);
+ }
+ }
+ else if (m_rExport.bOutPageDescs)
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGWSXN);
+ m_aSectionBreaks.append((sal_Int32)rSize.GetWidth());
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGHSXN);
+ m_aSectionBreaks.append((sal_Int32)rSize.GetHeight());
+ if (!m_bBufferSectionBreaks)
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+ }
+}
+
+void RtfAttributeOutput::FormatPaperBin( const SvxPaperBinItem& )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( !m_rExport.bOutFlyFrmAttrs )
+ {
+ if( m_rExport.bOutPageDescs )
+ {
+ if( rLRSpace.GetLeft() )
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGLSXN);
+ m_aSectionBreaks.append((sal_Int32)rLRSpace.GetLeft());
+ }
+ if( rLRSpace.GetRight() )
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGRSXN);
+ m_aSectionBreaks.append((sal_Int32)rLRSpace.GetRight());
+ }
+ if (!m_bBufferSectionBreaks)
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+ }
+ else
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LI);
+ m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RI);
+ m_aStyles.append( (sal_Int32) rLRSpace.GetRight() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LIN);
+ m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RIN);
+ m_aStyles.append( (sal_Int32) rLRSpace.GetRight() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FI);
+ m_aStyles.append( (sal_Int32) rLRSpace.GetTxtFirstLineOfst() );
+ }
+ }
+ else if (rLRSpace.GetLeft() == rLRSpace.GetRight() && m_rExport.bRTFFlySyntax)
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX;
+ m_rExport.OutLong( rLRSpace.GetLeft() );
+ }
+}
+
+void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( !m_rExport.bOutFlyFrmAttrs )
+ {
+ if( m_rExport.bOutPageDescs )
+ {
+
+ ASSERT( m_rExport.GetCurItemSet(), "Impossible" );
+ if ( !m_rExport.GetCurItemSet() )
+ return;
+
+ HdFtDistanceGlue aDistances( *m_rExport.GetCurItemSet() );
+
+ if ( aDistances.HasHeader() )
+ {
+ if( aDistances.dyaTop )
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN);
+ m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop);
+ }
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY);
+ m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrTop);
+ }
+
+ if( aDistances.HasFooter() )
+ {
+ if( aDistances.dyaBottom )
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN);
+ m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom);
+ }
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY);
+ m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom);
+ }
+ if (!m_bBufferSectionBreaks)
+ m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
+ }
+ else
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SB);
+ m_aStyles.append( (sal_Int32) rULSpace.GetUpper() );
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SA);
+ m_aStyles.append( (sal_Int32) rULSpace.GetLower() );
+ }
+ }
+ else if (rULSpace.GetUpper() == rULSpace.GetLower() && m_rExport.bRTFFlySyntax)
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTY;
+ m_rExport.OutLong( rULSpace.GetLower() );
+ }
+}
+
+void RtfAttributeOutput::FormatSurround( const SwFmtSurround& rSurround )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_rExport.bOutFlyFrmAttrs && !m_rExport.bRTFFlySyntax )
+ {
+ SwSurround eSurround = rSurround.GetSurround();
+ BOOL bGold = SURROUND_IDEAL == eSurround;
+ if( bGold )
+ eSurround = SURROUND_PARALLEL;
+ RTFSurround aMC( bGold, static_cast< BYTE >(eSurround) );
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYMAINCNT);
+ m_aRunText.append( (sal_Int32) aMC.GetValue() );
+ }
+}
+
+void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
+ {
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PVPARA);
+
+ switch (rFlyVert.GetVertOrient())
+ {
+ case text::VertOrientation::TOP:
+ case text::VertOrientation::LINE_TOP:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYT);
+ break;
+ case text::VertOrientation::BOTTOM:
+ case text::VertOrientation::LINE_BOTTOM:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYB);
+ break;
+ case text::VertOrientation::CENTER:
+ case text::VertOrientation::LINE_CENTER:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYC);
+ break;
+ case text::VertOrientation::NONE:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSY);
+ m_aRunText.append((sal_Int32)rFlyVert.GetPos());
+ break;
+ default:
+ break;
+ }
+ }
+ else if ( !m_rExport.bRTFFlySyntax )
+ {
+ RTFVertOrient aVO( static_cast< USHORT >(rFlyVert.GetVertOrient()), static_cast< USHORT >(rFlyVert.GetRelationOrient()) );
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYVERT);
+ m_aRunText.append((sal_Int32)aVO.GetValue());
+ }
+}
+
+void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
+ {
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PHCOL);
+
+ const char* pS = 0;
+ switch(rFlyHori.GetHoriOrient())
+ {
+ case text::HoriOrientation::RIGHT:
+ pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXO : OOO_STRING_SVTOOLS_RTF_POSXR;
+ break;
+ case text::HoriOrientation::LEFT:
+ pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXI : OOO_STRING_SVTOOLS_RTF_POSXL;
+ break;
+ case text::HoriOrientation::CENTER:
+ pS = OOO_STRING_SVTOOLS_RTF_POSXC;
+ break;
+ case text::HoriOrientation::NONE:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSX);
+ m_aRunText.append((sal_Int32)rFlyHori.GetPos());
+ break;
+ default:
+ break;
+ }
+ if (pS)
+ m_aRunText.append(pS);
+ } else if ( !m_rExport.bRTFFlySyntax )
+ {
+ RTFHoriOrient aHO( static_cast< USHORT >(rFlyHori.GetHoriOrient()),
+ static_cast< USHORT >(rFlyHori.GetRelationOrient()) );
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYHORZ);
+ m_aRunText.append((sal_Int32)aHO.GetValue());
+ }
+}
+
+void RtfAttributeOutput::FormatAnchor( const SwFmtAnchor& rAnchor )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( !m_rExport.bRTFFlySyntax )
+ {
+ USHORT nId = static_cast< USHORT >(rAnchor.GetAnchorId());
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYANCHOR);
+ m_aRunText.append((sal_Int32)nId);
+ switch( nId )
+ {
+ case FLY_AT_PAGE:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYPAGE);
+ m_aRunText.append((sal_Int32)rAnchor.GetPageNum());
+ break;
+ case FLY_AT_PARA:
+ case FLY_AS_CHAR:
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYCNTNT);
+ break;
+ }
+ }
+}
+
+void RtfAttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( !rBrush.GetColor().GetTransparency() )
+ {
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CBPAT);
+ m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor()));
+ }
+}
+
+void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ static USHORT __READONLY_DATA aBorders[] = {
+ BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT };
+ static const sal_Char* aBorderNames[] = {
+ OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR };
+
+ USHORT nDist = rBox.GetDistance();
+
+ if ( m_rExport.bRTFFlySyntax )
+ return;
+
+ if( rBox.GetTop() && rBox.GetBottom() &&
+ rBox.GetLeft() && rBox.GetRight() &&
+ *rBox.GetTop() == *rBox.GetBottom() &&
+ *rBox.GetTop() == *rBox.GetLeft() &&
+ *rBox.GetTop() == *rBox.GetRight() &&
+ nDist == rBox.GetDistance( BOX_LINE_TOP ) &&
+ nDist == rBox.GetDistance( BOX_LINE_LEFT ) &&
+ nDist == rBox.GetDistance( BOX_LINE_BOTTOM ) &&
+ nDist == rBox.GetDistance( BOX_LINE_RIGHT ))
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist ));
+ else
+ {
+ const USHORT* pBrd = aBorders;
+ const sal_Char** pBrdNms = (const sal_Char**)aBorderNames;
+ for(int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms)
+ {
+ if (const SvxBorderLine* pLn = rBox.GetLine(*pBrd))
+ {
+ m_aSectionBreaks.append(OutBorderLine(m_rExport, pLn, *pBrdNms,
+ rBox.GetDistance(*pBrd)));
+ }
+ }
+ }
+
+ const USHORT* pBrd = aBorders;
+ const sal_Char** pBrdNms = (const sal_Char**)aBorderNames;
+ for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms )
+ {
+ const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
+ if( pLn )
+ {
+ m_aSectionBreaks.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aSectionBreaks.append(OutBorderLine( m_rExport, pLn, *pBrdNms ));
+ m_aSectionBreaks.append("}" OOO_STRING_SVTOOLS_RTF_BRSP);
+ m_aSectionBreaks.append((sal_Int32)rBox.GetDistance( *pBrd ));
+ }
+ }
+
+ if (!m_bBufferSectionBreaks)
+ m_aStyles.append(m_aSectionBreaks.makeStringAndClear());
+}
+
+void RtfAttributeOutput::FormatColumns_Impl( USHORT nCols, const SwFmtCol& rCol, bool bEven, SwTwips nPageSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLS;
+ m_rExport.OutLong( nCols );
+
+ if( bEven )
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX;
+ m_rExport.OutLong( rCol.GetGutterWidth( TRUE ) );
+ }
+ else
+ {
+ const SwColumns & rColumns = rCol.GetColumns( );
+ for( USHORT n = 0; n < nCols; )
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO;
+ m_rExport.OutLong( n+1 );
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLW;
+ m_rExport.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) );
+
+ if( ++n != nCols )
+ {
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR;
+ m_rExport.OutLong( rColumns[ n-1 ]->GetRight() +
+ rColumns[ n ]->GetLeft() );
+ }
+ }
+ }
+}
+
+void RtfAttributeOutput::FormatKeep( const SvxFmtKeepItem& rItem )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if( rItem.GetValue() )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEPN);
+}
+
+void RtfAttributeOutput::FormatTextGrid( const SwTextGridItem& /*rGrid*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::FormatLineNumbering( const SwFmtLineNumber& rNumbering )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( !rNumbering.IsCount( ) )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOLINE);
+}
+
+void RtfAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDirection )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (!m_rExport.bOutPageDescs)
+ {
+ if (rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP)
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RTLPAR);
+ else
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LTRPAR);
+ }
+}
+
+void RtfAttributeOutput::WriteExpand( const SwField* /*pFld*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const String& /*rRef*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::HiddenField( const SwField& /*rFld*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::SetField( const SwField& /*rFld*/, ww::eField /*eType*/, const String& /*rCmd*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfAttributeOutput::PostitField( const SwField* pFld )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ const SwPostItField& rPFld = *(SwPostItField*)pFld;
+
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNID " ");
+ m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding));
+ m_aRunText.append("}");
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNAUTHOR " ");
+ m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding));
+ m_aRunText.append("}");
+ m_aRunText.append(OOO_STRING_SVTOOLS_RTF_CHATN);
+
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ANNOTATION);
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNDATE " ");
+ m_aRunText.append((sal_Int32)sw::ms::DateTime2DTTM(rPFld.GetDate()));
+ m_aRunText.append('}');
+ m_aRunText.append(OUStringToOString(OUString(rPFld.GetTxt()), m_rExport.eCurrentEncoding));
+ m_aRunText.append('}');
+}
+
+bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ )
+{
+ // this is handled in OutputFlyFrame_Impl()
+ return true;
+}
+
+RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport )
+ : m_rExport( rExport ),
+ m_pTableWrt( NULL ),
+ m_bTableCellOpen( false ),
+ m_nTableDepth( 0 ),
+ m_bTblAfterCell( false ),
+ m_nColBreakNeeded( false ),
+ m_bBufferSectionBreaks( false ),
+ m_bBufferSectionHeaders( false ),
+ m_bLastTable( true ),
+ m_bWroteCellInfo( false )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+}
+
+RtfAttributeOutput::~RtfAttributeOutput()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+}
+
+MSWordExportBase& RtfAttributeOutput::GetExport()
+{
+ return m_rExport;
+}
+
+// These are used by wwFont::WriteRtf()
+
+/// Start the font.
+void RtfAttributeOutput::StartFont( const String& rFamilyName ) const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OUStringToOString( OUString( rFamilyName ), m_rExport.eCurrentEncoding ).getStr();
+}
+
+/// End the font.
+void RtfAttributeOutput::EndFont() const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << ";}";
+}
+
+/// Alternate name for the font.
+void RtfAttributeOutput::FontAlternateName( const String& rName ) const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FALT << ' ';
+ m_rExport.Strm() << OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ) << '}';
+}
+
+/// Font charset.
+void RtfAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET;
+ m_rExport.OutULong( nCharSet );
+ m_rExport.Strm() << ' ';
+}
+
+/// Font family.
+void RtfAttributeOutput::FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F;
+
+ const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL;
+ switch (eFamily)
+ {
+ case FAMILY_ROMAN:
+ pStr = OOO_STRING_SVTOOLS_RTF_FROMAN;
+ break;
+ case FAMILY_SWISS:
+ pStr = OOO_STRING_SVTOOLS_RTF_FSWISS;
+ break;
+ case FAMILY_MODERN:
+ pStr = OOO_STRING_SVTOOLS_RTF_FMODERN;
+ break;
+ case FAMILY_SCRIPT:
+ pStr = OOO_STRING_SVTOOLS_RTF_FSCRIPT;
+ break;
+ case FAMILY_DECORATIVE:
+ pStr = OOO_STRING_SVTOOLS_RTF_FDECOR;
+ break;
+ default:
+ break;
+ }
+ m_rExport.OutULong(m_rExport.maFontHelper.GetId(rFont)) << pStr;
+}
+
+/// Font pitch.
+void RtfAttributeOutput::FontPitchType( FontPitch ePitch ) const
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FPRQ;
+
+ USHORT nVal = 0;
+ switch (ePitch)
+ {
+ case PITCH_FIXED:
+ nVal = 1;
+ break;
+ case PITCH_VARIABLE:
+ nVal = 2;
+ break;
+ default:
+ break;
+ }
+ m_rExport.OutULong(nVal);
+}
+
+static bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize)
+{
+ if (pGraphicAry && (nSize > 0x2c ))
+ {
+ // check the magic number
+ if (
+ (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) &&
+ (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46)
+ )
+ {
+ //emf detected
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize)
+{
+ if (rpGraphicAry && (rSize > 0x22))
+ {
+ if (
+ (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) &&
+ (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a)
+ )
+ { // we have to get rid of the metafileheader
+ rpGraphicAry += 22;
+ rSize -= 22;
+ return true;
+ }
+ }
+ return false;
+}
+
+static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, sal_uInt32 nLimit = 64)
+{
+ OStringBuffer aRet;
+
+ sal_uInt32 nBreak = 0;
+ for (sal_uInt32 i = 0; i < nSize; i++)
+ {
+ OString sNo = OString::valueOf(sal_Int32(pData[i]), 16);
+ if (sNo.getLength() < 2)
+ aRet.append('0');
+ aRet.append(sNo);
+ if (++nBreak == nLimit)
+ {
+ aRet.append(RtfExport::sNewLine);
+ nBreak = 0;
+ }
+ }
+
+ return aRet.makeStringAndClear();
+}
+
+static OString WriteHex(sal_Int32 nNum)
+{
+ return WriteHex((sal_uInt8*)&nNum, sizeof(sal_Int32));
+}
+
+static OString WriteHex(OString sString)
+{
+ OStringBuffer aRet;
+
+ aRet.append(WriteHex(sString.getLength()+1));
+ aRet.append(WriteHex((sal_uInt8*)sString.getStr(), sString.getLength()+1));
+
+ return aRet.makeStringAndClear();
+}
+
+void lcl_AppendSP( OStringBuffer& rBuffer,
+ const char cName[],
+ const ::rtl::OUString& rValue,
+ const RtfExport& rExport )
+{
+ rBuffer.append( "{" OOO_STRING_SVTOOLS_RTF_SP "{" ); // "{\sp{"
+ rBuffer.append( OOO_STRING_SVTOOLS_RTF_SN " " );//" \sn "
+ rBuffer.append( cName ); //"PropName"
+ rBuffer.append( "}{" OOO_STRING_SVTOOLS_RTF_SV " " );
+// "}{ \sv "
+ rBuffer.append( rExport.OutString( rValue, rExport.eCurrentEncoding ) );
+ rBuffer.append( "}}" );
+}
+
+static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, const Size &rOrig, const Size &rRendered, const Size &rMapped,
+ const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry,
+ unsigned long nSize, const RtfExport& rExport )
+{
+ OStringBuffer aRet;
+ bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
+ if (pBLIPType && nSize && pGraphicAry)
+ {
+ aRet.append("{" OOO_STRING_SVTOOLS_RTF_PICT);
+
+ if( pFlyFrmFmt )
+ {
+ String sDescription = pFlyFrmFmt->GetObjDescription();
+ //write picture properties - wzDescription at first
+ //looks like: "{\*\picprop{\sp{\sn PropertyName}{\sv PropertyValue}}}"
+ aRet.append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_PICPROP );//"{\*\picprop
+ lcl_AppendSP( aRet, "wzDescription", sDescription, rExport );
+ String sName = pFlyFrmFmt->GetObjTitle();
+ lcl_AppendSP( aRet, "wzName", sName, rExport );
+ aRet.append( "}" ); //"}"
+ }
+
+ long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight());
+ long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom());
+ /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused
+ crashes. */
+ if( !nXCroppedSize )
+ nXCroppedSize = 100;
+ if( !nYCroppedSize )
+ nYCroppedSize = 100;
+
+ //Given the original size and taking cropping into account
+ //first, how much has the original been scaled to get the
+ //final rendered size
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEX);
+ aRet.append((sal_Int32)((100 * rRendered.Width()) / nXCroppedSize));
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEY);
+ aRet.append((sal_Int32)((100 * rRendered.Height()) / nYCroppedSize));
+
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPL);
+ aRet.append((sal_Int32)rCr.GetLeft());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPR);
+ aRet.append((sal_Int32)rCr.GetRight());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPT);
+ aRet.append((sal_Int32)rCr.GetTop());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPB);
+ aRet.append((sal_Int32)rCr.GetBottom());
+
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICW);
+ aRet.append((sal_Int32)rMapped.Width());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICH);
+ aRet.append((sal_Int32)rMapped.Height());
+
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICWGOAL);
+ aRet.append((sal_Int32)rOrig.Width());
+ aRet.append(OOO_STRING_SVTOOLS_RTF_PICHGOAL);
+ aRet.append((sal_Int32)rOrig.Height());
+
+ aRet.append(pBLIPType);
+ if (bIsWMF)
+ {
+ aRet.append((sal_Int32)8);
+ StripMetafileHeader(pGraphicAry, nSize);
+ }
+ aRet.append(RtfExport::sNewLine);
+ aRet.append(WriteHex(pGraphicAry, nSize));
+ aRet.append('}');
+ }
+ return aRet.makeStringAndClear();
+}
+
+void RtfAttributeOutput::FlyFrameOLEData( SwOLENode& rOLENode )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef());
+ sal_Int64 nAspect = rOLENode.GetAspect();
+ svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
+ SvGlobalName aObjName(aObjRef->getClassID());
+
+ if (SotExchange::IsMath(aObjName))
+ {
+ // ObjectHeader
+ m_aRunText.append(WriteHex(0x00000501)); // OLEVersion
+ m_aRunText.append(WriteHex(0x00000002)); // FormatID
+ m_aRunText.append(WriteHex(OString("Equation.3"))); // ClassName
+ m_aRunText.append(WriteHex(0x00000000)); // TopicName
+ m_aRunText.append(WriteHex(0x00000000)); // ItemName
+
+ // NativeData
+ SvMemoryStream *pStream = new SvMemoryStream;
+ SvStorage* pStorage = new SvStorage(*pStream);
+ m_rExport.pOLEExp->ExportOLEObject( aObjRef, *pStorage );
+ pStream->Seek(STREAM_SEEK_TO_END);
+ sal_uInt32 nNativeDataSize = pStream->Tell();
+ const sal_uInt8* pNativeData = (sal_uInt8*)pStream->GetData();
+ m_aRunText.append(WriteHex(nNativeDataSize));
+ m_aRunText.append(RtfExport::sNewLine);
+ m_aRunText.append(WriteHex(pNativeData, nNativeDataSize, 126));
+ m_aRunText.append(RtfExport::sNewLine);
+ delete pStream;
+
+ // MetaFilePresentationObject
+ pStream = new SvMemoryStream;
+ Graphic* pGraphic = rOLENode.GetGraphic();
+ if (GraphicConverter::Export(*pStream, *pGraphic, CVT_WMF) != ERRCODE_NONE)
+ OSL_ENSURE(false, "failed to export the presentation data");
+ pStream->Seek(STREAM_SEEK_TO_END);
+ sal_uInt32 nPresentationDataSize = pStream->Tell();
+ const sal_uInt8* pPresentationData = (sal_uInt8*)pStream->GetData();
+ m_aRunText.append(WriteHex(pPresentationData, nPresentationDataSize, 126));
+ }
+}
+
+void RtfAttributeOutput::FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ SvMemoryStream aStream;
+ const sal_uInt8* pGraphicAry = 0;
+ sal_uInt32 nSize = 0;
+ Graphic* pGraphic = rOLENode.GetGraphic();
+
+ Size aSize(sw::util::GetSwappedInSize(rOLENode));
+ Size aRendered(aSize);
+ aRendered.Width() = rSize.Width();
+ aRendered.Height() = rSize.Height();
+ Size aMapped(pGraphic->GetPrefSize());
+ const SwCropGrf &rCr = (const SwCropGrf &)rOLENode.GetAttr(RES_GRFATR_CROPGRF);
+ const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
+
+ if (GraphicConverter::Export(aStream, *pGraphic, CVT_WMF) != ERRCODE_NONE)
+ OSL_ENSURE(false, "failed to export the graphic");
+ aStream.Seek(STREAM_SEEK_TO_END);
+ nSize = aStream.Tell();
+ pGraphicAry = (sal_uInt8*)aStream.GetData();
+
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_OBJECT OOO_STRING_SVTOOLS_RTF_OBJEMB);
+
+ // export the object data in the appropriate format; RTF requires the usage of the OLE 1.0 format
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_OBJDATA " ");
+ FlyFrameOLEData(rOLENode);
+ m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_RESULT);
+
+ SwTwips nHeight = aSize.Height();
+ nHeight/=20; //nHeight was in twips, want it in half points, but then half of total height.
+ long nFontHeight = ((const SvxFontHeightItem&)m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight();
+ nHeight-=nFontHeight/20;
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_DN).append(nHeight);
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT);
+ m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
+ m_aRunText.append("}}}}");
+}
+
+void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ SvMemoryStream aStream;
+ const sal_uInt8* pGraphicAry = 0;
+ sal_uInt32 nSize = 0;
+
+ Graphic aGraphic(rGrfNode.GetGrf());
+
+ // If there is no graphic there is not much point in parsing it
+ if(aGraphic.GetType()==GRAPHIC_NONE)
+ return;
+
+ GfxLink aGraphicLink;
+ const sal_Char* pBLIPType = 0;
+ if (aGraphic.IsLink())
+ {
+ aGraphicLink = aGraphic.GetLink();
+ nSize = aGraphicLink.GetDataSize();
+ pGraphicAry = aGraphicLink.GetData();
+ switch (aGraphicLink.GetType())
+ {
+ case GFX_LINK_TYPE_NATIVE_JPG:
+ pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP;
+ break;
+ case GFX_LINK_TYPE_NATIVE_PNG:
+ pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
+ break;
+ case GFX_LINK_TYPE_NATIVE_WMF:
+ pBLIPType =
+ IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ GraphicType eGraphicType = aGraphic.GetType();
+ if (!pGraphicAry)
+ {
+ if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic,
+ (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF))
+ {
+ pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ?
+ OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
+ aStream.Seek(STREAM_SEEK_TO_END);
+ nSize = aStream.Tell();
+ pGraphicAry = (sal_uInt8*)aStream.GetData();
+ }
+ }
+
+ Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize());
+
+ const SwCropGrf &rCr = (const SwCropGrf &)rGrfNode.GetAttr(RES_GRFATR_CROPGRF);
+
+ //Get original size in twips
+ Size aSize(sw::util::GetSwappedInSize(rGrfNode));
+ Size aRendered(aSize);
+ aRendered.Width() = rSize.Width();
+ aRendered.Height() = rSize.Height();
+
+ /*
+ If the graphic is not of type WMF then we will have to store two
+ graphics, one in the native format wrapped in shppict, and the other in
+ the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its
+ a wmf already then we don't need any such wrapping
+ */
+ bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
+ if (!bIsWMF)
+ m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT);
+
+ if (pBLIPType)
+ m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport));
+ else
+ {
+ aStream.Seek(0);
+ GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
+ pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
+ aStream.Seek(STREAM_SEEK_TO_END);
+ nSize = aStream.Tell();
+ pGraphicAry = (sal_uInt8*)aStream.GetData();
+
+ m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
+ }
+
+ if (!bIsWMF)
+ {
+ m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT);
+
+ aStream.Seek(0);
+ GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
+ pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
+ aStream.Seek(STREAM_SEEK_TO_END);
+ nSize = aStream.Tell();
+ pGraphicAry = (sal_uInt8*)aStream.GetData();
+
+ m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
+
+ m_aRunText.append('}');
+ }
+
+ m_aRunText.append(m_rExport.sNewLine);
+}
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
new file mode 100644
index 000000000000..af54802aa5d6
--- /dev/null
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -0,0 +1,590 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFATTRIBUTEOUTPUT_HXX_
+#define _RTFATTRIBUTEOUTPUT_HXX_
+
+#include <set>
+#include "attributeoutputbase.hxx"
+#include "fields.hxx"
+
+#include <vcl/vclenum.hxx>
+
+#include <fldbas.hxx>
+#include <rtl/strbuf.hxx>
+
+#include <vector>
+
+class RtfExport;
+
+class SwGrfNode;
+class SwOLENode;
+class SdrObject;
+class SwFlyFrmFmt;
+
+class RtfAttributeOutput : public AttributeOutputBase
+{
+public:
+ /// Export the state of RTL/CJK.
+ virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript );
+
+ /// Start of the paragraph.
+ virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo );
+
+ /// End of the paragraph.
+ virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
+
+ /// Empty paragraph.
+ virtual void EmptyParagraph();
+
+ /// Called before we start outputting the attributes.
+ virtual void StartParagraphProperties( const SwTxtNode& rNode );
+
+ /// Called after we end outputting the attributes.
+ virtual void EndParagraphProperties();
+
+ /// Start of the text run.
+ virtual void StartRun( const SwRedlineData* pRedlineData );
+
+ /// End of the text run.
+ virtual void EndRun();
+
+ /// Called before we start outputting the attributes.
+ virtual void StartRunProperties();
+
+ /// Called after we end outputting the attributes.
+ virtual void EndRunProperties( const SwRedlineData* pRedlineData );
+
+ /// Output text (inside a run).
+ virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
+
+ // Access to (anyway) private buffers, used by the sdr exporter
+ rtl::OStringBuffer& RunText();
+ rtl::OStringBuffer& Styles();
+
+ /// Output text (without markup).
+ virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
+
+ /// Output ruby start.
+ virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby );
+
+ /// Output ruby end.
+ virtual void EndRuby();
+
+ /// Output URL start.
+ virtual bool StartURL( const String& rUrl, const String& rTarget );
+
+ /// Output URL end.
+ virtual bool EndURL();
+
+ virtual void FieldVanish( const String& rTxt, ww::eField eType );
+
+ /// Output redlining.
+ ///
+ /// The common attribute that can be among the run properties.
+ virtual void Redline( const SwRedlineData* pRedline );
+
+ virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, USHORT nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
+
+ /// Output style.
+ virtual void ParagraphStyle( USHORT nStyle );
+
+ virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo );
+
+ virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner );
+
+ virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ virtual void TableRowEnd( sal_uInt32 nDepth );
+
+ /// Start of the styles table.
+ virtual void StartStyles();
+
+ /// End of the styles table.
+ virtual void EndStyles( USHORT nNumberOfStyles );
+
+ /// Write default style.
+ virtual void DefaultStyle( USHORT nStyle );
+
+ /// Start of a style in the styles table.
+ virtual void StartStyle( const String& rName, bool bPapFmt,
+ USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId );
+
+ /// End of a style in the styles table.
+ virtual void EndStyle();
+
+ /// Start of (paragraph or run) properties of a style.
+ virtual void StartStyleProperties( bool bParProp, USHORT nStyle );
+
+ /// End of (paragraph or run) properties of a style.
+ virtual void EndStyleProperties( bool bParProp );
+
+ /// Numbering rule and Id.
+ virtual void OutlineNumbering( BYTE nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt );
+
+ /// Page break
+ /// As a paragraph property - the paragraph should be on the next page.
+ virtual void PageBreakBefore( bool bBreak );
+
+ /// Write a section break
+ /// msword::ColumnBreak or msword::PageBreak
+ virtual void SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo = NULL );
+
+ /// Start of the section properties.
+ virtual void StartSection();
+
+ /// End of the section properties.
+ virtual void EndSection();
+
+ /// Protection of forms.
+ virtual void SectionFormProtection( bool bProtected );
+
+ /// Numbering of the lines in the document.
+ virtual void SectionLineNumbering( ULONG nRestartNo, const SwLineNumberInfo& rLnNumInfo );
+
+ /// Has different headers/footers for the title page.
+ virtual void SectionTitlePage();
+
+ /// Description of the page borders.
+ virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt );
+
+ /// Columns populated from right/numbers on the right side?
+ virtual void SectionBiDi( bool bBiDi );
+
+ /// The style of the page numbers.
+ ///
+ /// nPageRestartNumberr being 0 means no restart.
+ virtual void SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber );
+
+ /// The type of breaking.
+ virtual void SectionType( BYTE nBreakCode );
+
+ /// Definition of a numbering instance.
+ virtual void NumberingDefinition( USHORT nId, const SwNumRule &rRule );
+
+ /// Start of the abstract numbering definition instance.
+ virtual void StartAbstractNumbering( USHORT nId );
+
+ /// End of the abstract numbering definition instance.
+ virtual void EndAbstractNumbering();
+
+ /// All the numbering level information.
+ virtual void NumberingLevel( BYTE nLevel,
+ USHORT nStart,
+ USHORT nNumberingType,
+ SvxAdjust eAdjust,
+ const BYTE *pNumLvlPos,
+ BYTE nFollow,
+ const wwFont *pFont,
+ const SfxItemSet *pOutSet,
+ sal_Int16 nIndentAt,
+ sal_Int16 nFirstLineIndex,
+ sal_Int16 nListTabPos,
+ const String &rNumberingString );
+
+ void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, BYTE nMode );
+ void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds );
+ void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr );
+
+protected:
+ /// Output frames - the implementation.
+ virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft );
+
+ /// Sfx item Sfx item RES_CHRATR_CASEMAP
+ virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap );
+
+ /// Sfx item Sfx item RES_CHRATR_COLOR
+ virtual void CharColor( const SvxColorItem& rColor);
+
+ /// Sfx item Sfx item RES_CHRATR_CONTOUR
+ virtual void CharContour( const SvxContourItem& rContour );
+
+ /// Sfx item RES_CHRATR_CROSSEDOUT
+ virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut );
+
+ /// Sfx item RES_CHRATR_ESCAPEMENT
+ virtual void CharEscapement( const SvxEscapementItem& rEscapement );
+
+ /// Sfx item RES_CHRATR_FONT
+ virtual void CharFont( const SvxFontItem& rFont );
+
+ /// Sfx item RES_CHRATR_FONTSIZE
+ virtual void CharFontSize( const SvxFontHeightItem& rFontSize );
+
+ /// Sfx item RES_CHRATR_KERNING
+ virtual void CharKerning( const SvxKerningItem& rKerning );
+
+ /// Sfx item RES_CHRATR_LANGUAGE
+ virtual void CharLanguage( const SvxLanguageItem& rLanguage );
+
+ /// Sfx item RES_CHRATR_POSTURE
+ virtual void CharPosture( const SvxPostureItem& rPosture );
+
+ /// Sfx item RES_CHRATR_SHADOWED
+ virtual void CharShadow( const SvxShadowedItem& rShadow );
+
+ /// Sfx item RES_CHRATR_UNDERLINE
+ virtual void CharUnderline( const SvxUnderlineItem& rUnderline );
+
+ /// Sfx item RES_CHRATR_WEIGHT
+ virtual void CharWeight( const SvxWeightItem& rWeight );
+
+ /// Sfx item RES_CHRATR_AUTOKERN
+ virtual void CharAutoKern( const SvxAutoKernItem& );
+
+ /// Sfx item RES_CHRATR_BLINK
+ virtual void CharAnimatedText( const SvxBlinkItem& rBlink );
+
+ /// Sfx item RES_CHRATR_BACKGROUND
+ virtual void CharBackground( const SvxBrushItem& rBrush );
+
+ /// Sfx item RES_CHRATR_CJK_FONT
+ virtual void CharFontCJK( const SvxFontItem& rFont );
+
+ /// Sfx item RES_CHRATR_CJK_FONTSIZE
+ virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize );
+
+ /// Sfx item RES_CHRATR_CJK_LANGUAGE
+ virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem );
+
+ /// Sfx item RES_CHRATR_CJK_POSTURE
+ virtual void CharPostureCJK( const SvxPostureItem& rPosture );
+
+ /// Sfx item RES_CHRATR_CJK_WEIGHT
+ virtual void CharWeightCJK( const SvxWeightItem& rWeight );
+
+ /// Sfx item RES_CHRATR_CTL_FONT
+ virtual void CharFontCTL( const SvxFontItem& rFont );
+
+ /// Sfx item RES_CHRATR_CTL_FONTSIZE
+ virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize );
+
+ /// Sfx item RES_CHRATR_CTL_LANGUAGE
+ virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem );
+
+ /// Sfx item RES_CHRATR_CTL_POSTURE
+ virtual void CharPostureCTL( const SvxPostureItem& rWeight );
+
+ /// Sfx item RES_CHRATR_CTL_WEIGHT
+ virtual void CharWeightCTL( const SvxWeightItem& rWeight );
+
+ /// Sfx item RES_CHRATR_ROTATE
+ virtual void CharRotate( const SvxCharRotateItem& rRotate );
+
+ /// Sfx item RES_CHRATR_EMPHASIS_MARK
+ virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark );
+
+ /// Sfx item RES_CHRATR_TWO_LINES
+ virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines );
+
+ /// Sfx item RES_CHRATR_SCALEW
+ virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth );
+
+ /// Sfx item RES_CHRATR_RELIEF
+ virtual void CharRelief( const SvxCharReliefItem& rRelief);
+
+ /// Sfx item RES_CHRATR_HIDDEN
+ virtual void CharHidden( const SvxCharHiddenItem& rHidden );
+
+ /// Sfx item RES_TXTATR_INETFMT
+ virtual void TextINetFormat( const SwFmtINetFmt& );
+
+ /// Sfx item RES_TXTATR_CHARFMT
+ virtual void TextCharFormat( const SwFmtCharFmt& );
+
+ /// Sfx item RES_TXTATR_FTN
+ virtual void TextFootnote_Impl( const SwFmtFtn& );
+
+ /// Sfx item RES_PARATR_LINESPACING
+ virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
+
+ /// Sfx item RES_PARATR_ADJUST
+ virtual void ParaAdjust( const SvxAdjustItem& rAdjust );
+
+ /// Sfx item RES_PARATR_SPLIT
+ virtual void ParaSplit( const SvxFmtSplitItem& rSplit );
+
+ /// Sfx item RES_PARATR_WIDOWS
+ virtual void ParaWidows( const SvxWidowsItem& rWidows );
+
+ /// Sfx item RES_PARATR_TABSTOP
+ virtual void ParaTabStop( const SvxTabStopItem& rTabStop );
+
+ /// Sfx item RES_PARATR_HYPHENZONE
+ virtual void ParaHyphenZone( const SvxHyphenZoneItem& );
+
+ /// Sfx item RES_PARATR_NUMRULE
+ virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId );
+
+ /// Sfx item RES_PARATR_SCRIPTSPACE
+ virtual void ParaScriptSpace( const SfxBoolItem& );
+
+ /// Sfx item RES_PARATR_VERTALIGN
+ virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign );
+
+ /// Sfx item RES_PARATR_SNAPTOGRID
+ virtual void ParaSnapToGrid( const SvxParaGridItem& );
+
+ /// Sfx item RES_FRM_SIZE
+ virtual void FormatFrameSize( const SwFmtFrmSize& );
+
+ /// Sfx item RES_PAPER_BIN
+ virtual void FormatPaperBin( const SvxPaperBinItem& );
+
+ /// Sfx item RES_LR_SPACE
+ virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace );
+
+ /// Sfx item RES_UL_SPACE
+ virtual void FormatULSpace( const SvxULSpaceItem& rULSpace );
+
+ /// Sfx item RES_SURROUND
+ virtual void FormatSurround( const SwFmtSurround& );
+
+ /// Sfx item RES_VERT_ORIENT
+ virtual void FormatVertOrientation( const SwFmtVertOrient& );
+
+ /// Sfx item RES_HORI_ORIENT
+ virtual void FormatHorizOrientation( const SwFmtHoriOrient& );
+
+ /// Sfx item RES_ANCHOR
+ virtual void FormatAnchor( const SwFmtAnchor& );
+
+ /// Sfx item RES_BACKGROUND
+ virtual void FormatBackground( const SvxBrushItem& );
+
+ /// Sfx item RES_BOX
+ virtual void FormatBox( const SvxBoxItem& );
+
+ /// Sfx item RES_COL
+ virtual void FormatColumns_Impl( USHORT nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize );
+
+ /// Sfx item RES_KEEP
+ virtual void FormatKeep( const SvxFmtKeepItem& );
+
+ /// Sfx item RES_TEXTGRID
+ virtual void FormatTextGrid( const SwTextGridItem& );
+
+ /// Sfx item RES_LINENUMBER
+ virtual void FormatLineNumbering( const SwFmtLineNumber& );
+
+ /// Sfx item RES_FRAMEDIR
+ virtual void FormatFrameDirection( const SvxFrameDirectionItem& );
+
+ /// Write the expanded field
+ virtual void WriteExpand( const SwField* pFld );
+
+ virtual void RefField( const SwField& rFld, const String& rRef );
+ virtual void HiddenField( const SwField& rFld );
+ virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd );
+ virtual void PostitField( const SwField* pFld );
+ virtual bool DropdownField( const SwField* pFld );
+
+ /// Reference to the export, where to get the data from
+ RtfExport &m_rExport;
+
+private:
+
+ /// Output graphic fly frames.
+ void FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize );
+ void FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize );
+ void FlyFrameOLEData( SwOLENode& rOLENode );
+
+ /*
+ * Table methods.
+ */
+
+ void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
+ void EndTableCell( );
+
+ void EndTableRow( );
+
+ void EndTable();
+
+ /// End cell, row, and even the entire table if necessary.
+ void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false );
+
+ void WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote);
+
+ /*
+ * Current style name and its ID.
+ */
+ String m_rStyleName;
+ USHORT m_nStyleId;
+ /*
+ * Current list ID.
+ */
+ USHORT m_nListId;
+ /*
+ * This is needed because the call order is: run text, run properties, paragraph properties.
+ * What we need is the opposite.
+ */
+ rtl::OStringBuffer m_aRun;
+ rtl::OStringBuffer m_aRunText;
+ /*
+ * This is written after runs.
+ */
+ rtl::OStringBuffer m_aAfterRuns;
+ /*
+ * Same for colors and stylesheets: first we just want to output colors,
+ * need to buffer the stylesheet table to output it after the color one.
+ */
+ rtl::OStringBuffer m_aStylesheet;
+ /*
+ * This one just holds the style commands in the current style.
+ */
+ rtl::OStringBuffer m_aStyles;
+ /*
+ * This is the same as m_aStyles but the conents of it is written last.
+ */
+ rtl::OStringBuffer m_aStylesEnd;
+
+ /*
+ * We just get a "end of strike" mark at the end of strike, store here what to finish: single or double strike.
+ */
+ bool m_bStrikeDouble;
+
+ /*
+ * The current table helper.
+ */
+ SwWriteTable *m_pTableWrt;
+
+ /*
+ * Remember if we are in an open cell, or not.
+ */
+ bool m_bTableCellOpen;
+
+ /*
+ * Remember the current table depth.
+ */
+ sal_uInt32 m_nTableDepth;
+
+ /*
+ * Remember if we wrote a \cell or not.
+ */
+ bool m_bTblAfterCell;
+
+ /*
+ * For late output of row definitions.
+ */
+ rtl::OStringBuffer m_aRowDefs;
+
+ /*
+ * Is a column break needed after the next \par?
+ */
+ bool m_nColBreakNeeded;
+
+ /*
+ * If section breaks should be buffered to m_aSectionBreaks
+ */
+ bool m_bBufferSectionBreaks;
+ rtl::OStringBuffer m_aSectionBreaks;
+
+ /*
+ * If section headers (and footers) should be buffered to
+ * m_aSectionHeaders.
+ */
+ bool m_bBufferSectionHeaders;
+ rtl::OStringBuffer m_aSectionHeaders;
+
+ /*
+ * Support for starting multiple tables at the same cell.
+ * If the current table is the last started one.
+ */
+ bool m_bLastTable;
+ /*
+ * List of already started but not yet defined tables (need to be defined
+ * after the nested tables).
+ */
+ std::vector< rtl::OString > m_aTables;
+ /*
+ * If cell info is already output.
+ */
+ bool m_bWroteCellInfo;
+
+public:
+ RtfAttributeOutput( RtfExport &rExport );
+
+ virtual ~RtfAttributeOutput();
+
+ /// Return the right export class.
+ virtual MSWordExportBase& GetExport();
+
+ rtl::OStringBuffer m_aTabStop;
+
+ // These are used by wwFont::WriteRtf()
+ /// Start the font.
+ void StartFont( const String& rFamilyName ) const;
+
+ /// End the font.
+ void EndFont() const;
+
+ /// Alternate name for the font.
+ void FontAlternateName( const String& rName ) const;
+
+ /// Font charset.
+ void FontCharset( sal_uInt8 nCharSet ) const;
+
+ /// Font family.
+ void FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const;
+
+ /// Font pitch.
+ void FontPitchType( FontPitch ePitch ) const;
+};
+
+#endif // _RTFATTRIBUTEOUTPUT_HXX_
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
new file mode 100644
index 000000000000..f4f3f7166fe0
--- /dev/null
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -0,0 +1,1269 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "rtfexport.hxx"
+#include "rtfexportfilter.hxx"
+#include "rtfsdrexport.hxx"
+
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/i18n/ScriptType.hdl>
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <map>
+#include <algorithm>
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <sstream>
+
+#include <IMark.hxx>
+#include <docsh.hxx>
+#include <ndtxt.hxx>
+#include <wrtww8.hxx>
+#include <fltini.hxx>
+#include <fmtline.hxx>
+#include <fmtpdsc.hxx>
+#include <frmfmt.hxx>
+#include <section.hxx>
+#include <pagedesc.hxx>
+#include <swtable.hxx>
+#include <fmtfsize.hxx>
+#include <frmatr.hxx>
+#include <ftninfo.hxx>
+#include <fmthdft.hxx>
+#include <editeng/fontitem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/shaditem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/paperinf.hxx>
+#include <editeng/protitem.hxx>
+
+#include <docary.hxx>
+#include <numrule.hxx>
+#include <charfmt.hxx>
+#include <lineinfo.hxx>
+#include <swmodule.hxx>
+
+#include "ww8par.hxx"
+#include "ww8scan.hxx"
+
+#include <comphelper/string.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <vcl/font.hxx>
+#include <svtools/rtfkeywd.hxx>
+#include <unotools/configmgr.hxx>
+
+using namespace ::comphelper;
+using namespace ::com::sun::star;
+
+using rtl::OString;
+using rtl::OUString;
+using rtl::OStringBuffer;
+using rtl::OUStringBuffer;
+
+using sw::mark::IMark;
+
+#if defined(UNX)
+const sal_Char RtfExport::sNewLine = '\012';
+#else
+const sal_Char __FAR_DATA RtfExport::sNewLine[] = "\015\012";
+#endif
+
+// the default text encoding for the export, if it doesn't fit unicode will
+// be used
+#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US
+
+AttributeOutputBase& RtfExport::AttrOutput() const
+{
+ return *m_pAttrOutput;
+}
+
+MSWordSections& RtfExport::Sections() const
+{
+ return *m_pSections;
+}
+
+RtfSdrExport& RtfExport::SdrExporter() const
+{
+ return *m_pSdrExport;
+}
+
+bool RtfExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich )
+{
+ // FIXME is this actually true for rtf? - this is copied from DOCX
+ if ( nScript == i18n::ScriptType::ASIAN )
+ {
+ // for asian in ww8, there is only one fontsize
+ // and one fontstyle (posture/weight)
+ switch ( nWhich )
+ {
+ case RES_CHRATR_FONTSIZE:
+ case RES_CHRATR_POSTURE:
+ case RES_CHRATR_WEIGHT:
+ return false;
+ default:
+ break;
+ }
+ }
+ else if ( nScript != i18n::ScriptType::COMPLEX )
+ {
+ // for western in ww8, there is only one fontsize
+ // and one fontstyle (posture/weight)
+ switch ( nWhich )
+ {
+ case RES_CHRATR_CJK_FONTSIZE:
+ case RES_CHRATR_CJK_POSTURE:
+ case RES_CHRATR_CJK_WEIGHT:
+ return false;
+ default:
+ break;
+ }
+ }
+ return true;
+}
+
+void RtfExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ std::vector< OUString > aStarts;
+ std::vector< OUString > aEnds;
+
+ IMarkVector aMarks;
+ if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarks ) )
+ {
+ for ( IMarkVector::const_iterator it = aMarks.begin(), end = aMarks.end();
+ it < end; ++it )
+ {
+ IMark* pMark = (*it);
+ xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex();
+ xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex();
+
+ if ( nStart == nAktPos )
+ aStarts.push_back( pMark->GetName() );
+
+ if ( nEnd == nAktPos )
+ aEnds.push_back( pMark->GetName() );
+ }
+ }
+
+ m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds );
+}
+
+void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ std::vector<OUString> aStarts;
+ std::vector<OUString> aEnds;
+
+ aStarts.push_back(rName);
+ aEnds.push_back(rName);
+
+ m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
+}
+
+void RtfExport::WriteChar( sal_Unicode )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* WriteChar() has nothing to do for rtf. */
+}
+
+static bool IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 )
+{
+ BYTE nEnd = MAXLEVEL;
+ while( nEnd-- && !rRule.GetNumFmt( nEnd ))
+ ;
+ ++nEnd;
+
+ const SwNumFmt* pNFmt;
+ BYTE nLvl;
+
+ for( nLvl = 0; nLvl < nEnd; ++nLvl )
+ if( SVX_NUM_NUMBER_NONE != ( pNFmt = &rRule.Get( nLvl ))
+ ->GetNumberingType() || pNFmt->GetPrefix().Len() ||
+ (pNFmt->GetSuffix().Len() && pNFmt->GetSuffix() != aDotStr ))
+ break;
+
+ if( pEnd )
+ *pEnd = nEnd;
+ return nLvl != nEnd;
+}
+
+void RtfExport::BuildNumbering()
+{
+ const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl();
+
+ for( USHORT n = rListTbl.Count()+1; n; )
+ {
+ SwNumRule* pRule;
+ --n;
+ if( n == rListTbl.Count() )
+ pRule = (SwNumRule*)pDoc->GetOutlineNumRule();
+ else
+ {
+ pRule = rListTbl[ n ];
+ if( !pDoc->IsUsed( *pRule ))
+ continue;
+ }
+
+ if( IsExportNumRule( *pRule ))
+ GetId( *pRule );
+ }
+}
+
+void RtfExport::WriteNumbering()
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+
+ if ( !pUsedNumTbl )
+ return; // no numbering is used
+
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_LISTTABLE;
+ AbstractNumberingDefinitions();
+ Strm() << '}';
+
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE;
+ NumberingDefinitions();
+ Strm() << '}';
+
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteRevTab()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ int nRevAuthors = pDoc->GetRedlineTbl().Count();
+
+ if (nRevAuthors < 1)
+ return;
+
+ // RTF always seems to use Unknown as the default first entry
+ String sUnknown(RTL_CONSTASCII_USTRINGPARAM("Unknown"));
+ GetRedline(sUnknown);
+
+ for( USHORT i = 0; i < pDoc->GetRedlineTbl().Count(); ++i )
+ {
+ const SwRedline* pRedl = pDoc->GetRedlineTbl()[ i ];
+
+ GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor()));
+ }
+
+ // Now write the table
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' ';
+ for(USHORT i = 0; i < m_aRedlineTbl.size(); ++i)
+ {
+ const String* pAuthor = GetRedline(i);
+ Strm() << '{';
+ if (pAuthor)
+ Strm() << OutString(*pAuthor, eDefaultEncoding);
+ Strm() << ";}";
+ }
+ Strm() << '}' << sNewLine;
+}
+
+void RtfExport::WriteHeadersFooters( BYTE nHeadFootFlags,
+ const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE /*nBreakCode*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // headers
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN )
+ WriteHeaderFooter( rLeftFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERL );
+
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD )
+ WriteHeaderFooter( rFmt, true, OOO_STRING_SVTOOLS_RTF_HEADER );
+
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST )
+ WriteHeaderFooter( rFirstPageFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERF );
+
+ // footers
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN )
+ WriteHeaderFooter( rLeftFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERL );
+
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD )
+ WriteHeaderFooter( rFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTER );
+
+ if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST )
+ WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF );
+}
+
+void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, BYTE nMode )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_pAttrOutput->WriteField_Impl( pFld, eFldType, rFldCmd, nMode );
+}
+
+void RtfExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ )
+{
+ OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+}
+
+void RtfExport::DoComboBox(const rtl::OUString& /*rName*/,
+ const rtl::OUString& /*rHelp*/,
+ const rtl::OUString& /*rToolTip*/,
+ const rtl::OUString& /*rSelected*/,
+ uno::Sequence<rtl::OUString>& /*rListItems*/)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
+}
+
+void RtfExport::DoFormText(const SwInputField* pFld )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ ::rtl::OUString sResult = pFld->ExpandField(pDoc->IsClipBoard());
+ ::rtl::OUString sHelp( pFld->GetHelp() );
+ ::rtl::OUString sName = pFld->GetPar2();
+ ::rtl::OUString sStatus = pFld->GetToolTip();
+ m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST "{ FORMTEXT }");
+ m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD " {" OOO_STRING_SVTOOLS_RTF_FFTYPE "0" );
+ if( sHelp.getLength() )
+ m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNHELP );
+ if( sStatus.getLength() )
+ m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNSTAT );
+ m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0" );
+
+ if( sName.getLength() )
+ m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ").append( OutString( sName, eDefaultEncoding )).append( "}" );
+ if( sHelp.getLength() )
+ m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append( OutString( sHelp, eDefaultEncoding )).append( "}" );
+ m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFDEFTEXT " ").append( OutString( sResult, eDefaultEncoding )).append( "}" );
+ if( sStatus.getLength() )
+ m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append( OutString( sStatus, eDefaultEncoding )).append( "}");
+ m_pAttrOutput->RunText().append( "}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " " );
+ m_pAttrOutput->RunText().append( OutString( sResult, eDefaultEncoding )).append( "}}" );
+}
+
+ULONG RtfExport::ReplaceCr( BYTE )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // Completely unused for Rtf export... only here for code sharing
+ // purpose with binary export
+
+ return 0;
+}
+
+void RtfExport::WriteFonts()
+{
+ Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL;
+ maFontHelper.WriteFontTable( *m_pAttrOutput );
+ Strm() << '}';
+}
+
+void RtfExport::WriteStyles()
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+ pStyles->OutputStylesTable();
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteMainText()
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+ pCurPam->GetPoint()->nNode = pDoc->GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex();
+ WriteText();
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteInfo()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO;
+
+ SwDocShell *pDocShell(pDoc->GetDocShell());
+ uno::Reference<document::XDocumentProperties> xDocProps;
+ if (pDocShell) {
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ pDocShell->GetModel(), uno::UNO_QUERY);
+ xDocProps.set(xDPS->getDocumentProperties());
+ }
+
+ if (xDocProps.is()) {
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle());
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
+
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_KEYWORDS,
+ ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
+
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor());
+ OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
+
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR,xDocProps->getModifiedBy());
+ OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
+
+ OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
+ }
+
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " ";
+ OUString sProduct;
+ utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
+ Strm() << OUStringToOString( sProduct, eCurrentEncoding) << "}{" << OOO_STRING_SVTOOLS_RTF_VERN;
+ OutULong( SUPD*10 ) << '}';
+ Strm() << '}';
+}
+
+void RtfExport::WritePageDescTable()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // Write page descriptions (page styles)
+ USHORT nSize = pDoc->GetPageDescCnt();
+ if( !nSize )
+ return;
+
+ Strm() << sNewLine; // a separator
+ bOutPageDescs = TRUE;
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCTBL;
+ for( USHORT n = 0; n < nSize; ++n )
+ {
+ const SwPageDesc& rPageDesc =
+ const_cast<const SwDoc*>(pDoc)->GetPageDesc( n );
+
+ Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC;
+ OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE;
+ OutULong( rPageDesc.ReadUseOn() );
+
+ OutPageDescription( rPageDesc, FALSE, FALSE );
+
+ // search for the next page description
+ USHORT i = nSize;
+ while( i )
+ if( rPageDesc.GetFollow() ==
+ &const_cast<const SwDoc *>(pDoc)->GetPageDesc( --i ) )
+ break;
+ Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT;
+ OutULong( i ) << ' ';
+ Strm() << OutString( rPageDesc.GetName(), eDefaultEncoding) << ";}";
+ }
+ Strm() << '}' << sNewLine;
+ bOutPageDescs = FALSE;
+}
+
+void RtfExport::ExportDocument_Impl()
+{
+#ifdef DEBUG
+ // MSWordExportBase::WriteText and others write debug messages to std::clog
+ // which is not interesting while debugging RtfExport
+ std::ostringstream aOss;
+ std::streambuf *pOldBuf = std::clog.rdbuf(aOss.rdbuf());
+#endif
+
+ // Make the header
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1'
+ << OOO_STRING_SVTOOLS_RTF_ANSI;
+ Strm() << OOO_STRING_SVTOOLS_RTF_DEFF;
+ OutULong( maFontHelper.GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem(
+ RES_CHRATR_FONT ) ));
+ // If this not exist, MS don't understand our ansi characters (0x80-0xff).
+ Strm() << "\\adeflang1025";
+
+ // Font table
+ WriteFonts();
+
+ pStyles = new MSWordStyles( *this );
+ // Color and stylesheet table
+ WriteStyles();
+
+ // List table
+ BuildNumbering();
+ WriteNumbering();
+
+ WriteRevTab();
+
+ WriteInfo();
+ // Default TabSize
+ Strm() << m_pAttrOutput->m_aTabStop.makeStringAndClear() << sNewLine;
+ // Page description
+ WritePageDescTable();
+
+ // Enable form protection by default if needed, as there is no switch to
+ // enable it on a per-section basis. OTOH don't always enable it as it
+ // breaks moving of drawings - so write it only in case there is really a
+ // protected section in the document.
+ {
+ const SfxItemPool& rPool = pDoc->GetAttrPool();
+ USHORT nMaxItem = rPool.GetItemCount2(RES_PROTECT);
+ for( USHORT n = 0; n < nMaxItem; ++n )
+ {
+ const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n);
+ if (pProtect && pProtect->IsCntntProtected())
+ {
+ Strm() << OOO_STRING_SVTOOLS_RTF_FORMPROT;
+ break;
+ }
+ }
+ }
+
+ // enable form field shading
+ Strm() << OOO_STRING_SVTOOLS_RTF_FORMSHADE;
+
+ // size and empty margins of the page
+ if( pDoc->GetPageDescCnt() )
+ {
+ //JP 06.04.99: Bug 64361 - Seeking the first SwFmtPageDesc. If
+ // no set, the default is valid
+ const SwFmtPageDesc* pSttPgDsc = 0;
+ {
+ const SwNode& rSttNd = *pDoc->GetNodes()[
+ pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ];
+ const SfxItemSet* pSet = 0;
+
+ if( rSttNd.IsCntntNode() )
+ pSet = &rSttNd.GetCntntNode()->GetSwAttrSet();
+ else if( rSttNd.IsTableNode() )
+ pSet = &rSttNd.GetTableNode()->GetTable().
+ GetFrmFmt()->GetAttrSet();
+ else if( rSttNd.IsSectionNode() )
+ pSet = &rSttNd.GetSectionNode()->GetSection().
+ GetFmt()->GetAttrSet();
+
+ if( pSet )
+ {
+ USHORT nPosInDoc;
+ pSttPgDsc = (SwFmtPageDesc*)&pSet->Get( RES_PAGEDESC );
+ if( !pSttPgDsc->GetPageDesc() )
+ pSttPgDsc = 0;
+ else if( pDoc->FindPageDescByName( pSttPgDsc->
+ GetPageDesc()->GetName(), &nPosInDoc ))
+ {
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCNO;
+ OutULong( nPosInDoc ) << '}';
+ }
+ }
+ }
+ const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc()
+ : const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
+ const SwFrmFmt &rFmtPage = rPageDesc.GetMaster();
+
+ {
+ if( rPageDesc.GetLandscape() )
+ Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE;
+
+ const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize();
+ // Clipboard document is always created without a printer, then
+ // the size will be always LONG_MAX! Solution then is to use A4
+ if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() )
+ {
+ Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH;
+ Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4);
+ OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW;
+ OutULong( a4.Width() );
+ }
+ else
+ {
+ Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH;
+ OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW;
+ OutULong( rSz.GetWidth() );
+ }
+ }
+
+ {
+ const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace();
+ Strm() << OOO_STRING_SVTOOLS_RTF_MARGL;
+ OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR;
+ OutLong( rLR.GetRight() );
+ }
+
+ {
+ const SvxULSpaceItem& rUL = rFmtPage.GetULSpace();
+ Strm() << OOO_STRING_SVTOOLS_RTF_MARGT;
+ OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB;
+ OutLong( rUL.GetLower() );
+ }
+
+ Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE;
+ // All sections are unlocked by default
+ Strm() << OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED;
+ OutLong(1);
+ OutPageDescription( rPageDesc, FALSE, TRUE ); // Changed bCheckForFirstPage to TRUE so headers
+ // following title page are correctly added - i13107
+ if( pSttPgDsc )
+ {
+ pAktPageDesc = &rPageDesc;
+ }
+ }
+
+ // line numbering
+ const SwLineNumberInfo& rLnNumInfo = pDoc->GetLineNumberInfo();
+ if ( rLnNumInfo.IsPaintLineNumbers() )
+ AttrOutput().SectionLineNumbering( 0, rLnNumInfo );
+
+ {
+ // write the footnotes and endnotes-out Info
+ const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo();
+
+ const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos
+ ? OOO_STRING_SVTOOLS_RTF_ENDDOC
+ : OOO_STRING_SVTOOLS_RTF_FTNBJ;
+ Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART;
+ OutLong( rFtnInfo.nFtnOffset + 1 );
+
+ switch( rFtnInfo.eNum )
+ {
+ case FTNNUM_PAGE: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTPG; break;
+ case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break;
+ // case FTNNUM_CHAPTER:
+ default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break;
+ }
+ Strm() << pOut;
+
+ switch( rFtnInfo.aFmt.GetNumberingType() )
+ {
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNALC; break;
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAUC; break;
+ case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRLC; break;
+ case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRUC; break;
+ case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break;
+ // case SVX_NUM_ARABIC:
+ default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break;
+ }
+ Strm() << pOut;
+
+
+ const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo();
+
+ Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT
+ << OOO_STRING_SVTOOLS_RTF_AFTNSTART;
+ OutLong( rEndNoteInfo.nFtnOffset + 1 );
+
+ switch( rEndNoteInfo.aFmt.GetNumberingType() )
+ {
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNALC; break;
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAUC; break;
+ case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRLC; break;
+ case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRUC; break;
+ case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break;
+ // case SVX_NUM_ARABIC:
+ default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break;
+ }
+ Strm() << pOut;
+ }
+
+ Strm() << sNewLine;
+
+ // Init sections
+ m_pSections = new MSWordSections( *this );
+
+ WriteMainText();
+
+ Strm() << '}';
+
+#ifdef DEBUG
+ std::clog.rdbuf(pOldBuf);
+#endif
+}
+
+void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet,
+ const SwNode& rNd, const SwFmtPageDesc* pNewPgDescFmt,
+ const SwPageDesc* pNewPgDesc )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ const SwSectionFmt* pFmt = GetSectionFormat( rNd );
+ const ULONG nLnNm = GetSectionLineNo( pSet, rNd );
+
+ OSL_ENSURE( pNewPgDescFmt || pNewPgDesc, "Neither page desc format nor page desc provided." );
+
+ if ( pNewPgDescFmt )
+ m_pSections->AppendSection( *pNewPgDescFmt, rNd, pFmt, nLnNm );
+ else if ( pNewPgDesc )
+ m_pSections->AppendSection( pNewPgDesc, rNd, pFmt, nLnNm );
+
+ AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() );
+}
+
+bool RtfExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt )
+{
+ bool bRet( false );
+
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if (SFX_ITEM_SET != rFmt.GetItemState(RES_PARATR_NUMRULE, false))
+ {
+ if (const SwFmt *pParent = rFmt.DerivedFrom())
+ {
+ if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle())
+ {
+ // Level 9 disables the outline
+ Strm() << OOO_STRING_SVTOOLS_RTF_LEVEL << 9;
+
+ bRet = true;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+void RtfExport::OutputGrfNode( const SwGrfNode& )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop, see RtfAttributeOutput::FlyFrameGraphic */
+}
+
+void RtfExport::OutputOLENode( const SwOLENode& )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop, see RtfAttributeOutput::FlyFrameOLE */
+}
+
+void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_pSections->AppendSection( pPageDesc, pFmt, nLnNum );
+ AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() );
+}
+
+RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter )
+ : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
+ m_pFilter( pFilter ),
+ m_pWriter( pWriter ),
+ m_pAttrOutput( NULL ),
+ m_pSections( NULL ),
+ m_pSdrExport( NULL ),
+ eDefaultEncoding(
+ rtl_getTextEncodingFromWindowsCharset(
+ sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))),
+ eCurrentEncoding(eDefaultEncoding),
+ bRTFFlySyntax(false)
+{
+ mbExportModeRTF = true;
+ // the attribute output for the document
+ m_pAttrOutput = new RtfAttributeOutput( *this );
+ // that just causes problems for RTF
+ bSubstituteBullets = false;
+ // needed to have a complete font table
+ maFontHelper.bLoadAllFonts = true;
+ // the related SdrExport
+ m_pSdrExport = new RtfSdrExport( *this );
+
+ if (!m_pWriter)
+ m_pWriter = &m_pFilter->m_aWriter;
+}
+
+RtfExport::~RtfExport()
+{
+ delete m_pAttrOutput, m_pAttrOutput = NULL;
+ delete m_pSdrExport, m_pSdrExport = NULL;
+}
+
+SvStream& RtfExport::Strm()
+{
+ return m_pWriter->Strm();
+}
+
+SvStream& RtfExport::OutULong( ULONG nVal )
+{
+ return m_pWriter->OutULong( Strm(), nVal );
+}
+
+SvStream& RtfExport::OutLong( long nVal )
+{
+ return m_pWriter->OutLong( Strm(), nVal );
+}
+
+void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent)
+{
+ if (rContent.Len())
+ {
+ Strm() << '{' << pToken << ' ';
+ Strm() << OutString( rContent, eCurrentEncoding ).getStr();
+ Strm() << '}';
+ }
+}
+
+OString RtfExport::OutHex(ULONG nHex, BYTE nLen)
+{
+ sal_Char aNToABuf[] = "0000000000000000";
+
+ OSL_ENSURE( nLen < sizeof(aNToABuf), "nLen is too big" );
+ if( nLen >= sizeof(aNToABuf) )
+ nLen = (sizeof(aNToABuf)-1);
+
+ // Set pointer to the buffer end
+ sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
+ for( BYTE n = 0; n < nLen; ++n )
+ {
+ *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
+ if( *pStr > '9' )
+ *pStr += 39;
+ nHex >>= 4;
+ }
+ return OString(pStr);
+}
+
+OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc)
+{
+ OStringBuffer aBuf;
+ const sal_Char* pStr = 0;
+ // 0x0b instead of \n, etc because of the replacements in SwAttrIter::GetSnippet()
+ switch (c)
+ {
+ case 0x0b:
+ // hard line break
+ pStr = OOO_STRING_SVTOOLS_RTF_LINE;
+ break;
+ case '\t':
+ pStr = OOO_STRING_SVTOOLS_RTF_TAB;
+ break;
+ case '\\':
+ case '}':
+ case '{':
+ aBuf.append('\\');
+ aBuf.append((sal_Char)c);
+ break;
+ case 0xa0:
+ // non-breaking space
+ pStr = "\\~";
+ break;
+ case 0x1e:
+ // non-breaking hyphen
+ pStr = "\\_";
+ break;
+ case 0x1f:
+ // optional hyphen
+ pStr = "\\-";
+ break;
+ default:
+ if (c >= ' ' && c <= '~')
+ aBuf.append((sal_Char)c);
+ else {
+ //If we can't convert to the dest encoding, or if
+ //its an uncommon multibyte sequence which most
+ //readers won't be able to handle correctly, then
+ //If we can't convert to the dest encoding, then
+ //export as unicode
+ OUString sBuf(&c, 1);
+ OString sConverted;
+ sal_uInt32 nFlags =
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
+ bool bWriteAsUnicode = !(sBuf.convertToString(&sConverted,
+ eDestEnc, nFlags))
+ || (RTL_TEXTENCODING_UTF8==eDestEnc); // #i43933# do not export UTF-8 chars in RTF;
+ if (bWriteAsUnicode)
+ sBuf.convertToString(&sConverted,
+ eDestEnc, OUSTRING_TO_OSTRING_CVTFLAGS);
+ const sal_Int32 nLen = sConverted.getLength();
+
+ if (bWriteAsUnicode && pUCMode)
+ {
+ // then write as unicode - character
+ if (*pUCMode != nLen)
+ {
+ aBuf.append("\\uc");
+ aBuf.append((sal_Int32)nLen);
+ // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.
+ aBuf.append(' ');
+ *pUCMode = nLen;
+ }
+ aBuf.append("\\u");
+ aBuf.append((sal_Int32)c);
+ }
+
+ for (sal_Int32 nI = 0; nI < nLen; ++nI)
+ {
+ aBuf.append("\\'");
+ aBuf.append(OutHex(sConverted.getStr()[nI], 2));
+ }
+ }
+ }
+ if (pStr) {
+ aBuf.append(pStr);
+ aBuf.append(' ');
+ }
+ return aBuf.makeStringAndClear();
+}
+
+OString RtfExport::OutString(const String &rStr, rtl_TextEncoding eDestEnc)
+{
+ OSL_TRACE("%s, rStr = '%s'", OSL_THIS_FUNC,
+ OUStringToOString( OUString( rStr ), eDestEnc ).getStr());
+ OStringBuffer aBuf;
+ int nUCMode = 1;
+ for (xub_StrLen n = 0; n < rStr.Len(); ++n)
+ aBuf.append(OutChar(rStr.GetChar(n), &nUCMode, eDestEnc));
+ if (nUCMode != 1) {
+ aBuf.append(OOO_STRING_SVTOOLS_RTF_UC);
+ aBuf.append((sal_Int32)1);
+ aBuf.append(" "); // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.;
+ }
+ return aBuf.makeStringAndClear();
+}
+
+void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT )
+{
+ Strm() << '{' << pStr << OOO_STRING_SVTOOLS_RTF_YR;
+ OutULong( rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO;
+ OutULong( rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY;
+ OutULong( rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR;
+ OutULong( rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN;
+ OutULong( rDT.Minutes ) << '}';
+}
+
+USHORT RtfExport::GetColor( const Color& rColor ) const
+{
+ for (RtfColorTbl::const_iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
+ if ((*it).second == rColor) {
+ OSL_TRACE("%s returning %d (%d,%d,%d)", OSL_THIS_FUNC, (*it).first, rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue());
+ return (*it).first;
+ }
+ OSL_ENSURE( FALSE, "No such Color in m_aColTbl!" );
+ return 0;
+}
+
+void RtfExport::InsColor( const Color& rCol )
+{
+ USHORT n;
+ for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
+ if ((*it).second == rCol)
+ return; // Already in the table
+ if (rCol.GetColor() == COL_AUTO)
+ n = 0;
+ else
+ {
+ n = m_aColTbl.size();
+ // Fix for the case when first a !COL_AUTO gets inserted as #0, then
+ // gets overwritten by COL_AUTO
+ if (!n)
+ n++;
+ }
+ m_aColTbl.insert(std::pair<USHORT,Color>( n, rCol ));
+}
+
+void RtfExport::InsColorLine( const SvxBoxItem& rBox )
+{
+ const SvxBorderLine* pLine = 0;
+
+ if( rBox.GetTop() )
+ InsColor( (pLine = rBox.GetTop())->GetColor() );
+ if( rBox.GetBottom() && pLine != rBox.GetBottom() )
+ InsColor( (pLine = rBox.GetBottom())->GetColor() );
+ if( rBox.GetLeft() && pLine != rBox.GetLeft() )
+ InsColor( (pLine = rBox.GetLeft())->GetColor() );
+ if( rBox.GetRight() && pLine != rBox.GetRight() )
+ InsColor( rBox.GetRight()->GetColor() );
+}
+void RtfExport::OutColorTable()
+{
+ // Build the table from rPool since the colors provided to
+ // RtfAttributeOutput callbacks are too late.
+ USHORT n, nMaxItem;
+ const SfxItemPool& rPool = pDoc->GetAttrPool();
+
+ // char color
+ {
+ const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr(
+ RES_CHRATR_COLOR );
+ InsColor( pCol->GetValue() );
+ if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem(
+ RES_CHRATR_COLOR ) ))
+ InsColor( pCol->GetValue() );
+ nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
+ for( n = 0; n < nMaxItem; ++n )
+ {
+ if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2(
+ RES_CHRATR_COLOR, n ) ) )
+ InsColor( pCol->GetValue() );
+ }
+
+ const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE );
+ InsColor( pUnder->GetColor() );
+ nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
+ for( n = 0; n < nMaxItem;n++)
+ {
+ if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) )
+ InsColor( pUnder->GetColor() );
+
+ }
+
+ const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE );
+ InsColor( pOver->GetColor() );
+ nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
+ for( n = 0; n < nMaxItem;n++)
+ {
+ if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) )
+ InsColor( pOver->GetColor() );
+
+ }
+
+ }
+
+ // background color
+ static const USHORT aBrushIds[] = {
+ RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
+
+ for( const USHORT* pIds = aBrushIds; *pIds; ++pIds )
+ {
+ const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr( *pIds );
+ InsColor( pBkgrd->GetColor() );
+ if( 0 != ( pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem(
+ *pIds ) ))
+ {
+ InsColor( pBkgrd->GetColor() );
+ }
+ nMaxItem = rPool.GetItemCount2( *pIds );
+ for( n = 0; n < nMaxItem; ++n )
+ if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(
+ *pIds , n ) ))
+ {
+ InsColor( pBkgrd->GetColor() );
+ }
+ }
+
+ // shadow color
+ {
+ const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr(
+ RES_SHADOW );
+ InsColor( pShadow->GetColor() );
+ if( 0 != ( pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem(
+ RES_SHADOW ) ))
+ {
+ InsColor( pShadow->GetColor() );
+ }
+ nMaxItem = rPool.GetItemCount2(RES_SHADOW);
+ for( n = 0; n < nMaxItem; ++n )
+ if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(
+ RES_SHADOW, n ) ) )
+ {
+ InsColor( pShadow->GetColor() );
+ }
+ }
+
+ // frame border color
+ {
+ const SvxBoxItem* pBox;
+ if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(
+ RES_BOX ) ))
+ InsColorLine( *pBox );
+ nMaxItem = rPool.GetItemCount2(RES_BOX);
+ for( n = 0; n < nMaxItem; ++n )
+ if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) ))
+ InsColorLine( *pBox );
+ }
+
+ for( n = 0; n < m_aColTbl.size(); n++ )
+ {
+ const Color& rCol = m_aColTbl[ n ];
+ if( n || COL_AUTO != rCol.GetColor() )
+ {
+ Strm() << OOO_STRING_SVTOOLS_RTF_RED;
+ OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN;
+ OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE;
+ OutULong( rCol.GetBlue() );
+ }
+ Strm() << ';';
+ }
+}
+
+void RtfExport::InsStyle( USHORT nId, const OString& rStyle )
+{
+ m_aStyTbl.insert(std::pair<USHORT,OString>(nId, rStyle) );
+}
+
+OString* RtfExport::GetStyle( USHORT nId )
+{
+ std::map<USHORT,OString>::iterator i = m_aStyTbl.find(nId);
+ if (i != m_aStyTbl.end())
+ return &i->second;
+ return NULL;
+}
+
+USHORT RtfExport::GetRedline( const String& rAuthor )
+{
+ std::map<String,USHORT>::iterator i = m_aRedlineTbl.find(rAuthor);
+ if (i != m_aRedlineTbl.end())
+ return i->second;
+ else
+ {
+ int nId = m_aRedlineTbl.size();
+ m_aRedlineTbl.insert(std::pair<String,USHORT>(rAuthor,nId));
+ return nId;
+ }
+}
+
+const String* RtfExport::GetRedline( USHORT nId )
+{
+ for(std::map<String,USHORT>::iterator aIter = m_aRedlineTbl.begin(); aIter != m_aRedlineTbl.end(); ++aIter)
+ if ((*aIter).second == nId)
+ return &(*aIter).first;
+ return NULL;
+}
+
+void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage )
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+ const SwPageDesc *pSave = pAktPageDesc;
+
+ pAktPageDesc = &rPgDsc;
+ if( bCheckForFirstPage && pAktPageDesc->GetFollow() &&
+ pAktPageDesc->GetFollow() != pAktPageDesc )
+ pAktPageDesc = pAktPageDesc->GetFollow();
+
+ if( bWriteReset )
+ {
+ if( pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode )
+ Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE;
+ else
+ Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD;
+ }
+
+ if( pAktPageDesc->GetLandscape() )
+ Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN;
+
+ const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft();
+ bOutPageDescs = true;
+ OutputFormat(*pFmt, true, false);
+ bOutPageDescs = false;
+
+ // normal header / footer (without a style)
+ const SfxPoolItem* pItem;
+ if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_HEADER, FALSE,
+ &pItem ) == SFX_ITEM_SET)
+ WriteHeaderFooter(*pItem, true);
+ if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_FOOTER, FALSE,
+ &pItem ) == SFX_ITEM_SET)
+ WriteHeaderFooter(*pItem, false);
+
+ // title page
+ if( pAktPageDesc != &rPgDsc )
+ {
+ pAktPageDesc = &rPgDsc;
+ Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG;
+ if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER,
+ FALSE, &pItem ) == SFX_ITEM_SET )
+ WriteHeaderFooter(*pItem, true);
+ if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_FOOTER,
+ FALSE, &pItem ) == SFX_ITEM_SET )
+ WriteHeaderFooter(*pItem, false);
+ }
+
+ // numbering type
+ AttrOutput().SectionPageNumbering(pAktPageDesc->GetNumType().GetNumberingType(), 0);
+
+ pAktPageDesc = pSave;
+ //bOutPageDesc = bOldOut;
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
+{
+ if (bHeader)
+ {
+ const SwFmtHeader& rHeader = (const SwFmtHeader&)rItem;
+ if (!rHeader.IsActive())
+ return;
+ }
+ else
+ {
+ const SwFmtFooter& rFooter = (const SwFmtFooter&)rItem;
+ if (!rFooter.IsActive())
+ return;
+ }
+
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+
+ const sal_Char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER);
+ /* is this a title page? */
+ if( pAktPageDesc->GetFollow() && pAktPageDesc->GetFollow() != pAktPageDesc )
+ {
+ Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG;
+ pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERF : OOO_STRING_SVTOOLS_RTF_FOOTERF);
+ }
+ Strm() << '{' << pStr;
+ WriteHeaderFooterText(pAktPageDesc->GetMaster(), bHeader);
+ Strm() << '}';
+
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr)
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+
+ m_pAttrOutput->WriteHeaderFooter_Impl( rFmt, bHeader, pStr );
+
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+class SwRTFWriter : public Writer
+{
+ public:
+ SwRTFWriter( const String& rFilterName, const String& rBaseURL );
+ virtual ~SwRTFWriter();
+ virtual ULONG WriteStream();
+};
+
+SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ SetBaseURL( rBaseURL );
+}
+
+SwRTFWriter::~SwRTFWriter()
+{}
+
+ULONG SwRTFWriter::WriteStream()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+ aExport.ExportDocument( true );
+ return 0;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF( const String& rFltName, const String& rBaseURL, WriterRef& xRet )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ xRet = new SwRTFWriter( rFltName, rBaseURL );
+}
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
new file mode 100644
index 000000000000..1a26607ffd6a
--- /dev/null
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFEXPORT_HXX_
+#define _RTFEXPORT_HXX_
+
+#include <set>
+#include "rtfattributeoutput.hxx"
+#include "wrtww8.hxx"
+
+#include <rtl/ustring.hxx>
+
+#include <cstdio>
+#include <map>
+
+class RtfExportFilter;
+class RtfSdrExport;
+typedef std::map<USHORT,Color> RtfColorTbl;
+typedef std::map<USHORT,rtl::OString> RtfStyleTbl;
+typedef std::map<String,USHORT> RtfRedlineTbl;
+class SwNode;
+class SwEndNode;
+class SwTableNode;
+class SwTxtNode;
+class SwGrfNode;
+class SwOLENode;
+class SwSectionNode;
+class SwNumRuleTbl;
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+} } }
+
+/// The class that does all the actual RTF export-related work.
+class RtfExport : public MSWordExportBase
+{
+ /// Pointer to the filter that owns us.
+ RtfExportFilter *m_pFilter;
+ Writer* m_pWriter;
+
+ /// Attribute output for document.
+ RtfAttributeOutput *m_pAttrOutput;
+
+ /// Sections/headers/footers
+ MSWordSections *m_pSections;
+
+ RtfSdrExport *m_pSdrExport;
+
+public:
+ /// Access to the attribute output class.
+ virtual AttributeOutputBase& AttrOutput() const;
+
+ /// Access to the sections/headers/footres.
+ virtual MSWordSections& Sections() const;
+
+ /// Access to the Rtf Sdr exporter.
+ virtual RtfSdrExport& SdrExporter() const;
+
+ /// Hack, unfortunately necessary at some places for now.
+ virtual bool HackIsWW8OrHigher() const { return false; }
+
+ /// Guess the script (asian/western).
+ virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich );
+
+ virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen );
+
+ virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+
+ virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ }
+ virtual void WriteChar( sal_Unicode );
+
+ /// Write the numbering table.
+ virtual void WriteNumbering();
+
+ /// Write the revision table.
+ virtual void WriteRevTab();
+
+ /// Output the actual headers and footers.
+ virtual void WriteHeadersFooters( BYTE nHeadFootFlags,
+ const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE nBreakCode );
+
+ /// Write the field
+ virtual void OutputField( const SwField* pFld, ww::eField eFldType,
+ const String& rFldCmd, BYTE nMode = nsFieldFlags::WRITEFIELD_ALL );
+
+ /// Write the data of the form field
+ virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
+
+ virtual void DoComboBox(const rtl::OUString &rName,
+ const rtl::OUString &rHelp,
+ const rtl::OUString &ToolTip,
+ const rtl::OUString &rSelected,
+ com::sun::star::uno::Sequence<rtl::OUString> &rListItems);
+
+ virtual void DoFormText(const SwInputField * pFld);
+
+ virtual ULONG ReplaceCr( BYTE nChar );
+
+protected:
+ /// Format-dependant part of the actual export.
+ virtual void ExportDocument_Impl();
+
+ virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {}
+
+ /// Get ready for a new section.
+ virtual void PrepareNewPageDesc( const SfxItemSet* pSet,
+ const SwNode& rNd,
+ const SwFmtPageDesc* pNewPgDescFmt = 0,
+ const SwPageDesc* pNewPgDesc = 0 );
+
+ /// Return value indicates if an inherited outline numbering is suppressed.
+ virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt);
+
+ /// Output SwGrfNode
+ virtual void OutputGrfNode( const SwGrfNode& );
+
+ /// Output SwOLENode
+ virtual void OutputOLENode( const SwOLENode& );
+
+ virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum );
+
+public:
+ /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
+ RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument,
+ SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter );
+
+ /// Destructor.
+ virtual ~RtfExport();
+
+#if defined(UNX)
+ static const sal_Char sNewLine; // \012 or \015
+#else
+ static const sal_Char __FAR_DATA sNewLine[]; // \015\012
+#endif
+
+ rtl_TextEncoding eDefaultEncoding;
+ rtl_TextEncoding eCurrentEncoding;
+ /// This is used by OutputFlyFrame_Impl() to control the written syntax
+ bool bRTFFlySyntax;
+
+ BOOL m_bOutStyleTab : 1;
+ SvStream& Strm();
+ SvStream& OutULong( ULONG nVal );
+ SvStream& OutLong( long nVal );
+ void OutUnicode(const sal_Char *pToken, const String &rContent);
+ void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT );
+ static rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc);
+ static rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
+ static rtl::OString OutHex(ULONG nHex, BYTE nLen);
+ void OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage );
+
+ USHORT GetColor( const Color& rColor ) const;
+ void InsColor( const Color& rCol );
+ void InsColorLine( const SvxBoxItem& rBox );
+ void OutColorTable();
+ USHORT GetRedline( const String& rAuthor );
+ const String* GetRedline( USHORT nId );
+
+ void InsStyle( USHORT nId, const rtl::OString& rStyle );
+ rtl::OString* GetStyle( USHORT nId );
+
+private:
+ /// No copying.
+ RtfExport( const RtfExport& );
+
+ /// No copying.
+ RtfExport& operator=( const RtfExport& );
+
+ void WriteFonts();
+ void WriteStyles();
+ void WriteMainText();
+ void WriteInfo();
+ /// Writes the writer-specific \pgdsctbl group.
+ void WritePageDescTable();
+ /// This is necessary to have the numbering table ready before the main text is being processed.
+ void BuildNumbering();
+ void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader);
+ void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr);
+
+ RtfColorTbl m_aColTbl;
+ RtfStyleTbl m_aStyTbl;
+ RtfRedlineTbl m_aRedlineTbl;
+};
+
+#endif // _RTFEXPORT_HXX_
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx
new file mode 100644
index 000000000000..8fe2dd5edea8
--- /dev/null
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <rtfexportfilter.hxx>
+#include <rtfexport.hxx>
+#include <rtfimportfilter.hxx>
+
+#include <docsh.hxx>
+#include <doc.hxx>
+#include <pam.hxx>
+#include <unotxdoc.hxx>
+
+#include <cppuhelper/factory.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+
+using namespace ::comphelper;
+using namespace ::com::sun::star;
+using ::rtl::OUString;
+
+RtfExportFilter::RtfExportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) :
+ m_xMSF( xMSF )
+{
+}
+
+RtfExportFilter::~RtfExportFilter()
+{
+}
+
+sal_Bool RtfExportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
+ throw (uno::RuntimeException)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ MediaDescriptor aMediaDesc = aDescriptor;
+ ::uno::Reference< io::XStream > xStream =
+ aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STREAMFOROUTPUT(), uno::Reference< io::XStream >() );
+ m_pStream = utl::UcbStreamHelper::CreateStream( xStream, sal_True );
+ m_aWriter.SetStream(m_pStream);
+
+ // get SwDoc*
+ uno::Reference< uno::XInterface > xIfc( m_xSrcDoc, uno::UNO_QUERY );
+ SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
+ if ( !pTxtDoc ) {
+ return sal_False;
+ }
+
+ SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc();
+ if ( !pDoc ) {
+ return sal_False;
+ }
+
+ // get SwPaM*
+ // we get SwPaM for the entire document; copy&paste is handled internally, not via UNO
+ SwPaM aPam( pDoc->GetNodes().GetEndOfContent() );
+ aPam.SetMark();
+ aPam.Move( fnMoveBackward, fnGoDoc );
+
+ SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() );
+
+ // export the document
+ // (in a separate block so that it's destructed before the commit)
+ {
+ RtfExport aExport( this, pDoc, pCurPam, &aPam, NULL );
+ aExport.ExportDocument( true );
+ }
+
+ // delete the pCurPam
+ if ( pCurPam )
+ {
+ while ( pCurPam->GetNext() != pCurPam )
+ delete pCurPam->GetNext();
+ delete pCurPam;
+ }
+ delete m_pStream;
+
+ return sal_True;
+}
+
+
+void RtfExportFilter::cancel( ) throw (uno::RuntimeException)
+{
+}
+
+void RtfExportFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ m_xSrcDoc = xDoc;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// UNO helpers
+//////////////////////////////////////////////////////////////////////////
+
+OUString RtfExport_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFEXPORT ) );
+}
+
+uno::Sequence< OUString > SAL_CALL RtfExport_getSupportedServiceNames() throw()
+{
+ const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL RtfExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
+{
+ return (cppu::OWeakObject*) new RtfExportFilter( rSMgr );
+}
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
+{
+ sal_Bool bRet = sal_False;
+
+ if( pRegistryKey )
+ {
+ try
+ {
+ uno::Reference< registry::XRegistryKey > xNewKey1(
+ static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
+ OUString::createFromAscii( IMPL_NAME_RTFEXPORT "/UNO/SERVICES/" ) ) );
+ xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
+
+ bRet = sal_True;
+ }
+ catch( registry::InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfexport)!" );
+ }
+
+ try
+ {
+ uno::Reference< registry::XRegistryKey > xNewKey1(
+ static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
+ OUString::createFromAscii( IMPL_NAME_RTFIMPORT "/UNO/SERVICES/" ) ) );
+ xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
+
+ bRet = sal_True;
+ }
+ catch( registry::InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfimport)!" );
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------
+// - component_getFactory -
+// ------------------------
+
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
+{
+ OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName);
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
+ void* pRet = 0;
+
+ if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) {
+ const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ RtfExport_getImplementationName(),
+ RtfExport_createInstance,
+ RtfExport_getSupportedServiceNames() ) );
+ }
+ else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) {
+ const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ RtfImport_getImplementationName(),
+ RtfImport_createInstance,
+ RtfImport_getSupportedServiceNames() ) );
+ }
+
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexportfilter.hxx b/sw/source/filter/ww8/rtfexportfilter.hxx
new file mode 100644
index 000000000000..e3ccc3a9d3f9
--- /dev/null
+++ b/sw/source/filter/ww8/rtfexportfilter.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFEXPORTFILTER_HXX_
+#define _RTFEXPORTFILTER_HXX_
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <tools/stream.hxx>
+#include <shellio.hxx>
+
+// This is just here so that we don't have to copy&paste its string format methods
+class RtfWriter : public Writer
+{
+protected:
+ ULONG WriteStream() { return 0; }
+};
+
+/// The physical access to the RTF document (for writing).
+class RtfExportFilter : public cppu::WeakImplHelper2
+<
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XExporter
+>
+{
+protected:
+ ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc;
+ SvStream* m_pStream;
+public:
+ RtfExportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF );
+ virtual ~RtfExportFilter();
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XExporter
+ virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ RtfWriter m_aWriter;
+};
+
+::rtl::OUString RtfExport_getImplementationName();
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfExport_getSupportedServiceNames()
+ throw();
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfExport_createInstance(
+ const ::com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > &xMSF)
+ throw( ::com::sun::star::uno::Exception );
+
+#define IMPL_NAME_RTFEXPORT "com.sun.star.comp.Writer.RtfExport"
+
+#endif // _RTFEXPORTFILTER_HXX_
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfimportfilter.cxx b/sw/source/filter/ww8/rtfimportfilter.cxx
new file mode 100644
index 000000000000..d44a42db4fe3
--- /dev/null
+++ b/sw/source/filter/ww8/rtfimportfilter.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "rtfimportfilter.hxx"
+#include "../rtf/swparrtf.hxx"
+
+#include <docsh.hxx>
+#include <doc.hxx>
+#include <pam.hxx>
+#include <unotxdoc.hxx>
+#include <swerror.h>
+
+#include <cppuhelper/factory.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+
+using namespace ::comphelper;
+using namespace ::com::sun::star;
+using ::rtl::OUString;
+using rtl::OUStringToOString;
+
+RtfImportFilter::RtfImportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) :
+ m_xMSF( xMSF )
+{
+}
+
+RtfImportFilter::~RtfImportFilter()
+{
+}
+
+sal_Bool RtfImportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
+ throw (uno::RuntimeException)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ MediaDescriptor aMediaDesc = aDescriptor;
+ ::uno::Reference< io::XInputStream > xInputStream =
+ aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INPUTSTREAM(), uno::Reference< io::XInputStream >() );
+ SvStream* pStream = utl::UcbStreamHelper::CreateStream( xInputStream, sal_True );
+ if (!pStream)
+ return sal_False;
+
+ // get SwDoc*
+ uno::Reference< uno::XInterface > xIfc( m_xDstDoc, uno::UNO_QUERY );
+ SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
+ if (!pTxtDoc)
+ return sal_False;
+ SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc();
+ if (!pDoc)
+ return sal_False;
+
+ // get SwPaM*
+ // NEEDSWORK should we care about partial imports? For now we just import
+ // the whole document
+ SwPaM aPam( pDoc->GetNodes().GetEndOfContent() );
+ aPam.SetMark();
+ aPam.Move( fnMoveBackward, fnGoDoc );
+ SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() );
+
+ String aURL;
+ OUString sTemp;
+ for ( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ )
+ {
+ if( aDescriptor[i].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) )
+ {
+ aDescriptor[i].Value >>= sTemp;
+ aURL = sTemp;
+ }
+ }
+
+ RtfReader aReader;
+ sal_Bool bRet = aReader.Read(pStream, *pDoc, aURL, *pCurPam) == 0;
+ delete pStream;
+ return bRet;
+}
+
+
+void RtfImportFilter::cancel( ) throw (uno::RuntimeException)
+{
+}
+
+void RtfImportFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ m_xDstDoc = xDoc;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// UNO helpers
+//////////////////////////////////////////////////////////////////////////
+
+OUString RtfImport_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFIMPORT ) );
+}
+
+uno::Sequence< OUString > SAL_CALL RtfImport_getSupportedServiceNames() throw()
+{
+ const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ImportFilter" ) );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL RtfImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
+{
+ return (cppu::OWeakObject*) new RtfImportFilter( rSMgr );
+}
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfimportfilter.hxx b/sw/source/filter/ww8/rtfimportfilter.hxx
new file mode 100644
index 000000000000..9026d6357397
--- /dev/null
+++ b/sw/source/filter/ww8/rtfimportfilter.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFIMPORTFILTER_HXX_
+#define _RTFIMPORTFILTER_HXX_
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <tools/stream.hxx>
+#include <shellio.hxx>
+
+/// The physical access to the RTF document (for reading).
+class RtfImportFilter : public cppu::WeakImplHelper2
+<
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XImporter
+>
+{
+protected:
+ ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xDstDoc;
+public:
+ RtfImportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF );
+ virtual ~RtfImportFilter();
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XImporter
+ virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+};
+
+::rtl::OUString RtfImport_getImplementationName();
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfImport_getSupportedServiceNames()
+ throw();
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfImport_createInstance(
+ const ::com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > &xMSF)
+ throw( ::com::sun::star::uno::Exception );
+
+#define IMPL_NAME_RTFIMPORT "com.sun.star.comp.Writer.RtfImport"
+
+#endif // _RTFIMPORTFILTER_HXX_
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
new file mode 100644
index 000000000000..567ddd664dd3
--- /dev/null
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -0,0 +1,586 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "rtfsdrexport.hxx"
+#include "rtfexport.hxx"
+#include "writerhelper.hxx"
+
+#include <com/sun/star/i18n/ScriptType.hdl>
+#include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustring.hxx>
+#include <svl/itemiter.hxx>
+#include <svtools/rtfkeywd.hxx>
+#include <editeng/editdata.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/flditem.hxx>
+#include <editeng/fontitem.hxx>
+#include <svx/svdotext.hxx>
+#include <tools/stream.hxx>
+#include <breakit.hxx>
+
+using rtl::OString;
+using rtl::OStringBuffer;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+using namespace sw::util;
+
+/// Implementation of an empty stream that silently succeeds, but does nothing.
+///
+/// In fact, this is a hack. The right solution is to abstract EscherEx to be
+/// able to work without SvStream; but at the moment it is better to live with
+/// this I guess.
+class SvNullStream : public SvStream
+{
+protected:
+ virtual sal_Size GetData( void* pData, sal_Size nSize ) { memset( pData, 0, nSize ); return nSize; }
+ virtual sal_Size PutData( const void*, sal_Size nSize ) { return nSize; }
+ virtual sal_Size SeekPos( sal_Size nPos ) { return nPos; }
+ virtual void SetSize( sal_Size ) {}
+ virtual void FlushData() {}
+
+public:
+ SvNullStream() : SvStream() {}
+ virtual ~SvNullStream() {}
+};
+
+RtfSdrExport::RtfSdrExport( RtfExport &rExport )
+ : EscherEx( EscherExGlobalRef( new EscherExGlobal ), *( new SvNullStream )),
+ m_rExport( rExport ),
+ m_rAttrOutput( (RtfAttributeOutput&)m_rExport.AttrOutput() ),
+ m_nShapeType( ESCHER_ShpInst_Nil ),
+ m_pShapeStyle( new OStringBuffer( 200 ) ),
+ m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] )
+{
+ mnGroupLevel = 1;
+ memset( m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof( bool ) );
+}
+
+RtfSdrExport::~RtfSdrExport()
+{
+ delete mpOutStrm, mpOutStrm = NULL;
+ delete m_pShapeStyle, m_pShapeStyle = NULL;
+ delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL;
+}
+
+void RtfSdrExport::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ EscherEx::OpenContainer( nEscherContainer, nRecInstance );
+
+ if ( nEscherContainer == ESCHER_SpContainer )
+ {
+ m_nShapeType = ESCHER_ShpInst_Nil;
+ if ( m_pShapeStyle->getLength() )
+ m_pShapeStyle->makeStringAndClear();
+ m_pShapeStyle->ensureCapacity( 200 );
+ m_aShapeProps.clear();
+ }
+}
+
+void RtfSdrExport::CloseContainer()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( mRecTypes.back() == ESCHER_SpContainer )
+ {
+ // write the shape now when we have all the info
+ sal_Int32 nShapeElement = StartShape();
+ EndShape( nShapeElement );
+
+ // cleanup
+ m_nShapeType = ESCHER_ShpInst_Nil;
+ }
+
+ EscherEx::CloseContainer();
+}
+
+UINT32 RtfSdrExport::EnterGroup( const String& /*rShapeName*/, const Rectangle* /*pRect*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ return GenerateShapeId();
+}
+
+void RtfSdrExport::LeaveGroup()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop */
+}
+
+void RtfSdrExport::AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 /*nShapeId*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ m_nShapeType = nShapeType;
+ m_nShapeFlags = nShapeFlags;
+}
+
+inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal )
+{
+ sal_uInt16 nRet = *pVal++;
+ nRet += ( *pVal++ ) << 8;
+ return nRet;
+}
+
+inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize )
+{
+ sal_Int32 nRet = 0;
+ if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) )
+ {
+ sal_uInt16 nUnsigned = *pVal++;
+ nUnsigned += ( *pVal++ ) << 8;
+
+ nRet = sal_Int16( nUnsigned );
+ }
+ else if ( nPointSize == 8 )
+ {
+ sal_uInt32 nUnsigned = *pVal++;
+ nUnsigned += ( *pVal++ ) << 8;
+ nUnsigned += ( *pVal++ ) << 16;
+ nUnsigned += ( *pVal++ ) << 24;
+
+ nRet = nUnsigned;
+ }
+
+ return nRet;
+}
+
+void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_nShapeType == ESCHER_ShpInst_Nil )
+ return;
+
+ if ( m_nShapeType == ESCHER_ShpInst_Line )
+ AddLineDimensions( rRect );
+ else
+ AddRectangleDimensions( *m_pShapeStyle, rRect );
+
+ // properties
+ const EscherProperties &rOpts = rProps.GetOpts();
+ for ( EscherProperties::const_iterator it = rOpts.begin(); it != rOpts.end(); ++it )
+ {
+ sal_uInt16 nId = ( it->nPropId & 0x0FFF );
+
+ switch ( nId )
+ {
+ case ESCHER_Prop_WrapText:
+ {
+ int nWrapType = 0;
+ switch ( it->nPropValue )
+ {
+ case ESCHER_WrapSquare: nWrapType = 2; break;
+ case ESCHER_WrapByPoints: nWrapType = 4; break;
+ case ESCHER_WrapNone: nWrapType = 3; break;
+ case ESCHER_WrapTopBottom: nWrapType = 1; break;
+ case ESCHER_WrapThrough: nWrapType = 5; break;
+ }
+ if ( nWrapType )
+ m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPWR).append((sal_Int32)nWrapType);
+ }
+ break;
+ case ESCHER_Prop_fillColor:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fillColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_fillBackColor:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fillBackColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_AnchorText:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("anchorText"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_fNoFillHitTest:
+ if (it->nPropValue)
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fNoFillHitTest"), OString::valueOf(sal_Int32(1))));
+ break;
+ case ESCHER_Prop_fNoLineDrawDash:
+ // for some reason the value is set to 0x90000 if lines are switched off
+ if( it->nPropValue == 0x90000 )
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fLine"), OString::valueOf(sal_Int32(0))));
+ break;
+ case ESCHER_Prop_lineColor:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("lineColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_lineBackColor:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("lineBackColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_lineJoinStyle:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("lineJoinStyle"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_fshadowObscured:
+ if (it->nPropValue)
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fshadowObscured"), OString::valueOf(sal_Int32(1))));
+ break;
+ case ESCHER_Prop_geoLeft:
+ case ESCHER_Prop_geoTop:
+ {
+ sal_uInt32 nLeft = 0, nTop = 0;
+
+ if ( nId == ESCHER_Prop_geoLeft )
+ {
+ nLeft = it->nPropValue;
+ rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
+ }
+ else
+ {
+ nTop = it->nPropValue;
+ rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
+ }
+
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("geoLeft"),
+ OString::valueOf(sal_Int32(sal_Int32( nLeft )))));
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("geoTop"),
+ OString::valueOf(sal_Int32(sal_Int32( nTop )))));
+ }
+ break;
+
+ case ESCHER_Prop_geoRight:
+ case ESCHER_Prop_geoBottom:
+ {
+ sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0;
+ rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
+ rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
+
+ if ( nId == ESCHER_Prop_geoRight )
+ {
+ nRight = it->nPropValue;
+ rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom );
+ }
+ else
+ {
+ nBottom = it->nPropValue;
+ rProps.GetOpt( ESCHER_Prop_geoRight, nRight );
+ }
+
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("geoRight"),
+ OString::valueOf(sal_Int32(sal_Int32( nRight ) - sal_Int32( nLeft )))));
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("geoBottom"),
+ OString::valueOf(sal_Int32(sal_Int32( nBottom ) - sal_Int32( nTop )))));
+ }
+ break;
+ case ESCHER_Prop_pVertices:
+ case ESCHER_Prop_pSegmentInfo:
+ {
+ EscherPropSortStruct aVertices;
+ EscherPropSortStruct aSegments;
+
+ if ( rProps.GetOpt( ESCHER_Prop_pVertices, aVertices ) &&
+ rProps.GetOpt( ESCHER_Prop_pSegmentInfo, aSegments ) )
+ {
+ const sal_uInt8 *pVerticesIt = aVertices.pBuf + 6;
+ const sal_uInt8 *pSegmentIt = aSegments.pBuf;
+
+ OStringBuffer aSegmentInfo( 512 );
+ OStringBuffer aVerticies( 512 );
+
+ sal_uInt16 nPointSize = aVertices.pBuf[4] + ( aVertices.pBuf[5] << 8 );
+
+ // number of segments
+ sal_uInt16 nSegments = impl_GetUInt16( pSegmentIt );
+ sal_Int32 nVertices = 0;
+ aSegmentInfo.append("2;").append((sal_Int32)nSegments);
+ pSegmentIt += 4;
+
+ for ( ; nSegments; --nSegments )
+ {
+ sal_uInt16 nSeg = impl_GetUInt16( pSegmentIt );
+ aSegmentInfo.append(';').append((sal_Int32)nSeg);
+ switch ( nSeg )
+ {
+ case 0x0001: // lineto
+ case 0x4000: // moveto
+ {
+ sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize );
+ sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize );
+ aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" );
+ nVertices ++;
+ }
+ break;
+ case 0x2001: // curveto
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize );
+ sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize );
+ aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" );
+ nVertices ++;
+ }
+ }
+ break;
+ case 0xb300:
+ case 0xac00:
+ case 0xaa00: // nofill
+ case 0xab00: // nostroke
+ case 0x6001: // close
+ case 0x8000: // end
+ break;
+ default:
+ OSL_TRACE("%s: unhandled segment '%x' in the path", OSL_THIS_FUNC, nSeg);
+ break;
+ }
+ }
+
+ if (aVerticies.getLength() )
+ {
+ // We know the number of vertices at the end only, so we have to prepend them here.
+ OStringBuffer aBuf;
+ aBuf.append("8;").append((sal_Int32)nVertices);
+ aBuf.append(aVerticies.makeStringAndClear());
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("pVerticies"), aBuf.makeStringAndClear()));
+ }
+ if ( aSegmentInfo.getLength() )
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("pSegmentInfo"), aSegmentInfo.makeStringAndClear()));
+ }
+ else
+ OSL_TRACE("%s: unhandled shape path, missing either pVertices or pSegmentInfo", OSL_THIS_FUNC);
+ }
+ break;
+ case ESCHER_Prop_shapePath:
+ // noop, we use pSegmentInfo instead
+ break;
+ case ESCHER_Prop_fFillOK:
+ if (!it->nPropValue)
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fFillOK"), OString::valueOf(sal_Int32(0))));
+ break;
+ case ESCHER_Prop_dxTextLeft:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextLeft"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_dyTextTop:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextTop"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_dxTextRight:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextRight"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_dyTextBottom:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextBottom"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_FitTextToShape:
+ // Size text to fit shape size: not supported by RTF
+ break;
+ case ESCHER_Prop_adjustValue:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("adjustValue"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_txflTextFlow:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("txflTextFlow"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ default:
+ OSL_TRACE("%s: unhandled property: %d (value: %d)", OSL_THIS_FUNC, nId, it->nPropValue);
+ break;
+ }
+ }
+}
+
+void RtfSdrExport::AddLineDimensions( const Rectangle& rRectangle )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // We get the position relative to (the current?) character
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3))));
+
+ switch ( m_nShapeFlags & 0xC0 )
+ {
+ case 0x40:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1))));
+ break;
+ case 0x80:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1))));
+ break;
+ case 0xC0:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1))));
+ break;
+ }
+
+ // the actual dimensions
+ m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left());
+ m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top());
+ m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right());
+ m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom());
+}
+
+void RtfSdrExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ // We get the position relative to (the current?) character
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3))));
+
+ rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left());
+ rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top());
+ rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right());
+ rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom());
+}
+
+void RtfSdrExport::AddShapeAttribute( sal_Int32 /*nAttribute*/, const rtl::OString& /*rValue*/ )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ /* noop */
+}
+
+extern const char* pShapeTypes[];
+
+void lcl_AppendSP( ::rtl::OStringBuffer& rRunText, const char cName[], const ::rtl::OString& rValue)
+{
+ rRunText.append('{').append(OOO_STRING_SVTOOLS_RTF_SP)
+ .append('{').append(OOO_STRING_SVTOOLS_RTF_SN " ").append(cName).append('}')
+ .append('{').append(OOO_STRING_SVTOOLS_RTF_SV " ").append(rValue).append('}')
+ .append('}');
+}
+sal_Int32 RtfSdrExport::StartShape()
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( m_nShapeType == ESCHER_ShpInst_Nil )
+ return -1;
+
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("shapeType"), OString::valueOf(sal_Int32(m_nShapeType))));
+
+ m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHP);
+ m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_IGNORE).append(OOO_STRING_SVTOOLS_RTF_SHPINST);
+
+ m_rAttrOutput.RunText().append(m_pShapeStyle->makeStringAndClear());
+ // Ignore \shpbxpage, \shpbxmargin, and \shpbxcolumn, in favor of the posrelh property.
+ m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE);
+ // Ignore \shpbypage, \shpbymargin, and \shpbycolumn, in favor of the posrelh property.
+ m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE);
+
+ for(std::map<OString,OString>::reverse_iterator i = m_aShapeProps.rbegin(); i != m_aShapeProps.rend(); i++)
+ lcl_AppendSP(m_rAttrOutput.RunText(), (*i).first, (*i).second );
+
+ lcl_AppendSP(m_rAttrOutput.RunText(), "wzDescription", RtfExport::OutString( m_pSdrObject->GetDescription(), m_rExport.eCurrentEncoding));
+ lcl_AppendSP(m_rAttrOutput.RunText(), "wzName", RtfExport::OutString( m_pSdrObject->GetTitle(), m_rExport.eCurrentEncoding));
+
+ // now check if we have some text
+ const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);
+ if (pTxtObj)
+ {
+ const OutlinerParaObject* pParaObj = 0;
+ bool bOwnParaObj = false;
+
+ /*
+ #i13885#
+ When the object is actively being edited, that text is not set into
+ the objects normal text object, but lives in a seperate object.
+ */
+ if (pTxtObj->IsTextEditActive())
+ {
+ pParaObj = pTxtObj->GetEditOutlinerParaObject();
+ bOwnParaObj = true;
+ }
+ else
+ {
+ pParaObj = pTxtObj->GetOutlinerParaObject();
+ }
+
+ if( pParaObj )
+ {
+ // this is reached only in case some text is attached to the shape
+ WriteOutliner(*pParaObj);
+ if( bOwnParaObj )
+ delete pParaObj;
+ }
+ }
+
+ return m_nShapeType;
+}
+
+void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj)
+{
+ OSL_TRACE("%s start", OSL_THIS_FUNC);
+
+ const EditTextObject& rEditObj = rParaObj.GetTextObject();
+ MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX );
+
+ USHORT nPara = rEditObj.GetParagraphCount();
+
+ m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' ');
+ for (USHORT n = 0; n < nPara; ++n)
+ {
+ if( n )
+ aAttrIter.NextPara( n );
+
+ rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
+
+ String aStr( rEditObj.GetText( n ));
+ xub_StrLen nAktPos = 0;
+ xub_StrLen nEnd = aStr.Len();
+
+ aAttrIter.OutParaAttr(false);
+ m_rAttrOutput.RunText().append(m_rAttrOutput.Styles().makeStringAndClear());
+
+ do {
+ xub_StrLen nNextAttr = aAttrIter.WhereNext();
+ rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet();
+
+ if( nNextAttr > nEnd )
+ nNextAttr = nEnd;
+
+ aAttrIter.OutAttr( nAktPos );
+ m_rAttrOutput.RunText().append('{').append(m_rAttrOutput.Styles().makeStringAndClear()).append(m_rExport.sNewLine);
+ bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
+ if( !bTxtAtr )
+ {
+ String aOut( aStr.Copy( nAktPos, nNextAttr - nAktPos ) );
+ m_rAttrOutput.RunText().append( m_rExport.OutString( aOut, eChrSet ) );
+ }
+
+ m_rAttrOutput.RunText().append('}');
+
+ nAktPos = nNextAttr;
+ eChrSet = eNextChrSet;
+ aAttrIter.NextPos();
+ }
+ while( nAktPos < nEnd );
+ }
+ m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_PAR).append('}');
+
+ OSL_TRACE("%s end", OSL_THIS_FUNC);
+}
+
+void RtfSdrExport::EndShape( sal_Int32 nShapeElement )
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+
+ if ( nShapeElement >= 0 )
+ {
+ // end of the shape
+ m_rAttrOutput.RunText().append('}').append('}');
+ }
+}
+
+UINT32 RtfSdrExport::AddSdrObject( const SdrObject& rObj )
+{
+ m_pSdrObject = &rObj;
+ return EscherEx::AddSdrObject(rObj);
+}
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx
new file mode 100644
index 000000000000..f69b8bccab96
--- /dev/null
+++ b/sw/source/filter/ww8/rtfsdrexport.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFSdrEXPORT_HXX_
+#define _RTFSdrEXPORT_HXX_
+
+#include <filter/msfilter/escherex.hxx>
+#include <editeng/outlobj.hxx>
+#include <rtl/strbuf.hxx>
+
+#include <map>
+
+class RtfExport;
+class RtfAttributeOutput;
+
+class RtfSdrExport : public EscherEx
+{
+ RtfExport &m_rExport;
+
+ RtfAttributeOutput &m_rAttrOutput;
+
+ const SdrObject* m_pSdrObject;
+
+ /// Remember the shape type.
+ sal_uInt32 m_nShapeType;
+
+ /// Remember the shape flags.
+ sal_uInt32 m_nShapeFlags;
+
+ /// Remember style, the most important shape attribute ;-)
+ rtl::OStringBuffer *m_pShapeStyle;
+
+ std::map<rtl::OString,rtl::OString> m_aShapeProps;
+
+ /// Remember which shape types we had already written.
+ bool *m_pShapeTypeWritten;
+
+public:
+ RtfSdrExport( RtfExport &rExport );
+ virtual ~RtfSdrExport();
+
+ /// Export the sdr object as Sdr.
+ ///
+ /// Call this when you need to export the object as Sdr in RTF.
+ UINT32 AddSdrObject( const SdrObject& rObj );
+
+protected:
+ /// Add an attribute to the generated shape element.
+ ///
+ /// This should be called from within StartShape() to ensure that the
+ /// added attribute is preserved.
+ void AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& sValue );
+
+ /// Start the shape for which we just collected the information.
+ ///
+ /// Returns the element's tag number, -1 means we wrote nothing.
+ using EscherEx::StartShape;
+ virtual sal_Int32 StartShape();
+
+ /// End the shape.
+ ///
+ /// The parameter is just what we got from StartShape().
+ using EscherEx::EndShape;
+ virtual void EndShape( sal_Int32 nShapeElement );
+
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
+private:
+
+ virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
+ virtual void CloseContainer();
+
+ using EscherEx::EnterGroup;
+ virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ virtual void LeaveGroup();
+
+ virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 );
+
+private:
+ /// Add starting and ending point of a line to the m_pShapeAttrList.
+ void AddLineDimensions( const Rectangle& rRectangle );
+
+ /// Add position and size to the OStringBuffer.
+ void AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle );
+
+ void WriteOutliner(const OutlinerParaObject& rParaObj);
+};
+
+#endif // _RTFSdrEXPORT_HXX_
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 850e9b118fae..663df5db7b0e 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -466,9 +466,21 @@ namespace sw
}
//SetLayer boilerplate end
- void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems)
+ void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet )
{
- if (rSet.Count())
+ if( bExportParentItemSet )
+ {
+ USHORT nTotal = rSet.TotalCount();
+ for( USHORT nItem =0; nItem < nTotal; ++nItem )
+ {
+ const SfxPoolItem* pItem = 0;
+ if( SFX_ITEM_SET == rSet.GetItemState( rSet.GetWhichByPos( nItem ), true, &pItem ) )
+ {
+ rItems[pItem->Which()] = pItem;
+ }
+ }
+ }
+ else if( rSet.Count())
{
SfxItemIter aIter(rSet);
if (const SfxPoolItem *pItem = aIter.GetCurItem())
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index ec149ee08326..9e425714aad7 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -590,7 +590,7 @@ namespace sw
@author
<a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
*/
- void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems);
+ void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet );
const SfxPoolItem *SearchPoolItems(const PoolItems &rItems,
sal_uInt16 eType);
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index c7f5c06cb81c..306c9f6df78c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -812,49 +812,7 @@ void WW8Export::AppendFlyInFlys(const sw::Frame& rFrmFmt,
OutputField(0, ww::eSHAPE, aEmptyStr, WRITEFIELD_CLOSE);
}
-class WW8_SdrAttrIter : public MSWordAttrIter
-{
-private:
- const EditTextObject* pEditObj;
- const SfxItemPool* pEditPool;
- EECharAttribArray aTxtAtrArr;
- SvPtrarr aChrTxtAtrArr;
- SvUShorts aChrSetArr;
- USHORT nPara;
- xub_StrLen nAktSwPos;
- xub_StrLen nTmpSwPos; // fuer HasItem()
- rtl_TextEncoding eNdChrSet;
- USHORT nScript;
- BYTE mnTyp;
-
- xub_StrLen SearchNext( xub_StrLen nStartPos );
- void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart);
-
- //No copying
- WW8_SdrAttrIter(const WW8_SdrAttrIter&);
- WW8_SdrAttrIter& operator=(const WW8_SdrAttrIter&);
-public:
- WW8_SdrAttrIter( WW8Export& rWr, const EditTextObject& rEditObj,
- BYTE nType );
- void NextPara( USHORT nPar );
- void OutParaAttr(bool bCharAttr);
- void OutEEField(const SfxPoolItem& rHt);
-
- bool IsTxtAttr(xub_StrLen nSwPos);
-
- void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); }
-
- void OutAttr( xub_StrLen nSwPos );
- virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const;
- virtual const SfxPoolItem& GetItem( USHORT nWhich ) const;
- bool OutAttrWithRange(xub_StrLen nPos);
- xub_StrLen WhereNext() const { return nAktSwPos; }
- rtl_TextEncoding GetNextCharSet() const;
- rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; }
-};
-
-
-WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr,
+MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr,
const EditTextObject& rEditObj, BYTE nTyp )
: MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(0),
aTxtAtrArr( 0, 4 ), aChrTxtAtrArr( 0, 4 ), aChrSetArr( 0, 4 ),
@@ -863,7 +821,7 @@ WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr,
NextPara( 0 );
}
-void WW8_SdrAttrIter::NextPara( USHORT nPar )
+void MSWord_SdrAttrIter::NextPara( USHORT nPar )
{
nPara = nPar;
// Attributwechsel an Pos 0 wird ignoriert, da davon ausgegangen
@@ -886,7 +844,7 @@ void WW8_SdrAttrIter::NextPara( USHORT nPar )
nAktSwPos = SearchNext( 1 );
}
-rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const
+rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const
{
if( aChrSetArr.Count() )
return (rtl_TextEncoding)aChrSetArr[ aChrSetArr.Count() - 1 ];
@@ -894,7 +852,7 @@ rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const
}
// der erste Parameter in SearchNext() liefert zurueck, ob es ein TxtAtr ist.
-xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos )
+xub_StrLen MSWord_SdrAttrIter::SearchNext( xub_StrLen nStartPos )
{
xub_StrLen nPos;
xub_StrLen nMinPos = STRING_MAXLEN;
@@ -933,7 +891,7 @@ xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos )
return nMinPos;
}
-void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
+void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
{
void* p = 0;
rtl_TextEncoding eChrSet;
@@ -963,7 +921,7 @@ void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
}
}
-void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
+void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
{
const SvxFieldItem &rField = (const SvxFieldItem &)rHt;
const SvxFieldData *pFld = rField.GetField();
@@ -982,7 +940,7 @@ void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
}
}
-void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos )
+void MSWord_SdrAttrIter::OutAttr( xub_StrLen nSwPos )
{
OutParaAttr(true);
@@ -1039,7 +997,7 @@ void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos )
}
}
-bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos)
+bool MSWord_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos)
{
for (USHORT i = 0; i < aTxtAtrArr.Count(); ++i)
{
@@ -1064,7 +1022,7 @@ bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos)
// Attribut-Anfangposition fragen kann.
// Es koennen nur Attribute mit Ende abgefragt werden.
// Es wird mit bDeep gesucht
-const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const
+const SfxPoolItem* MSWord_SdrAttrIter::HasTextItem(USHORT nWhich) const
{
const SfxPoolItem* pRet = 0;
nWhich = sw::hack::TransformWhichBetweenPools(*pEditPool,
@@ -1089,7 +1047,7 @@ const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const
return pRet;
}
-const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const
+const SfxPoolItem& MSWord_SdrAttrIter::GetItem( USHORT nWhich ) const
{
using sw::hack::GetSetWhichFromSwDocWhich;
const SfxPoolItem* pRet = HasTextItem(nWhich);
@@ -1103,7 +1061,7 @@ const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const
return *pRet;
}
-void WW8_SdrAttrIter::OutParaAttr(bool bCharAttr)
+void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr)
{
SfxItemSet aSet( pEditObj->GetParaAttribs( nPara ));
if( aSet.Count() )
@@ -1176,7 +1134,7 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, BYTE nTyp)
{
bool bAnyWrite = false;
const EditTextObject& rEditObj = rParaObj.GetTextObject();
- WW8_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
+ MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
USHORT nPara = rEditObj.GetParagraphCount();
BYTE bNul = 0;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 6e6dcf813767..7b97b2fbdbc0 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -540,7 +540,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos )
ClearOverridesFromSet( *pCharFmtItem, aExportSet );
sw::PoolItems aExportItems;
- GetPoolItems( aExportSet, aExportItems );
+ GetPoolItems( aExportSet, aExportItems, false );
sw::cPoolItemIter aEnd = aRangeItems.end();
for ( sw::cPoolItemIter aI = aRangeItems.begin(); aI != aEnd; ++aI )
@@ -1646,14 +1646,136 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS
m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );
}
-xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& /*rNode*/, xub_StrLen /*nAktPos*/ )
+xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
{
- return aAttrIter->WhereNext();
+ // Get the bookmarks for the normal run
+ xub_StrLen nNextPos = aAttrIter->WhereNext();
+
+ GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
+
+ xub_StrLen nNextBookmark = nNextPos;
+ NearestBookmark( nNextPos, nAktPos, false );
+
+ return std::min( nNextPos, nNextBookmark );
+}
+
+void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ )
+{
+ xub_StrLen nNextPos;
+
+ // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+ bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
+ if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
+ aAttrIter->NextPos();
+}
+
+bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt,
+ xub_StrLen nEnd, IMarkVector& rArr )
+{
+ IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
+ ULONG nNd = rNd.GetIndex( );
+
+ const sal_Int32 nMarks = pMarkAccess->getMarksCount();
+ for ( sal_Int32 i = 0; i < nMarks; i++ )
+ {
+ IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get();
+
+ // Only keep the bookmarks starting or ending in this node
+ if ( pMark->GetMarkStart().nNode == nNd ||
+ pMark->GetMarkEnd().nNode == nNd )
+ {
+ xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex();
+ xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex();
+
+ // Keep only the bookmars starting or ending in the snippet
+ bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd );
+ bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
+
+ if ( bIsStartOk || bIsEndOk )
+ rArr.push_back( pMark );
+ }
+ }
+ return ( rArr.size() > 0 );
+}
+
+class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool >
+{
+public:
+ inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const
+ {
+ xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex();
+ xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex();
+
+ return nOEnd < nTEnd;
+ }
+};
+
+bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly )
+{
+ bool bHasBookmark = false;
+
+ if ( m_rSortedMarksStart.size( ) > 0 )
+ {
+ IMark* pMarkStart = m_rSortedMarksStart.front();
+ xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
+ if( !bNextPositionOnly || (nNext > nAktPos ))
+ {
+ rNearest = nNext;
+ bHasBookmark = true;
+ }
+ }
+
+ if ( m_rSortedMarksEnd.size( ) > 0 )
+ {
+ IMark* pMarkEnd = m_rSortedMarksEnd[0];
+ xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
+ if( !bNextPositionOnly || nNext > nAktPos )
+ {
+ if ( !bHasBookmark )
+ rNearest = nNext;
+ else
+ rNearest = std::min( rNearest, nNext );
+ bHasBookmark = true;
+ }
+ }
+
+ return bHasBookmark;
}
-void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen /*nAktPos*/, xub_StrLen /*nEnd*/ )
+void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
{
- aAttrIter->NextPos();
+ IMarkVector aMarksStart;
+ if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) )
+ {
+ IMarkVector aSortedEnd;
+ IMarkVector aSortedStart;
+ for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end();
+ it < end; ++it )
+ {
+ IMark* pMark = (*it);
+
+ // Remove the positions egals to the current pos
+ xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex();
+ xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex();
+
+ if ( nStart > nAktPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) )
+ aSortedStart.push_back( pMark );
+
+ if ( nEnd > nAktPos && nEnd <= ( nAktPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.GetIndex()) )
+ aSortedEnd.push_back( pMark );
+ }
+
+ // Sort the bookmarks by end position
+ std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() );
+
+ m_rSortedMarksStart.swap( aSortedStart );
+ m_rSortedMarksEnd.swap( aSortedEnd );
+ }
+ else
+ {
+ m_rSortedMarksStart.clear( );
+ m_rSortedMarksEnd.clear( );
+ }
}
void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
@@ -2188,7 +2310,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
pOutFmtNode = &rNode;
// Pap-Attrs, so script is not necessary
- OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN);
+ OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN, false);
pStyAttr = 0;
pOutFmtNode = pOldMod;
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 14fdd4e3627f..47316c867e33 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -268,7 +268,7 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
m_rWW8Export.InsUInt16( nFontID );
}
- m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN );
+ m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF );
m_rWW8Export.pO = pOldpO;
}
@@ -721,6 +721,9 @@ void MSWordExportBase::SubstituteBullet( String& rNumStr,
StarSymbolToMSMultiFont *pConvert = 0;
FontFamily eFamily = FAMILY_DECORATIVE;
+ if (!bSubstituteBullets)
+ return;
+
if (!pConvert)
{
pConvert = CreateStarSymbolToMSMultiFont();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 70d0d043710c..4d16a5646536 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -79,6 +79,7 @@
#include "ww8par.hxx"
#include "ww8attributeoutput.hxx"
#include "docxattributeoutput.hxx"
+#include "rtfattributeoutput.hxx"
using namespace sw::util;
using namespace nsHdFtFlags;
@@ -713,6 +714,17 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const
}
#endif
+void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const
+{
+ rAttrOutput->FontFamilyType( meFamily, *this );
+ rAttrOutput->FontPitchType( mePitch );
+ rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) );
+ rAttrOutput->StartFont( msFamilyNm );
+ if ( mbAlt )
+ rAttrOutput->FontAlternateName( msAltNm );
+ rAttrOutput->EndFont();
+}
+
bool operator<(const wwFont &r1, const wwFont &r2)
{
int nRet = memcmp(r1.maWW8_FFN, r2.maWW8_FFN, sizeof(r1.maWW8_FFN));
@@ -765,6 +777,22 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
}
+
+ if (!bLoadAllFonts)
+ return;
+
+ const USHORT aTypes[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT, 0 };
+ for (const USHORT* pId = aTypes; *pId; ++pId)
+ {
+ USHORT nMaxItem = rPool.GetItemCount2( *pId );
+ for( USHORT nGet = 0; nGet < nMaxItem; ++nGet )
+ if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2(
+ *pId, nGet )) )
+ {
+ GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
+ pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
+ }
+ }
}
USHORT wwFontHelper::GetId(const Font& rFont)
@@ -839,6 +867,14 @@ void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput )
}
#endif
+void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput )
+{
+ ::std::vector<const wwFont *> aFontList( AsVector() );
+
+ ::std::for_each( aFontList.begin(), aFontList.end(),
+ ::std::bind2nd( ::std::mem_fun( &wwFont::WriteRtf ), &rAttrOutput ) );
+}
+
/* */
WW8_WrPlc0::WW8_WrPlc0( ULONG nOffset )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index fd20d2f6dc65..0b1693e919f1 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3371,7 +3371,8 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0),
mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
pStyles( NULL ),
- bHasHdr(false), bHasFtr(false),
+ bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
+ mbExportModeRTF( false ),
pDoc( pDocument ),
pCurPam( pCurrentPam ),
pOrigPam( pOriginalPam )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 3c2f0d4d6d13..4ba3bf3c1089 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -35,6 +35,7 @@
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
#endif
+#include <editeng/editdata.hxx>
#include <map>
#include <vector>
@@ -55,6 +56,7 @@
class SwAttrIter;
class AttributeOutputBase;
class DocxAttributeOutput;
+class RtfAttributeOutput;
class BitmapPalette;
class SwEscherEx;
class DateTime;
@@ -296,6 +298,7 @@ public:
#ifdef DOCX
void WriteDocx( const DocxAttributeOutput* rAttrOutput ) const;
#endif
+ void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const;
rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); }
friend bool operator < (const wwFont &r1, const wwFont &r2);
};
@@ -311,7 +314,7 @@ private:
::std::vector< const wwFont* > AsVector() const;
public:
- wwFontHelper() : mbWrtWW8(false) {}
+ wwFontHelper() : mbWrtWW8(false), bLoadAllFonts(false) {}
/// rDoc used only to get the initial standard font(s) in use.
void InitFontTable(bool bWrtWW8, const SwDoc& rDoc);
USHORT GetId(const Font& rFont);
@@ -321,6 +324,10 @@ public:
#ifdef DOCX
void WriteFontTable( const DocxAttributeOutput& rAttrOutput );
#endif
+ void WriteFontTable( const RtfAttributeOutput& rAttrOutput );
+
+ /// If true, all fonts are loaded before processing the document.
+ BYTE bLoadAllFonts: 1;
};
class DrawObj
@@ -539,6 +546,9 @@ public:
BYTE bEndAtTxtEnd : 1; // true: all END at Textend
BYTE bHasHdr : 1;
BYTE bHasFtr : 1;
+ BYTE bSubstituteBullets : 1; // true: SubstituteBullet() gets called
+
+ bool mbExportModeRTF;
SwDoc *pDoc;
SwPaM *pCurPam, *pOrigPam;
@@ -546,6 +556,11 @@ public:
/// Stack to remember the nesting (see MSWordSaveData for more)
::std::stack< MSWordSaveData > maSaveData;
+ /// Used to split the runs according to the bookmarks start and ends
+ typedef std::vector< ::sw::mark::IMark* > IMarkVector;
+ IMarkVector m_rSortedMarksStart;
+ IMarkVector m_rSortedMarksEnd;
+
public:
/// The main function to export the document.
void ExportDocument( bool bWriteAll );
@@ -584,7 +599,7 @@ public:
void AppendWordBookmark( const String& rName );
/// Use OutputItem() on an item set according to the parameters.
- void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript );
+ void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript, bool bExportParentItemSet );
short GetDefaultFrameDirection( ) const;
@@ -785,6 +800,17 @@ protected:
/// One of OutputTextNode(), OutputGrfNode(), or OutputOLENode()
void OutputContentNode( const SwCntntNode& );
+ /// Find the nearest bookmark from the current position.
+ ///
+ /// Returns false when there is no bookmark.
+ bool NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly );
+
+ void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos,
+ xub_StrLen nLen );
+
+ bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd,
+ IMarkVector& rArr );
+
public:
MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam );
virtual ~MSWordExportBase();
@@ -1350,6 +1376,47 @@ public:
virtual const SfxPoolItem& GetItem( USHORT nWhich ) const = 0;
};
+class MSWord_SdrAttrIter : public MSWordAttrIter
+{
+private:
+ const EditTextObject* pEditObj;
+ const SfxItemPool* pEditPool;
+ EECharAttribArray aTxtAtrArr;
+ SvPtrarr aChrTxtAtrArr;
+ SvUShorts aChrSetArr;
+ USHORT nPara;
+ xub_StrLen nAktSwPos;
+ xub_StrLen nTmpSwPos; // for HasItem()
+ rtl_TextEncoding eNdChrSet;
+ USHORT nScript;
+ BYTE mnTyp;
+
+ xub_StrLen SearchNext( xub_StrLen nStartPos );
+ void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart);
+
+ //No copying
+ MSWord_SdrAttrIter(const MSWord_SdrAttrIter&);
+ MSWord_SdrAttrIter& operator=(const MSWord_SdrAttrIter&);
+public:
+ MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj,
+ BYTE nType );
+ void NextPara( USHORT nPar );
+ void OutParaAttr(bool bCharAttr);
+ void OutEEField(const SfxPoolItem& rHt);
+
+ bool IsTxtAttr(xub_StrLen nSwPos);
+
+ void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); }
+
+ void OutAttr( xub_StrLen nSwPos );
+ virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const;
+ virtual const SfxPoolItem& GetItem( USHORT nWhich ) const;
+ bool OutAttrWithRange(xub_StrLen nPos);
+ xub_StrLen WhereNext() const { return nAktSwPos; }
+ rtl_TextEncoding GetNextCharSet() const;
+ rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; }
+};
+
/// Class to collect and output the styles table.
class MSWordStyles
{
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 6e00687ffafa..6453869ee0d2 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -271,20 +271,21 @@ void MSWordExportBase::ExportPoolItemsToCHP( sw::PoolItems &rItems, USHORT nScri
* - gebe die Attribute aus; ohne Parents!
*/
-void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript )
+void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript,
+ bool bExportParentItemSet )
{
- if ( rSet.Count() )
+ if( bExportParentItemSet || rSet.Count() )
{
const SfxPoolItem* pItem;
pISet = &rSet; // fuer Doppel-Attribute
// If frame dir is set, but not adjust, then force adjust as well
- if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, false ) )
+ if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, bExportParentItemSet ) )
{
// No explicit adjust set ?
- if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, false ) )
+ if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, bExportParentItemSet ) )
{
- if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST ) ) )
+ if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet ) ) )
{
// then set the adjust used by the parent format
AttrOutput().OutputItem( *pItem );
@@ -292,7 +293,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
}
}
- if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, false, &pItem ) )
+ if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, bExportParentItemSet, &pItem ) )
{
AttrOutput().OutputItem( *pItem );
@@ -307,7 +308,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
}
sw::PoolItems aItems;
- GetPoolItems( rSet, aItems );
+ GetPoolItems( rSet, aItems, bExportParentItemSet );
if ( bChpFmt )
ExportPoolItemsToCHP(aItems, nScript);
@@ -783,7 +784,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
aSet.Put( aLR );
CorrectTabStopInSet( aSet, rNFmt.GetAbsLSpace() );
OutputItemSet( aSet, bPapFmt, bChpFmt,
- i18n::ScriptType::LATIN);
+ i18n::ScriptType::LATIN, mbExportModeRTF);
bCallOutSet = false;
}
}
@@ -801,7 +802,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
ItemGet<SvxLRSpaceItem>(aSet, RES_LR_SPACE));
aSet.Put( aLR );
OutputItemSet( aSet, bPapFmt, bChpFmt,
- com::sun::star::i18n::ScriptType::LATIN);
+ com::sun::star::i18n::ScriptType::LATIN, mbExportModeRTF);
bCallOutSet = false;
}
// <--
@@ -841,7 +842,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
bOutFlyFrmAttrs = true;
//script doesn't matter if not exporting chp
OutputItemSet(aSet, true, false,
- i18n::ScriptType::LATIN);
+ i18n::ScriptType::LATIN, mbExportModeRTF);
bOutFlyFrmAttrs = false;
bCallOutSet = false;
@@ -855,7 +856,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
if( bCallOutSet )
OutputItemSet( rFmt.GetAttrSet(), bPapFmt, bChpFmt,
- i18n::ScriptType::LATIN);
+ i18n::ScriptType::LATIN, mbExportModeRTF);
pOutFmtNode = pOldMod;
}
@@ -3340,7 +3341,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
m_rWW8Export.pO->Insert( (BYTE)0x02, m_rWW8Export.pO->Count() );
sal_Unicode cStart = rTwoLines.GetStartBracket();
- sal_Unicode cEnd = rTwoLines.GetStartBracket();
+ sal_Unicode cEnd = rTwoLines.GetEndBracket();
/*
As per usual we have problems. We can have seperate left and right brackets
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index d01af0213156..9508c4c17864 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -1147,6 +1147,23 @@ void SwDocShell::GetState(SfxItemSet& rSet)
rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
}
break;
+ case SID_MAIL_PREPAREEXPORT:
+ {
+ //check if linked content or possibly hidden content is available
+ //pDoc->UpdateFlds( NULL, false );
+ sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager();
+ const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
+ sal_Bool bRet = sal_False;
+ if( rLnks.Count() )
+ bRet = sal_True;
+ else
+ {
+ //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields
+ bRet = pDoc->HasInvisibleContent();
+ }
+ rSet.Put( SfxBoolItem( nWhich, bRet ) );
+ }
+ break;
default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!");
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 17f11b115bf8..5bbc29aab2ee 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1209,7 +1209,19 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
break;
- case SID_MAIL_EXPORT_FINISHED:
+ case SID_MAIL_PREPAREEXPORT:
+ {
+ //pWrtShell is not set in page preview
+ if(pWrtShell)
+ pWrtShell->StartAllAction();
+ pDoc->UpdateFlds( NULL, false );
+ pDoc->EmbedAllLinks();
+ pDoc->RemoveInvisibleContent();
+ if(pWrtShell)
+ pWrtShell->EndAllAction();
+ }
+ break;
+ case SID_MAIL_EXPORT_FINISHED:
{
if(pWrtShell)
pWrtShell->StartAllAction();
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index 3b23591c84eb..99492c5b9f07 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -430,14 +430,14 @@
MenuItem\
{\
Identifier = FN_REPLY ;\
- HelpId = CMD_FN_DELETE_NOTE ;\
+ HelpID = CMD_FN_REPLY ;\
Text [ en-US ] = "Reply" ;\
};\
SEPARATOR ; \
MenuItem\
{\
- Identifier = FN_DELETE_NOTE ;\
- HelpId = CMD_FN_DELETE_NOTE ;\
+ Identifier = FN_DELETE_COMMENT ;\
+ HelpID = CMD_FN_DELETE_COMMENT ;\
Text [ en-US ] = "Delete ~Comment" ;\
};\
MenuItem\
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index a9d90a4c02e4..44006ef5cab4 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -109,7 +109,7 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
aStyleLB.SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl));
aFilterLB.SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl));
- aTbLinks.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN);
+ aTbLinks.SetStyle(aTbLinks.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
aTbLinks.SetSelectionMode( SINGLE_SELECTION );
aTbLinks.SetTabs( &nTabs[0], MAP_APPFONT );
aTbLinks.Resize(); // OS: Hack fuer richtige Selektion
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 5fa03de5e0a5..726d27b281d1 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -330,7 +330,7 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare
m_aStatusLB.SetHelpId(HID_MM_TESTACCOUNTSETTINGS_TLB);
static long nTabs[] = {2, 0, aSz.Width()/2 };
- m_aStatusLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
+ m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aStatusLB.SetSelectionMode( SINGLE_SELECTION );
m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL);
short nEntryHeight = m_aStatusLB.GetEntryHeight();
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 49c073103501..04b781982979 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -152,7 +152,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage( Window* pParent, const SfxItemSe
pEntry->SetUserData( (void*)(ULONG)nResId );
}
}
- m_aOptionsLB.SetWindowBits( m_aOptionsLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
+ m_aOptionsLB.SetStyle( m_aOptionsLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
m_aOptionsLB.SetHighlightRange();
FreeResource();
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index dc007fc68e13..331d7035dc56 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -219,7 +219,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
m_aListLB.SetHelpId(HID_MM_ADDRESSLIST_TLB);
static long nTabs[] = {2, 0, aSz.Width()/2 };
- m_aListLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
+ m_aListLB.SetStyle( m_aListLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aListLB.SetSelectionMode( SINGLE_SELECTION );
m_aListLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aOK.SetClickHdl( LINK( this, SwAddressListDialog, OKHdl_Impl));
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 349a419e1c35..90eeb6ee1982 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -134,6 +134,7 @@
#include <memory>
#include <vector>
#include <unomid.h>
+#include <section.hxx>
using namespace ::osl;
using namespace ::svx;
@@ -842,6 +843,23 @@ void lcl_CopyFollowPageDesc(
}
}
+void lcl_RemoveSectionLinks( SwWrtShell& rWorkShell )
+{
+ //reset all links of the sections of synchronized labels
+ USHORT nSections = rWorkShell.GetSectionFmtCount();
+ for( USHORT nSection = 0; nSection < nSections; ++nSection )
+ {
+ SwSectionData aSectionData( *rWorkShell.GetSectionFmt( nSection ).GetSection() );
+ if( aSectionData.GetType() == FILE_LINK_SECTION )
+ {
+ aSectionData.SetType( CONTENT_SECTION );
+ aSectionData.SetLinkFileName( String() );
+ rWorkShell.UpdateSection( nSection, aSectionData );
+ }
+ }
+ rWorkShell.SetLabelDoc( sal_False );
+}
+
BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
const SwMergeDescriptor& rMergeDescriptor)
{
@@ -1082,6 +1100,10 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
// copy created file into the target document
rWorkShell.ConvertFieldsToText();
rWorkShell.SetNumberingRestart();
+ if( bSynchronizedDoc )
+ {
+ lcl_RemoveSectionLinks( rWorkShell );
+ }
// insert the document into the target document
rWorkShell.SttEndDoc(FALSE);
@@ -2931,7 +2953,10 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
rWorkShell.RemoveInvisibleContent();
rWorkShell.ConvertFieldsToText();
rWorkShell.SetNumberingRestart();
-
+ if( bSynchronizedDoc )
+ {
+ lcl_RemoveSectionLinks( rWorkShell );
+ }
// insert the document into the target document
rWorkShell.SttEndDoc(FALSE);
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 1e0a1faf1cbc..83259add5238 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -260,7 +260,7 @@ void SwDBTreeList::InitTreeList()
if(!pImpl->HasContext() && pImpl->GetWrtShell())
return;
SetSelectionMode(SINGLE_SELECTION);
- SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
// Font nicht setzen, damit der Font des Controls uebernommen wird!
SetSpaceBetweenEntries(0);
SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index 758f52840230..06d7dffab0ed 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -418,7 +418,7 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf
m_aStatusLB.SetHelpId(HID_MM_MAILSTATUS_TLB);
static long nTabs[] = {3, 0, nPos1, aSz.Width() };
- m_aStatusLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
+ m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aStatusLB.SetSelectionMode( SINGLE_SELECTION );
m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aStatusLB.SetSpaceBetweenEntries(3);
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 887ec3151fc5..1c45831e97e2 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1453,7 +1453,7 @@ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId)
SvTreeListBox(pParent, rResId),
m_pParentDialog(pParent)
{
- SetWindowBits( /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
+ SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
WB_CLIPCHILDREN );
// SetSpaceBetweenEntries(3);
SetSelectionMode( SINGLE_SELECTION );
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 6cb7b87336c8..41f9a18a0325 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -109,7 +109,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent,
static long nTabs[] = {3, 0, aSz.Width()/2, aSz.Width() };
m_aTableLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aTableLB.SetHelpId(HID_MM_SELECTDBTABLEDDIALOG_LISTBOX);
- m_aTableLB.SetWindowBits( WB_CLIPCHILDREN );
+ m_aTableLB.SetStyle( m_aTableLB.GetStyle() | WB_CLIPCHILDREN );
m_aTableLB.SetSpaceBetweenEntries(3);
m_aTableLB.SetSelectionMode( SINGLE_SELECTION );
m_aTableLB.SetDragDropMode( 0 );
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index b4151f6d1462..5acc169c4979 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -432,7 +432,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aTree.SetHelpId(HID_REGION_TREE);
aTree.SetSelectionMode( MULTIPLE_SELECTION );
- aTree.SetWindowBits(WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL);
+ aTree.SetStyle(aTree.GetStyle()|WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL);
aTree.SetSpaceBetweenEntries(0);
if(bWeb)
diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx
index 6022a4646ae6..c49c689851ba 100644
--- a/sw/source/ui/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx
@@ -85,20 +85,13 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( mrSidebarWin.IsReadOnly() )
{
pButtonPopup->EnableItem( FN_REPLY, false );
- pButtonPopup->EnableItem( FN_DELETE_NOTE, false );
+ pButtonPopup->EnableItem( FN_DELETE_COMMENT, false );
pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, false );
pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, false );
}
else
{
- if ( mrSidebarWin.IsProtected() )
- {
- pButtonPopup->EnableItem( FN_DELETE_NOTE, false );
- }
- else
- {
- pButtonPopup->EnableItem( FN_DELETE_NOTE, true );
- }
+ pButtonPopup->EnableItem( FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() );
pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, true );
pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, true );
}
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index 884409826362..413ffaef4333 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -935,7 +935,6 @@ void SwSidebarWin::ExecuteCommand(USHORT nSlot)
break;
}
case FN_DELETE_COMMENT:
- case FN_DELETE_NOTE:
//Delete(); // do not kill the parent of our open popup menu
mnEventId = Application::PostUserEvent( LINK( this, SwSidebarWin, DeleteHdl), 0 );
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 279ce515c1d9..d10a938c3046 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -103,9 +103,9 @@ void SwEnvPreview::Paint(const Rectangle &)
USHORT nPageW = (USHORT) Max(rItem.lWidth, rItem.lHeight),
nPageH = (USHORT) Min(rItem.lWidth, rItem.lHeight);
- float fx = static_cast< float >(GetOutputSizePixel().Width () / nPageW),
- fy = static_cast< float >(GetOutputSizePixel().Height() / nPageH),
- f = static_cast< float >(0.8 * ( fx < fy ? fx : fy ));
+ float fx = (float)GetOutputSizePixel().Width () / (float)nPageW,
+ fy = (float)GetOutputSizePixel().Height() / (float)nPageH,
+ f = 0.8f * ( fx < fy ? fx : fy );
Color aBack = rSettings.GetWindowColor( );
Color aFront = SwViewOption::GetFontColor();
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 162a6a5cea4f..c18e5587445f 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -724,7 +724,7 @@ SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet)
pExampleFrame(0)
{
FreeResource();
- aAutoTextLB.SetWindowBits( WB_HSCROLL );
+ aAutoTextLB.SetStyle( aAutoTextLB.GetStyle() | WB_HSCROLL );
aAutoTextLB.SetSpaceBetweenEntries(0);
aAutoTextLB.SetSelectionMode( SINGLE_SELECTION );
aAutoTextLB.SetHelpId(HID_BUSINESS_CARD_CONTENT);
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 141adf35ddf0..43ef58b11d7c 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -779,7 +779,7 @@ bool SwMailMergeDlg::ExecQryShell()
m_aSelection.realloc(nEnd - nStart + 1);
Any* pSelection = m_aSelection.getArray();
- for (sal_Int32 i = nStart; i != nEnd; ++i, ++pSelection)
+ for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection)
*pSelection <<= i;
}
else if (aAllRB.IsChecked() )
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 7d607b803536..a08e717f6948 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -115,7 +115,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
aAddDBPB.SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl));
aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION);
- aUsedDBTLB.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
aUsedDBTLB.SetSpaceBetweenEntries(0);
aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 07ab852e199e..1fd345c832d4 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -89,7 +89,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
aTypeTLB.SetHelpId(HID_FIELD_DINF_TYPE);
aTypeTLB.SetSelectionMode(SINGLE_SELECTION);
- aTypeTLB.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ aTypeTLB.SetStyle(aTypeTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
// Font nicht setzen, damit der Font des Controls uebernommen wird!
// Sonst bei falschem Font Bug an OV.
aTypeTLB.SetSpaceBetweenEntries(0);
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 1c7ff9e09564..4713e30775bc 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -124,7 +124,7 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
// --> OD 2007-11-21 #i83479#
aSelectionToolTipLB.SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) );
aSelectionToolTipLB.SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) );
- aSelectionToolTipLB.SetWindowBits( aSelectionToolTipLB.GetWindowBits() | WB_HSCROLL );
+ aSelectionToolTipLB.SetStyle( aSelectionToolTipLB.GetStyle() | WB_HSCROLL );
aSelectionToolTipLB.SetSpaceBetweenEntries(1);
aSelectionToolTipLB.SetHighlightRange();
// <--
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 8c7160433837..4a1294187876 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -163,6 +163,8 @@ class SwTOXSelectTabPage : public SfxTabPage
// PushButton aChapterDlgPB; //#outline level,removed by zhaojianwei
CheckBox aAddStylesCB;
PushButton aAddStylesPB;
+ Point aAddStylesPosDef;
+ Point aAddStylesPosUser;
//user
CheckBox aFromTablesCB;
CheckBox aFromFramesCB;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index a8a01a4f8222..852bc6b2a5e0 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -828,7 +828,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
rHB.Show();
SwIndexTreeLB& rTLB = aHeaderTree.GetTreeListBox();
- rTLB.SetWindowBits(WB_CLIPCHILDREN|WB_SORT);
+ rTLB.SetStyle(rTLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT);
//aStylesTLB.SetSelectHdl(LINK(this, SwAddStylesDlg_Impl, SelectHdl));
rTLB.GetModel()->SetSortMode(SortAscending);
for(i = 0; i < MAXLEVEL; ++i)
@@ -1523,6 +1523,18 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
//aAddStylesPB.SetPosPixel(aPos);
//}
//else if( nType & TO_ILLUSTRATION )//<-removed end.
+ // initialize button positions
+
+ //#i111993# add styles button has two different positions
+ if( !aAddStylesPosDef.X() )
+ {
+ aAddStylesPosDef = ( aAddStylesPB.GetPosPixel() );
+ // move left!
+ Point aPos(aAddStylesPosDef);
+ aPos.X() -= 2 * aAddStylesPB.GetSizePixel().Width();
+ aAddStylesPosUser = aPos;
+ }
+
if( nType & TO_ILLUSTRATION ) //add by zhaojianwei
aCaptionSequenceLB.SelectEntry( SwStyleNameMapper::GetUIName(
RES_POOLCOLL_LABEL_ABB, aEmptyStr ));
@@ -1532,11 +1544,11 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
else if( nType & TO_USER )
{
aAddStylesCB.SetText(sAddStyleUser);
- // move left!
- Point aPos(aAddStylesPB.GetPosPixel());
- // aPos.X() = aChapterDlgPB.GetPosPixel().X();
- aPos.X() -= 2 * aAddStylesPB.GetSizePixel().Width();
- aAddStylesPB.SetPosPixel(aPos);
+ aAddStylesPB.SetPosPixel(aAddStylesPosUser);
+ }
+ else if( nType & TO_CONTENT )
+ {
+ aAddStylesPB.SetPosPixel(aAddStylesPosDef);
}
aCollectSameCB.Show( 0 != (nType & TO_INDEX) );
@@ -2124,7 +2136,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
FreeResource();
sLevelStr = aLevelFT.GetText();
- aLevelLB.SetWindowBits( WB_HSCROLL );
+ aLevelLB.SetStyle( aLevelLB.GetStyle() | WB_HSCROLL );
aLevelLB.SetSpaceBetweenEntries(0);
aLevelLB.SetSelectionMode( SINGLE_SELECTION );
aLevelLB.SetHighlightRange(); // select full width
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 59a918fc4030..e462eb7530b6 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -107,7 +107,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
aGroupTLB.SetHelpId(HID_GLOS_GROUP_TREE);
aGroupTLB.SetTabs( &nTabs[0], MAP_APPFONT );
- aGroupTLB.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT);
+ aGroupTLB.SetStyle(aGroupTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT);
aGroupTLB.SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl));
aGroupTLB.GetModel()->SetSortMode(SortAscending);
aNewPB.SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl));
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index a2b6b85a7449..2d2c1989d65c 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -294,7 +294,7 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aInsertBtn.Enable(sal_False);
aNameED.GrabFocus();
aCategoryBox.SetHelpId(HID_MD_GLOS_CATEGORY);
- aCategoryBox.SetWindowBits(WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
+ aCategoryBox.SetStyle(aCategoryBox.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
aCategoryBox.GetModel()->SetSortMode(SortAscending);
aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren
aCategoryBox.SetNodeDefaultImages( );
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index b87060bd19b0..0101e92a0081 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -273,7 +273,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, BOOL bAutoFmt) :
pActLB->SelectEntryPos(0);
- pTable->SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ pTable->SetStyle(pTable->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
pTable->SetNodeDefaultImages();
pTable->SetSelectionMode(MULTIPLE_SELECTION);
pTable->SetHighlightRange(1);
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index e795c123d3a2..8115b4ec7438 100755
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -1010,7 +1010,6 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
case FN_REPLY:
case FN_POSTIT:
case FN_DELETE_COMMENT:
- case FN_DELETE_NOTE:
if ( pPostItMgr->HasActiveSidebarWin() )
pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
break;
@@ -1058,24 +1057,15 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
switch( nSlotId )
{
case FN_POSTIT:
- case FN_DELETE_NOTE:
case FN_DELETE_NOTE_AUTHOR:
case FN_DELETE_ALL_NOTES:
case FN_HIDE_NOTE:
case FN_HIDE_NOTE_AUTHOR:
case FN_HIDE_ALL_NOTES:
- {
- if ( !pPostItMgr ||
- !pPostItMgr->HasActiveAnnotationWin() )
- {
- rSet.DisableItem(nWhich);
- }
- break;
- }
case FN_DELETE_COMMENT:
{
if ( !pPostItMgr ||
- !pPostItMgr->HasActiveSidebarWin() /*HasActiveRedCommentWin()*/ )
+ !pPostItMgr->HasActiveAnnotationWin() )
{
rSet.DisableItem(nWhich);
}
@@ -1108,7 +1098,7 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
if (pPostItMgr->HasActiveSidebarWin())
{
if ( (pPostItMgr->GetActiveSidebarWin()->IsProtected()) &&
- ( (nSlotId==FN_DELETE_NOTE) || (nSlotId==FN_REPLY) ) )
+ ( (nSlotId==FN_DELETE_COMMENT) || (nSlotId==FN_REPLY) ) )
rSet.DisableItem( nWhich );
}
nWhich = aIter.NextWhich();
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 3f26e47c8823..5ac611fed854 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -313,7 +313,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
rReq.Ignore();
}
break;
- case FN_DELETE_NOTE:
+ case FN_DELETE_COMMENT:
if ( GetView().GetPostItMgr() &&
GetView().GetPostItMgr()->HasActiveSidebarWin() )
{
@@ -622,7 +622,7 @@ void SwTextShell::StateField( SfxItemSet &rSet )
{
switch (nWhich)
{
- case FN_DELETE_NOTE:
+ case FN_DELETE_COMMENT:
case FN_DELETE_NOTE_AUTHOR:
case FN_DELETE_ALL_NOTES:
case FN_HIDE_NOTE:
@@ -634,7 +634,7 @@ void SwTextShell::StateField( SfxItemSet &rSet )
rSet.InvalidateItem( nWhich );
else if ( !pPostItMgr->HasActiveSidebarWin() )
{
- rSet.InvalidateItem( FN_DELETE_NOTE );
+ rSet.InvalidateItem( FN_DELETE_COMMENT );
rSet.InvalidateItem( FN_HIDE_NOTE );
}
}
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index c9c80599541d..b0b95657600c 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -83,7 +83,6 @@
#include <globals.hrc>
#include <unomid.h>
#include <unotools/printwarningoptions.hxx>
-
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
@@ -948,7 +947,7 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
- RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
+ RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT,
0);
pSearch->FillSearchItemSet(aSearch);
BOOL bCancel;
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 0b0bca564f48..38ecb34051e5 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -952,6 +952,7 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) :
aUpdTimer.SetTimeout(1000);
Clear();
EnableContextMenuHandling();
+ SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
/***************************************************************************
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index ca2367744713..25633a7b691f 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -868,7 +868,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
((SfxDockingWindow*)pParent)->SetOutputSizePixel(aMinSize);
aContentTree.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
- aContentTree.SetWindowBits( WB_HASBUTTONS|WB_HASBUTTONSATROOT|
+ aContentTree.SetStyle( aContentTree.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
aContentTree.SetSpaceBetweenEntries(3);
aContentTree.SetSelectionMode( SINGLE_SELECTION );
@@ -882,7 +882,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
// TreeListBox fuer Globaldokument
aGlobalTree.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
aGlobalTree.SetSelectionMode( MULTIPLE_SELECTION );
- aGlobalTree.SetWindowBits( WB_HASBUTTONS|WB_HASBUTTONSATROOT|
+ aGlobalTree.SetStyle( aGlobalTree.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
WB_CLIPCHILDREN|WB_HSCROLL );
Size aGlblSize(aGlobalToolBox.CalcWindowSizePixel());
aGlobalToolBox.SetSizePixel(aGlblSize);
diff --git a/sw/util/msword.map b/sw/util/msword.map
index 16b9d25b0b78..d2a9d9b4f7e1 100755..100644
--- a/sw/util/msword.map
+++ b/sw/util/msword.map
@@ -6,6 +6,9 @@ UDK_3_0_0 {
ExportDOC;
SaveOrDelMSVBAStorage_ww8;
GetSaveWarningOfMSVBAStorage_ww8;
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
local:
*;
};
diff --git a/testautomation/dbaccess/optional/includes/ctrl_General.inc b/testautomation/dbaccess/optional/includes/ctrl_General.inc
index 9e137f4c7a70..b0ee0bea81dc 100644
--- a/testautomation/dbaccess/optional/includes/ctrl_General.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_General.inc
@@ -38,13 +38,14 @@ sub ctrl_General
call tPosAndSize_Protect_Position
call tPosAndSize_Protect_Size
call tPosAndSize_Keyboard
- call tPosAndSize_Dialog
+ call tPosAndSize_Dialog
call tPosAndSize_KeepRatio
'TODO Control the Setting on tabpage Rotation & Slant (should be inactive).
call tTabStop
call tActivationOrder
call tAddFields
+ call tLabelFieldSelection
end sub
@@ -1033,7 +1034,96 @@ testcase tAddFields
call hCloseDocument
endcase
+'-------------------------------------------------------------------------
+testcase tLabelFieldSelection
+ ' check if the assignment of lables to text fields work
+ dim sLabelText as String
+
+ printlog "Open a new document,"
+ call hNewDocument
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "tt_doc" , true
+ sleep(1)
+
+ printlog "open the form control toolbar"
+ call hToolbarSelect("FormControls",true)
+
+ Kontext "FormControls"
+ Label.Click
+ sleep(1)
+
+ printlog "insert a label field"
+ call hDrawingWithSelection ( 20, 20, 30, 30 )
+ sleep(2)
+
+ Kontext "FormControls"
+ Edit.Click
+ sleep(1)
+
+ printlog "insert a text field"
+ call hDrawingWithSelection ( 40, 40, 50, 50 )
+ sleep(2)
+
+ printlog "open the control property browser"
+ call fOpenControlPropertyBrowser
+
+ Kontext "ControlPropertiesTabControl"
+ ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
+ sleep(2)
+
+ printlog "click on button behind the lable field to open the field selection dialog"
+ Kontext "TabGeneralControl"
+ LabelFieldButton.Click
+ sleep(1)
+
+ printlog "select the lable fiiel in the tree list box"
+ Kontext "LabelFieldSelection"
+ LabelFieldSelection.TypeKeys "<DOWN>",TRUE
+ LabelFieldSelection.TypeKeys "<DOWN>",TRUE
+ sleep(1)
+ printlog "close the field selection dialog"
+ LabelFieldSelection.OK
+ sleep(1)
+ printlog "check if the lable field property contains some text"
+ 'TODO: check for the correct text this has a language dependencie
+ Kontext "TabGeneralControl"
+ sLabelText = LabelField.getText()
+ if(sLabelText = "") then
+ warnlog "the lable for a text field is not set"
+ else
+ printlog "the label for the text field is set"
+ endif
+
+ printlog "click on button behind the lable field to open the field selection dialog"
+ Kontext "TabGeneralControl"
+ LabelFieldButton.Click
+ sleep(1)
+
+ Kontext "LabelFieldSelection"
+ LabelFieldSelection.TypeKeys "<DOWN>",TRUE
+ LabelFieldSelection.TypeKeys "<DOWN>",TRUE
+ sleep(1)
+ printlog "select the lable field and check the checkbox 'no assignment'"
+ CBNoAssignment.check
+ printlog "close the field selection dialog"
+ LabelFieldSelection.OK
+ sleep(1)
+
+ printlog "check if the lable field property contains no text"
+ Kontext "TabGeneralControl"
+ sLabelText = LabelField.getText()
+ if(sLabelText <> "") then
+ warnlog "the lable for a text field is not deleted"
+ else
+ printlog "the label for the text field is deleted"
+ endif
+
+ printlog "close the document"
+ call hCloseDocument
+
+endcase
+'-------------------------------------------------------------------------
function fOpenPositionAndSizeDialog
call hToolbarSelect("FormDesignTools",true)
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Several2.inc b/testautomation/dbaccess/optional/includes/ctrl_Several2.inc
index 82fa9229b1f8..717cf149b902 100644
--- a/testautomation/dbaccess/optional/includes/ctrl_Several2.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Several2.inc
@@ -293,7 +293,7 @@ testcase tImageControl
sleep(2)
'/// set HelpURL
printlog "set HelpURL"
- fsetControlProperty("ImageControl","HelpURL","HID:1234567")
+ fsetControlProperty("ImageControl","HelpURL","customcontrol2")
'/// save the document
printlog "save the document"
hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ImageControl.odt"))
@@ -315,7 +315,7 @@ testcase tImageControl
Kontext "TabGeneralControl"
dim bScrOK as boolean 'control variable if all properties are correct
bScrOK = true
- if fgetControlProperty("ImageControl","HelpURL") <> "HID:1234567" then
+ if fgetControlProperty("ImageControl","HelpURL") <> "customcontrol2" then
warnlog "the imagecontrol is not saved with property: HelpURL"
bScrOK = false
endif
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc
index 49bcaceb6ac7..2f51183a40a1 100644
--- a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc
@@ -239,7 +239,7 @@ testcase tGroupBoxWithDatasource
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is.
sleep(1)
- HelpURL.setText "HID:123456"
+ HelpURL.setText "customcontrol1"
HelpURL.TypeKeys "<RETURN>",true
sleep(1)
Kontext "ControlPropertiesDialog"
@@ -276,7 +276,7 @@ testcase tGroupBoxWithDatasource
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is.
sleep(1)
- HelpURL.setText "HID:1234567"
+ HelpURL.setText "customcontrol2"
HelpURL.TypeKeys "<RETURN>", true
sleep(1)
Kontext "ControlPropertiesDialog"
@@ -314,7 +314,7 @@ testcase tGroupBoxWithDatasource
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
- HelpURL.setText "HID:12345678"
+ HelpURL.setText "customcontrol3"
HelpURL.TypeKeys "<RETURN>", true
sleep(1)
Kontext "ControlPropertiesDialog"
@@ -660,7 +660,7 @@ testcase tListBox
warnlog "The dropdown style is not active."
endif
sleep(1)
- fSetControlProperty("ListBox","HelpURL","HID:123456")
+ fSetControlProperty("ListBox","HelpURL","customcontrol1")
sleep(1)
'/// save the document
printlog "save the document"
diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc
index 2658281f65be..cc99d8d203c5 100644
--- a/testautomation/dbaccess/tools/dbcreatetools.inc
+++ b/testautomation/dbaccess/tools/dbcreatetools.inc
@@ -1375,8 +1375,17 @@ function fRegisterDatabaseFile( sFileName, sName)
NewBtn.Click
sleep(1)
Kontext "CreateDatabaseLink"
- DatabaseFile.setText(sFileName)
+
RegisteredName.setText(sName)
+
+ ' this does not work due to issue 115468
+ ' DatabaseFile.setText(sFileName)
+ ' workaround
+ CreatedatabaseLink.typeKeys("<shift tab>")
+ CreatedatabaseLink.typeKeys("<shift tab>")
+ CreatedatabaseLink.typeKeys(sFileName)
+ ' -
+
CreateDatabaseLink.OK
sleep(1)
diff --git a/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/src/toolpanels/TaskPaneComponentUI.xdl b/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/src/toolpanels/TaskPaneComponentUI.xdl
index 7820e3d52c59..75e1ceb1e019 100755
--- a/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/src/toolpanels/TaskPaneComponentUI.xdl
+++ b/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/src/toolpanels/TaskPaneComponentUI.xdl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="192" dlg:top="127" dlg:width="174" dlg:height="147" dlg:closeable="true" dlg:moveable="true" dlg:help-url="HID:123456" dlg:withtitlebar="false">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="192" dlg:top="127" dlg:width="174" dlg:height="147" dlg:closeable="true" dlg:moveable="true" dlg:help-url="customcontrol1" dlg:withtitlebar="false">
<dlg:bulletinboard>
<dlg:button dlg:id="CommandButton1" dlg:tab-index="0" dlg:left="6" dlg:top="8" dlg:width="64" dlg:height="20" dlg:value="a wonderful button"/>
<dlg:textfield dlg:id="TextField1" dlg:textarea-vertical-align="top" dlg:tab-index="1" dlg:left="6" dlg:top="38" dlg:width="64" dlg:height="59" dlg:value="a wonderful text"/>
diff --git a/testautomation/global/hid/hid.lst b/testautomation/global/hid/hid.lst
index 3257e92a9066..a07f54c87773 100755
--- a/testautomation/global/hid/hid.lst
+++ b/testautomation/global/hid/hid.lst
@@ -1,5 +1,3 @@
-DEV300.m85 010101010101010
-
1 1
SID_OPENDOC 5501
SID_SAVEASDOC 5502
diff --git a/testautomation/global/required/includes/g_printing.inc b/testautomation/global/required/includes/g_printing.inc
index 15ee12c4308d..2d0bd716e551 100644
--- a/testautomation/global/required/includes/g_printing.inc
+++ b/testautomation/global/required/includes/g_printing.inc
@@ -408,7 +408,7 @@ testcase tPrintLayout()
endif
endif
- lb_test( PrintOrder, 2, 1, "" )
+ lb_test( PrintOrder, 4, 1, "" )
cb_test( BorderAroundPages, false, "" )
select case( gApplication )
diff --git a/testautomation/global/system/includes/master.inc b/testautomation/global/system/includes/master.inc
index 3825dadff409..40a1f504ed64 100644
--- a/testautomation/global/system/includes/master.inc
+++ b/testautomation/global/system/includes/master.inc
@@ -84,6 +84,10 @@ sub GetUseFiles
Call GetIniInformation '///+<li><b>GetIniInformation</b>: Get all information out of the <i>testtool.ini/.testtoolrc</i> and set it on global variables (iniinfo.inc)</li>
Call GetOfficeInformation '///+<li><b>GetOfficeInformation</b>: Set <i>sAppExe</i> for startup (iniinfo.inc)</li>
+ gVersionsnummer = FindBuildID
+ ' split versionstring into its parts
+ call hSetBuildVersionInformation(False)
+
Call LoadDeclaration '///+<ul><li><b>LoadDeclaration</b>: Load all declaration files (master.inc)</li>
Call FirstOfficeStart '///+<li><b>FirstOfficeStart</b>: Try to start the office for first time (master.inc)</li>
diff --git a/testautomation/global/tools/includes/optional/t_control_objects.inc b/testautomation/global/tools/includes/optional/t_control_objects.inc
index b1da7d7e8d95..4ee8b908c93f 100644
--- a/testautomation/global/tools/includes/optional/t_control_objects.inc
+++ b/testautomation/global/tools/includes/optional/t_control_objects.inc
@@ -115,7 +115,7 @@ function lb_test( oControl as object, items as integer, preset as integer, issue
endif
endif
- for con_iterator = 1 to items
+ for con_iterator = 1 to con_items
oControl.select( con_iterator )
next con_iterator
diff --git a/testautomation/global/win/dial_d_h.win b/testautomation/global/win/dial_d_h.win
index 6a80e4209cbc..ba6673edb39d 100644
--- a/testautomation/global/win/dial_d_h.win
+++ b/testautomation/global/win/dial_d_h.win
@@ -401,7 +401,7 @@ Schattenfarbe sym:svx:ListBox:RID_SVXDLG_FONTWORK:CLB_SHADOW_COLOR
FormName sym:sw:Edit:DLG_NUM_NAMES:ED_FORM
FormListe sym:sw:ListBox:DLG_NUM_NAMES:LB_FORM
-*FormularNavigator .uno:ShowFmExplorer
+*FormularNavigator sym:SFXDOCKINGWINDOW_ShowFmExplorer
Liste sym:SVX_HID_FORM_NAVIGATOR
*FussnoteBearbeiten .uno:EditFootnote
diff --git a/testautomation/global/win/edia_i_o.win b/testautomation/global/win/edia_i_o.win
index ca8fb3659c1d..39d90d8d1c97 100644
--- a/testautomation/global/win/edia_i_o.win
+++ b/testautomation/global/win/edia_i_o.win
@@ -154,6 +154,7 @@ RightFieldCell sym:DBACCESS_HID_RELATIONDIALOG_RIGHTFIELDCELL
*LabelFieldSelection sym:extensions:ModalDialog:RID_DLG_SELECTLABELCONTROL
+CBNoAssignment sym:extensions:CheckBox:RID_DLG_SELECTLABELCONTROL:1
*JPGOptions sym:svtools:ModalDialog:DLG_EXPORT
Exportwidth sym:svtools:MetricField:DLG_EXPORT:MF_SIZEX
diff --git a/testautomation/global/win/sys_dial.win b/testautomation/global/win/sys_dial.win
index b63417e56b9f..15e8035d8b74 100644
--- a/testautomation/global/win/sys_dial.win
+++ b/testautomation/global/win/sys_dial.win
@@ -126,3 +126,8 @@ OrdnerName sym:fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_N
' ****
*TranslationWindow sym:svtools:WorkWindow:TT_INLINE_TRANSLATION svtools:FloatingWindow:TT_INLINE_TRANSLATION
+' **** specal longnames for bas test
+' **** author marc.neumann@oracle.com
+*MSC_Special_Dialog sym:customcontrol1
+*MSC_Special_Dialog2 sym:customcontrol2
+*MSC_Special_Dialog3 sym:customcontrol3 \ No newline at end of file
diff --git a/testautomation/graphics/required/includes/impress/im_003_.inc b/testautomation/graphics/required/includes/impress/im_003_.inc
index 744c24fb9a86..2674433034b9 100644
--- a/testautomation/graphics/required/includes/impress/im_003_.inc
+++ b/testautomation/graphics/required/includes/impress/im_003_.inc
@@ -201,14 +201,14 @@ testcase tiViewToolbar_1
printlog "open application "
Call hNewDocument
+
+ printlog "use the empty layout"
Call sSelectEmptyLayout
+
printlog "delete default content"
hUseAsyncSlot( "EditSelectAll" )
Kontext "DocumentImpress"
DocumentImpress.typeKeys("<DELETE>",true)
-
- printlog "use the empty layout"
- call sSelectEmptyLayout
printlog "Insert->Graphic... : global\input\graf_inp\desp.bmp "
hUseAsyncSlot( "InsertGraphicsFromFile" )
diff --git a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc
index d53c23fbbe3d..a12fbb764115 100644
--- a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc
+++ b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc
@@ -57,31 +57,6 @@ end sub
'
'-------------------------------------------------------------------------------
'
-function IsItLoaded as boolean
- '/// IsItLoaded
- '/// Wait until document is loaded
- Dim iLoop as integer
-
- IsItLoaded = FALSE
- sleep(3)
- for iLoop =1 to 20
- try
- 'Calling slot 'IsDocLoading'
- IsItLoaded = IsDocLoading
- catch
- IsItLoaded = FALSE
- endcatch
-
- if IsItLoaded = TRUE then
- exit for
- end if
- sleep(1)
- next iLoop
- sleep(2)
-end function
-'
-'-------------------------------------------------------------------------------
-'
testcase tLoadSpreadsheetDocument (SourceFile)
Dim sOnlyFileName as string
@@ -102,7 +77,7 @@ testcase tLoadSpreadsheetDocument (SourceFile)
if sOnlyFileName > "" then
'Some extensions make no sense to load
if sOnlyFileExtension <> "so" AND sOnlyFileExtension <> "tmp" AND sOnlyFileExtension <> "dbt" then
- if fCalcFileOpen(SourceFile) AND IsItLoaded()then
+ if fCalcFileOpen(SourceFile) then
if (hIsNamedDocLoaded (SourceFile)) then
printlog "- loaded"
sleep(15)
diff --git a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
index 9e25d898d8ce..f55bd6318ffd 100644
--- a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
+++ b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
@@ -125,10 +125,10 @@ testcase tIBIS111158
Kontext "TabGeneralControl"
'/// Enter in 'Help URL' as value exactly 'HID:123456'
TabGeneralControl.TypeKeys "<TAB>" , true
- HelpURL.setText "HID:123456"
+ HelpURL.setText "customcontrol1"
HelpURL.TypeKeys "<RETURN>",true
- if HelpURL.GetText <> "HID:123456" then
- warnlog "'HID:123456' has not been accepted as 'Help URL' value."
+ if HelpURL.GetText <> "customcontrol1" then
+ warnlog "'customcontrol1' has not been accepted as 'Help URL' value."
end if
Kontext "ControlPropertiesDialog"
diff --git a/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc b/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
index 75db278c25ef..729659dfc54d 100644
--- a/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
+++ b/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
@@ -194,7 +194,14 @@ testcase tPickGraphic
Call wOpenContextMenu(true)
printlog " Select 'ImageMap' in context menu"
- Call hMenuSelectNr(9)
+ try
+ CALL hMenuFindSelect (".uno:ImageMapDialog", true, 11, true) 'Find "ImageMap" and call the slot.
+ wait 500
+ catch
+ Warnlog "Unable to open context menu"
+ Call hCloseDocument
+ goto endsub
+ endcatch
Printlog " The graphic has to be selected and the context menu has to show graphics related commands"
Kontext "ImageMapEditor"
if Not ImageMapEditor.Exists(3) then
@@ -240,13 +247,13 @@ testcase tPickHyperlink
printlog " Empty clipboard"
SetClipBoard = ""
printlog " Insert a hyperlink in document"
- Call wTypeKeys "www.sun.com"
+ Call wTypeKeys "www.oracle.com"
Call wTypeKeys " "
Call wTypeKeys "<HOME>"
printlog " Open context menu on hyperlink"
Call wTypeKeys "<SHIFT F10>"
printlog " Last entry in menu has to be 'Open hyperlink' ...."
- CALL hMenuFindSelect (10955, true, 17, true) 'Find "Hyperlink-dialog" and call the slot.
+ CALL hMenuFindSelect (10955, false, 17, true) 'Find "Hyperlink-dialog" and call the slot.
kontext "TabHyperlinkInternet"
if TabHyperlinkInternet.Exists(3) then
Warnlog "Hyperlink-Dialog opened!"
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
index 25a762297df7..08ebbfed45d4 100644
--- a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
@@ -283,7 +283,7 @@ testcase tGroup_6
Sleep 2
Call gMouseClick(80,80)
- Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Call wObjektSelektieren ( 31, 31, 70, 80 )
Sleep 2
FormatGroupGroup
Sleep 1
@@ -351,7 +351,7 @@ testcase tGroup_7
Sleep 2
Call gMouseClick(80,80)
- Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Call wObjektSelektieren ( 31, 31, 70, 80 )
Sleep 2
FormatGroupGroup
Sleep 1
@@ -667,7 +667,7 @@ testcase tEncapsulatedGroup_1
Sleep 1
Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
Sleep 1
- Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Call wObjektSelektieren ( 31, 31, 70, 80 )
Sleep 1
FormatGroupGroup
@@ -677,20 +677,37 @@ testcase tEncapsulatedGroup_1
PrintLog "- insert 2 drawing objects (rectangle and ellipse) in the group"
Call wZeichenobjektEinfuegen("RECHTECK", 35, 40, 38, 45, false)
- Call wZeichenobjektEinfuegen("ELLIPSE", 52, 40, 78, 45, false)
- Call wObjektSelektieren ( 28, 38, 80, 48 )
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 40, 58, 45, false, true)
+ Call wObjektSelektieren ( 31, 31, 80, 80 )
+
+ Sleep 1
+ PrintLog "- generate a new group"
try
- PrintLog "- generate a new group"
FormatGroupGroup
- PrintLog "- edit the new group"
+ catch
+ Warnlog "Unable to execute Format / Group"
+ endcatch
+
+ PrintLog "- edit the new group"
+ try
FormatGroupEditGroup
- PrintLog "- leave the new group"
+ catch
+ Warnlog "Unable to execute Group / Enter Group"
+ endcatch
+
+ PrintLog "- leave the new group"
+ try
FormatGroupExitGroup
- PrintLog "- Undo the new group"
+ catch
+ Warnlog "Unable to exceute Format / Exit Group"
+ endcatch
+
+ PrintLog "- Undo the new group"
+ try
FormatGroupUnGroup
catch
- Warnlog "Something wrong where operating the Encapsulated group!"
+ Warnlog "Unable to execute Format / Ungroup"
endcatch
Call hCloseDocument
diff --git a/testautomation/writer/optional/includes/fields/w_fields1.inc b/testautomation/writer/optional/includes/fields/w_fields1.inc
index 2f727260b6c2..c6caf2c5fade 100644
--- a/testautomation/writer/optional/includes/fields/w_fields1.inc
+++ b/testautomation/writer/optional/includes/fields/w_fields1.inc
@@ -151,13 +151,23 @@ testcase tInsertFieldsTime
if NOT Len(sTime2) > 7 then Warnlog "Time-format is wrong !"
printlog "Stop for a while ..."
+
'/// Stop for a while , check if the time is still correct
Sleep 2
+ ' update fields
+ Call wTypeKeys "<F9>"
+ ' read field content
Call wTypeKeys "<MOD1 Home>"
Call wTypeKeys "<Shift Right>"
EditCopy
if GetClipboard <> sTime1 then Warnlog "Fixed time is wrong !"
-
+
+ '/// Stop for a while , check if the time is still correct
+ Sleep 2
+ ' update fields
+ Call wTypeKeys "<F9>"
+ ' read field content
+ Call wTypeKeys "<MOD1 Home>"
Call wTypeKeys "<Down><Home>"
Call wTypeKeys "<Shift Right>"
EditCopy
diff --git a/testautomation/writer/required/includes/w_001b_.inc b/testautomation/writer/required/includes/w_001b_.inc
index 297d04b579bb..4d8e6883891a 100644
--- a/testautomation/writer/required/includes/w_001b_.inc
+++ b/testautomation/writer/required/includes/w_001b_.inc
@@ -198,6 +198,7 @@ testcase tFileSendOutlineToClipboard
PrintLog "Paste outline in new document"
hUseAsyncSlot( "EditPaste" )
+ WaitSlot(1000)
Call wTypeKeys("<Up>", 6)
Call wTypeKeys("<Home><Shift End>")
hUseAsyncSlot( "EditCopy" )
diff --git a/testautomation/writer/tools/includes/w_tools.inc b/testautomation/writer/tools/includes/w_tools.inc
index e6bd4f92afa0..cfe0aa6e07f3 100755
--- a/testautomation/writer/tools/includes/w_tools.inc
+++ b/testautomation/writer/tools/includes/w_tools.inc
@@ -141,11 +141,14 @@ end function
' -----------------------------------------------------------------------
-sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optional sCloseToolbar as boolean )
+sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optional sCloseToolbar as boolean, optional bLeaveSelected as boolean )
Kontext "DrawBar"
if Not DrawBar.Exists then Call hToolbarSelect("Drawing", true)
Sleep 2
+ if IsMissing(bLeaveSelected) then
+ bLeaveSelected = false
+ endif
Objekt = UCase( Objekt )
select case Objekt
@@ -187,8 +190,10 @@ sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optiona
end if
if Objekt <> "TEXT" and Objekt <> "VTEXT" then
Kontext "DocumentWriter"
- Call gMouseClick (10, 10)
- wait 100
+ if bLeaveSelected = false then
+ Call gMouseClick (10, 10)
+ wait 100
+ endif
end if
Case "MASTERDOCUMENT"
@@ -205,8 +210,10 @@ sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optiona
end if
if Objekt <> "TEXT" and Objekt <> "VTEXT" then
Kontext "DocumentMasterDoc"
- Call gMouseClick (10, 10)
- wait 100
+ if bLeaveSelected = false then
+ Call gMouseClick (10, 10)
+ wait 100
+ endif
end if
end select
sleep (1)
@@ -215,18 +222,21 @@ end sub
' -----------------------------------------------------------------------
sub wObjektSelektieren ( xStart%, yStart%, xEnde%, yEnde% )
- ' Call gMouseClick(90,90)
Call hToolbarSelect("DRAWING",true)
- Auswahl.Click
+ if Auswahl.Getstate(2) = 0 then
+ Auswahl.Click
+ endif
Select Case gApplication
Case "WRITER"
Kontext "DocumentWriter"
DocumentWriter.MouseDown xStart%, yStart%
+ wait 500
DocumentWriter.MouseMove xEnde%, yEnde%
DocumentWriter.MouseUp xEnde%, yEnde%
Case "MASTERDOCUMENT"
Kontext "DocumentMasterDoc"
DocumentMasterDoc.MouseDown xStart%, yStart%
+ wait 500
DocumentMasterDoc.MouseMove xEnde%, yEnde%
DocumentMasterDoc.MouseUp xEnde%, yEnde%
end select
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index d0961188d06c..d3838a7421a4 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -592,7 +592,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingGraphic = true;
::rtl::OUString sImageURL;
OSL_VERIFY( rValue >>= sImageURL );
- setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_GRAPHIC, uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
mbAdjustingGraphic = false;
}
break;
@@ -601,7 +601,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) )
{
mbAdjustingGraphic = true;
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEURL, uno::makeAny( ::rtl::OUString() ) );
mbAdjustingGraphic = false;
}
break;
@@ -612,7 +612,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEPOSITION ), uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEPOSITION, uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -622,7 +622,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEALIGN ), uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEALIGN, uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -888,7 +888,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Int16 nScaleMode( awt::ImageScaleMode::Anisotropic );
OSL_VERIFY( _rValue >>= nScaleMode );
- setPropertyValue( GetPropertyName( BASEPROPERTY_SCALEIMAGE ), uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_SCALEIMAGE, uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -898,7 +898,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Bool bScale = sal_True;
OSL_VERIFY( _rValue >>= bScale );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGE_SCALE_MODE, uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -1917,7 +1917,7 @@ void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int3
uno::Sequence<sal_Int16> aSeq;
uno::Any aAny;
aAny <<= aSeq;
- setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny );
+ setDependentFastPropertyValue( BASEPROPERTY_SELECTEDITEMS, aAny );
if ( !m_pData->m_bSettingLegacyProperty )
{
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 7d6296b76e8c..9c7052e22d77 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -274,9 +274,16 @@ typedef sal_Int64 WinBits;
#define WB_STDTABCONTROL 0
// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
+#define WB_HASBUTTONS ((WinBits)SAL_CONST_INT64(0x000100000000))
+#define WB_HASLINES ((WinBits)SAL_CONST_INT64(0x000200000000))
+#define WB_HASLINESATROOT ((WinBits)SAL_CONST_INT64(0x000400000000))
+#define WB_HASBUTTONSATROOT ((WinBits)SAL_CONST_INT64(0x000800000000))
+#define WB_NOINITIALSELECTION ((WinBits)SAL_CONST_INT64(0x001000000000))
+#define WB_HIDESELECTION ((WinBits)SAL_CONST_INT64(0x002000000000))
+#define WB_FORCE_MAKEVISIBLE ((WinBits)SAL_CONST_INT64(0x004000000000))
+// DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW
+#define WB_QUICK_SEARCH ((WinBits)SAL_CONST_INT64(0x010000000000))
+
// For FileOpen Dialog
#define WB_PATH ((WinBits)0x00100000)
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 2ae6f0c97f0c..3cf43a1f3bc9 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -46,12 +46,14 @@
#include <unotools/ucbhelper.hxx>
#include <vos/process.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
#include <rtl/instance.hxx>
#include <itemholder1.hxx>
@@ -998,6 +1000,17 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) )
aObj.SetURL( aURL );
}
+ if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND )
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XMacroExpander > xMacroExpander( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY );
+ OSL_ENSURE( xMacroExpander.is(), "SvtPathOptions::SearchFile: unable to access the MacroExpander singleton!" );
+ if ( xMacroExpander.is() )
+ {
+ const ::rtl::OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+ aObj.SetURL( sExpandedPath );
+ }
+ }
xub_StrLen i, nCount = aIniFile.GetTokenCount( '/' );
for ( i = 0; i < nCount; ++i )
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index ac278f76f65b..6580538f5d10 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -36,6 +36,7 @@
#include <vcl/lstbox.h>
#include <vcl/timer.hxx>
+#include "vcl/quickselectionengine.hxx"
class ScrollBar;
class ScrollBarBox;
@@ -193,13 +194,11 @@ public:
// - ImplListBoxWindow -
// ---------------------
-class ImplListBoxWindow : public Control
+class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
{
private:
ImplEntryList* mpEntryList; // EntryListe
Rectangle maFocusRect;
- String maSearchStr;
- Timer maSearchTimeout;
Size maUserItemSize;
@@ -254,9 +253,10 @@ private:
Link maUserDrawHdl;
Link maMRUChangedHdl;
-protected:
- DECL_LINK( SearchStringTimeout, Timer* );
+ ::vcl::QuickSelectionEngine
+ maQuickSelectionEngine;
+protected:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -379,6 +379,12 @@ public:
// pb: #106948# explicit mirroring for calc
inline void EnableMirroring() { mbMirroring = TRUE; }
inline BOOL IsMirroring() const { return mbMirroring; }
+
+protected:
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
};
// ---------------
diff --git a/vcl/inc/vcl/mnemonicengine.hxx b/vcl/inc/vcl/mnemonicengine.hxx
index d12b3db2417e..fcd303510203 100644
--- a/vcl/inc/vcl/mnemonicengine.hxx
+++ b/vcl/inc/vcl/mnemonicengine.hxx
@@ -59,7 +59,7 @@ namespace vcl
If this value is <NULL/>, searching stops.
*/
- virtual const void* FirstSearchEntry( String& _rEntryText ) = 0;
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
/** returns the next list entry for the mnemonic search
@@ -74,7 +74,7 @@ namespace vcl
to <member>FirstSearchEntry</member> (i.e. you cycled
around), then searching stops, too.
*/
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) = 0;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const = 0;
/** "selects" a given entry.
@@ -117,7 +117,7 @@ namespace vcl
the entry to select. This is the return value of a previous call
to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
*/
- virtual void ExecuteSearchEntry( const void* _pEntry ) = 0;
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const = 0;
};
//====================================================================
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
new file mode 100644
index 000000000000..f70736428010
--- /dev/null
+++ b/vcl/inc/vcl/quickselectionengine.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef VCL_QUICKSELECTIONENGINE_HXX
+#define VCL_QUICKSELECTIONENGINE_HXX
+
+#include "dllapi.h"
+
+#include <tools/string.hxx>
+
+#include <memory>
+
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef const void* StringEntryIdentifier;
+
+ //====================================================================
+ //= ISearchableStringList
+ //====================================================================
+ // TODO: consolidate this with ::vcl::IMnemonicEntryList
+ class SAL_NO_VTABLE VCL_DLLPUBLIC ISearchableStringList
+ {
+ public:
+ /** returns the current entry in the list of searchable strings.
+
+ Search operations will start with this entry.
+ */
+ virtual StringEntryIdentifier CurrentEntry( String& _out_entryText ) const = 0;
+
+ /** returns the next entry in the list.
+
+ The implementation is expected to wrap around. That is, if the given entry denotes the last
+ entry in the list, then NextEntry should return the first entry.
+ */
+ virtual StringEntryIdentifier NextEntry( StringEntryIdentifier _currentEntry, String& _out_entryText ) const = 0;
+
+ /** selects a given entry
+ */
+ virtual void SelectEntry( StringEntryIdentifier _entry ) = 0;
+ };
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ struct QuickSelectionEngine_Data;
+ class VCL_DLLPUBLIC QuickSelectionEngine
+ {
+ public:
+ QuickSelectionEngine( ISearchableStringList& _entryList );
+ ~QuickSelectionEngine();
+
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ void Reset();
+
+ private:
+ ::std::auto_ptr< QuickSelectionEngine_Data > m_pData;
+
+ private:
+ QuickSelectionEngine(); // never implemented
+ QuickSelectionEngine( const QuickSelectionEngine& ); // never implemented
+ QuickSelectionEngine& operator=( const QuickSelectionEngine& ); // never implemented
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_QUICKSELECTIONENGINE_HXX
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 7c72f40d2767..d209becfb4ae 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -598,6 +598,7 @@ public:
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void PrePaint();
virtual void Paint( const Rectangle& rRect );
+ virtual void PostPaint();
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Move();
virtual void Resize();
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index e28dc755e8a8..9e6d39d925c0 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -78,6 +78,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\metric.hxx %_DEST%\inc%_EXT%\vcl\metric.hxx
..\inc\vcl\mnemonic.hxx %_DEST%\inc%_EXT%\vcl\mnemonic.hxx
..\inc\vcl\mnemonicengine.hxx %_DEST%\inc%_EXT%\vcl\mnemonicengine.hxx
+..\inc\vcl\quickselectionengine.hxx %_DEST%\inc%_EXT%\vcl\quickselectionengine.hxx
..\inc\vcl\morebtn.hxx %_DEST%\inc%_EXT%\vcl\morebtn.hxx
..\inc\vcl\msgbox.hxx %_DEST%\inc%_EXT%\vcl\msgbox.hxx
..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index b4b7e3f80357..bd0179ffe454 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -529,7 +529,8 @@ USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true
// =======================================================================
ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, 0 )
+ Control( pParent, 0 ),
+ maQuickSelectionEngine( *this )
{
mpEntryList = new ImplEntryList( this );
@@ -568,9 +569,6 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
SetTextFillColor();
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- maSearchTimeout.SetTimeout( 2500 );
- maSearchTimeout.SetTimeoutHdl( LINK( this, ImplListBoxWindow, SearchStringTimeout ) );
-
ImplInitSettings( TRUE, TRUE, TRUE );
ImplCalcMetrics();
}
@@ -579,7 +577,6 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
ImplListBoxWindow::~ImplListBoxWindow()
{
- maSearchTimeout.Stop();
delete mpEntryList;
}
@@ -624,14 +621,6 @@ void ImplListBoxWindow::ImplCalcMetrics()
// -----------------------------------------------------------------------
-IMPL_LINK( ImplListBoxWindow, SearchStringTimeout, Timer*, EMPTYARG )
-{
- maSearchStr.Erase();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
void ImplListBoxWindow::Clear()
{
mpEntryList->Clear();
@@ -648,6 +637,7 @@ void ImplListBoxWindow::Clear()
ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
+ maQuickSelectionEngine.Reset();
Invalidate();
}
@@ -918,7 +908,7 @@ USHORT ImplListBoxWindow::GetLastVisibleEntry() const
void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
mbMouseMoveSelect = FALSE; // Nur bis zum ersten MouseButtonDown
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
if ( !IsReadOnly() )
{
@@ -1465,7 +1455,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1492,7 +1482,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1523,7 +1513,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1557,7 +1547,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1578,7 +1568,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1604,7 +1594,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1615,7 +1605,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ScrollHorz( -HORZ_SCROLL );
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1626,7 +1616,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ScrollHorz( HORZ_SCROLL );
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1638,7 +1628,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ImplCallSelect();
bDone = FALSE; // RETURN nicht abfangen.
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1653,7 +1643,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1673,7 +1663,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
SetUpdateMode( bUpdates );
Invalidate();
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
bDone = TRUE;
break;
@@ -1682,43 +1672,12 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
// fall through intentional
default:
{
- xub_Unicode c = rKEvt.GetCharCode();
-
- if ( !IsReadOnly() && (c >= 32) && (c != 127) && !rKEvt.GetKeyCode().IsMod2() )
+ if ( !IsReadOnly() )
{
- maSearchStr += c;
- XubString aTmpSearch( maSearchStr );
-
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos );
- if ( (nSelect == LISTBOX_ENTRY_NOTFOUND) && (aTmpSearch.Len() > 1) )
- {
- // Wenn alles die gleichen Buchstaben, dann anderer Such-Modus
- BOOL bAllEqual = TRUE;
- for ( USHORT n = aTmpSearch.Len(); n && bAllEqual; )
- bAllEqual = aTmpSearch.GetChar( --n ) == c;
- if ( bAllEqual )
- {
- aTmpSearch = c;
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos+1 );
- }
- }
- if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, 0 );
-
- if ( nSelect != LISTBOX_ENTRY_NOTFOUND )
- {
- ShowProminentEntry( nSelect );
-
- if ( mpEntryList->IsEntryPosSelected( nSelect ) )
- nSelect = LISTBOX_ENTRY_NOTFOUND;
-
- maSearchTimeout.Start();
- }
- else
- maSearchStr.Erase();
- bDone = TRUE;
+ bDone = maQuickSelectionEngine.HandleKeyEvent( rKEvt );
}
- }
+ }
+ break;
}
if ( ( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -1744,6 +1703,72 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
// -----------------------------------------------------------------------
+namespace
+{
+ static ::vcl::StringEntryIdentifier lcl_getEntry( const ImplEntryList& _rList, USHORT _nPos, String& _out_entryText )
+ {
+ OSL_PRECOND( ( _nPos != LISTBOX_ENTRY_NOTFOUND ), "lcl_getEntry: invalid position!" );
+ USHORT nEntryCount( _rList.GetEntryCount() );
+ if ( _nPos >= nEntryCount )
+ _nPos = 0;
+ _out_entryText = _rList.GetEntryText( _nPos );
+
+ // ::vcl::StringEntryIdentifier does not allow for 0 values, but our position is 0-based
+ // => normalize
+ return reinterpret_cast< ::vcl::StringEntryIdentifier >( _nPos + 1 );
+ }
+
+ static USHORT lcl_getEntryPos( ::vcl::StringEntryIdentifier _entry )
+ {
+ // our pos is 0-based, but StringEntryIdentifier does not allow for a NULL
+ return static_cast< USHORT >( reinterpret_cast< sal_Int64 >( _entry ) ) - 1;
+ }
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::CurrentEntry( String& _out_entryText ) const
+{
+ return lcl_getEntry( *GetEntryList(), ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) ? 0 : mnCurrentPos + 1, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ USHORT nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
+ return lcl_getEntry( *GetEntryList(), nNextPos, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+void ImplListBoxWindow::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ USHORT nSelect = lcl_getEntryPos( _entry );
+ if ( mpEntryList->IsEntryPosSelected( nSelect ) )
+ {
+ // ignore that. This method is a callback from the QuickSelectionEngine, which means the user attempted
+ // to select the given entry by typing its starting letters. No need to act.
+ return;
+ }
+
+ // normalize
+ OSL_ENSURE( nSelect < mpEntryList->GetEntryCount(), "ImplListBoxWindow::SelectEntry: how that?" );
+ if( nSelect >= mpEntryList->GetEntryCount() )
+ nSelect = mpEntryList->GetEntryCount()-1;
+
+ // make visible
+ ShowProminentEntry( nSelect );
+
+ // actually select
+ mnCurrentPos = nSelect;
+ if ( SelectEntries( nSelect, LET_KEYMOVE, FALSE, FALSE ) )
+ {
+ mbTravelSelect = TRUE;
+ mnSelectModifier = 0;
+ ImplCallSelect();
+ mbTravelSelect = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
{
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index a2553333246d..b1644e58ccd9 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -62,7 +62,8 @@ SLOFILES= $(SLO)$/button.obj \
$(SLO)$/slider.obj \
$(SLO)$/spinfld.obj \
$(SLO)$/spinbtn.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/tabctrl.obj \
+ $(SLO)$/quickselectionengine.obj
EXCEPTIONSFILES= \
$(SLO)$/button.obj \
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
new file mode 100644
index 000000000000..2d32393bf79a
--- /dev/null
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "vcl/quickselectionengine.hxx"
+#include "vcl/event.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/i18nhelp.hxx"
+#include "vcl/svapp.hxx"
+
+#include <boost/optional.hpp>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= QuickSelectionEngine_Data
+ //====================================================================
+ struct QuickSelectionEngine_Data
+ {
+ ISearchableStringList& rEntryList;
+ String sCurrentSearchString;
+ ::boost::optional< sal_Unicode > aSingleSearchChar;
+ Timer aSearchTimeout;
+
+ QuickSelectionEngine_Data( ISearchableStringList& _entryList )
+ :rEntryList( _entryList )
+ ,sCurrentSearchString()
+ ,aSingleSearchChar()
+ ,aSearchTimeout()
+ {
+ aSearchTimeout.SetTimeout( 2500 );
+ aSearchTimeout.SetTimeoutHdl( LINK( this, QuickSelectionEngine_Data, SearchStringTimeout ) );
+ }
+
+ ~QuickSelectionEngine_Data()
+ {
+ aSearchTimeout.Stop();
+ }
+
+ DECL_LINK( SearchStringTimeout, Timer* );
+ };
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ static void lcl_reset( QuickSelectionEngine_Data& _data )
+ {
+ _data.sCurrentSearchString.Erase();
+ _data.aSingleSearchChar.reset();
+ _data.aSearchTimeout.Stop();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ )
+ {
+ lcl_reset( *this );
+ return 1;
+ }
+
+ //--------------------------------------------------------------------
+ static StringEntryIdentifier findMatchingEntry( const String& _searchString, QuickSelectionEngine_Data& _engineData )
+ {
+ const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
+ // TODO: do we really need the Window's settings here? The original code used it ...
+
+ String sEntryText;
+ // get the "current + 1" entry
+ StringEntryIdentifier pSearchEntry = _engineData.rEntryList.CurrentEntry( sEntryText );
+ if ( pSearchEntry )
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ // loop 'til we find another matching entry
+ StringEntryIdentifier pStartedWith = pSearchEntry;
+ while ( pSearchEntry )
+ {
+ if ( rI18nHelper.MatchString( _searchString, sEntryText ) != 0 )
+ break;
+
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ if ( pSearchEntry == pStartedWith )
+ pSearchEntry = NULL;
+ }
+
+ return pSearchEntry;
+ }
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList )
+ :m_pData( new QuickSelectionEngine_Data( _entryList ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::~QuickSelectionEngine()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent )
+ {
+ xub_Unicode c = _keyEvent.GetCharCode();
+
+ if ( ( c >= 32 ) && ( c != 127 ) && !_keyEvent.GetKeyCode().IsMod2() )
+ {
+ m_pData->sCurrentSearchString += c;
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", ByteString( m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+
+ if ( m_pData->sCurrentSearchString.Len() == 1 )
+ { // first character in the search -> remmeber
+ m_pData->aSingleSearchChar.reset( c );
+ }
+ else if ( m_pData->sCurrentSearchString.Len() > 1 )
+ {
+ if ( !!m_pData->aSingleSearchChar && ( *m_pData->aSingleSearchChar != c ) )
+ // we already have a "single char", but the current one is different -> reset
+ m_pData->aSingleSearchChar.reset();
+ }
+
+ XubString aSearchTemp( m_pData->sCurrentSearchString );
+
+ StringEntryIdentifier pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: found %p", pMatchingEntry );
+ if ( !pMatchingEntry && ( aSearchTemp.Len() > 1 ) && !!m_pData->aSingleSearchChar )
+ {
+ // if there's only one letter in the search string, use a different search mode
+ aSearchTemp = *m_pData->aSingleSearchChar;
+ pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ }
+
+ if ( pMatchingEntry )
+ {
+ m_pData->rEntryList.SelectEntry( pMatchingEntry );
+ m_pData->aSearchTimeout.Start();
+ }
+ else
+ {
+ lcl_reset( *m_pData );
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------
+ void QuickSelectionEngine::Reset()
+ {
+ lcl_reset( *m_pData );
+ }
+
+//........................................................................
+} // namespace vcl
+//........................................................................
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 69999f6c7188..77da205131ea 100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4862,6 +4862,12 @@ void Window::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
+void Window::PostPaint()
+{
+}
+
+// -----------------------------------------------------------------------
+
void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx
index b2549573d099..587e58be5bc7 100644
--- a/vcl/unx/source/printer/ppdparser.cxx
+++ b/vcl/unx/source/printer/ppdparser.cxx
@@ -405,51 +405,53 @@ void PPDParser::scanPPDDir( const String& rDir )
const int nSuffixes = sizeof(pSuffixes)/sizeof(pSuffixes[0]);
osl::Directory aDir( rDir );
- aDir.open();
- osl::DirectoryItem aItem;
-
- INetURLObject aPPDDir(rDir);
- while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ if ( aDir.open() == osl::FileBase::E_None )
{
- osl::FileStatus aStatus( FileStatusMask_FileName );
- if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ osl::DirectoryItem aItem;
+
+ INetURLObject aPPDDir(rDir);
+ while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
{
- rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
- aURLBuf.append( rDir );
- aURLBuf.append( sal_Unicode( '/' ) );
- aURLBuf.append( aStatus.getFileName() );
+ osl::FileStatus aStatus( FileStatusMask_FileName );
+ if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ {
+ rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
+ aURLBuf.append( rDir );
+ aURLBuf.append( sal_Unicode( '/' ) );
+ aURLBuf.append( aStatus.getFileName() );
- rtl::OUString aFileURL, aFileName;
- osl::FileStatus::Type eType = osl::FileStatus::Unknown;
+ rtl::OUString aFileURL, aFileName;
+ osl::FileStatus::Type eType = osl::FileStatus::Unknown;
- if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
- {
- if( eType == osl::FileStatus::Regular )
+ if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
{
- INetURLObject aPPDFile = aPPDDir;
- aPPDFile.Append( aFileName );
-
- // match extension
- for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
+ if( eType == osl::FileStatus::Regular )
{
- if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
+ INetURLObject aPPDFile = aPPDDir;
+ aPPDFile.Append( aFileName );
+
+ // match extension
+ for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
{
- if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
{
- (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
- break;
+ if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ {
+ (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
+ break;
+ }
}
}
}
- }
- else if( eType == osl::FileStatus::Directory )
- {
- scanPPDDir( aFileURL );
+ else if( eType == osl::FileStatus::Directory )
+ {
+ scanPPDDir( aFileURL );
+ }
}
}
}
+ aDir.close();
}
- aDir.close();
}
void PPDParser::initPPDFiles()
diff --git a/writerfilter/qa/cppunittests/doctok/makefile.mk b/writerfilter/qa/cppunittests/doctok/makefile.mk
index 298bb4da906b..e7de9f8b4446 100644
--- a/writerfilter/qa/cppunittests/doctok/makefile.mk
+++ b/writerfilter/qa/cppunittests/doctok/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-doctok
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/qname/makefile.mk b/writerfilter/qa/cppunittests/qname/makefile.mk
index c2e989d91beb..2f51eb3844c7 100644
--- a/writerfilter/qa/cppunittests/qname/makefile.mk
+++ b/writerfilter/qa/cppunittests/qname/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-qname
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/sl/makefile.mk b/writerfilter/qa/cppunittests/sl/makefile.mk
index b7a943e376e9..fa7cafc1dd00 100644
--- a/writerfilter/qa/cppunittests/sl/makefile.mk
+++ b/writerfilter/qa/cppunittests/sl/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-od_sl
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/xxml/makefile.mk b/writerfilter/qa/cppunittests/xxml/makefile.mk
index 32d0febc1c85..7f0d3f9731b4 100644
--- a/writerfilter/qa/cppunittests/xxml/makefile.mk
+++ b/writerfilter/qa/cppunittests/xxml/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-xxml
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
new file mode 100644
index 000000000000..040843afd7ce
--- /dev/null
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_
+#include <cppuhelper/implementationentry.hxx>
+#endif
+#include <osl/module.hxx>
+#include <tools/solar.h>
+#include <RtfFilter.hxx>
+
+using namespace ::rtl;
+using namespace ::cppu;
+using namespace ::com::sun::star;
+
+RtfFilter::RtfFilter( const uno::Reference< uno::XComponentContext >& rxContext) :
+ m_xContext( rxContext )
+{
+}
+
+RtfFilter::~RtfFilter()
+{
+}
+
+sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
+ throw (uno::RuntimeException)
+{
+ OSL_TRACE("%s", OSL_THIS_FUNC);
+ if( m_xSrcDoc.is() )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
+ uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfExport" ))), uno::UNO_QUERY_THROW);
+ if (!xIfc.is())
+ return sal_False;
+ uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW);
+ uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW);
+ if (!xExprtr.is() || !xFltr.is())
+ return sal_False;
+ xExprtr->setSourceDocument(m_xSrcDoc);
+ return xFltr->filter(aDescriptor);
+ }
+ else if ( m_xDstDoc.is() )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
+ uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfImport" ))), uno::UNO_QUERY_THROW);
+ if (!xIfc.is())
+ return sal_False;
+ uno::Reference< document::XImporter > xImprtr(xIfc, uno::UNO_QUERY_THROW);
+ uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW);
+ if (!xImprtr.is() || !xFltr.is())
+ return sal_False;
+ xImprtr->setTargetDocument(m_xDstDoc);
+ return xFltr->filter(aDescriptor);
+ }
+ return sal_False;
+}
+
+void RtfFilter::cancel( ) throw (uno::RuntimeException)
+{
+}
+
+void RtfFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ m_xSrcDoc = xDoc;
+}
+
+void RtfFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ m_xDstDoc = xDoc;
+}
+
+void RtfFilter::initialize( const uno::Sequence< uno::Any >& /*aArguments*/ ) throw (uno::Exception, uno::RuntimeException)
+{
+ // The DOCX exporter here extracts 'type' of the filter, ie 'Word' or
+ // 'Word Template' but we don't need it for RTF.
+}
+
+OUString RtfFilter::getImplementationName( ) throw (uno::RuntimeException)
+{
+ return RtfFilter_getImplementationName();
+}
+
+#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
+#define SERVICE_NAME2 "com.sun.star.document.ExportFilter"
+sal_Bool RtfFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException)
+{
+ return (rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) ||
+ rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ));
+}
+
+uno::Sequence< OUString > RtfFilter::getSupportedServiceNames( ) throw (uno::RuntimeException)
+{
+ return RtfFilter_getSupportedServiceNames();
+}
+
+/* Helpers, used by shared lib exports. */
+
+OUString RtfFilter_getImplementationName () throw (uno::RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfFilter" ) );
+}
+
+uno::Sequence< OUString > RtfFilter_getSupportedServiceNames( ) throw (uno::RuntimeException)
+{
+ uno::Sequence < OUString > aRet(2);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
+ pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) );
+ return aRet;
+}
+#undef SERVICE_NAME1
+#undef SERVICE_NAME2
+
+uno::Reference< uno::XInterface > RtfFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
+ throw( uno::Exception )
+{
+ return (cppu::OWeakObject*) new RtfFilter( xContext );
+}
+
+/* vi:set shiftwidth=4 expandtab: */
diff --git a/writerfilter/source/filter/RtfFilter.hxx b/writerfilter/source/filter/RtfFilter.hxx
new file mode 100644
index 000000000000..3a4be622ab17
--- /dev/null
+++ b/writerfilter/source/filter/RtfFilter.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Miklos Vajna.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RTFFILTER_HXX
+#define _RTFFILTER_HXX
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <cppuhelper/implbase5.hxx>
+#include <WriterFilterDllApi.hxx>
+
+class WRITERFILTER_DLLPUBLIC RtfFilter : public cppu::WeakImplHelper5
+<
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XImporter,
+ com::sun::star::document::XExporter,
+ com::sun::star::lang::XInitialization,
+ com::sun::star::lang::XServiceInfo
+>
+{
+
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc, m_xDstDoc;
+ ::rtl::OUString m_sFilterName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler;
+
+
+public:
+ RtfFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
+ virtual ~RtfFilter();
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XImporter
+ virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XExporter
+ virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+
+::rtl::OUString RtfFilter_getImplementationName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfFilter_getSupportedServiceNames( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfFilter_createInstance(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > &xContext)
+ throw( ::com::sun::star::uno::Exception );
+#endif
+
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index f8775d097f66..deede335d9af 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -30,6 +30,7 @@
#endif
#include <WriterFilter.hxx>
#include <WriterFilterDetection.hxx>
+#include <RtfFilter.hxx>
using namespace ::rtl;
using namespace ::cppu;
@@ -56,6 +57,7 @@ static struct ::cppu::ImplementationEntry s_component_entries [] =
{
{ WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 },
{ WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0} ,
+ { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 } // terminate with NULL
};
diff --git a/writerfilter/source/filter/makefile.mk b/writerfilter/source/filter/makefile.mk
index f578e2853243..6b11fd4ff1f3 100644
--- a/writerfilter/source/filter/makefile.mk
+++ b/writerfilter/source/filter/makefile.mk
@@ -40,7 +40,8 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES= $(SLO)$/WriterFilter.obj \
$(SLO)$/WriterFilterDetection.obj \
- $(SLO)$/ImportFilter.obj
+ $(SLO)$/ImportFilter.obj \
+ $(SLO)$/RtfFilter.obj
# --- Targets ----------------------------------
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 80238a075973..291c99c7be21 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3113,6 +3113,9 @@ namespace xmloff { namespace token {
XML_OUTSIDE_MINIMUM,//#i114142#
XML_OUTSIDE_MAXIMUM,//#i114142#
+ XML_MIN_VALUE,
+ XML_MAX_VALUE,
+
XML_TOKEN_END
};
diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst
index 7b68ed08ff82..8d60a0f0541b 100644
--- a/xmloff/prj/build.lst
+++ b/xmloff/prj/build.lst
@@ -9,9 +9,10 @@ xo xmloff\source\text nmake - all xo_text xo_inc NULL
xo xmloff\source\draw nmake - all xo_draw xo_inc NULL
xo xmloff\source\chart nmake - all xo_chart xo_inc NULL
xo xmloff\source\forms nmake - all xo_forms xo_inc NULL
+xo xmloff\source\forms\handler nmake - all xo_forms_handler xo_inc NULL
xo xmloff\source\script nmake - all xo_script xo_inc NULL
xo xmloff\source\transform nmake - all xo_transform xo_util xo_inc NULL
xo xmloff\source\xforms nmake - all xo_xforms xo_inc NULL
xo xmloff\source\table nmake - all xo_table xo_inc NULL
-xo xmloff\util nmake - all xo_util xo_chart xo_core xo_draw xo_forms xo_meta xo_script xo_style xo_text xo_xforms xo_table NULL
+xo xmloff\util nmake - all xo_util xo_chart xo_core xo_draw xo_forms xo_forms_handler xo_meta xo_script xo_style xo_text xo_xforms xo_table NULL
xo xmloff\qa\unoapi nmake - all xo_qa_unoapi NULL
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index d3f0670f672d..bc1b50a908a2 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -704,6 +704,7 @@ private:
public:
SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+ USHORT nPrefix,
const ::rtl::OUString& rLocalName,
::rtl::OUString& rRangeString );
virtual ~SchXMLRangeSomewhereContext();
@@ -818,7 +819,7 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
{
//#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore
//so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now
- pContext = new SchXMLRangeSomewhereContext( GetImport(), rLocalName, maRangeId );
+ pContext = new SchXMLRangeSomewhereContext( GetImport(), nPrefix, rLocalName, maRangeId );
}
else
{
@@ -1188,9 +1189,10 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
//---------------------------------------------------------------------------------------------------
SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+ USHORT nPrefix,
const OUString& rLocalName,
OUString& rRangeString ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ),
+ SvXMLImportContext( rImport, nPrefix, rLocalName ),
mrRangeString( rRangeString )
{
}
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index d65bafe583df..6cfacbd93905 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3113,6 +3113,9 @@ namespace xmloff { namespace token {
TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ),
TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ),
+ TOKEN( "min-value", XML_MIN_VALUE ),
+ TOKEN( "max-value", XML_MAX_VALUE ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index efd0a8127d87..5e91a8575b0a 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -874,32 +874,27 @@ void SvXMLUnitConverter::convertTime( ::rtl::OUStringBuffer& rBuffer,
}
/** convert ISO Time String to double; negative durations allowed */
-sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
- const ::rtl::OUString& rString)
+static bool lcl_convertTime( const ::rtl::OUString& rString, sal_Int32& o_rDays, sal_Int32& o_rHours, sal_Int32& o_rMins,
+ sal_Int32& o_rSecs, sal_Bool& o_rIsNegativeTime, double& o_rFractionalSecs )
{
rtl::OUString aTrimmed = rString.trim().toAsciiUpperCase();
const sal_Unicode* pStr = aTrimmed.getStr();
// negative time duration?
- sal_Bool bIsNegativeDuration = sal_False;
if ( sal_Unicode('-') == (*pStr) )
{
- bIsNegativeDuration = sal_True;
+ o_rIsNegativeTime = sal_True;
pStr++;
}
if ( *(pStr++) != sal_Unicode('P') ) // duration must start with "P"
- return sal_False;
+ return false;
- rtl::OUString sDoubleStr;
- sal_Bool bSuccess = sal_True;
+ ::rtl::OUString sDoubleStr;
+ sal_Bool bSuccess = true;
sal_Bool bDone = sal_False;
sal_Bool bTimePart = sal_False;
sal_Bool bIsFraction = sal_False;
- sal_Int32 nDays = 0;
- sal_Int32 nHours = 0;
- sal_Int32 nMins = 0;
- sal_Int32 nSecs = 0;
sal_Int32 nTemp = 0;
while ( bSuccess && !bDone )
@@ -910,7 +905,7 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
else if ( sal_Unicode('0') <= c && sal_Unicode('9') >= c )
{
if ( nTemp >= SAL_MAX_INT32 / 10 )
- bSuccess = sal_False;
+ bSuccess = false;
else
{
if ( !bIsFraction )
@@ -928,17 +923,17 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
{
if ( c == sal_Unicode('H') )
{
- nHours = nTemp;
+ o_rHours = nTemp;
nTemp = 0;
}
else if ( c == sal_Unicode('M') )
{
- nMins = nTemp;
+ o_rMins = nTemp;
nTemp = 0;
}
else if ( (c == sal_Unicode(',')) || (c == sal_Unicode('.')) )
{
- nSecs = nTemp;
+ o_rSecs = nTemp;
nTemp = 0;
bIsFraction = sal_True;
sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0."));
@@ -947,13 +942,13 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
{
if ( !bIsFraction )
{
- nSecs = nTemp;
+ o_rSecs = nTemp;
nTemp = 0;
sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0.0"));
}
}
else
- bSuccess = sal_False; // invalid character
+ bSuccess = false; // invalid character
}
else
{
@@ -961,7 +956,7 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
bTimePart = sal_True;
else if ( c == sal_Unicode('D') )
{
- nDays = nTemp;
+ o_rDays = nTemp;
nTemp = 0;
}
else if ( c == sal_Unicode('Y') || c == sal_Unicode('M') )
@@ -969,14 +964,28 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
//! how many days is a year or month?
DBG_ERROR("years or months in duration: not implemented");
- bSuccess = sal_False;
+ bSuccess = false;
}
else
- bSuccess = sal_False; // invalid character
+ bSuccess = false; // invalid character
}
}
if ( bSuccess )
+ o_rFractionalSecs = sDoubleStr.toDouble();
+ return bSuccess;
+}
+
+sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
+ const ::rtl::OUString& rString)
+{
+ sal_Int32 nDays = 0;
+ sal_Int32 nHours = 0;
+ sal_Int32 nMins = 0;
+ sal_Int32 nSecs = 0;
+ sal_Bool bIsNegativeDuration = sal_False;
+ double fFractionalSecs = 0.0;
+ if ( lcl_convertTime( rString, nDays, nHours, nMins, nSecs, bIsNegativeDuration, fFractionalSecs ) )
{
if ( nDays )
nHours += nDays * 24; // add the days to the hours part
@@ -985,12 +994,11 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
double fMin = nMins;
double fSec = nSecs;
double fSec100 = 0.0;
- double fFraction = sDoubleStr.toDouble();
fTempTime = fHour / 24;
fTempTime += fMin / (24 * 60);
fTempTime += fSec / (24 * 60 * 60);
fTempTime += fSec100 / (24 * 60 * 60 * 60);
- fTempTime += fFraction / (24 * 60 * 60);
+ fTempTime += fFractionalSecs / (24 * 60 * 60);
// negative duration?
if ( bIsNegativeDuration )
@@ -999,8 +1007,9 @@ sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
}
fTime = fTempTime;
+ return sal_True;
}
- return bSuccess;
+ return sal_False;
}
/** convert util::DateTime to ISO Time String */
@@ -1022,33 +1031,18 @@ void SvXMLUnitConverter::convertTime( ::rtl::OUStringBuffer& rBuffer,
sal_Bool SvXMLUnitConverter::convertTime( ::com::sun::star::util::DateTime& rDateTime,
const ::rtl::OUString& rString )
{
- double fCalculatedTime = 0.0;
- if( convertTime( fCalculatedTime, rString ) )
- {
- // #101357# declare as volatile to prevent optimization
- // (gcc 3.0.1 Linux)
- volatile double fTempTime = fCalculatedTime;
- fTempTime *= 24;
- double fHoursValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fHoursValue;
- fTempTime *= 60;
- double fMinsValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fMinsValue;
- fTempTime *= 60;
- double fSecsValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fSecsValue;
- double f100SecsValue = 0.0;
-
- if( fTempTime > 0.00001 )
- f100SecsValue = fTempTime;
-
+ sal_Int32 nDays = 0, nHours = 0, nMins = 0, nSecs = 0;
+ sal_Bool bIsNegativeDuration = sal_False;
+ double fFractionalSecs = 0.0;
+ if ( lcl_convertTime( rString, nDays, nHours, nMins, nSecs, bIsNegativeDuration, fFractionalSecs ) )
+ {
rDateTime.Year = 0;
rDateTime.Month = 0;
rDateTime.Day = 0;
- rDateTime.Hours = static_cast < sal_uInt16 > ( fHoursValue );
- rDateTime.Minutes = static_cast < sal_uInt16 > ( fMinsValue );
- rDateTime.Seconds = static_cast < sal_uInt16 > ( fSecsValue );
- rDateTime.HundredthSeconds = static_cast < sal_uInt16 > ( f100SecsValue * 100.0 );
+ rDateTime.Hours = static_cast < sal_uInt16 > ( nHours );
+ rDateTime.Minutes = static_cast < sal_uInt16 > ( nMins );
+ rDateTime.Seconds = static_cast < sal_uInt16 > ( nSecs );
+ rDateTime.HundredthSeconds = static_cast < sal_uInt16 > ( fFractionalSecs * 100.0 );
return sal_True;
}
diff --git a/xmloff/source/forms/controlelement.cxx b/xmloff/source/forms/controlelement.cxx
index 84a74fe44a8b..748cf68c23ed 100644
--- a/xmloff/source/forms/controlelement.cxx
+++ b/xmloff/source/forms/controlelement.cxx
@@ -59,6 +59,8 @@ namespace xmloff
case HIDDEN: return "hidden";
case GRID: return "grid";
case VALUERANGE: return "value-range";
+ case TIME: return "time";
+ case DATE: return "date";
default: return "generic-control";
}
diff --git a/xmloff/source/forms/controlelement.hxx b/xmloff/source/forms/controlelement.hxx
index 1816710fb4dc..d226f218f426 100644
--- a/xmloff/source/forms/controlelement.hxx
+++ b/xmloff/source/forms/controlelement.hxx
@@ -63,6 +63,8 @@ namespace xmloff
GRID,
VALUERANGE,
GENERIC_CONTROL,
+ TIME,
+ DATE,
UNKNOWN // must be the last element
};
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 115b06c4c2ad..149965631b27 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -36,6 +36,7 @@
#include "formcellbinding.hxx"
#include "formcellbinding.hxx"
#include "xformsexport.hxx"
+#include "property_meta_data.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/text/XText.hpp>
@@ -321,6 +322,9 @@ namespace xmloff
#endif
}
+ // "new-style" properties ...
+ exportGenericHandlerAttributes();
+
// common control attributes
exportCommonControlAttributes();
@@ -474,6 +478,84 @@ namespace xmloff
}
//---------------------------------------------------------------------
+ void OControlExport::exportGenericHandlerAttributes()
+ {
+ const Sequence< Property > aProperties = m_xPropertyInfo->getProperties();
+ for ( const Property* prop = aProperties.getConstArray();
+ prop != aProperties.getConstArray() + aProperties.getLength();
+ ++prop
+ )
+ {
+ try
+ {
+ // see if this property can already be handled with an IPropertyHandler (which, on the long
+ // term, should be the case for most, if not all, properties)
+ const PropertyDescription* propDescription = metadata::getPropertyDescription( prop->Name );
+ if ( propDescription == NULL )
+ continue;
+
+ // let the factory provide the concrete handler. Note that caching, if desired, is the task
+ // of the factory
+ PPropertyHandler handler = (*propDescription->factory)( propDescription->propertyId );
+ ENSURE_OR_CONTINUE( handler.get() != NULL,
+ "OControlExport::exportGenericHandlerAttributes: invalid property handler provided by the factory!" );
+
+ ::rtl::OUString attributeValue;
+ if ( propDescription->propertyGroup == NO_GROUP )
+ {
+ // that's a property which has a direct mapping to an attribute
+ if ( !shouldExportProperty( prop->Name ) )
+ // TODO: in the future, we surely need a more sophisticated approach to this, involving the property
+ // handler, or the property description
+ {
+ exportedProperty( prop->Name );
+ continue;
+ }
+
+ const Any propValue = m_xProps->getPropertyValue( prop->Name );
+ attributeValue = handler->getAttributeValue( propValue );
+ }
+ else
+ {
+ // that's a property which is part of a group of properties, whose values, in their entity, comprise
+ // a single attribute value
+
+ // retrieve the descriptions of all other properties which add to the attribute value
+ PropertyDescriptionList descriptions;
+ metadata::getPropertyGroup( propDescription->propertyGroup, descriptions );
+
+ // retrieve the values for all those properties
+ PropertyValues aValues;
+ for ( PropertyDescriptionList::iterator desc = descriptions.begin();
+ desc != descriptions.end();
+ ++desc
+ )
+ {
+ // TODO: XMultiPropertySet?
+ const Any propValue = m_xProps->getPropertyValue( (*desc)->propertyName );
+ aValues[ (*desc)->propertyId ] = propValue;
+ }
+
+ // let the handler translate into an XML attribute value
+ attributeValue = handler->getAttributeValue( aValues );
+ }
+
+ AddAttribute(
+ propDescription->attribute.namespacePrefix,
+ token::GetXMLToken( propDescription->attribute.attributeToken ),
+ attributeValue
+ );
+
+ exportedProperty( prop->Name );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ //---------------------------------------------------------------------
void OControlExport::exportCommonControlAttributes()
{
size_t i=0;
@@ -1380,21 +1462,35 @@ namespace xmloff
m_nClassId = FormComponentType::CONTROL;
DBG_CHECK_PROPERTY( PROPERTY_CLASSID, sal_Int16 );
m_xProps->getPropertyValue(PROPERTY_CLASSID) >>= m_nClassId;
+ bool knownType = false;
switch (m_nClassId)
{
case FormComponentType::DATEFIELD:
+ m_eType = DATE;
+ knownType = true;
+ // NO BREAK
case FormComponentType::TIMEFIELD:
+ if ( !knownType )
+ {
+ m_eType = TIME;
+ knownType = true;
+ }
+ m_nIncludeSpecial |= SCA_VALIDATION;
+ // NO BREAK
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
case FormComponentType::PATTERNFIELD:
- m_eType = FORMATTED_TEXT;
+ if ( !knownType )
+ {
+ m_eType = FORMATTED_TEXT;
+ knownType = true;
+ }
// NO BREAK
case FormComponentType::TEXTFIELD:
{ // it's some kind of edit. To know which type we need further investigation
- if (FORMATTED_TEXT != m_eType)
- { // not coming from the previous cases which had a class id .ne. TEXTFIELD
-
+ if ( !knownType )
+ {
// check if it's a formatted field
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_FORMATKEY))
{
@@ -1430,14 +1526,21 @@ namespace xmloff
m_eType = TEXT;
}
}
+ knownType = true;
}
- // attributes which are common to all the four types:
+ // attributes which are common to all the types:
// common attributes
m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_VALUE |
+ CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED |
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
+ if ( ( m_nClassId != FormComponentType::DATEFIELD )
+ && ( m_nClassId != FormComponentType::TIMEFIELD )
+ )
+ // date and time field values are handled differently nowadays
+ m_nIncludeCommon |= CCA_VALUE;
+
// database attributes
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
@@ -1461,8 +1564,7 @@ namespace xmloff
// max and min values and validation:
if (FORMATTED_TEXT == m_eType)
{ // in general all controls represented as formatted-text have these props
- if (FormComponentType::PATTERNFIELD != m_nClassId)
- // but the PatternField does not have value limits
+ if ( FormComponentType::PATTERNFIELD != m_nClassId ) // except the PatternField
m_nIncludeSpecial |= SCA_MAX_VALUE | SCA_MIN_VALUE;
if (FormComponentType::TEXTFIELD != m_nClassId)
@@ -1471,8 +1573,13 @@ namespace xmloff
}
// if it's not a password field or rich text control, the CurrentValue needs to be stored, too
- if ( PASSWORD != m_eType )
+ if ( ( PASSWORD != m_eType )
+ && ( DATE != m_eType )
+ && ( TIME != m_eType )
+ )
+ {
m_nIncludeCommon |= CCA_CURRENT_VALUE;
+ }
}
break;
diff --git a/xmloff/source/forms/elementexport.hxx b/xmloff/source/forms/elementexport.hxx
index d9504271ac04..a8981f0a1fea 100644
--- a/xmloff/source/forms/elementexport.hxx
+++ b/xmloff/source/forms/elementexport.hxx
@@ -161,6 +161,13 @@ namespace xmloff
*/
void exportSubTags() throw (::com::sun::star::uno::Exception);
+ /** adds the attributes which are handled via generic IPropertyHandlers
+
+ <p>In the future, this really should be *all* attribiutes, instead of this shitload of
+ hand-crafted code we have currently ...</p>
+ */
+ void exportGenericHandlerAttributes();
+
/** adds common control attributes to the XMLExport context given
<p>The attribute list of the context is not cleared initially, this is the responsibility of the caller.</p>
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index b946c4a20941..eb6dd0965e76 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -28,22 +28,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <algorithm>
#include "elementimport.hxx"
-#include <xmloff/xmlimp.hxx>
-#include <xmloff/nmspmap.hxx>
-#include <xmloff/xmluconv.hxx>
+#include "xmloff/xmlimp.hxx"
+#include "xmloff/nmspmap.hxx"
+#include "xmloff/xmluconv.hxx"
#include "strings.hxx"
#include "callbacks.hxx"
#include "attriblistmerge.hxx"
#include "xmlnmspe.hxx"
#include "eventimport.hxx"
-#include <xmloff/txtstyli.hxx>
+#include "xmloff/txtstyli.hxx"
#include "formenums.hxx"
-#include <xmloff/xmltoken.hxx>
+#include "xmloff/xmltoken.hxx"
#include "gridcolumnproptranslator.hxx"
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
+#include "property_description.hxx"
+#include "property_meta_data.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/text/XText.hpp>
@@ -54,9 +53,13 @@
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
/** === end UNO includes === **/
+
#include <tools/urlobj.hxx>
+#include <tools/diagnose_ex.h>
#include <tools/time.hxx>
#include <rtl/logfile.hxx>
+#include <comphelper/extract.hxx>
+#include <comphelper/types.hxx>
#include <algorithm>
#include <functional>
@@ -157,6 +160,7 @@ namespace xmloff
,m_rEventManager(_rEventManager)
,m_pStyleElement( NULL )
,m_xParentContainer(_rxParentContainer)
+ ,m_bImplicitGenericAttributeHandling( true )
{
OSL_ENSURE(m_xParentContainer.is(), "OElementImport::OElementImport: invalid parent container!");
}
@@ -167,17 +171,41 @@ namespace xmloff
}
//---------------------------------------------------------------------
+ ::rtl::OUString OElementImport::determineDefaultServiceName() const
+ {
+ return ::rtl::OUString();
+ }
+
+ //---------------------------------------------------------------------
void OElementImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
{
ENTER_LOG_CONTEXT( "xmloff::OElementImport - importing one element" );
- // call the base class. This should give us enough information (especially the service name)
- // to create our UNO element
- OPropertyImport::StartElement(_rxAttrList);
- // create the element
+ const SvXMLNamespaceMap& rMap = m_rContext.getGlobalContext().GetNamespaceMap();
+ const ::rtl::OUString sImplNameAttribute = rMap.GetQNameByKey( XML_NAMESPACE_FORM, GetXMLToken( XML_CONTROL_IMPLEMENTATION ) );
+ const ::rtl::OUString sControlImplementation = _rxAttrList->getValueByName( sImplNameAttribute );
+
+ // retrieve the service name
+ if ( sControlImplementation.getLength() > 0 )
+ {
+ ::rtl::OUString sOOoImplementationName;
+ const sal_uInt16 nImplPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sControlImplementation, &sOOoImplementationName );
+ m_sServiceName = ( nImplPrefix == XML_NAMESPACE_OOO ) ? sOOoImplementationName : sControlImplementation;
+ }
+
+ if ( !m_sServiceName.getLength() )
+ determineDefaultServiceName();
+
+ // create the object *now*. This allows setting properties in the various handleAttribute methods.
+ // (Though currently not all code is migrated to this pattern, most attributes are still handled
+ // by remembering the value (via implPushBackPropertyValue), and setting the correct property value
+ // later (in OControlImport::StartElement).)
m_xElement = createElement();
- if ( !m_xInfo.is() && m_xElement.is() )
+ if ( m_xElement.is() )
m_xInfo = m_xElement->getPropertySetInfo();
+
+ // call the base class
+ OPropertyImport::StartElement( _rxAttrList );
}
//---------------------------------------------------------------------
@@ -197,26 +225,61 @@ namespace xmloff
if (!m_xElement.is())
return;
+ // apply the non-generic properties
+ implApplySpecificProperties();
+
+ // set the generic properties
+ implApplyGenericProperties();
+
+ // set the style properties
+ if ( m_pStyleElement && m_xElement.is() )
+ {
+ Reference< XPropertySet > xPropTranslation =
+ new OGridColumnPropertyTranslator( Reference< XMultiPropertySet >( m_xElement, UNO_QUERY ) );
+ const_cast< XMLTextStyleContext* >( m_pStyleElement )->FillPropertySet( xPropTranslation );
+
+ const ::rtl::OUString sNumberStyleName = const_cast< XMLTextStyleContext* >( m_pStyleElement )->GetDataStyleName( );
+ if ( sNumberStyleName.getLength() )
+ // the style also has a number (sub) style
+ m_rContext.applyControlNumberStyle( m_xElement, sNumberStyleName );
+ }
+
+ // insert the element into the parent container
+ if (!m_sName.getLength())
+ {
+ OSL_ENSURE(sal_False, "OElementImport::EndElement: did not find a name attribute!");
+ m_sName = implGetDefaultName();
+ }
+
+ m_xParentContainer->insertByName(m_sName, makeAny(m_xElement));
+ LEAVE_LOG_CONTEXT( );
+ }
+
+ //---------------------------------------------------------------------
+ void OElementImport::implApplySpecificProperties()
+ {
+ if ( m_aValues.empty() )
+ return;
+
// set all the properties we collected
#if OSL_DEBUG_LEVEL > 0
// check if the object has all the properties
// (We do this in the non-pro version only. Doing it all the time would be much to expensive)
if ( m_xInfo.is() )
{
- PropertyValueArray::iterator aEnd = m_aValues.end();
+ PropertyValueArray::const_iterator aEnd = m_aValues.end();
for ( PropertyValueArray::iterator aCheck = m_aValues.begin();
aCheck != aEnd;
++aCheck
)
{
OSL_ENSURE(m_xInfo->hasPropertyByName(aCheck->Name),
- ::rtl::OString("OElementImport::EndElement: read a property (")
+ ::rtl::OString("OElementImport::implApplySpecificProperties: read a property (")
+= ::rtl::OString(aCheck->Name.getStr(), aCheck->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
+= ::rtl::OString(") which does not exist on the element!"));
}
}
#endif
- OSL_ENSURE(!m_aValues.empty(), "OElementImport::EndElement: no properties read!");
// set the properties
const Reference< XMultiPropertySet > xMultiProps(m_xElement, UNO_QUERY);
@@ -253,7 +316,7 @@ namespace xmloff
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OElementImport::EndElement: could not set the properties (using the XMultiPropertySet)!");
+ OSL_ENSURE(sal_False, "OElementImport::implApplySpecificProperties: could not set the properties (using the XMultiPropertySet)!");
}
}
@@ -274,42 +337,16 @@ namespace xmloff
catch(Exception&)
{
OSL_ENSURE(sal_False,
- ::rtl::OString("OElementImport::EndElement: could not set the property \"")
+ ::rtl::OString("OElementImport::implApplySpecificProperties: could not set the property \"")
+= ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
+= ::rtl::OString("\"!"));
}
}
}
-
- // set the generic properties
- implImportGenericProperties();
-
- // set the style properties
- if ( m_pStyleElement && m_xElement.is() )
- {
- Reference< XPropertySet > xPropTranslation =
- new OGridColumnPropertyTranslator( Reference< XMultiPropertySet >( m_xElement, UNO_QUERY ) );
- const_cast< XMLTextStyleContext* >( m_pStyleElement )->FillPropertySet( xPropTranslation );
-
- const ::rtl::OUString sNumberStyleName = const_cast< XMLTextStyleContext* >( m_pStyleElement )->GetDataStyleName( );
- if ( sNumberStyleName.getLength() )
- // the style also has a number (sub) style
- m_rContext.applyControlNumberStyle( m_xElement, sNumberStyleName );
- }
-
- // insert the element into the parent container
- if (!m_sName.getLength())
- {
- OSL_ENSURE(sal_False, "OElementImport::EndElement: did not find a name attribute!");
- m_sName = implGetDefaultName();
- }
-
- m_xParentContainer->insertByName(m_sName, makeAny(m_xElement));
- LEAVE_LOG_CONTEXT( );
}
//---------------------------------------------------------------------
- void OElementImport::implImportGenericProperties()
+ void OElementImport::implApplyGenericProperties()
{
if ( m_aGenericValues.empty() )
return;
@@ -334,7 +371,7 @@ namespace xmloff
if ( !xDynamicProperties.is() )
{
#if OSL_DEBUG_LEVEL > 0
- ::rtl::OString aMessage( "OElementImport::implImportGenericProperties: encountered an unknown property (" );
+ ::rtl::OString aMessage( "OElementImport::implApplyGenericProperties: encountered an unknown property (" );
aMessage += ::rtl::OUStringToOString( aPropValues->Name, RTL_TEXTENCODING_ASCII_US );
aMessage += "), but component is no PropertyBag!";
OSL_ENSURE( false, aMessage.getStr() );
@@ -352,7 +389,7 @@ namespace xmloff
m_xInfo = m_xElement->getPropertySetInfo();
}
- // determine the type of the value (source forthe following conversion)
+ // determine the type of the value (source for the following conversion)
TypeClass eValueTypeClass = aPropValues->Value.getValueTypeClass();
const sal_Bool bValueIsSequence = TypeClass_SEQUENCE == eValueTypeClass;
if ( bValueIsSequence )
@@ -361,7 +398,7 @@ namespace xmloff
eValueTypeClass = aSimpleType.getTypeClass();
}
- // determine the type of the property (target forthe following conversion)
+ // determine the type of the property (target for the following conversion)
const Property aProperty( m_xInfo->getPropertyByName( aPropValues->Name ) );
TypeClass ePropTypeClass = aProperty.Type.getTypeClass();
const sal_Bool bPropIsSequence = TypeClass_SEQUENCE == ePropTypeClass;
@@ -373,18 +410,18 @@ namespace xmloff
if ( bPropIsSequence != bValueIsSequence )
{
- OSL_ENSURE( false, "OElementImport::implImportGenericProperties: either both value and property should be a sequence, or none of them!" );
+ OSL_ENSURE( false, "OElementImport::implApplyGenericProperties: either both value and property should be a sequence, or none of them!" );
continue;
}
if ( bValueIsSequence )
{
OSL_ENSURE( eValueTypeClass == TypeClass_ANY,
- "OElementImport::implImportGenericProperties: only ANYs should have been imported as generic list property!" );
+ "OElementImport::implApplyGenericProperties: only ANYs should have been imported as generic list property!" );
// (OPropertyImport should produce only Sequencer< Any >, since it cannot know the real type
OSL_ENSURE( ePropTypeClass == TypeClass_SHORT,
- "OElementImport::implImportGenericProperties: conversion to sequences other than 'sequence< short >' not implemented, yet!" );
+ "OElementImport::implApplyGenericProperties: conversion to sequences other than 'sequence< short >' not implemented, yet!" );
Sequence< Any > aXMLValueList;
aPropValues->Value >>= aXMLValueList;
@@ -427,13 +464,13 @@ namespace xmloff
aPropValues->Value <<= static_cast< sal_Int64 >( nVal );
break;
default:
- OSL_ENSURE( false, "OElementImport::implImportGenericProperties: unsupported value type!" );
+ OSL_ENSURE( false, "OElementImport::implApplyGenericProperties: unsupported value type!" );
break;
}
}
break;
default:
- OSL_ENSURE( false, "OElementImport::implImportGenericProperties: non-double values not supported!" );
+ OSL_ENSURE( false, "OElementImport::implApplyGenericProperties: non-double values not supported!" );
break;
}
}
@@ -484,38 +521,117 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OElementImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ PropertyGroups::const_iterator OElementImport::impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const
{
- if (!m_sServiceName.getLength() &&
- token::IsXMLToken( _rLocalName, token::XML_CONTROL_IMPLEMENTATION))
- { // it's the service name
+ ENSURE_OR_RETURN( m_xInfo.is(), "OElementImport::impl_matchPropertyGroup: no property set info!", i_propertyGroups.end() );
- ::rtl::OUString sImplName;
- const sal_uInt16 nImplPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( _rValue,
- &sImplName );
- m_sServiceName = XML_NAMESPACE_OOO==nImplPrefix ? sImplName
- :_rValue;
+ for ( PropertyGroups::const_iterator group = i_propertyGroups.begin();
+ group != i_propertyGroups.end();
+ ++group
+ )
+ {
+ bool missingProp = false;
+ for ( PropertyDescriptionList::const_iterator prop = group->begin();
+ prop != group->end();
+ ++prop
+ )
+ {
+ if ( !m_xInfo->hasPropertyByName( (*prop)->propertyName ) )
+ {
+ missingProp = true;
+ break;
+ }
+ }
+
+ if ( missingProp )
+ // try next group
+ continue;
+
+ return group;
}
- else
+
+ return i_propertyGroups.end();
+ }
+
+ //---------------------------------------------------------------------
+ bool OElementImport::tryGenericAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue )
+ {
+ // the generic approach (which I hope all props will be migrated to, on the medium term): property handlers
+ const AttributeDescription attribute( metadata::getAttributeDescription( _nNamespaceKey, _rLocalName ) );
+ if ( attribute.attributeToken != XML_TOKEN_INVALID )
{
- if (!m_sName.getLength() &&
- token::IsXMLToken( _rLocalName, token::XML_NAME))
- // remember the name for later use in EndElement
- m_sName = _rValue;
+ PropertyGroups propertyGroups;
+ metadata::getPropertyGroupList( attribute, propertyGroups );
+ const PropertyGroups::const_iterator pos = impl_matchPropertyGroup( propertyGroups );
+ if ( pos == propertyGroups.end() )
+ return false;
- // maybe it's the style attribute?
- if ( token::IsXMLToken( _rLocalName, token::XML_TEXT_STYLE_NAME ) )
+ do
{
- const SvXMLStyleContext* pStyleContext = m_rContext.getStyleElement( _rValue );
- OSL_ENSURE( pStyleContext, "OPropertyImport::handleAttribute: do not know the style!" );
- // remember the element for later usage.
- m_pStyleElement = PTR_CAST( XMLTextStyleContext, pStyleContext );
+ const PropertyDescriptionList& rProperties( *pos );
+ const PropertyDescription* first = *rProperties.begin();
+ ENSURE_OR_BREAK( first != NULL, "OElementImport::handleAttribute: invalid property description!" );
+ const PPropertyHandler handler = (*first->factory)( first->propertyId );
+ ENSURE_OR_BREAK( handler.get() != NULL, "OElementImport::handleAttribute: invalid property handler!" );
+
+ PropertyValues aValues;
+ for ( PropertyDescriptionList::const_iterator propDesc = rProperties.begin();
+ propDesc != rProperties.end();
+ ++propDesc
+ )
+ {
+ aValues[ (*propDesc)->propertyId ] = Any();
+ }
+ if ( handler->getPropertyValues( _rValue, aValues ) )
+ {
+ for ( PropertyDescriptionList::const_iterator propDesc = rProperties.begin();
+ propDesc != rProperties.end();
+ ++propDesc
+ )
+ {
+ implPushBackPropertyValue( (*propDesc)->propertyName, aValues[ (*propDesc)->propertyId ] );
+ }
+ }
}
- else
- // let the base class handle it
- OPropertyImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ while ( false );
+
+ // handled
+ return true;
}
+ return false;
+ }
+
+ //---------------------------------------------------------------------
+ bool OElementImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ {
+ if ( token::IsXMLToken( _rLocalName, token::XML_CONTROL_IMPLEMENTATION ) )
+ // ignore this, it has already been handled in OElementImport::StartElement
+ return true;
+
+ if ( token::IsXMLToken( _rLocalName, token::XML_NAME ) )
+ {
+ if ( !m_sName.getLength() )
+ // remember the name for later use in EndElement
+ m_sName = _rValue;
+ return true;
+ }
+
+ // maybe it's the style attribute?
+ if ( token::IsXMLToken( _rLocalName, token::XML_TEXT_STYLE_NAME ) )
+ {
+ const SvXMLStyleContext* pStyleContext = m_rContext.getStyleElement( _rValue );
+ OSL_ENSURE( pStyleContext, "OElementImport::handleAttribute: do not know the style!" );
+ // remember the element for later usage.
+ m_pStyleElement = PTR_CAST( XMLTextStyleContext, pStyleContext );
+ return true;
+ }
+
+ if ( m_bImplicitGenericAttributeHandling )
+ if ( tryGenericAttribute( _nNamespaceKey, _rLocalName, _rValue ) )
+ return true;
+
+ // let the base class handle it
+ return OPropertyImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
}
//---------------------------------------------------------------------
@@ -553,7 +669,7 @@ namespace xmloff
{
::rtl::OUString sLocalAttrName = ::rtl::OUString::createFromAscii(_pAttributeName);
if ( !encounteredAttribute( sLocalAttrName ) )
- handleAttribute( XML_NAMESPACE_FORM, sLocalAttrName, ::rtl::OUString::createFromAscii( _pAttributeDefault ) );
+ OSL_VERIFY( handleAttribute( XML_NAMESPACE_FORM, sLocalAttrName, ::rtl::OUString::createFromAscii( _pAttributeDefault ) ) );
}
}
@@ -566,6 +682,7 @@ namespace xmloff
:OElementImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
,m_eElementType(OControlElement::UNKNOWN)
{
+ disableImplicitGenericAttributeHandling();
}
//---------------------------------------------------------------------
@@ -574,6 +691,38 @@ namespace xmloff
:OElementImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
,m_eElementType(_eType)
{
+ disableImplicitGenericAttributeHandling();
+ }
+
+ //---------------------------------------------------------------------
+ ::rtl::OUString OControlImport::determineDefaultServiceName() const
+ {
+ const sal_Char* pServiceName = NULL;
+ switch ( m_eElementType )
+ {
+ case OControlElement::TEXT:
+ case OControlElement::TEXT_AREA:
+ case OControlElement::PASSWORD: pServiceName = "com.sun.star.form.component.TextField"; break;
+ case OControlElement::FILE: pServiceName = "com.sun.star.form.component.FileControl"; break;
+ case OControlElement::FORMATTED_TEXT: pServiceName = "com.sun.star.form.component.FormattedField"; break;
+ case OControlElement::FIXED_TEXT: pServiceName = "com.sun.star.form.component.FixedText"; break;
+ case OControlElement::COMBOBOX: pServiceName = "com.sun.star.form.component.ComboBox"; break;
+ case OControlElement::LISTBOX: pServiceName = "com.sun.star.form.component.ListBox"; break;
+ case OControlElement::BUTTON: pServiceName = "com.sun.star.form.component.CommandButton"; break;
+ case OControlElement::IMAGE: pServiceName = "com.sun.star.form.component.ImageButton"; break;
+ case OControlElement::CHECKBOX: pServiceName = "com.sun.star.form.component.CheckBox"; break;
+ case OControlElement::RADIO: pServiceName = "com.sun.star.form.component.RadioButton"; break;
+ case OControlElement::FRAME: pServiceName = "com.sun.star.form.component.GroupBox"; break;
+ case OControlElement::IMAGE_FRAME: pServiceName = "com.sun.star.form.component.DatabaseImageControl"; break;
+ case OControlElement::HIDDEN: pServiceName = "com.sun.star.form.component.HiddenControl"; break;
+ case OControlElement::GRID: pServiceName = "com.sun.star.form.component.GridControl"; break;
+ case OControlElement::TIME: pServiceName = "com.sun.star.form.component.DateField"; break;
+ case OControlElement::DATE: pServiceName = "com.sun.star.form.component.TimeField"; break;
+ default: break;
+ }
+ if ( pServiceName != NULL )
+ return ::rtl::OUString::createFromAscii( pServiceName );
+ return ::rtl::OUString();
}
//---------------------------------------------------------------------
@@ -584,7 +733,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool OControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
static const sal_Char* pLinkedCellAttributeName = OAttributeMetaData::getBindingAttributeName(BA_LINKED_CELL);
@@ -601,66 +750,84 @@ namespace xmloff
m_sControlId = _rValue;
}
}
+ return true;
}
- else if ( _rLocalName.equalsAscii( pLinkedCellAttributeName ) )
+
+ if ( _rLocalName.equalsAscii( pLinkedCellAttributeName ) )
{ // it's the address of a spreadsheet cell
m_sBoundCellAddress = _rValue;
+ return true;
}
- else if ( _nNamespaceKey == XML_NAMESPACE_XFORMS && IsXMLToken( _rLocalName, XML_BIND ) )
+
+ if ( _nNamespaceKey == XML_NAMESPACE_XFORMS && IsXMLToken( _rLocalName, XML_BIND ) )
{
m_sBindingID = _rValue;
+ return true;
}
- else if ( _nNamespaceKey == XML_NAMESPACE_FORM && IsXMLToken( _rLocalName, XML_XFORMS_LIST_SOURCE ) )
+
+ if ( _nNamespaceKey == XML_NAMESPACE_FORM && IsXMLToken( _rLocalName, XML_XFORMS_LIST_SOURCE ) )
{
m_sListBindingID = _rValue;
+ return true;
}
- else if ( (_nNamespaceKey == XML_NAMESPACE_FORM && IsXMLToken( _rLocalName, XML_XFORMS_SUBMISSION ) ) ||
- ( _nNamespaceKey == XML_NAMESPACE_XFORMS && IsXMLToken( _rLocalName, XML_SUBMISSION ) ) )
+
+ if ( ( ( _nNamespaceKey == XML_NAMESPACE_FORM )
+ && IsXMLToken( _rLocalName, XML_XFORMS_SUBMISSION )
+ )
+ || ( ( _nNamespaceKey == XML_NAMESPACE_XFORMS )
+ && IsXMLToken( _rLocalName, XML_SUBMISSION )
+ )
+ )
{
m_sSubmissionID = _rValue;
+ return true;
}
- else
+
+ if ( OElementImport::tryGenericAttribute( _nNamespaceKey, _rLocalName, _rValue ) )
+ return true;
+
+ static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE);
+ static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_VALUE);
+ static const sal_Char* pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MIN_VALUE);
+ static const sal_Char* pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MAX_VALUE);
+ static const sal_Char* pRepeatDelayAttributeName = OAttributeMetaData::getSpecialAttributeName( SCA_REPEAT_DELAY );
+
+ sal_Int32 nHandle = -1;
+ if ( _rLocalName.equalsAscii( pValueAttributeName ) )
+ nHandle = PROPID_VALUE;
+ else if ( _rLocalName.equalsAscii( pCurrentValueAttributeName ) )
+ nHandle = PROPID_CURRENT_VALUE;
+ else if ( _rLocalName.equalsAscii( pMinValueAttributeName ) )
+ nHandle = PROPID_MIN_VALUE;
+ else if ( _rLocalName.equalsAscii( pMaxValueAttributeName ) )
+ nHandle = PROPID_MAX_VALUE;
+ if ( nHandle != -1 )
{
- static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE);
- static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_VALUE);
- static const sal_Char* pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MIN_VALUE);
- static const sal_Char* pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MAX_VALUE);
- static const sal_Char* pRepeatDelayAttributeName = OAttributeMetaData::getSpecialAttributeName( SCA_REPEAT_DELAY );
-
- sal_Int32 nHandle = -1;
- if ( _rLocalName.equalsAscii( pValueAttributeName ) )
- nHandle = PROPID_VALUE;
- else if ( _rLocalName.equalsAscii( pCurrentValueAttributeName ) )
- nHandle = PROPID_CURRENT_VALUE;
- else if ( _rLocalName.equalsAscii( pMinValueAttributeName ) )
- nHandle = PROPID_MIN_VALUE;
- else if ( _rLocalName.equalsAscii( pMaxValueAttributeName ) )
- nHandle = PROPID_MAX_VALUE;
- if ( nHandle != -1 )
+ // for the moment, simply remember the name and the value
+ PropertyValue aProp;
+ aProp.Name = _rLocalName;
+ aProp.Handle = nHandle;
+ aProp.Value <<= _rValue;
+ m_aValueProperties.push_back(aProp);
+ return true;
+ }
+
+ if ( _rLocalName.equalsAscii( pRepeatDelayAttributeName ) )
+ {
+ ::Time aTime;
+ sal_Int32 nFractions = 0;
+ if ( SvXMLUnitConverter::convertTimeDuration( _rValue, aTime, &nFractions ) )
{
- // for the moment, simply remember the name and the value
PropertyValue aProp;
- aProp.Name = _rLocalName;
- aProp.Handle = nHandle;
- aProp.Value <<= _rValue;
- m_aValueProperties.push_back(aProp);
- }
- else if ( _rLocalName.equalsAscii( pRepeatDelayAttributeName ) )
- {
- ::Time aTime;
- sal_Int32 nFractions = 0;
- if ( SvXMLUnitConverter::convertTimeDuration( _rValue, aTime, &nFractions ) )
- {
- PropertyValue aProp;
- aProp.Name = PROPERTY_REPEAT_DELAY;
- aProp.Value <<= (sal_Int32)( ( ( aTime.GetMSFromTime() / 1000 ) * 1000 ) + nFractions );
+ aProp.Name = PROPERTY_REPEAT_DELAY;
+ aProp.Value <<= (sal_Int32)( ( ( aTime.GetMSFromTime() / 1000 ) * 1000 ) + nFractions );
- implPushBackPropertyValue(aProp);
- }
+ implPushBackPropertyValue(aProp);
}
- else
- OElementImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ return true;
}
+
+ return OElementImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
}
//---------------------------------------------------------------------
@@ -713,6 +880,7 @@ namespace xmloff
++aValueProps
)
{
+ bool bSuccess = false;
switch (aValueProps->Handle)
{
case PROPID_VALUE:
@@ -722,6 +890,7 @@ namespace xmloff
if (!bRetrievedValues)
{
getValuePropertyNames(m_eElementType, nClassId, pCurrentValueProperty, pValueProperty);
+ ENSURE_OR_BREAK( pCurrentValueProperty && pValueProperty, "OControlImport::StartElement: illegal value property names!" );
bRetrievedValues = sal_True;
}
OSL_ENSURE((PROPID_VALUE != aValueProps->Handle) || pValueProperty,
@@ -734,6 +903,7 @@ namespace xmloff
aValueProps->Name = ::rtl::OUString::createFromAscii(pValueProperty);
else
aValueProps->Name = ::rtl::OUString::createFromAscii(pCurrentValueProperty);
+ bSuccess = true;
}
break;
case PROPID_MIN_VALUE:
@@ -743,6 +913,7 @@ namespace xmloff
if (!bRetrievedValueLimits)
{
getValueLimitPropertyNames(nClassId, pMinValueProperty, pMaxValueProperty);
+ ENSURE_OR_BREAK( pMinValueProperty && pMaxValueProperty, "OControlImport::StartElement: illegal value limit property names!" );
bRetrievedValueLimits = sal_True;
}
OSL_ENSURE((PROPID_MIN_VALUE != aValueProps->Handle) || pMinValueProperty,
@@ -755,10 +926,14 @@ namespace xmloff
aValueProps->Name = ::rtl::OUString::createFromAscii(pMinValueProperty);
else
aValueProps->Name = ::rtl::OUString::createFromAscii(pMaxValueProperty);
+ bSuccess = true;
}
break;
}
+ if ( !bSuccess )
+ continue;
+
// translate the value
implTranslateValueProperty(m_xInfo, *aValueProps);
// add the property to the base class' array
@@ -980,7 +1155,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OImagePositionImport::handleAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName,
+ bool OImagePositionImport::handleAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue )
{
if ( _rLocalName == GetXMLToken( XML_IMAGE_POSITION ) )
@@ -990,16 +1165,19 @@ namespace xmloff
_rValue, OEnumMapper::getEnumMap( OEnumMapper::epImagePosition )
) >>= m_nImagePosition );
m_bHaveImagePosition = sal_True;
+ return true;
}
- else if ( _rLocalName == GetXMLToken( XML_IMAGE_ALIGN ) )
+
+ if ( _rLocalName == GetXMLToken( XML_IMAGE_ALIGN ) )
{
OSL_VERIFY( PropertyConversion::convertString(
m_rContext.getGlobalContext(), ::getCppuType( &m_nImageAlign ),
_rValue, OEnumMapper::getEnumMap( OEnumMapper::epImageAlign )
) >>= m_nImageAlign );
+ return true;
}
- else
- OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
+
+ return OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
}
//---------------------------------------------------------------------
@@ -1047,14 +1225,16 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OReferredControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName,
+ bool OReferredControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue)
{
static const ::rtl::OUString s_sReferenceAttributeName = ::rtl::OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_FOR));
if (_rLocalName == s_sReferenceAttributeName)
+ {
m_sReferringControls = _rValue;
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ return true;
+ }
+ return OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
}
//=====================================================================
@@ -1068,7 +1248,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OPasswordImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool OPasswordImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
static const ::rtl::OUString s_sEchoCharAttributeName = ::rtl::OUString::createFromAscii(OAttributeMetaData::getSpecialAttributeName(SCA_ECHO_CHAR));
if (_rLocalName == s_sEchoCharAttributeName)
@@ -1083,9 +1263,9 @@ namespace xmloff
else
aEchoChar.Value <<= (sal_Int16)0;
implPushBackPropertyValue(aEchoChar);
+ return true;
}
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ return OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
}
//=====================================================================
@@ -1099,7 +1279,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void ORadioImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool ORadioImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
// need special handling for the State & CurrentState properties:
// they're stored as booleans, but expected to be int16 properties
@@ -1122,9 +1302,9 @@ namespace xmloff
implPushBackPropertyValue(aNewValue);
}
+ return true;
}
- else
- OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
+ return OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
}
//=====================================================================
@@ -1138,7 +1318,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OURLReferenceImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool OURLReferenceImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
static const sal_Char* s_pTargetLocationAttributeName = OAttributeMetaData::getCommonControlAttributeName( CCA_TARGET_LOCATION );
static const sal_Char* s_pImageDataAttributeName = OAttributeMetaData::getCommonControlAttributeName( CCA_IMAGE_DATA );
@@ -1157,18 +1337,18 @@ namespace xmloff
if ( bMakeAbsolute && ( _rValue.getLength() > 0 ) )
{
// make a global URL out of the local one
- ::rtl::OUString sAdjustedValue;
- // only resolve image related url
- // we don't want say form url targets to be resolved
- // using ResolveGraphicObjectURL
- if ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
- sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE );
- else
- sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
- OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
+ ::rtl::OUString sAdjustedValue;
+ // only resolve image related url
+ // we don't want say form url targets to be resolved
+ // using ResolveGraphicObjectURL
+ if ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
+ sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE );
+ else
+ sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
+ return OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
}
- else
- OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
+
+ return OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
}
//=====================================================================
@@ -1205,14 +1385,14 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OValueRangeImport::handleAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue )
+ bool OValueRangeImport::handleAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue )
{
if ( _rLocalName.equalsAscii( OAttributeMetaData::getSpecialAttributeName( SCA_STEP_SIZE ) ) )
{
GetImport().GetMM100UnitConverter().convertNumber( m_nStepSizeValue, _rValue );
+ return true;
}
- else
- OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
+ return OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
}
//---------------------------------------------------------------------
@@ -1535,7 +1715,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OListAndComboImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool OListAndComboImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
static const sal_Char* pListSourceAttributeName = OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE);
if ( _rLocalName.equalsAscii(pListSourceAttributeName) )
@@ -1560,12 +1740,16 @@ namespace xmloff
}
implPushBackPropertyValue( aListSource );
+ return true;
}
- else if ( _rLocalName.equalsAscii( OAttributeMetaData::getBindingAttributeName( BA_LIST_CELL_RANGE ) ) )
+
+ if ( _rLocalName.equalsAscii( OAttributeMetaData::getBindingAttributeName( BA_LIST_CELL_RANGE ) ) )
{
m_sCellListSource = _rValue;
+ return true;
}
- else if ( _rLocalName.equalsAscii( OAttributeMetaData::getBindingAttributeName( BA_LIST_LINKING_TYPE ) ) )
+
+ if ( _rLocalName.equalsAscii( OAttributeMetaData::getBindingAttributeName( BA_LIST_LINKING_TYPE ) ) )
{
sal_Int16 nLinkageType = 0;
PropertyConversion::convertString(
@@ -1576,9 +1760,10 @@ namespace xmloff
) >>= nLinkageType;
m_bLinkWithIndexes = ( nLinkageType != 0 );
+ return true;
}
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+
+ return OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
}
//---------------------------------------------------------------------
@@ -1776,7 +1961,9 @@ namespace xmloff
|| (OControlElement::FORMATTED_TEXT == _eType)
|| (OControlElement::CHECKBOX == _eType)
|| (OControlElement::LISTBOX == _eType)
- || (OControlElement::COMBOBOX == _eType),
+ || (OControlElement::COMBOBOX == _eType)
+ || (OControlElement::TIME == _eType)
+ || (OControlElement::DATE == _eType),
"OColumnWrapperImport::implCreateChildContext: invalid or unrecognized sub element!");
switch (_eType)
@@ -1871,19 +2058,25 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OFormImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ bool OFormImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
// handle the master/details field attributes (they're way too special to let the OPropertyImport handle them)
static const ::rtl::OUString s_sMasterFieldsAttributeName = ::rtl::OUString::createFromAscii(OAttributeMetaData::getFormAttributeName(faMasterFields));
static const ::rtl::OUString s_sDetailFieldsAttributeName = ::rtl::OUString::createFromAscii(OAttributeMetaData::getFormAttributeName(faDetailFiels));
- if (s_sMasterFieldsAttributeName == _rLocalName)
+ if ( s_sMasterFieldsAttributeName == _rLocalName )
+ {
implTranslateStringListProperty(PROPERTY_MASTERFIELDS, _rValue);
- else if (s_sDetailFieldsAttributeName == _rLocalName)
+ return true;
+ }
+
+ if ( s_sDetailFieldsAttributeName == _rLocalName )
+ {
implTranslateStringListProperty(PROPERTY_DETAILFIELDS, _rValue);
+ return true;
+ }
- else
- OFormImport_Base::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ return OFormImport_Base::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
}
//---------------------------------------------------------------------
diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx
index 97eb2ec950d3..3b604c752595 100644
--- a/xmloff/source/forms/elementimport.hxx
+++ b/xmloff/source/forms/elementimport.hxx
@@ -31,6 +31,9 @@
#include "propertyimport.hxx"
#include "controlelement.hxx"
#include "valueproperties.hxx"
+#include "eventimport.hxx"
+#include "logging.hxx"
+#include "property_description.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/text/XTextCursor.hpp>
@@ -39,9 +42,8 @@
#include <com/sun/star/form/XGridColumnFactory.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
/** === end UNO includes === **/
+
#include <comphelper/stl_types.hxx>
-#include "eventimport.hxx"
-#include "logging.hxx"
class XMLTextStyleContext;
//.........................................................................
@@ -83,22 +85,25 @@ namespace xmloff
,public OStackedLogging
{
protected:
- ::rtl::OUString m_sServiceName; // the service name as extracted from the service-name attribute
- ::rtl::OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
+ ::rtl::OUString m_sServiceName; // the service name as extracted from the service-name attribute
+ ::rtl::OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
OFormLayerXMLImport_Impl& m_rFormImport; // the form import context
- IEventAttacherManager& m_rEventManager; // the event attacher manager
+ IEventAttacherManager& m_rEventManager; // the event attacher manager
const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered
// while reading our element
+ /// the parent container to insert the new element into
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- m_xParentContainer;
- // the parent container to insert the new element into
+ m_xParentContainer;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- m_xInfo;
+ /// the element we're creating. Valid after StartElement
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- m_xElement; // the element we're creating. Valid after StartElement
+ m_xElement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ m_xInfo;
+
+ bool m_bImplicitGenericAttributeHandling;
public:
/** ctor
@@ -132,7 +137,7 @@ namespace xmloff
virtual void EndElement();
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
@@ -158,13 +163,28 @@ namespace xmloff
*/
void simulateDefaultedAttribute(const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName, const sal_Char* _pAttributeDefault);
+ /** to be called from within handleAttribute, checks whether the given attribute is covered by our generic
+ attribute handler mechanisms
+ */
+ bool tryGenericAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue );
+
+ /** controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class
+ must do this explicitly at a suitable place in its own |handleAttribute|
+ */
+ void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; }
+
private:
::rtl::OUString implGetDefaultName() const;
- void implImportGenericProperties();
+ void implApplyGenericProperties();
+ void implApplySpecificProperties();
/** sets the style properties which have been read for the element (if any)
*/
void implSetStyleProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
+
+ PropertyGroups::const_iterator impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const;
+
+ virtual ::rtl::OUString determineDefaultServiceName() const;
};
//=====================================================================
@@ -225,7 +245,7 @@ namespace xmloff
virtual void EndElement();
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
@@ -239,6 +259,8 @@ namespace xmloff
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
::com::sun::star::beans::PropertyValue& /* [in/out] */ _rPropValue);
+ virtual ::rtl::OUString determineDefaultServiceName() const;
+
/** registers the given cell address as value binding address for our element
<p>The default implementation simply calls registerCellValueBinding at our import
@@ -265,7 +287,6 @@ namespace xmloff
// OElementImport overridables
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
createElement();
-
};
// TODO:
@@ -295,7 +316,7 @@ namespace xmloff
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
// OPropertyImport overridables
- virtual void handleAttribute( sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue
);
@@ -321,7 +342,7 @@ namespace xmloff
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
};
@@ -339,7 +360,7 @@ namespace xmloff
);
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
};
@@ -358,7 +379,7 @@ namespace xmloff
protected:
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
};
@@ -380,7 +401,7 @@ namespace xmloff
protected:
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
};
@@ -430,7 +451,7 @@ namespace xmloff
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList );
// OPropertyImport overridables
- virtual void handleAttribute( sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue );
};
@@ -516,7 +537,7 @@ namespace xmloff
virtual void EndElement();
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
@@ -715,7 +736,7 @@ namespace xmloff
sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName);
// OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
diff --git a/xmloff/source/forms/form_handler_factory.hxx b/xmloff/source/forms/form_handler_factory.hxx
new file mode 100755
index 000000000000..62bf94f74aa8
--- /dev/null
+++ b/xmloff/source/forms/form_handler_factory.hxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_FORM_HANDLER_FACTORY_HXX
+#define XMLOFF_FORM_HANDLER_FACTORY_HXX
+
+#include "property_handler.hxx"
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= FormHandlerFactory
+ //==================================================================================================================
+ class FormHandlerFactory
+ {
+ public:
+ static PPropertyHandler getFormPropertyHandler( const PropertyId i_propertyId );
+ };
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_FORM_HANDLER_FACTORY_HXX
diff --git a/xmloff/source/forms/handler/form_handler_factory.cxx b/xmloff/source/forms/handler/form_handler_factory.cxx
new file mode 100755
index 000000000000..ccf829d4201f
--- /dev/null
+++ b/xmloff/source/forms/handler/form_handler_factory.cxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_xmloff.hxx"
+
+#include "form_handler_factory.hxx"
+#include "vcl_date_handler.hxx"
+#include "vcl_time_handler.hxx"
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ namespace
+ {
+ static PPropertyHandler s_pVCLDateHandler = NULL;
+ static PPropertyHandler s_pVCLTimeHandler = NULL;
+ }
+
+ //==================================================================================================================
+ //= FormHandlerFactory
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ PPropertyHandler FormHandlerFactory::getFormPropertyHandler( const PropertyId i_propertyId )
+ {
+ PPropertyHandler pHandler( NULL );
+
+ switch ( i_propertyId )
+ {
+ case PID_DATE_MIN:
+ case PID_DATE_MAX:
+ case PID_DEFAULT_DATE:
+ case PID_DATE:
+ if ( s_pVCLDateHandler.get() == NULL )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( s_pVCLDateHandler == NULL )
+ s_pVCLDateHandler = new VCLDateHandler();
+ }
+ pHandler = s_pVCLDateHandler;
+ break;
+
+ case PID_TIME_MIN:
+ case PID_TIME_MAX:
+ case PID_DEFAULT_TIME:
+ case PID_TIME:
+ if ( s_pVCLTimeHandler.get() == NULL )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( s_pVCLTimeHandler == NULL )
+ s_pVCLTimeHandler = new VCLTimeHandler();
+ }
+ pHandler = s_pVCLTimeHandler;
+ break;
+
+ default:
+ OSL_ENSURE( false, "FormHandlerFactory::getFormPropertyHandler: unknown property ID!" );
+ break;
+ }
+
+ return pHandler;
+ }
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
diff --git a/xmloff/source/forms/handler/makefile.mk b/xmloff/source/forms/handler/makefile.mk
new file mode 100755
index 000000000000..574537ffd474
--- /dev/null
+++ b/xmloff/source/forms/handler/makefile.mk
@@ -0,0 +1,55 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=../../..
+
+PRJNAME=xmloff
+TARGET=form_handlers
+
+INCEXT=..
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE: $(PRJ)/util/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = \
+ $(SLO)/form_handler_factory.obj \
+ $(SLO)/property_handler_base.obj \
+ $(SLO)/vcl_date_handler.obj \
+ $(SLO)/vcl_time_handler.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+test:
+ echo $(INCLUDE) \ No newline at end of file
diff --git a/xmloff/source/forms/handler/property_handler_base.cxx b/xmloff/source/forms/handler/property_handler_base.cxx
new file mode 100755
index 000000000000..d599e0e259fe
--- /dev/null
+++ b/xmloff/source/forms/handler/property_handler_base.cxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_xmloff.hxx"
+
+#include "property_handler_base.hxx"
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= PropertyHandlerBase
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ PropertyHandlerBase::~PropertyHandlerBase()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount SAL_CALL PropertyHandlerBase::acquire()
+ {
+ return osl_incrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount SAL_CALL PropertyHandlerBase::release()
+ {
+ oslInterlockedCount decremented = osl_decrementInterlockedCount( &m_refCount );
+ if ( 0 == decremented )
+ delete this;
+ return decremented;
+ }
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
diff --git a/xmloff/source/forms/handler/property_handler_base.hxx b/xmloff/source/forms/handler/property_handler_base.hxx
new file mode 100755
index 000000000000..10adceaa52aa
--- /dev/null
+++ b/xmloff/source/forms/handler/property_handler_base.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_PROPERTY_HANDLER_BASE_HXX
+#define XMLOFF_PROPERTY_HANDLER_BASE_HXX
+
+#include "property_handler.hxx"
+
+#include <osl/interlck.h>
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= PropertyHandlerBase
+ //==================================================================================================================
+ class PropertyHandlerBase : public IPropertyHandler
+ {
+ protected:
+ PropertyHandlerBase()
+ :m_refCount( 0 )
+ {
+ }
+
+ virtual ~PropertyHandlerBase();
+
+ // IReference
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_PROPERTY_HANDLER_BASE_HXX
diff --git a/xmloff/source/forms/handler/vcl_date_handler.cxx b/xmloff/source/forms/handler/vcl_date_handler.cxx
new file mode 100755
index 000000000000..a8404ed04e05
--- /dev/null
+++ b/xmloff/source/forms/handler/vcl_date_handler.cxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_xmloff.hxx"
+
+#include "vcl_date_handler.hxx"
+#include "xmloff/xmluconv.hxx"
+
+#include <com/sun/star/util/DateTime.hpp>
+
+#include <tools/diagnose_ex.h>
+#include <tools/date.hxx>
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::util::DateTime;
+
+ //==================================================================================================================
+ //= VCLDateHandler
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ VCLDateHandler::VCLDateHandler()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString VCLDateHandler::getAttributeValue( const PropertyValues& /*i_propertyValues*/ ) const
+ {
+ OSL_ENSURE( false, "VCLDateHandler::getAttributeValue: unexpected call!" );
+ return ::rtl::OUString();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString VCLDateHandler::getAttributeValue( const Any& i_propertyValue ) const
+ {
+ sal_Int32 nVCLDate(0);
+ OSL_VERIFY( i_propertyValue >>= nVCLDate );
+ ::Date aVCLDate( nVCLDate );
+
+ DateTime aDateTime; // default-inited to 0
+ aDateTime.Day = aVCLDate.GetDay();
+ aDateTime.Month = aVCLDate.GetMonth();
+ aDateTime.Year = aVCLDate.GetYear();
+
+ ::rtl::OUStringBuffer aBuffer;
+ SvXMLUnitConverter::convertDateTime( aBuffer, aDateTime, sal_False );
+ return aBuffer.makeStringAndClear();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool VCLDateHandler::getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const
+ {
+ sal_Int32 nVCLDate(0);
+
+ DateTime aDateTime;
+ if ( SvXMLUnitConverter::convertDateTime( aDateTime, i_attributeValue ) )
+ {
+ ::Date aVCLDate( aDateTime.Day, aDateTime.Month, aDateTime.Year );
+ nVCLDate = aVCLDate.GetDate();
+ }
+ else
+ {
+ // compatibility format, before we wrote those values in XML-schema compatible form
+ if ( !SvXMLUnitConverter::convertNumber( nVCLDate, i_attributeValue ) )
+ {
+ OSL_ENSURE( false, "VCLDateHandler::getPropertyValues: unknown date format (no XML-schema date, no legacy integer)!" );
+ return false;
+ }
+ }
+
+ const Any aPropertyValue( makeAny( nVCLDate ) );
+
+ OSL_ENSURE( o_propertyValues.size() == 1, "VCLDateHandler::getPropertyValues: date strings represent exactly one property - not more, not less!" );
+ for ( PropertyValues::iterator prop = o_propertyValues.begin();
+ prop != o_propertyValues.end();
+ ++prop
+ )
+ {
+ prop->second = aPropertyValue;
+ }
+ return true;
+ }
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
diff --git a/xmloff/source/forms/handler/vcl_date_handler.hxx b/xmloff/source/forms/handler/vcl_date_handler.hxx
new file mode 100755
index 000000000000..44a7f7395ceb
--- /dev/null
+++ b/xmloff/source/forms/handler/vcl_date_handler.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_VCL_DATE_HANDLER_HXX
+#define XMLOFF_VCL_DATE_HANDLER_HXX
+
+#include "property_handler_base.hxx"
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= VCLDateHandler
+ //==================================================================================================================
+ class VCLDateHandler : public PropertyHandlerBase
+ {
+ public:
+ VCLDateHandler();
+
+ // IPropertyHandler
+ virtual ::rtl::OUString getAttributeValue( const PropertyValues& i_propertyValues ) const;
+ virtual ::rtl::OUString getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const;
+ virtual bool getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const;
+ };
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_VCL_DATE_HANDLER_HXX
diff --git a/xmloff/source/forms/handler/vcl_time_handler.cxx b/xmloff/source/forms/handler/vcl_time_handler.cxx
new file mode 100755
index 000000000000..98ea739d04a4
--- /dev/null
+++ b/xmloff/source/forms/handler/vcl_time_handler.cxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_xmloff.hxx"
+
+#include "vcl_time_handler.hxx"
+#include "xmloff/xmluconv.hxx"
+
+#include <com/sun/star/util/DateTime.hpp>
+
+#include <tools/diagnose_ex.h>
+#include <tools/time.hxx>
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::util::DateTime;
+
+ //==================================================================================================================
+ //= VCLTimeHandler
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ VCLTimeHandler::VCLTimeHandler()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString VCLTimeHandler::getAttributeValue( const PropertyValues& /*i_propertyValues*/ ) const
+ {
+ OSL_ENSURE( false, "VCLTimeHandler::getAttributeValue: unexpected call!" );
+ return ::rtl::OUString();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString VCLTimeHandler::getAttributeValue( const Any& i_propertyValue ) const
+ {
+ sal_Int32 nVCLTime(0);
+ OSL_VERIFY( i_propertyValue >>= nVCLTime );
+ ::Time aVCLTime( nVCLTime );
+
+ DateTime aDateTime; // default-inited to 0
+ aDateTime.Hours = aVCLTime.GetHour();
+ aDateTime.Minutes = aVCLTime.GetMin();
+ aDateTime.Seconds = aVCLTime.GetSec();
+ aDateTime.HundredthSeconds = aVCLTime.Get100Sec();
+
+ ::rtl::OUStringBuffer aBuffer;
+ SvXMLUnitConverter::convertTime( aBuffer, aDateTime );
+ return aBuffer.makeStringAndClear();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool VCLTimeHandler::getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const
+ {
+ sal_Int32 nVCLTime(0);
+
+ DateTime aDateTime;
+ if ( SvXMLUnitConverter::convertTime( aDateTime, i_attributeValue ) )
+ {
+ ::Time aVCLTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.HundredthSeconds );
+ nVCLTime = aVCLTime.GetTime();
+ }
+ else
+ {
+ // compatibility format, before we wrote those values in XML-schema compatible form
+ if ( !SvXMLUnitConverter::convertNumber( nVCLTime, i_attributeValue ) )
+ {
+ OSL_ENSURE( false, "VCLTimeHandler::getPropertyValues: unknown time format (no XML-schema time, no legacy integer)!" );
+ return false;
+ }
+ }
+
+ const Any aPropertyValue( makeAny( nVCLTime ) );
+
+ OSL_ENSURE( o_propertyValues.size() == 1, "VCLTimeHandler::getPropertyValues: time strings represent exactly one property - not more, not less!" );
+ for ( PropertyValues::iterator prop = o_propertyValues.begin();
+ prop != o_propertyValues.end();
+ ++prop
+ )
+ {
+ prop->second = aPropertyValue;
+ }
+ return true;
+ }
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
diff --git a/xmloff/source/forms/handler/vcl_time_handler.hxx b/xmloff/source/forms/handler/vcl_time_handler.hxx
new file mode 100755
index 000000000000..7ed6f0aa5730
--- /dev/null
+++ b/xmloff/source/forms/handler/vcl_time_handler.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_VCL_TIME_HANDLER_HXX
+#define XMLOFF_VCL_TIME_HANDLER_HXX
+
+#include "property_handler_base.hxx"
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= VCLTimeHandler
+ //==================================================================================================================
+ class VCLTimeHandler : public PropertyHandlerBase
+ {
+ public:
+ VCLTimeHandler();
+
+ // IPropertyHandler
+ virtual ::rtl::OUString getAttributeValue( const PropertyValues& i_propertyValues ) const;
+ virtual ::rtl::OUString getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const;
+ virtual bool getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const;
+ };
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_VCL_TIME_HANDLER_HXX
diff --git a/xmloff/source/forms/makefile.mk b/xmloff/source/forms/makefile.mk
index 8c46a4fbf3c9..fa2a6ea7d235 100644
--- a/xmloff/source/forms/makefile.mk
+++ b/xmloff/source/forms/makefile.mk
@@ -64,6 +64,8 @@ SLOFILES = \
$(SLO)$/logging.obj \
$(SLO)$/formcellbinding.obj \
$(SLO)$/gridcolumnproptranslator.obj \
+ \
+ $(SLO)/property_meta_data.obj
# --- Tagets -------------------------------------------------------
diff --git a/xmloff/source/forms/property_description.hxx b/xmloff/source/forms/property_description.hxx
new file mode 100755
index 000000000000..8e9aa9cb616e
--- /dev/null
+++ b/xmloff/source/forms/property_description.hxx
@@ -0,0 +1,140 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_PROPERTY_DESCRIPTION_HXX
+#define XMLOFF_PROPERTY_DESCRIPTION_HXX
+
+#include "property_handler.hxx"
+#include "property_group.hxx"
+
+#include "xmloff/xmltoken.hxx"
+
+#include <vector>
+#include <list>
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= PropertyDescription
+ //==================================================================================================================
+ struct AttributeDescription
+ {
+ sal_uInt16 namespacePrefix; // usually XML_NAMESPACE_FORM
+ ::xmloff::token::XMLTokenEnum attributeToken;
+
+ AttributeDescription()
+ :namespacePrefix( 0 )
+ ,attributeToken( ::xmloff::token::XML_TOKEN_INVALID )
+ {
+ }
+
+ AttributeDescription(
+ const sal_uInt16 i_namespacePrefix,
+ const ::xmloff::token::XMLTokenEnum i_attributeToken
+ )
+ :namespacePrefix( i_namespacePrefix )
+ ,attributeToken( i_attributeToken )
+ {
+ }
+ };
+
+ //..................................................................................................................
+ inline bool operator==( const AttributeDescription& i_lhs, const AttributeDescription& i_rhs )
+ {
+ return ( i_lhs.namespacePrefix == i_rhs.namespacePrefix )
+ && ( i_lhs.attributeToken == i_rhs.attributeToken );
+ }
+
+ //==================================================================================================================
+ //= PropertyDescription
+ //==================================================================================================================
+ struct PropertyDescription
+ {
+ /// is the name of the property
+ const ::rtl::OUString propertyName;
+ /** denotes the attribute which represents the property. Note that multiple properties might comprise a single
+ attribute value.
+ */
+ const AttributeDescription attribute;
+ /// is the factory for creating a handler for reading and writing the property
+ const PropertyHandlerFactory factory;
+ /// the unique ID of the property. The property meta data table must not contain two entries with the same property ID
+ const PropertyId propertyId;
+ /** the group which the property belongs to. Multiple properties belonging to the same group will, all together,
+ define the attribute value to be written into the ODF file.
+
+ Consequently, properties which have the same |propertyGroup| value must also have the same |attribute|
+ and the same |factory| value, with the only exception being NO_GROUP properties.
+
+ Note that the other direction is not given: It is perfectly legitimate to map the same attribute to different
+ (disjunct) property groups.
+ */
+ const PropertyGroup propertyGroup;
+
+ PropertyDescription()
+ :propertyName()
+ ,attribute()
+ ,factory( NULL )
+ ,propertyId( PID_INVALID )
+ ,propertyGroup( NO_GROUP )
+ {
+ }
+
+ PropertyDescription(
+ const ::rtl::OUString& i_propertyName,
+ const sal_uInt16 i_namespacePrefix,
+ const ::xmloff::token::XMLTokenEnum i_attributeToken,
+ const PropertyHandlerFactory i_factory,
+ const PropertyId i_propertyId,
+ const PropertyGroup i_propertyGroup
+ )
+ :propertyName( i_propertyName )
+ ,attribute( i_namespacePrefix, i_attributeToken )
+ ,factory( i_factory )
+ ,propertyId( i_propertyId )
+ ,propertyGroup( i_propertyGroup )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= PropertyDescriptionList
+ //==================================================================================================================
+ typedef ::std::vector< const PropertyDescription* > PropertyDescriptionList;
+
+ //==================================================================================================================
+ //= PropertyGroups
+ //==================================================================================================================
+ typedef ::std::list< PropertyDescriptionList > PropertyGroups;
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_PROPERTY_DESCRIPTION_HXX
diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc b/xmloff/source/forms/property_group.hxx
index 69794e3a76bc..bca354f14e92 100644..100755
--- a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc
+++ b/xmloff/source/forms/property_group.hxx
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -24,25 +23,25 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef DBU_EXTENSIONNOTPRESENT_HRC
-#define DBU_EXTENSIONNOTPRESENT_HRC
-#define FT_TEXT (1)
-#define FI_WARNING (2)
-#define PB_DOWNLOAD (10)
-#define PB_CANCEL (11)
+#ifndef XMLOFF_PROPERTY_GROUP_HXX
+#define XMLOFF_PROPERTY_GROUP_HXX
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
-#define FIXEDTEXT_HEIGHT 8
-#define CELL_PADDING 8
-#define BUTTON_HEIGHT 14
-#define BUTTON_WIDTH 55
-#define BROWSER_HEIGHT 75
-// #define PAGE_WIDTH ( CELL_PADDING + BUTTON_WIDTH + CELL_PADDING + BUTTON_WIDTH + CELL_PADDING)
-#define LEFT_PADDING 32 /* size for the icon */
-#define RIGHT_PADDING 16
-#define DLG_WIDTH ( 250 )
-#define ACTION_LINE_START (CELL_PADDING + ( 3 * FIXEDTEXT_HEIGHT ) + 2 * CELL_PADDING + 1 )
-#define DLG_HEIGHT (ACTION_LINE_START + BUTTON_HEIGHT + CELL_PADDING)
+ //==================================================================================================================
+ //= PropertyGroup
+ //==================================================================================================================
+ enum PropertyGroup
+ {
+ NO_GROUP
+ };
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
-#endif /* DBU_EXTENSIONNOTPRESENT_HRC */
+#endif // XMLOFF_PROPERTY_GROUP_HXX
diff --git a/xmloff/source/forms/property_handler.hxx b/xmloff/source/forms/property_handler.hxx
new file mode 100755
index 000000000000..247b4f17f798
--- /dev/null
+++ b/xmloff/source/forms/property_handler.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_PROPERTY_HANDLER_HXX
+#define XMLOFF_PROPERTY_HANDLER_HXX
+
+#include "property_ids.hxx"
+
+#include <com/sun/star/uno/Any.hxx>
+
+#include <rtl/ref.hxx>
+
+#include <map>
+#include <vector>
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ typedef ::std::map< PropertyId, ::com::sun::star::uno::Any > PropertyValues;
+
+ //==================================================================================================================
+ //= IPropertyHandler
+ //==================================================================================================================
+ class IPropertyHandler : public ::rtl::IReference
+ {
+ public:
+ /** retrieves the XML attribute value for the given property values
+ */
+ virtual ::rtl::OUString
+ getAttributeValue( const PropertyValues& i_propertyValues ) const = 0;
+
+ /** is a convenience method for XML attributes whose value comprises of only one UNO API property
+ */
+ virtual ::rtl::OUString
+ getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const = 0;
+
+ /** retrieves the values of the properties controlled by an XML attributed, described by a given attribute value
+ */
+ virtual bool
+ getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const = 0;
+
+ virtual ~IPropertyHandler() { }
+ };
+
+ //==================================================================================================================
+ //= PPropertyHandler
+ //==================================================================================================================
+ typedef ::rtl::Reference< IPropertyHandler > PPropertyHandler;
+
+ //==================================================================================================================
+ //= PropertyHandlerFactory
+ //==================================================================================================================
+ typedef PPropertyHandler (*PropertyHandlerFactory)( const PropertyId i_propertyId );
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_PROPERTY_HANDLER_HXX
diff --git a/xmloff/source/forms/property_ids.hxx b/xmloff/source/forms/property_ids.hxx
new file mode 100755
index 000000000000..31004f2d9ff2
--- /dev/null
+++ b/xmloff/source/forms/property_ids.hxx
@@ -0,0 +1,56 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_PROPERTY_IDS_HXX
+#define XMLOFF_PROPERTY_IDS_HXX
+
+//......................................................................................................................
+namespace xmloff
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= PropertyId
+ //==================================================================================================================
+ enum PropertyId
+ {
+ PID_DATE_MIN,
+ PID_DATE_MAX,
+ PID_DEFAULT_DATE,
+ PID_DATE,
+ PID_TIME_MIN,
+ PID_TIME_MAX,
+ PID_DEFAULT_TIME,
+ PID_TIME,
+
+ PID_INVALID
+ };
+
+//......................................................................................................................
+} // namespace xmloff
+//......................................................................................................................
+
+#endif // XMLOFF_PROPERTY_IDS_HXX
diff --git a/xmloff/source/forms/property_meta_data.cxx b/xmloff/source/forms/property_meta_data.cxx
new file mode 100755
index 000000000000..7f058d14b9b7
--- /dev/null
+++ b/xmloff/source/forms/property_meta_data.cxx
@@ -0,0 +1,270 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_xmloff.hxx"
+
+#include "property_description.hxx"
+#include "form_handler_factory.hxx"
+#include "strings.hxx"
+#include "xmloff/xmltoken.hxx"
+#include "xmlnmspe.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <tools/debug.hxx>
+
+#include <hash_map>
+
+//......................................................................................................................
+namespace xmloff { namespace metadata
+{
+//......................................................................................................................
+
+ using namespace ::xmloff::token;
+
+#define FORM_SINGLE_PROPERTY( id, att ) \
+ PropertyDescription( PROPERTY_##id, XML_NAMESPACE_FORM, att, &FormHandlerFactory::getFormPropertyHandler, PID_##id, NO_GROUP )
+
+ //==================================================================================================================
+ //= property meta data
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ const PropertyDescription* lcl_getPropertyMetaData()
+ {
+ static const PropertyDescription s_propertyMetaData[] =
+ {
+ FORM_SINGLE_PROPERTY( DATE_MIN, XML_MIN_VALUE ),
+ FORM_SINGLE_PROPERTY( DATE_MAX, XML_MAX_VALUE ),
+ FORM_SINGLE_PROPERTY( DEFAULT_DATE, XML_VALUE ),
+ FORM_SINGLE_PROPERTY( DATE, XML_CURRENT_VALUE ),
+ FORM_SINGLE_PROPERTY( TIME_MIN, XML_MIN_VALUE ),
+ FORM_SINGLE_PROPERTY( TIME_MAX, XML_MAX_VALUE ),
+ FORM_SINGLE_PROPERTY( DEFAULT_TIME, XML_VALUE ),
+ FORM_SINGLE_PROPERTY( TIME, XML_CURRENT_VALUE ),
+
+ PropertyDescription()
+ };
+ return s_propertyMetaData;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ // TODO: instead of having all of the below static, it should be some per-instance data. This way, the
+ // approach used here would scale much better.
+ // That is, if you have multiple "meta data instances", which manage a small, but closed set of properties,
+ // then looking looking through those multiple instances would probably be faster than searching within
+ // one big instance, since in this case, every instance can quickly decide whether it is responsible
+ // for some attribute or property, and otherwise delegate to the next instance.
+
+ //..............................................................................................................
+ typedef ::std::hash_map< ::rtl::OUString, const PropertyDescription*, ::rtl::OUStringHash > DescriptionsByName;
+
+ //..............................................................................................................
+ const DescriptionsByName& lcl_getPropertyDescriptions()
+ {
+ DBG_TESTSOLARMUTEX();
+ static DescriptionsByName s_propertyDescriptionsByName;
+ if ( s_propertyDescriptionsByName.empty() )
+ {
+ const PropertyDescription* desc = lcl_getPropertyMetaData();
+ while ( desc->propertyName.getLength() != 0 )
+ {
+ s_propertyDescriptionsByName[ desc->propertyName ] = desc;
+ ++desc;
+ }
+ }
+ return s_propertyDescriptionsByName;
+ }
+
+ //..............................................................................................................
+ typedef ::std::map< PropertyGroup, PropertyDescriptionList > IndexedPropertyGroups;
+
+ //..............................................................................................................
+ const IndexedPropertyGroups& lcl_getIndexedPropertyGroups()
+ {
+ DBG_TESTSOLARMUTEX();
+ static IndexedPropertyGroups s_indexedPropertyGroups;
+ if ( s_indexedPropertyGroups.empty() )
+ {
+ const PropertyDescription* desc = lcl_getPropertyMetaData();
+ while ( desc->propertyName.getLength() != 0 )
+ {
+ if ( desc->propertyGroup != NO_GROUP )
+ s_indexedPropertyGroups[ desc->propertyGroup ].push_back( desc );
+ ++desc;
+ }
+ }
+ return s_indexedPropertyGroups;
+ }
+
+ //..............................................................................................................
+ typedef ::std::hash_map< ::rtl::OUString, XMLTokenEnum, ::rtl::OUStringHash > ReverseTokenLookup;
+
+ //..............................................................................................................
+ const ReverseTokenLookup& getReverseTokenLookup()
+ {
+ DBG_TESTSOLARMUTEX();
+ static ReverseTokenLookup s_reverseTokenLookup;
+ if ( s_reverseTokenLookup.empty() )
+ {
+ const PropertyDescription* desc = lcl_getPropertyMetaData();
+ while ( desc->propertyName.getLength() != 0 )
+ {
+ s_reverseTokenLookup[ token::GetXMLToken( desc->attribute.attributeToken ) ] = desc->attribute.attributeToken;
+ ++desc;
+ }
+ }
+ return s_reverseTokenLookup;
+ }
+
+ //..............................................................................................................
+ struct AttributeHash : public ::std::unary_function< AttributeDescription, size_t >
+ {
+ size_t operator()( const AttributeDescription& i_attribute ) const
+ {
+ return size_t( i_attribute.attributeToken * 100 ) + size_t( i_attribute.namespacePrefix );
+ }
+ };
+
+ //..............................................................................................................
+ typedef ::std::hash_multimap< AttributeDescription, PropertyGroup, AttributeHash > AttributeGroups;
+
+ //..............................................................................................................
+ const AttributeGroups& lcl_getAttributeGroups()
+ {
+ DBG_TESTSOLARMUTEX();
+ static AttributeGroups s_attributeGroups;
+ if ( s_attributeGroups.empty() )
+ {
+ const PropertyDescription* desc = lcl_getPropertyMetaData();
+ while ( desc->propertyName.getLength() != 0 )
+ {
+ if ( desc->propertyGroup != NO_GROUP )
+ s_attributeGroups.insert( AttributeGroups::value_type( desc->attribute, desc->propertyGroup ) );
+ ++desc;
+ }
+ }
+ return s_attributeGroups;
+ }
+
+ //..............................................................................................................
+ typedef ::std::hash_map< AttributeDescription, PropertyGroups, AttributeHash > AttributesWithoutGroup;
+
+ //..............................................................................................................
+ const AttributesWithoutGroup& lcl_getAttributesWithoutGroups()
+ {
+ DBG_TESTSOLARMUTEX();
+ static AttributesWithoutGroup s_attributesWithoutGroup;
+ if ( s_attributesWithoutGroup.empty() )
+ {
+ const PropertyDescription* desc = lcl_getPropertyMetaData();
+ while ( desc->propertyName.getLength() != 0 )
+ {
+ if ( desc->propertyGroup == NO_GROUP )
+ {
+ PropertyDescriptionList singleElementList;
+ singleElementList.push_back( desc );
+
+ s_attributesWithoutGroup[ desc->attribute ].push_back( singleElementList );
+ }
+ ++desc;
+ }
+ }
+ return s_attributesWithoutGroup;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const PropertyDescription* getPropertyDescription( const ::rtl::OUString& i_propertyName )
+ {
+ const DescriptionsByName& rAllDescriptions( lcl_getPropertyDescriptions() );
+ DescriptionsByName::const_iterator pos = rAllDescriptions.find( i_propertyName );
+ if ( pos != rAllDescriptions.end() )
+ return pos->second;
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void getPropertyGroup( const PropertyGroup i_propertyGroup, PropertyDescriptionList& o_propertyDescriptions )
+ {
+ OSL_ENSURE( i_propertyGroup != NO_GROUP, "xmloff::metadata::getPropertyGroup: illegal group!" );
+
+ const IndexedPropertyGroups& rPropertyGroups( lcl_getIndexedPropertyGroups() );
+ const IndexedPropertyGroups::const_iterator pos = rPropertyGroups.find( i_propertyGroup );
+ if ( pos != rPropertyGroups.end() )
+ o_propertyDescriptions = pos->second;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void getPropertyGroupList( const AttributeDescription& i_attribute, PropertyGroups& o_propertyGroups )
+ {
+ const AttributeGroups& rAttributeGroups = lcl_getAttributeGroups();
+
+ ::std::pair< AttributeGroups::const_iterator, AttributeGroups::const_iterator >
+ range = rAttributeGroups.equal_range( i_attribute );
+
+ if ( range.first == range.second )
+ {
+ // the attribute is not used for any non-trivial group, which means it is mapped directly to
+ // a single property
+ const AttributesWithoutGroup& attributesWithoutGroups( lcl_getAttributesWithoutGroups() );
+ const AttributesWithoutGroup::const_iterator pos = attributesWithoutGroups.find( i_attribute );
+ if ( pos != attributesWithoutGroups.end() )
+ o_propertyGroups = pos->second;
+ }
+ else
+ {
+ const IndexedPropertyGroups& rPropertyGroups = lcl_getIndexedPropertyGroups();
+ for ( AttributeGroups::const_iterator group = range.first; group != range.second; ++group )
+ {
+ const PropertyGroup propGroup = group->second;
+ const IndexedPropertyGroups::const_iterator groupPos = rPropertyGroups.find( propGroup );
+ ENSURE_OR_CONTINUE( groupPos != rPropertyGroups.end(), "getPropertyGroupList: inconsistency!" );
+ o_propertyGroups.push_back( groupPos->second );
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AttributeDescription getAttributeDescription( const sal_uInt16 i_namespacePrefix, const ::rtl::OUString& i_attributeName )
+ {
+ AttributeDescription attribute;
+ const ReverseTokenLookup& rTokenLookup( getReverseTokenLookup() );
+ const ReverseTokenLookup::const_iterator pos = rTokenLookup.find( i_attributeName );
+ if ( pos != rTokenLookup.end() )
+ {
+ attribute.namespacePrefix = i_namespacePrefix;
+ attribute.attributeToken = pos->second;
+ }
+ return attribute;
+ }
+
+//......................................................................................................................
+} } // namespace xmloff::metadata
+//......................................................................................................................
diff --git a/xmloff/source/forms/property_meta_data.hxx b/xmloff/source/forms/property_meta_data.hxx
new file mode 100755
index 000000000000..f246a7bfd745
--- /dev/null
+++ b/xmloff/source/forms/property_meta_data.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef XMLOFF_PROPERTY_META_DATA_HXX
+#define XMLOFF_PROPERTY_META_DATA_HXX
+
+#include "property_description.hxx"
+
+//......................................................................................................................
+namespace xmloff { namespace metadata
+{
+//......................................................................................................................
+
+ const PropertyDescription* getPropertyDescription( const ::rtl::OUString& i_propertyName );
+
+ /** retries the descriptions of all properties which add to the given XML attribute
+
+ <p>Effectively, the complete property map is search for all entries which have the given
+ namespace/attribute values.</p>
+ */
+ void getPropertyGroup(
+ const PropertyGroup i_propertyGroup,
+ PropertyDescriptionList& o_propertyDescriptions
+ );
+
+ /** retrieves all known property groups which are mapped to the given attribute
+ */
+ void getPropertyGroupList(
+ const AttributeDescription& i_attribute,
+ PropertyGroups& o_propertyGroups
+ );
+
+ /** retrieves the attribute descriptor for the attribute given by namespace prefix and attribute name
+ */
+ AttributeDescription
+ getAttributeDescription( const sal_uInt16 i_namespacePrefix, const ::rtl::OUString& i_attributeName );
+
+//......................................................................................................................
+} } // namespace xmloff::metadata
+//......................................................................................................................
+
+#endif // XMLOFF_PROPERTY_META_DATA_HXX
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 2a485566cf9d..7d84e5a60a1f 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -37,7 +37,6 @@
#include <xmloff/families.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
@@ -72,6 +71,8 @@ namespace xmloff
OPropertyExport::OPropertyExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxProps)
:m_rContext(_rContext)
,m_xProps(_rxProps)
+ ,m_xPropertyInfo( m_xProps->getPropertySetInfo() )
+ ,m_xPropertyState( _rxProps, UNO_QUERY )
{
// caching
::rtl::OUStringBuffer aBuffer;
@@ -80,7 +81,6 @@ namespace xmloff
m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(aBuffer, sal_False);
m_sValueFalse = aBuffer.makeStringAndClear();
- m_xPropertyInfo = m_xProps->getPropertySetInfo();
OSL_ENSURE(m_xPropertyInfo.is(), "OPropertyExport::OPropertyExport: need an XPropertySetInfo!");
// collect the properties which need to be exported
@@ -88,6 +88,18 @@ namespace xmloff
}
//---------------------------------------------------------------------
+ bool OPropertyExport::shouldExportProperty( const ::rtl::OUString& i_propertyName ) const
+ {
+ // if the property state is DEFAULT, it does not need to be written - at least
+ // if it's a built-in property, and not a dynamically-added one.
+ bool bIsDefaultValue = m_xPropertyState.is()
+ && ( PropertyState_DEFAULT_VALUE == m_xPropertyState->getPropertyState( i_propertyName ) );
+ bool bIsDynamicProperty = m_xPropertyInfo.is()
+ && ( ( m_xPropertyInfo->getPropertyByName( i_propertyName ).Attributes & PropertyAttribute::REMOVEABLE ) != 0 );
+ return ( !bIsDefaultValue || bIsDynamicProperty );
+ }
+
+ //---------------------------------------------------------------------
void OPropertyExport::exportRemainingProperties()
{
// the properties tag (will be created if we have at least one no-default property)
@@ -95,9 +107,6 @@ namespace xmloff
try
{
- Reference< XPropertyState > xPropertyState( m_xProps, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI( m_xProps->getPropertySetInfo() );
-
Any aValue;
::rtl::OUString sValue;
@@ -112,13 +121,7 @@ namespace xmloff
#if OSL_DEBUG_LEVEL > 0
const ::rtl::OUString sPropertyName = *aProperty; (void)sPropertyName;
#endif
- // if the property state is DEFAULT, it does not need to be written - at least
- // if it's a built-in property, and not a dynamically-added one.
- bool bIsDefaultValue = xPropertyState.is()
- && ( PropertyState_DEFAULT_VALUE == xPropertyState->getPropertyState( *aProperty ) );
- bool bIsDynamicProperty = xPSI.is()
- && ( ( xPSI->getPropertyByName( *aProperty ).Attributes & PropertyAttribute::REMOVEABLE ) != 0 );
- if ( bIsDefaultValue && !bIsDynamicProperty )
+ if ( !shouldExportProperty( *aProperty ) )
continue;
// now that we have the first sub-tag we need the form:properties element
diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx
index ab17912e4df4..3ddfd8d4cabd 100644
--- a/xmloff/source/forms/propertyexport.hxx
+++ b/xmloff/source/forms/propertyexport.hxx
@@ -31,6 +31,7 @@
#include "formattributes.hxx"
#include <comphelper/stl_types.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
#include <callbacks.hxx>
#include <xmloff/xmlexp.hxx>
#include "callbacks.hxx"
@@ -74,10 +75,12 @@ namespace xmloff
protected:
IFormsExportContext& m_rContext;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- m_xProps;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- m_xPropertyInfo;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ m_xProps;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ m_xPropertyInfo;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >
+ m_xPropertyState;
// caching
::rtl::OUString m_sValueTrue;
@@ -308,6 +311,14 @@ namespace xmloff
const sal_Unicode _aQuoteCharacter = '"',
const sal_Unicode _aListSeparator = ',');
+ /** determines whether the given property is to be exported
+
+ <p>Currently, the method simply checks whether the property's state is <em>not</em> PropertyState.DEFAULT,
+ or whether the property is a dynamic property (i.e. added via an <code>XPropertyContainer</code>).
+ So, take care when using the method - the heuristics is not applicable for all properties.</p>
+ */
+ bool shouldExportProperty( const ::rtl::OUString& i_propertyName ) const;
+
/** tries to convert an arbitrary <type scope="com.sun:star.uno">Any</type> into an string
<p>If the type contained in the Any is not supported, the returned string will be empty. In the
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index 45fa2f5b4744..de57eadb69ae 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -349,7 +349,7 @@ _rChars
}
//---------------------------------------------------------------------
-void OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+bool OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
const OAttribute2Property::AttributeAssignment* pProperty = m_rContext.getAttributeMap().getAttributeTranslation(_rLocalName);
if (pProperty)
@@ -361,18 +361,21 @@ void OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const ::rtl
// convert the value string into the target type
aNewValue.Value = PropertyConversion::convertString(m_rContext.getGlobalContext(), pProperty->aPropertyType, _rValue, pProperty->pEnumMap, pProperty->bInverseSemantics);
implPushBackPropertyValue( aNewValue );
+ return true;
}
-#if OSL_DEBUG_LEVEL > 0
- else if (!token::IsXMLToken(_rLocalName, token::XML_TYPE)) // xlink:type is valid but ignored for <form:form>
+ if (!token::IsXMLToken(_rLocalName, token::XML_TYPE)) // xlink:type is valid but ignored for <form:form>
{
+#if OSL_DEBUG_LEVEL > 0
::rtl::OString sMessage( "OPropertyImport::handleAttribute: Can't handle the following:\n" );
sMessage += ::rtl::OString( " Attribute name: " );
sMessage += ::rtl::OString( _rLocalName.getStr(), _rLocalName.getLength(), osl_getThreadTextEncoding() );
sMessage += ::rtl::OString( "\n value: " );
sMessage += ::rtl::OString( _rValue.getStr(), _rValue.getLength(), osl_getThreadTextEncoding() );
OSL_ENSURE( sal_False, sMessage.getStr() );
- }
#endif
+ return false;
+ }
+ return true;
}
//=====================================================================
diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx
index 30bc8bb1d617..d46c0068f090 100644
--- a/xmloff/source/forms/propertyimport.hxx
+++ b/xmloff/source/forms/propertyimport.hxx
@@ -119,7 +119,7 @@ namespace xmloff
@param _rValue
attribute value
*/
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
const ::rtl::OUString& _rValue);
diff --git a/xmloff/source/forms/valueproperties.cxx b/xmloff/source/forms/valueproperties.cxx
index 1c44db963944..8bf9ae7bcd57 100644
--- a/xmloff/source/forms/valueproperties.cxx
+++ b/xmloff/source/forms/valueproperties.cxx
@@ -65,16 +65,6 @@ namespace xmloff
}
break;
- case FormComponentType::DATEFIELD:
- _rpCurrentValuePropertyName = PROPERTY_DATE;
- _rpValuePropertyName = PROPERTY_DEFAULT_DATE;
- break;
-
- case FormComponentType::TIMEFIELD:
- _rpCurrentValuePropertyName = PROPERTY_TIME;
- _rpValuePropertyName = PROPERTY_DEFAULT_TIME;
- break;
-
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
_rpCurrentValuePropertyName = PROPERTY_VALUE;
@@ -108,6 +98,10 @@ namespace xmloff
_rpCurrentValuePropertyName = PROPERTY_SPINVALUE;
_rpValuePropertyName = PROPERTY_DEFAULT_SPINVALUE;
break;
+
+ default:
+ OSL_ENSURE( false, "OValuePropertiesMetaData::getValuePropertyNames: unsupported component type!" );
+ break;
}
}
@@ -119,16 +113,6 @@ namespace xmloff
_rpMinValuePropertyName = _rpMaxValuePropertyName = NULL;
switch (_nFormComponentType)
{
- case FormComponentType::DATEFIELD:
- _rpMinValuePropertyName = PROPERTY_DATE_MIN;
- _rpMaxValuePropertyName = PROPERTY_DATE_MAX;
- break;
-
- case FormComponentType::TIMEFIELD:
- _rpMinValuePropertyName = PROPERTY_TIME_MIN;
- _rpMaxValuePropertyName = PROPERTY_TIME_MAX;
- break;
-
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
_rpMinValuePropertyName = PROPERTY_VALUE_MIN;
@@ -149,6 +133,10 @@ namespace xmloff
_rpMinValuePropertyName = PROPERTY_SPINVALUE_MIN;
_rpMaxValuePropertyName = PROPERTY_SPINVALUE_MAX;
break;
+
+ default:
+ OSL_ENSURE( false, "OValuePropertiesMetaData::getValueLimitPropertyNames: unsupported component type!" );
+ break;
}
}
@@ -175,7 +163,15 @@ namespace xmloff
break;
case FormComponentType::DATEFIELD:
+ _rpValuePropertyName = PROPERTY_DATE;
+ _rpDefaultValuePropertyName = PROPERTY_DEFAULT_DATE;
+ break;
+
case FormComponentType::TIMEFIELD:
+ _rpValuePropertyName = PROPERTY_TIME;
+ _rpDefaultValuePropertyName = PROPERTY_DEFAULT_TIME;
+ break;
+
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
case FormComponentType::PATTERNFIELD:
diff --git a/xmloff/util/makefile.mk b/xmloff/util/makefile.mk
index 857067985c50..29ed0784d165 100644
--- a/xmloff/util/makefile.mk
+++ b/xmloff/util/makefile.mk
@@ -48,6 +48,7 @@ LIB1FILES= \
$(SLB)$/draw.lib \
$(SLB)$/chart.lib \
$(SLB)$/forms.lib \
+ $(SLB)$/form_handlers.lib \
$(SLB)$/xforms.lib \
$(SLB)$/table.lib