summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx2
-rw-r--r--accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx3
-rw-r--r--automation/source/server/statemnt.cxx3
-rw-r--r--automation/source/server/statemnt.hxx2
-rwxr-xr-x[-rw-r--r--]automation/util/manually_added_ids.hid0
-rw-r--r--basctl/source/basicide/basicprint.src2
-rw-r--r--basctl/source/basicide/basicrenderable.cxx14
-rw-r--r--basic/inc/pch/precompiled_basic.hxx2
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--canvas/source/vcl/backbuffer.cxx2
-rw-r--r--canvas/source/vcl/bitmapbackbuffer.cxx2
-rw-r--r--canvas/source/vcl/spritedevicehelper.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/inc/pch/precompiled_chart2.hxx2
-rw-r--r--chart2/source/controller/inc/ConfigurationAccess.hxx2
-rw-r--r--[-rwxr-xr-x]comphelper/inc/comphelper/docpasswordrequest.hxx0
-rw-r--r--comphelper/inc/comphelper/sequenceasvector.hxx11
-rw-r--r--[-rwxr-xr-x]comphelper/source/misc/docpasswordrequest.cxx0
-rw-r--r--cppu/inc/com/sun/star/uno/Sequence.h2
-rw-r--r--cppuhelper/inc/cppuhelper/factory.hxx4
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/hyphen.cxx0
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/hyphen.hrc0
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/thesdlg.hrc0
-rw-r--r--[-rwxr-xr-x]cui/source/dialogs/thesdlg_impl.hxx0
-rw-r--r--[-rwxr-xr-x]cui/source/factory/dlgfact.cxx0
-rwxr-xr-x[-rw-r--r--]cui/source/inc/hyphen.hxx0
-rwxr-xr-x[-rw-r--r--]cui/source/inc/macroass.hxx0
-rwxr-xr-x[-rw-r--r--]cui/source/inc/thesdlg.hxx0
-rw-r--r--cui/source/options/optcolor.cxx4
-rw-r--r--dbaccess/source/ui/dlg/UserAdminDlg.src1
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.src1
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.src2
-rw-r--r--dbaccess/source/ui/dlg/dbadminsetup.src1
-rwxr-xr-xdefault_images/res/commandimagelist/lc_showannotations.png (renamed from default_images/res/commandimagelist/lc_showannotation.png)bin4154 -> 4154 bytes
-rwxr-xr-xdefault_images/res/commandimagelist/lch_showannotations.png (renamed from default_images/res/commandimagelist/lch_showannotation.png)bin3628 -> 3628 bytes
-rwxr-xr-xdefault_images/res/commandimagelist/sc_showannotations.png (renamed from default_images/res/commandimagelist/sc_showannotation.png)bin3879 -> 3879 bytes
-rwxr-xr-xdefault_images/res/commandimagelist/sch_showannotations.png (renamed from default_images/res/commandimagelist/sch_showannotation.png)bin3611 -> 3611 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_01.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_01.png)bin441 -> 441 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_02.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_02.png)bin436 -> 436 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_03.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_03.png)bin435 -> 435 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_04.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_04.png)bin435 -> 435 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_05.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_05.png)bin439 -> 439 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_06.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_06.png)bin443 -> 443 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_07.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_07.png)bin444 -> 444 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_08.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_08.png)bin439 -> 439 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_09.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_09.png)bin427 -> 427 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_10.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_10.png)bin429 -> 429 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_11.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_11.png)bin429 -> 429 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-32-hc_12.png (renamed from default_images/toolkit/source/awt/spinner03-32-hc_12.png)bin435 -> 435 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_01.png (renamed from default_images/toolkit/source/awt/spinner03-grey_01.png)bin666 -> 666 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_02.png (renamed from default_images/toolkit/source/awt/spinner03-grey_02.png)bin668 -> 668 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_03.png (renamed from default_images/toolkit/source/awt/spinner03-grey_03.png)bin678 -> 678 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_04.png (renamed from default_images/toolkit/source/awt/spinner03-grey_04.png)bin680 -> 680 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_05.png (renamed from default_images/toolkit/source/awt/spinner03-grey_05.png)bin671 -> 671 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_06.png (renamed from default_images/toolkit/source/awt/spinner03-grey_06.png)bin676 -> 676 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_07.png (renamed from default_images/toolkit/source/awt/spinner03-grey_07.png)bin692 -> 692 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_08.png (renamed from default_images/toolkit/source/awt/spinner03-grey_08.png)bin682 -> 682 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_09.png (renamed from default_images/toolkit/source/awt/spinner03-grey_09.png)bin675 -> 675 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_10.png (renamed from default_images/toolkit/source/awt/spinner03-grey_10.png)bin673 -> 673 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_11.png (renamed from default_images/toolkit/source/awt/spinner03-grey_11.png)bin679 -> 679 bytes
-rw-r--r--default_images/toolkit/tk/spinner03-grey_12.png (renamed from default_images/toolkit/source/awt/spinner03-grey_12.png)bin676 -> 676 bytes
-rw-r--r--desktop/inc/app.hxx2
-rw-r--r--desktop/scripts/unopkg.sh15
-rw-r--r--desktop/source/app/app.cxx147
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.cxx4
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx129
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.hxx17
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx33
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx33
-rw-r--r--desktop/source/deployment/registry/component/dp_compbackenddb.cxx43
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx33
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx128
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx13
-rwxr-xr-xdesktop/source/deployment/registry/dp_backend.cxx6
-rw-r--r--desktop/source/deployment/registry/dp_backenddb.cxx108
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx18
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx38
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx427
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.cxx11
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.hxx2
-rwxr-xr-xdesktop/source/deployment/registry/inc/dp_backend.h20
-rw-r--r--desktop/source/deployment/registry/inc/dp_backenddb.hxx12
-rw-r--r--desktop/source/deployment/registry/package/dp_extbackenddb.cxx22
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/registry/package/dp_package.cxx26
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx45
-rwxr-xr-xdesktop/source/deployment/registry/sfwk/dp_sfwk.cxx17
-rw-r--r--[-rwxr-xr-x]desktop/source/migration/migration.cxx0
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx36
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h18
-rw-r--r--drawinglayer/source/processor2d/vclhelperbitmaprender.cxx39
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/editeng.hxx0
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/splwrap.hxx0
-rwxr-xr-x[-rw-r--r--]editeng/inc/pch/precompiled_editeng.hxx4
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/impedit.cxx0
-rwxr-xr-x[-rw-r--r--]editeng/source/outliner/outlvw.cxx0
-rwxr-xr-x[-rw-r--r--]extensions/inc/pch/precompiled_extensions.hxx2
-rw-r--r--extensions/source/oooimprovement/onlogrotate_job.cxx33
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.hxx2
-rwxr-xr-x[-rw-r--r--]extensions/source/update/check/download.cxx0
-rwxr-xr-x[-rw-r--r--]extensions/source/update/check/updatecheck.cxx0
-rw-r--r--extras/source/palettes/standard.soc1
-rw-r--r--filter/inc/filter/msfilter/msvbahelper.hxx94
-rw-r--r--filter/prj/build.lst2
-rw-r--r--filter/prj/d.lst1
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu2
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu2
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_40.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_5095.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_95.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_97.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu2
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx560
-rw-r--r--filter/source/graphicfilter/ipict/makefile.mk6
-rwxr-xr-xfilter/source/graphicfilter/ipict/shape.cxx266
-rwxr-xr-xfilter/source/graphicfilter/ipict/shape.hxx60
-rw-r--r--filter/source/msfilter/makefile.mk24
-rwxr-xr-xfilter/source/msfilter/msfilter.component34
-rw-r--r--filter/source/msfilter/msvbahelper.cxx346
-rwxr-xr-xfilter/source/msfilter/services.cxx75
-rwxr-xr-x[-rw-r--r--]forms/inc/pch/precompiled_forms.hxx4
-rw-r--r--forms/source/component/Edit.cxx2
-rw-r--r--forms/source/component/Filter.cxx2
-rw-r--r--forms/source/component/FormattedField.cxx2
-rw-r--r--forms/source/richtext/richtextcontrol.hxx2
-rw-r--r--forms/source/richtext/richtextengine.cxx2
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx2
-rw-r--r--forms/source/richtext/rtattributehandler.cxx2
-rw-r--r--forms/source/solar/component/navbarcontrol.hxx2
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx2
-rw-r--r--fpicker/source/unx/gnome/SalGtkFilePicker.cxx2
-rw-r--r--framework/inc/pch/precompiled_framework.hxx4
-rw-r--r--framework/inc/services/layoutmanager.hxx2
-rw-r--r--framework/source/helper/tagwindowasmodified.cxx2
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx2
-rw-r--r--[-rwxr-xr-x]i18npool/source/localedata/data/makefile.mk0
-rw-r--r--jvmfwk/source/elements.cxx93
-rw-r--r--jvmfwk/source/elements.hxx28
-rw-r--r--libxmlsec/xmlsec1-olderlibxml2.patch2
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/lingutil/lingutil.cxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/spellcheck/spell/sspellimp.hxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/thesaurus/libnth/nthesdta.hxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/thesaurus/libnth/nthesimp.cxx0
-rw-r--r--[-rwxr-xr-x]lingucomponent/source/thesaurus/libnth/nthesimp.hxx0
-rw-r--r--offapi/com/sun/star/deployment/XExtensionManager.idl21
-rw-r--r--offapi/com/sun/star/deployment/XPackageRegistry.idl7
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/script/vba/VBAMacroResolver.idl (renamed from vcl/inc/vcl/salctrlhandle.hxx)31
-rwxr-xr-xoffapi/com/sun/star/script/vba/XVBAMacroResolver.idl94
-rwxr-xr-xoffapi/com/sun/star/script/vba/makefile.mk2
-rw-r--r--offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl4
-rw-r--r--offapi/com/sun/star/sheet/SheetFilterDescriptor.idl27
-rwxr-xr-xoffapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl61
-rw-r--r--offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl10
-rw-r--r--offapi/com/sun/star/sheet/TableFilterField.idl11
-rw-r--r--offapi/com/sun/star/sheet/TableFilterField2.idl12
-rw-r--r--offapi/com/sun/star/sheet/XDatabaseRange.idl12
-rw-r--r--offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl14
-rw-r--r--offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl12
-rw-r--r--offapi/com/sun/star/sheet/makefile.mk1
-rw-r--r--[-rwxr-xr-x]offapi/com/sun/star/text/PrintPreviewSettings.idl0
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/text/TextFrame.idl0
-rw-r--r--[-rwxr-xr-x]officecfg/registry/data/org/openoffice/Office/Accelerators.xcu16
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu2
-rw-r--r--[-rwxr-xr-x]officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu0
-rw-r--r--[-rwxr-xr-x]officecfg/registry/data/org/openoffice/Setup.xcu0
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs55
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Draw.xcs8
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Impress.xcs49
-rw-r--r--oox/inc/oox/core/binarycodec.hxx1
-rw-r--r--oox/inc/oox/core/binaryfilterbase.hxx4
-rw-r--r--oox/inc/oox/core/contexthandler.hxx13
-rw-r--r--oox/inc/oox/core/contexthandler2.hxx145
-rwxr-xr-xoox/inc/oox/core/fastparser.hxx93
-rw-r--r--oox/inc/oox/core/fasttokenhandler.hxx14
-rw-r--r--oox/inc/oox/core/filterbase.hxx46
-rw-r--r--oox/inc/oox/core/filterdetect.hxx11
-rw-r--r--oox/inc/oox/core/fragmenthandler.hxx1
-rw-r--r--oox/inc/oox/core/fragmenthandler2.hxx14
-rw-r--r--oox/inc/oox/core/recordparser.hxx2
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/core/relations.hxx14
-rw-r--r--oox/inc/oox/core/relationshandler.hxx1
-rw-r--r--oox/inc/oox/core/xmlfilterbase.hxx24
-rw-r--r--oox/inc/oox/drawingml/chart/axiscontext.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/axisconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/axismodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/chartcontextbase.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/chartconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx4
-rw-r--r--oox/inc/oox/drawingml/chart/chartspaceconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacefragment.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacemodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/datasourcecontext.hxx5
-rw-r--r--oox/inc/oox/drawingml/chart/datasourceconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/datasourcemodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/modelbase.hxx5
-rw-r--r--oox/inc/oox/drawingml/chart/objectformatter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/plotareacontext.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/plotareaconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/plotareamodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/seriescontext.hxx7
-rw-r--r--oox/inc/oox/drawingml/chart/seriesconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/seriesmodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/titlecontext.hxx3
-rw-r--r--oox/inc/oox/drawingml/chart/titleconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/titlemodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupcontext.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupconverter.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupmodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/clrscheme.hxx1
-rw-r--r--oox/inc/oox/drawingml/customshapeproperties.hxx14
-rw-r--r--oox/inc/oox/drawingml/graphicshapecontext.hxx4
-rw-r--r--oox/inc/oox/drawingml/shape.hxx79
-rw-r--r--oox/inc/oox/drawingml/textbody.hxx1
-rw-r--r--oox/inc/oox/drawingml/textliststyle.hxx6
-rw-r--r--oox/inc/oox/drawingml/textparagraph.hxx1
-rw-r--r--oox/inc/oox/drawingml/textparagraphproperties.hxx4
-rw-r--r--oox/inc/oox/drawingml/theme.hxx1
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx5
-rw-r--r--oox/inc/oox/dump/oledumper.hxx12
-rw-r--r--oox/inc/oox/dump/xlsbdumper.hxx5
-rw-r--r--oox/inc/oox/helper/attributelist.hxx7
-rw-r--r--oox/inc/oox/helper/binaryinputstream.hxx1
-rw-r--r--oox/inc/oox/helper/binaryoutputstream.hxx1
-rw-r--r--oox/inc/oox/helper/binarystreambase.hxx1
-rw-r--r--oox/inc/oox/helper/containerhelper.hxx473
-rw-r--r--oox/inc/oox/helper/graphichelper.hxx4
-rw-r--r--oox/inc/oox/helper/helper.hxx1
-rw-r--r--oox/inc/oox/helper/modelobjecthelper.hxx55
-rw-r--r--oox/inc/oox/helper/progressbar.hxx1
-rw-r--r--oox/inc/oox/helper/propertymap.hxx13
-rw-r--r--oox/inc/oox/helper/propertyset.hxx6
-rwxr-xr-xoox/inc/oox/helper/refmap.hxx181
-rwxr-xr-xoox/inc/oox/helper/refvector.hxx201
-rw-r--r--oox/inc/oox/helper/storagebase.hxx4
-rwxr-xr-xoox/inc/oox/helper/textinputstream.hxx1
-rw-r--r--[-rwxr-xr-x]oox/inc/oox/ole/axbinaryreader.hxx6
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx155
-rw-r--r--oox/inc/oox/ole/axcontrolfragment.hxx1
-rw-r--r--oox/inc/oox/ole/olehelper.hxx5
-rw-r--r--oox/inc/oox/ole/oleobjecthelper.hxx3
-rw-r--r--[-rwxr-xr-x]oox/inc/oox/ole/olestorage.hxx2
-rwxr-xr-xoox/inc/oox/ole/vbacontrol.hxx20
-rw-r--r--oox/inc/oox/ole/vbahelper.hxx1
-rw-r--r--oox/inc/oox/ole/vbainputstream.hxx1
-rw-r--r--oox/inc/oox/ole/vbamodule.hxx2
-rw-r--r--oox/inc/oox/ole/vbaproject.hxx70
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/ole/vbaprojectfilter.hxx (renamed from oox/source/helper/recordinputstream.cxx)65
-rw-r--r--oox/inc/oox/ppt/pptimport.hxx5
-rw-r--r--oox/inc/oox/ppt/pptshape.hxx2
-rw-r--r--oox/inc/oox/ppt/slidepersist.hxx3
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/token/namespacemap.hxx (renamed from oox/source/token/propertylist.cxx)29
-rw-r--r--oox/inc/oox/token/propertynames.hxx (renamed from oox/inc/oox/token/propertylist.hxx)15
-rw-r--r--oox/inc/oox/token/tokenmap.hxx1
-rw-r--r--oox/inc/oox/vml/vmldrawing.hxx71
-rw-r--r--oox/inc/oox/vml/vmldrawingfragment.hxx1
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx31
-rw-r--r--oox/inc/oox/vml/vmlinputstream.hxx1
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx69
-rw-r--r--oox/inc/oox/vml/vmlshapecontainer.hxx7
-rw-r--r--oox/inc/oox/vml/vmlshapecontext.hxx51
-rwxr-xr-xoox/inc/oox/vml/vmltextbox.hxx95
-rwxr-xr-xoox/inc/oox/vml/vmltextboxcontext.hxx82
-rw-r--r--oox/inc/oox/xls/addressconverter.hxx15
-rwxr-xr-xoox/inc/oox/xls/autofilterbuffer.hxx279
-rw-r--r--oox/inc/oox/xls/autofiltercontext.hxx130
-rw-r--r--oox/inc/oox/xls/biffcodec.hxx1
-rw-r--r--oox/inc/oox/xls/biffdetector.hxx14
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx476
-rw-r--r--oox/inc/oox/xls/biffinputstream.hxx1
-rw-r--r--oox/inc/oox/xls/biffoutputstream.hxx1
-rw-r--r--oox/inc/oox/xls/chartsheetfragment.hxx19
-rw-r--r--oox/inc/oox/xls/commentsbuffer.hxx3
-rw-r--r--oox/inc/oox/xls/commentsfragment.hxx16
-rw-r--r--oox/inc/oox/xls/condformatbuffer.hxx18
-rw-r--r--oox/inc/oox/xls/condformatcontext.hxx13
-rwxr-xr-xoox/inc/oox/xls/connectionsbuffer.hxx186
-rw-r--r--oox/inc/oox/xls/connectionsfragment.hxx37
-rw-r--r--oox/inc/oox/xls/defnamesbuffer.hxx80
-rw-r--r--oox/inc/oox/xls/drawingfragment.hxx152
-rw-r--r--oox/inc/oox/xls/excelchartconverter.hxx1
-rw-r--r--oox/inc/oox/xls/excelfilter.hxx26
-rw-r--r--oox/inc/oox/xls/excelhandlers.hxx191
-rwxr-xr-xoox/inc/oox/xls/excelvbaproject.hxx5
-rw-r--r--oox/inc/oox/xls/externallinkbuffer.hxx53
-rw-r--r--oox/inc/oox/xls/externallinkfragment.hxx76
-rw-r--r--oox/inc/oox/xls/formulabase.hxx110
-rw-r--r--oox/inc/oox/xls/formulaparser.hxx18
-rw-r--r--oox/inc/oox/xls/numberformatsbuffer.hxx4
-rw-r--r--oox/inc/oox/xls/ooxformulaparser.hxx1
-rw-r--r--oox/inc/oox/xls/pagesettings.hxx17
-rw-r--r--oox/inc/oox/xls/pivotcachebuffer.hxx55
-rw-r--r--oox/inc/oox/xls/pivotcachefragment.hxx31
-rw-r--r--oox/inc/oox/xls/pivottablebuffer.hxx49
-rw-r--r--oox/inc/oox/xls/pivottablefragment.hxx31
-rw-r--r--oox/inc/oox/xls/querytablebuffer.hxx109
-rw-r--r--oox/inc/oox/xls/querytablefragment.hxx31
-rw-r--r--oox/inc/oox/xls/richstring.hxx19
-rw-r--r--oox/inc/oox/xls/richstringcontext.hxx15
-rw-r--r--oox/inc/oox/xls/scenariobuffer.hxx10
-rw-r--r--oox/inc/oox/xls/scenariocontext.hxx17
-rw-r--r--oox/inc/oox/xls/sharedformulabuffer.hxx5
-rw-r--r--oox/inc/oox/xls/sharedstringsbuffer.hxx2
-rw-r--r--oox/inc/oox/xls/sharedstringsfragment.hxx12
-rw-r--r--oox/inc/oox/xls/sheetdatacontext.hxx76
-rw-r--r--oox/inc/oox/xls/stylesbuffer.hxx126
-rw-r--r--oox/inc/oox/xls/stylesfragment.hxx47
-rw-r--r--oox/inc/oox/xls/tablebuffer.hxx24
-rw-r--r--oox/inc/oox/xls/tablefragment.hxx16
-rw-r--r--oox/inc/oox/xls/themebuffer.hxx1
-rw-r--r--oox/inc/oox/xls/unitconverter.hxx3
-rw-r--r--oox/inc/oox/xls/viewsettings.hxx17
-rw-r--r--oox/inc/oox/xls/webquerybuffer.hxx127
-rw-r--r--oox/inc/oox/xls/workbookfragment.hxx17
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx91
-rw-r--r--oox/inc/oox/xls/workbooksettings.hxx11
-rw-r--r--oox/inc/oox/xls/worksheetbuffer.hxx14
-rw-r--r--oox/inc/oox/xls/worksheetfragment.hxx90
-rw-r--r--oox/inc/oox/xls/worksheethelper.hxx42
-rw-r--r--oox/inc/oox/xls/worksheetsettings.hxx15
-rw-r--r--oox/prj/d.lst10
-rw-r--r--oox/source/core/binarycodec.cxx2
-rw-r--r--oox/source/core/binaryfilterbase.cxx24
-rw-r--r--oox/source/core/contexthandler.cxx21
-rw-r--r--oox/source/core/contexthandler2.cxx120
-rw-r--r--oox/source/core/facreg.cxx137
-rwxr-xr-xoox/source/core/fastparser.cxx136
-rw-r--r--oox/source/core/fasttokenhandler.cxx61
-rw-r--r--oox/source/core/filterbase.cxx167
-rw-r--r--oox/source/core/filterdetect.cxx179
-rw-r--r--oox/source/core/fragmenthandler.cxx19
-rw-r--r--oox/source/core/fragmenthandler2.cxx38
-rw-r--r--oox/source/core/makefile.mk3
-rw-r--r--oox/source/core/recordparser.cxx23
-rw-r--r--oox/source/core/relations.cxx14
-rw-r--r--oox/source/core/relationshandler.cxx19
-rw-r--r--oox/source/core/services.cxx97
-rw-r--r--oox/source/core/xmlfilterbase.cxx161
-rw-r--r--oox/source/docprop/docprophandler.cxx138
-rw-r--r--oox/source/docprop/docprophandler.hxx10
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx260
-rw-r--r--oox/source/docprop/ooxmldocpropimport.hxx40
-rw-r--r--oox/source/drawingml/chart/axiscontext.cxx12
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx31
-rw-r--r--oox/source/drawingml/chart/axismodel.cxx1
-rw-r--r--oox/source/drawingml/chart/chartcontextbase.cxx12
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx24
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx57
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx27
-rw-r--r--oox/source/drawingml/chart/chartspacefragment.cxx12
-rw-r--r--oox/source/drawingml/chart/chartspacemodel.cxx1
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx48
-rw-r--r--oox/source/drawingml/chart/datasourcecontext.cxx16
-rw-r--r--oox/source/drawingml/chart/datasourceconverter.cxx14
-rw-r--r--oox/source/drawingml/chart/datasourcemodel.cxx1
-rw-r--r--oox/source/drawingml/chart/modelbase.cxx8
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx42
-rw-r--r--oox/source/drawingml/chart/plotareacontext.cxx10
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx27
-rw-r--r--oox/source/drawingml/chart/seriescontext.cxx50
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx27
-rw-r--r--oox/source/drawingml/chart/seriesmodel.cxx1
-rw-r--r--oox/source/drawingml/chart/titlecontext.cxx124
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx28
-rw-r--r--oox/source/drawingml/chart/titlemodel.cxx1
-rw-r--r--oox/source/drawingml/chart/typegroupcontext.cxx10
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx29
-rw-r--r--oox/source/drawingml/chart/typegroupmodel.cxx1
-rw-r--r--oox/source/drawingml/clrscheme.cxx2
-rw-r--r--oox/source/drawingml/clrschemecontext.cxx4
-rw-r--r--oox/source/drawingml/color.cxx8
-rw-r--r--oox/source/drawingml/colorchoicecontext.cxx1
-rw-r--r--oox/source/drawingml/connectorshapecontext.cxx4
-rw-r--r--oox/source/drawingml/customshapegeometry.cxx57
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx3
-rw-r--r--oox/source/drawingml/diagram/datamodelcontext.cxx43
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx2
-rw-r--r--oox/source/drawingml/diagram/diagramdefinitioncontext.cxx18
-rw-r--r--oox/source/drawingml/diagram/diagramfragmenthandler.cxx10
-rw-r--r--oox/source/drawingml/diagram/layoutnodecontext.cxx41
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx2
-rw-r--r--oox/source/drawingml/embeddedwavaudiofile.cxx5
-rw-r--r--oox/source/drawingml/fillproperties.cxx3
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx19
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx160
-rw-r--r--oox/source/drawingml/guidcontext.cxx3
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx15
-rw-r--r--oox/source/drawingml/lineproperties.cxx5
-rw-r--r--oox/source/drawingml/linepropertiescontext.cxx4
-rw-r--r--oox/source/drawingml/objectdefaultcontext.cxx8
-rw-r--r--oox/source/drawingml/shape.cxx163
-rw-r--r--oox/source/drawingml/shapecontext.cxx4
-rw-r--r--oox/source/drawingml/shapegroupcontext.cxx6
-rw-r--r--oox/source/drawingml/shapepropertiescontext.cxx20
-rw-r--r--oox/source/drawingml/shapestylecontext.cxx12
-rw-r--r--oox/source/drawingml/spdefcontext.cxx10
-rw-r--r--oox/source/drawingml/table/tablebackgroundstylecontext.cxx11
-rw-r--r--oox/source/drawingml/table/tablecell.cxx3
-rw-r--r--oox/source/drawingml/table/tablecellcontext.cxx21
-rw-r--r--oox/source/drawingml/table/tablecontext.cxx16
-rw-r--r--oox/source/drawingml/table/tablepartstylecontext.cxx7
-rw-r--r--oox/source/drawingml/table/tableproperties.cxx2
-rw-r--r--oox/source/drawingml/table/tablerow.cxx2
-rw-r--r--oox/source/drawingml/table/tablerowcontext.cxx6
-rw-r--r--oox/source/drawingml/table/tablestylecellstylecontext.cxx33
-rw-r--r--oox/source/drawingml/table/tablestylecontext.cxx33
-rw-r--r--oox/source/drawingml/table/tablestylelistfragmenthandler.cxx4
-rw-r--r--oox/source/drawingml/table/tablestylepart.cxx2
-rw-r--r--oox/source/drawingml/table/tablestyletextstylecontext.cxx17
-rw-r--r--oox/source/drawingml/textbodycontext.cxx28
-rw-r--r--oox/source/drawingml/textbodyproperties.cxx3
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx19
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx3
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx52
-rw-r--r--oox/source/drawingml/textfieldcontext.cxx10
-rw-r--r--oox/source/drawingml/textfont.cxx1
-rw-r--r--oox/source/drawingml/textliststyle.cxx11
-rw-r--r--oox/source/drawingml/textliststylecontext.cxx26
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx3
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx35
-rw-r--r--oox/source/drawingml/textrun.cxx1
-rw-r--r--oox/source/drawingml/textspacingcontext.cxx9
-rw-r--r--oox/source/drawingml/texttabstoplistcontext.cxx4
-rw-r--r--oox/source/drawingml/theme.cxx1
-rw-r--r--oox/source/drawingml/themeelementscontext.cxx46
-rw-r--r--oox/source/drawingml/themefragmenthandler.cxx14
-rw-r--r--oox/source/drawingml/transform2dcontext.cxx9
-rw-r--r--oox/source/dump/biffdumper.cxx255
-rw-r--r--oox/source/dump/biffdumper.ini178
-rw-r--r--oox/source/dump/dffdumper.cxx7
-rw-r--r--oox/source/dump/dffdumper.ini1
-rw-r--r--oox/source/dump/dumperbase.cxx54
-rw-r--r--oox/source/dump/dumperbase.ini1
-rw-r--r--oox/source/dump/oledumper.cxx163
-rw-r--r--oox/source/dump/oledumper.ini1
-rw-r--r--oox/source/dump/pptxdumper.cxx23
-rw-r--r--oox/source/dump/pptxdumper.ini1
-rw-r--r--oox/source/dump/xlsbdumper.cxx440
-rw-r--r--oox/source/dump/xlsbdumper.ini123
-rw-r--r--oox/source/export/drawingml.cxx1
-rw-r--r--oox/source/export/shapes.cxx1
-rw-r--r--oox/source/helper/attributelist.cxx22
-rw-r--r--oox/source/helper/binaryinputstream.cxx18
-rw-r--r--oox/source/helper/binaryoutputstream.cxx16
-rw-r--r--oox/source/helper/binarystreambase.cxx11
-rw-r--r--oox/source/helper/containerhelper.cxx83
-rwxr-xr-x[-rw-r--r--]oox/source/helper/graphichelper.cxx83
-rw-r--r--oox/source/helper/makefile.mk1
-rw-r--r--oox/source/helper/modelobjecthelper.cxx79
-rw-r--r--oox/source/helper/progressbar.cxx11
-rw-r--r--oox/source/helper/propertymap.cxx120
-rw-r--r--oox/source/helper/propertyset.cxx28
-rw-r--r--oox/source/helper/storagebase.cxx21
-rwxr-xr-xoox/source/helper/textinputstream.cxx8
-rw-r--r--oox/source/helper/zipstorage.cxx26
-rw-r--r--[-rwxr-xr-x]oox/source/ole/axbinaryreader.cxx15
-rw-r--r--oox/source/ole/axcontrol.cxx419
-rw-r--r--oox/source/ole/axcontrolfragment.cxx26
-rw-r--r--oox/source/ole/makefile.mk3
-rw-r--r--oox/source/ole/olehelper.cxx25
-rw-r--r--oox/source/ole/oleobjecthelper.cxx33
-rw-r--r--[-rwxr-xr-x]oox/source/ole/olestorage.cxx38
-rw-r--r--oox/source/ole/vbacontrol.cxx63
-rw-r--r--oox/source/ole/vbahelper.cxx5
-rw-r--r--oox/source/ole/vbainputstream.cxx2
-rw-r--r--oox/source/ole/vbamodule.cxx12
-rw-r--r--oox/source/ole/vbaproject.cxx156
-rwxr-xr-xoox/source/ole/vbaprojectfilter.cxx106
-rw-r--r--oox/source/ppt/animationspersist.cxx4
-rw-r--r--oox/source/ppt/animationtypes.cxx2
-rw-r--r--oox/source/ppt/animvariantcontext.cxx12
-rw-r--r--oox/source/ppt/backgroundproperties.cxx4
-rw-r--r--oox/source/ppt/buildlistcontext.cxx15
-rw-r--r--oox/source/ppt/commonbehaviorcontext.cxx18
-rw-r--r--oox/source/ppt/commontimenodecontext.cxx20
-rw-r--r--oox/source/ppt/conditioncontext.cxx12
-rw-r--r--oox/source/ppt/customshowlistcontext.cxx9
-rw-r--r--oox/source/ppt/headerfootercontext.cxx2
-rw-r--r--oox/source/ppt/layoutfragmenthandler.cxx6
-rw-r--r--oox/source/ppt/pptimport.cxx29
-rw-r--r--oox/source/ppt/pptshape.cxx4
-rw-r--r--oox/source/ppt/pptshapecontext.cxx15
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx22
-rw-r--r--oox/source/ppt/pptshapepropertiescontext.cxx5
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx38
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx45
-rw-r--r--oox/source/ppt/slidemastertextstylescontext.cxx10
-rw-r--r--oox/source/ppt/slidepersist.cxx4
-rw-r--r--oox/source/ppt/slidetimingcontext.cxx8
-rw-r--r--oox/source/ppt/slidetransition.cxx45
-rw-r--r--oox/source/ppt/slidetransitioncontext.cxx49
-rw-r--r--oox/source/ppt/soundactioncontext.cxx11
-rw-r--r--oox/source/ppt/timeanimvaluecontext.cxx10
-rw-r--r--oox/source/ppt/timenode.cxx2
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx122
-rw-r--r--oox/source/ppt/timetargetelementcontext.cxx28
-rw-r--r--oox/source/shape/FastTokenHandlerService.cxx116
-rw-r--r--oox/source/shape/FastTokenHandlerService.hxx81
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx73
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx22
-rw-r--r--oox/source/shape/ShapeFilterBase.cxx14
-rw-r--r--oox/source/shape/ShapeFilterBase.hxx8
-rw-r--r--oox/source/shape/makefile.mk3
-rw-r--r--oox/source/token/gennamespaces.pl66
-rw-r--r--oox/source/token/genproperties.pl46
-rw-r--r--oox/source/token/gentoken.pl61
-rw-r--r--oox/source/token/makefile.mk44
-rwxr-xr-x[-rw-r--r--]oox/source/token/namespacemap.cxx (renamed from vcl/inc/vcl/impbmpconv.hxx)24
-rwxr-xr-x[-rw-r--r--]oox/source/token/namespaces.hxx.head (renamed from vcl/inc/vcl/wintypes.hxx)11
-rwxr-xr-xoox/source/token/namespaces.hxx.tail35
-rw-r--r--oox/source/token/namespaces.pl79
-rw-r--r--oox/source/token/namespaces.txt101
-rw-r--r--oox/source/token/parsexsd.pl27
-rwxr-xr-x[-rw-r--r--]oox/source/token/properties.hxx.head (renamed from vcl/inc/vcl/fldunit.hxx)13
-rwxr-xr-xoox/source/token/properties.hxx.tail6
-rw-r--r--oox/source/token/properties.pl (renamed from udkapi/prj/makefile.mk)62
-rw-r--r--oox/source/token/properties.txt22
-rw-r--r--oox/source/token/propertynames.cxx51
-rw-r--r--oox/source/token/tokenmap.cxx45
-rwxr-xr-x[-rw-r--r--]oox/source/token/tokens.hxx.head (renamed from vcl/inc/vcl/mapunit.hxx)11
-rwxr-xr-xoox/source/token/tokens.hxx.tail8
-rw-r--r--oox/source/token/tokens.pl80
-rw-r--r--oox/source/token/tokens.txt15
-rw-r--r--oox/source/vml/makefile.mk16
-rw-r--r--oox/source/vml/vmldrawing.cxx146
-rw-r--r--oox/source/vml/vmldrawingfragment.cxx23
-rw-r--r--oox/source/vml/vmlformatting.cxx112
-rw-r--r--oox/source/vml/vmlinputstream.cxx65
-rw-r--r--oox/source/vml/vmlshape.cxx237
-rw-r--r--oox/source/vml/vmlshapecontainer.cxx15
-rw-r--r--oox/source/vml/vmlshapecontext.cxx148
-rwxr-xr-x[-rw-r--r--]oox/source/vml/vmltextbox.cxx (renamed from oox/inc/oox/helper/recordinputstream.hxx)57
-rwxr-xr-xoox/source/vml/vmltextboxcontext.cxx146
-rw-r--r--oox/source/xls/addressconverter.cxx41
-rwxr-xr-xoox/source/xls/autofilterbuffer.cxx853
-rw-r--r--oox/source/xls/autofiltercontext.cxx734
-rw-r--r--oox/source/xls/biffcodec.cxx51
-rw-r--r--oox/source/xls/biffdetector.cxx88
-rw-r--r--oox/source/xls/biffhelper.cxx59
-rw-r--r--oox/source/xls/biffinputstream.cxx10
-rw-r--r--oox/source/xls/biffoutputstream.cxx1
-rw-r--r--oox/source/xls/chartsheetfragment.cxx163
-rw-r--r--oox/source/xls/commentsbuffer.cxx34
-rw-r--r--oox/source/xls/commentsfragment.cxx93
-rw-r--r--oox/source/xls/condformatbuffer.cxx283
-rw-r--r--oox/source/xls/condformatcontext.cxx41
-rwxr-xr-xoox/source/xls/connectionsbuffer.cxx501
-rw-r--r--oox/source/xls/connectionsfragment.cxx142
-rw-r--r--oox/source/xls/defnamesbuffer.cxx244
-rw-r--r--oox/source/xls/drawingfragment.cxx687
-rw-r--r--oox/source/xls/excelchartconverter.cxx27
-rw-r--r--oox/source/xls/excelfilter.cxx136
-rw-r--r--oox/source/xls/excelhandlers.cxx174
-rwxr-xr-xoox/source/xls/excelvbaproject.cxx18
-rw-r--r--oox/source/xls/externallinkbuffer.cxx186
-rw-r--r--oox/source/xls/externallinkfragment.cxx357
-rwxr-xr-x[-rw-r--r--]oox/source/xls/formulabase.cxx107
-rw-r--r--oox/source/xls/formulaparser.cxx406
-rw-r--r--oox/source/xls/makefile.mk6
-rw-r--r--oox/source/xls/numberformatsbuffer.cxx47
-rw-r--r--oox/source/xls/ooxformulaparser.cxx30
-rw-r--r--oox/source/xls/pagesettings.cxx161
-rw-r--r--oox/source/xls/pivotcachebuffer.cxx339
-rw-r--r--oox/source/xls/pivotcachefragment.cxx189
-rw-r--r--oox/source/xls/pivottablebuffer.cxx414
-rw-r--r--oox/source/xls/pivottablefragment.cxx190
-rw-r--r--oox/source/xls/querytablebuffer.cxx390
-rw-r--r--oox/source/xls/querytablefragment.cxx68
-rw-r--r--oox/source/xls/richstring.cxx55
-rw-r--r--oox/source/xls/richstringcontext.cxx50
-rw-r--r--oox/source/xls/scenariobuffer.cxx35
-rw-r--r--oox/source/xls/scenariocontext.cxx42
-rw-r--r--oox/source/xls/sharedformulabuffer.cxx27
-rw-r--r--oox/source/xls/sharedstringsbuffer.cxx10
-rw-r--r--oox/source/xls/sharedstringsfragment.cxx40
-rw-r--r--oox/source/xls/sheetdatacontext.cxx460
-rw-r--r--oox/source/xls/stylesbuffer.cxx460
-rw-r--r--oox/source/xls/stylesfragment.cxx158
-rw-r--r--oox/source/xls/tablebuffer.cxx81
-rw-r--r--oox/source/xls/tablefragment.cxx56
-rw-r--r--oox/source/xls/themebuffer.cxx11
-rw-r--r--oox/source/xls/unitconverter.cxx27
-rw-r--r--oox/source/xls/viewsettings.cxx223
-rw-r--r--oox/source/xls/webquerybuffer.cxx199
-rw-r--r--oox/source/xls/workbookfragment.cxx335
-rw-r--r--oox/source/xls/workbookhelper.cxx236
-rw-r--r--oox/source/xls/workbooksettings.cxx80
-rw-r--r--oox/source/xls/worksheetbuffer.cxx33
-rw-r--r--oox/source/xls/worksheetfragment.cxx692
-rw-r--r--oox/source/xls/worksheethelper.cxx326
-rw-r--r--oox/source/xls/worksheetsettings.cxx66
-rw-r--r--oox/util/oox.component41
-rw-r--r--postprocess/packcomponents/makefile.mk1
-rw-r--r--postprocess/packregistry/makefile.mk4
-rw-r--r--[-rwxr-xr-x]reportbuilder/util/makefile.pmk0
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx2
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
-rw-r--r--reportdesign/source/ui/inspection/ReportComponentHandler.cxx2
-rw-r--r--rsc/inc/rscdb.hxx1
-rw-r--r--rsc/inc/vclrsc.hxx181
-rw-r--r--rsc/source/parser/rscicpx.cxx1
-rw-r--r--rsc/source/parser/rscinit.cxx2
-rw-r--r--sax/source/tools/fshelper.cxx11
-rw-r--r--sc/inc/addruno.hxx2
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/inc/docuno.hxx2
-rw-r--r--sc/inc/fmtuno.hxx6
-rwxr-xr-x[-rw-r--r--]sc/inc/pch/precompiled_sc.hxx4
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/inc/unonames.hxx1
-rw-r--r--sc/source/core/data/conditio.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx3
-rw-r--r--sc/source/core/data/documen8.cxx11
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/drwlayer.cxx0
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/makefile.mk1
-rw-r--r--sc/source/core/data/postit.cxx7
-rw-r--r--sc/source/core/data/stlsheet.cxx7
-rw-r--r--sc/source/core/data/table1.cxx6
-rw-r--r--sc/source/core/inc/core_pch.hxx2
-rw-r--r--sc/source/core/tool/formulaparserpool.cxx21
-rw-r--r--sc/source/filter/excel/excdoc.cxx5
-rw-r--r--sc/source/filter/excel/excel.cxx2
-rw-r--r--sc/source/filter/excel/excimp8.cxx72
-rw-r--r--sc/source/filter/excel/excrecds.cxx4
-rw-r--r--sc/source/filter/excel/xecontent.cxx2
-rw-r--r--sc/source/filter/excel/xeescher.cxx2
-rw-r--r--sc/source/filter/excel/xeformula.cxx6
-rw-r--r--sc/source/filter/excel/xename.cxx3
-rw-r--r--sc/source/filter/excel/xepage.cxx2
-rw-r--r--sc/source/filter/excel/xepivot.cxx2
-rw-r--r--sc/source/filter/excel/xerecord.cxx2
-rw-r--r--sc/source/filter/excel/xestream.cxx79
-rw-r--r--sc/source/filter/excel/xestring.cxx2
-rw-r--r--sc/source/filter/excel/xestyle.cxx2
-rw-r--r--sc/source/filter/excel/xetable.cxx2
-rw-r--r--sc/source/filter/excel/xeview.cxx2
-rwxr-xr-x[-rw-r--r--]sc/source/filter/excel/xichart.cxx0
-rw-r--r--sc/source/filter/excel/xicontent.cxx5
-rw-r--r--sc/source/filter/excel/xistyle.cxx13
-rwxr-xr-x[-rw-r--r--]sc/source/filter/excel/xlchart.cxx0
-rwxr-xr-x[-rw-r--r--]sc/source/filter/excel/xlformula.cxx2
-rw-r--r--sc/source/filter/excel/xltools.cxx6
-rw-r--r--sc/source/filter/inc/filt_pch.hxx6
-rw-r--r--sc/source/filter/inc/xestream.hxx4
-rw-r--r--sc/source/filter/inc/xistyle.hxx3
-rwxr-xr-x[-rw-r--r--]sc/source/filter/inc/xlchart.hxx0
-rw-r--r--sc/source/filter/inc/xlescher.hxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx2
-rw-r--r--[-rwxr-xr-x]sc/source/filter/xml/XMLCodeNameProvider.cxx2
-rwxr-xr-xsc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx11
-rw-r--r--sc/source/ui/docshell/docsh.cxx1
-rw-r--r--sc/source/ui/docshell/docsh4.cxx368
-rw-r--r--sc/source/ui/inc/docsh.hxx8
-rw-r--r--sc/source/ui/inc/prevwsh.hxx4
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx6
-rw-r--r--sc/source/ui/inc/ui_pch.hxx3
-rw-r--r--sc/source/ui/inc/viewfunc.hxx5
-rw-r--r--sc/source/ui/src/scstring.src14
-rw-r--r--sc/source/ui/unoobj/addruno.cxx27
-rw-r--r--sc/source/ui/unoobj/docuno.cxx63
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx41
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx6
-rw-r--r--sc/source/ui/view/drawview.cxx12
-rw-r--r--sc/source/ui/view/formatsh.cxx8
-rw-r--r--sc/source/ui/view/prevwsh.cxx95
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/printfun.cxx0
-rw-r--r--sc/source/ui/view/tabview3.cxx4
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx124
-rw-r--r--sc/source/ui/view/viewfun4.cxx4
-rw-r--r--sc/source/ui/view/viewfunc.cxx4
-rw-r--r--scp2/source/ooo/common_brand.scp8
-rw-r--r--scp2/source/ooo/profileitem_ooo.scp18
-rwxr-xr-xsd/inc/pch/precompiled_sd.hxx3
-rw-r--r--[-rwxr-xr-x]sd/qa/unoapi/sd.sce0
-rwxr-xr-xsd/source/core/drawdoc4.cxx21
-rw-r--r--[-rwxr-xr-x]sd/source/core/glob.src0
-rwxr-xr-xsd/source/core/stlpool.cxx11
-rw-r--r--[-rwxr-xr-x]sd/source/filter/ppt/propread.cxx0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/animations/CustomAnimationDialog.cxx0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/animations/CustomAnimationPane.cxx10
-rwxr-xr-x[-rw-r--r--]sd/source/ui/annotations/annotations.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/menuids3_tmpl.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/menuids4_tmpl.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/menuids_tmpl.src0
-rw-r--r--[-rwxr-xr-x]sd/source/ui/app/optsitem.cxx39
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/popup.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/popup2_tmpl.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/strings.src2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/app/toolbox.src0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/LayerTabBar.cxx0
-rwxr-xr-xsd/source/ui/dlg/dlgass.cxx2
-rwxr-xr-xsd/source/ui/func/fuconstr.cxx92
-rwxr-xr-xsd/source/ui/func/fudraw.cxx30
-rwxr-xr-x[-rw-r--r--]sd/source/ui/func/fusel.cxx8
-rwxr-xr-xsd/source/ui/func/futext.cxx11
-rwxr-xr-xsd/source/ui/inc/ViewShellBase.hxx14
-rwxr-xr-xsd/source/ui/inc/optsitem.hxx9
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slideshow/makefile.mk3
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slideshow/showwin.cxx0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slideshow/slideshow.hrc33
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slideshow/slideshow.src70
-rwxr-xr-xsd/source/ui/slideshow/slideshowimpl.cxx544
-rwxr-xr-xsd/source/ui/slideshow/slideshowimpl.hxx11
-rwxr-xr-x[-rw-r--r--]sd/source/ui/table/tableobjectbar.cxx0
-rwxr-xr-xsd/source/ui/view/DocumentRenderer.cxx52
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/DocumentRenderer.hrc15
-rwxr-xr-xsd/source/ui/view/DocumentRenderer.src94
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx46
-rwxr-xr-xsd/source/ui/view/drviews1.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/drviewsb.cxx0
-rwxr-xr-xsd/source/ui/view/drviewse.cxx10
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/sdruler.cxx0
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/tabcontr.cxx0
-rw-r--r--set_soenv.in10
-rw-r--r--setup_native/scripts/admin.pl2
-rwxr-xr-xsetup_native/source/packinfo/shellscripts_extensions.txt168
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx208
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx2
-rw-r--r--sfx2/inc/sfx2/event.hxx1
-rw-r--r--sfx2/inc/sfx2/mnumgr.hxx2
-rw-r--r--sfx2/inc/sfx2/module.hxx2
-rw-r--r--sfx2/inc/sfx2/printer.hxx60
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx5
-rw-r--r--sfx2/source/appl/appmain.cxx15
-rw-r--r--[-rwxr-xr-x]sfx2/source/dialog/securitypage.src0
-rwxr-xr-xsfx2/source/doc/printhelper.cxx74
-rwxr-xr-x[-rw-r--r--]sfx2/source/doc/syspath.cxx0
-rw-r--r--[-rwxr-xr-x]sfx2/source/inc/helpid.hrc0
-rw-r--r--[-rwxr-xr-x]sfx2/source/menu/thessubmenu.hxx0
-rw-r--r--sfx2/source/view/printer.cxx314
-rw-r--r--sfx2/source/view/viewprn.cxx155
-rw-r--r--slideshow/source/engine/color.cxx4
-rw-r--r--slideshow/source/engine/makefile.mk2
-rw-r--r--slideshow/source/engine/shapes/shapeimporter.cxx7
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx50
-rw-r--r--slideshow/source/engine/slide/userpaintoverlay.cxx91
-rw-r--r--slideshow/source/engine/slide/userpaintoverlay.hxx9
-rw-r--r--slideshow/source/engine/slideshowimpl.cxx54
-rw-r--r--slideshow/source/inc/slide.hxx7
-rw-r--r--slideshow/util/makefile.pmk2
-rw-r--r--soldep/inc/soldep/soldlg.hxx2
-rw-r--r--solenv/config/sdev300.ini12
-rw-r--r--solenv/gbuild/AllLangResTarget.mk17
-rw-r--r--solenv/gbuild/TargetLocations.mk4
-rwxr-xr-xsolenv/gbuild/platform/macosx.mk4
-rwxr-xr-xsolenv/gbuild/platform/solaris.mk9
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/unxmacx.mk5
-rw-r--r--[-rwxr-xr-x]solenv/src/reg-component.map0
-rw-r--r--[-rwxr-xr-x]starmath/inc/starmath.hrc0
-rw-r--r--[-rwxr-xr-x]starmath/inc/toolbox.hxx0
-rw-r--r--starmath/inc/view.hxx2
-rw-r--r--[-rwxr-xr-x]starmath/sdi/smath.sdi0
-rw-r--r--[-rwxr-xr-x]starmath/sdi/smslots.sdi0
-rw-r--r--[-rwxr-xr-x]starmath/source/dialog.cxx0
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--starmath/source/math_pch.cxx833
-rwxr-xr-x[-rw-r--r--]starmath/source/smres.src6
-rw-r--r--[-rwxr-xr-x]starmath/source/toolbox.hrc0
-rw-r--r--[-rwxr-xr-x]starmath/source/toolbox.src0
-rwxr-xr-xstarmath/source/unomodel.cxx36
-rwxr-xr-xstarmath/source/view.cxx2
-rw-r--r--[-rwxr-xr-x]starmath/uiconfig/smath/menubar/menubar.xml0
-rw-r--r--[-rwxr-xr-x]stoc/source/simpleregistry/simpleregistry.cxx0
-rw-r--r--svtools/AllLangResTarget_svt.mk1
-rw-r--r--svtools/Library_svt.mk1
-rw-r--r--svtools/Package_inc.mk1
-rw-r--r--svtools/inc/pch/precompiled_svtools.hxx4
-rw-r--r--svtools/inc/svtools/apearcfg.hxx20
-rw-r--r--svtools/inc/svtools/embedhlp.hxx4
-rw-r--r--svtools/inc/svtools/printdlg.hxx297
-rw-r--r--svtools/inc/svtools/svmedit.hxx2
-rw-r--r--svtools/source/config/apearcfg.cxx87
-rwxr-xr-x[-rw-r--r--]svtools/source/control/headbar.cxx0
-rw-r--r--svtools/source/dialogs/printdlg.cxx791
-rw-r--r--svtools/source/dialogs/printdlg.hrc74
-rw-r--r--svtools/source/dialogs/printdlg.src349
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx2
-rw-r--r--svtools/source/misc/ehdl.cxx2
-rw-r--r--svtools/source/misc/embedtransfer.cxx2
-rw-r--r--svx/inc/pch/precompiled_svx.hxx4
-rw-r--r--svx/inc/svx/fmgridif.hxx2
-rw-r--r--svx/inc/svx/fmtools.hxx2
-rw-r--r--svx/inc/svx/xdef.hxx3
-rw-r--r--svx/prj/makefile.mk2
-rw-r--r--svx/source/dialog/bmpmask.src4
-rw-r--r--svx/source/dialog/contdlg.src2
-rw-r--r--svx/source/dialog/optgrid.cxx12
-rw-r--r--svx/source/dialog/optgrid.src4
-rw-r--r--svx/source/fmcomp/gridcell.cxx11
-rw-r--r--svx/source/gallery2/gallery1.cxx2
-rw-r--r--svx/source/items/customshapeitem.cxx2
-rw-r--r--svx/source/sdr/contact/objectcontactofobjlistpainter.cxx2
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx2
-rw-r--r--[-rwxr-xr-x]svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx0
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx2
-rw-r--r--svx/source/svdraw/svddrgmt.cxx38
-rw-r--r--svx/source/svdraw/svdobj.cxx6
-rw-r--r--svx/source/svdraw/svdotxtr.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx2
-rw-r--r--svx/source/unodraw/unoprov.cxx2
-rw-r--r--svx/source/xoutdev/xpool.cxx4
-rwxr-xr-x[-rw-r--r--]sw/inc/dochdl.hrc0
-rw-r--r--[-rwxr-xr-x]sw/inc/docsh.hxx0
-rw-r--r--sw/inc/modcfg.hxx2
-rwxr-xr-x[-rw-r--r--]sw/inc/pch/precompiled_sw.hxx5
-rw-r--r--sw/inc/swmodule.hxx2
-rw-r--r--sw/source/core/view/printdata.cxx162
-rw-r--r--[-rwxr-xr-x]sw/source/core/view/viewsh.cxx0
-rw-r--r--sw/source/filter/ascii/parasc.cxx20
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx3
-rw-r--r--sw/source/filter/ww8/docxexport.cxx3
-rw-r--r--sw/source/filter/ww8/docxfootnotes.hxx1
-rw-r--r--sw/source/filter/xml/xmliteme.cxx2
-rw-r--r--sw/source/ui/app/docshini.cxx41
-rw-r--r--sw/source/ui/config/optdlg.src15
-rw-r--r--sw/source/ui/config/optpage.cxx62
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx20
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/dochdl.src0
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/gloshdl.cxx0
-rw-r--r--sw/source/ui/inc/pview.hxx1
-rw-r--r--sw/source/ui/inc/uitool.hxx2
-rw-r--r--sw/source/ui/inc/usrpref.hxx2
-rw-r--r--sw/source/ui/inc/view.hxx2
-rw-r--r--[-rwxr-xr-x]sw/source/ui/lingu/olmenu.cxx0
-rw-r--r--[-rwxr-xr-x]sw/source/ui/shells/langhelper.cxx0
-rw-r--r--sw/source/ui/uiview/pview.cxx13
-rw-r--r--sw/source/ui/uiview/view.cxx3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uiview/view.hrc0
-rw-r--r--sw/source/ui/uiview/viewfunc.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/viewling.cxx0
-rw-r--r--sw/source/ui/uiview/viewprt.cxx37
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-base-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-calc-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-calc-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-chart-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-draw-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-draw-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-impress-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-impress-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-master-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-math-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-writer-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so7-writer-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-base-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-base-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-calc-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-calc-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-calc-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-chart-doc.icobin10134 -> 10134 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-configuration.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-draw-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-draw-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-draw-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-empty-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-empty-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-image-doc.icobin10134 -> 10134 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-impress-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-impress-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-impress-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-macro-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-main-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-master-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-math-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-math-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-open.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-printer.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-web-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-writer-app.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-writer-doc.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so8-writer-tem.icobin25214 -> 25214 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_base_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_calc_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_calc_tem.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_chart_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_draw_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_draw_tem.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_empty_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_empty_tem.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_global_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_html_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_impress_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_impress_tem.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_macro_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_math_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_writer_doc.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]sysui/desktop/icons/so9_writer_tem.icobin295606 -> 295606 bytes
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/optional/ch2_flexible_source_range_selection.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/optional/ch2_xml_format.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/optional/includes/loadsave/ch2_losa.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/ch2_updt_calc.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_file.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_format.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_format1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_insert.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_insert_ctl.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_menu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_ole.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_toolbars.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_view.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_window.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/required/includes/ch2_wizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_axes.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_chart_type.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_data_labels.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_grids.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_legend.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_select.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_statistics.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_tab_borders_lines.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_tab_pages.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/tools/ch_tools_titles.inc0
-rw-r--r--[-rwxr-xr-x]testautomation/dbaccess/optional/dba_misc_Macros.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_Grid.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_Several1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/ctrl_TextControl.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_ADOAccess.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_AdabasD.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Dbase.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_DbaseFunction.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_IndexDesign.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Query.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Relations.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Spreadsheet.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Text.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_Windows.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/db_hsqldb.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/misc_Macros.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_DateTime.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_Grouping.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_PageNumber.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/wiz_FormWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/optional/includes/wiz_TableWizard.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/DatabaseTypes.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/Forms.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/MainApp.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/Query.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/ReportBuilder01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/Table.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/TableDesign.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/Wizards.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/required/includes/Xforms01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/controltools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/dbinit.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/dbtools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/formtools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/querytools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/dbaccess/tools/tabletools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/display_name.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/fileopen.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/help.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/identifiers.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/meta-inf.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/includes/options.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/nbproject/private/config.properties0
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/optional/input/issues/Logging.xcu0
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/required/e_update.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_delete_modules.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_documents.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_eventbinding.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_ide.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_library_export.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_library_import.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_macros.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_modulehide.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_modulenames.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_modules.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_package_export.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_protected_libraries.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_usertemplate.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_vba_compat_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/configuration.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_file_open.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_preview.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_table_autoformat.inc0
-rw-r--r--testautomation/framework/optional/includes/f_usage_tracking.inc2
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_allowed_names.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_autocomplete.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_cjk_files.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_cjk_folders.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_document_properties.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_filternames.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders4.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders5.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders6.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_folders7.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_multiselection.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_passwords.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_triggers.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/fontworkgallery.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_bookmarks.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_applications.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_content.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_topics.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_search.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_view_topics.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/loadsave_files.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/loadsave_new.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/menuentries.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_asia.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_data.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_int1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_lan1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_loadsave_html.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_loadsave_msoffice.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_loadsave_vba.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_accessibility.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_appearance.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_fontreplacement.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_java.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_memory.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_paths.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_print.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_security.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_userdata.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_view.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/scripting_organizers.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_broken_signature.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_evilmacro1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_evilmacro2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_evilmacro3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_recommend_password.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_trusted_path.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/standardbar2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/toolbar_behavior.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/basic_dialog_export.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/basic_dialog_i18n_import.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/basic_macroassignment.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/basic_organizer.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/first.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/help_browser.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/printer_administration.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/security_dialogs.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/standard_toolbar_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/standard_toolbar_3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/standard_toolbar_4.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/standard_toolbar_5.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/standard_toolbar_6.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/tools_customize.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/tools_options.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/wizard_mailmerge.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/required/includes/wizard_webpage.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/CJK_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/customize_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/fileoperations.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/formcontrols.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/help_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/i18n_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/options_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/pbrowser_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/private_environment.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/scriptorganizer_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/spadmin_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/webtools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/framework/tools/includes/window_tools.inc0
-rw-r--r--[-rwxr-xr-x]testautomation/global/input/empty/please_do_not_delete_this_file0
-rwxr-xr-x[-rw-r--r--]testautomation/global/required/includes/g_001.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/required/includes/g_009.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/required/includes/g_customize.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/required/includes/g_numberformatter1.inc0
-rw-r--r--testautomation/global/required/includes/g_option.inc11
-rwxr-xr-x[-rw-r--r--]testautomation/global/required/includes/g_option_application.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/sid/bars.sid0
-rwxr-xr-x[-rw-r--r--]testautomation/global/sid/context.sid0
-rwxr-xr-x[-rw-r--r--]testautomation/global/sid/others.sid0
-rwxr-xr-x[-rw-r--r--]testautomation/global/system/includes/declare.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/system/includes/iniinfo.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/system/includes/inivalue.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/system/includes/status.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/system/includes/sysinfo.inc0
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/closeoffice.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_accels.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_basic_ide_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_docfuncs.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_extension_manager_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_key_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_locale_strings1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_locale_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_ole.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_security_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_set_standard_controls.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_spreadsheet_tools1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_stringtools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_toolbar_tools1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_toolbar_writer.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_ui_filters.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_user_info.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_xml1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_xml2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_xml_filter1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/required/t_lists.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/required/t_option.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/required/t_option2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/required/t_tools1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/required/t_tools3.inc0
-rwxr-xr-xtestautomation/global/win/edia_p_s.win168
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_accessability.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_area.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_arrangealign.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_autocorrection.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_character.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_clipboard.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_clipexport.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_convertto.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_crossfading.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_customshapes.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_demoguide.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_dimensions.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_edit.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_export_html.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_findreplace.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_format.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_group.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_imagemap.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_insert.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_line.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_load_save.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_mediaplayer.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_navigator.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_ole.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_paneview.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_paragraph.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_savepictureas.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_shaddow.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_slidelayer.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_stylist.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_tables.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_toolbars.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_tools.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/g_zoom.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/gallery.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/gallery2.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_animation.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_headerfooter.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_pengine.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_saveloadlayout.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_shape.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_slidecopy.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/optional/i_view.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/required/d_opt.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/required/d_updt.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/required/i_opt.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/required/i_updt_1.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/graphics/required/i_updt_2.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/math/optional/includes/m_106_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_002_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_003_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_004_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_006_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_007_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_010_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/math/required/includes/m_020_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_editmenu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_helpmenu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/required/includes/c_upd_windowmenu.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/tools/includes/c_cell_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/tools/includes/c_select_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/tools/includes/c_tool_l10n_mnomics.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/spreadsheet/tools/includes/c_tool_options.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/CJKCTLDependency/CJKCTLDependency1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/autotext/w_autotext.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/calculate/w_calculate.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/filter/w_filter.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/fontwork/w_fontwork1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/option/wh_o_3.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/option/wr_o_5.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/redlining/w_redlining2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/section/w_section_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/section/w_section_2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/section/w_section_tools.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/stylist/w_stylist.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/table/w_204_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/table/w_204a_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/includes/table/w_204b_.inc0
-rw-r--r--testautomation/writer/optional/includes/textframes/w_textframes2.inc4
-rwxr-xr-x[-rw-r--r--]testautomation/writer/optional/input/import/dostext.txt0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_CJKCTLDependency.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_alternative_text.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_autotext.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_calculate.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_chinesetranslate.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_drawing_tools.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_dropdownLB.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_fields.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_fontwork.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_formatpage.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_formatparagraph.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_hhConversion.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_hyphenation.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_insertgraphic.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_loadsave.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_navigator.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_redlining.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_section.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_sorting.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_spellcheck.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_stylist.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_textframes.bas0
-rw-r--r--[-rwxr-xr-x]testautomation/writer/optional/w_undo.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_001a_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_002_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_003_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_005_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_005b_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_006_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_008_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_009_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_010_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_010_1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/required/includes/w_011_.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_get_locale_strings.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_locale_strings2.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tool1.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tool4.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tool5.inc0
-rw-r--r--testautomation/writer/tools/includes/w_tool6.inc4
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tool7.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tools_autocorrection.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tools_drawing.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tools_hyphenation.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/writer/tools/includes/w_tools_undo.inc0
-rw-r--r--[-rwxr-xr-x]testautomation/xml/optional/docbook_losa.bas0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/c_datapilot_pagefields.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/docbook_001.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/f_xml_save_ms_ole.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxd7_01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxd7_02.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxd7_03.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxd7_04.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxd7_05.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxi7_01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxm7_01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxw7_01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxw7_01a.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxw7_02.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/sxw7_03.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/optional/includes/w_xml_vertical_alignment.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/required/includes/oasis_graphics_01.inc0
-rwxr-xr-x[-rw-r--r--]testautomation/xml/tools/includes/itools1.inc0
-rwxr-xr-x[-rw-r--r--]testgraphical/prj/d.lst0
-rw-r--r--toolkit/AllLangResTarget_tk.mk2
-rw-r--r--toolkit/inc/layout/layout.hxx4
-rw-r--r--toolkit/inc/pch/precompiled_toolkit.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxtoolkit.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/vclunohelper.hxx4
-rw-r--r--toolkit/source/awt/vclxplugin.hxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx18
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx4
-rw-r--r--tools/inc/tools/fldunit.hxx1
-rw-r--r--tools/inc/tools/mapunit.hxx1
-rw-r--r--tools/inc/tools/wintypes.hxx6
-rwxr-xr-x[-rw-r--r--]ucb/source/core/cmdenv.cxx0
-rwxr-xr-x[-rw-r--r--]unotools/inc/unotools/lingucfg.hxx0
-rwxr-xr-x[-rw-r--r--]unotools/source/config/lingucfg.cxx0
-rw-r--r--[-rwxr-xr-x]uui/source/iahndl.cxx0
-rwxr-xr-xuui/source/iahndl.hxx2
-rw-r--r--[-rwxr-xr-x]uui/source/ids.hrc0
-rw-r--r--[-rwxr-xr-x]uui/source/logindlg.src0
-rw-r--r--[-rwxr-xr-x]uui/source/loginerr.hxx0
-rw-r--r--[-rwxr-xr-x]uui/source/masterpasscrtdlg.cxx0
-rw-r--r--[-rwxr-xr-x]uui/source/passworddlg.cxx0
-rw-r--r--[-rwxr-xr-x]uui/source/passworddlg.hrc0
-rw-r--r--[-rwxr-xr-x]uui/source/passworddlg.hxx0
-rw-r--r--[-rwxr-xr-x]uui/source/passworderrs.src0
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx6
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx6
-rwxr-xr-xvbahelper/source/vbahelper/vbaeventshelperbase.cxx4
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm73
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm3
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx2
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm4
-rw-r--r--vcl/inc/vcl/button.hxx1
-rw-r--r--vcl/inc/vcl/field.hxx2
-rw-r--r--vcl/inc/vcl/lazydelete.hxx39
-rw-r--r--vcl/inc/vcl/mapmod.hxx2
-rw-r--r--vcl/inc/vcl/outfont.hxx16
-rw-r--r--vcl/inc/vcl/print.hxx37
-rw-r--r--vcl/inc/vcl/prndlg.hxx4
-rw-r--r--vcl/inc/vcl/salatype.hxx47
-rw-r--r--vcl/inc/vcl/salctype.hxx12
-rw-r--r--vcl/inc/vcl/salgdi.hxx1
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salnativewidgets.hxx19
-rw-r--r--vcl/inc/vcl/settings.hxx54
-rw-r--r--vcl/inc/vcl/svids.hrc6
-rw-r--r--vcl/inc/vcl/symbol.hxx3
-rw-r--r--vcl/inc/vcl/tabctrl.hxx12
-rw-r--r--vcl/inc/vcl/windata.hxx49
-rw-r--r--vcl/inc/vcl/window.h14
-rwxr-xr-xvcl/inc/vcl/window.hxx2
-rw-r--r--vcl/os2/source/app/salinst.cxx2
-rw-r--r--vcl/os2/source/window/salframe.cxx51
-rw-r--r--vcl/prj/d.lst3
-rw-r--r--vcl/source/app/salvtables.cxx4
-rw-r--r--vcl/source/app/settings.cxx46
-rw-r--r--vcl/source/app/svapp.cxx1
-rw-r--r--vcl/source/control/button.cxx178
-rw-r--r--vcl/source/control/menubtn.cxx9
-rw-r--r--vcl/source/control/scrbar.cxx57
-rw-r--r--vcl/source/control/slider.cxx7
-rw-r--r--vcl/source/control/tabctrl.cxx149
-rw-r--r--vcl/source/gdi/bmpconv.cxx16
-rw-r--r--vcl/source/gdi/outdev3.cxx6
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdevnative.cxx63
-rw-r--r--vcl/source/gdi/print.cxx105
-rwxr-xr-xvcl/source/gdi/print3.cxx86
-rw-r--r--vcl/source/src/btntext.src64
-rw-r--r--vcl/source/src/images.src39
-rw-r--r--vcl/source/src/print.src85
-rw-r--r--vcl/source/window/decoview.cxx100
-rwxr-xr-x[-rw-r--r--]vcl/source/window/menu.cxx60
-rw-r--r--vcl/source/window/printdlg.cxx162
-rw-r--r--[-rwxr-xr-x]vcl/source/window/window.cxx61
-rw-r--r--vcl/source/window/winproc.cxx1
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx7
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx2
-rw-r--r--vcl/unx/headless/svpinst.cxx2
-rw-r--r--vcl/unx/inc/i18n_im.hxx4
-rw-r--r--vcl/unx/inc/saldisp.hxx18
-rw-r--r--vcl/unx/inc/salgdi.h24
-rw-r--r--vcl/unx/inc/xfont.hxx162
-rw-r--r--vcl/unx/source/app/saldisp.cxx10
-rw-r--r--vcl/unx/source/app/salinst.cxx2
-rw-r--r--vcl/unx/source/gdi/makefile.mk10
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx9
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx578
-rw-r--r--vcl/unx/source/gdi/xfont.cxx780
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.cxx686
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.hxx228
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.cxx1001
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.hxx272
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.cxx268
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.hxx92
-rw-r--r--vcl/unx/source/window/salframe.cxx2
-rw-r--r--vcl/util/makefile.mk1
-rw-r--r--vcl/util/target.pmk5
-rwxr-xr-x[-rw-r--r--]vcl/win/inc/saldata.hxx8
-rw-r--r--vcl/win/source/app/saldata.cxx37
-rwxr-xr-x[-rw-r--r--]vcl/win/source/app/salinst.cxx53
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/salgdi3.cxx480
-rwxr-xr-xvcl/win/source/gdi/salnativewidgets-luna.cxx143
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/winlayout.cxx93
-rwxr-xr-xvcl/win/source/window/salframe.cxx257
-rw-r--r--vcl/win/source/window/salobj.cxx12
-rw-r--r--writerfilter/source/filter/ImportFilter.cxx3
-rw-r--r--writerfilter/source/ooxml/model.xml26
-rw-r--r--writerfilter/source/ooxml/namespaceids.xsl2
-rw-r--r--writerfilter/source/resourcemodel/namespace_preprocess.pl25
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx22
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/handler/property_handler_base.cxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/handler/vcl_date_handler.cxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/handler/vcl_date_handler.hxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/handler/vcl_time_handler.cxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/handler/vcl_time_handler.hxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/property_group.hxx0
-rw-r--r--[-rwxr-xr-x]xmloff/source/forms/property_meta_data.hxx0
-rw-r--r--[-rwxr-xr-x]xmlreader/prj/d.lst0
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx14
1417 files changed, 19195 insertions, 23674 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx
index 5ab160535aa0..c2526cbec18d 100644
--- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx
@@ -34,7 +34,7 @@
#include "accessibility/extended/accessiblebrowseboxcell.hxx"
#endif
#include <cppuhelper/implbase2.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
// ============================================================================
namespace accessibility
{
diff --git a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
index 847896a14588..f5320c2fd20f 100644
--- a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
+++ b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
@@ -29,8 +29,7 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
-#include <vcl/wintypes.hxx>
-#include <tools/gen.hxx>
+#include <tools/wintypes.hxx>
namespace com { namespace sun { namespace star { namespace datatransfer { namespace clipboard {
class XClipboard;
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index a288c3d4d3a7..1b22b32388ec 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -34,7 +34,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/uieventslogger.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
#endif
@@ -79,7 +79,6 @@
#include <vcl/fixed.hxx>
#include <vcl/wrkwin.hxx>
#include <osl/diagnose.h>
-#include <vcl/wintypes.hxx>
#include <svtools/valueset.hxx>
#include <svtools/roadmap.hxx>
#include <svtools/table/tablecontrol.hxx>
diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx
index ada6c60a6b35..61f3ad52309e 100644
--- a/automation/source/server/statemnt.hxx
+++ b/automation/source/server/statemnt.hxx
@@ -40,7 +40,7 @@
#ifndef _STATEMNT_HXX
#define _STATEMNT_HXX
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <tools/time.hxx>
diff --git a/automation/util/manually_added_ids.hid b/automation/util/manually_added_ids.hid
index 7372dc0d9879..7372dc0d9879 100644..100755
--- a/automation/util/manually_added_ids.hid
+++ b/automation/util/manually_added_ids.hid
diff --git a/basctl/source/basicide/basicprint.src b/basctl/source/basicide/basicprint.src
index 1f301d3461a9..06bb6b057150 100644
--- a/basctl/source/basicide/basicprint.src
+++ b/basctl/source/basicide/basicprint.src
@@ -33,8 +33,6 @@ StringArray RID_PRINTDLG_STRLIST
{
< "Print range"; >;
< "All ~Pages"; >;
- < "Print all pages of the printable content."; >;
< "Pa~ges"; >;
- < "Print only some pages of the printable content."; >;
};
};
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index e2042d49876c..1f8fe51c21dd 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -45,8 +45,8 @@ BasicRenderable::BasicRenderable( IDEBaseWindow* pWin )
, mpWindow( pWin )
{
ResStringArray aStrings( IDEResId( RID_PRINTDLG_STRLIST ) );
- DBG_ASSERT( aStrings.Count() >= 5, "resource incomplete" );
- if( aStrings.Count() < 5 ) // bad resource ?
+ DBG_ASSERT( aStrings.Count() >= 3, "resource incomplete" );
+ if( aStrings.Count() < 3 ) // bad resource ?
return;
m_aUIProperties.realloc( 3 );
@@ -63,13 +63,13 @@ BasicRenderable::BasicRenderable( IDEBaseWindow* pWin )
// create a choice for the range to print
rtl::OUString aPrintContentName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
Sequence< rtl::OUString > aChoices( 2 );
- Sequence< rtl::OUString > aHelpTexts( 2 );
+ Sequence< rtl::OUString > aHelpIds( 2 );
aChoices[0] = aStrings.GetString( 1 );
- aHelpTexts[0] = aStrings.GetString( 2 );
- aChoices[1] = aStrings.GetString( 3 );
- aHelpTexts[1] = aStrings.GetString( 4 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aChoices[1] = aStrings.GetString( 2 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
m_aUIProperties[1].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
aPrintContentName,
aChoices,
0 );
diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx
index e8f9e004ca6a..ae45c383c74d 100644
--- a/basic/inc/pch/precompiled_basic.hxx
+++ b/basic/inc/pch/precompiled_basic.hxx
@@ -272,7 +272,7 @@
#include "vcl/timer.hxx"
#include "vcl/toolbox.hxx"
#include "vcl/window.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vcl/wrkwin.hxx"
#include "vos/diagnose.hxx"
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 97f6ed227d47..cfd84567644a 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -37,7 +37,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/sound.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <basic/sbx.hxx>
#include <svl/zforlist.hxx>
diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx
index 3820c4e42657..36888d038ceb 100644
--- a/canvas/source/vcl/backbuffer.cxx
+++ b/canvas/source/vcl/backbuffer.cxx
@@ -48,7 +48,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx
index 31c78283a128..c09721a5cfaf 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -138,7 +138,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx
index 4c0ea4fd6d3b..46561bc3f835 100644
--- a/canvas/source/vcl/spritedevicehelper.cxx
+++ b/canvas/source/vcl/spritedevicehelper.cxx
@@ -67,7 +67,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx
index 199564a9f024..fed813c55c76 100644..100755
--- a/chart2/inc/pch/precompiled_chart2.hxx
+++ b/chart2/inc/pch/precompiled_chart2.hxx
@@ -268,7 +268,7 @@
#include "unotools/configitem.hxx"
#include "unotools/eventlisteneradapter.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "vos/mutex.hxx"
//---MARKER---
diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx
index 0cc8180b3dd2..4b5196e7f902 100644
--- a/chart2/source/controller/inc/ConfigurationAccess.hxx
+++ b/chart2/source/controller/inc/ConfigurationAccess.hxx
@@ -29,7 +29,7 @@
#define _CHART2_CONFIGURATIONACCESS_HXX
// header for enum FieldUnit
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
//.............................................................................
namespace chart
diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx
index effc47392078..effc47392078 100755..100644
--- a/comphelper/inc/comphelper/docpasswordrequest.hxx
+++ b/comphelper/inc/comphelper/docpasswordrequest.hxx
diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx
index 263b68b24c7c..48dfe50b1645 100644
--- a/comphelper/inc/comphelper/sequenceasvector.hxx
+++ b/comphelper/inc/comphelper/sequenceasvector.hxx
@@ -86,6 +86,17 @@ class SequenceAsVector : public ::std::vector< TElementType >
{}
//---------------------------------------
+ /** @short creates a new vector with the given length.
+
+ @param nLength
+ the number of elements for the new vector.
+ */
+ explicit SequenceAsVector(sal_Int32 nLength) :
+ ::std::vector< TElementType >( static_cast< size_t >( nLength ) )
+ {
+ }
+
+ //---------------------------------------
/** @short creates a new deque from the given uno sequence.
@param lSource
diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx
index 15c2e09ba0f3..15c2e09ba0f3 100755..100644
--- a/comphelper/source/misc/docpasswordrequest.cxx
+++ b/comphelper/source/misc/docpasswordrequest.cxx
diff --git a/cppu/inc/com/sun/star/uno/Sequence.h b/cppu/inc/com/sun/star/uno/Sequence.h
index da9906533583..71bb42c7413b 100644
--- a/cppu/inc/com/sun/star/uno/Sequence.h
+++ b/cppu/inc/com/sun/star/uno/Sequence.h
@@ -125,7 +125,7 @@ public:
@param len initial sequence length
*/
- inline Sequence( sal_Int32 len );
+ inline explicit Sequence( sal_Int32 len );
/** Destructor: Releases sequence handle. Last handle will destruct
elements and free memory.
diff --git a/cppuhelper/inc/cppuhelper/factory.hxx b/cppuhelper/inc/cppuhelper/factory.hxx
index 579ee876cb39..2f1afcab1726 100644
--- a/cppuhelper/inc/cppuhelper/factory.hxx
+++ b/cppuhelper/inc/cppuhelper/factory.hxx
@@ -27,9 +27,7 @@
#ifndef _CPPUHELPER_FACTORY_HXX_
#define _CPPUHELPER_FACTORY_HXX_
-#ifndef _RTL_STRING_HXX_
#include <rtl/ustring.hxx>
-#endif
#include <uno/dispatcher.h>
#include <rtl/unload.h>
@@ -54,7 +52,7 @@ typedef struct _uno_Environment uno_Environment;
compiled it. If the environment is NOT session specific (needs no additional context),
then this function should return the environment type name and leave ppEnv (to 0).
- @paramppEnvTypeName environment type name; string must be constant
+ @param ppEnvTypeName environment type name; string must be constant
@param ppEnv function returns its environment if the environment is session specific,
i.e. has special context
*/
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 16026aaff6d1..16026aaff6d1 100644..100755
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
diff --git a/cui/source/dialogs/hyphen.hrc b/cui/source/dialogs/hyphen.hrc
index f76e2aa75770..f76e2aa75770 100644..100755
--- a/cui/source/dialogs/hyphen.hrc
+++ b/cui/source/dialogs/hyphen.hrc
diff --git a/cui/source/dialogs/thesdlg.hrc b/cui/source/dialogs/thesdlg.hrc
index 994c933246de..994c933246de 100644..100755
--- a/cui/source/dialogs/thesdlg.hrc
+++ b/cui/source/dialogs/thesdlg.hrc
diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx
index b682c8d0c129..b682c8d0c129 100755..100644
--- a/cui/source/dialogs/thesdlg_impl.hxx
+++ b/cui/source/dialogs/thesdlg_impl.hxx
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 1f441d728d63..1f441d728d63 100755..100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 502b212c8a91..502b212c8a91 100644..100755
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 45cf2fdbf79e..45cf2fdbf79e 100644..100755
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx
index 99b292b560a5..99b292b560a5 100644..100755
--- a/cui/source/inc/thesdlg.hxx
+++ b/cui/source/inc/thesdlg.hxx
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index ff10e2744533..bcc4dbf54dcb 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -945,12 +945,14 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe
aColorBoxes[0]->SetHelpId( aColorLBHids[0] );
+ OSL_ENSURE( nCount < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])), "too few helpIDs for color listboxes" );
for( sal_Int32 i = 1; i < nCount; i++ )
{
if(aColorBoxes[i])
{
aColorBoxes[i]->CopyEntries( *aColorBoxes[0] );
- aColorBoxes[i]->SetHelpId( aColorLBHids[i] );
+ if( i < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])) )
+ aColorBoxes[i]->SetHelpId( aColorLBHids[i] );
}
}
}
diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.src b/dbaccess/source/ui/dlg/UserAdminDlg.src
index faa7f33302d7..d3a59a511deb 100644
--- a/dbaccess/source/ui/dlg/UserAdminDlg.src
+++ b/dbaccess/source/ui/dlg/UserAdminDlg.src
@@ -49,7 +49,6 @@ TabDialog DLG_DATABASE_USERADMIN
{
OutputSize = TRUE ;
HelpId = HID_DSADMIN_TABCONTROL;
- SingleLine=TRUE;
};
String STR_PAGETITLE_USERADMIN
{
diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src
index f37c67148e18..7a94c0dafb4c 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.src
+++ b/dbaccess/source/ui/dlg/advancedsettings.src
@@ -351,7 +351,6 @@ TabDialog DLG_DATABASE_ADVANCED
{
OutputSize = TRUE ;
HelpId = HID_DSADMIN_TABCONTROL;
- SingleLine=TRUE;
};
String STR_GENERATED_VALUE
diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src
index 1d8744f07b53..f16edc83a761 100644
--- a/dbaccess/source/ui/dlg/dbadmin.src
+++ b/dbaccess/source/ui/dlg/dbadmin.src
@@ -113,7 +113,6 @@ TabDialog DLG_DATABASE_ADMINISTRATION
{
OutputSize = TRUE ;
HelpId = HID_DSADMIN_TABCONTROL;
- SingleLine=TRUE;
};
//.........................................................................
@@ -147,7 +146,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE
{
OutputSize = TRUE ;
HelpId = HID_DSADMIN_TABCONTROL;
- SingleLine=TRUE;
};
Text [ en-US ] = "Database properties" ;
};
diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src
index 5fc9cdc12f23..4d6812143598 100644
--- a/dbaccess/source/ui/dlg/dbadminsetup.src
+++ b/dbaccess/source/ui/dlg/dbadminsetup.src
@@ -56,7 +56,6 @@ ModalDialog DLG_DATABASE_WIZARD
{
OutputSize = TRUE ;
HelpId = HID_DSADMIN_TABCONTROL;
- SingleLine=TRUE;
};
String STR_DBWIZARDTITLE
diff --git a/default_images/res/commandimagelist/lc_showannotation.png b/default_images/res/commandimagelist/lc_showannotations.png
index dd3d968a8faf..dd3d968a8faf 100755
--- a/default_images/res/commandimagelist/lc_showannotation.png
+++ b/default_images/res/commandimagelist/lc_showannotations.png
Binary files differ
diff --git a/default_images/res/commandimagelist/lch_showannotation.png b/default_images/res/commandimagelist/lch_showannotations.png
index b298f8cf843d..b298f8cf843d 100755
--- a/default_images/res/commandimagelist/lch_showannotation.png
+++ b/default_images/res/commandimagelist/lch_showannotations.png
Binary files differ
diff --git a/default_images/res/commandimagelist/sc_showannotation.png b/default_images/res/commandimagelist/sc_showannotations.png
index 4b987016b68b..4b987016b68b 100755
--- a/default_images/res/commandimagelist/sc_showannotation.png
+++ b/default_images/res/commandimagelist/sc_showannotations.png
Binary files differ
diff --git a/default_images/res/commandimagelist/sch_showannotation.png b/default_images/res/commandimagelist/sch_showannotations.png
index cd3155082eed..cd3155082eed 100755
--- a/default_images/res/commandimagelist/sch_showannotation.png
+++ b/default_images/res/commandimagelist/sch_showannotations.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_01.png b/default_images/toolkit/tk/spinner03-32-hc_01.png
index c3596c19f276..c3596c19f276 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_01.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_01.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_02.png b/default_images/toolkit/tk/spinner03-32-hc_02.png
index e2ca6b965d23..e2ca6b965d23 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_02.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_02.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_03.png b/default_images/toolkit/tk/spinner03-32-hc_03.png
index 6609d3a6d300..6609d3a6d300 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_03.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_03.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_04.png b/default_images/toolkit/tk/spinner03-32-hc_04.png
index e70a393be204..e70a393be204 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_04.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_04.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_05.png b/default_images/toolkit/tk/spinner03-32-hc_05.png
index 63eb3e10375c..63eb3e10375c 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_05.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_05.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_06.png b/default_images/toolkit/tk/spinner03-32-hc_06.png
index c072e397cc00..c072e397cc00 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_06.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_06.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_07.png b/default_images/toolkit/tk/spinner03-32-hc_07.png
index 801ea3b36f9e..801ea3b36f9e 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_07.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_07.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_08.png b/default_images/toolkit/tk/spinner03-32-hc_08.png
index 60635b1e47e1..60635b1e47e1 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_08.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_08.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_09.png b/default_images/toolkit/tk/spinner03-32-hc_09.png
index 0a4513daa636..0a4513daa636 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_09.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_09.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_10.png b/default_images/toolkit/tk/spinner03-32-hc_10.png
index 06fbd02faf7f..06fbd02faf7f 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_10.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_10.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_11.png b/default_images/toolkit/tk/spinner03-32-hc_11.png
index 89e14cd33786..89e14cd33786 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_11.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_11.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_12.png b/default_images/toolkit/tk/spinner03-32-hc_12.png
index 2ced9380408e..2ced9380408e 100644
--- a/default_images/toolkit/source/awt/spinner03-32-hc_12.png
+++ b/default_images/toolkit/tk/spinner03-32-hc_12.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_01.png b/default_images/toolkit/tk/spinner03-grey_01.png
index 2c6b6937f8b2..2c6b6937f8b2 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_01.png
+++ b/default_images/toolkit/tk/spinner03-grey_01.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_02.png b/default_images/toolkit/tk/spinner03-grey_02.png
index 4662ddf54924..4662ddf54924 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_02.png
+++ b/default_images/toolkit/tk/spinner03-grey_02.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_03.png b/default_images/toolkit/tk/spinner03-grey_03.png
index 8c1a0be53da5..8c1a0be53da5 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_03.png
+++ b/default_images/toolkit/tk/spinner03-grey_03.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_04.png b/default_images/toolkit/tk/spinner03-grey_04.png
index ba323f36244d..ba323f36244d 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_04.png
+++ b/default_images/toolkit/tk/spinner03-grey_04.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_05.png b/default_images/toolkit/tk/spinner03-grey_05.png
index f733dd17266c..f733dd17266c 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_05.png
+++ b/default_images/toolkit/tk/spinner03-grey_05.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_06.png b/default_images/toolkit/tk/spinner03-grey_06.png
index bbaebc36f565..bbaebc36f565 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_06.png
+++ b/default_images/toolkit/tk/spinner03-grey_06.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_07.png b/default_images/toolkit/tk/spinner03-grey_07.png
index d005cb55b4eb..d005cb55b4eb 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_07.png
+++ b/default_images/toolkit/tk/spinner03-grey_07.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_08.png b/default_images/toolkit/tk/spinner03-grey_08.png
index bda1e7192809..bda1e7192809 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_08.png
+++ b/default_images/toolkit/tk/spinner03-grey_08.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_09.png b/default_images/toolkit/tk/spinner03-grey_09.png
index 3e688421d95e..3e688421d95e 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_09.png
+++ b/default_images/toolkit/tk/spinner03-grey_09.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_10.png b/default_images/toolkit/tk/spinner03-grey_10.png
index d43e8866e10e..d43e8866e10e 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_10.png
+++ b/default_images/toolkit/tk/spinner03-grey_10.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_11.png b/default_images/toolkit/tk/spinner03-grey_11.png
index d67c895a2c7d..d67c895a2c7d 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_11.png
+++ b/default_images/toolkit/tk/spinner03-grey_11.png
Binary files differ
diff --git a/default_images/toolkit/source/awt/spinner03-grey_12.png b/default_images/toolkit/tk/spinner03-grey_12.png
index 9c3c4a849c6f..9c3c4a849c6f 100644
--- a/default_images/toolkit/source/awt/spinner03-grey_12.png
+++ b/default_images/toolkit/tk/spinner03-grey_12.png
Binary files differ
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 8eb4dd3cc25b..b64327bd7232 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -65,6 +65,8 @@ class Desktop : public Application
{
friend class UserInstall;
+ void doShutdown();
+
public:
enum BootstrapError
{
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 77172e549534..5020b89194d1 100644
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -44,16 +44,27 @@ cd "$sd_cwd"
#collect all bootstrap variables specified on the command line
#so that they can be passed as arguments to javaldx later on
+#Recognize the "sync" option. sync must be applied without any other
+#options except bootstrap variables or the verbose option
for arg in $@
do
case "$arg" in
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
+ sync) OPTSYNC=true;;
+ -v) VERBOSE=true;;
+ --verbose) VERBOSE=true;;
+ *) OPTOTHER=$arg;;
esac
done
+if [ "$OPTSYNC" = "true" ] && [ -z "$OPTOTHER" ]
+then
+ JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+fi
+
# extend the ld_library_path for java: javaldx checks the sofficerc for us
if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
- my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
+ my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS $JVMFWKPARAMS \
"-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
if [ -n "$my_path" ] ; then
LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
@@ -70,6 +81,6 @@ unset XENVIRONMENT
# SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
# execute binary
-exec "$sd_prog/unopkg.bin" "$@" \
+exec "$sd_prog/unopkg.bin" "$@" "$JVMFWKPARAMS" \
"-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a49cabc90bed..82af26653b84 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -202,6 +202,7 @@ static const ::rtl::OUString CFG_PATH_REG ( RTL_CONSTASCII_USTRINGP
static const ::rtl::OUString CFG_ENTRY_REGURL ( RTL_CONSTASCII_USTRINGPARAM( "URL" ));
static const ::rtl::OUString CFG_ENTRY_TEMPLATEREGURL ( RTL_CONSTASCII_USTRINGPARAM( "TemplateURL" ));
+static ::rtl::OUString getBrandSharePreregBundledPathURL();
// ----------------------------------------------------------------------------
ResMgr* Desktop::GetDesktopResManager()
@@ -578,6 +579,44 @@ static ::rtl::OUString getLastSyncFileURLFromUserInstallation()
return aTmp.makeStringAndClear();
}
+//Checks if the argument src is the folder of the help or configuration
+//backend in the prereg folder
+static bool excludeTmpFilesAndFolders(const rtl::OUString & src)
+{
+ const char helpBackend[] = "com.sun.star.comp.deployment.help.PackageRegistryBackend";
+ const char configBackend[] = "com.sun.star.comp.deployment.configuration.PackageRegistryBackend";
+ if (src.endsWithAsciiL(helpBackend, sizeof(helpBackend) - 1 )
+ || src.endsWithAsciiL(configBackend, sizeof(configBackend) - 1))
+ {
+ return true;
+ }
+ return false;
+}
+
+//If we are about to copy the contents of some special folder as determined
+//by excludeTmpFilesAndFolders, then we omit those files or folders with a name
+//derived from temporary folders.
+static bool isExcludedFileOrFolder( const rtl::OUString & name)
+{
+ char const * allowed[] = {
+ "backenddb.xml",
+ "configmgr.ini",
+ "registered_packages.db"
+ };
+
+ const unsigned int size = sizeof(allowed) / sizeof (char const *);
+ bool bExclude = true;
+ for (unsigned int i= 0; i < size; i ++)
+ {
+ ::rtl::OUString allowedName = ::rtl::OUString::createFromAscii(allowed[i]);
+ if (allowedName.equals(name))
+ {
+ bExclude = false;
+ break;
+ }
+ }
+ return bExclude;
+}
static osl::FileBase::RC copy_bundled_recursive(
const rtl::OUString& srcUnqPath,
@@ -605,6 +644,7 @@ throw()
sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type;
osl::DirectoryItem aDirItem;
+ bool bExcludeFiles = excludeTmpFilesAndFolders(srcUnqPath);
while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
{
@@ -634,7 +674,12 @@ throw()
// Special treatment for "lastsychronized" file. Must not be
// copied from the bundled folder!
- if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName ))
+ //Also do not copy *.tmp files and *.tmp_ folders. This affects the files/folders
+ //from the help and configuration backend
+ if ( IsDoc && (aFileName.equalsAscii( pLastSyncFileName )
+ || bExcludeFiles && isExcludedFileOrFolder(aFileName)))
+ bFilter = true;
+ else if (!IsDoc && bExcludeFiles && isExcludedFileOrFolder(aFileName))
bFilter = true;
}
@@ -1486,8 +1531,26 @@ void Desktop::AppEvent( const ApplicationEvent& rAppEvent )
HandleAppEvent( rAppEvent );
}
+struct ExecuteGlobals
+{
+ Reference < css::document::XEventListener > xGlobalBroadcaster;
+ sal_Bool bRestartRequested;
+ sal_Bool bUseSystemFileDialog;
+ std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
+ std::auto_ptr<SvtPathOptions> pPathOptions;
+
+ ExecuteGlobals()
+ : bRestartRequested( sal_False )
+ , bUseSystemFileDialog( sal_True )
+ {}
+};
+
+static ExecuteGlobals* pExecGlobals = NULL;
+
void Desktop::Main()
{
+ pExecGlobals = new ExecuteGlobals();
+
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Main" );
// Remember current context object
@@ -1545,14 +1608,8 @@ void Desktop::Main()
Reference< XMultiServiceFactory > xSMgr =
::comphelper::getProcessServiceFactory();
- std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
- std::auto_ptr<SvtPathOptions> pPathOptions;
-
Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
- sal_Bool bRestartRequested( sal_False );
- sal_Bool bUseSystemFileDialog(sal_True);
int nAcquireCount( 0 );
- Reference < css::document::XEventListener > xGlobalBroadcaster;
try
{
RegisterServices( xSMgr );
@@ -1638,7 +1695,7 @@ void Desktop::Main()
SetDisplayName( aTitle );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" );
- pPathOptions.reset( new SvtPathOptions);
+ pExecGlobals->pPathOptions.reset( new SvtPathOptions);
SetSplashScreenProgress(40);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" );
@@ -1655,7 +1712,7 @@ void Desktop::Main()
}
// create service for loadin SFX (still needed in startup)
- xGlobalBroadcaster = Reference < css::document::XEventListener >
+ pExecGlobals->xGlobalBroadcaster = Reference < css::document::XEventListener >
( xSMgr->createInstance(
DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY );
@@ -1711,13 +1768,13 @@ void Desktop::Main()
}
// keep a language options instance...
- pLanguageOptions.reset( new SvtLanguageOptions(sal_True));
+ pExecGlobals->pLanguageOptions.reset( new SvtLanguageOptions(sal_True));
- if (xGlobalBroadcaster.is())
+ if (pExecGlobals->xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
aEvent.EventName = ::rtl::OUString::createFromAscii("OnStartApp");
- xGlobalBroadcaster->notifyEvent(aEvent);
+ pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent);
}
SetSplashScreenProgress(50);
@@ -1737,7 +1794,7 @@ void Desktop::Main()
}
// check whether the shutdown is caused by restart
- bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+ pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
if ( pCmdLineArgs->IsHeadless() )
{
@@ -1745,11 +1802,11 @@ void Desktop::Main()
// headless mode relies on Application::EnableHeadlessMode()
// which does only work for VCL dialogs!!
SvtMiscOptions aMiscOptions;
- bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog();
+ pExecGlobals->bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog();
aMiscOptions.SetUseSystemFileDialog( sal_False );
}
- if ( !bRestartRequested )
+ if ( !pExecGlobals->bRestartRequested )
{
if ((!pCmdLineArgs->WantsToLoadDocument() ) &&
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
@@ -1821,10 +1878,9 @@ void Desktop::Main()
SvtAccessibilityOptions aOptions;
aOptions.SetVCLSettings();
- if ( !bRestartRequested )
+ if ( !pExecGlobals->bRestartRequested )
{
Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) );
-
sal_Bool bTerminateRequested = sal_False;
// Preload function depends on an initialized sfx application!
@@ -1880,9 +1936,9 @@ void Desktop::Main()
new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
// check whether the shutdown is caused by restart just before entering the Execute
- bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+ pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
- if ( !bRestartRequested )
+ if ( !pExecGlobals->bRestartRequested )
{
// if this run of the office is triggered by restart, some additional actions should be done
DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() );
@@ -1901,44 +1957,57 @@ void Desktop::Main()
FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
}
}
+ // CAUTION: you do not necessarily get here e.g. on the Mac.
+ // please put all deinitialization code into doShutdown
+ doShutdown();
+}
- if ( bRestartRequested )
+void Desktop::doShutdown()
+{
+ if( ! pExecGlobals )
+ return;
+
+ if ( pExecGlobals->bRestartRequested )
SetRestartState();
- if (xGlobalBroadcaster.is())
+ if (pExecGlobals->xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
aEvent.EventName = ::rtl::OUString::createFromAscii("OnCloseApp");
- xGlobalBroadcaster->notifyEvent(aEvent);
+ pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent);
}
- delete pResMgr;
+ delete pResMgr, pResMgr = NULL;
// Restore old value
+ CommandLineArgs* pCmdLineArgs = GetCommandLineArgs();
if ( pCmdLineArgs->IsHeadless() )
- SvtMiscOptions().SetUseSystemFileDialog( bUseSystemFileDialog );
+ SvtMiscOptions().SetUseSystemFileDialog( pExecGlobals->bUseSystemFileDialog );
// remove temp directory
RemoveTemporaryDirectory();
FlushConfiguration();
// The acceptors in the AcceptorMap must be released (in DeregisterServices)
// with the solar mutex unlocked, to avoid deadlock:
- nAcquireCount = Application::ReleaseSolarMutex();
+ ULONG nAcquireCount = Application::ReleaseSolarMutex();
DeregisterServices();
Application::AcquireSolarMutex(nAcquireCount);
tools::DeInitTestToolLib();
// be sure that path/language options gets destroyed before
// UCB is deinitialized
RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> dispose path/language options" );
- pLanguageOptions.reset( 0 );
- pPathOptions.reset( 0 );
+ pExecGlobals->pLanguageOptions.reset( 0 );
+ pExecGlobals->pPathOptions.reset( 0 );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- dispose path/language options" );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> deinit ucb" );
::ucbhelper::ContentBroker::deinitialize();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- deinit ucb" );
+ sal_Bool bRR = pExecGlobals->bRestartRequested;
+ delete pExecGlobals, pExecGlobals = NULL;
+
RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" );
- if ( bRestartRequested )
+ if ( bRR )
{
restartOnMac(true);
// wouldn't the solution be more clean if SalMain returns the exit code to the system?
@@ -2053,9 +2122,9 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
// unfortunately this broke the QUARTZ behavior which is to always run
// in quickstart mode since Mac applications do not usually quit
// when the last document closes
- #ifndef QUARTZ
+ //#ifndef QUARTZ
if ( bQuickstart )
- #endif
+ //#endif
{
Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
@@ -2123,17 +2192,6 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* )
}
hStyleSettings.SetUseImagesInMenus(bUseImagesInMenus);
- sal_uInt16 nTabStyle = hStyleSettings.GetTabControlStyle();
- nTabStyle &= ~STYLE_TABCONTROL_SINGLELINE;
- if( aAppearanceCfg.IsSingleLineTabCtrl() )
- nTabStyle |=STYLE_TABCONTROL_SINGLELINE;
-
- nTabStyle &= ~STYLE_TABCONTROL_COLOR;
- if( aAppearanceCfg.IsColoredTabCtrl() )
- nTabStyle |= STYLE_TABCONTROL_COLOR;
-
- hStyleSettings.SetTabControlStyle(nTabStyle);
-
hStyleSettings.SetDragFullOptions( nDragFullOptions );
rSettings.SetStyleSettings ( hStyleSettings );
}
@@ -3135,6 +3193,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
catch(const css::uno::Exception&)
{}
}
+ else if( rAppEvent.GetEvent() == "PRIVATE:DOSHUTDOWN" )
+ {
+ Desktop* pD = dynamic_cast<Desktop*>(GetpApp());
+ OSL_ENSURE( pD, "no desktop ?!?" );
+ if( pD )
+ pD->doShutdown();
+ }
}
void Desktop::OpenSplashScreen()
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 44f335dd509d..b1dbcdf861e9 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -388,6 +388,10 @@ void UpdateDialog::Thread::execute()
uno::Reference<ucb::XCommandEnvironment>());
} catch (lang::IllegalArgumentException& ) {
OSL_ASSERT(0);
+ continue;
+ } catch (css::ucb::CommandFailedException& ) {
+ OSL_ASSERT(0);
+ continue;
}
OSL_ASSERT(extensions.getLength() == 3);
if (extensions[0].is() )
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 709cca86c631..6eb547c4e98a 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -183,12 +183,8 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x
::cppu::WeakComponentImplHelper1< css::deployment::XExtensionManager >(getMutex()),
m_xContext( xContext )
{
- Reference<deploy::XPackageManagerFactory> xPackageManagerFactory(
- deploy::thePackageManagerFactory::get(m_xContext));
- m_userRepository = xPackageManagerFactory->getPackageManager(OUSTR("user"));
- m_sharedRepository = xPackageManagerFactory->getPackageManager(OUSTR("shared"));
- m_bundledRepository = xPackageManagerFactory->getPackageManager(OUSTR("bundled"));
- m_tmpRepository = xPackageManagerFactory->getPackageManager(OUSTR("tmp"));
+ m_xPackageManagerFactory = deploy::thePackageManagerFactory::get(m_xContext);
+ OSL_ASSERT(m_xPackageManagerFactory.is());
m_repositoryNames.push_back(OUSTR("user"));
m_repositoryNames.push_back(OUSTR("shared"));
@@ -201,6 +197,23 @@ ExtensionManager::~ExtensionManager()
{
}
+Reference<deploy::XPackageManager> ExtensionManager::getUserRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("user"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getSharedRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("shared"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getBundledRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("bundled"));
+}
+Reference<deploy::XPackageManager> ExtensionManager::getTmpRepository()
+{
+ return m_xPackageManagerFactory->getPackageManager(OUSTR("tmp"));
+}
+
Reference<task::XAbortChannel> ExtensionManager::createAbortChannel()
throw (uno::RuntimeException)
{
@@ -213,11 +226,11 @@ ExtensionManager::getPackageManager(::rtl::OUString const & repository)
{
Reference<deploy::XPackageManager> xPackageManager;
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else if (repository.equals(OUSTR("bundled")))
- xPackageManager = m_bundledRepository;
+ xPackageManager = getBundledRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -288,7 +301,7 @@ void ExtensionManager::addExtensionsToMap(
::std::list<Reference<deploy::XPackage> > extensionList;
try
{ //will throw an exception if the extension does not exist
- extensionList.push_back(m_userRepository->getDeployedPackage(
+ extensionList.push_back(getUserRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch(lang::IllegalArgumentException &)
{
@@ -296,7 +309,7 @@ void ExtensionManager::addExtensionsToMap(
}
try
{
- extensionList.push_back(m_sharedRepository->getDeployedPackage(
+ extensionList.push_back(getSharedRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch (lang::IllegalArgumentException &)
{
@@ -304,7 +317,7 @@ void ExtensionManager::addExtensionsToMap(
}
try
{
- extensionList.push_back(m_bundledRepository->getDeployedPackage(
+ extensionList.push_back(getBundledRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch (lang::IllegalArgumentException &)
{
@@ -508,7 +521,7 @@ Reference<deploy::XPackage> ExtensionManager::backupExtension(
if (xOldExtension.is())
{
- xBackup = m_tmpRepository->addPackage(
+ xBackup = getTmpRepository()->addPackage(
xOldExtension->getURL(), uno::Sequence<beans::NamedValue>(),
OUString(), Reference<task::XAbortChannel>(), tmpCmdEnv);
@@ -529,7 +542,7 @@ uno::Sequence< Reference<deploy::XPackageTypeInfo> >
ExtensionManager::getSupportedPackageTypes()
throw (uno::RuntimeException)
{
- return m_userRepository->getSupportedPackageTypes();
+ return getUserRepository()->getSupportedPackageTypes();
}
//Do some necessary checks and user interaction. This function does not
//aquire the extension manager mutex and that mutex must not be aquired
@@ -649,9 +662,9 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//Determine the repository to use
Reference<deploy::XPackageManager> xPackageManager;
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -664,7 +677,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
getTempExtension(url, xAbortChannel, xCmdEnv);
//Make sure the extension is removed from the tmp repository in case
//of an exception
- ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, m_tmpRepository);
+ ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository());
const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension);
const OUString sFileName = xTmpExtension->getName();
Reference<deploy::XPackage> xOldExtension;
@@ -708,7 +721,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//the xTmpExtension
//no command environment supplied, only this class shall interact
//with the user!
- xExtensionBackup = m_tmpRepository->importExtension(
+ xExtensionBackup = getTmpRepository()->importExtension(
xOldExtension, Reference<task::XAbortChannel>(),
Reference<ucb::XCommandEnvironment>());
tmpExtensionRemoveGuard.reset(xExtensionBackup);
@@ -857,9 +870,9 @@ void ExtensionManager::removeExtension(
{
//Determine the repository to use
if (repository.equals(OUSTR("user")))
- xPackageManager = m_userRepository;
+ xPackageManager = getUserRepository();
else if (repository.equals(OUSTR("shared")))
- xPackageManager = m_sharedRepository;
+ xPackageManager = getSharedRepository();
else
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
@@ -919,7 +932,7 @@ void ExtensionManager::removeExtension(
Reference<task::XAbortChannel>(),
tmpCmdEnv);
- m_tmpRepository->removePackage(
+ getTmpRepository()->removePackage(
dp_misc::getIdentifier(xExtensionBackup),
xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
fireModified();
@@ -932,7 +945,7 @@ void ExtensionManager::removeExtension(
}
if (xExtensionBackup.is())
- m_tmpRepository->removePackage(
+ getTmpRepository()->removePackage(
dp_misc::getIdentifier(xExtensionBackup),
xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
}
@@ -1160,13 +1173,13 @@ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > >
id2extensions mapExt;
uno::Sequence<Reference<deploy::XPackage> > userExt =
- m_userRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getUserRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, userExt, OUSTR("user"));
uno::Sequence<Reference<deploy::XPackage> > sharedExt =
- m_sharedRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getSharedRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, sharedExt, OUSTR("shared"));
uno::Sequence<Reference<deploy::XPackage> > bundledExt =
- m_bundledRepository->getDeployedPackages(xAbort, xCmdEnv);
+ getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled"));
//copy the values of the map to a vector for sorting
@@ -1236,7 +1249,7 @@ void ExtensionManager::reinstallDeployedExtensions(
const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
const OUString fileName = extensions[ pos ]->getName();
OSL_ASSERT(id.getLength());
- activateExtension(id, fileName, false, false, xAbortChannel, xCmdEnv );
+ activateExtension(id, fileName, false, true, xAbortChannel, xCmdEnv );
}
catch (lang::DisposedException &)
{
@@ -1260,6 +1273,64 @@ void ExtensionManager::reinstallDeployedExtensions(
}
}
+/** Works on the bundled repository. That is using the variables
+ BUNDLED_EXTENSIONS and BUNDLED_EXTENSIONS_USER.
+ */
+void ExtensionManager::synchronizeBundledPrereg(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ String sSynchronizingBundled(StrSyncRepository::get());
+ sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled"));
+ dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
+
+ Reference<deploy::XPackageManagerFactory> xPackageManagerFactory(
+ deploy::thePackageManagerFactory::get(m_xContext));
+
+ Reference<deploy::XPackageManager> xMgr =
+ xPackageManagerFactory->getPackageManager(OUSTR("bundled_prereg"));
+ xMgr->synchronize(xAbortChannel, xCmdEnv);
+ progressBundled.update(OUSTR("\n\n"));
+
+ uno::Sequence<Reference<deploy::XPackage> > extensions = xMgr->getDeployedPackages(
+ xAbortChannel, xCmdEnv);
+ try
+ {
+ for (sal_Int32 i = 0; i < extensions.getLength(); i++)
+ {
+ extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv);
+ }
+ }
+ catch (...)
+ {
+ OSL_ASSERT(0);
+ }
+ OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM(
+ "$BUNDLED_EXTENSIONS_PREREG/lastsynchronized"));
+ writeLastModified(lastSyncBundled, xCmdEnv);
+
+ } catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception in synchronize"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
sal_Bool ExtensionManager::synchronize(
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv )
@@ -1277,13 +1348,13 @@ sal_Bool ExtensionManager::synchronize(
String sSynchronizingShared(StrSyncRepository::get());
sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUSTR("shared"));
dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
- bModified = m_sharedRepository->synchronize(xAbortChannel, xCmdEnv);
+ bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv);
progressShared.update(OUSTR("\n\n"));
String sSynchronizingBundled(StrSyncRepository::get());
sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled"));
dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
- bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv);
+ bModified |= getBundledRepository()->synchronize(xAbortChannel, xCmdEnv);
progressBundled.update(OUSTR("\n\n"));
//Always determine the active extension. This is necessary for the
@@ -1410,7 +1481,7 @@ Reference<deploy::XPackage> ExtensionManager::getTempExtension(
{
Reference<ucb::XCommandEnvironment> tmpCmdEnvA(new TmpRepositoryCommandEnv());
- Reference<deploy::XPackage> xTmpPackage = m_tmpRepository->addPackage(
+ Reference<deploy::XPackage> xTmpPackage = getTmpRepository()->addPackage(
url, uno::Sequence<beans::NamedValue>(),OUString(), xAbortChannel, tmpCmdEnvA);
if (!xTmpPackage.is())
{
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index 683f45a1bd6e..e7a180a05de1 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -205,6 +205,12 @@ public:
css::lang::IllegalArgumentException,
css::uno::RuntimeException);
+ virtual void SAL_CALL synchronizeBundledPrereg(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException);
+
virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL
getExtensionsWithUnacceptedLicenses(
::rtl::OUString const & repository,
@@ -229,11 +235,7 @@ private:
};
css::uno::Reference< css::uno::XComponentContext> m_xContext;
-
- css::uno::Reference<css::deployment::XPackageManager> m_userRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_sharedRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_bundledRepository;
- css::uno::Reference<css::deployment::XPackageManager> m_tmpRepository;
+ css::uno::Reference<css::deployment::XPackageManagerFactory> m_xPackageManagerFactory;
//only to be used within addExtension
::osl::Mutex m_addMutex;
@@ -243,6 +245,11 @@ private:
*/
::std::list< ::rtl::OUString > m_repositoryNames;
+ css::uno::Reference<css::deployment::XPackageManager> getUserRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getSharedRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getBundledRepository();
+ css::uno::Reference<css::deployment::XPackageManager> getTmpRepository();
+
bool isUserDisabled(::rtl::OUString const & identifier,
::rtl::OUString const & filename);
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 4cc43a8386d8..6d4750bb2447 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -40,9 +40,8 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/registry/XRegistryKey.hpp"
#include "com/sun/star/task/XAbortChannel.hpp"
-#include "com/sun/star/ucb/CommandFailedException.hpp"
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/xml/dom/XElement.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
@@ -71,9 +70,8 @@ namespace xml = com::sun::star::xml ;
namespace dp_info {
class PackageInformationProvider :
- public ::cppu::WeakImplHelper3< deployment::XPackageInformationProvider,
- css_ucb::XCommandEnvironment,
- task::XInteractionHandler >
+ public ::cppu::WeakImplHelper1< deployment::XPackageInformationProvider >
+
{
public:
PackageInformationProvider( uno::Reference< uno::XComponentContext >const& xContext);
@@ -82,16 +80,6 @@ class PackageInformationProvider :
static uno::Sequence< rtl::OUString > getServiceNames();
static rtl::OUString getImplName();
- // XInteractionHandler
- virtual void SAL_CALL handle( const uno::Reference< task::XInteractionRequest >& Request )
- throw( uno::RuntimeException );
- // XCommandEnvironment
- virtual uno::Reference< task::XInteractionHandler > SAL_CALL getInteractionHandler()
- throw ( uno::RuntimeException ) { return static_cast<task::XInteractionHandler*>(this); };
-
- virtual uno::Reference< css_ucb::XProgressHandler > SAL_CALL getProgressHandler()
- throw ( uno::RuntimeException ) { return uno::Reference< css_ucb::XProgressHandler >(); };
-
// XPackageInformationProvider
virtual rtl::OUString SAL_CALL getPackageLocation( const rtl::OUString& extensionId )
throw ( uno::RuntimeException );
@@ -125,17 +113,6 @@ PackageInformationProvider::~PackageInformationProvider()
}
//------------------------------------------------------------------------------
-void SAL_CALL PackageInformationProvider::handle( uno::Reference< task::XInteractionRequest > const & rRequest)
- throw (uno::RuntimeException)
-{
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations();
- if ( xContinuations.getLength() == 1 )
- {
- xContinuations[0]->select();
- }
-}
-
-//------------------------------------------------------------------------------
rtl::OUString PackageInformationProvider::getPackageLocation(
const rtl::OUString & repository,
const rtl::OUString& _rExtensionId )
@@ -150,7 +127,7 @@ rtl::OUString PackageInformationProvider::getPackageLocation(
xManager->getDeployedExtensions(
repository,
uno::Reference< task::XAbortChannel >(),
- static_cast < XCommandEnvironment *> (this) ) );
+ uno::Reference< css_ucb::XCommandEnvironment > () ) );
for ( int pos = packages.getLength(); pos--; )
{
@@ -320,7 +297,7 @@ uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvi
const uno::Sequence< uno::Sequence< uno::Reference<deployment::XPackage > > >
allExt = mgr->getAllExtensions(
uno::Reference< task::XAbortChannel >(),
- static_cast < XCommandEnvironment *> (this) );
+ uno::Reference< css_ucb::XCommandEnvironment > () );
uno::Sequence< uno::Sequence< rtl::OUString > > retList;
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 44bc4d469f2f..2e2c5e2a2f53 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -370,6 +370,24 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
//No stamp file. We assume that bundled is always readonly. It must not be
//modified from ExtensionManager but only by the installer
}
+ else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") )) {
+ //This is a bundled repository but the registration data
+ //is in the brand layer: share/prereg
+ //It is special because the registration data are copied at the first startup
+ //into the user installation. The processed help and xcu files are not
+ //copied. Instead the backenddb.xml for the help backend references the help
+ //by using $BUNDLED_EXTENSION_PREREG instead $BUNDLED_EXTENSIONS_USER. The
+ //configmgr.ini also used $BUNDLED_EXTENSIONS_PREREG to refer to the xcu file
+ //which contain the replacement for %origin%.
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/registry");
+ logFile = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/log.txt");
+ }
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") )) {
that->m_activePackages = OUSTR(
"vnd.sun.star.expand:$TMP_EXTENSIONS/extensions");
@@ -949,6 +967,8 @@ void PackageManagerImpl::removePackage(
contentRemoved.writeStream( xData, true /* replace existing */ );
}
m_activePackagesDB->erase( id, fileName ); // to be removed upon next start
+ //remove any cached data hold by the backend
+ m_xRegistry->packageRemoved(xPackage->getURL(), xPackage->getPackageType()->getMediaType());
}
try_dispose( xPackage );
@@ -989,7 +1009,8 @@ OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data )
//The bundled extensions are not contained in an additional folder
//with a unique name. data.temporaryName contains already the
//UTF8 encoded folder name. See PackageManagerImpl::synchronize
- if (!m_context.equals(OUSTR("bundled")))
+ if (!m_context.equals(OUSTR("bundled"))
+ && !m_context.equals(OUSTR("bundled_prereg")))
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") );
buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar,
@@ -1341,6 +1362,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
{
bool bModified = false;
+ OSL_ASSERT(!m_context.equals(OUSTR("user")));
+
ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
//check if the folder exist at all. The shared extension folder
//may not exist for a normal user.
@@ -1366,8 +1389,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
//The temporary folders of user and shared have an '_' at then end.
//But the name in ActivePackages.temporaryName is saved without.
OUString title2 = title;
- bool bNotBundled = !m_context.equals(OUSTR("bundled"));
- if (bNotBundled)
+ bool bShared = m_context.equals(OUSTR("shared"));
+ if (bShared)
{
OSL_ASSERT(title2[title2.getLength() -1] == '_');
title2 = title2.copy(0, title2.getLength() -1);
@@ -1389,7 +1412,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
// an added extension
OUString url(m_activePackages_expanded + OUSTR("/") + titleEncoded);
OUString sExtFolder;
- if (bNotBundled) //that is, shared
+ if (bShared) //that is, shared
{
//Check if the extension was not "deleted" already which is indicated
//by a xxx.tmpremoved file
@@ -1411,7 +1434,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
ActivePackages::Data dbData;
dbData.temporaryName = titleEncoded;
- if (bNotBundled)
+ if (bShared)
dbData.fileName = sExtFolder;
else
dbData.fileName = title;
diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
index 898e7c931f6d..458ece3d0bd8 100644
--- a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
+++ b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
@@ -82,26 +82,29 @@ OUString ComponentBackendDb::getKeyElementName()
void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> componentNode = writeKeyElement(url);
- writeSimpleElement(OUSTR("java-type-library"),
- OUString::valueOf((sal_Bool) data.javaTypeLibrary),
- componentNode);
-
- writeSimpleList(
- data.implementationNames,
- OUSTR("implementation-names"),
- OUSTR("name"),
- componentNode);
-
- writeVectorOfPair(
- data.singletons,
- OUSTR("singletons"),
- OUSTR("item"),
- OUSTR("key"),
- OUSTR("value"),
- componentNode);
-
- save();
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> componentNode = writeKeyElement(url);
+ writeSimpleElement(OUSTR("java-type-library"),
+ OUString::valueOf((sal_Bool) data.javaTypeLibrary),
+ componentNode);
+
+ writeSimpleList(
+ data.implementationNames,
+ OUSTR("implementation-names"),
+ OUSTR("name"),
+ componentNode);
+
+ writeVectorOfPair(
+ data.singletons,
+ OUSTR("singletons"),
+ OUSTR("item"),
+ OUSTR("key"),
+ OUSTR("value"),
+ componentNode);
+
+ save();
+ }
}
catch(css::uno::Exception &)
{
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index d1511952a92a..650a7585d929 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -270,8 +270,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
std::auto_ptr<ComponentBackendDb> m_backendDb;
void addDataToDb(OUString const & url, ComponentBackendDb::Data const & data);
- void deleteDataFromDb(OUString const & url);
ComponentBackendDb::Data readDataFromDb(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
//These rdbs are for writing new service entries. The rdb files are copies
@@ -327,6 +327,10 @@ public:
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
using PackageRegistryBackend::disposing;
//Will be called from ComponentPackageImpl
@@ -660,12 +664,6 @@ void BackendImpl::addDataToDb(
m_backendDb->addEntry(url, data);
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
-{
- if (m_backendDb.get())
- m_backendDb->removeEntry(url);
-}
-
ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url)
{
ComponentBackendDb::Data data;
@@ -674,6 +672,12 @@ ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url)
return data;
}
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
+}
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -682,6 +686,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -1437,6 +1449,9 @@ void BackendImpl::ComponentPackageImpl::getComponentInfo(
// Package
//______________________________________________________________________________
+//We could use here BackendImpl::hasActiveEntry. However, this check is just as well.
+//And it also shows the problem if another extension has overwritten an implementation
+//entry, because it contains the same service implementation
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::ComponentPackageImpl::isRegistered_(
::osl::ResettableMutexGuard &,
@@ -1590,7 +1605,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
that->releaseObject(url);
}
m_registered = REG_NOT_REGISTERED;
- that->deleteDataFromDb(url);
+ getMyBackend()->revokeEntryFromDb(url);
}
}
@@ -1803,7 +1818,7 @@ void BackendImpl::ComponentsPackageImpl::processPackage_(
that->componentLiveRemoval(that->readDataFromDb(url));
}
that->releaseObject(url);
- that->deleteDataFromDb(url);
+ that->revokeEntryFromDb(url);
}
}
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 1e7ee5bfac8a..24e5587cd0cc 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -132,15 +132,21 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XCommandEnvironment> const & xCmdEnv );
void configmgrini_flush( Reference<XCommandEnvironment> const & xCmdEnv );
- bool addToConfigmgrIni( bool isSchema, OUString const & url,
+ /* The paramter isURL is false in the case of adding the conf:ini-entry
+ value from the backend db. This entry already contains the path as it
+ is used in the configmgr.ini.
+ */
+ bool addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
bool removeFromConfigmgrIni( bool isSchema, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data);
::boost::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url);
- OUString deleteDataFromDb(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
::std::list<OUString> getAllIniEntries();
+ bool hasActiveEntry(OUString const & url);
+ bool activateEntry(OUString const & url);
public:
BackendImpl( Sequence<Any> const & args,
@@ -149,6 +155,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
using PackageRegistryBackend::disposing;
};
@@ -240,18 +249,10 @@ void BackendImpl::addDataToDb(
return data;
}
-OUString BackendImpl::deleteDataFromDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
- OUString url2(url);
- if (m_backendDb.get()) {
- boost::optional< ConfigurationBackendDb::Data > data(
- m_backendDb->getEntry(url));
- if (data) {
- url2 = expandUnoRcTerm(data->iniEntry);
- }
- m_backendDb->removeEntry(url);
- }
- return url2;
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
}
::std::list<OUString> BackendImpl::getAllIniEntries()
@@ -262,6 +263,20 @@ OUString BackendImpl::deleteDataFromDb(OUString const & url)
return ::std::list<OUString>();
}
+bool BackendImpl::hasActiveEntry(OUString const & url)
+{
+ if (m_backendDb.get())
+ return m_backendDb->hasActiveEntry(url);
+ return false;
+}
+
+bool BackendImpl::activateEntry(OUString const & url)
+{
+ if (m_backendDb.get())
+ return m_backendDb->activateEntry(url);
+ return false;
+}
+
// XPackageRegistry
@@ -271,6 +286,13 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
//______________________________________________________________________________
@@ -457,10 +479,10 @@ void BackendImpl::configmgrini_flush(
}
//______________________________________________________________________________
-bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_,
+bool BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( dp_misc::makeRcTerm(url_) );
+ const OUString rcterm( isURL ? dp_misc::makeRcTerm(url_) : url_ );
const ::osl::MutexGuard guard( getMutex() );
configmgrini_verify_init( xCmdEnv );
t_stringlist & rSet = getFiles(isSchema);
@@ -509,6 +531,7 @@ bool BackendImpl::removeFromConfigmgrIni(
// Package
//______________________________________________________________________________
+
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
@@ -534,7 +557,7 @@ BackendImpl::PackageImpl::isRegistered_(
const rtl::OUString url(getURL());
bool bReg = false;
- if (that->readDataFromDb(getURL()))
+ if (that->hasActiveEntry(getURL()))
bReg = true;
if (!bReg)
//fallback for user extension registered in berkeley DB
@@ -677,38 +700,48 @@ void BackendImpl::PackageImpl::processPackage_(
if (doRegisterPackage)
{
- ConfigurationBackendDb::Data data;
- if (!m_isSchema)
+ if (getMyBackend()->activateEntry(getURL()))
{
- const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
- bool out_replaced = false;
- url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced);
- if (out_replaced)
- data.dataUrl = sModFolder;
- else
- deleteTempFolder(sModFolder);
+ ::boost::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url);
+ OSL_ASSERT(data);
+ that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv );
}
- //No need for live-deployment for bundled extension, because OOo
- //restarts after installation
- if (that->m_eContext != CONTEXT_BUNDLED
- && !startup)
+ else
{
- if (m_isSchema)
+ ConfigurationBackendDb::Data data;
+ if (!m_isSchema)
{
- com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->insertExtensionXcsFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
+ bool out_replaced = false;
+ url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced);
+ if (out_replaced)
+ data.dataUrl = sModFolder;
+ else
+ deleteTempFolder(sModFolder);
}
- else
+ //No need for live-deployment for bundled extension, because OOo
+ //restarts after installation
+ if (that->m_eContext != CONTEXT_BUNDLED
+ && that->m_eContext != CONTEXT_BUNDLED_PREREG
+ && !startup)
{
- com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->insertExtensionXcuFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ if (m_isSchema)
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcsFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
+ else
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcuFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
}
+ that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv );
+ data.iniEntry = dp_misc::makeRcTerm(url);
+ that->addDataToDb(getURL(), data);
}
- that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
- data.iniEntry = dp_misc::makeRcTerm(url);
- that->addDataToDb(getURL(), data);
}
else // revoke
{
@@ -741,7 +774,7 @@ void BackendImpl::PackageImpl::processPackage_(
else
deleteTempFolder(sModFolder);
}
- that->addToConfigmgrIni(schema, url_replaced, xCmdEnv);
+ that->addToConfigmgrIni(schema, true, url_replaced, xCmdEnv);
data.iniEntry = dp_misc::makeRcTerm(url_replaced);
that->addDataToDb(url2, data);
}
@@ -759,12 +792,17 @@ void BackendImpl::PackageImpl::processPackage_(
OSL_ASSERT(0);
}
}
- url = that->deleteDataFromDb(url);
- if (!m_isSchema) {
+
+ ::boost::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url);
+ //If an xcu file was life deployed then always a data entry is written.
+ //If the xcu file was already in the configmr.ini then there is also
+ //a data entry
+ if (!m_isSchema && data)
+ {
com::sun::star::configuration::Update::get(
- that->m_xComponentContext)->removeExtensionXcuFile(
- expandUnoRcUrl(url));
+ that->m_xComponentContext)->removeExtensionXcuFile(expandUnoRcTerm(data->iniEntry));
}
+ that->revokeEntryFromDb(url);
}
}
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
index 2a02c6d8efa0..2437c54ec734 100644
--- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
@@ -83,12 +83,15 @@ OUString ConfigurationBackendDb::getKeyElementName()
void ConfigurationBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> helpNode
- = writeKeyElement(url);
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
- writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
- writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode);
- save();
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode);
+ save();
+ }
}
catch (css::deployment::DeploymentException& )
{
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index fa53d4e78a15..266d4406cfde 100755
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -39,6 +39,7 @@
#include "ucbhelper/content.hxx"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
+#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
#include "com/sun/star/ucb/IOErrorCode.hpp"
#include "com/sun/star/beans/StringPair.hpp"
@@ -99,6 +100,8 @@ PackageRegistryBackend::PackageRegistryBackend(
m_eContext = CONTEXT_BUNDLED;
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") ))
m_eContext = CONTEXT_TMP;
+ else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") ))
+ m_eContext = CONTEXT_BUNDLED_PREREG;
else if (m_context.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") ))
m_eContext = CONTEXT_DOCUMENT;
@@ -121,6 +124,9 @@ void PackageRegistryBackend::check()
void PackageRegistryBackend::disposing()
{
try {
+ for ( t_string2ref::const_iterator i = m_bound.begin(); i != m_bound.end(); i++)
+ i->second->removeEventListener(this);
+ m_bound.clear();
m_xComponentContext.clear();
WeakComponentImplHelperBase::disposing();
}
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx
index 14b4f2374c5b..9629855aaf11 100644
--- a/desktop/source/deployment/registry/dp_backenddb.cxx
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -187,6 +187,74 @@ void BackendDb::removeEntry(::rtl::OUString const & url)
removeElement(sExpression.makeStringAndClear());
}
+void BackendDb::revokeEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ entry->setAttribute(OUSTR("revoked"), OUSTR("true"));
+ save();
+ }
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to revoke data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+bool BackendDb::activateEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ bool ret = false;
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ //no attribute "active" means it is active, that is, registered.
+ entry->removeAttribute(OUSTR("revoked"));
+ save();
+ ret = true;
+ }
+ return ret;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to revoke data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+bool BackendDb::hasActiveEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ bool ret = false;
+ Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY);
+ if (entry.is())
+ {
+ OUString sActive = entry->getAttribute(OUSTR("revoked"));
+ if (!sActive.equals(OUSTR("true")))
+ ret = true;
+ }
+ return ret;
+
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to determine an active entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
Reference<css::xml::dom::XNode> BackendDb::getKeyElement(
::rtl::OUString const & url)
{
@@ -577,32 +645,34 @@ RegisteredDb::RegisteredDb(
void RegisteredDb::addEntry(::rtl::OUString const & url)
{
try{
+ if (!activateEntry(url))
+ {
+ const OUString sNameSpace = getDbNSName();
+ const OUString sPrefix = getNSPrefix();
+ const OUString sEntry = getKeyElementName();
- const OUString sNameSpace = getDbNSName();
- const OUString sPrefix = getNSPrefix();
- const OUString sEntry = getKeyElementName();
-
- Reference<css::xml::dom::XDocument> doc = getDocument();
- Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
#if OSL_DEBUG_LEVEL > 0
- //There must not be yet an entry with the same url
- OUString sExpression(
- sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
- Reference<css::xml::dom::XNode> _extensionNode =
- getXPathAPI()->selectSingleNode(root, sExpression);
- OSL_ASSERT(! _extensionNode.is());
+ //There must not be yet an entry with the same url
+ OUString sExpression(
+ sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
+ Reference<css::xml::dom::XNode> _extensionNode =
+ getXPathAPI()->selectSingleNode(root, sExpression);
+ OSL_ASSERT(! _extensionNode.is());
#endif
- Reference<css::xml::dom::XElement> helpElement(
- doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry));
+ Reference<css::xml::dom::XElement> helpElement(
+ doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry));
- helpElement->setAttribute(OUSTR("url"), url);
+ helpElement->setAttribute(OUSTR("url"), url);
- Reference<css::xml::dom::XNode> helpNode(
- helpElement, UNO_QUERY_THROW);
- root->appendChild(helpNode);
+ Reference<css::xml::dom::XNode> helpNode(
+ helpElement, UNO_QUERY_THROW);
+ root->appendChild(helpNode);
- save();
+ save();
+ }
}
catch(css::uno::Exception &)
{
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index 0f309a5b729f..eecae4e391b7 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -135,6 +135,10 @@ public:
lang::IllegalArgumentException, RuntimeException);
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ RuntimeException);
+
};
//______________________________________________________________________________
@@ -185,6 +189,20 @@ OUString normalizeMediaType( OUString const & mediaType )
//______________________________________________________________________________
+void PackageRegistryImpl::packageRemoved(
+ ::rtl::OUString const & url, ::rtl::OUString const & mediaType)
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException)
+{
+ const t_string2registry::const_iterator i =
+ m_mediaType2backend.find(mediaType);
+
+ if (i != m_mediaType2backend.end())
+ {
+ i->second->packageRemoved(url, mediaType);
+ }
+}
+
void PackageRegistryImpl::insertBackend(
Reference<deployment::XPackageRegistry> const & xBackend )
{
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 968ee7297b0f..5ec739153831 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -71,6 +71,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
bool getFileAttributes(sal_uInt64& out_Attributes);
bool isUrlTargetInExtension();
+
public:
inline ExecutablePackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -92,8 +93,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url);
- bool isRegisteredInDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
Reference<deployment::XPackageTypeInfo> m_xExecutableTypeInfo;
std::auto_ptr<ExecutableBackendDb> m_backendDb;
@@ -104,6 +105,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
using PackageRegistryBackend::disposing;
};
@@ -134,20 +138,20 @@ void BackendImpl::addDataToDb(OUString const & url)
m_backendDb->addEntry(url);
}
-bool BackendImpl::isRegisteredInDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
- bool ret = false;
if (m_backendDb.get())
- ret = m_backendDb->getEntry(url);
- return ret;
+ m_backendDb->revokeEntry(url);
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
}
+
// XPackageRegistry
Sequence< Reference<deployment::XPackageTypeInfo> >
BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
@@ -156,6 +160,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
& m_xExecutableTypeInfo, 1);
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
@@ -217,7 +229,7 @@ BackendImpl::ExecutablePackageImpl::isRegistered_(
::rtl::Reference<dp_misc::AbortChannel> const &,
Reference<XCommandEnvironment> const & )
{
- bool registered = getMyBackend()->isRegisteredInDb(getURL());
+ bool registered = getMyBackend()->hasActiveEntry(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
sal_True /* IsPresent */,
beans::Ambiguous<sal_Bool>(
@@ -248,7 +260,8 @@ void BackendImpl::ExecutablePackageImpl::processPackage_(
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe
| osl_File_Attribute_OthExe);
- else if (!getMyBackend()->m_context.equals(OUSTR("bundled")))
+ else if (!getMyBackend()->m_context.equals(OUSTR("bundled"))
+ && !getMyBackend()->m_context.equals(OUSTR("bundled_prereg")))
//Bundled extension are required to be in the properly
//installed. That is an executable must have the right flags
OSL_ASSERT(0);
@@ -261,7 +274,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_(
}
else
{
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
}
}
@@ -277,7 +290,8 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension()
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE"));
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE"));
- else if (getMyBackend()->m_context.equals(OUSTR("bundled")))
+ else if (getMyBackend()->m_context.equals(OUSTR("bundled"))
+ || getMyBackend()->m_context.equals(OUSTR("bundled_prereg")))
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS"));
else
OSL_ASSERT(0);
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 53a7ba1c316d..0adb63614828 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -80,7 +80,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
- bool extensionContainsCompiledHelp();
+
public:
PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -88,6 +88,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<deployment::XPackageTypeInfo> const & xPackageType,
bool bRemoved, OUString const & identifier);
+ bool extensionContainsCompiledHelp();
+
//XPackage
virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getRegistrationDataURL()
throw (deployment::ExtensionRemovedException, css::uno::RuntimeException);
@@ -100,14 +102,16 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
- void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
- bool compiledHelp, Reference<ucb::XCommandEnvironment> const & xCmdEnv);
+ void implProcessHelp( PackageImpl * package, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv);
void implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector );
void addDataToDb(OUString const & url, HelpBackendDb::Data const & data);
::boost::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
+ bool activateEntry(OUString const & url);
Reference< ucb::XSimpleFileAccess > getFileAccess( void );
Reference< ucb::XSimpleFileAccess > m_xSFA;
@@ -123,6 +127,10 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
};
//______________________________________________________________________________
@@ -162,6 +170,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -220,12 +236,27 @@ void BackendImpl::addDataToDb(
return data;
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
+}
+
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
}
+bool BackendImpl::activateEntry(OUString const & url)
+{
+ if (m_backendDb.get())
+ return m_backendDb->activateEntry(url);
+ return false;
+}
+
+
//##############################################################################
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -235,13 +266,6 @@ BackendImpl::PackageImpl::PackageImpl(
: Package( myBackend, url, name, name, xPackageType, bRemoved,
identifier)
{
-// if (bRemoved)
-// {
-// ::boost::optional<HelpBackendDb::Data> opt =
-// getMyBackend()->readDataFromDb(url);
-// if (opt)
-// m_dbData = *opt;
-// }
}
// Package
@@ -260,7 +284,6 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
return pBackend;
}
-
bool BackendImpl::PackageImpl::extensionContainsCompiledHelp()
{
bool bCompiled = true;
@@ -311,6 +334,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp()
}
return bCompiled;
}
+
//______________________________________________________________________________
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
@@ -321,7 +345,7 @@ BackendImpl::PackageImpl::isRegistered_(
BackendImpl * that = getMyBackend();
bool bReg = false;
- if (that->readDataFromDb(getURL()))
+ if (that->hasActiveEntry(getURL()))
bReg = true;
return beans::Optional< beans::Ambiguous<sal_Bool> >( true, beans::Ambiguous<sal_Bool>( bReg, false ) );
@@ -340,9 +364,7 @@ void BackendImpl::PackageImpl::processPackage_(
(void)xCmdEnv;
BackendImpl* that = getMyBackend();
- Reference< deployment::XPackage > xThisPackage( this );
- that->implProcessHelp( xThisPackage, doRegisterPackage,
- extensionContainsCompiledHelp(), xCmdEnv);
+ that->implProcessHelp( this, doRegisterPackage, xCmdEnv);
}
beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
@@ -355,7 +377,7 @@ beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
::boost::optional<HelpBackendDb::Data> data =
getMyBackend()->readDataFromDb(getURL());
- if (data)
+ if (data && getMyBackend()->hasActiveEntry(getURL()))
return beans::Optional<OUString>(true, data->dataUrl);
return beans::Optional<OUString>(true, OUString());
@@ -368,224 +390,225 @@ static rtl::OUString aSlash( rtl::OUString::createFromAscii( "/" ) );
static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) );
-void BackendImpl::implProcessHelp
-( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp,
- Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+void BackendImpl::implProcessHelp(
+ PackageImpl * package, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
+ Reference< deployment::XPackage > xPackage(package);
OSL_ASSERT(xPackage.is());
if (doRegisterPackage)
{
- HelpBackendDb::Data data;
-
- if (compiledHelp)
+ //revive already processed help if possible
+ if ( !activateEntry(xPackage->getURL()))
{
+ HelpBackendDb::Data data;
data.dataUrl = xPackage->getURL();
- }
- else
- {
- const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
- data.dataUrl = sHelpFolder;
-
- Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
- rtl::OUString aHelpURL = xPackage->getURL();
- rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
- rtl::OUString aName = xPackage->getName();
- if( !xSFA->isFolder( aExpandedHelpURL ) )
+ if (!package->extensionContainsCompiledHelp())
{
- rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
- aErrStr += rtl::OUString::createFromAscii( "No help folder" );
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
- }
-
- Reference<XComponentContext> const & xContext = getComponentContext();
- Reference< script::XInvocation > xInvocation;
- if( xContext.is() )
- {
- try
+ const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
+ data.dataUrl = sHelpFolder;
+
+ Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
+ rtl::OUString aHelpURL = xPackage->getURL();
+ rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
+ rtl::OUString aName = xPackage->getName();
+ if( !xSFA->isFolder( aExpandedHelpURL ) )
{
- xInvocation = Reference< script::XInvocation >(
- xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
+ rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
+ aErrStr += rtl::OUString::createFromAscii( "No help folder" );
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
- catch (Exception &)
+
+ Reference<XComponentContext> const & xContext = getComponentContext();
+ Reference< script::XInvocation > xInvocation;
+ if( xContext.is() )
{
- // i98680: Survive missing lucene
+ try
+ {
+ xInvocation = Reference< script::XInvocation >(
+ xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
+ "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
+ }
+ catch (Exception &)
+ {
+ // i98680: Survive missing lucene
+ }
}
- }
- // Scan languages
- Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
- sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
- const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
- for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
- {
- rtl::OUString aLangURL = pSeq[iLang];
- if( xSFA->isFolder( aLangURL ) )
+ // Scan languages
+ Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
+ sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
+ const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
+ for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
{
- std::vector< rtl::OUString > aXhpFileVector;
-
- // calculate jar file URL
- sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
- // for example "/en"
- OUString langFolderURLSegment(
- aLangURL.copy(
- indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
-
- //create the folder in the "temporary folder"
- ::ucbhelper::Content langFolderContent;
- const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
- const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
- ::dp_misc::create_folder(
- &langFolderContent,
- langFolderDest, xCmdEnv);
-
- rtl::OUString aJarFile(
- makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
- OUSTR(".jar")));
- aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
-
- rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
- aJarFile, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 );
- rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.zip://" );
- aDestBasePath += aEncodedJarFilePath;
- aDestBasePath += rtl::OUString::createFromAscii( "/" );
-
- sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
-
- Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
- sal_Int32 nSubLangCount = aSubLangSeq.getLength();
- const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
- for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
+ rtl::OUString aLangURL = pSeq[iLang];
+ if( xSFA->isFolder( aLangURL ) )
{
- rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
- if( !xSFA->isFolder( aSubFolderURL ) )
- continue;
-
- implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
+ std::vector< rtl::OUString > aXhpFileVector;
+
+ // calculate jar file URL
+ sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
+ // for example "/en"
+ OUString langFolderURLSegment(
+ aLangURL.copy(
+ indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
+
+ //create the folder in the "temporary folder"
+ ::ucbhelper::Content langFolderContent;
+ const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
+ const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
+ ::dp_misc::create_folder(
+ &langFolderContent,
+ langFolderDest, xCmdEnv);
+
+ rtl::OUString aJarFile(
+ makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
+ OUSTR(".jar")));
+ aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
+
+ rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
+ aJarFile, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.zip://" );
+ aDestBasePath += aEncodedJarFilePath;
+ aDestBasePath += rtl::OUString::createFromAscii( "/" );
+
+ sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
+
+ Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
+ sal_Int32 nSubLangCount = aSubLangSeq.getLength();
+ const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
+ for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
+ {
+ rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
+ if( !xSFA->isFolder( aSubFolderURL ) )
+ continue;
- // Copy to package (later: move?)
- rtl::OUString aDestPath = aDestBasePath;
- rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
- aDestPath += aPureFolderName;
- xSFA->copy( aSubFolderURL, aDestPath );
- }
+ implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
- // Call compiler
- sal_Int32 nXhpFileCount = aXhpFileVector.size();
- rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- {
- rtl::OUString aXhpFile = aXhpFileVector[iXhp];
- rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
- pXhpFiles[iXhp] = aXhpRelFile;
- }
+ // Copy to package (later: move?)
+ rtl::OUString aDestPath = aDestBasePath;
+ rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
+ aDestPath += aPureFolderName;
+ xSFA->copy( aSubFolderURL, aDestPath );
+ }
- rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
- rtl::OUString aOfficeHelpPathFileURL;
- ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
+ // Call compiler
+ sal_Int32 nXhpFileCount = aXhpFileVector.size();
+ rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
+ for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
+ {
+ rtl::OUString aXhpFile = aXhpFileVector[iXhp];
+ rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
+ pXhpFiles[iXhp] = aXhpRelFile;
+ }
- HelpProcessingErrorInfo aErrorInfo;
- bool bSuccess = compileExtensionHelp(
- aOfficeHelpPathFileURL, aHelpStr, aLangURL,
- nXhpFileCount, pXhpFiles,
- langFolderDestExpanded, aErrorInfo );
+ rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
+ rtl::OUString aOfficeHelpPathFileURL;
+ ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
- if( bSuccess && xInvocation.is() )
- {
- Sequence<uno::Any> aParamsSeq( 6 );
-
- aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) );
-
- rtl::OUString aLang;
- sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
- if( nLastSlash != -1 )
- aLang = aLangURL.copy( nLastSlash + 1 );
- else
- aLang = rtl::OUString::createFromAscii( "en" );
- aParamsSeq[1] = uno::makeAny( aLang );
-
- aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) );
- aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) );
-
- aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
- rtl::OUString aSystemPath;
- osl::FileBase::getSystemPathFromFileURL(
- langFolderDestExpanded, aSystemPath );
- aParamsSeq[5] = uno::makeAny( aSystemPath );
-
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< uno::Any > aOutParam;
- uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ),
- aParamsSeq, aOutParamIndex, aOutParam );
- }
+ HelpProcessingErrorInfo aErrorInfo;
+ bool bSuccess = compileExtensionHelp(
+ aOfficeHelpPathFileURL, aHelpStr, aLangURL,
+ nXhpFileCount, pXhpFiles,
+ langFolderDestExpanded, aErrorInfo );
- if( !bSuccess )
- {
- USHORT nErrStrId = 0;
- switch( aErrorInfo.m_eErrorClass )
+ if( bSuccess && xInvocation.is() )
{
- case HELPPROCESSING_GENERAL_ERROR:
- case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
- case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
- default: ;
- };
-
- rtl::OUString aErrStr;
- if( nErrStrId != 0 )
+ Sequence<uno::Any> aParamsSeq( 6 );
+
+ aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) );
+
+ rtl::OUString aLang;
+ sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
+ if( nLastSlash != -1 )
+ aLang = aLangURL.copy( nLastSlash + 1 );
+ else
+ aLang = rtl::OUString::createFromAscii( "en" );
+ aParamsSeq[1] = uno::makeAny( aLang );
+
+ aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) );
+ aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) );
+
+ aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
+ rtl::OUString aSystemPath;
+ osl::FileBase::getSystemPathFromFileURL(
+ langFolderDestExpanded, aSystemPath );
+ aParamsSeq[5] = uno::makeAny( aSystemPath );
+
+ Sequence< sal_Int16 > aOutParamIndex;
+ Sequence< uno::Any > aOutParam;
+ uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ),
+ aParamsSeq, aOutParamIndex, aOutParam );
+ }
+
+ if( !bSuccess )
{
- aErrStr = getResourceString( nErrStrId );
-
- // Remoce CR/LF
- rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
- sal_Unicode nCR = 13, nLF = 10;
- sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
- sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
- sal_Int32 nCopy;
- if( nSearchCR != -1 || nSearchLF != -1 )
+ USHORT nErrStrId = 0;
+ switch( aErrorInfo.m_eErrorClass )
{
- if( nSearchCR == -1 )
- nCopy = nSearchLF;
- else if( nSearchLF == -1 )
- nCopy = nSearchCR;
- else
- nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
-
- aErrMsg = aErrMsg.copy( 0, nCopy );
- }
- aErrStr += aErrMsg;
- if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
+ case HELPPROCESSING_GENERAL_ERROR:
+ case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
+ case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
+ default: ;
+ };
+
+ rtl::OUString aErrStr;
+ if( nErrStrId != 0 )
{
- aErrStr += rtl::OUString::createFromAscii( " in " );
-
- rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
- rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- aErrStr += aDecodedFile;
- if( aErrorInfo.m_nXMLParsingLine != -1 )
+ aErrStr = getResourceString( nErrStrId );
+
+ // Remoce CR/LF
+ rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
+ sal_Unicode nCR = 13, nLF = 10;
+ sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
+ sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
+ sal_Int32 nCopy;
+ if( nSearchCR != -1 || nSearchLF != -1 )
+ {
+ if( nSearchCR == -1 )
+ nCopy = nSearchLF;
+ else if( nSearchLF == -1 )
+ nCopy = nSearchCR;
+ else
+ nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
+
+ aErrMsg = aErrMsg.copy( 0, nCopy );
+ }
+ aErrStr += aErrMsg;
+ if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
{
- aErrStr += rtl::OUString::createFromAscii( ", line " );
- aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ aErrStr += rtl::OUString::createFromAscii( " in " );
+
+ rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
+ rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ aErrStr += aDecodedFile;
+ if( aErrorInfo.m_nXMLParsingLine != -1 )
+ {
+ aErrStr += rtl::OUString::createFromAscii( ", line " );
+ aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ }
}
}
- }
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ }
}
}
}
+ //Writing the data entry replaces writing the flag file. If we got to this
+ //point the registration was successful.
+ addDataToDb(xPackage->getURL(), data);
}
- //Writing the data entry replaces writing the flag file. If we got to this
- //point the registration was successful.
- addDataToDb(xPackage->getURL(), data);
} //if (doRegisterPackage)
else
{
- deleteDataFromDb(xPackage->getURL());
+ revokeEntryFromDb(xPackage->getURL());
}
}
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
index 8ec9a39d5050..81057f744640 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
@@ -83,11 +83,14 @@ OUString HelpBackendDb::getKeyElementName()
void HelpBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> helpNode
- = writeKeyElement(url);
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
- writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
- save();
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ save();
+ }
}
catch (css::deployment::DeploymentException& )
{
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
index c7b730fd1b99..bcff008c00ae 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
@@ -76,6 +76,8 @@ public:
void addEntry(::rtl::OUString const & url, Data const & data);
::boost::optional<Data> getEntry(::rtl::OUString const & url);
+ //must also return the data urls for entries with @activ="false". That is,
+ //those are currently revoked.
::std::list< ::rtl::OUString> getAllDataUrls();
};
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 20fc2a8dc7e1..80aec2402a59 100755
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -299,7 +299,7 @@ protected:
// currently only for library containers:
enum {
CONTEXT_UNKNOWN,
- CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP,
+ CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, CONTEXT_BUNDLED_PREREG,
CONTEXT_DOCUMENT
} m_eContext;
bool m_readOnly;
@@ -345,6 +345,18 @@ protected:
static void deleteTempFolder(
::rtl::OUString const & folderUrl);
+ ::rtl::OUString getSharedRegistrationDataURL(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::deployment::XPackage> const & item);
+
+ /* The backends must implement this function, which is called
+ from XPackageRegistry::packageRemoved (also implemented here).
+ This ensure that the backends clean up their registration data
+ when an extension was removed.
+ */
+// virtual void deleteDbEntry( ::rtl::OUString const & url) = 0;
+
+
public:
struct StrRegisteringPackage : public ::dp_misc::StaticResourceString<
@@ -373,6 +385,12 @@ public:
css::deployment::InvalidRemovedParameterException,
css::ucb::CommandFailedException,
css::lang::IllegalArgumentException, css::uno::RuntimeException);
+
+// virtual void SAL_CALL packageRemoved(
+// ::rtl::OUString const & url, ::rtl::OUString const & mediaType)
+// throw (css::deployment::DeploymentException,
+// css::uno::RuntimeException);
+
};
}
diff --git a/desktop/source/deployment/registry/inc/dp_backenddb.hxx b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
index a0e477979f8c..299a6ec328ce 100644
--- a/desktop/source/deployment/registry/inc/dp_backenddb.hxx
+++ b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
@@ -147,6 +147,18 @@ public:
virtual ~BackendDb() {};
void removeEntry(::rtl::OUString const & url);
+
+ /* This is called to write the "revoked" attribute to the entry.
+ This is done when XPackage::revokePackage is called.
+ */
+ void revokeEntry(::rtl::OUString const & url);
+
+ /* returns false if the entry does not exist yet.
+ */
+ bool activateEntry(::rtl::OUString const & url);
+
+ bool hasActiveEntry(::rtl::OUString const & url);
+
};
class RegisteredDb: public BackendDb
diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
index 2e92a907f8fb..660d6bb374c3 100644
--- a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
+++ b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
@@ -82,15 +82,19 @@ OUString ExtensionBackendDb::getKeyElementName()
void ExtensionBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
{
try{
- Reference<css::xml::dom::XNode> extensionNodeNode = writeKeyElement(url);
- writeVectorOfPair(
- data.items,
- OUSTR("extension-items"),
- OUSTR("item"),
- OUSTR("url"),
- OUSTR("media-type"),
- extensionNodeNode);
- save();
+ //reactive revoked entry if possible.
+ if (!activateEntry(url))
+ {
+ Reference<css::xml::dom::XNode> extensionNodeNode = writeKeyElement(url);
+ writeVectorOfPair(
+ data.items,
+ OUSTR("extension-items"),
+ OUSTR("item"),
+ OUSTR("url"),
+ OUSTR("media-type"),
+ extensionNodeNode);
+ save();
+ }
}
catch(css::uno::Exception &)
{
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 262bbef420f2..d247597a808f 100755..100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -250,7 +250,7 @@ class BackendImpl : public ImplBaseT
void addDataToDb(OUString const & url, ExtensionBackendDb::Data const & data);
ExtensionBackendDb::Data readDataFromDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
@@ -276,6 +276,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
using ImplBaseT::disposing;
};
@@ -360,6 +363,21 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return m_typeInfos;
}
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ //Notify the backend responsible for processing the different media
+ //types that this extension was removed.
+ ExtensionBackendDb::Data data = readDataFromDb(url);
+ for (ExtensionBackendDb::Data::ITC_ITEMS i = data.items.begin(); i != data.items.end(); i++)
+ {
+ m_xRootRegistry->packageRemoved(i->first, i->second);
+ }
+
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
@@ -460,10 +478,10 @@ ExtensionBackendDb::Data BackendImpl::readDataFromDb(
return data;
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+void BackendImpl::revokeEntryFromDb(OUString const & url)
{
if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ m_backendDb->revokeEntry(url);
}
@@ -973,7 +991,7 @@ void BackendImpl::PackageImpl::processPackage_(
// selected
}
}
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
}
}
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index edeae256cbaf..dddf82e09790 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -101,13 +101,8 @@ class BackendImpl : public t_helper
Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
- bool isRegisteredInDb(OUString const & url);
-
-
-
-// Reference< ucb::XSimpleFileAccess > getFileAccess( void );
-// Reference< ucb::XSimpleFileAccess > m_xSFA;
+ bool hasActiveEntry(OUString const & url);
+ void revokeEntryFromDb(OUString const & url);
const Reference<deployment::XPackageTypeInfo> m_xBasicLibTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xDialogLibTypeInfo;
@@ -123,6 +118,10 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
+
};
//______________________________________________________________________________
@@ -191,18 +190,11 @@ void BackendImpl::addDataToDb(OUString const & url)
m_backendDb->addEntry(url);
}
-bool BackendImpl::isRegisteredInDb(OUString const & url)
+bool BackendImpl::hasActiveEntry(OUString const & url)
{
- bool registered = false;
if (m_backendDb.get())
- registered = m_backendDb->getEntry(url);
- return registered;
-}
-
-void BackendImpl::deleteDataFromDb(OUString const & url)
-{
- if (m_backendDb.get())
- m_backendDb->removeEntry(url);
+ return m_backendDb->hasActiveEntry(url);
+ return false;
}
// XUpdatable
@@ -219,6 +211,19 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return m_typeInfos;
}
+void BackendImpl::revokeEntryFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->revokeEntry(url);
+}
+
+void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
// PackageRegistryBackend
//______________________________________________________________________________
@@ -321,7 +326,7 @@ BackendImpl::PackageImpl::isRegistered_(
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- bool registered = that->isRegisteredInDb(getURL());
+ bool registered = that->hasActiveEntry(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>( registered, false /* IsAmbiguous */ ) );
@@ -367,7 +372,7 @@ void BackendImpl::PackageImpl::processPackage_(
xComponentContext ), UNO_QUERY_THROW );
}
}
- bool bRegistered = getMyBackend()->isRegisteredInDb(getURL());
+ bool bRegistered = getMyBackend()->hasActiveEntry(getURL());
if( !doRegisterPackage )
{
//We cannot just call removeLibrary(name) because this could remove a
@@ -399,7 +404,7 @@ void BackendImpl::PackageImpl::processPackage_(
xDialogLibs->removeLibrary(m_dialogName);
}
}
- getMyBackend()->deleteDataFromDb(getURL());
+ getMyBackend()->revokeEntryFromDb(getURL());
return;
}
}
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index f3195701fc7c..7e4be0f4e35a 100755
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -100,6 +100,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
const Reference<deployment::XPackageTypeInfo> m_xTypeInfo;
+
public:
BackendImpl(
Sequence<Any> const & args,
@@ -108,6 +109,9 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+ virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException);
};
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
@@ -218,6 +222,8 @@ BackendImpl::BackendImpl(
}
}
+
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -226,6 +232,12 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
return Sequence< Reference<deployment::XPackageTypeInfo> >(&m_xTypeInfo, 1);
}
+void BackendImpl::packageRemoved(OUString const & /*url*/, OUString const & /*mediaType*/)
+ throw (deployment::DeploymentException,
+ uno::RuntimeException)
+{
+}
+
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
@@ -338,6 +350,11 @@ void BackendImpl::PackageImpl:: initPackageHandler()
{
aContext <<= OUSTR("bundled");
}
+ else if ( that->m_eContext == CONTEXT_BUNDLED_PREREG )
+ {
+ aContext <<= OUSTR("bundled_prereg");
+ }
+
else
{
OSL_ASSERT( 0 );
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 314537836921..314537836921 100755..100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 4545ed862271..83552cb7c4c6 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -380,7 +380,12 @@ extern "C" int unopkg_main()
}
else if (subCommand.equals(OUSTR("sync")))
{
- //sync is private!!!! Only for bundled extensions!!!
+ //sync is private!!!! Only to be called from setup!!!
+ //The UserInstallation is diverted to the prereg folder. But only
+ //the lock file is written! This requires that
+ //-env:UNO_JAVA_JFW_INSTALL_DATA is passed to javaldx and unopkg otherwise the
+ //javasettings file is written to the prereg folder.
+ //
//For performance reasons unopkg sync is called during the setup and
//creates the registration data for the repository of the bundled
//extensions. It is then copied to the user installation during
@@ -395,10 +400,21 @@ extern "C" int unopkg_main()
//$BUNDLED_EXTENSIONS_USER
if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions")))
{
- removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER"));
+ removeFolder(OUSTR("$BUNDLED_EXTENSIONS_PREREG"));
//return otherwise we create the registration data again
return 0;
}
+ //redirect the UserInstallation, so we do not create a
+ //user installation for the admin and we also do not need
+ //to call unopkg with -env:UserInstallation
+ ::rtl::Bootstrap::set(OUSTR("UserInstallation"),
+ OUSTR("$BUNDLED_EXTENSIONS_PREREG/.."));
+ //Setting UNO_JAVA_JFW_INSTALL_DATA causes the javasettings to be written
+ //in the office installation. We do not want to create the user data folder
+ //for the admin. The value must also be set in the unopkg script (Linux, etc.)
+ //when calling javaldx
+ ::rtl::Bootstrap::set(OUSTR("UNO_JAVA_JFW_INSTALL_DATA"),
+ OUSTR("$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml"));
}
@@ -418,6 +434,7 @@ extern "C" int unopkg_main()
//prevent the deletion of the registry data folder
//synching is done in XExtensionManager.reinstall
if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall"))
+ && ! subCommand.equals(OUSTR("sync"))
&& ! dp_misc::office_is_running())
dp_misc::syncRepositories(xCmdEnv);
@@ -613,12 +630,15 @@ extern "C" int unopkg_main()
}
else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("sync")))
{
- //This sub command may be removed later and is only there to have a
- //possibility to start extension synching without any output.
- //This is just here so we do not get an error, because of an unknown
- //sub-command. We do synching before
- //the sub-commands are processed.
-
+ if (! dp_misc::office_is_running())
+ {
+ xExtensionManager->synchronizeBundledPrereg(
+ Reference<task::XAbortChannel>(), xCmdEnv);
+ }
+ else
+ {
+ dp_misc::writeConsoleError(OUSTR("\nError: office is running"));
+ }
}
else
{
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index d7b6e1ca2336..f6773b768062 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -396,6 +396,7 @@ Reference<XComponentContext> bootstrapStandAlone(
if (! ::ucbhelper::ContentBroker::initialize( xServiceManager, ucb_args ))
throw RuntimeException( OUSTR("cannot initialize UCB!"), 0 );
+ disposeGuard.setDeinitUCB();
return xContext;
}
@@ -627,7 +628,7 @@ void removeFolder(OUString const & folderUrl)
dir.close();
::osl::Directory::remove(url);
}
- else
+ else if (rc != osl::File::E_NOENT)
{
dp_misc::writeConsole(
OUSTR("unopkg: Error while removing ") + url + OUSTR("\n"));
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 4975cc4c087b..55c86260ca8f 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -34,6 +34,7 @@
#include "tools/resmgr.hxx"
#include "rtl/ustring.hxx"
#include "unotools/configmgr.hxx"
+#include "ucbhelper/contentbroker.hxx"
#define APP_NAME "unopkg"
@@ -137,15 +138,14 @@ bool isBootstrapVariable(sal_uInt32 * pIndex);
class DisposeGuard
{
css::uno::Reference<css::lang::XComponent> m_xComp;
-
+ bool m_bDeinitUCB;
public:
- inline DisposeGuard() {}
- inline DisposeGuard(
- css::uno::Reference<css::lang::XComponent> const & xComp )
- : m_xComp( xComp ) {}
-
+ DisposeGuard(): m_bDeinitUCB(false) {}
inline ~DisposeGuard()
{
+ if (m_bDeinitUCB)
+ ::ucbhelper::ContentBroker::deinitialize();
+
if (m_xComp.is())
m_xComp->dispose();
}
@@ -155,6 +155,12 @@ public:
{
m_xComp = xComp;
}
+
+ inline void setDeinitUCB()
+ {
+ m_bDeinitUCB = true;
+ }
+
};
//==============================================================================
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
index 80e34ba27701..752bf6d13849 100644
--- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
@@ -84,19 +84,18 @@ namespace drawinglayer
aOutlineRange.transform(aSimpleObjectMatrix);
}
- // prepare dest coor
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
- const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()),
- basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ // prepare dest coordinates
+ const Point aPoint(
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()));
+ const Size aSize(
+ basegfx::fround(aOutlineRange.getWidth()),
+ basegfx::fround(aOutlineRange.getHeight()));
// paint it using GraphicManager
Graphic aGraphic(rBitmapEx);
GraphicObject aGraphicObject(aGraphic);
- aGraphicObject.Draw(&rOutDev, aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), &aAttributes);
+ aGraphicObject.Draw(&rOutDev, aPoint, aSize, &aAttributes);
}
void RenderBitmapPrimitive2D_BitmapEx(
@@ -110,13 +109,13 @@ namespace drawinglayer
// prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
- const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()),
- basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ // prepare dest coordinates
+ const Point aPoint(
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()));
+ const Size aSize(
+ basegfx::fround(aOutlineRange.getWidth()),
+ basegfx::fround(aOutlineRange.getHeight()));
// decompose matrix to check for shear, rotate and mirroring
basegfx::B2DVector aScale, aTranslate;
@@ -142,7 +141,7 @@ namespace drawinglayer
}
// draw bitmap
- rOutDev.DrawBitmapEx(aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), aContent);
+ rOutDev.DrawBitmapEx(aPoint, aSize, aContent);
}
void RenderBitmapPrimitive2D_self(
@@ -153,13 +152,11 @@ namespace drawinglayer
// process self with free transformation (containing shear and rotate). Get dest rect in pixels.
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectLogic(
basegfx::fround(aOutlineRange.getMinX()),
basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ basegfx::fround(aOutlineRange.getMaxX()),
+ basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic));
// #i96708# check if Metafile is recorded
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 84f4802e7b44..84f4802e7b44 100644..100755
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
diff --git a/editeng/inc/editeng/splwrap.hxx b/editeng/inc/editeng/splwrap.hxx
index 5e46a96adb9f..5e46a96adb9f 100644..100755
--- a/editeng/inc/editeng/splwrap.hxx
+++ b/editeng/inc/editeng/splwrap.hxx
diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx
index d53bfcf1aaf2..83f0ab6c54e8 100644..100755
--- a/editeng/inc/pch/precompiled_editeng.hxx
+++ b/editeng/inc/pch/precompiled_editeng.hxx
@@ -853,7 +853,7 @@
#include "vcl/cursor.hxx"
#include "vcl/decoview.hxx"
#include "vcl/dndhelp.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "vcl/fntstyle.hxx"
#include "unotools/fontcvt.hxx"
#include "vcl/gdimtf.hxx"
@@ -872,7 +872,7 @@
#include "vcl/unohelp.hxx"
#include "vcl/unohelp2.hxx"
#include "vcl/wall.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vos/mutex.hxx"
#include "vos/ref.hxx"
#include "vos/refernce.hxx"
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 9ac7de8e2b7d..9ac7de8e2b7d 100644..100755
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index e2a1fabea0ba..e2a1fabea0ba 100644..100755
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
diff --git a/extensions/inc/pch/precompiled_extensions.hxx b/extensions/inc/pch/precompiled_extensions.hxx
index 676418c6729f..bed9dd749349 100644..100755
--- a/extensions/inc/pch/precompiled_extensions.hxx
+++ b/extensions/inc/pch/precompiled_extensions.hxx
@@ -533,7 +533,7 @@
#include "unotools/processfactory.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "vos/conditn.hxx"
#include "vos/diagnose.hxx"
diff --git a/extensions/source/oooimprovement/onlogrotate_job.cxx b/extensions/source/oooimprovement/onlogrotate_job.cxx
index c5f6b56be31a..d83c43bfcfd8 100644
--- a/extensions/source/oooimprovement/onlogrotate_job.cxx
+++ b/extensions/source/oooimprovement/onlogrotate_job.cxx
@@ -128,17 +128,21 @@ namespace
}
{
::osl::Guard< ::osl::Mutex> service_factory_guard(m_ServiceFactoryMutex);
- if(m_ServiceFactory.is())
+ try
{
- if(Config(m_ServiceFactory).getInvitationAccepted())
+ if(m_ServiceFactory.is())
{
- packLogs(m_ServiceFactory);
- uploadLogs(m_ServiceFactory);
+ if(Config(m_ServiceFactory).getInvitationAccepted())
+ {
+ packLogs(m_ServiceFactory);
+ uploadLogs(m_ServiceFactory);
+ }
+ else
+ LogStorage(m_ServiceFactory).clear();
}
- else
- LogStorage(m_ServiceFactory).clear();
+ m_ServiceFactory.clear();
}
- m_ServiceFactory.clear();
+ catch(...) {}
}
}
@@ -158,16 +162,25 @@ namespace
m_Thread->create();
}
virtual ~OnLogRotateThreadWatcher()
- { m_Thread->disposing()->terminate(); };
+ {
+ m_Thread->disposing()->terminate();
+ m_Thread->join();
+ };
// XTerminateListener
virtual void SAL_CALL queryTermination(const EventObject&) throw(RuntimeException)
{ };
virtual void SAL_CALL notifyTermination(const EventObject&) throw(RuntimeException)
- { m_Thread->disposing()->terminate(); };
+ {
+ m_Thread->disposing()->terminate();
+ m_Thread->join();
+ };
// XEventListener
virtual void SAL_CALL disposing(const EventObject&) throw(RuntimeException)
- { m_Thread->disposing()->terminate(); };
+ {
+ m_Thread->disposing()->terminate();
+ m_Thread->join();
+ };
private:
::std::auto_ptr<OnLogRotateThread> m_Thread;
};
diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx
index ea724c61828c..01f56bd7ac0d 100644
--- a/extensions/source/propctrlr/formcomponenthandler.hxx
+++ b/extensions/source/propctrlr/formcomponenthandler.hxx
@@ -41,7 +41,7 @@
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/form/XForm.hpp>
/** === end UNO includes === **/
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <vcl/waitobj.hxx>
#include <connectivity/dbtools.hxx>
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index 09d90f1eaa83..09d90f1eaa83 100644..100755
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 8419569bd949..8419569bd949 100644..100755
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
diff --git a/extras/source/palettes/standard.soc b/extras/source/palettes/standard.soc
index b275e95f2cdb..83cffa5d8edd 100644
--- a/extras/source/palettes/standard.soc
+++ b/extras/source/palettes/standard.soc
@@ -49,6 +49,7 @@
<draw:color draw:name="Blue 6" draw:color="#0099ff"/>
<draw:color draw:name="Blue 7" draw:color="#00b8ff"/>
<draw:color draw:name="Blue 8" draw:color="#99ccff"/>
+ <draw:color draw:name="Blue 9" draw:color="#CFE7E5"/>
<draw:color draw:name="Turquoise 1" draw:color="#00dcff"/>
<draw:color draw:name="Turquoise 2" draw:color="#00cccc"/>
<draw:color draw:name="Turquoise 3" draw:color="#23b8dc"/>
diff --git a/filter/inc/filter/msfilter/msvbahelper.hxx b/filter/inc/filter/msfilter/msvbahelper.hxx
index 81607c9b296c..94ece293ee20 100644
--- a/filter/inc/filter/msfilter/msvbahelper.hxx
+++ b/filter/inc/filter/msfilter/msvbahelper.hxx
@@ -28,29 +28,81 @@
#define _MSVBAHELPER_HXX
#include <sfx2/objsh.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
#include "filter/msfilter/msfilterdllapi.h"
-namespace ooo { namespace vba
+namespace ooo {
+namespace vba {
+
+// ============================================================================
+
+struct MSFILTER_DLLPUBLIC MacroResolvedInfo
+{
+ SfxObjectShell* mpDocContext;
+ String msResolvedMacro;
+ bool mbFound;
+
+ inline explicit MacroResolvedInfo( SfxObjectShell* pDocContext = 0 ) : mpDocContext( pDocContext ), mbFound( false ) {}
+};
+
+MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
+MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl );
+MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const ::rtl::OUString& rMacroName, bool bSearchGlobalTemplates = false );
+MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::script::vba::XVBAMacroResolver > VBAMacroResolverBase;
+
+class VBAMacroResolver : public VBAMacroResolverBase
{
- class MSFILTER_DLLPUBLIC VBAMacroResolvedInfo
- {
- SfxObjectShell* mpDocContext;
- bool mbFound;
- String msResolvedMacro;
- public:
- VBAMacroResolvedInfo() : mpDocContext(NULL), mbFound( false ){}
- void SetResolved( bool bRes ) { mbFound = bRes; }
- bool IsResolved() { return mbFound; }
- void SetMacroDocContext(SfxObjectShell* pShell ) { mpDocContext = pShell; }
- SfxObjectShell* MacroDocContext() { return mpDocContext; }
- String ResolvedMacro() { return msResolvedMacro; }
- void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; }
- };
-
- MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
- MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl );
- MSFILTER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
- MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
-} }
+public:
+ explicit VBAMacroResolver();
+ virtual ~VBAMacroResolver();
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& rService )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.lang.XInitialization interface ----------------------------
+
+ virtual void SAL_CALL initialize(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.script.vba.XVBAMacroResolver interface --------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveScriptURLtoVBAMacro( const ::rtl::OUString& rScriptURL )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ SfxObjectShell* mpObjShell;
+ ::rtl::OUString maProjectName;
+};
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
#endif
diff --git a/filter/prj/build.lst b/filter/prj/build.lst
index 065b4313c57b..5617d28856f7 100644
--- a/filter/prj/build.lst
+++ b/filter/prj/build.lst
@@ -1,4 +1,4 @@
-fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt NULL
+fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt basegfx NULL
fl filter usr1 - all fl_mkout NULL
fl filter\prj get - all fl_prj NULL
fl filter\inc nmake - all fl_inc NULL
diff --git a/filter/prj/d.lst b/filter/prj/d.lst
index 037bef1a3765..52d96f64cdf5 100644
--- a/filter/prj/d.lst
+++ b/filter/prj/d.lst
@@ -60,6 +60,7 @@ mkdir: %_DEST%\inc%_EXT%\filter\msfilter
..\%__SRC%\misc\XSLTValidate.component %_DEST%\xml%_EXT%\XSLTValidate.component
..\%__SRC%\misc\filterconfig1.component %_DEST%\xml%_EXT%\filterconfig1.component
..\%__SRC%\misc\flash.component %_DEST%\xml%_EXT%\flash.component
+..\%__SRC%\misc\msfilter.component %_DEST%\xml%_EXT%\msfilter.component
..\%__SRC%\misc\pdffilter.component %_DEST%\xml%_EXT%\pdffilter.component
..\%__SRC%\misc\placeware.component %_DEST%\xml%_EXT%\placeware.component
..\%__SRC%\misc\svgfilter.component %_DEST%\xml%_EXT%\svgfilter.component
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
index 650c0cf980fb..2402d74084e3 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 Binary" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 Binary</value></prop>
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
index 508927802621..73c9e1be54df 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 XML" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 XML</value></prop>
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
index 46f1eca86085..d5a14a27d0e2 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 XML Template" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 XML Template</value></prop>
diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
index 7fdcbd702a54..254ba468b6eb 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="Impress MS PowerPoint 2007 XML" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ppt.PowerPointImport</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS PowerPoint 2007 XML</value></prop>
diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
index 4fad96fc0521..01fd72086d6b 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
@@ -1,7 +1,7 @@
<node oor:name="Impress MS PowerPoint 2007 XML Template" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ppt.PowerPointImport</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS PowerPoint 2007 XML Template</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
index b45c21fa33bd..939a0a4025ad 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_40" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlw xlc xlm</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
index 42bb10ed09c8..291382df43b6 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_40_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
index 3f450f0cb85f..5656b73f57dd 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_5095" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
index 8dbb02c0170e..9c1799dfe405 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_5095_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
index 0ea10dddc31e..8e02ea8f088d 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_95" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
index fb3e41014f85..bc80367624f3 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_95_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
index 9f1949d9f413..ab71bc304247 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_97" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
index 26f4bca3a725..ff390ce3d376 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_97_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 244ca56971be..2a1992e246a3 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -36,6 +36,8 @@
#include <svtools/fltcall.hxx>
#include <math.h>
+#include "shape.hxx"
+
namespace PictReaderInternal {
//! utilitary class to store a pattern, ...
class Pattern {
@@ -165,7 +167,7 @@ private:
Pattern eActPenPattern;
Pattern eActFillPattern;
Pattern eActBackPattern;
- USHORT nActPenSize;
+ Size nActPenSize;
// Note: Postscript mode is stored by setting eActRop to ROP_1
RasterOp eActROP;
PictDrawingMethod eActMethod;
@@ -220,6 +222,12 @@ private:
ULONG ReadAndDrawRgn(PictDrawingMethod eMethod);
ULONG ReadAndDrawSameRgn(PictDrawingMethod eMethod);
+ // returns true, if we do not need to print the shape/text/frame
+ bool IsInvisible(PictDrawingMethod eMethod) const {
+ if (eActROP == ROP_1) return true;
+ if (eMethod==PDM_FRAME && (nActPenSize.Width() == 0 || nActPenSize.Height() == 0)) return true;
+ return false;
+ }
void DrawingMethod(PictDrawingMethod eMethod);
ULONG ReadAndDrawText();
@@ -455,8 +463,6 @@ void PictReader::ReadRectangle(Rectangle & rRect)
aTopLeft=ReadPoint();
aBottomRight=ReadPoint();
- aBottomRight.X() -= 1;
- aBottomRight.Y() -= 1;
rRect=Rectangle(aTopLeft,aBottomRight);
}
@@ -510,92 +516,69 @@ ULONG PictReader::ReadPixPattern(PictReader::Pattern &pattern)
ULONG PictReader::ReadAndDrawRect(PictDrawingMethod eMethod)
{
ReadRectangle(aLastRect);
- DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRect);
+ ReadAndDrawSameRect(eMethod);
return 8;
}
ULONG PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRect);
+ PictReaderShape::drawRectangle(pVirDev, eMethod==PDM_FRAME, aLastRect, nActPenSize);
return 0;
}
ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod)
{
ReadRectangle(aLastRoundRect);
- DrawingMethod(eMethod);
- // Osnola: the corner's size is equal to aActOvalSize/2, see Quickdraw Drawing Reference 3-63
- pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2);
+ ReadAndDrawSameRoundRect(eMethod);
return 8;
}
ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2);
+ PictReaderShape::drawRoundRectangle(pVirDev, eMethod==PDM_FRAME, aLastRoundRect, aActOvalSize, nActPenSize);
return 0;
}
ULONG PictReader::ReadAndDrawOval(PictDrawingMethod eMethod)
{
ReadRectangle(aLastOval);
- DrawingMethod(eMethod);
- pVirDev->DrawEllipse(aLastOval);
+ ReadAndDrawSameOval(eMethod);
return 8;
}
ULONG PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawEllipse(aLastOval);
+ PictReaderShape::drawEllipse(pVirDev, eMethod==PDM_FRAME, aLastOval, nActPenSize);
return 0;
}
ULONG PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod)
{
ULONG nDataSize;
-
nDataSize=ReadPolygon(aLastPolygon);
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon);
- else pVirDev->DrawPolygon(aLastPolygon);
+ ReadAndDrawSamePolygon(eMethod);
return nDataSize;
}
ULONG PictReader::ReadAndDrawSamePolygon(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon);
- else pVirDev->DrawPolygon(aLastPolygon);
+ PictReaderShape::drawPolygon(pVirDev, eMethod==PDM_FRAME, aLastPolygon, nActPenSize);
return 0;
}
ULONG PictReader::ReadAndDrawArc(PictDrawingMethod eMethod)
{
- short nstartAngle, narcAngle;
- double fAng1, fAng2;
- Point aStartPt, aEndPt, aCenter;
-
ReadRectangle(aLastArcRect);
- *pPict >> nstartAngle >> narcAngle;
- if (narcAngle<0) {
- nstartAngle = nstartAngle + narcAngle;
- narcAngle=-narcAngle;
- }
- fAng1=((double)nstartAngle)/180.0*3.14159265359;
- fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359;
- aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2,
- (aLastArcRect.Top()+aLastArcRect.Bottom())/2);
- aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0),
- aCenter.Y()+(long)(-cos(fAng2)*256.0));
- aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0),
- aCenter.Y()+(long)(-cos(fAng1)*256.0));
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt);
- else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt);
+ ReadAndDrawSameArc(eMethod);
return 12;
}
@@ -603,24 +586,18 @@ ULONG PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod)
{
short nstartAngle, narcAngle;
double fAng1, fAng2;
- Point aStartPt, aEndPt, aCenter;
*pPict >> nstartAngle >> narcAngle;
+ if (IsInvisible(eMethod)) return 4;
+ DrawingMethod(eMethod);
+
if (narcAngle<0) {
nstartAngle = nstartAngle + narcAngle;
narcAngle=-narcAngle;
}
fAng1=((double)nstartAngle)/180.0*3.14159265359;
fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359;
- aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2,
- (aLastArcRect.Top()+aLastArcRect.Bottom())/2);
- aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0),
- aCenter.Y()+(long)(-cos(fAng2)*256.0));
- aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0),
- aCenter.Y()+(long)(-cos(fAng1)*256.0));
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt);
- else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt);
+ PictReaderShape::drawArc(pVirDev, eMethod==PDM_FRAME, aLastArcRect,fAng1,fAng2, nActPenSize);
return 4;
}
@@ -628,42 +605,42 @@ ULONG PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod)
{
USHORT nSize;
- DrawingMethod(eMethod);
*pPict >> nSize;
- // ...???...
+ // read the DATA
+ //
+ // a region data is a mask and is probably coded as
+ // - the first 8 bytes: bdbox ( which can be read by ReadRectangle )
+ // - then a list of line modifiers: y_i, a_0, b_0, a_1, b_1, ..., a_{n_i}, b_{n_i}, 0x7fff
+ // - 0x7fff
+ // where y_i is the increasing sequences of line coordinates
+ // and on each line: a0 < b0 < a1 < b1 < ... < a_{n_i} < b_{n_i}
+
+ // it can be probably decoded as :
+ // M=an empty mask: ie. (0, 0, ... ) with (left_box-right_box+1) zeroes
+ // then for each line (y_i):
+ // - takes M and inverts all values in [a_0,b_0-1], in [a_1,b_1-1] ...
+ // - sets M = new y_i line mask
+ ReadAndDrawSameRgn(eMethod);
return (ULONG)nSize;
}
ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod)
{
- DrawingMethod(eMethod);
- // ...???...
+ if (IsInvisible(eMethod)) return 0;
+ DrawingMethod(eMethod);
+ // DISPLAY: ...???...
return 0;
}
void PictReader::DrawingMethod(PictDrawingMethod eMethod)
{
if( eActMethod==eMethod ) return;
- if (eActROP == ROP_1) {
- // Osnola: ignore postscript command
- if (eMethod == PDM_TEXT) {
- Font invisibleFont;
- invisibleFont.SetColor(Color(COL_TRANSPARENT));
- invisibleFont.SetFillColor(Color(COL_TRANSPARENT));
- invisibleFont.SetTransparent(TRUE);
- pVirDev->SetFont(invisibleFont);
- }
- else {
- SetLineColor( Color(COL_TRANSPARENT) );
- SetFillColor( Color(COL_TRANSPARENT) );
- }
- pVirDev->SetRasterOp(ROP_OVERPAINT);
- eActMethod=eMethod;
- return;
- }
switch (eMethod) {
case PDM_FRAME:
- SetLineColor( aActForeColor );
+ if (eActPenPattern.isDefault())
+ SetLineColor( aActForeColor );
+ else
+ SetLineColor(eActPenPattern.getColor(aActBackColor, aActForeColor));
SetFillColor( Color(COL_TRANSPARENT) );
pVirDev->SetRasterOp(eActROP);
break;
@@ -715,16 +692,18 @@ ULONG PictReader::ReadAndDrawText()
sal_uInt32 nLen, nDataLen;
sal_Char sText[256];
- DrawingMethod(PDM_TEXT);
*pPict >> nByteLen; nLen=((ULONG)nByteLen)&0x000000ff;
nDataLen = nLen + 1;
pPict->Read( &sText, nLen );
+ if (IsInvisible(PDM_TEXT)) return nDataLen;
+ DrawingMethod(PDM_TEXT);
+
// Stoerende Steuerzeuichen wegnehmen:
while ( nLen > 0 && ( (unsigned char)sText[ nLen - 1 ] ) < 32 )
nLen--;
sText[ nLen ] = 0;
- String aString( (const sal_Char*)&sText, aActFont.GetCharSet());// OSNOLA: gsl_getSystemTextEncoding() );
+ String aString( (const sal_Char*)&sText, aActFont.GetCharSet());
pVirDev->DrawText( Point( aTextPosition.X(), aTextPosition.Y() ), aString );
return nDataLen;
}
@@ -1101,114 +1080,148 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
void PictReader::ReadHeader()
{
- char nC;
short y1,x1,y2,x2;
- sal_Char sBuf[ 3 ];
- pPict->SeekRel( 10 );
- pPict->Read( sBuf, 3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
- pPict->SeekRel( -13 ); // this maybe a pict from a ms document
- else
- pPict->SeekRel( 512 - 13 ); // 512 Bytes Muell am Anfang
-
- pPict->SeekRel(2); // Lo-16-bits von "picture size"
- *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes
- aBoundingRect=Rectangle( x1,y1, --x2, --y2 );
-
- // Jetzt kommen x-beliebig viele Nullen
- // (in manchen Dateien tatsaechlich mehr als eine):
- do { *pPict >> nC; } while (nC==0 && pPict->IsEof()==FALSE);
-
- // dann sollte der Versions-Opcode 0x11 folgen, dann die Versionsnummer:
- if (nC==0x11)
- {
- *pPict >> nC;
- if ( nC == 0x01 )
- IsVersion2 = FALSE; // Version 1
- else // Version 2 oder hoeher
- {
- short nExtVer;
- // 3 Bytes ueberspringen, um auf
- // ExtVersion2 oder Version2 zu kommen
- pPict->SeekRel( 3 );
- *pPict >> nExtVer;
-
- // nachsehen, ob wir einen Extended-Version2-Header (==-2) haben
- // oder einen einfachen Version2-Header (==-1);
- // dementsprechend Aufloesung einlesen oder nicht
- if ( nExtVer == -2 )
- {
- sal_Int16 nReserved;
- sal_Int32 nHResFixed, nVResFixed;
- *pPict >> nReserved >> nHResFixed >> nVResFixed;
- double fHRes = nHResFixed;
- fHRes /= 65536;
- double fVRes = nVResFixed;
- fVRes /= 65536;
- aHRes /= fHRes;
- aVRes /= fVRes;
- *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect
- aBoundingRect=Rectangle( x1,y1, --x2, --y2 );
- pPict->SeekRel( -22 );
- }
- else
- {
- pPict->SeekRel( -4 );
- }
- IsVersion2=TRUE;
+ sal_Char sBuf[ 2 ];
+ // previous code considers pPict->Tell() as the normal starting position,
+ // can we have nStartPos != 0 ?
+ ULONG nStartPos = pPict->Tell();
+ // Standard:
+ // a picture file begins by 512 bytes (reserved to the application) followed by the picture data
+ // while clipboard, pictures stored in a document often contain only the picture data.
+
+ // Special cases:
+ // - some Pict v.1 use 0x00 0x11 0x01 ( instead of 0x11 0x01) to store the version op
+ // (we consider here this as another standard for Pict. v.1 )
+ // - some files seem to contain extra garbage data at the beginning
+ // - some picture data seem to contain extra NOP opcode(0x00) between the bounding box and the version opcode
+
+ // This code looks hard to find a picture header, ie. it looks at positions
+ // - nStartPos+0, nStartPos+512 with potential extra NOP codes between bdbox and version (at most 9 extra NOP)
+ // - 512..1024 with more strict bdbox checking and no extra NOP codes
+
+ // Notes:
+ // - if the header can begin at nStartPos+0 and at nStartPos+512, we try to choose the more
+ // <<probable>> ( using the variable confidence)
+ // - svtools/source/filter.vcl/filter/{filter.cxx,filter2.cxx} only check for standard Pict,
+ // this may cause future problems
+ int st;
+ sal_uInt32 nOffset;
+ int confidence[2] = { 0, 0};
+ for ( st = 0; st < 3 + 513; st++ )
+ {
+ int actualConfid = 20; // the actual confidence
+ pPict->ResetError();
+ if (st < 2) nOffset = nStartPos+st*512;
+ else if (st == 2) {
+ // choose nStartPos+0 or nStartPos+512 even if there are a little dubious
+ int actPos = -1, actConf=0;
+ if (confidence[0] > 0) { actPos = 0; actConf = confidence[0]; }
+ if (confidence[1] > 0 && confidence[1] >= actConf) actPos = 1;
+ if (actPos < 0) continue;
+ nOffset = nStartPos+actPos*512;
}
- }
- else {
- // Eigentlich ist dies wohl kein Pict-File, aber es gibt tatsaechlich
- // Dateien, bei denen mehr als 512 Bytes "Muell" am Anfang stehen.
- // Somit koennte es theoretisch folgende Art von Header geben:
- // <beliebig viele Bytes Muell> <Picture-Size (Lo-Bytes)> <BoundingRect>
- // <beliebig viele Nullen> <0x11> ..
- // Da aber in so einem Fall die Position von <BoundingRect> kaum auszumachen ist,
- // gehen wir nun davon aus, dass in einer Datei immer entweder genau 512 Bytes Muell
- // am Anfang sind (wie oben versucht), oder (wie normalerweise ueblich) genau eine 0 zwischen
- // Bounding-Rectangle und 0x11. Des weiteren mag es hoechstens 1024 Bytes Muell geben,
- // und das Ganze nur fuer Version 1 oder 2.
- // Somit suchen wir nun nach der Folge 0x00,0x11,0x01 oder 0x00,0x11,0x02 innerhalb der
- // "zweiten" 512 Bytes, und nehmen an, dass davor das Bounding-Rect steht, und hoffen
- // dass das alles so seine Richtigkeit hat.
- BYTE n1,n2,n3;
- USHORT i,Found;
- pPict->Seek(522);
- Found=0;
- *pPict >> n1 >> n2 >> n3;
- for (i=0; i<512; i++) {
- if (n1==0x00 && n2==0x11 && (n3==0x01 || n3==0x02)) { Found=1; break; }
- n1=n2; n2=n3; *pPict >> n3;
+ else {
+ nOffset = 509+st; // illogical : more logical will be nStartPos+509+st or to consider that nStartPos=0
+ // a small test to check if versionOp code exists after the bdbox ( with no extra NOP codes)
+ pPict->Seek(nOffset+10);
+ pPict->Read( sBuf, 2 );
+ if (pPict->IsEof() || pPict->GetError()) break;
+ if (sBuf[0] == 0x11 || (sBuf[0] == 0x00 && sBuf[1] == 0x11)) ; // maybe ok
+ else continue;
}
- if (Found!=0) {
- pPict->SeekRel(-11);
- *pPict >> y1 >> x1 >> y2 >> x2;
- // Lieber nochmal nachsehen, ob das Bounding-Rectangle gut zu sein scheint:
- if (x1+10<x2 && y1+10<y2 && y1>=-2048 && x1>=-2048 && x2<=2048 && y2<=2048) {
- aBoundingRect=Rectangle( x1, y1, --x2, --y2 );
- if (n3==0x01) {
- pPict->SeekRel(3);
- IsVersion2=FALSE;
- }
- else {
- pPict->SeekRel(4);
- IsVersion2=TRUE;
- }
- }
- else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
+ pPict->Seek(nOffset);
+
+ // 2 bytes to store size ( version 1 ) ignored
+ pPict->SeekRel( 2 );
+ *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes
+ if (x1 > x2 || y1 > y2) continue; // bad bdbox
+ if (x1 < -2048 || x2 > 2048 || y1 < -2048 || y2 > 2048 || // origin|dest is very small|large
+ (x1 == x2 && y1 == y2) ) // 1 pixel pict is dubious
+ actualConfid-=3;
+ else if (x2 < x1+8 || y2 < y1+8) // a little dubious
+ actualConfid-=1;
+ if (st >= 3 && actualConfid != 20) continue;
+ aBoundingRect=Rectangle( x1,y1, x2, y2 );
+
+ if (pPict->IsEof() || pPict->GetError()) continue;
+ // read version
+ pPict->Read( sBuf, 2 );
+ // version 1 file
+ if ( sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 ) {
+ // pict v1 must be rare and we do only few tests
+ if (st < 2) { confidence[st] = --actualConfid; continue; }
+ IsVersion2 = FALSE; return;
}
- else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
- }
+ if (sBuf[0] != 0x00) continue; // unrecovable error
+ int numZero = 0;
+ do
+ {
+ numZero++;
+ pPict->SeekRel(-1);
+ pPict->Read( sBuf, 2 );
+ }
+ while ( sBuf[0] == 0x00 && numZero < 10);
+ actualConfid -= (numZero-1); // extra nop are dubious
+ if (pPict->IsEof() || pPict->GetError()) continue;
+ if (sBuf[0] != 0x11) continue; // not a version opcode
+ // abnormal version 1 file
+ if (sBuf[1] == 0x01 ) {
+ // pict v1 must be rare and we do only few tests
+ if (st < 2) { confidence[st] = --actualConfid; continue; }
+ IsVersion2 = FALSE; return;
+ }
+ if (sBuf[1] != 0x02 ) continue; // not a version 2 file
+
+ IsVersion2=TRUE;
+ short nExtVer, nReserved;
+ // 3 Bytes ignored : end of version arg 0x02FF (ie: 0xFF), HeaderOp : 0x0C00
+ pPict->SeekRel( 3 );
+ *pPict >> nExtVer >> nReserved;
+ if (pPict->IsEof() || pPict->GetError()) continue;
+
+ if ( nExtVer == -2 ) // extended version 2 picture
+ {
+ sal_Int32 nHResFixed, nVResFixed;
+ *pPict >> nHResFixed >> nVResFixed;
+ *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect
+ if (x1 > x2 || y1 > y2) continue; // bad bdbox
+ if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; }
+
+ double fHRes = nHResFixed;
+ fHRes /= 65536;
+ double fVRes = nVResFixed;
+ fVRes /= 65536;
+ aHRes /= fHRes;
+ aVRes /= fVRes;
+ aBoundingRect=Rectangle( x1,y1, x2, y2 );
+ pPict->SeekRel( 4 ); // 4 bytes reserved
+ return;
+ }
+ else if (nExtVer == -1 ) { // basic version 2 picture
+ if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; }
+ pPict->SeekRel( 16); // bdbox(4 fixed number)
+ pPict->SeekRel(4); // 4 bytes reserved
+ return;
+ }
+ }
+ pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
}
-
ULONG PictReader::ReadData(USHORT nOpcode)
{
USHORT nUSHORT;
Point aPoint;
ULONG nDataSize=0;
+ PictDrawingMethod shapeDMethod = PDM_UNDEFINED;
+ switch (nOpcode & 7) {
+ case 0: shapeDMethod = PDM_FRAME; break;
+ case 1: shapeDMethod = PDM_PAINT; break;
+ case 2: shapeDMethod = PDM_ERASE; break;
+ case 3: shapeDMethod = PDM_INVERT; break;
+ case 4: shapeDMethod = PDM_FILL; break;
+ default: break;
+ }
switch(nOpcode) {
@@ -1221,6 +1234,13 @@ ULONG PictReader::ReadData(USHORT nOpcode)
*pPict >> nUSHORT;
nDataSize=nUSHORT;
ReadRectangle(aRect);
+ // checkme: do we really want to extend the rectangle here ?
+ // I do that because the clipping is often used to clean a region,
+ // before drawing some text and also to draw this text.
+ // So using a too small region can lead to clip the end of the text ;
+ // but this can be discutable...
+ aRect.setWidth(aRect.getWidth()+1);
+ aRect.setHeight(aRect.getHeight()+1);
pVirDev->SetClipRegion( Region( aRect ) );
break;
}
@@ -1269,9 +1289,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0007: { // PnSize
- Size aSize;
- aSize=ReadSize();
- nActPenSize=(USHORT)((aSize.Width()+aSize.Height())/2);
+ nActPenSize=ReadSize();
eActMethod=PDM_UNDEFINED;
nDataSize=4;
break;
@@ -1402,34 +1420,42 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0020: // Line
aPoint=ReadPoint(); aPenPosition=ReadPoint();
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=8;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0021: // LineFrom
aPoint=aPenPosition; aPenPosition=ReadPoint();
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=4;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0022: // ShortLine
aPoint=ReadPoint();
aPenPosition=ReadDeltaH(aPoint);
aPenPosition=ReadDeltaV(aPenPosition);
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=6;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0023: // ShortLineFrom
aPoint=aPenPosition;
aPenPosition=ReadDeltaH(aPoint);
aPenPosition=ReadDeltaV(aPenPosition);
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=2;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0024: // Reserved (n Bytes)
@@ -1497,23 +1523,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0030: // frameRect
- nDataSize=ReadAndDrawRect(PDM_FRAME);
- break;
-
case 0x0031: // paintRect
- nDataSize=ReadAndDrawRect(PDM_PAINT);
- break;
-
case 0x0032: // eraseRect
- nDataSize=ReadAndDrawRect(PDM_ERASE);
- break;
-
case 0x0033: // invertRect
- nDataSize=ReadAndDrawRect(PDM_INVERT);
- break;
-
case 0x0034: // fillRect
- nDataSize=ReadAndDrawRect(PDM_FILL);
+ nDataSize=ReadAndDrawRect(shapeDMethod);
break;
case 0x0035: // Reserved (8 Bytes)
@@ -1523,23 +1537,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0038: // frameSameRect
- nDataSize=ReadAndDrawSameRect(PDM_FRAME);
- break;
-
case 0x0039: // paintSameRect
- nDataSize=ReadAndDrawSameRect(PDM_PAINT);
- break;
-
case 0x003a: // eraseSameRect
- nDataSize=ReadAndDrawSameRect(PDM_ERASE);
- break;
-
case 0x003b: // invertSameRect
- nDataSize=ReadAndDrawSameRect(PDM_INVERT);
- break;
-
case 0x003c: // fillSameRect
- nDataSize=ReadAndDrawSameRect(PDM_FILL);
+ nDataSize=ReadAndDrawSameRect(shapeDMethod);
break;
case 0x003d: // Reserved (0 Bytes)
@@ -1549,23 +1551,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0040: // frameRRect
- nDataSize=ReadAndDrawRoundRect(PDM_FRAME);
- break;
-
case 0x0041: // paintRRect
- nDataSize=ReadAndDrawRoundRect(PDM_PAINT);
- break;
-
case 0x0042: // eraseRRect
- nDataSize=ReadAndDrawRoundRect(PDM_ERASE);
- break;
-
case 0x0043: // invertRRect
- nDataSize=ReadAndDrawRoundRect(PDM_INVERT);
- break;
-
case 0x0044: // fillRRect
- nDataSize=ReadAndDrawRoundRect(PDM_FILL);
+ nDataSize=ReadAndDrawRoundRect(shapeDMethod);
break;
case 0x0045: // Reserved (8 Bytes)
@@ -1575,23 +1565,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0048: // frameSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_FRAME);
- break;
-
case 0x0049: // paintSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_PAINT);
- break;
-
case 0x004a: // eraseSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_ERASE);
- break;
-
case 0x004b: // invertSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_INVERT);
- break;
-
case 0x004c: // fillSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_FILL);
+ nDataSize=ReadAndDrawSameRoundRect(shapeDMethod);
break;
case 0x004d: // Reserved (0 Bytes)
@@ -1601,23 +1579,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0050: // frameOval
- nDataSize=ReadAndDrawOval(PDM_FRAME);
- break;
-
case 0x0051: // paintOval
- nDataSize=ReadAndDrawOval(PDM_PAINT);
- break;
-
case 0x0052: // eraseOval
- nDataSize=ReadAndDrawOval(PDM_ERASE);
- break;
-
case 0x0053: // invertOval
- nDataSize=ReadAndDrawOval(PDM_INVERT);
- break;
-
case 0x0054: // fillOval
- nDataSize=ReadAndDrawOval(PDM_FILL);
+ nDataSize=ReadAndDrawOval(shapeDMethod);
break;
case 0x0055: // Reserved (8 Bytes)
@@ -1627,23 +1593,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0058: // frameSameOval
- nDataSize=ReadAndDrawSameOval(PDM_FRAME);
- break;
-
case 0x0059: // paintSameOval
- nDataSize=ReadAndDrawSameOval(PDM_PAINT);
- break;
-
case 0x005a: // eraseSameOval
- nDataSize=ReadAndDrawSameOval(PDM_ERASE);
- break;
-
case 0x005b: // invertSameOval
- nDataSize=ReadAndDrawSameOval(PDM_INVERT);
- break;
-
case 0x005c: // fillSameOval
- nDataSize=ReadAndDrawSameOval(PDM_FILL);
+ nDataSize=ReadAndDrawSameOval(shapeDMethod);
break;
case 0x005d: // Reserved (0 Bytes)
@@ -1653,23 +1607,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0060: // frameArc
- nDataSize=ReadAndDrawArc(PDM_FRAME);
- break;
-
case 0x0061: // paintArc
- nDataSize=ReadAndDrawArc(PDM_PAINT);
- break;
-
case 0x0062: // eraseArc
- nDataSize=ReadAndDrawArc(PDM_ERASE);
- break;
-
case 0x0063: // invertArc
- nDataSize=ReadAndDrawArc(PDM_INVERT);
- break;
-
case 0x0064: // fillArc
- nDataSize=ReadAndDrawArc(PDM_FILL);
+ nDataSize=ReadAndDrawArc(shapeDMethod);
break;
case 0x0065: // Reserved (12 Bytes)
@@ -1679,23 +1621,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0068: // frameSameArc
- nDataSize=ReadAndDrawSameArc(PDM_FRAME);
- break;
-
case 0x0069: // paintSameArc
- nDataSize=ReadAndDrawSameArc(PDM_PAINT);
- break;
-
case 0x006a: // eraseSameArc
- nDataSize=ReadAndDrawSameArc(PDM_ERASE);
- break;
-
case 0x006b: // invertSameArc
- nDataSize=ReadAndDrawSameArc(PDM_INVERT);
- break;
-
case 0x006c: // fillSameArc
- nDataSize=ReadAndDrawSameArc(PDM_FILL);
+ nDataSize=ReadAndDrawSameArc(shapeDMethod);
break;
case 0x006d: // Reserved (4 Bytes)
@@ -1705,23 +1635,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0070: // framePoly
- nDataSize=ReadAndDrawPolygon(PDM_FRAME);
- break;
-
case 0x0071: // paintPoly
- nDataSize=ReadAndDrawPolygon(PDM_PAINT);
- break;
-
case 0x0072: // erasePoly
- nDataSize=ReadAndDrawPolygon(PDM_ERASE);
- break;
-
case 0x0073: // invertPoly
- nDataSize=ReadAndDrawPolygon(PDM_INVERT);
- break;
-
case 0x0074: // fillPoly
- nDataSize=ReadAndDrawPolygon(PDM_FILL);
+ nDataSize=ReadAndDrawPolygon(shapeDMethod);
break;
case 0x0075: // Reserved (Polygon-Size)
@@ -1731,23 +1649,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0078: // frameSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_FRAME);
- break;
-
case 0x0079: // paintSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_PAINT);
- break;
-
case 0x007a: // eraseSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_ERASE);
- break;
-
case 0x007b: // invertSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_INVERT);
- break;
-
case 0x007c: // fillSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_FILL);
+ nDataSize=ReadAndDrawSamePolygon(shapeDMethod);
break;
case 0x007d: // Reserved (0 Bytes)
@@ -1757,23 +1663,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0080: // frameRgn
- nDataSize=ReadAndDrawRgn(PDM_FILL);
- break;
-
case 0x0081: // paintRgn
- nDataSize=ReadAndDrawRgn(PDM_PAINT);
- break;
-
case 0x0082: // eraseRgn
- nDataSize=ReadAndDrawRgn(PDM_ERASE);
- break;
-
case 0x0083: // invertRgn
- nDataSize=ReadAndDrawRgn(PDM_INVERT);
- break;
-
case 0x0084: // fillRgn
- nDataSize=ReadAndDrawRgn(PDM_FILL);
+ nDataSize=ReadAndDrawRgn(shapeDMethod);
break;
case 0x0085: // Reserved (Region-Size)
@@ -1783,23 +1677,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0088: // frameSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_FRAME);
- break;
-
case 0x0089: // paintSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_PAINT);
- break;
-
case 0x008a: // eraseSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_ERASE);
- break;
-
case 0x008b: // invertSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_INVERT);
- break;
-
case 0x008c: // fillSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_FILL);
+ nDataSize=ReadAndDrawSameRgn(shapeDMethod);
break;
case 0x008d: // Reserved (0 Bytes)
@@ -1884,7 +1766,9 @@ ULONG PictReader::ReadData(USHORT nOpcode)
if (nOpcode<=0x00af) { *pPict >> nUSHORT; nDataSize=2+nUSHORT; }
else if (nOpcode<=0x00cf) { nDataSize=0; }
else if (nOpcode<=0x00fe) { sal_uInt32 nTemp; *pPict >> nTemp ; nDataSize = nTemp; nDataSize+=4; }
- else if (nOpcode==0x00ff) { nDataSize=2; } // OpEndPic
+ // Osnola: checkme: in the Quickdraw Ref examples ( for pict v2)
+ // 0x00ff(EndOfPict) is also not followed by any data...
+ else if (nOpcode==0x00ff) { nDataSize=IsVersion2 ? 2 : 0; } // OpEndPic
else if (nOpcode<=0x01ff) { nDataSize=2; }
else if (nOpcode<=0x0bfe) { nDataSize=4; }
else if (nOpcode<=0x0bff) { nDataSize=22; }
@@ -1914,7 +1798,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aActForeColor = Color(COL_BLACK);
aActBackColor = Color(COL_WHITE);
- nActPenSize = 1;
+ nActPenSize = Size(1,1);
eActROP = ROP_OVERPAINT;
eActMethod = PDM_UNDEFINED;
aActOvalSize = Size(1,1);
diff --git a/filter/source/graphicfilter/ipict/makefile.mk b/filter/source/graphicfilter/ipict/makefile.mk
index 679fd79951ac..dd8dfbc400c2 100644
--- a/filter/source/graphicfilter/ipict/makefile.mk
+++ b/filter/source/graphicfilter/ipict/makefile.mk
@@ -41,18 +41,18 @@ DEPTARGET=vipict
CDEFS+= -DEDITDEBUG
.ENDIF
.IF "$(L10N_framework)"==""
-SLOFILES = $(SLO)$/ipict.obj
+SLOFILES = $(SLO)$/ipict.obj $(SLO)$/shape.obj
# ==========================================================================
SHL1TARGET= ipt$(DLLPOSTFIX)
SHL1IMPLIB= ipict
-SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB)
+SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB) $(BASEGFXLIB)
SHL1LIBS= $(SLB)$/ipict.lib
.IF "$(GUI)" != "UNX"
.IF "$(COM)" != "GCC"
-SHL1OBJS= $(SLO)$/ipict.obj
+SHL1OBJS= $(SLOFILES)
.ENDIF
.ENDIF
diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx
new file mode 100755
index 000000000000..fdf32830b728
--- /dev/null
+++ b/filter/source/graphicfilter/ipict/shape.cxx
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+/** Osnola:
+IMPORTANT NOTE: some Quickdraw lines/frames can not be "quickly" drawn exactly:
+for instance, when PenSize=(1,1), the line from (0,0) to (8,0)
+corresponds to the rectangle (0,0)(0,1)(9,1)(9,0), which can only be drawn
+ by drawing a rectangle. Drawing a non horizontal/vertical will imply to draw
+a polygon, ...
+Similarly, drawing the frame of a rectangle (0,0)(0,1)(9,1)(9,0) when PenSize=(1,1),
+will imply to draw a rectangle (0.5,0.5)(0.5,8.5)(8.5,8.5)(8.5,0.5) with linewidth=1...
+
+Here, we choose:
+- for horizontal/vertical lines and line with length less than five to draw the real line,
+- in the other case, we keep the same shape (even if this means some "bad" coordinates)
+*/
+#include "precompiled_filter.hxx"
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include "shape.hxx"
+
+namespace PictReaderShapePrivate {
+ /** returns an inside rectangle knowing the penSize in order to obtain the ``correct'' position
+ when we draw a frame in wide length*/
+ Rectangle contractRectangle(bool drawFrame, Rectangle const &rect, Size const &pSize) {
+ if (!drawFrame) return rect;
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2;
+ if (2*penSize > rect.Bottom()-rect.Top()) penSize = (rect.Bottom()-rect.Top()+1)/2;
+ int const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 };
+ int const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 };
+ return Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1]));
+ }
+}
+
+namespace PictReaderShape {
+ //--------- draws a horizontal/vertical/small line (by creating a "rectangle/polygon") ---------
+ bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) {
+ int dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() };
+ bool vertic = dir[0] == 0;
+ bool horiz = dir[1] == 0;
+ if (!horiz && !vertic && dir[0]*dir[0]+dir[1]*dir[1] > 25) return false;
+
+ int X[2]={ orig.X(), dest.X() }, Y[2] = { orig.Y(), dest.Y() };
+ using namespace basegfx;
+ B2DPolygon poly;
+ if (horiz || vertic) {
+ if (horiz) {
+ if (X[0] < X[1]) X[1]+=pSize.Width();
+ else X[0]+=pSize.Width();
+ Y[1] += pSize.Height();
+ }
+ else {
+ if (Y[0] < Y[1]) Y[1]+=pSize.Height();
+ else Y[0]+=pSize.Height();
+ X[1] += pSize.Width();
+ }
+ poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0]));
+ poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1]));
+ poly.append(B2DPoint(X[0], Y[0]));
+ }
+ else {
+ int origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() },
+ { orig.X()+pSize.Width(), orig.Y()+pSize.Height() },
+ { orig.X(), orig.Y()+pSize.Height() }};
+ int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0);
+ int destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() },
+ { dest.X()+pSize.Width(), dest.Y()+pSize.Height() },
+ { dest.X(), dest.Y()+pSize.Height() }};
+ for (int w = origAvoid+1; w < origAvoid+4; w++) {
+ int wh = (w%4);
+ poly.append(B2DPoint(origPt[wh][0], origPt[wh][1]));
+ }
+ for (int w = origAvoid+3; w < origAvoid+6; w++) {
+ int wh = (w%4);
+ poly.append(B2DPoint(destPt[wh][0], destPt[wh][1]));
+ }
+ int wh = (origAvoid+1)%4;
+ poly.append(B2DPoint(origPt[wh][0], origPt[wh][1]));
+ }
+
+ // HACK: here we use the line coloring when drawing the shape
+ // must be changed if other parameter are changed to draw
+ // a line/fill shape
+ Color oldFColor = dev->GetFillColor(), oldLColor = dev->GetLineColor();
+ dev->SetFillColor(oldLColor); dev->SetLineColor(Color(COL_TRANSPARENT));
+ dev->DrawPolygon(poly);
+ dev->SetLineColor(oldLColor); dev->SetFillColor(oldFColor);
+ return true;
+ }
+
+ //
+ //-------------------- draws a line --------------------
+ //
+ void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) {
+ if (drawLineHQ(dev,orig,dest,pSize)) return;
+
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ int decal[2] = { pSize.Width()/2, pSize.Height()/2};
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ poly.append(B2DPoint(double(orig.X()+decal[0]), double(orig.Y()+decal[1])));
+ poly.append(B2DPoint(double(dest.X()+decal[0]), double(dest.Y()+decal[1])));
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ }
+
+ //-------------------- draws a rectangle --------------------
+ /* Note(checkme): contradically with the QuickDraw's reference 3-23, it seems better to consider
+ that the frame/content of a rectangle appears inside the given rectangle. Does a conversion
+ appear between the pascal functions and the data stored in the file ? */
+ void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ double const X[2] = { rect.Left(), rect.Right() };
+ double const Y[2] = { rect.Top(), rect.Bottom() };
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0]));
+ poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1]));
+ poly.append(B2DPoint(X[0], Y[0]));
+
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws an ellipse --------------------
+ void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ using namespace basegfx;
+ double const X[2] = { oval.Left(), oval.Right() };
+ double const Y[2] = { oval.Top(), oval.Bottom() };
+ B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0]));
+ B2DPolygon poly = tools::createPolygonFromEllipse(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]));
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws an arc/pie --------------------
+ void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle arc = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ using namespace basegfx;
+
+ double const PI2 = M_PI/2.0;
+ // pict angle are CW with 0 at twelve oclock ( with Y-axis inverted)...
+ double angl1 = angle1-PI2;
+ double angl2 = angle2-PI2;
+ double const X[2] = { arc.Left(), arc.Right() };
+ double const Y[2] = { arc.Top(), arc.Bottom() };
+ B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0]));
+
+ // We must have angl1 between 0 and F_2PI
+ while (angl1 < 0.0) { angl1 += F_2PI; angl2 += F_2PI; }
+ while (angl1 >= F_2PI) { angl1 -= F_2PI; angl2 -= F_2PI; }
+
+ // if this happen, we want a complete circle
+ // so we set angl2 slightly less than angl1
+ if (angl2 >= angl1+F_2PI) angl2 = angl1-0.001;
+
+ // We must have angl2 between 0 and F_2PI
+ while (angl2 < 0.0) angl2 += F_2PI;
+ while (angl2 >= F_2PI) angl2 -= F_2PI;
+
+ B2DPolygon poly = tools::createPolygonFromEllipseSegment(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]), angl1, angl2);
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else {
+ // adds circle's center
+ poly.append(center);
+ dev->DrawPolygon(poly);
+ }
+ }
+ //-------------------- draws a rectangle with round corner --------------------
+ void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalSize, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ int ovalW=ovalSize.Width(), ovalH=ovalSize.Height();
+ using namespace basegfx;
+ double const X[2] = { oval.Left(), oval.Right() };
+ double const Y[2] = { oval.Top(), oval.Bottom() };
+ double width = X[1] - X[0];
+ double height = Y[1] - Y[0];
+ if (ovalW > width) ovalW = width;
+ if (ovalH > height) ovalH = height;
+
+ B2DRectangle rect(B2DPoint(X[0],Y[0]), B2DPoint(X[1],Y[1]));
+ B2DPolygon poly = tools::createPolygonFromRect(rect, (width != 0.0) ? ovalW/width : 0.0, (height != 0.0) ? ovalH/height : 0.0);
+
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws a polygon --------------------
+ void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ int decalTL[2] = {0, 0}, decalBR[2] = { pSize.Width(), pSize.Height()};
+ if (drawFrame) {
+ decalTL[0] += penSize/2; decalTL[1] += penSize/2;
+ decalBR[0] -= (penSize+1)/2; decalBR[1] -= (penSize+1)/2;
+ }
+ // Quickdraw Drawing Reference 3-82: the pen size is only used for frame
+ else decalBR[0] = decalBR[1] = 0.0;
+
+
+ int numPt = orig.GetSize();
+ if (numPt <= 1) return;
+
+ // we compute a barycenter of the point to define the extended direction of each point
+ double bary[2] = { 0.0, 0.0 };
+ for (int i = 0; i < numPt; i++) {
+ Point const &pt = orig.GetPoint(i);
+ bary[0] += double(pt.X()); bary[1] += double(pt.Y());
+ }
+ bary[0]/=double(numPt); bary[1]/=double(numPt);
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ // Note: a polygon can be open, so we must not close it when we draw the frame
+ for (int i = 0; i < numPt; i++) {
+ Point const &pt = orig.GetPoint(i);
+ double x = (double(pt.X()) < bary[0]) ? pt.X()+decalTL[0] : pt.X()+decalBR[0];
+ double y = (double(pt.Y()) < bary[1]) ? pt.Y()+decalTL[1] : pt.Y()+decalBR[1];
+ poly.append(B2DPoint(x, y));
+ }
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+
+}
diff --git a/filter/source/graphicfilter/ipict/shape.hxx b/filter/source/graphicfilter/ipict/shape.hxx
new file mode 100755
index 000000000000..635a7cf06c1e
--- /dev/null
+++ b/filter/source/graphicfilter/ipict/shape.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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 <vcl/virdev.hxx>
+
+namespace PictReaderShape {
+ /** draws a line from orig to dest knowing penSize
+
+ Attention: in order to draw horizontal/vertical/small lines, this function can instead draw a rectangle or
+ a polygon. In this case, we retrieve the line informations from VirtualDev ( GetLineColor )
+ and we use them as fill informations ( SetFillColor ). We restore after the VirtualDev state.
+
+ This implies also that this function must be modified if we use real pattern to draw these primitives.
+ */
+ void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize);
+
+ /** draws a rectangle knowing penSize */
+ void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &rect, Size const &pSize);
+
+ /** draws a polygon knowing penSize */
+ void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &rect, Size const &pSize);
+
+ /** draws an ellipse knowing penSize */
+ void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize);
+
+ /** draws a rounded rectangle knowing penSize
+ \note ovalSize is two time the size of the corner
+ */
+ void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalS, Size const &pSize);
+
+ /** draws an arc in a b2dpolygon knowing penSize
+ \note - it supposes that angl1 < angl2
+ */
+ void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize);
+}
diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk
index 7780529b5580..96a4a616bfb2 100644
--- a/filter/source/msfilter/makefile.mk
+++ b/filter/source/msfilter/makefile.mk
@@ -25,11 +25,12 @@
#
#*************************************************************************
-PRJ=../..
+PRJ=..$/..
PRJNAME=filter
TARGET=msfilter
-ENABLE_EXCEPTIONS=true
+
+ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -43,16 +44,17 @@ SLOFILES= \
$(SLO)$/countryid.obj \
$(SLO)$/escherex.obj \
$(SLO)$/eschesdo.obj \
+ $(SLO)$/mscodec.obj \
$(SLO)$/msdffimp.obj \
+ $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/msocximex.obj \
$(SLO)$/msoleexp.obj \
+ $(SLO)$/msvbahelper.obj \
$(SLO)$/msvbasic.obj \
- $(SLO)$/svxmsbas.obj \
- $(SLO)$/msocximex.obj \
- $(SLO)$/mscodec.obj \
- $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/services.obj \
$(SLO)$/svdfppt.obj \
- $(SLO)$/svxmsbas2.obj \
- $(SLO)$/msvbahelper.obj \
+ $(SLO)$/svxmsbas.obj \
+ $(SLO)$/svxmsbas2.obj
SHL1TARGET= msfilter$(DLLPOSTFIX)
SHL1IMPLIB= i$(TARGET)
@@ -83,4 +85,10 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/msfilter.component
+$(MISC)/msfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ msfilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt msfilter.component
diff --git a/filter/source/msfilter/msfilter.component b/filter/source/msfilter/msfilter.component
new file mode 100755
index 000000000000..64128aa1385b
--- /dev/null
+++ b/filter/source/msfilter/msfilter.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.vba.VBAMacroResolver">
+ <service name="com.sun.star.script.vba.VBAMacroResolver"/>
+ </implementation>
+</component>
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index e40c3c2c61c2..3bbcf7b4727d 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -36,13 +36,15 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
#include <unotools/pathoptions.hxx>
using namespace ::com::sun::star;
-namespace ooo { namespace vba {
+namespace ooo {
+namespace vba {
const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
@@ -63,6 +65,16 @@ String makeMacroURL( const String& sMacroName )
return ::rtl::OUString();
}
+::rtl::OUString trimMacroName( const ::rtl::OUString& rMacroName )
+{
+ // the name may contain whitespaces and may be enclosed in apostrophs
+ ::rtl::OUString aMacroName = rMacroName.trim();
+ sal_Int32 nMacroLen = aMacroName.getLength();
+ if( (nMacroLen >= 2) && (aMacroName[ 0 ] == '\'') && (aMacroName[ nMacroLen - 1 ] == '\'') )
+ aMacroName = aMacroName.copy( 1, nMacroLen - 2 ).trim();
+ return aMacroName;
+}
+
SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
{
SfxObjectShell* pFoundShell=NULL;
@@ -227,26 +239,16 @@ void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModul
sProcedure = sMacro;
}
-VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
+MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
{
- VBAMacroResolvedInfo aRes;
- if ( !pShell )
- return aRes;
- aRes.SetMacroDocContext( pShell );
+ if( !pShell )
+ return MacroResolvedInfo();
// the name may be enclosed in apostrophs
- ::rtl::OUString sMacroUrl = MacroName;
- sal_Int32 nMacroLen = MacroName.getLength();
- if( (nMacroLen >= 2) && (MacroName[0] == '\'') && (MacroName[nMacroLen-1] == '\'') )
- sMacroUrl = MacroName.copy( 1, nMacroLen - 2 );
+ ::rtl::OUString aMacroName = trimMacroName( MacroName );
// parse the macro name
- sal_Int32 nDocSepIndex = sMacroUrl.indexOf( '!' );
-
- String sContainer;
- String sModule;
- String sProcedure;
-
+ sal_Int32 nDocSepIndex = aMacroName.indexOf( '!' );
if( nDocSepIndex > 0 )
{
// macro specified by document name
@@ -254,10 +256,10 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
// recursively
// assume for now that the document name is *this* document
- String sDocUrlOrPath = sMacroUrl.copy( 0, nDocSepIndex );
- sMacroUrl = sMacroUrl.copy( nDocSepIndex + 1 );
+ String sDocUrlOrPath = aMacroName.copy( 0, nDocSepIndex );
+ aMacroName = aMacroName.copy( nDocSepIndex + 1 );
OSL_TRACE("doc search, current shell is 0x%x", pShell );
- SfxObjectShell* pFoundShell = NULL;
+ SfxObjectShell* pFoundShell = 0;
if( bSearchGlobalTemplates )
{
SvtPathOptions aPathOpt;
@@ -265,129 +267,124 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
if( rtl::OUString( sDocUrlOrPath ).indexOf( aAddinPath ) == 0 )
pFoundShell = pShell;
}
- if( pFoundShell == NULL )
+ if( !pFoundShell )
pFoundShell = findShellForUrl( sDocUrlOrPath );
OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell );
- aRes = resolveVBAMacro( pFoundShell, sMacroUrl, bSearchGlobalTemplates );
- return aRes;
+ return resolveVBAMacro( pFoundShell, aMacroName );
}
- else
- {
- // macro is contained in 'this' document ( or code imported from a template
- // where that template is a global template or perhaps the template this
- // document is created from )
- // macro format = Container.Module.Procedure
- parseMacro( sMacroUrl, sContainer, sModule, sProcedure );
- uno::Reference< container::XNameContainer > xPrjNameCache;
+ // macro is contained in 'this' document ( or code imported from a template
+ // where that template is a global template or perhaps the template this
+ // document is created from )
+
+ MacroResolvedInfo aRes( pShell );
- // As long as service VBAProjectNameProvider isn't supported in the model, disable the createInstance call
- // (the ServiceNotRegisteredException is wrongly caught in ScModelObj::createInstance)
- //uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
- //if ( xSF.is() )
- // xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
+ // macro format = Container.Module.Procedure
+ String sContainer, sModule, sProcedure;
+ parseMacro( aMacroName, sContainer, sModule, sProcedure );
+ uno::Reference< container::XNameContainer > xPrjNameCache;
- std::vector< rtl::OUString > sSearchList;
+ // As long as service VBAProjectNameProvider isn't supported in the model, disable the createInstance call
+ // (the ServiceNotRegisteredException is wrongly caught in ScModelObj::createInstance)
+ //uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
+ //if ( xSF.is() )
+ // xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
- if ( sContainer.Len() > 0 )
+ std::vector< rtl::OUString > sSearchList;
+
+ if ( sContainer.Len() > 0 )
+ {
+ // get the Project associated with the Container
+ if ( xPrjNameCache.is() )
{
- // get the Project associated with the Container
- if ( xPrjNameCache.is() )
+ if ( xPrjNameCache->hasByName( sContainer ) )
{
- if ( xPrjNameCache->hasByName( sContainer ) )
- {
- rtl::OUString sProject;
- xPrjNameCache->getByName( sContainer ) >>= sProject;
- sContainer = sProject;
- }
+ rtl::OUString sProject;
+ xPrjNameCache->getByName( sContainer ) >>= sProject;
+ sContainer = sProject;
}
- sSearchList.push_back( sContainer ); // First Lib to search
}
- else
+ sSearchList.push_back( sContainer ); // First Lib to search
+ }
+ else
+ {
+ // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
+ // get the name of Project/Library for 'this' document
+ rtl::OUString sThisProject;
+ BasicManager* pBasicMgr = pShell-> GetBasicManager();
+ if ( pBasicMgr )
{
- // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
- // get the name of Project/Library for 'this' document
- rtl::OUString sThisProject;
- BasicManager* pBasicMgr = pShell-> GetBasicManager();
- if ( pBasicMgr )
- {
- if ( pBasicMgr->GetName().Len() )
- sThisProject = pBasicMgr->GetName();
- else // cater for the case where VBA is not enabled
- sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
- }
- sSearchList.push_back( sThisProject ); // First Lib to search
- if ( xPrjNameCache.is() )
- {
- // is this document created from a template?
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+ if ( pBasicMgr->GetName().Len() )
+ sThisProject = pBasicMgr->GetName();
+ else // cater for the case where VBA is not enabled
+ sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ }
+ sSearchList.push_back( sThisProject ); // First Lib to search
+ if ( xPrjNameCache.is() )
+ {
+ // is this document created from a template?
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
- if ( sCreatedFrom.getLength() )
+ rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
+ if ( sCreatedFrom.getLength() )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( sCreatedFrom );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sCreatedFrom;
+ else
{
- INetURLObject aObj;
- aObj.SetURL( sCreatedFrom );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sCreatedFrom;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
- aObj.SetURL( aURL );
- }
- sCreatedFrom = aObj.GetLastName();
+ osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
+ aObj.SetURL( aURL );
}
+ sCreatedFrom = aObj.GetLastName();
+ }
- sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
- if ( nIndex != -1 )
- sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
+ sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
+ if ( nIndex != -1 )
+ sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
- rtl::OUString sPrj;
- if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
- {
- xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
+ rtl::OUString sPrj;
+ if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
+ {
+ xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
+ }
- // get list of global template Names
- uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
- sal_Int32 nLen = sTemplateNames.getLength();
- for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
- {
+ // get list of global template Names
+ uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
+ sal_Int32 nLen = sTemplateNames.getLength();
+ for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
+ {
- if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
+ if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
+ {
+ if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
{
- if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
- {
- xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
+ xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
}
-
}
+
}
}
- std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
- for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it )
- {
- bool bRes = hasMacro( pShell, *it, sModule, sProcedure );
- if ( bRes )
- {
- aRes.SetResolved( true );
- aRes.SetMacroDocContext( pShell );
- sContainer = *it;
- break;
- }
- }
- aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) );
}
+ std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
+ for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); !aRes.mbFound && (it != it_end); ++it )
+ {
+ aRes.mbFound = hasMacro( pShell, *it, sModule, sProcedure );
+ if ( aRes.mbFound )
+ sContainer = *it;
+ }
+ aRes.msResolvedMacro = sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 );
return aRes;
}
@@ -428,4 +425,117 @@ sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Se
}
return bRes;
}
-} } // vba // ooo
+
+// ============================================================================
+
+uno::Sequence< ::rtl::OUString > VBAMacroResolver_getSupportedServiceNames()
+{
+ uno::Sequence< ::rtl::OUString > aServiceNames( 1 );
+ aServiceNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.vba.VBAMacroResolver" ) );
+ return aServiceNames;
+}
+
+::rtl::OUString VBAMacroResolver_getImplementationName()
+{
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.vba.VBAMacroResolver" ) );
+}
+
+uno::Reference< uno::XInterface > SAL_CALL VBAMacroResolver_createInstance( const uno::Reference< uno::XComponentContext >& ) throw (uno::Exception)
+{
+ return static_cast< ::cppu::OWeakObject* >( new VBAMacroResolver );
+}
+
+// ============================================================================
+
+VBAMacroResolver::VBAMacroResolver() :
+ mpObjShell( 0 )
+{
+}
+
+VBAMacroResolver::~VBAMacroResolver()
+{
+}
+
+// com.sun.star.lang.XServiceInfo interface -----------------------------------
+
+::rtl::OUString SAL_CALL VBAMacroResolver::getImplementationName() throw (uno::RuntimeException)
+{
+ return VBAMacroResolver_getImplementationName();
+}
+
+sal_Bool SAL_CALL VBAMacroResolver::supportsService( const ::rtl::OUString& rService ) throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices = VBAMacroResolver_getSupportedServiceNames();
+ const ::rtl::OUString* pArray = aServices.getConstArray();
+ const ::rtl::OUString* pArrayEnd = pArray + aServices.getLength();
+ return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames() throw (uno::RuntimeException)
+{
+ return VBAMacroResolver_getSupportedServiceNames();
+}
+
+// com.sun.star.lang.XInitialization interface --------------------------------
+
+void SAL_CALL VBAMacroResolver::initialize( const uno::Sequence< uno::Any >& rArgs ) throw (uno::Exception, uno::RuntimeException)
+{
+ OSL_ENSURE( rArgs.getLength() < 2, "VBAMacroResolver::initialize - missing arguments" );
+ if( rArgs.getLength() < 2 )
+ throw uno::RuntimeException();
+
+ // first argument: document model
+ mxModel.set( rArgs[ 0 ], uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XUnoTunnel > xUnoTunnel( mxModel, uno::UNO_QUERY_THROW );
+ mpObjShell = reinterpret_cast< SfxObjectShell* >( xUnoTunnel->getSomething( SfxObjectShell::getUnoTunnelId() ) );
+ if( !mpObjShell )
+ throw uno::RuntimeException();
+
+ // second argument: VBA project name
+ if( !(rArgs[ 1 ] >>= maProjectName) || (maProjectName.getLength() == 0) )
+ throw uno::RuntimeException();
+}
+
+// com.sun.star.script.vba.XVBAMacroResolver interface ------------------------
+
+::rtl::OUString SAL_CALL VBAMacroResolver::resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if( !mpObjShell )
+ throw uno::RuntimeException();
+
+ // the name may be enclosed in apostrophs
+ ::rtl::OUString aMacroName = trimMacroName( rVBAMacroName );
+ if( aMacroName.getLength() == 0 )
+ throw lang::IllegalArgumentException();
+
+ // external references not supported here (syntax is "url!macroname" or "[url]!macroname" or "[url]macroname")
+ if( (aMacroName[ 0 ] == '[') || (aMacroName.indexOf( '!' ) >= 0) )
+ throw lang::IllegalArgumentException();
+
+ // check if macro name starts with project name, replace with "Standard"
+ // TODO: adjust this when custom VBA project name is supported
+ sal_Int32 nDotPos = aMacroName.indexOf( '.' );
+ if( (nDotPos == 0) || (nDotPos + 1 == aMacroName.getLength()) )
+ throw lang::IllegalArgumentException();
+ if( (nDotPos > 0) && aMacroName.matchIgnoreAsciiCase( maProjectName ) )
+ aMacroName = aMacroName.copy( nDotPos + 1 );
+
+ // try to find the macro
+ MacroResolvedInfo aInfo = resolveVBAMacro( mpObjShell, aMacroName, false );
+ if( !aInfo.mbFound )
+ throw lang::IllegalArgumentException();
+
+ // build and return the script URL
+ return makeMacroURL( aInfo.msResolvedMacro );
+}
+
+::rtl::OUString SAL_CALL VBAMacroResolver::resolveScriptURLtoVBAMacro( const ::rtl::OUString& /*rScriptURL*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ OSL_ENSURE( false, "VBAMacroResolver::resolveScriptURLtoVBAMacro - not implemented" );
+ throw uno::RuntimeException();
+}
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx
new file mode 100755
index 000000000000..09a303f72141
--- /dev/null
+++ b/filter/source/msfilter/services.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * 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 <cppuhelper/implementationentry.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+
+// Declare static functions providing service information =====================
+
+#define DECLARE_FUNCTIONS( className ) \
+extern OUString SAL_CALL className##_getImplementationName() throw(); \
+extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \
+extern Reference< XInterface > SAL_CALL className##_createInstance( \
+ const Reference< XComponentContext >& rxContext ) throw (Exception)
+
+namespace ooo { namespace vba { DECLARE_FUNCTIONS( VBAMacroResolver ); } }
+
+#undef DECLARE_FUNCTIONS
+
+// ============================================================================
+
+namespace {
+
+#define IMPLEMENTATION_ENTRY( className ) \
+ { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }
+
+static ::cppu::ImplementationEntry const spServices[] =
+{
+ IMPLEMENTATION_ENTRY( ::ooo::vba::VBAMacroResolver ),
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+#undef IMPLEMENTATION_ENTRY
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
+{
+ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
+{
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
+}
+
+// ============================================================================
diff --git a/forms/inc/pch/precompiled_forms.hxx b/forms/inc/pch/precompiled_forms.hxx
index f75e8ca4316a..c6c9cd5d5341 100644..100755
--- a/forms/inc/pch/precompiled_forms.hxx
+++ b/forms/inc/pch/precompiled_forms.hxx
@@ -389,10 +389,10 @@
#include "vcl/bmpacc.hxx"
#include "vcl/cvtgrf.hxx"
#include "vcl/mapmod.hxx"
-#include "vcl/mapunit.hxx"
+#include "tools/mapunit.hxx"
#include "vcl/stdtext.hxx"
#include "vcl/timer.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vos/mutex.hxx"
#include "vos/thread.hxx"
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index 3a36078a7fed..c3f759696ef9 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <vcl/svapp.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/formattedcolumnvalue.hxx>
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index d664be8e4a86..f9f17524756f 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -72,7 +72,7 @@
#include <unotools/localedatawrapper.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
//--------------------------------------------------------------------------
extern "C" void SAL_CALL createRegistryInfo_OFilterControl()
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index a35a300dda78..654a2e5a19b4 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -43,7 +43,7 @@
#include <svl/numuno.hxx>
#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <i18npool/mslangid.hxx>
#include <rtl/textenc.h>
#include <com/sun/star/sdbc/DataType.hpp>
diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx
index a3f0da71aca7..e4dea25ec225 100644
--- a/forms/source/richtext/richtextcontrol.hxx
+++ b/forms/source/richtext/richtextcontrol.hxx
@@ -37,7 +37,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/implementationreference.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include "rtattributes.hxx"
#include "attributedispatcher.hxx"
diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx
index 1105f8a51c1c..3b220a2e222a 100644
--- a/forms/source/richtext/richtextengine.cxx
+++ b/forms/source/richtext/richtextengine.cxx
@@ -38,7 +38,7 @@
#define ITEMID_LANGUAGE EE_CHAR_LANGUAGE
#include <editeng/langitem.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/outdev.hxx>
#include <unotools/lingucfg.hxx>
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index 3a82822f6701..7aac8918c877 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -42,7 +42,7 @@
#include <editeng/editobj.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index c19fe516beb2..b56319f33dee 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -35,7 +35,7 @@
#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
#include <svl/itempool.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/outdev.hxx>
diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx
index 1e7c6cd8b854..0040d5d4e6ad 100644
--- a/forms/source/solar/component/navbarcontrol.hxx
+++ b/forms/source/solar/component/navbarcontrol.hxx
@@ -39,7 +39,7 @@
#include <toolkit/awt/vclxwindow.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
//.........................................................................
namespace frm
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index 21839554aefc..c203924f6e51 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -42,7 +42,7 @@
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include "commonpicker.hxx"
#include "pickercallbacks.hxx"
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index fdf4866daf24..cfb3574f702e 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -1445,7 +1445,7 @@ uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() t
OSL_ASSERT( m_pDialog != NULL );
// TODO return m_pImpl->getSupportedImageFormats();
- return 0;
+ return uno::Sequence<sal_Int16>();
}
sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeException )
diff --git a/framework/inc/pch/precompiled_framework.hxx b/framework/inc/pch/precompiled_framework.hxx
index 45919a31047b..b4afb017ebab 100644
--- a/framework/inc/pch/precompiled_framework.hxx
+++ b/framework/inc/pch/precompiled_framework.hxx
@@ -463,7 +463,7 @@
#include "vcl/keycod.hxx"
#include "vcl/keycodes.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/mapunit.hxx"
+#include "tools/mapunit.hxx"
#include "vcl/menu.hxx"
#include "vcl/mnemonic.hxx"
#include "vcl/morebtn.hxx"
@@ -482,7 +482,7 @@
#include "vcl/timer.hxx"
#include "vcl/wall.hxx"
#include "vcl/window.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vos/mutex.hxx"
#include "vos/process.hxx"
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 0110a0b40b9e..e6a638c654e9 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -85,7 +85,7 @@
#include <cppuhelper/implbase8.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/propertycontainer.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <svtools/miscopt.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/timer.hxx>
diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx
index a71c5263455b..67c047dfefd4 100644
--- a/framework/source/helper/tagwindowasmodified.cxx
+++ b/framework/source/helper/tagwindowasmodified.cxx
@@ -61,7 +61,7 @@
#include <vcl/syswin.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
//_________________________________________________________________________________________________________________
// namespace
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index 58cf3a3b02be..0b1a0d003133 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -51,7 +51,7 @@
#ifndef _VCL_MENU_HXX_
#include <vcl/menu.hxx>
#endif
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#ifndef _VCL_SVAPP_HXX_
#include <vcl/svapp.hxx>
#endif
diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
index 1034de7f11bf..1034de7f11bf 100755..100644
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 9674c28d54df..8ed982f34523 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -51,16 +51,16 @@ using namespace osl;
namespace jfw
{
-rtl::OString getElementUpdated()
+rtl::OString getElement(::rtl::OString const & docPath,
+ xmlChar const * pathExpression, bool bThrowIfEmpty)
{
//Prepare the xml document and context
- rtl::OString sSettingsPath = jfw::getVendorSettingsPath();
- OSL_ASSERT(sSettingsPath.getLength() > 0);
- jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr()));
+ OSL_ASSERT(docPath.getLength() > 0);
+ jfw::CXmlDocPtr doc(xmlParseFile(docPath.getStr()));
if (doc == NULL)
throw FrameworkException(
JFW_E_ERROR,
- rtl::OString("[Java framework] Error in function getElementUpdated "
+ rtl::OString("[Java framework] Error in function getElement "
"(elements.cxx)"));
jfw::CXPathContextPtr context(xmlXPathNewContext(doc));
@@ -68,20 +68,42 @@ rtl::OString getElementUpdated()
(xmlChar*) NS_JAVA_FRAMEWORK) == -1)
throw FrameworkException(
JFW_E_ERROR,
- rtl::OString("[Java framework] Error in function getElementUpdated "
+ rtl::OString("[Java framework] Error in function getElement "
"(elements.cxx)"));
+
CXPathObjectPtr pathObj;
- pathObj = xmlXPathEvalExpression(
- (xmlChar*)"/jf:javaSelection/jf:updated/text()", context);
+ pathObj = xmlXPathEvalExpression(pathExpression, context);
+ rtl::OString sValue;
if (xmlXPathNodeSetIsEmpty(pathObj->nodesetval))
- throw FrameworkException(
- JFW_E_ERROR,
- rtl::OString("[Java framework] Error in function getElementUpdated "
- "(elements.cxx)"));
- rtl::OString sValue = (sal_Char*) pathObj->nodesetval->nodeTab[0]->content;
+ {
+ if (bThrowIfEmpty)
+ throw FrameworkException(
+ JFW_E_ERROR,
+ rtl::OString("[Java framework] Error in function getElement "
+ "(elements.cxx)"));
+ }
+ else
+ {
+ sValue = (sal_Char*) pathObj->nodesetval->nodeTab[0]->content;
+ }
return sValue;
}
+rtl::OString getElementUpdated()
+{
+ return getElement(jfw::getVendorSettingsPath(),
+ (xmlChar*)"/jf:javaSelection/jf:updated/text()", true);
+}
+
+// Use only in INSTALL mode !!!
+rtl::OString getElementModified()
+{
+ //The modified element is only written in INSTALL mode.
+ //That is NodeJava::m_layer = INSTALL
+ return getElement(jfw::getInstallSettingsPath(),
+ (xmlChar*)"/jf:java/jf:modified/text()", false);
+}
+
void createSettingsStructure(xmlDoc * document, bool * bNeedsSave)
{
@@ -579,6 +601,21 @@ void NodeJava::write() const
xmlAddChild(jreLocationsNode, nodeCrLf);
}
}
+
+ if (INSTALL == m_layer)
+ {
+ //now write the current system time
+ ::TimeValue curTime = {0,0};
+ if (::osl_getSystemTime(& curTime))
+ {
+ rtl::OUString sSeconds =
+ rtl::OUString::valueOf((sal_Int64) curTime.Seconds);
+ xmlNewTextChild(
+ root,NULL, (xmlChar*) "modified", CXmlCharPtr(sSeconds));
+ xmlNode * nodeCrLf = xmlNewText((xmlChar*) "\n");
+ xmlAddChild(root, nodeCrLf);
+ }
+ }
if (xmlSaveFormatFile(sSettingsPath.getStr(), docUser, 1) == -1)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
}
@@ -721,7 +758,7 @@ jfw::FileStatus NodeJava::checkSettingsFileStatus() const
File::RC rc_stat = item.getFileStatus(stat);
if (File::E_None == rc_stat)
{
- //ToDo we remove the file and create it shortly after. This
+ // This
//function may be called multiple times when a java is started.
//If the expiretime is too small then we may loop because everytime
//the file is deleted and we need to search for a java again.
@@ -732,20 +769,27 @@ jfw::FileStatus NodeJava::checkSettingsFileStatus() const
//that after removing the file and shortly later creating it again
//did not change the creation time. That is the newly created file
//had the creation time of the former file.
-// ::TimeValue time = stat.getCreationTime();
- ::TimeValue modTime = stat.getModifyTime();
+ // ::TimeValue modTime = stat.getModifyTime();
::TimeValue curTime = {0,0};
+ ret = FILE_OK;
if (sal_True == ::osl_getSystemTime(& curTime))
{
- if ( curTime.Seconds - modTime.Seconds >
+ //get the modified time recorded in the <modified> element
+ sal_uInt32 modified = getModifiedTime();
+ OSL_ASSERT(modified <= curTime.Seconds);
+ //Only if modified has a valued then NodeJava::write was called,
+ //then the xml structure was filled with data.
+
+ if ( modified && curTime.Seconds - modified >
BootParams::getInstallDataExpiration())
{
#if OSL_DEBUG_LEVEL >=2
+ fprintf(stderr, "[Java framework] Settings file is %d seconds old. \n",
+ (int)( curTime.Seconds - modified));
rtl::OString s = rtl::OUStringToOString(sURL, osl_getThreadTextEncoding());
- fprintf(stderr, "[Java framework] Deleting settings file at \n%s\n", s.getStr());
+ fprintf(stderr, "[Java framework] Settings file is exspired. Deleting settings file at \n%s\n", s.getStr());
#endif
//delete file
-// File::RC rc_rem = File::remove(sURL);
File f(sURL);
if (File::E_None == f.open(OpenFlag_Write | OpenFlag_Read)
&& File::E_None == f.setPos(0, 0)
@@ -1093,6 +1137,17 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
return pInfo;
}
+sal_uInt32 NodeJava::getModifiedTime() const
+{
+ sal_uInt32 ret = 0;
+ if (m_layer != INSTALL)
+ {
+ OSL_ASSERT(0);
+ return ret;
+ }
+ rtl::OString modTimeSeconds = getElementModified();
+ return (sal_uInt32) modTimeSeconds.toInt64();
+}
//================================================================================
MergedSettings::MergedSettings():
diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx
index a4ca1a83fc3d..ec0e06dc5bab 100644
--- a/jvmfwk/source/elements.hxx
+++ b/jvmfwk/source/elements.hxx
@@ -195,6 +195,34 @@ private:
*/
boost::optional< ::std::vector< ::rtl::OUString> > m_JRELocations;
+ /** Only in INSTALL mode. Then NodeJava.write writes a <modified> element
+ which contains the seconds value of the TimeValue (osl/time.h), obtained
+ with osl_getSystemTime.
+ It returns 0 if the value cannot be obtained.
+ This is used to fix the problem that the modified time of the settings
+ file is incorrect because it resides on an NFS volume where the NFS
+ server and NFS client do not have the same system time. For example if
+ the server time is ahead of the client time then checkSettingsFileStatus
+ deleted the settings. So even if javaldx determined a Java
+ (jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then
+ it looked again for a java by calling jfw_findAndSelectJRE, which
+ returned a JFW_E_NONE. But the following jfw_startVM returned again
+ JFW_E_NO_SELECT. So it looped. (see issue i114509)
+
+ NFS server and NFS client should have the same time. It is common
+ practise to enforce this in networks. We actually should not work
+ around a malconfigured network. We must however, make sure that we do
+ not loop. Maybe a better approach is, that:
+ - assume that mtime and system time are reliable
+ - checkSettingsFile uses system time and mtime of the settings file,
+ instset of using getModifiedTime.
+ - allow a small error margin
+ - jfw_startVM must return a JFW_E_EXPIRED_SETTINGS
+ - XJavaVM::startVM should prevent the loop by processing the new return+ value
+
+ */
+ sal_uInt32 getModifiedTime() const;
+
public:
NodeJava(Layer theLayer = USER_OR_INSTALL);
diff --git a/libxmlsec/xmlsec1-olderlibxml2.patch b/libxmlsec/xmlsec1-olderlibxml2.patch
index b5f3d5747586..f2bd85f5113b 100644
--- a/libxmlsec/xmlsec1-olderlibxml2.patch
+++ b/libxmlsec/xmlsec1-olderlibxml2.patch
@@ -4,7 +4,7 @@
return(0);
}
-+#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20706
++#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20704
+/*
+ * xmlC14NMode:
+ *
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
index e20b4f58f589..e20b4f58f589 100755..100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index 14253fca5cd3..14253fca5cd3 100755..100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
index fc1906e18025..fc1906e18025 100755..100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
index 9bcbdec5250b..9bcbdec5250b 100755..100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
diff --git a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx
index 23804d54f60f..23804d54f60f 100755..100644
--- a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 02d469514593..02d469514593 100755..100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
index e6d447879701..e6d447879701 100755..100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx
diff --git a/offapi/com/sun/star/deployment/XExtensionManager.idl b/offapi/com/sun/star/deployment/XExtensionManager.idl
index b807df54af65..679ba2ba5a66 100644
--- a/offapi/com/sun/star/deployment/XExtensionManager.idl
+++ b/offapi/com/sun/star/deployment/XExtensionManager.idl
@@ -281,6 +281,8 @@ interface XExtensionManager
Added extensions will be added to the database and removed extensions
will be removed from the database.
+ The active extensions are determined. That is, shared or bundled extensions
+ are not necessaryly registered (<member>XPackage::registerPackage</member>).
@return
If true - then at least one extension was removed or added. Otherwise
@@ -295,6 +297,25 @@ interface XExtensionManager
com::sun::star::lang::IllegalArgumentException);
+ /** synchronizes the special bundled_prereg repository, which is based on
+ the bundled extensions and has its registration data folder at
+ $BUNDLED_EXTENSIONS_PREREG (for example openoffice.org3/share/prereg).
+
+ All bundled extensions are registered (<member>XPackage::registerPackage</member>).
+ The active extensions are NOT determined, because this function only works
+ with bundled extensions.
+
+ This function is intended to be called during the installation of OOo.
+ OOo will copy parts of the registration data folder to the user installation at the
+ first startup.
+ */
+
+ void synchronizeBundledPrereg(
+ [in] com::sun::star::task::XAbortChannel xAbortChannel,
+ [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
+ raises (DeploymentException);
+
+
/** returns all extensions which are currently not in use
because the user did not accept the license.
diff --git a/offapi/com/sun/star/deployment/XPackageRegistry.idl b/offapi/com/sun/star/deployment/XPackageRegistry.idl
index c84f37625ec5..a8e3f556781d 100644
--- a/offapi/com/sun/star/deployment/XPackageRegistry.idl
+++ b/offapi/com/sun/star/deployment/XPackageRegistry.idl
@@ -115,6 +115,13 @@ interface XPackageRegistry
supported <type>XPackageTypeInfo</type>s.
*/
sequence<XPackageTypeInfo> getSupportedPackageTypes();
+
+ void packageRemoved(
+ [in] string url,
+ [in] string mediaType)
+ raises (DeploymentException,
+ com::sun::star::lang::IllegalArgumentException);
+
};
}; }; }; };
diff --git a/vcl/inc/vcl/salctrlhandle.hxx b/offapi/com/sun/star/script/vba/VBAMacroResolver.idl
index 4a0a3a0f5b0a..62f6e8ce0c2a 100644..100755
--- a/vcl/inc/vcl/salctrlhandle.hxx
+++ b/offapi/com/sun/star/script/vba/VBAMacroResolver.idl
@@ -25,24 +25,25 @@
*
************************************************************************/
-#ifndef _SV_SALCTRLHANDLE_HXX
-#define _SV_SALCTRLHANDLE_HXX
+#ifndef __com_sun_star_script_vba_VBAMacroResolver_idl__
+#define __com_sun_star_script_vba_VBAMacroResolver_idl__
-/* SalControlHandle:
- *
- * Container for platform-specific handles and data
- * about controls. Lives as long as the VCL control
- * lives.
- */
+#include <com/sun/star/script/vba/XVBAMacroResolver.idl>
-class SalControlHandle
-{
- public:
- SalControlHandle() {}
- virtual ~SalControlHandle();
+//=============================================================================
+
+module com { module sun { module star { module script { module vba {
+
+//=============================================================================
- // TODO: derive Sal implementation
- //SalControlHandleData maData;
+service VBAMacroResolver : XVBAMacroResolver
+{
};
+//=============================================================================
+
+}; }; }; }; };
+
+//=============================================================================
+
#endif
diff --git a/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl b/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl
new file mode 100755
index 000000000000..378219268010
--- /dev/null
+++ b/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * 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 __com_sun_star_script_vba_XVBAMacroResolver_idl__
+#define __com_sun_star_script_vba_XVBAMacroResolver_idl__
+
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module script { module vba {
+
+//=============================================================================
+
+/** Converts VBA macro names to script URLs and vice versa.
+ */
+interface XVBAMacroResolver
+{
+ //-------------------------------------------------------------------------
+
+ /** Returns the script URL representing the passed VBA macro name.
+
+ @param aVBAMacroName
+ The VBA macro name to be resolved to a script URL. The macro name
+ may consist of up to three parts, divided by periods. The first two
+ parts are optional. The first part represents the VBA project name.
+ The second part represents the module name. The third part
+ represents the procedure name. Example: All the VBA macro names
+ "VBAProject.Module1.TestMacro", "Module1.TestMacro",
+ "VBAProject.TestMacro", and "TestMacro" may refer to the same VBA
+ procedure located in "Module" of the project "VBAProject". If the
+ module name is missing, then all modules are searched for a macro
+ with the specified name.
+
+ @return
+ The script URL referring to the passed VBA macro.
+
+ @throws <type scope="::com::sun::star::lang">IllegalArgumentException</type>
+ if a macro with the passed name does not exist.
+ **/
+ string resolveVBAMacroToScriptURL( [in] string aVBAMacroName )
+ raises (::com::sun::star::lang::IllegalArgumentException);
+
+ //-------------------------------------------------------------------------
+
+ /** Returns the VBA macro name for a macro with the passed script URL.
+
+ @param aScriptURL
+ The script URL to be resolved to a VBA macro name. Must be a
+ document-local script.
+
+ @return
+ The VBA macro name referring to a macro with the passed script URL.
+
+ @throws <type scope="::com::sun::star::lang">IllegalArgumentException</type>
+ if a macro with the passed name does not exist.
+ **/
+ string resolveScriptURLtoVBAMacro( [in] string aScriptURL )
+ raises (::com::sun::star::lang::IllegalArgumentException);
+
+ //-------------------------------------------------------------------------
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+//=============================================================================
+
+#endif
diff --git a/offapi/com/sun/star/script/vba/makefile.mk b/offapi/com/sun/star/script/vba/makefile.mk
index 4657b587d7d8..336be1b5e7a6 100755
--- a/offapi/com/sun/star/script/vba/makefile.mk
+++ b/offapi/com/sun/star/script/vba/makefile.mk
@@ -40,10 +40,12 @@ PACKAGE=com$/sun$/star$/script$/vba
IDLFILES=\
VBAEventId.idl \
VBAEventProcessor.idl \
+ VBAMacroResolver.idl \
VBASpreadsheetEventProcessor.idl \
VBATextEventProcessor.idl \
XVBACompatibility.idl \
XVBAEventProcessor.idl \
+ XVBAMacroResolver.idl \
XVBAModuleInfo.idl
# ------------------------------------------------------------------
diff --git a/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl b/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl
index 06008bbc059d..90edc6b22200 100644
--- a/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl
+++ b/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl
@@ -56,7 +56,7 @@ constants FormulaMapGroupSpecialOffset
constants.</li>
<li>A <atom>string</atom> for literal text.</li>
<li>A <atom dim="[][]">any</atom> for a literal array. The contained
- values shall be of type <atom>double</atom> or atom>string</atom>.
+ values shall be of type <atom>double</atom> or <atom>string</atom>.
Floating-point values and strings may occur together in an array.</li>
<li>A struct of type <type>SingleReference</type> for a reference to a
single cell in the own document.</li>
@@ -142,7 +142,7 @@ constants FormulaMapGroupSpecialOffset
able to parse.
<p>The <member>FormulaToken::Data</member> member shall contain a
- <atom>string</string> with the bad data. This string will be displayed
+ <atom>string</atom> with the bad data. This string will be displayed
literally in the formula.</p>
*/
const long BAD = 7;
diff --git a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
index 8e94a6b2edcf..cd4a12abde76 100644
--- a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
+++ b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
@@ -28,21 +28,11 @@
#ifndef __com_sun_star_sheet_SheetFilterDescriptor_idl__
#define __com_sun_star_sheet_SheetFilterDescriptor_idl__
-#ifndef __com_sun_star_sheet_XSheetFilterDescriptor_idl__
#include <com/sun/star/sheet/XSheetFilterDescriptor.idl>
-#endif
-
-#ifndef __com_sun_star_beans_XPropertySet_idl__
+#include <com/sun/star/sheet/XSheetFilterDescriptor2.idl>
#include <com/sun/star/beans/XPropertySet.idl>
-#endif
-
-#ifndef __com_sun_star_table_TableOrientation_idl__
#include <com/sun/star/table/TableOrientation.idl>
-#endif
-
-#ifndef __com_sun_star_table_CellAddress_idl__
#include <com/sun/star/table/CellAddress.idl>
-#endif
//=============================================================================
@@ -62,7 +52,20 @@ published service SheetFilterDescriptor
/** provides access to the collection of filter fields.
*/
- interface com::sun::star::sheet::XSheetFilterDescriptor;
+ interface XSheetFilterDescriptor;
+
+ //-------------------------------------------------------------------------
+
+ /** provides access to the collection of filter fields.
+
+ <p>This interface provides a sequence of <type>TableFilterField2</type>
+ structures supporting a wider range of comparison operators, compared
+ to the <type>TableFilterField</type> structure provided by interface
+ <type>XSheetFilterDescriptor</type>.
+
+ @since OOo 3.2
+ */
+ [optional] interface XSheetFilterDescriptor2;
//-------------------------------------------------------------------------
diff --git a/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl b/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl
new file mode 100755
index 000000000000..d672dd8931e9
--- /dev/null
+++ b/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl
@@ -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.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_sheet_SpreadsheetViewObjectsMode_idl__
+#define __com_sun_star_sheet_SpreadsheetViewObjectsMode_idl__
+
+//=============================================================================
+
+module com { module sun { module star { module sheet {
+
+//=============================================================================
+
+/** Constants that control how embedded objects are shown in the view.
+ */
+published constants SpreadsheetViewObjectsMode
+{
+ //-------------------------------------------------------------------------
+
+ /** Specifies to display a specific set of objects in the spreadsheet view.
+ */
+ const short SHOW = 0;
+
+ //-------------------------------------------------------------------------
+
+ /** Specifies to hide a specific set of objects from the spreadsheet view.
+ */
+ const short HIDE = 1;
+
+ //-------------------------------------------------------------------------
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+
diff --git a/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl b/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
index e40ea1dd8fe4..c1b56ff7ffc6 100644
--- a/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
+++ b/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
@@ -149,18 +149,24 @@ published service SpreadsheetViewSettings
//-------------------------------------------------------------------------
/** enables display of embedded objects in the view.
+
+ @see SpreadsheetViewObjectsMode
*/
[property] short ShowObjects;
//-------------------------------------------------------------------------
/** enables the display of charts in the view.
+
+ @see SpreadsheetViewObjectsMode
*/
[property] short ShowCharts;
//-------------------------------------------------------------------------
/** enables the display of drawing objects in the view.
+
+ @see SpreadsheetViewObjectsMode
*/
[property] short ShowDrawing;
@@ -175,14 +181,14 @@ published service SpreadsheetViewSettings
@see com::sun::star::view::DocumentZoomType
*/
- [property] short ZoomType;
+ [property] short ZoomType;
//-------------------------------------------------------------------------
/** Defines the zoom value to use.
Valid only if the ZoomType is set to
<member scope="com::sun::star::view::DocumentZoomType">BY_VALUE</member>.
*/
- [property] short ZoomValue;
+ [property] short ZoomValue;
};
//=============================================================================
diff --git a/offapi/com/sun/star/sheet/TableFilterField.idl b/offapi/com/sun/star/sheet/TableFilterField.idl
index 6000a1c0247e..69d9a5bcc6ee 100644
--- a/offapi/com/sun/star/sheet/TableFilterField.idl
+++ b/offapi/com/sun/star/sheet/TableFilterField.idl
@@ -28,13 +28,8 @@
#ifndef __com_sun_star_sheet_TableFilterField_idl__
#define __com_sun_star_sheet_TableFilterField_idl__
-#ifndef __com_sun_star_sheet_FilterConnection_idl__
#include <com/sun/star/sheet/FilterConnection.idl>
-#endif
-
-#ifndef __com_sun_star_sheet_FilterOperator_idl__
#include <com/sun/star/sheet/FilterOperator.idl>
-#endif
//=============================================================================
@@ -44,7 +39,7 @@ module com { module sun { module star { module sheet {
/** describes a single condition in a filter descriptor.
- @see com::sun::star::sheet::SheetFilterDescriptor
+ @see SheetFilterDescriptor
*/
published struct TableFilterField
{
@@ -52,7 +47,7 @@ published struct TableFilterField
/** specifies how the condition is connected to the previous condition.
*/
- com::sun::star::sheet::FilterConnection Connection;
+ FilterConnection Connection;
//-------------------------------------------------------------------------
@@ -64,7 +59,7 @@ published struct TableFilterField
/** specifies the type of the condition.
*/
- com::sun::star::sheet::FilterOperator Operator;
+ FilterOperator Operator;
//-------------------------------------------------------------------------
diff --git a/offapi/com/sun/star/sheet/TableFilterField2.idl b/offapi/com/sun/star/sheet/TableFilterField2.idl
index cfbcfa4d143c..d7383f477bdc 100644
--- a/offapi/com/sun/star/sheet/TableFilterField2.idl
+++ b/offapi/com/sun/star/sheet/TableFilterField2.idl
@@ -28,14 +28,8 @@
#ifndef __com_sun_star_sheet_TableFilterField2_idl__
#define __com_sun_star_sheet_TableFilterField2_idl__
-
-#ifndef __com_sun_star_sheet_FilterConnection_idl__
#include <com/sun/star/sheet/FilterConnection.idl>
-#endif
-
-#ifndef __com_sun_star_sheet_FilterOperator2_idl__
#include <com/sun/star/sheet/FilterOperator2.idl>
-#endif
//=============================================================================
@@ -49,7 +43,7 @@ module com { module sun { module star { module sheet {
member, whereas the <type>TableFilterField</type> struct uses the
<type>FilterOperator</type> enum.</p>
- @see com::sun::star::sheet::SheetFilterDescriptor
+ @see SheetFilterDescriptor
@since OOo 3.2
*/
published struct TableFilterField2
@@ -58,7 +52,7 @@ published struct TableFilterField2
/** specifies how the condition is connected to the previous condition.
*/
- com::sun::star::sheet::FilterConnection Connection;
+ FilterConnection Connection;
//-------------------------------------------------------------------------
@@ -69,7 +63,7 @@ published struct TableFilterField2
//-------------------------------------------------------------------------
/** specifies the type of the condition as defined in
- <type>FilterOperator2</type>.
+ <type>FilterOperator2</type>.
*/
long Operator;
diff --git a/offapi/com/sun/star/sheet/XDatabaseRange.idl b/offapi/com/sun/star/sheet/XDatabaseRange.idl
index 573578f0c355..9826ab8278e6 100644
--- a/offapi/com/sun/star/sheet/XDatabaseRange.idl
+++ b/offapi/com/sun/star/sheet/XDatabaseRange.idl
@@ -77,7 +77,7 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface
/** returns the sort descriptor stored with the database range.
- @see com::sun::star::sheet::SheetSortDescriptor2
+ @see SheetSortDescriptor2
*/
sequence< com::sun::star::beans::PropertyValue > getSortDescriptor();
@@ -88,8 +88,10 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface
<p>If the filter descriptor is modified, the new filtering is
carried out when <member>XDatabaseRange::refresh()</member> is
called.</p>
+
+ @see SheetFilterDescriptor
*/
- com::sun::star::sheet::XSheetFilterDescriptor getFilterDescriptor();
+ XSheetFilterDescriptor getFilterDescriptor();
//-------------------------------------------------------------------------
@@ -98,15 +100,17 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface
<p>If the subtotal descriptor is modified, the new subtotals are
inserted when <member>XDatabaseRange::refresh()</member> is
called.</p>
+
+ @see SubTotalDescriptor
*/
- com::sun::star::sheet::XSubTotalDescriptor getSubTotalDescriptor();
+ XSubTotalDescriptor getSubTotalDescriptor();
//-------------------------------------------------------------------------
/** returns the database import descriptor stored with this database
range.
- @see com::sun::star::sheet::DatabaseImportDescriptor
+ @see DatabaseImportDescriptor
*/
sequence< com::sun::star::beans::PropertyValue > getImportDescriptor();
diff --git a/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl b/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl
index 49f44fd534d8..b3864f373c8a 100644
--- a/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl
+++ b/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl
@@ -28,13 +28,8 @@
#ifndef __com_sun_star_sheet_XSheetFilterDescriptor_idl__
#define __com_sun_star_sheet_XSheetFilterDescriptor_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-#ifndef __com_sun_star_sheet_TableFilterField_idl__
#include <com/sun/star/sheet/TableFilterField.idl>
-#endif
+#include <com/sun/star/uno/XInterface.idl>
//=============================================================================
@@ -44,7 +39,7 @@ module com { module sun { module star { module sheet {
/** provides access to a collection of filter conditions (filter fields).
- @see com::sun::star::sheet::SheetFilterDescriptor
+ @see SheetFilterDescriptor
*/
published interface XSheetFilterDescriptor: com::sun::star::uno::XInterface
{
@@ -52,14 +47,13 @@ published interface XSheetFilterDescriptor: com::sun::star::uno::XInterface
/** returns the collection of filter fields.
*/
- sequence< com::sun::star::sheet::TableFilterField > getFilterFields();
+ sequence< TableFilterField > getFilterFields();
//-------------------------------------------------------------------------
/** sets a new collection of filter fields.
*/
- void setFilterFields(
- [in] sequence< com::sun::star::sheet::TableFilterField > aFilterFields );
+ void setFilterFields( [in] sequence< TableFilterField > aFilterFields );
};
diff --git a/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl b/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl
index 8f94ee65fc8e..ba8b7904366e 100644
--- a/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl
+++ b/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl
@@ -28,13 +28,8 @@
#ifndef __com_sun_star_sheet_XSheetFilterDescriptor2_idl__
#define __com_sun_star_sheet_XSheetFilterDescriptor2_idl__
-#ifndef __com_sun_star_sheet_TableFilterField2_idl__
#include <com/sun/star/sheet/TableFilterField2.idl>
-#endif
-
-#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
-#endif
//=============================================================================
@@ -48,7 +43,7 @@ module com { module sun { module star { module sheet {
whereas the <type>XSheetFilterDescriptor</type> interface uses the
<type>TableFilterField</type> struct.</p>
- @see com::sun::star::sheet::SheetFilterDescriptor
+ @see SheetFilterDescriptor
@since OOo 3.2
*/
published interface XSheetFilterDescriptor2: com::sun::star::uno::XInterface
@@ -57,14 +52,13 @@ published interface XSheetFilterDescriptor2: com::sun::star::uno::XInterface
/** returns the collection of filter fields.
*/
- sequence< com::sun::star::sheet::TableFilterField2 > getFilterFields2();
+ sequence< TableFilterField2 > getFilterFields2();
//-------------------------------------------------------------------------
/** sets a new collection of filter fields.
*/
- void setFilterFields2(
- [in] sequence< com::sun::star::sheet::TableFilterField2 > aFilterFields );
+ void setFilterFields2( [in] sequence< TableFilterField2 > aFilterFields );
};
diff --git a/offapi/com/sun/star/sheet/makefile.mk b/offapi/com/sun/star/sheet/makefile.mk
index 65e8d5c40491..c5b15a5b07af 100644
--- a/offapi/com/sun/star/sheet/makefile.mk
+++ b/offapi/com/sun/star/sheet/makefile.mk
@@ -198,6 +198,7 @@ IDLFILES=\
SpreadsheetDocumentSettings.idl\
SpreadsheetDrawPage.idl\
SpreadsheetView.idl\
+ SpreadsheetViewObjectsMode.idl\
SpreadsheetViewPane.idl\
SpreadsheetViewPanesEnumeration.idl\
SpreadsheetViewSettings.idl\
diff --git a/offapi/com/sun/star/text/PrintPreviewSettings.idl b/offapi/com/sun/star/text/PrintPreviewSettings.idl
index e282cf76536f..e282cf76536f 100755..100644
--- a/offapi/com/sun/star/text/PrintPreviewSettings.idl
+++ b/offapi/com/sun/star/text/PrintPreviewSettings.idl
diff --git a/offapi/com/sun/star/text/TextFrame.idl b/offapi/com/sun/star/text/TextFrame.idl
index e43b3d79197c..e43b3d79197c 100644..100755
--- a/offapi/com/sun/star/text/TextFrame.idl
+++ b/offapi/com/sun/star/text/TextFrame.idl
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 5c735744104b..2616566225b9 100755..100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -1698,7 +1698,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -1893,7 +1893,7 @@
</node>
</node>
<node oor:name="com.sun.star.presentation.PresentationDocument" oor:op="replace">
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
@@ -2739,7 +2739,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -3374,7 +3374,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -3979,7 +3979,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -4589,7 +4589,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -5204,7 +5204,7 @@
<value xml:lang="es">.uno:Bold</value>
</prop>
</node>
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
</prop>
@@ -5567,7 +5567,7 @@
</node>
</node>
<node oor:name="com.sun.star.drawing.DrawingDocument" oor:op="replace">
- <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <node oor:name="C_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertAnnotation</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 46611715f998..7b83b162338e 100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -3412,7 +3412,7 @@
</node>
<node oor:name=".uno:BmpMask" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Eyedropper</value>
+ <value xml:lang="en-US">Color ~Replacer</value>
</prop>
</node>
<node oor:name=".uno:GoLeftBlock" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index 4ed9be5a3d27..4ed9be5a3d27 100755..100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index e8b483b8622d..e8b483b8622d 100755..100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 9bc07c592f0f..ae171230dd13 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2600,39 +2600,6 @@
</constraints>
<value>100</value>
</prop>
- <prop oor:name="LookAndFeel" oor:type="xs:short">
- <!-- OldPath: General/View -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - General View [Section] Display -->
- <info>
- <author>PB</author>
- <desc>Determines the look and feel of the application.</desc>
- <label>Look &amp; Feel</label>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Standard</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Macintosh</desc>
- </info>
- </enumeration>
- <enumeration oor:value="2">
- <info>
- <desc>X Window</desc>
- </info>
- </enumeration>
- <enumeration oor:value="3">
- <info>
- <desc>OS/2</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
<group oor:name="NewDocumentHandling">
<info>
<author>CD</author>
@@ -2714,17 +2681,6 @@
</info>
<value>true</value>
</prop>
- <prop oor:name="ColoredTab" oor:type="xs:boolean">
- <!-- OldPath: General/View -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - General View [Section] Options -->
- <info>
- <author>PB</author>
- <desc>Specifies TabDialogs with colored tab control (True)</desc>
- <label>Colored tab controls</label>
- </info>
- <value>false</value>
- </prop>
<prop oor:name="MousePositioning" oor:type="xs:short">
<!-- OldPath: General/View -->
<!-- OldLocation: soffice.cfg -->
@@ -2780,17 +2736,6 @@
</constraints>
<value>1</value>
</prop>
- <prop oor:name="SingleLineTab" oor:type="xs:boolean">
- <!-- OldPath: General/View -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - General View [Section] Options -->
- <info>
- <author>PB</author>
- <desc>Specifies TabDialogs with single line tab control (True).</desc>
- <label>Single line tab controls</label>
- </info>
- <value>false</value>
- </prop>
</group>
<group oor:name="Localisation">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index e133b7a5a957..6dd518250d4a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -282,7 +282,7 @@
<desc>Indicates whether moving while holding the Control key makes a copy of the moved object.</desc>
<label>Copy while moving</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="ObjectMoveable" oor:type="xs:boolean">
<!-- OldPath: Draw/Other -->
@@ -410,7 +410,7 @@
<desc>Indicates whether a simple click on a text object changes it to edit mode.</desc>
<label>Allow quick editing</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="Selectable" oor:type="xs:boolean">
<!-- OldPath: Draw/Other/Text_Objects -->
@@ -824,7 +824,7 @@
<desc>Specifies the number of points between two grid points on the X axis.</desc>
<label>X Axis Subdivision</label>
</info>
- <value>1</value>
+ <value>9</value>
</prop>
<prop oor:name="YAxis" oor:type="xs:double">
<!-- OldPath: Draw/Grid/Subdivision -->
@@ -836,7 +836,7 @@
<desc>Specifies the number of points between two grid points on the Y axis.</desc>
<label>Y Axis Subdivision</label>
</info>
- <value>1</value>
+ <value>9</value>
</prop>
</group>
<group oor:name="SnapGrid">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 8317e3e0082d..871c5c2c1494 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -331,7 +331,7 @@
<desc>Indicates whether moving while holding the Control key makes a copy of the moved object.</desc>
<label>Copy while moving</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="ObjectMoveable" oor:type="xs:boolean">
<!-- OldPath: Impress/Other -->
@@ -371,7 +371,7 @@
<desc>Indicates whether a double-click on an object activates the rotation mode.</desc>
<label>Rotation Mode after clicking object</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="Preview" oor:type="xs:double">
<!-- OldPath: Impress/Other -->
@@ -426,7 +426,7 @@
<desc>Indicates whether to show big (true) or small (false) handles.</desc>
<label>Big Handles</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="ModifyWithAttributes" oor:type="xs:boolean">
<!-- OldPath: Impress/Other -->
@@ -537,6 +537,29 @@
</info>
<value>0</value>
</prop>
+ <prop oor:name="PenColor" oor:type="xs:int">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: slide show context menu -->
+ <info>
+ <author>CL</author>
+ <desc>Color of the pen during slideshow.</desc>
+ <label>Pen Color</label>
+ </info>
+ <value>16711680</value>
+ </prop>
+ <prop oor:name="PenWidth" oor:type="xs:double">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: slide show context menu -->
+ <info>
+ <author>CL</author>
+ <desc>Width of the pen during slideshow.</desc>
+ <label>Pen Width</label>
+ </info>
+ <value>150</value>
+ </prop>
+
<group oor:name="TextObject">
<info>
<desc>Contains text editing related configuration items.</desc>
@@ -679,7 +702,7 @@
<desc>Indicates whether to snap at snap lines.</desc>
<label>Snap lines</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="PageMargin" oor:type="xs:boolean">
<!-- OldPath: Impress/Snap/Objects -->
@@ -699,7 +722,7 @@
<desc>Indicates whether to justify the outline of an object to that of an adjacent object.</desc>
<label>Object frame</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="ObjectPoint" oor:type="xs:boolean">
<!-- OldPath: Impress/Snap/Objects -->
@@ -871,14 +894,14 @@
<desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
<label/>
</info>
- <value>1000</value>
+ <value>2000</value>
</prop>
<prop oor:name="NonMetric" oor:type="xs:int">
<info>
<desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
<label/>
</info>
- <value>1270</value>
+ <value>2540</value>
</prop>
</group>
<group oor:name="YAxis">
@@ -895,14 +918,14 @@
<desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
<label/>
</info>
- <value>1000</value>
+ <value>2000</value>
</prop>
<prop oor:name="NonMetric" oor:type="xs:int">
<info>
<desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
<label/>
</info>
- <value>1270</value>
+ <value>2540</value>
</prop>
</group>
</group>
@@ -919,7 +942,7 @@
<desc>Specifies the number of points between two adjacent grid points on the X axis.</desc>
<label>X Axis Subdivision</label>
</info>
- <value>1</value>
+ <value>9</value>
</prop>
<prop oor:name="YAxis" oor:type="xs:double">
<!-- OldPath: Impress/Grid/Subdivision -->
@@ -930,7 +953,7 @@
<desc>Specifies the number of intervals between two adjacent grid points on the Y axis</desc>
<label>Y Axis Subdivision</label>
</info>
- <value>1</value>
+ <value>9</value>
</prop>
</group>
<group oor:name="SnapGrid">
@@ -961,7 +984,7 @@
<desc>Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
<label/>
</info>
- <value>1000</value>
+ <value>100</value>
</prop>
<prop oor:name="NonMetric" oor:type="xs:int">
<info>
@@ -985,7 +1008,7 @@
<desc>Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
<label/>
</info>
- <value>1000</value>
+ <value>100</value>
</prop>
<prop oor:name="NonMetric" oor:type="xs:int">
<info>
diff --git a/oox/inc/oox/core/binarycodec.hxx b/oox/inc/oox/core/binarycodec.hxx
index ce57e190f088..ced63250f3e1 100644
--- a/oox/inc/oox/core/binarycodec.hxx
+++ b/oox/inc/oox/core/binarycodec.hxx
@@ -319,4 +319,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/binaryfilterbase.hxx b/oox/inc/oox/core/binaryfilterbase.hxx
index bf249cdfab9b..4cd9cd1db62f 100644
--- a/oox/inc/oox/core/binaryfilterbase.hxx
+++ b/oox/inc/oox/core/binaryfilterbase.hxx
@@ -40,7 +40,8 @@ class BinaryFilterBase : public FilterBase
{
public:
explicit BinaryFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~BinaryFilterBase();
@@ -59,4 +60,3 @@ typedef ::rtl::Reference< BinaryFilterBase > BinaryFilterRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx
index dd9ac686ff46..b1f24d051c70 100644
--- a/oox/inc/oox/core/contexthandler.hxx
+++ b/oox/inc/oox/core/contexthandler.hxx
@@ -28,16 +28,18 @@
#ifndef OOX_CORE_CONTEXTHANDLER_HXX
#define OOX_CORE_CONTEXTHANDLER_HXX
+#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
#include <boost/shared_ptr.hpp>
-#include <rtl/ref.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
+#include <rtl/ref.hxx>
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XLocator; } }
} } }
-namespace oox { class RecordInputStream; }
+namespace oox { class SequenceInputStream; }
namespace oox {
namespace core {
@@ -91,8 +93,8 @@ public:
// record context interface -----------------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
protected:
@@ -114,4 +116,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx
index 48f11c962e38..0c9ac794e94b 100644
--- a/oox/inc/oox/core/contexthandler2.hxx
+++ b/oox/inc/oox/core/contexthandler2.hxx
@@ -30,39 +30,43 @@
#include <vector>
#include <boost/shared_ptr.hpp>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
+#include "oox/helper/binaryinputstream.hxx"
#include "oox/core/contexthandler.hxx"
-#include "oox/core/namespaces.hxx"
namespace oox {
namespace core {
// ============================================================================
-struct ContextInfo;
+const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;
-/** Helper class that provides a context identifier stack.
+// ============================================================================
+
+struct ElementInfo;
+
+/** Helper class that provides a context stack.
Fragment handlers and context handlers derived from this helper class will
- track the identifiers of the current context in a stack. The idea is to use
- the same instance of a fragment handler or context handler to process
+ track the identifiers of the visited elements in a stack. The idea is to
+ use the same instance of a fragment handler or context handler to process
several nested elements in an XML stream. For that, the abstract function
- onCreateContext() has to return 'true' for the passed element.
+ onCreateContext() has to return 'this' for the passed element.
Derived classes have to implement the createFastChildContext(),
startFastElement(), characters(), and endFastElement() functions from the
com.sun.star.xml.sax.XFastContextHandler interface by simply forwarding
- them to the respective implCreateChildContext(), implStartCurrentContext(),
- implCharacters(), and implEndCurrentContext() functions of this helper. The
- new abstract functions have to be implemented according to the elements to
- be processed.
+ them to the respective implCreateChildContext(), implStartElement(),
+ implCharacters(), and implEndElement() functions of this helper. This is
+ implemented already in the classes ContextHandler2 and FragmentHandler2.
+ The new abstract functions have to be implemented according to the elements
+ to be processed.
Similarly, for binary import, derived classes have to forward the
createRecordContext(), startRecord(), and endRecord() functions from the
ContextHandler class to the implCreateRecordContext(), implStartRecord(),
- and implEndRecord() functions of this helper.
+ and implEndRecord() functions of this helper. Again, this is implemented
+ already in the classes ContextHandler2 and FragmentHandler2.
*/
class ContextHandler2Helper
{
@@ -71,78 +75,97 @@ public:
explicit ContextHandler2Helper( const ContextHandler2Helper& rParent );
virtual ~ContextHandler2Helper();
+ // allow instances to be stored in ::rtl::Reference
virtual void SAL_CALL acquire() throw() = 0;
virtual void SAL_CALL release() throw() = 0;
- virtual ContextHandler& queryContextHandler() = 0;
-
// interface --------------------------------------------------------------
- /** Will be called if a new context can be created for the passed element.
+ /** Will be called to create a context handler for the passed element.
- Usually 'true' should be returned to improve performance by reusing the
+ Usually 'this' can be returned to improve performance by reusing the
same instance to process several elements. Used by OOXML import only.
*/
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) = 0;
- /** Will be called if a new context element has been started.
+ /** Will be called when a new element has been started.
+
+ This function is called at the context handler returned from
+ onCreateContext(), or, for root elements of an XML stream, at the
+ fragment handler itself.
- The current element identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOXML import only.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
virtual void onStartElement( const AttributeList& rAttribs ) = 0;
- /** Will be called if the current context element is about to be left.
+ /** Will be called before a new child element starts, or if the current
+ element is about to be left.
- The current element identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOXML import only.
+ This helper function collects all text fragments received by the
+ characters() function (such as encoded characters which are passed in
+ separate calls to the characters() function), and passes the
+ concatenated and trimmed string.
- @param rChars The characters collected in this element.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
- virtual void onEndElement( const ::rtl::OUString& rChars ) = 0;
+ virtual void onCharacters( const ::rtl::OUString& rChars ) = 0;
- /** Will be called if a new context can be created for the passed element.
+ /** Will be called when the current element is about to be left.
- Usually 'true' should be returned to improve performance by reusing the
- same instance to process several elements. Used by OOBIN import only.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0;
+ virtual void onEndElement() = 0;
- /** Will be called if a new record in a binary stream has been started.
+ /** Will be called to create a context handler for the passed record.
- The current record identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOBIN import only.
+ Usually 'this' can be returned to improve performance by reusing the
+ same instance to process several records. Used by BIFF import only.
*/
- virtual void onStartRecord( RecordInputStream& rStrm ) = 0;
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) = 0;
- /** Will be called if the current context record is about to be left.
+ /** Will be called when a new record block in a binary stream has been
+ started.
- The current record identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOBIN import only.
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
+ */
+ virtual void onStartRecord( SequenceInputStream& rStrm ) = 0;
+
+ /** Will be called when the current record block is about to be left.
+
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
*/
virtual void onEndRecord() = 0;
// helpers ----------------------------------------------------------------
- /** Returns the element identifier of the current topmost context. */
+ /** Returns the identifier of the currently processed element. */
sal_Int32 getCurrentElement() const;
- /** Returns true, if nElement contains the current topmost context. */
+ /** Returns true, if nElement contains the identifier of the currently
+ processed element. */
inline bool isCurrentElement( sal_Int32 nElement ) const
{ return getCurrentElement() == nElement; }
- /** Returns true, if either nElement1 or nElement2 contain the current topmost context. */
+ /** Returns true, if either nElement1 or nElement2 contain the identifier
+ of the currently processed element. */
inline bool isCurrentElement( sal_Int32 nElement1, sal_Int32 nElement2 ) const
{ return isCurrentElement( nElement1 ) || isCurrentElement( nElement2 ); }
- /** Returns the element identifier of the specified parent context. */
- sal_Int32 getPreviousElement( sal_Int32 nCountBack = 1 ) const;
+ /** Returns the identifier of the specified parent element. */
+ sal_Int32 getParentElement( sal_Int32 nCountBack = 1 ) const;
- /** Returns the element identifier of the specified parent context. */
- inline sal_Int32 isPreviousElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const
- { return getPreviousElement( nCountBack ) == nElement; }
+ /** Returns true, if nElement contains the identifier of the specified
+ parent element. */
+ inline sal_Int32 isParentElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const
+ { return getParentElement( nCountBack ) == nElement; }
- /** Returns true, if the current element is the root element. */
+ /** Returns true, if the element currently processed is the root element of
+ the context or fragment handler. */
bool isRootElement() const;
// implementation ---------------------------------------------------------
@@ -155,7 +178,7 @@ protected:
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
/** Must be called from startFastElement() in derived classes. */
- void implStartCurrentContext(
+ void implStartElement(
sal_Int32 nElement,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
@@ -163,13 +186,13 @@ protected:
void implCharacters( const ::rtl::OUString& rChars );
/** Must be called from endFastElement() in derived classes. */
- void implEndCurrentContext( sal_Int32 nElement );
+ void implEndElement( sal_Int32 nElement );
/** Must be called from createRecordContext() in derived classes. */
- ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Must be called from startRecord() in derived classes. */
- void implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Must be called from endRecord() in derived classes. */
void implEndRecord( sal_Int32 nRecId );
@@ -177,15 +200,15 @@ protected:
private:
ContextHandler2Helper& operator=( const ContextHandler2Helper& );
- ContextInfo& pushContextInfo( sal_Int32 nElement );
- void popContextInfo();
- void appendCollectedChars();
+ ElementInfo& pushElementInfo( sal_Int32 nElement );
+ void popElementInfo();
+ void processCollectedChars();
private:
- typedef ::std::vector< ContextInfo > ContextStack;
+ typedef ::std::vector< ElementInfo > ContextStack;
typedef ::boost::shared_ptr< ContextStack > ContextStackRef;
- ContextStackRef mxContextStack; /// Stack of processed contexts.
+ ContextStackRef mxContextStack; /// Stack of all processed elements.
size_t mnRootStackSize; /// Stack size on construction time.
bool mbEnableTrimSpace; /// True = trim whitespace in characters().
};
@@ -202,8 +225,6 @@ public:
virtual void SAL_CALL acquire() throw() { ContextHandler::acquire(); }
virtual void SAL_CALL release() throw() { ContextHandler::release(); }
- virtual ContextHandler& queryContextHandler();
-
// com.sun.star.xml.sax.XFastContextHandler interface ---------------------
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
@@ -229,18 +250,19 @@ public:
// oox.core.ContextHandler interface --------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
// oox.core.ContextHandler2Helper interface -------------------------------
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
virtual void onEndRecord();
};
@@ -250,4 +272,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/fastparser.hxx b/oox/inc/oox/core/fastparser.hxx
new file mode 100755
index 000000000000..967c42474dcc
--- /dev/null
+++ b/oox/inc/oox/core/fastparser.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * 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 OOX_CORE_FASTPARSER_HXX
+#define OOX_CORE_FASTPARSER_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
+
+namespace oox {
+ struct NamespaceMap;
+ class StorageBase;
+}
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Wrapper for a fast SAX parser that works on automatically generated OOXML
+ token and namespace identifiers.
+ */
+class FastParser
+{
+public:
+ explicit FastParser(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ~FastParser();
+
+ /** Registers an OOXML namespace at the parser. */
+ void registerNamespace( sal_Int32 nNamespaceId )
+ throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+
+ /** Sets the passed document handler that will receive the SAX parser events. */
+ void setDocumentHandler(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler >& rxDocHandler )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed SAX input source.
+ @param bCloseStream True = closes the stream in the input source after parsing. */
+ void parseStream( const ::com::sun::star::xml::sax::InputSource& rInputSource, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed input stream.
+ @param bCloseStream True = closes the passed stream after parsing. */
+ void parseStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
+ const ::rtl::OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses a stream from the passed storage with the specified name.
+ @param bCloseStream True = closes the stream after parsing. */
+ void parseStream( StorageBase& rStorage, const ::rtl::OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastParser >
+ mxParser;
+ const NamespaceMap& mrNamespaceMap;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx
index 84baccabdc67..a6c73de9842b 100644
--- a/oox/inc/oox/core/fasttokenhandler.hxx
+++ b/oox/inc/oox/core/fasttokenhandler.hxx
@@ -28,8 +28,9 @@
#ifndef OOX_CORE_FASTTOKENHANDLER_HXX
#define OOX_CORE_FASTTOKENHANDLER_HXX
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
namespace oox { class TokenMap; }
@@ -38,15 +39,23 @@ namespace core {
// ============================================================================
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerBase;
+
/** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface
that provides access to the tokens generated from the internal token name list.
*/
-class FastTokenHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastTokenHandler >
+class FastTokenHandler : public FastTokenHandlerBase
{
public:
explicit FastTokenHandler();
virtual ~FastTokenHandler();
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // XFastTokenHandler
virtual sal_Int32 SAL_CALL getToken( const ::rtl::OUString& rIdentifier ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getIdentifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
@@ -62,4 +71,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index 9d9b8dcca515..80dc233491d4 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -29,15 +29,15 @@
#define OOX_CORE_FILTERBASE_HXX
#include <memory>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase5.hxx>
#include "oox/helper/binarystreambase.hxx"
@@ -45,16 +45,18 @@
#include "oox/dllapi.h"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace awt { struct DeviceInfo; }
- namespace frame { class XModel; }
- namespace task { class XStatusIndicator; }
- namespace task { class XInteractionHandler; }
namespace frame { class XFrame; }
+ namespace frame { class XModel; }
+ namespace graphic { class XGraphic; }
namespace io { class XInputStream; }
namespace io { class XOutputStream; }
namespace io { class XStream; }
- namespace graphic { class XGraphic; }
+ namespace lang { class XMultiComponentFactory; }
+ namespace lang { class XMultiServiceFactory; }
+ namespace task { class XInteractionHandler; }
+ namespace task { class XStatusIndicator; }
+ namespace uno { class XComponentContext; }
} } }
namespace comphelper {
@@ -69,6 +71,7 @@ namespace oox {
namespace oox { namespace ole {
class OleObjectHelper;
+ class VbaProject;
} }
namespace oox {
@@ -90,7 +93,8 @@ class OOX_DLLPUBLIC FilterBase : public FilterBaseBase, public ::cppu::BaseMutex
{
public:
explicit FilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~FilterBase();
@@ -110,9 +114,17 @@ public:
/** Returns the specified argument passed through the XInitialization interface. */
::com::sun::star::uno::Any getArgument( const ::rtl::OUString& rArgName ) const;
- /** Returns the global service factory passed in the filter constructor (always existing). */
+ /** Returns the component context passed in the filter constructor (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
+ getComponentContext() const;
+
+ /** Returns the component service factory (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >&
+ getComponentFactory() const;
+
+ /** Returns the multi service factory of the component (always existing). */
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getGlobalFactory() const;
+ getServiceFactory() const;
/** Returns the document model (always existing). */
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >&
@@ -122,7 +134,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
getModelFactory() const;
- /** Returns the frame that will contain the document model. */
+ /** Returns the frame that will contain the document model (may be null). */
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
getTargetFrame() const;
@@ -195,9 +207,13 @@ public:
/** Returns a helper for the handling of OLE obejcts. */
::oox::ole::OleObjectHelper& getOleObjectHelper() const;
+ /** Returns the VBA project manager. */
+ ::oox::ole::VbaProject& getVbaProject() const;
+
/** Requests the encryption data from the media descriptor or from the user. On
success, the encryption data will be inserted into the media descriptor. */
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
/** Imports the raw binary data from the specified stream.
@return True, if the data could be imported from the stream. */
@@ -272,6 +288,9 @@ private:
resolving palette colors. */
virtual GraphicHelper* implCreateGraphicHelper() const;
+ /** Derived classes create a VBA project manager object. */
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const = 0;
+
virtual ::rtl::OUString implGetImplementationName() const = 0;
virtual StorageRef implCreateStorage(
@@ -289,4 +308,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx
index 76e46050c24a..7eb283f5056b 100644
--- a/oox/inc/oox/core/filterdetect.hxx
+++ b/oox/inc/oox/core/filterdetect.hxx
@@ -38,6 +38,7 @@
namespace com { namespace sun { namespace star {
namespace io { class XInputStream; }
+ namespace uno { class XComponentContext; }
} } }
namespace comphelper { class MediaDescriptor; }
@@ -96,7 +97,8 @@ private:
class OOX_DLLPUBLIC FilterDetect : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo >
{
public:
- explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~FilterDetect();
/** Tries to extract an unencrypted ZIP package from the passed media
@@ -149,12 +151,12 @@ public:
interface of the temporary file will be stored in the 'ComponentData'
property of the passed media descriptor.
*/
- virtual ::rtl::OUString SAL_CALL detect(
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
+ virtual ::rtl::OUString SAL_CALL
+ detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
};
// ============================================================================
@@ -163,4 +165,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/fragmenthandler.hxx b/oox/inc/oox/core/fragmenthandler.hxx
index 26d2ac540a7a..ba3164a74da8 100644
--- a/oox/inc/oox/core/fragmenthandler.hxx
+++ b/oox/inc/oox/core/fragmenthandler.hxx
@@ -134,4 +134,3 @@ typedef ::rtl::Reference< FragmentHandler > FragmentHandlerRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx
index 9b864260b853..51408005ecdd 100644
--- a/oox/inc/oox/core/fragmenthandler2.hxx
+++ b/oox/inc/oox/core/fragmenthandler2.hxx
@@ -49,8 +49,6 @@ public:
virtual void SAL_CALL acquire() throw() { FragmentHandler::acquire(); }
virtual void SAL_CALL release() throw() { FragmentHandler::release(); }
- virtual ContextHandler& queryContextHandler();
-
// com.sun.star.xml.sax.XFastContextHandler interface ---------------------
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
@@ -86,18 +84,19 @@ public:
// oox.core.ContextHandler interface --------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
// oox.core.ContextHandler2Helper interface -------------------------------
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
virtual void onEndRecord();
// oox.core.FragmentHandler2 interface ------------------------------------
@@ -112,4 +111,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/recordparser.hxx b/oox/inc/oox/core/recordparser.hxx
index e499195c52f8..4600be3ff832 100644
--- a/oox/inc/oox/core/recordparser.hxx
+++ b/oox/inc/oox/core/recordparser.hxx
@@ -29,7 +29,6 @@
#define OOX_CORE_RECORDPARSER_HXX
#include <map>
-#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <rtl/ref.hxx>
@@ -95,4 +94,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx
index 4ca8ca3899e7..285c4ed947e4 100644..100755
--- a/oox/inc/oox/core/relations.hxx
+++ b/oox/inc/oox/core/relations.hxx
@@ -35,14 +35,21 @@
namespace oox {
namespace core {
-/** Expands to an OUString containing an officeDocument relation type created
+// ============================================================================
+
+/** Expands to an OUString containing an 'officeDocument' relation type created
from the passed literal(!) ASCII(!) character array. */
-#define CREATE_OFFICEDOC_RELATIONSTYPE( ascii ) \
+#define CREATE_OFFICEDOC_RELATION_TYPE( ascii ) \
CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/" ascii )
+/** Expands to an OUString containing a 'package' relation type created from
+ the passed literal(!) ASCII(!) character array. */
+#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \
+ CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii )
+
/** Expands to an OUString containing an MS Office specific relation type
created from the passed literal(!) ASCII(!) character array. */
-#define CREATE_MSOFFICE_RELATIONSTYPE( ascii ) \
+#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \
CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/relationships/" ascii )
// ============================================================================
@@ -99,4 +106,3 @@ private:
} // namespace oox
#endif // OOX_CORE_RELATIONS
-
diff --git a/oox/inc/oox/core/relationshandler.hxx b/oox/inc/oox/core/relationshandler.hxx
index 3211888ecc9f..b2da8d59c39f 100644
--- a/oox/inc/oox/core/relationshandler.hxx
+++ b/oox/inc/oox/core/relationshandler.hxx
@@ -58,4 +58,3 @@ private:
} // namespace oox
#endif // OOX_CORE_RELATIONSHANDLER
-
diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx
index 30efeb0e9440..11d2d488c8b6 100644
--- a/oox/inc/oox/core/xmlfilterbase.hxx
+++ b/oox/inc/oox/core/xmlfilterbase.hxx
@@ -28,16 +28,16 @@
#ifndef OOX_CORE_XMLFILTERBASE_HXX
#define OOX_CORE_XMLFILTERBASE_HXX
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XTextField.hpp>
#include <rtl/ref.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
-#include "oox/drawingml/table/tablestylelist.hxx"
#include "oox/core/filterbase.hxx"
#include "oox/core/relations.hxx"
-#include <oox/dllapi.h>
-#include <com/sun/star/text/XTextField.hpp>
-#include <com/sun/star/text/XTextCursor.hpp>
-#include <com/sun/star/text/XText.hpp>
+#include "oox/drawingml/table/tablestylelist.hxx"
+#include "oox/dllapi.h"
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
@@ -46,9 +46,11 @@ namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XFastDocumentHandler; } }
} } }
-namespace oox { namespace drawingml { class Theme; } }
-namespace oox { namespace drawingml { namespace chart { class ChartConverter; } } }
-namespace oox { namespace vml { class Drawing; } }
+namespace oox {
+ namespace drawingml { class Theme; }
+ namespace drawingml { namespace chart { class ChartConverter; } }
+ namespace vml { class Drawing; }
+}
namespace sax_fastparser {
class FastSerializerHelper;
@@ -61,6 +63,8 @@ namespace core {
class FragmentHandler;
+// ============================================================================
+
struct TextField {
com::sun::star::uno::Reference< com::sun::star::text::XText > xText;
com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > xTextCursor;
@@ -76,7 +80,8 @@ class OOX_DLLPUBLIC XmlFilterBase : public FilterBase
{
public:
explicit XmlFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~XmlFilterBase();
@@ -222,4 +227,3 @@ typedef ::rtl::Reference< XmlFilterBase > XmlFilterRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/axiscontext.hxx b/oox/inc/oox/drawingml/chart/axiscontext.hxx
index b80dd2e6f9ef..13c550e881d4 100644
--- a/oox/inc/oox/drawingml/chart/axiscontext.hxx
+++ b/oox/inc/oox/drawingml/chart/axiscontext.hxx
@@ -124,4 +124,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/axisconverter.hxx b/oox/inc/oox/drawingml/chart/axisconverter.hxx
index 925fa1fe8b4f..9e083f69d253 100644
--- a/oox/inc/oox/drawingml/chart/axisconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/axisconverter.hxx
@@ -68,4 +68,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/axismodel.hxx b/oox/inc/oox/drawingml/chart/axismodel.hxx
index 8bab84257eee..23dc96037427 100644
--- a/oox/inc/oox/drawingml/chart/axismodel.hxx
+++ b/oox/inc/oox/drawingml/chart/axismodel.hxx
@@ -109,4 +109,3 @@ struct AxisModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
index f034b4b6e6bb..76ddeafddb80 100644
--- a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
+++ b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
@@ -99,4 +99,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartconverter.hxx b/oox/inc/oox/drawingml/chart/chartconverter.hxx
index f9d10388ce13..de8572ab168b 100644
--- a/oox/inc/oox/drawingml/chart/chartconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartconverter.hxx
@@ -108,4 +108,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
index 0b5a7f6374a4..3ff545cda295 100644
--- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -101,7 +101,8 @@ public:
virtual ~ChartDrawingFragment();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
@@ -119,4 +120,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
index b4c40015f825..91e622552aa7 100644
--- a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
@@ -61,4 +61,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
index 898bc2ea15e8..e51c1c1fcc1b 100644
--- a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
@@ -59,4 +59,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
index ddfa57fb919c..37c39e315e3e 100644
--- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
@@ -75,4 +75,3 @@ struct ChartSpaceModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index c937c6e94900..aec646d4c610 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -155,4 +155,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
index 9b832a0209ab..1cffa32e382a 100644
--- a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
@@ -51,7 +51,7 @@ public:
virtual ~DoubleSequenceContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
sal_Int32 mnPtIndex; /// Current data point index.
@@ -69,7 +69,7 @@ public:
virtual ~StringSequenceContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
sal_Int32 mnPtIndex; /// Current data point index.
@@ -98,4 +98,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
index 7cdd6ab4a175..9d16f4e85882 100644
--- a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
@@ -75,4 +75,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
index 3de2278e5a71..04e79b831049 100644
--- a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
@@ -69,4 +69,3 @@ struct DataSourceModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx
index d34970025abd..278a8af9fed3 100644
--- a/oox/inc/oox/drawingml/chart/modelbase.hxx
+++ b/oox/inc/oox/drawingml/chart/modelbase.hxx
@@ -28,9 +28,9 @@
#ifndef OOX_DRAWINGML_CHART_MODELBASE_HXX
#define OOX_DRAWINGML_CHART_MODELBASE_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox { class AttributeList; }
@@ -138,4 +138,3 @@ struct LayoutModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/objectformatter.hxx b/oox/inc/oox/drawingml/chart/objectformatter.hxx
index 9f83a6bc0391..c35cd66f65e1 100644
--- a/oox/inc/oox/drawingml/chart/objectformatter.hxx
+++ b/oox/inc/oox/drawingml/chart/objectformatter.hxx
@@ -28,7 +28,6 @@
#ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
#define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/chart/modelbase.hxx"
@@ -170,4 +169,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/plotareacontext.hxx b/oox/inc/oox/drawingml/chart/plotareacontext.hxx
index 75ebed545956..5d3358c1147c 100644
--- a/oox/inc/oox/drawingml/chart/plotareacontext.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareacontext.hxx
@@ -87,4 +87,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
index e35afb633b92..9089c0180024 100644
--- a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
@@ -107,4 +107,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/plotareamodel.hxx b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
index c5793717defc..ef29a72f4b09 100644
--- a/oox/inc/oox/drawingml/chart/plotareamodel.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
@@ -91,4 +91,3 @@ struct PlotAreaModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/seriescontext.hxx b/oox/inc/oox/drawingml/chart/seriescontext.hxx
index 024e9754781c..ef50bc94866c 100644
--- a/oox/inc/oox/drawingml/chart/seriescontext.hxx
+++ b/oox/inc/oox/drawingml/chart/seriescontext.hxx
@@ -47,7 +47,7 @@ public:
virtual ~DataLabelContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -63,7 +63,7 @@ public:
virtual ~DataLabelsContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -124,7 +124,7 @@ public:
virtual ~TrendlineContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -270,4 +270,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/seriesconverter.hxx b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
index fd3ca207d7c0..6874298487d4 100644
--- a/oox/inc/oox/drawingml/chart/seriesconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
@@ -171,4 +171,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/seriesmodel.hxx b/oox/inc/oox/drawingml/chart/seriesmodel.hxx
index 2b72eb0f2bcf..d4b9ab3c9715 100644
--- a/oox/inc/oox/drawingml/chart/seriesmodel.hxx
+++ b/oox/inc/oox/drawingml/chart/seriesmodel.hxx
@@ -241,4 +241,3 @@ struct SeriesModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/titlecontext.hxx b/oox/inc/oox/drawingml/chart/titlecontext.hxx
index b3fec5d93203..45969bf150c2 100644
--- a/oox/inc/oox/drawingml/chart/titlecontext.hxx
+++ b/oox/inc/oox/drawingml/chart/titlecontext.hxx
@@ -47,7 +47,7 @@ public:
virtual ~TextContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -87,4 +87,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/titleconverter.hxx b/oox/inc/oox/drawingml/chart/titleconverter.hxx
index d153e9f3e760..2a452ae6c96b 100644
--- a/oox/inc/oox/drawingml/chart/titleconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/titleconverter.hxx
@@ -110,4 +110,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/titlemodel.hxx b/oox/inc/oox/drawingml/chart/titlemodel.hxx
index f80837249809..fc47d684c6dc 100644
--- a/oox/inc/oox/drawingml/chart/titlemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/titlemodel.hxx
@@ -93,4 +93,3 @@ struct LegendModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
index aa5f2a47c4a0..d58cb7e1c4f7 100644
--- a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
@@ -168,4 +168,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
index 46018696baef..58375a4c2b1f 100644
--- a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
@@ -202,4 +202,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
index b51b8e5d4a7c..9af01210d585 100644
--- a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
@@ -100,4 +100,3 @@ struct TypeGroupModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/drawingml/clrscheme.hxx b/oox/inc/oox/drawingml/clrscheme.hxx
index 22eab1a892a1..5f13f54b705d 100644
--- a/oox/inc/oox/drawingml/clrscheme.hxx
+++ b/oox/inc/oox/drawingml/clrscheme.hxx
@@ -31,7 +31,6 @@
#include <boost/shared_ptr.hpp>
#include <map>
#include <vector>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/color.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index 282e0c6009b5..985507d22265 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -28,13 +28,7 @@
#ifndef OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
#define OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
-#include "oox/helper/propertymap.hxx"
-#include "oox/drawingml/color.hxx"
-#include "oox/core/xmlfilterbase.hxx"
-#include <com/sun/star/graphic/XGraphic.hpp>
#include <boost/shared_ptr.hpp>
-#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
#include <vector>
#include <map>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
@@ -45,11 +39,15 @@
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#ifndef __com_sun_star_beans_PropertyValues_hpp__
#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertymap.hxx"
+#include "oox/token/tokens.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx
index d515a4553936..5f27efdf15e7 100644
--- a/oox/inc/oox/drawingml/graphicshapecontext.hxx
+++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx
@@ -68,7 +68,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
- ::boost::shared_ptr< ::oox::vml::OleObjectInfo > mxOleObjectInfo;
+ ::oox::vml::OleObjectInfo& mrOleObjectInfo;
};
// ====================================================================
@@ -106,7 +106,7 @@ public:
throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
- bool mbEmbedShapes;
+ ChartShapeInfo& mrChartShapeInfo;
};
// ====================================================================
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index d6cab48f6bb5..2114f8d9cf02 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -40,6 +40,10 @@
#include <vector>
#include <map>
+namespace oox { namespace vml {
+ struct OleObjectInfo;
+} }
+
namespace oox { namespace drawingml {
class CustomShapeProperties;
@@ -57,37 +61,15 @@ typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
// ============================================================================
-/** A callback that will be called before and after the API shape is created
- from the imported shape.
-
- An instance of a derived class of this callback can be set at every
- ::oox::drawingml::Shape instance to implement anything that needs a created
- and inserted XShape.
- */
-class CreateShapeCallback
+/** Additional information for a chart embedded in a drawing shape. */
+struct ChartShapeInfo
{
-public:
- virtual ::rtl::OUString onCreateXShape(
- const ::rtl::OUString& rServiceName,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ ::rtl::OUString maFragmentPath; /// Path to related XML stream, e.g. for charts.
+ bool mbEmbedShapes; /// True = load chart shapes into chart, false = load into parent drawpage.
- virtual void onXShapeCreated(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ) const;
-
- inline const PropertyMap& getShapeProperties() const { return maShapeProps; }
-
-protected:
- explicit CreateShapeCallback( ::oox::core::XmlFilterBase& rFilter );
- virtual ~CreateShapeCallback();
-
-protected:
- ::oox::core::XmlFilterBase& mrFilter;
- PropertyMap maShapeProps;
+ inline explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {}
};
-typedef ::boost::shared_ptr< CreateShapeCallback > CreateShapeCallbackRef;
-
// ============================================================================
class Shape
@@ -95,7 +77,7 @@ class Shape
{
public:
- Shape( const sal_Char* pServiceType = NULL );
+ explicit Shape( const sal_Char* pServiceType = 0 );
virtual ~Shape();
rtl::OUString& getServiceName(){ return msServiceName; }
@@ -136,6 +118,11 @@ public:
// setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
void setDefaults();
+ ::oox::vml::OleObjectInfo& setOleObjectType();
+ ChartShapeInfo& setChartType( bool bEmbedShapes );
+ void setDiagramType();
+ void setTableType();
+
void setTextBody(const TextBodyPtr & pTextBody);
TextBodyPtr getTextBody();
void setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle );
@@ -145,11 +132,9 @@ public:
inline const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; }
const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const;
- inline void setCreateShapeCallback( CreateShapeCallbackRef xCallback ) { mxCreateCallback = xCallback; }
-
// addShape is creating and inserting the corresponding XShape.
void addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
@@ -166,7 +151,7 @@ protected:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
createAndInsert(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const ::rtl::OUString& rServiceName,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
@@ -174,13 +159,22 @@ protected:
sal_Bool bClearText );
void addChildren(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
Shape& rMaster,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle& rClientRect,
ShapeIdMap* pShapeMap );
+ virtual ::rtl::OUString finalizeServiceName(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::rtl::OUString& rServiceName,
+ const ::com::sun::star::awt::Rectangle& rShapeRect );
+
+ virtual void finalizeXShape(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
std::vector< ShapePtr > maChildren; // only used for group shapes
TextBodyPtr mpTextBody;
LinePropertiesPtr mpLinePropertiesPtr;
@@ -204,7 +198,22 @@ protected:
com::sun::star::awt::Point maPosition;
private:
- CreateShapeCallbackRef mxCreateCallback;
+ enum FrameType
+ {
+ FRAMETYPE_GENERIC, /// Generic shape, no special type.
+ FRAMETYPE_OLEOBJECT, /// OLE object embedded in a shape.
+ FRAMETYPE_CHART, /// Chart embedded in a shape.
+ FRAMETYPE_DIAGRAM, /// Complex diagram drawing shape.
+ FRAMETYPE_TABLE /// A table embedded in a shape.
+ };
+
+ typedef ::boost::shared_ptr< ::oox::vml::OleObjectInfo > OleObjectInfoRef;
+ typedef ::boost::shared_ptr< ChartShapeInfo > ChartShapeInfoRef;
+
+ FrameType meFrameType; /// Type for graphic frame shapes.
+ OleObjectInfoRef mxOleObjectInfo; /// Additional data for OLE objects.
+ ChartShapeInfoRef mxChartShapeInfo; /// Additional data for chart shapes.
+
sal_Int32 mnRotation;
sal_Bool mbFlipH;
sal_Bool mbFlipV;
@@ -213,6 +222,8 @@ private:
::rtl::OUString GetShapeType( sal_Int32 nType );
+// ============================================================================
+
} }
#endif // OOX_DRAWINGML_SHAPE_HXX
diff --git a/oox/inc/oox/drawingml/textbody.hxx b/oox/inc/oox/drawingml/textbody.hxx
index a2eb6106e651..ce747c62bdbb 100644
--- a/oox/inc/oox/drawingml/textbody.hxx
+++ b/oox/inc/oox/drawingml/textbody.hxx
@@ -28,7 +28,6 @@
#ifndef OOX_DRAWINGML_TEXTBODY_HXX
#define OOX_DRAWINGML_TEXTBODY_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/textliststyle.hxx"
diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx
index 1a8fca45bf25..cafcc951504b 100644
--- a/oox/inc/oox/drawingml/textliststyle.hxx
+++ b/oox/inc/oox/drawingml/textliststyle.hxx
@@ -28,8 +28,8 @@
#ifndef OOX_DRAWINGML_TEXTLISTSTYLE_HXX
#define OOX_DRAWINGML_TEXTLISTSTYLE_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/textparagraphproperties.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox { namespace drawingml {
@@ -50,10 +50,6 @@ public:
inline const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; };
inline TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; };
-#if OSL_DEBUG_LEVEL > 0
- void dump( int nLevels=9 );
-#endif
-
protected:
TextParagraphPropertiesVector maListStyle;
diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx
index d8c97cbfa114..c059edc73f43 100644
--- a/oox/inc/oox/drawingml/textparagraph.hxx
+++ b/oox/inc/oox/drawingml/textparagraph.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/XText.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/textrun.hxx"
#include "oox/drawingml/textliststyle.hxx"
diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index 310df83212a0..ef80af2d1c11 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -112,10 +112,6 @@ public:
size can be zero and the default value is returned. */
float getCharHeightPoints( float fDefault ) const;
-#if OSL_DEBUG_LEVEL > 0
- void dump() { maTextParagraphPropertyMap.dump(); OSL_TRACE("character height: %f", maTextCharacterProperties.getCharHeightPoints(-1)); }
-#endif
-
protected:
TextCharacterProperties maTextCharacterProperties;
diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx
index 15f5ce82ce12..7f982a1eec71 100644
--- a/oox/inc/oox/drawingml/theme.hxx
+++ b/oox/inc/oox/drawingml/theme.hxx
@@ -28,7 +28,6 @@
#ifndef OOX_DRAWINGML_THEME_HXX
#define OOX_DRAWINGML_THEME_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/clrscheme.hxx"
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/textfont.hxx"
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
index e3e712a52a25..a3bdc4a87c73 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -190,6 +190,9 @@ protected:
::oox::xls::BiffStringFlags nUniFlags = ::oox::xls::BIFF_STR_DEFAULT,
rtl_TextEncoding eDefaultTextEnc = RTL_TEXTENCODING_DONTKNOW );
+ ::rtl::OUString dumpSegmentedUniString( const String& rName );
+ void dumpSegmentedUniStringArray( const String& rName );
+
sal_uInt8 dumpBoolean( const String& rName = EMPTY_STRING );
sal_uInt8 dumpErrorCode( const String& rName = EMPTY_STRING );
@@ -440,6 +443,8 @@ private:
void dumpExtCfColor( const String& rName = EMPTY_STRING );
void dumpExtGradientHead();
+ sal_uInt8 dumpFilterColumnOperator( const String& rName );
+
::rtl::OUString dumpPivotString( const String& rName, sal_uInt16 nStrLen );
::rtl::OUString dumpPivotString( const String& rName );
diff --git a/oox/inc/oox/dump/oledumper.hxx b/oox/inc/oox/dump/oledumper.hxx
index a0e9cd55e337..8f706f4c40f1 100644
--- a/oox/inc/oox/dump/oledumper.hxx
+++ b/oox/inc/oox/dump/oledumper.hxx
@@ -141,15 +141,19 @@ private:
void dumpCodePageProperty( sal_uInt32 nStartPos );
void dumpDictionaryProperty( sal_uInt32 nStartPos );
- void dumpPropertyContents( sal_Int32 nPropId );
- void dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType );
+ sal_uInt16 dumpPropertyContents( sal_Int32 nPropId );
+ void dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyArray( sal_Int32 nPropId, sal_uInt16 nBaseType );
- sal_Int32 dumpPropertyType();
- void dumpBlob( const String& rName );
+ sal_uInt16 dumpPropertyType();
+ void dumpBlob( sal_Int32 nPropId, const String& rName );
::rtl::OUString dumpString8( const String& rName );
::rtl::OUString dumpCharArray8( const String& rName, sal_Int32 nLen );
::rtl::OUString dumpString16( const String& rName );
::rtl::OUString dumpCharArray16( const String& rName, sal_Int32 nLen );
+ bool dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType );
+ void dumpHlinks( sal_Int32 nSize );
bool startElement( sal_uInt32 nStartPos );
void writeSectionHeader( const ::rtl::OUString& rGuid, sal_uInt32 nStartPos );
diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx
index 345202f67a4a..6fa1c9bd7e45 100644
--- a/oox/inc/oox/dump/xlsbdumper.hxx
+++ b/oox/inc/oox/dump/xlsbdumper.hxx
@@ -29,7 +29,6 @@
#define OOX_DUMP_XLSBDUMPER_HXX
#include "oox/dump/dumperbase.hxx"
-#include "oox/helper/recordinputstream.hxx"
#if OOX_INCLUDE_DUMPER
@@ -96,9 +95,9 @@ private:
bool readCompressedInt( BinaryInputStream& rStrm, sal_Int32& ornValue );
private:
- typedef ::boost::shared_ptr< RecordInputStream > RecordInputStreamRef;
+ typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef;
- RecordInputStreamRef mxBiffStrm;
+ SequenceInputStreamRef mxBiffStrm;
NameListRef mxErrCodes;
};
diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx
index 631d7ec4b66e..87e21e553c2d 100644
--- a/oox/inc/oox/helper/attributelist.hxx
+++ b/oox/inc/oox/helper/attributelist.hxx
@@ -31,7 +31,8 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
@@ -43,6 +44,9 @@ namespace oox {
class AttributeConversion
{
public:
+ /** Returns the XML token identifier from the passed string. */
+ static sal_Int32 decodeToken( const ::rtl::OUString& rValue );
+
/** Returns the decoded string value. All characters in the format
'_xHHHH_' (H being a hexadecimal digit), will be decoded. */
static ::rtl::OUString decodeXString( const ::rtl::OUString& rValue );
@@ -189,4 +193,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/binaryinputstream.hxx b/oox/inc/oox/helper/binaryinputstream.hxx
index 8f58e2de4d9e..52a3a4de9f0f 100644
--- a/oox/inc/oox/helper/binaryinputstream.hxx
+++ b/oox/inc/oox/helper/binaryinputstream.hxx
@@ -288,4 +288,3 @@ typedef ::boost::shared_ptr< RelativeInputStream > RelativeInputStreamRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/binaryoutputstream.hxx b/oox/inc/oox/helper/binaryoutputstream.hxx
index d2f0f8b36ffa..e24777c4f296 100644
--- a/oox/inc/oox/helper/binaryoutputstream.hxx
+++ b/oox/inc/oox/helper/binaryoutputstream.hxx
@@ -158,4 +158,3 @@ typedef ::boost::shared_ptr< SequenceOutputStream > SequenceOutputStreamRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/binarystreambase.hxx b/oox/inc/oox/helper/binarystreambase.hxx
index abe4c5f1c274..ba0f34b21f40 100644
--- a/oox/inc/oox/helper/binarystreambase.hxx
+++ b/oox/inc/oox/helper/binarystreambase.hxx
@@ -144,4 +144,3 @@ protected:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index f4f3717eac3f..96b9feeffe07 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -30,8 +30,6 @@
#include <vector>
#include <map>
-#include <boost/shared_ptr.hpp>
-#include <boost/bind.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
@@ -49,304 +47,6 @@ namespace oox {
// ============================================================================
-/** Template for a vector of ref-counted objects with additional accessor functions.
-
- An instance of the class RefVector< Type > stores elements of the type
- ::boost::shared_ptr< Type >. The new accessor functions has() and get()
- work correctly for indexes out of the current range, there is no need to
- check the passed index before.
- */
-template< typename ObjType >
-class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > >
-{
-public:
- typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::size_type size_type;
-
-public:
- /** Returns true, if the object with the passed index exists. Returns
- false, if the vector element exists but is an empty reference. */
- inline bool has( sal_Int32 nIndex ) const
- {
- const value_type* pxRef = getRef( nIndex );
- return pxRef && pxRef->get();
- }
-
- /** Returns a reference to the object with the passed index, or 0 on error. */
- inline value_type get( sal_Int32 nIndex ) const
- {
- if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef;
- return value_type();
- }
-
- /** Returns the index of the last element, or -1, if the vector is empty.
- Does *not* check whether the last element is an empty reference. */
- inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
-
- /** Calls the passed functor for every contained object, automatically
- skips all elements that are empty references. */
- template< typename FunctorType >
- inline void forEach( FunctorType aFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType >
- inline void forEachMem( FuncType pFunc ) const
- {
- forEach( ::boost::bind( pFunc, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType >
- inline void forEachMem( FuncType pFunc, ParamType aParam ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
- }
-
- /** Calls the passed functor for every contained object. Passes the index as
- first argument and the object reference as second argument to rFunctor. */
- template< typename FunctorType >
- inline void forEachWithIndex( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index to the member function. */
- template< typename FuncType >
- inline void forEachMemWithIndex( FuncType pFunc ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
- }
-
- /** Searches for an element by using the passed functor that takes a
- constant reference of the object type (const ObjType&). */
- template< typename FunctorType >
- inline value_type findIf( const FunctorType& rFunctor ) const
- {
- typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) );
- return (aIt == this->end()) ? value_type() : *aIt;
- }
-
-private:
- template< typename FunctorType >
- struct ForEachFunctor
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
- };
-
- template< typename FunctorType >
- struct ForEachFunctorWithIndex
- {
- FunctorType maFunctor;
- sal_Int32 mnIndex;
- inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
- inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
- };
-
- template< typename FunctorType >
- struct FindFunctor
- {
- FunctorType maFunctor;
- inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
- };
-
- inline const value_type* getRef( sal_Int32 nIndex ) const
- {
- return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ?
- &(*this)[ static_cast< size_type >( nIndex ) ] : 0;
- }
-};
-
-// ============================================================================
-
-/** Template for a map of ref-counted objects with additional accessor functions.
-
- An instance of the class RefMap< Type > stores elements of the type
- ::boost::shared_ptr< Type >. The new accessor functions has() and get()
- work correctly for nonexisting keys, there is no need to check the passed
- key before.
- */
-template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > >
-class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType >
-{
-public:
- typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type;
- typedef typename container_type::key_type key_type;
- typedef typename container_type::mapped_type mapped_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::key_compare key_compare;
-
-public:
- /** Returns true, if the object accossiated to the passed key exists.
- Returns false, if the key exists but points to an empty reference. */
- inline bool has( key_type nKey ) const
- {
- const mapped_type* pxRef = getRef( nKey );
- return pxRef && pxRef->get();
- }
-
- /** Returns a reference to the object accossiated to the passed key, or an
- empty reference on error. */
- inline mapped_type get( key_type nKey ) const
- {
- if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
- return mapped_type();
- }
-
- /** Calls the passed functor for every contained object, automatically
- skips all elements that are empty references. */
- template< typename FunctorType >
- inline void forEach( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType >
- inline void forEachMem( FuncType pFunc ) const
- {
- forEach( ::boost::bind( pFunc, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType >
- inline void forEachMem( FuncType pFunc, ParamType aParam ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
- }
- /** Calls the passed functor for every contained object. Passes the key as
- first argument and the object reference as second argument to rFunctor. */
- template< typename FunctorType >
- inline void forEachWithKey( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as argument to the member function. */
- template< typename FuncType >
- inline void forEachMemWithKey( FuncType pFunc ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType >
- inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
- }
-
-private:
- template< typename FunctorType >
- struct ForEachFunctor
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
- };
-
- template< typename FunctorType >
- struct ForEachFunctorWithKey
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
- };
-
- inline const mapped_type* getRef( key_type nKey ) const
- {
- typename container_type::const_iterator aIt = find( nKey );
- return (aIt == this->end()) ? 0 : &aIt->second;
- }
-};
-
-// ============================================================================
-
/** Template for a 2-dimensional array of objects.
This class template provides a similar interface to the ::std::vector
@@ -518,45 +218,53 @@ public:
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */
- template< typename Type >
- static const Type* getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex );
+ template< typename VectorType >
+ static const typename VectorType::value_type*
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex );
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */
- template< typename Type >
- static Type* getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex );
+ template< typename VectorType >
+ static typename VectorType::value_type*
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex );
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */
- template< typename Type >
- static const Type& getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault );
+ template< typename VectorType >
+ static const typename VectorType::value_type&
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault );
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */
- template< typename Type >
- static Type& getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault );
+ template< typename VectorType >
+ static typename VectorType::value_type&
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static const Type* getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey );
+ template< typename MapType >
+ static const typename MapType::mapped_type*
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static Type* getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey );
+ template< typename MapType >
+ static typename MapType::mapped_type*
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey );
/** Returns the reference to an existing element of the passed map, or the
passed default value, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static const Type& getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault );
+ template< typename MapType >
+ static const typename MapType::mapped_type&
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault );
/** Returns the reference to an existing element of the passed map, or the
passed default value, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static Type& getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault );
+ template< typename MapType >
+ static typename MapType::mapped_type&
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault );
- // vector/matrix to Sequence ----------------------------------------------
+ // vector/map/matrix to UNO sequence --------------------------------------
/** Creates a UNO sequence from a std::vector with copies of all elements.
@@ -565,9 +273,20 @@ public:
@return A com.sun.star.uno.Sequence object with copies of all objects
contained in the passed vector.
*/
- template< typename Type >
- static ::com::sun::star::uno::Sequence< Type >
- vectorToSequence( const ::std::vector< Type >& rVector );
+ template< typename VectorType >
+ static ::com::sun::star::uno::Sequence< typename VectorType::value_type >
+ vectorToSequence( const VectorType& rVector );
+
+ /** Creates a UNO sequence from a std::map with copies of all elements.
+
+ @param rMap The map to be converted to a sequence.
+
+ @return A com.sun.star.uno.Sequence object with copies of all objects
+ contained in the passed map.
+ */
+ template< typename MapType >
+ static ::com::sun::star::uno::Sequence< typename MapType::mapped_type >
+ mapToSequence( const MapType& rMap );
/** Creates a UNO sequence of sequences from a matrix with copies of all elements.
@@ -577,126 +296,104 @@ public:
com.sun.star.uno.Sequence objects with copies of all objects
contained in the passed matrix.
*/
- template< typename Type >
- static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > >
- matrixToSequenceSequence( const Matrix< Type >& rMatrix );
+ template< typename MatrixType >
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > >
+ matrixToSequenceSequence( const MatrixType& rMatrix );
};
// ----------------------------------------------------------------------------
-template< typename Type >
-const Type* ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex )
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type* ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
}
-template< typename Type >
-Type* ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex )
+template< typename VectorType >
+/*static*/ typename VectorType::value_type* ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
}
-template< typename Type >
-const Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault )
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type& ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
}
-template< typename Type >
-Type& ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault )
+template< typename VectorType >
+/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
}
-template< typename Type, typename KeyType >
-const Type* ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey )
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey )
{
- typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey );
+ typename MapType::const_iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? 0 : &aIt->second;
}
-template< typename Type, typename KeyType >
-Type* ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey )
+template< typename MapType >
+/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey )
{
- typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey );
+ typename MapType::iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? 0 : &aIt->second;
}
-template< typename Type, typename KeyType >
-const Type& ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault )
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault )
{
- typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey );
+ typename MapType::const_iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? rDefault : aIt->second;
}
-template< typename Type, typename KeyType >
-Type& ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault )
+template< typename MapType >
+/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault )
{
- typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey );
+ typename MapType::iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? rDefault : aIt->second;
}
-template< typename Type >
-::com::sun::star::uno::Sequence< Type > ContainerHelper::vectorToSequence( const ::std::vector< Type >& rVector )
+template< typename VectorType >
+/*static*/ ::com::sun::star::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector )
{
+ typedef typename VectorType::value_type ValueType;
if( rVector.empty() )
- return ::com::sun::star::uno::Sequence< Type >();
- return ::com::sun::star::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ return ::com::sun::star::uno::Sequence< ValueType >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
}
-template< typename Type >
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > ContainerHelper::matrixToSequenceSequence( const Matrix< Type >& rMatrix )
+template< typename MapType >
+/*static*/ ::com::sun::star::uno::Sequence< typename MapType::mapped_type > ContainerHelper::mapToSequence( const MapType& rMap )
+{
+ typedef typename MapType::mapped_type ValueType;
+ if( rMap.empty() )
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ ::com::sun::star::uno::Sequence< ValueType > aSeq( static_cast< sal_Int32 >( rMap.size() ) );
+ sal_Int32 nIndex = 0;
+ for( typename MapType::const_iterator aIt = rMap.begin(), aEnd = rMap.end(); aIt != aEnd; ++aIt, ++nIndex )
+ aSeq[ nIndex ] = *aIt;
+ return aSeq;
+}
+
+template< typename MatrixType >
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix )
{
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > aSeq;
+ typedef typename MatrixType::value_type ValueType;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ValueType > > aSeq;
if( !rMatrix.empty() )
{
aSeq.realloc( static_cast< sal_Int32 >( rMatrix.height() ) );
for( size_t nRow = 0, nHeight = rMatrix.height(); nRow < nHeight; ++nRow )
aSeq[ static_cast< sal_Int32 >( nRow ) ] =
- ::com::sun::star::uno::Sequence< Type >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) );
+ ::com::sun::star::uno::Sequence< ValueType >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) );
}
return aSeq;
}
// ============================================================================
-/** This helper manages named objects in a container, which is created on demand.
- */
-class ObjectContainer
-{
-public:
- explicit ObjectContainer(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::rtl::OUString& rServiceName );
- ~ObjectContainer();
-
- /** Returns true, if the object with the passed name exists in the container. */
- bool hasObject( const ::rtl::OUString& rObjName ) const;
-
- /** Returns the object with the passed name from the container. */
- ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const;
-
- /** Inserts the passed object into the container, returns its final name. */
- ::rtl::OUString insertObject(
- const ::rtl::OUString& rObjName,
- const ::com::sun::star::uno::Any& rObj,
- bool bInsertByUnusedName );
-
-private:
- void createContainer() const;
-
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory; /// Factory to create the container.
- mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- mxContainer; /// Container for the objects.
- ::rtl::OUString maServiceName; /// Service name to create the container.
- sal_Int32 mnIndex; /// Index to create unique identifiers.
-};
-
-// ============================================================================
-
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx
index 1c112efcf923..b2b9e1cd133b 100644
--- a/oox/inc/oox/helper/graphichelper.hxx
+++ b/oox/inc/oox/helper/graphichelper.hxx
@@ -45,7 +45,6 @@ namespace com { namespace sun { namespace star {
namespace graphic { class XGraphic; }
namespace graphic { class XGraphicObject; }
namespace graphic { class XGraphicProvider; }
- namespace lang { class XMultiServiceFactory; }
namespace uno { class XComponentContext; }
} } }
@@ -68,7 +67,7 @@ class GraphicHelper
{
public:
explicit GraphicHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame,
const StorageRef& rxStorage );
virtual ~GraphicHelper();
@@ -176,4 +175,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx
index c68fe9ce83f8..84c501fae2e5 100644
--- a/oox/inc/oox/helper/helper.hxx
+++ b/oox/inc/oox/helper/helper.hxx
@@ -322,4 +322,3 @@ inline void ByteOrderConverter::swap8( sal_uInt8* pnData )
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx
index a9ef27e8cb98..e36e7001e613 100644
--- a/oox/inc/oox/helper/modelobjecthelper.hxx
+++ b/oox/inc/oox/helper/modelobjecthelper.hxx
@@ -29,19 +29,55 @@
#define OOX_HELPER_MODELOBJECTHELPER_HXX
#include <com/sun/star/uno/Reference.hxx>
-#include "oox/helper/containerhelper.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace awt { struct Gradient; }
+ namespace container { class XNameContainer; }
namespace drawing { struct LineDash; }
namespace drawing { struct PolyPolygonBezierCoords; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox {
// ============================================================================
+/** This helper manages named objects in a container, which is created on demand.
+ */
+class ObjectContainer
+{
+public:
+ explicit ObjectContainer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::rtl::OUString& rServiceName );
+ ~ObjectContainer();
+
+ /** Returns true, if the object with the passed name exists in the container. */
+ bool hasObject( const ::rtl::OUString& rObjName ) const;
+
+ /** Returns the object with the passed name from the container. */
+ ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const;
+
+ /** Inserts the passed object into the container, returns its final name. */
+ ::rtl::OUString insertObject(
+ const ::rtl::OUString& rObjName,
+ const ::com::sun::star::uno::Any& rObj,
+ bool bInsertByUnusedName );
+
+private:
+ void createContainer() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ mxFactory; /// Factory to create the container.
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxContainer; /// Container for the objects.
+ ::rtl::OUString maServiceName; /// Service name to create the container.
+ sal_Int32 mnIndex; /// Index to create unique identifiers.
+};
+
+// ============================================================================
+
/** Contains tables for named drawing objects for a document model.
Contains tables for named line markers, line dashes, fill gradients, and
@@ -77,13 +113,13 @@ public:
::rtl::OUString insertFillBitmap( const ::rtl::OUString& rGraphicUrl );
private:
- ObjectContainer maMarkerContainer;
- ObjectContainer maDashContainer;
- ObjectContainer maGradientContainer;
- ObjectContainer maBitmapContainer;
- const ::rtl::OUString maDashNameBase;
- const ::rtl::OUString maGradientNameBase;
- const ::rtl::OUString maBitmapNameBase;
+ ObjectContainer maMarkerContainer; /// Contains all named line markers (line end polygons).
+ ObjectContainer maDashContainer; /// Contains all named line dsahes.
+ ObjectContainer maGradientContainer; /// Contains all named fill gradients.
+ ObjectContainer maBitmapContainer; /// Contains all named fill bitmaps.
+ const ::rtl::OUString maDashNameBase; /// Base name for all named line dashes.
+ const ::rtl::OUString maGradientNameBase; /// Base name for all named fill gradients.
+ const ::rtl::OUString maBitmapNameBase; /// Base name for all named fill bitmaps.
};
// ============================================================================
@@ -91,4 +127,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/progressbar.hxx b/oox/inc/oox/helper/progressbar.hxx
index f5ea98816915..847d16ea9231 100644
--- a/oox/inc/oox/helper/progressbar.hxx
+++ b/oox/inc/oox/helper/progressbar.hxx
@@ -142,4 +142,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx
index 150f5c3d9364..9e7196381002 100644
--- a/oox/inc/oox/helper/propertymap.hxx
+++ b/oox/inc/oox/helper/propertymap.hxx
@@ -30,9 +30,10 @@
#include <vector>
#include <map>
-#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include "oox/token/properties.hxx"
namespace com { namespace sun { namespace star { namespace beans {
struct PropertyValue;
@@ -41,7 +42,7 @@ namespace com { namespace sun { namespace star { namespace beans {
namespace oox {
-struct PropertyList;
+struct PropertyNameVector;
// ============================================================================
@@ -89,13 +90,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
makePropertySet() const;
-#if OSL_DEBUG_LEVEL > 0
- static void dump( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
- void dump();
-#endif
-
private:
- const PropertyList* mpPropNames;
+ const PropertyNameVector* mpPropNames;
};
// ============================================================================
@@ -103,4 +99,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx
index 8ddfaff44421..9a49bb48cf92 100644
--- a/oox/inc/oox/helper/propertyset.hxx
+++ b/oox/inc/oox/helper/propertyset.hxx
@@ -30,6 +30,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include "oox/token/properties.hxx"
namespace oox {
@@ -127,10 +128,6 @@ public:
@param rPropertyMap The property map. */
void setProperties( const PropertyMap& rPropertyMap );
-#if OSL_DEBUG_LEVEL > 0
- void dump();
-#endif
-
// ------------------------------------------------------------------------
private:
/** Gets the specified property from the property set.
@@ -167,4 +164,3 @@ inline void PropertySet::setProperty( sal_Int32 nPropId, const Type& rValue )
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/refmap.hxx b/oox/inc/oox/helper/refmap.hxx
new file mode 100755
index 000000000000..e833e1196c81
--- /dev/null
+++ b/oox/inc/oox/helper/refmap.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * 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 OOX_HELPER_REFMAP_HXX
+#define OOX_HELPER_REFMAP_HXX
+
+#include <map>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a map of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefMap< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for nonexisting keys, there is no need to check the passed
+ key before.
+ */
+template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > >
+class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType >
+{
+public:
+ typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type;
+ typedef typename container_type::key_type key_type;
+ typedef typename container_type::mapped_type mapped_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::key_compare key_compare;
+
+public:
+ /** Returns true, if the object accossiated to the passed key exists.
+ Returns false, if the key exists but points to an empty reference. */
+ inline bool has( key_type nKey ) const
+ {
+ const mapped_type* pxRef = getRef( nKey );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object accossiated to the passed key, or an
+ empty reference on error. */
+ inline mapped_type get( key_type nKey ) const
+ {
+ if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
+ return mapped_type();
+ }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+ /** Calls the passed functor for every contained object. Passes the key as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithKey( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as argument to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithKey( FuncType pFunc ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithKey
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
+ };
+
+ inline const mapped_type* getRef( key_type nKey ) const
+ {
+ typename container_type::const_iterator aIt = find( nKey );
+ return (aIt == this->end()) ? 0 : &aIt->second;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/helper/refvector.hxx b/oox/inc/oox/helper/refvector.hxx
new file mode 100755
index 000000000000..0a2d8be62e2f
--- /dev/null
+++ b/oox/inc/oox/helper/refvector.hxx
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * 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 OOX_HELPER_REFVECTOR_HXX
+#define OOX_HELPER_REFVECTOR_HXX
+
+#include <vector>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a vector of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefVector< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for indexes out of the current range, there is no need to
+ check the passed index before.
+ */
+template< typename ObjType >
+class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > >
+{
+public:
+ typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::size_type size_type;
+
+public:
+ /** Returns true, if the object with the passed index exists. Returns
+ false, if the vector element exists but is an empty reference. */
+ inline bool has( sal_Int32 nIndex ) const
+ {
+ const value_type* pxRef = getRef( nIndex );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object with the passed index, or 0 on error. */
+ inline value_type get( sal_Int32 nIndex ) const
+ {
+ if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef;
+ return value_type();
+ }
+
+ /** Returns the index of the last element, or -1, if the vector is empty.
+ Does *not* check whether the last element is an empty reference. */
+ inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( FunctorType aFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Calls the passed functor for every contained object. Passes the index as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithIndex( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithIndex( FuncType pFunc ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Searches for an element by using the passed functor that takes a
+ constant reference of the object type (const ObjType&). */
+ template< typename FunctorType >
+ inline value_type findIf( const FunctorType& rFunctor ) const
+ {
+ typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) );
+ return (aIt == this->end()) ? value_type() : *aIt;
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithIndex
+ {
+ FunctorType maFunctor;
+ sal_Int32 mnIndex;
+ inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
+ };
+
+ template< typename FunctorType >
+ struct FindFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
+ };
+
+ inline const value_type* getRef( sal_Int32 nIndex ) const
+ {
+ return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ?
+ &(*this)[ static_cast< size_type >( nIndex ) ] : 0;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/helper/storagebase.hxx b/oox/inc/oox/helper/storagebase.hxx
index 5a179e73cf75..d48e5fdd1844 100644
--- a/oox/inc/oox/helper/storagebase.hxx
+++ b/oox/inc/oox/helper/storagebase.hxx
@@ -28,8 +28,10 @@
#ifndef OOX_HELPER_STORAGEBASE_HXX
#define OOX_HELPER_STORAGEBASE_HXX
+#include <vector>
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/helper/refmap.hxx"
#include "oox/dllapi.h"
-#include "oox/helper/containerhelper.hxx"
namespace com { namespace sun { namespace star {
namespace embed { class XStorage; }
diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx
index 1e74825ee713..2e98d3fc8c84 100755
--- a/oox/inc/oox/helper/textinputstream.hxx
+++ b/oox/inc/oox/helper/textinputstream.hxx
@@ -55,4 +55,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx
index e3f102716e17..f26075ff52eb 100755..100644
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -30,7 +30,7 @@
#include <utility>
#include "oox/helper/binaryinputstream.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox {
namespace ole {
@@ -92,6 +92,8 @@ typedef ::std::vector< ::rtl::OUString > AxStringArray;
// ============================================================================
+const sal_Char* const AX_GUID_CFONT = "{AFC20920-DA4E-11CE-B943-00AA006887B4}";
+
const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001;
const sal_uInt32 AX_FONTDATA_ITALIC = 0x00000002;
const sal_uInt32 AX_FONTDATA_UNDERLINE = 0x00000004;
@@ -111,6 +113,7 @@ struct AxFontData
sal_Int32 mnFontHeight; /// Height of the font (not really twips, see code).
sal_Int32 mnFontCharSet; /// Windows character set of the font.
sal_Int32 mnHorAlign; /// Horizontal text alignment.
+ bool mbDblUnderline; /// True = double underline style (legacy VML drawing controls only).
explicit AxFontData();
@@ -293,4 +296,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index 8df45ece6065..8bc9cd622b2b 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -30,6 +30,7 @@
#include <boost/shared_ptr.hpp>
#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/propertyset.hxx"
#include "oox/ole/axbinaryreader.hxx"
#include "oox/ole/olehelper.hxx"
@@ -37,6 +38,7 @@ namespace com { namespace sun { namespace star {
namespace awt { class XControlModel; }
namespace container { class XIndexContainer; }
namespace drawing { class XDrawPage; }
+ namespace frame { class XModel; }
namespace form { class XFormsSupplier; }
namespace lang { class XMultiServiceFactory; }
} } }
@@ -56,6 +58,9 @@ const sal_Char* const COMCTL_GUID_SCROLLBAR_60 = "{FE38753A-44A3-11D1-B5B7-
const sal_Char* const COMCTL_GUID_PROGRESSBAR_50 = "{0713E8D2-850A-101B-AFC0-4210102A8DA7}";
const sal_Char* const COMCTL_GUID_PROGRESSBAR_60 = "{35053A22-8589-11D1-B16A-00C0F0283628}";
+const sal_uInt16 COMCTL_VERSION_50 = 5;
+const sal_uInt16 COMCTL_VERSION_60 = 6;
+
// ----------------------------------------------------------------------------
const sal_Char* const AX_GUID_COMMANDBUTTON = "{D7053240-CE69-11CD-A777-00DD01143C57}";
@@ -77,6 +82,28 @@ const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F;
const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012;
+const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002;
+const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004;
+const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008;
+const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400;
+const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800;
+const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000;
+const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000;
+const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000;
+const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000;
+const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000;
+const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000;
+const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000;
+const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000;
+const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000;
+const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000;
+const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000;
+const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000;
+const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000;
+const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000;
+const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000;
+const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000;
+
const sal_Int32 AX_BORDERSTYLE_NONE = 0;
const sal_Int32 AX_BORDERSTYLE_SINGLE = 1;
@@ -96,6 +123,26 @@ const sal_Int32 AX_PICALIGN_CENTER = 2;
const sal_Int32 AX_PICALIGN_BOTTOMLEFT = 3;
const sal_Int32 AX_PICALIGN_BOTTOMRIGHT = 4;
+const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1;
+const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2;
+const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3;
+const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4;
+const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5;
+const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6;
+const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7;
+
+const sal_Int32 AX_SELCTION_SINGLE = 0;
+const sal_Int32 AX_SELCTION_MULTI = 1;
+const sal_Int32 AX_SELCTION_EXTENDED = 2;
+
+const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
+const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
+const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2;
+
+const sal_Int32 AX_SCROLLBAR_NONE = 0x00;
+const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01;
+const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02;
+
// ----------------------------------------------------------------------------
/** Enumerates all UNO API control types supported by these filters. */
@@ -107,6 +154,7 @@ enum ApiControlType
API_CONTROL_CHECKBOX,
API_CONTROL_RADIOBUTTON,
API_CONTROL_EDIT,
+ API_CONTROL_NUMERIC,
API_CONTROL_LISTBOX,
API_CONTROL_COMBOBOX,
API_CONTROL_SPINBUTTON,
@@ -147,6 +195,7 @@ class ControlConverter
{
public:
explicit ControlConverter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
virtual ~ControlConverter();
@@ -179,12 +228,25 @@ public:
PropertyMap& rPropMap,
bool bHorizontal ) const;
+ /** Converts the vertical alignment to UNO properties. */
+ void convertVerticalAlign(
+ PropertyMap& rPropMap,
+ sal_Int32 nVerticalAlign ) const;
+
/** Converts common scrollbar settings to UNO properties. */
void convertScrollBar(
PropertyMap& rPropMap,
sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const;
+ /** Binds the passed control model to the passed data sources. The
+ implementation will check which source types are supported. */
+ void bindToSources(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ::rtl::OUString& rCtrlSource,
+ const ::rtl::OUString& rRowSource,
+ sal_Int32 nRefSheet = 0 ) const;
+
// ActiveX (Forms 2.0) specific conversion --------------------------------
/** Converts the Forms 2.0 background formatting to UNO properties. */
@@ -238,7 +300,10 @@ public:
sal_Int32 nOrientation ) const;
private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
const GraphicHelper& mrGraphicHelper;
+ mutable PropertySet maAddressConverter;
+ mutable PropertySet maRangeConverter;
bool mbDefaultColorBgr;
};
@@ -275,8 +340,10 @@ public:
/** Converts the control size to UNO properties. */
void convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-protected:
+public: // direct access needed for legacy VML drawing controls
AxPairData maSize; /// Size of the control in 1/100 mm.
+
+protected:
bool mbAwtModel; /// True = AWT control model, false = form component.
};
@@ -396,8 +463,10 @@ public:
/** Returns the font height in points. */
inline sal_Int16 getFontHeight() const { return maFontData.getHeightPoints(); }
-protected:
+public: // direct access needed for legacy VML drawing controls
AxFontData maFontData; /// The font settings.
+
+private:
bool mbSupportsAlign; /// True = UNO model supports Align property.
};
@@ -416,13 +485,14 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the button.
sal_uInt32 mnTextColor; /// Text color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
sal_uInt32 mnPicturePos; /// Position of the picture relative to text.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
bool mbFocusOnClick; /// True = take focus on click.
};
@@ -440,7 +510,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
::rtl::OUString maCaption; /// Visible caption of the button.
sal_uInt32 mnTextColor; /// Text color.
sal_uInt32 mnBackColor; /// Fill color.
@@ -448,6 +518,7 @@ private:
sal_uInt32 mnBorderColor; /// Flat border color.
sal_Int32 mnBorderStyle; /// Flat border style.
sal_Int32 mnSpecialEffect; /// 3D border effect.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
};
// ============================================================================
@@ -490,7 +561,7 @@ public:
virtual bool importBinaryModel( BinaryInputStream& rInStrm );
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-protected:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the button.
::rtl::OUString maValue; /// Current value of the control.
@@ -510,6 +581,7 @@ protected:
sal_Int32 mnMaxLength; /// Maximum character count.
sal_Int32 mnPasswordChar; /// Password character in edit fields.
sal_Int32 mnListRows; /// Number of rows in dropdown box.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
};
// ============================================================================
@@ -565,6 +637,18 @@ public:
// ============================================================================
+/** Model for a numeric field (legacy drawing controls only). */
+class AxNumericFieldModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxNumericFieldModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+// ============================================================================
+
/** Model for a Forms 2.0 list box. */
class AxListBoxModel : public AxMorphDataModelBase
{
@@ -601,7 +685,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
sal_uInt32 mnArrowColor; /// Button arrow color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
@@ -627,7 +711,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
sal_uInt32 mnArrowColor; /// Button arrow color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
@@ -691,7 +775,7 @@ public:
model from the 'f' stream. */
bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable );
-protected:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the form.
AxPairData maLogicalSize; /// Logical form size (scroll area).
@@ -776,14 +860,27 @@ class EmbeddedControl
{
public:
explicit EmbeddedControl( const ::rtl::OUString& rName );
- ~EmbeddedControl();
+ virtual ~EmbeddedControl();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType >
+ inline ModelType& createModel();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType, typename ParamType >
+ inline ModelType& createModel( const ParamType& rParam );
/** Creates and returns the internal control model according to the passed
MS class identifier. */
- ControlModelRef createModel( const ::rtl::OUString& rClassId );
+ ControlModelBase* createModelFromGuid( const ::rtl::OUString& rClassId );
/** Returns true, if the internal control model exists. */
inline bool hasModel() const { return mxModel.get() != 0; }
+ /** Returns read-only access to the internal control model. */
+ inline const ControlModelBase* getModel() const { return mxModel.get(); }
+ /** Returns read/write access to the internal control model. */
+ inline ControlModelBase* getModel() { return mxModel.get(); }
+
/** Returns the UNO service name needed to construct the control model. */
::rtl::OUString getServiceName() const;
@@ -797,32 +894,54 @@ private:
::rtl::OUString maName; /// Name of the control.
};
+// ----------------------------------------------------------------------------
+
+template< typename ModelType >
+inline ModelType& EmbeddedControl::createModel()
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
+template< typename ModelType, typename ParamType >
+inline ModelType& EmbeddedControl::createModel( const ParamType& rParam )
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType( rParam ) );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
// ============================================================================
/** A wrapper for a control form embedded directly in a draw page. */
-class EmbeddedForm : public ControlConverter
+class EmbeddedForm
{
public:
explicit EmbeddedForm(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
- /** Converts the passed ActiveX control and inserts it into the form.
+ /** Converts the passed control and inserts the control model into the form.
@return The API control model, if conversion was successful. */
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
- convertAndInsert( const EmbeddedControl& rControl );
+ convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex );
-private:
- /** Tries to insert the passed control model into the form. */
- bool insertControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel );
+ /** Returns the XIndexContainer interface of the UNO control form, if existing. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ getXForm() const { return mxFormIC; }
+private:
/** Creates the form that will hold the form controls. */
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
- createForm();
+ createXForm();
private:
+ ControlConverter maControlConv;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxModelFactory;
::com::sun::star::uno::Reference< ::com::sun::star::form::XFormsSupplier > mxFormsSupp;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxFormIC;
diff --git a/oox/inc/oox/ole/axcontrolfragment.hxx b/oox/inc/oox/ole/axcontrolfragment.hxx
index 3c9aed61bd3e..a5273070ba8f 100644
--- a/oox/inc/oox/ole/axcontrolfragment.hxx
+++ b/oox/inc/oox/ole/axcontrolfragment.hxx
@@ -78,4 +78,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx
index ba46d3baf6df..98085e66cfd8 100644
--- a/oox/inc/oox/ole/olehelper.hxx
+++ b/oox/inc/oox/ole/olehelper.hxx
@@ -100,6 +100,10 @@ public:
sal_uInt32 nOleColor,
bool bDefaultColorBgr = true );
+ /** Returns the OLE color from the passed UNO RGB color.
+ */
+ static sal_uInt32 encodeOleColor( sal_Int32 nRgbColor );
+
/** Imports a GUID from the passed binary stream and returns its string
representation (in uppercase characters).
*/
@@ -140,4 +144,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/oleobjecthelper.hxx b/oox/inc/oox/ole/oleobjecthelper.hxx
index ef3570c4fa20..c3a58213abc9 100644
--- a/oox/inc/oox/ole/oleobjecthelper.hxx
+++ b/oox/inc/oox/ole/oleobjecthelper.hxx
@@ -32,8 +32,8 @@
namespace com { namespace sun { namespace star {
namespace awt { struct Size; }
- namespace lang { class XMultiServiceFactory; }
namespace document { class XEmbeddedObjectResolver; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox { class PropertyMap; }
@@ -83,4 +83,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx
index a84fadfadc92..eabcfd4d0f87 100755..100644
--- a/oox/inc/oox/ole/olestorage.hxx
+++ b/oox/inc/oox/ole/olestorage.hxx
@@ -31,8 +31,8 @@
#include "oox/helper/storagebase.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace container { class XNameContainer; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox {
diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx
index c2490b3506bf..8c4274ffda7e 100755
--- a/oox/inc/oox/ole/vbacontrol.hxx
+++ b/oox/inc/oox/ole/vbacontrol.hxx
@@ -32,6 +32,7 @@
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class StorageBase; }
@@ -82,12 +83,18 @@ public:
ApiControlType eCtrlType,
sal_Int32 nCtrlIndex ) const;
+ /** Binds the passed control model to the data sources. The implementation
+ will check which source types are supported. */
+ void bindToSources(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv ) const;
+
protected:
::rtl::OUString maName; /// Name of the control.
::rtl::OUString maTag; /// User defined tag.
::rtl::OUString maToolTip; /// Tool tip for the control.
- ::rtl::OUString maLinkedCell; /// Linked cell for the control value in a spreadsheet.
- ::rtl::OUString maSourceRange; /// Source data for the control in a spreadsheet.
+ ::rtl::OUString maControlSource; /// Linked cell for the control value in a spreadsheet.
+ ::rtl::OUString maRowSource; /// Source data for the control in a spreadsheet.
AxPairData maPos; /// Position in parent container.
sal_Int32 mnId; /// Control identifier.
sal_Int32 mnHelpContextId; /// Help context identifier.
@@ -181,11 +188,12 @@ private:
// ============================================================================
-class VbaUserForm : public VbaFormControl, public ControlConverter
+class VbaUserForm : public VbaFormControl
{
public:
explicit VbaUserForm(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
@@ -198,7 +206,9 @@ public:
rtl_TextEncoding eTextEnc );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
+ ControlConverter maConverter;
};
// ============================================================================
diff --git a/oox/inc/oox/ole/vbahelper.hxx b/oox/inc/oox/ole/vbahelper.hxx
index c1e7297d0c5b..aa7b3a081c8d 100644
--- a/oox/inc/oox/ole/vbahelper.hxx
+++ b/oox/inc/oox/ole/vbahelper.hxx
@@ -54,6 +54,7 @@ const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL = 0x0021;
const sal_uInt16 VBA_ID_PROJECTCODEPAGE = 0x0003;
const sal_uInt16 VBA_ID_PROJECTEND = 0x0010;
const sal_uInt16 VBA_ID_PROJECTMODULES = 0x000F;
+const sal_uInt16 VBA_ID_PROJECTNAME = 0x0004;
const sal_uInt16 VBA_ID_PROJECTVERSION = 0x0009;
// ============================================================================
diff --git a/oox/inc/oox/ole/vbainputstream.hxx b/oox/inc/oox/ole/vbainputstream.hxx
index 4de0a91a622f..858698518968 100644
--- a/oox/inc/oox/ole/vbainputstream.hxx
+++ b/oox/inc/oox/ole/vbainputstream.hxx
@@ -69,4 +69,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx
index 377c7abc335a..52b2261e55b5 100644
--- a/oox/inc/oox/ole/vbamodule.hxx
+++ b/oox/inc/oox/ole/vbamodule.hxx
@@ -28,8 +28,8 @@
#ifndef OOX_OLE_VBAMODULE_HXX
#define OOX_OLE_VBAMODULE_HXX
-#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
namespace com { namespace sun { namespace star {
namespace container { class XNameAccess; }
diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx
index e8d9aa7c0f5d..40e81c923d25 100644
--- a/oox/inc/oox/ole/vbaproject.hxx
+++ b/oox/inc/oox/ole/vbaproject.hxx
@@ -28,8 +28,10 @@
#ifndef OOX_OLE_VBAPROJECT_HXX
#define OOX_OLE_VBAPROJECT_HXX
-#include "oox/helper/storagebase.hxx"
+#include <map>
#include <com/sun/star/uno/XInterface.hpp>
+#include "oox/helper/refvector.hxx"
+#include "oox/helper/storagebase.hxx"
#include "oox/dllapi.h"
namespace com { namespace sun { namespace star {
@@ -37,7 +39,8 @@ namespace com { namespace sun { namespace star {
namespace document { class XEventsSupplier; }
namespace frame { class XModel; }
namespace script { class XLibraryContainer; }
- namespace lang { class XMultiServiceFactory; }
+ namespace script { namespace vba { class XVBAMacroResolver; } }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class GraphicHelper; }
@@ -51,7 +54,7 @@ class OOX_DLLPUBLIC VbaFilterConfig
{
public:
explicit VbaFilterConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rConfigCompName );
~VbaFilterConfig();
@@ -69,11 +72,52 @@ private:
// ============================================================================
+/** Base class for objects that attach a amcro to a specific action.
+
+ Purpose is to collect objects that need to attach a VBA macro to an action.
+ The VBA project will be loaded at a very late point of the document import
+ process, because it depends on an initialized core document model (e.g.
+ spreadsheet codenames). Some objects that want to attach a VBA macro to an
+ action (e.g. mouse click action for drawing shapes) are loaded long before
+ the VBA project. The drawback is that in most cases macros are specified
+ without module name, or the VBA project name is part of the macro name.
+ In the former case, all code modules have to be scanned for the macro to be
+ able to create a valid script URL.
+
+ The import code will register these requests to attach a VBA macro with an
+ instance of a class derived from this base class. The derived class will
+ store all information needed to finally attach the macro to the action,
+ once the VBA project has been imported.
+ */
+class VbaMacroAttacherBase
+{
+public:
+ explicit VbaMacroAttacherBase( const ::rtl::OUString& rMacroName );
+ virtual ~VbaMacroAttacherBase();
+
+ /** Resolves the internal macro name to the related macro URL, and attaches
+ the macro to the object. */
+ void resolveAndAttachMacro(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::script::vba::XVBAMacroResolver >& rxResolver );
+
+private:
+ /** Called after the VBA project has been imported. Derived classes will
+ attach the passed script to the object represented by this instance. */
+ virtual void attachMacro( const ::rtl::OUString& rScriptUrl ) = 0;
+
+private:
+ ::rtl::OUString maMacroName;
+};
+
+typedef ::boost::shared_ptr< VbaMacroAttacherBase > VbaMacroAttacherRef;
+
+// ============================================================================
+
class OOX_DLLPUBLIC VbaProject : public VbaFilterConfig
{
public:
explicit VbaProject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const ::rtl::OUString& rConfigCompName );
virtual ~VbaProject();
@@ -87,6 +131,10 @@ public:
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
+ /** Registers a macro atatcher object. For details, see description of the
+ VbaMacroAttacherBase class. */
+ void registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher );
+
/** Returns true, if the document contains at least one code module. */
bool hasModules() const;
/** Returns true, if the document contains the specified code module. */
@@ -101,8 +149,6 @@ protected:
/** Registers a dummy module that will be created when the VBA project is
imported. */
void addDummyModule( const ::rtl::OUString& rName, sal_Int32 nType );
- /** Creates all dummy modules in the document. */
- void createDummyModules();
/** Called when the import process of the VBA project has been started. */
virtual void prepareImport();
@@ -131,22 +177,28 @@ private:
StorageBase& rVbaPrjStrg,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr );
+
+ /** Attaches VBA macros to objects registered via registerMacroAttacher(). */
+ void attachMacros();
+
/** Copies the entire VBA project storage to the passed document model. */
void copyStorage( StorageBase& rVbaPrjStrg );
private:
+ typedef RefVector< VbaMacroAttacherBase > MacroAttacherVector;
typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxGlobalFactory; /// Global service factory.
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxCompContext; /// Component context with service manager.
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
mxDocModel; /// Document model used to import/export the VBA project.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxBasicLib; /// The Basic library of the document used for import.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxDialogLib; /// The dialog library of the document used for import.
+ MacroAttacherVector maMacroAttachers; /// Objects that want to attach a VBA macro to an action.
DummyModuleMap maDummyModules; /// Additional empty modules created on import.
- const ::rtl::OUString maLibName; /// Name for Basic and dialog library used for import.
+ ::rtl::OUString maPrjName; /// Name of the VBA project.
};
// ============================================================================
diff --git a/oox/source/helper/recordinputstream.cxx b/oox/inc/oox/ole/vbaprojectfilter.hxx
index 617e7f95876e..c8a0a1b0ce74 100644..100755
--- a/oox/source/helper/recordinputstream.cxx
+++ b/oox/inc/oox/ole/vbaprojectfilter.hxx
@@ -25,47 +25,52 @@
*
************************************************************************/
-#include "oox/helper/recordinputstream.hxx"
-#include <vector>
-#include <string.h>
+#ifndef OOX_OLE_VBAPROJECTFILTER_HXX
+#define OOX_OLE_VBAPROJECTFILTER_HXX
-using ::rtl::OUString;
+#include "oox/core/binaryfilterbase.hxx"
namespace oox {
+namespace ole {
// ============================================================================
-RecordInputStream::RecordInputStream( const StreamDataSequence& rData ) :
- SequenceInputStream( rData )
+class VbaProjectFilterBase : public ::oox::core::BinaryFilterBase
{
-}
+public:
+ explicit VbaProjectFilterBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::rtl::OUString& rAppName,
+ const ::rtl::OUString& rStorageName )
+ throw( ::com::sun::star::uno::RuntimeException );
-OUString RecordInputStream::readString( bool b32BitLen )
+ virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
+
+private:
+ virtual VbaProject* implCreateVbaProject() const;
+
+private:
+ ::rtl::OUString maAppName;
+ ::rtl::OUString maStorageName;
+};
+
+// ============================================================================
+
+class WordVbaProjectFilter : public VbaProjectFilterBase
{
- OUString aString;
- if( !isEof() )
- {
- sal_Int32 nCharCount = b32BitLen ? readValue< sal_Int32 >() : readValue< sal_Int16 >();
- // string length -1 is often used to indicate a missing string
- OSL_ENSURE( !isEof() && (nCharCount >= -1), "RecordInputStream::readString - invalid string length" );
- if( !isEof() && (nCharCount > 0) )
- {
- ::std::vector< sal_Unicode > aBuffer;
- aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) );
- for( sal_Int32 nCharIdx = 0; !isEof() && (nCharIdx < nCharCount); ++nCharIdx )
- {
- sal_uInt16 nChar;
- readValue( nChar );
- aBuffer.push_back( static_cast< sal_Unicode >( nChar ) );
- }
- aBuffer.push_back( 0 );
- aString = OUString( &aBuffer.front() );
- }
- }
- return aString;
-}
+public:
+ explicit WordVbaProjectFilter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ virtual ::rtl::OUString implGetImplementationName() const;
+};
// ============================================================================
+} // namespace ole
} // namespace oox
+#endif
diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx
index c4ee29447c64..158584eeb3f5 100644
--- a/oox/inc/oox/ppt/pptimport.hxx
+++ b/oox/inc/oox/ppt/pptimport.hxx
@@ -34,7 +34,6 @@
#include <oox/drawingml/theme.hxx>
#include "oox/ppt/presentationfragmenthandler.hxx"
#include "oox/ppt/slidepersist.hxx"
-#include "tokens.hxx"
#include <vector>
#include <map>
@@ -46,7 +45,8 @@ class PowerPointImport : public oox::core::XmlFilterBase
{
public:
- PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr );
+ PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~PowerPointImport();
// from FilterBase
@@ -68,6 +68,7 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
private:
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 3376e5bb1ace..be200859c6e6 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -48,7 +48,7 @@ public:
using oox::drawingml::Shape::addShape;
// addShape is creating and inserting the corresponding XShape.
void addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rPersist,
const oox::drawingml::Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx
index bcb0c5803d61..a6561772ed3a 100644
--- a/oox/inc/oox/ppt/slidepersist.hxx
+++ b/oox/inc/oox/ppt/slidepersist.hxx
@@ -28,7 +28,6 @@
#ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX
#define OOX_POWERPOINT_SLIDEPERSIST_HXX
-#include "tokens.hxx"
#include <boost/shared_ptr.hpp>
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/theme.hxx"
@@ -112,7 +111,7 @@ public:
oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
- void createXShapes( const oox::core::XmlFilterBase& rFilterBase );
+ void createXShapes( oox::core::XmlFilterBase& rFilterBase );
void createBackground( const oox::core::XmlFilterBase& rFilterBase );
void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
diff --git a/oox/source/token/propertylist.cxx b/oox/inc/oox/token/namespacemap.hxx
index 0ffc902fcdc0..e4daa18f6b56 100644..100755
--- a/oox/source/token/propertylist.cxx
+++ b/oox/inc/oox/token/namespacemap.hxx
@@ -25,32 +25,25 @@
*
************************************************************************/
-#include "oox/token/propertylist.hxx"
-#include "properties.hxx"
+#ifndef OOX_TOKEN_NAMESPACEMAP_HXX
+#define OOX_TOKEN_NAMESPACEMAP_HXX
-namespace oox {
-
-namespace {
+#include <map>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
-// include auto-generated property name lists
-#include "propertywords.inc"
-
-} // namespace
+namespace oox {
// ============================================================================
-PropertyList::PropertyList()
-{
- reserve( static_cast< size_t >( PROP_COUNT ) );
- for( sal_Int32 nIdx = 0; nIdx < PROP_COUNT; ++nIdx )
- push_back( ::rtl::OUString::createFromAscii( propertywordlist[ nIdx ] ) );
-}
+/** A map that contains all XML namespace URLs used in the filters. */
+struct NamespaceMap : public ::std::map< sal_Int32, ::rtl::OUString > { NamespaceMap(); };
-PropertyList::~PropertyList()
-{
-}
+/** Thread-save singleton of a map of all supported XML namespace URLs. */
+struct StaticNamespaceMap : public ::rtl::Static< NamespaceMap, StaticNamespaceMap > {};
// ============================================================================
} // namespace oox
+#endif
diff --git a/oox/inc/oox/token/propertylist.hxx b/oox/inc/oox/token/propertynames.hxx
index 5f75b13e10c4..5f94e74c2b96 100644
--- a/oox/inc/oox/token/propertylist.hxx
+++ b/oox/inc/oox/token/propertynames.hxx
@@ -25,10 +25,11 @@
*
************************************************************************/
-#ifndef OOX_TOKEN_PROPERTYLIST_HXX
-#define OOX_TOKEN_PROPERTYLIST_HXX
+#ifndef OOX_TOKEN_PROPERTYNAMES_HXX
+#define OOX_TOKEN_PROPERTYNAMES_HXX
#include <vector>
+#include <rtl/instance.hxx>
#include <rtl/ustring.hxx>
namespace oox {
@@ -36,15 +37,13 @@ namespace oox {
// ============================================================================
/** A vector that contains all predefined property names used in the filters. */
-struct PropertyList : public ::std::vector< ::rtl::OUString >
-{
- explicit PropertyList();
- ~PropertyList();
-};
+struct PropertyNameVector : public ::std::vector< ::rtl::OUString > { PropertyNameVector(); };
+
+/** Thread-save singleton of a vector of all supported property names. */
+struct StaticPropertyNameVector : public ::rtl::Static< PropertyNameVector, StaticPropertyNameVector > {};
// ============================================================================
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/token/tokenmap.hxx b/oox/inc/oox/token/tokenmap.hxx
index 108feee9a2e8..b197c491ac51 100644
--- a/oox/inc/oox/token/tokenmap.hxx
+++ b/oox/inc/oox/token/tokenmap.hxx
@@ -66,7 +66,6 @@ private:
typedef ::std::vector< TokenName > TokenNameVector;
TokenNameVector maTokenNames;
-
};
// ============================================================================
diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx
index c2f8432dca6f..0d87dae3138b 100644
--- a/oox/inc/oox/vml/vmldrawing.hxx
+++ b/oox/inc/oox/vml/vmldrawing.hxx
@@ -30,6 +30,7 @@
#include <map>
#include <memory>
+#include <vector>
#include "oox/ole/oleobjecthelper.hxx"
namespace com { namespace sun { namespace star {
@@ -37,17 +38,21 @@ namespace com { namespace sun { namespace star {
namespace awt { class XControlModel; }
namespace drawing { class XDrawPage; }
namespace drawing { class XShape; }
+ namespace drawing { class XShapes; }
} } }
-namespace oox { namespace core { class XmlFilterBase; } }
-namespace oox { namespace ole { class EmbeddedForm; } }
+namespace oox {
+ namespace core { class XmlFilterBase; }
+ namespace ole { class EmbeddedControl; }
+ namespace ole { class EmbeddedForm; }
+}
namespace oox {
namespace vml {
class ShapeBase;
class ShapeContainer;
-struct ShapeClientData;
+struct ClientData;
// ============================================================================
@@ -114,6 +119,9 @@ public:
/** Returns the form object used to process ActiveX form controls. */
::oox::ole::EmbeddedForm& getControlForm() const;
+ /** Registers a block of shape identifiers reserved by this drawing. Block
+ size is 1024, shape identifiers are one-based (block 1 => 1025-2048). */
+ void registerBlockId( sal_Int32 nBlockId );
/** Registers the passed embedded OLE object. The related shape will then
load the OLE object data from the specified fragment. */
void registerOleObject( const OleObjectInfo& rOleObject );
@@ -125,36 +133,65 @@ public:
void finalizeFragmentImport();
/** Creates and inserts all UNO shapes into the passed container. The virtual
- function notifyShapeInserted() will be called for each new shape. */
+ function notifyXShapeInserted() will be called for each new shape. */
void convertAndInsert() const;
+ /** Returns the local shape index from the passed global shape identifier. */
+ sal_Int32 getLocalShapeIndex( const ::rtl::OUString& rShapeId ) const;
/** Returns the registered info structure for an OLE object, if extant. */
const OleObjectInfo* getOleObjectInfo( const ::rtl::OUString& rShapeId ) const;
/** Returns the registered info structure for a form control, if extant. */
const ControlInfo* getControlInfo( const ::rtl::OUString& rShapeId ) const;
+ /** Creates a new UNO shape object, inserts it into the passed UNO shape
+ container, and sets the shape position and size. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXShape(
+ const ::rtl::OUString& rService,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Creates a new UNO shape object for a form control, inserts the control
+ model into the form, and the shape into the passed UNO shape container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXControlShape(
+ const ::oox::ole::EmbeddedControl& rControl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ sal_Int32& rnCtrlIndex ) const;
+
/** Derived classes may disable conversion of specific shapes. */
virtual bool isShapeSupported( const ShapeBase& rShape ) const;
+ /** Derived classes may return additional base names for automatic shape
+ name creation. */
+ virtual ::rtl::OUString getShapeBaseName( const ShapeBase& rShape ) const;
+
/** Derived classes may calculate the shape rectangle from a non-standard
anchor information string. */
- virtual bool convertShapeClientAnchor(
+ virtual bool convertClientAnchor(
::com::sun::star::awt::Rectangle& orShapeRect,
const ::rtl::OUString& rShapeAnchor ) const;
- /** Derived classes may convert additional form control properties from the
- passed VML shape client data. */
- virtual void convertControlClientData(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
- const ShapeClientData& rClientData ) const;
-
- /** Derived classes may want to know that a shape has been inserted. Will
- be called from the convertAndInsert() implementation. */
- virtual void notifyShapeInserted(
+ /** Derived classes create a UNO shape according to the passed shape model.
+ Called for shape models that specify being under host control. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertClientXShape(
+ const ShapeBase& rShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Derived classes may want to know that a UNO shape has been inserted.
+ Will be called from the convertAndInsert() implementation.
+ @param bGroupChild True = inserted into a group shape,
+ false = inserted directly into this drawing. */
+ virtual void notifyXShapeInserted(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ const ShapeBase& rShape, bool bGroupChild );
private:
+ typedef ::std::vector< sal_Int32 > BlockIdVector;
typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr;
typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr;
typedef ::std::map< ::rtl::OUString, OleObjectInfo > OleObjectInfoMap;
@@ -163,7 +200,8 @@ private:
::oox::core::XmlFilterBase& mrFilter; /// Filter object that imports/exports the VML drawing.
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
mxDrawPage; /// UNO draw page used to insert the shapes.
- mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process ActiveX controls.
+ mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process embedded controls.
+ mutable BlockIdVector maBlockIds; /// Block identifiers used by this drawing.
ShapeContainerPtr mxShapes; /// All shapes and shape templates.
OleObjectInfoMap maOleObjects; /// Info about all embedded OLE objects, mapped by shape id.
ControlInfoMap maControls; /// Info about all embedded form controls, mapped by control name.
@@ -176,4 +214,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmldrawingfragment.hxx b/oox/inc/oox/vml/vmldrawingfragment.hxx
index e0ffcd9c5203..0c961db1aabf 100644
--- a/oox/inc/oox/vml/vmldrawingfragment.hxx
+++ b/oox/inc/oox/vml/vmldrawingfragment.hxx
@@ -63,4 +63,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx
index db67d7a85af4..934be61e5a65 100644
--- a/oox/inc/oox/vml/vmlformatting.hxx
+++ b/oox/inc/oox/vml/vmlformatting.hxx
@@ -34,6 +34,7 @@ namespace oox {
class GraphicHelper;
class ModelObjectHelper;
class PropertyMap;
+ namespace drawingml { class Color; }
}
namespace oox {
@@ -112,6 +113,35 @@ public:
bool bPixelX,
bool bDefaultAsPixel );
+ /** Converts VML color attributes to a DrawingML color.
+
+ @param roVmlColor The VML string representation of the color. If
+ existing, this can be a 3-digit or 6-digit hexadecimal RGB value
+ with leading '#' character, a predefined color name (e.g. 'black',
+ 'red', etc.), the index into an application defined color palette
+ in brackets with leading color name (e.g. 'red [9]' or
+ 'windowColor [64]'), or a color modifier used in one-color
+ gradients (e.g. 'fill darken(128)' or 'fill lighten(0)').
+
+ @param roVmlOpacity The opacity of the color. If existing, this should
+ be a floating-point value in the range [0.0;1.0].
+
+ @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor
+ is empty.
+
+ @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT,
+ specifies the color to be used to resolve the color modifiers used
+ in one-color gradients.
+
+ @return The resulting DrawingML color.
+ */
+ static ::oox::drawingml::Color decodeColor(
+ const GraphicHelper& rGraphicHelper,
+ const OptValue< ::rtl::OUString >& roVmlColor,
+ const OptValue< double >& roVmlOpacity,
+ sal_Int32 nDefaultRgb,
+ sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT );
+
private:
ConversionHelper();
~ConversionHelper();
@@ -187,4 +217,3 @@ struct FillModel
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx
index 311fc17df960..a425425cd0cb 100644
--- a/oox/inc/oox/vml/vmlinputstream.hxx
+++ b/oox/inc/oox/vml/vmlinputstream.hxx
@@ -66,4 +66,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 7c770df28477..ee95c6b61e29 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -45,6 +45,19 @@ namespace vml {
class Drawing;
struct ShapeParentAnchor;
class ShapeContainer;
+class TextBox;
+
+// ============================================================================
+
+const sal_Int32 VML_CLIENTDATA_UNCHECKED = 0;
+const sal_Int32 VML_CLIENTDATA_CHECKED = 1;
+const sal_Int32 VML_CLIENTDATA_MIXED = 2;
+
+const sal_Int32 VML_CLIENTDATA_TEXT = 0;
+const sal_Int32 VML_CLIENTDATA_INTEGER = 1;
+const sal_Int32 VML_CLIENTDATA_NUMBER = 2;
+const sal_Int32 VML_CLIENTDATA_REFERENCE = 3;
+const sal_Int32 VML_CLIENTDATA_FORMULA = 4;
// ============================================================================
@@ -52,7 +65,7 @@ class ShapeContainer;
struct ShapeTypeModel
{
::rtl::OUString maShapeId; /// Unique identifier of the shape.
- ::rtl::OUString maName; /// Name of the shape, if present.
+ ::rtl::OUString maShapeName; /// Name of the shape, if present.
OptValue< sal_Int32 > moShapeType; /// Builtin shape type identifier.
OptValue< Int32Pair > moCoordPos; /// Top-left position of coordinate system for children scaling.
@@ -93,6 +106,8 @@ public:
/** Returns the shape identifier (which is unique through the containing drawing). */
inline const ::rtl::OUString& getShapeId() const { return maTypeModel.maShapeId; }
+ /** Returns the application defined shape type. */
+ sal_Int32 getShapeType() const;
/** Returns the fragment path to the embedded graphic used by this shape. */
::rtl::OUString getGraphicPath() const;
@@ -116,19 +131,39 @@ protected:
// ============================================================================
/** Excel specific shape client data (such as cell anchor). */
-struct ShapeClientData
+struct ClientData
{
::rtl::OUString maAnchor; /// Cell anchor as comma-separated string.
- ::rtl::OUString maPictureLink; /// Target cell range of picture links.
- ::rtl::OUString maLinkedCell; /// Link to value cell associated to the control.
- ::rtl::OUString maSourceRange; /// Link to cell range used as data source for the control.
+ ::rtl::OUString maFmlaMacro; /// Link to macro associated to the control.
+ ::rtl::OUString maFmlaPict; /// Target cell range of picture links.
+ ::rtl::OUString maFmlaLink; /// Link to value cell associated to the control.
+ ::rtl::OUString maFmlaRange; /// Link to cell range used as data source for the control.
+ ::rtl::OUString maFmlaGroup; /// Link to value cell associated to a group of option buttons.
sal_Int32 mnObjType; /// Type of the shape.
+ sal_Int32 mnTextHAlign; /// Horizontal text alignment.
+ sal_Int32 mnTextVAlign; /// Vertical text alignment.
sal_Int32 mnCol; /// Column index for spreadsheet cell note.
sal_Int32 mnRow; /// Row index for spreadsheet cell note.
+ sal_Int32 mnChecked; /// State for checkboxes and option buttons.
+ sal_Int32 mnDropStyle; /// Drop down box style (read-only or editable).
+ sal_Int32 mnDropLines; /// Number of lines in drop down box.
+ sal_Int32 mnVal; /// Current value of spin buttons and scroll bars.
+ sal_Int32 mnMin; /// Minimum value of spin buttons and scroll bars.
+ sal_Int32 mnMax; /// Maximum value of spin buttons and scroll bars.
+ sal_Int32 mnInc; /// Small increment of spin buttons and scroll bars.
+ sal_Int32 mnPage; /// Large increment of spin buttons and scroll bars.
+ sal_Int32 mnSelType; /// Listbox selection type.
+ sal_Int32 mnVTEdit; /// Data type of the textbox.
bool mbPrintObject; /// True = print the object.
bool mbVisible; /// True = cell note is visible.
-
- explicit ShapeClientData();
+ bool mbDde; /// True = object is linked through DDE.
+ bool mbNo3D; /// True = flat style, false = 3D style.
+ bool mbNo3D2; /// True = flat style, false = 3D style (listboxes and dropdowns).
+ bool mbMultiLine; /// True = textbox allows line breaks.
+ bool mbVScroll; /// True = textbox has a vertical scrollbar.
+ bool mbSecretEdit; /// True = textbox is a password edit field.
+
+ explicit ClientData();
};
// ----------------------------------------------------------------------------
@@ -136,16 +171,21 @@ struct ShapeClientData
struct ShapeModel
{
typedef ::std::vector< ::com::sun::star::awt::Point > PointVector;
- typedef ::std::auto_ptr< ShapeClientData > ShapeClientDataPtr;
+ typedef ::std::auto_ptr< TextBox > TextBoxPtr;
+ typedef ::std::auto_ptr< ClientData > ClientDataPtr;
::rtl::OUString maType; /// Shape template with default properties.
PointVector maPoints; /// Points for the polyline shape.
- ShapeClientDataPtr mxClientData; /// Excel specific shape client data.
+ TextBoxPtr mxTextBox; /// Text contents and properties.
+ ClientDataPtr mxClientData; /// Excel specific client data.
explicit ShapeModel();
+ ~ShapeModel();
+ /** Creates and returns a new shape textbox structure. */
+ TextBox& createTextBox();
/** Creates and returns a new shape client data structure. */
- ShapeClientData& createClientData();
+ ClientData& createClientData();
};
// ----------------------------------------------------------------------------
@@ -160,9 +200,17 @@ public:
/** Returns read access to the shape model structure. */
inline const ShapeModel& getShapeModel() const { return maShapeModel; }
+ /** Returns read access to the shape textbox. */
+ inline const TextBox* getTextBox() const { return maShapeModel.mxTextBox.get(); }
+ /** Returns read access to the shape client data structure. */
+ inline const ClientData* getClientData() const { return maShapeModel.mxClientData.get(); }
+
/** Final processing after import of the drawing fragment. */
virtual void finalizeFragmentImport();
+ /** Returns the real shape name if existing, or a generated shape name. */
+ ::rtl::OUString getShapeName() const;
+
/** Returns the shape template with the passed identifier from the child shapes. */
virtual const ShapeType* getChildTypeById( const ::rtl::OUString& rShapeId ) const;
/** Returns the shape with the passed identifier from the child shapes. */
@@ -327,4 +375,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx
index a878fda2b74c..7b13763e0e40 100644
--- a/oox/inc/oox/vml/vmlshapecontainer.hxx
+++ b/oox/inc/oox/vml/vmlshapecontainer.hxx
@@ -29,7 +29,8 @@
#define OOX_VML_VMLSHAPECONTAINER_HXX
#include <com/sun/star/awt/Rectangle.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
namespace com { namespace sun { namespace star {
namespace drawing { class XShapes; }
@@ -59,6 +60,9 @@ public:
explicit ShapeContainer( Drawing& rDrawing );
~ShapeContainer();
+ /** Returns the drawing this shape container is part of. */
+ inline Drawing& getDrawing() { return mrDrawing; }
+
/** Creates and returns a new shape template object. */
ShapeType& createShapeType();
/** Creates and returns a new shape object of the specified type. */
@@ -136,4 +140,3 @@ const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx
index bda7d90f34e2..7236fe7fef2c 100644
--- a/oox/inc/oox/vml/vmlshapecontext.hxx
+++ b/oox/inc/oox/vml/vmlshapecontext.hxx
@@ -33,10 +33,12 @@
namespace oox {
namespace vml {
+class Drawing;
+
struct ShapeTypeModel;
class ShapeType;
-struct ShapeClientData;
+struct ClientData;
struct ShapeModel;
class ShapeBase;
class GroupShape;
@@ -45,20 +47,38 @@ class ShapeContainer;
// ============================================================================
-class ShapeClientDataContext : public ::oox::core::ContextHandler2
+class ShapeLayoutContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit ShapeLayoutContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ Drawing& rDrawing );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ Drawing& mrDrawing;
+};
+
+// ============================================================================
+
+class ClientDataContext : public ::oox::core::ContextHandler2
{
public:
- explicit ShapeClientDataContext(
+ explicit ClientDataContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeClientData& rClientData );
+ ClientData& rClientData,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
- ShapeClientData& mrClientData;
+ ClientData& mrClientData;
+ ::rtl::OUString maElementText;
};
// ============================================================================
@@ -69,9 +89,9 @@ public:
static ::oox::core::ContextHandlerRef
createShapeContext(
::oox::core::ContextHandler2Helper& rParent,
+ ShapeContainer& rShapes,
sal_Int32 nElement,
- const AttributeList& rAttribs,
- ShapeContainer& rShapes );
+ const AttributeList& rAttribs );
protected:
explicit ShapeContextBase( ::oox::core::ContextHandler2Helper& rParent );
@@ -84,8 +104,8 @@ class ShapeTypeContext : public ShapeContextBase
public:
explicit ShapeTypeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeType& rShapeType );
+ ShapeType& rShapeType,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -108,8 +128,8 @@ class ShapeContext : public ShapeTypeContext
public:
explicit ShapeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeBase& rShape );
+ ShapeBase& rShape,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -129,8 +149,8 @@ class GroupShapeContext : public ShapeContext
public:
explicit GroupShapeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- GroupShape& rShape );
+ GroupShape& rShape,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -145,4 +165,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx
new file mode 100755
index 000000000000..5aedaf86bc74
--- /dev/null
+++ b/oox/inc/oox/vml/vmltextbox.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * 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 OOX_VML_VMLTEXTBOX_HXX
+#define OOX_VML_VMLTEXTBOX_HXX
+
+#include <vector>
+#include <rtl/ustring.hxx>
+#include "oox/helper/helper.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+/** Font settings for a text portion in a textbox. */
+struct TextFontModel
+{
+ OptValue< ::rtl::OUString > moName; /// Font name.
+ OptValue< ::rtl::OUString > moColor; /// Font color, HTML encoded, sort of.
+ OptValue< sal_Int32 > monSize; /// Font size in twips.
+ OptValue< sal_Int32 > monUnderline; /// Single or double underline.
+ OptValue< sal_Int32 > monEscapement; /// Subscript or superscript.
+ OptValue< bool > mobBold;
+ OptValue< bool > mobItalic;
+ OptValue< bool > mobStrikeout;
+
+ explicit TextFontModel();
+};
+
+// ============================================================================
+
+/** A text portion in a textbox with the same formatting for all characters. */
+struct TextPortionModel
+{
+ TextFontModel maFont;
+ ::rtl::OUString maText;
+
+ explicit TextPortionModel( const TextFontModel& rFont, const ::rtl::OUString& rText );
+};
+
+// ============================================================================
+
+/** The textbox contains all text contents and properties. */
+class TextBox
+{
+public:
+ explicit TextBox();
+
+ /** Appends a new text portion to the textbox. */
+ void appendPortion( const TextFontModel& rFont, const ::rtl::OUString& rText );
+
+ /** Returns the current number of text portions. */
+ inline size_t getPortionCount() const { return maPortions.size(); }
+ /** Returns the font settings of the first text portion. */
+ const TextFontModel* getFirstFont() const;
+ /** Returns the entire text of all text portions. */
+ ::rtl::OUString getText() const;
+
+private:
+ typedef ::std::vector< TextPortionModel > PortionVector;
+
+ PortionVector maPortions;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/vml/vmltextboxcontext.hxx b/oox/inc/oox/vml/vmltextboxcontext.hxx
new file mode 100755
index 000000000000..1dc8832f9cc4
--- /dev/null
+++ b/oox/inc/oox/vml/vmltextboxcontext.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * 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 OOX_VML_VMLTEXTBOXCONTEXT_HXX
+#define OOX_VML_VMLTEXTBOXCONTEXT_HXX
+
+#include "oox/core/contexthandler2.hxx"
+#include "oox/vml/vmltextbox.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+class TextPortionContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextPortionContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const TextFontModel& rParentFont,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
+
+private:
+ TextBox& mrTextBox;
+ TextFontModel maFont;
+ size_t mnInitialPortions;
+};
+
+// ============================================================================
+
+class TextBoxContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextBoxContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ TextBox& mrTextBox;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx
index c11bd31bbf22..11b5e74ccd5c 100644
--- a/oox/inc/oox/xls/addressconverter.hxx
+++ b/oox/inc/oox/xls/addressconverter.hxx
@@ -69,7 +69,7 @@ struct BinAddress
inline void set( sal_Int32 nCol, sal_Int32 nRow ) { mnCol = nCol; mnRow = nRow; }
inline void set( const ::com::sun::star::table::CellAddress& rAddr ) { mnCol = rAddr.Column; mnRow = rAddr.Row; }
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
};
@@ -86,7 +86,7 @@ inline bool operator<( const BinAddress& rL, const BinAddress& rR )
return (rL.mnCol < rR.mnCol) || ((rL.mnCol == rR.mnCol) && (rL.mnRow < rR.mnRow));
}
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinAddress& orPos )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinAddress& orPos )
{
orPos.read( rStrm );
return rStrm;
@@ -134,7 +134,7 @@ struct BinRange
inline sal_Int32 getRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
bool contains( const BinAddress& rAddr ) const;
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
};
@@ -151,7 +151,7 @@ inline bool operator<( const BinRange& rL, const BinRange& rR )
return (rL.maFirst < rR.maFirst) || ((rL.maFirst == rR.maFirst) && (rL.maLast < rR.maLast));
}
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRange& orRange )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRange& orRange )
{
orRange.read( rStrm );
return rStrm;
@@ -179,7 +179,7 @@ public:
BinRange getEnclosingRange() const;
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
void writeSubList( BiffOutputStream& rStrm,
@@ -188,7 +188,7 @@ public:
// ----------------------------------------------------------------------------
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRangeList& orRanges )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRangeList& orRanges )
{
orRanges.read( rStrm );
return rStrm;
@@ -221,7 +221,7 @@ enum BiffTargetType
// ============================================================================
// ============================================================================
-/** Converter for cell addresses and cell ranges for OOX and BIFF filters.
+/** Converter for cell addresses and cell ranges for OOXML and BIFF filters.
*/
class AddressConverter : public WorkbookHelper
{
@@ -689,4 +689,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx
new file mode 100755
index 000000000000..ddf083c2ea98
--- /dev/null
+++ b/oox/inc/oox/xls/autofilterbuffer.hxx
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_AUTOFILTERBUFFER_HXX
+#define OOX_XLS_AUTOFILTERBUFFER_HXX
+
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include "oox/helper/refvector.hxx"
+#include "oox/xls/workbookhelper.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace sheet { struct TableFilterField2; }
+ namespace sheet { class XDatabaseRange; }
+ namespace sheet { class XSheetFilterDescriptor2; }
+} } }
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+/** Contains UNO API filter settings for a column in a filtered range. */
+struct ApiFilterSettings
+{
+ typedef ::std::vector< ::com::sun::star::sheet::TableFilterField2 > FilterFieldVector;
+
+ FilterFieldVector maFilterFields; /// List of UNO API filter settings.
+ OptValue< bool > mobNeedsRegExp; /// If set, requires regular expressions to be enabled/disabled.
+
+ explicit ApiFilterSettings();
+
+ void appendField( bool bAnd, sal_Int32 nOperator, double fValue );
+ void appendField( bool bAnd, sal_Int32 nOperator, const ::rtl::OUString& rValue );
+};
+
+// ============================================================================
+
+/** Base class for specific filter settings for a column in a filtered range.
+ */
+class FilterSettingsBase : public WorkbookHelper
+{
+public:
+ explicit FilterSettingsBase( const WorkbookHelper& rHelper );
+
+ /** Derived classes import filter settings from the passed attribute list. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Derived classes import filter settings from the passed record. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Derived classes import filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Derived classes return converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+};
+
+typedef ::boost::shared_ptr< FilterSettingsBase > FilterSettingsRef;
+
+// ============================================================================
+
+/** Settings for a discrete filter, specifying a list of values to be shown in
+ the filtered range.
+ */
+class DiscreteFilter : public FilterSettingsBase
+{
+public:
+ explicit DiscreteFilter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ typedef ::std::vector< ::rtl::OUString > FilterValueVector;
+
+ FilterValueVector maValues;
+ sal_Int32 mnCalendarType;
+ bool mbShowBlank;
+};
+
+// ============================================================================
+
+/** Settings for a top-10 filter. */
+class Top10Filter : public FilterSettingsBase
+{
+public:
+ explicit Top10Filter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Imports filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ double mfValue; /// Number of items or percentage.
+ bool mbTop; /// True = show top (greatest) items/percentage.
+ bool mbPercent; /// True = percentage, false = number of items.
+};
+
+// ============================================================================
+
+/** A filter criterion for a custom filter. */
+struct FilterCriterionModel
+{
+ ::com::sun::star::uno::Any maValue; /// Comparison operand.
+ sal_Int32 mnOperator; /// Comparison operator.
+ sal_uInt8 mnDataType; /// Operand data type (BIFF only).
+ sal_uInt8 mnStrLen; /// Length of string operand (BIFF5-BIFF8 only).
+
+ explicit FilterCriterionModel();
+
+ /** Sets the passed BIFF operator constant. */
+ void setBiffOperator( sal_uInt8 nOperator );
+
+ /** Imports the criterion model from the passed BIFF12 stream. */
+ void readBiffData( SequenceInputStream& rStrm );
+ /** Imports the initial criterion data from the passed BIFF5/BIFF8 stream. */
+ void readBiffData( BiffInputStream& rStrm );
+ /** Imports the trailing string data from the passed BIFF5/BIFF8 stream. */
+ void readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc );
+};
+
+// ----------------------------------------------------------------------------
+
+/** Settings for a custom filter, specifying one or two comparison operators
+ associated with some values.
+ */
+class CustomFilter : public FilterSettingsBase
+{
+public:
+ explicit CustomFilter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Imports filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ /** Apeends the passed filter criteriom, if it contains valid settings. */
+ void appendCriterion( const FilterCriterionModel& rCriterion );
+
+private:
+ typedef ::std::vector< FilterCriterionModel > FilterCriterionVector;
+
+ FilterCriterionVector maCriteria;
+ bool mbAnd;
+};
+
+// ============================================================================
+
+/** A column in a filtered range. Contains an object with specific filter
+ settings for the cells in the column.
+ */
+class FilterColumn : public WorkbookHelper
+{
+public:
+ explicit FilterColumn( const WorkbookHelper& rHelper );
+
+ /** Imports auto filter column settings from the filterColumn element. */
+ void importFilterColumn( const AttributeList& rAttribs );
+ /** Imports auto filter column settings from the FILTERCOLUMN record. */
+ void importFilterColumn( SequenceInputStream& rStrm );
+ /** Imports auto filter column settings from the FILTERCOLUMN record. */
+ void importFilterColumn( BiffInputStream& rStrm );
+
+ /** Creates and returns the specified filter settings object. */
+ template< typename FilterSettingsType >
+ inline FilterSettingsBase& createFilterSettings()
+ { mxSettings.reset( new FilterSettingsType( *this ) ); return *mxSettings; }
+
+ /** Returns the index of the column in the filtered range this object is related to. */
+ inline sal_Int32 getColumnId() const { return mnColId; }
+
+ /** Returns converted UNO API filter settings representing all filter
+ settings of this column. */
+ ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ FilterSettingsRef mxSettings;
+ sal_Int32 mnColId;
+ bool mbHiddenButton;
+ bool mbShowButton;
+};
+
+// ============================================================================
+
+class AutoFilter : public WorkbookHelper
+{
+public:
+ explicit AutoFilter( const WorkbookHelper& rHelper );
+
+ /** Imports auto filter settings from the autoFilter element. */
+ void importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet );
+ /** Imports auto filter settings from the AUTOFILTER record. */
+ void importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet );
+
+ /** Creates a new auto filter column and stores it internally. */
+ FilterColumn& createFilterColumn();
+
+ /** Applies the filter to the passed filter descriptor. */
+ void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc );
+
+private:
+ typedef RefVector< FilterColumn > FilterColumnVector;
+
+ FilterColumnVector maFilterColumns;
+ ::com::sun::star::table::CellRangeAddress maRange;
+};
+
+// ============================================================================
+
+class AutoFilterBuffer : public WorkbookHelper
+{
+public:
+ explicit AutoFilterBuffer( const WorkbookHelper& rHelper );
+
+ /** Creates a new auto filter and stores it internally. */
+ AutoFilter& createAutoFilter();
+
+ /** Applies filter settings to a new database range object (used for sheet
+ autofilter or advanced filter as specified by built-in defined names). */
+ void finalizeImport( sal_Int16 nSheet );
+
+ /** Applies the filters to the passed database range object.
+ @return True = this buffer contains valid auto filter settings. */
+ bool finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange >& rxDatabaseRange );
+
+private:
+ /** Returns the auto filter object used to perform auto filtering. */
+ AutoFilter* getActiveAutoFilter();
+
+private:
+ typedef RefVector< AutoFilter > AutoFilterVector;
+ AutoFilterVector maAutoFilters;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx
index ccef6972e871..13508bbf5e63 100644
--- a/oox/inc/oox/xls/autofiltercontext.hxx
+++ b/oox/inc/oox/xls/autofiltercontext.hxx
@@ -28,126 +28,82 @@
#ifndef OOX_XLS_AUTOFILTERCONTEXT_HXX
#define OOX_XLS_AUTOFILTERCONTEXT_HXX
-#define USE_SC_MULTI_STRING_FILTER_PATCH 0
-
#include "oox/xls/excelhandlers.hxx"
-#include <com/sun/star/table/CellRangeAddress.hpp>
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
-#include <com/sun/star/sheet/TableFilterFieldBase.hpp>
-#else
-#include <com/sun/star/sheet/TableFilterField.hpp>
-#endif
-
-#include <boost/shared_ptr.hpp>
-#include <list>
-
-namespace com { namespace sun { namespace star { namespace sheet {
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- struct TableFilterFieldBase;
-#else
- struct TableFilterField;
-#endif
- struct TableFilterFieldMultiString;
-}}}}
namespace oox {
namespace xls {
+class AutoFilter;
+class FilterColumn;
+class FilterSettingsBase;
+
// ============================================================================
-struct FilterFieldItem
+class FilterSettingsContext : public WorksheetContextBase
{
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterFieldBase > TableFilterFieldRef;
-#else
- typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterField > TableFilterFieldRef;
-#endif
+public:
+ explicit FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings );
- enum Type { NORMAL, MULTI_STRING };
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
- TableFilterFieldRef mpField;
- Type meType;
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
- FilterFieldItem();
- FilterFieldItem(Type eType);
+private:
+ FilterSettingsBase& mrFilterSettings;
};
// ============================================================================
-class OoxAutoFilterContext : public OoxWorksheetContextBase
+class FilterColumnContext : public WorksheetContextBase
{
public:
- explicit OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment );
+ explicit FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
-private:
- /** Initializes data members to prepare for autofilter parsing. Call this
- method when a new autofilter context starts. */
- void initialize();
-
- /** Commits the imported autofilter data to Calc. */
- void setAutoFilter();
-
- /** Check if the shown blank bit is on, if so, add show blank filter to the
- list. */
- void maybeShowBlank();
-
- /** Packs the collected filter names into a single regex string. */
- void setFilterNames();
- void importAutoFilter( const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
- void importFilterColumn( const AttributeList& rAttribs );
-
- void importTop10( const AttributeList& rAttribs );
-
- /** Be sure to check for its 'and' attribute when there are two
- customFilter's. If the attribute is not given, assume OR. */
- void importCustomFilters( const AttributeList& rAttribs );
+private:
+ FilterColumn& mrFilterColumn;
+};
- /** Imports custumFilter element. Note that the standard specifies there
- can be at most two custom filters specified, but no more than two. When
- there are two custom filters, then their relationship (AND or OR) must
- be specified by the parent element <customFilters>. */
- void importCustomFilter( const AttributeList& rAttribs );
+// ============================================================================
- void importFilters( const AttributeList& rAttribs );
+class AutoFilterContext : public WorksheetContextBase
+{
+public:
+ explicit AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter );
- void importFilter( const AttributeList& rAttribs );
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
- void importDynamicFilter( const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > XCellRef;
-
- ::std::list< FilterFieldItem > maFields;
-
- ::std::list< ::rtl::OUString > maFilterNames;
- ::com::sun::star::table::CellRangeAddress maAutoFilterRange;
- sal_Int32 mnCurColID;
+ AutoFilter& mrAutoFilter;
+};
- /** If this is false (i.e. the given cell range address is not valid), then
- don't do anything. */
- bool mbValidAddress:1;
+// ============================================================================
- /** We use regex to compensate for Calc's lack of filtering by individual
- names (i.e. <filter> tag). */
- bool mbUseRegex:1;
+class BiffAutoFilterContext : public BiffWorksheetContextBase
+{
+public:
+ explicit BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter );
- /** The <filters> tag may have a 'blank' attribute when the blank values
- need to be shown. This flag stores that information. */
- bool mbShowBlank:1;
+protected:
+ /** Imports all records related to the current auto filter. */
+ virtual void importRecord( BiffInputStream& rStrm );
- /** true if FilterConnection_AND, or false if FilterConnection_OR. This
- flag is used to store the relationship of paired customFilter's. */
- bool mbConnectionAnd:1;
+private:
+ AutoFilter& mrAutoFilter;
};
// ============================================================================
diff --git a/oox/inc/oox/xls/biffcodec.hxx b/oox/inc/oox/xls/biffcodec.hxx
index c1c040de095b..9b9157c7e494 100644
--- a/oox/inc/oox/xls/biffcodec.hxx
+++ b/oox/inc/oox/xls/biffcodec.hxx
@@ -185,4 +185,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/biffdetector.hxx b/oox/inc/oox/xls/biffdetector.hxx
index 9ce5d19af3fe..df372c76d7cc 100644
--- a/oox/inc/oox/xls/biffdetector.hxx
+++ b/oox/inc/oox/xls/biffdetector.hxx
@@ -28,15 +28,15 @@
#ifndef OOX_XLS_BIFFDETECTOR_HXX
#define OOX_XLS_BIFFDETECTOR_HXX
-#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include "oox/helper/storagebase.hxx"
#include "oox/xls/biffhelper.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace beans { struct PropertyValue; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class BinaryInputStream; }
@@ -53,7 +53,8 @@ class BiffDetector : public ::cppu::WeakImplHelper2<
{
public:
explicit BiffDetector(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~BiffDetector();
@@ -63,7 +64,7 @@ public:
/** Detects the BIFF version and workbook stream name of the passed storage. */
static BiffType detectStorageBiffVersion(
::rtl::OUString& orWorkbookStreamName,
- StorageRef xStorage );
+ const StorageRef& rxStorage );
// com.sun.star.lang.XServiceInfo interface -------------------------------
@@ -84,8 +85,8 @@ public:
throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext;
};
// ============================================================================
@@ -94,4 +95,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index ce43e44fb613..9c0a57a83c04 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -30,217 +30,229 @@
#include "oox/helper/binarystreambase.hxx"
+namespace oox { class SequenceInputStream; }
+
namespace oox {
namespace xls {
class BiffInputStream;
-// OOBIN record identifiers ===================================================
-
-const sal_Int32 OOBIN_ID_ARRAY = 0x01AA;
-const sal_Int32 OOBIN_ID_AUTOFILTER = 0x00A1;
-const sal_Int32 OOBIN_ID_AUTOSORTSCOPE = 0x01CB;
-const sal_Int32 OOBIN_ID_BINARYINDEXBLOCK = 0x002A;
-const sal_Int32 OOBIN_ID_BINARYINDEXROWS = 0x0028;
-const sal_Int32 OOBIN_ID_BOOKVIEWS = 0x0087;
-const sal_Int32 OOBIN_ID_BORDER = 0x002E;
-const sal_Int32 OOBIN_ID_BORDERS = 0x0265;
-const sal_Int32 OOBIN_ID_BRK = 0x018C;
-const sal_Int32 OOBIN_ID_CALCPR = 0x009D;
-const sal_Int32 OOBIN_ID_CELL_BLANK = 0x0001;
-const sal_Int32 OOBIN_ID_CELL_BOOL = 0x0004;
-const sal_Int32 OOBIN_ID_CELL_DOUBLE = 0x0005;
-const sal_Int32 OOBIN_ID_CELL_ERROR = 0x0003;
-const sal_Int32 OOBIN_ID_CELL_RK = 0x0002;
-const sal_Int32 OOBIN_ID_CELL_RSTRING = 0x003E;
-const sal_Int32 OOBIN_ID_CELL_SI = 0x0007;
-const sal_Int32 OOBIN_ID_CELL_STRING = 0x0006;
-const sal_Int32 OOBIN_ID_CELLSTYLE = 0x0030;
-const sal_Int32 OOBIN_ID_CELLSTYLES = 0x026B;
-const sal_Int32 OOBIN_ID_CELLSTYLEXFS = 0x0272;
-const sal_Int32 OOBIN_ID_CELLXFS = 0x0269;
-const sal_Int32 OOBIN_ID_CFCOLOR = 0x0234;
-const sal_Int32 OOBIN_ID_CFRULE = 0x01CF;
-const sal_Int32 OOBIN_ID_CHARTPAGESETUP = 0x028C;
-const sal_Int32 OOBIN_ID_CHARTPROTECTION = 0x029D;
-const sal_Int32 OOBIN_ID_CHARTSHEETPR = 0x028B;
-const sal_Int32 OOBIN_ID_CHARTSHEETVIEW = 0x008D;
-const sal_Int32 OOBIN_ID_CHARTSHEETVIEWS = 0x008B;
-const sal_Int32 OOBIN_ID_COL = 0x003C;
-const sal_Int32 OOBIN_ID_COLBREAKS = 0x018A;
-const sal_Int32 OOBIN_ID_COLOR = 0x023C;
-const sal_Int32 OOBIN_ID_COLORS = 0x01D9;
-const sal_Int32 OOBIN_ID_COLORSCALE = 0x01D5;
-const sal_Int32 OOBIN_ID_COLS = 0x0186;
-const sal_Int32 OOBIN_ID_COMMENT = 0x027B;
-const sal_Int32 OOBIN_ID_COMMENTAUTHOR = 0x0278;
-const sal_Int32 OOBIN_ID_COMMENTAUTHORS = 0x0276;
-const sal_Int32 OOBIN_ID_COMMENTLIST = 0x0279;
-const sal_Int32 OOBIN_ID_COMMENTS = 0x0274;
-const sal_Int32 OOBIN_ID_COMMENTTEXT = 0x027D;
-const sal_Int32 OOBIN_ID_CONDFORMATTING = 0x01CD;
-const sal_Int32 OOBIN_ID_CONTROL = 0x0284;
-const sal_Int32 OOBIN_ID_CONTROLS = 0x0283;
-const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEW = 0x028F;
-const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEWS = 0x028D;
-const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEW = 0x01A7;
-const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEWS = 0x01A6;
-const sal_Int32 OOBIN_ID_CUSTOMWORKBOOKVIEW = 0x018D;
-const sal_Int32 OOBIN_ID_DATABAR = 0x01D3;
-const sal_Int32 OOBIN_ID_DATATABLE = 0x01AC;
-const sal_Int32 OOBIN_ID_DATAVALIDATION = 0x0040;
-const sal_Int32 OOBIN_ID_DATAVALIDATIONS = 0x023D;
-const sal_Int32 OOBIN_ID_DDEITEMVALUES = 0x0242;
-const sal_Int32 OOBIN_ID_DDEITEM_BOOL = 0x0248;
-const sal_Int32 OOBIN_ID_DDEITEM_DOUBLE = 0x0244;
-const sal_Int32 OOBIN_ID_DDEITEM_ERROR = 0x0245;
-const sal_Int32 OOBIN_ID_DDEITEM_STRING = 0x0246;
-const sal_Int32 OOBIN_ID_DEFINEDNAME = 0x0027;
-const sal_Int32 OOBIN_ID_DIMENSION = 0x0094;
-const sal_Int32 OOBIN_ID_DRAWING = 0x0226;
-const sal_Int32 OOBIN_ID_DXF = 0x01FB;
-const sal_Int32 OOBIN_ID_DXFS = 0x01F9;
-const sal_Int32 OOBIN_ID_EXTCELL_BLANK = 0x016F;
-const sal_Int32 OOBIN_ID_EXTCELL_BOOL = 0x0171;
-const sal_Int32 OOBIN_ID_EXTCELL_DOUBLE = 0x0170;
-const sal_Int32 OOBIN_ID_EXTCELL_ERROR = 0x0172;
-const sal_Int32 OOBIN_ID_EXTCELL_STRING = 0x0173;
-const sal_Int32 OOBIN_ID_EXTERNALADDIN = 0x029B;
-const sal_Int32 OOBIN_ID_EXTERNALBOOK = 0x0168;
-const sal_Int32 OOBIN_ID_EXTERNALNAME = 0x0241;
-const sal_Int32 OOBIN_ID_EXTERNALREF = 0x0163;
-const sal_Int32 OOBIN_ID_EXTERNALREFS = 0x0161;
-const sal_Int32 OOBIN_ID_EXTERNALSELF = 0x0165;
-const sal_Int32 OOBIN_ID_EXTERNALSAME = 0x0166;
-const sal_Int32 OOBIN_ID_EXTERNALSHEETS = 0x016A;
-const sal_Int32 OOBIN_ID_EXTROW = 0x016E;
-const sal_Int32 OOBIN_ID_EXTSHEETDATA = 0x016B;
-const sal_Int32 OOBIN_ID_EXTERNALNAMEFLAGS = 0x024A;
-const sal_Int32 OOBIN_ID_EXTSHEETNAMES = 0x0167;
-const sal_Int32 OOBIN_ID_FILESHARING = 0x0224;
-const sal_Int32 OOBIN_ID_FILEVERSION = 0x0080;
-const sal_Int32 OOBIN_ID_FILL = 0x002D;
-const sal_Int32 OOBIN_ID_FILLS = 0x025B;
-const sal_Int32 OOBIN_ID_FILTERCOLUMN = 0x00A3;
-const sal_Int32 OOBIN_ID_FONT = 0x002B;
-const sal_Int32 OOBIN_ID_FONTS = 0x0263;
-const sal_Int32 OOBIN_ID_FORMULA_STRING = 0x0008;
-const sal_Int32 OOBIN_ID_FORMULA_DOUBLE = 0x0009;
-const sal_Int32 OOBIN_ID_FORMULA_BOOL = 0x000A;
-const sal_Int32 OOBIN_ID_FORMULA_ERROR = 0x000B;
-const sal_Int32 OOBIN_ID_FUNCTIONGROUP = 0x0299;
-const sal_Int32 OOBIN_ID_FUNCTIONGROUPS = 0x0298;
-const sal_Int32 OOBIN_ID_HEADERFOOTER = 0x01DF;
-const sal_Int32 OOBIN_ID_HYPERLINK = 0x01EE;
-const sal_Int32 OOBIN_ID_ICONSET = 0x01D1;
-const sal_Int32 OOBIN_ID_INDEXEDCOLORS = 0x0235;
-const sal_Int32 OOBIN_ID_INPUTCELLS = 0x01F8;
-const sal_Int32 OOBIN_ID_LEGACYDRAWING = 0x0227;
-const sal_Int32 OOBIN_ID_MERGECELL = 0x00B0;
-const sal_Int32 OOBIN_ID_MERGECELLS = 0x00B1;
-const sal_Int32 OOBIN_ID_MRUCOLORS = 0x0239;
-const sal_Int32 OOBIN_ID_MULTCELL_BLANK = 0x000C;
-const sal_Int32 OOBIN_ID_MULTCELL_BOOL = 0x000F;
-const sal_Int32 OOBIN_ID_MULTCELL_DOUBLE = 0x0010;
-const sal_Int32 OOBIN_ID_MULTCELL_ERROR = 0x000E;
-const sal_Int32 OOBIN_ID_MULTCELL_RK = 0x000D;
-const sal_Int32 OOBIN_ID_MULTCELL_RSTRING = 0x003D;
-const sal_Int32 OOBIN_ID_MULTCELL_SI = 0x0012;
-const sal_Int32 OOBIN_ID_MULTCELL_STRING = 0x0011;
-const sal_Int32 OOBIN_ID_NUMFMT = 0x002C;
-const sal_Int32 OOBIN_ID_NUMFMTS = 0x0267;
-const sal_Int32 OOBIN_ID_OLEOBJECT = 0x027F;
-const sal_Int32 OOBIN_ID_OLEOBJECTS = 0x027E;
-const sal_Int32 OOBIN_ID_OLESIZE = 0x0225;
-const sal_Int32 OOBIN_ID_PAGEMARGINS = 0x01DC;
-const sal_Int32 OOBIN_ID_PAGESETUP = 0x01DE;
-const sal_Int32 OOBIN_ID_PANE = 0x0097;
-const sal_Int32 OOBIN_ID_PCDEFINITION = 0x00B3;
-const sal_Int32 OOBIN_ID_PCDFDISCRETEPR = 0x00E1;
-const sal_Int32 OOBIN_ID_PCDFGROUPITEMS = 0x00DD;
-const sal_Int32 OOBIN_ID_PCDFIELD = 0x00B7;
-const sal_Int32 OOBIN_ID_PCDFIELDGROUP = 0x00DB;
-const sal_Int32 OOBIN_ID_PCDFIELDS = 0x00B5;
-const sal_Int32 OOBIN_ID_PCDFRANGEPR = 0x00DF;
-const sal_Int32 OOBIN_ID_PCDFSHAREDITEMS = 0x00BD;
-const sal_Int32 OOBIN_ID_PCDSHEETSOURCE = 0x00BB;
-const sal_Int32 OOBIN_ID_PCDSOURCE = 0x00B9;
-const sal_Int32 OOBIN_ID_PCITEM_ARRAY = 0x00BF;
-const sal_Int32 OOBIN_ID_PCITEM_BOOL = 0x0016;
-const sal_Int32 OOBIN_ID_PCITEM_DATE = 0x0019;
-const sal_Int32 OOBIN_ID_PCITEM_DOUBLE = 0x0015;
-const sal_Int32 OOBIN_ID_PCITEM_ERROR = 0x0017;
-const sal_Int32 OOBIN_ID_PCITEM_INDEX = 0x001A;
-const sal_Int32 OOBIN_ID_PCITEM_MISSING = 0x0014;
-const sal_Int32 OOBIN_ID_PCITEM_STRING = 0x0018;
-const sal_Int32 OOBIN_ID_PCITEMA_BOOL = 0x001D;
-const sal_Int32 OOBIN_ID_PCITEMA_DATE = 0x0020;
-const sal_Int32 OOBIN_ID_PCITEMA_DOUBLE = 0x001C;
-const sal_Int32 OOBIN_ID_PCITEMA_ERROR = 0x001E;
-const sal_Int32 OOBIN_ID_PCITEMA_MISSING = 0x001B;
-const sal_Int32 OOBIN_ID_PCITEMA_STRING = 0x001F;
-const sal_Int32 OOBIN_ID_PCRECORD = 0x0021;
-const sal_Int32 OOBIN_ID_PCRECORDDT = 0x0022;
-const sal_Int32 OOBIN_ID_PCRECORDS = 0x00C1;
-const sal_Int32 OOBIN_ID_PHONETICPR = 0x0219;
-const sal_Int32 OOBIN_ID_PICTURE = 0x0232;
-const sal_Int32 OOBIN_ID_PIVOTAREA = 0x00F7;
-const sal_Int32 OOBIN_ID_PIVOTCACHE = 0x0182;
-const sal_Int32 OOBIN_ID_PIVOTCACHES = 0x0180;
-const sal_Int32 OOBIN_ID_PRINTOPTIONS = 0x01DD;
-const sal_Int32 OOBIN_ID_PTCOLFIELDS = 0x0137;
-const sal_Int32 OOBIN_ID_PTDATAFIELD = 0x0125;
-const sal_Int32 OOBIN_ID_PTDATAFIELDS = 0x0127;
-const sal_Int32 OOBIN_ID_PTDEFINITION = 0x0118;
-const sal_Int32 OOBIN_ID_PTFIELD = 0x011D;
-const sal_Int32 OOBIN_ID_PTFIELDS = 0x011F;
-const sal_Int32 OOBIN_ID_PTFILTER = 0x0259;
-const sal_Int32 OOBIN_ID_PTFILTERS = 0x0257;
-const sal_Int32 OOBIN_ID_PTFITEM = 0x011A;
-const sal_Int32 OOBIN_ID_PTFITEMS = 0x011B;
-const sal_Int32 OOBIN_ID_PTLOCATION = 0x013A;
-const sal_Int32 OOBIN_ID_PTPAGEFIELD = 0x0121;
-const sal_Int32 OOBIN_ID_PTPAGEFIELDS = 0x0123;
-const sal_Int32 OOBIN_ID_PTREFERENCE = 0x00FB;
-const sal_Int32 OOBIN_ID_PTREFERENCEITEM = 0x017E;
-const sal_Int32 OOBIN_ID_PTREFERENCES = 0x00F9;
-const sal_Int32 OOBIN_ID_PTROWFIELDS = 0x0135;
-const sal_Int32 OOBIN_ID_RGBCOLOR = 0x01DB;
-const sal_Int32 OOBIN_ID_ROW = 0x0000;
-const sal_Int32 OOBIN_ID_ROWBREAKS = 0x0188;
-const sal_Int32 OOBIN_ID_SCENARIO = 0x01F6;
-const sal_Int32 OOBIN_ID_SCENARIOS = 0x01F4;
-const sal_Int32 OOBIN_ID_SELECTION = 0x0098;
-const sal_Int32 OOBIN_ID_SHAREDFMLA = 0x01AB;
-const sal_Int32 OOBIN_ID_SHEET = 0x009C;
-const sal_Int32 OOBIN_ID_SHEETDATA = 0x0091;
-const sal_Int32 OOBIN_ID_SHEETFORMATPR = 0x01E5;
-const sal_Int32 OOBIN_ID_SHEETPR = 0x0093;
-const sal_Int32 OOBIN_ID_SHEETPROTECTION = 0x0217;
-const sal_Int32 OOBIN_ID_SHEETS = 0x008F;
-const sal_Int32 OOBIN_ID_SHEETVIEW = 0x0089;
-const sal_Int32 OOBIN_ID_SHEETVIEWS = 0x0085;
-const sal_Int32 OOBIN_ID_SI = 0x0013;
-const sal_Int32 OOBIN_ID_SST = 0x009F;
-const sal_Int32 OOBIN_ID_STYLESHEET = 0x0116;
-const sal_Int32 OOBIN_ID_TABLE = 0x0157;
-const sal_Int32 OOBIN_ID_TABLEPART = 0x0295;
-const sal_Int32 OOBIN_ID_TABLEPARTS = 0x0294;
-const sal_Int32 OOBIN_ID_TABLESTYLEINFO = 0x0201;
-const sal_Int32 OOBIN_ID_TABLESTYLES = 0x01FC;
-const sal_Int32 OOBIN_ID_TOP10FILTER = 0x00AA;
-const sal_Int32 OOBIN_ID_VOLTYPE = 0x0204;
-const sal_Int32 OOBIN_ID_VOLTYPEMAIN = 0x0206;
-const sal_Int32 OOBIN_ID_VOLTYPES = 0x0202;
-const sal_Int32 OOBIN_ID_VOLTYPESTP = 0x020A;
-const sal_Int32 OOBIN_ID_VOLTYPETR = 0x020B;
-const sal_Int32 OOBIN_ID_WORKBOOK = 0x0083;
-const sal_Int32 OOBIN_ID_WORKBOOKPR = 0x0099;
-const sal_Int32 OOBIN_ID_WORKBOOKVIEW = 0x009E;
-const sal_Int32 OOBIN_ID_WORKSHEET = 0x0081;
-const sal_Int32 OOBIN_ID_XF = 0x002F;
+// BIFF12 record identifiers ==================================================
-// ============================================================================
+const sal_Int32 BIFF12_ID_ARRAY = 0x01AA;
+const sal_Int32 BIFF12_ID_AUTOFILTER = 0x00A1;
+const sal_Int32 BIFF12_ID_AUTOSORTSCOPE = 0x01CB;
+const sal_Int32 BIFF12_ID_BINARYINDEXBLOCK = 0x002A;
+const sal_Int32 BIFF12_ID_BINARYINDEXROWS = 0x0028;
+const sal_Int32 BIFF12_ID_BOOKVIEWS = 0x0087;
+const sal_Int32 BIFF12_ID_BORDER = 0x002E;
+const sal_Int32 BIFF12_ID_BORDERS = 0x0265;
+const sal_Int32 BIFF12_ID_BRK = 0x018C;
+const sal_Int32 BIFF12_ID_CALCPR = 0x009D;
+const sal_Int32 BIFF12_ID_CELL_BLANK = 0x0001;
+const sal_Int32 BIFF12_ID_CELL_BOOL = 0x0004;
+const sal_Int32 BIFF12_ID_CELL_DOUBLE = 0x0005;
+const sal_Int32 BIFF12_ID_CELL_ERROR = 0x0003;
+const sal_Int32 BIFF12_ID_CELL_RK = 0x0002;
+const sal_Int32 BIFF12_ID_CELL_RSTRING = 0x003E;
+const sal_Int32 BIFF12_ID_CELL_SI = 0x0007;
+const sal_Int32 BIFF12_ID_CELL_STRING = 0x0006;
+const sal_Int32 BIFF12_ID_CELLSTYLE = 0x0030;
+const sal_Int32 BIFF12_ID_CELLSTYLES = 0x026B;
+const sal_Int32 BIFF12_ID_CELLSTYLEXFS = 0x0272;
+const sal_Int32 BIFF12_ID_CELLXFS = 0x0269;
+const sal_Int32 BIFF12_ID_CFCOLOR = 0x0234;
+const sal_Int32 BIFF12_ID_CFRULE = 0x01CF;
+const sal_Int32 BIFF12_ID_CHARTPAGESETUP = 0x028C;
+const sal_Int32 BIFF12_ID_CHARTPROTECTION = 0x029D;
+const sal_Int32 BIFF12_ID_CHARTSHEETPR = 0x028B;
+const sal_Int32 BIFF12_ID_CHARTSHEETVIEW = 0x008D;
+const sal_Int32 BIFF12_ID_CHARTSHEETVIEWS = 0x008B;
+const sal_Int32 BIFF12_ID_COL = 0x003C;
+const sal_Int32 BIFF12_ID_COLBREAKS = 0x018A;
+const sal_Int32 BIFF12_ID_COLOR = 0x023C;
+const sal_Int32 BIFF12_ID_COLORS = 0x01D9;
+const sal_Int32 BIFF12_ID_COLORSCALE = 0x01D5;
+const sal_Int32 BIFF12_ID_COLS = 0x0186;
+const sal_Int32 BIFF12_ID_COMMENT = 0x027B;
+const sal_Int32 BIFF12_ID_COMMENTAUTHOR = 0x0278;
+const sal_Int32 BIFF12_ID_COMMENTAUTHORS = 0x0276;
+const sal_Int32 BIFF12_ID_COMMENTLIST = 0x0279;
+const sal_Int32 BIFF12_ID_COMMENTS = 0x0274;
+const sal_Int32 BIFF12_ID_COMMENTTEXT = 0x027D;
+const sal_Int32 BIFF12_ID_CONDFORMATTING = 0x01CD;
+const sal_Int32 BIFF12_ID_CONNECTION = 0x00C9;
+const sal_Int32 BIFF12_ID_CONNECTIONS = 0x01AD;
+const sal_Int32 BIFF12_ID_CONTROL = 0x0284;
+const sal_Int32 BIFF12_ID_CONTROLS = 0x0283;
+const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEW = 0x028F;
+const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEWS = 0x028D;
+const sal_Int32 BIFF12_ID_CUSTOMFILTER = 0x00AE;
+const sal_Int32 BIFF12_ID_CUSTOMFILTERS = 0x00AC;
+const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW = 0x01A7;
+const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS = 0x01A6;
+const sal_Int32 BIFF12_ID_CUSTOMWORKBOOKVIEW= 0x018D;
+const sal_Int32 BIFF12_ID_DATABAR = 0x01D3;
+const sal_Int32 BIFF12_ID_DATATABLE = 0x01AC;
+const sal_Int32 BIFF12_ID_DATAVALIDATION = 0x0040;
+const sal_Int32 BIFF12_ID_DATAVALIDATIONS = 0x023D;
+const sal_Int32 BIFF12_ID_DDEITEMVALUES = 0x0242;
+const sal_Int32 BIFF12_ID_DDEITEM_BOOL = 0x0248;
+const sal_Int32 BIFF12_ID_DDEITEM_DOUBLE = 0x0244;
+const sal_Int32 BIFF12_ID_DDEITEM_ERROR = 0x0245;
+const sal_Int32 BIFF12_ID_DDEITEM_STRING = 0x0246;
+const sal_Int32 BIFF12_ID_DEFINEDNAME = 0x0027;
+const sal_Int32 BIFF12_ID_DIMENSION = 0x0094;
+const sal_Int32 BIFF12_ID_DISCRETEFILTER = 0x00A7;
+const sal_Int32 BIFF12_ID_DISCRETEFILTERS = 0x00A5;
+const sal_Int32 BIFF12_ID_DRAWING = 0x0226;
+const sal_Int32 BIFF12_ID_DXF = 0x01FB;
+const sal_Int32 BIFF12_ID_DXFS = 0x01F9;
+const sal_Int32 BIFF12_ID_EXTCELL_BLANK = 0x016F;
+const sal_Int32 BIFF12_ID_EXTCELL_BOOL = 0x0171;
+const sal_Int32 BIFF12_ID_EXTCELL_DOUBLE = 0x0170;
+const sal_Int32 BIFF12_ID_EXTCELL_ERROR = 0x0172;
+const sal_Int32 BIFF12_ID_EXTCELL_STRING = 0x0173;
+const sal_Int32 BIFF12_ID_EXTERNALADDIN = 0x029B;
+const sal_Int32 BIFF12_ID_EXTERNALBOOK = 0x0168;
+const sal_Int32 BIFF12_ID_EXTERNALNAME = 0x0241;
+const sal_Int32 BIFF12_ID_EXTERNALREF = 0x0163;
+const sal_Int32 BIFF12_ID_EXTERNALREFS = 0x0161;
+const sal_Int32 BIFF12_ID_EXTERNALSELF = 0x0165;
+const sal_Int32 BIFF12_ID_EXTERNALSAME = 0x0166;
+const sal_Int32 BIFF12_ID_EXTERNALSHEETS = 0x016A;
+const sal_Int32 BIFF12_ID_EXTROW = 0x016E;
+const sal_Int32 BIFF12_ID_EXTSHEETDATA = 0x016B;
+const sal_Int32 BIFF12_ID_EXTERNALNAMEFLAGS = 0x024A;
+const sal_Int32 BIFF12_ID_EXTSHEETNAMES = 0x0167;
+const sal_Int32 BIFF12_ID_FILESHARING = 0x0224;
+const sal_Int32 BIFF12_ID_FILEVERSION = 0x0080;
+const sal_Int32 BIFF12_ID_FILL = 0x002D;
+const sal_Int32 BIFF12_ID_FILLS = 0x025B;
+const sal_Int32 BIFF12_ID_FILTERCOLUMN = 0x00A3;
+const sal_Int32 BIFF12_ID_FONT = 0x002B;
+const sal_Int32 BIFF12_ID_FONTS = 0x0263;
+const sal_Int32 BIFF12_ID_FORMULA_STRING = 0x0008;
+const sal_Int32 BIFF12_ID_FORMULA_DOUBLE = 0x0009;
+const sal_Int32 BIFF12_ID_FORMULA_BOOL = 0x000A;
+const sal_Int32 BIFF12_ID_FORMULA_ERROR = 0x000B;
+const sal_Int32 BIFF12_ID_FUNCTIONGROUP = 0x0299;
+const sal_Int32 BIFF12_ID_FUNCTIONGROUPS = 0x0298;
+const sal_Int32 BIFF12_ID_HEADERFOOTER = 0x01DF;
+const sal_Int32 BIFF12_ID_HYPERLINK = 0x01EE;
+const sal_Int32 BIFF12_ID_ICONSET = 0x01D1;
+const sal_Int32 BIFF12_ID_INDEXEDCOLORS = 0x0235;
+const sal_Int32 BIFF12_ID_INPUTCELLS = 0x01F8;
+const sal_Int32 BIFF12_ID_LEGACYDRAWING = 0x0227;
+const sal_Int32 BIFF12_ID_MERGECELL = 0x00B0;
+const sal_Int32 BIFF12_ID_MERGECELLS = 0x00B1;
+const sal_Int32 BIFF12_ID_MRUCOLORS = 0x0239;
+const sal_Int32 BIFF12_ID_MULTCELL_BLANK = 0x000C;
+const sal_Int32 BIFF12_ID_MULTCELL_BOOL = 0x000F;
+const sal_Int32 BIFF12_ID_MULTCELL_DOUBLE = 0x0010;
+const sal_Int32 BIFF12_ID_MULTCELL_ERROR = 0x000E;
+const sal_Int32 BIFF12_ID_MULTCELL_RK = 0x000D;
+const sal_Int32 BIFF12_ID_MULTCELL_RSTRING = 0x003D;
+const sal_Int32 BIFF12_ID_MULTCELL_SI = 0x0012;
+const sal_Int32 BIFF12_ID_MULTCELL_STRING = 0x0011;
+const sal_Int32 BIFF12_ID_NUMFMT = 0x002C;
+const sal_Int32 BIFF12_ID_NUMFMTS = 0x0267;
+const sal_Int32 BIFF12_ID_OLEOBJECT = 0x027F;
+const sal_Int32 BIFF12_ID_OLEOBJECTS = 0x027E;
+const sal_Int32 BIFF12_ID_OLESIZE = 0x0225;
+const sal_Int32 BIFF12_ID_PAGEMARGINS = 0x01DC;
+const sal_Int32 BIFF12_ID_PAGESETUP = 0x01DE;
+const sal_Int32 BIFF12_ID_PANE = 0x0097;
+const sal_Int32 BIFF12_ID_PCDEFINITION = 0x00B3;
+const sal_Int32 BIFF12_ID_PCDFDISCRETEPR = 0x00E1;
+const sal_Int32 BIFF12_ID_PCDFGROUPITEMS = 0x00DD;
+const sal_Int32 BIFF12_ID_PCDFIELD = 0x00B7;
+const sal_Int32 BIFF12_ID_PCDFIELDGROUP = 0x00DB;
+const sal_Int32 BIFF12_ID_PCDFIELDS = 0x00B5;
+const sal_Int32 BIFF12_ID_PCDFRANGEPR = 0x00DF;
+const sal_Int32 BIFF12_ID_PCDFSHAREDITEMS = 0x00BD;
+const sal_Int32 BIFF12_ID_PCDSHEETSOURCE = 0x00BB;
+const sal_Int32 BIFF12_ID_PCDSOURCE = 0x00B9;
+const sal_Int32 BIFF12_ID_PCITEM_ARRAY = 0x00BF;
+const sal_Int32 BIFF12_ID_PCITEM_BOOL = 0x0016;
+const sal_Int32 BIFF12_ID_PCITEM_DATE = 0x0019;
+const sal_Int32 BIFF12_ID_PCITEM_DOUBLE = 0x0015;
+const sal_Int32 BIFF12_ID_PCITEM_ERROR = 0x0017;
+const sal_Int32 BIFF12_ID_PCITEM_INDEX = 0x001A;
+const sal_Int32 BIFF12_ID_PCITEM_MISSING = 0x0014;
+const sal_Int32 BIFF12_ID_PCITEM_STRING = 0x0018;
+const sal_Int32 BIFF12_ID_PCITEMA_BOOL = 0x001D;
+const sal_Int32 BIFF12_ID_PCITEMA_DATE = 0x0020;
+const sal_Int32 BIFF12_ID_PCITEMA_DOUBLE = 0x001C;
+const sal_Int32 BIFF12_ID_PCITEMA_ERROR = 0x001E;
+const sal_Int32 BIFF12_ID_PCITEMA_MISSING = 0x001B;
+const sal_Int32 BIFF12_ID_PCITEMA_STRING = 0x001F;
+const sal_Int32 BIFF12_ID_PCRECORD = 0x0021;
+const sal_Int32 BIFF12_ID_PCRECORDDT = 0x0022;
+const sal_Int32 BIFF12_ID_PCRECORDS = 0x00C1;
+const sal_Int32 BIFF12_ID_PHONETICPR = 0x0219;
+const sal_Int32 BIFF12_ID_PICTURE = 0x0232;
+const sal_Int32 BIFF12_ID_PIVOTAREA = 0x00F7;
+const sal_Int32 BIFF12_ID_PIVOTCACHE = 0x0182;
+const sal_Int32 BIFF12_ID_PIVOTCACHES = 0x0180;
+const sal_Int32 BIFF12_ID_PRINTOPTIONS = 0x01DD;
+const sal_Int32 BIFF12_ID_PTCOLFIELDS = 0x0137;
+const sal_Int32 BIFF12_ID_PTDATAFIELD = 0x0125;
+const sal_Int32 BIFF12_ID_PTDATAFIELDS = 0x0127;
+const sal_Int32 BIFF12_ID_PTDEFINITION = 0x0118;
+const sal_Int32 BIFF12_ID_PTFIELD = 0x011D;
+const sal_Int32 BIFF12_ID_PTFIELDS = 0x011F;
+const sal_Int32 BIFF12_ID_PTFILTER = 0x0259;
+const sal_Int32 BIFF12_ID_PTFILTERS = 0x0257;
+const sal_Int32 BIFF12_ID_PTFITEM = 0x011A;
+const sal_Int32 BIFF12_ID_PTFITEMS = 0x011B;
+const sal_Int32 BIFF12_ID_PTLOCATION = 0x013A;
+const sal_Int32 BIFF12_ID_PTPAGEFIELD = 0x0121;
+const sal_Int32 BIFF12_ID_PTPAGEFIELDS = 0x0123;
+const sal_Int32 BIFF12_ID_PTREFERENCE = 0x00FB;
+const sal_Int32 BIFF12_ID_PTREFERENCEITEM = 0x017E;
+const sal_Int32 BIFF12_ID_PTREFERENCES = 0x00F9;
+const sal_Int32 BIFF12_ID_PTROWFIELDS = 0x0135;
+const sal_Int32 BIFF12_ID_QUERYTABLE = 0x01BF;
+const sal_Int32 BIFF12_ID_QUERYTABLEREFRESH = 0x01C1;
+const sal_Int32 BIFF12_ID_RGBCOLOR = 0x01DB;
+const sal_Int32 BIFF12_ID_ROW = 0x0000;
+const sal_Int32 BIFF12_ID_ROWBREAKS = 0x0188;
+const sal_Int32 BIFF12_ID_SCENARIO = 0x01F6;
+const sal_Int32 BIFF12_ID_SCENARIOS = 0x01F4;
+const sal_Int32 BIFF12_ID_SELECTION = 0x0098;
+const sal_Int32 BIFF12_ID_SHAREDFMLA = 0x01AB;
+const sal_Int32 BIFF12_ID_SHEET = 0x009C;
+const sal_Int32 BIFF12_ID_SHEETDATA = 0x0091;
+const sal_Int32 BIFF12_ID_SHEETFORMATPR = 0x01E5;
+const sal_Int32 BIFF12_ID_SHEETPR = 0x0093;
+const sal_Int32 BIFF12_ID_SHEETPROTECTION = 0x0217;
+const sal_Int32 BIFF12_ID_SHEETS = 0x008F;
+const sal_Int32 BIFF12_ID_SHEETVIEW = 0x0089;
+const sal_Int32 BIFF12_ID_SHEETVIEWS = 0x0085;
+const sal_Int32 BIFF12_ID_SI = 0x0013;
+const sal_Int32 BIFF12_ID_SST = 0x009F;
+const sal_Int32 BIFF12_ID_STYLESHEET = 0x0116;
+const sal_Int32 BIFF12_ID_TABLE = 0x0157;
+const sal_Int32 BIFF12_ID_TABLEPART = 0x0295;
+const sal_Int32 BIFF12_ID_TABLEPARTS = 0x0294;
+const sal_Int32 BIFF12_ID_TABLESTYLEINFO = 0x0201;
+const sal_Int32 BIFF12_ID_TABLESTYLES = 0x01FC;
+const sal_Int32 BIFF12_ID_TOP10FILTER = 0x00AA;
+const sal_Int32 BIFF12_ID_VOLTYPE = 0x0204;
+const sal_Int32 BIFF12_ID_VOLTYPEMAIN = 0x0206;
+const sal_Int32 BIFF12_ID_VOLTYPES = 0x0202;
+const sal_Int32 BIFF12_ID_VOLTYPESTP = 0x020A;
+const sal_Int32 BIFF12_ID_VOLTYPETR = 0x020B;
+const sal_Int32 BIFF12_ID_WEBPR = 0x0105;
+const sal_Int32 BIFF12_ID_WEBPRTABLES = 0x0107;
+const sal_Int32 BIFF12_ID_WORKBOOK = 0x0083;
+const sal_Int32 BIFF12_ID_WORKBOOKPR = 0x0099;
+const sal_Int32 BIFF12_ID_WORKBOOKVIEW = 0x009E;
+const sal_Int32 BIFF12_ID_WORKSHEET = 0x0081;
+const sal_Int32 BIFF12_ID_XF = 0x002F;
+
+// BIFF2-BIFF8 record identifiers =============================================
/** An enumeration for all binary Excel file format types (BIFF types). */
enum BiffType
@@ -260,6 +272,7 @@ const sal_uInt16 BIFF8_MAXRECSIZE = 8224;
const sal_uInt16 BIFF2_ID_ARRAY = 0x0021;
const sal_uInt16 BIFF3_ID_ARRAY = 0x0221;
+const sal_uInt16 BIFF_ID_AUTOFILTER = 0x009D;
const sal_uInt16 BIFF2_ID_BLANK = 0x0001;
const sal_uInt16 BIFF3_ID_BLANK = 0x0201;
const sal_uInt16 BIFF2_ID_BOF = 0x0009;
@@ -352,6 +365,7 @@ const sal_uInt16 BIFF_ID_COLINFO = 0x007D;
const sal_uInt16 BIFF_ID_COLUMNDEFAULT = 0x0020;
const sal_uInt16 BIFF_ID_COLWIDTH = 0x0024;
const sal_uInt16 BIFF_ID_COMPRESSPICS = 0x089B;
+const sal_uInt16 BIFF_ID_CONNECTION = 0x0876;
const sal_uInt16 BIFF_ID_CONT = 0x003C;
const sal_uInt16 BIFF_ID_COORDLIST = 0x00A9;
const sal_uInt16 BIFF_ID_COUNTRY = 0x008C;
@@ -363,6 +377,7 @@ const sal_uInt16 BIFF_ID_DATAVALIDATION = 0x01BE;
const sal_uInt16 BIFF_ID_DATAVALIDATIONS = 0x01B2;
const sal_uInt16 BIFF_ID_DATEMODE = 0x0022;
const sal_uInt16 BIFF_ID_DBCELL = 0x00D7;
+const sal_uInt16 BIFF_ID_DBQUERY = 0x00DC;
const sal_uInt16 BIFF_ID_DCONBINAME = 0x01B5;
const sal_uInt16 BIFF_ID_DCONNAME = 0x0052;
const sal_uInt16 BIFF_ID_DCONREF = 0x0051;
@@ -385,6 +400,8 @@ const sal_uInt16 BIFF_ID_EXTERNSHEET = 0x0017;
const sal_uInt16 BIFF_ID_EXTSST = 0x00FF;
const sal_uInt16 BIFF_ID_FILEPASS = 0x002F;
const sal_uInt16 BIFF_ID_FILESHARING = 0x005B;
+const sal_uInt16 BIFF_ID_FILTERCOLUMN = 0x009E;
+const sal_uInt16 BIFF_ID_FILTERMODE = 0x009B;
const sal_uInt16 BIFF2_ID_FONT = 0x0031;
const sal_uInt16 BIFF3_ID_FONT = 0x0231;
const sal_uInt16 BIFF5_ID_FONT = 0x0031;
@@ -434,6 +451,7 @@ const sal_uInt16 BIFF_ID_PAGELAYOUTVIEW = 0x088B;
const sal_uInt16 BIFF_ID_PAGESETUP = 0x00A1;
const sal_uInt16 BIFF_ID_PALETTE = 0x0092;
const sal_uInt16 BIFF_ID_PANE = 0x0041;
+const sal_uInt16 BIFF_ID_PARAMQUERY = 0x00DC;
const sal_uInt16 BIFF_ID_PASSWORD = 0x0013;
const sal_uInt16 BIFF_ID_PCDEFINITION = 0x00C6;
const sal_uInt16 BIFF_ID_PCDEFINITION2 = 0x0122;
@@ -469,6 +487,10 @@ const sal_uInt16 BIFF_ID_PTFITEM = 0x00B2;
const sal_uInt16 BIFF_ID_PTPAGEFIELDS = 0x00B6;
const sal_uInt16 BIFF_ID_PTROWCOLFIELDS = 0x00B4;
const sal_uInt16 BIFF_ID_PTROWCOLITEMS = 0x00B5;
+const sal_uInt16 BIFF_ID_QUERYTABLE = 0x01AD;
+const sal_uInt16 BIFF_ID_QUERYTABLEREFRESH = 0x0802;
+const sal_uInt16 BIFF_ID_QUERYTABLESETTINGS = 0x0803;
+const sal_uInt16 BIFF_ID_QUERYTABLESTRING = 0x0804;
const sal_uInt16 BIFF_ID_RECALCID = 0x01C1;
const sal_uInt16 BIFF_ID_REFMODE = 0x000F;
const sal_uInt16 BIFF_ID_RIGHTMARGIN = 0x0027;
@@ -495,7 +517,6 @@ const sal_uInt16 BIFF2_ID_STRING = 0x0007;
const sal_uInt16 BIFF3_ID_STRING = 0x0207;
const sal_uInt16 BIFF_ID_STYLE = 0x0293;
const sal_uInt16 BIFF_ID_STYLEEXT = 0x0892;
-const sal_uInt16 BIFF_ID_SXEXT = 0x00DC;
const sal_uInt16 BIFF_ID_TABLESTYLES = 0x088E;
const sal_uInt16 BIFF_ID_THEME = 0x0896;
const sal_uInt16 BIFF_ID_TOPMARGIN = 0x0028;
@@ -520,6 +541,8 @@ const sal_uInt16 BIFF_ID_XFEXT = 0x087D;
const sal_uInt16 BIFF_ID_UNKNOWN = SAL_MAX_UINT16;
+// OBJ subrecord identifiers --------------------------------------------------
+
const sal_uInt16 BIFF_ID_OBJEND = 0x0000; /// End of OBJ.
const sal_uInt16 BIFF_ID_OBJMACRO = 0x0004; /// Macro link.
const sal_uInt16 BIFF_ID_OBJBUTTON = 0x0005; /// Button data.
@@ -562,7 +585,10 @@ const sal_uInt8 BIFF_DATATYPE_STRING = 2;
const sal_uInt8 BIFF_DATATYPE_BOOL = 4;
const sal_uInt8 BIFF_DATATYPE_ERROR = 16;
-// unicode strings ------------------------------------------------------------
+const sal_uInt8 BIFF_BOOLERR_BOOL = 0;
+const sal_uInt8 BIFF_BOOLERR_ERROR = 1;
+
+// BIFF8 unicode strings ------------------------------------------------------
const sal_uInt8 BIFF_STRF_16BIT = 0x01;
const sal_uInt8 BIFF_STRF_PHONETIC = 0x04;
@@ -591,6 +617,32 @@ public:
/** Returns a Windows code page from a text encoding. */
static sal_uInt16 calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc );
+ // BIFF12 import ----------------------------------------------------------
+
+ /** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */
+ static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true );
+
+ // BIFF2-BIFF8 import -----------------------------------------------------
+
+ /** Returns true, if the current record of the stream is a BOF record. */
+ static bool isBofRecord( BiffInputStream& rStrm );
+
+ /** Skips a block of records up to the specified end record.
+
+ Skips all records until next end record. When this function returns,
+ the stream points to the end record, and the next call of the function
+ startNextRecord() at the stream will start the record following the end
+ record.
+
+ The identifier of the record that is active while this function is
+ called is used as start record identifier. This identifier is used to
+ correctly skip embedded record blocks with the same start and end
+ record identifier.
+
+ @return True = stream points to the end record.
+ */
+ static bool skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId );
+
/** Imports a picture from an IMGDATA record. */
static void importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff );
@@ -599,10 +651,18 @@ private:
~BiffHelper(); // not implemented
};
+// ----------------------------------------------------------------------------
+
+/** BIFF12 stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUString& orString )
+{
+ orString = BiffHelper::readString( rStrm );
+ return rStrm;
+}
+
// ============================================================================
} // namespace xls
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx
index c804d2c9c6e0..003ab28be34f 100644
--- a/oox/inc/oox/xls/biffinputstream.hxx
+++ b/oox/inc/oox/xls/biffinputstream.hxx
@@ -444,4 +444,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/biffoutputstream.hxx b/oox/inc/oox/xls/biffoutputstream.hxx
index 6e36b08d3592..ada646bd879a 100644
--- a/oox/inc/oox/xls/biffoutputstream.hxx
+++ b/oox/inc/oox/xls/biffoutputstream.hxx
@@ -162,4 +162,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx
index dc8e0f85fd13..8dfedc5ba48e 100644
--- a/oox/inc/oox/xls/chartsheetfragment.hxx
+++ b/oox/inc/oox/xls/chartsheetfragment.hxx
@@ -35,24 +35,20 @@ namespace xls {
// ============================================================================
-class OoxChartsheetFragment : public OoxWorksheetFragmentBase
+class ChartsheetFragment : public WorksheetFragmentBase
{
public:
- explicit OoxChartsheetFragment(
+ explicit ChartsheetFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void initializeImport();
@@ -62,7 +58,7 @@ private:
/** Imports the the relation identifier for the DrawingML part. */
void importDrawing( const AttributeList& rAttribs );
/** Imports the DRAWING record containing the relation identifier for the DrawingML part. */
- void importDrawing( RecordInputStream& rStrm );
+ void importDrawing( SequenceInputStream& rStrm );
};
// ============================================================================
@@ -72,7 +68,7 @@ class BiffChartsheetFragment : public BiffWorksheetFragmentBase
public:
explicit BiffChartsheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
/** Imports the entire sheet fragment, returns true, if EOF record has been reached. */
@@ -85,4 +81,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx
index 8a43eb7fe9fe..e87d52ff03a2 100644
--- a/oox/inc/oox/xls/commentsbuffer.hxx
+++ b/oox/inc/oox/xls/commentsbuffer.hxx
@@ -56,7 +56,7 @@ public:
/** Imports a cell comment from the passed attributes of the comment element. */
void importComment( const AttributeList& rAttribs );
/** Imports a cell comment from the passed stream of a COMMENT record. */
- void importComment( RecordInputStream& rStrm );
+ void importComment( SequenceInputStream& rStrm );
/** Creates and returns a new rich-string object for the comment text. */
RichStringRef createText();
@@ -99,4 +99,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx
index 584c6a2bb340..3751cde764f4 100644
--- a/oox/inc/oox/xls/commentsfragment.hxx
+++ b/oox/inc/oox/xls/commentsfragment.hxx
@@ -36,30 +36,27 @@ namespace xls {
// ============================================================================
-class OoxCommentsFragment : public OoxWorksheetFragmentBase
+class CommentsFragment : public WorksheetFragmentBase
{
public:
- explicit OoxCommentsFragment(
+ explicit CommentsFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void onEndRecord();
- // oox.core.FragmentHandler2 interface ------------------------------------
-
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
/** Imports comment data from the comment element. */
void importComment( const AttributeList& rAttribs );
/** Imports comment data from the COMMENT record. */
- void importComment( RecordInputStream& rStrm );
+ void importComment( SequenceInputStream& rStrm );
private:
CommentRef mxComment;
@@ -71,4 +68,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx
index 25259ce04295..fae6381f6402 100644
--- a/oox/inc/oox/xls/condformatbuffer.hxx
+++ b/oox/inc/oox/xls/condformatbuffer.hxx
@@ -29,7 +29,6 @@
#define OOX_XLS_CONDFORMATBUFFER_HXX
#include <com/sun/star/sheet/ConditionOperator.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheethelper.hxx"
@@ -64,11 +63,11 @@ struct CondFormatRuleModel
explicit CondFormatRuleModel();
- /** Sets the passed OOBIN or BIFF operator for condition type cellIs. */
- void setBinOperator( sal_Int32 nOperator );
+ /** Sets the passed BIFF operator for condition type cellIs. */
+ void setBiffOperator( sal_Int32 nOperator );
- /** Sets the passed OOBIN text comparison type and operator. */
- void setOobTextType( sal_Int32 nOperator );
+ /** Sets the passed BIFF12 text comparison type and operator. */
+ void setBiff12TextType( sal_Int32 nOperator );
};
// ============================================================================
@@ -87,7 +86,7 @@ public:
void appendFormula( const ::rtl::OUString& rFormula );
/** Imports rule settings from a CFRULE record. */
- void importCfRule( RecordInputStream& rStrm );
+ void importCfRule( SequenceInputStream& rStrm );
/** Imports rule settings from a CFRULE record. */
void importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority );
@@ -131,9 +130,9 @@ public:
CondFormatRuleRef importCfRule( const AttributeList& rAttribs );
/** Imports settings from the CONDFORMATTING record. */
- void importCondFormatting( RecordInputStream& rStrm );
+ void importCondFormatting( SequenceInputStream& rStrm );
/** Imports a conditional formatting rule from the CFRULE record. */
- void importCfRule( RecordInputStream& rStrm );
+ void importCfRule( SequenceInputStream& rStrm );
/** Imports settings from the CFHEADER record. */
void importCfHeader( BiffInputStream& rStrm );
@@ -167,7 +166,7 @@ public:
/** Imports settings from the conditionalFormatting element. */
CondFormatRef importConditionalFormatting( const AttributeList& rAttribs );
/** Imports settings from the CONDFORMATTING record. */
- CondFormatRef importCondFormatting( RecordInputStream& rStrm );
+ CondFormatRef importCondFormatting( SequenceInputStream& rStrm );
/** Imports settings from the CFHEADER record. */
void importCfHeader( BiffInputStream& rStrm );
@@ -192,4 +191,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx
index 799e3127b7a3..44c9fe592250 100644
--- a/oox/inc/oox/xls/condformatcontext.hxx
+++ b/oox/inc/oox/xls/condformatcontext.hxx
@@ -36,20 +36,18 @@ namespace xls {
// ============================================================================
-class OoxCondFormatContext : public OoxWorksheetContextBase
+class CondFormatContext : public WorksheetContextBase
{
public:
- explicit OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment );
+ explicit CondFormatContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
CondFormatRef mxCondFmt;
@@ -62,4 +60,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx
new file mode 100755
index 000000000000..98a5bea17bc6
--- /dev/null
+++ b/oox/inc/oox/xls/connectionsbuffer.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_CONNECTIONSBUFFER_HXX
+#define OOX_XLS_CONNECTIONSBUFFER_HXX
+
+#include "oox/helper/refvector.hxx"
+#include "oox/xls/workbookhelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+const sal_Int32 BIFF12_CONNECTION_UNKNOWN = 0;
+const sal_Int32 BIFF12_CONNECTION_ODBC = 1;
+const sal_Int32 BIFF12_CONNECTION_DAO = 2;
+const sal_Int32 BIFF12_CONNECTION_FILE = 3;
+const sal_Int32 BIFF12_CONNECTION_HTML = 4;
+const sal_Int32 BIFF12_CONNECTION_OLEDB = 5;
+const sal_Int32 BIFF12_CONNECTION_TEXT = 6;
+const sal_Int32 BIFF12_CONNECTION_ADO = 7;
+const sal_Int32 BIFF12_CONNECTION_DSP = 8;
+
+// ============================================================================
+
+/** Special properties for data connections representing web queries. */
+struct WebPrModel
+{
+ typedef ::std::vector< ::com::sun::star::uno::Any > TablesVector;
+
+ TablesVector maTables; /// Names or indexes of the web query tables.
+ ::rtl::OUString maUrl; /// Source URL to refresh the data.
+ ::rtl::OUString maPostMethod; /// POST method to query data.
+ ::rtl::OUString maEditPage; /// Web page showing query data (for XML queries).
+ sal_Int32 mnHtmlFormat; /// Plain text, rich text, or HTML.
+ bool mbXml; /// True = XML query, false = HTML query.
+ bool mbSourceData; /// True = import XML source data referred by HTML table.
+ bool mbParsePre; /// True = parse preformatted sections (<pre> tag).
+ bool mbConsecutive; /// True = join consecutive delimiters.
+ bool mbFirstRow; /// True = use column withs of first row for entire <pre> tag.
+ bool mbXl97Created; /// True = web query created with Excel 97.
+ bool mbTextDates; /// True = read date values as text, false = parse dates.
+ bool mbXl2000Refreshed; /// True = refreshed with Excel 2000 or newer.
+ bool mbHtmlTables; /// True = HTML tables, false = entire document.
+
+ explicit WebPrModel();
+};
+
+// ----------------------------------------------------------------------------
+
+/** Common properties of an external data connection. */
+struct ConnectionModel
+{
+ typedef ::std::auto_ptr< WebPrModel > WebPrModelPtr;
+
+ WebPrModelPtr mxWebPr; /// Special settings for web queries.
+ ::rtl::OUString maName; /// Unique name of this connection.
+ ::rtl::OUString maDescription; /// User description of this connection.
+ ::rtl::OUString maSourceFile; /// URL of a source data file.
+ ::rtl::OUString maSourceConnFile; /// URL of a source connection file.
+ ::rtl::OUString maSsoId; /// Single sign-on identifier.
+ sal_Int32 mnId; /// Unique connection identifier.
+ sal_Int32 mnType; /// Data source type.
+ sal_Int32 mnReconnectMethod; /// Reconnection method.
+ sal_Int32 mnCredentials; /// Credentials method.
+ sal_Int32 mnInterval; /// Refresh interval in minutes.
+ bool mbKeepAlive; /// True = keep connection open after import.
+ bool mbNew; /// True = new connection, never updated.
+ bool mbDeleted; /// True = connection has been deleted.
+ bool mbOnlyUseConnFile; /// True = use maSourceConnFile, ignore mnReconnectMethod.
+ bool mbBackground; /// True = background refresh enabled.
+ bool mbRefreshOnLoad; /// True = refresh connection on import.
+ bool mbSaveData; /// True = save cached data with connection.
+ bool mbSavePassword; /// True = save password in connection string.
+
+ explicit ConnectionModel();
+
+ WebPrModel& createWebPr();
+};
+
+// ----------------------------------------------------------------------------
+
+/** An external data connection (database, web query, etc.). */
+class Connection : public WorkbookHelper
+{
+public:
+ explicit Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId = -1 );
+
+ /** Imports connection settings from the connection element. */
+ void importConnection( const AttributeList& rAttribs );
+ /** Imports web query settings from the webPr element. */
+ void importWebPr( const AttributeList& rAttribs );
+ /** Imports web query table settings from the tables element. */
+ void importTables( const AttributeList& rAttribs );
+ /** Imports a web query table identifier from the m, s, or x element. */
+ void importTable( const AttributeList& rAttribs, sal_Int32 nElement );
+
+ /** Imports connection settings from the CONNECTION record. */
+ void importConnection( SequenceInputStream& rStrm );
+ /** Imports web query settings from the WEBPR record. */
+ void importWebPr( SequenceInputStream& rStrm );
+ /** Imports web query table settings from the WEBPRTABLES record. */
+ void importWebPrTables( SequenceInputStream& rStrm );
+ /** Imports a web query table identifier from the PCITEM_MISSING, PCITEM_STRING, or PCITEM_INDEX record. */
+ void importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId );
+
+ /** Imports connection settings from the DBQUERY record. */
+ void importDbQuery( BiffInputStream& rStrm );
+ /** Imports connection settings from the QUERYTABLESETTINGS record. */
+ void importQueryTableSettings( BiffInputStream& rStrm );
+
+ /** Returns the unique connection identifier. */
+ inline sal_Int32 getConnectionId() const { return maModel.mnId; }
+ /** Returns the source data type of the connection. */
+ inline sal_Int32 getConnectionType() const { return maModel.mnType; }
+ /** Returns read-only access to the connection model data. */
+ const ConnectionModel& getModel() const { return maModel; }
+
+private:
+ ConnectionModel maModel;
+};
+
+typedef ::boost::shared_ptr< Connection > ConnectionRef;
+
+// ============================================================================
+
+class ConnectionsBuffer : public WorkbookHelper
+{
+public:
+ explicit ConnectionsBuffer( const WorkbookHelper& rHelper );
+
+ /** Creates a new empty connection. */
+ Connection& createConnection();
+ /** Creates a new empty connection with a valid but unused identifier. */
+ Connection& createConnectionWithId();
+
+ /** Maps all connections by their identifier. */
+ void finalizeImport();
+
+ /** Returns a data connection by its unique identifier. */
+ ConnectionRef getConnection( sal_Int32 nConnId ) const;
+
+private:
+ /** Inserts the passed connection into the map according to its identifier. */
+ void insertConnectionToMap( const ConnectionRef& rxConnection );
+
+private:
+ typedef RefVector< Connection > ConnectionVector;
+ typedef RefMap< sal_Int32, Connection > ConnectionMap;
+
+ ConnectionVector maConnections;
+ ConnectionMap maConnectionsById;
+ sal_Int32 mnUnusedId;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx
index 85951a5bbfc7..5a9a9085c6c5 100644
--- a/oox/inc/oox/xls/connectionsfragment.hxx
+++ b/oox/inc/oox/xls/connectionsfragment.hxx
@@ -29,31 +29,45 @@
#define OOX_XLS_CONNECTIONSFRAGMENT_HXX
#include "oox/xls/excelhandlers.hxx"
-#include "oox/xls/workbookhelper.hxx"
namespace oox {
namespace xls {
+class Connection;
+
+// ============================================================================
+
+class ConnectionContext : public WorkbookContextBase
+{
+public:
+ explicit ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection );
+
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
+
+private:
+ Connection& mrConnection;
+};
+
// ============================================================================
-class OoxConnectionsFragment : public OoxWorkbookFragmentBase
+class ConnectionsFragment : public WorkbookFragmentBase
{
public:
- explicit OoxConnectionsFragment(
+ explicit ConnectionsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
-private:
- void importConnection( const AttributeList& rAttribs );
- void importWebPr( const AttributeList& rAttribs );
- void importTables( const AttributeList& rAttribs );
- void importS( const AttributeList& rAttribs );
- void importX( const AttributeList& rAttribs );
+ virtual const ::oox::core::RecordInfo* getRecordInfos() const;
+ virtual void finalizeImport();
};
// ============================================================================
@@ -62,4 +76,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx
index 45208f0ac344..5374c47f6a07 100644
--- a/oox/inc/oox/xls/defnamesbuffer.hxx
+++ b/oox/inc/oox/xls/defnamesbuffer.hxx
@@ -28,8 +28,6 @@
#ifndef OOX_XLS_DEFINEDNAMESBUFFER_HXX
#define OOX_XLS_DEFINEDNAMESBUFFER_HXX
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/formulabase.hxx"
namespace com { namespace sun { namespace star {
@@ -45,21 +43,21 @@ class BiffInputStreamPos;
// ============================================================================
// codes for built-in names
-const sal_Unicode OOX_DEFNAME_CONSOLIDATEAREA = '\x00';
-const sal_Unicode OOX_DEFNAME_AUTOOPEN = '\x01';
-const sal_Unicode OOX_DEFNAME_AUTOCLOSE = '\x02';
-const sal_Unicode OOX_DEFNAME_EXTRACT = '\x03';
-const sal_Unicode OOX_DEFNAME_DATABASE = '\x04';
-const sal_Unicode OOX_DEFNAME_CRITERIA = '\x05';
-const sal_Unicode OOX_DEFNAME_PRINTAREA = '\x06';
-const sal_Unicode OOX_DEFNAME_PRINTTITLES = '\x07';
-const sal_Unicode OOX_DEFNAME_RECORDER = '\x08';
-const sal_Unicode OOX_DEFNAME_DATAFORM = '\x09';
-const sal_Unicode OOX_DEFNAME_AUTOACTIVATE = '\x0A';
-const sal_Unicode OOX_DEFNAME_AUTODEACTIVATE = '\x0B';
-const sal_Unicode OOX_DEFNAME_SHEETTITLE = '\x0C';
-const sal_Unicode OOX_DEFNAME_FILTERDATABASE = '\x0D';
-const sal_Unicode OOX_DEFNAME_UNKNOWN = '\x0E';
+const sal_Unicode BIFF_DEFNAME_CONSOLIDATEAREA = '\x00';
+const sal_Unicode BIFF_DEFNAME_AUTOOPEN = '\x01'; // Sheet macro executed when workbook is opened.
+const sal_Unicode BIFF_DEFNAME_AUTOCLOSE = '\x02'; // Sheet macro executed when workbook is closed.
+const sal_Unicode BIFF_DEFNAME_EXTRACT = '\x03'; // Filter output destination for advanced filter.
+const sal_Unicode BIFF_DEFNAME_DATABASE = '\x04';
+const sal_Unicode BIFF_DEFNAME_CRITERIA = '\x05'; // Filter criteria source range for advanced filter.
+const sal_Unicode BIFF_DEFNAME_PRINTAREA = '\x06'; // Print ranges.
+const sal_Unicode BIFF_DEFNAME_PRINTTITLES = '\x07'; // Rows/columns repeated on each page when printing.
+const sal_Unicode BIFF_DEFNAME_RECORDER = '\x08';
+const sal_Unicode BIFF_DEFNAME_DATAFORM = '\x09';
+const sal_Unicode BIFF_DEFNAME_AUTOACTIVATE = '\x0A'; // Sheet macro executed when workbook is activated.
+const sal_Unicode BIFF_DEFNAME_AUTODEACTIVATE = '\x0B'; // Sheet macro executed when workbook is deactivated.
+const sal_Unicode BIFF_DEFNAME_SHEETTITLE = '\x0C';
+const sal_Unicode BIFF_DEFNAME_FILTERDATABASE = '\x0D'; // Sheet range autofilter or advanced filter works on.
+const sal_Unicode BIFF_DEFNAME_UNKNOWN = '\x0E';
// ============================================================================
@@ -69,9 +67,9 @@ struct DefinedNameModel
::rtl::OUString maFormula; /// The formula string.
sal_Int32 mnSheet; /// Sheet index for local names.
sal_Int32 mnFuncGroupId; /// Function group identifier.
- bool mbMacro; /// True = Macro name (VBasic or sheet macro).
+ bool mbMacro; /// True = Macro name (VBA or sheet macro).
bool mbFunction; /// True = function, false = command.
- bool mbVBName; /// True = VBasic macro, false = sheet macro.
+ bool mbVBName; /// True = VBA macro, false = sheet macro.
bool mbHidden; /// True = name hidden in UI.
explicit DefinedNameModel();
@@ -96,10 +94,10 @@ public:
::com::sun::star::uno::Any getReference( const ::com::sun::star::table::CellAddress& rBaseAddress ) const;
protected:
- /** Imports the OOX formula string, using the passed formula context. */
+ /** Imports the OOXML formula string, using the passed formula context. */
void importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet );
- /** Imports the OOBIN formula, using the passed formula context. */
- void importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm );
+ /** Imports the BIFF12 formula, using the passed formula context. */
+ void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm );
/** Imports the BIFF formula, using the passed formula context. */
void importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
@@ -125,7 +123,7 @@ public:
/** Sets the formula string from the body of the definedName element. */
void setFormula( const ::rtl::OUString& rFormula );
/** Imports the defined name from a DEFINEDNAME record in the passed stream. */
- void importDefinedName( RecordInputStream& rStrm );
+ void importDefinedName( SequenceInputStream& rStrm );
/** Imports the defined name from a DEFINEDNAME record in the passed BIFF stream. */
void importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcSheet );
@@ -134,22 +132,26 @@ public:
/** Converts the formula string or BIFF token array for this defined name. */
void convertFormula();
+ /** Returns true, if this defined name is global in the document. */
+ inline bool isGlobalName() const { return mnCalcSheet < 0; }
/** Returns true, if this defined name is a special builtin name. */
- inline bool isBuiltinName() const { return mcBuiltinId != OOX_DEFNAME_UNKNOWN; }
+ inline bool isBuiltinName() const { return mcBuiltinId != BIFF_DEFNAME_UNKNOWN; }
/** Returns true, if this defined name is a macro function call. */
inline bool isMacroFunction() const { return maModel.mbMacro && maModel.mbFunction; }
- /** Returns true, if this defined name is global in the document. */
- inline bool isGlobalName() const { return mnCalcSheet < 0; }
+ /** Returns true, if this defined name is a reference to a VBA macro. */
+ inline bool isVBName() const { return maModel.mbMacro && maModel.mbVBName; }
- /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
- inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
/** Returns the 0-based sheet index for local names, or -1 for global names. */
inline sal_Int16 getLocalCalcSheet() const { return mnCalcSheet; }
+ /** Returns the built-in identifier of the defined name. */
+ inline sal_Unicode getBuiltinId() const { return mcBuiltinId; }
+ /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
+ inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
/** Tries to resolve the defined name to an absolute cell range. */
bool getAbsoluteRange( ::com::sun::star::table::CellRangeAddress& orRange ) const;
private:
- /** Imports the OOX or OOBIN formula, using the passed formula context. */
+ /** Imports the OOXML or BIFF12 formula, using the passed formula context. */
void implImportOoxFormula( FormulaContext& rContext );
/** Imports the BIFF formula, using the passed formula context. */
void implImportBiffFormula( FormulaContext& rContext );
@@ -163,7 +165,7 @@ private:
sal_Int32 mnTokenIndex; /// Name index used in API token array.
sal_Int16 mnCalcSheet; /// Calc sheet index for sheet-local names.
sal_Unicode mcBuiltinId; /// Identifier for built-in defined names.
- StreamDataSeqPtr mxFormula; /// Formula data for OOBIN import.
+ StreamDataSeqPtr mxFormula; /// Formula data for BIFF12 import.
BiffStreamPosPtr mxBiffStrm; /// Cached BIFF stream for formula import.
sal_uInt16 mnFmlaSize; /// Cached BIFF formula size for formula import.
};
@@ -183,7 +185,7 @@ public:
/** Imports a defined name from the passed attribute set. */
DefinedNameRef importDefinedName( const AttributeList& rAttribs );
/** Imports a defined name from a DEFINEDNAME record in the passed stream. */
- void importDefinedName( RecordInputStream& rStrm );
+ void importDefinedName( SequenceInputStream& rStrm );
/** Imports a defined name from a DEFINEDNAME record in the passed BIFF stream. */
void importDefinedName( BiffInputStream& rStrm );
@@ -199,16 +201,27 @@ public:
If no local name is found, tries to find a matching global name.
@return Reference to the defined name or empty reference. */
DefinedNameRef getByModelName( const ::rtl::OUString& rModelName, sal_Int16 nCalcSheet = -1 ) const;
+ /** Returns a built-in defined name by its built-in identifier.
+ @param nSheet The sheet index of the built-in name.
+ @return Reference to the defined name or empty reference. */
+ DefinedNameRef getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const;
private:
DefinedNameRef createDefinedName();
private:
+ typedef ::std::pair< sal_Int16, ::rtl::OUString > SheetNameKey;
+ typedef ::std::pair< sal_Int16, sal_Unicode > BuiltinKey;
+
typedef RefVector< DefinedName > DefNameVector;
- typedef RefMap< sal_Int32, DefinedName > DefNameMap;
+ typedef RefMap< SheetNameKey, DefinedName > DefNameNameMap;
+ typedef RefMap< BuiltinKey, DefinedName > DefNameBuiltinMap;
+ typedef RefMap< sal_Int32, DefinedName > DefNameTokenIdMap;
DefNameVector maDefNames; /// List of all defined names in insertion order.
- DefNameMap maDefNameMap; /// Maps all defined names by API token index.
+ DefNameNameMap maModelNameMap; /// Maps all defined names by sheet index and model name.
+ DefNameBuiltinMap maBuiltinMap; /// Maps all defined names by sheet index and built-in identifier.
+ DefNameTokenIdMap maTokenIdMap; /// Maps all defined names by API token index.
sal_Int16 mnCalcSheet; /// Current sheet index for BIFF2-BIFF4 names (always sheet-local).
};
@@ -218,4 +231,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index 66d716220b8a..0d3360323a94 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -31,14 +31,25 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapegroupcontext.hxx"
+#include "oox/ole/axcontrol.hxx"
+#include "oox/ole/vbaproject.hxx"
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmldrawingfragment.hxx"
+#include "oox/vml/vmltextbox.hxx"
#include "oox/xls/excelhandlers.hxx"
+namespace oox { namespace ole {
+ struct AxFontData;
+ class AxMorphDataModelBase;
+} }
+
namespace oox {
namespace xls {
// ============================================================================
+// DrawingML
+// ============================================================================
/** Absolute position in spreadsheet (in EMUs) independent from cells. */
struct AnchorPosModel : public ::oox::drawingml::EmuPoint
@@ -100,6 +111,7 @@ public:
void importClientData( const AttributeList& rAttribs );
/** Sets an attribute of the cell-dependent anchor position from xdr:from and xdr:to elements. */
void setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
+ /** Imports and converts the VML specific client anchor. */
void importVmlAnchor( const ::rtl::OUString& rAnchor );
/** Returns true, if the anchor contains valid position and size settings. */
@@ -131,19 +143,81 @@ typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
// ============================================================================
+class ShapeMacroAttacher : public ::oox::ole::VbaMacroAttacherBase
+{
+public:
+ explicit ShapeMacroAttacher( const ::rtl::OUString& rMacroName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape );
+
+private:
+ virtual void attachMacro( const ::rtl::OUString& rMacroUrl );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
+};
+
+// ============================================================================
+
+class Shape : public ::oox::drawingml::Shape, public WorksheetHelper
+{
+public:
+ explicit Shape(
+ const WorksheetHelper& rHelper,
+ const AttributeList& rAttribs,
+ const sal_Char* pcServiceName = 0 );
+
+protected:
+ virtual void finalizeXShape(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+private:
+ ::rtl::OUString maMacroName;
+};
+
+// ============================================================================
+
+/** Context handler for creation of shapes embedded in group shapes. */
+class GroupShapeContext : public ::oox::drawingml::ShapeGroupContext, public WorksheetHelper
+{
+public:
+ explicit GroupShapeContext(
+ ::oox::core::ContextHandler& rParent,
+ const WorksheetHelper& rHelper,
+ const ::oox::drawingml::ShapePtr& rxParentShape,
+ const ::oox::drawingml::ShapePtr& rxShape );
+
+ static ::oox::core::ContextHandlerRef
+ createShapeContext(
+ ::oox::core::ContextHandler& rParent,
+ const WorksheetHelper& rHelper,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs,
+ const ::oox::drawingml::ShapePtr& rxParentShape,
+ ::oox::drawingml::ShapePtr* pxShape = 0 );
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ============================================================================
+
/** Fragment handler for a complete sheet drawing. */
-class OoxDrawingFragment : public OoxWorksheetFragmentBase
+class DrawingFragment : public WorksheetFragmentBase
{
public:
- explicit OoxDrawingFragment(
+ explicit DrawingFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
@@ -155,6 +229,27 @@ private:
};
// ============================================================================
+// VML
+// ============================================================================
+
+class VmlControlMacroAttacher : public ::oox::ole::VbaMacroAttacherBase
+{
+public:
+ explicit VmlControlMacroAttacher( const ::rtl::OUString& rMacroName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rxCtrlFormIC,
+ sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle );
+
+private:
+ virtual void attachMacro( const ::rtl::OUString& rMacroUrl );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxCtrlFormIC;
+ sal_Int32 mnCtrlIndex;
+ sal_Int32 mnCtrlType;
+ sal_Int32 mnDropStyle;
+};
+
+// ============================================================================
class VmlDrawing : public ::oox::vml::Drawing, public WorksheetHelper
{
@@ -167,29 +262,55 @@ public:
/** Filters cell note shapes. */
virtual bool isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const;
+ /** Returns additional base names for automatic shape name creation. */
+ virtual ::rtl::OUString getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const;
+
/** Calculates the shape rectangle from a cell anchor string. */
- virtual bool convertShapeClientAnchor(
+ virtual bool convertClientAnchor(
::com::sun::star::awt::Rectangle& orShapeRect,
const ::rtl::OUString& rShapeAnchor ) const;
- /** Converts additional form control properties from the passed VML shape
- client data. */
- virtual void convertControlClientData(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
- const ::oox::vml::ShapeClientData& rClientData ) const;
+ /** Creates a UNO control shape for legacy drawing controls. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertClientXShape(
+ const ::oox::vml::ShapeBase& rShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
/** Updates the bounding box covering all shapes of this drawing. */
- virtual void notifyShapeInserted(
+ virtual void notifyXShapeInserted(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ const ::oox::vml::ShapeBase& rShape, bool bGroupChild );
+
+private:
+ /** Converts the passed VML textbox text color to an OLE color. */
+ sal_uInt32 convertControlTextColor( const ::rtl::OUString& rTextColor ) const;
+ /** Converts the passed VML textbox font to an ActiveX form control font. */
+ void convertControlFontData(
+ ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor,
+ const ::oox::vml::TextFontModel& rFontModel ) const;
+ /** Converts the caption, the font settings, and the horizontal alignment
+ from the passed VML textbox to ActiveX form control settings. */
+ void convertControlText(
+ ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, ::rtl::OUString& rCaption,
+ const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const;
+ /** Converts the passed VML shape background formatting to ActiveX control formatting. */
+ void convertControlBackground(
+ ::oox::ole::AxMorphDataModelBase& rAxModel,
+ const ::oox::vml::ShapeBase& rShape ) const;
+
+private:
+ ::oox::ole::ControlConverter maControlConv;
+ ::oox::vml::TextFontModel maListBoxFont;
};
// ============================================================================
-class OoxVmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
+class VmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
{
public:
- explicit OoxVmlDrawingFragment(
+ explicit VmlDrawingFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
@@ -203,4 +324,3 @@ protected:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/excelchartconverter.hxx b/oox/inc/oox/xls/excelchartconverter.hxx
index 08c3398a5718..a46d484f2074 100644
--- a/oox/inc/oox/xls/excelchartconverter.hxx
+++ b/oox/inc/oox/xls/excelchartconverter.hxx
@@ -59,4 +59,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx
index b5d7a97f33b5..789cbc99cb07 100644
--- a/oox/inc/oox/xls/excelfilter.hxx
+++ b/oox/inc/oox/xls/excelfilter.hxx
@@ -28,8 +28,8 @@
#ifndef OOX_XLS_EXCELFILTER_HXX
#define OOX_XLS_EXCELFILTER_HXX
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/core/binaryfilterbase.hxx"
+#include "oox/core/xmlfilterbase.hxx"
namespace oox {
namespace xls {
@@ -59,7 +59,8 @@ class ExcelFilter : public ::oox::core::XmlFilterBase, public ExcelFilterBase
{
public:
explicit ExcelFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ExcelFilter();
virtual bool importDocument() throw();
@@ -72,6 +73,7 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
};
@@ -81,7 +83,8 @@ class ExcelBiffFilter : public ::oox::core::BinaryFilterBase, public ExcelFilter
{
public:
explicit ExcelBiffFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ExcelBiffFilter();
virtual bool importDocument() throw();
@@ -89,13 +92,28 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
};
// ============================================================================
+class ExcelVbaProjectFilter : public ExcelBiffFilter
+{
+public:
+ explicit ExcelVbaProjectFilter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
+
+private:
+ virtual ::rtl::OUString implGetImplementationName() const;
+};
+ // ============================================================================
+
} // namespace xls
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/excelhandlers.hxx b/oox/inc/oox/xls/excelhandlers.hxx
index 986f42aadba4..864f5f9a9e44 100644
--- a/oox/inc/oox/xls/excelhandlers.hxx
+++ b/oox/inc/oox/xls/excelhandlers.hxx
@@ -41,17 +41,17 @@ namespace xls {
Used to import contexts in global workbook fragments.
*/
-class OoxWorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
+class WorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
{
public:
template< typename ParentType >
- explicit OoxWorkbookContextBase( ParentType& rParent );
+ explicit WorkbookContextBase( ParentType& rParent );
};
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
+WorkbookContextBase::WorkbookContextBase( ParentType& rParent ) :
::oox::core::ContextHandler2( rParent ),
WorkbookHelper( rParent )
{
@@ -63,32 +63,32 @@ OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
Used to import contexts in sheet fragments.
*/
-class OoxWorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
+class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
{
public:
template< typename ParentType >
- explicit OoxWorksheetContextBase(
+ explicit WorksheetContextBase(
ParentType& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
template< typename ParentType >
- explicit OoxWorksheetContextBase( ParentType& rParent );
+ explicit WorksheetContextBase( ParentType& rParent );
};
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
::oox::core::ContextHandler2( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
{
}
template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent ) :
::oox::core::ContextHandler2( rParent ),
WorksheetHelperRoot( rParent )
{
@@ -100,10 +100,10 @@ OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
Used to import global workbook fragments.
*/
-class OoxWorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
+class WorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
{
public:
- explicit OoxWorkbookFragmentBase(
+ explicit WorkbookFragmentBase(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
};
@@ -114,17 +114,17 @@ public:
Used to import sheet fragments.
*/
-class OoxWorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
+class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
{
public:
- explicit OoxWorksheetFragmentBase(
+ explicit WorksheetFragmentBase(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
- explicit OoxWorksheetFragmentBase(
+ explicit WorksheetFragmentBase(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
};
@@ -132,72 +132,21 @@ public:
// ============================================================================
// ============================================================================
-/** An enumeration for all types of fragments in a BIFF workbook stream. */
-enum BiffFragmentType
-{
- BIFF_FRAGMENT_GLOBALS, /// Workbook globals fragment.
- BIFF_FRAGMENT_WORKSHEET, /// Worksheet fragment.
- BIFF_FRAGMENT_CHARTSHEET, /// Chart sheet fragment.
- BIFF_FRAGMENT_MACROSHEET, /// Macro sheet fragment.
- BIFF_FRAGMENT_MODULESHEET, /// BIFF5 VB module fragment.
- BIFF_FRAGMENT_EMPTYSHEET, /// Sheet fragment of unsupported type.
- BIFF_FRAGMENT_WORKSPACE, /// BIFF4 workspace/workbook globals.
- BIFF_FRAGMENT_UNKNOWN /// Unknown fragment/error.
-};
-
-// ============================================================================
-
-/** Base class for all BIFF context handlers and fragment handlers.
-
- This base class holds a reference to the BIFF input stream which can be
- accessed in all derived classes.
- */
-class BiffHandlerBase
-{
-protected:
- inline explicit BiffHandlerBase( BiffInputStream& rStrm ) : mrStrm( rStrm ) {}
- virtual ~BiffHandlerBase();
-
- /** Skips a block of records up to the specified end record.
-
- Skips all records until next end record. When this function returns,
- stream points to the end record, and the next call of startNextRecord()
- at the stream will start the record following the end record.
-
- The identifier of the record that is active while this function is
- called is used as start record identifier. This identifier is used to
- correctly skip embedded record blocks with the same start and end
- record identifier.
-
- @return True = stream points to the end record.
- */
- bool skipRecordBlock( sal_uInt16 nEndRecId );
-
- /** @return True = current record identifier is a BOF record. */
- bool isBofRecord() const;
-
-protected:
- BiffInputStream& mrStrm;
-};
-
-// ============================================================================
-
/** Base class for all BIFF context handlers.
Derived handlers have to implement the importRecord() function that has to
- import the record the BIFF input stream currently points to.
+ import the record the passed BIFF input stream currently points to.
*/
-class BiffContextHandler : public BiffHandlerBase
+class BiffContextHandler
{
public:
- /** Derived classes have to implement importing the current record. */
- virtual void importRecord() = 0;
+ virtual ~BiffContextHandler();
-protected:
- explicit BiffContextHandler( const BiffHandlerBase& rParent );
+ /** Derived classes have to implement importing the current record. */
+ virtual void importRecord( BiffInputStream& rStrm ) = 0;
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Context handler derived from the WorkbookHelper helper class.
@@ -206,21 +155,11 @@ protected:
class BiffWorkbookContextBase : public BiffContextHandler, public WorkbookHelper
{
protected:
- template< typename ParentType >
- explicit BiffWorkbookContextBase( const ParentType& rParent );
+ explicit BiffWorkbookContextBase( const WorkbookHelper& rHelper );
};
// ----------------------------------------------------------------------------
-template< typename ParentType >
-BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
- BiffContextHandler( rParent ),
- WorkbookHelper( rParent )
-{
-}
-
-// ============================================================================
-
/** Context handler derived from the WorksheetHelper helper class.
Used to import contexts in sheet fragments.
@@ -228,68 +167,48 @@ BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelperRoot
{
protected:
- template< typename ParentType >
explicit BiffWorksheetContextBase(
- const ParentType& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const WorkbookHelper& rHelper,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
- template< typename ParentType >
- explicit BiffWorksheetContextBase( const ParentType& rParent );
+ explicit BiffWorksheetContextBase( const WorksheetHelper& rHelper );
};
-// ----------------------------------------------------------------------------
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- BiffContextHandler( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
-{
-}
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent ) :
- BiffContextHandler( rParent ),
- WorksheetHelperRoot( rParent )
-{
-}
-
// ============================================================================
-namespace prv {
-
-struct BiffFragmentStreamOwner
+/** An enumeration for all types of fragments in a BIFF workbook stream. */
+enum BiffFragmentType
{
- typedef ::boost::shared_ptr< BinaryXInputStream > XInputStreamRef;
- typedef ::boost::shared_ptr< BiffInputStream > BiffInputStreamRef;
-
- XInputStreamRef mxXInStrm;
- BiffInputStreamRef mxBiffStrm;
-
- explicit BiffFragmentStreamOwner( const ::oox::core::FilterBase& rFilter, const ::rtl::OUString& rStrmName );
- virtual ~BiffFragmentStreamOwner();
+ BIFF_FRAGMENT_GLOBALS, /// Workbook globals fragment.
+ BIFF_FRAGMENT_WORKSHEET, /// Worksheet fragment.
+ BIFF_FRAGMENT_CHARTSHEET, /// Chart sheet fragment.
+ BIFF_FRAGMENT_MACROSHEET, /// Macro sheet fragment.
+ BIFF_FRAGMENT_MODULESHEET, /// BIFF5 VB module fragment.
+ BIFF_FRAGMENT_EMPTYSHEET, /// Sheet fragment of unsupported type.
+ BIFF_FRAGMENT_WORKSPACE, /// BIFF4 workspace/workbook globals.
+ BIFF_FRAGMENT_UNKNOWN /// Unknown fragment/error.
};
-} // namespace prv
-
// ----------------------------------------------------------------------------
-class BiffFragmentHandler : private prv::BiffFragmentStreamOwner, public BiffHandlerBase
+class BiffFragmentHandler
{
public:
- /** Imports the fragment, returns true, if EOF record has been reached. */
- virtual bool importFragment() = 0;
-
-protected:
/** Opens the stream with the passed full name. */
explicit BiffFragmentHandler(
const ::oox::core::FilterBase& rFilter,
const ::rtl::OUString& rStrmName );
- /** Reuses the stream of the passed fragment. */
- explicit BiffFragmentHandler( const BiffFragmentHandler& rHandler );
+ virtual ~BiffFragmentHandler();
+
+ /** Imports the fragment, returns true, if EOF record has been reached. */
+ virtual bool importFragment() = 0;
+
+protected:
+ /** Returns the BIFF input stream of this fragment. */
+ inline BiffInputStream& getInputStream() { return *mxBiffStrm; }
/** Starts a new fragment in a workbbok stream and returns the fragment type.
@@ -326,11 +245,14 @@ protected:
bool skipFragment();
private:
- /** Implementation helper for the startFragment() functions. */
- BiffFragmentType implStartFragment( BiffType eBiff );
+ typedef ::boost::shared_ptr< BinaryXInputStream > XInputStreamRef;
+ typedef ::boost::shared_ptr< BiffInputStream > BiffInputStreamRef;
+
+ XInputStreamRef mxXInStrm;
+ BiffInputStreamRef mxBiffStrm;
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Fragment handler derived from the WorkbookHelper helper class.
@@ -345,7 +267,7 @@ protected:
bool bCloneDecoder = false );
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Fragment handler derived from the WorksheetHelper helper class.
@@ -356,12 +278,12 @@ class BiffWorksheetFragmentBase : public BiffFragmentHandler, public WorksheetHe
protected:
explicit BiffWorksheetFragmentBase(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Special fragment handler for worksheets that have to be skipped.
*/
@@ -370,7 +292,7 @@ class BiffSkipWorksheetFragment : public BiffWorksheetFragmentBase
public:
explicit BiffSkipWorksheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
virtual bool importFragment();
@@ -383,4 +305,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx
index 121e6a1667cd..96dabd08b5d7 100755
--- a/oox/inc/oox/xls/excelvbaproject.hxx
+++ b/oox/inc/oox/xls/excelvbaproject.hxx
@@ -45,12 +45,9 @@ class OOX_DLLPUBLIC ExcelVbaProject : public ::oox::ole::VbaProject
{
public:
explicit ExcelVbaProject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument );
- /** Generates VBA modules for sheets that do not specify a codename. */
- void createMissingModules();
-
protected:
/** Adds dummy modules for sheets without imported code name. */
virtual void prepareImport();
diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx
index b9980cc21e2f..c616a2b97e97 100644
--- a/oox/inc/oox/xls/externallinkbuffer.hxx
+++ b/oox/inc/oox/xls/externallinkbuffer.hxx
@@ -84,19 +84,19 @@ public:
void importOleItem( const AttributeList& rAttribs );
/** Imports the EXTERNALNAME record containing the name (only). */
- void importExternalName( RecordInputStream& rStrm );
+ void importExternalName( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAMEFLAGS record containing the settings of an external name. */
- void importExternalNameFlags( RecordInputStream& rStrm );
+ void importExternalNameFlags( SequenceInputStream& rStrm );
/** Imports the DDEITEMVALUES record containing the size of the DDE result matrix. */
- void importDdeItemValues( RecordInputStream& rStrm );
+ void importDdeItemValues( SequenceInputStream& rStrm );
/** Imports the DDEITEM_BOOL record containing a boolean value in a link result. */
- void importDdeItemBool( RecordInputStream& rStrm );
+ void importDdeItemBool( SequenceInputStream& rStrm );
/** Imports the DDEITEM_DOUBLE record containing a double value in a link result. */
- void importDdeItemDouble( RecordInputStream& rStrm );
+ void importDdeItemDouble( SequenceInputStream& rStrm );
/** Imports the DDEITEM_ERROR record containing an error code in a link result. */
- void importDdeItemError( RecordInputStream& rStrm );
+ void importDdeItemError( SequenceInputStream& rStrm );
/** Imports the DDEITEM_STRING record containing a string in a link result. */
- void importDdeItemString( RecordInputStream& rStrm );
+ void importDdeItemString( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAME record from the passed stream. */
void importExternalName( BiffInputStream& rStrm );
@@ -227,19 +227,19 @@ public:
ExternalNameRef importOleItem( const AttributeList& rAttribs );
/** Imports the EXTERNALBOOK record describing an externally linked document, DDE link, or OLE link. */
- void importExternalBook( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importExternalBook( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the EXTSHEETNAMES record containing the sheet names in an externally linked document. */
- void importExtSheetNames( RecordInputStream& rStrm );
+ void importExtSheetNames( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAME record describing an external name. */
- ExternalNameRef importExternalName( RecordInputStream& rStrm );
+ ExternalNameRef importExternalName( SequenceInputStream& rStrm );
/** Imports the EXTERNALREF record from the passed stream. */
- void importExternalRef( RecordInputStream& rStrm );
+ void importExternalRef( SequenceInputStream& rStrm );
/** Imports the EXTERNALSELF record from the passed stream. */
- void importExternalSelf( RecordInputStream& rStrm );
+ void importExternalSelf( SequenceInputStream& rStrm );
/** Imports the EXTERNALSAME record from the passed stream. */
- void importExternalSame( RecordInputStream& rStrm );
+ void importExternalSame( SequenceInputStream& rStrm );
/** Imports the EXTERNALADDIN record from the passed stream. */
- void importExternalAddin( RecordInputStream& rStrm );
+ void importExternalAddin( SequenceInputStream& rStrm );
/** Imports the EXTERNSHEET record from the passed stream. */
void importExternSheet( BiffInputStream& rStrm );
@@ -248,6 +248,9 @@ public:
/** Imports the EXTERNALNAME record from the passed stream. */
void importExternalName( BiffInputStream& rStrm );
+ /** Sets the link type to 'self reference'. */
+ inline void setSelfLinkType() { meLinkType = LINKTYPE_SELF; }
+
/** Returns the type of this external link. */
inline ExternalLinkType getLinkType() const { return meLinkType; }
/** Returns true, if the link refers to the current workbook. */
@@ -314,10 +317,10 @@ typedef ::boost::shared_ptr< ExternalLink > ExternalLinkRef;
// ============================================================================
-/** Represents a REF entry in the OOBIN EXTERNALSHEETS or in the BIFF8
+/** Represents a REF entry in the BIFF12 EXTERNALSHEETS or in the BIFF8
EXTERNSHEET record.
- This struct is used to map ref identifiers to external books (OOBIN:
+ This struct is used to map ref identifiers to external books (BIFF12:
EXTERNALREF records, BIFF8: EXTERNALBOOK records), and provides sheet
indexes into the sheet list of the external document.
*/
@@ -329,7 +332,7 @@ struct RefSheetsModel
explicit RefSheetsModel();
- void readOobData( RecordInputStream& rStrm );
+ void readBiff12Data( SequenceInputStream& rStrm );
void readBiff8Data( BiffInputStream& rStrm );
};
@@ -344,15 +347,15 @@ public:
ExternalLinkRef importExternalReference( const AttributeList& rAttribs );
/** Imports the EXTERNALREF record from the passed stream. */
- ExternalLinkRef importExternalRef( RecordInputStream& rStrm );
+ ExternalLinkRef importExternalRef( SequenceInputStream& rStrm );
/** Imports the EXTERNALSELF record from the passed stream. */
- void importExternalSelf( RecordInputStream& rStrm );
+ void importExternalSelf( SequenceInputStream& rStrm );
/** Imports the EXTERNALSAME record from the passed stream. */
- void importExternalSame( RecordInputStream& rStrm );
+ void importExternalSame( SequenceInputStream& rStrm );
/** Imports the EXTERNALADDIN record from the passed stream. */
- void importExternalAddin( RecordInputStream& rStrm );
+ void importExternalAddin( SequenceInputStream& rStrm );
/** Imports the EXTERNALSHEETS record from the passed stream. */
- void importExternalSheets( RecordInputStream& rStrm );
+ void importExternalSheets( SequenceInputStream& rStrm );
/** Imports the EXTERNSHEET record from the passed stream. */
ExternalLinkRef importExternSheet( BiffInputStream& rStrm );
@@ -368,7 +371,7 @@ public:
getLinkInfos() const;
/** Returns the external link for the passed reference identifier. */
- ExternalLinkRef getExternalLink( sal_Int32 nRefId ) const;
+ ExternalLinkRef getExternalLink( sal_Int32 nRefId, bool bUseRefSheets = true ) const;
/** Returns the sheet range for the specified reference (BIFF2-BIFF5 only). */
LinkSheetRange getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const;
@@ -386,10 +389,11 @@ private:
typedef RefVector< ExternalLink > ExternalLinkVec;
typedef ::std::vector< RefSheetsModel > RefSheetsModelVec;
+ ExternalLinkRef mxSelfRef; /// Implicit self reference at index 0.
ExternalLinkVec maLinks; /// List of link structures for all kinds of links.
ExternalLinkVec maExtLinks; /// Real external links needed for formula parser.
RefSheetsModelVec maRefSheets; /// Sheet indexes for reference ids.
- bool mbUseRefSheets; /// True = use maRefSheets list (OOBIN only).
+ bool mbUseRefSheets; /// True = use maRefSheets list (BIFF12 only).
};
// ============================================================================
@@ -398,4 +402,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx
index ec310974818a..0e1f293d2444 100644
--- a/oox/inc/oox/xls/externallinkfragment.hxx
+++ b/oox/inc/oox/xls/externallinkfragment.hxx
@@ -37,41 +37,40 @@ namespace xls {
class ExternalLink;
// ============================================================================
+// ============================================================================
/** This class implements importing the sheetData element in external sheets.
The sheetData element embedded in the externalBook element contains cached
cells from externally linked sheets.
*/
-class OoxExternalSheetDataContext : public OoxWorkbookContextBase
+class ExternalSheetDataContext : public WorkbookContextBase
{
public:
- explicit OoxExternalSheetDataContext(
- OoxWorkbookFragmentBase& rFragment,
+ explicit ExternalSheetDataContext(
+ WorkbookFragmentBase& rFragment,
const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >& rxSheetCache );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Imports cell settings from a c element. */
void importCell( const AttributeList& rAttribs );
/** Imports the EXTCELL_BLANK from the passed stream. */
- void importExtCellBlank( RecordInputStream& rStrm );
+ void importExtCellBlank( SequenceInputStream& rStrm );
/** Imports the EXTCELL_BOOL from the passed stream. */
- void importExtCellBool( RecordInputStream& rStrm );
+ void importExtCellBool( SequenceInputStream& rStrm );
/** Imports the EXTCELL_DOUBLE from the passed stream. */
- void importExtCellDouble( RecordInputStream& rStrm );
+ void importExtCellDouble( SequenceInputStream& rStrm );
/** Imports the EXTCELL_ERROR from the passed stream. */
- void importExtCellError( RecordInputStream& rStrm );
+ void importExtCellError( SequenceInputStream& rStrm );
/** Imports the EXTCELL_STRING from the passed stream. */
- void importExtCellString( RecordInputStream& rStrm );
+ void importExtCellString( SequenceInputStream& rStrm );
/** Sets the passed cell value to the current position in the sheet cache. */
void setCellValue( const ::com::sun::star::uno::Any& rValue );
@@ -85,23 +84,20 @@ private:
// ============================================================================
-class OoxExternalLinkFragment : public OoxWorkbookFragmentBase
+class ExternalLinkFragment : public WorkbookFragmentBase
{
public:
- explicit OoxExternalLinkFragment(
+ explicit ExternalLinkFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
ExternalLink& rExtLink );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
@@ -116,29 +112,24 @@ private:
};
// ============================================================================
+// ============================================================================
-class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+class BiffExternalSheetDataContext : public BiffWorkbookContextBase
{
public:
- explicit BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames );
- virtual ~BiffExternalLinkFragment();
-
- /** Imports all records related to external links. */
- virtual bool importFragment();
+ explicit BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames );
+ virtual ~BiffExternalSheetDataContext();
/** Tries to import a record related to external links and defined names. */
- void importRecord();
-
- /** Finalizes buffers related to external links and defined names. */
- void finalizeImport();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
- void importExternSheet();
- void importExternalBook();
- void importExternalName();
- void importXct();
- void importCrn();
- void importDefinedName();
+ void importExternSheet( BiffInputStream& rStrm );
+ void importExternalBook( BiffInputStream& rStrm );
+ void importExternalName( BiffInputStream& rStrm );
+ void importXct( BiffInputStream& rStrm );
+ void importCrn( BiffInputStream& rStrm );
+ void importDefinedName( BiffInputStream& rStrm );
/** Sets the passed cell value to the passed position in the sheet cache. */
void setCellValue( const BinAddress& rBinAddr, const ::com::sun::star::uno::Any& rValue );
@@ -152,8 +143,19 @@ private:
// ============================================================================
+class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+{
+public:
+ explicit BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent );
+
+ /** Imports all records related to external links. */
+ virtual bool importFragment();
+};
+
+// ============================================================================
+// ============================================================================
+
} // namespace xls
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index 510404d2b662..013e63f3bf30 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -28,19 +28,19 @@
#ifndef OOX_XLS_FORMULABASE_HXX
#define OOX_XLS_FORMULABASE_HXX
-#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
+#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/sheet/FormulaToken.hpp>
-#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include <com/sun/star/uno/Sequence.hxx>
#include "oox/helper/propertyset.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/addressconverter.hxx"
namespace com { namespace sun { namespace star {
+ namespace sheet { class XFormulaOpCodeMapper; }
namespace sheet { class XFormulaParser; }
namespace sheet { class XFormulaTokens; }
- namespace sheet { class XFormulaOpCodeMapper; }
} } }
namespace oox { template< typename Type > class Matrix; }
@@ -126,24 +126,14 @@ const sal_uInt8 BIFF_TOKID_AREAERR3D = 0x1D; /// Deleted 3D area
// specific token constants ---------------------------------------------------
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR = 4;
+const sal_uInt8 BIFF_TOK_ARRAY_DOUBLE = 0; /// Double value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_STRING = 1; /// String value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_BOOL = 2; /// Boolean value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_ERROR = 4; /// Error code in an array.
const sal_uInt8 BIFF_TOK_BOOL_FALSE = 0; /// FALSE value of a tBool token.
const sal_uInt8 BIFF_TOK_BOOL_TRUE = 1; /// TRUE value of a tBool token.
-const sal_uInt8 OOBIN_TOK_ATTR_VOLATILE = 0x01; /// Volatile function.
-const sal_uInt8 OOBIN_TOK_ATTR_IF = 0x02; /// Start of true condition in IF function.
-const sal_uInt8 OOBIN_TOK_ATTR_CHOOSE = 0x04; /// Jump array of CHOOSE function.
-const sal_uInt8 OOBIN_TOK_ATTR_SKIP = 0x08; /// Skip tokens.
-const sal_uInt8 OOBIN_TOK_ATTR_SUM = 0x10; /// SUM function with one parameter.
-const sal_uInt8 OOBIN_TOK_ATTR_ASSIGN = 0x20; /// BASIC style assignment.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE = 0x40; /// Spaces in formula representation.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE_VOLATILE = 0x41; /// Leading spaces and volatile formula.
-const sal_uInt8 OOBIN_TOK_ATTR_IFERROR = 0x80; /// Start of condition in IFERROR function.
-
const sal_uInt8 BIFF_TOK_ATTR_VOLATILE = 0x01; /// Volatile function.
const sal_uInt8 BIFF_TOK_ATTR_IF = 0x02; /// Start of true condition in IF function.
const sal_uInt8 BIFF_TOK_ATTR_CHOOSE = 0x04; /// Jump array of CHOOSE function.
@@ -152,6 +142,7 @@ const sal_uInt8 BIFF_TOK_ATTR_SUM = 0x10; /// SUM function wit
const sal_uInt8 BIFF_TOK_ATTR_ASSIGN = 0x20; /// BASIC style assignment.
const sal_uInt8 BIFF_TOK_ATTR_SPACE = 0x40; /// Spaces in formula representation.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_VOLATILE = 0x41; /// Leading spaces and volatile formula.
+const sal_uInt8 BIFF_TOK_ATTR_IFERROR = 0x80; /// Start of condition in IFERROR function (BIFF12 only).
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP = 0x00; /// Spaces before next token.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR = 0x01; /// Line breaks before next token.
@@ -166,27 +157,27 @@ const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK = 0x7FFF; /// Mask for functio
const sal_uInt8 BIFF_TOK_FUNCVAR_CMDPROMPT = 0x80; /// User prompt for macro commands.
const sal_uInt8 BIFF_TOK_FUNCVAR_COUNTMASK = 0x7F; /// Mask for parameter count.
-const sal_uInt16 OOBIN_TOK_REF_COLMASK = 0x3FFF; /// Mask to extract column from reference.
-const sal_Int32 OOBIN_TOK_REF_ROWMASK = 0xFFFFF; /// Mask to extract row from reference.
-const sal_uInt16 OOBIN_TOK_REF_COLREL = 0x4000; /// True = column is relative.
-const sal_uInt16 OOBIN_TOK_REF_ROWREL = 0x8000; /// True = row is relative.
+const sal_uInt16 BIFF12_TOK_REF_COLMASK = 0x3FFF; /// Mask to extract column from reference (BIFF12).
+const sal_Int32 BIFF12_TOK_REF_ROWMASK = 0xFFFFF; /// Mask to extract row from reference (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_COLREL = 0x4000; /// True = column is relative (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_ROWREL = 0x8000; /// True = row is relative (BIFF12).
const sal_uInt16 BIFF_TOK_REF_COLMASK = 0x00FF; /// Mask to extract BIFF8 column from reference.
const sal_uInt16 BIFF_TOK_REF_ROWMASK = 0x3FFF; /// Mask to extract BIFF2-BIFF5 row from reference.
const sal_uInt16 BIFF_TOK_REF_COLREL = 0x4000; /// True = column is relative.
const sal_uInt16 BIFF_TOK_REF_ROWREL = 0x8000; /// True = row is relative.
-const sal_uInt16 OOBIN_TOK_TABLE_COLUMN = 0x0001; /// Table reference: Single column.
-const sal_uInt16 OOBIN_TOK_TABLE_COLRANGE = 0x0002; /// Table reference: Range of columns.
-const sal_uInt16 OOBIN_TOK_TABLE_ALL = 0x0004; /// Table reference: Special [#All] range.
-const sal_uInt16 OOBIN_TOK_TABLE_HEADERS = 0x0008; /// Table reference: Special [#Headers] range.
-const sal_uInt16 OOBIN_TOK_TABLE_DATA = 0x0010; /// Table reference: Special [#Data] range.
-const sal_uInt16 OOBIN_TOK_TABLE_TOTALS = 0x0020; /// Table reference: Special [#Totals] range.
-const sal_uInt16 OOBIN_TOK_TABLE_THISROW = 0x0040; /// Table reference: Special [#This Row] range.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_BRACKETS = 0x0080; /// Table reference: Spaces in outer brackets.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_SEP = 0x0100; /// Table reference: Spaces after separators.
-const sal_uInt16 OOBIN_TOK_TABLE_ROW = 0x0200; /// Table reference: Single row.
-const sal_uInt16 OOBIN_TOK_TABLE_CELL = 0x0400; /// Table reference: Single cell.
+const sal_uInt16 BIFF12_TOK_TABLE_COLUMN = 0x0001; /// Table reference: Single column.
+const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE = 0x0002; /// Table reference: Range of columns.
+const sal_uInt16 BIFF12_TOK_TABLE_ALL = 0x0004; /// Table reference: Special [#All] range.
+const sal_uInt16 BIFF12_TOK_TABLE_HEADERS = 0x0008; /// Table reference: Special [#Headers] range.
+const sal_uInt16 BIFF12_TOK_TABLE_DATA = 0x0010; /// Table reference: Special [#Data] range.
+const sal_uInt16 BIFF12_TOK_TABLE_TOTALS = 0x0020; /// Table reference: Special [#Totals] range.
+const sal_uInt16 BIFF12_TOK_TABLE_THISROW = 0x0040; /// Table reference: Special [#This Row] range.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS = 0x0080; /// Table reference: Spaces in outer brackets.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP = 0x0100; /// Table reference: Spaces after separators.
+const sal_uInt16 BIFF12_TOK_TABLE_ROW = 0x0200; /// Table reference: Single row.
+const sal_uInt16 BIFF12_TOK_TABLE_CELL = 0x0400; /// Table reference: Single cell.
const sal_uInt8 BIFF_TOK_NLR_ERR = 0x01; /// NLR: Invalid/deleted.
const sal_uInt8 BIFF_TOK_NLR_ROWR = 0x02; /// NLR: Row index.
@@ -209,23 +200,21 @@ const sal_uInt32 BIFF_TOK_NLR_ADDMASK = 0x3FFFFFFF; /// Mask for num
// function constants ---------------------------------------------------------
-const sal_uInt8 OOX_MAX_PARAMCOUNT = 255; /// Maximum parameter count for OOXML/OOBIN files.
-const sal_uInt8 BIFF_MAX_PARAMCOUNT = 30; /// Maximum parameter count for BIFF files.
-
-const sal_uInt16 OOBIN_FUNC_IF = 1; /// OOBIN function id of the IF function.
-const sal_uInt16 OOBIN_FUNC_SUM = 4; /// OOBIN function id of the SUM function.
-const sal_uInt16 OOBIN_FUNC_TRUE = 34; /// OOBIN function id of the TRUE function.
-const sal_uInt16 OOBIN_FUNC_FALSE = 35; /// OOBIN function id of the FALSE function.
-const sal_uInt16 OOBIN_FUNC_ROWS = 76; /// OOBIN function id of the ROWS function.
-const sal_uInt16 OOBIN_FUNC_COLUMNS = 77; /// OOBIN function id of the COLUMNS function.
-const sal_uInt16 OOBIN_FUNC_OFFSET = 78; /// OOBIN function id of the OFFSET function.
-const sal_uInt16 OOBIN_FUNC_FLOOR = 285; /// OOBIN function id of the FLOOR function.
-const sal_uInt16 OOBIN_FUNC_CEILING = 288; /// OOBIN function id of the CEILING function.
-const sal_uInt16 OOBIN_FUNC_HYPERLINK = 359; /// OOBIN function id of the HYPERLINK function.
-const sal_uInt16 OOBIN_FUNC_WEEKNUM = 465; /// OOBIN function id of the WEEKNUM function.
-
-const sal_uInt16 BIFF_FUNC_SUM = 4; /// BIFF function id of the SUM function.
+const sal_uInt8 OOX_MAX_PARAMCOUNT = 255; /// Maximum parameter count for OOXML/BIFF12 files.
+const sal_uInt8 BIFF_MAX_PARAMCOUNT = 30; /// Maximum parameter count for BIFF2-BIFF8 files.
+
+const sal_uInt16 BIFF_FUNC_IF = 1; /// Function identifier of the IF function.
+const sal_uInt16 BIFF_FUNC_SUM = 4; /// Function identifier of the SUM function.
+const sal_uInt16 BIFF_FUNC_TRUE = 34; /// Function identifier of the TRUE function.
+const sal_uInt16 BIFF_FUNC_FALSE = 35; /// Function identifier of the FALSE function.
+const sal_uInt16 BIFF_FUNC_ROWS = 76; /// Function identifier of the ROWS function.
+const sal_uInt16 BIFF_FUNC_COLUMNS = 77; /// Function identifier of the COLUMNS function.
+const sal_uInt16 BIFF_FUNC_OFFSET = 78; /// Function identifier of the OFFSET function.
const sal_uInt16 BIFF_FUNC_EXTERNCALL = 255; /// BIFF function id of the EXTERN.CALL function.
+const sal_uInt16 BIFF_FUNC_FLOOR = 285; /// Function identifier of the FLOOR function.
+const sal_uInt16 BIFF_FUNC_CEILING = 288; /// Function identifier of the CEILING function.
+const sal_uInt16 BIFF_FUNC_HYPERLINK = 359; /// Function identifier of the HYPERLINK function.
+const sal_uInt16 BIFF_FUNC_WEEKNUM = 465; /// Function identifier of the WEEKNUM function.
// reference helpers ==========================================================
@@ -239,11 +228,11 @@ struct BinSingleRef2d
explicit BinSingleRef2d();
- void setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
+ void setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
void setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
void setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
- void readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+ void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
};
@@ -256,7 +245,7 @@ struct BinComplexRef2d
BinSingleRef2d maRef1; /// Start (top-left) cell address.
BinSingleRef2d maRef2; /// End (bottom-right) cell address.
- void readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+ void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
};
@@ -495,8 +484,8 @@ struct FunctionInfo
::rtl::OUString maExtProgName; /// Programmatic function name for external functions.
FunctionLibraryType meFuncLibType; /// The external library this function is part of.
sal_Int32 mnApiOpCode; /// API function opcode.
- sal_uInt16 mnOobFuncId; /// OOBIN function identifier.
- sal_uInt16 mnBiffFuncId; /// BIFF function identifier.
+ sal_uInt16 mnBiff12FuncId; /// BIFF12 function identifier.
+ sal_uInt16 mnBiffFuncId; /// BIFF2-BIFF8 function identifier.
sal_uInt8 mnMinParamCount; /// Minimum number of parameters.
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
@@ -551,13 +540,13 @@ public:
/** Returns the function info for an ODF function name, or 0 on error. */
const FunctionInfo* getFuncInfoFromOdfFuncName( const ::rtl::OUString& rFuncName ) const;
- /** Returns the function info for an OOX function name, or 0 on error. */
+ /** Returns the function info for an OOXML function name, or 0 on error. */
const FunctionInfo* getFuncInfoFromOoxFuncName( const ::rtl::OUString& rFuncName ) const;
- /** Returns the function info for an OOBIN function index, or 0 on error. */
- const FunctionInfo* getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const;
+ /** Returns the function info for a BIFF12 function index, or 0 on error. */
+ const FunctionInfo* getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const;
- /** Returns the function info for a BIFF function index, or 0 on error. */
+ /** Returns the function info for a BIFF2-BIFF8 function index, or 0 on error. */
const FunctionInfo* getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const;
/** Returns the function info for a macro function referred by the
@@ -599,7 +588,7 @@ public:
/** Returns the function info for an API token, or 0 on error. */
const FunctionInfo* getFuncInfoFromApiToken( const ApiToken& rToken ) const;
- /** Returns the op-code map that is used by the OOX formula parser. */
+ /** Returns the op-code map that is used by the OOXML formula parser. */
::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry >
getOoxParserMap() const;
@@ -933,4 +922,3 @@ public:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx
index 0227e8efee6d..c595993264d9 100644
--- a/oox/inc/oox/xls/formulaparser.hxx
+++ b/oox/inc/oox/xls/formulaparser.hxx
@@ -100,9 +100,9 @@ private:
class FormulaParserImpl;
-/** Import formula parser for OOX and BIFF filters.
+/** Import formula parser for OOXML and BIFF filters.
- This class implements formula import for the OOX and BIFF filter. One
+ This class implements formula import for the OOXML and BIFF filter. One
instance is contained in the global filter data to prevent construction and
destruction of internal buffers for every imported formula.
*/
@@ -112,17 +112,17 @@ public:
explicit FormulaParser( const WorkbookHelper& rHelper );
virtual ~FormulaParser();
- /** Converts an XML formula string. */
+ /** Converts an OOXML formula string. */
void importFormula(
FormulaContext& rContext,
const ::rtl::OUString& rFormulaString ) const;
- /** Imports and converts a OOBIN token array from the passed stream. */
+ /** Imports and converts a BIFF12 token array from the passed stream. */
void importFormula(
FormulaContext& rContext,
- RecordInputStream& rStrm ) const;
+ SequenceInputStream& rStrm ) const;
- /** Imports and converts a BIFF token array from the passed stream.
+ /** Imports and converts a BIFF2-BIFF8 token array from the passed stream.
@param pnFmlaSize Size of the token array. If null is passed, reads
it from stream (1 byte in BIFF2, 2 bytes otherwise) first. */
void importFormula(
@@ -150,13 +150,16 @@ public:
::rtl::OUString importOleTargetLink( const ::rtl::OUString& rFormulaString );
/** Imports and converts an OLE link target from the passed stream. */
- ::rtl::OUString importOleTargetLink( RecordInputStream& rStrm );
+ ::rtl::OUString importOleTargetLink( SequenceInputStream& rStrm );
/** Imports and converts an OLE link target from the passed stream. */
::rtl::OUString importOleTargetLink(
BiffInputStream& rStrm,
const sal_uInt16* pnFmlaSize = 0 ) const;
+ /** Converts the passed formula to a macro name for a drawing shape. */
+ ::rtl::OUString importMacroName( const ::rtl::OUString& rFormulaString );
+
private:
::std::auto_ptr< FormulaParserImpl > mxImpl;
};
@@ -167,4 +170,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/numberformatsbuffer.hxx b/oox/inc/oox/xls/numberformatsbuffer.hxx
index 59a2c4e9324e..768572a5839c 100644
--- a/oox/inc/oox/xls/numberformatsbuffer.hxx
+++ b/oox/inc/oox/xls/numberformatsbuffer.hxx
@@ -29,7 +29,6 @@
#define OOX_XLS_NUMBERFORMATSBUFFER_HXX
#include <com/sun/star/lang/Locale.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -109,7 +108,7 @@ public:
/** Inserts a new number format code. */
NumberFormatRef importNumFmt( const AttributeList& rAttribs );
/** Inserts a new number format code from a NUMFMT record. */
- void importNumFmt( RecordInputStream& rStrm );
+ void importNumFmt( SequenceInputStream& rStrm );
/** Inserts a new number format code from a FORMAT record. */
void importFormat( BiffInputStream& rStrm );
@@ -137,4 +136,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/ooxformulaparser.hxx b/oox/inc/oox/xls/ooxformulaparser.hxx
index 1c20febf5f43..7bc1bbdd4909 100644
--- a/oox/inc/oox/xls/ooxformulaparser.hxx
+++ b/oox/inc/oox/xls/ooxformulaparser.hxx
@@ -109,4 +109,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/pagesettings.hxx b/oox/inc/oox/xls/pagesettings.hxx
index eb163daf94c8..6ff896b1bb51 100644
--- a/oox/inc/oox/xls/pagesettings.hxx
+++ b/oox/inc/oox/xls/pagesettings.hxx
@@ -83,8 +83,8 @@ struct PageSettingsModel
explicit PageSettingsModel();
- /** Sets the OOBIN or BIFF print errors mode. */
- void setBinPrintErrors( sal_uInt8 nPrintErrors );
+ /** Sets the BIFF print errors mode. */
+ void setBiffPrintErrors( sal_uInt8 nPrintErrors );
};
// ============================================================================
@@ -110,17 +110,17 @@ public:
void importPicture( const ::oox::core::Relations& rRelations, const AttributeList& rAttribs );
/** Imports the PRINTOPTIONS record from the passed stream. */
- void importPrintOptions( RecordInputStream& rStrm );
+ void importPrintOptions( SequenceInputStream& rStrm );
/** Imports the PAGEMARGINS record from the passed stream. */
- void importPageMargins( RecordInputStream& rStrm );
+ void importPageMargins( SequenceInputStream& rStrm );
/** Imports the PAGESETUP record from the passed stream. */
- void importPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the CHARTPAGESETUP record from the passed stream. */
- void importChartPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importChartPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the HEADERFOOTER record from the passed stream. */
- void importHeaderFooter( RecordInputStream& rStrm );
+ void importHeaderFooter( SequenceInputStream& rStrm );
/** Imports the PICTURE record from the passed stream. */
- void importPicture( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importPicture( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the LEFTMARGIN record from the passed BIFF stream. */
void importLeftMargin( BiffInputStream& rStrm );
@@ -217,4 +217,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx
index 8f79ab0685b3..2e32d0faa7e5 100644
--- a/oox/inc/oox/xls/pivotcachebuffer.hxx
+++ b/oox/inc/oox/xls/pivotcachebuffer.hxx
@@ -28,10 +28,10 @@
#ifndef OOX_XLS_PIVOTCACHEBUFFER_HXX
#define OOX_XLS_PIVOTCACHEBUFFER_HXX
-#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include <com/sun/star/util/DateTime.hpp>
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -66,17 +66,17 @@ public:
void readIndex( const AttributeList& rAttribs );
/** Reads the string value from a pivot cache item. */
- void readString( RecordInputStream& rStrm );
+ void readString( SequenceInputStream& rStrm );
/** Reads the double value from a pivot cache item. */
- void readDouble( RecordInputStream& rStrm );
+ void readDouble( SequenceInputStream& rStrm );
/** Reads the date/time value from a pivot cache item. */
- void readDate( RecordInputStream& rStrm );
+ void readDate( SequenceInputStream& rStrm );
/** Reads the boolean value from a pivot cache item. */
- void readBool( RecordInputStream& rStrm );
+ void readBool( SequenceInputStream& rStrm );
/** Reads the error code value from a pivot cache item. */
- void readError( RecordInputStream& rStrm );
+ void readError( SequenceInputStream& rStrm );
/** Reads the index of a shared item. */
- void readIndex( RecordInputStream& rStrm );
+ void readIndex( SequenceInputStream& rStrm );
/** Reads the string value from a pivot cache item. */
void readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper );
@@ -100,7 +100,7 @@ public:
private:
::com::sun::star::uno::Any maValue; /// Value of the item.
- sal_Int32 mnType; /// Value type (OOX token identifier).
+ sal_Int32 mnType; /// Value type (OOXML token identifier).
};
// ----------------------------------------------------------------------------
@@ -113,7 +113,7 @@ public:
/** Imports the item from the passed attribute list. */
void importItem( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the item from the passed stream and record. */
- void importItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports a complete item list from the passed stream. */
void importItemList( BiffInputStream& rStrm, sal_uInt16 nCount );
@@ -131,7 +131,7 @@ private:
/** Creates and returns a new item at the end of the items list. */
PivotCacheItem& createItem();
/** Imports an array of items from the PCITEM_ARRAY record */
- void importArray( RecordInputStream& rStrm );
+ void importArray( SequenceInputStream& rStrm );
private:
typedef ::std::vector< PivotCacheItem > CacheItemVector;
@@ -196,8 +196,8 @@ struct PCFieldGroupModel
explicit PCFieldGroupModel();
- /** Sets the group-by value for BIFF/OOBIN import. */
- void setBinGroupBy( sal_uInt8 nGroupBy );
+ /** Sets the group-by value for BIFF import. */
+ void setBiffGroupBy( sal_uInt8 nGroupBy );
};
// ----------------------------------------------------------------------------
@@ -237,19 +237,19 @@ public:
void importGroupItem( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports pivot cache field settings from the PCDFIELD record. */
- void importPCDField( RecordInputStream& rStrm );
+ void importPCDField( SequenceInputStream& rStrm );
/** Imports shared items settings from the PCDFSHAREDITEMS record. */
- void importPCDFSharedItems( RecordInputStream& rStrm );
+ void importPCDFSharedItems( SequenceInputStream& rStrm );
/** Imports one or more shared items from the passed record. */
- void importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports grouping settings from the PCDFIELDGROUP record. */
- void importPCDFieldGroup( RecordInputStream& rStrm );
+ void importPCDFieldGroup( SequenceInputStream& rStrm );
/** Imports numeric grouping settings from the PCDFRANGEPR record. */
- void importPCDFRangePr( RecordInputStream& rStrm );
+ void importPCDFRangePr( SequenceInputStream& rStrm );
/** Imports an item of the mapping between group items and base items from the passed record. */
- void importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports one or more group items from the passed record. */
- void importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports pivot cache field settings from the PCDFIELD record. */
void importPCDField( BiffInputStream& rStrm );
@@ -304,7 +304,7 @@ public:
const PivotCacheItem& rItem ) const;
/** Reads an item from the PCRECORD record and writes it to the passed sheet. */
- void importPCRecordItem( RecordInputStream& rStrm,
+ void importPCRecordItem( SequenceInputStream& rStrm,
WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const;
/** Reads an item index from the PCITEM_INDEXLIST record and writes the item to the passed sheet. */
void importPCItemIndex( BiffInputStream& rStrm,
@@ -392,11 +392,11 @@ public:
void importWorksheetSource( const AttributeList& rAttribs, const ::oox::core::Relations& rRelations );
/** Reads pivot cache global settings from the PCDEFINITION record. */
- void importPCDefinition( RecordInputStream& rStrm );
+ void importPCDefinition( SequenceInputStream& rStrm );
/** Reads cache source settings from the PCDSOURCE record. */
- void importPCDSource( RecordInputStream& rStrm );
+ void importPCDSource( SequenceInputStream& rStrm );
/** Reads sheet source settings from the PCDSHEETSOURCE record. */
- void importPCDSheetSource( RecordInputStream& rStrm, const ::oox::core::Relations& rRelations );
+ void importPCDSheetSource( SequenceInputStream& rStrm, const ::oox::core::Relations& rRelations );
/** Reads cache source settings from the PCDSOURCE record. */
void importPCDSource( BiffInputStream& rStrm );
@@ -434,7 +434,7 @@ public:
const PivotCacheItem& rItem ) const;
/** Reads a PCRECORD record and writes all item values to the passed sheet. */
- void importPCRecord( RecordInputStream& rStrm,
+ void importPCRecord( SequenceInputStream& rStrm,
WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const;
/** Reads a PCITEM_INDEXLIST record and writes all item values to the passed sheet. */
void importPCItemIndexList( BiffInputStream& rStrm,
@@ -479,9 +479,9 @@ class PivotCacheBuffer : public WorkbookHelper
public:
explicit PivotCacheBuffer( const WorkbookHelper& rHelper );
- /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOX/OOBIN only). */
+ /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOXML/BIFF12 only). */
void registerPivotCacheFragment( sal_Int32 nCacheId, const ::rtl::OUString& rFragmentPath );
- /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF only). */
+ /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF2-BIFF8 only). */
void importPivotCacheRef( BiffInputStream& rStrm );
/** Imports and stores a pivot cache definition fragment on first call,
@@ -508,4 +508,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx
index 745208f485e6..34a833e26525 100644
--- a/oox/inc/oox/xls/pivotcachefragment.hxx
+++ b/oox/inc/oox/xls/pivotcachefragment.hxx
@@ -38,18 +38,18 @@ class PivotCacheField;
// ============================================================================
-class OoxPivotCacheFieldContext : public OoxWorkbookContextBase
+class PivotCacheFieldContext : public WorkbookContextBase
{
public:
- explicit OoxPivotCacheFieldContext(
- OoxWorkbookFragmentBase& rFragment,
+ explicit PivotCacheFieldContext(
+ WorkbookFragmentBase& rFragment,
PivotCacheField& rCacheField );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotCacheField& mrCacheField;
@@ -57,17 +57,17 @@ private:
// ============================================================================
-class OoxPivotCacheDefinitionFragment : public OoxWorkbookFragmentBase
+class PivotCacheDefinitionFragment : public WorkbookFragmentBase
{
public:
- explicit OoxPivotCacheDefinitionFragment(
+ explicit PivotCacheDefinitionFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
PivotCache& rPivotCache );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -77,23 +77,23 @@ private:
// ============================================================================
-class OoxPivotCacheRecordsFragment : public OoxWorksheetFragmentBase
+class PivotCacheRecordsFragment : public WorksheetFragmentBase
{
public:
- explicit OoxPivotCacheRecordsFragment(
+ explicit PivotCacheRecordsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
const PivotCache& rPivotCache );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
void startCacheRecord();
- void importPCRecord( RecordInputStream& rStrm );
- void importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCRecord( SequenceInputStream& rStrm );
+ void importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
const PivotCache& mrPivotCache;
@@ -126,12 +126,12 @@ class BiffPivotCacheRecordsContext : public BiffWorksheetContextBase
{
public:
explicit BiffPivotCacheRecordsContext(
- const BiffWorkbookFragmentBase& rFragment,
+ const WorkbookHelper& rHelper,
const PivotCache& rPivotCache );
/** Reads the current record from stream and tries to insert a cell into
the source data sheet. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
void startNextRow();
@@ -153,4 +153,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/pivottablebuffer.hxx b/oox/inc/oox/xls/pivottablebuffer.hxx
index 6fde212f0018..7732037bd579 100644
--- a/oox/inc/oox/xls/pivottablebuffer.hxx
+++ b/oox/inc/oox/xls/pivottablebuffer.hxx
@@ -29,9 +29,8 @@
#define OOX_XLS_PIVOTTABLEBUFFER_HXX
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/pivotcachebuffer.hxx"
-#include "oox/xls/workbookhelper.hxx"
+#include "oox/xls/stylesbuffer.hxx"
namespace com { namespace sun { namespace star {
namespace sheet { class XDataPilotDescriptor; }
@@ -54,8 +53,8 @@ struct PTFieldItemModel
explicit PTFieldItemModel();
- /** Sets item type for BIFF/OOBIN import. */
- void setBinType( sal_uInt16 nType );
+ /** Sets item type for BIFF import. */
+ void setBiffType( sal_uInt16 nType );
};
// ----------------------------------------------------------------------------
@@ -93,8 +92,8 @@ struct PTFieldModel
explicit PTFieldModel();
- /** Sets axis type for BIFF/OOBIN import. */
- void setBinAxis( sal_uInt8 nAxisFlags );
+ /** Sets axis type for BIFF import. */
+ void setBiffAxis( sal_uInt8 nAxisFlags );
};
// ----------------------------------------------------------------------------
@@ -122,10 +121,10 @@ struct PTDataFieldModel
explicit PTDataFieldModel();
- /** Sets the subtotal aggregation function for BIFF/OOBIN import. */
- void setBinSubtotal( sal_Int32 nSubtotal );
- /** Sets the 'show data as' type for BIFF/OOBIN import. */
- void setBinShowDataAs( sal_Int32 nShowDataAs );
+ /** Sets the subtotal aggregation function for BIFF import. */
+ void setBiffSubtotal( sal_Int32 nSubtotal );
+ /** Sets the 'show data as' type for BIFF import. */
+ void setBiffShowDataAs( sal_Int32 nShowDataAs );
};
// ----------------------------------------------------------------------------
@@ -145,13 +144,13 @@ public:
void importReferenceItem( const AttributeList& rAttribs );
/** Imports pivot field settings from the PTFIELD record. */
- void importPTField( RecordInputStream& rStrm );
+ void importPTField( SequenceInputStream& rStrm );
/** Imports settings of an item in this pivot field from the PTFITEM record. */
- void importPTFItem( RecordInputStream& rStrm );
+ void importPTFItem( SequenceInputStream& rStrm );
/** Imports pivot field reference settings from the PTREFERENCE record. */
- void importPTReference( RecordInputStream& rStrm );
+ void importPTReference( SequenceInputStream& rStrm );
/** Imports pivot field item reference settings from the PTREFERENCEITEM record. */
- void importPTReferenceItem( RecordInputStream& rStrm );
+ void importPTReferenceItem( SequenceInputStream& rStrm );
/** Imports pivot field settings from the PTFIELD and following records. */
void importPTField( BiffInputStream& rStrm );
@@ -235,9 +234,9 @@ public:
void importTop10( const AttributeList& rAttribs );
/** Reads the settings of a field filter from the PTFILTER record. */
- void importPTFilter( RecordInputStream& rStrm );
+ void importPTFilter( SequenceInputStream& rStrm );
/** Reads additional settings of a field filter from the TOP10FILTER record. */
- void importTop10Filter( RecordInputStream& rStrm );
+ void importTop10Filter( SequenceInputStream& rStrm );
/** Applies the filter to the associated pivot table field if possible. */
void finalizeImport();
@@ -249,7 +248,7 @@ private:
// ============================================================================
-struct PTDefinitionModel
+struct PTDefinitionModel : public AutoFormatModel
{
::rtl::OUString maName;
::rtl::OUString maDataCaption;
@@ -281,6 +280,7 @@ struct PTDefinitionModel
bool mbPrintDrill;
bool mbEnableDrill;
bool mbPreserveFormatting;
+ bool mbUseAutoFormat;
bool mbPageOverThenDown;
bool mbSubtotalHiddenItems;
bool mbRowGrandTotals;
@@ -333,17 +333,17 @@ public:
void importDataField( const AttributeList& rAttribs );
/** Reads global pivot table settings from the PTDEFINITION record. */
- void importPTDefinition( RecordInputStream& rStrm );
+ void importPTDefinition( SequenceInputStream& rStrm );
/** Reads the location of the pivot table from the PTLOCATION record. */
- void importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet );
+ void importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet );
/** Reads the indexes of all fields located in the row dimension from a PTROWFIELDS record. */
- void importPTRowFields( RecordInputStream& rStrm );
+ void importPTRowFields( SequenceInputStream& rStrm );
/** Reads the indexes of all fields located in the column dimension from a PTCOLFIELDS record. */
- void importPTColFields( RecordInputStream& rStrm );
+ void importPTColFields( SequenceInputStream& rStrm );
/** Reads the settings of a field located in the page dimension from the PTPAGEFIELD record. */
- void importPTPageField( RecordInputStream& rStrm );
+ void importPTPageField( SequenceInputStream& rStrm );
/** Reads the settings of a field located in the data dimension from the PTDATAFIELD record. */
- void importPTDataField( RecordInputStream& rStrm );
+ void importPTDataField( SequenceInputStream& rStrm );
/** Reads global pivot table settings from the PTDEFINITION record. */
void importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet );
@@ -403,7 +403,7 @@ private:
/** Reads a field index for the row or column dimension. */
static void importField( IndexVector& orFields, const AttributeList& rAttribs );
/** Reads an array of field indexes for the row or column dimension. */
- static void importFields( IndexVector& orFields, RecordInputStream& rStrm );
+ static void importFields( IndexVector& orFields, SequenceInputStream& rStrm );
/** Reads an array of field indexes for the row or column dimension. */
static void importFields( IndexVector& orFields, BiffInputStream& rStrm, sal_Int32 nCount );
@@ -446,4 +446,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx
index 59c86b4ba3cb..aafae063990c 100644
--- a/oox/inc/oox/xls/pivottablefragment.hxx
+++ b/oox/inc/oox/xls/pivottablefragment.hxx
@@ -40,18 +40,18 @@ class PivotTableFilter;
// ============================================================================
-class OoxPivotTableFieldContext : public OoxWorksheetContextBase
+class PivotTableFieldContext : public WorksheetContextBase
{
public:
- explicit OoxPivotTableFieldContext(
- OoxWorksheetFragmentBase& rFragment,
+ explicit PivotTableFieldContext(
+ WorksheetFragmentBase& rFragment,
PivotTableField& rTableField );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotTableField& mrTableField;
@@ -59,18 +59,18 @@ private:
// ============================================================================
-class OoxPivotTableFilterContext : public OoxWorksheetContextBase
+class PivotTableFilterContext : public WorksheetContextBase
{
public:
- explicit OoxPivotTableFilterContext(
- OoxWorksheetFragmentBase& rFragment,
+ explicit PivotTableFilterContext(
+ WorksheetFragmentBase& rFragment,
PivotTableFilter& rTableFilter );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotTableFilter& mrTableFilter;
@@ -78,16 +78,16 @@ private:
// ============================================================================
-class OoxPivotTableFragment : public OoxWorksheetFragmentBase
+class PivotTableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxPivotTableFragment(
+ explicit PivotTableFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
@@ -100,10 +100,10 @@ private:
class BiffPivotTableContext : public BiffWorksheetContextBase
{
public:
- explicit BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable );
+ explicit BiffPivotTableContext( const WorksheetHelper& rHelper );
/** Imports all records related to the current pivot table. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
PivotTable& mrPivotTable;
@@ -115,4 +115,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/querytablebuffer.hxx b/oox/inc/oox/xls/querytablebuffer.hxx
new file mode 100644
index 000000000000..fa67ca8874c0
--- /dev/null
+++ b/oox/inc/oox/xls/querytablebuffer.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * 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 OOX_XLS_QUERYTABLEBUFFER_HXX
+#define OOX_XLS_QUERYTABLEBUFFER_HXX
+
+#include "oox/xls/stylesbuffer.hxx"
+#include "oox/xls/worksheethelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+struct QueryTableModel : public AutoFormatModel
+{
+ ::rtl::OUString maDefName; /// Defined name containing the target cell range.
+ sal_Int32 mnConnId; /// Identifier of the external connection used to query the data.
+ sal_Int32 mnGrowShrinkType; /// Behaviour when source data size changes.
+ bool mbHeaders; /// True = source data contains a header row.
+ bool mbRowNumbers; /// True = first column contains row numbers.
+ bool mbDisableRefresh; /// True = refreshing data disabled.
+ bool mbBackground; /// True = refresh asynchronously.
+ bool mbFirstBackground; /// True = first background refresh not yet finished.
+ bool mbRefreshOnLoad; /// True = refresh table after import.
+ bool mbFillFormulas; /// True = expand formulas next to range when source data grows.
+ bool mbRemoveDataOnSave; /// True = remove querried data before saving.
+ bool mbDisableEdit; /// True = connection locked for editing.
+ bool mbPreserveFormat; /// True = use existing formatting for new rows.
+ bool mbAdjustColWidth; /// True = adjust column widths after refresh.
+ bool mbIntermediate; /// True = query table defined but not built yet.
+
+ explicit QueryTableModel();
+};
+
+// ----------------------------------------------------------------------------
+
+class QueryTable : public WorksheetHelper
+{
+public:
+ explicit QueryTable( const WorksheetHelper& rHelper );
+
+ /** Imports query table settings from the queryTable element. */
+ void importQueryTable( const AttributeList& rAttribs );
+ /** Imports query table settings from the QUERYTABLE record. */
+ void importQueryTable( SequenceInputStream& rStrm );
+
+ /** Imports query table settings from the QUERYTABLE record. */
+ void importQueryTable( BiffInputStream& rStrm );
+ /** Imports query table settings from the QUERYTABLEREFRESH record. */
+ void importQueryTableRefresh( BiffInputStream& rStrm );
+ /** Imports query table settings from the QUERYTABLESETTINGS record. */
+ void importQueryTableSettings( BiffInputStream& rStrm );
+
+ /** Inserts a web query into the sheet. */
+ void finalizeImport();
+
+private:
+ QueryTableModel maModel;
+};
+
+// ============================================================================
+
+class QueryTableBuffer : public WorksheetHelper
+{
+public:
+ explicit QueryTableBuffer( const WorksheetHelper& rHelper );
+
+ /** Creates a new query table and stores it into the internal vector. */
+ QueryTable& createQueryTable();
+
+ /** Inserts all web queries into the sheet. */
+ void finalizeImport();
+
+private:
+ typedef RefVector< QueryTable > QueryTableVector;
+ QueryTableVector maQueryTables;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx
index 3702069b4859..6eb561aa5a5e 100644
--- a/oox/inc/oox/xls/querytablefragment.hxx
+++ b/oox/inc/oox/xls/querytablefragment.hxx
@@ -33,19 +33,39 @@
namespace oox {
namespace xls {
+class QueryTable;
+
// ============================================================================
-class OoxQueryTableFragment : public OoxWorkbookFragmentBase
+class QueryTableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxQueryTableFragment(
- const WorkbookHelper& rHelper,
+ explicit QueryTableFragment(
+ const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ virtual const ::oox::core::RecordInfo* getRecordInfos() const;
+
+private:
+ QueryTable& mrQueryTable;
+};
+
+// ============================================================================
+
+class BiffQueryTableContext : public BiffWorksheetContextBase
+{
+public:
+ explicit BiffQueryTableContext( const WorksheetHelper& rHelper );
+
+ /** Imports all records related to the current query table. */
+ virtual void importRecord( BiffInputStream& rStrm );
+
+private:
+ QueryTable& mrQueryTable;
};
// ============================================================================
@@ -54,4 +74,3 @@ protected:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx
index 6293aac4d340..f21e2a021111 100644
--- a/oox/inc/oox/xls/richstring.hxx
+++ b/oox/inc/oox/xls/richstring.hxx
@@ -28,7 +28,7 @@
#ifndef OOX_XLS_RICHSTRING_HXX
#define OOX_XLS_RICHSTRING_HXX
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/stylesbuffer.hxx"
namespace com { namespace sun { namespace star {
@@ -110,7 +110,7 @@ struct FontPortionModel
explicit inline FontPortionModel( sal_Int32 nPos, sal_Int32 nFontId ) :
mnPos( nPos ), mnFontId( nFontId ) {}
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, BiffFontPortionMode eMode );
};
@@ -125,7 +125,7 @@ public:
/** Appends a rich-string font identifier. */
void appendPortion( const FontPortionModel& rPortion );
/** Reads count and font identifiers from the passed stream. */
- void importPortions( RecordInputStream& rStrm );
+ void importPortions( SequenceInputStream& rStrm );
/** Reads nCount font identifiers from the passed stream. */
void importPortions( BiffInputStream& rStrm, sal_uInt16 nCount, BiffFontPortionMode eMode );
/** Reads count and font identifiers from the passed stream. */
@@ -143,7 +143,7 @@ struct PhoneticDataModel
explicit PhoneticDataModel();
/** Sets the passed data from binary import. */
- void setBinData( sal_Int32 nType, sal_Int32 nAlignment );
+ void setBiffData( sal_Int32 nType, sal_Int32 nAlignment );
};
// ----------------------------------------------------------------------------
@@ -156,12 +156,12 @@ public:
/** Imports phonetic settings from the phoneticPr element. */
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports phonetic settings from the PHONETICPR record. */
- void importPhoneticPr( RecordInputStream& rStrm );
+ void importPhoneticPr( SequenceInputStream& rStrm );
/** Imports phonetic settings from the PHONETICPR record. */
void importPhoneticPr( BiffInputStream& rStrm );
/** Imports phonetic settings from a rich string. */
- void importStringData( RecordInputStream& rStrm );
+ void importStringData( SequenceInputStream& rStrm );
/** Imports phonetic settings from a rich string. */
void importStringData( BiffInputStream& rStrm );
@@ -206,7 +206,7 @@ struct PhoneticPortionModel
explicit inline PhoneticPortionModel( sal_Int32 nPos, sal_Int32 nBasePos, sal_Int32 nBaseLen ) :
mnPos( nPos ), mnBasePos( nBasePos ), mnBaseLen( nBaseLen ) {}
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm );
};
@@ -221,7 +221,7 @@ public:
/** Appends a rich-string phonetic portion. */
void appendPortion( const PhoneticPortionModel& rPortion );
/** Reads all phonetic portions from the passed stream. */
- void importPortions( RecordInputStream& rStrm );
+ void importPortions( SequenceInputStream& rStrm );
/** Reads phonetic portion data from the passed stream. */
::rtl::OUString importPortions( BiffInputStream& rStrm, sal_Int32 nPhoneticSize );
};
@@ -244,7 +244,7 @@ public:
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports a Unicode rich-string from the passed record stream. */
- void importString( RecordInputStream& rStrm, bool bRich );
+ void importString( SequenceInputStream& rStrm, bool bRich );
/** Imports a byte string from the passed BIFF stream. */
void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eDefaultTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
@@ -292,4 +292,3 @@ typedef ::boost::shared_ptr< RichString > RichStringRef;
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/richstringcontext.hxx b/oox/inc/oox/xls/richstringcontext.hxx
index 53882641df7e..df3f412d87ec 100644
--- a/oox/inc/oox/xls/richstringcontext.hxx
+++ b/oox/inc/oox/xls/richstringcontext.hxx
@@ -36,17 +36,15 @@ namespace xls {
// ============================================================================
-class OoxRichStringContext : public OoxWorkbookContextBase
+class RichStringContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- explicit OoxRichStringContext( ParentType& rParent, RichStringRef xString );
+ explicit RichStringContext( ParentType& rParent, RichStringRef xString );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
RichStringRef mxString; /// Processed string.
@@ -58,11 +56,11 @@ private:
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef xString ) :
- OoxWorkbookContextBase( rParent ),
+RichStringContext::RichStringContext( ParentType& rParent, RichStringRef xString ) :
+ WorkbookContextBase( rParent ),
mxString( xString )
{
- OSL_ENSURE( mxString.get(), "OoxRichStringContext::OoxRichStringContext - missing string object" );
+ OSL_ENSURE( mxString.get(), "RichStringContext::RichStringContext - missing string object" );
}
// ============================================================================
@@ -71,4 +69,3 @@ OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef x
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/scenariobuffer.hxx b/oox/inc/oox/xls/scenariobuffer.hxx
index 8c2e0b0f1065..ed8d4e919bd2 100644
--- a/oox/inc/oox/xls/scenariobuffer.hxx
+++ b/oox/inc/oox/xls/scenariobuffer.hxx
@@ -29,7 +29,8 @@
#define OOX_XLS_SCENARIOBUFFER_HXX
#include <com/sun/star/table/CellAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace oox {
@@ -73,9 +74,9 @@ public:
void importInputCells( const AttributeList& rAttribs );
/** Imports a scenario definition from a SCENARIO record. */
- void importScenario( RecordInputStream& rStrm );
+ void importScenario( SequenceInputStream& rStrm );
/** Imports a new cell for this scenario from a INPUTCELLS record. */
- void importInputCells( RecordInputStream& rStrm );
+ void importInputCells( SequenceInputStream& rStrm );
/** Imports a scenario definition from a SCENARIO record. */
void importScenario( BiffInputStream& rStrm );
@@ -111,7 +112,7 @@ public:
/** Imports sheet scenario settings from a scenarios element. */
void importScenarios( const AttributeList& rAttribs );
/** Imports sheet scenario settings from a SCENARIOS record. */
- void importScenarios( RecordInputStream& rStrm );
+ void importScenarios( SequenceInputStream& rStrm );
/** Imports sheet scenario settings from a SCENARIOS record. */
void importScenarios( BiffInputStream& rStrm );
@@ -152,4 +153,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/scenariocontext.hxx b/oox/inc/oox/xls/scenariocontext.hxx
index f3286f144656..3e6ccc5c22d6 100644
--- a/oox/inc/oox/xls/scenariocontext.hxx
+++ b/oox/inc/oox/xls/scenariocontext.hxx
@@ -38,17 +38,17 @@ class SheetScenarios;
// ============================================================================
-class OoxScenarioContext : public OoxWorksheetContextBase
+class ScenarioContext : public WorksheetContextBase
{
public:
- explicit OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
+ explicit ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
Scenario& mrScenario;
@@ -56,17 +56,17 @@ private:
// ============================================================================
-class OoxScenariosContext : public OoxWorksheetContextBase
+class ScenariosContext : public WorksheetContextBase
{
public:
- explicit OoxScenariosContext( OoxWorksheetFragmentBase& rFragment );
+ explicit ScenariosContext( WorksheetFragmentBase& rFragment );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
SheetScenarios& mrSheetScenarios;
@@ -78,4 +78,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/sharedformulabuffer.hxx b/oox/inc/oox/xls/sharedformulabuffer.hxx
index 0f9fb0bb093e..94b7572dcfd9 100644
--- a/oox/inc/oox/xls/sharedformulabuffer.hxx
+++ b/oox/inc/oox/xls/sharedformulabuffer.hxx
@@ -61,12 +61,12 @@ class SharedFormulaBuffer : public WorksheetHelper
public:
explicit SharedFormulaBuffer( const WorksheetHelper& rHelper );
- /** Imports a shared formula from a OOX formula string. */
+ /** Imports a shared formula from a OOXML formula string. */
void importSharedFmla( const ::rtl::OUString& rFormula,
const ::rtl::OUString& rSharedRange, sal_Int32 nId,
const ::com::sun::star::table::CellAddress& rBaseAddr );
/** Imports a shared formula from a SHAREDFORMULA record in the passed stream */
- void importSharedFmla( RecordInputStream& rStrm,
+ void importSharedFmla( SequenceInputStream& rStrm,
const ::com::sun::star::table::CellAddress& rBaseAddr );
/** Imports a shared formula from a SHAREDFMLA record in the passed stream. */
void importSharedFmla( BiffInputStream& rStrm,
@@ -109,4 +109,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx
index 27827ec215ed..eff8ab4e7738 100644
--- a/oox/inc/oox/xls/sharedstringsbuffer.hxx
+++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx
@@ -28,7 +28,6 @@
#ifndef OOX_XLS_SHAREDSTRINGSBUFFER_HXX
#define OOX_XLS_SHAREDSTRINGSBUFFER_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/richstring.hxx"
namespace oox {
@@ -67,4 +66,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/sharedstringsfragment.hxx b/oox/inc/oox/xls/sharedstringsfragment.hxx
index 7294643b7df5..bc3a23122d19 100644
--- a/oox/inc/oox/xls/sharedstringsfragment.hxx
+++ b/oox/inc/oox/xls/sharedstringsfragment.hxx
@@ -35,21 +35,16 @@ namespace xls {
// ============================================================================
-class OoxSharedStringsFragment : public OoxWorkbookFragmentBase
+class SharedStringsFragment : public WorkbookFragmentBase
{
public:
- explicit OoxSharedStringsFragment(
+ explicit SharedStringsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -61,4 +56,3 @@ protected:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx
index a77f4b285fa4..fdbc0ba21231 100644
--- a/oox/inc/oox/xls/sheetdatacontext.hxx
+++ b/oox/inc/oox/xls/sheetdatacontext.hxx
@@ -45,18 +45,17 @@ namespace xls {
The sheetData element contains all row settings and all cells in a single
sheet of a spreadsheet document.
*/
-class OoxSheetDataContext : public OoxWorksheetContextBase
+class SheetDataContext : public WorksheetContextBase
{
public:
- explicit OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment );
+ explicit SheetDataContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Different types of cell records. */
@@ -70,35 +69,35 @@ private:
void importFormula( const AttributeList& rAttribs );
/** Imports a cell address and the following XF identifier. */
- void importCellHeader( RecordInputStream& rStrm, CellType eCellType );
+ void importCellHeader( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an empty cell from a CELL_BLANK or MULTCELL_BLANK record. */
- void importCellBlank( RecordInputStream& rStrm, CellType eCellType );
+ void importCellBlank( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a boolean cell from a CELL_BOOL, MULTCELL_BOOL, or FORMULA_BOOL record. */
- void importCellBool( RecordInputStream& rStrm, CellType eCellType );
+ void importCellBool( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a numeric cell from a CELL_DOUBLE, MULTCELL_DOUBLE, or FORMULA_DOUBLE record. */
- void importCellDouble( RecordInputStream& rStrm, CellType eCellType );
+ void importCellDouble( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an error code cell from a CELL_ERROR, MULTCELL_ERROR, or FORMULA_ERROR record. */
- void importCellError( RecordInputStream& rStrm, CellType eCellType );
+ void importCellError( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an encoded numeric cell from a CELL_RK or MULTCELL_RK record. */
- void importCellRk( RecordInputStream& rStrm, CellType eCellType );
+ void importCellRk( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a rich-string cell from a CELL_RSTRING or MULTCELL_RSTRING record. */
- void importCellRString( RecordInputStream& rStrm, CellType eCellType );
+ void importCellRString( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a string cell from a CELL_SI or MULTCELL_SI record. */
- void importCellSi( RecordInputStream& rStrm, CellType eCellType );
+ void importCellSi( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a string cell from a CELL_STRING, MULTCELL_STRING, or FORMULA_STRING record. */
- void importCellString( RecordInputStream& rStrm, CellType eCellType );
+ void importCellString( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a cell formula for the current cell. */
- void importCellFormula( RecordInputStream& rStrm );
+ void importCellFormula( SequenceInputStream& rStrm );
/** Imports row settings from a ROW record. */
- void importRow( RecordInputStream& rStrm );
+ void importRow( SequenceInputStream& rStrm );
/** Imports an array formula from an ARRAY record. */
- void importArray( RecordInputStream& rStrm );
+ void importArray( SequenceInputStream& rStrm );
/** Imports a shared formula from a SHAREDFORMULA record. */
- void importSharedFmla( RecordInputStream& rStrm );
+ void importSharedFmla( SequenceInputStream& rStrm );
/** Imports table operation from a DATATABLE record. */
- void importDataTable( RecordInputStream& rStrm );
+ void importDataTable( SequenceInputStream& rStrm );
private:
CellModel maCurrCell; /// Position and formatting of current imported cell.
@@ -114,49 +113,49 @@ private:
class BiffSheetDataContext : public BiffWorksheetContextBase
{
public:
- explicit BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent );
+ explicit BiffSheetDataContext( const WorksheetHelper& rHelper );
/** Tries to import a sheet data record. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
/** Sets current cell according to the passed address. */
void setCurrCell( const BinAddress& rAddr );
/** Imports an XF identifier and sets the mnXfId member. */
- void importXfId( bool bBiff2 );
+ void importXfId( BiffInputStream& rStrm, bool bBiff2 );
/** Imports a BIFF cell address and the following XF identifier. */
- void importCellHeader( bool bBiff2 );
+ void importCellHeader( BiffInputStream& rStrm, bool bBiff2 );
/** Imports a BLANK record describing a blank but formatted cell. */
- void importBlank();
+ void importBlank( BiffInputStream& rStrm );
/** Imports a BOOLERR record describing a boolean or error code cell. */
- void importBoolErr();
+ void importBoolErr( BiffInputStream& rStrm );
/** Imports a FORMULA record describing a formula cell. */
- void importFormula();
+ void importFormula( BiffInputStream& rStrm );
/** Imports an INTEGER record describing a BIFF2 integer cell. */
- void importInteger();
+ void importInteger( BiffInputStream& rStrm );
/** Imports a LABEL record describing an unformatted string cell. */
- void importLabel();
+ void importLabel( BiffInputStream& rStrm );
/** Imports a LABELSST record describing a string cell using the shared string list. */
- void importLabelSst();
+ void importLabelSst( BiffInputStream& rStrm );
/** Imports a MULTBLANK record describing a range of blank but formatted cells. */
- void importMultBlank();
+ void importMultBlank( BiffInputStream& rStrm );
/** Imports a MULTRK record describing a range of numeric cells. */
- void importMultRk();
+ void importMultRk( BiffInputStream& rStrm );
/** Imports a NUMBER record describing a floating-point cell. */
- void importNumber();
+ void importNumber( BiffInputStream& rStrm );
/** Imports an RK record describing a numeric cell. */
- void importRk();
+ void importRk( BiffInputStream& rStrm );
/** Imports row settings from a ROW record. */
- void importRow();
+ void importRow( BiffInputStream& rStrm );
/** Imports an ARRAY record describing an array formula of a cell range. */
- void importArray();
+ void importArray( BiffInputStream& rStrm );
/** Imports a SHAREDFMLA record describing a shared formula in a cell range. */
- void importSharedFmla();
+ void importSharedFmla( BiffInputStream& rStrm );
/** Imports table operation from a DATATABLE or DATATABLE2 record. */
- void importDataTable();
+ void importDataTable( BiffInputStream& rStrm );
private:
CellModel maCurrCell; /// Position and formatting of current imported cell.
@@ -171,4 +170,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index 4fa9c964108e..64a56968aa37 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -29,14 +29,15 @@
#define OOX_XLS_STYLESBUFFER_HXX
#include <com/sun/star/awt/FontDescriptor.hpp>
-#include <com/sun/star/util/CellProtection.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
#include <com/sun/star/table/CellVertJustify.hpp>
#include <com/sun/star/table/TableBorder.hpp>
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/graphichelper.hxx"
+#include <com/sun/star/util/CellProtection.hpp>
#include "oox/drawingml/color.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/numberformatsbuffer.hxx"
namespace com { namespace sun { namespace star {
@@ -111,11 +112,11 @@ public:
void importColor( const AttributeList& rAttribs );
/** Imports a 64-bit color from the passed binary stream. */
- void importColor( RecordInputStream& rStrm );
- /** Imports a 32-bit palette color identifier from the passed OOBIN stream. */
- void importColorId( RecordInputStream& rStrm );
- /** Imports a 32-bit RGBA color value from the passed OOBIN stream. */
- void importColorRgb( RecordInputStream& rStrm );
+ void importColor( SequenceInputStream& rStrm );
+ /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */
+ void importColorId( SequenceInputStream& rStrm );
+ /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */
+ void importColorRgb( SequenceInputStream& rStrm );
/** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */
void importColorId( BiffInputStream& rStrm, bool b16Bit = true );
@@ -128,7 +129,7 @@ public:
// ----------------------------------------------------------------------------
-RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor );
+SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor );
// ============================================================================
@@ -142,9 +143,11 @@ public:
/** Appends a new color from the passed attributes. */
void importPaletteColor( const AttributeList& rAttribs );
/** Appends a new color from the passed RGBCOLOR record. */
- void importPaletteColor( RecordInputStream& rStrm );
+ void importPaletteColor( SequenceInputStream& rStrm );
/** Imports the PALETTE record from the passed stream. */
void importPalette( BiffInputStream& rStrm );
+ /** Imports a color palette from a UNO sequence in the passed any. */
+ void importPalette( const ::com::sun::star::uno::Any& rPalette );
/** Rturns the RGB value of the color with the passed index. */
sal_Int32 getColor( sal_Int32 nPaletteIdx ) const;
@@ -179,7 +182,7 @@ struct FontModel
explicit FontModel();
- void setBinScheme( sal_uInt8 nScheme );
+ void setBiff12Scheme( sal_uInt8 nScheme );
void setBiffHeight( sal_uInt16 nHeight );
void setBiffWeight( sal_uInt16 nWeight );
void setBiffUnderline( sal_uInt16 nUnderline );
@@ -259,23 +262,23 @@ public:
void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the FONT record from the passed stream. */
- void importFont( RecordInputStream& rStrm );
+ void importFont( SequenceInputStream& rStrm );
/** Imports the font name from a DXF record. */
- void importDxfName( RecordInputStream& rStrm );
+ void importDxfName( SequenceInputStream& rStrm );
/** Imports the font color from a DXF record. */
- void importDxfColor( RecordInputStream& rStrm );
+ void importDxfColor( SequenceInputStream& rStrm );
/** Imports the font scheme from a DXF record. */
- void importDxfScheme( RecordInputStream& rStrm );
+ void importDxfScheme( SequenceInputStream& rStrm );
/** Imports the font height from a DXF record. */
- void importDxfHeight( RecordInputStream& rStrm );
+ void importDxfHeight( SequenceInputStream& rStrm );
/** Imports the font weight from a DXF record. */
- void importDxfWeight( RecordInputStream& rStrm );
+ void importDxfWeight( SequenceInputStream& rStrm );
/** Imports the font underline style from a DXF record. */
- void importDxfUnderline( RecordInputStream& rStrm );
+ void importDxfUnderline( SequenceInputStream& rStrm );
/** Imports the font escapement style from a DXF record. */
- void importDxfEscapement( RecordInputStream& rStrm );
+ void importDxfEscapement( SequenceInputStream& rStrm );
/** Imports a font style flag from a DXF record. */
- void importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm );
+ void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm );
/** Imports the FONT record from the passed stream. */
void importFont( BiffInputStream& rStrm );
@@ -346,12 +349,12 @@ struct AlignmentModel
explicit AlignmentModel();
- /** Sets horizontal alignment from the passed OOBIN or BIFF data. */
- void setBinHorAlign( sal_uInt8 nHorAlign );
- /** Sets vertical alignment from the passed OOBIN or BIFF data. */
- void setBinVerAlign( sal_uInt8 nVerAlign );
- /** Sets rotation from the passed OOBIN or BIFF text orientation. */
- void setBinTextOrient( sal_uInt8 nTextOrient );
+ /** Sets horizontal alignment from the passed BIFF data. */
+ void setBiffHorAlign( sal_uInt8 nHorAlign );
+ /** Sets vertical alignment from the passed BIFF data. */
+ void setBiffVerAlign( sal_uInt8 nVerAlign );
+ /** Sets rotation from the passed BIFF text orientation. */
+ void setBiffTextOrient( sal_uInt8 nTextOrient );
};
// ----------------------------------------------------------------------------
@@ -387,8 +390,8 @@ public:
/** Sets all attributes from the alignment element. */
void importAlignment( const AttributeList& rAttribs );
- /** Sets the alignment attributes from the passed OOBIN XF record data. */
- void setBinData( sal_uInt32 nFlags );
+ /** Sets the alignment attributes from the passed BIFF12 XF record data. */
+ void setBiff12Data( sal_uInt32 nFlags );
/** Sets the alignment attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
/** Sets the alignment attributes from the passed BIFF3 XF record data. */
@@ -453,8 +456,8 @@ public:
/** Sets all attributes from the protection element. */
void importProtection( const AttributeList& rAttribs );
- /** Sets the protection attributes from the passed OOBIN XF record data. */
- void setBinData( sal_uInt32 nFlags );
+ /** Sets the protection attributes from the passed BIFF12 XF record data. */
+ void setBiff12Data( sal_uInt32 nFlags );
/** Sets the protection attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nNumFmt );
/** Sets the protection attributes from the passed BIFF3-BIFF8 XF record data. */
@@ -489,7 +492,7 @@ struct BorderLineModel
explicit BorderLineModel( bool bDxf );
- /** Sets the passed OOBIN or BIFF line style. */
+ /** Sets the passed BIFF line style. */
void setBiffStyle( sal_Int32 nLineStyle );
/** Sets line style and line color from the passed BIFF data. */
void setBiffData( sal_uInt8 nLineStyle, sal_uInt16 nLineColor );
@@ -548,9 +551,9 @@ public:
void importColor( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the BORDER record from the passed stream. */
- void importBorder( RecordInputStream& rStrm );
+ void importBorder( SequenceInputStream& rStrm );
/** Imports a border from a DXF record from the passed stream. */
- void importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm );
+ void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm );
/** Sets the border attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
@@ -605,8 +608,8 @@ struct PatternFillModel
explicit PatternFillModel( bool bDxf );
- /** Sets the passed OOBIN or BIFF pattern identifier. */
- void setBinPattern( sal_Int32 nPattern );
+ /** Sets the passed BIFF pattern identifier. */
+ void setBiffPattern( sal_Int32 nPattern );
/** Sets the pattern and pattern colors from the passed BIFF data. */
void setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillColor, sal_uInt8 nPattern );
};
@@ -628,10 +631,10 @@ struct GradientFillModel
explicit GradientFillModel();
- /** Reads OOBIN gradient settings from a FILL or DXF record. */
- void readGradient( RecordInputStream& rStrm );
- /** Reads OOBIN gradient stop settings from a FILL or DXF record. */
- void readGradientStop( RecordInputStream& rStrm, bool bDxf );
+ /** Reads BIFF12 gradient settings from a FILL or DXF record. */
+ void readGradient( SequenceInputStream& rStrm );
+ /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */
+ void readGradientStop( SequenceInputStream& rStrm, bool bDxf );
};
// ----------------------------------------------------------------------------
@@ -668,17 +671,17 @@ public:
void importColor( const AttributeList& rAttribs, double fPosition );
/** Imports the FILL record from the passed stream. */
- void importFill( RecordInputStream& rStrm );
+ void importFill( SequenceInputStream& rStrm );
/** Imports the fill pattern from a DXF record. */
- void importDxfPattern( RecordInputStream& rStrm );
+ void importDxfPattern( SequenceInputStream& rStrm );
/** Imports the pattern color from a DXF record. */
- void importDxfFgColor( RecordInputStream& rStrm );
+ void importDxfFgColor( SequenceInputStream& rStrm );
/** Imports the background color from a DXF record. */
- void importDxfBgColor( RecordInputStream& rStrm );
+ void importDxfBgColor( SequenceInputStream& rStrm );
/** Imports gradient settings from a DXF record. */
- void importDxfGradient( RecordInputStream& rStrm );
+ void importDxfGradient( SequenceInputStream& rStrm );
/** Imports gradient stop settings from a DXF record. */
- void importDxfStop( RecordInputStream& rStrm );
+ void importDxfStop( SequenceInputStream& rStrm );
/** Sets the fill attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
@@ -762,7 +765,7 @@ public:
void importProtection( const AttributeList& rAttribs );
/** Imports the XF record from the passed stream. */
- void importXf( RecordInputStream& rStrm, bool bCellXf );
+ void importXf( SequenceInputStream& rStrm, bool bCellXf );
/** Imports the XF record from the passed stream. */
void importXf( BiffInputStream& rStrm );
@@ -823,7 +826,7 @@ public:
void importProtection( const AttributeList& rAttribs );
/** Imports the DXF record from the passed stream. */
- void importDxf( RecordInputStream& rStrm );
+ void importDxf( SequenceInputStream& rStrm );
/** Imports font, border, and fill settings from the CFRULE record. */
void importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags );
@@ -878,7 +881,7 @@ public:
/** Imports passed attributes from the cellStyle element. */
void importCellStyle( const AttributeList& rAttribs );
/** Imports style settings from a CELLSTYLE record. */
- void importCellStyle( RecordInputStream& rStrm );
+ void importCellStyle( SequenceInputStream& rStrm );
/** Imports style settings from a STYLE record. */
void importStyle( BiffInputStream& rStrm );
@@ -911,7 +914,7 @@ public:
/** Appends and returns a new named cell style object. */
CellStyleRef importCellStyle( const AttributeList& rAttribs );
/** Imports the CELLSTYLE record from the passed stream. */
- CellStyleRef importCellStyle( RecordInputStream& rStrm );
+ CellStyleRef importCellStyle( SequenceInputStream& rStrm );
/** Imports the STYLE record from the passed stream. */
CellStyleRef importStyle( BiffInputStream& rStrm );
@@ -943,6 +946,21 @@ private:
// ============================================================================
+struct AutoFormatModel
+{
+ sal_Int32 mnAutoFormatId; /// Index of predefined autoformatting.
+ bool mbApplyNumFmt; /// True = apply number format from autoformatting.
+ bool mbApplyFont; /// True = apply font from autoformatting.
+ bool mbApplyAlignment; /// True = apply alignment from autoformatting.
+ bool mbApplyBorder; /// True = apply border from autoformatting.
+ bool mbApplyFill; /// True = apply fill from autoformatting.
+ bool mbApplyProtection; /// True = apply protection from autoformatting.
+
+ explicit AutoFormatModel();
+};
+
+// ============================================================================
+
class StylesBuffer : public WorkbookHelper
{
public:
@@ -977,11 +995,11 @@ public:
CellStyleRef importCellStyle( const AttributeList& rAttribs );
/** Appends a new color to the color palette. */
- void importPaletteColor( RecordInputStream& rStrm );
+ void importPaletteColor( SequenceInputStream& rStrm );
/** Imports the NUMFMT record from the passed stream. */
- void importNumFmt( RecordInputStream& rStrm );
+ void importNumFmt( SequenceInputStream& rStrm );
/** Imports the CELLSTYLE record from the passed stream. */
- void importCellStyle( RecordInputStream& rStrm );
+ void importCellStyle( SequenceInputStream& rStrm );
/** Imports the PALETTE record from the passed stream. */
void importPalette( BiffInputStream& rStrm );
@@ -996,6 +1014,9 @@ public:
/** Imports the STYLE record from the passed stream. */
void importStyle( BiffInputStream& rStrm );
+ /** Imports a color palette from a UNO sequence in the passed any. */
+ void importPalette( const ::com::sun::star::uno::Any& rPalette );
+
/** Final processing after import of all style settings. */
void finalizeImport();
@@ -1075,4 +1096,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/stylesfragment.hxx b/oox/inc/oox/xls/stylesfragment.hxx
index b3dc63fe6e31..eb1af53d9cdb 100644
--- a/oox/inc/oox/xls/stylesfragment.hxx
+++ b/oox/inc/oox/xls/stylesfragment.hxx
@@ -36,24 +36,24 @@ namespace xls {
// ============================================================================
-class OoxIndexedColorsContext : public OoxWorkbookContextBase
+class IndexedColorsContext : public WorkbookContextBase
{
public:
- explicit OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment );
+ explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
};
// ============================================================================
-class OoxFontContext : public OoxWorkbookContextBase
+class FontContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxFontContext( ParentType& rParent, const FontRef& rxFont ) :
- OoxWorkbookContextBase( rParent ), mxFont( rxFont ) {}
+ inline explicit FontContext( ParentType& rParent, const FontRef& rxFont ) :
+ WorkbookContextBase( rParent ), mxFont( rxFont ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -64,12 +64,12 @@ private:
// ============================================================================
-class OoxBorderContext : public OoxWorkbookContextBase
+class BorderContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxBorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
- OoxWorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
+ inline explicit BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
+ WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
protected:
virtual void onStartElement( const AttributeList& rAttribs );
@@ -81,12 +81,12 @@ private:
// ============================================================================
-class OoxFillContext : public OoxWorkbookContextBase
+class FillContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxFillContext( ParentType& rParent, const FillRef& rxFill ) :
- OoxWorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
+ inline explicit FillContext( ParentType& rParent, const FillRef& rxFill ) :
+ WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -98,12 +98,12 @@ private:
// ============================================================================
-class OoxXfContext : public OoxWorkbookContextBase
+class XfContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxXfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
- OoxWorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
+ inline explicit XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
+ WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
protected:
virtual void onStartElement( const AttributeList& rAttribs );
@@ -116,12 +116,12 @@ private:
// ============================================================================
-class OoxDxfContext : public OoxWorkbookContextBase
+class DxfContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxDxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
- OoxWorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
+ inline explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
+ WorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -132,20 +132,16 @@ private:
// ============================================================================
-class OoxStylesFragment : public OoxWorkbookFragmentBase
+class StylesFragment : public WorkbookFragmentBase
{
public:
- explicit OoxStylesFragment(
+ explicit StylesFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -157,4 +153,3 @@ protected:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx
index 993b4305d03a..d643fbc40728 100644
--- a/oox/inc/oox/xls/tablebuffer.hxx
+++ b/oox/inc/oox/xls/tablebuffer.hxx
@@ -29,7 +29,7 @@
#define OOX_XLS_TABLEBUFFER_HXX
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace oox {
@@ -61,16 +61,18 @@ public:
/** Imports a table definition from the passed attributes. */
void importTable( const AttributeList& rAttribs, sal_Int16 nSheet );
/** Imports a table definition from a TABLE record. */
- void importTable( RecordInputStream& rStrm, sal_Int16 nSheet );
+ void importTable( SequenceInputStream& rStrm, sal_Int16 nSheet );
+ /** Creates a new auto filter and stores it internally. */
+ inline AutoFilter& createAutoFilter() { return maAutoFilters.createAutoFilter(); }
/** Creates a database range from this tables. */
void finalizeImport();
- /** Returns the table identifier. */
+ /** Returns the unique table identifier. */
inline sal_Int32 getTableId() const { return maModel.mnId; }
/** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
- /** Returns the display name of the table. */
+ /** Returns the original display name of the table. */
inline const ::rtl::OUString& getDisplayName() const { return maModel.maDisplayName; }
/** Returns the original (unchecked) total range of the table. */
@@ -88,6 +90,8 @@ public:
private:
TableModel maModel;
+ AutoFilterBuffer maAutoFilters; /// Filter settings for this table.
+ ::rtl::OUString maDBRangeName; /// Name of the databae range in the Calc document.
::com::sun::star::table::CellRangeAddress
maDestRange; /// Validated range of the table in the worksheet.
sal_Int32 mnTokenIndex; /// Token index used in API token array.
@@ -102,10 +106,8 @@ class TableBuffer : public WorkbookHelper
public:
explicit TableBuffer( const WorkbookHelper& rHelper );
- /** Imports a table definition from the passed attributes. */
- TableRef importTable( const AttributeList& rAttribs, sal_Int16 nSheet );
- /** Imports a table definition from a TABLE record. */
- TableRef importTable( RecordInputStream& rStrm, sal_Int16 nSheet );
+ /** Creates a new empty table. */
+ Table& createTable();
/** Creates database ranges from all imported tables. */
void finalizeImport();
@@ -116,12 +118,15 @@ public:
TableRef getTable( const ::rtl::OUString& rDispName ) const;
private:
- void insertTable( TableRef xTable );
+ /** Inserts the passed table into the maps according to its identifier and name. */
+ void insertTableToMaps( const TableRef& rxTable );
private:
+ typedef RefVector< Table > TableVector;
typedef RefMap< sal_Int32, Table > TableIdMap;
typedef RefMap< ::rtl::OUString, Table > TableNameMap;
+ TableVector maTables;
TableIdMap maIdTables;
TableNameMap maNameTables;
};
@@ -132,4 +137,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx
index e30eb1e2f9e8..9c2678405ee5 100644
--- a/oox/inc/oox/xls/tablefragment.hxx
+++ b/oox/inc/oox/xls/tablefragment.hxx
@@ -29,32 +29,29 @@
#define OOX_XLS_TABLEFRAGMENT_HXX
#include "oox/xls/excelhandlers.hxx"
-#include "oox/xls/tablebuffer.hxx"
namespace oox {
namespace xls {
+class Table;
+
// ============================================================================
-class OoxTableFragment : public OoxWorksheetFragmentBase
+class TableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxTableFragment(
+ explicit TableFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
- TableRef mxTable; /// Current table.
+ Table& mrTable;
};
// ============================================================================
@@ -63,4 +60,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/themebuffer.hxx b/oox/inc/oox/xls/themebuffer.hxx
index 338837e40427..95d092198b95 100644
--- a/oox/inc/oox/xls/themebuffer.hxx
+++ b/oox/inc/oox/xls/themebuffer.hxx
@@ -61,4 +61,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/unitconverter.hxx b/oox/inc/oox/xls/unitconverter.hxx
index 36a70a7f4067..1ea4180bc6fd 100644
--- a/oox/inc/oox/xls/unitconverter.hxx
+++ b/oox/inc/oox/xls/unitconverter.hxx
@@ -28,8 +28,8 @@
#ifndef OOX_XLS_UNITCONVERTER_HXX
#define OOX_XLS_UNITCONVERTER_HXX
-#include <vector>
#include <map>
+#include <vector>
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -121,4 +121,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx
index 1f82aedeef91..c5880bf077fe 100644
--- a/oox/inc/oox/xls/viewsettings.hxx
+++ b/oox/inc/oox/xls/viewsettings.hxx
@@ -30,7 +30,6 @@
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/worksheethelper.hxx"
@@ -119,13 +118,13 @@ public:
void importChartSheetView( const AttributeList& rAttribs );
/** Imports the SHEETVIEW record containing sheet view settings. */
- void importSheetView( RecordInputStream& rStrm );
+ void importSheetView( SequenceInputStream& rStrm );
/** Imports the PANE record containing sheet pane settings. */
- void importPane( RecordInputStream& rStrm );
+ void importPane( SequenceInputStream& rStrm );
/** Imports the SELECTION record containing selection settings for a pane. */
- void importSelection( RecordInputStream& rStrm );
+ void importSelection( SequenceInputStream& rStrm );
/** Imports the CHARTSHEETVIEW record containing view settings of a chart sheet. */
- void importChartSheetView( RecordInputStream& rStrm );
+ void importChartSheetView( SequenceInputStream& rStrm );
/** Imports the WINDOW2 record containing sheet view settings. */
void importWindow2( BiffInputStream& rStrm );
@@ -139,6 +138,9 @@ public:
/** Converts all imported sheet view settings. */
void finalizeImport();
+ /** Returns true, if the sheet layout is set to right-to-left. */
+ bool isSheetRightToLeft() const;
+
private:
SheetViewModelRef createSheetView();
@@ -182,9 +184,9 @@ public:
/** Imports the oleSize element containing the visible size of the workbook. */
void importOleSize( const AttributeList& rAttribs );
/** Imports the WORKBOOKVIEW record containing workbook view settings. */
- void importWorkbookView( RecordInputStream& rStrm );
+ void importWorkbookView( SequenceInputStream& rStrm );
/** Imports the OLESIZE record containing the visible size of the workbook. */
- void importOleSize( RecordInputStream& rStrm );
+ void importOleSize( SequenceInputStream& rStrm );
/** Imports the WINDOW1 record containing workbook view settings. */
void importWindow1( BiffInputStream& rStrm );
/** Imports the OLESIZE record containing the visible size of the workbook. */
@@ -228,4 +230,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/webquerybuffer.hxx b/oox/inc/oox/xls/webquerybuffer.hxx
deleted file mode 100644
index 22c91bc15d1f..000000000000
--- a/oox/inc/oox/xls/webquerybuffer.hxx
+++ /dev/null
@@ -1,127 +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 OOX_XLS_WEBQUERYBUFFER_HXX
-#define OOX_XLS_WEBQUERYBUFFER_HXX
-
-#include <vector>
-#include <hash_map>
-#include <boost/shared_ptr.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/xls/workbookhelper.hxx"
-
-namespace oox {
-namespace xls {
-
-// ============================================================================
-
-struct QueryTable
-{
- sal_Int32 mnConnectionId;
-};
-
-// struct WebQuery
-// {
-// enum WebQueryMode
-// {
-// xlWQUnknown, /// Not specified.
-// xlWQDocument, /// Entire document.
-// xlWQAllTables, /// All tables.
-// xlWQSpecTables /// Specific tables.
-// };
-//
-// ::rtl::OUString maURL; /// Source document URL.
-// ::rtl::OUString maTables; /// List of source range names.
-// ::com::sun::star::table::CellRangeAddress maDestRange; /// Destination range.
-// WebQueryMode meMode; /// Current mode of web query.
-// sal_uInt16 mnRefresh; /// Refresh time in minutes.
-// };
-
-struct BaseProperties
-{
-};
-
-/** Stores web query properties from webPr element. */
-struct WebProperties : public BaseProperties
-{
- ::rtl::OUString maURL;
-};
-
-/** Stores text data source properties from textPr element. */
-struct TextProperties : public BaseProperties
-{
- ::rtl::OUString maSourceFile;
-};
-
-struct Connection
-{
- static const sal_Int32 CONNECTION_ODBC_SOURCE;
- static const sal_Int32 CONNECTION_DAO_SOURCE;
- static const sal_Int32 CONNECTION_FILE_SOURCE;
- static const sal_Int32 CONNECTION_WEBQUERY;
- static const sal_Int32 CONNECTION_OLEDB_SOURCE;
- static const sal_Int32 CONNECTION_TEXT_SOURCE;
- static const sal_Int32 CONNECTION_ADO_RECORD_SET;
- static const sal_Int32 CONNECTION_DSP;
-
- ::rtl::OUString maName; /// Connection name (must be unique).
- sal_Int32 mnType;
- ::boost::shared_ptr< BaseProperties > mpProperties;
-};
-
-// ============================================================================
-
-typedef ::std::hash_map< ::rtl::OUString, QueryTable, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > QueryTableHashMap;
-
-class WebQueryBuffer : public WorkbookHelper
-{
-public:
- explicit WebQueryBuffer( const WorkbookHelper& rHelper );
-
- void importQueryTable( const AttributeList& rAttribs );
-
- void importConnection( const AttributeList& rAttribs );
-
- void importWebPr( const AttributeList& rAttribs );
-
- /** Dumps content for debug purposes. */
- void dump() const;
-
-private:
- QueryTableHashMap maQueryTableMap;
- ::std::vector< Connection > maConnections;
-
- sal_Int32 mnCurConnId; /// Current connection ID.
-};
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
-#endif
-
diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx
index f9f0bb25c78f..d0b0cadd416b 100644
--- a/oox/inc/oox/xls/workbookfragment.hxx
+++ b/oox/inc/oox/xls/workbookfragment.hxx
@@ -38,22 +38,18 @@ class ExternalLink;
// ============================================================================
-class OoxWorkbookFragment : public OoxWorkbookFragmentBase
+class WorkbookFragment : public WorkbookFragmentBase
{
public:
- explicit OoxWorkbookFragment(
+ explicit WorkbookFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -63,8 +59,8 @@ private:
void importDefinedName( const AttributeList& rAttribs );
void importPivotCache( const AttributeList& rAttribs );
- void importExternalRef( RecordInputStream& rStrm );
- void importPivotCache( RecordInputStream& rStrm );
+ void importExternalRef( SequenceInputStream& rStrm );
+ void importPivotCache( SequenceInputStream& rStrm );
void importExternalLinkFragment( ExternalLink& rExtLink );
void importPivotCacheDefFragment( const ::rtl::OUString& rRelId, sal_Int32 nCacheId );
@@ -100,4 +96,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 0ff8c0f9d3e5..ecf824076ef5 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -37,24 +37,21 @@ namespace com { namespace sun { namespace star {
namespace container { class XNameAccess; }
namespace container { class XNameContainer; }
namespace lang { class XMultiServiceFactory; }
- namespace awt { class XDevice; }
+ namespace sheet { class XDatabaseRange; }
+ namespace sheet { class XNamedRange; }
+ namespace sheet { class XSpreadsheet; }
+ namespace sheet { class XSpreadsheetDocument; }
+ namespace style { class XStyle; }
namespace table { struct CellAddress; }
namespace table { struct CellRangeAddress; }
namespace table { class XCell; }
namespace table { class XCellRange; }
- namespace sheet { class XSpreadsheetDocument; }
- namespace sheet { class XSpreadsheet; }
- namespace sheet { class XNamedRanges; }
- namespace sheet { class XNamedRange; }
- namespace sheet { class XDatabaseRanges; }
- namespace sheet { class XExternalDocLinks; }
- namespace style { class XStyle; }
} } }
namespace oox {
class AttributeList;
class SegmentProgressBar;
- class RecordInputStream;
+ class SequenceInputStream;
}
namespace oox { namespace core {
@@ -79,8 +76,8 @@ class ExcelBiffFilter;
/** An enumeration for all supported spreadsheet filter types. */
enum FilterType
{
- FILTER_OOX, /// MS Excel OOXML (Office Open XML) or OOBIN.
- FILTER_BIFF, /// MS Excel BIFF (Binary Interchange File Format).
+ FILTER_OOXML, /// MS Excel OOXML (Office Open XML) or BIFF12.
+ FILTER_BIFF, /// MS Excel BIFF2-BIFF8 (Binary Interchange File Format).
FILTER_UNKNOWN /// Unknown filter type.
};
@@ -89,31 +86,31 @@ enum FilterType
/** Functor for case-insensitive string comparison, usable in maps etc. */
struct IgnoreCaseCompare
{
- bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
+ bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
};
// ============================================================================
-class WorkbookData;
-class WorkbookSettings;
-class ViewSettings;
-class WorksheetBuffer;
-class ThemeBuffer;
-class StylesBuffer;
-class SharedStringsBuffer;
-class ExternalLinkBuffer;
+class AddressConverter;
+class BiffCodecHelper;
+class ConnectionsBuffer;
class DefinedNamesBuffer;
-class TableBuffer;
-class ScenarioBuffer;
-class WebQueryBuffer;
+class ExcelChartConverter;
+class ExternalLinkBuffer;
+class FormulaParser;
+class PageSettingsConverter;
class PivotCacheBuffer;
class PivotTableBuffer;
-class FormulaParser;
+class ScenarioBuffer;
+class SharedStringsBuffer;
+class StylesBuffer;
+class TableBuffer;
+class ThemeBuffer;
class UnitConverter;
-class AddressConverter;
-class ExcelChartConverter;
-class PageSettingsConverter;
-class BiffCodecHelper;
+class ViewSettings;
+class WorkbookData;
+class WorkbookSettings;
+class WorksheetBuffer;
/** Helper class to provice access to global workbook data.
@@ -163,21 +160,6 @@ public:
/** Returns a reference to the service factory of the spreadsheet document model. */
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
getDocumentFactory() const;
- /** Returns the reference device of the document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >
- getReferenceDevice() const;
- /** Returns the container for defined names from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRanges >
- getNamedRanges() const;
- /** Returns the container for database ranges from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRanges >
- getDatabaseRanges() const;
- /** Returns the container for external documents from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalDocLinks >
- getExternalDocLinks() const;
- /** Returns the container for DDE links from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- getDdeLinks() const;
/** Returns a reference to the specified spreadsheet in the document model. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
@@ -203,12 +185,21 @@ public:
getStyleObject( const ::rtl::OUString& rStyleName, bool bPageStyle ) const;
/** Creates and returns a defined name on-the-fly in the Calc document.
- The name will not be buffered in this defined names buffer.
+ The name will not be buffered in the global defined names buffer.
@param orName (in/out-parameter) Returns the resulting used name. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
createNamedRangeObject(
::rtl::OUString& orName,
sal_Int32 nNameFlags = 0 ) const;
+
+ /** Creates and returns a database range on-the-fly in the Calc document.
+ The range will not be buffered in the global table buffer.
+ @param orName (in/out-parameter) Returns the resulting used name. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange >
+ createDatabaseRangeObject(
+ ::rtl::OUString& orName,
+ const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const;
+
/** Creates and returns a com.sun.star.style.Style object for cells or pages. */
::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
createStyleObject(
@@ -237,8 +228,8 @@ public:
TableBuffer& getTables() const;
/** Returns the scenarios collection. */
ScenarioBuffer& getScenarios() const;
- /** Returns the web queries. */
- WebQueryBuffer& getWebQueries() const;
+ /** Returns the collection of external data connections. */
+ ConnectionsBuffer& getConnections() const;
/** Returns the collection of pivot caches. */
PivotCacheBuffer& getPivotCaches() const;
/** Returns the collection of pivot tables. */
@@ -257,17 +248,17 @@ public:
/** Returns the page and print settings converter. */
PageSettingsConverter& getPageSettingsConverter() const;
- // OOX specific (MUST NOT be called in BIFF filter) -----------------------
+ // OOXML/BIFF12 specific (MUST NOT be called in BIFF filter) --------------
- /** Returns the base OOX filter object.
- Must not be called, if current filter is not the OOX filter. */
+ /** Returns the base OOXML/BIFF12 filter object.
+ Must not be called, if current filter is not the OOXML/BIFF12 filter. */
::oox::core::XmlFilterBase& getOoxFilter() const;
/** Imports a fragment using the passed fragment handler, which contains
the full path to the fragment stream. */
bool importOoxFragment( const ::rtl::Reference< ::oox::core::FragmentHandler >& rxHandler );
- // BIFF specific (MUST NOT be called in OOX filter) -----------------------
+ // BIFF2-BIFF8 specific (MUST NOT be called in OOXML/BIFF12 filter) -------
/** Returns the base BIFF filter object. */
::oox::core::BinaryFilterBase& getBiffFilter() const;
diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx
index 8ba322103955..858e886df778 100644
--- a/oox/inc/oox/xls/workbooksettings.hxx
+++ b/oox/inc/oox/xls/workbooksettings.hxx
@@ -61,8 +61,8 @@ struct WorkbookSettingsModel
explicit WorkbookSettingsModel();
- /** Sets OOBIN or BIFF object visibility mode. */
- void setBinObjectMode( sal_uInt16 nObjMode );
+ /** Sets BIFF object visibility mode. */
+ void setBiffObjectMode( sal_uInt16 nObjMode );
};
// ============================================================================
@@ -101,11 +101,11 @@ public:
void importCalcPr( const AttributeList& rAttribs );
/** Imports the FILESHARING record containing write protection settings. */
- void importFileSharing( RecordInputStream& rStrm );
+ void importFileSharing( SequenceInputStream& rStrm );
/** Imports the WORKBOOKPR record containing global workbook settings. */
- void importWorkbookPr( RecordInputStream& rStrm );
+ void importWorkbookPr( SequenceInputStream& rStrm );
/** Imports the CALCPR record containing workbook calculation settings. */
- void importCalcPr( RecordInputStream& rStrm );
+ void importCalcPr( SequenceInputStream& rStrm );
/** Sets the save external linked values flag, e.g. from the WSBOOL record. */
void setSaveExtLinkValues( bool bSaveExtLinks );
@@ -162,4 +162,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx
index 2f9359b38370..7c59cce988dd 100644
--- a/oox/inc/oox/xls/worksheetbuffer.hxx
+++ b/oox/inc/oox/xls/worksheetbuffer.hxx
@@ -29,7 +29,8 @@
#define OOX_XLS_WORKSHEETBUFFER_HXX
#include <utility>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -58,8 +59,8 @@ struct SheetInfoModel
/** Stores information about all sheets in a spreadsheet document.
Information about sheets includes the sheet name, the visibility state, and
- for the OOX filter, the relation identifier of the sheet used to obtain the
- related worksheet fragment.
+ for the OOXML filter, the relation identifier of the sheet used to obtain
+ the related worksheet fragment.
*/
class WorksheetBuffer : public WorkbookHelper
{
@@ -74,8 +75,8 @@ public:
/** Imports the attributes of a sheet element. */
void importSheet( const AttributeList& rAttribs );
- /** Imports the SHEET record from the passed OOBIN stream. */
- void importSheet( RecordInputStream& rStrm );
+ /** Imports the SHEET record from the passed BIFF12 stream. */
+ void importSheet( SequenceInputStream& rStrm );
/** Imports the SHEET record from the passed BIFF stream. */
void importSheet( BiffInputStream& rStrm );
/** Inserts a new empty sheet into the document. Looks for an unused name.
@@ -84,7 +85,7 @@ public:
/** Returns the number of original sheets contained in the workbook. */
sal_Int32 getWorksheetCount() const;
- /** Returns the OOX relation identifier of the specified worksheet. */
+ /** Returns the OOXML relation identifier of the specified worksheet. */
::rtl::OUString getWorksheetRelId( sal_Int32 nWorksheet ) const;
/** Returns the BIFF record handle of the associated sheet substream. */
sal_Int64 getBiffRecordHandle( sal_Int32 nWorksheet ) const;
@@ -130,4 +131,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx
index 7234153d7dd3..4fe3bf4240dd 100644
--- a/oox/inc/oox/xls/worksheetfragment.hxx
+++ b/oox/inc/oox/xls/worksheetfragment.hxx
@@ -35,24 +35,23 @@ namespace xls {
// ============================================================================
-class OoxDataValidationsContext : public OoxWorksheetContextBase
+class DataValidationsContext : public WorksheetContextBase
{
public:
- explicit OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment );
+ explicit DataValidationsContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Imports the dataValidation element containing data validation settings. */
void importDataValidation( const AttributeList& rAttribs );
/** Imports the DATAVALIDATION record containing data validation settings. */
- void importDataValidation( RecordInputStream& rStrm );
+ void importDataValidation( SequenceInputStream& rStrm );
private:
::std::auto_ptr< ValidationModel > mxValModel;
@@ -60,25 +59,21 @@ private:
// ============================================================================
-class OoxWorksheetFragment : public OoxWorksheetFragmentBase
+class WorksheetFragment : public WorksheetFragmentBase
{
public:
- explicit OoxWorksheetFragment(
+ explicit WorksheetFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void initializeImport();
@@ -109,25 +104,25 @@ private:
void importControl( const AttributeList& rAttribs );
/** Imports the DIMENSION record containing the used area of the sheet. */
- void importDimension( RecordInputStream& rStrm );
+ void importDimension( SequenceInputStream& rStrm );
/** Imports sheet format properties from a SHEETFORMATPR record. */
- void importSheetFormatPr( RecordInputStream& rStrm );
+ void importSheetFormatPr( SequenceInputStream& rStrm );
/** Imports column settings from a COL record. */
- void importCol( RecordInputStream& rStrm );
+ void importCol( SequenceInputStream& rStrm );
/** Imports a merged cell range from a MERGECELL record. */
- void importMergeCell( RecordInputStream& rStrm );
+ void importMergeCell( SequenceInputStream& rStrm );
/** Imports a hyperlink for a cell range from a HYPERLINK record. */
- void importHyperlink( RecordInputStream& rStrm );
+ void importHyperlink( SequenceInputStream& rStrm );
/** Imports the BRK record for an individual row or column page break. */
- void importBrk( RecordInputStream& rStrm, bool bRowBreak );
+ void importBrk( SequenceInputStream& rStrm, bool bRowBreak );
/** Imports the DRAWING record containing the relation identifier for the DrawingML part. */
- void importDrawing( RecordInputStream& rStrm );
+ void importDrawing( SequenceInputStream& rStrm );
/** Imports the LEGACYDRAWING record containing the relation identifier for the VML drawing part. */
- void importLegacyDrawing( RecordInputStream& rStrm );
+ void importLegacyDrawing( SequenceInputStream& rStrm );
/** Imports additional data for an OLE object. */
- void importOleObject( RecordInputStream& rStrm );
+ void importOleObject( SequenceInputStream& rStrm );
/** Imports additional data for an OCX form control. */
- void importControl( RecordInputStream& rStrm );
+ void importControl( SequenceInputStream& rStrm );
/** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */
void importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const ::rtl::OUString& rRelId );
@@ -135,14 +130,12 @@ private:
// ============================================================================
-class BiffPivotTableContext;
-
class BiffWorksheetFragment : public BiffWorksheetFragmentBase
{
public:
explicit BiffWorksheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
virtual ~BiffWorksheetFragment();
@@ -151,41 +144,45 @@ public:
virtual bool importFragment();
private:
+ /** Imports the AUTOFILTER and following records with auto filter settings. */
+ void importAutoFilter( BiffInputStream& rStrm );
/** Imports the COLINFO record and sets column properties and formatting. */
- void importColInfo();
+ void importColInfo( BiffInputStream& rStrm );
/** Imports the BIFF2 COLUMNDEFAULT record and sets column default formatting. */
- void importColumnDefault();
+ void importColumnDefault( BiffInputStream& rStrm );
/** Imports the BIFF2 COLWIDTH record and sets column width. */
- void importColWidth();
+ void importColWidth( BiffInputStream& rStrm );
/** Imports the DATAVALIDATION record containing cell ranges with data validation settings. */
- void importDataValidation();
+ void importDataValidation( BiffInputStream& rStrm );
/** Imports the DATAVALIDATIONS record containing global data validation settings. */
- void importDataValidations();
+ void importDataValidations( BiffInputStream& rStrm );
/** Imports the DEFCOLWIDTH record and sets default column width. */
- void importDefColWidth();
+ void importDefColWidth( BiffInputStream& rStrm );
/** Imports the DEFROWHEIGHT record and sets default row height and properties. */
- void importDefRowHeight();
+ void importDefRowHeight( BiffInputStream& rStrm );
/** Imports the DIMENSION record containing the used area of the sheet. */
- void importDimension();
+ void importDimension( BiffInputStream& rStrm );
/** Imports the HYPERLINK record and sets a cell hyperlink. */
- void importHyperlink();
+ void importHyperlink( BiffInputStream& rStrm );
/** Imports the LABELRANGES record and sets the imported label ranges. */
- void importLabelRanges();
+ void importLabelRanges( BiffInputStream& rStrm );
/** Imports the MEREDCELLS record and merges all cells in the document. */
- void importMergedCells();
+ void importMergedCells( BiffInputStream& rStrm );
/** Imports the HORPAGEBREAKS or VERPAGEBREAKS record and inserts page breaks. */
- void importPageBreaks( bool bRowBreak );
+ void importPageBreaks( BiffInputStream& rStrm, bool bRowBreak );
/** Imports a pivot table. */
- void importPTDefinition();
+ void importPTDefinition( BiffInputStream& rStrm );
+ /** Imports the QUERYTABLE and following records and inserts a web query. */
+ void importQueryTable( BiffInputStream& rStrm );
/** Imports the SCENARIOS record and the following scenarios. */
- void importScenarios();
+ void importScenarios( BiffInputStream& rStrm );
/** Imports the SHAREDFEATHEAD record. */
- void importSharedFeatHead();
+ void importSharedFeatHead( BiffInputStream& rStrm );
/** Imports the STANDARDWIDTH record and sets standard column width. */
- void importStandardWidth();
+ void importStandardWidth( BiffInputStream& rStrm );
private:
- ::boost::shared_ptr< BiffPivotTableContext > mxPTContext;
+ ::boost::shared_ptr< BiffWorksheetContextBase > mxContext;
};
// ============================================================================
@@ -194,4 +191,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx
index 632d7027403f..55bf1c044e30 100644
--- a/oox/inc/oox/xls/worksheethelper.hxx
+++ b/oox/inc/oox/xls/worksheethelper.hxx
@@ -37,29 +37,31 @@ namespace com { namespace sun { namespace star {
namespace awt { struct Point; }
namespace awt { struct Rectangle; }
namespace awt { struct Size; }
- namespace util { struct DateTime; }
namespace drawing { class XDrawPage; }
- namespace table { class XTableColumns; }
- namespace table { class XTableRows; }
+ namespace sheet { class XSheetCellRanges; }
+ namespace sheet { class XSpreadsheet; }
namespace table { class XCell; }
namespace table { class XCellRange; }
- namespace sheet { class XSpreadsheet; }
- namespace sheet { class XSheetCellRanges; }
+ namespace table { class XTableColumns; }
+ namespace table { class XTableRows; }
+ namespace util { struct DateTime; }
} } }
namespace oox {
namespace xls {
+class AutoFilterBuffer;
struct BinAddress;
struct BinRange;
class BinRangeList;
-class WorksheetSettings;
-class SharedFormulaBuffer;
-class CondFormatBuffer;
class CommentsBuffer;
+class CondFormatBuffer;
class PageSettings;
+class QueryTableBuffer;
+class SharedFormulaBuffer;
class SheetViewSettings;
class VmlDrawing;
+class WorksheetSettings;
// ============================================================================
// ============================================================================
@@ -202,12 +204,12 @@ struct ValidationModel
explicit ValidationModel();
- /** Sets the passed OOBIN or BIFF validation type. */
- void setBinType( sal_uInt8 nType );
- /** Sets the passed OOBIN or BIFF operator. */
- void setBinOperator( sal_uInt8 nOperator );
- /** Sets the passed OOBIN or BIFF error style. */
- void setBinErrorStyle( sal_uInt8 nErrorStyle );
+ /** Sets the passed BIFF validation type. */
+ void setBiffType( sal_uInt8 nType );
+ /** Sets the passed BIFF operator. */
+ void setBiffOperator( sal_uInt8 nOperator );
+ /** Sets the passed BIFF error style. */
+ void setBiffErrorStyle( sal_uInt8 nErrorStyle );
};
// ============================================================================
@@ -314,6 +316,10 @@ public:
CondFormatBuffer& getCondFormats() const;
/** Returns the buffer for all cell comments in this sheet. */
CommentsBuffer& getComments() const;
+ /** Returns the auto filters for the sheet. */
+ AutoFilterBuffer& getAutoFilters() const;
+ /** Returns the buffer for all web query tables in this sheet. */
+ QueryTableBuffer& getQueryTables() const;
/** Returns the page/print settings for this sheet. */
PageSettings& getPageSettings() const;
/** Returns the view settings for this sheet. */
@@ -383,9 +389,8 @@ public:
void extendUsedArea( const ::com::sun::star::table::CellAddress& rAddress );
/** Extends the used area of this sheet by the passed cell range. */
void extendUsedArea( const ::com::sun::star::table::CellRangeAddress& rRange );
- /** Extends the shape bounding box by the position and size of the passed rectangle. */
- void extendShapeBoundingBox(
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ /** Extends the shape bounding box by the position and size of the passed rectangle (in 1/100 mm). */
+ void extendShapeBoundingBox( const ::com::sun::star::awt::Rectangle& rShapeRect );
/** Sets base width for all columns (without padding pixels). This value
is only used, if width has not been set with setDefaultColumnWidth(). */
@@ -445,7 +450,7 @@ protected:
/** Constructs from the passed data, creates and owns a new data object. */
explicit WorksheetHelperRoot(
const WorkbookHelper& rHelper,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
@@ -468,4 +473,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx
index 17e22dc5342c..6d6c8a4912d2 100644
--- a/oox/inc/oox/xls/worksheetsettings.hxx
+++ b/oox/inc/oox/xls/worksheetsettings.hxx
@@ -28,8 +28,8 @@
#ifndef OOX_XLS_WORKSHEETSETTINGS_HXX
#define OOX_XLS_WORKSHEETSETTINGS_HXX
-#include "oox/xls/worksheethelper.hxx"
#include "oox/xls/richstring.hxx"
+#include "oox/xls/worksheethelper.hxx"
namespace oox {
namespace xls {
@@ -98,16 +98,18 @@ public:
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports sheet properties from the SHEETPR record. */
- void importSheetPr( RecordInputStream& rStrm );
+ void importSheetPr( SequenceInputStream& rStrm );
/** Imports sheet properties from the CHARTSHEETPR record. */
- void importChartSheetPr( RecordInputStream& rStrm );
+ void importChartSheetPr( SequenceInputStream& rStrm );
/** Imports sheet protection settings from the SHEETPROTECTION record. */
- void importSheetProtection( RecordInputStream& rStrm );
+ void importSheetProtection( SequenceInputStream& rStrm );
/** Imports chart sheet protection settings from the CHARTPROTECTION record. */
- void importChartProtection( RecordInputStream& rStrm );
+ void importChartProtection( SequenceInputStream& rStrm );
/** Imports phonetic settings from the PHONETICPR record. */
- void importPhoneticPr( RecordInputStream& rStrm );
+ void importPhoneticPr( SequenceInputStream& rStrm );
+ /** Imports sheet properties from a SHEETEXT record. */
+ void importSheetExt( BiffInputStream& rStrm );
/** Imports sheet properties from a SHEETPR record. */
void importSheetPr( BiffInputStream& rStrm );
/** Imports protection status from the PROTECT record. */
@@ -140,4 +142,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/prj/d.lst b/oox/prj/d.lst
index f656056b119e..69ff66b95bc5 100644
--- a/oox/prj/d.lst
+++ b/oox/prj/d.lst
@@ -1,10 +1,11 @@
mkdir: %_DEST%\inc%_EXT%\oox
-mkdir: %_DEST%\inc%_EXT%\oox\helper
mkdir: %_DEST%\inc%_EXT%\oox\core
mkdir: %_DEST%\inc%_EXT%\oox\drawingml
mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart
mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table
+mkdir: %_DEST%\inc%_EXT%\oox\helper
mkdir: %_DEST%\inc%_EXT%\oox\ole
+mkdir: %_DEST%\inc%_EXT%\oox\token
mkdir: %_DEST%\inc%_EXT%\oox\vml
mkdir: %_DEST%\inc%_EXT%\oox\xls
@@ -17,14 +18,15 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls
..\%__SRC%\lib\i*.lib %_DEST%\lib%_EXT%\i*.lib
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\inc\tokens.hxx %_DEST%\inc%_EXT%\oox\core\tokens.hxx
+..\%__SRC%\inc\oox\token\tokens.hxx %_DEST%\inc%_EXT%\oox\token\tokens.hxx
+..\%__SRC%\misc\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt
..\source\token\tokens.txt %_DEST%\inc%_EXT%\oox\token.txt
-..\source\token\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt
..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h
..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx
..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx
-..\inc\oox\helper\containerhelper.hxx %_DEST%\inc%_EXT%\oox\helper\containerhelper.hxx
+..\inc\oox\helper\refmap.hxx %_DEST%\inc%_EXT%\oox\helper\refmap.hxx
+..\inc\oox\helper\refvector.hxx %_DEST%\inc%_EXT%\oox\helper\refvector.hxx
..\inc\oox\helper\storagebase.hxx %_DEST%\inc%_EXT%\oox\helper\storagebase.hxx
..\inc\oox\helper\zipstorage.hxx %_DEST%\inc%_EXT%\oox\helper\zipstorage.hxx
..\inc\oox\core\filterbase.hxx %_DEST%\inc%_EXT%\oox\core\filterbase.hxx
diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx
index 954f623f1f91..3f406ba1af08 100644
--- a/oox/source/core/binarycodec.cxx
+++ b/oox/source/core/binarycodec.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/core/binarycodec.hxx"
+
#include <algorithm>
#include <string.h>
#include "oox/helper/attributelist.hxx"
@@ -424,4 +425,3 @@ bool BinaryCodec_RCF::skip( sal_Int32 nBytes )
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/binaryfilterbase.cxx b/oox/source/core/binaryfilterbase.cxx
index f308f02ac9dc..9bebedb9c96b 100644
--- a/oox/source/core/binaryfilterbase.cxx
+++ b/oox/source/core/binaryfilterbase.cxx
@@ -26,21 +26,24 @@
************************************************************************/
#include "oox/core/binaryfilterbase.hxx"
-#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XStream;
+#include "oox/ole/olestorage.hxx"
namespace oox {
namespace core {
// ============================================================================
-BinaryFilterBase::BinaryFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- FilterBase( rxGlobalFactory )
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+BinaryFilterBase::BinaryFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ FilterBase( rxContext )
{
}
@@ -52,16 +55,15 @@ BinaryFilterBase::~BinaryFilterBase()
StorageRef BinaryFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const
{
- return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxInStream, true ) );
+ return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxInStream, true ) );
}
StorageRef BinaryFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const
{
- return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxOutStream, true ) );
+ return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxOutStream, true ) );
}
// ============================================================================
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx
index b9c7cb48377e..8bf2c4eadfeb 100644
--- a/oox/source/core/contexthandler.cxx
+++ b/oox/source/core/contexthandler.cxx
@@ -26,21 +26,21 @@
************************************************************************/
#include "oox/core/contexthandler.hxx"
-#include "oox/core/fragmenthandler.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XLocator;
+#include "oox/core/fragmenthandler.hxx"
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ContextHandler::ContextHandler( ContextHandler& rParent ) :
ContextHandlerImplBase(),
mxBaseData( rParent.mxBaseData )
@@ -133,12 +133,12 @@ void ContextHandler::processingInstruction( const OUString&, const OUString& ) t
// record context interface ---------------------------------------------------
-ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, RecordInputStream& )
+ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void ContextHandler::startRecord( sal_Int32, RecordInputStream& )
+void ContextHandler::startRecord( sal_Int32, SequenceInputStream& )
{
}
@@ -150,4 +150,3 @@ void ContextHandler::endRecord( sal_Int32 )
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index 0f39ba313e6b..48f5718f9149 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -28,36 +28,29 @@
#include "oox/core/contexthandler2.hxx"
#include <rtl/ustrbuf.hxx>
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-
namespace oox {
namespace core {
// ============================================================================
-/** Information about a processed context element. */
-struct ContextInfo
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+/** Information about a processed element. */
+struct ElementInfo
{
- OUStringBuffer maCurrChars; /// Collected characters from context.
- OUStringBuffer maFinalChars; /// Finalized (stipped) characters.
+ OUStringBuffer maChars; /// Collected element characters.
sal_Int32 mnElement; /// The element identifier.
bool mbTrimSpaces; /// True = trims leading/trailing spaces from text data.
- explicit ContextInfo();
+ inline explicit ElementInfo() : mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
};
-ContextInfo::ContextInfo() :
- mnElement( XML_TOKEN_INVALID ),
- mbTrimSpaces( false )
-{
-}
-
// ============================================================================
ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
@@ -65,7 +58,7 @@ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
mnRootStackSize( 0 ),
mbEnableTrimSpace( bEnableTrimSpace )
{
- pushContextInfo( XML_ROOT_CONTEXT );
+ pushElementInfo( XML_ROOT_CONTEXT );
}
ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) :
@@ -84,7 +77,7 @@ sal_Int32 ContextHandler2Helper::getCurrentElement() const
return mxContextStack->empty() ? XML_ROOT_CONTEXT : mxContextStack->back().mnElement;
}
-sal_Int32 ContextHandler2Helper::getPreviousElement( sal_Int32 nCountBack ) const
+sal_Int32 ContextHandler2Helper::getParentElement( sal_Int32 nCountBack ) const
{
if( (nCountBack < 0) || (mxContextStack->size() < static_cast< size_t >( nCountBack )) )
return XML_TOKEN_INVALID;
@@ -97,49 +90,50 @@ bool ContextHandler2Helper::isRootElement() const
return mxContextStack->size() == mnRootStackSize + 1;
}
-Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
+Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext(
+ sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
- appendCollectedChars();
+ // #i76091# process collected characters (calls onCharacters() if needed)
+ processCollectedChars();
ContextHandlerRef xContext = onCreateContext( nElement, AttributeList( rxAttribs ) );
return Reference< XFastContextHandler >( xContext.get() );
}
-void ContextHandler2Helper::implStartCurrentContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
+void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
AttributeList aAttribs( rxAttribs );
- pushContextInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve;
+ pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( XML_TOKEN( space ), XML_TOKEN_INVALID ) != XML_preserve;
onStartElement( aAttribs );
}
void ContextHandler2Helper::implCharacters( const OUString& rChars )
{
- // #i76091# collect characters until context ends
+ // #i76091# collect characters until new element starts or this element ends
if( !mxContextStack->empty() )
- mxContextStack->back().maCurrChars.append( rChars );
+ mxContextStack->back().maChars.append( rChars );
}
-void ContextHandler2Helper::implEndCurrentContext( sal_Int32 nElement )
+void ContextHandler2Helper::implEndElement( sal_Int32 nElement )
{
(void)nElement; // prevent "unused parameter" warning in product build
- OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndCurrentContext - context stack broken" );
+ OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndElement - context stack broken" );
if( !mxContextStack->empty() )
{
- // #i76091# process collected characters
- appendCollectedChars();
- // finalize the current context and pop context info from stack
- onEndElement( mxContextStack->back().maFinalChars.makeStringAndClear() );
- popContextInfo();
+ // #i76091# process collected characters (calls onCharacters() if needed)
+ processCollectedChars();
+ onEndElement();
+ popElementInfo();
}
}
-ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return onCreateRecordContext( nRecId, rStrm );
}
-void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- pushContextInfo( nRecId );
+ pushElementInfo( nRecId );
onStartRecord( rStrm );
}
@@ -149,42 +143,44 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId )
OSL_ENSURE( getCurrentElement() == nRecId, "ContextHandler2Helper::implEndRecord - context stack broken" );
if( !mxContextStack->empty() )
{
- // finalize the current context and pop context info from stack
onEndRecord();
- popContextInfo();
+ popElementInfo();
}
}
-ContextInfo& ContextHandler2Helper::pushContextInfo( sal_Int32 nElement )
+ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement )
{
mxContextStack->resize( mxContextStack->size() + 1 );
- ContextInfo& rInfo = mxContextStack->back();
+ ElementInfo& rInfo = mxContextStack->back();
rInfo.mnElement = nElement;
return rInfo;
}
-void ContextHandler2Helper::popContextInfo()
+void ContextHandler2Helper::popElementInfo()
{
- OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popContextInfo - context stack broken" );
+ OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popElementInfo - context stack broken" );
if( !mxContextStack->empty() )
mxContextStack->pop_back();
}
-void ContextHandler2Helper::appendCollectedChars()
+void ContextHandler2Helper::processCollectedChars()
{
- OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::appendCollectedChars - no context info" );
- ContextInfo& rInfo = mxContextStack->back();
- if( rInfo.maCurrChars.getLength() > 0 )
+ OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::processCollectedChars - no context info" );
+ ElementInfo& rInfo = mxContextStack->back();
+ if( rInfo.maChars.getLength() > 0 )
{
- OUString aChars = rInfo.maCurrChars.makeStringAndClear();
- rInfo.maFinalChars.append( (mbEnableTrimSpace && rInfo.mbTrimSpaces) ? aChars.trim() : aChars );
+ OUString aChars = rInfo.maChars.makeStringAndClear();
+ if( mbEnableTrimSpace && rInfo.mbTrimSpaces )
+ aChars = aChars.trim();
+ if( aChars.getLength() > 0 )
+ onCharacters( aChars );
}
}
// ============================================================================
ContextHandler2::ContextHandler2( ContextHandler2Helper& rParent ) :
- ContextHandler( rParent.queryContextHandler() ),
+ ContextHandler( dynamic_cast< ContextHandler& >( rParent ) ),
ContextHandler2Helper( rParent )
{
}
@@ -193,11 +189,6 @@ ContextHandler2::~ContextHandler2()
{
}
-ContextHandler& ContextHandler2::queryContextHandler()
-{
- return *this;
-}
-
// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContext(
@@ -209,7 +200,7 @@ Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContex
void SAL_CALL ContextHandler2::startFastElement(
sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException )
{
- implStartCurrentContext( nElement, rxAttribs );
+ implStartElement( nElement, rxAttribs );
}
void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException )
@@ -219,17 +210,17 @@ void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXEx
void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException )
{
- implEndCurrentContext( nElement );
+ implEndElement( nElement );
}
// oox.core.RecordContext interface -------------------------------------------
-ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return implCreateRecordContext( nRecId, rStrm );
}
-void ContextHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void ContextHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
implStartRecord( nRecId, rStrm );
}
@@ -250,16 +241,20 @@ void ContextHandler2::onStartElement( const AttributeList& )
{
}
-void ContextHandler2::onEndElement( const OUString& )
+void ContextHandler2::onCharacters( const OUString& )
{
}
-ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& )
+void ContextHandler2::onEndElement()
+{
+}
+
+ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void ContextHandler2::onStartRecord( RecordInputStream& )
+void ContextHandler2::onStartRecord( SequenceInputStream& )
{
}
@@ -271,4 +266,3 @@ void ContextHandler2::onEndRecord()
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx
deleted file mode 100644
index ed54ae81e7e5..000000000000
--- a/oox/source/core/facreg.cxx
+++ /dev/null
@@ -1,137 +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 "oox/dllapi.h"
-
-#include <string.h>
-
-#include <sal/config.h>
-
-#include <com/sun/star/container/XSet.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#include <cppuhelper/factory.hxx>
-#include <uno/lbnames.h>
-
-using namespace rtl;
-using namespace com::sun::star;
-
-#define SERVICE( className ) \
-extern OUString SAL_CALL className##_getImplementationName() throw(); \
-extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\
-extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) \
- throw( uno::Exception )
-
-#define SERVICE2( className ) \
-extern OUString SAL_CALL className##_getImplementationName() throw(); \
-extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\
-extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \
- const uno::Reference< uno::XComponentContext > & xContext ) \
- throw( uno::Exception )
-
-namespace oox {
- namespace core { SERVICE( FilterDetect ); }
- namespace ppt { SERVICE( PowerPointImport ); }
- namespace xls { SERVICE( BiffDetector ); }
- namespace xls { SERVICE( ExcelFilter ); }
- namespace xls { SERVICE( ExcelBiffFilter ); }
- namespace shape { SERVICE( ShapeContextHandler ); }
- namespace shape { SERVICE( FastTokenHandlerService ); }
- namespace docprop { SERVICE2( OOXMLDocPropImportImpl ); }
- namespace xls { SERVICE2( OOXMLFormulaParser ); }
-}
-
-//
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-OOX_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-#define SINGLEFACTORY(classname)\
- if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
- {\
- xFactory = ::cppu::createSingleFactory( xMSF,\
- classname##_getImplementationName(),\
- classname##_createInstance,\
- classname##_getSupportedServiceNames() );\
- }
-
-#define SINGLEFACTORY2(classname)\
- if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
- {\
- xCompFactory = ::cppu::createSingleComponentFactory(\
- classname##_createInstance,\
- classname##_getImplementationName(),\
- classname##_getSupportedServiceNames() );\
- }
-
-OOX_DLLPUBLIC void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * )
-{
- void * pRet = 0;
- if( pServiceManager )
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
-
- const sal_Int32 nImplNameLen = strlen( pImplName );
-
- SINGLEFACTORY( ::oox::core::FilterDetect )
- else SINGLEFACTORY( oox::ppt::PowerPointImport )
- else SINGLEFACTORY( ::oox::xls::BiffDetector )
- else SINGLEFACTORY( ::oox::xls::ExcelFilter )
- else SINGLEFACTORY( ::oox::xls::ExcelBiffFilter )
- else SINGLEFACTORY( ::oox::shape::ShapeContextHandler)
- else SINGLEFACTORY( ::oox::shape::FastTokenHandlerService)
- else SINGLEFACTORY2( ::oox::docprop::OOXMLDocPropImportImpl )
- else SINGLEFACTORY2( ::oox::xls::OOXMLFormulaParser )
-
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- else if ( xCompFactory.is() )
- {
- xCompFactory->acquire();
- pRet = xCompFactory.get();
- }
- }
- return pRet;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
new file mode 100755
index 000000000000..eaf8c428b92c
--- /dev/null
+++ b/oox/source/core/fastparser.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * 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 "oox/core/fastparser.hxx"
+
+#include "oox/core/fasttokenhandler.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/token/namespacemap.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+namespace {
+
+class InputStreamCloseGuard
+{
+public:
+ explicit InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream );
+ ~InputStreamCloseGuard();
+private:
+ Reference< XInputStream > mxInStream;
+ bool mbCloseStream;
+};
+
+InputStreamCloseGuard::InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ) :
+ mxInStream( rxInStream ),
+ mbCloseStream( bCloseStream )
+{
+}
+
+InputStreamCloseGuard::~InputStreamCloseGuard()
+{
+ if( mxInStream.is() && mbCloseStream ) try { mxInStream->closeInput(); } catch( Exception& ) {}
+}
+
+} // namespace
+
+// ============================================================================
+
+FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mrNamespaceMap( StaticNamespaceMap::get() )
+{
+ // create a fast parser instance
+ Reference< XMultiComponentFactory > xFactory( rxContext->getServiceManager(), UNO_SET_THROW );
+ mxParser.set( xFactory->createInstanceWithContext( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ), rxContext ), UNO_QUERY_THROW );
+
+ // create the fast token handler based on the OOXML token list
+ mxParser->setTokenHandler( new FastTokenHandler );
+}
+
+FastParser::~FastParser()
+{
+}
+
+void FastParser::registerNamespace( sal_Int32 nNamespaceId ) throw( IllegalArgumentException, RuntimeException )
+{
+ if( !mxParser.is() )
+ throw RuntimeException();
+
+ const OUString* pNamespaceUrl = ContainerHelper::getMapElement( mrNamespaceMap, nNamespaceId );
+ if( !pNamespaceUrl )
+ throw IllegalArgumentException();
+
+ mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId );
+}
+
+void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rxDocHandler ) throw( RuntimeException )
+{
+ if( !mxParser.is() )
+ throw RuntimeException();
+ mxParser->setFastDocumentHandler( rxDocHandler );
+}
+
+void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ // guard closing the input stream also when exceptions are thrown
+ InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream );
+ if( !mxParser.is() )
+ throw RuntimeException();
+ mxParser->parseStream( rInputSource );
+}
+
+void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ InputSource aInputSource;
+ aInputSource.sSystemId = rStreamName;
+ aInputSource.aInputStream = rxInStream;
+ parseStream( aInputSource, bCloseStream );
+}
+
+void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ parseStream( rStorage.openInputStream( rStreamName ), rStreamName, bCloseStream );
+}
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx
index c662828bc583..e09687cc5470 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -26,29 +26,38 @@
************************************************************************/
#include "oox/core/fasttokenhandler.hxx"
-#include <osl/mutex.hxx>
-#include "oox/token/tokenmap.hxx"
-using ::rtl::OUString;
-using ::osl::Mutex;
-using ::osl::MutexGuard;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::RuntimeException;
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/token/tokenmap.hxx"
namespace oox {
namespace core {
// ============================================================================
-namespace {
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+OUString SAL_CALL FastTokenHandler_getImplementationName()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.core.FastTokenHandler" );
+}
-Mutex& lclGetTokenMutex()
+Sequence< OUString > SAL_CALL FastTokenHandler_getSupportedServiceNames()
{
- static Mutex aMutex;
- return aMutex;
+ Sequence< OUString > aServiceNames( 1 );
+ aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" );
+ return aServiceNames;
}
-} // namespace
+Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ ) throw (Exception)
+{
+ return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
+}
// ============================================================================
@@ -61,27 +70,46 @@ FastTokenHandler::~FastTokenHandler()
{
}
+// XServiceInfo
+
+OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException)
+{
+ return FastTokenHandler_getImplementationName();
+}
+
+sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException)
+{
+ Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames();
+ for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
+ if( aServiceNames[ nIndex ] == rServiceName )
+ return sal_True;
+ return sal_False;
+}
+
+Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException)
+{
+ return FastTokenHandler_getSupportedServiceNames();
+}
+
+// XFastTokenHandler
+
sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getTokenFromUnicode( rIdentifier );
}
OUString FastTokenHandler::getIdentifier( sal_Int32 nToken ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getUnicodeTokenName( nToken );
}
Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getUtf8TokenName( nToken );
}
sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdentifier ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getTokenFromUtf8( rIdentifier );
}
@@ -89,4 +117,3 @@ sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdent
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 6d2b98454444..b215150acb88 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -26,51 +26,41 @@
************************************************************************/
#include "oox/core/filterbase.hxx"
+
#include <set>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <comphelper/docpasswordhelper.hxx>
+#include <comphelper/mediadescriptor.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <rtl/uri.hxx>
-#include <comphelper/docpasswordhelper.hxx>
-#include <comphelper/mediadescriptor.hxx>
-#include "tokens.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/ole/oleobjecthelper.hxx"
+#include "oox/ole/vbaproject.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::uno;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::lang::XComponent;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::frame::XFrame;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::task::XStatusIndicator;
-using ::com::sun::star::task::XInteractionHandler;
-using ::com::sun::star::graphic::XGraphic;
using ::comphelper::MediaDescriptor;
using ::comphelper::SequenceAsHashMap;
using ::oox::ole::OleObjectHelper;
-
-using namespace ::com::sun::star;
-
-namespace oox {
-namespace core {
+using ::oox::ole::VbaProject;
+using ::rtl::OUString;
// ============================================================================
@@ -142,6 +132,7 @@ struct FilterBaseImpl
typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef;
typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef;
typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef;
+ typedef ::boost::shared_ptr< VbaProject > VbaProjectRef;
FilterDirection meDirection;
SequenceAsHashMap maArguments;
@@ -152,8 +143,11 @@ struct FilterBaseImpl
GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling.
ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects.
OleObjHelperRef mxOleObjHelper; /// OLE object handling.
+ VbaProjectRef mxVbaProject; /// VBA project manager.
- Reference< XMultiServiceFactory > mxGlobalFactory;
+ Reference< XComponentContext > mxComponentContext;
+ Reference< XMultiComponentFactory > mxComponentFactory;
+ Reference< XMultiServiceFactory > mxServiceFactory;
Reference< XModel > mxModel;
Reference< XMultiServiceFactory > mxModelFactory;
Reference< XFrame > mxTargetFrame;
@@ -162,10 +156,9 @@ struct FilterBaseImpl
Reference< XStatusIndicator > mxStatusIndicator;
Reference< XInteractionHandler > mxInteractionHandler;
- explicit FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory );
+ explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
- void setDocumentModel( const Reference< XComponent >& rxComponent );
- bool hasDocumentModel() const;
+ void setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException );
void initializeFilter();
void finalizeFilter();
@@ -173,22 +166,25 @@ struct FilterBaseImpl
// ----------------------------------------------------------------------------
-FilterBaseImpl::FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
+FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
meDirection( FILTERDIRECTION_UNKNOWN ),
- mxGlobalFactory( rxGlobalFactory )
-{
- OSL_ENSURE( mxGlobalFactory.is(), "FilterBaseImpl::FilterBaseImpl - missing service factory" );
-}
-
-void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent )
+ mxComponentContext( rxContext, UNO_SET_THROW ),
+ mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ),
+ mxServiceFactory( rxContext->getServiceManager(), UNO_QUERY_THROW )
{
- mxModel.set( rxComponent, UNO_QUERY );
- mxModelFactory.set( rxComponent, UNO_QUERY );
}
-bool FilterBaseImpl::hasDocumentModel() const
+void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException )
{
- return mxGlobalFactory.is() && mxModel.is() && mxModelFactory.is();
+ try
+ {
+ mxModel.set( rxComponent, UNO_QUERY_THROW );
+ mxModelFactory.set( rxComponent, UNO_QUERY_THROW );
+ }
+ catch( Exception& )
+ {
+ throw IllegalArgumentException();
+ }
}
void FilterBaseImpl::initializeFilter()
@@ -219,8 +215,8 @@ void FilterBaseImpl::finalizeFilter()
// ============================================================================
-FilterBase::FilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- mxImpl( new FilterBaseImpl( rxGlobalFactory ) )
+FilterBase::FilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxImpl( new FilterBaseImpl( rxContext ) )
{
}
@@ -246,9 +242,19 @@ Any FilterBase::getArgument( const OUString& rArgName ) const
return (aIt == mxImpl->maArguments.end()) ? Any() : aIt->second;
}
-const Reference< XMultiServiceFactory >& FilterBase::getGlobalFactory() const
+const Reference< XComponentContext >& FilterBase::getComponentContext() const
+{
+ return mxImpl->mxComponentContext;
+}
+
+const Reference< XMultiComponentFactory >& FilterBase::getComponentFactory() const
{
- return mxImpl->mxGlobalFactory;
+ return mxImpl->mxComponentFactory;
+}
+
+const Reference< XMultiServiceFactory >& FilterBase::getServiceFactory() const
+{
+ return mxImpl->mxServiceFactory;
}
const Reference< XModel >& FilterBase::getModel() const
@@ -401,7 +407,14 @@ OleObjectHelper& FilterBase::getOleObjectHelper() const
return *mxImpl->mxOleObjHelper;
}
-uno::Sequence< beans::NamedValue > FilterBase::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+VbaProject& FilterBase::getVbaProject() const
+{
+ if( !mxImpl->mxVbaProject )
+ mxImpl->mxVbaProject.reset( implCreateVbaProject() );
+ return *mxImpl->mxVbaProject;
+}
+
+Sequence< NamedValue > FilterBase::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
@@ -466,8 +479,6 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce
void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{
mxImpl->setDocumentModel( rxDocument );
- if( !mxImpl->hasDocumentModel() )
- throw IllegalArgumentException();
mxImpl->meDirection = FILTERDIRECTION_IMPORT;
}
@@ -476,8 +487,6 @@ void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDo
void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{
mxImpl->setDocumentModel( rxDocument );
- if( !mxImpl->hasDocumentModel() )
- throw IllegalArgumentException();
mxImpl->meDirection = FILTERDIRECTION_EXPORT;
}
@@ -485,35 +494,35 @@ void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDo
sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) throw( RuntimeException )
{
+ if( !mxImpl->mxModel.is() || !mxImpl->mxModelFactory.is() || (mxImpl->meDirection == FILTERDIRECTION_UNKNOWN) )
+ throw RuntimeException();
+
sal_Bool bRet = sal_False;
- if( mxImpl->hasDocumentModel() && (mxImpl->meDirection != FILTERDIRECTION_UNKNOWN) )
+ setMediaDescriptor( rMediaDescSeq );
+ DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
+ if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() )
{
- setMediaDescriptor( rMediaDescSeq );
- DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
- if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() )
+ mxImpl->initializeFilter();
+ switch( mxImpl->meDirection )
{
- mxImpl->initializeFilter();
- switch( mxImpl->meDirection )
- {
- case FILTERDIRECTION_UNKNOWN:
- break;
- case FILTERDIRECTION_IMPORT:
- if( mxImpl->mxInStream.is() )
- {
- mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream );
- bRet = mxImpl->mxStorage.get() && importDocument();
- }
- break;
- case FILTERDIRECTION_EXPORT:
- if( mxImpl->mxOutStream.is() )
- {
- mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream );
- bRet = mxImpl->mxStorage.get() && exportDocument();
- }
- break;
- }
- mxImpl->finalizeFilter();
+ case FILTERDIRECTION_UNKNOWN:
+ break;
+ case FILTERDIRECTION_IMPORT:
+ if( mxImpl->mxInStream.is() )
+ {
+ mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream );
+ bRet = mxImpl->mxStorage.get() && importDocument();
+ }
+ break;
+ case FILTERDIRECTION_EXPORT:
+ if( mxImpl->mxOutStream.is() )
+ {
+ mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream );
+ bRet = mxImpl->mxStorage.get() && exportDocument();
+ }
+ break;
}
+ mxImpl->finalizeFilter();
}
return bRet;
}
@@ -565,7 +574,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc
GraphicHelper* FilterBase::implCreateGraphicHelper() const
{
// default: return base implementation without any special behaviour
- return new GraphicHelper( mxImpl->mxGlobalFactory, mxImpl->mxTargetFrame, mxImpl->mxStorage );
+ return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage );
}
// ============================================================================
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 53d8809330d9..cdab111e9898 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -26,52 +26,36 @@
************************************************************************/
#include "oox/core/filterdetect.hxx"
+
#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/xml/sax/XFastParser.hpp>
-#include <rtl/digest.h>
-#include <openssl/evp.h>
#include <comphelper/docpasswordhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <openssl/evp.h>
+#include <rtl/digest.h>
+#include "oox/core/fastparser.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/zipstorage.hxx"
-#include "oox/core/fasttokenhandler.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::beans::NamedValue;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::xml::sax::InputSource;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XFastParser;
-using ::com::sun::star::xml::sax::XLocator;
-using ::comphelper::MediaDescriptor;
-using ::comphelper::SequenceAsHashMap;
-
-using namespace ::com::sun::star;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::comphelper::MediaDescriptor;
+using ::comphelper::SequenceAsHashMap;
+using ::rtl::OUString;
+
+// ============================================================================
+
FilterDetectDocHandler::FilterDetectDocHandler( OUString& rFilterName ) :
mrFilterName( rFilterName )
{
@@ -105,22 +89,22 @@ void SAL_CALL FilterDetectDocHandler::startFastElement(
switch ( nElement )
{
// cases for _rels/.rels
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships:
+ case PR_TOKEN( Relationships ):
break;
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships)) )
+ case PR_TOKEN( Relationship ):
+ if( !maContextStack.empty() && (maContextStack.back() == PR_TOKEN( Relationships )) )
parseRelationship( aAttribs );
break;
// cases for [Content_Types].xml
- case NMSP_CONTENT_TYPES|XML_Types:
+ case PC_TOKEN( Types ):
break;
- case NMSP_CONTENT_TYPES|XML_Default:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) )
+ case PC_TOKEN( Default ):
+ if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) )
parseContentTypesDefault( aAttribs );
break;
- case NMSP_CONTENT_TYPES|XML_Override:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) )
+ case PC_TOKEN( Override ):
+ if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) )
parseContentTypesOverride( aAttribs );
break;
}
@@ -249,17 +233,16 @@ OUString FilterDetect_getImplementationName()
}
/* Helper for registry */
-Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception )
+Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return Reference< XInterface >( *new FilterDetect( xServiceManager ) );
+ return static_cast< ::cppu::OWeakObject* >( new FilterDetect( rxContext ) );
}
// ----------------------------------------------------------------------------
-FilterDetect::FilterDetect( const Reference< XMultiServiceFactory >& rxFactory ) :
- mxFactory( rxFactory )
+FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxContext( rxContext, UNO_SET_THROW )
{
- OSL_ENSURE( mxFactory.is(), "FilterDetect::FilterDetect - no service factory" );
}
FilterDetect::~FilterDetect()
@@ -410,7 +393,7 @@ bool lclCheckEncryptionData( const sal_uInt8* pnKey, sal_uInt32 nKeySize, const
// ----------------------------------------------------------------------------
-uno::Sequence< beans::NamedValue > lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
+Sequence< NamedValue > lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
{
size_t nBufferSize = rEncrInfo.mnSaltSize + 2 * rPassword.getLength();
sal_uInt8* pnBuffer = new sal_uInt8[ nBufferSize ];
@@ -449,15 +432,14 @@ uno::Sequence< beans::NamedValue > lclGenerateEncryptionKey( const PackageEncryp
lclDeriveKey( pnHash, RTL_DIGEST_LENGTH_SHA1, pnKey, nRequiredKeyLen );
delete[] pnHash;
- uno::Sequence< beans::NamedValue > aResult;
- if ( lclCheckEncryptionData( pnKey, nRequiredKeyLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ), rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) ) )
+ Sequence< NamedValue > aResult;
+ if( lclCheckEncryptionData( pnKey, nRequiredKeyLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ), rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) ) )
{
- ::comphelper::SequenceAsHashMap aEncryptionData;
- aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( pnKey ), nRequiredKeyLen );
- aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionSalt" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnSalt ), rEncrInfo.mnSaltSize );
- aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifier" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifier ), sizeof( rEncrInfo.mpnEncrVerifier ) );
- aEncryptionData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifierHash" ) ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifierHash ), sizeof( rEncrInfo.mpnEncrVerifierHash ) );
-
+ SequenceAsHashMap aEncryptionData;
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionKey" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( pnKey ), nRequiredKeyLen );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionSalt" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnSalt ), rEncrInfo.mnSaltSize );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionVerifier" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifier ), sizeof( rEncrInfo.mpnEncrVerifier ) );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionVerifierHash" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifierHash ), sizeof( rEncrInfo.mpnEncrVerifierHash ) );
aResult = aEncryptionData.getAsConstNamedValueList();
}
@@ -471,8 +453,10 @@ class PasswordVerifier : public ::comphelper::IDocPasswordVerifier
public:
explicit PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo );
- virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
- virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult
+ verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult
+ verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData );
inline const sal_uInt8* getKey() const { return &maKey.front(); }
@@ -487,29 +471,26 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo )
{
}
-::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData )
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData )
{
// verifies the password and writes the related decryption key into maKey
o_rEncryptionData = lclGenerateEncryptionKey( mrEncryptInfo, rPassword, &maKey.front(), maKey.size() );
- return ( o_rEncryptionData.getLength() > 0 ) ?
- ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+ return o_rEncryptionData.hasElements() ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
-::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData )
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
{
- ::comphelper::SequenceAsHashMap aHashData( rEncryptionData );
- uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
- uno::Sequence< sal_Int8 > aVerifier = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifier" ) ), uno::Sequence< sal_Int8 >() );
- uno::Sequence< sal_Int8 > aVerifierHash = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AES128EncryptionVerifierHash" ) ), uno::Sequence< sal_Int8 >() );
+ SequenceAsHashMap aHashData( rEncryptionData );
+ Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionKey" ), Sequence< sal_Int8 >() );
+ Sequence< sal_Int8 > aVerifier = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionVerifier" ), Sequence< sal_Int8 >() );
+ Sequence< sal_Int8 > aVerifierHash = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionVerifierHash" ), Sequence< sal_Int8 >() );
- return lclCheckEncryptionData(
- reinterpret_cast< const sal_uInt8* >( aKey.getConstArray() ),
- aKey.getLength(),
- reinterpret_cast< const sal_uInt8* >( aVerifier.getConstArray() ),
- aVerifier.getLength(),
- reinterpret_cast< const sal_uInt8* >( aVerifierHash.getConstArray() ),
- aVerifierHash.getLength() )
- ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+ bool bResult = lclCheckEncryptionData(
+ reinterpret_cast< const sal_uInt8* >( aKey.getConstArray() ), aKey.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifier.getConstArray() ), aVerifier.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifierHash.getConstArray() ), aVerifierHash.getLength() );
+
+ return bResult ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
} // namespace
@@ -518,11 +499,12 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo )
Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescriptor& rMediaDesc ) const
{
- if( mxFactory.is() )
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY );
+ if( xFactory.is() )
{
// try the plain input stream
Reference< XInputStream > xInStrm( rMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY );
- if( !xInStrm.is() || lclIsZipPackage( mxFactory, xInStrm ) )
+ if( !xInStrm.is() || lclIsZipPackage( xFactory, xInStrm ) )
return xInStrm;
// check if a temporary file is passed in the 'ComponentData' property
@@ -530,12 +512,12 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
if( xDecrypted.is() )
{
Reference< XInputStream > xDecrInStrm = xDecrypted->getInputStream();
- if( lclIsZipPackage( mxFactory, xDecrInStrm ) )
+ if( lclIsZipPackage( xFactory, xDecrInStrm ) )
return xDecrInStrm;
}
// try to decrypt an encrypted OLE package
- ::oox::ole::OleStorage aOleStorage( mxFactory, xInStrm, false );
+ ::oox::ole::OleStorage aOleStorage( xFactory, xInStrm, false );
if( aOleStorage.isStorage() ) try
{
// open the required input streams in the encrypted package
@@ -571,7 +553,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
(according to the verifier), or with an empty string if
user has cancelled the password input dialog. */
PasswordVerifier aVerifier( aEncryptInfo );
- uno::Sequence< beans::NamedValue > aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ Sequence< NamedValue > aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
aVerifier, rMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
if( aEncryptionData.getLength() == 0 )
@@ -581,7 +563,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
else
{
// create temporary file for unencrypted package
- Reference< XStream > xTempFile( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
Reference< XOutputStream > xDecryptedPackage( xTempFile->getOutputStream(), UNO_SET_THROW );
BinaryXOutputStream aDecryptedPackage( xDecryptedPackage, true );
BinaryXInputStream aEncryptedPackage( xEncryptedPackage, true );
@@ -612,7 +594,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
rMediaDesc.setComponentDataEntry( CREATE_OUSTRING( "DecryptedPackage" ), Any( xTempFile ) );
Reference< XInputStream > xDecrInStrm = xTempFile->getInputStream();
- if( lclIsZipPackage( mxFactory, xDecrInStrm ) )
+ if( lclIsZipPackage( xFactory, xDecrInStrm ) )
return xDecrInStrm;
}
}
@@ -651,12 +633,13 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
{
OUString aFilterName;
MediaDescriptor aMediaDesc( rMediaDescSeq );
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
/* Check that the user has not choosen to abort detection, e.g. by hitting
'Cancel' in the password input dialog. This may happen because this
filter detection is used by different filters. */
bool bAborted = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_ABORTED(), false );
- if( !bAborted && mxFactory.is() ) try
+ if( !bAborted ) try
{
aMediaDesc.addInputStream();
@@ -666,30 +649,21 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
descriptor. */
Reference< XInputStream > xInStrm( extractUnencryptedPackage( aMediaDesc ), UNO_SET_THROW );
- // try to detect the file type, must be a ZIP package
- ZipStorage aZipStorage( mxFactory, xInStrm );
+ // stream must be a ZIP package
+ ZipStorage aZipStorage( xFactory, xInStrm );
if( aZipStorage.isStorage() )
{
- Reference< XFastParser > xParser( mxFactory->createInstance(
- CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
-
- xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilterName ) );
- xParser->setTokenHandler( new FastTokenHandler );
-
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES );
-
- // Parse _rels/.rels to get the target path.
- InputSource aParserInput;
- aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" );
- aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId );
- xParser->parseStream( aParserInput );
-
- // Parse [Content_Types].xml to determine the content type of the part at the target path.
- aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" );
- aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId );
- xParser->parseStream( aParserInput );
+ // create the fast parser, register the XML namespaces, set document handler
+ FastParser aParser( mxContext );
+ aParser.registerNamespace( NMSP_packageRel );
+ aParser.registerNamespace( NMSP_officeRel );
+ aParser.registerNamespace( NMSP_packageContentTypes );
+ aParser.setDocumentHandler( new FilterDetectDocHandler( aFilterName ) );
+
+ /* Parse '_rels/.rels' to get the target path and '[Content_Types].xml'
+ to determine the content type of the part at the target path. */
+ aParser.parseStream( aZipStorage, CREATE_OUSTRING( "_rels/.rels" ) );
+ aParser.parseStream( aZipStorage, CREATE_OUSTRING( "[Content_Types].xml" ) );
}
}
catch( Exception& )
@@ -705,4 +679,3 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/fragmenthandler.cxx b/oox/source/core/fragmenthandler.cxx
index 66c7bf5e136b..a1c42e56c155 100644
--- a/oox/source/core/fragmenthandler.cxx
+++ b/oox/source/core/fragmenthandler.cxx
@@ -26,22 +26,22 @@
************************************************************************/
#include "oox/core/fragmenthandler.hxx"
-#include "oox/core/xmlfilterbase.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XLocator;
+#include "oox/core/xmlfilterbase.hxx"
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
mrFilter( rFilter ),
maFragmentPath( rFragmentPath ),
@@ -139,4 +139,3 @@ const RecordInfo* FragmentHandler::getRecordInfos() const
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 531f43d76d28..7771b89747b9 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -27,18 +27,18 @@
#include "oox/core/fragmenthandler2.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) :
FragmentHandler( rFilter, rFragmentPath ),
ContextHandler2Helper( bEnableTrimSpace )
@@ -49,11 +49,6 @@ FragmentHandler2::~FragmentHandler2()
{
}
-ContextHandler& FragmentHandler2::queryContextHandler()
-{
- return *this;
-}
-
// com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
void SAL_CALL FragmentHandler2::startDocument() throw( SAXException, RuntimeException )
@@ -77,7 +72,7 @@ Reference< XFastContextHandler > SAL_CALL FragmentHandler2::createFastChildConte
void SAL_CALL FragmentHandler2::startFastElement(
sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException )
{
- implStartCurrentContext( nElement, rxAttribs );
+ implStartElement( nElement, rxAttribs );
}
void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException )
@@ -87,17 +82,17 @@ void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXE
void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException )
{
- implEndCurrentContext( nElement );
+ implEndElement( nElement );
}
// oox.core.ContextHandler interface ------------------------------------------
-ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return implCreateRecordContext( nRecId, rStrm );
}
-void FragmentHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void FragmentHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
implStartRecord( nRecId, rStrm );
}
@@ -118,16 +113,20 @@ void FragmentHandler2::onStartElement( const AttributeList& )
{
}
-void FragmentHandler2::onEndElement( const OUString& )
+void FragmentHandler2::onCharacters( const OUString& )
{
}
-ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& )
+void FragmentHandler2::onEndElement()
+{
+}
+
+ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void FragmentHandler2::onStartRecord( RecordInputStream& )
+void FragmentHandler2::onStartRecord( SequenceInputStream& )
{
}
@@ -149,4 +148,3 @@ void FragmentHandler2::finalizeImport()
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/makefile.mk b/oox/source/core/makefile.mk
index 2e29cf01543a..2b58b95777df 100644
--- a/oox/source/core/makefile.mk
+++ b/oox/source/core/makefile.mk
@@ -49,7 +49,7 @@ SLOFILES = \
$(SLO)$/binaryfilterbase.obj \
$(SLO)$/contexthandler.obj \
$(SLO)$/contexthandler2.obj \
- $(SLO)$/facreg.obj \
+ $(SLO)$/fastparser.obj \
$(SLO)$/fasttokenhandler.obj \
$(SLO)$/filterbase.obj \
$(SLO)$/filterdetect.obj \
@@ -58,6 +58,7 @@ SLOFILES = \
$(SLO)$/recordparser.obj \
$(SLO)$/relations.obj \
$(SLO)$/relationshandler.obj \
+ $(SLO)$/services.obj \
$(SLO)$/xmlfilterbase.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx
index 8f0de9c2894a..aef73ceed86c 100644
--- a/oox/source/core/recordparser.cxx
+++ b/oox/source/core/recordparser.cxx
@@ -26,27 +26,27 @@
************************************************************************/
#include "oox/core/recordparser.hxx"
+
#include <vector>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/xml/sax/XLocator.hpp>
#include <cppuhelper/implbase1.hxx>
-#include "oox/helper/recordinputstream.hxx"
#include "oox/core/fragmenthandler.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::lang::DisposedException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::IOException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XLocator;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace prv {
class Locator : public ::cppu::WeakImplHelper1< XLocator >
@@ -273,7 +273,7 @@ void RecordParser::parseStream( const RecordInputSource& rInputSource ) throw( S
while( lclReadNextRecord( nRecId, aRecData, *maSource.mxInStream ) )
{
// create record stream object from imported record data
- RecordInputStream aRecStrm( aRecData );
+ SequenceInputStream aRecStrm( aRecData );
// try to leave a context, there may be other incomplete contexts on the stack
if( const RecordInfo* pEndRecInfo = getEndRecordInfo( nRecId ) )
{
@@ -348,4 +348,3 @@ const RecordInfo* RecordParser::getEndRecordInfo( sal_Int32 nRecId ) const
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index c8d17cce3b9b..f6cade391a0f 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -26,17 +26,20 @@
************************************************************************/
#include "oox/core/relations.hxx"
+
#include <rtl/ustrbuf.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
namespace oox {
namespace core {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
OUString lclRemoveFileName( const OUString& rPath )
@@ -68,7 +71,7 @@ const Relation* Relations::getRelationFromRelId( const OUString& rId ) const
const Relation* Relations::getRelationFromFirstType( const OUString& rType ) const
{
for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
- if( aIt->second.maType == rType )
+ if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) )
return &aIt->second;
return 0;
}
@@ -77,7 +80,7 @@ RelationsRef Relations::getRelationsFromType( const OUString& rType ) const
{
RelationsRef xRelations( new Relations( maFragmentPath ) );
for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
- if( aIt->second.maType == rType )
+ if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) )
(*xRelations)[ aIt->first ] = aIt->second;
return xRelations;
}
@@ -143,4 +146,3 @@ OUString Relations::getFragmentPathFromFirstType( const OUString& rType ) const
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx
index e0d7acda81e0..6812a4acada6 100644
--- a/oox/source/core/relationshandler.cxx
+++ b/oox/source/core/relationshandler.cxx
@@ -26,18 +26,20 @@
************************************************************************/
#include "oox/core/relationshandler.hxx"
+
#include <rtl/ustrbuf.hxx>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+namespace oox {
+namespace core {
+
+// ============================================================================
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-namespace oox {
-namespace core {
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
@@ -76,7 +78,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
AttributeList aAttribs( rxAttribs );
switch( nElement )
{
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship:
+ case PR_TOKEN( Relationship ):
{
Relation aRelation;
aRelation.maId = aAttribs.getString( XML_Id, OUString() );
@@ -95,7 +97,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
}
}
break;
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships:
+ case PR_TOKEN( Relationships ):
xRet = getFastContextHandler();
break;
}
@@ -106,4 +108,3 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
} // namespace core
} // namespace oox
-
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
new file mode 100644
index 000000000000..f05524f4d046
--- /dev/null
+++ b/oox/source/core/services.cxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * 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 <cppuhelper/implementationentry.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+
+// Declare static functions providing service information =====================
+
+#define DECLARE_FUNCTIONS( className ) \
+extern OUString SAL_CALL className##_getImplementationName() throw(); \
+extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \
+extern Reference< XInterface > SAL_CALL className##_createInstance( \
+ const Reference< XComponentContext >& rxContext ) throw (Exception)
+
+namespace oox {
+ namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); }
+ namespace core { DECLARE_FUNCTIONS( FilterDetect ); }
+ namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); }
+ namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); }
+ namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); }
+ namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); }
+ namespace xls { DECLARE_FUNCTIONS( BiffDetector ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); }
+}
+
+#undef DECLARE_FUNCTIONS
+
+// ============================================================================
+
+namespace {
+
+#define IMPLEMENTATION_ENTRY( className ) \
+ { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }
+
+static ::cppu::ImplementationEntry const spServices[] =
+{
+ IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
+ IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
+ IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
+ IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
+ IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ),
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+#undef IMPLEMENTATION_ENTRY
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
+{
+ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
+{
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
+}
+
+// ============================================================================
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 87faadd7a9ce..fe13d9322346 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -28,9 +28,6 @@
#include "oox/core/xmlfilterbase.hxx"
#include <cstdio>
-
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
@@ -38,50 +35,38 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <comphelper/mediadescriptor.hxx>
#include <sax/fshelper.hxx>
-#include "properties.hxx"
-#include "tokens.hxx"
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/propertyset.hxx"
-#include "oox/helper/zipstorage.hxx"
-#include "oox/core/fasttokenhandler.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/fastparser.hxx"
#include "oox/core/filterdetect.hxx"
#include "oox/core/fragmenthandler.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/recordparser.hxx"
#include "oox/core/relationshandler.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/helper/zipstorage.hxx"
+
+namespace oox {
+namespace core {
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::xml::sax;
+
+using ::comphelper::MediaDescriptor;
using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::StringPair;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::embed::XRelationshipAccess;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::xml::sax::XFastParser;
-using ::com::sun::star::xml::sax::XFastTokenHandler;
-using ::com::sun::star::xml::sax::XFastDocumentHandler;
-using ::com::sun::star::xml::sax::InputSource;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::document::XDocumentProperties;
-using ::com::sun::star::util::DateTime;
-using ::comphelper::MediaDescriptor;
-using ::sax_fastparser::FastSerializerHelper;
using ::sax_fastparser::FSHelperPtr;
-
-namespace oox {
-namespace core {
+using ::sax_fastparser::FastSerializerHelper;
// ============================================================================
@@ -101,62 +86,54 @@ struct XmlFilterBaseImpl
{
typedef RefMap< OUString, Relations > RelationsMap;
- Reference< XFastParser > mxFastParser;
- OUString maBinSuffix;
- OUString maVmlSuffix;
+ FastParser maFastParser;
+ const OUString maBinSuffix;
+ const OUString maVmlSuffix;
RelationsMap maRelationsMap;
TextFieldStack maTextFieldStack;
- explicit XmlFilterBaseImpl();
+
+ explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
};
// ----------------------------------------------------------------------------
-XmlFilterBaseImpl::XmlFilterBaseImpl() :
+XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ maFastParser( rxContext ),
maBinSuffix( CREATE_OUSTRING( ".bin" ) ),
maVmlSuffix( CREATE_OUSTRING( ".vml" ) )
{
+ // register XML namespaces
+ maFastParser.registerNamespace( NMSP_xml );
+ maFastParser.registerNamespace( NMSP_packageRel );
+ maFastParser.registerNamespace( NMSP_officeRel );
+
+ maFastParser.registerNamespace( NMSP_dml );
+ maFastParser.registerNamespace( NMSP_dmlDiagram );
+ maFastParser.registerNamespace( NMSP_dmlChart );
+ maFastParser.registerNamespace( NMSP_dmlChartDr );
+ maFastParser.registerNamespace( NMSP_dmlSpreadDr );
+
+ maFastParser.registerNamespace( NMSP_vml );
+ maFastParser.registerNamespace( NMSP_vmlOffice );
+ maFastParser.registerNamespace( NMSP_vmlWord );
+ maFastParser.registerNamespace( NMSP_vmlExcel );
+ maFastParser.registerNamespace( NMSP_vmlPowerpoint );
+
+ maFastParser.registerNamespace( NMSP_xls );
+ maFastParser.registerNamespace( NMSP_ppt );
+
+ maFastParser.registerNamespace( NMSP_ax );
+ maFastParser.registerNamespace( NMSP_xm );
}
// ============================================================================
-XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- FilterBase( rxGlobalFactory ),
- mxImpl( new XmlFilterBaseImpl ),
+XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ FilterBase( rxContext ),
+ mxImpl( new XmlFilterBaseImpl( rxContext ) ),
mnRelId( 1 ),
mnMaxDocId( 0 )
{
- try
- {
- // create the fast parser
- mxImpl->mxFastParser.set( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
- mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler );
-
- // register XML namespaces
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://www.w3.org/XML/1998/namespace" ), NMSP_XML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:word" ), NMSP_VML_DOC );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:excel" ), NMSP_VML_XLS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:powerpoint" ), NMSP_VML_PPT );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/activeX" ), NMSP_AX );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/spreadsheetml/2006/main"), NMSP_XLS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" ), NMSP_XDR );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/2006/main" ), NMSP_XM );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/presentationml/2006/main"), NMSP_PPT );
- }
- catch( Exception& )
- {
- }
}
XmlFilterBase::~XmlFilterBase()
@@ -213,25 +190,20 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r
if( !xDocHandler.is() )
return false;
- // check that the fast parser exists
- if( !mxImpl->mxFastParser.is() )
- return false;
-
// try to import XML stream
try
{
- // try to open the fragment stream (this may fail - do not assert)
- Reference< XInputStream > xInStrm( rxHandler->openFragmentStream(), UNO_SET_THROW );
+ /* Try to open the fragment stream (may fail, do not throw/assert).
+ Using the virtual function openFragmentStream() allows a document
+ handler to create specialized input streams, e.g. VML streams that
+ have to preprocess the raw input data. */
+ Reference< XInputStream > xInStrm = rxHandler->openFragmentStream();
- // create the input source and parse the stream
- InputSource aSource;
- aSource.aInputStream = xInStrm;
- aSource.sSystemId = aFragmentPath;
// own try/catch block for showing parser failure assertion with fragment path
- try
+ if( xInStrm.is() ) try
{
- mxImpl->mxFastParser->setFastDocumentHandler( xDocHandler );
- mxImpl->mxFastParser->parseStream( aSource );
+ mxImpl->maFastParser.setDocumentHandler( xDocHandler );
+ mxImpl->maFastParser.parseStream( xInStrm, aFragmentPath );
return true;
}
catch( Exception& )
@@ -516,7 +488,7 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM
/* Get the input stream directly from the media descriptor, or decrypt the
package again. The latter is needed e.g. when the document is reloaded.
All this is implemented in the detector service. */
- FilterDetect aDetector( getGlobalFactory() );
+ FilterDetect aDetector( getComponentContext() );
return aDetector.extractUnencryptedPackage( rMediaDesc );
}
@@ -524,16 +496,15 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM
StorageRef XmlFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const
{
- return StorageRef( new ZipStorage( getGlobalFactory(), rxInStream ) );
+ return StorageRef( new ZipStorage( getServiceFactory(), rxInStream ) );
}
StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const
{
- return StorageRef( new ZipStorage( getGlobalFactory(), rxOutStream ) );
+ return StorageRef( new ZipStorage( getServiceFactory(), rxOutStream ) );
}
// ============================================================================
} // namespace core
} // namespace oox
-
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 1830a8c5d5f9..560fcf141c19 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -33,9 +33,7 @@
#include <osl/time.h>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::com::sun::star;
@@ -226,19 +224,19 @@ void OOXMLDocPropHandler::UpdateDocStatistic( const ::rtl::OUString& aChars )
switch( m_nBlock )
{
- case XML_Characters|NMSP_EXTPR:
+ case EXTPR_TOKEN( Characters ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterCount" ) );
break;
- case XML_Pages|NMSP_EXTPR:
+ case EXTPR_TOKEN( Pages ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageCount" ) );
break;
- case XML_Words|NMSP_EXTPR:
+ case EXTPR_TOKEN( Words ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WordCount" ) );
break;
- case XML_Paragraphs|NMSP_EXTPR:
+ case EXTPR_TOKEN( Paragraphs ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphCount" ) );
break;
@@ -299,9 +297,9 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const
{
if ( !m_nInBlock && !m_nState )
{
- if ( nElement == ( XML_coreProperties|NMSP_COREPR )
- || nElement == ( XML_Properties|NMSP_EXTPR )
- || nElement == ( XML_Properties|NMSP_CUSTPR ) )
+ if ( nElement == COREPR_TOKEN( coreProperties )
+ || nElement == EXTPR_TOKEN( Properties )
+ || nElement == CUSTPR_TOKEN( Properties ) )
{
m_nState = nElement;
}
@@ -320,7 +318,7 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const
if ( xAttribs.is() && xAttribs->hasAttribute( XML_name ) )
m_aCustomPropertyName = xAttribs->getValue( XML_name );
}
- else if ( m_nState && m_nInBlock && m_nInBlock == 2 && ( nElement >> 16 ) == ( NMSP_VT >> 16 ) )
+ else if ( m_nState && m_nInBlock && m_nInBlock == 2 && getNamespace( nElement ) == NMSP_officeDocPropsVT )
{
m_nType = nElement;
}
@@ -402,72 +400,72 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
{
if ( (m_nInBlock == 2) || ((m_nInBlock == 3) && m_nType) )
{
- if ( m_nState == ( XML_coreProperties|NMSP_COREPR ) )
+ if ( m_nState == COREPR_TOKEN( coreProperties ) )
{
switch( m_nBlock )
{
- case XML_category|NMSP_COREPR:
+ case COREPR_TOKEN( category ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "category" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_contentStatus|NMSP_COREPR:
+ case COREPR_TOKEN( contentStatus ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentStatus" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_contentType|NMSP_COREPR:
+ case COREPR_TOKEN( contentType ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentType" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_identifier|NMSP_COREPR:
+ case COREPR_TOKEN( identifier ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "identifier" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_version|NMSP_COREPR:
+ case COREPR_TOKEN( version ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "version" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_created|NMSP_DCTERMS:
+ case DCT_TOKEN( created ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setCreationDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_creator|NMSP_DC:
+ case DC_TOKEN( creator ):
m_xDocProp->setAuthor( aChars );
break;
- case XML_description|NMSP_DC:
+ case DC_TOKEN( description ):
m_xDocProp->setDescription( aChars );
break;
- case XML_keywords|NMSP_COREPR:
+ case COREPR_TOKEN( keywords ):
m_xDocProp->setKeywords( GetKeywordsSet( aChars ) );
break;
- case XML_language|NMSP_DC:
+ case DC_TOKEN( language ):
if ( aChars.getLength() >= 2 )
m_xDocProp->setLanguage( GetLanguage( aChars ) );
break;
- case XML_lastModifiedBy|NMSP_COREPR:
+ case COREPR_TOKEN( lastModifiedBy ):
m_xDocProp->setModifiedBy( aChars );
break;
- case XML_lastPrinted|NMSP_COREPR:
+ case COREPR_TOKEN( lastPrinted ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setPrintDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_modified|NMSP_DCTERMS:
+ case DCT_TOKEN( modified ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setModificationDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_revision|NMSP_COREPR:
+ case COREPR_TOKEN( revision ):
try
{
m_xDocProp->setEditingCycles(
@@ -479,11 +477,11 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
}
break;
- case XML_subject|NMSP_DC:
+ case DC_TOKEN( subject ):
m_xDocProp->setSubject( aChars );
break;
- case XML_title|NMSP_DC:
+ case DC_TOKEN( title ):
m_xDocProp->setTitle( aChars );
break;
@@ -491,19 +489,19 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
OSL_ASSERT( "Unexpected core property!" );
}
}
- else if ( m_nState == ( XML_Properties|NMSP_EXTPR ) )
+ else if ( m_nState == EXTPR_TOKEN( Properties ) )
{
switch( m_nBlock )
{
- case XML_Application|NMSP_EXTPR:
+ case EXTPR_TOKEN( Application ):
m_xDocProp->setGenerator( aChars );
break;
- case XML_Template|NMSP_EXTPR:
+ case EXTPR_TOKEN( Template ):
m_xDocProp->setTemplateName( aChars );
break;
- case XML_TotalTime|NMSP_EXTPR:
+ case EXTPR_TOKEN( TotalTime ):
try
{
m_xDocProp->setEditingDuration( aChars.toInt32() );
@@ -514,89 +512,89 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
}
break;
- case XML_Characters|NMSP_EXTPR:
- case XML_Pages|NMSP_EXTPR:
- case XML_Words|NMSP_EXTPR:
- case XML_Paragraphs|NMSP_EXTPR:
+ case EXTPR_TOKEN( Characters ):
+ case EXTPR_TOKEN( Pages ):
+ case EXTPR_TOKEN( Words ):
+ case EXTPR_TOKEN( Paragraphs ):
UpdateDocStatistic( aChars );
break;
- case XML_HyperlinksChanged|NMSP_EXTPR:
+ case EXTPR_TOKEN( HyperlinksChanged ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinksChanged" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_LinksUpToDate|NMSP_EXTPR:
+ case EXTPR_TOKEN( LinksUpToDate ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LinksUpToDate" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_ScaleCrop|NMSP_EXTPR:
+ case EXTPR_TOKEN( ScaleCrop ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScaleCrop" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_SharedDoc|NMSP_EXTPR:
+ case EXTPR_TOKEN( SharedDoc ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShareDoc" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_DocSecurity|NMSP_EXTPR:
+ case EXTPR_TOKEN( DocSecurity ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocSecurity" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_HiddenSlides|NMSP_EXTPR:
+ case EXTPR_TOKEN( HiddenSlides ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenSlides" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_MMClips|NMSP_EXTPR:
+ case EXTPR_TOKEN( MMClips ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MMClips" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_Notes|NMSP_EXTPR:
+ case EXTPR_TOKEN( Notes ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Notes" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_Slides|NMSP_EXTPR:
+ case EXTPR_TOKEN( Slides ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Slides" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_AppVersion|NMSP_EXTPR:
+ case EXTPR_TOKEN( AppVersion ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AppVersion" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_Company|NMSP_EXTPR:
+ case EXTPR_TOKEN( Company ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Company" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_HyperlinkBase|NMSP_EXTPR:
+ case EXTPR_TOKEN( HyperlinkBase ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinkBase" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_Manager|NMSP_EXTPR:
+ case EXTPR_TOKEN( Manager ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Manager" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_PresentationFormat|NMSP_EXTPR:
+ case EXTPR_TOKEN( PresentationFormat ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PresentationFormat" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_CharactersWithSpaces|NMSP_EXTPR:
- case XML_Lines|NMSP_EXTPR:
- case XML_DigSig|NMSP_EXTPR:
- case XML_HeadingPairs|NMSP_EXTPR:
- case XML_HLinks|NMSP_EXTPR:
- case XML_TitlesOfParts|NMSP_EXTPR:
+ case EXTPR_TOKEN( CharactersWithSpaces ):
+ case EXTPR_TOKEN( Lines ):
+ case EXTPR_TOKEN( DigSig ):
+ case EXTPR_TOKEN( HeadingPairs ):
+ case EXTPR_TOKEN( HLinks ):
+ case EXTPR_TOKEN( TitlesOfParts ):
// ignored during the import currently
break;
@@ -604,46 +602,46 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
OSL_ASSERT( "Unexpected extended property!" );
}
}
- else if ( m_nState == ( XML_Properties|NMSP_CUSTPR ) )
+ else if ( m_nState == CUSTPR_TOKEN( Properties ) )
{
- if ( m_nBlock == ( XML_property|NMSP_CUSTPR ) )
+ if ( m_nBlock == CUSTPR_TOKEN( property ) )
{
// this is a custom property
switch( m_nType )
{
- case XML_bool|NMSP_VT:
+ case VT_TOKEN( bool ):
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) );
break;
- case XML_bstr|NMSP_VT:
- case XML_lpstr|NMSP_VT:
- case XML_lpwstr|NMSP_VT:
+ case VT_TOKEN( bstr ):
+ case VT_TOKEN( lpstr ):
+ case VT_TOKEN( lpwstr ):
AddCustomProperty( uno::makeAny( AttributeConversion::decodeXString( aChars ) ) ); // the property has string type
break;
- case XML_date|NMSP_VT:
- case XML_filetime|NMSP_VT:
+ case VT_TOKEN( date ):
+ case VT_TOKEN( filetime ):
AddCustomProperty( uno::makeAny( GetDateTimeFromW3CDTF( aChars ) ) );
- case XML_i1|NMSP_VT:
- case XML_i2|NMSP_VT:
+ case VT_TOKEN( i1 ):
+ case VT_TOKEN( i2 ):
AddCustomProperty( uno::makeAny( (sal_Int16)aChars.toInt32() ) );
break;
- case XML_i4|NMSP_VT:
- case XML_int|NMSP_VT:
+ case VT_TOKEN( i4 ):
+ case VT_TOKEN( int ):
AddCustomProperty( uno::makeAny( aChars.toInt32() ) );
break;
- case XML_i8|NMSP_VT:
+ case VT_TOKEN( i8 ):
AddCustomProperty( uno::makeAny( aChars.toInt64() ) );
break;
- case XML_r4|NMSP_VT:
+ case VT_TOKEN( r4 ):
AddCustomProperty( uno::makeAny( aChars.toFloat() ) );
break;
- case XML_r8|NMSP_VT:
+ case VT_TOKEN( r8 ):
AddCustomProperty( uno::makeAny( aChars.toDouble() ) );
break;
diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx
index bb2cff323159..13e6e47b025e 100644
--- a/oox/source/docprop/docprophandler.hxx
+++ b/oox/source/docprop/docprophandler.hxx
@@ -34,9 +34,19 @@
#include <cppuhelper/implbase1.hxx>
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
+
namespace oox {
namespace docprop {
+#define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token)
+#define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token)
+#define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token)
+#define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token)
+#define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token)
+#define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token)
+
class OOXMLDocPropHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler >
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index de34f592e98a..7f3a08859302 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -25,203 +25,165 @@
*
************************************************************************/
-#include <com/sun/star/embed/XStorage.hpp>
+#include "ooxmldocpropimport.hxx"
+
+#include <vector>
+#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/xml/sax/XFastParser.hpp>
-#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
-#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-
-#include <oox/core/namespaces.hxx>
+#include <com/sun/star/embed/XStorage.hpp>
+#include "oox/core/fastparser.hxx"
+#include "oox/core/relations.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
#include "docprophandler.hxx"
-#include "ooxmldocpropimport.hxx"
-
-using namespace ::com::sun::star;
namespace oox {
namespace docprop {
-// -----------------------------------------------------------
-::rtl::OUString SAL_CALL OOXMLDocPropImportImpl_getImplementationName()
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+OUString SAL_CALL DocumentPropertiesImport_getImplementationName()
{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter"));
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
}
-// -----------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl_getSupportedServiceNames()
+Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames()
{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.OOXMLDocumentPropertiesImporter"));
- return s;
+ Sequence< OUString > aServices( 1 );
+ aServices[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.OOXMLDocumentPropertiesImporter" );
+ return aServices;
}
-// -----------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL OOXMLDocPropImportImpl_createInstance(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
+Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) SAL_THROW((Exception))
{
- return static_cast< ::cppu::OWeakObject * >(new OOXMLDocPropImportImpl(context));
+ return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) );
}
+// ============================================================================
-// -----------------------------------------------------------
-OOXMLDocPropImportImpl::OOXMLDocPropImportImpl(uno::Reference< uno::XComponentContext > const & xContext) :
- m_xContext( xContext )
-{}
+namespace {
-// -----------------------------------------------------------
-uno::Sequence< xml::sax::InputSource > OOXMLDocPropImportImpl::GetRelatedStreams( const uno::Reference< embed::XStorage > xStorage, const ::rtl::OUString& aStreamType )
+Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException)
{
- if ( !xStorage.is() )
- throw uno::RuntimeException();
+ Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW );
+ Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW );
- uno::Reference< embed::XRelationshipAccess > xRelation( xStorage, uno::UNO_QUERY_THROW );
- uno::Reference< embed::XHierarchicalStorageAccess > xHierarchy( xStorage, uno::UNO_QUERY_THROW );
+ Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType );
- uno::Sequence< uno::Sequence< beans::StringPair > > aPropsInfo = xRelation->getRelationshipsByType( aStreamType );
+ ::std::vector< InputSource > aResult;
- sal_Int32 nLength = 0;
- uno::Sequence< xml::sax::InputSource > aResult( aPropsInfo.getLength() );
- if ( aPropsInfo.getLength() )
+ for( sal_Int32 nIndex = 0, nLength = aPropsInfo.getLength(); nIndex < nLength; ++nIndex )
{
- for ( sal_Int32 nInd = 0; nInd < aPropsInfo.getLength(); nInd++ )
- for ( sal_Int32 nEntryInd = 0; nEntryInd < aPropsInfo[nInd].getLength(); nEntryInd++ )
- if ( aPropsInfo[nInd][nEntryInd].First.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ) ) )
+ const Sequence< StringPair >& rEntries = aPropsInfo[ nIndex ];
+ for( sal_Int32 nEntryIndex = 0, nEntryLength = rEntries.getLength(); nEntryIndex < nEntryLength; ++nEntryIndex )
+ {
+ const StringPair& rEntry = rEntries[ nEntryIndex ];
+ if( rEntry.First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) )
+ {
+ Reference< XExtendedStorageStream > xExtStream(
+ xHierarchy->openStreamElementByHierarchicalName( rEntry.Second, ElementModes::READ ), UNO_QUERY_THROW );
+ Reference< XInputStream > xInStream = xExtStream->getInputStream();
+ if( xInStream.is() )
{
- uno::Reference< embed::XExtendedStorageStream > xExtStream = xHierarchy->openStreamElementByHierarchicalName( aPropsInfo[nInd][nEntryInd].Second, embed::ElementModes::READ );
- if ( !xExtStream.is() )
- throw uno::RuntimeException();
-
- aResult[nLength].sSystemId = aPropsInfo[nInd][nEntryInd].Second;
- aResult[nLength++].aInputStream = xExtStream->getInputStream();
- break;
+ aResult.resize( aResult.size() + 1 );
+ aResult.back().sSystemId = rEntry.Second;
+ aResult.back().aInputStream = xExtStream->getInputStream();
}
-
- aResult.realloc( nLength );
+ break;
+ }
+ }
}
- return aResult;
+ return ContainerHelper::vectorToSequence( aResult );
}
-// com.sun.star.uno.XServiceInfo:
-// -----------------------------------------------------------
-::rtl::OUString SAL_CALL OOXMLDocPropImportImpl::getImplementationName() throw (uno::RuntimeException)
+} // namespace
+
+// ============================================================================
+
+DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) :
+ mxContext( rxContext )
{
- return OOXMLDocPropImportImpl_getImplementationName();
}
-// -----------------------------------------------------------
-::sal_Bool SAL_CALL OOXMLDocPropImportImpl::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException)
-{
- uno::Sequence< ::rtl::OUString > serviceNames = OOXMLDocPropImportImpl_getSupportedServiceNames();
- for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i)
- {
- if (serviceNames[i] == serviceName)
- return sal_True;
- }
+// XServiceInfo
- return sal_False;
+OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException)
+{
+ return DocumentPropertiesImport_getImplementationName();
}
-// -----------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl::getSupportedServiceNames() throw (uno::RuntimeException)
+sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- return OOXMLDocPropImportImpl_getSupportedServiceNames();
+ Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames();
+ for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
+ if( aServiceNames[ nIndex ] == rServiceName )
+ return sal_True;
+ return sal_False;
}
-// -----------------------------------------------------------
-// ::com::sun::star::document::XOOXMLDocumentPropertiesImporter:
-void SAL_CALL OOXMLDocPropImportImpl::importProperties(const uno::Reference< embed::XStorage > & xSource, const uno::Reference< document::XDocumentProperties > & xDocumentProperties) throw (uno::RuntimeException, lang::IllegalArgumentException, xml::sax::SAXException, uno::Exception)
+Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException)
{
- // TODO: Insert your implementation for "importProperties" here.
- if ( !m_xContext.is() )
- throw uno::RuntimeException();
+ return DocumentPropertiesImport_getSupportedServiceNames();
+}
- if ( !xSource.is() || !xDocumentProperties.is() )
- throw lang::IllegalArgumentException();
+// XOOXMLDocumentPropertiesImporter
- // the MS Office seems to have a bug, so we have to do similar handling
- ::rtl::OUString aCoreType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties" ) );
- ::rtl::OUString aCoreWorkaroundType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ) );
+void SAL_CALL DocumentPropertiesImport::importProperties(
+ const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties )
+ throw (RuntimeException, IllegalArgumentException, SAXException, Exception)
+{
+ if( !mxContext.is() )
+ throw RuntimeException();
- ::rtl::OUString aExtType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/extended-properties" ) );
- ::rtl::OUString aCustomType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/custom-properties" ) );
+ if( !rxSource.is() || !rxDocumentProperties.is() )
+ throw IllegalArgumentException();
- uno::Sequence< xml::sax::InputSource > aCoreStreams = GetRelatedStreams( xSource, aCoreType );
- if ( !aCoreStreams.getLength() )
- aCoreStreams = GetRelatedStreams( xSource, aCoreWorkaroundType );
+ Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) );
+ // MS Office seems to have a bug, so we have to do similar handling
+ if( !aCoreStreams.hasElements() )
+ aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) );
- uno::Sequence< xml::sax::InputSource > aExtStreams = GetRelatedStreams( xSource, aExtType );
- uno::Sequence< xml::sax::InputSource > aCustomStreams = GetRelatedStreams( xSource, aCustomType );
+ Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) );
+ Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) );
- if ( aCoreStreams.getLength() || aExtStreams.getLength() || aCustomStreams.getLength() )
+ if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() )
{
- if ( aCoreStreams.getLength() > 1 )
- throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected core properties stream!" ) ), uno::Reference< uno::XInterface >() );
-
- uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastParser > xParser(
- xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastParser" ) ),
- m_xContext ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler(
- xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.oox.FastTokenHandlerService" ) ),
- m_xContext ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastDocumentHandler > xDocHandler( static_cast< xml::sax::XFastDocumentHandler* >( new OOXMLDocPropHandler( m_xContext, xDocumentProperties ) ) );
-
- xParser->setFastDocumentHandler( xDocHandler );
- xParser->setTokenHandler( xTokenHandler );
-
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ) ), NMSP_COREPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/elements/1.1/" ) ), NMSP_DC );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/terms/" ) ), NMSP_DCTERMS );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ) ), NMSP_EXTPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ) ), NMSP_CUSTPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" ) ), NMSP_VT );
-
- // #158414# XFastParser::parseStream() throws on invalid XML
- if ( aCoreStreams.getLength() ) try
- {
- if ( aCoreStreams[0].aInputStream.is() )
- {
- xParser->parseStream( aCoreStreams[0] );
- aCoreStreams[0].aInputStream->closeInput();
- }
- }
- catch( uno::Exception& )
- {
- }
-
- sal_Int32 nInd = 0;
- for ( nInd = 0; nInd < aExtStreams.getLength(); nInd++ )
- {
- xParser->parseStream( aExtStreams[nInd] );
- if ( aExtStreams[nInd].aInputStream.is() )
- aExtStreams[nInd].aInputStream->closeInput();
- }
-
- for ( nInd = 0; nInd < aCustomStreams.getLength(); nInd++ )
- {
- xParser->parseStream( aCustomStreams[nInd] );
- if ( aCustomStreams[nInd].aInputStream.is() )
- aCustomStreams[nInd].aInputStream->closeInput();
- }
+ if( aCoreStreams.getLength() > 1 )
+ throw IOException( CREATE_OUSTRING( "Unexpected core properties stream!" ), Reference< XInterface >() );
+
+ ::oox::core::FastParser aParser( mxContext );
+ aParser.registerNamespace( NMSP_packageMetaCorePr );
+ aParser.registerNamespace( NMSP_dc );
+ aParser.registerNamespace( NMSP_dcTerms );
+ aParser.registerNamespace( NMSP_officeExtPr );
+ aParser.registerNamespace( NMSP_officeCustomPr );
+ aParser.registerNamespace( NMSP_officeDocPropsVT );
+ aParser.setDocumentHandler( new OOXMLDocPropHandler( mxContext, rxDocumentProperties ) );
+
+ if( aCoreStreams.hasElements() )
+ aParser.parseStream( aCoreStreams[ 0 ], true );
+ for( sal_Int32 nIndex = 0; nIndex < aExtStreams.getLength(); ++nIndex )
+ aParser.parseStream( aExtStreams[ nIndex ], true );
+ for( sal_Int32 nIndex = 0; nIndex < aCustomStreams.getLength(); ++nIndex )
+ aParser.parseStream( aCustomStreams[ nIndex ], true );
}
}
+// ============================================================================
+
} // namespace docprop
} // namespace oox
-
-
diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx
index a10eafbe1eb4..79f4d1f7e60b 100644
--- a/oox/source/docprop/ooxmldocpropimport.hxx
+++ b/oox/source/docprop/ooxmldocpropimport.hxx
@@ -28,44 +28,44 @@
#ifndef OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX
#define OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX
-#include <sal/config.h>
-#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
+#include <cppuhelper/implbase2.hxx>
namespace oox {
namespace docprop {
-class OOXMLDocPropImportImpl:
+// ============================================================================
+
+class DocumentPropertiesImport :
public ::cppu::WeakImplHelper2<
::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::document::XOOXMLDocumentPropertiesImporter>
+ ::com::sun::star::document::XOOXMLDocumentPropertiesImporter >
{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
-
- OOXMLDocPropImportImpl(const OOXMLDocPropImportImpl &); // not defined
- OOXMLDocPropImportImpl& operator=(const OOXMLDocPropImportImpl &); // not defined
-
public:
- explicit OOXMLDocPropImportImpl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
- virtual ~OOXMLDocPropImportImpl() {}
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::xml::sax::InputSource > GetRelatedStreams( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xStorage, const ::rtl::OUString& aStreamType );
+ explicit DocumentPropertiesImport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
- // ::com::sun::star::lang::XServiceInfo:
+ // 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 sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::document::XOOXMLDocumentPropertiesImporter:
- virtual void SAL_CALL importProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > & xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > & xDocumentProperties) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception);
+ // XOOXMLDocumentPropertiesImporter
+ virtual void SAL_CALL importProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxSource,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties >& rxDocumentProperties )
+ throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception);
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
};
+// ============================================================================
+
} // namespace docprop
} // namespace oox
#endif
-
diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx
index 1066f91c0e19..cfcdd3ff0754 100644
--- a/oox/source/drawingml/chart/axiscontext.cxx
+++ b/oox/source/drawingml/chart/axiscontext.cxx
@@ -26,21 +26,24 @@
************************************************************************/
#include "oox/drawingml/chart/axiscontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::ContextHandler2Helper;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::ContextHandler2Helper;
+using ::rtl::OUString;
+
+// ============================================================================
+
AxisDispUnitsContext::AxisDispUnitsContext( ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel ) :
ContextBase< AxisDispUnitsModel >( rParent, rModel )
{
@@ -315,4 +318,3 @@ ContextHandlerRef ValAxisContext::onCreateContext( sal_Int32 nElement, const Att
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index da4fc3e5b83f..028fc3d19eb1 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -26,36 +26,20 @@
************************************************************************/
#include "oox/drawingml/chart/axisconverter.hxx"
+
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
-#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
-#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::IncrementData;
-using ::com::sun::star::chart2::ScaleData;
-using ::com::sun::star::chart2::SubIncrement;
-using ::com::sun::star::chart2::XAxis;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XScaling;
-using ::com::sun::star::chart2::XTitled;
+#include "oox/drawingml/lineproperties.hxx"
namespace oox {
namespace drawingml {
@@ -63,6 +47,14 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
template< typename Type >
@@ -330,4 +322,3 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index 9f1d52adc0d2..8736e8f6dcd5 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -78,4 +78,3 @@ AxisModel::~AxisModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx b/oox/source/drawingml/chart/chartcontextbase.cxx
index d3746f07ba6c..69c1f2622b46 100644
--- a/oox/source/drawingml/chart/chartcontextbase.cxx
+++ b/oox/source/drawingml/chart/chartcontextbase.cxx
@@ -26,11 +26,9 @@
************************************************************************/
#include "oox/drawingml/chart/chartcontextbase.hxx"
-#include "oox/drawingml/shapepropertiescontext.hxx"
-#include "oox/drawingml/chart/modelbase.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
+#include "oox/drawingml/chart/modelbase.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
namespace oox {
namespace drawingml {
@@ -38,6 +36,11 @@ namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper& rParent, Shape& rModel ) :
ContextBase< Shape >( rParent, rModel )
{
@@ -117,4 +120,3 @@ ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const Attr
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index efd8e6d021e1..02672088c763 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -26,27 +26,28 @@
************************************************************************/
#include "oox/drawingml/chart/chartconverter.hxx"
+
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/chart/chartspaceconverter.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::drawing::XShapes;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::data::XDataProvider;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
ChartConverter::ChartConverter()
{
}
@@ -90,4 +91,3 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference<
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index fcc350b583c3..03c634453e8b 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -26,28 +26,28 @@
************************************************************************/
#include "oox/drawingml/chart/chartdrawingfragment.hxx"
+
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/connectorshapecontext.hxx"
#include "oox/drawingml/graphicshapecontext.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandler2;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ShapeAnchor::ShapeAnchor( bool bRelSize ) :
mbRelSize( bRelSize )
{
@@ -175,7 +175,7 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con
case CDR_TOKEN( graphicFrame ):
if( !mbOleSupport )
return 0;
- mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
+ mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) );
return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true );
case CDR_TOKEN( grpSp ):
mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
@@ -204,26 +204,24 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void ChartDrawingFragment::onEndElement( const OUString& rChars )
+void ChartDrawingFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case CDR_TOKEN( x ):
- case CDR_TOKEN( y ):
- if( mxAnchor.get() ) mxAnchor->setPos( getCurrentElement(), getPreviousElement(), rChars );
- break;
+ if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor.get() )
+ mxAnchor->setPos( getCurrentElement(), getParentElement(), rChars );
+}
- case CDR_TOKEN( absSizeAnchor ):
- case CDR_TOKEN( relSizeAnchor ):
- if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
- {
- Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect );
- if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
- mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc );
- }
- mxShape.reset();
- mxAnchor.reset();
- break;
+void ChartDrawingFragment::onEndElement()
+{
+ if( isCurrentElement( CDR_TOKEN( absSizeAnchor ), CDR_TOKEN( relSizeAnchor ) ) )
+ {
+ if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
+ {
+ Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect );
+ if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
+ mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc );
+ }
+ mxShape.reset();
+ mxAnchor.reset();
}
}
@@ -232,4 +230,3 @@ void ChartDrawingFragment::onEndElement( const OUString& rChars )
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 54212f1bdbda..b16ac91e09c9 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/chart/chartspaceconverter.hxx"
+
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -38,20 +39,6 @@
#include "oox/drawingml/chart/chartspacemodel.hxx"
#include "oox/drawingml/chart/plotareaconverter.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::drawing::XDrawPageSupplier;
-using ::com::sun::star::drawing::XShapes;
-using ::com::sun::star::chart2::XDiagram;
-using ::com::sun::star::chart2::XTitled;
-using ::com::sun::star::chart2::data::XDataReceiver;
namespace oox {
namespace drawingml {
@@ -59,6 +46,17 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ChartSpaceConverter::ChartSpaceConverter( const ConverterRoot& rParent, ChartSpaceModel& rModel ) :
ConverterBase< ChartSpaceModel >( rParent, rModel )
{
@@ -206,4 +204,3 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx
index 75df94e95de7..d4b4a66f361f 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -26,22 +26,25 @@
************************************************************************/
#include "oox/drawingml/chart/chartspacefragment.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
#include "oox/drawingml/chart/plotareacontext.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
{
@@ -124,4 +127,3 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx
index e386334160a8..3e2253a2ffc1 100644
--- a/oox/source/drawingml/chart/chartspacemodel.cxx
+++ b/oox/source/drawingml/chart/chartspacemodel.cxx
@@ -51,4 +51,3 @@ ChartSpaceModel::~ChartSpaceModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index b5a0511bf1b8..df4d40e952ac 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -26,48 +26,41 @@
************************************************************************/
#include "oox/drawingml/chart/converterbase.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
+
#include <com/sun/star/chart/XAxisXSupplier.hpp>
#include <com/sun/star/chart/XAxisYSupplier.hpp>
#include <com/sun/star/chart/XAxisZSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <tools/solar.h> // for F_PI180
-#include "properties.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/theme.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::chart2::RelativePosition;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::XTitle;
-using ::com::sun::star::drawing::XShape;
-using ::oox::core::XmlFilterBase;
-
-namespace cssc = ::com::sun::star::chart;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+namespace cssc = ::com::sun::star::chart;
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
struct TitleKey : public ::std::pair< ObjectType, ::std::pair< sal_Int32, sal_Int32 > >
@@ -247,7 +240,7 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN
Reference< XInterface > xInt;
try
{
- xInt = mxData->mrFilter.getGlobalFactory()->createInstance( rServiceName );
+ xInt = mxData->mrFilter.getServiceFactory()->createInstance( rServiceName );
}
catch( Exception& )
{
@@ -419,4 +412,3 @@ bool LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, doub
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx
index d55b955d6e0d..a044dd67018d 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -26,11 +26,8 @@
************************************************************************/
#include "oox/drawingml/chart/datasourcecontext.hxx"
-#include "oox/drawingml/chart/datasourcemodel.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
+#include "oox/drawingml/chart/datasourcemodel.hxx"
namespace oox {
namespace drawingml {
@@ -38,6 +35,12 @@ namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel ) :
DataSequenceContextBase( rParent, rModel ),
mnPtIndex( -1 )
@@ -87,7 +90,7 @@ ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-void DoubleSequenceContext::onEndElement( const OUString& rChars )
+void DoubleSequenceContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -160,7 +163,7 @@ ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-void StringSequenceContext::onEndElement( const OUString& rChars )
+void StringSequenceContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -228,4 +231,3 @@ ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx
index 2409f8e89962..c68a6cbe4adf 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -26,14 +26,10 @@
************************************************************************/
#include "oox/drawingml/chart/datasourceconverter.hxx"
+
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/chart/chartconverter.hxx"
#include "oox/drawingml/chart/datasourcemodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::chart2::data::XDataSequence;
namespace oox {
namespace drawingml {
@@ -41,6 +37,13 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
DataSequenceConverter::DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel ) :
ConverterBase< DataSequenceModel >( rParent, rModel )
{
@@ -89,4 +92,3 @@ Reference< XDataSequence > DataSourceConverter::createDataSequence( const OUStri
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/datasourcemodel.cxx b/oox/source/drawingml/chart/datasourcemodel.cxx
index 1f5b15f3e809..aad5a1bff959 100644
--- a/oox/source/drawingml/chart/datasourcemodel.cxx
+++ b/oox/source/drawingml/chart/datasourcemodel.cxx
@@ -57,4 +57,3 @@ DataSourceModel::~DataSourceModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx
index c182d8e3e410..f32a118c5589 100644
--- a/oox/source/drawingml/chart/modelbase.cxx
+++ b/oox/source/drawingml/chart/modelbase.cxx
@@ -26,9 +26,8 @@
************************************************************************/
#include "oox/drawingml/chart/modelbase.hxx"
-#include "oox/helper/attributelist.hxx"
-using ::rtl::OUString;
+#include "oox/helper/attributelist.hxx"
namespace oox {
namespace drawingml {
@@ -36,6 +35,10 @@ namespace chart {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
NumberFormat::NumberFormat() :
mbSourceLinked( true )
{
@@ -73,4 +76,3 @@ LayoutModel::~LayoutModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index d96e2d43dd6f..f6d441ded650 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -26,13 +26,11 @@
************************************************************************/
#include "oox/drawingml/chart/objectformatter.hxx"
-#include <rtl/strbuf.hxx>
-#include <osl/thread.h>
+
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
-#include "oox/helper/modelobjecthelper.hxx"
+#include <osl/thread.h>
+#include <rtl/strbuf.hxx>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/lineproperties.hxx"
@@ -40,24 +38,7 @@
#include "oox/drawingml/textparagraph.hxx"
#include "oox/drawingml/theme.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
-
-using ::rtl::OStringBuffer;
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::util::XNumberFormats;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormatTypes;
-using ::oox::core::XmlFilterBase;
+#include "oox/helper/modelobjecthelper.hxx"
namespace oox {
namespace drawingml {
@@ -65,6 +46,20 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+
+// ============================================================================
+
namespace {
struct AutoFormatPatternEntry
@@ -1211,4 +1206,3 @@ void ObjectFormatter::convertAutomaticFill( PropertySet& rPropSet, ObjectType eO
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 4f8268f06d66..17c6487b59b4 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/chart/plotareacontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/chart/axiscontext.hxx"
#include "oox/drawingml/chart/plotareamodel.hxx"
@@ -33,15 +34,17 @@
#include "oox/drawingml/chart/titlecontext.hxx"
#include "oox/drawingml/chart/typegroupcontext.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) :
ContextBase< View3DModel >( rParent, rModel )
{
@@ -182,4 +185,3 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index c3f74899ed97..78379ae855bd 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -26,28 +26,18 @@
************************************************************************/
#include "oox/drawingml/chart/plotareaconverter.hxx"
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/drawing/ShadeMode.hpp>
+
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
+#include <com/sun/star/drawing/Direction3D.hpp>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
#include "oox/drawingml/chart/axisconverter.hxx"
#include "oox/drawingml/chart/plotareamodel.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XCoordinateSystemContainer;
-using ::com::sun::star::chart2::XDiagram;
namespace oox {
namespace drawingml {
@@ -55,6 +45,14 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
/** Axes set model. This is a helper for the plot area converter collecting all
@@ -452,4 +450,3 @@ void PlotAreaConverter::convertPositionFromModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index d06ca9716944..014ca51e869d 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -26,27 +26,30 @@
************************************************************************/
#include "oox/drawingml/chart/seriescontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/datasourcecontext.hxx"
#include "oox/drawingml/chart/seriesmodel.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2;
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-ContextHandlerRef lclDataLabelSharedCreateContext(
- ContextHandler2& rContext, sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
+ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
+ sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
{
if( rContext.isRootElement() ) switch( nElement )
{
@@ -79,7 +82,7 @@ ContextHandlerRef lclDataLabelSharedCreateContext(
orModel.mobShowVal = rAttribs.getBool( XML_val );
return 0;
case C_TOKEN( separator ):
- // collect separator text in onEndElement()
+ // collect separator text in onCharacters()
return &rContext;
case C_TOKEN( spPr ):
return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
@@ -89,14 +92,10 @@ ContextHandlerRef lclDataLabelSharedCreateContext(
return 0;
}
-void lclDataLabelSharedEndElement( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
+void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
{
- switch( rContext.getCurrentElement() )
- {
- case C_TOKEN( separator ):
- orModel.moaSeparator = rChars;
- break;
- }
+ if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
+ orModel.moaSeparator = rChars;
}
} // namespace
@@ -127,9 +126,9 @@ ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const A
return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
}
-void DataLabelContext::onEndElement( const OUString& rChars )
+void DataLabelContext::onCharacters( const OUString& rChars )
{
- lclDataLabelSharedEndElement( *this, rChars, mrModel );
+ lclDataLabelSharedCharacters( *this, rChars, mrModel );
}
// ============================================================================
@@ -159,9 +158,9 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const
return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
}
-void DataLabelsContext::onEndElement( const OUString& rChars )
+void DataLabelsContext::onCharacters( const OUString& rChars )
{
- lclDataLabelSharedEndElement( *this, rChars, mrModel );
+ lclDataLabelSharedCharacters( *this, rChars, mrModel );
}
// ============================================================================
@@ -305,7 +304,7 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A
mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
return 0;
case C_TOKEN( name ):
- return this; // collect name in onEndElement()
+ return this; // collect name in onCharacters()
case C_TOKEN( order ):
mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
return 0;
@@ -323,14 +322,10 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A
return 0;
}
-void TrendlineContext::onEndElement( const ::rtl::OUString& rChars )
+void TrendlineContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case C_TOKEN( name ):
- mrModel.maName = rChars;
- break;
- }
+ if( isCurrentElement( C_TOKEN( name ) ) )
+ mrModel.maName = rChars;
}
// ============================================================================
@@ -757,4 +752,3 @@ ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, con
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 717a3972550e..b9eaee5c01be 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/chart/seriesconverter.hxx"
+
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
@@ -38,21 +39,7 @@
#include "oox/drawingml/chart/titleconverter.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::DataPointLabel;
-using ::com::sun::star::chart2::XDataSeries;
-using ::com::sun::star::chart2::XRegressionCurve;
-using ::com::sun::star::chart2::XRegressionCurveContainer;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::com::sun::star::chart2::data::XDataSink;
-using ::com::sun::star::chart2::data::XLabeledDataSequence;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -60,6 +47,15 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
Reference< XLabeledDataSequence > lclCreateLabeledDataSequence(
@@ -621,4 +617,3 @@ Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence(
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 01fff8e8d385..417d250caf77 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -154,4 +154,3 @@ SeriesModel::~SeriesModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx
index 5ff71109b710..cc2b7ace0e72 100644
--- a/oox/source/drawingml/chart/titlecontext.cxx
+++ b/oox/source/drawingml/chart/titlecontext.cxx
@@ -26,21 +26,24 @@
************************************************************************/
#include "oox/drawingml/chart/titlecontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/datasourcecontext.hxx"
#include "oox/drawingml/chart/titlemodel.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
TextContext::TextContext( ContextHandler2Helper& rParent, TextModel& rModel ) :
ContextBase< TextModel >( rParent, rModel )
{
@@ -52,34 +55,28 @@ TextContext::~TextContext()
ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:tx> and embedded <c:v> elements
+ if( isCurrentElement( C_TOKEN( tx ) ) ) switch( nElement )
{
- case C_TOKEN( tx ):
- switch( nElement )
- {
- case C_TOKEN( rich ):
- return new TextBodyContext( *this, mrModel.mxTextBody.create() );
- case C_TOKEN( strRef ):
- OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
- return new StringSequenceContext( *this, mrModel.mxDataSeq.create() );
- case C_TOKEN( v ):
- OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
- return this; // collect value in onEndElement()
- }
- break;
+ case C_TOKEN( rich ):
+ return new TextBodyContext( *this, mrModel.mxTextBody.create() );
+
+ case C_TOKEN( strRef ):
+ OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
+ return new StringSequenceContext( *this, mrModel.mxDataSeq.create() );
+
+ case C_TOKEN( v ):
+ OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
+ return this; // collect value in onCharacters()
}
return 0;
}
-void TextContext::onEndElement( const OUString& rChars )
+void TextContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case C_TOKEN( v ):
- // store as single string sequence element
- mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars;
- break;
- }
+ // store as single string sequence element
+ if( isCurrentElement( C_TOKEN( v ) ) )
+ mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars;
}
// ============================================================================
@@ -95,25 +92,25 @@ TitleContext::~TitleContext()
ContextHandlerRef TitleContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:title> only
+ switch( nElement )
{
- case C_TOKEN( title ):
- switch( nElement )
- {
- case C_TOKEN( layout ):
- return new LayoutContext( *this, mrModel.mxLayout.create() );
- case C_TOKEN( overlay ):
- // default is 'false', not 'true' as specified
- mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
- return 0;
- case C_TOKEN( spPr ):
- return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
- case C_TOKEN( tx ):
- return new TextContext( *this, mrModel.mxText.create() );
- case C_TOKEN( txPr ):
- return new TextBodyContext( *this, mrModel.mxTextProp.create() );
- }
- break;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+
+ case C_TOKEN( overlay ):
+ // default is 'false', not 'true' as specified
+ mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
+ return 0;
+
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
}
return 0;
}
@@ -131,26 +128,26 @@ LegendContext::~LegendContext()
ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:legend> only
+ switch( nElement )
{
- case C_TOKEN( legend ):
- switch( nElement )
- {
- case C_TOKEN( layout ):
- return new LayoutContext( *this, mrModel.mxLayout.create() );
- case C_TOKEN( legendPos ):
- mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r );
- return 0;
- case C_TOKEN( overlay ):
- // default is 'false', not 'true' as specified
- mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
- return 0;
- case C_TOKEN( spPr ):
- return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
- case C_TOKEN( txPr ):
- return new TextBodyContext( *this, mrModel.mxTextProp.create() );
- }
- break;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+
+ case C_TOKEN( legendPos ):
+ mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r );
+ return 0;
+
+ case C_TOKEN( overlay ):
+ // default is 'false', not 'true' as specified
+ mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
+ return 0;
+
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
}
return 0;
}
@@ -160,4 +157,3 @@ ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const Attr
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index bca53f1a2c01..fdc4969f7c5e 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/chart/titleconverter.hxx"
+
#include <com/sun/star/chart2/LegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -33,25 +34,11 @@
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
-#include "properties.hxx"
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/textparagraph.hxx"
#include "oox/drawingml/chart/datasourceconverter.hxx"
#include "oox/drawingml/chart/titlemodel.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::chart2::XDiagram;
-using ::com::sun::star::chart2::XFormattedString;
-using ::com::sun::star::chart2::XLegend;
-using ::com::sun::star::chart2::XTitle;
-using ::com::sun::star::chart2::XTitled;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::core::XmlFilterBase;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -59,6 +46,16 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
TextConverter::TextConverter( const ConverterRoot& rParent, TextModel& rModel ) :
ConverterBase< TextModel >( rParent, rModel )
{
@@ -270,4 +267,3 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx
index bb5501e05f32..d1dc2c664e8f 100644
--- a/oox/source/drawingml/chart/titlemodel.cxx
+++ b/oox/source/drawingml/chart/titlemodel.cxx
@@ -69,4 +69,3 @@ LegendModel::~LegendModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 972295304593..781b2665d6f1 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -26,18 +26,21 @@
************************************************************************/
#include "oox/drawingml/chart/typegroupcontext.hxx"
+
#include "oox/drawingml/chart/seriescontext.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) :
ContextBase< UpDownBarsModel >( rParent, rModel )
{
@@ -399,4 +402,3 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 3746048074e9..6c0d3660a670 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/chart/typegroupconverter.hxx"
+
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
@@ -39,23 +40,7 @@
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/chart/seriesconverter.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::XChartType;
-using ::com::sun::star::chart2::XChartTypeContainer;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XDataSeries;
-using ::com::sun::star::chart2::XDataSeriesContainer;
-using ::com::sun::star::chart2::XDiagram;
-using ::com::sun::star::chart2::data::XDataSink;
-using ::com::sun::star::chart2::data::XLabeledDataSequence;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -63,6 +48,15 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
// chart type service names
@@ -570,4 +564,3 @@ void TypeGroupConverter::insertDataSeries( const Reference< XChartType >& rxChar
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index 24f5420644e4..ee5eefc4d163 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -80,4 +80,3 @@ TypeGroupModel::~TypeGroupModel()
} // namespace chart
} // namespace drawingml
} // namespace oox
-
diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx
index fdeb28a27ef0..b011cd27b147 100644
--- a/oox/source/drawingml/clrscheme.cxx
+++ b/oox/source/drawingml/clrscheme.cxx
@@ -26,7 +26,7 @@
************************************************************************/
#include "oox/drawingml/clrscheme.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/source/drawingml/clrschemecontext.cxx b/oox/source/drawingml/clrschemecontext.cxx
index 996ddef2ab0f..fad92dd35c3c 100644
--- a/oox/source/drawingml/clrschemecontext.cxx
+++ b/oox/source/drawingml/clrschemecontext.cxx
@@ -26,9 +26,7 @@
************************************************************************/
#include "oox/drawingml/clrschemecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -99,7 +97,7 @@ Reference< XFastContextHandler > clrSchemeContext::createFastChildContext(
case A_TOKEN( accent6 ):
case A_TOKEN( hlink ):
case A_TOKEN( folHlink ):
- return new clrSchemeColorContext( *this, mrClrScheme, getToken( nElement ) );
+ return new clrSchemeColorContext( *this, mrClrScheme, getBaseToken( nElement ) );
}
return 0;
}
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 8653d787517d..4ff19a4bf987 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -28,11 +28,11 @@
#include "oox/drawingml/color.hxx"
#include <algorithm>
#include <math.h>
-#include "tokens.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
@@ -314,7 +314,7 @@ void Color::addTransformation( sal_Int32 nElement, sal_Int32 nValue )
/* Execute alpha transformations directly, store other transformations in
a vector, they may depend on a scheme base color which will be resolved
in Color::getColor(). */
- sal_Int32 nToken = getToken( nElement );
+ sal_Int32 nToken = getBaseToken( nElement );
switch( nToken )
{
case XML_alpha: lclSetValue( mnAlpha, nValue ); break;
@@ -336,7 +336,7 @@ void Color::addChartTintTransformation( double fTint )
void Color::addExcelTintTransformation( double fTint )
{
sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT );
- maTransforms.push_back( Transformation( NMSP_XLS | XML_tint, nValue ) );
+ maTransforms.push_back( Transformation( XLS_TOKEN( tint ), nValue ) );
}
void Color::clearTransformations()
diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx
index 2bc01e049a8e..a909f2f68d0c 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -27,7 +27,6 @@
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/color.hxx"
using ::com::sun::star::uno::Reference;
diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx
index 3327d627af6d..f2840a8d82fa 100644
--- a/oox/source/drawingml/connectorshapecontext.cxx
+++ b/oox/source/drawingml/connectorshapecontext.cxx
@@ -35,8 +35,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -63,7 +61,7 @@ Reference< XFastContextHandler > ConnectorShapeContext::createFastChildContext(
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
case XML_nvCxnSpPr :
break;
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index a0fcc3142f51..d0c5c6a2dde2 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -32,10 +32,7 @@
#include <hash_map>
#include "oox/helper/helper.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/token/tokenmap.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -243,7 +240,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu
sal_Char nVal = 0;
// first check if its a constant value
- switch( StaticTokenMap::get().getTokenFromUnicode( rValue ) )
+ switch( AttributeConversion::decodeToken( rValue ) )
{
case XML_3cd4 : nConstant = 270 * 60000; break;
case XML_3cd8 : nConstant = 135 * 60000; break;
@@ -631,7 +628,7 @@ static rtl::OUString convertToOOEquation( CustomShapeProperties& rCustomShapePro
Reference< XFastContextHandler > GeomGuideListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_gd ) ) // CT_GeomGuide
+ if ( aElementToken == A_TOKEN( gd ) ) // CT_GeomGuide
{
CustomShapeGuide aGuide;
aGuide.maName = xAttribs->getOptionalValue( XML_name );
@@ -712,7 +709,7 @@ XYAdjustHandleContext::XYAdjustHandleContext( ContextHandler& rParent, const Ref
Reference< XFastContextHandler > XYAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -766,7 +763,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler& rParent, con
Reference< XFastContextHandler > PolarAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -794,13 +791,13 @@ AdjustHandleListContext::AdjustHandleListContext( ContextHandler& rParent, Custo
Reference< XFastContextHandler > AdjustHandleListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_ahXY ) ) // CT_XYAdjustHandle
+ if ( aElementToken == A_TOKEN( ahXY ) ) // CT_XYAdjustHandle
{
AdjustHandle aAdjustHandle( sal_False );
mrAdjustHandleList.push_back( aAdjustHandle );
xContext = new XYAdjustHandleContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() );
}
- else if ( aElementToken == ( NMSP_DRAWINGML | XML_ahPolar ) ) // CT_PolarAdjustHandle
+ else if ( aElementToken == A_TOKEN( ahPolar ) ) // CT_PolarAdjustHandle
{
AdjustHandle aAdjustHandle( sal_True );
mrAdjustHandleList.push_back( aAdjustHandle );
@@ -833,7 +830,7 @@ ConnectionSiteContext::ConnectionSiteContext( ContextHandler& rParent, const Ref
Reference< XFastContextHandler > ConnectionSiteContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrConnectionSite.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -861,7 +858,7 @@ Path2DMoveToContext::Path2DMoveToContext( ContextHandler& rParent, CustomShapePr
Reference< XFastContextHandler > Path2DMoveToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D
return xContext;
}
@@ -889,7 +886,7 @@ Path2DLineToContext::Path2DLineToContext( ContextHandler& rParent, CustomShapePr
Reference< XFastContextHandler > Path2DLineToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D
return xContext;
}
@@ -924,7 +921,7 @@ Path2DQuadBezierToContext::Path2DQuadBezierToContext( ContextHandler& rParent,
Reference< XFastContextHandler > Path2DQuadBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? mrPt2 : mrPt1 ); // CT_AdjPoint2D
return xContext;
}
@@ -962,7 +959,7 @@ Path2DCubicBezierToContext::Path2DCubicBezierToContext( ContextHandler& rParent,
Reference< XFastContextHandler > Path2DCubicBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties,
nCount++ ? nCount == 2 ? mrControlPt2 : mrEndPt : mrControlPt1 ); // CT_AdjPoint2D
return xContext;
@@ -1021,7 +1018,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
Reference< XFastContextHandler > xContext;
switch( aElementToken )
{
- case NMSP_DRAWINGML | XML_close :
+ case A_TOKEN( close ) :
{
EnhancedCustomShapeSegment aNewSegment;
aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
@@ -1029,7 +1026,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrSegments.push_back( aNewSegment );
}
break;
- case NMSP_DRAWINGML | XML_moveTo :
+ case A_TOKEN( moveTo ) :
{
EnhancedCustomShapeSegment aNewSegment;
aNewSegment.Command = EnhancedCustomShapeSegmentCommand::MOVETO;
@@ -1041,7 +1038,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
xContext = new Path2DMoveToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_lnTo :
+ case A_TOKEN( lnTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::LINETO ) )
@@ -1058,7 +1055,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
xContext = new Path2DLineToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_arcTo : // CT_Path2DArcTo
+ case A_TOKEN( arcTo ) : // CT_Path2DArcTo
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::ARCTO ) )
mrSegments.back().Count++;
@@ -1084,7 +1081,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrPath2D.parameter.push_back( aPt );
}
break;
- case NMSP_DRAWINGML | XML_quadBezTo :
+ case A_TOKEN( quadBezTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO ) )
mrSegments.back().Count++;
@@ -1104,7 +1101,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_cubicBezTo :
+ case A_TOKEN( cubicBezTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::CURVETO ) )
mrSegments.back().Count++;
@@ -1160,7 +1157,7 @@ Path2DListContext::Path2DListContext( ContextHandler& rParent, CustomShapeProper
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL Path2DListContext::createFastChildContext( sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_path ) )
+ if ( aElementToken == A_TOKEN( path ) )
{
Path2D aPath2D;
mrPath2DList.push_back( aPath2D );
@@ -1983,19 +1980,19 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont
Reference< XFastContextHandler > xContext;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_avLst: // CT_GeomGuideList adjust value list
+ case A_TOKEN( avLst ): // CT_GeomGuideList adjust value list
xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
break;
- case NMSP_DRAWINGML|XML_gdLst: // CT_GeomGuideList guide list
+ case A_TOKEN( gdLst ): // CT_GeomGuideList guide list
xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getGuideList() );
break;
- case NMSP_DRAWINGML|XML_ahLst: // CT_AdjustHandleList adjust handle list
+ case A_TOKEN( ahLst ): // CT_AdjustHandleList adjust handle list
xContext = new AdjustHandleListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustHandleList() );
break;
- case NMSP_DRAWINGML|XML_cxnLst: // CT_ConnectionSiteList connection site list
+ case A_TOKEN( cxnLst ): // CT_ConnectionSiteList connection site list
xContext = this;
break;
- case NMSP_DRAWINGML|XML_rect: // CT_GeomRectList geometry rect list
+ case A_TOKEN( rect ): // CT_GeomRectList geometry rect list
{
GeomRect aGeomRect;
aGeomRect.l = GetAdjCoordinate( mrCustomShapeProperties, xAttribs->getOptionalValue( XML_l ), sal_True );
@@ -2005,12 +2002,12 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont
mrCustomShapeProperties.getTextRect() = aGeomRect;
}
break;
- case NMSP_DRAWINGML|XML_pathLst: // CT_Path2DList 2d path list
+ case A_TOKEN( pathLst ): // CT_Path2DList 2d path list
xContext = new Path2DListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getSegments(), mrCustomShapeProperties.getPath2DList() );
break;
// from cxnLst:
- case NMSP_DRAWINGML|XML_cxn: // CT_ConnectionSite
+ case A_TOKEN( cxn ): // CT_ConnectionSite
{
ConnectionSite aConnectionSite;
mrCustomShapeProperties.getConnectionSiteList().push_back( aConnectionSite );
@@ -2037,7 +2034,7 @@ PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler& rParent,
Reference< XFastContextHandler > PresetShapeGeometryContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) )
+ if ( aElementToken == A_TOKEN( avLst ) )
return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
else
return this;
@@ -2059,7 +2056,7 @@ PresetTextShapeContext::PresetTextShapeContext( ContextHandler& rParent, const R
Reference< XFastContextHandler > PresetTextShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) )
+ if ( aElementToken == A_TOKEN( avLst ) )
return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
else
return this;
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index d296a4041fb9..052fdc5e1dfc 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -29,9 +29,6 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx
index 901b9267df36..8d81c800b2df 100644
--- a/oox/source/drawingml/diagram/datamodelcontext.cxx
+++ b/oox/source/drawingml/diagram/datamodelcontext.cxx
@@ -27,7 +27,6 @@
#include "oox/drawingml/diagram/datamodelcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
@@ -39,8 +38,6 @@ using ::rtl::OUString;
namespace oox { namespace drawingml {
-
-
// CL_Cxn
class CxnContext
: public ContextHandler
@@ -73,7 +70,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
default:
break;
@@ -106,7 +103,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_cxn:
+ case DGM_TOKEN( cxn ):
{
dgm::ConnectionPtr pConnection( new dgm::Connection() );
maConnections.push_back( pConnection );
@@ -161,17 +158,17 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
- case NMSP_DIAGRAM|XML_prSet:
+ case DGM_TOKEN( prSet ):
// TODO
// CT_ElemPropSet
break;
- case NMSP_DIAGRAM|XML_spPr:
+ case DGM_TOKEN( spPr ):
OSL_TRACE( "shape props for point");
xRet = new ShapePropertiesContext( *this, *mpPoint->getShape() );
break;
- case NMSP_DIAGRAM|XML_t:
+ case DGM_TOKEN( t ):
{
OSL_TRACE( "shape text body for point");
TextBodyPtr xTextBody( new TextBody );
@@ -212,7 +209,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_pt:
+ case DGM_TOKEN( pt ):
{
// CT_Pt
dgm::PointPtr pPoint( new dgm::Point() );
@@ -253,18 +250,18 @@ public:
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_blipFill:
- case NMSP_DRAWINGML|XML_gradFill:
- case NMSP_DRAWINGML|XML_grpFill:
- case NMSP_DRAWINGML|XML_noFill:
- case NMSP_DRAWINGML|XML_pattFill:
- case NMSP_DRAWINGML|XML_solidFill:
+ case A_TOKEN( blipFill ):
+ case A_TOKEN( gradFill ):
+ case A_TOKEN( grpFill ):
+ case A_TOKEN( noFill ):
+ case A_TOKEN( pattFill ):
+ case A_TOKEN( solidFill ):
// EG_FillProperties
xRet.set( FillPropertiesContext::createFillContext(
*this, aElementToken, xAttribs, *mpDataModel->getFillProperties() ) );
break;
- case NMSP_DRAWINGML|XML_effectDag:
- case NMSP_DRAWINGML|XML_effectLst:
+ case A_TOKEN( effectDag ):
+ case A_TOKEN( effectLst ):
// TODO
// EG_EffectProperties
break;
@@ -306,23 +303,23 @@ DataModelContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_cxnLst:
+ case DGM_TOKEN( cxnLst ):
// CT_CxnList
xRet.set( new CxnListContext( *this, mpDataModel->getConnections() ) );
break;
- case NMSP_DIAGRAM|XML_ptLst:
+ case DGM_TOKEN( ptLst ):
// CT_PtList
xRet.set( new PtListContext( *this, mpDataModel->getPoints() ) );
break;
- case NMSP_DIAGRAM|XML_bg:
+ case DGM_TOKEN( bg ):
// CT_BackgroundFormatting
xRet.set( new BackgroundFormattingContext( *this, mpDataModel ) );
break;
- case NMSP_DIAGRAM|XML_whole:
+ case DGM_TOKEN( whole ):
// CT_WholeE2oFormatting
// TODO
return xRet;
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
default:
break;
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 516d6bfb231c..cebb730af103 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -33,8 +33,6 @@
#include <com/sun/star/awt/Size.hpp>
#include "oox/drawingml/diagram/diagram.hxx"
#include "oox/drawingml/fillproperties.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
index 53477211848e..ac98bfb18c38 100644
--- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
+++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
@@ -26,11 +26,9 @@
************************************************************************/
#include "diagramdefinitioncontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/helper.hxx"
#include "layoutnodecontext.hxx"
#include "oox/drawingml/diagram/datamodelcontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -80,29 +78,29 @@ DiagramDefinitionContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_title:
+ case DGM_TOKEN( title ):
mpLayout->setTitle( xAttribs->getOptionalValue( XML_val ) );
break;
- case NMSP_DIAGRAM|XML_desc:
+ case DGM_TOKEN( desc ):
mpLayout->setDesc( xAttribs->getOptionalValue( XML_val ) );
break;
- case NMSP_DIAGRAM|XML_layoutNode:
+ case DGM_TOKEN( layoutNode ):
mpLayout->getNode().reset( new LayoutNode() );
xRet.set( new LayoutNodeContext( *this, xAttribs, mpLayout->getNode() ) );
break;
- case NMSP_DIAGRAM|XML_clrData:
+ case DGM_TOKEN( clrData ):
// TODO, does not matter for the UI. skip.
return xRet;
- case NMSP_DIAGRAM|XML_sampData:
+ case DGM_TOKEN( sampData ):
mpLayout->getSampData().reset( new DiagramData );
xRet.set( new DataModelContext( *this, mpLayout->getSampData() ) );
break;
- case NMSP_DIAGRAM|XML_styleData:
+ case DGM_TOKEN( styleData ):
mpLayout->getStyleData().reset( new DiagramData );
xRet.set( new DataModelContext( *this, mpLayout->getStyleData() ) );
break;
- case NMSP_DIAGRAM|XML_cat:
- case NMSP_DIAGRAM|XML_catLst:
+ case DGM_TOKEN( cat ):
+ case DGM_TOKEN( catLst ):
// TODO, does not matter for the UI
default:
break;
diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
index ac2e755bee40..644e84771b3e 100644
--- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
+++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
@@ -29,9 +29,7 @@
#include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
#include "oox/drawingml/diagram/datamodelcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "diagramdefinitioncontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
@@ -70,7 +68,7 @@ DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_dataModel:
+ case DGM_TOKEN( dataModel ):
xRet.set( new DataModelContext( *this, mpDataPtr ) );
break;
default:
@@ -115,7 +113,7 @@ DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_layoutDef:
+ case DGM_TOKEN( layoutDef ):
xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) );
break;
default:
@@ -160,7 +158,7 @@ DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_styleDef:
+ case DGM_TOKEN( styleDef ):
// TODO
break;
default:
@@ -205,7 +203,7 @@ DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_colorsDef:
+ case DGM_TOKEN( colorsDef ):
// TODO
break;
default:
diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx
index 4d430bb6ba36..0815843dd424 100644
--- a/oox/source/drawingml/diagram/layoutnodecontext.cxx
+++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx
@@ -28,7 +28,6 @@
#include "layoutnodecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/diagram/diagram.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "diagramdefinitioncontext.hxx"
@@ -178,7 +177,7 @@ public:
{
Reference< XFastContextHandler > xRet;
- sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getToken( aElement ) );
+ sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getBaseToken( aElement ) );
if( nIdx != -1 )
{
mVariables[ nIdx ] = makeAny( xAttribs->getOptionalValue( XML_val ) );
@@ -229,31 +228,31 @@ sal_Int32 LayoutNodeContext::tagToVarIdx( sal_Int32 aTag )
sal_Int32 nIdx = -1;
switch( aTag )
{
- case NMSP_DIAGRAM|XML_animLvl:
+ case DGM_TOKEN( animLvl ):
nIdx = LayoutNode::VAR_animLvl;
break;
- case NMSP_DIAGRAM|XML_animOne:
+ case DGM_TOKEN( animOne ):
nIdx = LayoutNode::VAR_animOne;
break;
- case NMSP_DIAGRAM|XML_bulletEnabled:
+ case DGM_TOKEN( bulletEnabled ):
nIdx = LayoutNode::VAR_bulletEnabled;
break;
- case NMSP_DIAGRAM|XML_chMax:
+ case DGM_TOKEN( chMax ):
nIdx = LayoutNode::VAR_chMax;
break;
- case NMSP_DIAGRAM|XML_chPref:
+ case DGM_TOKEN( chPref ):
nIdx = LayoutNode::VAR_chPref;
break;
- case NMSP_DIAGRAM|XML_dir:
+ case DGM_TOKEN( dir ):
nIdx = LayoutNode::VAR_dir;
break;
- case NMSP_DIAGRAM|XML_hierBranch:
+ case DGM_TOKEN( hierBranch ):
nIdx = LayoutNode::VAR_hierBranch;
break;
- case NMSP_DIAGRAM|XML_orgChart:
+ case DGM_TOKEN( orgChart ):
nIdx = LayoutNode::VAR_orgChart;
break;
- case NMSP_DIAGRAM|XML_resizeHandles:
+ case DGM_TOKEN( resizeHandles ):
nIdx = LayoutNode::VAR_resizeHandles;
break;
default:
@@ -272,22 +271,22 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_layoutNode:
+ case DGM_TOKEN( layoutNode ):
{
LayoutNodePtr pNode( new LayoutNode() );
mpNode->addChild( pNode );
xRet.set( new LayoutNodeContext( *this, xAttribs, pNode ) );
break;
}
- case NMSP_DIAGRAM|XML_shape:
+ case DGM_TOKEN( shape ):
{
ShapePtr pShape( new Shape() );
xRet.set( new ShapeContext( *this, ShapePtr(), pShape ) );
break;
}
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
- case NMSP_DIAGRAM|XML_alg:
+ case DGM_TOKEN( alg ):
{
// CT_Algorithm
LayoutAtomPtr pAtom( new AlgAtom );
@@ -295,7 +294,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new AlgorithmContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_choose:
+ case DGM_TOKEN( choose ):
{
// CT_Choose
LayoutAtomPtr pAtom( new ChooseAtom );
@@ -303,7 +302,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new ChooseContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_forEach:
+ case DGM_TOKEN( forEach ):
{
// CT_ForEach
LayoutAtomPtr pAtom( new ForEachAtom );
@@ -311,11 +310,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new ForEachContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_constrLst:
+ case DGM_TOKEN( constrLst ):
// CT_Constraints
// TODO
break;
- case NMSP_DIAGRAM|XML_presOf:
+ case DGM_TOKEN( presOf ):
{
// CT_PresentationOf
// TODO
@@ -327,11 +326,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xAttribs->getOptionalValue( XML_step );
break;
}
- case NMSP_DIAGRAM|XML_ruleLst:
+ case DGM_TOKEN( ruleLst ):
// CT_Rules
// TODO
break;
- case NMSP_DIAGRAM|XML_varLst:
+ case DGM_TOKEN( varLst ):
{
LayoutNodePtr pNode( boost::dynamic_pointer_cast< LayoutNode >( mpNode ) );
if( pNode )
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index e5aef824bf54..f99fdc21ab55 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -31,7 +31,7 @@
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <sax/tools/converter.hxx>
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx
index 02cad5ce9f05..5c9484894109 100644
--- a/oox/source/drawingml/embeddedwavaudiofile.cxx
+++ b/oox/source/drawingml/embeddedwavaudiofile.cxx
@@ -27,9 +27,6 @@
#include "oox/drawingml/embeddedwavaudiofile.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -46,7 +43,7 @@ namespace oox { namespace drawingml {
{
AttributeList attribs(xAttribs);
- OUString sId = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_embed );
+ OUString sId = xAttribs->getOptionalValue( R_TOKEN( embed ) );
aAudio.msEmbed = rRelations.getFragmentPathFromRelId( sId );
aAudio.mbBuiltIn = attribs.getBool( XML_builtIn, false );
aAudio.msName = xAttribs->getOptionalValue( XML_name );
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 08d001f09a62..19700cd8199c 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -36,13 +36,12 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/tokens.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::drawing;
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index cb2037294786..15b1ef0f2404 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -28,7 +28,6 @@
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/fillproperties.hxx"
@@ -190,7 +189,7 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext(
{
case A_TOKEN( biLevel ):
case A_TOKEN( grayscl ):
- mrBlipProps.moColorEffect = getToken( nElement );
+ mrBlipProps.moColorEffect = getBaseToken( nElement );
break;
case A_TOKEN( clrChange ):
@@ -237,7 +236,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext(
break;
case A_TOKEN( tile ):
- mrBlipProps.moBitmapMode = getToken( nElement );
+ mrBlipProps.moBitmapMode = getBaseToken( nElement );
mrBlipProps.moTileOffsetX = aAttribs.getInteger( XML_tx );
mrBlipProps.moTileOffsetY = aAttribs.getInteger( XML_ty );
mrBlipProps.moTileScaleX = aAttribs.getInteger( XML_sx );
@@ -247,7 +246,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext(
break;
case A_TOKEN( stretch ):
- mrBlipProps.moBitmapMode = getToken( nElement );
+ mrBlipProps.moBitmapMode = getBaseToken( nElement );
return this; // for fillRect element
case A_TOKEN( fillRect ):
@@ -279,12 +278,12 @@ Reference< XFastContextHandler > FillPropertiesContext::createFastChildContext(
{
switch( nElement )
{
- case A_TOKEN( noFill ): { rFillProps.moFillType = getToken( nElement ); return 0; };
- case A_TOKEN( solidFill ): { rFillProps.moFillType = getToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); };
- case A_TOKEN( gradFill ): { rFillProps.moFillType = getToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); };
- case A_TOKEN( pattFill ): { rFillProps.moFillType = getToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); };
- case A_TOKEN( blipFill ): { rFillProps.moFillType = getToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); };
- case A_TOKEN( grpFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; // TODO
+ case A_TOKEN( noFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; };
+ case A_TOKEN( solidFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); };
+ case A_TOKEN( gradFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); };
+ case A_TOKEN( pattFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); };
+ case A_TOKEN( blipFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); };
+ case A_TOKEN( grpFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; // TODO
}
return 0;
}
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index 48461bb2858e..646017aa22ea 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -27,13 +27,11 @@
#include "oox/drawingml/graphicshapecontext.hxx"
#include <osl/diagnose.h>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/customshapeproperties.hxx"
#include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
#include "oox/drawingml/table/tablecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
@@ -41,14 +39,8 @@
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-#include "oox/ole/oleobjecthelper.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/transform2dcontext.hxx"
-#include "oox/drawingml/chart/chartconverter.hxx"
-#include "oox/drawingml/chart/chartspacefragment.hxx"
-#include "oox/drawingml/chart/chartspacemodel.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -58,7 +50,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::xml::sax;
using namespace ::oox::core;
-using ::oox::vml::OleObjectInfo;
namespace oox {
namespace drawingml {
@@ -75,7 +66,7 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
// CT_ShapeProperties
case XML_xfrm:
@@ -86,13 +77,13 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
break;
}
- if (getNamespace( aElementToken ) == NMSP_VML && mpShapePtr)
+ if ((getNamespace( aElementToken ) == NMSP_vml) && mpShapePtr)
{
mpShapePtr->setServiceName("com.sun.star.drawing.CustomShape");
CustomShapePropertiesPtr pCstmShpProps
(mpShapePtr->getCustomShapeProperties());
- sal_uInt32 nType = aElementToken & (~ NMSP_MASK);
+ sal_uInt32 nType = getBaseToken( aElementToken );
OUString sType(GetShapeType(nType));
if (sType.getLength() > 0)
@@ -118,7 +109,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon
{
Reference< XFastContextHandler > xRet;
- switch( aElementToken &(~NMSP_MASK) )
+ switch( getBaseToken( aElementToken ) )
{
// CT_ShapeProperties
case XML_nvGraphicFramePr: // CT_GraphicalObjectFrameNonVisual
@@ -157,65 +148,19 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon
// ============================================================================
-class CreateOleObjectCallback : public CreateShapeCallback
-{
-public:
- explicit CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo );
- virtual OUString onCreateXShape( const OUString& rServiceName, const awt::Rectangle& rShapeRect );
-
-private:
- ::boost::shared_ptr< OleObjectInfo > mxOleObjectInfo;
-};
-
-// ----------------------------------------------------------------------------
-
-CreateOleObjectCallback::CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo ) :
- CreateShapeCallback( rFilter ),
- mxOleObjectInfo( rxOleObjectInfo )
-{
-}
-
-OUString CreateOleObjectCallback::onCreateXShape( const OUString&, const awt::Rectangle& rShapeRect )
-{
- awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height );
- bool bSuccess = mrFilter.getOleObjectHelper().importOleObject( maShapeProps, *mxOleObjectInfo, aOleSize );
- OUString aServiceName = bSuccess ? CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ) : CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" );
-
- // get the path to the representation graphic
- OUString aGraphicPath;
- if( mxOleObjectInfo->maShapeId.getLength() > 0 )
- if( ::oox::vml::Drawing* pVmlDrawing = mrFilter.getVmlDrawing() )
- if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) )
- aGraphicPath = pVmlShape->getGraphicPath();
-
- // import and store the graphic
- if( aGraphicPath.getLength() > 0 )
- {
- Reference< graphic::XGraphic > xGraphic = mrFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath );
- if( xGraphic.is() )
- maShapeProps[ PROP_Graphic ] <<= xGraphic;
- }
-
- return aServiceName;
-}
-
-// ============================================================================
-
OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler& rParent, ShapePtr xShape ) :
ShapeContext( rParent, ShapePtr(), xShape ),
- mxOleObjectInfo( new OleObjectInfo( true ) )
+ mrOleObjectInfo( xShape->setOleObjectType() )
{
- CreateShapeCallbackRef xCallback( new CreateOleObjectCallback( getFilter(), mxOleObjectInfo ) );
- xShape->setCreateShapeCallback( xCallback );
}
OleObjectGraphicDataContext::~OleObjectGraphicDataContext()
{
/* Register the OLE shape at the VML drawing, this prevents that the
related VML shape converts the OLE object by itself. */
- if( mxOleObjectInfo->maShapeId.getLength() > 0 )
+ if( mrOleObjectInfo.maShapeId.getLength() > 0 )
if( ::oox::vml::Drawing* pVmlDrawing = getFilter().getVmlDrawing() )
- pVmlDrawing->registerOleObject( *mxOleObjectInfo );
+ pVmlDrawing->registerOleObject( mrOleObjectInfo );
}
Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
@@ -227,37 +172,37 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon
{
case PPT_TOKEN( oleObj ):
{
- mxOleObjectInfo->maShapeId = aAttribs.getXString( XML_spid, OUString() );
+ mrOleObjectInfo.maShapeId = aAttribs.getXString( XML_spid, OUString() );
const Relation* pRelation = getRelations().getRelationFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
OSL_ENSURE( pRelation, "OleObjectGraphicDataContext::createFastChildContext - missing relation for OLE object" );
if( pRelation )
{
- mxOleObjectInfo->mbLinked = pRelation->mbExternal;
+ mrOleObjectInfo.mbLinked = pRelation->mbExternal;
if( pRelation->mbExternal )
{
- mxOleObjectInfo->maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget );
+ mrOleObjectInfo.maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget );
}
else
{
OUString aFragmentPath = getFragmentPathFromRelation( *pRelation );
if( aFragmentPath.getLength() > 0 )
- getFilter().importBinaryData( mxOleObjectInfo->maEmbeddedData, aFragmentPath );
+ getFilter().importBinaryData( mrOleObjectInfo.maEmbeddedData, aFragmentPath );
}
}
- mxOleObjectInfo->maName = aAttribs.getXString( XML_name, OUString() );
- mxOleObjectInfo->maProgId = aAttribs.getXString( XML_progId, OUString() );
- mxOleObjectInfo->mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false );
+ mrOleObjectInfo.maName = aAttribs.getXString( XML_name, OUString() );
+ mrOleObjectInfo.maProgId = aAttribs.getXString( XML_progId, OUString() );
+ mrOleObjectInfo.mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false );
xRet.set( this );
}
break;
case PPT_TOKEN( embed ):
- OSL_ENSURE( !mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
+ OSL_ENSURE( !mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
break;
case PPT_TOKEN( link ):
- OSL_ENSURE( mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
- mxOleObjectInfo->mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false );
+ OSL_ENSURE( mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
+ mrOleObjectInfo.mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false );
break;
}
return xRet;
@@ -268,8 +213,7 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon
DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler& rParent, ShapePtr pShapePtr )
: ShapeContext( rParent, ShapePtr(), pShapePtr )
{
- pShapePtr->setServiceName( "com.sun.star.drawing.GroupShape" );
- pShapePtr->setSubType( 0 );
+ pShapePtr->setDiagramType();
}
DiagramGraphicDataContext::~DiagramGraphicDataContext()
@@ -325,12 +269,12 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_relIds:
+ case DGM_TOKEN( relIds ):
{
- msDm = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_dm );
- msLo = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_lo );
- msQs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_qs );
- msCs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_cs );
+ msDm = xAttribs->getOptionalValue( R_TOKEN( dm ) );
+ msLo = xAttribs->getOptionalValue( R_TOKEN( lo ) );
+ msQs = xAttribs->getOptionalValue( R_TOKEN( qs ) );
+ msCs = xAttribs->getOptionalValue( R_TOKEN( cs ) );
DiagramPtr pDiagram = loadDiagram();
pDiagram->addTo( mpShapePtr );
OSL_TRACE("diagram added shape %s of type %s", OUSTRING_TO_CSTR( mpShapePtr->getName() ),
@@ -349,62 +293,10 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte
// ============================================================================
-class CreateChartCallback : public CreateShapeCallback
-{
-public:
- explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes );
- virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const;
-
-private:
- OUString maFragmentPath;
- bool mbEmbedShapes;
-};
-
-// ----------------------------------------------------------------------------
-
-CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ) :
- CreateShapeCallback( rFilter ),
- maFragmentPath( rFragmentPath ),
- mbEmbedShapes( bEmbedShapes )
-{
-}
-
-void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const
-{
- OSL_ENSURE( maFragmentPath.getLength() > 0, "CreateChartCallback::onXShapeCreated - missing chart fragment" );
- if( maFragmentPath.getLength() > 0 ) try
- {
- // set the chart2 OLE class ID at the OLE shape
- PropertySet aShapeProp( rxShape );
- aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) );
-
- // get the XModel interface of the embedded object from the OLE shape
- Reference< frame::XModel > xDocModel;
- aShapeProp.getProperty( xDocModel, PROP_Model );
- Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
-
- // load the chart data from the XML fragment
- chart::ChartSpaceModel aModel;
- mrFilter.importFragment( new chart::ChartSpaceFragment( mrFilter, maFragmentPath, aModel ) );
-
- // convert imported chart model to chart document
- Reference< drawing::XShapes > xExternalPage;
- if( !mbEmbedShapes )
- xExternalPage = rxShapes;
- mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, xExternalPage, rxShape->getPosition(), rxShape->getSize() );
- }
- catch( Exception& )
- {
- }
-}
-
-// ============================================================================
-
ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape, bool bEmbedShapes ) :
ShapeContext( rParent, ShapePtr(), rxShape ),
- mbEmbedShapes( bEmbedShapes )
+ mrChartShapeInfo( rxShape->setChartType( bEmbedShapes ) )
{
- rxShape->setServiceName( "com.sun.star.drawing.OLE2Shape" );
}
Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext( ::sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
@@ -413,9 +305,7 @@ Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext
if( nElement == C_TOKEN( chart ) )
{
AttributeList aAttribs( rxAttribs );
- OUString aFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
- CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath, mbEmbedShapes ) );
- mpShapePtr->setCreateShapeCallback( xCallback );
+ mrChartShapeInfo.maFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
}
return 0;
}
diff --git a/oox/source/drawingml/guidcontext.cxx b/oox/source/drawingml/guidcontext.cxx
index b53e33fcb746..d5fbc10783ac 100644
--- a/oox/source/drawingml/guidcontext.cxx
+++ b/oox/source/drawingml/guidcontext.cxx
@@ -25,10 +25,7 @@
*
************************************************************************/
-#include <rtl/ustring.hxx>
#include "oox/drawingml/guidcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index 280077eb0b5b..2b2b1ee1cef6 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -27,17 +27,12 @@
#include "hyperlinkcontext.hxx"
-#include <rtl/ustring.hxx>
-
#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
#include "oox/helper/propertymap.hxx"
#include "oox/core/relations.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -53,7 +48,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
, maProperties(aProperties)
{
OUString sURL, sHref;
- OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id );
+ OUString aRelId = xAttributes->getOptionalValue( R_TOKEN( id ) );
if ( aRelId.getLength() )
{
OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer);
@@ -64,10 +59,10 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
sURL = getFilter().getAbsoluteUrl( sHref );
}
}
- OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip );
+ OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) );
if ( sTooltip.getLength() )
maProperties[ PROP_Representation ] <<= sTooltip;
- OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame );
+ OUString sFrame = xAttributes->getOptionalValue( R_TOKEN( tgtFrame ) );
if( sFrame.getLength() )
maProperties[ PROP_TargetFrame ] <<= sFrame;
OUString aAction = xAttributes->getOptionalValue( XML_action );
@@ -164,9 +159,9 @@ Reference< XFastContextHandler > HyperLinkContext::createFastChildContext(
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_extLst:
+ case A_TOKEN( extLst ):
return xRet;
- case NMSP_DRAWINGML|XML_snd:
+ case A_TOKEN( snd ):
EmbeddedWAVAudioFile aAudio;
getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio );
break;
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 9f23cf466d30..2eb1ef8b4cdf 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -35,14 +35,13 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/tokens.hxx"
using namespace ::com::sun::star::drawing;
diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx
index a2cf4111a524..a200b60f9e4b 100644
--- a/oox/source/drawingml/linepropertiescontext.cxx
+++ b/oox/source/drawingml/linepropertiescontext.cxx
@@ -30,8 +30,6 @@
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -88,7 +86,7 @@ Reference< XFastContextHandler > LinePropertiesContext::createFastChildContext(
case A_TOKEN( round ):
case A_TOKEN( bevel ):
case A_TOKEN( miter ):
- mrLineProperties.moLineJoint = getToken( nElement );
+ mrLineProperties.moLineJoint = getBaseToken( nElement );
break;
case A_TOKEN( headEnd ): // CT_LineEndProperties
diff --git a/oox/source/drawingml/objectdefaultcontext.cxx b/oox/source/drawingml/objectdefaultcontext.cxx
index 69b9423a4abc..d233379f9b02 100644
--- a/oox/source/drawingml/objectdefaultcontext.cxx
+++ b/oox/source/drawingml/objectdefaultcontext.cxx
@@ -28,8 +28,6 @@
#include "oox/drawingml/objectdefaultcontext.hxx"
#include "oox/drawingml/spdefcontext.hxx"
#include "oox/drawingml/theme.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -48,11 +46,11 @@ Reference< XFastContextHandler > objectDefaultContext::createFastChildContext( s
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_spDef:
+ case A_TOKEN( spDef ):
return new spDefContext( *this, mrTheme.getSpDef() );
- case NMSP_DRAWINGML|XML_lnDef:
+ case A_TOKEN( lnDef ):
return new spDefContext( *this, mrTheme.getLnDef() );
- case NMSP_DRAWINGML|XML_txDef:
+ case A_TOKEN( txDef ):
return new spDefContext( *this, mrTheme.getTxDef() );
}
return 0;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index f0ae2ec2a7a3..61956c068deb 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -32,11 +32,15 @@
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/table/tableproperties.hxx"
-#include "oox/core/namespaces.hxx"
+#include "oox/drawingml/chart/chartconverter.hxx"
+#include "oox/drawingml/chart/chartspacefragment.hxx"
+#include "oox/drawingml/chart/chartspacemodel.hxx"
+#include "oox/vml/vmldrawing.hxx"
+#include "oox/vml/vmlshape.hxx"
+#include "oox/vml/vmlshapecontainer.hxx"
#include "oox/core/xmlfilterbase.hxx"
+#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include <tools/solar.h> // for the F_PI180 define
#include <com/sun/star/graphic/XGraphic.hpp>
@@ -45,6 +49,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -64,26 +69,6 @@ namespace oox { namespace drawingml {
// ============================================================================
-CreateShapeCallback::CreateShapeCallback( XmlFilterBase& rFilter ) :
- mrFilter( rFilter )
-{
-}
-
-CreateShapeCallback::~CreateShapeCallback()
-{
-}
-
-OUString CreateShapeCallback::onCreateXShape( const OUString& rServiceName, const Rectangle& )
-{
- return rServiceName;
-}
-
-void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Reference< XShapes >& ) const
-{
-}
-
-// ============================================================================
-
Shape::Shape( const sal_Char* pServiceName )
: mpLinePropertiesPtr( new LineProperties )
, mpFillPropertiesPtr( new FillProperties )
@@ -92,6 +77,7 @@ Shape::Shape( const sal_Char* pServiceName )
, mpMasterTextListStyle( new TextListStyle )
, mnSubType( 0 )
, mnSubTypeIndex( -1 )
+, meFrameType( FRAMETYPE_GENERIC )
, mnRotation( 0 )
, mbFlipH( false )
, mbFlipV( false )
@@ -101,6 +87,7 @@ Shape::Shape( const sal_Char* pServiceName )
msServiceName = OUString::createFromAscii( pServiceName );
setDefaults();
}
+
Shape::~Shape()
{
}
@@ -123,6 +110,39 @@ void Shape::setDefaults()
maShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 );
}
+::oox::vml::OleObjectInfo& Shape::setOleObjectType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setOleObjectType - multiple frame types" );
+ meFrameType = FRAMETYPE_OLEOBJECT;
+ mxOleObjectInfo.reset( new ::oox::vml::OleObjectInfo( true ) );
+ return *mxOleObjectInfo;
+}
+
+ChartShapeInfo& Shape::setChartType( bool bEmbedShapes )
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" );
+ meFrameType = FRAMETYPE_CHART;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" );
+ mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) );
+ return *mxChartShapeInfo;
+}
+
+void Shape::setDiagramType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setDiagramType - multiple frame types" );
+ meFrameType = FRAMETYPE_DIAGRAM;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" );
+ mnSubType = 0;
+}
+
+void Shape::setTableType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setTableType - multiple frame types" );
+ meFrameType = FRAMETYPE_TABLE;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.TableShape" );
+ mnSubType = 0;
+}
+
void Shape::setServiceName( const sal_Char* pServiceName )
{
if ( pServiceName )
@@ -137,7 +157,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const
}
void Shape::addShape(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
const awt::Rectangle* pShapeRect,
@@ -189,7 +209,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape )
// for group shapes, the following method is also adding each child
void Shape::addChildren(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ XmlFilterBase& rFilterBase,
Shape& rMaster,
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
@@ -247,7 +267,7 @@ void Shape::addChildren(
}
Reference< XShape > Shape::createAndInsert(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const rtl::OUString& rServiceName,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
@@ -256,11 +276,10 @@ Reference< XShape > Shape::createAndInsert(
{
awt::Size aSize( pShapeRect ? awt::Size( pShapeRect->Width, pShapeRect->Height ) : maSize );
awt::Point aPosition( pShapeRect ? awt::Point( pShapeRect->X, pShapeRect->Y ) : maPosition );
+ awt::Rectangle aShapeRectHmm( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 );
- OUString aServiceName = rServiceName;
- if( mxCreateCallback.get() )
- aServiceName = mxCreateCallback->onCreateXShape( aServiceName, awt::Rectangle( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 ) );
- sal_Bool bIsCustomShape = aServiceName == OUString::createFromAscii( "com.sun.star.drawing.CustomShape" );
+ OUString aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm );
+ sal_Bool bIsCustomShape = aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.CustomShape" ) );
basegfx::B2DHomMatrix aTransformation;
if( aSize.Width != 1 || aSize.Height != 1)
@@ -432,13 +451,6 @@ Reference< XShape > Shape::createAndInsert(
PropertyMap aShapeProperties;
PropertyMap::const_iterator aShapePropIter;
- if( mxCreateCallback.get() )
- {
- for ( aShapePropIter = mxCreateCallback->getShapeProperties().begin();
- aShapePropIter != mxCreateCallback->getShapeProperties().end(); aShapePropIter++ )
- aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second;
- }
-
// add properties from textbody to shape properties
if( mpTextBody.get() )
{
@@ -502,9 +514,8 @@ Reference< XShape > Shape::createAndInsert(
xLockable->removeActionLock();
}
- // use a callback for further processing on the XShape (e.g. charts)
- if( mxShape.is() && mxCreateCallback.get() )
- mxCreateCallback->onXShapeCreated( mxShape, rxShapes );
+ if( mxShape.is() )
+ finalizeXShape( rFilterBase, rxShapes );
return mxShape;
}
@@ -537,5 +548,77 @@ void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle
mpMasterTextListStyle = pMasterTextListStyle;
}
+OUString Shape::finalizeServiceName( XmlFilterBase& rFilter, const OUString& rServiceName, const Rectangle& rShapeRect )
+{
+ OUString aServiceName = rServiceName;
+ switch( meFrameType )
+ {
+ case FRAMETYPE_OLEOBJECT:
+ {
+ Size aOleSize( rShapeRect.Width, rShapeRect.Height );
+ if( rFilter.getOleObjectHelper().importOleObject( maShapeProperties, *mxOleObjectInfo, aOleSize ) )
+ aServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" );
+
+ // get the path to the representation graphic
+ OUString aGraphicPath;
+ if( mxOleObjectInfo->maShapeId.getLength() > 0 )
+ if( ::oox::vml::Drawing* pVmlDrawing = rFilter.getVmlDrawing() )
+ if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) )
+ aGraphicPath = pVmlShape->getGraphicPath();
+
+ // import and store the graphic
+ if( aGraphicPath.getLength() > 0 )
+ {
+ Reference< graphic::XGraphic > xGraphic = rFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath );
+ if( xGraphic.is() )
+ maShapeProperties[ PROP_Graphic ] <<= xGraphic;
+ }
+ }
+ break;
+
+ default:;
+ }
+ return aServiceName;
+}
+
+void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
+{
+ switch( meFrameType )
+ {
+ case FRAMETYPE_CHART:
+ {
+ OSL_ENSURE( mxChartShapeInfo->maFragmentPath.getLength() > 0, "Shape::finalizeXShape - missing chart fragment" );
+ if( mxShape.is() && (mxChartShapeInfo->maFragmentPath.getLength() > 0) ) try
+ {
+ // set the chart2 OLE class ID at the OLE shape
+ PropertySet aShapeProp( mxShape );
+ aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) );
+
+ // get the XModel interface of the embedded object from the OLE shape
+ Reference< frame::XModel > xDocModel;
+ aShapeProp.getProperty( xDocModel, PROP_Model );
+ Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
+
+ // load the chart data from the XML fragment
+ chart::ChartSpaceModel aModel;
+ rFilter.importFragment( new chart::ChartSpaceFragment( rFilter, mxChartShapeInfo->maFragmentPath, aModel ) );
+
+ // convert imported chart model to chart document
+ Reference< drawing::XShapes > xExternalPage;
+ if( !mxChartShapeInfo->mbEmbedShapes )
+ xExternalPage = rxShapes;
+ rFilter.getChartConverter().convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ break;
+
+ default:;
+ }
+}
+
+// ============================================================================
} }
diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx
index a5f3b1598447..d4781fdaa436 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -34,13 +34,11 @@
#include "oox/helper/attributelist.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -80,7 +78,7 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
// nvSpPr CT_ShapeNonVisual begin
// case XML_drElemPr:
diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index e1bd51f852ad..183302667066 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -37,8 +37,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -68,7 +66,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
case XML_cNvPr:
{
@@ -108,7 +106,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
xRet.set( new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
case XML_graphicFrame: // CT_GraphicalObjectFrame
- xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ), true ) );
+ xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ), true ) );
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx
index dd1814ac23cf..13fd8c421784 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -33,12 +33,10 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/transform2dcontext.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -68,17 +66,17 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
switch( aElementToken )
{
// CT_Transform2D
- case NMSP_DRAWINGML|XML_xfrm:
+ case A_TOKEN( xfrm ):
xRet.set( new Transform2DContext( *this, xAttribs, mrShape ) );
break;
// GeometryGroup
- case NMSP_DRAWINGML|XML_custGeom: // custom geometry "CT_CustomGeometry2D"
+ case A_TOKEN( custGeom ): // custom geometry "CT_CustomGeometry2D"
xRet.set( new CustomShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
break;
- case NMSP_DRAWINGML|XML_prstGeom: // preset geometry "CT_PresetGeometry2D"
+ case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D"
{
sal_Int32 nToken = xAttribs->getOptionalValueToken( XML_prst, 0 );
if ( nToken == XML_line )
@@ -90,24 +88,24 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
}
break;
- case NMSP_DRAWINGML|XML_prstTxWarp:
+ case A_TOKEN( prstTxWarp ):
xRet.set( new PresetTextShapeContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
break;
// CT_LineProperties
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
xRet.set( new LinePropertiesContext( *this, xAttribs, mrShape.getLineProperties() ) );
break;
// EffectPropertiesGroup
// todo not supported by core
- case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList
- case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer
+ case A_TOKEN( effectLst ): // CT_EffectList
+ case A_TOKEN( effectDag ): // CT_EffectContainer
break;
// todo
- case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D
- case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D
+ case A_TOKEN( scene3d ): // CT_Scene3D
+ case A_TOKEN( sp3d ): // CT_Shape3D
break;
}
diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx
index 13f15783e49b..a1ae5df43cda 100644
--- a/oox/source/drawingml/shapestylecontext.cxx
+++ b/oox/source/drawingml/shapestylecontext.cxx
@@ -28,9 +28,7 @@
#include "oox/drawingml/shapestylecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -67,12 +65,12 @@ Reference< XFastContextHandler > ShapeStyleContext::createFastChildContext( sal_
AttributeList aAttribs( rxAttributes );
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_lnRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_fillRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_effectRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_fontRef : // CT_FontReference
+ case A_TOKEN( lnRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( effectRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( fontRef ) : // CT_FontReference
{
- sal_Int32 nToken = getToken( aElementToken );
+ sal_Int32 nToken = getBaseToken( aElementToken );
ShapeStyleRef& rStyleRef = mrShape.getShapeStyleRefs()[ nToken ];
rStyleRef.mnThemedIdx = (nToken == XML_fontRef) ? aAttribs.getToken( XML_idx, XML_none ) : aAttribs.getInteger( XML_idx, 0 );
xRet.set( new ColorContext( *this, rStyleRef.maPhClr ) );
diff --git a/oox/source/drawingml/spdefcontext.cxx b/oox/source/drawingml/spdefcontext.cxx
index d85fe2ceb2bb..da86e031ddec 100644
--- a/oox/source/drawingml/spdefcontext.cxx
+++ b/oox/source/drawingml/spdefcontext.cxx
@@ -30,8 +30,6 @@
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/textbodypropertiescontext.hxx"
#include "oox/drawingml/textliststylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -51,22 +49,22 @@ Reference< XFastContextHandler > spDefContext::createFastChildContext( sal_Int32
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_spPr:
+ case A_TOKEN( spPr ):
{
xRet = new ShapePropertiesContext( *this, mrDefaultObject );
break;
}
- case NMSP_DRAWINGML|XML_bodyPr:
+ case A_TOKEN( bodyPr ):
{
TextBodyPtr xTextBody( new TextBody );
mrDefaultObject.setTextBody( xTextBody );
xRet = new TextBodyPropertiesContext( *this, xAttribs, xTextBody->getTextProperties() );
break;
}
- case NMSP_DRAWINGML|XML_lstStyle:
+ case A_TOKEN( lstStyle ):
xRet.set( new TextListStyleContext( *this, *mrDefaultObject.getMasterTextListStyle() ) );
break;
- case NMSP_DRAWINGML|XML_style:
+ case A_TOKEN( style ):
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
index c9be0287a7cc..075e8ded9b31 100644
--- a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
+++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
@@ -29,9 +29,8 @@
#include "oox/drawingml/table/tablebackgroundstylecontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -60,14 +59,14 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken,
switch( aElementToken )
{
// EG_ThemeableFillStyle (choice)
- case NMSP_DRAWINGML|XML_fill: // CT_FillProperties
+ case A_TOKEN( fill ): // CT_FillProperties
{
boost::shared_ptr< FillProperties >& rxFillProperties = mrTableStyle.getBackgroundFillProperties();
rxFillProperties.reset( new FillProperties );
xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) );
}
break;
- case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ): // CT_StyleMatrixReference
{
ShapeStyleRef& rStyleRef = mrTableStyle.getBackgroundFillStyleRef();
rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 );
@@ -76,9 +75,9 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken,
break;
// EG_ThemeableEffectStyle (choice)
- case NMSP_DRAWINGML|XML_effect: // CT_EffectProperties
+ case A_TOKEN( effect ): // CT_EffectProperties
break;
- case NMSP_DRAWINGML|XML_effectRef: // CT_StyleMatrixReference
+ case A_TOKEN( effectRef ): // CT_StyleMatrixReference
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index ee3ac495f4d6..f381b20d5383 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -28,10 +28,7 @@
#include "oox/drawingml/table/tablecell.hxx"
#include "oox/drawingml/table/tableproperties.hxx"
#include "oox/drawingml/textbody.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include "oox/helper/propertyset.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
diff --git a/oox/source/drawingml/table/tablecellcontext.cxx b/oox/source/drawingml/table/tablecellcontext.cxx
index 68e3cd3a864a..844f134c3e85 100644
--- a/oox/source/drawingml/table/tablecellcontext.cxx
+++ b/oox/source/drawingml/table/tablecellcontext.cxx
@@ -31,7 +31,6 @@
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
using namespace ::oox::core;
@@ -66,7 +65,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_txBody: // CT_TextBody
+ case A_TOKEN( txBody ): // CT_TextBody
{
oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
mrTableCell.setTextBody( xTextBody );
@@ -74,7 +73,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
}
break;
- case NMSP_DRAWINGML|XML_tcPr: // CT_TableCellProperties
+ case A_TOKEN( tcPr ): // CT_TableCellProperties
{
AttributeList aAttribs( xAttribs );
mrTableCell.setLeftMargin( aAttribs.getInteger( XML_marL, 91440 ) );
@@ -87,28 +86,28 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
mrTableCell.setHorzOverflowToken( xAttribs->getOptionalValueToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType
}
break;
- case NMSP_DRAWINGML|XML_lnL:
+ case A_TOKEN( lnL ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesLeft ) );
break;
- case NMSP_DRAWINGML|XML_lnR:
+ case A_TOKEN( lnR ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesRight ) );
break;
- case NMSP_DRAWINGML|XML_lnT:
+ case A_TOKEN( lnT ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTop ) );
break;
- case NMSP_DRAWINGML|XML_lnB:
+ case A_TOKEN( lnB ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottom ) );
break;
- case NMSP_DRAWINGML|XML_lnTlToBr:
+ case A_TOKEN( lnTlToBr ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTopLeftToBottomRight ) );
break;
- case NMSP_DRAWINGML|XML_lnBlToTr:
+ case A_TOKEN( lnBlToTr ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottomLeftToTopRight ) );
break;
- case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D
+ case A_TOKEN( cell3D ): // CT_Cell3D
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
default:
diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx
index b194fdc9ee26..f7e7af620428 100644
--- a/oox/source/drawingml/table/tablecontext.cxx
+++ b/oox/source/drawingml/table/tablecontext.cxx
@@ -32,7 +32,6 @@
#include "oox/drawingml/table/tableproperties.hxx"
#include "oox/drawingml/table/tablestylecontext.hxx"
#include "oox/drawingml/table/tablerowcontext.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star;
@@ -44,8 +43,7 @@ TableContext::TableContext( ContextHandler& rParent, ShapePtr pShapePtr )
: ShapeContext( rParent, ShapePtr(), pShapePtr )
, mrTableProperties( *pShapePtr->getTableProperties().get() )
{
- pShapePtr->setServiceName( "com.sun.star.drawing.TableShape" );
- pShapePtr->setSubType( 0 );
+ pShapePtr->setTableType();
}
TableContext::~TableContext()
@@ -60,7 +58,7 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblPr: // CT_TableProperties
+ case A_TOKEN( tblPr ): // CT_TableProperties
{
AttributeList aAttribs( xAttribs );
mrTableProperties.isRtl() = aAttribs.getBool( XML_rtl, sal_False );
@@ -72,26 +70,26 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe
mrTableProperties.isBandCol() = aAttribs.getBool( XML_bandCol, sal_False );
}
break;
- case NMSP_DRAWINGML|XML_tableStyle: // CT_TableStyle
+ case A_TOKEN( tableStyle ): // CT_TableStyle
{
boost::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle();
rTableStyle.reset( new TableStyle() );
xRet = new TableStyleContext( *this, xAttribs, *rTableStyle );
}
break;
- case NMSP_DRAWINGML|XML_tableStyleId: // ST_Guid
+ case A_TOKEN( tableStyleId ): // ST_Guid
xRet.set( new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() ) );
break;
- case NMSP_DRAWINGML|XML_tblGrid: // CT_TableGrid
+ case A_TOKEN( tblGrid ): // CT_TableGrid
break;
- case NMSP_DRAWINGML|XML_gridCol: // CT_TableCol
+ case A_TOKEN( gridCol ): // CT_TableCol
{
std::vector< sal_Int32 >& rvTableGrid( mrTableProperties.getTableGrid() );
rvTableGrid.push_back( xAttribs->getOptionalValue( XML_w ).toInt32() );
}
break;
- case NMSP_DRAWINGML|XML_tr: // CT_TableRow
+ case A_TOKEN( tr ): // CT_TableRow
{
std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() );
rvTableRows.resize( rvTableRows.size() + 1 );
diff --git a/oox/source/drawingml/table/tablepartstylecontext.cxx b/oox/source/drawingml/table/tablepartstylecontext.cxx
index 92e314d6afa7..1d48cbcf2a18 100644
--- a/oox/source/drawingml/table/tablepartstylecontext.cxx
+++ b/oox/source/drawingml/table/tablepartstylecontext.cxx
@@ -30,8 +30,7 @@
#include "oox/drawingml/table/tablepartstylecontext.hxx"
#include "oox/drawingml/table/tablestyletextstylecontext.hxx"
#include "oox/drawingml/table/tablestylecellstylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -59,10 +58,10 @@ TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tcTxStyle: // CT_TableStyleTextStyle
+ case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle
xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) );
break;
- case NMSP_DRAWINGML|XML_tcStyle: // CT_TableStyleCellStyle
+ case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle
xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) );
break;
}
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 136754fbccc3..e0d0ac91c2ab 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -33,10 +33,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/XMergeableCellRange.hpp>
#include <com/sun/star/table/BorderLine.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/propertyset.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/table/tablerow.cxx b/oox/source/drawingml/table/tablerow.cxx
index 8986a6e35d08..3c4af56a5d42 100644
--- a/oox/source/drawingml/table/tablerow.cxx
+++ b/oox/source/drawingml/table/tablerow.cxx
@@ -27,8 +27,6 @@
#include "oox/drawingml/table/tablerow.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include "oox/helper/propertyset.hxx"
diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx
index 7e0ff052bb4e..1a6c38167a8d 100644
--- a/oox/source/drawingml/table/tablerowcontext.cxx
+++ b/oox/source/drawingml/table/tablerowcontext.cxx
@@ -30,8 +30,6 @@
#include "oox/drawingml/table/tablerowcontext.hxx"
#include "oox/drawingml/table/tablecellcontext.hxx"
#include "oox/drawingml/table/tablerow.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star;
@@ -58,14 +56,14 @@ TableRowContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::R
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tc: // CT_TableCell
+ case A_TOKEN( tc ): // CT_TableCell
{
std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells();
rvTableCells.resize( rvTableCells.size() + 1 );
xRet.set( new TableCellContext( *this, xAttribs, rvTableCells.back() ) );
}
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
default:
break;
}
diff --git a/oox/source/drawingml/table/tablestylecellstylecontext.cxx b/oox/source/drawingml/table/tablestylecellstylecontext.cxx
index 47d747bf8b20..56127b0c049c 100644
--- a/oox/source/drawingml/table/tablestylecellstylecontext.cxx
+++ b/oox/source/drawingml/table/tablestylecellstylecontext.cxx
@@ -30,9 +30,8 @@
#include "oox/drawingml/table/tablestylecellstylecontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -61,20 +60,20 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
AttributeList aAttribs( xAttribs );
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tcBdr: // CT_TableCellBorderStyle
+ case A_TOKEN( tcBdr ): // CT_TableCellBorderStyle
break;
- case NMSP_DRAWINGML|XML_left: // CT_ThemeableLineStyle
- case NMSP_DRAWINGML|XML_right:
- case NMSP_DRAWINGML|XML_top:
- case NMSP_DRAWINGML|XML_bottom:
- case NMSP_DRAWINGML|XML_insideH:
- case NMSP_DRAWINGML|XML_insideV:
- case NMSP_DRAWINGML|XML_tl2br:
- case NMSP_DRAWINGML|XML_tr2bl:
- mnLineType = getToken( aElementToken );
+ case A_TOKEN( left ): // CT_ThemeableLineStyle
+ case A_TOKEN( right ):
+ case A_TOKEN( top ):
+ case A_TOKEN( bottom ):
+ case A_TOKEN( insideH ):
+ case A_TOKEN( insideV ):
+ case A_TOKEN( tl2br ):
+ case A_TOKEN( tr2bl ):
+ mnLineType = getBaseToken( aElementToken );
break;
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
{
if ( mnLineType != XML_none )
{
@@ -85,7 +84,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
}
break;
- case NMSP_DRAWINGML|XML_lnRef:
+ case A_TOKEN( lnRef ):
{
if ( mnLineType != XML_none )
{
@@ -97,14 +96,14 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
break;
// EG_ThemeableFillStyle (choice)
- case NMSP_DRAWINGML|XML_fill: // CT_FillProperties
+ case A_TOKEN( fill ): // CT_FillProperties
{
FillPropertiesPtr& rxFillProperties = mrTableStylePart.getFillProperties();
rxFillProperties.reset( new FillProperties );
xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) );
}
break;
- case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ): // CT_StyleMatrixReference
{
ShapeStyleRef& rStyleRef = mrTableStylePart.getStyleRefs()[ XML_fillRef ];
rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 );
@@ -112,7 +111,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
break;
- case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D
+ case A_TOKEN( cell3D ): // CT_Cell3D
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablestylecontext.cxx b/oox/source/drawingml/table/tablestylecontext.cxx
index 4d0b945d3d72..aee23eaf9c7b 100644
--- a/oox/source/drawingml/table/tablestylecontext.cxx
+++ b/oox/source/drawingml/table/tablestylecontext.cxx
@@ -30,8 +30,7 @@
#include "oox/drawingml/table/tablestylecontext.hxx"
#include "oox/drawingml/table/tablebackgroundstylecontext.hxx"
#include "oox/drawingml/table/tablepartstylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -61,49 +60,49 @@ TableStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblBg: // CT_TableBackgroundStyle
+ case A_TOKEN( tblBg ): // CT_TableBackgroundStyle
xRet = new TableBackgroundStyleContext( *this, mrTableStyle );
break;
- case NMSP_DRAWINGML|XML_wholeTbl: // CT_TablePartStyle
+ case A_TOKEN( wholeTbl ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getWholeTbl() );
break;
- case NMSP_DRAWINGML|XML_band1H: // CT_TablePartStyle
+ case A_TOKEN( band1H ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1H() );
break;
- case NMSP_DRAWINGML|XML_band2H: // CT_TablePartStyle
+ case A_TOKEN( band2H ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2H() );
break;
- case NMSP_DRAWINGML|XML_band1V: // CT_TablePartStyle
+ case A_TOKEN( band1V ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1V() );
break;
- case NMSP_DRAWINGML|XML_band2V: // CT_TablePartStyle
+ case A_TOKEN( band2V ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2V() );
break;
- case NMSP_DRAWINGML|XML_lastCol: // CT_TablePartStyle
+ case A_TOKEN( lastCol ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getLastCol() );
break;
- case NMSP_DRAWINGML|XML_firstCol: // CT_TablePartStyle
+ case A_TOKEN( firstCol ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstCol() );
break;
- case NMSP_DRAWINGML|XML_lastRow: // CT_TablePartStyle
+ case A_TOKEN( lastRow ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getLastRow() );
break;
- case NMSP_DRAWINGML|XML_seCell: // CT_TablePartStyle
+ case A_TOKEN( seCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getSeCell() );
break;
- case NMSP_DRAWINGML|XML_swCell: // CT_TablePartStyle
+ case A_TOKEN( swCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getSwCell() );
break;
- case NMSP_DRAWINGML|XML_firstRow: // CT_TablePartStyle
+ case A_TOKEN( firstRow ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstRow() );
break;
- case NMSP_DRAWINGML|XML_neCell: // CT_TablePartStyle
+ case A_TOKEN( neCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getNeCell() );
break;
- case NMSP_DRAWINGML|XML_nwCell: // CT_TablePartStyle
+ case A_TOKEN( nwCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getNwCell() );
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
index e90554409d4d..7b837d27e826 100644
--- a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
+++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
@@ -62,10 +62,10 @@ Reference< XFastContextHandler > TableStyleListFragmentHandler::createFastChildC
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblStyleLst: // CT_TableStyleList
+ case A_TOKEN( tblStyleLst ): // CT_TableStyleList
mrTableStyleList.getDefaultStyleId() = xAttribs->getOptionalValue( XML_def );
break;
- case NMSP_DRAWINGML|XML_tblStyle: // CT_TableStyle
+ case A_TOKEN( tblStyle ): // CT_TableStyle
std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles();
rTableStyles.resize( rTableStyles.size() + 1 );
xRet = new TableStyleContext( *this, xAttribs, rTableStyles.back() );
diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx
index f8e700e5fccd..b4a68fd488cd 100644
--- a/oox/source/drawingml/table/tablestylepart.cxx
+++ b/oox/source/drawingml/table/tablestylepart.cxx
@@ -27,8 +27,6 @@
#include "oox/drawingml/table/tablestylepart.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
index ec117f4ac3c1..7c04e3293eb1 100644
--- a/oox/source/drawingml/table/tablestyletextstylecontext.cxx
+++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
@@ -29,9 +29,8 @@
#include "oox/drawingml/table/tablestyletextstylecontext.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -73,23 +72,23 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
switch( aElementToken )
{
// EG_ThemeableFontStyles (choice)
- case NMSP_DRAWINGML|XML_font: // CT_FontCollection
+ case A_TOKEN( font ): // CT_FontCollection
xRet.set( this );
break;
- case NMSP_DRAWINGML|XML_ea: // CT_TextFont
+ case A_TOKEN( ea ): // CT_TextFont
mrTableStylePart.getAsianFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_cs: // CT_TextFont
+ case A_TOKEN( cs ): // CT_TextFont
mrTableStylePart.getComplexFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_sym: // CT_TextFont
+ case A_TOKEN( sym ): // CT_TextFont
mrTableStylePart.getSymbolFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_latin: // CT_TextFont
+ case A_TOKEN( latin ): // CT_TextFont
mrTableStylePart.getLatinFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_fontRef: // CT_FontReference
+ case A_TOKEN( fontRef ): // CT_FontReference
{
ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ];
rFontStyle.mnThemedIdx = aAttribs.getToken( XML_idx, XML_none );
@@ -97,7 +96,7 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 8de730849b24..8d695e295fd4 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -33,8 +33,6 @@
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/drawingml/textfield.hxx"
#include "oox/drawingml/textfieldcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -69,7 +67,7 @@ TextParagraphContext::TextParagraphContext( ContextHandler& rParent, TextParagra
// --------------------------------------------------------------------
void TextParagraphContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException)
{
- if( aElementToken == (NMSP_DRAWINGML|XML_p) )
+ if( aElementToken == (A_TOKEN( p )) )
{
}
}
@@ -83,14 +81,14 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
// EG_TextRun
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_r: // "CT_RegularTextRun" Regular Text Run.
+ case A_TOKEN( r ): // "CT_RegularTextRun" Regular Text Run.
{
TextRunPtr pRun( new TextRun );
mrParagraph.addRun( pRun );
xRet.set( new RegularTextRunContext( *this, pRun ) );
break;
}
- case NMSP_DRAWINGML|XML_br: // "CT_TextLineBreak" Soft return line break (vertical tab).
+ case A_TOKEN( br ): // "CT_TextLineBreak" Soft return line break (vertical tab).
{
TextRunPtr pRun( new TextRun );
pRun->setLineBreak();
@@ -98,17 +96,17 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
xRet.set( new RegularTextRunContext( *this, pRun ) );
break;
}
- case NMSP_DRAWINGML|XML_fld: // "CT_TextField" Text Field.
+ case A_TOKEN( fld ): // "CT_TextField" Text Field.
{
TextFieldPtr pField( new TextField );
mrParagraph.addRun( pField );
xRet.set( new TextFieldContext( *this, xAttribs, *pField ) );
break;
}
- case NMSP_DRAWINGML|XML_pPr:
+ case A_TOKEN( pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) );
break;
- case NMSP_DRAWINGML|XML_endParaRPr:
+ case A_TOKEN( endParaRPr ):
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
break;
}
@@ -130,12 +128,12 @@ void RegularTextRunContext::endFastElement( sal_Int32 aElementToken ) throw (SAX
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_t:
+ case A_TOKEN( t ):
{
mbIsInText = false;
break;
}
- case NMSP_DRAWINGML|XML_r:
+ case A_TOKEN( r ):
{
break;
}
@@ -161,10 +159,10 @@ Reference< XFastContextHandler > RegularTextRunContext::createFastChildContext(
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_rPr: // "CT_TextCharPropertyBag" The text char properties of this text run.
+ case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run.
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mpRunPtr->getTextCharacterProperties() ) );
break;
- case NMSP_DRAWINGML|XML_t: // "xsd:string" minOccurs="1" The actual text string.
+ case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string.
mbIsInText = true;
break;
}
@@ -194,13 +192,13 @@ Reference< XFastContextHandler > TextBodyContext::createFastChildContext( sal_In
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_bodyPr: // CT_TextBodyPropertyBag
+ case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag
xRet.set( new TextBodyPropertiesContext( *this, xAttribs, mrTextBody.getTextProperties() ) );
break;
- case NMSP_DRAWINGML|XML_lstStyle: // CT_TextListStyle
+ case A_TOKEN( lstStyle ): // CT_TextListStyle
xRet.set( new TextListStyleContext( *this, mrTextBody.getTextListStyle() ) );
break;
- case NMSP_DRAWINGML|XML_p: // CT_TextParagraph
+ case A_TOKEN( p ): // CT_TextParagraph
xRet.set( new TextParagraphContext( *this, mrTextBody.addParagraph() ) );
break;
}
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 6cec7643e58e..4339c93aa0ae 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -27,8 +27,7 @@
#include "oox/drawingml/textbodyproperties.hxx"
#include <com/sun/star/text/WritingMode.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
namespace drawingml {
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 668266f2f679..f22258075e16 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -36,9 +36,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -156,27 +153,27 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte
switch( aElementToken )
{
// Sequence
- case NMSP_DRAWINGML|XML_prstTxWarp: // CT_PresetTextShape
- case NMSP_DRAWINGML|XML_prot: // CT_TextProtectionProperty
+ case A_TOKEN( prstTxWarp ): // CT_PresetTextShape
+ case A_TOKEN( prot ): // CT_TextProtectionProperty
break;
// EG_TextAutofit
- case NMSP_DRAWINGML|XML_noAutofit:
+ case A_TOKEN( noAutofit ):
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit
break;
- case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit
+ case A_TOKEN( normAutofit ): // CT_TextNormalAutofit
mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= true;
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false;
break;
- case NMSP_DRAWINGML|XML_spAutoFit:
+ case A_TOKEN( spAutoFit ):
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= true;
break;
- case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D
+ case A_TOKEN( scene3d ): // CT_Scene3D
// EG_Text3D
- case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D
- case NMSP_DRAWINGML|XML_flatTx: // CT_FlatText
+ case A_TOKEN( sp3d ): // CT_Shape3D
+ case A_TOKEN( flatTx ): // CT_FlatText
break;
}
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 9750375f97dd..61333535c38f 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -33,8 +33,7 @@
#include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
using ::oox::core::XmlFilterBase;
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index cfba04a7b44b..f3be44773a39 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -32,10 +32,8 @@
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/textparagraphproperties.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/relations.hxx"
#include "hyperlinkcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -76,21 +74,21 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
// ST_TextNonNegativePoint
const OUString sCharKerning( CREATE_OUSTRING( "CharKerning" ) );
- //case NMSP_DRAWINGML|XML_kern:
+ //case A_TOKEN( kern ):
// ST_TextLanguageID
OUString sAltLang = rXAttributes->getOptionalValue( XML_altLang );
- case NMSP_DRAWINGML|XML_kumimoji: // xsd:boolean
+ case A_TOKEN( kumimoji ): // xsd:boolean
break;
- case NMSP_DRAWINGML|XML_spc: // ST_TextPoint
- case NMSP_DRAWINGML|XML_normalizeH: // xsd:boolean
- case NMSP_DRAWINGML|XML_baseline: // ST_Percentage
- case NMSP_DRAWINGML|XML_noProof: // xsd:boolean
- case NMSP_DRAWINGML|XML_dirty: // xsd:boolean
- case NMSP_DRAWINGML|XML_err: // xsd:boolean
- case NMSP_DRAWINGML|XML_smtClean: // xsd:boolean
- case NMSP_DRAWINGML|XML_smtId: // xsd:unsignedInt
+ case A_TOKEN( spc ): // ST_TextPoint
+ case A_TOKEN( normalizeH ): // xsd:boolean
+ case A_TOKEN( baseline ): // ST_Percentage
+ case A_TOKEN( noProof ): // xsd:boolean
+ case A_TOKEN( dirty ): // xsd:boolean
+ case A_TOKEN( err ): // xsd:boolean
+ case A_TOKEN( smtClean ): // xsd:boolean
+ case A_TOKEN( smtId ): // xsd:unsignedInt
break;
*/
@@ -115,56 +113,56 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild
switch( aElementToken )
{
// TODO unsupported yet
-// case NMSP_DRAWINGML|XML_ln: // CT_LineProperties
+// case A_TOKEN( ln ): // CT_LineProperties
// xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maTextOutlineProperties ) );
// break;
- case NMSP_DRAWINGML|XML_solidFill: // EG_FillProperties
+ case A_TOKEN( solidFill ): // EG_FillProperties
xRet.set( new ColorContext( *this, mrTextCharacterProperties.maCharColor ) );
break;
// EG_EffectProperties
- case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer 5.1.10.25
- case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList 5.1.10.26
+ case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25
+ case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26
break;
- case NMSP_DRAWINGML|XML_highlight: // CT_Color
+ case A_TOKEN( highlight ): // CT_Color
xRet.set( new ColorContext( *this, mrTextCharacterProperties.maHighlightColor ) );
break;
// EG_TextUnderlineLine
- case NMSP_DRAWINGML|XML_uLnTx: // CT_TextUnderlineLineFollowText
+ case A_TOKEN( uLnTx ): // CT_TextUnderlineLineFollowText
mrTextCharacterProperties.moUnderlineLineFollowText = true;
break;
// TODO unsupported yet
-// case NMSP_DRAWINGML|XML_uLn: // CT_LineProperties
+// case A_TOKEN( uLn ): // CT_LineProperties
// xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maUnderlineProperties ) );
// break;
// EG_TextUnderlineFill
- case NMSP_DRAWINGML|XML_uFillTx: // CT_TextUnderlineFillFollowText
+ case A_TOKEN( uFillTx ): // CT_TextUnderlineFillFollowText
mrTextCharacterProperties.moUnderlineFillFollowText = true;
break;
- case NMSP_DRAWINGML|XML_uFill: // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported)
+ case A_TOKEN( uFill ): // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported)
xRet.set( new SimpleFillPropertiesContext( *this, mrTextCharacterProperties.maUnderlineColor ) );
break;
// CT_FontCollection
- case NMSP_DRAWINGML|XML_latin: // CT_TextFont
+ case A_TOKEN( latin ): // CT_TextFont
mrTextCharacterProperties.maLatinFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_ea: // CT_TextFont
+ case A_TOKEN( ea ): // CT_TextFont
mrTextCharacterProperties.maAsianFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_cs: // CT_TextFont
+ case A_TOKEN( cs ): // CT_TextFont
mrTextCharacterProperties.maComplexFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_sym: // CT_TextFont
+ case A_TOKEN( sym ): // CT_TextFont
mrTextCharacterProperties.maSymbolFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_hlinkClick: // CT_Hyperlink
- case NMSP_DRAWINGML|XML_hlinkMouseOver: // CT_Hyperlink
+ case A_TOKEN( hlinkClick ): // CT_Hyperlink
+ case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) );
break;
}
diff --git a/oox/source/drawingml/textfieldcontext.cxx b/oox/source/drawingml/textfieldcontext.cxx
index 2c993af562bf..4e9f576a0ca9 100644
--- a/oox/source/drawingml/textfieldcontext.cxx
+++ b/oox/source/drawingml/textfieldcontext.cxx
@@ -29,8 +29,6 @@
#include "oox/drawingml/textparagraphpropertiescontext.hxx"
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
#include "oox/drawingml/textfield.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -52,7 +50,7 @@ TextFieldContext::TextFieldContext( ContextHandler& rParent,
void TextFieldContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException)
{
- if( aElementToken == (NMSP_DRAWINGML|XML_t) )
+ if( aElementToken == (A_TOKEN( t )) )
{
mbIsInText = false;
}
@@ -72,13 +70,13 @@ Reference< XFastContextHandler > TextFieldContext::createFastChildContext( sal_I
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_rPr:
+ case A_TOKEN( rPr ):
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrTextField.getTextCharacterProperties() ) );
break;
- case NMSP_DRAWINGML|XML_pPr:
+ case A_TOKEN( pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrTextField.getTextParagraphProperties() ) );
break;
- case NMSP_DRAWINGML|XML_t:
+ case A_TOKEN( t ):
mbIsInText = true;
break;
}
diff --git a/oox/source/drawingml/textfont.cxx b/oox/source/drawingml/textfont.cxx
index 8d58787e544a..b4f9d359fb14 100644
--- a/oox/source/drawingml/textfont.cxx
+++ b/oox/source/drawingml/textfont.cxx
@@ -31,7 +31,6 @@
#include "oox/drawingml/theme.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using ::oox::core::XmlFilterBase;
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index 901db49802d9..8a491076909f 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -65,15 +65,4 @@ void TextListStyle::apply( const TextListStyle& rTextListStyle )
applyStyleList( rTextListStyle.getListStyle(), getListStyle() );
}
-#if OSL_DEBUG_LEVEL > 0
-void TextListStyle::dump( int nLevels )
-{
- for ( int i = 0; i < nLevels; i++ )
- {
- OSL_TRACE("level: %d", i);
- maListStyle[ i ]->dump();
- }
-}
-#endif
-
} }
diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx
index 693957490579..21afc698d730 100644
--- a/oox/source/drawingml/textliststylecontext.cxx
+++ b/oox/source/drawingml/textliststylecontext.cxx
@@ -27,9 +27,7 @@
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/drawingml/textparagraphpropertiescontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -64,40 +62,40 @@ Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( s
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_defPPr: // CT_TextParagraphProperties
+ case A_TOKEN( defPPr ): // CT_TextParagraphProperties
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_outline1pPr:
+ case A_TOKEN( outline1pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_outline2pPr:
+ case A_TOKEN( outline2pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl1pPr:
+ case A_TOKEN( lvl1pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl2pPr:
+ case A_TOKEN( lvl2pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl3pPr:
+ case A_TOKEN( lvl3pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl4pPr:
+ case A_TOKEN( lvl4pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl5pPr:
+ case A_TOKEN( lvl5pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl6pPr:
+ case A_TOKEN( lvl6pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl7pPr:
+ case A_TOKEN( lvl7pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl8pPr:
+ case A_TOKEN( lvl8pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl9pPr:
+ case A_TOKEN( lvl9pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) );
break;
}
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 2f5954168d37..cd969874513e 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -37,11 +37,8 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 3c41fef69a76..eb888867556b 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -34,11 +34,8 @@
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
#include "textspacingcontext.hxx"
#include "texttabstoplistcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -187,49 +184,49 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_lnSpc: // CT_TextSpacing
+ case A_TOKEN( lnSpc ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, maLineSpacing ) );
break;
- case NMSP_DRAWINGML|XML_spcBef: // CT_TextSpacing
+ case A_TOKEN( spcBef ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, mrSpaceBefore ) );
break;
- case NMSP_DRAWINGML|XML_spcAft: // CT_TextSpacing
+ case A_TOKEN( spcAft ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, mrSpaceAfter ) );
break;
// EG_TextBulletColor
- case NMSP_DRAWINGML|XML_buClrTx: // CT_TextBulletColorFollowText ???
+ case A_TOKEN( buClrTx ): // CT_TextBulletColorFollowText ???
mrBulletList.mbBulletColorFollowText <<= sal_True;
break;
- case NMSP_DRAWINGML|XML_buClr: // CT_Color
+ case A_TOKEN( buClr ): // CT_Color
xRet.set( new ColorContext( *this, *mrBulletList.maBulletColorPtr ) );
break;
// EG_TextBulletSize
- case NMSP_DRAWINGML|XML_buSzTx: // CT_TextBulletSizeFollowText
+ case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText
mrBulletList.setBulletSize(100);
break;
- case NMSP_DRAWINGML|XML_buSzPct: // CT_TextBulletSizePercent
+ case A_TOKEN( buSzPct ): // CT_TextBulletSizePercent
mrBulletList.setBulletSize( static_cast<sal_Int16>( GetPercent( rXAttributes->getOptionalValue( XML_val ) ) / 1000 ) );
break;
- case NMSP_DRAWINGML|XML_buSzPts: // CT_TextBulletSizePoint
+ case A_TOKEN( buSzPts ): // CT_TextBulletSizePoint
mrBulletList.setBulletSize(0);
mrBulletList.setFontSize( static_cast<sal_Int16>(GetTextSize( rXAttributes->getOptionalValue( XML_val ) ) ) );
break;
// EG_TextBulletTypeface
- case NMSP_DRAWINGML|XML_buFontTx: // CT_TextBulletTypefaceFollowText
+ case A_TOKEN( buFontTx ): // CT_TextBulletTypefaceFollowText
mrBulletList.mbBulletFontFollowText <<= sal_True;
break;
- case NMSP_DRAWINGML|XML_buFont: // CT_TextFont
+ case A_TOKEN( buFont ): // CT_TextFont
mrBulletList.maBulletFont.setAttributes( aAttribs );
break;
// EG_TextBullet
- case NMSP_DRAWINGML|XML_buNone: // CT_TextNoBullet
+ case A_TOKEN( buNone ): // CT_TextNoBullet
mrBulletList.setNone();
break;
- case NMSP_DRAWINGML|XML_buAutoNum: // CT_TextAutonumberBullet
+ case A_TOKEN( buAutoNum ): // CT_TextAutonumberBullet
{
AttributeList attribs( rXAttributes );
try {
@@ -252,7 +249,7 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
}
break;
}
- case NMSP_DRAWINGML|XML_buChar: // CT_TextCharBullet
+ case A_TOKEN( buChar ): // CT_TextCharBullet
try {
mrBulletList.setBulletChar( rXAttributes->getValue( XML_char ) );
}
@@ -261,17 +258,17 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
OSL_TRACE("OOX: SAXException in XML_buChar");
}
break;
- case NMSP_DRAWINGML|XML_buBlip: // CT_TextBlipBullet
+ case A_TOKEN( buBlip ): // CT_TextBlipBullet
{
mxBlipProps.reset( new BlipFillProperties );
xRet.set( new BlipFillContext( *this, rXAttributes, *mxBlipProps ) );
}
break;
- case NMSP_DRAWINGML|XML_tabLst: // CT_TextTabStopList
+ case A_TOKEN( tabLst ): // CT_TextTabStopList
xRet.set( new TextTabStopListContext( *this, maTabList ) );
break;
- case NMSP_DRAWINGML|XML_defRPr: // CT_TextCharacterProperties
+ case A_TOKEN( defRPr ): // CT_TextCharacterProperties
xRet.set( new TextCharacterPropertiesContext( *this, rXAttributes, mrTextParagraphProperties.getTextCharacterProperties() ) );
break;
}
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index cb8304b76d04..1e435defaa2d 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -35,7 +35,6 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "properties.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star::uno;
diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx
index 6bc6b79497d6..5eb5f3d77f82 100644
--- a/oox/source/drawingml/textspacingcontext.cxx
+++ b/oox/source/drawingml/textspacingcontext.cxx
@@ -27,10 +27,7 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/textspacing.hxx"
-#include "oox/core/namespaces.hxx"
#include "textspacingcontext.hxx"
-#include "tokens.hxx"
-
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
@@ -52,17 +49,17 @@ namespace oox { namespace drawingml {
}
Reference< XFastContextHandler > TextSpacingContext::createFastChildContext( ::sal_Int32 aElement,
- const Reference< XFastAttributeList >& xAttribs )
+ const Reference< XFastAttributeList >& xAttribs )
throw ( SAXException, RuntimeException )
{
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_spcPct:
+ case A_TOKEN( spcPct ):
maSpacing.nUnit = TextSpacing::PERCENT;
maSpacing.nValue = GetPercent( xAttribs->getValue( XML_val ) );
break;
- case NMSP_DRAWINGML|XML_spcPts:
+ case A_TOKEN( spcPts ):
maSpacing.nUnit = TextSpacing::POINTS;
maSpacing.nValue = GetTextSpacingPoint( xAttribs->getValue( XML_val ) );
break;
diff --git a/oox/source/drawingml/texttabstoplistcontext.cxx b/oox/source/drawingml/texttabstoplistcontext.cxx
index 1a8affa898bb..78248fd0b6f7 100644
--- a/oox/source/drawingml/texttabstoplistcontext.cxx
+++ b/oox/source/drawingml/texttabstoplistcontext.cxx
@@ -30,10 +30,8 @@
#include <rtl/ustring.hxx>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "texttabstoplistcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -66,7 +64,7 @@ namespace oox { namespace drawingml {
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_tab:
+ case A_TOKEN( tab ):
{
OUString sValue;
TabStop aTabStop;
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index 59245201eb61..b37ccdbaf13c 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -26,7 +26,6 @@
************************************************************************/
#include "oox/drawingml/theme.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx
index 7e8b5177498f..a27afdbc0ea3 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -32,9 +32,7 @@
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/theme.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -67,12 +65,12 @@ Reference< XFastContextHandler > FillStyleListContext::createFastChildContext( s
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_noFill:
- case NMSP_DRAWINGML|XML_solidFill:
- case NMSP_DRAWINGML|XML_gradFill:
- case NMSP_DRAWINGML|XML_blipFill:
- case NMSP_DRAWINGML|XML_pattFill:
- case NMSP_DRAWINGML|XML_grpFill:
+ case A_TOKEN( noFill ):
+ case A_TOKEN( solidFill ):
+ case A_TOKEN( gradFill ):
+ case A_TOKEN( blipFill ):
+ case A_TOKEN( pattFill ):
+ case A_TOKEN( grpFill ):
mrFillStyleList.push_back( FillPropertiesPtr( new FillProperties ) );
return FillPropertiesContext::createFillContext( *this, nElement, xAttribs, *mrFillStyleList.back() );
}
@@ -102,7 +100,7 @@ Reference< XFastContextHandler > LineStyleListContext::createFastChildContext( s
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
mrLineStyleList.push_back( LinePropertiesPtr( new LineProperties ) );
return new LinePropertiesContext( *this, xAttribs, *mrLineStyleList.back() );
}
@@ -131,7 +129,7 @@ Reference< XFastContextHandler > EffectStyleListContext::createFastChildContext(
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_effectStyle:
+ case A_TOKEN( effectStyle ):
mrEffectStyleList.push_back( EffectStyleList::value_type( new PropertyMap ) );
// TODO: import effect styles
return 0;
@@ -165,24 +163,24 @@ Reference< XFastContextHandler > FontSchemeContext::createFastChildContext( sal_
AttributeList aAttribs( rxAttribs );
switch( nElement )
{
- case NMSP_DRAWINGML|XML_majorFont:
+ case A_TOKEN( majorFont ):
mxCharProps.reset( new TextCharacterProperties );
mrFontScheme[ XML_major ] = mxCharProps;
return this;
- case NMSP_DRAWINGML|XML_minorFont:
+ case A_TOKEN( minorFont ):
mxCharProps.reset( new TextCharacterProperties );
mrFontScheme[ XML_minor ] = mxCharProps;
return this;
- case NMSP_DRAWINGML|XML_latin:
+ case A_TOKEN( latin ):
if( mxCharProps.get() )
mxCharProps->maLatinFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_ea:
+ case A_TOKEN( ea ):
if( mxCharProps.get() )
mxCharProps->maAsianFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_cs:
+ case A_TOKEN( cs ):
if( mxCharProps.get() )
mxCharProps->maComplexFont.setAttributes( aAttribs );
break;
@@ -194,8 +192,8 @@ void FontSchemeContext::endFastElement( sal_Int32 nElement ) throw (SAXException
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_majorFont:
- case NMSP_DRAWINGML|XML_minorFont:
+ case A_TOKEN( majorFont ):
+ case A_TOKEN( minorFont ):
mxCharProps.reset();
break;
}
@@ -215,22 +213,22 @@ Reference< XFastContextHandler > ThemeElementsContext::createFastChildContext( s
Reference< XFastContextHandler > xRet;
switch( nElement )
{
- case NMSP_DRAWINGML|XML_clrScheme: // CT_ColorScheme
+ case A_TOKEN( clrScheme ): // CT_ColorScheme
return new clrSchemeContext( *this, mrTheme.getClrScheme() );
- case NMSP_DRAWINGML|XML_fontScheme: // CT_FontScheme
+ case A_TOKEN( fontScheme ): // CT_FontScheme
return new FontSchemeContext( *this, mrTheme.getFontScheme() );
- case NMSP_DRAWINGML|XML_fmtScheme: // CT_StyleMatrix
+ case A_TOKEN( fmtScheme ): // CT_StyleMatrix
mrTheme.setStyleName( xAttribs->getOptionalValue( XML_name ) );
return this;
- case NMSP_DRAWINGML|XML_fillStyleLst: // CT_FillStyleList
+ case A_TOKEN( fillStyleLst ): // CT_FillStyleList
return new FillStyleListContext( *this, mrTheme.getFillStyleList() );
- case NMSP_DRAWINGML|XML_lnStyleLst: // CT_LineStyleList
+ case A_TOKEN( lnStyleLst ): // CT_LineStyleList
return new LineStyleListContext( *this, mrTheme.getLineStyleList() );
- case NMSP_DRAWINGML|XML_effectStyleLst: // CT_EffectStyleList
+ case A_TOKEN( effectStyleLst ): // CT_EffectStyleList
return new EffectStyleListContext( *this, mrTheme.getEffectStyleList() );
- case NMSP_DRAWINGML|XML_bgFillStyleLst: // CT_BackgroundFillStyleList
+ case A_TOKEN( bgFillStyleLst ): // CT_BackgroundFillStyleList
return new FillStyleListContext( *this, mrTheme.getBgFillStyleList() );
}
return 0;
diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx
index 160db1881a25..3cae10e40b4f 100644
--- a/oox/source/drawingml/themefragmenthandler.cxx
+++ b/oox/source/drawingml/themefragmenthandler.cxx
@@ -56,23 +56,23 @@ ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, con
case XML_ROOT_CONTEXT:
switch( nElement )
{
- case NMSP_DRAWINGML|XML_theme:
+ case A_TOKEN( theme ):
return this;
}
break;
- case NMSP_DRAWINGML|XML_theme:
+ case A_TOKEN( theme ):
switch( nElement )
{
- case NMSP_DRAWINGML|XML_themeElements: // CT_BaseStyles
+ case A_TOKEN( themeElements ): // CT_BaseStyles
return new ThemeElementsContext( *this, mrTheme );
- case NMSP_DRAWINGML|XML_objectDefaults: // CT_ObjectStyleDefaults
+ case A_TOKEN( objectDefaults ): // CT_ObjectStyleDefaults
return new objectDefaultContext( *this, mrTheme );
- case NMSP_DRAWINGML|XML_extraClrSchemeLst: // CT_ColorSchemeList
+ case A_TOKEN( extraClrSchemeLst ): // CT_ColorSchemeList
return 0;
- case NMSP_DRAWINGML|XML_custClrLst: // CustomColorList
+ case A_TOKEN( custClrLst ): // CustomColorList
return 0;
- case NMSP_DRAWINGML|XML_ext: // CT_OfficeArtExtension
+ case A_TOKEN( ext ): // CT_OfficeArtExtension
return 0;
}
break;
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index 43748bd1089a..c686feed165c 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -26,7 +26,6 @@
************************************************************************/
#include "oox/drawingml/transform2dcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/drawingml/shape.hxx"
@@ -58,15 +57,15 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_off: // horz/vert translation
+ case A_TOKEN( off ): // horz/vert translation
mrShape.setPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) );
break;
- case NMSP_DRAWINGML|XML_ext: // horz/vert size
+ case A_TOKEN( ext ): // horz/vert size
mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
break;
/* todo: what to do?
- case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children
- case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children
+ case A_TOKEN( chOff ): // horz/vert translation of children
+ case A_TOKEN( chExt ): // horz/vert size of children
break;
*/
}
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index b78c993a0968..4e9156b5cc03 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -29,8 +29,8 @@
#include <osl/thread.h>
#include <rtl/tencinfo.h>
-#include "oox/dump/oledumper.hxx"
#include "oox/core/filterbase.hxx"
+#include "oox/dump/oledumper.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/xls/biffdetector.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -38,23 +38,27 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+namespace oox {
+namespace dump {
+namespace biff {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::oox::xls;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
-using namespace ::oox::xls;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
-namespace oox {
-namespace dump {
-namespace biff {
+// ============================================================================
namespace {
@@ -93,12 +97,7 @@ const sal_uInt16 BIFF_STYLE_BUILTIN = 0x8000;
const sal_uInt16 BIFF_PT_NOSTRING = 0xFFFF;
-} // namespace
-
-// ============================================================================
-// ============================================================================
-
-namespace {
+// ----------------------------------------------------------------------------
void lclDumpDffClientPos( const OutputRef& rxOut, const BinaryInputStreamRef& rxStrm, const String& rName, sal_uInt16 nSubScale )
{
@@ -128,7 +127,8 @@ void lclDumpDffClientRect( const OutputRef& rxOut, const BinaryInputStreamRef& r
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+// ============================================================================
BiffDffStreamObject::BiffDffStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm )
{
@@ -537,6 +537,26 @@ OUString BiffObjectBase::dumpString( const String& rName, BiffStringFlags nByteF
return (getBiff() == BIFF8) ? dumpUniString( rName, nUniFlags ) : dumpByteString( rName, nByteFlags, eDefaultTextEnc );
}
+OUString BiffObjectBase::dumpSegmentedUniString( const String& rName )
+{
+ sal_Int32 nLength = mxBiffStrm->readInt32();
+ OUStringBuffer aBuffer;
+ while( !mxBiffStrm->isEof() && (aBuffer.getLength() < nLength) )
+ aBuffer.append( mxBiffStrm->readUniString() );
+ OUString aString = aBuffer.makeStringAndClear();
+ writeStringItem( rName, aString );
+ return aString;
+}
+
+void BiffObjectBase::dumpSegmentedUniStringArray( const String& rName )
+{
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ mxOut->resetItemIndex();
+ for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !mxBiffStrm->isEof() && (nIndex < nCount); ++nIndex )
+ dumpSegmentedUniString( "#entry" );
+}
+
sal_uInt8 BiffObjectBase::dumpBoolean( const String& rName )
{
sal_uInt8 nBool;
@@ -2066,6 +2086,69 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpBool< sal_uInt32 >( "recommend-compress-pics" );
break;
+ case BIFF_ID_CONNECTION:
+ {
+ dumpFrHeader( true, false );
+ sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ sal_uInt16 nFlags1 = dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+ dumpDec< sal_uInt16 >( "param-count" );
+ dumpUnused( 2 );
+ dumpHex< sal_uInt16 >( "querytable-flags", "QUERYTABLESETTINGS-FLAGS" );
+ switch( nType )
+ {
+ case 4: dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" ); break;
+ case 5: dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" ); break;
+ case 7: dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" ); break;
+ default: dumpUnused( 2 );
+ }
+ dumpDec< sal_uInt8 >( "edited-version" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+ dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+ dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+ dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+ dumpUnused( 1 );
+ dumpSegmentedUniString( "source-file" );
+ dumpSegmentedUniString( "source-conn-file" );
+ dumpSegmentedUniString( "name" );
+ dumpSegmentedUniString( "description" );
+ dumpSegmentedUniString( "sso-id" );
+ if( nFlags1 & 0x0004 ) dumpSegmentedUniString( "table-names" );
+ if( nFlags1 & 0x0010 )
+ {
+ break; // TODO: parameter array structure
+ }
+ bool bEscape = false;
+ switch( nType )
+ {
+ case 1:
+ dumpSegmentedUniString( "connection-string" );
+ break;
+ case 4:
+ dumpSegmentedUniStringArray( "urls" );
+ dumpSegmentedUniStringArray( "post-method" );
+ break;
+ case 5:
+ bEscape = true;
+ break;
+ case 6:
+ bEscape = true;
+ break;
+ }
+ if( bEscape )
+ break;
+ dumpSegmentedUniStringArray( "sql-command" );
+ dumpSegmentedUniStringArray( "orig-sql-command" );
+ dumpSegmentedUniStringArray( "webquery-dialog-url" );
+ switch( dumpDec< sal_uInt8 >( "linked-object-type", "CONNECTION-LINKEDOBJECTTYPE" ) )
+ {
+ case 1: dumpSegmentedUniString( "defined-name" ); break;
+ case 2: dumpHex< sal_uInt16 >( "cache-id" ); break;
+ }
+ }
+ break;
+
case BIFF_ID_CONT:
if( (eBiff == BIFF8) && (getLastRecId() == BIFF_ID_OBJ) )
dumpEmbeddedDff();
@@ -2177,6 +2260,21 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpDec< sal_uInt16 >( "#cell-offset" );
break;
+ case BIFF_ID_DBQUERY:
+ if( eBiff == BIFF8 )
+ {
+ if( (getLastRecId() != BIFF_ID_PCITEM_STRING) && (getLastRecId() != BIFF_ID_DBQUERY) )
+ {
+ dumpHex< sal_uInt16 >( "flags", "DBQUERY-FLAGS" );
+ dumpDec< sal_uInt16 >( "sql-param-count" );
+ dumpDec< sal_uInt16 >( "command-count" );
+ dumpDec< sal_uInt16 >( "post-method-count" );
+ dumpDec< sal_uInt16 >( "server-sql-count" );
+ dumpDec< sal_uInt16 >( "odbc-connection-count" );
+ }
+ }
+ break;
+
case BIFF2_ID_DEFINEDNAME:
case BIFF3_ID_DEFINEDNAME:
{
@@ -2335,6 +2433,19 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpString( "password-creator", BIFF_STR_8BITLENGTH, BIFF_STR_SMARTFLAGS );
break;
+ case BIFF_ID_FILTERCOLUMN:
+ {
+ dumpDec< sal_uInt16 >( "column-index" );
+ dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" );
+ sal_uInt8 nStrLen1 = dumpFilterColumnOperator( "operator-1" );
+ sal_uInt8 nStrLen2 = dumpFilterColumnOperator( "operator-2" );
+ bool bBiff8 = eBiff == BIFF8;
+ rtl_TextEncoding eTextEnc = getBiffData().getTextEncoding();
+ if( nStrLen1 > 0 ) writeStringItem( "string-1", bBiff8 ? rStrm.readUniStringBody( nStrLen1, true ) : rStrm.readCharArrayUC( nStrLen1, eTextEnc, true ) );
+ if( nStrLen2 > 0 ) writeStringItem( "string-2", bBiff8 ? rStrm.readUniStringBody( nStrLen2, true ) : rStrm.readCharArrayUC( nStrLen2, eTextEnc, true ) );
+ }
+ break;
+
case BIFF2_ID_FONT:
case BIFF3_ID_FONT:
dumpFontRec();
@@ -2715,6 +2826,58 @@ void WorkbookStreamObject::implDumpRecordBody()
}
break;
+ case BIFF_ID_QUERYTABLE:
+ dumpHex< sal_uInt16 >( "flags", "QUERYTABLE-FLAGS" );
+ dumpDec< sal_uInt16 >( "autoformat-id" );
+ dumpHex< sal_uInt16 >( "autoformat-flags", "QUERYTABLE-AUTOFORMAT-FLAGS" );
+ dumpUnused( 4 );
+ dumpUniString( "defined-name" );
+ dumpUnused( 2 );
+ break;
+
+ case BIFF_ID_QUERYTABLEREFRESH:
+ {
+ dumpFrHeader( true, false );
+ bool bPivot = dumpBool< sal_uInt16 >( "pivot-table" );
+ dumpHex< sal_uInt16 >( "flags", "QUERYTABLEREFRESH-FLAGS" );
+ dumpHex< sal_uInt32 >( bPivot ? "pivottable-flags" : "querytable-flags", bPivot ? "QUERYTABLEREFRESH-PTFLAGS" : "QUERYTABLEREFRESH-QTFLAGS" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpUnused( 2 );
+ dumpUniString( "table-name" );
+ dumpUnused( 2 );
+ }
+ break;
+
+ case BIFF_ID_QUERYTABLESETTINGS:
+ {
+ dumpFrHeader( true, false );
+ sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ dumpHex< sal_uInt16 >( "flags-1", "QUERYTABLESETTINGS-FLAGS" );
+ switch( nType )
+ {
+ case 4: dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" ); break;
+ case 5: dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" ); break;
+ case 7: dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" ); break;
+ default: dumpUnused( 2 );
+ }
+ dumpHex< sal_uInt16 >( "ext-flags", "QUERYTABLESETTINGS-EXT-FLAGS" );
+ dumpDec< sal_uInt8 >( "edited-version" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpUnused( 3 );
+ dumpDec< sal_uInt16 >( "oledb-count" );
+ dumpDec< sal_uInt16 >( "future-data-size" );
+ dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+ dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+ }
+ break;
+
+ case BIFF_ID_QUERYTABLESTRING:
+ dumpFrHeader( true, false );
+ dumpUniString( "connection-string" );
+ break;
+
case BIFF_ID_RECALCID:
dumpFrHeader( true, false );
dumpDec< sal_uInt32 >( "recalc-engine-id" );
@@ -2896,18 +3059,6 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpDxfProp();
break;
- case BIFF_ID_SXEXT:
- if( eBiff == BIFF8 )
- {
- dumpHex< sal_uInt16 >( "flags", "SXEXT-FLAGS" );
- dumpDec< sal_uInt16 >( "param-string-count" );
- dumpDec< sal_uInt16 >( "sql-statement-string-count" );
- dumpDec< sal_uInt16 >( "webquery-postmethod-string-count" );
- dumpDec< sal_uInt16 >( "server-pagefields-string-count" );
- dumpDec< sal_uInt16 >( "odbc-connection-string-count" );
- }
- break;
-
case BIFF_ID_TABLESTYLES:
{
dumpFrHeader( true, true );
@@ -3122,6 +3273,38 @@ void WorkbookStreamObject::dumpExtGradientHead()
dumpDec< double >( "pos-bottom" );
}
+sal_uInt8 WorkbookStreamObject::dumpFilterColumnOperator( const String& rName )
+{
+ sal_uInt8 nStrLen = 0;
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "FILTERCOLUMN-DATATYPE" );
+ dumpDec< sal_uInt8 >( "operator", "FILTERCOLUMN-OPERATOR" );
+ switch( nType )
+ {
+ case 2:
+ dumpRk( "value" );
+ dumpUnused( 4 );
+ break;
+ case 4:
+ dumpDec< double >( "value" );
+ break;
+ case 6:
+ dumpUnused( 4 );
+ nStrLen = dumpDec< sal_uInt8 >( "length" );
+ dumpBoolean( "simple" );
+ dumpUnused( 2 );
+ break;
+ case 8:
+ dumpBoolErr();
+ dumpUnused( 6 );
+ break;
+ default:
+ dumpUnused( 8 );
+ }
+ return nStrLen;
+}
+
OUString WorkbookStreamObject::dumpPivotString( const String& rName, sal_uInt16 nStrLen )
{
OUString aString;
@@ -3151,9 +3334,9 @@ void WorkbookStreamObject::dumpBoolErr()
{
MultiItemsGuard aMultiGuard( mxOut );
sal_uInt8 nValue = dumpHex< sal_uInt8 >( "value" );
- bool bErrCode = dumpBool< sal_uInt8 >( "is-errorcode" );
+ bool bErrCode = dumpBool< sal_uInt8 >( "is-error-code" );
if( bErrCode )
- writeErrorCodeItem( "errorcode", nValue );
+ writeErrorCodeItem( "error-code", nValue );
else
writeBooleanItem( "boolean", nValue );
}
@@ -4362,10 +4545,10 @@ void Dumper::implDump()
}
// ============================================================================
+// ============================================================================
} // namespace biff
} // namespace dump
} // namespace oox
#endif
-
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index d4b862825b3c..f32ed89334f8 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -344,14 +344,14 @@ multilist=RECORD-NAMES-BIFF5
0x0018=DEFINEDNAME
0x0023=EXTERNALNAME
0x0031=FONT
- 0x0098=,,,FILTERMODE,,AUTOFILTERINFO,AUTOFILTER,
+ 0x0098=,,,FILTERMODE,,AUTOFILTER,FILTERCOLUMN,
0x00A8=,,,,,,SCENARIOS,SCENARIO
0x00B0=PTDEFINITION,PTFIELD,PTFITEM,,PTROWCOLFIELDS,PTROWCOLITEMS,PTPAGEFIELDS,
0x00B8=DOCROUTE,RECIPNAME,,,,MULTRK,MULTBLANK,TOOLBARHDR
0x00C0=TOOLBAREND,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD
0x00C8=PCITEM_INDEXLIST,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR,PCITEM_INTEGER,PCITEM_STRING,PCITEM_DATE,PCITEM_MISSING
0x00D0=SXTBL,SXTBRGITEM,SXTBPG,VBAPROJECT,,PIVOTCACHE,RSTRING,DBCELL
- 0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,SXEXT|PARAMQRY,SCENPROTECT,OLESIZE,UDDESC
+ 0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,DBORPARAMQUERY,SCENPROTECT,OLESIZE,UDDESC
0x00E0=XF,INTERFACEHDR,INTERFACEEND,PCDSOURCE,,,,
0x0206=FORMULA
0x04BC=SHAREDFMLA
@@ -379,17 +379,18 @@ multilist=RECORD-NAMES-BIFF8
0x0158=,,,,,,,LABELRANGES
0x0160=USESELFS,DSF,XL5MODIFY,,,,,
0x0190=,,,,,,CHTRHEADER,
- 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QSI,EXTERNALBOOK,PROT4REV
+ 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QUERYTABLE,EXTERNALBOOK,PROT4REV
0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL
0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,VBAPROJECTEMPTY,DATAVALIDATION,
0x01C0=XL9FILE,RECALCID,INTCACHEDDATA,,,,,
# future records
- 0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
+ 0x0800=SCREENTIP,,QUERYTABLEREFRESH,QUERYTABLESETTINGS,QUERYTABLESTRING,,,
0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,CHFRCATEGORYPROPS,CHFRUNITPROPS
0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,,
0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD
0x0868=,,,CHFRLABELPROPS,,,,
- 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,,
+ 0x0870=,,,,,,CONNECTION,
+ 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,FILTERCOLUMN12,CONTINUE12
0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES,
0x0890=,,STYLEEXT,,,,THEME,
0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,CHFRLAYOUT,CHFREXTPROPS,CHFREXTPROPSCONT
@@ -464,6 +465,7 @@ end
constlist=SIMPLE-RECORDS-BIFF5
include=SIMPLE-RECORDS-BIFF4
+ 0x009D=uint16,dec,column-count
0x00C9=double,dec,value
0x00CA=uint16,bool,value
0x00CB=uint16,hex,error-code,ERRORCODES
@@ -1229,6 +1231,26 @@ combilist=COLINFO-FLAGS
0x1000=outline-collapsed
end
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+
+flagslist=CONNECTION-FLAGS
+ 0x0001=save-password
+ 0x0002=html-tables
+ 0x0004=table-names
+ 0x0008=deleted
+ 0x0010=stand-alone
+ 0x0020=only-use-conn-file
+ 0x0040=background
+ 0x0080=refresh-on-load
+ 0x0100=save-data
+end
+
+shortlist=CONNECTION-RECONNECTTYPE,0,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+shortlist=CONNECTION-LINKEDOBJECTTYPE,0,none,query-table,pivot-cache
+
# DATATABLE ------------------------------------------------------------------
flagslist=DATATABLE-FLAGS-BIFF3
@@ -1273,6 +1295,18 @@ end
shortlist=DATEMODE,0,1899-12-31,1904-01-01
+# DBQUERY --------------------------------------------------------------------
+
+combilist=DBQUERY-FLAGS
+ 0x0007=uint8,dec,source-type,CONNECTION-SOURCETYPE
+ 0x0008=odbc-connection
+ 0x0010=sql-query
+ 0x0020=server-sql
+ 0x0040=html-query
+ 0x0080=save-password
+ 0x0100=html-tables
+end
+
# DEFINEDNAME ----------------------------------------------------------------
flagslist=DEFINEDNAME-FLAGS-BIFF2
@@ -1380,6 +1414,30 @@ end
shortlist=FILEPASS-TYPE,0,xor,rc4
shortlist=FILEPASS-MAJOR,1,rc4,crypto-api-2003,crypto-api-2007
+# FILTERCOLUMN ---------------------------------------------------------------
+
+combilist=FILTERCOLUMN-FLAGS
+ 0x0001=!and!or
+ 0x0004=op-1-simple
+ 0x0008=op-2-simple
+ 0x0010=top-10
+ 0x0020=!bottom!top
+ 0x0040=percent
+ 0xFF80=uint16,dec,top-10-count
+end
+
+constlist=FILTERCOLUMN-DATATYPE
+ 0=none
+ 2=rk
+ 4=double
+ 6=string
+ 8=boolean
+ 12=blank
+ 14=not-blank
+end
+
+shortlist=FILTERCOLUMN-OPERATOR,0,none,less,equal,less-equal,greater,not-equal,greater-equal
+
# FONT -----------------------------------------------------------------------
flagslist=FONT-FLAGS
@@ -1874,6 +1932,101 @@ combilist=PTROWCOLITEMS-FLAGS
0x1000=multi-data
end
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+ 0x0001=headers
+ 0x0002=row-numbers
+ 0x0004=disable-refresh
+ 0x0008=background
+ 0x0010=first-background
+ 0x0020=refresh-on-load
+ 0x0040=delete-unused
+ 0x0080=fill-formulas
+ 0x0100=adjust-column-width
+ 0x0200=save-data
+ 0x0400=disable-edit
+ 0x2000=overwrite-existing
+end
+
+combilist=QUERYTABLE-AUTOFORMAT-FLAGS
+ 0x0001=apply-num-fmt
+ 0x0002=apply-font
+ 0x0004=apply-alignment
+ 0x0008=apply-border
+ 0x0010=apply-fill
+ 0x0020=apply-protection
+end
+
+# QUERYTABLEREFRESH ----------------------------------------------------------
+
+flagslist=QUERYTABLEREFRESH-FLAGS
+ 0x0001=enable-refresh
+ 0x0002=pivot-cache-invalid
+ 0x0004=olap-pivot-table
+end
+
+flagslist=QUERYTABLEREFRESH-PTFLAGS
+ 0x00000001=disable-draw-drop
+ 0x00000002=hide-totals-annotation
+ 0x00000008=include-empty-rows
+ 0x00000010=include-empty-columns
+end
+
+flagslist=QUERYTABLEREFRESH-QTFLAGS
+ 0x00000001=preserve-formatting
+ 0x00000002=adjust-column-width
+ 0x00000010=ext-data-list
+ 0x00000040=create-table-list
+ 0x00000080=create-dummy-list
+end
+
+# QUERYTABLESETTINGS ---------------------------------------------------------
+
+flagslist=QUERYTABLESETTINGS-FLAGS
+ 0x0001=keep-alive
+ 0x0002=new
+ 0x0004=source-data
+ 0x0008=web-based-prov
+ 0x0010=reinit-list
+ 0x0080=xml
+end
+
+flagslist=QUERYTABLESETTINGS-HTML-FLAGS
+ 0x0001=parse-pre
+ 0x0002=consecutive-delimiters
+ 0x0004=first-row
+ 0x0008=xl97-created
+ 0x0010=text-dates
+ 0x0020=xl2000-refreshed
+end
+
+combilist=QUERYTABLESETTINGS-OLEDB-FLAGS
+ 0x0007=uint8,dec,command-type,QUERYTABLESETTINGS-OLEDB-COMMANDTYPE
+ 0x0008=alt-connection-string
+ 0x0010=no-refresh-cube
+ 0x0020=olap-has-locale
+ 0x0040=server-num-fmt
+ 0x0080=server-fill-color
+ 0x0100=server-font-color
+ 0x0200=server-font-format
+ 0x0400=olap-member-l10n
+end
+
+shortlist=QUERYTABLESETTINGS-OLEDB-COMMANDTYPE,0,none,cube,sql,table,default,list
+
+flagslist=QUERYTABLESETTINGS-ADO-FLAGS
+ 0x0100=ado-refreshable
+end
+
+flagslist=QUERYTABLESETTINGS-EXT-FLAGS
+ 0x0001=text-query
+ 0x0002=table-names
+end
+
+unitconverter=QUERYTABLESETTINGS-INTERVAL,60,sec
+shortlist=QUERYTABLESETTINGS-HTMLFORMAT,1,none,rtf,all
+
# REFMODE --------------------------------------------------------------------
shortlist=REFMODE,0,R1C1,A1
@@ -1998,20 +2151,6 @@ multilist=STYLEEXT-BUILTIN
50=20%-accent6,40%-accent6,60%-accent6,explanatory-text
end
-# SXEXT ----------------------------------------------------------------------
-
-combilist=SXEXT-FLAGS
- 0x0007=uint8,dec,source-type,SXEXT-SOURCETYPE
- 0x0008=odbc-connection
- 0x0010=odbc-sql
- 0x0020=server-pagefields
- 0x0040=webquery
- 0x0080=save-password
- 0x0100=tables-html-only
-end
-
-shortlist=SXEXT-SOURCETYPE,1,odbc,dao,,webquery
-
# THEME ----------------------------------------------------------------------
constlist=THEME-VERSION
@@ -2235,4 +2374,3 @@ multilist=XFEXT-SUBREC
end
# ============================================================================
-
diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx
index 8730698561ce..01994865c69d 100644
--- a/oox/source/dump/dffdumper.cxx
+++ b/oox/source/dump/dffdumper.cxx
@@ -29,13 +29,15 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-
namespace oox {
namespace dump {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry.
@@ -320,4 +322,3 @@ sal_uInt16 DffStreamObject::dumpDffOptPropHeader()
} // namespace oox
#endif
-
diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini
index c33d733c6bd8..5526663e0e15 100644
--- a/oox/source/dump/dffdumper.ini
+++ b/oox/source/dump/dffdumper.ini
@@ -648,4 +648,3 @@ combilist=DFFSPLITMENUC-RECORD-INST
end
# ============================================================================
-
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index 53452765288a..f7c6c6102b1d 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -29,46 +29,45 @@
#include <algorithm>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/XTextInputStream.hpp>
#include <com/sun/star/io/XTextOutputStream.hpp>
-#include <rtl/math.hxx>
-#include <osl/file.hxx>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <comphelper/docpasswordhelper.hxx>
+#include <osl/file.hxx>
+#include <rtl/math.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/textinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffhelper.hxx"
#if OOX_INCLUDE_DUMPER
+namespace oox {
+namespace dump {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::ucb::XSimpleFileAccess;
-using ::com::sun::star::io::XActiveDataSink;
-using ::com::sun::star::io::XActiveDataSource;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XTextInputStream;
-using ::com::sun::star::io::XTextOutputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-using namespace ::com::sun::star;
+// ============================================================================
-namespace oox {
-namespace dump {
+namespace {
const sal_Unicode OOX_DUMP_BOM = 0xFEFF;
const sal_Int32 OOX_DUMP_MAXSTRLEN = 80;
@@ -81,6 +80,8 @@ const sal_Unicode OOX_DUMP_ITEMSEP = '=';
const sal_Int32 OOX_DUMP_BYTESPERLINE = 16;
const sal_Int64 OOX_DUMP_MAXARRAY = 16;
+} // namespace
+
// ============================================================================
// ============================================================================
@@ -1583,16 +1584,16 @@ NameListRef SharedConfigData::getNameList( const OUString& rListName ) const
return xList;
}
-uno::Sequence< beans::NamedValue > SharedConfigData::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
+Sequence< NamedValue > SharedConfigData::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
- uno::Sequence< beans::NamedValue > aEncryptionData;
+ Sequence< NamedValue > aEncryptionData;
if( !mbPwCancelled )
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
rVerifier, mrMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
- mbPwCancelled = aEncryptionData.getLength() == 0;
+ mbPwCancelled = !aEncryptionData.hasElements();
}
return aEncryptionData;
}
@@ -1714,7 +1715,7 @@ void Config::construct( const Config& rParent )
void Config::construct( const sal_Char* pcEnvVar, const FilterBase& rFilter )
{
if( rFilter.getFileUrl().getLength() > 0 )
- construct( pcEnvVar, rFilter.getGlobalFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() );
+ construct( pcEnvVar, rFilter.getServiceFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() );
}
void Config::construct( const sal_Char* pcEnvVar, const Reference< XMultiServiceFactory >& rxFactory, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc )
@@ -1766,7 +1767,7 @@ NameListRef Config::getNameList( const String& rListName ) const
return implGetNameList( rListName );
}
-uno::Sequence< beans::NamedValue > Config::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
+Sequence< NamedValue > Config::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
return mxCfgData->requestEncryptionData( rVerifier );
}
@@ -3214,4 +3215,3 @@ void DumperBase::construct( const ConfigRef& rxConfig )
} // namespace oox
#endif
-
diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini
index 34ef302c784c..28aa59a03b81 100644
--- a/oox/source/dump/dumperbase.ini
+++ b/oox/source/dump/dumperbase.ini
@@ -393,4 +393,3 @@ multilist=SYSTEMCOLOR
end
# ============================================================================
-
diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx
index cc49ee050ea6..bd2a0e05ecce 100644
--- a/oox/source/dump/oledumper.cxx
+++ b/oox/source/dump/oledumper.cxx
@@ -26,30 +26,33 @@
************************************************************************/
#include "oox/dump/oledumper.hxx"
+
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
-#include <osl/thread.h>
#include <osl/file.hxx>
+#include <osl/thread.h>
#include <rtl/tencinfo.h>
-#include "oox/helper/binaryoutputstream.hxx"
#include "oox/core/filterbase.hxx"
+#include "oox/helper/binaryoutputstream.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/ole/vbainputstream.hxx"
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OString;
-using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-
namespace oox {
namespace dump {
// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
// ============================================================================
OUString OleInputObjectBase::dumpAnsiString32( const String& rName )
@@ -302,28 +305,32 @@ namespace {
const sal_Int32 OLEPROP_ID_DICTIONARY = 0;
const sal_Int32 OLEPROP_ID_CODEPAGE = 1;
-const sal_Int32 OLEPROP_TYPE_INT16 = 2;
-const sal_Int32 OLEPROP_TYPE_INT32 = 3;
-const sal_Int32 OLEPROP_TYPE_FLOAT = 4;
-const sal_Int32 OLEPROP_TYPE_DOUBLE = 5;
-const sal_Int32 OLEPROP_TYPE_DATE = 7;
-const sal_Int32 OLEPROP_TYPE_STRING = 8;
-const sal_Int32 OLEPROP_TYPE_STATUS = 10;
-const sal_Int32 OLEPROP_TYPE_BOOL = 11;
-const sal_Int32 OLEPROP_TYPE_VARIANT = 12;
-const sal_Int32 OLEPROP_TYPE_INT8 = 16;
-const sal_Int32 OLEPROP_TYPE_UINT8 = 17;
-const sal_Int32 OLEPROP_TYPE_UINT16 = 18;
-const sal_Int32 OLEPROP_TYPE_UINT32 = 19;
-const sal_Int32 OLEPROP_TYPE_INT64 = 20;
-const sal_Int32 OLEPROP_TYPE_UINT64 = 21;
-const sal_Int32 OLEPROP_TYPE_STRING8 = 30;
-const sal_Int32 OLEPROP_TYPE_STRING16 = 31;
-const sal_Int32 OLEPROP_TYPE_FILETIME = 64;
-const sal_Int32 OLEPROP_TYPE_BLOB = 65;
-const sal_Int32 OLEPROP_TYPE_STREAM = 66;
-const sal_Int32 OLEPROP_TYPE_STORAGE = 67;
-const sal_Int32 OLEPROP_TYPE_CLIPFMT = 71;
+const sal_uInt16 OLEPROP_TYPE_INT16 = 2;
+const sal_uInt16 OLEPROP_TYPE_INT32 = 3;
+const sal_uInt16 OLEPROP_TYPE_FLOAT = 4;
+const sal_uInt16 OLEPROP_TYPE_DOUBLE = 5;
+const sal_uInt16 OLEPROP_TYPE_DATE = 7;
+const sal_uInt16 OLEPROP_TYPE_STRING = 8;
+const sal_uInt16 OLEPROP_TYPE_STATUS = 10;
+const sal_uInt16 OLEPROP_TYPE_BOOL = 11;
+const sal_uInt16 OLEPROP_TYPE_VARIANT = 12;
+const sal_uInt16 OLEPROP_TYPE_INT8 = 16;
+const sal_uInt16 OLEPROP_TYPE_UINT8 = 17;
+const sal_uInt16 OLEPROP_TYPE_UINT16 = 18;
+const sal_uInt16 OLEPROP_TYPE_UINT32 = 19;
+const sal_uInt16 OLEPROP_TYPE_INT64 = 20;
+const sal_uInt16 OLEPROP_TYPE_UINT64 = 21;
+const sal_uInt16 OLEPROP_TYPE_STRING8 = 30;
+const sal_uInt16 OLEPROP_TYPE_STRING16 = 31;
+const sal_uInt16 OLEPROP_TYPE_FILETIME = 64;
+const sal_uInt16 OLEPROP_TYPE_BLOB = 65;
+const sal_uInt16 OLEPROP_TYPE_STREAM = 66;
+const sal_uInt16 OLEPROP_TYPE_STORAGE = 67;
+const sal_uInt16 OLEPROP_TYPE_CLIPFMT = 71;
+
+const sal_uInt16 OLEPROP_TYPE_SIMPLE = 0x0000;
+const sal_uInt16 OLEPROP_TYPE_VECTOR = 0x1000;
+const sal_uInt16 OLEPROP_TYPE_ARRAY = 0x2000;
const sal_uInt16 CODEPAGE_UNICODE = 1200;
@@ -458,7 +465,7 @@ void OlePropertyStreamObject::dumpCodePageProperty( sal_uInt32 nStartPos )
IndentGuard aIndGuard( mxOut );
if( startElement( nStartPos ) )
{
- sal_Int32 nType = dumpPropertyType();
+ sal_uInt16 nType = dumpPropertyType();
if( nType == OLEPROP_TYPE_INT16 )
{
sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" );
@@ -493,28 +500,21 @@ void OlePropertyStreamObject::dumpDictionaryProperty( sal_uInt32 nStartPos )
mxOut->emptyLine();
}
-void OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId )
+sal_uInt16 OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId )
{
- sal_Int32 nType = dumpPropertyType();
- if( getFlag< sal_Int32 >( nType, 0x1000 ) ) // vector
+ sal_uInt16 nType = dumpPropertyType();
+ sal_uInt16 nBaseType = static_cast< sal_uInt16 >( nType & 0x0FFF );
+ sal_uInt16 nArrayType = static_cast< sal_uInt16 >( nType & 0xF000 );
+ switch( nArrayType )
{
- sal_Int32 nBaseType = nType & 0x0FFF;
- sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" );
- for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx )
- {
- mxOut->resetItemIndex( nElemIdx );
- writeEmptyItem( "#element" );
- IndentGuard aIndGuard( mxOut );
- dumpPropertyValue( nPropId, nBaseType );
- }
- }
- else if( !getFlag< sal_Int32 >( nType, 0x7000 ) )
- {
- dumpPropertyValue( nPropId, nType );
+ case OLEPROP_TYPE_SIMPLE: dumpPropertyValue( nPropId, nBaseType ); break;
+ case OLEPROP_TYPE_VECTOR: dumpPropertyVector( nPropId, nBaseType ); break;
+ case OLEPROP_TYPE_ARRAY: dumpPropertyArray( nPropId, nBaseType ); break;
}
+ return nType;
}
-void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType )
+void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType )
{
switch( nBaseType )
{
@@ -536,23 +536,46 @@ void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nB
case OLEPROP_TYPE_STRING8: dumpString8( "value" ); break;
case OLEPROP_TYPE_STRING16: dumpString16( "value" ); break;
case OLEPROP_TYPE_FILETIME: dumpFileTime( "file-time" ); break;
- case OLEPROP_TYPE_BLOB: dumpBlob( "data" ); break;
+ case OLEPROP_TYPE_BLOB: dumpBlob( nPropId, "data" ); break;
case OLEPROP_TYPE_STREAM: dumpString8( "stream-name" ); break;
case OLEPROP_TYPE_STORAGE: dumpString8( "storage-name" ); break;
- case OLEPROP_TYPE_CLIPFMT: dumpBlob( "clip-data" ); break;
+ case OLEPROP_TYPE_CLIPFMT: dumpBlob( nPropId, "clip-data" ); break;
}
}
-sal_Int32 OlePropertyStreamObject::dumpPropertyType()
+void OlePropertyStreamObject::dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType )
{
- return dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" );
+ sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" );
+ for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx )
+ {
+ mxOut->resetItemIndex( nElemIdx );
+ writeEmptyItem( "#element" );
+ IndentGuard aIndGuard( mxOut );
+ dumpPropertyValue( nPropId, nBaseType );
+ }
+}
+
+void OlePropertyStreamObject::dumpPropertyArray( sal_Int32 /*nPropId*/, sal_uInt16 /*nBaseType*/ )
+{
+ // TODO
+}
+
+sal_uInt16 OlePropertyStreamObject::dumpPropertyType()
+{
+ return static_cast< sal_uInt16 >( dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" ) & 0xFFFF );
}
-void OlePropertyStreamObject::dumpBlob( const String& rName )
+void OlePropertyStreamObject::dumpBlob( sal_Int32 nPropId, const String& rName )
{
sal_Int32 nSize = dumpDec< sal_Int32 >( "data-size" );
if( nSize > 0 )
- dumpBinary( rName, nSize );
+ {
+ OUString aPropName = mxPropIds->getName( cfg(), nPropId );
+ if( aPropName == CREATE_OUSTRING( "'_PID_HLINKS'" ) )
+ dumpHlinks( nSize );
+ else
+ dumpBinary( rName, nSize );
+ }
}
OUString OlePropertyStreamObject::dumpString8( const String& rName )
@@ -596,6 +619,33 @@ OUString OlePropertyStreamObject::dumpCharArray16( const String& rName, sal_Int3
return aData;
}
+bool OlePropertyStreamObject::dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType )
+{
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ return (dumpPropertyContents( -1 ) == nExpectedType) && !mxStrm->isEof();
+}
+
+void OlePropertyStreamObject::dumpHlinks( sal_Int32 nSize )
+{
+ sal_Int64 nEndPos = mxStrm->tell() + nSize;
+ sal_Int32 nCount = dumpDec< sal_Int32 >( "property-count" );
+ bool bValid = true;
+ for( sal_Int32 nHlinkIndex = 0, nHlinkCount = nCount / 6; bValid && !mxStrm->isEof() && (nHlinkIndex < nHlinkCount); ++nHlinkIndex )
+ {
+ writeEmptyItem( "HYPERLINK" );
+ IndentGuard aIndGuard( mxOut );
+ bValid =
+ dumpTypedProperty( "hash", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "app", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "shape-id", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "info", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "target", OLEPROP_TYPE_STRING16 ) &&
+ dumpTypedProperty( "location", OLEPROP_TYPE_STRING16 );
+ }
+ dumpRemainingTo( nEndPos );
+}
+
bool OlePropertyStreamObject::startElement( sal_uInt32 nStartPos )
{
mxStrm->seek( nStartPos );
@@ -2312,4 +2362,3 @@ void ActiveXStorageObject::implDumpBaseStream( const BinaryInputStreamRef& rxStr
} // namespace oox
#endif
-
diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini
index 13478464e6b3..c8461d4b28a7 100644
--- a/oox/source/dump/oledumper.ini
+++ b/oox/source/dump/oledumper.ini
@@ -885,4 +885,3 @@ end
shortlist=VBA-DIR-PROJECTSYSKIND-PLATFORM,0,16-bit-windows,32-bit-windows,macintosh
# ============================================================================
-
diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx
index e01d7d349855..39e0ccc2be55 100644
--- a/oox/source/dump/pptxdumper.cxx
+++ b/oox/source/dump/pptxdumper.cxx
@@ -26,27 +26,31 @@
************************************************************************/
#include "oox/dump/pptxdumper.hxx"
-#include "oox/helper/zipstorage.hxx"
-#include "oox/ole/olestorage.hxx"
+
#include "oox/dump/biffdumper.hxx"
#include "oox/dump/oledumper.hxx"
#include "oox/dump/xlsbdumper.hxx"
+#include "oox/helper/zipstorage.hxx"
+#include "oox/ole/olestorage.hxx"
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace dump {
namespace pptx {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
RootStorageObject::RootStorageObject( const DumperBase& rParent )
{
StorageObjectBase::construct( rParent );
@@ -144,4 +148,3 @@ void Dumper::implDump()
} // namespace oox
#endif
-
diff --git a/oox/source/dump/pptxdumper.ini b/oox/source/dump/pptxdumper.ini
index fa03953b7113..f3c058ecfbf5 100644
--- a/oox/source/dump/pptxdumper.ini
+++ b/oox/source/dump/pptxdumper.ini
@@ -16,4 +16,3 @@ include-config-file=dumperbase.ini
# enable-import=1
# ============================================================================
-
diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx
index dd78ac3c4e2e..3dc2974420a6 100644
--- a/oox/source/dump/xlsbdumper.cxx
+++ b/oox/source/dump/xlsbdumper.cxx
@@ -26,12 +26,13 @@
************************************************************************/
#include "oox/dump/xlsbdumper.hxx"
+
#include <com/sun/star/io/XTextInputStream.hpp>
+#include "oox/core/filterbase.hxx"
#include "oox/dump/biffdumper.hxx"
#include "oox/dump/oledumper.hxx"
#include "oox/dump/pptxdumper.hxx"
#include "oox/helper/zipstorage.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/xls/biffhelper.hxx"
#include "oox/xls/formulabase.hxx"
@@ -39,34 +40,31 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
-using namespace ::oox::xls;
-
namespace oox {
namespace dump {
namespace xlsb {
// ============================================================================
-namespace {
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::oox::xls;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS = 0x02;
+// ============================================================================
+
+namespace {
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR = 4;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS = 0x02;
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED = 0x0001;
} // namespace
@@ -82,7 +80,7 @@ RecordObjectBase::~RecordObjectBase()
void RecordObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName )
{
- mxBiffStrm.reset( new RecordInputStream( getRecordDataSequence() ) );
+ mxBiffStrm.reset( new SequenceInputStream( getRecordDataSequence() ) );
SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, mxBiffStrm, "RECORD-NAMES", "SIMPLE-RECORDS" );
if( SequenceRecordObjectBase::implIsValid() )
mxErrCodes = cfg().getNameList( "ERRORCODES" );
@@ -200,11 +198,11 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
{
sal_uInt8 nFlags = bRich ? dumpHex< sal_uInt8 >( "flags", "STRING-FLAGS" ) : 0;
- OUString aString = mxBiffStrm->readString( b32BitLen );
+ OUString aString = BiffHelper::readString( *mxBiffStrm, b32BitLen );
writeStringItem( rName( "text" ), aString );
// --- formatting ---
- if( getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+ if( getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
{
IndentGuard aIndGuard( mxOut );
FontPortionModelList aPortions;
@@ -213,7 +211,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
}
// --- phonetic text ---
- if( getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+ if( getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
{
IndentGuard aIndGuard( mxOut );
dumpString( "phonetic-text" );
@@ -489,7 +487,7 @@ void FormulaObject::constructFmlaObj()
{
if( RecordObjectBase::implIsValid() )
{
- mxFuncProv.reset( new FunctionProvider( FILTER_OOX, BIFF_UNKNOWN, true ) );
+ mxFuncProv.reset( new FunctionProvider( FILTER_OOXML, BIFF_UNKNOWN, true ) );
Config& rCfg = cfg();
mxClasses = rCfg.getNameList( "TOKENCLASSES" );
@@ -567,7 +565,7 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
ItemGuard aItem( mxOut, "func-id" );
writeHexItem( EMPTY_STRING, nFuncId, "FUNCID" );
OUStringBuffer aBuffer;
- const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromOobFuncId( nFuncId );
+ const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromBiff12FuncId( nFuncId );
if( pFuncInfo )
aBuffer.append( pFuncInfo->maOoxFuncName );
else
@@ -588,9 +586,9 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
sal_Int32 FormulaObject::dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR )
{
sal_uInt16 nCol = dumpHex< sal_uInt16 >( rName, mxRelFlags );
- rbRelC = getFlag( nCol, OOBIN_TOK_REF_COLREL );
- rbRelR = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
- nCol &= OOBIN_TOK_REF_COLMASK;
+ rbRelC = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+ rbRelR = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+ nCol &= BIFF12_TOK_REF_COLMASK;
return nCol;
}
@@ -821,17 +819,17 @@ bool FormulaObject::dumpTableToken()
StringHelper::appendIndex( aColRange, mxOut->getLastItemValue() );
OUStringBuffer aParams;
size_t nParams = 0;
- if( getFlag( nFlags, OOBIN_TOK_TABLE_ALL ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_ALL ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#All]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Headers]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_DATA ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_DATA ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Data]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Totals]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_THISROW ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_THISROW ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#This Row]" ) );
- if( (getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN ) || getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE )) && ++nParams )
+ if( (getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN ) || getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE )) && ++nParams )
StringHelper::appendToken( aParams, aColRange.makeStringAndClear() );
OUStringBuffer aOp;
StringHelper::appendIndexedText( aOp, CREATE_OUSTRING( "TABLE" ), nTabId );
@@ -849,13 +847,13 @@ bool FormulaObject::dumpAttrToken()
sal_uInt8 nType = dumpHex< sal_uInt8 >( "type", mxAttrTypes );
switch( nType )
{
- case OOBIN_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_VOLATILE:
dumpUnused( 2 );
break;
- case OOBIN_TOK_ATTR_IF:
+ case BIFF_TOK_ATTR_IF:
dumpDec< sal_uInt16 >( "skip" );
break;
- case OOBIN_TOK_ATTR_CHOOSE:
+ case BIFF_TOK_ATTR_CHOOSE:
{
sal_uInt16 nCount = dumpDec< sal_uInt16 >( "choices" );
mxOut->resetItemIndex();
@@ -864,22 +862,22 @@ bool FormulaObject::dumpAttrToken()
dumpDec< sal_uInt16 >( "skip-err" );
}
break;
- case OOBIN_TOK_ATTR_SKIP:
+ case BIFF_TOK_ATTR_SKIP:
dumpDec< sal_uInt16 >( "skip" );
break;
- case OOBIN_TOK_ATTR_SUM:
+ case BIFF_TOK_ATTR_SUM:
dumpUnused( 2 );
mxStack->pushFuncOp( CREATE_OUSTRING( "SUM" ), OUString( OOX_DUMP_BASECLASS ), 1 );
break;
- case OOBIN_TOK_ATTR_ASSIGN:
+ case BIFF_TOK_ATTR_ASSIGN:
dumpUnused( 2 );
break;
- case OOBIN_TOK_ATTR_SPACE:
- case OOBIN_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_SPACE:
+ case BIFF_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
dumpDec< sal_uInt8 >( "char-type", mxSpTypes );
dumpDec< sal_uInt8 >( "char-count" );
break;
- case OOBIN_TOK_ATTR_IFERROR:
+ case BIFF_TOK_ATTR_IFERROR:
dumpDec< sal_uInt16 >( "skip" );
break;
default:
@@ -967,19 +965,19 @@ OUString FormulaObject::dumpaddDataArrayValue()
OUStringBuffer aValue;
switch( dumpDec< sal_uInt8 >( "type", "ARRAYVALUE-TYPE" ) )
{
- case OOBIN_TOK_ARRAY_DOUBLE:
+ case BIFF_TOK_ARRAY_DOUBLE:
dumpDec< double >( "value" );
aValue.append( mxOut->getLastItemValue() );
break;
- case OOBIN_TOK_ARRAY_STRING:
+ case BIFF_TOK_ARRAY_STRING:
aValue.append( dumpString( "value", false, false ) );
StringHelper::enclose( aValue, OOX_DUMP_STRQUOTE );
break;
- case OOBIN_TOK_ARRAY_BOOL:
+ case BIFF_TOK_ARRAY_BOOL:
dumpBoolean( "value" );
aValue.append( mxOut->getLastItemValue() );
break;
- case OOBIN_TOK_ARRAY_ERROR:
+ case BIFF_TOK_ARRAY_ERROR:
dumpErrorCode( "value" );
aValue.append( mxOut->getLastItemValue() );
dumpUnused( 3 );
@@ -1006,18 +1004,22 @@ void RecordStreamObject::implDumpRecordBody()
{
switch( getRecId() )
{
- case OOBIN_ID_ARRAY:
+ case BIFF12_ID_ARRAY:
dumpRange( "array-range" );
dumpHex< sal_uInt8 >( "flags", "ARRAY-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_BINARYINDEXBLOCK:
+ case BIFF12_ID_AUTOFILTER:
+ dumpRange( "filter-range" );
+ break;
+
+ case BIFF12_ID_BINARYINDEXBLOCK:
dumpRowRange( "row-range" );
dumpUnknown( 12 );
break;
- case OOBIN_ID_BINARYINDEXROWS:
+ case BIFF12_ID_BINARYINDEXROWS:
{
sal_uInt32 nUsedRows = dumpBin< sal_uInt32 >( "used-rows" );
dumpDec< sal_Int64 >( "stream-offset" );
@@ -1027,7 +1029,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_BORDER:
+ case BIFF12_ID_BORDER:
dumpHex< sal_uInt8 >( "flags", "BORDER-FLAGS" );
dumpDec< sal_uInt16 >( "top-style", "BORDERSTYLES" );
dumpColor( "top-color" );
@@ -1041,7 +1043,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpColor( "diag-color" );
break;
- case OOBIN_ID_BRK:
+ case BIFF12_ID_BRK:
dumpDec< sal_Int32 >( "id" );
dumpDec< sal_Int32 >( "min" );
dumpDec< sal_Int32 >( "max" );
@@ -1049,7 +1051,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "pivot-break", "BOOLEAN" );
break;
- case OOBIN_ID_CALCPR:
+ case BIFF12_ID_CALCPR:
dumpDec< sal_Int32 >( "calc-id" );
dumpDec< sal_Int32 >( "calc-mode", "CALCPR-CALCMODE" );
dumpDec< sal_Int32 >( "iteration-count" );
@@ -1058,46 +1060,46 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt16 >( "flags", "CALCPR-FLAGS" );
break;
- case OOBIN_ID_CELL_BLANK:
+ case BIFF12_ID_CELL_BLANK:
dumpCellHeader( true );
break;
- case OOBIN_ID_CELL_BOOL:
+ case BIFF12_ID_CELL_BOOL:
dumpCellHeader( true );
dumpBoolean();
break;
- case OOBIN_ID_CELL_DOUBLE:
+ case BIFF12_ID_CELL_DOUBLE:
dumpCellHeader( true );
dumpDec< double >( "value" );
break;
- case OOBIN_ID_CELL_ERROR:
+ case BIFF12_ID_CELL_ERROR:
dumpCellHeader( true );
dumpErrorCode();
break;
- case OOBIN_ID_CELL_RK:
+ case BIFF12_ID_CELL_RK:
dumpCellHeader( true );
dumpRk( "value" );
break;
- case OOBIN_ID_CELL_RSTRING:
+ case BIFF12_ID_CELL_RSTRING:
dumpCellHeader( true );
dumpString( "value", true );
break;
- case OOBIN_ID_CELL_SI:
+ case BIFF12_ID_CELL_SI:
dumpCellHeader( true );
dumpDec< sal_Int32 >( "string-id" );
break;
- case OOBIN_ID_CELL_STRING:
+ case BIFF12_ID_CELL_STRING:
dumpCellHeader( true );
dumpString( "value" );
break;
- case OOBIN_ID_CELLSTYLE:
+ case BIFF12_ID_CELLSTYLE:
dumpDec< sal_Int32 >( "xf-id" );
dumpHex< sal_uInt16 >( "flags", "CELLSTYLE-FLAGS" );
dumpDec< sal_uInt8 >( "builtin-id", "CELLSTYLE-BUILTIN" );
@@ -1105,11 +1107,11 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_CFCOLOR:
+ case BIFF12_ID_CFCOLOR:
dumpColor();
break;
- case OOBIN_ID_CFRULE:
+ case BIFF12_ID_CFRULE:
{
// type/subtype/operator is a mess...
dumpDec< sal_Int32 >( "type", "CFRULE-TYPE" );
@@ -1153,7 +1155,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_CHARTPAGESETUP:
+ case BIFF12_ID_CHARTPAGESETUP:
dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
dumpDec< sal_Int32 >( "vertical-res", "PAGESETUP-DPI" );
@@ -1163,75 +1165,110 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "printer-settings-rel-id" );
break;
- case OOBIN_ID_CHARTPROTECTION:
+ case BIFF12_ID_CHARTPROTECTION:
dumpHex< sal_uInt16 >( "password-hash" );
// no flags field for the boolean flags?!?
dumpDec< sal_Int32 >( "content-locked", "BOOLEAN" );
dumpDec< sal_Int32 >( "objects-locked", "BOOLEAN" );
break;
- case OOBIN_ID_CHARTSHEETPR:
+ case BIFF12_ID_CHARTSHEETPR:
dumpHex< sal_uInt16 >( "flags", "CHARTSHEETPR-FLAGS" );
dumpColor( "tab-color" );
dumpString( "codename" );
break;
- case OOBIN_ID_CHARTSHEETVIEW:
+ case BIFF12_ID_CHARTSHEETVIEW:
dumpHex< sal_uInt16 >( "flags", "CHARTSHEETVIEW-FLAGS" );
dumpDec< sal_Int32 >( "zoom-scale", "CONV-PERCENT" );
dumpDec< sal_Int32 >( "workbookview-id" );
break;
- case OOBIN_ID_COL:
+ case BIFF12_ID_COL:
dumpColRange();
dumpDec< sal_Int32 >( "col-width", "CONV-COLWIDTH" );
dumpDec< sal_Int32 >( "custom-xf-id" );
dumpHex< sal_uInt16 >( "flags", "COL-FLAGS" );
break;
- case OOBIN_ID_COLBREAKS:
+ case BIFF12_ID_COLBREAKS:
dumpDec< sal_Int32 >( "count" );
dumpDec< sal_Int32 >( "manual-count" );
break;
- case OOBIN_ID_COLOR:
+ case BIFF12_ID_COLOR:
dumpColor();
break;
- case OOBIN_ID_COMMENT:
+ case BIFF12_ID_COMMENT:
dumpDec< sal_Int32 >( "author-id" );
dumpRange( "ref" );
dumpGuid();
break;
- case OOBIN_ID_COMMENTAUTHOR:
+ case BIFF12_ID_COMMENTAUTHOR:
dumpString( "author" );
break;
- case OOBIN_ID_COMMENTTEXT:
+ case BIFF12_ID_COMMENTTEXT:
dumpString( "text", true );
break;
- case OOBIN_ID_CONDFORMATTING:
+ case BIFF12_ID_CONDFORMATTING:
dumpDec< sal_Int32 >( "cfrule-count" );
dumpDec< sal_Int32 >( "pivot-table", "BOOLEAN" );
dumpRangeList();
break;
- case OOBIN_ID_CONTROL:
+ case BIFF12_ID_CONNECTION:
+ {
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpDec< sal_uInt8 >( "save-password", "CONNECTION-SAVEPASSWORD" );
+ dumpUnused( 1 );
+ dumpDec< sal_uInt16 >( "refresh-interval", "CONNECTION-INTERVAL" );
+ dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+ sal_uInt16 nStrFlags = dumpHex< sal_uInt16 >( "string-flags", "CONNECTION-STRINGFLAGS" );
+ dumpDec< sal_Int32 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+ dumpDec< sal_Int32 >( "id" );
+ dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+ if( nStrFlags & 0x0001 ) dumpString( "source-file" );
+ if( nStrFlags & 0x0002 ) dumpString( "source-conn-file" );
+ if( nStrFlags & 0x0004 ) dumpString( "description" );
+ if( nStrFlags & 0x0008 ) dumpString( "name" );
+ if( nStrFlags & 0x0010 ) dumpString( "sso-id" );
+ }
+ break;
+
+ case BIFF12_ID_CONTROL:
dumpDec< sal_Int32 >( "shape-id" );
dumpString( "rel-id" );
dumpString( "name" );
break;
- case OOBIN_ID_DATATABLE:
+ case BIFF12_ID_CUSTOMFILTER:
+ {
+ sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "CUSTOMFILTER-DATATYPE" );
+ dumpDec< sal_uInt8 >( "operator", "CUSTOMFILTER-OPERATOR" );
+ switch( nType )
+ {
+ case 4: dumpDec< double >( "value" ); break;
+ case 6: dumpUnused( 8 ); dumpString( "value" ); break;
+ case 8: dumpBoolean( "value" ); dumpUnused( 7 ); break;
+ default: dumpUnused( 8 );
+ }
+ }
+ break;
+
+ case BIFF12_ID_DATATABLE:
dumpRange( "table-range" );
dumpAddress( "ref1" );
dumpAddress( "ref2" );
dumpHex< sal_uInt8 >( "flags", "DATATABLE-FLAGS" );
break;
- case OOBIN_ID_DATAVALIDATION:
+ case BIFF12_ID_DATAVALIDATION:
dumpHex< sal_uInt32 >( "flags", "DATAVALIDATION-FLAGS" );
dumpRangeList();
dumpString( "error-title" );
@@ -1242,7 +1279,7 @@ void RecordStreamObject::implDumpRecordBody()
mxFmlaObj->dumpNameFormula( "formula2" );
break;
- case OOBIN_ID_DATAVALIDATIONS:
+ case BIFF12_ID_DATAVALIDATIONS:
dumpHex< sal_uInt16 >( "flags", "DATAVALIDATIONS-FLAGS" );
dumpDec< sal_Int32 >( "input-x" );
dumpDec< sal_Int32 >( "input-y" );
@@ -1250,16 +1287,16 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "count" );
break;
- case OOBIN_ID_DDEITEMVALUES:
+ case BIFF12_ID_DDEITEMVALUES:
dumpDec< sal_Int32 >( "rows" );
dumpDec< sal_Int32 >( "columns" );
break;
- case OOBIN_ID_DDEITEM_STRING:
+ case BIFF12_ID_DDEITEM_STRING:
dumpString( "value" );
break;
- case OOBIN_ID_DEFINEDNAME:
+ case BIFF12_ID_DEFINEDNAME:
dumpHex< sal_uInt32 >( "flags", "DEFINEDNAME-FLAGS" );
dumpChar( "accelerator", RTL_TEXTENCODING_ISO_8859_1 );
dumpDec< sal_Int32 >( "sheet-id", "DEFINEDNAME-SHEETID" );
@@ -1272,15 +1309,24 @@ void RecordStreamObject::implDumpRecordBody()
if( mxStrm->getRemaining() >= 4 ) dumpString( "statusbar-text" );
break;
- case OOBIN_ID_DIMENSION:
+ case BIFF12_ID_DIMENSION:
dumpRange( "used-range" );
break;
- case OOBIN_ID_DRAWING:
+ case BIFF12_ID_DISCRETEFILTER:
+ dumpString( "value" );
+ break;
+
+ case BIFF12_ID_DISCRETEFILTERS:
+ dumpBool< sal_Int32 >( "show-blank" );
+ dumpDec< sal_Int32 >( "calendar-type", "DISCRETEFILTERS-CALTYPE" );
+ break;
+
+ case BIFF12_ID_DRAWING:
dumpString( "rel-id" );
break;
- case OOBIN_ID_DXF:
+ case BIFF12_ID_DXF:
dumpHex< sal_uInt32 >( "flags", "DXF-FLAGS" );
for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "subrec-count" ); !mxStrm->isEof() && (nIndex < nCount); ++nIndex )
{
@@ -1377,27 +1423,27 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTCELL_BOOL:
+ case BIFF12_ID_EXTCELL_BOOL:
dumpColIndex();
dumpBoolean();
break;
- case OOBIN_ID_EXTCELL_DOUBLE:
+ case BIFF12_ID_EXTCELL_DOUBLE:
dumpColIndex();
dumpDec< double >( "value" );
break;
- case OOBIN_ID_EXTCELL_ERROR:
+ case BIFF12_ID_EXTCELL_ERROR:
dumpColIndex();
dumpErrorCode();
break;
- case OOBIN_ID_EXTCELL_STRING:
+ case BIFF12_ID_EXTCELL_STRING:
dumpColIndex();
dumpString( "value" );
break;
- case OOBIN_ID_EXTERNALBOOK:
+ case BIFF12_ID_EXTERNALBOOK:
switch( dumpDec< sal_uInt16 >( "type", "EXTERNALBOOK-TYPE" ) )
{
case 0:
@@ -1415,21 +1461,21 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTERNALNAME:
+ case BIFF12_ID_EXTERNALNAME:
dumpString( "name" );
break;
- case OOBIN_ID_EXTERNALNAMEFLAGS:
+ case BIFF12_ID_EXTERNALNAMEFLAGS:
dumpHex< sal_uInt16 >( "flags", "EXTERNALNAMEFLAGS-FLAGS" );
dumpDec< sal_Int32 >( "sheet-id" );
dumpBoolean( "is-dde-ole" );
break;
- case OOBIN_ID_EXTERNALREF:
+ case BIFF12_ID_EXTERNALREF:
dumpString( "rel-id" );
break;
- case OOBIN_ID_EXTERNALSHEETS:
+ case BIFF12_ID_EXTERNALSHEETS:
{
sal_Int32 nCount = dumpDec< sal_Int32 >( "ref-count" );
TableGuard aTabGuard( mxOut, 13, 17, 24 );
@@ -1445,28 +1491,28 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTROW:
+ case BIFF12_ID_EXTROW:
dumpRowIndex();
break;
- case OOBIN_ID_EXTSHEETDATA:
+ case BIFF12_ID_EXTSHEETDATA:
dumpDec< sal_Int32 >( "sheet-id" );
dumpHex< sal_uInt8 >( "flags", "EXTSHEETDATA-FLAGS" );
break;
- case OOBIN_ID_EXTSHEETNAMES:
+ case BIFF12_ID_EXTSHEETNAMES:
mxOut->resetItemIndex();
for( sal_Int32 nSheet = 0, nCount = dumpDec< sal_Int32 >( "sheet-count" ); !mxStrm->isEof() && (nSheet < nCount); ++nSheet )
dumpString( "#sheet-name" );
break;
- case OOBIN_ID_FILESHARING:
+ case BIFF12_ID_FILESHARING:
dumpBool< sal_uInt16 >( "recommend-read-only" );
dumpHex< sal_uInt16 >( "password-hash" );
dumpString( "password-creator" );
break;
- case OOBIN_ID_FILL:
+ case BIFF12_ID_FILL:
dumpDec< sal_Int32 >( "fill-pattern", "FILLPATTERNS" );
dumpColor( "fg-color" );
dumpColor( "bg-color" );
@@ -1481,7 +1527,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_FILEVERSION:
+ case BIFF12_ID_FILEVERSION:
dumpGuid( "codename" );
dumpString( "app-name" );
dumpString( "last-edited" );
@@ -1489,7 +1535,12 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "build-version" );
break;
- case OOBIN_ID_FONT:
+ case BIFF12_ID_FILTERCOLUMN:
+ dumpDec< sal_Int32 >( "column-index" );
+ dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" );
+ break;
+
+ case BIFF12_ID_FONT:
dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
dumpHex< sal_uInt16 >( "flags", "FONT-FLAGS" );
dumpDec< sal_uInt16 >( "weight", "FONT-WEIGHT" );
@@ -1503,39 +1554,39 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_FORMULA_BOOL:
+ case BIFF12_ID_FORMULA_BOOL:
dumpCellHeader( true );
dumpBoolean();
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_DOUBLE:
+ case BIFF12_ID_FORMULA_DOUBLE:
dumpCellHeader( true );
dumpDec< double >( "value" );
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_ERROR:
+ case BIFF12_ID_FORMULA_ERROR:
dumpCellHeader( true );
dumpErrorCode();
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_STRING:
+ case BIFF12_ID_FORMULA_STRING:
dumpCellHeader( true );
dumpString( "value" );
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FUNCTIONGROUP:
+ case BIFF12_ID_FUNCTIONGROUP:
dumpString( "name" );
break;
- case OOBIN_ID_HEADERFOOTER:
+ case BIFF12_ID_HEADERFOOTER:
dumpHex< sal_uInt16 >( "flags", "HEADERFOOTER-FLAGS" );
dumpString( "odd-header" );
dumpString( "odd-footer" );
@@ -1545,7 +1596,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "first-footer" );
break;
- case OOBIN_ID_HYPERLINK:
+ case BIFF12_ID_HYPERLINK:
dumpRange();
dumpString( "rel-id" );
dumpString( "location" );
@@ -1553,84 +1604,84 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "display" );
break;
- case OOBIN_ID_INPUTCELLS:
+ case BIFF12_ID_INPUTCELLS:
dumpAddress( "pos" );
dumpUnused( 8 );
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpString( "value" );
break;
- case OOBIN_ID_LEGACYDRAWING:
+ case BIFF12_ID_LEGACYDRAWING:
dumpString( "rel-id" );
break;
- case OOBIN_ID_MERGECELL:
+ case BIFF12_ID_MERGECELL:
dumpRange();
break;
- case OOBIN_ID_MULTCELL_BLANK:
+ case BIFF12_ID_MULTCELL_BLANK:
dumpCellHeader( false );
break;
- case OOBIN_ID_MULTCELL_BOOL:
+ case BIFF12_ID_MULTCELL_BOOL:
dumpCellHeader( false );
dumpBoolean();
break;
- case OOBIN_ID_MULTCELL_DOUBLE:
+ case BIFF12_ID_MULTCELL_DOUBLE:
dumpCellHeader( false );
dumpDec< double >( "value" );
break;
- case OOBIN_ID_MULTCELL_ERROR:
+ case BIFF12_ID_MULTCELL_ERROR:
dumpCellHeader( false );
dumpErrorCode();
break;
- case OOBIN_ID_MULTCELL_RK:
+ case BIFF12_ID_MULTCELL_RK:
dumpCellHeader( false );
dumpRk( "value" );
break;
- case OOBIN_ID_MULTCELL_RSTRING:
+ case BIFF12_ID_MULTCELL_RSTRING:
dumpCellHeader( false );
dumpString( "value", true );
break;
- case OOBIN_ID_MULTCELL_SI:
+ case BIFF12_ID_MULTCELL_SI:
dumpCellHeader( false );
dumpDec< sal_Int32 >( "string-id" );
break;
- case OOBIN_ID_MULTCELL_STRING:
+ case BIFF12_ID_MULTCELL_STRING:
dumpCellHeader( false );
dumpString( "value" );
break;
- case OOBIN_ID_NUMFMT:
+ case BIFF12_ID_NUMFMT:
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpString( "format" );
break;
- case OOBIN_ID_OLEOBJECT:
+ case BIFF12_ID_OLEOBJECT:
{
dumpDec< sal_Int32 >( "aspect", "OLEOBJECT-ASPECT" );
dumpDec< sal_Int32 >( "update", "OLEOBJECT-UPDATE" );
dumpDec< sal_Int32 >( "shape-id" );
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "OLEOBJECT-FLAGS" );
dumpString( "prog-id" );
- if( getFlag( nFlags, OOBIN_OLEOBJECT_LINKED ) )
+ if( getFlag( nFlags, BIFF12_OLEOBJECT_LINKED ) )
mxFmlaObj->dumpNameFormula( "link" );
else
dumpString( "rel-id" );
}
break;
- case OOBIN_ID_OLESIZE:
+ case BIFF12_ID_OLESIZE:
dumpRange( "visible-range" );
break;
- case OOBIN_ID_PAGEMARGINS:
+ case BIFF12_ID_PAGEMARGINS:
dumpDec< double >( "left-margin" );
dumpDec< double >( "right-margin" );
dumpDec< double >( "top-margin" );
@@ -1639,7 +1690,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< double >( "footer-margin" );
break;
- case OOBIN_ID_PAGESETUP:
+ case BIFF12_ID_PAGESETUP:
dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
dumpDec< sal_Int32 >( "scaling", "CONV-PERCENT" );
dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
@@ -1652,7 +1703,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "printer-settings-rel-id" );
break;
- case OOBIN_ID_PANE:
+ case BIFF12_ID_PANE:
dumpDec< double >( "x-split-pos" );
dumpDec< double >( "y-split-pos" );
dumpAddress( "second-top-left" );
@@ -1660,7 +1711,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt8 >( "flags", "PANE-FLAGS" );
break;
- case OOBIN_ID_PCDEFINITION:
+ case BIFF12_ID_PCDEFINITION:
{
dumpDec< sal_uInt8 >( "refreshed-version" );
dumpDec< sal_uInt8 >( "min-refresh-version" );
@@ -1675,7 +1726,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDFIELD:
+ case BIFF12_ID_PCDFIELD:
{
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFIELD-FLAGS" );
dumpDec< sal_Int32 >( "numfmt-id" );
@@ -1695,12 +1746,12 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDFIELDGROUP:
+ case BIFF12_ID_PCDFIELDGROUP:
dumpDec< sal_Int32 >( "parent-field" );
dumpDec< sal_Int32 >( "base-field" );
break;
- case OOBIN_ID_PCDFRANGEPR:
+ case BIFF12_ID_PCDFRANGEPR:
dumpDec< sal_uInt8 >( "group-by", "PCDFRANGEPR-GROUPBY" );
dumpHex< sal_uInt8 >( "flags", "PCDFRANGEPR-FLAGS" );
dumpDec< double >( "start-value" );
@@ -1708,7 +1759,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< double >( "interval" );
break;
- case OOBIN_ID_PCDFSHAREDITEMS:
+ case BIFF12_ID_PCDFSHAREDITEMS:
{
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFSHAREDITEMS-FLAGS" );
dumpDec< sal_Int32 >( "count" );
@@ -1717,7 +1768,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDSHEETSOURCE:
+ case BIFF12_ID_PCDSHEETSOURCE:
{
sal_uInt8 nIsDefName = dumpBoolean( "is-def-name" );
dumpBoolean( "is-builtin-def-name" );
@@ -1728,12 +1779,12 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDSOURCE:
+ case BIFF12_ID_PCDSOURCE:
dumpDec< sal_Int32 >( "source-type", "PCDSOURCE-TYPE" );
dumpDec< sal_Int32 >( "connection-id" );
break;
- case OOBIN_ID_PCITEM_ARRAY:
+ case BIFF12_ID_PCITEM_ARRAY:
{
sal_uInt16 nType = dumpDec< sal_uInt16 >( "type", "PCITEM_ARRAY-TYPE" );
sal_Int32 nCount = dumpDec< sal_Int32 >( "count" );
@@ -1752,97 +1803,97 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCITEM_BOOL:
+ case BIFF12_ID_PCITEM_BOOL:
dumpBoolean( "value" );
break;
- case OOBIN_ID_PCITEM_DATE:
+ case BIFF12_ID_PCITEM_DATE:
dumpPivotDateTime( "value" );
break;
- case OOBIN_ID_PCITEM_DOUBLE:
+ case BIFF12_ID_PCITEM_DOUBLE:
dumpDec< double >( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_ERROR:
+ case BIFF12_ID_PCITEM_ERROR:
dumpErrorCode( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_INDEX:
+ case BIFF12_ID_PCITEM_INDEX:
dumpDec< sal_Int32 >( "index" );
break;
- case OOBIN_ID_PCITEM_MISSING:
+ case BIFF12_ID_PCITEM_MISSING:
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_STRING:
+ case BIFF12_ID_PCITEM_STRING:
dumpString( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEMA_BOOL:
+ case BIFF12_ID_PCITEMA_BOOL:
dumpBoolean( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_DATE:
+ case BIFF12_ID_PCITEMA_DATE:
dumpPivotDateTime( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_DOUBLE:
+ case BIFF12_ID_PCITEMA_DOUBLE:
dumpDec< double >( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_ERROR:
+ case BIFF12_ID_PCITEMA_ERROR:
dumpErrorCode( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_MISSING:
+ case BIFF12_ID_PCITEMA_MISSING:
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_STRING:
+ case BIFF12_ID_PCITEMA_STRING:
dumpString( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PHONETICPR:
+ case BIFF12_ID_PHONETICPR:
dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
dumpDec< sal_Int32 >( "type", "PHONETICPR-TYPE" );
dumpDec< sal_Int32 >( "alignment", "PHONETICPR-ALIGNMENT" );
break;
- case OOBIN_ID_PICTURE:
+ case BIFF12_ID_PICTURE:
dumpString( "rel-id" );
break;
- case OOBIN_ID_PIVOTAREA:
+ case BIFF12_ID_PIVOTAREA:
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_uInt8 >( "type", "PIVOTAREA-TYPE" );
dumpHex< sal_uInt8 >( "flags-1", "PIVOTAREA-FLAGS1" );
dumpHex< sal_uInt16 >( "flags-2", "PIVOTAREA-FLAGS2" );
break;
- case OOBIN_ID_PIVOTCACHE:
+ case BIFF12_ID_PIVOTCACHE:
dumpDec< sal_Int32 >( "cache-id" );
dumpString( "rel-id" );
break;
- case OOBIN_ID_PTCOLFIELDS:
+ case BIFF12_ID_PTCOLFIELDS:
dumpDec< sal_Int32 >( "count" );
mxOut->resetItemIndex();
while( mxStrm->getRemaining() >= 4 )
dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
break;
- case OOBIN_ID_PTDATAFIELD:
+ case BIFF12_ID_PTDATAFIELD:
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "subtotal", "PTDATAFIELD-SUBTOTAL" );
dumpDec< sal_Int32 >( "show-data-as", "PTDATAFIELD-SHOWDATAAS" );
@@ -1853,7 +1904,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_PTDEFINITION:
+ case BIFF12_ID_PTDEFINITION:
{
dumpDec< sal_uInt8 >( "created-version" );
dumpHex< sal_uInt8 >( "flags-1", "PTDEFINITION-FLAGS1" );
@@ -1883,7 +1934,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTFIELD:
+ case BIFF12_ID_PTFIELD:
dumpHex< sal_uInt32 >( "flags-1", "PTFIELD-FLAGS1" );
dumpDec< sal_Int32 >( "num-fmt" );
dumpHex< sal_uInt32 >( "flags-2", "PTFIELD-FLAGS2" );
@@ -1891,7 +1942,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "autoshow-datafield-idx" );
break;
- case OOBIN_ID_PTFILTER:
+ case BIFF12_ID_PTFILTER:
{
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "member-prop-field" );
@@ -1908,7 +1959,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTFITEM:
+ case BIFF12_ID_PTFITEM:
{
dumpDec< sal_uInt8 >( "type", "PTFITEM-TYPE" );
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PTFITEM-FLAGS" );
@@ -1917,7 +1968,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTLOCATION:
+ case BIFF12_ID_PTLOCATION:
dumpRange( "location" );
dumpDec< sal_Int32 >( "first-header-row" );
dumpDec< sal_Int32 >( "first-data-row" );
@@ -1926,7 +1977,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "page-col-count" );
break;
- case OOBIN_ID_PTPAGEFIELD:
+ case BIFF12_ID_PTPAGEFIELD:
{
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "cache-item", "PTPAGEFIELD-ITEM" );
@@ -1937,21 +1988,28 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTREFERENCE:
+ case BIFF12_ID_PTREFERENCE:
dumpDec< sal_Int32 >( "field", "PT-FIELDINDEX" );
dumpDec< sal_Int32 >( "item-count" );
dumpHex< sal_uInt16 >( "flags-1", "PTREFERENCE-FLAGS1" );
dumpHex< sal_uInt8 >( "flags-2", "PTREFERENCE-FLAGS2" );
break;
- case OOBIN_ID_PTROWFIELDS:
+ case BIFF12_ID_PTROWFIELDS:
dumpDec< sal_Int32 >( "count" );
mxOut->resetItemIndex();
while( mxStrm->getRemaining() >= 4 )
dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
break;
- case OOBIN_ID_ROW:
+ case BIFF12_ID_QUERYTABLE:
+ dumpHex< sal_uInt32 >( "flags", "QUERYTABLE-FLAGS" );
+ dumpDec< sal_uInt16 >( "autoformat-id" );
+ dumpDec< sal_Int32 >( "connection-id" );
+ dumpString( "defined-name" );
+ break;
+
+ case BIFF12_ID_ROW:
dumpRowIndex();
dumpDec< sal_Int32 >( "custom-xf-id" );
dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
@@ -1962,12 +2020,12 @@ void RecordStreamObject::implDumpRecordBody()
dumpRowRange( "#row-spans" );
break;
- case OOBIN_ID_ROWBREAKS:
+ case BIFF12_ID_ROWBREAKS:
dumpDec< sal_Int32 >( "count" );
dumpDec< sal_Int32 >( "manual-count" );
break;
- case OOBIN_ID_SCENARIO:
+ case BIFF12_ID_SCENARIO:
dumpDec< sal_uInt16 >( "cell-count" );
// two longs instead of flag field
dumpDec< sal_Int32 >( "locked", "BOOLEAN" );
@@ -1977,32 +2035,32 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "user" );
break;
- case OOBIN_ID_SCENARIOS:
+ case BIFF12_ID_SCENARIOS:
dumpDec< sal_uInt16 >( "selected" );
dumpDec< sal_uInt16 >( "shown" );
dumpRangeList( "result-cells" );
break;
- case OOBIN_ID_SELECTION:
+ case BIFF12_ID_SELECTION:
dumpDec< sal_Int32 >( "pane", "PANE-ID" );
dumpAddress( "active-cell" );
dumpDec< sal_Int32 >( "active-cell-id" );
dumpRangeList( "selection" );
break;
- case OOBIN_ID_SHAREDFMLA:
+ case BIFF12_ID_SHAREDFMLA:
dumpRange( "formula-range" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_SHEET:
+ case BIFF12_ID_SHEET:
dumpDec< sal_Int32 >( "sheet-state", "SHEET-STATE" );
dumpDec< sal_Int32 >( "sheet-id" );
dumpString( "rel-id" );
dumpString( "sheet-name" );
break;
- case OOBIN_ID_SHEETFORMATPR:
+ case BIFF12_ID_SHEETFORMATPR:
dumpDec< sal_Int32 >( "default-col-width", "CONV-COLWIDTH" );
dumpDec< sal_uInt16 >( "base-col-width" );
dumpDec< sal_uInt16 >( "default-row-height", "CONV-TWIP-TO-PT" );
@@ -2011,7 +2069,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_uInt8 >( "max-col-outline" );
break;
- case OOBIN_ID_SHEETPR:
+ case BIFF12_ID_SHEETPR:
dumpHex< sal_uInt16 >( "flags1", "SHEETPR-FLAGS1" );
dumpHex< sal_uInt8 >( "flags2", "SHEETPR-FLAGS2" );
dumpColor( "tab-color" );
@@ -2019,7 +2077,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "codename" );
break;
- case OOBIN_ID_SHEETPROTECTION:
+ case BIFF12_ID_SHEETPROTECTION:
dumpHex< sal_uInt16 >( "password-hash" );
// no flags field for all these boolean flags?!?
dumpDec< sal_Int32 >( "sheet-locked", "BOOLEAN" );
@@ -2040,7 +2098,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "select-unlocked-cells-locked", "BOOLEAN" );
break;
- case OOBIN_ID_SHEETVIEW:
+ case BIFF12_ID_SHEETVIEW:
dumpHex< sal_uInt16 >( "flags", "SHEETVIEW-FLAGS" );
dumpDec< sal_Int32 >( "view-type", "SHEETVIEW-TYPE" );
dumpAddress( "top-left" );
@@ -2052,16 +2110,16 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "workbookview-id" );
break;
- case OOBIN_ID_SI:
+ case BIFF12_ID_SI:
dumpString( "string", true );
break;
- case OOBIN_ID_SST:
+ case BIFF12_ID_SST:
dumpDec< sal_Int32 >( "string-cell-count" );
dumpDec< sal_Int32 >( "sst-size" );
break;
- case OOBIN_ID_TABLE:
+ case BIFF12_ID_TABLE:
dumpRange();
dumpDec< sal_Int32 >( "type", "TABLE-TYPE" );
dumpDec< sal_Int32 >( "id" );
@@ -2083,41 +2141,51 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "totalsrow-cell-style" );
break;
- case OOBIN_ID_TABLEPART:
+ case BIFF12_ID_TABLEPART:
dumpString( "rel-id" );
break;
- case OOBIN_ID_TABLESTYLEINFO:
+ case BIFF12_ID_TABLESTYLEINFO:
dumpHex< sal_uInt16 >( "flags", "TABLESTYLEINFO-FLAGS" );
dumpString( "style-name" );
break;
- case OOBIN_ID_TOP10FILTER:
+ case BIFF12_ID_TOP10FILTER:
dumpHex< sal_uInt8 >( "flags", "TOP10FILTER-FLAGS" );
dumpDec< double >( "value" );
dumpDec< double >( "cell-value" );
break;
- case OOBIN_ID_VOLTYPEMAIN:
+ case BIFF12_ID_VOLTYPEMAIN:
dumpString( "first" );
break;
- case OOBIN_ID_VOLTYPESTP:
+ case BIFF12_ID_VOLTYPESTP:
dumpString( "topic-value" );
break;
- case OOBIN_ID_VOLTYPETR:
+ case BIFF12_ID_VOLTYPETR:
dumpAddress( "ref" );
dumpDec< sal_Int32 >( "sheet-id" );
break;
- case OOBIN_ID_WORKBOOKPR:
+ case BIFF12_ID_WEBPR:
+ {
+ dumpHex< sal_uInt32 >( "flags", "WEBPR-FLAGS" );
+ sal_uInt8 nStrFlags = dumpHex< sal_uInt8 >( "string-flags", "WEBPR-STRINGFLAGS" );
+ if( nStrFlags & 0x04 ) dumpString( "url" );
+ if( nStrFlags & 0x01 ) dumpString( "post-method" );
+ if( nStrFlags & 0x02 ) dumpString( "edit-page" );
+ }
+ break;
+
+ case BIFF12_ID_WORKBOOKPR:
dumpHex< sal_uInt32 >( "flags", "WORKBBOKPR-FLAGS" );
dumpDec< sal_Int32 >( "default-theme-version" );
dumpString( "codename" );
break;
- case OOBIN_ID_WORKBOOKVIEW:
+ case BIFF12_ID_WORKBOOKVIEW:
dumpDec< sal_Int32 >( "x-window" );
dumpDec< sal_Int32 >( "y-window" );
dumpDec< sal_Int32 >( "win-width" );
@@ -2128,7 +2196,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt8 >( "flags", "WORKBOOKVIEW-FLAGS" );
break;
- case OOBIN_ID_XF:
+ case BIFF12_ID_XF:
dumpDec< sal_uInt16 >( "parent-xf-id" );
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
@@ -2219,6 +2287,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons
rStrgPath.equalsAscii( "xl/macrosheets" ) ||
rStrgPath.equalsAscii( "xl/pivotCache" ) ||
rStrgPath.equalsAscii( "xl/pivotTables" ) ||
+ rStrgPath.equalsAscii( "xl/queryTables" ) ||
rStrgPath.equalsAscii( "xl/tables" ) ||
rStrgPath.equalsAscii( "xl/worksheets" ) )
{
@@ -2269,4 +2338,3 @@ void Dumper::implDump()
} // namespace oox
#endif
-
diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini
index f2ac3b49b4d6..3490111c4ba5 100644
--- a/oox/source/dump/xlsbdumper.ini
+++ b/oox/source/dump/xlsbdumper.ini
@@ -174,18 +174,20 @@ multilist=RECORD-NAMES
0x0088=BOOKVIEWS_END,SHEETVIEW,SHEETVIEW_END,CHARTSHEETVIEWS,CHARTSHEETVIEWS_END,CHARTSHEETVIEW,CHARTSHEETVIEW_END,SHEETS
0x0090=SHEETS_END,SHEETDATA,SHEETDATA_END,SHEETPR,DIMENSION,,,PANE
0x0098=SELECTION,WORKBOOKPR,SMARTTAGPR,FILERECOVERYPR,SHEET,CALCPR,WORKBOOKVIEW,SST
- 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,FILTERS,FILTERS_END,FILTER
- 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AUTOFILTERDATEGROUPITEM
+ 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,DISCRETEFILTERS,DISCRETEFILTERS_END,DISCRETEFILTER
+ 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AFDATEGROUPITEM
0x00B0=MERGECELL,MERGECELLS,MERGECELLS_END,PCDEFINITION,PCDEFINITION_END,PCDFIELDS,PCDFIELDS_END,PCDFIELD
0x00B8=PCDFIELD_END,PCDSOURCE,PCDSOURCE_END,PCDSHEETSOURCE,PCDSHEETSOURCE_END,PCDFSHAREDITEMS,PCDFSHAREDITEMS_END,PCITEM_ARRAY
0x00C0=PCITEM_ARRAY_END,PCRECORDS,PCRECORDS_END,,,,,
+ 0x00C8=,CONNECTION,CONNECTION_END,,,,,
0x00D8=,,,PCDFIELDGROUP,PCDFIELDGROUP_END,PCDFGROUPITEMS,PCDFGROUPITEMS_END,PCDFRANGEPR
0x00E0=PCDFRANGEPR_END,PCDFDISCRETEPR,PCDFDISCRETEPR_END,,,,,
0x00F0=,,,,,,,PIVOTAREA
0x00F8=PIVOTAREA_END,PTREFERENCES,PTREFERENCES_END,PTREFERENCE,PTREFERENCE_END,,,
-
+ 0x0100=,,,,,WEBPR,WEBPR_END,WEBPRTABLES
+ 0x0108=WEBPRTABLES_END,,,,,,,
0x0110=,,,,,BINARYINDEX_END,STYLESHEET,STYLESHEET_END
0x0118=PTDEFINITION,PTFITEM_END,PTFITEM,PTFITEMS,PTFITEMS_END,PTFIELD,PTFIELD_END,PTFIELDS
0x0120=PTFIELDS_END,PTPAGEFIELD,PTPAGEFIELD_END,PTPAGEFIELDS,PTPAGEFIELDS_END,PTDATAFIELD,PTDATAFIELD_END,PTDATAFIELDS
@@ -203,8 +205,10 @@ multilist=RECORD-NAMES
0x0188=ROWBREAKS,ROWBREAKS_END,COLBREAKS,COLBREAKS_END,BRK,CUSTOMWORKBOOKVIEW,,
0x01A0=,,,,,,CUSTOMSHEETVIEWS,CUSTOMSHEETVIEW
- 0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,,,
+ 0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,CONNECTIONS,CONNECTIONS_END,
+ 0x01B8=,,,,,,,QUERYTABLE
+ 0x01C0=QUERYTABLE_END,QUERYTABLEREFRESH,QUERYTABLEREFRESH_END,,,,,
0x01C8=,,,AUTOSORTSCOPE,AUTOSORTSCOPE_END,CONDFORMATTING,CONDFORMATTING_END,CFRULE
0x01D0=CFRULE_END,ICONSET,ICONSET_END,DATABAR,DATABAR_END,COLORSCALE,COLORSCALE_END,CFVO
0x01D8=,COLORS,COLORS_END,RGBCOLOR,PAGEMARGINS,PRINTOPTIONS,PAGESETUP,HEADERFOOTER
@@ -238,11 +242,13 @@ end
constlist=SIMPLE-RECORDS
0x001A=int32,dec,item-index
+ 0x00AC=int32,dec,relation,CUSTOMFILTERS-RELATION
0x00B5=int32,dec,count
0x00C1=int32,dec,count
0x00DD=int32,dec,count
0x00E1=int32,dec,count
0x00F9=int32,dec,count
+ 0x0107=int32,dec,count
0x011B=int32,dec,count
0x011F=int32,dec,count
0x0123=int32,dec,count
@@ -374,6 +380,48 @@ combilist=COL-FLAGS
0x1000=outline-collapsed
end
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SAVEPASSWORD,1,on,off
+unitconverter=CONNECTION-INTERVAL,60,sec
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+shortlist=CONNECTION-RECONNECTTYPE,1,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+
+flagslist=CONNECTION-FLAGS
+ 0x0001=keep-alive
+ 0x0002=new
+ 0x0004=deleted
+ 0x0008=only-use-conn-file
+ 0x0010=background
+ 0x0020=refresh-on-load
+ 0x0040=save-data
+end
+
+flagslist=CONNECTION-STRINGFLAGS
+ 0x0001=has-source-file
+ 0x0002=has-source-conn-file
+ 0x0004=has-description
+ 0x0008=has-name
+ 0x0010=has-sso-id
+end
+
+# CUSTOMFILTER ---------------------------------------------------------------
+
+constlist=CUSTOMFILTER-DATATYPE
+ 4=double
+ 6=string
+ 8=boolean
+ 12=blank
+ 14=not-blank
+end
+
+shortlist=CUSTOMFILTER-OPERATOR,1,less,equal,less-equal,greater,not-equal,greater-equal
+
+# CUSTOMFILTERS --------------------------------------------------------------
+
+shortlist=CUSTOMFILTERS-RELATION,0,and,or
+
# DATATABLE ------------------------------------------------------------------
flagslist=DATATABLE-FLAGS
@@ -428,6 +476,10 @@ constlist=DEFINEDNAME-SHEETID
-1=global
end
+# DISCRETEFILTERS --------------------------------------------------------------------
+
+shortlist=DISCRETEFILTERS-CALTYPE,0,none,gregorian,gregorian-us,japan,taiwan,korea,hijri,thai,hebrew,gregorian-mideast-fr,gregorian-ar,gregorian-xlit-en,gregorian-xlit-fr
+
# DXF ------------------------------------------------------------------------
flagslist=DXF-FLAGS
@@ -478,6 +530,13 @@ end
shortlist=FILL-GRADIENTTYPE,0,linear,path
+# FILTERCOLUMN ---------------------------------------------------------------
+
+flagslist=FILTERCOLUMN-FLAGS
+ 0x0001=hidden-button
+ 0x0002=show-button
+end
+
# FONT -----------------------------------------------------------------------
flagslist=FONT-FLAGS
@@ -741,7 +800,7 @@ flagslist=PTDEFINITION-FLAGS3
0x00004000=col-grand-totals
0x00008000=field-print-titles
0x00020000=item-print-titles
- 0x00040000=merge-labels
+ 0x00040000=merge-item
0x00080000=has-data-caption
0x00100000=has-grand-total-caption
0x00200000=has-page-field-style
@@ -751,8 +810,8 @@ flagslist=PTDEFINITION-FLAGS3
0x02000000=apply-font
0x04000000=apply-alignment
0x08000000=apply-border
- 0x10000000=apply-pattern
- 0x20000000=protected
+ 0x10000000=apply-fill
+ 0x20000000=apply-protection
0x40000000=has-tag
end
@@ -905,6 +964,32 @@ flagslist=PTREFERENCE-FLAGS2
0x01=selected
end
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+ 0x00000001=headers
+ 0x00000002=row-numbers
+ 0x00000004=disable-refresh
+ 0x00000008=background
+ 0x00000010=first-background
+ 0x00000020=refresh-on-load
+ 0x000000C0=uint8,dec,grow-shrink,QUERYTABLE-GROWSHRINK
+ 0x00000100=fill-formulas
+ 0x00000200=save-data
+ 0x00000400=disable-edit
+ 0x00000800=preserve-formatting
+ 0x00001000=adjust-column-width
+ 0x00002000=intermediate
+ 0x00004000=apply-num-fmt
+ 0x00008000=apply-font
+ 0x00010000=apply-alignment
+ 0x00020000=apply-border
+ 0x00040000=apply-fill
+ 0x00080000=apply-protection
+end
+
+shortlist=QUERYTABLE-GROWSHRINK,0,insert-clear,insert-delete,overwrite-clear
+
# ROW ------------------------------------------------------------------------
combilist=ROW-FLAGS1
@@ -1012,6 +1097,29 @@ end
shortlist=VOLTYPE-TYPE,0,realtime-data,olap-functions
+# WEBPR ----------------------------------------------------------------------
+
+combilist=WEBPR-FLAGS
+ 0x000000FF=uint8,dec,html-format,WEBPR-HTMLFORMAT
+ 0x00000100=xml
+ 0x00000200=source-data
+ 0x00000400=parse-pre
+ 0x00000800=consecutive-delimiters
+ 0x00001000=first-row
+ 0x00002000=xl97-created
+ 0x00004000=text-dates
+ 0x00008000=xl2000-refreshed
+ 0x00010000=html-tables
+end
+
+shortlist=WEBPR-HTMLFORMAT,0,none,rtf,all
+
+flagslist=WEBPR-STRINGFLAGS
+ 0x01=has-post-method
+ 0x02=has-edit-page
+ 0x04=has-url
+end
+
# WORKBBOKPR -----------------------------------------------------------------
combilist=WORKBBOKPR-FLAGS
@@ -1076,4 +1184,3 @@ flagslist=XF-USEDFLAGS
end
# ============================================================================
-
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 5aeb56883d2d..85ef2519f029 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -25,7 +25,6 @@
*
************************************************************************/
-#include "tokens.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/drawingml.hxx"
#include "oox/export/utils.hxx"
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d33572230f1d..0d07e6cf5226 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -25,7 +25,6 @@
*
************************************************************************/
-#include "tokens.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/shapes.hxx"
#include "oox/export/utils.hxx"
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx
index 5479fae46f82..ae10c290b425 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -26,17 +26,21 @@
************************************************************************/
#include "oox/helper/attributelist.hxx"
+
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
+#include "oox/token/tokenmap.hxx"
+
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::xml::sax;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-
-namespace oox {
// ============================================================================
@@ -74,6 +78,11 @@ sal_Unicode lclGetXChar( const sal_Unicode*& rpcStr, const sal_Unicode* pcEnd )
// ----------------------------------------------------------------------------
+sal_Int32 AttributeConversion::decodeToken( const OUString& rValue )
+{
+ return StaticTokenMap::get().getTokenFromUnicode( rValue );
+}
+
OUString AttributeConversion::decodeXString( const OUString& rValue )
{
// string shorter than one encoded character - no need to decode
@@ -314,4 +323,3 @@ DateTime AttributeList::getDateTime( sal_Int32 nAttrToken, const DateTime& rDefa
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx
index a5a3cf9a2c30..2d547cdbf724 100644
--- a/oox/source/helper/binaryinputstream.cxx
+++ b/oox/source/helper/binaryinputstream.cxx
@@ -26,27 +26,32 @@
************************************************************************/
#include "oox/helper/binaryinputstream.hxx"
+
#include <string.h>
#include <vector>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryoutputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XSeekable;
-namespace oox {
+namespace {
const sal_Int32 INPUTSTREAM_BUFFERSIZE = 0x8000;
+} // namespace
+
// ============================================================================
OString BinaryInputStream::readNulCharArray()
@@ -330,4 +335,3 @@ void RelativeInputStream::skip( sal_Int32 nBytes )
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index f39ac9d8f1b2..f4ea9378aa90 100644
--- a/oox/source/helper/binaryoutputstream.cxx
+++ b/oox/source/helper/binaryoutputstream.cxx
@@ -26,19 +26,23 @@
************************************************************************/
#include "oox/helper/binaryoutputstream.hxx"
+
#include <osl/diagnose.h>
#include <string.h>
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XSeekable;
-
namespace oox {
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+namespace {
+
const sal_Int32 OUTPUTSTREAM_BUFFERSIZE = 0x8000;
+} // namespace
+
// ============================================================================
void BinaryOutputStream::writeAtom( const void* pMem, sal_uInt8 nSize )
diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx
index a8f9320ffc94..d1e11850a68c 100644
--- a/oox/source/helper/binarystreambase.cxx
+++ b/oox/source/helper/binarystreambase.cxx
@@ -26,16 +26,18 @@
************************************************************************/
#include "oox/helper/binarystreambase.hxx"
-#include <osl/diagnose.h>
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XSeekable;
+#include <osl/diagnose.h>
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+// ============================================================================
+
BinaryStreamBase::~BinaryStreamBase()
{
}
@@ -158,4 +160,3 @@ void SequenceSeekableStream::seek( sal_Int64 nPos )
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx
index 359bc87e09e9..e7f322ff10e3 100644
--- a/oox/source/helper/containerhelper.cxx
+++ b/oox/source/helper/containerhelper.cxx
@@ -26,25 +26,23 @@
************************************************************************/
#include "oox/helper/containerhelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/helper.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNameContainer;
-
-namespace oox {
// ============================================================================
@@ -162,63 +160,4 @@ OUString ContainerHelper::insertByUnusedName(
// ============================================================================
-ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) :
- mxFactory( rxFactory ),
- maServiceName( rServiceName ),
- mnIndex( 0 )
-{
- OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" );
-}
-
-ObjectContainer::~ObjectContainer()
-{
-}
-
-bool ObjectContainer::hasObject( const OUString& rObjName ) const
-{
- createContainer();
- return mxContainer.is() && mxContainer->hasByName( rObjName );
-}
-
-Any ObjectContainer::getObject( const OUString& rObjName ) const
-{
- createContainer();
- if( mxContainer.is() ) try
- {
- return mxContainer->getByName( rObjName );
- }
- catch( Exception& )
- {
- }
- return Any();
-}
-
-OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName )
-{
- createContainer();
- if( mxContainer.is() )
- {
- if( bInsertByUnusedName )
- return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj );
- if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) )
- return rObjName;
- }
- return OUString();
-}
-
-void ObjectContainer::createContainer() const
-{
- if( !mxContainer.is() && mxFactory.is() ) try
- {
- mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" );
-}
-
-// ============================================================================
-
} // namespace oox
-
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index ae664cf86668..2e5a612699e2 100644..100755
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -26,47 +26,37 @@
************************************************************************/
#include "oox/helper/graphichelper.hxx"
+
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/graphic/GraphicObject.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/seqstream.hxx>
-#include "tokens.hxx"
#include "oox/helper/containerhelper.hxx"
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-using ::rtl::OUString;
-using ::com::sun::star::awt::DeviceInfo;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::XUnitConversion;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::frame::XFrame;
-using ::com::sun::star::frame::XFramesSupplier;
-using ::com::sun::star::graphic::GraphicObject;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::graphic::XGraphicObject;
-using ::com::sun::star::graphic::XGraphicProvider;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
+#include "oox/helper/propertyset.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm )
@@ -78,13 +68,17 @@ inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm
// ============================================================================
-GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) :
- mxGraphicProvider( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY ),
+GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) :
+ mxCompContext( rxContext ),
mxStorage( rxStorage ),
maGraphicObjScheme( CREATE_OUSTRING( "vnd.sun.star.GraphicObject:" ) )
{
- ::comphelper::ComponentContext aContext( rxGlobalFactory );
- mxCompContext = aContext.getUNOContext();
+ OSL_ENSURE( mxCompContext.is(), "GraphicHelper::GraphicHelper - missing component context" );
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
+ OSL_ENSURE( xFactory.is(), "GraphicHelper::GraphicHelper - missing service factory" );
+
+ if( xFactory.is() )
+ mxGraphicProvider.set( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
//! TODO: get colors from system
maSystemPalette[ XML_3dDkShadow ] = 0x716F64;
@@ -121,9 +115,9 @@ GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalF
// if no target frame has been passed (e.g. OLE objects), try to fallback to the active frame
// TODO: we need some mechanism to keep and pass the parent frame
Reference< XFrame > xFrame = rxTargetFrame;
- if( !xFrame.is() && rxGlobalFactory.is() ) try
+ if( !xFrame.is() && xFactory.is() ) try
{
- Reference< XFramesSupplier > xFramesSupp( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW );
+ Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW );
xFrame = xFramesSupp->getActiveFrame();
}
catch( Exception& )
@@ -356,28 +350,17 @@ OUString GraphicHelper::importEmbeddedGraphicObject( const OUString& rStreamName
Size GraphicHelper::getOriginalSize( const Reference< XGraphic >& xGraphic ) const
{
- Size aSize100thMM( 0, 0 );
- Reference< XPropertySet > xGraphicPropertySet( xGraphic, UNO_QUERY_THROW );
- if ( xGraphicPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size100thMM" ) ) ) >>= aSize100thMM )
+ Size aSizeHmm;
+ PropertySet aPropSet( xGraphic );
+ if( aPropSet.getProperty( aSizeHmm, PROP_Size100thMM ) && (aSizeHmm.Width == 0) && (aSizeHmm.Height == 0) ) // MAPMODE_PIXEL used?
{
- if ( !aSize100thMM.Width && !aSize100thMM.Height )
- { // MAPMODE_PIXEL USED :-(
- Size aSourceSizePixel( 0, 0 );
- if ( xGraphicPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SizePixel" ) ) ) >>= aSourceSizePixel )
- {
- const DeviceInfo& rDeviceInfo = getDeviceInfo();
- if ( rDeviceInfo.PixelPerMeterX && rDeviceInfo.PixelPerMeterY )
- {
- aSize100thMM.Width = static_cast< sal_Int32 >( ( aSourceSizePixel.Width * 100000.0 ) / rDeviceInfo.PixelPerMeterX );
- aSize100thMM.Height = static_cast< sal_Int32 >( ( aSourceSizePixel.Height * 100000.0 ) / rDeviceInfo.PixelPerMeterY );
- }
- }
- }
+ Size aSizePixel( 0, 0 );
+ if( aPropSet.getProperty( aSizePixel, PROP_SizePixel ) )
+ aSizeHmm = convertScreenPixelToHmm( aSizePixel );
}
- return aSize100thMM;
+ return aSizeHmm;
}
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/makefile.mk b/oox/source/helper/makefile.mk
index 3518db0c6d7c..f31736faac8d 100644
--- a/oox/source/helper/makefile.mk
+++ b/oox/source/helper/makefile.mk
@@ -51,7 +51,6 @@ SLOFILES = \
$(SLO)$/progressbar.obj \
$(SLO)$/propertymap.obj \
$(SLO)$/propertyset.obj \
- $(SLO)$/recordinputstream.obj \
$(SLO)$/storagebase.obj \
$(SLO)$/textinputstream.obj \
$(SLO)$/zipstorage.obj
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx
index 6528fea5634d..7fdbe4b38134 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -26,21 +26,83 @@
************************************************************************/
#include "oox/helper/modelobjecthelper.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/helper.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Gradient;
-using ::com::sun::star::drawing::LineDash;
-using ::com::sun::star::drawing::PolyPolygonBezierCoords;
-namespace oox {
+// ============================================================================
+
+ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) :
+ mxFactory( rxFactory ),
+ maServiceName( rServiceName ),
+ mnIndex( 0 )
+{
+ OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" );
+}
+
+ObjectContainer::~ObjectContainer()
+{
+}
+
+bool ObjectContainer::hasObject( const OUString& rObjName ) const
+{
+ createContainer();
+ return mxContainer.is() && mxContainer->hasByName( rObjName );
+}
+
+Any ObjectContainer::getObject( const OUString& rObjName ) const
+{
+ createContainer();
+ if( mxContainer.is() ) try
+ {
+ return mxContainer->getByName( rObjName );
+ }
+ catch( Exception& )
+ {
+ }
+ return Any();
+}
+
+OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName )
+{
+ createContainer();
+ if( mxContainer.is() )
+ {
+ if( bInsertByUnusedName )
+ return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj );
+ if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) )
+ return rObjName;
+ }
+ return OUString();
+}
+
+void ObjectContainer::createContainer() const
+{
+ if( !mxContainer.is() && mxFactory.is() ) try
+ {
+ mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" );
+}
// ============================================================================
@@ -88,4 +150,3 @@ OUString ModelObjectHelper::insertFillBitmap( const OUString& rGraphicUrl )
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx
index 6934f2dcf8d3..1ef6531d3fb0 100644
--- a/oox/source/helper/progressbar.cxx
+++ b/oox/source/helper/progressbar.cxx
@@ -26,17 +26,19 @@
************************************************************************/
#include "oox/helper/progressbar.hxx"
+
#include <com/sun/star/task/XStatusIndicator.hpp>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::task::XStatusIndicator;
-
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
namespace {
const sal_Int32 PROGRESS_RANGE = 1000000;
@@ -182,4 +184,3 @@ ISegmentProgressBarRef SegmentProgressBar::createSegment( double fLength )
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 31072fe449e5..0c4e2cb07549 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -26,62 +26,37 @@
************************************************************************/
#include "oox/helper/propertymap.hxx"
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase2.hxx>
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include "properties.hxx"
-#include "oox/token/propertylist.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::WrappedTargetException;
-using ::com::sun::star::beans::Property;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyVetoException;
-using ::com::sun::star::beans::UnknownPropertyException;
-using ::com::sun::star::beans::XPropertyChangeListener;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
-using ::com::sun::star::beans::XVetoableChangeListener;
-
-#if OSL_DEBUG_LEVEL > 0
-#include <cstdio>
-#include <com/sun/star/style/LineSpacing.hpp>
-#include <com/sun/star/style/LineSpacingMode.hpp>
-#include <com/sun/star/text/WritingMode.hpp>
-#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using ::rtl::OString;
-using ::com::sun::star::style::LineSpacing;
-using ::com::sun::star::text::WritingMode;
-#endif
+#include <cppuhelper/implbase2.hxx>
+#include <osl/mutex.hxx>
+#include "oox/token/propertynames.hxx"
namespace oox {
// ============================================================================
-namespace {
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
-/** Thread-save singleton of a vector of all supported property names. */
-struct StaticPropertyList : public ::rtl::Static< PropertyList, StaticPropertyList > {};
+using ::rtl::OString;
+using ::rtl::OUString;
-// ----------------------------------------------------------------------------
+// ============================================================================
+
+namespace {
-typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetImplBase;
+typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetBase;
/** This class implements a generic XPropertySet.
Properties of all names and types can be set and later retrieved.
TODO: move this to comphelper or better find an existing implementation
*/
-class GenericPropertySet : public GenericPropertySetImplBase, private ::osl::Mutex
+class GenericPropertySet : public GenericPropertySetBase, private ::osl::Mutex
{
public:
explicit GenericPropertySet();
@@ -114,7 +89,7 @@ GenericPropertySet::GenericPropertySet()
GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap )
{
- const PropertyList& rPropNames = StaticPropertyList::get();
+ const PropertyNameVector& rPropNames = StaticPropertyNameVector::get();
for( PropertyMap::const_iterator aIt = rPropMap.begin(), aEnd = rPropMap.end(); aIt != aEnd; ++aIt )
maPropMap[ rPropNames[ aIt->first ] ] = aIt->second;
}
@@ -182,7 +157,7 @@ sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rProper
// ============================================================================
PropertyMap::PropertyMap() :
- mpPropNames( &StaticPropertyList::get() )
+ mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator=
{
}
@@ -193,7 +168,7 @@ PropertyMap::~PropertyMap()
/*static*/ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
{
OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" );
- return StaticPropertyList::get()[ nPropId ];
+ return StaticPropertyNameVector::get()[ nPropId ];
}
const Any* PropertyMap::getProperty( sal_Int32 nPropId ) const
@@ -241,67 +216,6 @@ Reference< XPropertySet > PropertyMap::makePropertySet() const
return new GenericPropertySet( *this );
}
-#if OSL_DEBUG_LEVEL > 0
-void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
-{
- Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
- Sequence< beans::Property > props = info->getProperties ();
-
- OSL_TRACE("dump props, len: %d", props.getLength ());
-
- for (int i=0; i < props.getLength (); i++) {
- OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
- fprintf (stderr,"%30s = ", name.getStr() );
-
- try {
- Any value = rXPropSet->getPropertyValue( props [i].Name );
-
- OUString strValue;
- sal_Int32 intValue = 0;
- sal_uInt32 uintValue = 0;
- sal_Int16 int16Value = 0;
- sal_uInt16 uint16Value = 0;
- bool boolValue = false;
- LineSpacing spacing;
-// RectanglePoint pointValue;
- WritingMode aWritingMode;
-
- if( value >>= strValue )
- fprintf (stderr,"\"%s\"\n", USS( strValue ) );
- else if( value >>= intValue )
- fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", intValue, intValue);
- else if( value >>= uintValue )
- fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", uintValue, uintValue);
- else if( value >>= int16Value )
- fprintf (stderr,"%d (hex: %x)\n", int16Value, int16Value);
- else if( value >>= uint16Value )
- fprintf (stderr,"%d (hex: %x)\n", uint16Value, uint16Value);
- else if( value >>= boolValue )
- fprintf (stderr,"%d (bool)\n", boolValue);
- else if( value >>= aWritingMode )
- fprintf (stderr, "%d writing mode\n", aWritingMode);
- else if( value >>= spacing ) {
- fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height);
- } else if( value.isExtractableTo(::getCppuType((const sal_Int32*)0))) {
- fprintf (stderr,"is extractable to int32\n");
- }
-// else if( value >>= pointValue )
-// fprintf (stderr,"%d (RectanglePoint)\n", pointValue);
- else
- fprintf (stderr,"??? <unhandled type %s>\n", USS(value.getValueTypeName()));
- } catch(Exception e) {
- fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
- }
- }
-}
-
-void PropertyMap::dump()
-{
- dump( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) );
-}
-#endif
-
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx
index e7071ba402a2..4812fdf35aa5 100644
--- a/oox/source/helper/propertyset.cxx
+++ b/oox/source/helper/propertyset.cxx
@@ -26,21 +26,21 @@
************************************************************************/
#include "oox/helper/propertyset.hxx"
-#include <rtl/strbuf.hxx>
+
#include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
#include "oox/helper/propertymap.hxx"
-using ::rtl::OUString;
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OStringBuffer;
+using ::rtl::OUString;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::beans::XPropertySet;
-
-namespace oox {
// ============================================================================
@@ -172,14 +172,6 @@ void PropertySet::setAnyProperty( const OUString& rPropName, const Any& rValue )
}
}
-#if OSL_DEBUG_LEVEL > 0
-void PropertySet::dump()
-{
- PropertyMap::dump( Reference< XPropertySet >( getXPropertySet(), UNO_QUERY ) );
-}
-#endif
-
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index 4a05f66db81b..eee2b5c5d9b2 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -26,24 +26,23 @@
************************************************************************/
#include "oox/helper/storagebase.hxx"
-#include <com/sun/star/io/XStream.hpp>
+
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/io/XStream.hpp>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-
-namespace oox {
// ============================================================================
diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx
index d6d4736f3ca2..d590781c6fd3 100755
--- a/oox/source/helper/textinputstream.cxx
+++ b/oox/source/helper/textinputstream.cxx
@@ -26,17 +26,20 @@
************************************************************************/
#include "oox/helper/textinputstream.hxx"
+
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-namespace oox {
-
// ============================================================================
namespace {
@@ -125,4 +128,3 @@ OUString TextInputStream::readLine()
// ============================================================================
} // namespace oox
-
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 384870430c39..8145e7c4e5ce 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/helper/zipstorage.hxx"
+
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
@@ -35,25 +36,20 @@
#include <comphelper/storagehelper.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::container::NoSuchElementException;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ZipStorage::ZipStorage(
const Reference< XMultiServiceFactory >& rxFactory,
const Reference< XInputStream >& rxInStream ) :
diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx
index 68a18932bf42..493d6b68c6ff 100755..100644
--- a/oox/source/ole/axbinaryreader.cxx
+++ b/oox/source/ole/axbinaryreader.cxx
@@ -26,15 +26,18 @@
************************************************************************/
#include "oox/ole/axbinaryreader.hxx"
-#include "oox/ole/olehelper.hxx"
-using ::rtl::OUString;
+#include "oox/ole/olehelper.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF;
@@ -93,7 +96,8 @@ AxFontData::AxFontData() :
mnFontEffects( 0 ),
mnFontHeight( 160 ),
mnFontCharSet( WINDOWS_CHARSET_DEFAULT ),
- mnHorAlign( AX_FONTDATA_LEFT )
+ mnHorAlign( AX_FONTDATA_LEFT ),
+ mbDblUnderline( false )
{
}
@@ -121,6 +125,7 @@ bool AxFontData::importBinaryModel( BinaryInputStream& rInStrm )
aReader.skipIntProperty< sal_uInt8 >(); // font pitch/family
aReader.readIntProperty< sal_uInt8 >( mnHorAlign );
aReader.skipIntProperty< sal_uInt16 >(); // font weight
+ mbDblUnderline = false;
return aReader.finalizeImport();
}
@@ -135,6 +140,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm )
setFlag( mnFontEffects, AX_FONTDATA_ITALIC, getFlag( aFontInfo.mnFlags, OLE_STDFONT_ITALIC ) );
setFlag( mnFontEffects, AX_FONTDATA_UNDERLINE, getFlag( aFontInfo.mnFlags, OLE_STDFONT_UNDERLINE ) );
setFlag( mnFontEffects, AX_FONTDATA_STRIKEOUT, getFlag( aFontInfo.mnFlags,OLE_STDFONT_STRIKE ) );
+ mbDblUnderline = false;
// StdFont stores font height in 1/10,000 of points
setHeightPoints( getLimitedValue< sal_Int16, sal_Int32 >( aFontInfo.mnHeight / 10000, 0, SAL_MAX_INT16 ) );
mnFontCharSet = aFontInfo.mnCharSet;
@@ -147,7 +153,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm )
bool AxFontData::importGuidAndFont( BinaryInputStream& rInStrm )
{
OUString aGuid = OleHelper::importGuid( rInStrm );
- if( aGuid.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "{AFC20920-DA4E-11CE-B943-00AA006887B4}" ) ) )
+ if( aGuid.equalsAscii( AX_GUID_CFONT ) )
return importBinaryModel( rInStrm );
if( aGuid.equalsAscii( OLE_GUID_STDFONT ) )
return importStdFont( rInStrm );
@@ -340,4 +346,3 @@ bool AxBinaryPropertyReader::startNextProperty()
} // namespace ole
} // namespace oox
-
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 82616026a505..86cc55df3127 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -26,7 +26,7 @@
************************************************************************/
#include "oox/ole/axcontrol.hxx"
-#include <rtl/tencinfo.h>
+
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
@@ -39,42 +39,50 @@
#include <com/sun/star/awt/TextAlign.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/form/binding/XBindableValue.hpp>
+#include <com/sun/star/form/binding/XListEntrySink.hpp>
+#include <com/sun/star/form/binding/XListEntrySource.hpp>
+#include <com/sun/star/form/binding/XValueBinding.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <rtl/tencinfo.h>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/helper/propertyset.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::form::XForm;
-using ::com::sun::star::form::XFormComponent;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::form;
+using namespace ::com::sun::star::form::binding;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_uInt32 COMCTL_ID_SIZE = 0x12344321;
@@ -100,28 +108,6 @@ const sal_uInt32 COMCTL_ID_PROGRESSBAR_60 = 0x97AB8A01;
// ----------------------------------------------------------------------------
-const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002;
-const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004;
-const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008;
-const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400;
-const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800;
-const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000;
-const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000;
-const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000;
-const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000;
-const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000;
-const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000;
-const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000;
-const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000;
-const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000;
-const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000;
-const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000;
-const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000;
-const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000;
-const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000;
-const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000;
-const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000;
-
const sal_uInt32 AX_CMDBUTTON_DEFFLAGS = 0x0000001B;
const sal_uInt32 AX_LABEL_DEFFLAGS = 0x0080001B;
const sal_uInt32 AX_IMAGE_DEFFLAGS = 0x0000001B;
@@ -156,30 +142,10 @@ const sal_uInt32 AX_PICPOS_BELOWRIGHT = AX_PICPOS_IMPL( TOPRIGHT, BOTTO
const sal_uInt32 AX_PICPOS_CENTER = AX_PICPOS_IMPL( CENTER, CENTER );
#undef AX_PICPOS_IMPL
-const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1;
-const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2;
-const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3;
-const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4;
-const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5;
-const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6;
-const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7;
-
-const sal_Int32 AX_SELCTION_SINGLE = 0;
-const sal_Int32 AX_SELCTION_MULTI = 1;
-const sal_Int32 AX_SELCTION_EXTENDED = 2;
-
-const sal_Int32 AX_SCROLLBAR_NONE = 0x00;
-const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01;
-const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02;
-
const sal_Int32 AX_MATCHENTRY_FIRSTLETTER = 0;
const sal_Int32 AX_MATCHENTRY_COMPLETE = 1;
const sal_Int32 AX_MATCHENTRY_NONE = 2;
-const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
-const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
-const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2;
-
const sal_Int32 AX_ORIENTATION_AUTO = -1;
const sal_Int32 AX_ORIENTATION_VERTICAL = 0;
const sal_Int32 AX_ORIENTATION_HORIZONTAL = 1;
@@ -220,14 +186,70 @@ const sal_Int16 API_STATE_UNCHECKED = 0;
const sal_Int16 API_STATE_CHECKED = 1;
const sal_Int16 API_STATE_DONTKNOW = 2;
+// ----------------------------------------------------------------------------
+
+/** Tries to extract a range address from a defined name. */
+bool lclExtractRangeFromName( CellRangeAddress& orRangeAddr, const Reference< XModel >& rxDocModel, const OUString& rAddressString )
+{
+ try
+ {
+ PropertySet aPropSet( rxDocModel );
+ Reference< XNameAccess > xRangesNA( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW );
+ Reference< XCellRangeReferrer > xReferrer( xRangesNA->getByName( rAddressString ), UNO_QUERY_THROW );
+ Reference< XCellRangeAddressable > xAddressable( xReferrer->getReferredCells(), UNO_QUERY_THROW );
+ orRangeAddr = xAddressable->getRangeAddress();
+ return true;
+ }
+ catch( Exception& )
+ {
+ }
+ return false;
+}
+
+bool lclExtractAddressFromName( CellAddress& orAddress, const Reference< XModel >& rxDocModel, const OUString& rAddressString )
+{
+ CellRangeAddress aRangeAddr;
+ if( lclExtractRangeFromName( aRangeAddr, rxDocModel, rAddressString ) &&
+ (aRangeAddr.StartColumn == aRangeAddr.EndColumn) &&
+ (aRangeAddr.StartRow == aRangeAddr.EndRow) )
+ {
+ orAddress.Sheet = aRangeAddr.Sheet;
+ orAddress.Column = aRangeAddr.StartColumn;
+ orAddress.Row = aRangeAddr.StartRow;
+ return true;
+ }
+ return false;
+}
+
+void lclPrepareConverter( PropertySet& rConverter, const Reference< XModel >& rxDocModel,
+ const OUString& rAddressString, sal_Int32 nRefSheet, bool bRange )
+{
+ if( !rConverter.is() ) try
+ {
+ Reference< XMultiServiceFactory > xFactory( rxDocModel, UNO_QUERY_THROW );
+ OUString aServiceName = bRange ?
+ CREATE_OUSTRING( "com.sun.star.table.CellRangeAddressConversion" ) :
+ CREATE_OUSTRING( "com.sun.star.table.CellAddressConversion" );
+ rConverter.set( xFactory->createInstance( aServiceName ) );
+ }
+ catch( Exception& )
+ {
+ }
+ rConverter.setProperty( PROP_XLA1Representation, rAddressString );
+ rConverter.setProperty( PROP_ReferenceSheet, nRefSheet );
+}
+
} // namespace
// ============================================================================
-ControlConverter::ControlConverter( const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
+ControlConverter::ControlConverter( const Reference< XModel >& rxDocModel,
+ const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
+ mxDocModel( rxDocModel ),
mrGraphicHelper( rGraphicHelper ),
mbDefaultColorBgr( bDefaultColorBgr )
{
+ OSL_ENSURE( mxDocModel.is(), "ControlConverter::ControlConverter - missing document model" );
}
ControlConverter::~ControlConverter()
@@ -269,11 +291,22 @@ void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSe
void ControlConverter::convertOrientation( PropertyMap& rPropMap, bool bHorizontal ) const
{
- namespace AwtScrollBarOrient = ::com::sun::star::awt::ScrollBarOrientation;
- sal_Int32 nScrollOrient = bHorizontal ? AwtScrollBarOrient::HORIZONTAL : AwtScrollBarOrient::VERTICAL;
+ sal_Int32 nScrollOrient = bHorizontal ? ScrollBarOrientation::HORIZONTAL : ScrollBarOrientation::VERTICAL;
rPropMap.setProperty( PROP_Orientation, nScrollOrient );
}
+void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nVerticalAlign ) const
+{
+ VerticalAlignment eAlign = VerticalAlignment_TOP;
+ switch( nVerticalAlign )
+ {
+ case XML_Top: eAlign = VerticalAlignment_TOP; break;
+ case XML_Center: eAlign = VerticalAlignment_MIDDLE; break;
+ case XML_Bottom: eAlign = VerticalAlignment_BOTTOM; break;
+ }
+ rPropMap.setProperty( PROP_VerticalAlign, eAlign );
+}
+
void ControlConverter::convertScrollBar( PropertyMap& rPropMap,
sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const
@@ -285,6 +318,74 @@ void ControlConverter::convertScrollBar( PropertyMap& rPropMap,
rPropMap.setProperty( bAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue, nPosition );
}
+void ControlConverter::bindToSources( const Reference< XControlModel >& rxCtrlModel,
+ const OUString& rCtrlSource, const OUString& rRowSource, sal_Int32 nRefSheet ) const
+{
+ // value binding
+ if( rCtrlSource.getLength() > 0 ) try
+ {
+ // first check if the XBindableValue interface is supported
+ Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW );
+
+ // convert address string to cell address struct
+ CellAddress aAddress;
+ if( !lclExtractAddressFromName( aAddress, mxDocModel, rCtrlSource ) )
+ {
+ lclPrepareConverter( maAddressConverter, mxDocModel, rCtrlSource, nRefSheet, false );
+ if( !maAddressConverter.getProperty( aAddress, PROP_Address ) )
+ throw RuntimeException();
+ }
+
+ // create argument sequence
+ NamedValue aValue;
+ aValue.Name = CREATE_OUSTRING( "BoundCell" );
+ aValue.Value <<= aAddress;
+ Sequence< Any > aArgs( 1 );
+ aArgs[ 0 ] <<= aValue;
+
+ // create the CellValueBinding instance and set at the control model
+ Reference< XMultiServiceFactory > xFactory( mxDocModel, UNO_QUERY_THROW );
+ Reference< XValueBinding > xBinding( xFactory->createInstanceWithArguments(
+ CREATE_OUSTRING( "com.sun.star.table.CellValueBinding" ), aArgs ), UNO_QUERY_THROW );
+ xBindable->setValueBinding( xBinding );
+ }
+ catch( Exception& )
+ {
+ }
+
+ // list entry source
+ if( rRowSource.getLength() > 0 ) try
+ {
+ // first check if the XListEntrySink interface is supported
+ Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW );
+
+ // convert address string to cell range address struct
+ CellRangeAddress aRangeAddr;
+ if( !lclExtractRangeFromName( aRangeAddr, mxDocModel, rRowSource ) )
+ {
+ lclPrepareConverter( maRangeConverter, mxDocModel, rRowSource, nRefSheet, true );
+ if( !maRangeConverter.getProperty( aRangeAddr, PROP_Address ) )
+ throw RuntimeException();
+ }
+
+ // create argument sequence
+ NamedValue aValue;
+ aValue.Name = CREATE_OUSTRING( "CellRange" );
+ aValue.Value <<= aRangeAddr;
+ Sequence< Any > aArgs( 1 );
+ aArgs[ 0 ] <<= aValue;
+
+ // create the EntrySource instance and set at the control model
+ Reference< XMultiServiceFactory > xFactory( mxDocModel, UNO_QUERY_THROW );
+ Reference< XListEntrySource > xEntrySource( xFactory->createInstanceWithArguments(
+ CREATE_OUSTRING( "com.sun.star.table.CellRangeListSource" ), aArgs ), UNO_QUERY_THROW );
+ xEntrySink->setListEntrySource( xEntrySource );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
// ActiveX (Forms 2.0) specific conversion ------------------------------------
void ControlConverter::convertAxBackground( PropertyMap& rPropMap,
@@ -319,8 +420,7 @@ void ControlConverter::convertAxBorder( PropertyMap& rPropMap,
void ControlConverter::convertAxVisualEffect( PropertyMap& rPropMap, sal_Int32 nSpecialEffect ) const
{
- namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
- sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? AwtVisualEffect::FLAT : AwtVisualEffect::LOOK3D;
+ sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? VisualEffect::FLAT : VisualEffect::LOOK3D;
rPropMap.setProperty( PROP_VisualEffect, nVisualEffect );
}
@@ -330,23 +430,22 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData
convertPicture( rPropMap, rPicData );
// picture position
- namespace AwtImagePos = ::com::sun::star::awt::ImagePosition;
- sal_Int16 nImagePos = AwtImagePos::LeftCenter;
+ sal_Int16 nImagePos = ImagePosition::LeftCenter;
switch( nPicPos )
{
- case AX_PICPOS_LEFTTOP: nImagePos = AwtImagePos::LeftTop; break;
- case AX_PICPOS_LEFTCENTER: nImagePos = AwtImagePos::LeftCenter; break;
- case AX_PICPOS_LEFTBOTTOM: nImagePos = AwtImagePos::LeftBottom; break;
- case AX_PICPOS_RIGHTTOP: nImagePos = AwtImagePos::RightTop; break;
- case AX_PICPOS_RIGHTCENTER: nImagePos = AwtImagePos::RightCenter; break;
- case AX_PICPOS_RIGHTBOTTOM: nImagePos = AwtImagePos::RightBottom; break;
- case AX_PICPOS_ABOVELEFT: nImagePos = AwtImagePos::AboveLeft; break;
- case AX_PICPOS_ABOVECENTER: nImagePos = AwtImagePos::AboveCenter; break;
- case AX_PICPOS_ABOVERIGHT: nImagePos = AwtImagePos::AboveRight; break;
- case AX_PICPOS_BELOWLEFT: nImagePos = AwtImagePos::BelowLeft; break;
- case AX_PICPOS_BELOWCENTER: nImagePos = AwtImagePos::BelowCenter; break;
- case AX_PICPOS_BELOWRIGHT: nImagePos = AwtImagePos::BelowRight; break;
- case AX_PICPOS_CENTER: nImagePos = AwtImagePos::Centered; break;
+ case AX_PICPOS_LEFTTOP: nImagePos = ImagePosition::LeftTop; break;
+ case AX_PICPOS_LEFTCENTER: nImagePos = ImagePosition::LeftCenter; break;
+ case AX_PICPOS_LEFTBOTTOM: nImagePos = ImagePosition::LeftBottom; break;
+ case AX_PICPOS_RIGHTTOP: nImagePos = ImagePosition::RightTop; break;
+ case AX_PICPOS_RIGHTCENTER: nImagePos = ImagePosition::RightCenter; break;
+ case AX_PICPOS_RIGHTBOTTOM: nImagePos = ImagePosition::RightBottom; break;
+ case AX_PICPOS_ABOVELEFT: nImagePos = ImagePosition::AboveLeft; break;
+ case AX_PICPOS_ABOVECENTER: nImagePos = ImagePosition::AboveCenter; break;
+ case AX_PICPOS_ABOVERIGHT: nImagePos = ImagePosition::AboveRight; break;
+ case AX_PICPOS_BELOWLEFT: nImagePos = ImagePosition::BelowLeft; break;
+ case AX_PICPOS_BELOWCENTER: nImagePos = ImagePosition::BelowCenter; break;
+ case AX_PICPOS_BELOWRIGHT: nImagePos = ImagePosition::BelowRight; break;
+ case AX_PICPOS_CENTER: nImagePos = ImagePosition::Centered; break;
default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture position" );
}
rPropMap.setProperty( PROP_ImagePosition, nImagePos );
@@ -359,13 +458,12 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData
convertPicture( rPropMap, rPicData );
// picture scale mode
- namespace AwtScaleMode = ::com::sun::star::awt::ImageScaleMode;
- sal_Int16 nScaleMode = AwtScaleMode::None;
+ sal_Int16 nScaleMode = ImageScaleMode::None;
switch( nPicSizeMode )
{
- case AX_PICSIZE_CLIP: nScaleMode = AwtScaleMode::None; break;
- case AX_PICSIZE_STRETCH: nScaleMode = AwtScaleMode::Anisotropic; break;
- case AX_PICSIZE_ZOOM: nScaleMode = AwtScaleMode::Isotropic; break;
+ case AX_PICSIZE_CLIP: nScaleMode = ImageScaleMode::None; break;
+ case AX_PICSIZE_STRETCH: nScaleMode = ImageScaleMode::Anisotropic; break;
+ case AX_PICSIZE_ZOOM: nScaleMode = ImageScaleMode::Isotropic; break;
default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture size mode" );
}
rPropMap.setProperty( PROP_ScaleMode, nScaleMode );
@@ -433,6 +531,7 @@ OUString ControlModelBase::getServiceName() const
case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlCheckBoxModel" );
case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlRadioButtonModel" );
case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlEditModel" );
+ case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlNumericFieldModel" );
case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlListBoxModel" );
case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlComboBoxModel" );
case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlSpinButtonModel" );
@@ -450,6 +549,7 @@ OUString ControlModelBase::getServiceName() const
case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.form.component.CheckBox" );
case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" );
case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.form.component.TextField" );
+ case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.form.component.NumericField" );
case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" );
case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" );
@@ -530,8 +630,8 @@ sal_uInt32 ComCtlModelBase::getDataPartId() const
{
switch( mnVersion )
{
- case 5: return mnDataPartId5;
- case 6: return mnDataPartId6;
+ case COMCTL_VERSION_50: return mnDataPartId5;
+ case COMCTL_VERSION_60: return mnDataPartId6;
}
OSL_ENSURE( false, "ComCtlObjectBase::getDataPartId - unxpected version" );
return SAL_MAX_UINT32;
@@ -652,7 +752,7 @@ void ComCtlProgressBarModel::convertProperties( PropertyMap& rPropMap, const Con
void ComCtlProgressBarModel::importControlData( BinaryInputStream& rInStrm )
{
rInStrm >> mfMin >> mfMax;
- if( mnVersion == 6 )
+ if( mnVersion == COMCTL_VERSION_60 )
rInStrm >> mnVertical >> mnSmooth;
}
@@ -708,17 +808,15 @@ bool AxFontDataModel::importBinaryModel( BinaryInputStream& rInStrm )
void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
{
- namespace cssa = ::com::sun::star::awt;
-
// font name
if( maFontData.maFontName.getLength() > 0 )
rPropMap.setProperty( PROP_FontName, maFontData.maFontName );
// font effects
- rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, cssa::FontWeight::BOLD, cssa::FontWeight::NORMAL ) );
- rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, cssa::FontSlant_ITALIC, cssa::FontSlant_NONE ) );
- rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, cssa::FontUnderline::SINGLE, cssa::FontUnderline::NONE ) );
- rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, cssa::FontStrikeout::SINGLE, cssa::FontStrikeout::NONE ) );
+ rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, FontWeight::BOLD, FontWeight::NORMAL ) );
+ rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, FontSlant_ITALIC, FontSlant_NONE ) );
+ rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, maFontData.mbDblUnderline ? FontUnderline::DOUBLE : FontUnderline::SINGLE, FontUnderline::NONE ) );
+ rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, FontStrikeout::SINGLE, FontStrikeout::NONE ) );
rPropMap.setProperty( PROP_FontHeight, maFontData.getHeightPoints() );
// font character set
@@ -731,12 +829,12 @@ void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlCon
// text alignment
if( mbSupportsAlign )
{
- sal_Int32 nAlign = cssa::TextAlign::LEFT;
+ sal_Int32 nAlign = TextAlign::LEFT;
switch( maFontData.mnHorAlign )
{
- case AX_FONTDATA_LEFT: nAlign = cssa::TextAlign::LEFT; break;
- case AX_FONTDATA_RIGHT: nAlign = cssa::TextAlign::RIGHT; break;
- case AX_FONTDATA_CENTER: nAlign = cssa::TextAlign::CENTER; break;
+ case AX_FONTDATA_LEFT: nAlign = TextAlign::LEFT; break;
+ case AX_FONTDATA_RIGHT: nAlign = TextAlign::RIGHT; break;
+ case AX_FONTDATA_CENTER: nAlign = TextAlign::CENTER; break;
default: OSL_ENSURE( false, "AxFontDataModel::convertProperties - unknown text alignment" );
}
// form controls expect short value
@@ -754,6 +852,7 @@ AxCommandButtonModel::AxCommandButtonModel() :
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
mnFlags( AX_CMDBUTTON_DEFFLAGS ),
mnPicturePos( AX_PICPOS_ABOVECENTER ),
+ mnVerticalAlign( XML_Center ),
mbFocusOnClick( true )
{
}
@@ -809,8 +908,8 @@ void AxCommandButtonModel::convertProperties( PropertyMap& rPropMap, const Contr
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
rPropMap.setProperty( PROP_FocusOnClick, mbFocusOnClick );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
AxFontDataModel::convertProperties( rPropMap, rConv );
@@ -824,7 +923,8 @@ AxLabelModel::AxLabelModel() :
mnFlags( AX_LABEL_DEFFLAGS ),
mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ),
mnBorderStyle( AX_BORDERSTYLE_NONE ),
- mnSpecialEffect( AX_SPECIALEFFECT_FLAT )
+ mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
+ mnVerticalAlign( XML_Top )
{
}
@@ -872,8 +972,8 @@ void AxLabelModel::convertProperties( PropertyMap& rPropMap, const ControlConver
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_TOP );
rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect );
AxFontDataModel::convertProperties( rPropMap, rConv );
@@ -970,7 +1070,8 @@ AxMorphDataModelBase::AxMorphDataModelBase() :
mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ),
mnMaxLength( 0 ),
mnPasswordChar( 0 ),
- mnListRows( 8 )
+ mnListRows( 8 ),
+ mnVerticalAlign( XML_Center )
{
}
@@ -1059,6 +1160,7 @@ void AxMorphDataModelBase::convertProperties( PropertyMap& rPropMap, const Contr
AxToggleButtonModel::AxToggleButtonModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TOGGLE;
}
ApiControlType AxToggleButtonModel::getControlType() const
@@ -1071,8 +1173,8 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
rPropMap.setProperty( PROP_Toggle, true );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
rConv.convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN, mbAwtModel );
@@ -1083,6 +1185,7 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
AxCheckBoxModel::AxCheckBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_CHECKBOX;
}
ApiControlType AxCheckBoxModel::getControlType() const
@@ -1095,7 +1198,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
@@ -1107,6 +1210,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon
AxOptionButtonModel::AxOptionButtonModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_OPTBUTTON;
}
ApiControlType AxOptionButtonModel::getControlType() const
@@ -1119,7 +1223,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
@@ -1131,6 +1235,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
AxTextBoxModel::AxTextBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TEXT;
}
ApiControlType AxTextBoxModel::getControlType() const
@@ -1156,8 +1261,34 @@ void AxTextBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv
// ============================================================================
+AxNumericFieldModel::AxNumericFieldModel()
+{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TEXT;
+}
+
+ApiControlType AxNumericFieldModel::getControlType() const
+{
+ OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxNumericFieldModel::getControlType - invalid control type" );
+ return API_CONTROL_NUMERIC;
+}
+
+void AxNumericFieldModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
+{
+ rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) );
+ // TODO: OUString::toDouble() does not handle local decimal separator
+ rPropMap.setProperty( mbAwtModel ? PROP_Value : PROP_DefaultValue, maValue.toDouble() );
+ rPropMap.setProperty( PROP_Spin, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) );
+ rPropMap.setProperty( PROP_Repeat, true );
+ rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
+ rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect );
+ AxMorphDataModelBase::convertProperties( rPropMap, rConv );
+}
+
+// ============================================================================
+
AxListBoxModel::AxListBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_LISTBOX;
}
ApiControlType AxListBoxModel::getControlType() const
@@ -1180,6 +1311,7 @@ void AxListBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv
AxComboBoxModel::AxComboBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_COMBOBOX;
}
ApiControlType AxComboBoxModel::getControlType() const
@@ -1368,7 +1500,7 @@ void AxScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlCo
// ============================================================================
AxTabStripModel::AxTabStripModel() :
- AxFontDataModel( false ), // no support for Align property
+ AxFontDataModel( false ), // no support for alignment properties
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
mnFlags( AX_TABSTRIP_DEFFLAGS ),
@@ -1430,7 +1562,7 @@ OUString AxTabStripModel::getCaption( sal_Int32 nIndex ) const
// ============================================================================
AxContainerModelBase::AxContainerModelBase( bool bFontSupport ) :
- AxFontDataModel( false ), // no support for Align property
+ AxFontDataModel( false ), // no support for alignment properties
maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ),
maScrollPos( 0, 0 ),
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
@@ -1623,43 +1755,26 @@ EmbeddedControl::~EmbeddedControl()
{
}
-ControlModelRef EmbeddedControl::createModel( const OUString& rClassId )
+ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId )
{
OUString aClassId = rClassId.toAsciiUpperCase();
- if( aClassId.equalsAscii( AX_GUID_COMMANDBUTTON ) )
- mxModel.reset( new AxCommandButtonModel );
- else if( aClassId.equalsAscii( AX_GUID_LABEL ) )
- mxModel.reset( new AxLabelModel );
- else if( aClassId.equalsAscii( AX_GUID_IMAGE ) )
- mxModel.reset( new AxImageModel );
- else if( aClassId.equalsAscii( AX_GUID_TOGGLEBUTTON ) )
- mxModel.reset( new AxToggleButtonModel );
- else if( aClassId.equalsAscii( AX_GUID_CHECKBOX ) )
- mxModel.reset( new AxCheckBoxModel );
- else if( aClassId.equalsAscii( AX_GUID_OPTIONBUTTON ) )
- mxModel.reset( new AxOptionButtonModel );
- else if( aClassId.equalsAscii( AX_GUID_TEXTBOX ) )
- mxModel.reset( new AxTextBoxModel );
- else if( aClassId.equalsAscii( AX_GUID_LISTBOX ) )
- mxModel.reset( new AxListBoxModel );
- else if( aClassId.equalsAscii( AX_GUID_COMBOBOX ) )
- mxModel.reset( new AxComboBoxModel );
- else if( aClassId.equalsAscii( AX_GUID_SPINBUTTON ) )
- mxModel.reset( new AxSpinButtonModel );
- else if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) )
- mxModel.reset( new AxScrollBarModel );
- else if( aClassId.equalsAscii( AX_GUID_FRAME ) )
- mxModel.reset( new AxFrameModel );
- else if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) )
- mxModel.reset( new ComCtlScrollBarModel( 6 ) );
- else
- mxModel.reset();
- // embedded controls are form component instances
- if( mxModel.get() )
- mxModel->setFormComponentMode();
+ if( aClassId.equalsAscii( AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_LABEL ) ) return &createModel< AxLabelModel >();
+ if( aClassId.equalsAscii( AX_GUID_IMAGE ) ) return &createModel< AxImageModel >();
+ if( aClassId.equalsAscii( AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
+ if( aClassId.equalsAscii( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
+ if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
- return mxModel;
+ mxModel.reset();
+ return 0;
}
OUString EmbeddedControl::getServiceName() const
@@ -1683,16 +1798,16 @@ bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtr
// ============================================================================
-EmbeddedForm::EmbeddedForm( const Reference< XMultiServiceFactory >& rxModelFactory,
+EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel,
const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
- ControlConverter( rGraphicHelper, bDefaultColorBgr ),
- mxModelFactory( rxModelFactory ),
+ maControlConv( rxDocModel, rGraphicHelper, bDefaultColorBgr ),
+ mxModelFactory( rxDocModel, UNO_QUERY ),
mxFormsSupp( rxDrawPage, UNO_QUERY )
{
OSL_ENSURE( mxModelFactory.is(), "EmbeddedForm::EmbeddedForm - missing service factory" );
}
-Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl )
+Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex )
{
if( mxModelFactory.is() && rControl.hasModel() ) try
{
@@ -1702,12 +1817,12 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl
Reference< XControlModel > xCtrlModel( xFormComp, UNO_QUERY_THROW );
// insert the control into the form
- Reference< XIndexContainer > xFormIC( createForm(), UNO_SET_THROW );
- sal_Int32 nNewIndex = xFormIC->getCount();
- xFormIC->insertByIndex( nNewIndex, Any( xFormComp ) );
+ Reference< XIndexContainer > xFormIC( createXForm(), UNO_SET_THROW );
+ rnCtrlIndex = xFormIC->getCount();
+ xFormIC->insertByIndex( rnCtrlIndex, Any( xFormComp ) );
// convert the control properties
- if( rControl.convertProperties( xCtrlModel, *this ) )
+ if( rControl.convertProperties( xCtrlModel, maControlConv ) )
return xCtrlModel;
}
catch( Exception& )
@@ -1716,7 +1831,7 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl
return Reference< XControlModel >();
}
-Reference< XIndexContainer > EmbeddedForm::createForm()
+Reference< XIndexContainer > EmbeddedForm::createXForm()
{
if( mxFormsSupp.is() )
{
diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx
index ecd782da2cb0..f45e8e2590c9 100644
--- a/oox/source/ole/axcontrolfragment.cxx
+++ b/oox/source/ole/axcontrolfragment.cxx
@@ -26,23 +26,27 @@
************************************************************************/
#include "oox/ole/axcontrolfragment.hxx"
+
+#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/ole/axcontrol.hxx"
#include "oox/ole/olehelper.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::uno::Reference;
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::oox::core::ContextHandler2;
using ::oox::core::ContextHandlerRef;
using ::oox::core::FragmentHandler2;
using ::oox::core::XmlFilterBase;
-
-namespace oox {
-namespace ole {
+using ::rtl::OUString;
// ============================================================================
@@ -105,7 +109,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
switch( rAttribs.getToken( AX_TOKEN( persistence ), XML_TOKEN_INVALID ) )
{
case XML_persistPropertyBag:
- if( ControlModelBase* pModel = mrControl.createModel( aClassId ).get() )
+ if( ControlModelBase* pModel = mrControl.createModelFromGuid( aClassId ) )
return new AxControlPropertyContext( *this, *pModel );
break;
@@ -121,7 +125,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
OUString aStrmClassId = OleHelper::importGuid( aInStrm );
OSL_ENSURE( aClassId.equalsIgnoreAsciiCase( aStrmClassId ),
"AxControlFragment::importBinaryControl - form control class ID mismatch" );
- if( ControlModelBase* pModel = mrControl.createModel( aStrmClassId ).get() )
+ if( ControlModelBase* pModel = mrControl.createModelFromGuid( aStrmClassId ) )
pModel->importBinaryModel( aInStrm );
}
}
@@ -136,10 +140,10 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
Reference< XInputStream > xStrgStrm = getFilter().openInputStream( aFragmentPath );
if( xStrgStrm.is() )
{
- OleStorage aStorage( getFilter().getGlobalFactory(), xStrgStrm, false );
+ OleStorage aStorage( getFilter().getServiceFactory(), xStrgStrm, false );
BinaryXInputStream aInStrm( aStorage.openInputStream( CREATE_OUSTRING( "f" ) ), true );
if( !aInStrm.isEof() )
- if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModel( aClassId ).get() ) )
+ if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModelFromGuid( aClassId ) ) )
pModel->importBinaryModel( aInStrm );
}
}
diff --git a/oox/source/ole/makefile.mk b/oox/source/ole/makefile.mk
index 4e01392d4a57..a5232247cfa5 100644
--- a/oox/source/ole/makefile.mk
+++ b/oox/source/ole/makefile.mk
@@ -51,7 +51,8 @@ SLOFILES = \
$(SLO)$/vbahelper.obj \
$(SLO)$/vbainputstream.obj \
$(SLO)$/vbamodule.obj \
- $(SLO)$/vbaproject.obj
+ $(SLO)$/vbaproject.obj \
+ $(SLO)$/vbaprojectfilter.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 0a0796e15a7e..8dfe02283cb0 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -26,19 +26,22 @@
************************************************************************/
#include "oox/ole/olehelper.hxx"
+
#include <rtl/ustrbuf.hxx>
-#include "tokens.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/graphichelper.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+#include "oox/token/tokens.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_uInt32 OLE_COLORTYPE_MASK = 0xFF000000;
@@ -51,10 +54,16 @@ const sal_uInt32 OLE_PALETTECOLOR_MASK = 0x0000FFFF;
const sal_uInt32 OLE_BGRCOLOR_MASK = 0x00FFFFFF;
const sal_uInt32 OLE_SYSTEMCOLOR_MASK = 0x0000FFFF;
+/** Swaps the red and blue component of the passed color. */
+inline sal_uInt32 lclSwapRedBlue( sal_uInt32 nColor )
+{
+ return static_cast< sal_uInt32 >( (nColor & 0xFF00FF00) | ((nColor & 0x0000FF) << 16) | ((nColor & 0xFF0000) >> 16) );
+}
+
/** Returns the UNO RGB color from the passed encoded OLE BGR color. */
inline sal_Int32 lclDecodeBgrColor( sal_uInt32 nOleColor )
{
- return static_cast< sal_Int32 >( ((nOleColor & 0x0000FF) << 16) | (nOleColor & 0x00FF00) | ((nOleColor & 0xFF0000) >> 16) );
+ return static_cast< sal_Int32 >( lclSwapRedBlue( nOleColor ) & 0xFFFFFF );
}
// ----------------------------------------------------------------------------
@@ -161,6 +170,11 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight,
return API_RGB_BLACK;
}
+/*static*/ sal_uInt32 OleHelper::encodeOleColor( sal_Int32 nRgbColor )
+{
+ return OLE_COLORTYPE_BGR | lclSwapRedBlue( static_cast< sal_uInt32 >( nRgbColor & 0xFFFFFF ) );
+}
+
/*static*/ OUString OleHelper::importGuid( BinaryInputStream& rInStrm )
{
OUStringBuffer aBuffer;
@@ -297,4 +311,3 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight,
} // namespace ole
} // namespace oox
-
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index 5ef65fe2292e..396cd6b53874 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -26,34 +26,32 @@
************************************************************************/
#include "oox/ole/oleobjecthelper.hxx"
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
+
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
#include <com/sun/star/embed/Aspects.hpp>
-#include "properties.hxx"
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "oox/helper/propertymap.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::lang::XComponent;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
OleObjectInfo::OleObjectInfo() :
mbLinked( false ),
mbShowAsIcon( false ),
@@ -138,4 +136,3 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf
} // namespace ole
} // namespace oox
-
diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx
index 0ca2992d47ad..cf55d6463778 100755..100644
--- a/oox/source/ole/olestorage.cxx
+++ b/oox/source/ole/olestorage.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/ole/olestorage.hxx"
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
@@ -35,38 +36,27 @@
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/implbase2.hxx>
-#include "oox/helper/helper.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::BufferSizeExceededException;
-using ::com::sun::star::io::IOException;
-using ::com::sun::star::io::NotConnectedException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XSeekable;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
typedef ::cppu::WeakImplHelper2< XSeekable, XOutputStream > OleOutputStreamBase;
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx
index 2a36cb4ff3ca..39deb77576d9 100644
--- a/oox/source/ole/vbacontrol.cxx
+++ b/oox/source/ole/vbacontrol.cxx
@@ -26,43 +26,42 @@
************************************************************************/
#include "oox/ole/vbacontrol.hxx"
+
#include <algorithm>
#include <set>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/io/XInputStreamProvider.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/ustrbuf.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
-#include "properties.hxx"
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/helper/storagebase.hxx"
#include "oox/helper/textinputstream.hxx"
#include "oox/ole/vbahelper.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::io::XInputStreamProvider;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::uno::XComponentContext;
-
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_uInt16 VBA_SITE_CLASSIDINDEX = 0x8000;
@@ -220,8 +219,8 @@ bool VbaSiteModel::importBinaryModel( BinaryInputStream& rInStrm )
aReader.skipUndefinedProperty();
aReader.readStringProperty( maToolTip );
aReader.skipStringProperty(); // license key
- aReader.readStringProperty( maLinkedCell );
- aReader.readStringProperty( maSourceRange );
+ aReader.readStringProperty( maControlSource );
+ aReader.readStringProperty( maRowSource );
return aReader.finalizeImport();
}
@@ -337,6 +336,11 @@ void VbaSiteModel::convertProperties( PropertyMap& rPropMap,
}
}
+void VbaSiteModel::bindToSources( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv ) const
+{
+ rConv.bindToSources( rxCtrlModel, maControlSource, maRowSource );
+}
+
// ============================================================================
VbaFormControl::VbaFormControl()
@@ -750,19 +754,21 @@ bool lclEatKeyword( OUString& rCodeLine, const OUString& rKeyword )
// ----------------------------------------------------------------------------
-VbaUserForm::VbaUserForm( const Reference< XMultiServiceFactory >& rxGlobalFactory,
- const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
- ControlConverter( rGraphicHelper, bDefaultColorBgr ),
- mxGlobalFactory( rxGlobalFactory )
+VbaUserForm::VbaUserForm( const Reference< XComponentContext >& rxContext,
+ const Reference< XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
+ mxCompContext( rxContext ),
+ mxDocModel( rxDocModel ),
+ maConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr )
{
- OSL_ENSURE( mxGlobalFactory.is(), "VbaUserForm::VbaUserForm - missing service factory" );
+ OSL_ENSURE( mxCompContext.is(), "VbaUserForm::VbaUserForm - missing component context" );
+ OSL_ENSURE( mxDocModel.is(), "VbaUserForm::VbaUserForm - missing document model" );
}
void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib,
StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc )
{
OSL_ENSURE( rxDialogLib.is(), "VbaUserForm::importForm - missing dialog library" );
- if( !mxGlobalFactory.is() || !rxDialogLib.is() )
+ if( !mxCompContext.is() || !mxDocModel.is() || !rxDialogLib.is() )
return;
// check that the '03VBFrame' stream exists, this is required for forms
@@ -820,16 +826,15 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib,
{
// create the dialog model
OUString aServiceName = mxCtrlModel->getServiceName();
- Reference< XControlModel > xDialogModel( mxGlobalFactory->createInstance( aServiceName ), UNO_QUERY_THROW );
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< XControlModel > xDialogModel( xFactory->createInstance( aServiceName ), UNO_QUERY_THROW );
Reference< XNameContainer > xDialogNC( xDialogModel, UNO_QUERY_THROW );
// convert properties and embedded controls
- if( convertProperties( xDialogModel, *this, 0 ) )
+ if( convertProperties( xDialogModel, maConverter, 0 ) )
{
// export the dialog to XML and insert it into the dialog library
- PropertySet aFactoryProps( mxGlobalFactory );
- Reference< XComponentContext > xCompContext( aFactoryProps.getAnyProperty( PROP_DefaultContext ), UNO_QUERY_THROW );
- Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, xCompContext ), UNO_SET_THROW );
+ Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, mxCompContext ), UNO_SET_THROW );
OSL_ENSURE( !rxDialogLib->hasByName( aFormName ), "VbaUserForm::importForm - multiple dialogs with equal name" );
ContainerHelper::insertByName( rxDialogLib, aFormName, Any( xDialogSource ) );
}
diff --git a/oox/source/ole/vbahelper.cxx b/oox/source/ole/vbahelper.cxx
index 3bf72d30bfa5..82d38d83610c 100644
--- a/oox/source/ole/vbahelper.cxx
+++ b/oox/source/ole/vbahelper.cxx
@@ -32,9 +32,12 @@
namespace oox {
namespace ole {
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using namespace ::com::sun::star::uno;
// ============================================================================
diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxx
index b2c8d5c64859..e56e8b5fbc89 100644
--- a/oox/source/ole/vbainputstream.cxx
+++ b/oox/source/ole/vbainputstream.cxx
@@ -31,6 +31,8 @@
namespace oox {
namespace ole {
+// ============================================================================
+
namespace {
const sal_uInt8 VBASTREAM_SIGNATURE = 1;
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index dbd5c9c02ced..2da92b935004 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/ole/vbamodule.hxx"
+
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
#include <com/sun/star/script/ModuleType.hpp>
@@ -36,17 +37,20 @@
#include "oox/ole/vbahelper.hxx"
#include "oox/ole/vbainputstream.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+namespace oox {
+namespace ole {
+
+// ============================================================================
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::script::vba;
using namespace ::com::sun::star::uno;
-namespace oox {
-namespace ole {
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 0f7e3cb8612a..35e6b7911012 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -26,19 +26,21 @@
************************************************************************/
#include "oox/ole/vbaproject.hxx"
+
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
-#include <rtl/tencinfo.h>
-#include <rtl/ustrbuf.h>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/configurationhelper.hxx>
#include <comphelper/string.hxx>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include <rtl/tencinfo.h>
+#include <rtl/ustrbuf.h>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
@@ -49,9 +51,10 @@
#include "oox/ole/vbainputstream.hxx"
#include "oox/ole/vbamodule.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::comphelper::ConfigurationHelper;
+namespace oox {
+namespace ole {
+
+// ============================================================================
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::document;
@@ -63,8 +66,9 @@ using namespace ::com::sun::star::script;
using namespace ::com::sun::star::script::vba;
using namespace ::com::sun::star::uno;
-namespace oox {
-namespace ole {
+using ::comphelper::ConfigurationHelper;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
@@ -88,14 +92,15 @@ bool lclReadConfigItem( const Reference< XInterface >& rxConfigAccess, const OUS
// ----------------------------------------------------------------------------
-VbaFilterConfig::VbaFilterConfig( const Reference< XMultiServiceFactory >& rxGlobalFactory, const OUString& rConfigCompName )
+VbaFilterConfig::VbaFilterConfig( const Reference< XComponentContext >& rxContext, const OUString& rConfigCompName )
{
- OSL_ENSURE( rxGlobalFactory.is(), "VbaFilterConfig::VbaFilterConfig - missing service factory" );
- try
+ OSL_ENSURE( rxContext.is(), "VbaFilterConfig::VbaFilterConfig - missing component context" );
+ if( rxContext.is() ) try
{
OSL_ENSURE( rConfigCompName.getLength() > 0, "VbaFilterConfig::VbaFilterConfig - invalid configuration component name" );
OUString aConfigPackage = CREATE_OUSTRING( "org.openoffice.Office." ) + rConfigCompName;
- mxConfigAccess = ConfigurationHelper::openConfig( rxGlobalFactory, aConfigPackage, ConfigurationHelper::E_READONLY );
+ Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
+ mxConfigAccess = ConfigurationHelper::openConfig( xFactory, aConfigPackage, ConfigurationHelper::E_READONLY );
}
catch( Exception& )
{
@@ -124,13 +129,37 @@ bool VbaFilterConfig::isExportVba() const
// ============================================================================
-VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory,
+VbaMacroAttacherBase::VbaMacroAttacherBase( const OUString& rMacroName ) :
+ maMacroName( rMacroName )
+{
+ OSL_ENSURE( maMacroName.getLength() > 0, "VbaMacroAttacherBase::VbaMacroAttacherBase - empty macro name" );
+}
+
+VbaMacroAttacherBase::~VbaMacroAttacherBase()
+{
+}
+
+void VbaMacroAttacherBase::resolveAndAttachMacro( const Reference< XVBAMacroResolver >& rxResolver )
+{
+ try
+ {
+ attachMacro( rxResolver->resolveVBAMacroToScriptURL( maMacroName ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+VbaProject::VbaProject( const Reference< XComponentContext >& rxContext,
const Reference< XModel >& rxDocModel, const OUString& rConfigCompName ) :
- VbaFilterConfig( rxGlobalFactory, rConfigCompName ),
- mxGlobalFactory( rxGlobalFactory ),
+ VbaFilterConfig( rxContext, rConfigCompName ),
+ mxCompContext( rxContext ),
mxDocModel( rxDocModel ),
- maLibName( CREATE_OUSTRING( "Standard" ) )
+ maPrjName( CREATE_OUSTRING( "Standard" ) )
{
+ OSL_ENSURE( mxCompContext.is(), "VbaProject::VbaProject - missing component context" );
OSL_ENSURE( mxDocModel.is(), "VbaProject::VbaProject - missing document model" );
mxBasicLib = openLibrary( PROP_BasicLibraries, false );
mxDialogLib = openLibrary( PROP_DialogLibraries, false );
@@ -153,6 +182,12 @@ void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper
}
}
+void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher )
+{
+ OSL_ENSURE( rxAttacher.get(), "VbaProject::registerMacroAttacher - unexpected empty reference" );
+ maMacroAttachers.push_back( rxAttacher );
+}
+
bool VbaProject::hasModules() const
{
return mxBasicLib.is() && mxBasicLib->hasElements();
@@ -181,51 +216,6 @@ void VbaProject::addDummyModule( const OUString& rName, sal_Int32 nType )
maDummyModules[ rName ] = nType;
}
-void VbaProject::createDummyModules()
-{
- /* !! HACK !! This function is called from old XLS filter only, must be
- removed when this filter uses the OOX VBA import instead of the old SVX
- VBA import.
- */
-
- // create empty dummy modules
- typedef RefMap< OUString, VbaModule > VbaModuleMap;
- VbaModuleMap aDummyModules;
- for( DummyModuleMap::iterator aIt = maDummyModules.begin(), aEnd = maDummyModules.end(); aIt != aEnd; ++aIt )
- {
- OSL_ENSURE( !aDummyModules.has( aIt->first ), "VbaProject::createDummyModules - multiple modules with the same name" );
- VbaModuleMap::mapped_type& rxModule = aDummyModules[ aIt->first ];
- rxModule.reset( new VbaModule( mxDocModel, aIt->first, RTL_TEXTENCODING_MS_1252, isImportVbaExecutable() ) );
- rxModule->setType( aIt->second );
- }
-
- if( !aDummyModules.empty() ) try
- {
- // get the model factory and the basic library
- Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
- Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW );
-
- // try to get access to document objects related to code modules
- Reference< XNameAccess > xDocObjectNA;
- try
- {
- xDocObjectNA.set( xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAObjectModuleObjectProvider" ) ), UNO_QUERY );
- }
- catch( Exception& )
- {
- // not all documents support this
- }
-
- // create empty dummy modules
- if( xBasicLib.is() )
- aDummyModules.forEachMem( &VbaModule::createEmptyModule,
- ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ) );
- }
- catch( Exception& )
- {
- }
-}
-
void VbaProject::prepareImport()
{
}
@@ -249,9 +239,9 @@ Reference< XNameContainer > VbaProject::openLibrary( sal_Int32 nPropId, bool bCr
try
{
Reference< XLibraryContainer > xLibContainer( getLibraryContainer( nPropId ), UNO_SET_THROW );
- if( bCreateMissing && !xLibContainer->hasByName( maLibName ) )
- xLibContainer->createLibrary( maLibName );
- xLibrary.set( xLibContainer->getByName( maLibName ), UNO_QUERY_THROW );
+ if( bCreateMissing && !xLibContainer->hasByName( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ ) )
+ xLibContainer->createLibrary( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ );
+ xLibrary.set( xLibContainer->getByName( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ ), UNO_QUERY_THROW );
}
catch( Exception& )
{
@@ -323,6 +313,14 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
eTextEnc = eNewTextEnc;
}
break;
+ case VBA_ID_PROJECTNAME:
+ {
+ OUString aPrjName = aRecStrm.readCharArrayUC( nRecSize, eTextEnc );
+ OSL_ENSURE( aPrjName.getLength() > 0, "VbaProject::importVba - invalid project name" );
+ if( aPrjName.getLength() > 0 )
+ maPrjName = aPrjName;
+ }
+ break;
case VBA_ID_PROJECTMODULES:
OOX_ENSURE_RECORDSIZE( nRecSize == 2 );
OSL_ENSURE( aModules.empty(), "VbaProject::importVba - unexpected PROJECTMODULES record" );
@@ -420,7 +418,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
}
/* Now it is time to load the source code. All modules will be inserted
- into the Basic library of the document specified by the 'maLibName'
+ into the Basic library of the document specified by the 'maPrjName'
member. Do not create the Basic library, if there are no modules
specified. */
if( !aModules.empty() || !aDummyModules.empty() ) try
@@ -491,7 +489,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
// create and import the form
Reference< XNameContainer > xDialogLib( createDialogLibrary(), UNO_SET_THROW );
- VbaUserForm aForm( mxGlobalFactory, rGraphicHelper, bDefaultColorBgr );
+ VbaUserForm aForm( mxCompContext, mxDocModel, rGraphicHelper, bDefaultColorBgr );
aForm.importForm( xDialogLib, *xSubStrg, aModuleName, eTextEnc );
}
catch( Exception& )
@@ -500,20 +498,40 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
}
}
+ // attach macros to registered objects
+ attachMacros();
// virtual call, derived classes may do some more processing
finalizeImport();
}
+void VbaProject::attachMacros()
+{
+ if( !maMacroAttachers.empty() && mxCompContext.is() ) try
+ {
+ Reference< XMultiComponentFactory > xFactory( mxCompContext->getServiceManager(), UNO_SET_THROW );
+ Sequence< Any > aArgs( 2 );
+ aArgs[ 0 ] <<= mxDocModel;
+ aArgs[ 1 ] <<= maPrjName;
+ Reference< XVBAMacroResolver > xResolver( xFactory->createInstanceWithArgumentsAndContext(
+ CREATE_OUSTRING( "com.sun.star.script.vba.VBAMacroResolver" ), aArgs, mxCompContext ), UNO_QUERY_THROW );
+ maMacroAttachers.forEachMem( &VbaMacroAttacherBase::resolveAndAttachMacro, ::boost::cref( xResolver ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
void VbaProject::copyStorage( StorageBase& rVbaPrjStrg )
{
- try
+ if( mxCompContext.is() ) try
{
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
Reference< XStorageBasedDocument > xStorageBasedDoc( mxDocModel, UNO_QUERY_THROW );
Reference< XStorage > xDocStorage( xStorageBasedDoc->getDocumentStorage(), UNO_QUERY_THROW );
{
using namespace ::com::sun::star::embed::ElementModes;
Reference< XStream > xDocStream( xDocStorage->openStreamElement( CREATE_OUSTRING( "_MS_VBA_Macros" ), SEEKABLE | WRITE | TRUNCATE ), UNO_SET_THROW );
- OleStorage aDestStorage( mxGlobalFactory, xDocStream, false );
+ OleStorage aDestStorage( xFactory, xDocStream, false );
rVbaPrjStrg.copyStorageToStorage( aDestStorage );
aDestStorage.commit();
}
diff --git a/oox/source/ole/vbaprojectfilter.cxx b/oox/source/ole/vbaprojectfilter.cxx
new file mode 100755
index 000000000000..ee5b3bf7a715
--- /dev/null
+++ b/oox/source/ole/vbaprojectfilter.cxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * 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 "oox/ole/vbaprojectfilter.hxx"
+
+#include "oox/ole/vbaproject.hxx"
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+VbaProjectFilterBase::VbaProjectFilterBase( const Reference< XComponentContext >& rxContext,
+ const OUString& rAppName, const OUString& rStorageName ) throw( RuntimeException ) :
+ BinaryFilterBase( rxContext ),
+ maAppName( rAppName ),
+ maStorageName( rStorageName )
+{
+}
+
+bool VbaProjectFilterBase::importDocument() throw()
+{
+ StorageRef xVbaPrjStrg = openSubStorage( maStorageName, false );
+ if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() )
+ return false;
+
+ getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
+ return true;
+}
+
+bool VbaProjectFilterBase::exportDocument() throw()
+{
+ return false;
+}
+
+VbaProject* VbaProjectFilterBase::implCreateVbaProject() const
+{
+ return new VbaProject( getComponentContext(), getModel(), maAppName );
+}
+
+// ============================================================================
+
+OUString SAL_CALL WordVbaProjectFilter_getImplementationName() throw()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.WordVbaProjectFilter" );
+}
+
+Sequence< OUString > SAL_CALL WordVbaProjectFilter_getSupportedServiceNames() throw()
+{
+ Sequence< OUString > aSeq( 1 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ return aSeq;
+}
+
+Reference< XInterface > SAL_CALL WordVbaProjectFilter_createInstance(
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
+{
+ return static_cast< ::cppu::OWeakObject* >( new WordVbaProjectFilter( rxContext ) );
+}
+
+// ----------------------------------------------------------------------------
+
+WordVbaProjectFilter::WordVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ VbaProjectFilterBase( rxContext, CREATE_OUSTRING( "Writer" ), CREATE_OUSTRING( "Macros" ) )
+{
+}
+
+OUString WordVbaProjectFilter::implGetImplementationName() const
+{
+ return WordVbaProjectFilter_getImplementationName();
+}
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index 456b0616af1c..fdee865251af 100644
--- a/oox/source/ppt/animationspersist.cxx
+++ b/oox/source/ppt/animationspersist.cxx
@@ -25,8 +25,6 @@
*
************************************************************************/
-
-
#include "oox/ppt/animationspersist.hxx"
#include <rtl/ustring.hxx>
@@ -38,8 +36,6 @@
#include "oox/drawingml/shape.hxx"
-#include "tokens.hxx"
-
using rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx
index 80d87dd49ad2..6346a8058c5d 100644
--- a/oox/source/ppt/animationtypes.cxx
+++ b/oox/source/ppt/animationtypes.cxx
@@ -32,8 +32,6 @@
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::animations;
using namespace ::com::sun::star::xml::sax;
diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx
index e2eca9a36dca..449c4ef73d11 100644
--- a/oox/source/ppt/animvariantcontext.cxx
+++ b/oox/source/ppt/animvariantcontext.cxx
@@ -35,12 +35,10 @@
#include <rtl/ustring.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
#include "pptfilterhelpers.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -80,29 +78,29 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_boolVal:
+ case PPT_TOKEN( boolVal ):
{
bool val = attribs.getBool( XML_val, false );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_clrVal:
+ case PPT_TOKEN( clrVal ):
xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) );
// we'll defer setting the Any until the end.
break;
- case NMSP_PPT|XML_fltVal:
+ case PPT_TOKEN( fltVal ):
{
double val = attribs.getDouble( XML_val, 0.0 );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_intVal:
+ case PPT_TOKEN( intVal ):
{
sal_Int32 val = attribs.getInteger( XML_val, 0 );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_strVal:
+ case PPT_TOKEN( strVal ):
{
OUString val = attribs.getString( XML_val, OUString() );
convertMeasure( val ); // ignore success or failure if it fails, use as is
diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx
index 5b6fc4076a80..65664bdd3691 100644
--- a/oox/source/ppt/backgroundproperties.cxx
+++ b/oox/source/ppt/backgroundproperties.cxx
@@ -28,8 +28,6 @@
#include "oox/ppt/backgroundproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -51,7 +49,7 @@ Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildCon
switch( aElementToken )
{
- case NMSP_PPT|XML_fill: // a:CT_FillEffect
+ case PPT_TOKEN( fill ): // a:CT_FillEffect
break;
}
diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx
index 61148265dfbe..3352e202e057 100644
--- a/oox/source/ppt/buildlistcontext.cxx
+++ b/oox/source/ppt/buildlistcontext.cxx
@@ -28,7 +28,6 @@
#include "buildlistcontext.hxx"
#include <rtl/ustring.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::oox::core;
@@ -56,7 +55,7 @@ namespace oox { namespace ppt {
{
switch( aElement )
{
- case NMSP_PPT|XML_bldGraphic:
+ case PPT_TOKEN( bldGraphic ):
mbInBldGraphic = false;
break;
default:
@@ -72,18 +71,18 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_bldAsOne:
+ case PPT_TOKEN( bldAsOne ):
if( mbInBldGraphic )
{
mbBuildAsOne = true;
}
break;
- case NMSP_PPT|XML_bldSub:
+ case PPT_TOKEN( bldSub ):
if( mbInBldGraphic )
{
}
break;
- case NMSP_PPT|XML_bldGraphic:
+ case PPT_TOKEN( bldGraphic ):
{
mbInBldGraphic = true;
AttributeList attribs( xAttribs );
@@ -94,9 +93,9 @@ namespace oox { namespace ppt {
// sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 );
break;
}
- case NMSP_DRAWINGML|XML_bldDgm:
- case NMSP_DRAWINGML|XML_bldOleChart:
- case NMSP_DRAWINGML|XML_bldP:
+ case A_TOKEN( bldDgm ):
+ case A_TOKEN( bldOleChart ):
+ case A_TOKEN( bldP ):
break;
default:
diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx
index 36841bab5aae..a4e3951228ae 100644
--- a/oox/source/ppt/commonbehaviorcontext.cxx
+++ b/oox/source/ppt/commonbehaviorcontext.cxx
@@ -34,14 +34,12 @@
#include <com/sun/star/animations/XAnimationNode.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "commonbehaviorcontext.hxx"
#include "commontimenodecontext.hxx"
#include "timetargetelementcontext.hxx"
#include "pptfilterhelpers.hxx"
-#include "tokens.hxx"
#include <string.h>
@@ -57,7 +55,7 @@ namespace oox { namespace ppt {
CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
- : TimeNodeContext( rParent, NMSP_PPT|XML_cBhvr, xAttribs, pNode )
+ : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode )
, mbInAttrList( false )
, mbIsInAttrName( false )
{
@@ -75,7 +73,7 @@ namespace oox { namespace ppt {
{
switch( aElement )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
{
if( !maAttributes.empty() )
{
@@ -94,10 +92,10 @@ namespace oox { namespace ppt {
}
break;
}
- case NMSP_PPT|XML_attrNameLst:
+ case PPT_TOKEN( attrNameLst ):
mbInAttrList = false;
break;
- case NMSP_PPT|XML_attrName:
+ case PPT_TOKEN( attrName ):
if( mbIsInAttrName )
{
const ImplAttributeNameConversion *attrConv = gImplConversionList;
@@ -145,16 +143,16 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_tgtEl:
+ case PPT_TOKEN( tgtEl ):
xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) );
break;
- case NMSP_PPT|XML_attrNameLst:
+ case PPT_TOKEN( attrNameLst ):
mbInAttrList = true;
break;
- case NMSP_PPT|XML_attrName:
+ case PPT_TOKEN( attrName ):
{
if( mbInAttrList )
{
diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx
index d7de40255298..1057deb70c5d 100644
--- a/oox/source/ppt/commontimenodecontext.cxx
+++ b/oox/source/ppt/commontimenodecontext.cxx
@@ -42,13 +42,11 @@
#include <com/sun/star/presentation/EffectNodeType.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "oox/ppt/pptimport.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "animationtypes.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -619,7 +617,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_iterate ) )
+ if( aElement == ( PPT_TOKEN( iterate ) ) )
{
mbIterate = false;
}
@@ -632,22 +630,22 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
switch ( aElementToken )
{
- case NMSP_PPT|XML_childTnLst:
- case NMSP_PPT|XML_subTnLst:
+ case PPT_TOKEN( childTnLst ):
+ case PPT_TOKEN( subTnLst ):
xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) );
break;
- case NMSP_PPT|XML_stCondLst:
+ case PPT_TOKEN( stCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) );
break;
- case NMSP_PPT|XML_endCondLst:
+ case PPT_TOKEN( endCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) );
break;
- case NMSP_PPT|XML_endSync:
+ case PPT_TOKEN( endSync ):
xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) );
break;
- case NMSP_PPT|XML_iterate:
+ case PPT_TOKEN( iterate ):
{
sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el );
if( nVal != 0 )
@@ -680,7 +678,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
mbIterate = true;
break;
}
- case NMSP_PPT|XML_tmAbs:
+ case PPT_TOKEN( tmAbs ):
if( mbIterate )
{
AttributeList attribs( xAttribs );
@@ -689,7 +687,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime;
}
break;
- case NMSP_PPT|XML_tmPct:
+ case PPT_TOKEN( tmPct ):
if( mbIterate )
{
AttributeList attribs( xAttribs );
diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx
index e52d8b27a464..5b622b6ef602 100644
--- a/oox/source/ppt/conditioncontext.cxx
+++ b/oox/source/ppt/conditioncontext.cxx
@@ -37,13 +37,11 @@
#include <com/sun/star/animations/EventTrigger.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/contexthandler.hxx"
#include "oox/ppt/animationspersist.hxx"
#include "animationtypes.hxx"
#include "timetargetelementcontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -54,7 +52,7 @@ namespace oox { namespace ppt {
CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode, AnimationCondition & aValue )
- : TimeNodeContext( rParent, NMSP_PPT|XML_cond, xAttribs, pNode )
+ : TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode )
, maCond( aValue )
{
maEvent.Trigger = EventTrigger::NONE;
@@ -123,7 +121,7 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_rtn:
+ case PPT_TOKEN( rtn ):
{
// ST_TLTriggerRuntimeNode { first, last, all }
sal_Int32 aTok;
@@ -147,7 +145,7 @@ namespace oox { namespace ppt {
maCond.maValue = makeAny( nEnum );
break;
}
- case NMSP_PPT|XML_tn:
+ case PPT_TOKEN( tn ):
{
maCond.mnType = aElementToken;
AttributeList attribs( xAttribs );
@@ -155,7 +153,7 @@ namespace oox { namespace ppt {
maCond.maValue = makeAny( nId );
break;
}
- case NMSP_PPT|XML_tgtEl:
+ case PPT_TOKEN( tgtEl ):
// CT_TLTimeTargetElement
xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) );
break;
@@ -194,7 +192,7 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_cond:
+ case PPT_TOKEN( cond ):
// add a condition to the list
maConditions.push_back( AnimationCondition() );
xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) );
diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx
index 613000d07d41..f66ccb0f6084 100644
--- a/oox/source/ppt/customshowlistcontext.cxx
+++ b/oox/source/ppt/customshowlistcontext.cxx
@@ -26,9 +26,6 @@
************************************************************************/
#include "customshowlistcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
-
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -71,8 +68,8 @@ Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildCont
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_sld :
- mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS | XML_id ) );
+ case PPT_TOKEN( sld ) :
+ mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
default:
break;
}
@@ -102,7 +99,7 @@ Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChild
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_custShow :
+ case PPT_TOKEN( custShow ) :
{
CustomShow aCustomShow;
mrCustomShowList.push_back( aCustomShow );
diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx
index 69f23b77c0da..2089b019c58c 100644
--- a/oox/source/ppt/headerfootercontext.cxx
+++ b/oox/source/ppt/headerfootercontext.cxx
@@ -26,9 +26,7 @@
************************************************************************/
#include "headerfootercontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx
index d291550ac321..152beb280bd7 100644
--- a/oox/source/ppt/layoutfragmenthandler.cxx
+++ b/oox/source/ppt/layoutfragmenthandler.cxx
@@ -34,8 +34,6 @@
#include "headerfootercontext.hxx"
#include "oox/ppt/layoutfragmenthandler.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -67,10 +65,10 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext(
Reference< XFastContextHandler > xRet = getFastContextHandler();
switch( aElementToken )
{
- case NMSP_PPT|XML_sldLayout: // CT_SlideLayout
+ case PPT_TOKEN( sldLayout ): // CT_SlideLayout
mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType
break;
- case NMSP_PPT|XML_hf: // CT_HeaderFooter
+ case PPT_TOKEN( hf ): // CT_HeaderFooter
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
default:
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index d60629b4481b..625e4e662e3c 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -30,6 +30,7 @@
#include "oox/dump/pptxdumper.hxx"
#include "oox/drawingml/table/tablestylelistfragmenthandler.hxx"
#include "oox/helper/graphichelper.hxx"
+#include "oox/ole/vbaproject.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -41,24 +42,25 @@ namespace oox { namespace ppt {
OUString SAL_CALL PowerPointImport_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointImport" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.ppt.PowerPointImport" );
}
uno::Sequence< OUString > SAL_CALL PowerPointImport_getSupportedServiceNames() throw()
{
- const OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.ooxpptx" );
- const Sequence< OUString > aSeq( &aServiceName, 1 );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
-uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
+uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return (cppu::OWeakObject*)new PowerPointImport( rSMgr );
+ return static_cast< ::cppu::OWeakObject* >( new PowerPointImport( rxContext ) );
}
-PowerPointImport::PowerPointImport( const uno::Reference< lang::XMultiServiceFactory > & rSMgr )
- : XmlFilterBase( rSMgr )
- , mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ XmlFilterBase( rxContext ),
+ mxChartConv( new ::oox::drawingml::chart::ChartConverter )
{
}
@@ -73,9 +75,9 @@ bool PowerPointImport::importDocument() throw()
file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
- OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) );
+ OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) );
FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) );
- maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "tableStyles" ) );
+ maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) );
return importFragment( xPresentationFragmentHandler );
@@ -163,7 +165,7 @@ private:
};
PptGraphicHelper::PptGraphicHelper( const PowerPointImport& rFilter ) :
- GraphicHelper( rFilter.getGlobalFactory(), rFilter.getTargetFrame(), rFilter.getStorage() ),
+ GraphicHelper( rFilter.getComponentContext(), rFilter.getTargetFrame(), rFilter.getStorage() ),
mrFilter( rFilter )
{
}
@@ -180,6 +182,11 @@ GraphicHelper* PowerPointImport::implCreateGraphicHelper() const
return new PptGraphicHelper( *this );
}
+::oox::ole::VbaProject* PowerPointImport::implCreateVbaProject() const
+{
+ return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Impress" ) );
+}
+
OUString PowerPointImport::implGetImplementationName() const
{
return PowerPointImport_getImplementationName();
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index bfe3ead6ca04..7437b378b324 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -26,10 +26,8 @@
************************************************************************/
#include "oox/ppt/pptshape.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/textbody.hxx"
-#include "tokens.hxx"
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
@@ -64,7 +62,7 @@ PPTShape::~PPTShape()
}
void PPTShape::addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rSlidePersist,
const oox::drawingml::Theme* pTheme,
const Reference< XShapes >& rxShapes,
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index c59638553018..7df41ac3d714 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -37,14 +37,11 @@
#include "oox/ppt/pptshapepropertiescontext.hxx"
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "tokens.hxx"
-#include "properties.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -102,9 +99,9 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
switch( aElementToken )
{
// nvSpPr CT_ShapeNonVisual begin
- // case NMSP_PPT|XML_drElemPr:
+ // case PPT_TOKEN( drElemPr ):
// break;
- case NMSP_PPT|XML_cNvPr:
+ case PPT_TOKEN( cNvPr ):
{
AttributeList aAttribs( xAttribs );
mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) );
@@ -112,7 +109,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
break;
}
- case NMSP_PPT|XML_ph:
+ case PPT_TOKEN( ph ):
{
sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
mpShapePtr->setSubType( nSubType );
@@ -191,15 +188,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
// nvSpPr CT_ShapeNonVisual end
- case NMSP_PPT|XML_spPr:
+ case PPT_TOKEN( spPr ):
xRet = new PPTShapePropertiesContext( *this, *mpShapePtr );
break;
- case NMSP_PPT|XML_style:
+ case PPT_TOKEN( style ):
xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr );
break;
- case NMSP_PPT|XML_txBody:
+ case PPT_TOKEN( txBody ):
{
oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True );
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 074393874264..0ba36ee99417 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -39,8 +39,6 @@
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/connectorshapecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -71,7 +69,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
switch( aElementToken )
{
- case NMSP_PPT|XML_cNvPr:
+ case PPT_TOKEN( cNvPr ):
{
AttributeList aAttribs( xAttribs );
mpGroupShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) );
@@ -79,36 +77,36 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
mpGroupShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
break;
}
- case NMSP_PPT|XML_ph:
+ case PPT_TOKEN( ph ):
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
- case NMSP_PPT|XML_grpSpPr:
+ case PPT_TOKEN( grpSpPr ):
xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr );
break;
- case NMSP_PPT|XML_spPr:
+ case PPT_TOKEN( spPr ):
xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr );
break;
/*
- case NMSP_PPT|XML_style:
+ case PPT_TOKEN( style ):
xRet = new ShapeStyleContext( getParser() );
break;
*/
- case NMSP_PPT|XML_cxnSp: // connector shape
+ case PPT_TOKEN( cxnSp ): // connector shape
xRet.set( new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) ) );
break;
- case NMSP_PPT|XML_grpSp: // group shape
+ case PPT_TOKEN( grpSp ): // group shape
xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) );
break;
- case NMSP_PPT|XML_sp: // Shape
+ case PPT_TOKEN( sp ): // Shape
xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) );
break;
- case NMSP_PPT|XML_pic: // CT_Picture
+ case PPT_TOKEN( pic ): // CT_Picture
xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
- case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame
+ case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame
xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) );
break;
diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx
index b4af0f08a555..bddd74f4837a 100644
--- a/oox/source/ppt/pptshapepropertiescontext.cxx
+++ b/oox/source/ppt/pptshapepropertiescontext.cxx
@@ -35,14 +35,11 @@
#include "oox/ppt/pptshapepropertiescontext.hxx"
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -68,7 +65,7 @@ Reference< XFastContextHandler > PPTShapePropertiesContext::createFastChildConte
switch( aElementToken )
{
- case NMSP_DRAWINGML | XML_xfrm:
+ case A_TOKEN( xfrm ):
{
mrShape.getShapeProperties()[ PROP_IsPlaceholderDependent ] <<= sal_False;
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 786836fbc554..6976c965ad83 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -46,8 +46,6 @@
#include "oox/ppt/slidefragmenthandler.hxx"
#include "oox/ppt/layoutfragmenthandler.hxx"
#include "oox/ppt/pptimport.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -182,12 +180,12 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) );
// importing the corresponding masterpage/layout
- OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideLayout" ) );
+ OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) );
if ( aLayoutFragmentPath.getLength() > 0 )
{
// importing layout
RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath );
- OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideMaster" ) );
+ OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) );
if( aMasterFragmentPath.getLength() )
{
// check if the corresponding masterpage+layout has already been imported
@@ -221,7 +219,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) );
// set the correct theme
- OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) );
+ OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
if( aThemeFragmentPath.getLength() > 0 )
{
std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() );
@@ -259,7 +257,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
pSlidePersistPtr->createXShapes( rFilter );
// now importing the notes page
- OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "notesSlide" ) );
+ OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) );
if( aNotesFragmentPath.getLength() > 0 )
{
Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
@@ -305,30 +303,30 @@ Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildCon
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_presentation:
- case NMSP_PPT|XML_sldMasterIdLst:
- case NMSP_PPT|XML_notesMasterIdLst:
- case NMSP_PPT|XML_sldIdLst:
+ case PPT_TOKEN( presentation ):
+ case PPT_TOKEN( sldMasterIdLst ):
+ case PPT_TOKEN( notesMasterIdLst ):
+ case PPT_TOKEN( sldIdLst ):
break;
- case NMSP_PPT|XML_sldMasterId:
- maSlideMasterVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( sldMasterId ):
+ maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_sldId:
- maSlidesVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( sldId ):
+ maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_notesMasterId:
- maNotesMasterVector.push_back( xAttribs->getOptionalValue(NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( notesMasterId ):
+ maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_sldSz:
+ case PPT_TOKEN( sldSz ):
maSlideSize = GetSize2D( xAttribs );
break;
- case NMSP_PPT|XML_notesSz:
+ case PPT_TOKEN( notesSz ):
maNotesSize = GetSize2D( xAttribs );
break;
- case NMSP_PPT|XML_custShowLst:
+ case PPT_TOKEN( custShowLst ):
xRet.set( new CustomShowListContext( *this, maCustomShowList ) );
break;
- case NMSP_PPT|XML_defaultTextStyle:
+ case PPT_TOKEN( defaultTextStyle ):
xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) );
break;
}
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 7e77f5a54938..1d25abe5c941 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -31,10 +31,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include "tokens.hxx"
-#include "properties.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "headerfootercontext.hxx"
#include "oox/ppt/backgroundproperties.hxx"
@@ -65,7 +62,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri
, mpSlidePersistPtr( pPersistPtr )
, meShapeLocation( eShapeLocation )
{
- OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "vmlDrawing" ) );
+ OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) );
if( aVMLDrawingFragmentPath.getLength() > 0 )
getFilter().importFragment( new oox::vml::DrawingFragment(
getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) );
@@ -84,9 +81,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
switch( aElementToken )
{
- case NMSP_PPT|XML_sldMaster: // CT_SlideMaster
- case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster
- case NMSP_PPT|XML_sld: // CT_CommonSlideData
+ case PPT_TOKEN( sldMaster ): // CT_SlideMaster
+ case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster
+ case PPT_TOKEN( sld ): // CT_CommonSlideData
{
AttributeList attribs( xAttribs );
@@ -99,14 +96,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
break;
}
- case NMSP_PPT|XML_notes: // CT_NotesSlide
- case NMSP_PPT|XML_notesMaster: // CT_NotesMaster
+ case PPT_TOKEN( notes ): // CT_NotesSlide
+ case PPT_TOKEN( notesMaster ): // CT_NotesMaster
break;
- case NMSP_PPT|XML_cSld: // CT_CommonSlideData
+ case PPT_TOKEN( cSld ): // CT_CommonSlideData
maSlideName = xAttribs->getOptionalValue(XML_name);
break;
- case NMSP_PPT|XML_spTree: // CT_GroupShape
+ case PPT_TOKEN( spTree ): // CT_GroupShape
{
xRet.set( new PPTShapeGroupContext(
*this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
@@ -114,10 +111,10 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
break;
- case NMSP_PPT|XML_controls:
+ case PPT_TOKEN( controls ):
xRet = getFastContextHandler();
break;
- case NMSP_PPT|XML_control:
+ case PPT_TOKEN( control ):
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) );
@@ -127,18 +124,18 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
return xRet;
- case NMSP_PPT|XML_timing: // CT_SlideTiming
+ case PPT_TOKEN( timing ): // CT_SlideTiming
xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) );
break;
- case NMSP_PPT|XML_transition: // CT_SlideTransition
+ case PPT_TOKEN( transition ): // CT_SlideTransition
xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) );
break;
- case NMSP_PPT|XML_hf:
+ case PPT_TOKEN( hf ):
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
// BackgroundGroup
- case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties
+ case PPT_TOKEN( bgPr ): // CT_BackgroundProperties
{
FillPropertiesPtr pFillPropertiesPtr( new FillProperties );
xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) );
@@ -146,7 +143,7 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
break;
- case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference
+ case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference
{
FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
*mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
@@ -155,21 +152,21 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
break;
- case NMSP_PPT|XML_clrMap: // CT_ColorMapping
+ case PPT_TOKEN( clrMap ): // CT_ColorMapping
{
oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() );
xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) );
mpSlidePersistPtr->setClrMap( pClrMapPtr );
}
break;
- case NMSP_PPT|XML_clrMapOvr: // CT_ColorMappingOverride
- case NMSP_PPT|XML_sldLayoutIdLst: // CT_SlideLayoutIdList
+ case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride
+ case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList
break;
- case NMSP_PPT|XML_txStyles: // CT_SlideMasterTextStyles
+ case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles
xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) );
break;
- case NMSP_PPT|XML_custDataLst: // CT_CustomerDataList
- case NMSP_PPT|XML_tagLst: // CT_TagList
+ case PPT_TOKEN( custDataLst ): // CT_CustomerDataList
+ case PPT_TOKEN( tagLst ): // CT_TagList
break;
}
diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx
index 773730417a27..d4c777102a0a 100644
--- a/oox/source/ppt/slidemastertextstylescontext.cxx
+++ b/oox/source/ppt/slidemastertextstylescontext.cxx
@@ -28,8 +28,6 @@
#include "oox/drawingml/textliststyle.hxx"
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/ppt/slidemastertextstylescontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -54,22 +52,22 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_titleStyle:
+ case PPT_TOKEN( titleStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getTitleTextStyle();
break;
}
- case NMSP_PPT|XML_bodyStyle:
+ case PPT_TOKEN( bodyStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getBodyTextStyle();
break;
}
- case NMSP_PPT|XML_notesStyle:
+ case PPT_TOKEN( notesStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getNotesTextStyle();
break;
}
- case NMSP_PPT|XML_otherStyle:
+ case PPT_TOKEN( otherStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getOtherTextStyle();
break;
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 8555ba371b77..7f8fba345bd6 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -31,9 +31,7 @@
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/vml/vmldrawing.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "tokens.hxx"
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -129,7 +127,7 @@ sal_Int16 SlidePersist::getLayoutFromValueToken()
return nLayout;
}
-void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase )
+void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
{
applyTextStyles( rFilterBase );
diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx
index b64d79c949cf..4357e14ea08e 100644
--- a/oox/source/ppt/slidetimingcontext.cxx
+++ b/oox/source/ppt/slidetimingcontext.cxx
@@ -34,10 +34,8 @@
#include "oox/ppt/slidefragmenthandler.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/ppt/timenodelistcontext.hxx"
#include "buildlistcontext.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -72,12 +70,12 @@ Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal
switch( aElementToken )
{
- case NMSP_PPT|XML_bldLst:
+ case PPT_TOKEN( bldLst ):
xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) );
break;
- case NMSP_PPT|XML_extLst:
+ case PPT_TOKEN( extLst ):
return xRet;
- case NMSP_PPT|XML_tnLst:
+ case PPT_TOKEN( tnLst ):
// timing nodes
{
xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) );
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index ee889e13d840..a380a4d945e1 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -35,10 +35,9 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
#include "pptfilterhelpers.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star::uno;
@@ -256,11 +255,11 @@ namespace oox { namespace ppt {
{
switch( OoxType )
{
- case NMSP_PPT|XML_blinds:
+ case PPT_TOKEN( blinds ):
mnTransitionType = TransitionType::BLINDSWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
break;
- case NMSP_PPT|XML_checker:
+ case PPT_TOKEN( checker ):
mnTransitionType = TransitionType::CHECKERBOARDWIPE;
switch ( param1 )
{
@@ -274,7 +273,7 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_comb:
+ case PPT_TOKEN( comb ):
mnTransitionType = TransitionType::PUSHWIPE;
switch( param1 )
{
@@ -288,16 +287,16 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_cover:
+ case PPT_TOKEN( cover ):
mnTransitionType = TransitionType::SLIDEWIPE;
mnTransitionSubType = ooxToOdpEightDirections( param1 );
break;
- case NMSP_PPT|XML_pull: // uncover
+ case PPT_TOKEN( pull ): // uncover
mnTransitionType = TransitionType::SLIDEWIPE;
mnTransitionSubType = ooxToOdpEightDirections( param1 );
mbTransitionDirectionNormal = false;
break;
- case NMSP_PPT|XML_cut:
+ case PPT_TOKEN( cut ):
// The binfilter seems to ignore this transition.
// Fade to black instead if thrBlk is true.
if( param1 )
@@ -307,7 +306,7 @@ namespace oox { namespace ppt {
}
OSL_TRACE( "OOX: cut transition fallback." );
break;
- case NMSP_PPT|XML_fade:
+ case PPT_TOKEN( fade ):
mnTransitionType = TransitionType::FADE;
if( param1 )
{
@@ -318,16 +317,16 @@ namespace oox { namespace ppt {
mnTransitionSubType = TransitionSubType::CROSSFADE;
}
break;
- case NMSP_PPT|XML_push:
+ case PPT_TOKEN( push ):
mnTransitionType = TransitionType::PUSHWIPE;
mnTransitionSubType = ooxToOdpBorderDirections( param1 );
break;
- case NMSP_PPT|XML_wipe:
+ case PPT_TOKEN( wipe ):
mnTransitionType = TransitionType::BARWIPE;
mnTransitionSubType = ooxToOdpSideDirections( param1 );
mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 );
break;
- case NMSP_PPT|XML_split:
+ case PPT_TOKEN( split ):
mnTransitionType = TransitionType::BARNDOORWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
if( param2 == XML_in )
@@ -336,7 +335,7 @@ namespace oox { namespace ppt {
mbTransitionDirectionNormal = false;
}
break;
- case NMSP_PPT|XML_wheel:
+ case PPT_TOKEN( wheel ):
mnTransitionType = TransitionType::PINWHEELWIPE;
switch( param1 )
{
@@ -372,40 +371,40 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_randomBar:
+ case PPT_TOKEN( randomBar ):
mnTransitionType = TransitionType::RANDOMBARWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
break;
- case NMSP_PPT|XML_circle:
+ case PPT_TOKEN( circle ):
mnTransitionType = TransitionType::ELLIPSEWIPE;
mnTransitionSubType = TransitionSubType::CIRCLE;
break;
- case NMSP_PPT|XML_diamond:
+ case PPT_TOKEN( diamond ):
mnTransitionType = TransitionType::IRISWIPE;
mnTransitionSubType = TransitionSubType::DIAMOND;
break;
- case NMSP_PPT|XML_dissolve:
+ case PPT_TOKEN( dissolve ):
mnTransitionType = TransitionType::DISSOLVE;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
- case NMSP_PPT|XML_newsflash:
+ case PPT_TOKEN( newsflash ):
// this is what the PPT binary filter does.... not sure I agree.
mnTransitionType = TransitionType::FOURBOXWIPE;
mnTransitionSubType = TransitionSubType::CORNERSOUT;
break;
- case NMSP_PPT|XML_plus:
+ case PPT_TOKEN( plus ):
mnTransitionType = TransitionType::FOURBOXWIPE;
mnTransitionSubType = TransitionSubType::CORNERSOUT;
break;
- case NMSP_PPT|XML_random:
+ case PPT_TOKEN( random ):
mnTransitionType = TransitionType::RANDOM;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
- case NMSP_PPT|XML_wedge:
+ case PPT_TOKEN( wedge ):
mnTransitionType = TransitionType::FANWIPE;
mnTransitionSubType = TransitionSubType::CENTERTOP;
break;
- case NMSP_PPT|XML_zoom:
+ case PPT_TOKEN( zoom ):
mnTransitionType = TransitionType::ZOOM;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index 92993d754ada..4c5ae7dcc65f 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -38,9 +38,6 @@
#include "oox/ppt/soundactioncontext.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -86,10 +83,10 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
switch( aElementToken )
{
- case NMSP_PPT|XML_blinds:
- case NMSP_PPT|XML_checker:
- case NMSP_PPT|XML_comb:
- case NMSP_PPT|XML_randomBar:
+ case PPT_TOKEN( blinds ):
+ case PPT_TOKEN( checker ):
+ case PPT_TOKEN( comb ):
+ case PPT_TOKEN( randomBar ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -97,8 +94,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_Direction { XML_horz, XML_vert }
}
break;
- case NMSP_PPT|XML_cover:
- case NMSP_PPT|XML_pull:
+ case PPT_TOKEN( cover ):
+ case PPT_TOKEN( pull ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -109,8 +106,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// XML_ld, XML_lu, XML_rd, XML_ru }
}
break;
- case NMSP_PPT|XML_cut:
- case NMSP_PPT|XML_fade:
+ case PPT_TOKEN( cut ):
+ case PPT_TOKEN( fade ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -119,8 +116,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0);
}
break;
- case NMSP_PPT|XML_push:
- case NMSP_PPT|XML_wipe:
+ case PPT_TOKEN( push ):
+ case PPT_TOKEN( wipe ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -128,7 +125,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u }
}
break;
- case NMSP_PPT|XML_split:
+ case PPT_TOKEN( split ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -137,7 +134,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
break;
- case NMSP_PPT|XML_zoom:
+ case PPT_TOKEN( zoom ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -145,7 +142,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
break;
- case NMSP_PPT|XML_wheel:
+ case PPT_TOKEN( wheel ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -154,13 +151,13 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// unsignedInt
}
break;
- case NMSP_PPT|XML_circle:
- case NMSP_PPT|XML_diamond:
- case NMSP_PPT|XML_dissolve:
- case NMSP_PPT|XML_newsflash:
- case NMSP_PPT|XML_plus:
- case NMSP_PPT|XML_random:
- case NMSP_PPT|XML_wedge:
+ case PPT_TOKEN( circle ):
+ case PPT_TOKEN( diamond ):
+ case PPT_TOKEN( dissolve ):
+ case PPT_TOKEN( newsflash ):
+ case PPT_TOKEN( plus ):
+ case PPT_TOKEN( random ):
+ case PPT_TOKEN( wedge ):
// CT_Empty
if (!mbHasTransition)
{
@@ -170,11 +167,11 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
break;
- case NMSP_PPT|XML_sndAc: // CT_TransitionSoundAction
+ case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction
//"Sound"
xRet.set( new SoundActionContext ( *this, maSlideProperties ) );
break;
- case NMSP_PPT|XML_extLst: // CT_OfficeArtExtensionList
+ case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList
return xRet;
default:
break;
@@ -188,7 +185,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException)
{
- if( aElement == (NMSP_PPT|XML_transition) )
+ if( aElement == (PPT_TOKEN( transition )) )
{
if( mbHasTransition )
{
diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx
index 281eb848629c..e9b955a73e15 100644
--- a/oox/source/ppt/soundactioncontext.cxx
+++ b/oox/source/ppt/soundactioncontext.cxx
@@ -32,10 +32,7 @@
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -63,7 +60,7 @@ namespace oox { namespace ppt {
void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException)
{
- if ( aElement == ( NMSP_PPT|XML_sndAc ) )
+ if ( aElement == PPT_TOKEN( sndAc ) )
{
if( mbHasStartSound )
{
@@ -106,7 +103,7 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_snd:
+ case PPT_TOKEN( snd ):
if( mbHasStartSound )
{
drawingml::EmbeddedWAVAudioFile aAudio;
@@ -115,11 +112,11 @@ namespace oox { namespace ppt {
msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
}
break;
- case NMSP_PPT|XML_endSnd:
+ case PPT_TOKEN( endSnd ):
// CT_Empty
mbStopSound = true;
break;
- case NMSP_PPT|XML_stSnd:
+ case PPT_TOKEN( stSnd ):
mbHasStartSound = true;
mbLoopSound = attribs.getBool( XML_loop, false );
default:
diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx
index 5699d8a44cc3..185897f2e101 100644
--- a/oox/source/ppt/timeanimvaluecontext.cxx
+++ b/oox/source/ppt/timeanimvaluecontext.cxx
@@ -27,12 +27,8 @@
#include "timeanimvaluecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "animvariantcontext.hxx"
-#include "tokens.hxx"
-
-
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -57,7 +53,7 @@ namespace oox { namespace ppt {
void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_tav ) )
+ if( aElement == PPT_TOKEN( tav ) )
{
mbInValue = false;
}
@@ -72,7 +68,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_tav:
+ case PPT_TOKEN( tav ):
{
mbInValue = true;
TimeAnimationValue val;
@@ -81,7 +77,7 @@ namespace oox { namespace ppt {
maTavList.push_back( val );
break;
}
- case NMSP_PPT|XML_val:
+ case PPT_TOKEN( val ):
if( mbInValue )
{
// CT_TLAnimVariant
diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx
index 51a53d9631a2..6887bcfdf3a3 100644
--- a/oox/source/ppt/timenode.cxx
+++ b/oox/source/ppt/timenode.cxx
@@ -588,7 +588,7 @@ namespace oox { namespace ppt {
const Reference< XAnimationNode >& rxNode )
{
try {
- Reference< XAnimationNode > xNode ( rFilter.getGlobalFactory()->createInstance(rServiceName ), UNO_QUERY_THROW );
+ Reference< XAnimationNode > xNode ( rFilter.getServiceFactory()->createInstance( rServiceName ), UNO_QUERY_THROW );
Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW );
xParentContainer->appendChild( xNode );
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 7e40e3be4db4..6a82dc29c1de 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -47,12 +47,10 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/ppt/slidetransition.hxx"
-#include "tokens.hxx"
#include "animvariantcontext.hxx"
#include "commonbehaviorcontext.hxx"
@@ -129,10 +127,10 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_audio:
+ case PPT_TOKEN( audio ):
mbIsNarration = attribs.getBool( XML_isNarration, false );
break;
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( video ):
mbFullScrn = attribs.getBool( XML_fullScrn, false );
break;
default:
@@ -143,11 +141,11 @@ namespace oox { namespace ppt {
virtual void SAL_CALL endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_audio ) )
+ if( aElement == PPT_TOKEN( audio ) )
{
// TODO deal with mbIsNarration
}
- else if( aElement == ( NMSP_PPT|XML_video ) )
+ else if( aElement == PPT_TOKEN( video ) )
{
// TODO deal with mbFullScrn
}
@@ -161,7 +159,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -227,10 +225,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
// CT_TLAnimVariant
xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) );
break;
@@ -261,7 +259,7 @@ namespace oox { namespace ppt {
{
switch ( aElement )
{
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
msCommand = xAttribs->getOptionalValue( XML_cmd );
maType = xAttribs->getOptionalValueToken( XML_type, 0 );
break;
@@ -277,7 +275,7 @@ namespace oox { namespace ppt {
virtual void SAL_CALL endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_cmd ) )
+ if( aElement == PPT_TOKEN( cmd ) )
{
try {
// see sd/source/filter/ppt/pptinanimations.cxx
@@ -356,7 +354,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -409,14 +407,14 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_nextCondLst:
+ case PPT_TOKEN( nextCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
mpNode->getNextCondition() ) );
break;
- case NMSP_PPT|XML_prevCondLst:
+ case PPT_TOKEN( prevCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
mpNode->getPrevCondition() ) );
break;
@@ -457,7 +455,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
default:
@@ -521,7 +519,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_hsl:
+ case PPT_TOKEN( hsl ):
// CT_TLByHslColorTransform
{
if( mbHasByColor )
@@ -534,7 +532,7 @@ namespace oox { namespace ppt {
xRet.set(this);
break;
}
- case NMSP_PPT|XML_rgb:
+ case PPT_TOKEN( rgb ):
{
if( mbHasByColor )
{
@@ -547,19 +545,19 @@ namespace oox { namespace ppt {
xRet.set(this);
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
// CT_TLByAnimateColorTransform
mbHasByColor = true;
xRet.set(this);
break;
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
// CT_Color
xRet.set( new ColorContext( *this, maToClr ) );
break;
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
// CT_Color
xRet.set( new ColorContext( *this, maFromClr ) );
break;
@@ -678,10 +676,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_tavLst:
+ case PPT_TOKEN( tavLst ):
xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) );
break;
default:
@@ -748,10 +746,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -759,7 +757,7 @@ namespace oox { namespace ppt {
maTo <<= p.Y;
break;
}
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -767,7 +765,7 @@ namespace oox { namespace ppt {
maFrom <<= p.Y;
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -834,7 +832,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -902,10 +900,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -915,7 +913,7 @@ namespace oox { namespace ppt {
mpNode->setTo( rAny );
break;
}
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -925,7 +923,7 @@ namespace oox { namespace ppt {
mpNode->setFrom( rAny );
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -935,7 +933,7 @@ namespace oox { namespace ppt {
mpNode->setBy( rAny );
break;
}
- case NMSP_PPT|XML_rCtr:
+ case PPT_TOKEN( rCtr ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -993,10 +991,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_progress:
+ case PPT_TOKEN( progress ):
xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) );
// TODO handle it.
break;
@@ -1025,41 +1023,41 @@ namespace oox { namespace ppt {
TimeNodeContext *pCtx = NULL;
switch( aElement )
{
- case NMSP_PPT|XML_animClr:
+ case PPT_TOKEN( animClr ):
pCtx = new AnimColorContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_par:
+ case PPT_TOKEN( par ):
pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_seq:
+ case PPT_TOKEN( seq ):
pCtx = new SequenceTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_excl:
+ case PPT_TOKEN( excl ):
pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_anim:
+ case PPT_TOKEN( anim ):
pCtx = new AnimContext ( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animEffect:
+ case PPT_TOKEN( animEffect ):
pCtx = new AnimEffectContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animMotion:
+ case PPT_TOKEN( animMotion ):
pCtx = new AnimMotionContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animRot:
+ case PPT_TOKEN( animRot ):
pCtx = new AnimRotContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animScale:
+ case PPT_TOKEN( animScale ):
pCtx = new AnimScaleContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
pCtx = new CmdTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_set:
+ case PPT_TOKEN( set ):
pCtx = new SetTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_audio:
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( audio ):
+ case PPT_TOKEN( video ):
pCtx = new MediaNodeContext( rParent, aElement, xAttribs, pNode );
break;
default:
@@ -1106,43 +1104,43 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_par:
+ case PPT_TOKEN( par ):
nNodeType = AnimationNodeType::PAR;
break;
- case NMSP_PPT|XML_seq:
+ case PPT_TOKEN( seq ):
nNodeType = AnimationNodeType::SEQ;
break;
- case NMSP_PPT|XML_excl:
+ case PPT_TOKEN( excl ):
// TODO pick the right type. We choose parallel for now as
// there does not seem to be an "Exclusive"
nNodeType = AnimationNodeType::PAR;
break;
- case NMSP_PPT|XML_anim:
+ case PPT_TOKEN( anim ):
nNodeType = AnimationNodeType::ANIMATE;
break;
- case NMSP_PPT|XML_animClr:
+ case PPT_TOKEN( animClr ):
nNodeType = AnimationNodeType::ANIMATECOLOR;
break;
- case NMSP_PPT|XML_animEffect:
+ case PPT_TOKEN( animEffect ):
nNodeType = AnimationNodeType::TRANSITIONFILTER;
break;
- case NMSP_PPT|XML_animMotion:
+ case PPT_TOKEN( animMotion ):
nNodeType = AnimationNodeType::ANIMATEMOTION;
break;
- case NMSP_PPT|XML_animRot:
- case NMSP_PPT|XML_animScale:
+ case PPT_TOKEN( animRot ):
+ case PPT_TOKEN( animScale ):
nNodeType = AnimationNodeType::ANIMATETRANSFORM;
break;
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
nNodeType = AnimationNodeType::COMMAND;
break;
- case NMSP_PPT|XML_set:
+ case PPT_TOKEN( set ):
nNodeType = AnimationNodeType::SET;
break;
- case NMSP_PPT|XML_audio:
+ case PPT_TOKEN( audio ):
nNodeType = AnimationNodeType::AUDIO;
break;
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( video ):
nNodeType = AnimationNodeType::AUDIO;
OSL_TRACE( "OOX: video requested, gave Audio instead" );
break;
diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx
index 884b6d30fa61..81320bef5e89 100644
--- a/oox/source/ppt/timetargetelementcontext.cxx
+++ b/oox/source/ppt/timetargetelementcontext.cxx
@@ -34,9 +34,7 @@
#include <com/sun/star/uno/Any.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "tokens.hxx"
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -67,29 +65,29 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_bg:
+ case PPT_TOKEN( bg ):
bTargetSet = true;
maShapeTarget.mnType = XML_bg;
break;
- case NMSP_PPT|XML_txEl:
+ case PPT_TOKEN( txEl ):
bTargetSet = true;
maShapeTarget.mnType = XML_txEl;
break;
- case NMSP_PPT|XML_subSp:
+ case PPT_TOKEN( subSp ):
bTargetSet = true;
maShapeTarget.mnType = XML_subSp;
maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid );
break;
- case NMSP_PPT|XML_graphicEl:
- case NMSP_PPT|XML_oleChartEl:
+ case PPT_TOKEN( graphicEl ):
+ case PPT_TOKEN( oleChartEl ):
bTargetSet = true;
// TODO
break;
- case NMSP_PPT|XML_charRg:
- case NMSP_PPT|XML_pRg:
+ case PPT_TOKEN( charRg ):
+ case PPT_TOKEN( pRg ):
if( bTargetSet && maShapeTarget.mnType == XML_txEl )
{
- maShapeTarget.mnRangeType = getToken( aElementToken );
+ maShapeTarget.mnRangeType = getBaseToken( aElementToken );
maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs );
}
break;
@@ -130,7 +128,7 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_inkTgt:
+ case PPT_TOKEN( inkTgt ):
{
mpTarget->mnType = XML_inkTgt;
OUString aId = xAttribs->getOptionalValue( XML_spid );
@@ -140,10 +138,10 @@ namespace oox { namespace ppt {
}
break;
}
- case NMSP_PPT|XML_sldTgt:
+ case PPT_TOKEN( sldTgt ):
mpTarget->mnType = XML_sldTgt;
break;
- case NMSP_PPT|XML_sndTgt:
+ case PPT_TOKEN( sndTgt ):
{
mpTarget->mnType = XML_sndTgt;
drawingml::EmbeddedWAVAudioFile aAudio;
@@ -153,7 +151,7 @@ namespace oox { namespace ppt {
mpTarget->msValue = sSndName;
break;
}
- case NMSP_PPT|XML_spTgt:
+ case PPT_TOKEN( spTgt ):
{
mpTarget->mnType = XML_spTgt;
OUString aId = xAttribs->getOptionalValue( XML_spid );
@@ -162,7 +160,7 @@ namespace oox { namespace ppt {
break;
}
default:
- OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getToken( aElementToken ) );
+ OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) );
break;
}
diff --git a/oox/source/shape/FastTokenHandlerService.cxx b/oox/source/shape/FastTokenHandlerService.cxx
deleted file mode 100644
index 6c6fcfa53d6e..000000000000
--- a/oox/source/shape/FastTokenHandlerService.cxx
+++ /dev/null
@@ -1,116 +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 <com/sun/star/beans/XPropertySet.hpp>
-#include "FastTokenHandlerService.hxx"
-
-namespace oox {
-namespace shape {
-
-using namespace ::com::sun::star;
-
-FastTokenHandlerService::FastTokenHandlerService(uno::Reference< uno::XComponentContext > const & context) :
- m_xContext(context)
-{}
-
-// com.sun.star.uno.XServiceInfo:
-::rtl::OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (uno::RuntimeException)
-{
- return FastTokenHandlerService_getImplementationName();
-}
-
-::sal_Bool SAL_CALL FastTokenHandlerService::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException)
-{
- uno::Sequence< ::rtl::OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames();
- for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
- if (serviceNames[i] == serviceName)
- return sal_True;
- }
- return sal_False;
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (uno::RuntimeException)
-{
- return FastTokenHandlerService_getSupportedServiceNames();
-}
-
-::sal_Int32 SAL_CALL FastTokenHandlerService::getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getToken(Identifier);
-}
-
-::rtl::OUString SAL_CALL FastTokenHandlerService::getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getIdentifier(Token);
-}
-
-::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getUTF8Identifier(Token);
-}
-
-::sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getTokenFromUTF8(Identifier);
-}
-
-::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName() {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.FastTokenHandlerService"));
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames()
-{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.xml.sax.FastTokenHandler"));
- return s;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL FastTokenHandlerService_create(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
-{
- return static_cast< ::cppu::OWeakObject * >(new FastTokenHandlerService(context));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-FastTokenHandlerService_createInstance
-( const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- uno::Reference<beans::XPropertySet>
- xPropertySet(rSMgr, uno::UNO_QUERY_THROW);
- uno::Any aDefaultContext = xPropertySet->getPropertyValue
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")));
-
- uno::Reference<uno::XComponentContext> xContext;
- aDefaultContext >>= xContext;
-
- return FastTokenHandlerService_create(xContext);
-}
-
-}}
diff --git a/oox/source/shape/FastTokenHandlerService.hxx b/oox/source/shape/FastTokenHandlerService.hxx
deleted file mode 100644
index b822654fdcfb..000000000000
--- a/oox/source/shape/FastTokenHandlerService.hxx
+++ /dev/null
@@ -1,81 +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 OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX
-#define OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX
-
-#include <sal/config.h>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include "oox/core/fasttokenhandler.hxx"
-
-namespace css = ::com::sun::star;
-
-namespace oox {
-namespace shape {
-
-class FastTokenHandlerService:
- public ::cppu::WeakImplHelper2<
- css::lang::XServiceInfo,
- css::xml::sax::XFastTokenHandler>
-{
-public:
- explicit FastTokenHandlerService(css::uno::Reference< css::uno::XComponentContext > const & context);
-
- // ::com::sun::star::lang::XServiceInfo:
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
-
- // ::com::sun::star::xml::sax::XFastTokenHandler:
- virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (css::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (css::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException);
-
-private:
- FastTokenHandlerService(FastTokenHandlerService &); // not defined
- void operator =(FastTokenHandlerService &); // not defined
-
- virtual ~FastTokenHandlerService() {}
-
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
- ::oox::core::FastTokenHandler mFastTokenHandler;
-};
-
-::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName();
-
-css::uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames();
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL _FastTokenHandlerService_create(
- const css::uno::Reference< css::uno::XComponentContext > & context)
- SAL_THROW((css::uno::Exception));
-
-}}
-#endif // OOX_SHAPE_FAST_TOKEN_HANDLER_SERVICE_HXX
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index e253d43e56e7..31ab343e0ebc 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -29,7 +29,6 @@
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-#include "tokens.hxx"
namespace oox { namespace shape {
@@ -37,15 +36,34 @@ using namespace ::com::sun::star;
using namespace core;
using namespace drawingml;
+::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.ShapeContextHandler" );
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL
+ShapeContextHandler_getSupportedServiceNames()
+{
+ uno::Sequence< ::rtl::OUString > s(1);
+ s[0] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastShapeContextHandler" );
+ return s;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL
+ShapeContextHandler_createInstance( const uno::Reference< uno::XComponentContext > & context)
+ SAL_THROW((uno::Exception))
+{
+ return static_cast< ::cppu::OWeakObject* >( new ShapeContextHandler(context) );
+}
+
+
ShapeContextHandler::ShapeContextHandler
(uno::Reference< uno::XComponentContext > const & context) :
mnStartToken(0), m_xContext(context)
{
try
{
- uno::Reference<lang::XMultiServiceFactory>
- xFactory(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
- mxFilterBase.set( new ShapeFilterBase(xFactory) );
+ mxFilterBase.set( new ShapeFilterBase(context) );
}
catch( uno::Exception& )
{
@@ -68,7 +86,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
switch (Element & 0xffff)
{
case XML_graphic:
- mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
+ mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
mxGraphicShapeContext.set
(new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape, true));
break;
@@ -105,10 +123,10 @@ ShapeContextHandler::getContextHandler()
{
uno::Reference<xml::sax::XFastContextHandler> xResult;
- switch (mnStartToken & NMSP_MASK)
+ switch (getNamespace( mnStartToken ))
{
- case NMSP_DOC:
- case NMSP_VML:
+ case NMSP_doc:
+ case NMSP_vml:
xResult.set(getDrawingShapeContext());
break;
default:
@@ -320,11 +338,6 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames()
return ShapeContextHandler_getSupportedServiceNames();
}
-::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName() {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.ShapeContextHandler"));
-}
-
::sal_Bool SAL_CALL ShapeContextHandler::supportsService
(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException)
{
@@ -336,38 +349,4 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames()
return sal_False;
}
-uno::Sequence< ::rtl::OUString > SAL_CALL
-ShapeContextHandler_getSupportedServiceNames()
-{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.xml.sax.FastShapeContextHandler"));
- return s;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-ShapeContextHandler_create(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
-{
- return static_cast< ::cppu::OWeakObject * >
- (new ShapeContextHandler(context));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-ShapeContextHandler_createInstance
-( const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- uno::Reference<beans::XPropertySet>
- xPropertySet(rSMgr, uno::UNO_QUERY_THROW);
- uno::Any aDefaultContext = xPropertySet->getPropertyValue
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")));
-
- uno::Reference<uno::XComponentContext> xContext;
- aDefaultContext >>= xContext;
-
- return ShapeContextHandler_create(xContext);
-}
-
}}
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index c9cf67283c37..b794c2f879c1 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -28,10 +28,9 @@
#define OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX
#include <boost/shared_ptr.hpp>
-#include "sal/config.h"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/implbase1.hxx"
-#include "com/sun/star/xml/sax/XFastShapeContextHandler.hpp"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/theme.hxx"
@@ -43,21 +42,6 @@ namespace css = ::com::sun::star;
namespace oox { namespace shape {
-// component and service helper functions:
-::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName();
-
-css::uno::Sequence< ::rtl::OUString > SAL_CALL
-ShapeContextHandler_getSupportedServiceNames();
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL
-ShapeContextHandler_create
-( css::uno::Reference< css::uno::XComponentContext > const & context );
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL
-ShapeContextHandler_createInstance
-( const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr)
-throw( css::uno::Exception );
-
class ShapeFragmentHandler : public core::FragmentHandler
{
public:
diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx
index 7ed001ffc96c..68e0d0002392 100644
--- a/oox/source/shape/ShapeFilterBase.cxx
+++ b/oox/source/shape/ShapeFilterBase.cxx
@@ -27,17 +27,16 @@
#include "ShapeFilterBase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx"
+#include "oox/ole/vbaproject.hxx"
namespace oox {
namespace shape {
using namespace ::com::sun::star;
-ShapeFilterBase::ShapeFilterBase
-(const uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- rxFactory)
-: XmlFilterBase(rxFactory)
-, mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+ShapeFilterBase::ShapeFilterBase( const uno::Reference< uno::XComponentContext >& rxContext ) throw( uno::RuntimeException ) :
+ XmlFilterBase( rxContext ),
+ mxChartConv( new ::oox::drawingml::chart::ChartConverter )
{
}
@@ -65,6 +64,11 @@ const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles
return *mxChartConv;
}
+::oox::ole::VbaProject* ShapeFilterBase::implCreateVbaProject() const
+{
+ return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Writer" ) );
+}
+
::rtl::OUString ShapeFilterBase::implGetImplementationName() const
{
return ::rtl::OUString();
diff --git a/oox/source/shape/ShapeFilterBase.hxx b/oox/source/shape/ShapeFilterBase.hxx
index 09cbc75e01aa..a21357c16079 100644
--- a/oox/source/shape/ShapeFilterBase.hxx
+++ b/oox/source/shape/ShapeFilterBase.hxx
@@ -45,7 +45,8 @@ public:
typedef boost::shared_ptr<ShapeFilterBase> Pointer_t;
explicit ShapeFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ShapeFilterBase();
@@ -60,12 +61,13 @@ public:
virtual ::oox::drawingml::chart::ChartConverter& getChartConverter();
- virtual rtl::OUString implGetImplementationName() const;
-
virtual bool importDocument() { return true; }
virtual bool exportDocument() { return true; }
private:
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
+ virtual rtl::OUString implGetImplementationName() const;
+
::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv;
};
diff --git a/oox/source/shape/makefile.mk b/oox/source/shape/makefile.mk
index f5a3af5542c0..c6534b3a8a6f 100644
--- a/oox/source/shape/makefile.mk
+++ b/oox/source/shape/makefile.mk
@@ -42,8 +42,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/ShapeContextHandler.obj \
- $(SLO)$/ShapeFilterBase.obj \
- $(SLO)$/FastTokenHandlerService.obj
+ $(SLO)$/ShapeFilterBase.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl
deleted file mode 100644
index 2a7f2e2423bb..000000000000
--- a/oox/source/token/gennamespaces.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-
-open ( NAMESPACES, $ARGV0 ) || die "can't open namespaces file: $!";
-
-
-open ( HXX, ">$ARGV1" ) or die "can't open namespaces.hxx file: $!";
-
-print ( HXX "#ifndef OOX_NAMESPACES_HXX\n" );
-print ( HXX "#define OOX_NAMESPACES_HXX\n\n" );
-print ( HXX "#include <sal/types.h>\n\n" );
-print ( HXX "namespace oox {\n\n" );
-
-$group = 0;
-$i = 1;
-while ( <NAMESPACES> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- if ( $_ =~ m/^$/ )
- {
- # Start a new group
- print ( HXX "\n" );
- $i = 0;
- $group++;
- }
- elsif ( $_ =~ m/^[^#]/ )
- {
- # Neither an empty line nor a comment
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
- $id = "NMSP_$_";
- $id =~ s/-/_/g;
- $no = $group*10 + $i;
- print ( HXX "const sal_Int32 $id = $no << 16;\n" );
- ++$i;
- }
-}
-close ( NAMESPACES );
-
-print ( HXX "\nconst sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;\n" );
-print ( HXX "const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;\n" );
-
-print ( HXX "/** Returns the token identifier of the passed element without namespace. */\n" );
-print ( HXX "inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }\n\n" );
-
-print ( HXX "/** Returns the namespace of the passed element without token identifier. */\n" );
-print ( HXX "inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }\n\n" );
-
-print ( HXX "// defines for tokens with specific namespaces, can be used in switch/cases\n\n" );
-print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" );
-print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" );
-print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" );
-print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" );
-print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" );
-print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" );
-print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" );
-print ( HXX "#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)\n" );
-print ( HXX "#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)\n" );
-print ( HXX "#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)\n" );
-print ( HXX "#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)\n" );
-print ( HXX "#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)\n" );
-print ( HXX "#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)\n" );
-
-
-print ( HXX "} // namespace oox\n\n" );
-print ( HXX "#endif // OOX_NAMESPACES_HXX\n" );
diff --git a/oox/source/token/genproperties.pl b/oox/source/token/genproperties.pl
deleted file mode 100644
index 9dbe15c8ac12..000000000000
--- a/oox/source/token/genproperties.pl
+++ /dev/null
@@ -1,46 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-$ARGV2 = shift @ARGV;
-
-open ( PROPS, $ARGV0 ) || die "can't open properties source file: $!";
-my %props;
-
-while ( <PROPS> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "invalid character in property '$_'";
- $id = "PROP_$_";
- $props{$_} = $id;
-}
-close ( TOKENS );
-
-open ( HXX, ">$ARGV1" ) or die "can't open properties.hxx file: $!";
-open ( WORDS, ">$ARGV2" ) or die "can't open propertynames.inc file: $!";
-
-print ( HXX "#ifndef OOX_PROPERTIES_HXX\n" );
-print ( HXX "#define OOX_PROPERTIES_HXX\n\n" );
-print ( HXX "#include <sal/types.h>\n" );
-print ( HXX "namespace oox {\n\n" );
-
-print ( WORDS "static const sal_Char* propertywordlist[] = {\n" );
-
-$i = 0;
-foreach( sort( keys( %props ) ) )
-{
- print ( HXX "const sal_Int32 $props{$_} = $i;\n" );
- print ( WORDS " \"$_\",\n" );
- ++$i;
-}
-
-print ( HXX "const sal_Int32 PROP_COUNT = $i;\n" );
-print ( HXX "const sal_Int32 PROP_INVALID = -1;\n\n" );
-print ( HXX "} // namespace oox\n" );
-print ( HXX "#endif\n" );
-
-print ( WORDS " \"\"\n" );
-print ( WORDS "};\n" );
-
-close ( HXX );
-close ( WORDS );
-
diff --git a/oox/source/token/gentoken.pl b/oox/source/token/gentoken.pl
deleted file mode 100644
index 196ac37ebb5c..000000000000
--- a/oox/source/token/gentoken.pl
+++ /dev/null
@@ -1,61 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-$ARGV2 = shift @ARGV;
-$ARGV3 = shift @ARGV;
-
-open ( TOKENS, $ARGV0 ) || die "can't open $ARGV0 file: $!";
-my %tokens;
-
-while ( <TOKENS> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "invalid character in token '$_'";
- $id = "XML_$_";
- $id =~ s/-/_/g;
- $tokens{$_} = $id;
-}
-close ( TOKENS );
-
-open ( HXX, ">$ARGV1" ) or die "can't open $ARGV1 file: $!";
-open ( WORDS, ">$ARGV2" ) or die "can't open $ARGV2 file: $!";
-open ( GPERF, ">$ARGV3" ) or die "can't open $ARGV3 file: $!";
-
-print ( HXX "#ifndef OOX_TOKENS_HXX\n" );
-print ( HXX "#define OOX_TOKENS_HXX\n\n" );
-print ( HXX "#include <com/sun/star/xml/sax/FastToken.hpp>\n" );
-
-print ( WORDS "static const sal_Char* xmltokenwordlist[] = {\n" );
-
-print ( GPERF "%language=C++\n" );
-print ( GPERF "%global-table\n" );
-print ( GPERF "%null-strings\n" );
-print ( GPERF "%struct-type\n" );
-print ( GPERF "struct xmltoken {\n" );
-print ( GPERF " const sal_Char *name;\n" );
-print ( GPERF " sal_Int32 nToken;\n" );
-print ( GPERF "};\n" );
-print ( GPERF "%%\n" );
-
-$i = 0;
-foreach( sort( keys( %tokens ) ) )
-{
- print ( HXX "const sal_Int32 $tokens{$_} = $i;\n" );
- print ( WORDS " \"$_\",\n" );
- print ( GPERF "$_,$tokens{$_}\n" );
- ++$i;
-}
-
-print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
-print ( HXX "const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;\n\n" );
-print ( HXX "const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;\n\n" );
-print ( HXX "#endif\n" );
-
-print ( WORDS " \"\"\n" );
-print ( WORDS "};\n" );
-
-print ( GPERF "%%\n" );
-
-close ( HXX );
-close ( WORDS );
-close ( GPERF );
diff --git a/oox/source/token/makefile.mk b/oox/source/token/makefile.mk
index 7884c375fde6..ff42967f0bb1 100644
--- a/oox/source/token/makefile.mk
+++ b/oox/source/token/makefile.mk
@@ -39,40 +39,40 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/propertylist.obj \
- $(SLO)$/tokenmap.obj
+SLOFILES = \
+ $(SLO)$/namespacemap.obj \
+ $(SLO)$/propertynames.obj \
+ $(SLO)$/tokenmap.obj
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
-$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(INCCOM)$/oox$/core$/namespaces.hxx :
- @@noop $(assign do_phony:=.PHONY)
+GENHEADERPATH = $(INCCOM)$/oox$/token
-$(MISC)$/do_tokens $(do_phony) : tokens.txt gentoken.pl $(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx
- @@-$(RM) $@
- $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@
+$(MISC)$/tokenhash.gperf $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx :
+ @@noop $(assign do_phony:=.PHONY)
-$(INCCOM)$/oox:
- $(MKDIR) $(INCCOM)$/oox
+$(SLO)$/tokenmap.obj : $(INCCOM)$/tokenhash.inc $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(MISC)$/do_tokens
-$(INCCOM)$/oox$/core: $(INCCOM)$/oox
- $(MKDIR) $(INCCOM)$/oox$/core
+$(INCCOM)$/tokenhash.inc : $(MISC)$/tokenhash.gperf $(MISC)$/do_tokens
+ $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokenhash.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokenhash.inc
-$(MISC)$/do_namespaces $(do_phony) : namespaces.txt gennamespaces.pl
+$(MISC)$/do_tokens $(do_phony) : tokens.txt tokens.pl tokens.hxx.head tokens.hxx.tail $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf
@@-$(RM) $@
- $(MKDIRHIER) $(INCCOM)$/oox$/core
- $(PERL) gennamespaces.pl namespaces.txt $(INCCOM)$/oox$/core$/namespaces.hxx && $(TOUCH) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) tokens.pl tokens.txt $(MISC)$/tokenids.inc $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf && $(TYPE) tokens.hxx.head $(MISC)$/tokenids.inc tokens.hxx.tail > $(GENHEADERPATH)$/tokens.hxx && $(TOUCH) $@
-$(INCCOM)$/tokens.inc : $(MISC)$/tokens.gperf $(MISC)$/do_tokens
- $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokens.inc
+$(SLO)$/namespacemap.obj : $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(MISC)$/do_namespaces
-$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/oox$/core$/namespaces.hxx $(MISC)$/do_tokens $(MISC)$/do_namespaces
-
-$(MISC)$/do_properties $(do_phony) : properties.txt genproperties.pl $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc
+$(MISC)$/do_namespaces $(do_phony) : namespaces.txt namespaces.pl namespaces.hxx.head namespaces.hxx.tail $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx
@@-$(RM) $@
- $(PERL) genproperties.pl properties.txt $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc && $(TOUCH) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) namespaces.pl namespaces.txt $(MISC)$/namespaceids.inc $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt && $(TYPE) namespaces.hxx.head $(MISC)$/namespaceids.inc namespaces.hxx.tail > $(GENHEADERPATH)$/namespaces.hxx && $(TOUCH) $@
-$(SLO)$/propertylist.obj : $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(MISC)$/do_properties
+$(SLO)$/propertynames.obj : $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx $(MISC)$/do_properties
+$(MISC)$/do_properties $(do_phony) : properties.txt properties.pl properties.hxx.head properties.hxx.tail $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx
+ @@-$(RM) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) properties.pl properties.txt $(MISC)$/propertyids.inc $(INCCOM)$/propertynames.inc && $(TYPE) properties.hxx.head $(MISC)$/propertyids.inc properties.hxx.tail > $(GENHEADERPATH)$/properties.hxx && $(TOUCH) $@
diff --git a/vcl/inc/vcl/impbmpconv.hxx b/oox/source/token/namespacemap.cxx
index d95da9a4093a..0f4373d2dc59 100644..100755
--- a/vcl/inc/vcl/impbmpconv.hxx
+++ b/oox/source/token/namespacemap.cxx
@@ -25,15 +25,25 @@
*
************************************************************************/
-#ifndef _VCL_IMPBMPCONV_HXX_
-#define _VCL_IMPBMPCONV_HXX_
+#include "oox/token/namespacemap.hxx"
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/uno/Reference.hxx>
+namespace oox {
-namespace vcl
+// ============================================================================
+
+NamespaceMap::NamespaceMap()
{
-com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+ static const struct NamespaceUrl { sal_Int32 mnId; const sal_Char* mpcUrl; } spNamespaceUrls[] =
+ {
+// include auto-generated C array with namespace URLs as C strings
+#include "namespacenames.inc"
+ { -1, "" }
+ };
+
+ for( const NamespaceUrl* pNamespaceUrl = spNamespaceUrls; pNamespaceUrl->mnId != -1; ++pNamespaceUrl )
+ operator[]( pNamespaceUrl->mnId ) = ::rtl::OUString::createFromAscii( pNamespaceUrl->mpcUrl );
}
-#endif
+// ============================================================================
+
+} // namespace oox
diff --git a/vcl/inc/vcl/wintypes.hxx b/oox/source/token/namespaces.hxx.head
index 6da4e4e3d988..351bf2558303 100644..100755
--- a/vcl/inc/vcl/wintypes.hxx
+++ b/oox/source/token/namespaces.hxx.head
@@ -24,10 +24,13 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SV_WINTYPES_HXX
-#define _SV_WINTYPES_HXX
-#include <tools/wintypes.hxx>
+#ifndef OOX_TOKEN_NAMESPACES_HXX
+#define OOX_TOKEN_NAMESPACES_HXX
-#endif // _SV_WINTYPES_HXX
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail
new file mode 100755
index 000000000000..651fc38511d4
--- /dev/null
+++ b/oox/source/token/namespaces.hxx.tail
@@ -0,0 +1,35 @@
+
+// ============================================================================
+
+const sal_Int32 TOKEN_MASK = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
+const sal_Int32 NMSP_MASK = static_cast< sal_Int32 >( SAL_MAX_INT16 & ~TOKEN_MASK );
+
+/** Returns the raw token identifier without namespace of the passed token. */
+inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }
+
+/** Returns the namespace without token identifier of the passed token. */
+inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
+
+// defines for tokens with specific namespaces
+#define A_TOKEN( token ) (::oox::NMSP_dml | XML_##token)
+#define AX_TOKEN( token ) (::oox::NMSP_ax | XML_##token)
+#define C_TOKEN( token ) (::oox::NMSP_dmlChart | XML_##token)
+#define CDR_TOKEN( token ) (::oox::NMSP_dmlChartDr | XML_##token)
+#define DGM_TOKEN( token ) (::oox::NMSP_dmlDiagram | XML_##token)
+#define O_TOKEN( token ) (::oox::NMSP_vmlOffice | XML_##token)
+#define PC_TOKEN( token ) (::oox::NMSP_packageContentTypes | XML_##token)
+#define PPT_TOKEN( token ) (::oox::NMSP_ppt | XML_##token)
+#define PR_TOKEN( token ) (::oox::NMSP_packageRel | XML_##token)
+#define R_TOKEN( token ) (::oox::NMSP_officeRel | XML_##token)
+#define VML_TOKEN( token ) (::oox::NMSP_vml | XML_##token)
+#define VMLX_TOKEN( token ) (::oox::NMSP_vmlExcel | XML_##token)
+#define XDR_TOKEN( token ) (::oox::NMSP_dmlSpreadDr | XML_##token)
+#define XLS_TOKEN( token ) (::oox::NMSP_xls | XML_##token)
+#define XM_TOKEN( token ) (::oox::NMSP_xm | XML_##token)
+#define XML_TOKEN( token ) (::oox::NMSP_xml | XML_##token)
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/source/token/namespaces.pl b/oox/source/token/namespaces.pl
new file mode 100644
index 000000000000..3c741fa7b2af
--- /dev/null
+++ b/oox/source/token/namespaces.pl
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
+$ARGV3 = shift @ARGV;
+
+# parse input file
+
+open( INFILE, $ARGV0 ) or die "cannot open input file: $!";
+my %namespaces;
+while( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # trim comments
+ $_ =~ s/^#.*//;
+ # skip empty lines
+ if( $_ )
+ {
+ # check for valid characters
+ $_ =~ /^([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
+ $namespaces{$1} = $2;
+ }
+}
+close( INFILE );
+
+# generate output files
+
+open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
+open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
+
+# number of bits to shift the namespace identifier
+$shift = 16;
+
+print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" );
+
+$i = 1;
+foreach( keys( %namespaces ) )
+{
+ print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" );
+ $id = $i << $shift;
+ print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" );
+ print( TXTFILE "$id $_ $namespaces{$_}\n" );
+ ++$i;
+}
+
+close( IDFILE );
+close( nameFILE );
+close( TXTFILE );
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 45bb59541b1b..81b568067470 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -1,49 +1,52 @@
-# Relations, XML
-XML
-PACKAGE_RELATIONSHIPS
-RELATIONSHIPS
-CONTENT_TYPES
-
-# Office global
-THEME
-ACTIVATION
-MATH
-
-#DrawingML
-DRAWINGML
-PICTURE
-DIAGRAM
-CHART
-CDR
-DOC_DRAWINGML
-
-# VML
-VML
-OFFICE
-VML_DOC
-VML_XLS
-VML_PPT
-AX
-
-#SpreadsheetML
-XLS
-XDR
-XM
-
-#PresentationML
-PPT
-
-#WordprocessingML
-DOC
-SML
-
-# Document properties
-COREPR
-DC
-DCTERMS
-EXTPR
-CUSTPR
-VT
-
-# Other elements: used by writerfilter
-SPRM
+
+# generic XML -----------------------------------------------------------------
+
+xml http://www.w3.org/XML/1998/namespace
+schema http://schemas.openxmlformats.org/schemaLibrary/2006/main
+
+# package ---------------------------------------------------------------------
+
+packageContentTypes http://schemas.openxmlformats.org/package/2006/content-types
+packageMetaCorePr http://schemas.openxmlformats.org/package/2006/metadata/core-properties
+packageRel http://schemas.openxmlformats.org/package/2006/relationships
+
+# office shared ---------------------------------------------------------------
+
+officeCustomPr http://schemas.openxmlformats.org/officeDocument/2006/custom-properties
+officeDocPropsVT http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes
+officeExtPr http://schemas.openxmlformats.org/officeDocument/2006/extended-properties
+officeMath http://schemas.openxmlformats.org/officeDocument/2006/math
+officeRel http://schemas.openxmlformats.org/officeDocument/2006/relationships
+officeRelTheme http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme
+
+# applications ----------------------------------------------------------------
+
+doc http://schemas.openxmlformats.org/wordprocessingml/2006/main
+xls http://schemas.openxmlformats.org/spreadsheetml/2006/main
+ppt http://schemas.openxmlformats.org/presentationml/2006/main
+
+# drawing ---------------------------------------------------------------------
+
+dml http://schemas.openxmlformats.org/drawingml/2006/main
+dmlChart http://schemas.openxmlformats.org/drawingml/2006/chart
+dmlChartDr http://schemas.openxmlformats.org/drawingml/2006/chartDrawing
+dmlDiagram http://schemas.openxmlformats.org/drawingml/2006/diagram
+dmlPicture http://schemas.openxmlformats.org/drawingml/2006/picture
+dmlSpreadDr http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing
+dmlWordDr http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
+
+# VML -------------------------------------------------------------------------
+
+vml urn:schemas-microsoft-com:vml
+vmlExcel urn:schemas-microsoft-com:office:excel
+vmlOffice urn:schemas-microsoft-com:office:office
+vmlPowerpoint urn:schemas-microsoft-com:office:powerpoint
+vmlWord urn:schemas-microsoft-com:office:word
+
+# other -----------------------------------------------------------------------
+
+ax http://schemas.microsoft.com/office/2006/activeX
+dc http://purl.org/dc/elements/1.1/
+dcTerms http://purl.org/dc/terms/
+xm http://schemas.microsoft.com/office/excel/2006/main
+sprm http://sprm
diff --git a/oox/source/token/parsexsd.pl b/oox/source/token/parsexsd.pl
index 3b6745121e4c..8fed059bbc44 100644
--- a/oox/source/token/parsexsd.pl
+++ b/oox/source/token/parsexsd.pl
@@ -1,3 +1,30 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
$ARGV = shift @ARGV;
my %tokens;
diff --git a/vcl/inc/vcl/fldunit.hxx b/oox/source/token/properties.hxx.head
index aa76f34332d6..25817b5e72f3 100644..100755
--- a/vcl/inc/vcl/fldunit.hxx
+++ b/oox/source/token/properties.hxx.head
@@ -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
@@ -25,9 +25,12 @@
*
************************************************************************/
-#ifndef _VCL_FLDUNIT_HXX
-#define _VCL_FLDUNIT_HXX
+#ifndef OOX_TOKEN_PROPERTIES_HXX
+#define OOX_TOKEN_PROPERTIES_HXX
+
+#include <sal/types.h>
+
+namespace oox {
-#include <tools/fldunit.hxx>
+// ============================================================================
-#endif // _VCL_FLDUNIT_HXX
diff --git a/oox/source/token/properties.hxx.tail b/oox/source/token/properties.hxx.tail
new file mode 100755
index 000000000000..f647337e529c
--- /dev/null
+++ b/oox/source/token/properties.hxx.tail
@@ -0,0 +1,6 @@
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/udkapi/prj/makefile.mk b/oox/source/token/properties.pl
index 0b1e9335ed44..f341924bbb90 100644
--- a/udkapi/prj/makefile.mk
+++ b/oox/source/token/properties.pl
@@ -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
@@ -25,37 +25,43 @@
#
#*************************************************************************
-PRJ=.
-PRJNAME:=udkapi
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
-# --- Settings -----------------------------------------------------
+# parse input file
-OUT!:=$(PRJ)$/out
+open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
+my %props;
+while( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # check for valid characters
+ $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "Error: invalid character in property '$_'";
+ $id = "PROP_$_";
+ $props{$_} = $id;
+}
+close( INFILE );
-# ------------------------------------------------------------------
+# generate output files
-INCLUDES= \
- com$/sun$/star$/container$/makefile.mk \
- com$/sun$/star$/io$/makefile.mk \
- com$/sun$/star$/reflection$/makefile.mk \
- com$/sun$/star$/beans$/makefile.mk \
- com$/sun$/star$/lang$/makefile.mk \
- com$/sun$/star$/uno$/makefile.mk \
- com$/sun$/star$/uno$/util$/logging$/makefile.mk \
- com$/sun$/star$/corba$/makefile.mk \
- com$/sun$/star$/corba$/iop$/makefile.mk \
- com$/sun$/star$/corba$/giop$/makefile.mk \
- com$/sun$/star$/corba$/iiop$/makefile.mk \
- com$/sun$/star$/script$/makefile.mk \
- com$/sun$/star$/test$/makefile.mk \
- com$/sun$/star$/registry$/makefile.mk \
- com$/sun$/star$/loader$/makefile.mk \
- com$/sun$/star$/bridge$/makefile.mk
+open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
-.INCLUDE: $(INCLUDES)
+$i = 0;
+foreach( sort( keys( %props ) ) )
+{
+ print( IDFILE "const sal_Int32 $props{$_} = $i;\n" );
+ print( NAMEFILE "/* $i */ \"$_\",\n" );
+ ++$i;
+}
-out$/$(PRJNAME).rdb:: $(ALLIDLFILES)
- unoidl @$(mktmp -I$(PRJ) -Burd -OHout $(ALLIDLFILES:+"\n"))
- regmerge @$(mktmp $@ /UCR out$/{$(?:f:s/.idl/.urd/:+"\n")} )
- touch $@
+print( IDFILE "const sal_Int32 PROP_COUNT = $i;\n" );
+print( IDFILE "const sal_Int32 PROP_INVALID = -1;\n" );
+close( IDFILE );
+close( NAMEFILE );
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index ba51c3577a8e..7d41b89bfa68 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -2,12 +2,15 @@ AbsoluteName
Action
ActiveSplitRange
ActiveTable
+Address
Adjust
AdjustContrast
AdjustLuminance
AdjustmentValues
Align
AnchorPosition
+ApplyFormDesignMode
+AreaLinks
ArrangeOrder
Aspect
AttachedAxisIndex
@@ -87,6 +90,7 @@ ContainsHeader
Coordinates
CopyBack
CopyFormulas
+CopyOutputData
CopyStyles
CrossoverPosition
CrossoverValue
@@ -104,11 +108,11 @@ D3DSceneShadeMode
DDELinks
DatabaseRanges
Decoration
-DefaultContext
DefaultScrollValue
DefaultSpinValue
DefaultState
DefaultText
+DefaultValue
DiagonalBLTR
DiagonalTLBR
DialogLibraries
@@ -143,6 +147,9 @@ FillGradient
FillGradientName
FillStyle
FillTransparence
+Filter
+FilterCriteriaSource
+FilterOptions
FirstLineOffset
FirstPageNumber
FocusOnClick
@@ -208,6 +215,7 @@ InputMessage
InputTitle
IsActive
IsAdjustHeightEnabled
+IsCaseSensitive
IsCellBackgroundTransparent
IsChangeReadOnlyEnabled
IsDate
@@ -280,6 +288,7 @@ NumberingType
Offset
OpCodeMap
Orientation
+OutputPosition
OverlapSequence
PageScale
PageStyle
@@ -331,6 +340,8 @@ RefX
RefY
Reference
ReferenceDevice
+ReferenceSheet
+RefreshPeriod
RegularExpressions
RelId
RelativeHorizontalTabbarWidth
@@ -350,6 +361,7 @@ RotationHorizontal
RotationVertical
RowGrand
RowLabelRanges
+SaveOutputPosition
ScaleMode
ScaleToPages
ScaleToPagesX
@@ -382,10 +394,14 @@ ShowPositiveError
ShowZeroValues
ShrinkToFit
Size
+Size100thMM
+SizePixel
+SkipDuplicates
SortInfo
Sound
SoundOn
Speed
+Spin
SpinIncrement
SpinValue
SpinValueMax
@@ -439,11 +455,14 @@ Transparency
TriState
Type
URL
+Url
+UseFilterCriteriaSource
UseRegularExpressions
UseRings
UseSelectedPage
VScroll
Validation
+Value
VaryColorsByPoint
VertJustify
VerticalAlign
@@ -458,5 +477,6 @@ Weight
WhiteDay
Width
WritingMode
+XLA1Representation
ZoomType
ZoomValue
diff --git a/oox/source/token/propertynames.cxx b/oox/source/token/propertynames.cxx
new file mode 100644
index 000000000000..401d168fe696
--- /dev/null
+++ b/oox/source/token/propertynames.cxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * 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 "oox/token/propertynames.hxx"
+
+namespace oox {
+
+// ============================================================================
+
+PropertyNameVector::PropertyNameVector()
+{
+ static const sal_Char* sppcPropertyNames[] =
+ {
+ // include auto-generated C array with property names as C strings
+#include "propertynames.inc"
+ ""
+ };
+
+ size_t nArraySize = (sizeof( sppcPropertyNames ) / sizeof( *sppcPropertyNames )) - 1;
+ reserve( nArraySize );
+ for( size_t nIndex = 0; nIndex < nArraySize; ++nIndex )
+ push_back( ::rtl::OUString::createFromAscii( sppcPropertyNames[ nIndex ] ) );
+}
+
+// ============================================================================
+
+} // namespace oox
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx
index b5ed8e9a9323..a5189269c3c8 100644
--- a/oox/source/token/tokenmap.cxx
+++ b/oox/source/token/tokenmap.cxx
@@ -26,28 +26,25 @@
************************************************************************/
#include "oox/token/tokenmap.hxx"
+
#include <string.h>
#include <rtl/strbuf.hxx>
#include <rtl/string.hxx>
-#include "tokens.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/token/tokens.hxx"
-#include <string.h>
+namespace oox {
+// ============================================================================
+
+using ::com::sun::star::uno::Sequence;
using ::rtl::OString;
using ::rtl::OUString;
-using ::com::sun::star::uno::Sequence;
-
-namespace oox {
// ============================================================================
namespace {
-
-// include auto-generated token lists
-#include "tokens.inc"
-#include "tokenwords.inc"
-
+// include auto-generated Perfect_Hash
+#include "tokenhash.inc"
} // namespace
// ============================================================================
@@ -55,10 +52,17 @@ namespace {
TokenMap::TokenMap() :
maTokenNames( static_cast< size_t >( XML_TOKEN_COUNT ) )
{
- const sal_Char* const* ppcTokenWord = xmltokenwordlist;
- for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenWord )
+ static const sal_Char* sppcTokenNames[] =
{
- OString aUtf8Token( *ppcTokenWord );
+// include auto-generated C array with token names as C strings
+#include "tokennames.inc"
+ ""
+ };
+
+ const sal_Char* const* ppcTokenName = sppcTokenNames;
+ for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName )
+ {
+ OString aUtf8Token( *ppcTokenName );
aIt->maUniName = OStringToOUString( aUtf8Token, RTL_TEXTENCODING_UTF8 );
aIt->maUtf8Name = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() );
}
@@ -72,7 +76,7 @@ TokenMap::TokenMap() :
OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 );
struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() );
bOk = pToken && (pToken->nToken == nToken);
- OSL_ENSURE( bOk, ::rtl::OStringBuffer( "FastTokenHandler::FastTokenHandler - token list broken, #" ).
+ OSL_ENSURE( bOk, ::rtl::OStringBuffer( "TokenMap::TokenMap - token list broken, #" ).
append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() );
}
#endif
@@ -84,8 +88,9 @@ TokenMap::~TokenMap()
OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const
{
- const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken );
- return pTokenName ? pTokenName->maUniName : OUString();
+ if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) )
+ return maTokenNames[ static_cast< size_t >( nToken ) ].maUniName;
+ return OUString();
}
sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
@@ -97,8 +102,9 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const
{
- const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken );
- return pTokenName ? pTokenName->maUtf8Name : Sequence< sal_Int8 >();
+ if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) )
+ return maTokenNames[ static_cast< size_t >( nToken ) ].maUtf8Name;
+ return Sequence< sal_Int8 >();
}
sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const
@@ -111,4 +117,3 @@ sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) co
// ============================================================================
} // namespace oox
-
diff --git a/vcl/inc/vcl/mapunit.hxx b/oox/source/token/tokens.hxx.head
index b4c757c538e6..dd201caeb1d9 100644..100755
--- a/vcl/inc/vcl/mapunit.hxx
+++ b/oox/source/token/tokens.hxx.head
@@ -25,9 +25,12 @@
*
************************************************************************/
-#ifndef _VCL_MAPUNIT_HXX
-#define _VCL_MAPUNIT_HXX
+#ifndef OOX_TOKEN_TOKENS_HXX
+#define OOX_TOKEN_TOKENS_HXX
-#include <tools/mapunit.hxx>
+#include <com/sun/star/xml/sax/FastToken.hpp>
+
+namespace oox {
+
+// ============================================================================
-#endif // _VCL_MAPUNIT_HXX
diff --git a/oox/source/token/tokens.hxx.tail b/oox/source/token/tokens.hxx.tail
new file mode 100755
index 000000000000..df4b5ef1a955
--- /dev/null
+++ b/oox/source/token/tokens.hxx.tail
@@ -0,0 +1,8 @@
+
+const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/source/token/tokens.pl b/oox/source/token/tokens.pl
new file mode 100644
index 000000000000..a951cee80db2
--- /dev/null
+++ b/oox/source/token/tokens.pl
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
+$ARGV3 = shift @ARGV;
+
+open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
+my %tokens;
+while ( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # check for valid characters
+ $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid character in token '$_'";
+ $id = "XML_$_";
+ $id =~ s/-/_/g;
+ $tokens{$_} = $id;
+}
+close ( INFILE );
+
+# generate output files
+
+open ( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open ( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
+open ( GPERFFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
+
+print( GPERFFILE "%language=C++\n" );
+print( GPERFFILE "%global-table\n" );
+print( GPERFFILE "%null-strings\n" );
+print( GPERFFILE "%struct-type\n" );
+print( GPERFFILE "struct xmltoken {\n" );
+print( GPERFFILE " const sal_Char *name;\n" );
+print( GPERFFILE " sal_Int32 nToken;\n" );
+print( GPERFFILE "};\n" );
+print( GPERFFILE "%%\n" );
+
+$i = 0;
+foreach( sort( keys( %tokens ) ) )
+{
+ print( IDFILE "const sal_Int32 $tokens{$_} = $i;\n" );
+ print( NAMEFILE "\"$_\",\n" );
+ print( GPERFFILE "$_,$tokens{$_}\n" );
+ ++$i;
+}
+
+print( IDFILE "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
+print( GPERFFILE "%%\n" );
+
+close( IDFILE );
+close( NAMEFILE );
+close( GPERFFILE );
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index b05a21152722..13c1a10ff9b4 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -63,6 +63,7 @@ BookSection
BookTitle
BorderColor
BorderStyle
+Bottom
BroadcastTitle
Broadcaster
Button
@@ -72,6 +73,7 @@ Cancel
Caption
Case
CaseNumber
+Center
ChapterNumber
Characters
CharactersWithSpaces
@@ -82,6 +84,8 @@ ClientData
ColHidden
Colored
Column
+Combo
+ComboEdit
Comments
Company
Compiler
@@ -116,6 +120,7 @@ Director
Disabled
Dismiss
DisplayStyle
+Distributed
Distributor
DocSecurity
DocumentFromInternetSite
@@ -134,6 +139,7 @@ Editor
ElectronicSource
Embed
EnhancedMetaFile
+Extend
Extension
External
False
@@ -190,11 +196,13 @@ Issue
JournalArticle
JournalName
JustLastX
+Justify
LCID
LCT
Label
LargeChange
Last
+Left
LineA
Lines
Link
@@ -239,6 +247,7 @@ MouseIcon
MousePointer
MoveWithCells
Movie
+Multi
MultiLine
MultiSel
MultiSelect
@@ -315,6 +324,7 @@ Relationships
RelationshipsGroupReference
Report
Reporter
+Right
RootElement
Row
RowHidden
@@ -340,6 +350,8 @@ ShortTitle
ShowDropButtonWhen
ShowImportExportValidationErrors
SignatureTime
+Simple
+Single
Size
SizeMode
SizeWithCells
@@ -367,6 +379,7 @@ Theater
ThesisType
Title
TitlesOfParts
+Top
TotalTime
Translator
True
@@ -2087,6 +2100,7 @@ fNode
fPr
fPrintsWithSheet
fPublished
+face
facet
fact
factor
@@ -2249,6 +2263,7 @@ followColorScheme
followSib
followedHyperlink
font
+font4
fontAlgn
fontColor
fontId
diff --git a/oox/source/vml/makefile.mk b/oox/source/vml/makefile.mk
index 2b47a1c930db..094d37cd8c1c 100644
--- a/oox/source/vml/makefile.mk
+++ b/oox/source/vml/makefile.mk
@@ -41,13 +41,15 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/vmldrawing.obj \
- $(SLO)$/vmldrawingfragment.obj \
- $(SLO)$/vmlformatting.obj \
- $(SLO)$/vmlinputstream.obj \
- $(SLO)$/vmlshape.obj \
- $(SLO)$/vmlshapecontainer.obj \
- $(SLO)$/vmlshapecontext.obj
+ $(SLO)$/vmldrawing.obj \
+ $(SLO)$/vmldrawingfragment.obj \
+ $(SLO)$/vmlformatting.obj \
+ $(SLO)$/vmlinputstream.obj \
+ $(SLO)$/vmlshape.obj \
+ $(SLO)$/vmlshapecontainer.obj \
+ $(SLO)$/vmlshapecontext.obj \
+ $(SLO)$/vmltextbox.obj \
+ $(SLO)$/vmltextboxcontext.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 1cc74c32aa2d..ccf0fe567235 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -26,28 +26,32 @@
************************************************************************/
#include "oox/vml/vmldrawing.hxx"
+
+#include <algorithm>
+#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#include "tokens.hxx"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "oox/core/xmlfilterbase.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/ole/axcontrol.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
/** Returns the textual representation of a numeric VML shape identifier. */
@@ -57,6 +61,13 @@ OUString lclGetShapeId( sal_Int32 nShapeId )
return CREATE_OUSTRING( "\0s" ) + OUString::valueOf( nShapeId );
}
+/** Returns the numeric VML shape identifier from its textual representation. */
+sal_Int32 lclGetShapeId( const OUString& rShapeId )
+{
+ // identifier consists of a literal NUL character, a lowercase 's', and the id
+ return ((rShapeId.getLength() >= 3) && (rShapeId[ 0 ] == '\0') && (rShapeId[ 1 ] == 's')) ? rShapeId.copy( 2 ).toInt32() : -1;
+}
+
} // namespace
// ============================================================================
@@ -102,10 +113,22 @@ Drawing::~Drawing()
{
if( !mxCtrlForm.get() )
mxCtrlForm.reset( new ::oox::ole::EmbeddedForm(
- mrFilter.getModelFactory(), mxDrawPage, mrFilter.getGraphicHelper() ) );
+ mrFilter.getModel(), mxDrawPage, mrFilter.getGraphicHelper() ) );
return *mxCtrlForm;
}
+void Drawing::registerBlockId( sal_Int32 nBlockId )
+{
+ OSL_ENSURE( nBlockId > 0, "Drawing::registerBlockId - invalid block index" );
+ if( nBlockId > 0 )
+ {
+ // lower_bound() returns iterator pointing to element equal to nBlockId, if existing
+ BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId );
+ if( (aIt == maBlockIds.end()) || (nBlockId != *aIt) )
+ maBlockIds.insert( aIt, nBlockId );
+ }
+}
+
void Drawing::registerOleObject( const OleObjectInfo& rOleObject )
{
OSL_ENSURE( rOleObject.maShapeId.getLength() > 0, "Drawing::registerOleObject - missing OLE object shape id" );
@@ -132,6 +155,47 @@ void Drawing::convertAndInsert() const
mxShapes->convertAndInsert( xShapes );
}
+sal_Int32 Drawing::getLocalShapeIndex( const OUString& rShapeId ) const
+{
+ sal_Int32 nShapeId = lclGetShapeId( rShapeId );
+ if( nShapeId <= 0 ) return -1;
+
+ /* Shapes in a drawing are counted per registered shape identifier blocks
+ as stored in the o:idmap element. The contents of this element have
+ been stored in our member maBlockIds. Each block represents 1024 shape
+ identifiers, starting with identifier 1 for the block #0. This means,
+ block #0 represents the identifiers 1-1024, block #1 represents the
+ identifiers 1025-2048, and so on. The local shape index has to be
+ calculated according to all blocks registered for this drawing.
+
+ Example:
+ Registered for this drawing are blocks #1 and #3 (shape identifiers
+ 1025-2048 and 3073-4096).
+ Shape identifier 1025 -> local shape index 1.
+ Shape identifier 1026 -> local shape index 2.
+ ...
+ Shape identifier 2048 -> local shape index 1024.
+ Shape identifier 3073 -> local shape index 1025.
+ ...
+ Shape identifier 4096 -> local shape index 2048.
+ */
+
+ // get block id from shape id and find its index in the list of used blocks
+ sal_Int32 nBlockId = (nShapeId - 1) / 1024;
+ BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId );
+ sal_Int32 nIndex = static_cast< sal_Int32 >( aIt - maBlockIds.begin() );
+
+ // block id not found in set -> register it now (value of nIndex remains valid)
+ if( (aIt == maBlockIds.end()) || (*aIt != nBlockId) )
+ maBlockIds.insert( aIt, nBlockId );
+
+ // get one-based offset of shape id in its block
+ sal_Int32 nBlockOffset = (nShapeId - 1) % 1024 + 1;
+
+ // calculate the local shape index
+ return 1024 * nIndex + nBlockOffset;
+}
+
const OleObjectInfo* Drawing::getOleObjectInfo( const OUString& rShapeId ) const
{
return ContainerHelper::getMapElement( maOleObjects, rShapeId );
@@ -142,21 +206,72 @@ const ControlInfo* Drawing::getControlInfo( const OUString& rShapeId ) const
return ContainerHelper::getMapElement( maControls, rShapeId );
}
+Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
+{
+ OSL_ENSURE( rService.getLength() > 0, "Drawing::createAndInsertXShape - missing UNO shape service name" );
+ OSL_ENSURE( rxShapes.is(), "Drawing::createAndInsertXShape - missing XShapes container" );
+ Reference< XShape > xShape;
+ if( (rService.getLength() > 0) && rxShapes.is() ) try
+ {
+ Reference< XMultiServiceFactory > xFactory( mrFilter.getModelFactory(), UNO_SET_THROW );
+ xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW );
+ // insert shape into passed shape collection (maybe drawpage or group shape)
+ rxShapes->add( xShape );
+ xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) );
+ xShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( xShape.is(), "Drawing::createAndInsertXShape - cannot instanciate shape object" );
+ return xShape;
+}
+
+Reference< XShape > Drawing::createAndInsertXControlShape( const ::oox::ole::EmbeddedControl& rControl,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect, sal_Int32& rnCtrlIndex ) const
+{
+ Reference< XShape > xShape;
+ try
+ {
+ // create control model and insert it into the form of the draw page
+ Reference< XControlModel > xCtrlModel( getControlForm().convertAndInsert( rControl, rnCtrlIndex ), UNO_SET_THROW );
+
+ // create the control shape
+ xShape = createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rxShapes, rShapeRect );
+
+ // set the control model at the shape
+ Reference< XControlShape >( xShape, UNO_QUERY_THROW )->setControl( xCtrlModel );
+ }
+ catch( Exception& )
+ {
+ }
+ return xShape;
+}
+
bool Drawing::isShapeSupported( const ShapeBase& /*rShape*/ ) const
{
return true;
}
-bool Drawing::convertShapeClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const
+OUString Drawing::getShapeBaseName( const ShapeBase& /*rShape*/ ) const
+{
+ return OUString();
+}
+
+bool Drawing::convertClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const
{
return false;
}
-void Drawing::convertControlClientData( const Reference< XControlModel >& /*rxCtrlModel*/, const ShapeClientData& /*rClientData*/ ) const
+Reference< XShape > Drawing::createAndInsertClientXShape( const ShapeBase& /*rShape*/,
+ const Reference< XShapes >& /*rxShapes*/, const Rectangle& /*rShapeRect*/ ) const
{
+ return Reference< XShape >();
}
-void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& /*rShapeRect*/ )
+void Drawing::notifyXShapeInserted( const Reference< XShape >& /*rxShape*/,
+ const Rectangle& /*rShapeRect*/, const ShapeBase& /*rShape*/, bool /*bGroupChild*/ )
{
}
@@ -164,4 +279,3 @@ void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const
} // namespace vml
} // namespave oox
-
diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx
index 333df72bbaf7..dc5c82515691 100644
--- a/oox/source/vml/vmldrawingfragment.cxx
+++ b/oox/source/vml/vmldrawingfragment.cxx
@@ -26,24 +26,26 @@
************************************************************************/
#include "oox/vml/vmldrawingfragment.hxx"
+
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlinputstream.hxx"
#include "oox/vml/vmlshapecontext.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandler2;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
DrawingFragment::DrawingFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, Drawing& rDrawing ) :
- FragmentHandler2( rFilter, rFragmentPath ),
+ FragmentHandler2( rFilter, rFragmentPath, false ), // do not trim whitespace, has been preprocessed by the input stream
mrDrawing( rDrawing )
{
}
@@ -61,7 +63,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At
// DOCX filter handles plain shape elements with this fragment handler
case VMLDRAWING_WORD:
if( isRootElement() )
- return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() );
+ return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs );
break;
// XLSX and PPTX filters load the entire VML fragment
@@ -73,7 +75,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At
if( nElement == XML_xml ) return this;
break;
case XML_xml:
- return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() );
+ return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs );
}
break;
}
@@ -90,4 +92,3 @@ void DrawingFragment::finalizeImport()
} // namespace vml
} // namespace oox
-
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 827930c22496..cd280d041eb9 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -26,26 +26,29 @@
************************************************************************/
#include "oox/vml/vmlformatting.hxx"
+
#include <rtl/strbuf.hxx>
-#include "tokens.hxx"
-#include "oox/token/tokenmap.hxx"
-#include "oox/helper/graphichelper.hxx"
-#include "oox/helper/propertymap.hxx"
#include "oox/drawingml/color.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/lineproperties.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "oox/helper/propertymap.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using namespace ::com::sun::star::geometry;
-using ::rtl::OStringBuffer;
-using ::rtl::OUString;
-using ::com::sun::star::geometry::IntegerRectangle2D;
using ::oox::drawingml::Color;
using ::oox::drawingml::FillProperties;
using ::oox::drawingml::LineArrowProperties;
using ::oox::drawingml::LineProperties;
-
-namespace oox {
-namespace vml {
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
// ============================================================================
@@ -81,8 +84,9 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
/*static*/ bool ConversionHelper::decodeBool( const OUString& rValue )
{
+ sal_Int32 nToken = AttributeConversion::decodeToken( rValue );
// anything else than 't' or 'true' is considered to be false, as specified
- return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "true" ));
+ return (nToken == XML_t) || (nToken == XML_true);
}
/*static*/ double ConversionHelper::decodePercent( const OUString& rValue, double fDefValue )
@@ -171,58 +175,35 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
return (decodeMeasureToEmu( rGraphicHelper, rValue, nRefValue, bPixelX, bDefaultAsPixel ) + 180) / 360;
}
-// ============================================================================
-
-namespace {
-
-/** Converts a VML color attribute to a DrawingML color.
-
- @param orDmlColor (out-parameter) The destination DrawingML color.
-
- @param roVmlColor The VML string representation of the color. If existing,
- this can be a 6-digit hexadecimal RGB value with leading '#' character,
- a predefined color name (e.g. 'black', 'red', etc.), the index into an
- application defined color palette in brackets with leading color name
- (e.g. 'red [9]' or 'windowColor [64]'), or a color modifier used in
- one-color gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'.
-
- @param roVmlOpacity The opacity of the color. If existing, this should be
- a floating-point value in the range [0.0;1.0].
-
- @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor is
- empty.
-
- @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT,
- specifies the color to be used to resolve the color modifiers used in
- one-color gradients.
- */
-void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
+/*static*/ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper,
const OptValue< OUString >& roVmlColor, const OptValue< double >& roVmlOpacity,
- sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT )
+ sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb )
{
+ Color aDmlColor;
+
// convert opacity
const sal_Int32 DML_FULL_OPAQUE = ::oox::drawingml::MAX_PERCENT;
double fOpacity = roVmlOpacity.get( 1.0 );
sal_Int32 nOpacity = getLimitedValue< sal_Int32, double >( fOpacity * DML_FULL_OPAQUE, 0, DML_FULL_OPAQUE );
if( nOpacity < DML_FULL_OPAQUE )
- orDmlColor.addTransformation( XML_alpha, nOpacity );
+ aDmlColor.addTransformation( XML_alpha, nOpacity );
// color attribute not present - set passed default color
if( !roVmlColor.has() )
{
- orDmlColor.setSrgbClr( nDefaultRgb );
- return;
+ aDmlColor.setSrgbClr( nDefaultRgb );
+ return aDmlColor;
}
// separate leading color name or RGB value from following palette index
OUString aColorName, aColorIndex;
- ConversionHelper::separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' );
+ separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' );
// RGB colors in the format '#RRGGBB'
if( (aColorName.getLength() == 7) && (aColorName[ 0 ] == '#') )
{
- orDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) );
- return;
+ aDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) );
+ return aDmlColor;
}
// RGB colors in the format '#RGB'
@@ -231,27 +212,27 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
sal_Int32 nR = aColorName.copy( 1, 1 ).toInt32( 16 ) * 0x11;
sal_Int32 nG = aColorName.copy( 2, 1 ).toInt32( 16 ) * 0x11;
sal_Int32 nB = aColorName.copy( 3, 1 ).toInt32( 16 ) * 0x11;
- orDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB );
- return;
+ aDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB );
+ return aDmlColor;
}
/* Predefined color names or system color names (resolve to RGB to detect
valid color name). */
- sal_Int32 nColorToken = StaticTokenMap::get().getTokenFromUnicode( aColorName );
+ sal_Int32 nColorToken = AttributeConversion::decodeToken( aColorName );
sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT );
if( nRgbValue == API_RGB_TRANSPARENT )
nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT );
if( nRgbValue != API_RGB_TRANSPARENT )
{
- orDmlColor.setSrgbClr( nRgbValue );
- return;
+ aDmlColor.setSrgbClr( nRgbValue );
+ return aDmlColor;
}
// try palette colors enclosed in brackets
if( (aColorIndex.getLength() >= 3) && (aColorIndex[ 0 ] == '[') && (aColorIndex[ aColorIndex.getLength() - 1 ] == ']') )
{
- orDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() );
- return;
+ aDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() );
+ return aDmlColor;
}
// try fill gradient modificator 'fill <modifier>(<amount>)'
@@ -262,7 +243,7 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
if( (2 <= nOpenParen) && (nOpenParen + 1 < nCloseParen) && (nCloseParen + 1 == aColorIndex.getLength()) )
{
sal_Int32 nModToken = XML_TOKEN_INVALID;
- switch( StaticTokenMap::get().getTokenFromUnicode( aColorIndex.copy( 0, nOpenParen ) ) )
+ switch( AttributeConversion::decodeToken( aColorIndex.copy( 0, nOpenParen ) ) )
{
case XML_darken: nModToken = XML_shade;
case XML_lighten: nModToken = XML_tint;
@@ -273,18 +254,23 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
/* Simulate this modifier color by a color with related transformation.
The modifier amount has to be converted from the range [0;255] to
percentage [0;100000] used by DrawingML. */
- orDmlColor.setSrgbClr( nPrimaryRgb );
- orDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) );
- return;
+ aDmlColor.setSrgbClr( nPrimaryRgb );
+ aDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) );
+ return aDmlColor;
}
}
}
- OSL_ENSURE( false, OStringBuffer( "lclGetColor - invalid VML color name '" ).
+ OSL_ENSURE( false, OStringBuffer( "ConversionHelper::decodeColor - invalid VML color name '" ).
append( OUStringToOString( roVmlColor.get(), RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() );
- orDmlColor.setSrgbClr( nDefaultRgb );
+ aDmlColor.setSrgbClr( nDefaultRgb );
+ return aDmlColor;
}
+// ============================================================================
+
+namespace {
+
sal_Int32 lclGetEmu( const GraphicHelper& rGraphicHelper, const OptValue< OUString >& roValue, sal_Int32 nDefValue )
{
return roValue.has() ? ConversionHelper::decodeMeasureToEmu( rGraphicHelper, roValue.get(), 0, false, false ) : nDefValue;
@@ -295,7 +281,7 @@ void lclGetDmlLineDash( OptValue< sal_Int32 >& oroPresetDash, LineProperties::Da
if( roDashStyle.has() )
{
const OUString& rDashStyle = roDashStyle.get();
- switch( StaticTokenMap::get().getTokenFromUnicode( rDashStyle ) )
+ switch( AttributeConversion::decodeToken( rDashStyle ) )
{
case XML_solid: oroPresetDash = XML_solid; return;
case XML_shortdot: oroPresetDash = XML_sysDot; return;
@@ -441,7 +427,7 @@ void StrokeModel::pushToPropMap( PropertyMap& rPropMap,
aLineProps.maLineFill.moFillType = XML_solidFill;
lclConvertArrow( aLineProps.maStartArrow, maStartArrow );
lclConvertArrow( aLineProps.maEndArrow, maEndArrow );
- lclGetColor( aLineProps.maLineFill.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_BLACK );
+ aLineProps.maLineFill.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_BLACK );
aLineProps.moLineWidth = lclGetEmu( rGraphicHelper, moWeight, 1 );
lclGetDmlLineDash( aLineProps.moPresetDash, aLineProps.maCustomDash, moDashStyle );
aLineProps.moLineCompound = lclGetDmlLineCompound( moLineStyle );
@@ -494,9 +480,8 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
double fFocus = moFocus.get( 0.0 );
// prepare colors
- Color aColor1, aColor2;
- lclGetColor( aColor1, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
- lclGetColor( aColor2, rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) );
+ Color aColor1 = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
+ Color aColor2 = ConversionHelper::decodeColor( rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) );
// type XML_gradient is linear or axial gradient
if( nFillType == XML_gradient )
@@ -584,7 +569,7 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
{
aFillProps.moFillType = XML_solidFill;
// fill color (default is white)
- lclGetColor( aFillProps.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
+ aFillProps.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
}
}
}
@@ -600,4 +585,3 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
} // namespace vml
} // namespace oox
-
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index a6d50e193bc4..fb2443aba4c4 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -26,22 +26,25 @@
************************************************************************/
#include "oox/vml/vmlinputstream.hxx"
+
#include <map>
#include <rtl/strbuf.hxx>
#include <rtl/strbuf.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OString;
+using ::rtl::OStringBuffer;
+
+// ============================================================================
+
namespace {
inline const sal_Char* lclFindCharacter( const sal_Char* pcBeg, const sal_Char* pcEnd, sal_Char cChar )
@@ -148,6 +151,48 @@ void lclProcessAttribs( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal
lclAppendToBuffer( rBuffer, pcBeg, pcEnd );
}
+void lclProcessContents( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal_Char* pcEnd )
+{
+ /* MSO has a very weird way to store and handle whitespaces. The stream
+ may contain lots of spaces, tabs, and newlines which have to be handled
+ as single space character. This will be done in this function.
+
+ If the element text contains a literal line break, it will be stored as
+ <br> tag (without matching closing </br> element).
+
+ A single space character following another character is stored
+ literally and must not be stipped away here. Example: The element
+ <font>abc </font>
+ contains the three letters a, b, and c, followed by a space character.
+
+ Consecutive space characters, or a leading single space character, are
+ stored in a <span> element. If there are N space characters (N > 1),
+ then the <span> element contains exactly (N-1) NBSP characters
+ (non-breaking space), followed by a regular space character. Example:
+ The element
+ <font><span style='mso-spacerun:yes'>\xA0\xA0\xA0 </span></font>
+ represents 4 consecutive space characters. Has to be handled by the
+ implementation.
+
+ A single space character for its own is stored in an empty element.
+ Example: The element
+ <font></font>
+ represents a single space character. Has to be handled by the
+ implementation.
+ */
+
+ // skip leading whitespace
+ const sal_Char* pcContentsBeg = lclFindNonWhiteSpace( pcBeg, pcEnd );
+ while( pcContentsBeg < pcEnd )
+ {
+ const sal_Char* pcWhitespaceBeg = lclFindWhiteSpace( pcContentsBeg + 1, pcEnd );
+ lclAppendToBuffer( rBuffer, pcContentsBeg, pcWhitespaceBeg );
+ if( pcWhitespaceBeg < pcEnd )
+ rBuffer.append( ' ' );
+ pcContentsBeg = lclFindNonWhiteSpace( pcWhitespaceBeg, pcEnd );
+ }
+}
+
} // namespace
// ============================================================================
@@ -176,8 +221,9 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS
{
// look for the next opening angle bracket
const sal_Char* pcOpen = lclFindCharacter( pcCurr, pcEnd, '<' );
+
// copy all characters from current position to opening bracket
- lclAppendToBuffer( aBuffer, pcCurr, pcOpen );
+ lclProcessContents( aBuffer, pcCurr, pcOpen );
// nothing to do if no opening bracket has been found
if( pcOpen < pcEnd )
@@ -214,10 +260,10 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS
// do nothing
}
- // replace '<br>' elements with '<br/>' elements
+ // replace '<br>' element with newline
else if( (nElementLen >= 4) && (pcOpen[ 1 ] == 'b') && (pcOpen[ 2 ] == 'r') && (lclFindNonWhiteSpace( pcOpen + 3, pcClose ) == pcClose) )
{
- aBuffer.append( RTL_CONSTASCII_STRINGPARAM( "<br/>" ) );
+ aBuffer.append( '\n' );
}
// check start elements and empty elements for repeated attributes
@@ -277,4 +323,3 @@ InputStream::~InputStream()
} // namespace vml
} // namespave oox
-
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index d557a7f50354..db12f3d91e0b 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -26,52 +26,50 @@
************************************************************************/
#include "oox/vml/vmlshape.hxx"
-#include <rtl/math.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
-#include "properties.hxx"
+#include <rtl/math.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/ole/axcontrol.hxx"
#include "oox/ole/axcontrolfragment.hxx"
#include "oox/ole/oleobjecthelper.hxx"
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::drawing::PointSequenceSequence;
-using ::com::sun::star::drawing::XControlShape;
-using ::com::sun::star::drawing::XEnhancedCustomShapeDefaulter;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::XmlFilterBase;
+#include "oox/vml/vmltextbox.hxx"
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
+const sal_Int32 VML_SHAPETYPE_PICTUREFRAME = 75;
+const sal_Int32 VML_SHAPETYPE_HOSTCONTROL = 201;
+
+// ----------------------------------------------------------------------------
+
Point lclGetAbsPoint( const Point& rRelPoint, const Rectangle& rShapeRect, const Rectangle& rCoordSys )
{
double fWidthRatio = static_cast< double >( rShapeRect.Width ) / rCoordSys.Width;
@@ -94,55 +92,6 @@ Rectangle lclGetAbsRect( const Rectangle& rRelRect, const Rectangle& rShapeRect,
return aAbsRect;
}
-Reference< XShape > lclCreateXShape( const XmlFilterBase& rFilter, const OUString& rService )
-{
- OSL_ENSURE( rService.getLength() > 0, "lclCreateXShape - missing UNO shape service name" );
- Reference< XShape > xShape;
- try
- {
- Reference< XMultiServiceFactory > xFactory( rFilter.getModelFactory(), UNO_SET_THROW );
- xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( xShape.is(), "lclCreateXShape - cannot instanciate shape object" );
- return xShape;
-}
-
-void lclInsertXShape( const Reference< XShapes >& rxShapes, const Reference< XShape >& rxShape )
-{
- OSL_ENSURE( rxShapes.is(), "lclInsertXShape - missing XShapes container" );
- OSL_ENSURE( rxShape.is(), "lclInsertXShape - missing XShape" );
- if( rxShapes.is() && rxShape.is() ) try
- {
- // insert shape into passed shape collection (maybe drawpage or group shape)
- rxShapes->add( rxShape );
- }
- catch( Exception& )
- {
- }
-}
-
-void lclSetXShapeRect( const Reference< XShape >& rxShape, const Rectangle& rShapeRect )
-{
- OSL_ENSURE( rxShape.is(), "lclSetXShapeRect - missing XShape" );
- if( rxShape.is() )
- {
- rxShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) );
- rxShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) );
- }
-}
-
-Reference< XShape > lclCreateAndInsertXShape( const XmlFilterBase& rFilter,
- const Reference< XShapes >& rxShapes, const OUString& rService, const Rectangle& rShapeRect )
-{
- Reference< XShape > xShape = lclCreateXShape( rFilter, rService );
- lclInsertXShape( rxShapes, xShape );
- lclSetXShapeRect( xShape, rShapeRect );
- return xShape;
-}
-
} // namespace
// ============================================================================
@@ -175,6 +124,11 @@ ShapeType::~ShapeType()
{
}
+sal_Int32 ShapeType::getShapeType() const
+{
+ return maTypeModel.moShapeType.get( 0 );
+}
+
OUString ShapeType::getGraphicPath() const
{
return maTypeModel.moGraphicPath.get( OUString() );
@@ -215,12 +169,30 @@ Rectangle ShapeType::getRelRectangle() const
// ============================================================================
-ShapeClientData::ShapeClientData() :
+ClientData::ClientData() :
mnObjType( XML_TOKEN_INVALID ),
+ mnTextHAlign( XML_Left ),
+ mnTextVAlign( XML_Top ),
mnCol( -1 ),
mnRow( -1 ),
+ mnChecked( VML_CLIENTDATA_UNCHECKED ),
+ mnDropStyle( XML_Combo ),
+ mnDropLines( 1 ),
+ mnVal( 0 ),
+ mnMin( 0 ),
+ mnMax( 0 ),
+ mnInc( 0 ),
+ mnPage( 0 ),
+ mnSelType( XML_Single ),
+ mnVTEdit( VML_CLIENTDATA_TEXT ),
mbPrintObject( true ),
- mbVisible( false )
+ mbVisible( false ),
+ mbDde( false ),
+ mbNo3D( false ),
+ mbNo3D2( false ),
+ mbMultiLine( false ),
+ mbVScroll( false ),
+ mbSecretEdit( false )
{
}
@@ -230,9 +202,19 @@ ShapeModel::ShapeModel()
{
}
-ShapeClientData& ShapeModel::createClientData()
+ShapeModel::~ShapeModel()
+{
+}
+
+TextBox& ShapeModel::createTextBox()
+{
+ mxTextBox.reset( new TextBox );
+ return *mxTextBox;
+}
+
+ClientData& ShapeModel::createClientData()
{
- mxClientData.reset( new ShapeClientData );
+ mxClientData.reset( new ClientData );
return *mxClientData;
}
@@ -251,6 +233,22 @@ void ShapeBase::finalizeFragmentImport()
maTypeModel.assignUsed( pShapeType->getTypeModel() );
}
+OUString ShapeBase::getShapeName() const
+{
+ if( maTypeModel.maShapeName.getLength() > 0 )
+ return maTypeModel.maShapeName;
+
+ OUString aBaseName = mrDrawing.getShapeBaseName( *this );
+ if( aBaseName.getLength() > 0 )
+ {
+ sal_Int32 nShapeIdx = mrDrawing.getLocalShapeIndex( getShapeId() );
+ if( nShapeIdx > 0 )
+ return OUStringBuffer( aBaseName ).append( sal_Unicode( ' ' ) ).append( nShapeIdx ).makeStringAndClear();
+ }
+
+ return OUString();
+}
+
const ShapeType* ShapeBase::getChildTypeById( const OUString& ) const
{
return 0;
@@ -269,15 +267,23 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect = calcShapeRectangle( pParentAnchor );
+
// convert the shape, if the calculated rectangle is not empty
if( ((aShapeRect.Width > 0) || (aShapeRect.Height > 0)) && rxShapes.is() )
{
xShape = implConvertAndInsert( rxShapes, aShapeRect );
- /* Notify the drawing that a new shape has been inserted (but not
- for children of group shapes). For convenience, pass the
- rectangle that contains position and size of the shape. */
- if( !pParentAnchor && xShape.is() )
- mrDrawing.notifyShapeInserted( xShape, aShapeRect );
+ if( xShape.is() )
+ {
+ // set shape name (imported or generated)
+ PropertySet aShapeProp( xShape );
+ aShapeProp.setProperty( PROP_Name, getShapeName() );
+
+ /* Notify the drawing that a new shape has been inserted. For
+ convenience, pass the rectangle that contains position and
+ size of the shape. */
+ bool bGroupChild = pParentAnchor != 0;
+ mrDrawing.notifyXShapeInserted( xShape, aShapeRect, *this, bGroupChild );
+ }
}
}
return xShape;
@@ -290,10 +296,12 @@ void ShapeBase::convertFormatting( const Reference< XShape >& rxShape, const Sha
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect = calcShapeRectangle( pParentAnchor );
+
// convert the shape, if the calculated rectangle is not empty
if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) )
{
- lclSetXShapeRect( rxShape, aShapeRect );
+ rxShape->setPosition( Point( aShapeRect.X, aShapeRect.Y ) );
+ rxShape->setSize( Size( aShapeRect.Width, aShapeRect.Height ) );
convertShapeProperties( rxShape );
}
}
@@ -306,7 +314,8 @@ Rectangle ShapeBase::calcShapeRectangle( const ShapeParentAnchor* pParentAnchor
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect;
- if( !maShapeModel.mxClientData.get() || !mrDrawing.convertShapeClientAnchor( aShapeRect, maShapeModel.mxClientData->maAnchor ) )
+ const ClientData* pClientData = getClientData();
+ if( !pClientData || !mrDrawing.convertClientAnchor( aShapeRect, pClientData->maAnchor ) )
aShapeRect = getRectangle( pParentAnchor );
return aShapeRect;
}
@@ -334,7 +343,7 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) :
Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, maService, rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, rShapeRect );
convertShapeProperties( xShape );
return xShape;
}
@@ -393,7 +402,7 @@ Reference< XShape > CustomShape::implConvertAndInsert( const Reference< XShapes
{
// create the custom shape geometry
Reference< XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY_THROW );
- xDefaulter->createCustomShapeDefaults( OUString::valueOf( maTypeModel.moShapeType.get( 0 ) ) );
+ xDefaulter->createCustomShapeDefaults( OUString::valueOf( getShapeType() ) );
// convert common properties
convertShapeProperties( xShape );
}
@@ -413,11 +422,14 @@ ComplexShape::ComplexShape( Drawing& rDrawing ) :
Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
XmlFilterBase& rFilter = mrDrawing.getFilter();
+ sal_Int32 nShapeType = getShapeType();
OUString aGraphicPath = getGraphicPath();
// try to find registered OLE object info
if( const OleObjectInfo* pOleObjectInfo = mrDrawing.getOleObjectInfo( maTypeModel.maShapeId ) )
{
+ OSL_ENSURE( nShapeType == VML_SHAPETYPE_PICTUREFRAME, "ComplexShape::implConvertAndInsert - unexpected shape type" );
+
// if OLE object is embedded into a DrawingML shape (PPTX), do not create it here
if( pOleObjectInfo->mbDmlShape )
return Reference< XShape >();
@@ -426,7 +438,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
Size aOleSize( rShapeRect.Width, rShapeRect.Height );
if( rFilter.getOleObjectHelper().importOleObject( aOleProps, *pOleObjectInfo, aOleSize ) )
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rxShapes, rShapeRect );
if( xShape.is() )
{
// set the replacement graphic
@@ -447,36 +459,40 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
// try to find registered form control info
const ControlInfo* pControlInfo = mrDrawing.getControlInfo( maTypeModel.maShapeId );
- if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) && (maTypeModel.maName.getLength() > 0) )
+ if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) )
{
- OSL_ENSURE( maTypeModel.maName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" );
- ::oox::ole::EmbeddedControl aControl( maTypeModel.maName );
- // load the control properties from fragment
- if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) ) try
- {
- // create control model and insert it into the form of the draw page
- Reference< XControlModel > xCtrlModel( mrDrawing.getControlForm().convertAndInsert( aControl ), UNO_SET_THROW );
- if( maShapeModel.mxClientData.get() )
- mrDrawing.convertControlClientData( xCtrlModel, *maShapeModel.mxClientData );
-
- // create the control shape, set control model at the shape
- Reference< XShape > xShape = lclCreateAndInsertXShape(
- rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rShapeRect );
- Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY ); // do not throw, but always return the shape
- if( xCtrlShape.is() )
- xCtrlShape->setControl( xCtrlModel );
- return xShape;
- }
- catch( Exception& )
+ OSL_ENSURE( nShapeType == VML_SHAPETYPE_HOSTCONTROL, "ComplexShape::implConvertAndInsert - unexpected shape type" );
+ OUString aShapeName = getShapeName();
+ if( aShapeName.getLength() > 0 )
{
+ OSL_ENSURE( aShapeName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" );
+ // load the control properties from fragment
+ ::oox::ole::EmbeddedControl aControl( aShapeName );
+ if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) )
+ {
+ // create and return the control shape (including control model)
+ sal_Int32 nCtrlIndex = -1;
+ Reference< XShape > xShape = mrDrawing.createAndInsertXControlShape( aControl, rxShapes, rShapeRect, nCtrlIndex );
+ // on error, proceed and try to create picture from replacement image
+ if( xShape.is() )
+ return xShape;
+ }
}
- // on error, proceed and try to create picture from replacement image
+ }
+
+ // host application wants to create the shape (do not try failed OLE controls again)
+ if( (nShapeType == VML_SHAPETYPE_HOSTCONTROL) && !pControlInfo )
+ {
+ OSL_ENSURE( getClientData(), "ComplexShape::implConvertAndInsert - missing client data" );
+ Reference< XShape > xShape = mrDrawing.createAndInsertClientXShape( *this, rxShapes, rShapeRect );
+ if( xShape.is() )
+ return xShape;
}
// try to create a picture object
if( aGraphicPath.getLength() > 0 )
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rxShapes, rShapeRect );
if( xShape.is() )
{
OUString aGraphicUrl = rFilter.getGraphicHelper().importEmbeddedGraphicObject( aGraphicPath );
@@ -532,7 +548,7 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
aParentAnchor.maCoordSys = getCoordSystem();
if( !mxChildren->empty() && (aParentAnchor.maCoordSys.Width > 0) && (aParentAnchor.maCoordSys.Height > 0) ) try
{
- xGroupShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rShapeRect );
+ xGroupShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rxShapes, rShapeRect );
Reference< XShapes > xChildShapes( xGroupShape, UNO_QUERY_THROW );
mxChildren->convertAndInsert( xChildShapes, &aParentAnchor );
// no child shape has been created - delete the group shape
@@ -552,4 +568,3 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
} // namespace vml
} // namespace oox
-
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index a3bdfdb217d7..9589549be0d9 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -26,19 +26,23 @@
************************************************************************/
#include "oox/vml/vmlshapecontainer.hxx"
+
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::drawing::XShapes;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
template< typename ShapeType >
@@ -130,4 +134,3 @@ void ShapeContainer::convertAndInsert( const Reference< XShapes >& rxShapes, con
} // namespace vml
} // namespace oox
-
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 08115d4f8d25..54e0d1ac70bc 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -26,17 +26,23 @@
************************************************************************/
#include "oox/vml/vmlshapecontext.hxx"
+
+#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
+#include "oox/vml/vmltextboxcontext.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
using ::oox::core::ContextHandler2;
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextHandlerRef;
-
-namespace oox {
-namespace vml {
+using ::rtl::OUString;
// ============================================================================
@@ -100,39 +106,101 @@ OptValue< DoublePair > lclDecodePercentPair( const AttributeList& rAttribs, sal_
bool lclDecodeVmlxBool( const OUString& rValue, bool bDefaultForEmpty )
{
if( rValue.getLength() == 0 ) return bDefaultForEmpty;
+ sal_Int32 nToken = AttributeConversion::decodeToken( rValue );
// anything else than 't' or 'True' is considered to be false, as specified
- return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "True" ));
+ return (nToken == XML_t) || (nToken == XML_True);
}
} // namespace
// ============================================================================
-ShapeClientDataContext::ShapeClientDataContext( ContextHandler2Helper& rParent,
- const AttributeList& rAttribs, ShapeClientData& rClientData ) :
+ShapeLayoutContext::ShapeLayoutContext( ContextHandler2Helper& rParent, Drawing& rDrawing ) :
+ ContextHandler2( rParent ),
+ mrDrawing( rDrawing )
+{
+}
+
+
+ContextHandlerRef ShapeLayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case O_TOKEN( idmap ):
+ {
+ OUString aBlockIds = rAttribs.getString( XML_data, OUString() );
+ sal_Int32 nIndex = 0;
+ while( nIndex >= 0 )
+ {
+ OUString aToken = aBlockIds.getToken( 0, ' ', nIndex ).trim();
+ if( aToken.getLength() > 0 )
+ mrDrawing.registerBlockId( aToken.toInt32() );
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
+
+ClientDataContext::ClientDataContext( ContextHandler2Helper& rParent,
+ ClientData& rClientData, const AttributeList& rAttribs ) :
ContextHandler2( rParent ),
mrClientData( rClientData )
{
mrClientData.mnObjType = rAttribs.getToken( XML_ObjectType, XML_TOKEN_INVALID );
}
-ContextHandlerRef ShapeClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
{
- return isRootElement() ? this : 0;
+ if( isRootElement() )
+ {
+ maElementText = OUString();
+ return this;
+ }
+ return 0;
+}
+
+void ClientDataContext::onCharacters( const OUString& rChars )
+{
+ /* Empty but existing elements have special meaning, e.g. 'true'. Collect
+ existing text and convert it in onEndElement(). */
+ maElementText = rChars;
}
-void ShapeClientDataContext::onEndElement( const OUString& rChars )
+void ClientDataContext::onEndElement()
{
switch( getCurrentElement() )
{
- case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = rChars; break;
- case VMLX_TOKEN( FmlaPict ): mrClientData.maPictureLink = rChars; break;
- case VMLX_TOKEN( FmlaLink ): mrClientData.maLinkedCell = rChars; break;
- case VMLX_TOKEN( FmlaRange ): mrClientData.maSourceRange = rChars; break;
- case VMLX_TOKEN( Column ): mrClientData.mnCol = rChars.toInt32(); break;
- case VMLX_TOKEN( Row ): mrClientData.mnRow = rChars.toInt32(); break;
- case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( rChars, true ); break;
- case VMLX_TOKEN( Visible ): mrClientData.mbVisible = true; break;
+ case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = maElementText; break;
+ case VMLX_TOKEN( FmlaMacro ): mrClientData.maFmlaMacro = maElementText; break;
+ case VMLX_TOKEN( FmlaPict ): mrClientData.maFmlaPict = maElementText; break;
+ case VMLX_TOKEN( FmlaLink ): mrClientData.maFmlaLink = maElementText; break;
+ case VMLX_TOKEN( FmlaRange ): mrClientData.maFmlaRange = maElementText; break;
+ case VMLX_TOKEN( FmlaGroup ): mrClientData.maFmlaGroup = maElementText; break;
+ case VMLX_TOKEN( TextHAlign ): mrClientData.mnTextHAlign = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( TextVAlign ): mrClientData.mnTextVAlign = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( Column ): mrClientData.mnCol = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Row ): mrClientData.mnRow = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Checked ): mrClientData.mnChecked = maElementText.toInt32(); break;
+ case VMLX_TOKEN( DropStyle ): mrClientData.mnDropStyle = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( DropLines ): mrClientData.mnDropLines = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Val ): mrClientData.mnVal = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Min ): mrClientData.mnMin = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Max ): mrClientData.mnMax = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Inc ): mrClientData.mnInc = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Page ): mrClientData.mnPage = maElementText.toInt32(); break;
+ case VMLX_TOKEN( SelType ): mrClientData.mnSelType = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( VTEdit ): mrClientData.mnVTEdit = maElementText.toInt32(); break;
+ case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( Visible ): mrClientData.mbVisible = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( DDE ): mrClientData.mbDde = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( NoThreeD ): mrClientData.mbNo3D = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( NoThreeD2 ): mrClientData.mbNo3D2 = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( MultiLine ): mrClientData.mbMultiLine = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( VScroll ): mrClientData.mbVScroll = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( SecretEdit ): mrClientData.mbSecretEdit = lclDecodeVmlxBool( maElementText, true ); break;
}
}
@@ -144,23 +212,26 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) :
}
/*static*/ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper& rParent,
- sal_Int32 nElement, const AttributeList& rAttribs, ShapeContainer& rShapes )
+ ShapeContainer& rShapes, sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( nElement )
{
+ case O_TOKEN( shapelayout ):
+ return new ShapeLayoutContext( rParent, rShapes.getDrawing() );
+
case VML_TOKEN( shapetype ):
- return new ShapeTypeContext( rParent, rAttribs, rShapes.createShapeType() );
+ return new ShapeTypeContext( rParent, rShapes.createShapeType(), rAttribs );
case VML_TOKEN( group ):
- return new GroupShapeContext( rParent, rAttribs, rShapes.createShape< GroupShape >() );
+ return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs );
case VML_TOKEN( shape ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
case VML_TOKEN( rect ):
case VML_TOKEN( roundrect ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< RectangleShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< RectangleShape >(), rAttribs );
case VML_TOKEN( oval ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< EllipseShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< EllipseShape >(), rAttribs );
case VML_TOKEN( polyline ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< PolyLineShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< PolyLineShape >(), rAttribs );
// TODO:
case VML_TOKEN( arc ):
@@ -168,14 +239,14 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) :
case VML_TOKEN( line ):
case VML_TOKEN( diagram ):
case VML_TOKEN( image ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
}
return 0;
}
// ============================================================================
-ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeType& rShapeType ) :
+ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& rShapeType, const AttributeList& rAttribs ) :
ShapeContextBase( rParent ),
mrTypeModel( rShapeType.getTypeModel() )
{
@@ -185,7 +256,7 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const Attrib
OSL_ENSURE( mrTypeModel.maShapeId.getLength() > 0, "ShapeTypeContext::ShapeTypeContext - missing shape identifier" );
// if the o:spid attribute exists, the id attribute contains the user-defined shape name
if( bHasOspid )
- mrTypeModel.maName = rAttribs.getXString( XML_id, OUString() );
+ mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
// builtin shape type identifier
mrTypeModel.moShapeType = rAttribs.getInteger( O_TOKEN( spt ) );
@@ -276,8 +347,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
// ============================================================================
-ShapeContext::ShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeBase& rShape ) :
- ShapeTypeContext( rParent, rAttribs, rShape ),
+ShapeContext::ShapeContext( ContextHandler2Helper& rParent, ShapeBase& rShape, const AttributeList& rAttribs ) :
+ ShapeTypeContext( rParent, rShape, rAttribs ),
mrShapeModel( rShape.getShapeModel() )
{
// collect shape specific attributes
@@ -289,8 +360,13 @@ ShapeContext::ShapeContext( ContextHandler2Helper& rParent, const AttributeList&
ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
// Excel specific shape client data
- if( isRootElement() && (nElement == VMLX_TOKEN( ClientData )) )
- return new ShapeClientDataContext( *this, rAttribs, mrShapeModel.createClientData() );
+ if( isRootElement() ) switch( nElement )
+ {
+ case VML_TOKEN( textbox ):
+ return new TextBoxContext( *this, mrShapeModel.createTextBox(), rAttribs );
+ case VMLX_TOKEN( ClientData ):
+ return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs );
+ }
// handle remaining stuff in base class
return ShapeTypeContext::onCreateContext( nElement, rAttribs );
}
@@ -309,8 +385,8 @@ void ShapeContext::setPoints( const OUString& rPoints )
// ============================================================================
-GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, GroupShape& rShape ) :
- ShapeContext( rParent, rAttribs, rShape ),
+GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, GroupShape& rShape, const AttributeList& rAttribs ) :
+ ShapeContext( rParent, rShape, rAttribs ),
mrShapes( rShape.getChildren() )
{
}
@@ -318,7 +394,7 @@ GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const Attr
ContextHandlerRef GroupShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
// try to create a context of an embedded shape
- ContextHandlerRef xContext = createShapeContext( *this, nElement, rAttribs, mrShapes );
+ ContextHandlerRef xContext = createShapeContext( *this, mrShapes, nElement, rAttribs );
// handle remaining stuff of this shape in base class
return xContext.get() ? xContext : ShapeContext::onCreateContext( nElement, rAttribs );
}
diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/source/vml/vmltextbox.cxx
index ee05ce480a75..f56eb387d5b2 100644..100755
--- a/oox/inc/oox/helper/recordinputstream.hxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -25,34 +25,57 @@
*
************************************************************************/
-#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX
-#define OOX_HELPER_RECORDINPUTSTREAM_HXX
+#include "oox/vml/vmltextbox.hxx"
-#include "oox/helper/binaryinputstream.hxx"
+#include <rtl/ustrbuf.hxx>
namespace oox {
+namespace vml {
// ============================================================================
-/** Reads the contents of a record from a binary OOBIN stream. */
-class RecordInputStream : public SequenceInputStream
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+TextFontModel::TextFontModel()
{
-public:
- explicit RecordInputStream( const StreamDataSequence& rData );
+}
- /** Reads a string with leading 16-bit or 32-bit length field. */
- ::rtl::OUString readString( bool b32BitLen = true );
+// ============================================================================
- /** Stream operator for integral types. */
- template< typename Type >
- inline RecordInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
- /** Stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */
- inline RecordInputStream& operator>>( ::rtl::OUString& orString ) { orString = readString(); return *this; }
-};
+TextPortionModel::TextPortionModel( const TextFontModel& rFont, const OUString& rText ) :
+ maFont( rFont ),
+ maText( rText )
+{
+}
// ============================================================================
-} // namespace oox
+TextBox::TextBox()
+{
+}
-#endif
+void TextBox::appendPortion( const TextFontModel& rFont, const OUString& rText )
+{
+ maPortions.push_back( TextPortionModel( rFont, rText ) );
+}
+const TextFontModel* TextBox::getFirstFont() const
+{
+ return maPortions.empty() ? 0 : &maPortions.front().maFont;
+}
+
+OUString TextBox::getText() const
+{
+ OUStringBuffer aBuffer;
+ for( PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt )
+ aBuffer.append( aIt->maText );
+ return aBuffer.makeStringAndClear();
+}
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
new file mode 100755
index 000000000000..4b57656b4f78
--- /dev/null
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * 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 "oox/vml/vmltextboxcontext.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using ::oox::core::ContextHandler2;
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
+TextPortionContext::TextPortionContext( ContextHandler2Helper& rParent,
+ TextBox& rTextBox, const TextFontModel& rParentFont,
+ sal_Int32 nElement, const AttributeList& rAttribs ) :
+ ContextHandler2( rParent ),
+ mrTextBox( rTextBox ),
+ maFont( rParentFont ),
+ mnInitialPortions( rTextBox.getPortionCount() )
+{
+ switch( nElement )
+ {
+ case XML_font:
+ maFont.moName = rAttribs.getXString( XML_face );
+ maFont.moColor = rAttribs.getXString( XML_color );
+ maFont.monSize = rAttribs.getInteger( XML_size );
+ break;
+ case XML_u:
+ OSL_ENSURE( !maFont.monUnderline, "TextPortionContext::TextPortionContext - nested <u> elements" );
+ maFont.monUnderline = (rAttribs.getToken( XML_class, XML_TOKEN_INVALID ) == XML_font4) ? XML_double : XML_single;
+ break;
+ case XML_sub:
+ case XML_sup:
+ OSL_ENSURE( !maFont.monEscapement, "TextPortionContext::TextPortionContext - nested <sub> or <sup> elements" );
+ maFont.monEscapement = nElement;
+ break;
+ case XML_b:
+ OSL_ENSURE( !maFont.mobBold, "TextPortionContext::TextPortionContext - nested <b> elements" );
+ maFont.mobBold = true;
+ break;
+ case XML_i:
+ OSL_ENSURE( !maFont.mobItalic, "TextPortionContext::TextPortionContext - nested <i> elements" );
+ maFont.mobItalic = true;
+ break;
+ case XML_s:
+ OSL_ENSURE( !maFont.mobStrikeout, "TextPortionContext::TextPortionContext - nested <s> elements" );
+ maFont.mobStrikeout = true;
+ break;
+ default:
+ OSL_ENSURE( false, "TextPortionContext::TextPortionContext - unknown element" );
+ }
+}
+
+ContextHandlerRef TextPortionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ OSL_ENSURE( nElement != XML_font, "TextPortionContext::onCreateContext - nested <font> elements" );
+ return new TextPortionContext( *this, mrTextBox, maFont, nElement, rAttribs );
+}
+
+void TextPortionContext::onCharacters( const OUString& rChars )
+{
+ switch( getCurrentElement() )
+ {
+ case XML_span:
+ // replace all NBSP characters with SP
+ mrTextBox.appendPortion( maFont, rChars.replace( 160, ' ' ) );
+ break;
+ default:
+ mrTextBox.appendPortion( maFont, rChars );
+ }
+}
+
+void TextPortionContext::onEndElement()
+{
+ /* An empty child element without own child elements represents a single
+ space character, for example:
+
+ <font>
+ <i>abc</i>
+ <font></font>
+ <b>def</b>
+ </font>
+
+ represents the italic text 'abc', an unformatted space character, and
+ the bold text 'def'.
+ */
+ if( (mnInitialPortions > 0) && (mrTextBox.getPortionCount() == mnInitialPortions) )
+ mrTextBox.appendPortion( maFont, OUString( sal_Unicode( ' ' ) ) );
+}
+
+// ============================================================================
+
+TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBox, const AttributeList& /*rAttribs*/ ) :
+ ContextHandler2( rParent ),
+ mrTextBox( rTextBox )
+{
+}
+
+ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case VML_TOKEN( textbox ):
+ if( nElement == XML_div ) return this;
+ break;
+ case XML_div:
+ if( nElement == XML_font ) return new TextPortionContext( *this, mrTextBox, TextFontModel(), nElement, rAttribs );
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx
index 5a379000fe9e..6d53be0c155b 100644
--- a/oox/source/xls/addressconverter.cxx
+++ b/oox/source/xls/addressconverter.cxx
@@ -26,37 +26,37 @@
************************************************************************/
#include "oox/xls/addressconverter.hxx"
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include "oox/helper/recordinputstream.hxx"
+#include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffoutputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringBuffer;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-//! TODO: this limit may be changed
+//! TODO: this limit may change, is there a way to obtain it via API?
const sal_Int16 API_MAXTAB = 255;
const sal_Int32 OOX_MAXCOL = static_cast< sal_Int32 >( (1 << 14) - 1 );
@@ -122,7 +122,7 @@ CellAddress ApiCellRangeList::getBaseAddress() const
// ============================================================================
-void BinAddress::read( RecordInputStream& rStrm )
+void BinAddress::read( SequenceInputStream& rStrm )
{
rStrm >> mnRow >> mnCol;
}
@@ -153,7 +153,7 @@ bool BinRange::contains( const BinAddress& rAddr ) const
(maFirst.mnRow <= rAddr.mnRow) && (rAddr.mnRow <= maLast.mnRow);
}
-void BinRange::read( RecordInputStream& rStrm )
+void BinRange::read( SequenceInputStream& rStrm )
{
rStrm >> maFirst.mnRow >> maLast.mnRow >> maFirst.mnCol >> maLast.mnCol;
}
@@ -198,7 +198,7 @@ BinRange BinRangeList::getEnclosingRange() const
return aRange;
}
-void BinRangeList::read( RecordInputStream& rStrm )
+void BinRangeList::read( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
resize( getLimitedValue< size_t, sal_Int64 >( nCount, 0, rStrm.getRemaining() / 16 ) );
@@ -242,7 +242,7 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) :
maDConChars.set( 0xFFFF, '\x01', 0xFFFF, '\x02', 0xFFFF );
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
initializeMaxPos( OOX_MAXTAB, OOX_MAXCOL, OOX_MAXROW );
break;
case FILTER_BIFF: switch( getBiff() )
@@ -781,4 +781,3 @@ void AddressConverter::initializeMaxPos(
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx
new file mode 100755
index 000000000000..7cf359f6d3c9
--- /dev/null
+++ b/oox/source/xls/autofilterbuffer.cxx
@@ -0,0 +1,853 @@
+/*************************************************************************
+ *
+ * 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 "oox/xls/autofilterbuffer.hxx"
+
+#include <com/sun/star/sheet/FilterConnection.hpp>
+#include <com/sun/star/sheet/FilterOperator2.hpp>
+#include <com/sun/star/sheet/TableFilterField2.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
+#include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
+#include <com/sun/star/table/TableOrientation.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/defnamesbuffer.hxx"
+
+namespace oox {
+namespace xls {
+
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt8 BIFF12_TOP10FILTER_TOP = 0x01;
+const sal_uInt8 BIFF12_TOP10FILTER_PERCENT = 0x02;
+
+const sal_uInt16 BIFF12_FILTERCOLUMN_HIDDENBUTTON = 0x0001;
+const sal_uInt16 BIFF12_FILTERCOLUMN_SHOWBUTTON = 0x0002;
+
+const sal_uInt16 BIFF_FILTERCOLUMN_OR = 0x0001;
+const sal_uInt16 BIFF_FILTERCOLUMN_TOP10FILTER = 0x0010;
+const sal_uInt16 BIFF_FILTERCOLUMN_TOP = 0x0020;
+const sal_uInt16 BIFF_FILTERCOLUMN_PERCENT = 0x0040;
+
+const sal_uInt8 BIFF_FILTER_DATATYPE_NONE = 0;
+const sal_uInt8 BIFF_FILTER_DATATYPE_RK = 2;
+const sal_uInt8 BIFF_FILTER_DATATYPE_DOUBLE = 4;
+const sal_uInt8 BIFF_FILTER_DATATYPE_STRING = 6;
+const sal_uInt8 BIFF_FILTER_DATATYPE_BOOLEAN = 8;
+const sal_uInt8 BIFF_FILTER_DATATYPE_EMPTY = 12;
+const sal_uInt8 BIFF_FILTER_DATATYPE_NOTEMPTY = 14;
+
+// ----------------------------------------------------------------------------
+
+bool lclGetApiOperatorFromToken( sal_Int32& rnApiOperator, sal_Int32 nToken )
+{
+ switch( nToken )
+ {
+ case XML_lessThan: rnApiOperator = FilterOperator2::NOT_EQUAL; return true;
+ case XML_equal: rnApiOperator = FilterOperator2::EQUAL; return true;
+ case XML_lessThanOrEqual: rnApiOperator = FilterOperator2::LESS_EQUAL; return true;
+ case XML_greaterThan: rnApiOperator = FilterOperator2::GREATER; return true;
+ case XML_notEqual: rnApiOperator = FilterOperator2::NOT_EQUAL; return true;
+ case XML_greaterThanOrEqual: rnApiOperator = FilterOperator2::GREATER_EQUAL; return true;
+ }
+ return false;
+}
+
+/** Removes leading asterisk characters from the passed string.
+ @return True = at least one asterisk character has been removed. */
+bool lclTrimLeadingAsterisks( OUString& rValue )
+{
+ sal_Int32 nLength = rValue.getLength();
+ sal_Int32 nPos = 0;
+ while( (nPos < nLength) && (rValue[ nPos ] == '*') )
+ ++nPos;
+ if( nPos > 0 )
+ {
+ rValue = rValue.copy( nPos );
+ return true;
+ }
+ return false;
+}
+
+/** Removes trailing asterisk characters from the passed string.
+ @return True = at least one asterisk character has been removed. */
+bool lclTrimTrailingAsterisks( OUString& rValue )
+{
+ sal_Int32 nLength = rValue.getLength();
+ sal_Int32 nPos = nLength;
+ while( (nPos > 0) && (rValue[ nPos - 1 ] == '*') )
+ --nPos;
+ if( nPos < nLength )
+ {
+ rValue = rValue.copy( 0, nPos );
+ return true;
+ }
+ return false;
+}
+
+/** Converts wildcard characters '*' and '?' to regular expressions and quotes
+ RE meta characters.
+ @return True = passed string has been changed (RE needs to be enabled). */
+bool lclConvertWildcardsToRegExp( OUString& rValue )
+{
+ // check existence of the wildcard characters '*' and '?'
+ if( (rValue.getLength() > 0) && ((rValue.indexOf( '*' ) >= 0) || (rValue.indexOf( '?' ) >= 0)) )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.ensureCapacity( rValue.getLength() + 5 );
+ const sal_Unicode* pcChar = rValue.getStr();
+ const sal_Unicode* pcEnd = pcChar + rValue.getLength();
+ for( ; pcChar < pcEnd; ++pcChar )
+ {
+ switch( *pcChar )
+ {
+ case '?':
+ aBuffer.append( sal_Unicode( '.' ) );
+ break;
+ case '*':
+ aBuffer.append( sal_Unicode( '.' ) ).append( sal_Unicode( '*' ) );
+ break;
+ case '\\': case '.': case '|': case '(': case ')': case '^': case '$':
+ // quote RE meta characters
+ aBuffer.append( sal_Unicode( '\\' ) ).append( *pcChar );
+ break;
+ default:
+ aBuffer.append( *pcChar );
+ }
+ }
+ rValue = aBuffer.makeStringAndClear();
+ return true;
+ }
+ return false;
+}
+
+} // namespace
+
+// ============================================================================
+
+ApiFilterSettings::ApiFilterSettings()
+{
+}
+
+void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, double fValue )
+{
+ maFilterFields.resize( maFilterFields.size() + 1 );
+ TableFilterField2& rFilterField = maFilterFields.back();
+ rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
+ rFilterField.Operator = nOperator;
+ rFilterField.IsNumeric = sal_True;
+ rFilterField.NumericValue = fValue;
+}
+
+void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, const OUString& rValue )
+{
+ maFilterFields.resize( maFilterFields.size() + 1 );
+ TableFilterField2& rFilterField = maFilterFields.back();
+ rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
+ rFilterField.Operator = nOperator;
+ rFilterField.IsNumeric = sal_False;
+ rFilterField.StringValue = rValue;
+}
+
+// ============================================================================
+
+FilterSettingsBase::FilterSettingsBase( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+void FilterSettingsBase::importAttribs( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
+{
+}
+
+void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, SequenceInputStream& /*rStrm*/ )
+{
+}
+
+void FilterSettingsBase::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 /*nFlags*/ )
+{
+}
+
+ApiFilterSettings FilterSettingsBase::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ return ApiFilterSettings();
+}
+
+// ============================================================================
+
+DiscreteFilter::DiscreteFilter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mnCalendarType( XML_none ),
+ mbShowBlank( false )
+{
+}
+
+void DiscreteFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case XLS_TOKEN( filters ):
+ mnCalendarType = rAttribs.getToken( XML_calendarType, XML_none );
+ mbShowBlank = rAttribs.getBool( XML_blank, false );
+ break;
+
+ case XLS_TOKEN( filter ):
+ {
+ OUString aValue = rAttribs.getXString( XML_val, OUString() );
+ if( aValue.getLength() > 0 )
+ maValues.push_back( aValue );
+ }
+ break;
+ }
+}
+
+void DiscreteFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( nRecId )
+ {
+ case BIFF12_ID_DISCRETEFILTERS:
+ {
+ sal_Int32 nShowBlank, nCalendarType;
+ rStrm >> nShowBlank >> nCalendarType;
+
+ static const sal_Int32 spnCalendarTypes[] = {
+ XML_none, XML_gregorian, XML_gregorianUs, XML_japan, XML_taiwan, XML_korea, XML_hijri, XML_thai, XML_hebrew,
+ XML_gregorianMeFrench, XML_gregorianArabic, XML_gregorianXlitEnglish, XML_gregorianXlitFrench };
+ mnCalendarType = STATIC_ARRAY_SELECT( spnCalendarTypes, nCalendarType, XML_none );
+ mbShowBlank = nShowBlank != 0;
+ }
+ break;
+
+ case BIFF12_ID_DISCRETEFILTER:
+ {
+ OUString aValue = BiffHelper::readString( rStrm );
+ if( aValue.getLength() > 0 )
+ maValues.push_back( aValue );
+ }
+ break;
+ }
+}
+
+ApiFilterSettings DiscreteFilter::finalizeImport( sal_Int32 nMaxCount )
+{
+ ApiFilterSettings aSettings;
+ if( static_cast< sal_Int32 >( maValues.size() ) <= nMaxCount )
+ {
+ aSettings.maFilterFields.reserve( maValues.size() );
+
+ // insert all filter values
+ for( FilterValueVector::iterator aIt = maValues.begin(), aEnd = maValues.end(); aIt != aEnd; ++aIt )
+ aSettings.appendField( false, FilterOperator2::EQUAL, *aIt );
+
+ // extra field for 'show empty'
+ if( mbShowBlank )
+ aSettings.appendField( false, FilterOperator2::EMPTY, OUString() );
+
+ /* Require disabled regular expressions, filter entries may contain
+ any RE meta characters. */
+ if( !maValues.empty() )
+ aSettings.mobNeedsRegExp = false;
+ }
+ return aSettings;
+}
+
+// ============================================================================
+
+Top10Filter::Top10Filter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mfValue( 0.0 ),
+ mbTop( true ),
+ mbPercent( false )
+{
+}
+
+void Top10Filter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ if( nElement == XLS_TOKEN( top10 ) )
+ {
+ mfValue = rAttribs.getDouble( XML_val, 0.0 );
+ mbTop = rAttribs.getBool( XML_top, true );
+ mbPercent = rAttribs.getBool( XML_percent, false );
+ }
+}
+
+void Top10Filter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ if( nRecId == BIFF12_ID_TOP10FILTER )
+ {
+ sal_uInt8 nFlags;
+ rStrm >> nFlags >> mfValue;
+ mbTop = getFlag( nFlags, BIFF12_TOP10FILTER_TOP );
+ mbPercent = getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT );
+ }
+}
+
+void Top10Filter::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 nFlags )
+{
+ mfValue = extractValue< sal_uInt16 >( nFlags, 7, 9 );
+ mbTop = getFlag( nFlags, BIFF_FILTERCOLUMN_TOP );
+ mbPercent = getFlag( nFlags, BIFF_FILTERCOLUMN_PERCENT );
+}
+
+ApiFilterSettings Top10Filter::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ sal_Int32 nOperator = mbTop ?
+ (mbPercent ? FilterOperator2::TOP_PERCENT : FilterOperator2::TOP_VALUES) :
+ (mbPercent ? FilterOperator2::BOTTOM_PERCENT : FilterOperator2::BOTTOM_VALUES);
+ ApiFilterSettings aSettings;
+ aSettings.appendField( true, nOperator, mfValue );
+ return aSettings;
+}
+
+// ============================================================================
+
+FilterCriterionModel::FilterCriterionModel() :
+ mnOperator( XML_equal ),
+ mnDataType( BIFF_FILTER_DATATYPE_NONE ),
+ mnStrLen( 0 )
+{
+}
+
+void FilterCriterionModel::setBiffOperator( sal_uInt8 nOperator )
+{
+ static const sal_Int32 spnOperators[] = { XML_TOKEN_INVALID,
+ XML_lessThan, XML_equal, XML_lessThanOrEqual, XML_greaterThan, XML_notEqual, XML_greaterThanOrEqual };
+ mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
+}
+
+void FilterCriterionModel::readBiffData( SequenceInputStream& rStrm )
+{
+ sal_uInt8 nOperator;
+ rStrm >> mnDataType >> nOperator;
+ setBiffOperator( nOperator );
+
+ switch( mnDataType )
+ {
+ case BIFF_FILTER_DATATYPE_DOUBLE:
+ maValue <<= rStrm.readDouble();
+ break;
+ case BIFF_FILTER_DATATYPE_STRING:
+ {
+ rStrm.skip( 8 );
+ OUString aValue = BiffHelper::readString( rStrm ).trim();
+ if( aValue.getLength() > 0 )
+ maValue <<= aValue;
+ }
+ break;
+ case BIFF_FILTER_DATATYPE_BOOLEAN:
+ maValue <<= (rStrm.readuInt8() != 0);
+ rStrm.skip( 7 );
+ break;
+ case BIFF_FILTER_DATATYPE_EMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_equal )
+ maValue <<= OUString();
+ break;
+ case BIFF_FILTER_DATATYPE_NOTEMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_notEqual )
+ maValue <<= OUString();
+ break;
+ default:
+ OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" );
+ rStrm.skip( 8 );
+ }
+}
+
+void FilterCriterionModel::readBiffData( BiffInputStream& rStrm )
+{
+ sal_uInt8 nOperator;
+ rStrm >> mnDataType >> nOperator;
+ setBiffOperator( nOperator );
+
+ switch( mnDataType )
+ {
+ case BIFF_FILTER_DATATYPE_NONE:
+ rStrm.skip( 8 );
+ break;
+ case BIFF_FILTER_DATATYPE_RK:
+ maValue <<= BiffHelper::calcDoubleFromRk( rStrm.readInt32() );
+ rStrm.skip( 4 );
+ break;
+ case BIFF_FILTER_DATATYPE_DOUBLE:
+ maValue <<= rStrm.readDouble();
+ break;
+ case BIFF_FILTER_DATATYPE_STRING:
+ rStrm.skip( 4 );
+ rStrm >> mnStrLen;
+ rStrm.skip( 3 );
+ break;
+ case BIFF_FILTER_DATATYPE_BOOLEAN:
+ {
+ sal_uInt8 nValue, nType;
+ rStrm >> nValue >> nType;
+ rStrm.skip( 6 );
+ switch( nType )
+ {
+ case BIFF_BOOLERR_BOOL: maValue <<= (nValue != 0); break;
+ case BIFF_BOOLERR_ERROR: maValue <<= BiffHelper::calcDoubleFromError( nValue ); break;
+ default: OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unknown type" );
+ }
+ }
+ break;
+ case BIFF_FILTER_DATATYPE_EMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_equal )
+ maValue <<= OUString();
+ break;
+ case BIFF_FILTER_DATATYPE_NOTEMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_notEqual )
+ maValue <<= OUString();
+ break;
+ default:
+ OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" );
+ rStrm.skip( 8 );
+ }
+}
+
+void FilterCriterionModel::readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc )
+{
+ if( (mnDataType == BIFF_FILTER_DATATYPE_STRING) && (mnStrLen > 0) )
+ {
+ OUString aValue = (eBiff == BIFF8) ?
+ rStrm.readUniStringBody( mnStrLen, true ) :
+ rStrm.readCharArrayUC( mnStrLen, eTextEnc, true );
+ aValue = aValue.trim();
+ if( aValue.getLength() > 0 )
+ maValue <<= aValue;
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+CustomFilter::CustomFilter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mbAnd( false )
+{
+}
+
+void CustomFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case XLS_TOKEN( customFilters ):
+ mbAnd = rAttribs.getBool( XML_and, false );
+ break;
+
+ case XLS_TOKEN( customFilter ):
+ {
+ FilterCriterionModel aCriterion;
+ aCriterion.mnOperator = rAttribs.getToken( XML_operator, XML_equal );
+ OUString aValue = rAttribs.getXString( XML_val, OUString() ).trim();
+ if( (aCriterion.mnOperator == XML_equal) || (aCriterion.mnOperator == XML_notEqual) || (aValue.getLength() > 0) )
+ aCriterion.maValue <<= aValue;
+ appendCriterion( aCriterion );
+ }
+ break;
+ }
+}
+
+void CustomFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( nRecId )
+ {
+ case BIFF12_ID_CUSTOMFILTERS:
+ mbAnd = rStrm.readInt32() == 0;
+ break;
+
+ case BIFF12_ID_CUSTOMFILTER:
+ {
+ FilterCriterionModel aCriterion;
+ aCriterion.readBiffData( rStrm );
+ appendCriterion( aCriterion );
+ }
+ break;
+ }
+}
+
+void CustomFilter::importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags )
+{
+ mbAnd = !getFlag( nFlags, BIFF_FILTERCOLUMN_OR );
+
+ FilterCriterionModel aCriterion1, aCriterion2;
+ aCriterion1.readBiffData( rStrm );
+ aCriterion2.readBiffData( rStrm );
+ aCriterion1.readString( rStrm, getBiff(), getTextEncoding() );
+ aCriterion2.readString( rStrm, getBiff(), getTextEncoding() );
+ appendCriterion( aCriterion1 );
+ appendCriterion( aCriterion2 );
+}
+
+ApiFilterSettings CustomFilter::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ ApiFilterSettings aSettings;
+ OSL_ENSURE( maCriteria.size() <= 2, "CustomFilter::finalizeImport - too many filter criteria" );
+ for( FilterCriterionVector::iterator aIt = maCriteria.begin(), aEnd = maCriteria.end(); aIt != aEnd; ++aIt )
+ {
+ // first extract the filter operator
+ sal_Int32 nOperator = 0;
+ bool bValidOperator = lclGetApiOperatorFromToken( nOperator, aIt->mnOperator );
+ if( bValidOperator )
+ {
+ if( aIt->maValue.has< OUString >() )
+ {
+ // string argument
+ OUString aValue;
+ aIt->maValue >>= aValue;
+ // check for 'empty', 'contains', 'begins with', or 'ends with' text filters
+ bool bEqual = nOperator == FilterOperator2::EQUAL;
+ bool bNotEqual = nOperator == FilterOperator2::NOT_EQUAL;
+ if( bEqual || bNotEqual )
+ {
+ if( aValue.getLength() == 0 )
+ {
+ // empty comparison string: create empty/not empty filters
+ nOperator = bNotEqual ? FilterOperator2::NOT_EMPTY : FilterOperator2::EMPTY;
+ }
+ else
+ {
+ // compare to something: try to find begins/ends/contains
+ bool bHasLeadingAsterisk = lclTrimLeadingAsterisks( aValue );
+ bool bHasTrailingAsterisk = lclTrimTrailingAsterisks( aValue );
+ // just '***' matches everything, do not create a filter field
+ bValidOperator = aValue.getLength() > 0;
+ if( bValidOperator )
+ {
+ if( bHasLeadingAsterisk && bHasTrailingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_CONTAIN : FilterOperator2::CONTAINS;
+ else if( bHasLeadingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_END_WITH : FilterOperator2::ENDS_WITH;
+ else if( bHasTrailingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_BEGIN_WITH : FilterOperator2::BEGINS_WITH;
+ // else: no asterisks, stick to equal/not equal
+ }
+ }
+ }
+
+ if( bValidOperator )
+ {
+ // if wildcards are present, require RE mode, otherwise keep don't care state
+ if( lclConvertWildcardsToRegExp( aValue ) )
+ aSettings.mobNeedsRegExp = true;
+ // create a new UNO API filter field
+ aSettings.appendField( mbAnd, nOperator, aValue );
+ }
+ }
+ else if( aIt->maValue.has< double >() )
+ {
+ // floating-point argument
+ double fValue = 0.0;
+ aIt->maValue >>= fValue;
+ aSettings.appendField( mbAnd, nOperator, fValue );
+ }
+ }
+ }
+ return aSettings;
+}
+
+void CustomFilter::appendCriterion( const FilterCriterionModel& rCriterion )
+{
+ if( (rCriterion.mnOperator != XML_TOKEN_INVALID) && rCriterion.maValue.hasValue() )
+ maCriteria.push_back( rCriterion );
+}
+
+// ============================================================================
+
+FilterColumn::FilterColumn( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper ),
+ mnColId( -1 ),
+ mbHiddenButton( false ),
+ mbShowButton( true )
+{
+}
+
+void FilterColumn::importFilterColumn( const AttributeList& rAttribs )
+{
+ mnColId = rAttribs.getInteger( XML_colId, -1 );
+ mbHiddenButton = rAttribs.getBool( XML_hiddenButton, false );
+ mbShowButton = rAttribs.getBool( XML_showButton, true );
+}
+
+void FilterColumn::importFilterColumn( SequenceInputStream& rStrm )
+{
+ sal_uInt16 nFlags;
+ rStrm >> mnColId >> nFlags;
+ mbHiddenButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_HIDDENBUTTON );
+ mbShowButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_SHOWBUTTON );
+}
+
+void FilterColumn::importFilterColumn( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags;
+ mnColId = rStrm.readuInt16();
+ rStrm >> nFlags;
+
+ // BIFF5/BIFF8 support top-10 filters and custom filters
+ if( getFlag( nFlags, BIFF_FILTERCOLUMN_TOP10FILTER ) )
+ createFilterSettings< Top10Filter >().importBiffRecord( rStrm, nFlags );
+ else
+ createFilterSettings< CustomFilter >().importBiffRecord( rStrm, nFlags );
+}
+
+ApiFilterSettings FilterColumn::finalizeImport( sal_Int32 nMaxCount )
+{
+ ApiFilterSettings aSettings;
+ if( (0 <= mnColId) && mxSettings.get() )
+ {
+ // filter settings object creates a sequence of filter fields
+ aSettings = mxSettings->finalizeImport( nMaxCount );
+ // add column index to all filter fields
+ for( ApiFilterSettings::FilterFieldVector::iterator aIt = aSettings.maFilterFields.begin(), aEnd = aSettings.maFilterFields.end(); aIt != aEnd; ++aIt )
+ aIt->Field = mnColId;
+ }
+ return aSettings;
+}
+
+// ============================================================================
+
+AutoFilter::AutoFilter( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+void AutoFilter::importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet )
+{
+ OUString aRangeStr = rAttribs.getString( XML_ref, OUString() );
+ getAddressConverter().convertToCellRangeUnchecked( maRange, aRangeStr, nSheet );
+}
+
+void AutoFilter::importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet )
+{
+ BinRange aBinRange;
+ rStrm >> aBinRange;
+ getAddressConverter().convertToCellRangeUnchecked( maRange, aBinRange, nSheet );
+}
+
+FilterColumn& AutoFilter::createFilterColumn()
+{
+ FilterColumnVector::value_type xFilterColumn( new FilterColumn( *this ) );
+ maFilterColumns.push_back( xFilterColumn );
+ return *xFilterColumn;
+}
+
+void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxFilterDesc )
+{
+ if( rxFilterDesc.is() )
+ {
+ // set some common properties for the auto filter range
+ PropertySet aDescProps( rxFilterDesc );
+ aDescProps.setProperty( PROP_IsCaseSensitive, false );
+ aDescProps.setProperty( PROP_SkipDuplicates, false );
+ aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS );
+ aDescProps.setProperty( PROP_ContainsHeader, true );
+ aDescProps.setProperty( PROP_CopyOutputData, false );
+
+ // maximum number of UNO API filter fields
+ sal_Int32 nMaxCount = 0;
+ aDescProps.getProperty( nMaxCount, PROP_MaxFieldCount );
+ OSL_ENSURE( nMaxCount > 0, "AutoFilter::finalizeImport - invalid maximum filter field count" );
+
+ // resulting list of all UNO API filter fields
+ ::std::vector< TableFilterField2 > aFilterFields;
+
+ // track if columns require to enable or disable regular expressions
+ OptValue< bool > obNeedsRegExp;
+
+ /* Track whether the filter fields of the first filter column are
+ connected with 'or'. In this case, other filter fields cannot be
+ inserted without altering the result of the entire filter, due to
+ Calc's precedence for the 'and' connection operator. Example:
+ Excel's filter conditions 'A1 and (B1 or B2) and C1' where B1 and
+ B2 belong to filter column B, will be evaluated by Calc as
+ '(A1 and B1) or (B2 and C1)'. */
+ bool bHasOrConnection = false;
+
+ // process all filter column objects, exit when 'or' connection exists
+ for( FilterColumnVector::iterator aIt = maFilterColumns.begin(), aEnd = maFilterColumns.end(); !bHasOrConnection && (aIt != aEnd); ++aIt )
+ {
+ // the filter settings object creates a list of filter fields
+ ApiFilterSettings aSettings = (*aIt)->finalizeImport( nMaxCount );
+ ApiFilterSettings::FilterFieldVector& rColumnFields = aSettings.maFilterFields;
+
+ // new total number of filter fields
+ sal_Int32 nNewCount = static_cast< sal_Int32 >( aFilterFields.size() + rColumnFields.size() );
+
+ /* Check whether mode for regular expressions is compatible with
+ the global mode in obNeedsRegExp. If either one is still in
+ don't-care state, all is fine. If both are set, they must be
+ equal. */
+ bool bRegExpCompatible = !obNeedsRegExp || !aSettings.mobNeedsRegExp || (obNeedsRegExp.get() == aSettings.mobNeedsRegExp.get());
+
+ // check whether fields are connected by 'or' (see comments above).
+ if( rColumnFields.size() >= 2 )
+ for( ApiFilterSettings::FilterFieldVector::iterator aSIt = rColumnFields.begin() + 1, aSEnd = rColumnFields.end(); !bHasOrConnection && (aSIt != aSEnd); ++aSIt )
+ bHasOrConnection = aSIt->Connection == FilterConnection_OR;
+
+ /* Skip the column filter, if no filter fields have been created,
+ if the number of new filter fields would exceed the total limit
+ of filter fields, or if the mode for regular expressions of the
+ filter column does not fit. */
+ if( !rColumnFields.empty() && (nNewCount <= nMaxCount) && bRegExpCompatible )
+ {
+ /* Add 'and' connection to the first filter field to connect
+ it to the existing filter fields of other columns. */
+ rColumnFields[ 0 ].Connection = FilterConnection_AND;
+
+ // insert the new filter fields
+ aFilterFields.insert( aFilterFields.end(), rColumnFields.begin(), rColumnFields.end() );
+
+ // update the regular expressions mode
+ obNeedsRegExp.assignIfUsed( aSettings.mobNeedsRegExp );
+ }
+ }
+
+ // insert all filter fields to the filter descriptor
+ if( !aFilterFields.empty() )
+ rxFilterDesc->setFilterFields2( ContainerHelper::vectorToSequence( aFilterFields ) );
+
+ // regular expressions
+ bool bUseRegExp = obNeedsRegExp.get( false );
+ aDescProps.setProperty( PROP_UseRegularExpressions, bUseRegExp );
+ }
+}
+
+// ============================================================================
+
+AutoFilterBuffer::AutoFilterBuffer( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+AutoFilter& AutoFilterBuffer::createAutoFilter()
+{
+ AutoFilterVector::value_type xAutoFilter( new AutoFilter( *this ) );
+ maAutoFilters.push_back( xAutoFilter );
+ return *xAutoFilter;
+}
+
+void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet )
+{
+ // rely on existence of the defined name '_FilterDatabase' containing the range address of the filtered area
+ if( const DefinedName* pFilterDBName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_FILTERDATABASE, nSheet ).get() )
+ {
+ CellRangeAddress aFilterRange;
+ if( pFilterDBName->getAbsoluteRange( aFilterRange ) && (aFilterRange.Sheet == nSheet) )
+ {
+ // use the same name for the database range as used for the defined name '_FilterDatabase'
+ OUString aDBRangeName = pFilterDBName->getCalcName();
+ Reference< XDatabaseRange > xDatabaseRange = createDatabaseRangeObject( aDBRangeName, aFilterRange );
+ // first, try to create an auto filter
+ bool bHasAutoFilter = finalizeImport( xDatabaseRange );
+ // no success: try to create an advanced filter
+ if( !bHasAutoFilter && xDatabaseRange.is() )
+ {
+ // the built-in defined name 'Criteria' must exist
+ if( const DefinedName* pCriteriaName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_CRITERIA, nSheet ).get() )
+ {
+ CellRangeAddress aCriteriaRange;
+ if( pCriteriaName->getAbsoluteRange( aCriteriaRange ) )
+ {
+ // set some common properties for the filter descriptor
+ PropertySet aDescProps( xDatabaseRange->getFilterDescriptor() );
+ aDescProps.setProperty( PROP_IsCaseSensitive, false );
+ aDescProps.setProperty( PROP_SkipDuplicates, false );
+ aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS );
+ aDescProps.setProperty( PROP_ContainsHeader, true );
+ // criteria range may contain wildcards, but these are incompatible with REs
+ aDescProps.setProperty( PROP_UseRegularExpressions, false );
+
+ // position of output data (if built-in defined name 'Extract' exists)
+ DefinedNameRef xExtractName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_EXTRACT, nSheet );
+ CellRangeAddress aOutputRange;
+ bool bHasOutputRange = xExtractName.get() && xExtractName->getAbsoluteRange( aOutputRange );
+ aDescProps.setProperty( PROP_CopyOutputData, bHasOutputRange );
+ if( bHasOutputRange )
+ {
+ aDescProps.setProperty( PROP_SaveOutputPosition, true );
+ aDescProps.setProperty( PROP_OutputPosition, CellAddress( aOutputRange.Sheet, aOutputRange.StartColumn, aOutputRange.StartRow ) );
+ }
+
+ /* Properties of the database range (must be set after
+ modifying properties of the filter descriptor,
+ otherwise the 'FilterCriteriaSource' property gets
+ deleted). */
+ PropertySet aRangeProps( xDatabaseRange );
+ aRangeProps.setProperty( PROP_AutoFilter, false );
+ aRangeProps.setProperty( PROP_FilterCriteriaSource, aCriteriaRange );
+ }
+ }
+ }
+ }
+ }
+}
+
+bool AutoFilterBuffer::finalizeImport( const Reference< XDatabaseRange >& rxDatabaseRange )
+{
+ AutoFilter* pAutoFilter = getActiveAutoFilter();
+ if( pAutoFilter && rxDatabaseRange.is() ) try
+ {
+ // the property 'AutoFilter' enables the drop-down buttons
+ PropertySet aRangeProps( rxDatabaseRange );
+ aRangeProps.setProperty( PROP_AutoFilter, true );
+ // convert filter settings using the filter descriptor of the database range
+ Reference< XSheetFilterDescriptor2 > xFilterDesc( rxDatabaseRange->getFilterDescriptor(), UNO_QUERY_THROW );
+ pAutoFilter->finalizeImport( xFilterDesc );
+ // return true to indicate enabled autofilter
+ return true;
+ }
+ catch( Exception& )
+ {
+ }
+ return false;
+}
+
+AutoFilter* AutoFilterBuffer::getActiveAutoFilter()
+{
+ // Excel expects not more than one auto filter per sheet or table
+ OSL_ENSURE( maAutoFilters.size() == 1, "AutoFilterBuffer::getActiveAutoFilter - too many auto filters" );
+ // stick to the last imported auto filter
+ return maAutoFilters.empty() ? 0 : maAutoFilters.back().get();
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx
index 4ae31fc94c56..81327944fc05 100644
--- a/oox/source/xls/autofiltercontext.cxx
+++ b/oox/source/xls/autofiltercontext.cxx
@@ -26,750 +26,158 @@
************************************************************************/
#include "oox/xls/autofiltercontext.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
-#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XSheetFilterDescriptor.hpp>
-#include <com/sun/star/sheet/FilterOperator.hpp>
-#include <com/sun/star/sheet/FilterConnection.hpp>
-#include <com/sun/star/i18n/XLocaleData.hpp>
-#include "properties.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
-#include "oox/xls/addressconverter.hxx"
-#define DEBUG_OOX_AUTOFILTER 0
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
-#include <com/sun/star/sheet/XExtendedSheetFilterDescriptor.hpp>
-#include <com/sun/star/sheet/TableFilterFieldNormal.hpp>
-#include <com/sun/star/sheet/TableFilterFieldMultiString.hpp>
-using ::com::sun::star::sheet::TableFilterFieldNormal;
-using ::com::sun::star::sheet::TableFilterFieldMultiString;
-using ::com::sun::star::sheet::XExtendedSheetFilterDescriptor;
-#else
-#include <com/sun/star/sheet/TableFilterField.hpp>
-using ::com::sun::star::sheet::TableFilterField;
-#endif
-
-#if DEBUG_OOX_AUTOFILTER
-#include <stdio.h>
-#endif
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XDatabaseRange;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XSheetFilterDescriptor;
-using ::com::sun::star::i18n::LocaleDataItem;
-using ::com::sun::star::i18n::XLocaleData;
-using ::com::sun::star::lang::Locale;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/autofilterbuffer.hxx"
+#include "oox/xls/biffinputstream.hxx"
namespace oox {
namespace xls {
-// ============================================================================
-
-FilterFieldItem::FilterFieldItem() :
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- mpField(new TableFilterFieldNormal),
-#else
- mpField(new TableFilterField),
-#endif
- meType(NORMAL)
-{
-}
-
-FilterFieldItem::FilterFieldItem(Type eType) :
- meType(eType)
-{
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- switch ( eType )
- {
- case MULTI_STRING:
- mpField.reset(new TableFilterFieldMultiString);
- break;
- case NORMAL:
- mpField.reset(new TableFilterFieldNormal);
- break;
- default:
- mpField.reset(new TableFilterFieldNormal);
- }
-#else
- mpField.reset(new TableFilterField);
- meType = NORMAL;
-#endif
-}
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
// ============================================================================
-OoxAutoFilterContext::OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment ),
- mbValidAddress( false ),
- mbUseRegex( false ),
- mbShowBlank( false ),
- mbConnectionAnd( false )
+FilterSettingsContext::FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings ) :
+ WorksheetContextBase( rParent ),
+ mrFilterSettings( rFilterSettings )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxAutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef FilterSettingsContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
switch( getCurrentElement() )
{
- case XLS_TOKEN( autoFilter ):
- switch( nElement )
- {
- case XLS_TOKEN( filterColumn ): return this;
- }
- break;
-
- case XLS_TOKEN( filterColumn ):
- switch( nElement )
- {
- case XLS_TOKEN( filters ):
- case XLS_TOKEN( customFilters ):
- case XLS_TOKEN( top10 ):
- case XLS_TOKEN( dynamicFilter ): return this;
- }
- break;
-
case XLS_TOKEN( filters ):
- switch( nElement )
- {
- case XLS_TOKEN( filter ): return this;
- }
+ if( nElement == XLS_TOKEN( filter ) ) return this;
break;
-
case XLS_TOKEN( customFilters ):
- switch( nElement )
- {
- case XLS_TOKEN( customFilter ): return this;
- }
+ if( nElement == XLS_TOKEN( customFilter ) ) return this;
break;
}
return 0;
}
-void OoxAutoFilterContext::onStartElement( const AttributeList& rAttribs )
+void FilterSettingsContext::onStartElement( const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( autoFilter ):
- importAutoFilter( rAttribs );
- break;
- case XLS_TOKEN( filterColumn ):
- if ( mbValidAddress )
- importFilterColumn( rAttribs );
- break;
- case XLS_TOKEN( filters ):
- if ( mbValidAddress )
- importFilters( rAttribs );
- break;
- case XLS_TOKEN( filter ):
- if ( mbValidAddress )
- importFilter( rAttribs );
- break;
- case XLS_TOKEN( customFilters ):
- if ( mbValidAddress )
- importCustomFilters( rAttribs );
- break;
- case XLS_TOKEN( customFilter ):
- if ( mbValidAddress )
- importCustomFilter( rAttribs );
- break;
- case XLS_TOKEN( top10 ):
- if ( mbValidAddress )
- importTop10( rAttribs );
- break;
- case XLS_TOKEN( dynamicFilter ):
- if ( mbValidAddress )
- importDynamicFilter( rAttribs );
- break;
- }
+ mrFilterSettings.importAttribs( getCurrentElement(), rAttribs );
}
-void OoxAutoFilterContext::onEndElement( const OUString& /*rChars*/ )
+ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
switch( getCurrentElement() )
{
- case XLS_TOKEN( autoFilter ):
- maybeShowBlank();
- setAutoFilter();
+ case BIFF12_ID_DISCRETEFILTERS:
+ if( nRecId == BIFF12_ID_DISCRETEFILTER ) return this;
break;
- case XLS_TOKEN( filters ):
- setFilterNames();
+ case BIFF12_ID_CUSTOMFILTERS:
+ if( nRecId == BIFF12_ID_CUSTOMFILTER ) return this;
break;
}
+ return 0;
}
-#if DEBUG_OOX_AUTOFILTER
-static void lclPrintNormalField(
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- TableFilterFieldNormal* pField
-#else
- TableFilterField* pField
-#endif
-)
+void FilterSettingsContext::onStartRecord( SequenceInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- printf(" Operator: ");
- switch ( pField->Operator )
- {
- case FilterOperator_EQUAL:
- printf("EQUAL");
- break;
- case FilterOperator_NOT_EQUAL:
- printf("NOT_EQUAL");
- break;
- case com::sun::star::sheet::FilterOperator_GREATER:
- printf("GREATER");
- break;
- case com::sun::star::sheet::FilterOperator_GREATER_EQUAL:
- printf("GREATER_EQUAL");
- break;
- case FilterOperator_LESS:
- printf("LESS");
- break;
- case FilterOperator_LESS_EQUAL:
- printf("LESS_EQUAL");
- break;
- case FilterOperator_NOT_EMPTY:
- printf("NOT_EMPTY");
- break;
- case FilterOperator_EMPTY:
- printf("EMPTY");
- break;
- case FilterOperator_BOTTOM_PERCENT:
- printf("BOTTOM_PERCENT");
- break;
- case FilterOperator_BOTTOM_VALUES:
- printf("BOTTOM_VALUES");
- break;
- case FilterOperator_TOP_PERCENT:
- printf("TOP_PERCENT");
- break;
- case FilterOperator_TOP_VALUES:
- printf("TOP_VALUES");
- break;
- default:
- printf("other");
- }
- printf("\n");
-
- printf(" StringValue: %s\n",
- OUStringToOString(pField->StringValue, RTL_TEXTENCODING_UTF8).getStr());
-
- printf(" NumericValue: %g\n", pField->NumericValue);
-
- printf(" IsNumeric: ");
- if (pField->IsNumeric)
- printf("yes\n");
- else
- printf("no\n");
+ mrFilterSettings.importRecord( getCurrentElement(), rStrm );
}
-static void lclPrintFieldConnection( ::com::sun::star::sheet::FilterConnection eConn )
-{
- using namespace ::com::sun::star::sheet;
+// ============================================================================
- printf(" Connection: ");
- switch ( eConn )
- {
- case FilterConnection_AND:
- printf("AND");
- break;
- case FilterConnection_OR:
- printf("OR");
- break;
- case FilterConnection_MAKE_FIXED_SIZE:
- printf("MAKE_FIXED_SIZE");
- break;
- default:
- printf("other");
- }
- printf("\n");
+FilterColumnContext::FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn ) :
+ WorksheetContextBase( rParent ),
+ mrFilterColumn( rFilterColumn )
+{
}
-static void lclPrintFilterField( const FilterFieldItem& aItem )
+ContextHandlerRef FilterColumnContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- using namespace ::com::sun::star::sheet;
-
- printf("----------------------------------------\n");
-#if USE_SC_MULTI_STRING_FILTER_PATCH
+ if( getCurrentElement() == XLS_TOKEN( filterColumn ) ) switch( nElement )
{
- // Print common fields first.
-
- TableFilterFieldBase* pField = aItem.mpField.get();
- printf(" Field: %ld\n", pField->Field);
- lclPrintFieldConnection(pField->Connection);
- }
- switch ( aItem.meType )
- {
- case FilterFieldItem::NORMAL:
- {
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
- lclPrintNormalField(pField);
- }
- break;
- case FilterFieldItem::MULTI_STRING:
- {
- TableFilterFieldMultiString* pMultiStrField = static_cast<TableFilterFieldMultiString*>(aItem.mpField.get());
- sal_Int32 nSize = pMultiStrField->StringSet.getLength();
- printf(" StringSet:\n");
- for ( sal_Int32 i = 0; i < nSize; ++i )
- {
- printf(" * %s\n",
- OUStringToOString(pMultiStrField->StringSet[i], RTL_TEXTENCODING_UTF8).getStr());
- }
- }
- break;
+ case XLS_TOKEN( filters ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() );
+ case XLS_TOKEN( top10 ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() );
+ case XLS_TOKEN( customFilters ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() );
}
-#else
- TableFilterField* pField = aItem.mpField.get();
- printf(" Field: %ld\n", pField->Field);
- lclPrintFieldConnection(pField->Connection);
- lclPrintNormalField(pField);
-
-#endif
- fflush(stdout);
+ return 0;
}
-#endif
-void OoxAutoFilterContext::initialize()
+void FilterColumnContext::onStartElement( const AttributeList& rAttribs )
{
- maFields.clear();
- maFilterNames.clear();
- mbValidAddress = mbShowBlank = mbUseRegex = mbConnectionAnd = false;
+ mrFilterColumn.importFilterColumn( rAttribs );
}
-void OoxAutoFilterContext::setAutoFilter()
+ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
- using namespace ::com::sun::star::sheet;
-
- // Name this built-in database.
- OUStringBuffer sDataAreaNameBuf( CREATE_OUSTRING("Excel_BuiltIn__FilterDatabase_ ") );
- sDataAreaNameBuf.append( static_cast<sal_Int32>(getSheetIndex()+1) );
-
- OUString sDataAreaName = sDataAreaNameBuf.makeStringAndClear();
- Reference< XCellRange > xCellRange = getCellRange( maAutoFilterRange );
-
- // Create a new database range, add filters to it and refresh the database
- // for that to take effect.
-
- Reference< XDatabaseRanges > xDBRanges = getDatabaseRanges();
- if ( !xDBRanges.is() )
+ if( getCurrentElement() == BIFF12_ID_FILTERCOLUMN ) switch( nRecId )
{
- OSL_ENSURE( false, "OoxAutoFilterContext::setAutoFilter: DBRange empty" );
- return;
+ case BIFF12_ID_DISCRETEFILTERS:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() );
+ case BIFF12_ID_TOP10FILTER:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() );
+ case BIFF12_ID_CUSTOMFILTERS:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() );
}
-
- Reference< XNameAccess > xNA( xDBRanges, UNO_QUERY_THROW );
- if ( !xNA->hasByName( sDataAreaName ) )
- xDBRanges->addNewByName( sDataAreaName, maAutoFilterRange );
-
- Reference< XDatabaseRange > xDB( xNA->getByName( sDataAreaName ), UNO_QUERY );
- if ( xDB.is() )
- {
- PropertySet aProp( xDB );
- aProp.setProperty( PROP_AutoFilter, true );
- }
-
- sal_Int32 nSize = maFields.size();
- sal_Int32 nMaxFieldCount = nSize;
- Reference< XSheetFilterDescriptor > xDescriptor = xDB->getFilterDescriptor();
- if ( xDescriptor.is() )
- {
- PropertySet aProp( xDescriptor );
- aProp.setProperty( PROP_ContainsHeader, true );
- aProp.setProperty( PROP_UseRegularExpressions, mbUseRegex );
- aProp.getProperty( nMaxFieldCount, PROP_MaxFieldCount );
- }
- else
- {
- OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: descriptor is empty");
- return;
- }
-
- // Unpack all column field items into a sequence.
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- Reference< XExtendedSheetFilterDescriptor > xExtDescriptor( xDescriptor, UNO_QUERY );
- if ( !xExtDescriptor.is() )
- {
- OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: extended descriptor is empty");
- return;
- }
-
- xExtDescriptor->begin();
-
- ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end();
- for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i)
- {
-#if DEBUG_OOX_AUTOFILTER
- lclPrintFilterField(*itr);
-#endif
- switch ( itr->meType )
- {
- case oox::xls::FilterFieldItem::MULTI_STRING:
- {
- // multi-string filter type
- TableFilterFieldMultiString* pField = static_cast<TableFilterFieldMultiString*>( itr->mpField.get() );
- xExtDescriptor->addFilterFieldMultiString( *pField );
- }
- break;
- case oox::xls::FilterFieldItem::NORMAL:
- default:
- // normal filter type
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>( itr->mpField.get() );
- xExtDescriptor->addFilterFieldNormal( *pField );
- }
- }
- xExtDescriptor->commit();
-
-#else
- Sequence< TableFilterField > aFields(nSize);
- ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end();
- for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i)
- {
-#if DEBUG_OOX_AUTOFILTER
- lclPrintFilterField( *itr );
-#endif
- aFields[i] = *itr->mpField;
- }
- xDescriptor->setFilterFields( aFields );
-#endif
- xDB->refresh();
+ return 0;
}
-void OoxAutoFilterContext::maybeShowBlank()
+void FilterColumnContext::onStartRecord( SequenceInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- if ( !mbShowBlank )
- return;
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- FilterFieldItem aItem(FilterFieldItem::NORMAL);
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
- pField->Field = mnCurColID;
- pField->Operator = FilterOperator_EMPTY;
- pField->Connection = FilterConnection_AND;
- pField->IsNumeric = false;
-#else
- FilterFieldItem aItem;
- aItem.mpField->Field = mnCurColID;
- aItem.mpField->Operator = FilterOperator_EMPTY;
- aItem.mpField->Connection = FilterConnection_AND;
- aItem.mpField->IsNumeric = false;
-#endif
- maFields.push_back(aItem);
+ mrFilterColumn.importFilterColumn( rStrm );
}
-void OoxAutoFilterContext::setFilterNames()
-{
- using namespace ::com::sun::star::sheet;
-
-
- sal_Int32 size = maFilterNames.size();
- if ( !size )
- return;
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- Sequence< OUString > aStrList(size);
- ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end();
- for (sal_Int32 i = 0; itr != itrEnd; ++itr, ++i)
- aStrList[i] = *itr;
-
- FilterFieldItem aItem(FilterFieldItem::MULTI_STRING);
- TableFilterFieldMultiString* pField = static_cast<TableFilterFieldMultiString*>( aItem.mpField.get() );
- pField->Field = mnCurColID;
- pField->Connection = FilterConnection_AND;
- pField->StringSet = aStrList;
-
- maFields.push_back(aItem);
-#else
- static const OUString sSep = CREATE_OUSTRING("|");
-
- OUStringBuffer buf;
- if ( size > 1 )
- {
- buf.append( CREATE_OUSTRING("^(") );
- mbUseRegex = true;
- }
-
- ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end();
- bool bFirst = true;
- for (; itr != itrEnd; ++itr)
- {
- if (bFirst)
- bFirst = false;
- else
- buf.append( sSep );
- buf.append( *itr );
- }
- if ( size > 1 )
- buf.append( CREATE_OUSTRING(")$") );
-
- FilterFieldItem aItem;
- aItem.mpField->Field = mnCurColID;
- aItem.mpField->StringValue = buf.makeStringAndClear();
- aItem.mpField->Operator = FilterOperator_EQUAL;
- aItem.mpField->Connection = FilterConnection_AND;
- aItem.mpField->IsNumeric = false;
- maFields.push_back(aItem);
-#endif
-}
+// ============================================================================
-void OoxAutoFilterContext::importAutoFilter( const AttributeList& rAttribs )
+AutoFilterContext::AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter ) :
+ WorksheetContextBase( rFragment ),
+ mrAutoFilter( rAutoFilter )
{
- initialize();
-
- mbValidAddress = getAddressConverter().convertToCellRange(
- maAutoFilterRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true );
}
-void OoxAutoFilterContext::importFilterColumn( const AttributeList& rAttribs )
+ContextHandlerRef AutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- // hiddenButton and showButton attributes are not used for now.
- mnCurColID = rAttribs.getInteger( XML_colId, -1 );
+ if( (getCurrentElement() == XLS_TOKEN( autoFilter )) && (nElement == XLS_TOKEN( filterColumn )) )
+ return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() );
+ return 0;
}
-void OoxAutoFilterContext::importTop10( const AttributeList& rAttribs )
+void AutoFilterContext::onStartElement( const AttributeList& rAttribs )
{
- using namespace ::com::sun::star::sheet;
-
- // filterVal attribute is not necessarily, since Calc also supports top 10
- // and top 10% filter type.
- FilterFieldItem aItem;
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
-#else
- TableFilterField* pField = aItem.mpField.get();
-#endif
- pField->Field = mnCurColID;
-
- bool bPercent = rAttribs.getBool( XML_percent, false );
- bool bTop = rAttribs.getBool( XML_top, true );
- pField->NumericValue = rAttribs.getDouble( XML_val, 0.0 );
- pField->IsNumeric = true;
-
- // When top10 filter item is present, that's the only filter item for that column.
- if ( bTop )
- if ( bPercent )
- pField->Operator = FilterOperator_TOP_PERCENT;
- else
- pField->Operator = FilterOperator_TOP_VALUES;
- else
- if ( bPercent )
- pField->Operator = FilterOperator_BOTTOM_PERCENT;
- else
- pField->Operator = FilterOperator_BOTTOM_VALUES;
-
- maFields.push_back(aItem);
+ mrAutoFilter.importAutoFilter( rAttribs, getSheetIndex() );
}
-void OoxAutoFilterContext::importCustomFilters( const AttributeList& rAttribs )
+ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
- // OR is default when the 'and' attribute is absent.
- mbConnectionAnd = rAttribs.getBool( XML_and, false );
+ if( (getCurrentElement() == BIFF12_ID_AUTOFILTER) && (nRecId == BIFF12_ID_FILTERCOLUMN) )
+ return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() );
+ return 0;
}
-/** Do a best-effort guess of whether or not the given string is numerical. */
-static bool lclIsNumeric( const OUString& _str, const LocaleDataItem& aLocaleItem )
+void AutoFilterContext::onStartRecord( SequenceInputStream& rStrm )
{
- OUString str = _str.trim();
- sal_Int32 size = str.getLength();
-
- if ( !size )
- // Empty string. This can't be a number.
- return false;
-
- // Get the decimal separator for the current locale.
- const OUString& sep = aLocaleItem.decimalSeparator;
-
- bool bDecimalSep = false;
- for (sal_Int32 i = 0; i < size; ++i)
- {
- OUString c = str.copy(i, 1);
- if ( !c.compareTo(sep) )
- {
- if ( bDecimalSep )
- return false;
- else
- {
- bDecimalSep = true;
- continue;
- }
- }
- if ( (0 > c.compareToAscii("0") || 0 < c.compareToAscii("9")) )
- return false;
- }
-
- return true;
+ mrAutoFilter.importAutoFilter( rStrm, getSheetIndex() );
}
-/** Convert wildcard characters to regex equivalent. Returns true if any
- wildcard character is found. */
-static bool lclWildcard2Regex( OUString& str )
-{
- bool bWCFound = false;
- OUStringBuffer buf;
- sal_Int32 size = str.getLength();
- buf.ensureCapacity(size + 6); // pure heuristics.
-
- sal_Unicode dot = '.', star = '*', hat = '^', dollar = '$';
- buf.append(hat);
- for (sal_Int32 i = 0; i < size; ++i)
- {
- OUString c = str.copy(i, 1);
- if ( !c.compareToAscii("?") )
- {
- buf.append(dot);
- bWCFound = true;
- }
- else if ( !c.compareToAscii("*") )
- {
- buf.append(dot);
- buf.append(star);
- bWCFound = true;
- }
- else
- buf.append(c);
- }
- buf.append(dollar);
-
- if (bWCFound)
- str = buf.makeStringAndClear();
-
- return bWCFound;
-}
+// ============================================================================
-/** Translate Excel's filter operator to Calc's. */
-static ::com::sun::star::sheet::FilterOperator lclTranslateFilterOp( sal_Int32 nToken )
+BiffAutoFilterContext::BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrAutoFilter( rAutoFilter )
{
- using namespace ::com::sun::star::sheet;
-
- switch ( nToken )
- {
- case XML_equal:
- return FilterOperator_EQUAL;
- case XML_notEqual:
- return FilterOperator_NOT_EQUAL;
- case XML_greaterThan:
- return FilterOperator_GREATER;
- case XML_greaterThanOrEqual:
- return FilterOperator_GREATER_EQUAL;
- case XML_lessThan:
- return FilterOperator_LESS;
- case XML_lessThanOrEqual:
- return FilterOperator_LESS_EQUAL;
- }
- return FilterOperator_EQUAL;
}
-void OoxAutoFilterContext::importCustomFilter( const AttributeList& rAttribs )
+void BiffAutoFilterContext::importRecord( BiffInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- sal_Int32 nToken = rAttribs.getToken( XML_operator, XML_equal );
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- FilterFieldItem aItem(FilterFieldItem::NORMAL);
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
-#else
- FilterFieldItem aItem;
- TableFilterField* pField = aItem.mpField.get();
-#endif
- pField->Field = mnCurColID;
- pField->StringValue = rAttribs.getString( XML_val, OUString() );
- pField->NumericValue = pField->StringValue.toDouble();
- pField->Operator = lclTranslateFilterOp( nToken );
-
- if ( nToken == XML_notEqual && !pField->StringValue.compareToAscii(" ") )
+ switch( rStrm.getRecId() )
{
- // Special case for hiding blanks. Excel translates "hide blanks" to
- // (filter if notEqual " "). So, we need to translate it back.
- pField->Operator = FilterOperator_NOT_EMPTY;
- pField->IsNumeric = false;
- maFields.push_back(aItem);
- return;
+ // nothing to read for BIFF_ID_AUTOFILTER
+ case BIFF_ID_FILTERCOLUMN: mrAutoFilter.createFilterColumn().importFilterColumn( rStrm ); break;
}
-
- switch ( nToken )
- {
- case XML_equal:
- case XML_notEqual:
- {
- Reference< XLocaleData > xLocale( getGlobalFactory()->createInstance(
- CREATE_OUSTRING("com.sun.star.i18n.LocaleData") ), UNO_QUERY );
-
- if ( !xLocale.is() )
- return;
-
- LocaleDataItem aLocaleItem = xLocale->getLocaleItem( ::com::sun::star::lang::Locale() );
- pField->IsNumeric = lclIsNumeric(pField->StringValue, aLocaleItem);
-
- if ( !pField->IsNumeric && lclWildcard2Regex(pField->StringValue) )
- mbUseRegex = true;
-
- maFields.push_back(aItem);
- }
- break;
-
- case XML_greaterThan:
- case XML_greaterThanOrEqual:
- case XML_lessThan:
- case XML_lessThanOrEqual:
- {
- pField->IsNumeric = true;
- maFields.push_back(aItem);
- }
- break;
- default:
- OSL_ENSURE( false, "OoxAutoFilterContext::importCustomFilter: unhandled case" );
- }
-}
-
-void OoxAutoFilterContext::importFilters( const AttributeList& rAttribs )
-{
- // blank (boolean) and calendarType attributes can be present, but not used for now.
-
- mbShowBlank = rAttribs.getBool( XML_blank, false );
- maFilterNames.clear();
-}
-
-void OoxAutoFilterContext::importFilter( const AttributeList& rAttribs )
-{
- if (mnCurColID == -1)
- return;
-
- OUString value = rAttribs.getString( XML_val, OUString() );
- if ( value.getLength() )
- maFilterNames.push_back(value);
-}
-
-void OoxAutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*/ )
-{
- // not implemented yet - Calc doesn't support this.
}
// ============================================================================
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx
index 0872dcc654df..cb4829973fcc 100644
--- a/oox/source/xls/biffcodec.cxx
+++ b/oox/source/xls/biffcodec.cxx
@@ -26,20 +26,24 @@
************************************************************************/
#include "oox/xls/biffcodec.hxx"
+
#include <osl/thread.h>
#include <string.h>
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OStringToOUString;
-using ::oox::core::FilterBase;
-
-using namespace ::com::sun::star;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -52,14 +56,14 @@ BiffDecoderBase::~BiffDecoderBase()
{
}
-::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData )
{
o_rEncryptionData = implVerifyPassword( rPassword );
- mbValid = ( o_rEncryptionData.getLength() > 0 );
+ mbValid = o_rEncryptionData.hasElements();
return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
-::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
{
mbValid = implVerifyEncryptionData( rEncryptionData );
return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
@@ -101,7 +105,7 @@ BiffDecoder_XOR* BiffDecoder_XOR::implClone()
return new BiffDecoder_XOR( *this );
}
-uno::Sequence< beans::NamedValue > BiffDecoder_XOR::implVerifyPassword( const ::rtl::OUString& rPassword )
+Sequence< NamedValue > BiffDecoder_XOR::implVerifyPassword( const OUString& rPassword )
{
maEncryptionData.realloc( 0 );
@@ -112,29 +116,29 @@ uno::Sequence< beans::NamedValue > BiffDecoder_XOR::implVerifyPassword( const ::
if( (0 < nLen) && (nLen < 16) )
{
// init codec
- maCodec.initKey( (sal_uInt8*)aBytePassword.getStr() );
+ maCodec.initKey( reinterpret_cast< const sal_uInt8* >( aBytePassword.getStr() ) );
- if ( maCodec.verifyKey( mnKey, mnHash ) )
+ if( maCodec.verifyKey( mnKey, mnHash ) )
maEncryptionData = maCodec.getEncryptionData();
}
return maEncryptionData;
}
-bool BiffDecoder_XOR::implVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+bool BiffDecoder_XOR::implVerifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
{
maEncryptionData.realloc( 0 );
- if( rEncryptionData.getLength() )
+ if( rEncryptionData.hasElements() )
{
// init codec
maCodec.initCodec( rEncryptionData );
- if ( maCodec.verifyKey( mnKey, mnHash ) )
+ if( maCodec.verifyKey( mnKey, mnHash ) )
maEncryptionData = rEncryptionData;
}
- return maEncryptionData.getLength();
+ return maEncryptionData.hasElements();
}
void BiffDecoder_XOR::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
@@ -187,7 +191,7 @@ BiffDecoder_RCF* BiffDecoder_RCF::implClone()
return new BiffDecoder_RCF( *this );
}
-uno::Sequence< beans::NamedValue > BiffDecoder_RCF::implVerifyPassword( const ::rtl::OUString& rPassword )
+Sequence< NamedValue > BiffDecoder_RCF::implVerifyPassword( const OUString& rPassword )
{
maEncryptionData.realloc( 0 );
@@ -204,31 +208,29 @@ uno::Sequence< beans::NamedValue > BiffDecoder_RCF::implVerifyPassword( const ::
// init codec
maCodec.initKey( &aPassVect.front(), &maSalt.front() );
- if ( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
maEncryptionData = maCodec.getEncryptionData();
}
return maEncryptionData;
}
-bool BiffDecoder_RCF::implVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+bool BiffDecoder_RCF::implVerifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
{
maEncryptionData.realloc( 0 );
- if( rEncryptionData.getLength() )
+ if( rEncryptionData.hasElements() )
{
// init codec
maCodec.initCodec( rEncryptionData );
- if ( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
maEncryptionData = rEncryptionData;
}
- return maEncryptionData.getLength();
+ return maEncryptionData.hasElements();
}
-
-
void BiffDecoder_RCF::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
{
sal_uInt8* pnCurrDest = pnDestData;
@@ -375,4 +377,3 @@ void BiffCodecHelper::cloneDecoder( BiffInputStream& rStrm )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/biffdetector.cxx b/oox/source/xls/biffdetector.cxx
index fc3e1e710bcb..038d7d732425 100644
--- a/oox/source/xls/biffdetector.cxx
+++ b/oox/source/xls/biffdetector.cxx
@@ -26,31 +26,31 @@
************************************************************************/
#include "oox/xls/biffdetector.hxx"
+
#include <algorithm>
-#include <rtl/strbuf.hxx>
#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/mediadescriptor.hxx>
+#include <rtl/strbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::rtl::OStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::comphelper::MediaDescriptor;
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
+
+// ============================================================================
+
Sequence< OUString > BiffDetector_getSupportedServiceNames()
{
Sequence< OUString > aServiceNames( 1 );
@@ -60,18 +60,18 @@ Sequence< OUString > BiffDetector_getSupportedServiceNames()
OUString BiffDetector_getImplementationName()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.BiffDetector" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.BiffDetector" );
}
-Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XMultiServiceFactory >& rxFactory ) throw( Exception )
+Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxContext ) );
}
// ============================================================================
-BiffDetector::BiffDetector( const Reference< XMultiServiceFactory >& rxFactory ) :
- mxFactory( rxFactory )
+BiffDetector::BiffDetector( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxContext( rxContext, UNO_SET_THROW )
{
}
@@ -79,7 +79,7 @@ BiffDetector::~BiffDetector()
{
}
-BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
+/*static*/ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
{
BiffType eBiff = BIFF_UNKNOWN;
if( !rInStream.isEof() && rInStream.isSeekable() && (rInStream.getLength() > 4) )
@@ -132,36 +132,36 @@ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
return eBiff;
}
-BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, StorageRef xStorage )
+/*static*/ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, const StorageRef& rxStorage )
{
static const OUString saBookName = CREATE_OUSTRING( "Book" );
static const OUString saWorkbookName = CREATE_OUSTRING( "Workbook" );
BiffType eBiff = BIFF_UNKNOWN;
- if( xStorage.get() )
+ if( rxStorage.get() )
{
- if( xStorage->isStorage() )
+ if( rxStorage->isStorage() )
{
// try to open the "Book" stream
- BinaryXInputStream aBookStrm5( xStorage->openInputStream( saBookName ), true );
+ BinaryXInputStream aBookStrm5( rxStorage->openInputStream( saBookName ), true );
BiffType eBookStrm5Biff = detectStreamBiffVersion( aBookStrm5 );
// try to open the "Workbook" stream
- BinaryXInputStream aBookStrm8( xStorage->openInputStream( saWorkbookName ), true );
+ BinaryXInputStream aBookStrm8( rxStorage->openInputStream( saWorkbookName ), true );
BiffType eBookStrm8Biff = detectStreamBiffVersion( aBookStrm8 );
// decide which stream to use
if( (eBookStrm8Biff != BIFF_UNKNOWN) && ((eBookStrm5Biff == BIFF_UNKNOWN) || (eBookStrm8Biff > eBookStrm5Biff)) )
{
- /* Only "Workbook" stream exists; or both streams exist,
- and "Workbook" has higher BIFF version than "Book" stream. */
+ /* Only "Workbook" stream exists; or both streams exist, and
+ "Workbook" has higher BIFF version than "Book" stream. */
eBiff = eBookStrm8Biff;
orWorkbookStreamName = saWorkbookName;
}
else if( eBookStrm5Biff != BIFF_UNKNOWN )
{
- /* Only "Book" stream exists; or both streams exist,
- and "Book" has higher BIFF version than "Workbook" stream. */
+ /* Only "Book" stream exists; or both streams exist, and
+ "Book" has higher BIFF version than "Workbook" stream. */
eBiff = eBookStrm5Biff;
orWorkbookStreamName = saBookName;
}
@@ -169,7 +169,7 @@ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName,
else
{
// no storage, try plain input stream from medium (even for BIFF5+)
- BinaryXInputStream aStrm( xStorage->openInputStream( OUString() ), false );
+ BinaryXInputStream aStrm( rxStorage->openInputStream( OUString() ), false );
eBiff = detectStreamBiffVersion( aStrm );
orWorkbookStreamName = OUString();
}
@@ -187,7 +187,7 @@ OUString SAL_CALL BiffDetector::getImplementationName() throw( RuntimeException
sal_Bool SAL_CALL BiffDetector::supportsService( const OUString& rService ) throw( RuntimeException )
{
- const Sequence< OUString > aServices( BiffDetector_getSupportedServiceNames() );
+ const Sequence< OUString > aServices = BiffDetector_getSupportedServiceNames();
const OUString* pArray = aServices.getConstArray();
const OUString* pArrayEnd = pArray + aServices.getLength();
return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd;
@@ -207,20 +207,19 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor )
MediaDescriptor aDescriptor( rDescriptor );
aDescriptor.addInputStream();
- Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY );
- if( xInStrm.is() )
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY_THROW );
+ StorageRef xStorage( new ::oox::ole::OleStorage( xFactory, xInStrm, true ) );
+
+ OUString aWorkbookName;
+ switch( detectStorageBiffVersion( aWorkbookName, xStorage ) )
{
- OUString aWorkbookName;
- StorageRef xStorage( new ::oox::ole::OleStorage( mxFactory, xInStrm, true ) );
- switch( detectStorageBiffVersion( aWorkbookName, xStorage ) )
- {
- case BIFF2:
- case BIFF3:
- case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break;
- case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break;
- case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break;
- default:;
- }
+ case BIFF2:
+ case BIFF3:
+ case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break;
+ case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break;
+ case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break;
+ default:;
}
return aTypeName;
@@ -230,4 +229,3 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx
index afd7e04e6a08..55839043865e 100644
--- a/oox/source/xls/biffhelper.cxx
+++ b/oox/source/xls/biffhelper.cxx
@@ -26,20 +26,23 @@
************************************************************************/
#include "oox/xls/biffhelper.hxx"
+
#include <rtl/math.hxx>
#include <rtl/tencinfo.h>
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffoutputstream.hxx"
#include "oox/xls/worksheethelper.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
namespace oox {
namespace xls {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_Int32 BIFF_RK_100FLAG = 0x00000001;
@@ -186,6 +189,8 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
// ============================================================================
+// conversion -----------------------------------------------------------------
+
/*static*/ double BiffHelper::calcDoubleFromRk( sal_Int32 nRkValue )
{
DecodedDouble aDecDbl( 0.0 );
@@ -262,6 +267,53 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage );
}
+// BIFF12 import --------------------------------------------------------------
+
+/*static*/ OUString BiffHelper::readString( SequenceInputStream& rStrm, bool b32BitLen )
+{
+ OUString aString;
+ if( !rStrm.isEof() )
+ {
+ sal_Int32 nCharCount = b32BitLen ? rStrm.readValue< sal_Int32 >() : rStrm.readValue< sal_Int16 >();
+ // string length -1 is often used to indicate a missing string
+ OSL_ENSURE( !rStrm.isEof() && (nCharCount >= -1), "BiffHelper::readString - invalid string length" );
+ if( !rStrm.isEof() && (nCharCount > 0) )
+ {
+ ::std::vector< sal_Unicode > aBuffer;
+ aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) );
+ for( sal_Int32 nCharIdx = 0; !rStrm.isEof() && (nCharIdx < nCharCount); ++nCharIdx )
+ {
+ sal_uInt16 nChar;
+ rStrm.readValue( nChar );
+ aBuffer.push_back( static_cast< sal_Unicode >( nChar ) );
+ }
+ aBuffer.push_back( 0 );
+ aString = OUString( &aBuffer.front() );
+ }
+ }
+ return aString;
+}
+
+// BIFF2-BIFF8 import ---------------------------------------------------------
+
+/*static*/ bool BiffHelper::isBofRecord( BiffInputStream& rStrm )
+{
+ return
+ (rStrm.getRecId() == BIFF2_ID_BOF) ||
+ (rStrm.getRecId() == BIFF3_ID_BOF) ||
+ (rStrm.getRecId() == BIFF4_ID_BOF) ||
+ (rStrm.getRecId() == BIFF5_ID_BOF);
+}
+
+/*static*/ bool BiffHelper::skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId )
+{
+ sal_uInt16 nStartRecId = rStrm.getRecId();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != nEndRecId) )
+ if( rStrm.getRecId() == nStartRecId )
+ skipRecordBlock( rStrm, nEndRecId );
+ return !rStrm.isEof() && (rStrm.getRecId() == nEndRecId);
+}
+
/*static*/ void BiffHelper::importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff )
{
sal_uInt16 nFormat, nEnv;
@@ -284,4 +336,3 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/biffinputstream.cxx b/oox/source/xls/biffinputstream.cxx
index fec36d4fa54d..6dfa8f755c25 100644
--- a/oox/source/xls/biffinputstream.cxx
+++ b/oox/source/xls/biffinputstream.cxx
@@ -26,17 +26,20 @@
************************************************************************/
#include "oox/xls/biffinputstream.hxx"
+
#include <algorithm>
#include <rtl/ustrbuf.hxx>
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
using ::rtl::OString;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-namespace oox {
-namespace xls {
-
// ============================================================================
namespace prv {
@@ -628,4 +631,3 @@ BiffInputStreamPosGuard::~BiffInputStreamPosGuard()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/biffoutputstream.cxx b/oox/source/xls/biffoutputstream.cxx
index 5ec8834c5336..ba59f50bea4d 100644
--- a/oox/source/xls/biffoutputstream.cxx
+++ b/oox/source/xls/biffoutputstream.cxx
@@ -205,4 +205,3 @@ sal_uInt16 BiffOutputStream::prepareRawBlock( sal_Int32 nTotalSize )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx
index 287518584cc3..c67768ef2f22 100644
--- a/oox/source/xls/chartsheetfragment.cxx
+++ b/oox/source/xls/chartsheetfragment.cxx
@@ -26,32 +26,32 @@
************************************************************************/
#include "oox/xls/chartsheetfragment.hxx"
+
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pagesettings.hxx"
#include "oox/xls/viewsettings.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxChartsheetFragment::OoxChartsheetFragment( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+ChartsheetFragment::ChartsheetFragment( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -86,14 +86,14 @@ ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, co
case XLS_TOKEN( oddHeader ):
case XLS_TOKEN( oddFooter ):
case XLS_TOKEN( evenHeader ):
- case XLS_TOKEN( evenFooter ): return this; // collect contents in onEndElement()
+ case XLS_TOKEN( evenFooter ): return this; // collect contents in onCharacters()
}
break;
}
return 0;
}
-void OoxChartsheetFragment::onEndElement( const OUString& rChars )
+void ChartsheetFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -108,60 +108,58 @@ void OoxChartsheetFragment::onEndElement( const OUString& rChars )
}
}
-ContextHandlerRef OoxChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+ if( nRecId == BIFF12_ID_WORKSHEET ) return this;
break;
- case OOBIN_ID_WORKSHEET:
+ case BIFF12_ID_WORKSHEET:
switch( nRecId )
{
- case OOBIN_ID_CHARTSHEETVIEWS: return this;
-
- case OOBIN_ID_CHARTSHEETPR: getWorksheetSettings().importChartSheetPr( rStrm ); break;
- case OOBIN_ID_CHARTPROTECTION: getWorksheetSettings().importChartProtection( rStrm ); break;
- case OOBIN_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
- case OOBIN_ID_CHARTPAGESETUP: getPageSettings().importChartPageSetup( getRelations(), rStrm ); break;
- case OOBIN_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
- case OOBIN_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
- case OOBIN_ID_DRAWING: importDrawing( rStrm ); break;
+ case BIFF12_ID_CHARTSHEETVIEWS: return this;
+
+ case BIFF12_ID_CHARTSHEETPR: getWorksheetSettings().importChartSheetPr( rStrm ); break;
+ case BIFF12_ID_CHARTPROTECTION: getWorksheetSettings().importChartProtection( rStrm ); break;
+ case BIFF12_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
+ case BIFF12_ID_CHARTPAGESETUP: getPageSettings().importChartPageSetup( getRelations(), rStrm ); break;
+ case BIFF12_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
+ case BIFF12_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
+ case BIFF12_ID_DRAWING: importDrawing( rStrm ); break;
}
break;
- case OOBIN_ID_CHARTSHEETVIEWS:
- if( nRecId == OOBIN_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
+ case BIFF12_ID_CHARTSHEETVIEWS:
+ if( nRecId == BIFF12_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxChartsheetFragment::getRecordInfos() const
+const RecordInfo* ChartsheetFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_CHARTSHEETVIEW, OOBIN_ID_CHARTSHEETVIEW + 1 },
- { OOBIN_ID_CHARTSHEETVIEWS, OOBIN_ID_CHARTSHEETVIEWS + 1 },
- { OOBIN_ID_CUSTOMCHARTVIEW, OOBIN_ID_CUSTOMCHARTVIEW + 1 },
- { OOBIN_ID_CUSTOMCHARTVIEWS, OOBIN_ID_CUSTOMCHARTVIEWS + 1 },
- { OOBIN_ID_HEADERFOOTER, OOBIN_ID_HEADERFOOTER + 1 },
- { OOBIN_ID_WORKSHEET, OOBIN_ID_WORKSHEET + 1 },
+ { BIFF12_ID_CHARTSHEETVIEW, BIFF12_ID_CHARTSHEETVIEW + 1 },
+ { BIFF12_ID_CHARTSHEETVIEWS, BIFF12_ID_CHARTSHEETVIEWS + 1 },
+ { BIFF12_ID_CUSTOMCHARTVIEW, BIFF12_ID_CUSTOMCHARTVIEW + 1 },
+ { BIFF12_ID_CUSTOMCHARTVIEWS, BIFF12_ID_CUSTOMCHARTVIEWS + 1 },
+ { BIFF12_ID_HEADERFOOTER, BIFF12_ID_HEADERFOOTER + 1 },
+ { BIFF12_ID_WORKSHEET, BIFF12_ID_WORKSHEET + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxChartsheetFragment::initializeImport()
+void ChartsheetFragment::initializeImport()
{
// initial processing in base class WorksheetHelper
initializeWorksheetImport();
}
-void OoxChartsheetFragment::finalizeImport()
+void ChartsheetFragment::finalizeImport()
{
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
@@ -169,21 +167,21 @@ void OoxChartsheetFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxChartsheetFragment::importDrawing( const AttributeList& rAttribs )
+void ChartsheetFragment::importDrawing( const AttributeList& rAttribs )
{
setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxChartsheetFragment::importDrawing( RecordInputStream& rStrm )
+void ChartsheetFragment::importDrawing( SequenceInputStream& rStrm )
{
- setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
// ============================================================================
BiffChartsheetFragment::BiffChartsheetFragment( const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+ const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
{
}
@@ -197,80 +195,82 @@ bool BiffChartsheetFragment::importFragment()
PageSettings& rPageSett = getPageSettings();
// process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// skip unknown embedded fragments (BOF/EOF blocks)
skipFragment();
}
else
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( mrStrm ); break;
- case BIFF_ID_CHBEGIN: skipRecordBlock( BIFF_ID_CHEND ); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( mrStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( mrStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( mrStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( mrStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( mrStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( mrStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( mrStrm ); break;
+ case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
+ case BIFF_ID_CHBEGIN: BiffHelper::skipRecordBlock( rStrm, BIFF_ID_CHEND ); break;
+ case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
+ case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
+ case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
+ case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
+ case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
+ case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
+ case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( mrStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
@@ -282,11 +282,10 @@ bool BiffChartsheetFragment::importFragment()
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// ============================================================================
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx
index 190309649789..78d5fe044fe8 100644
--- a/oox/source/xls/commentsbuffer.cxx
+++ b/oox/source/xls/commentsbuffer.cxx
@@ -26,34 +26,30 @@
************************************************************************/
#include "oox/xls/commentsbuffer.hxx"
+
#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
#include <com/sun/star/sheet/XSheetAnnotations.hpp>
#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/drawingfragment.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XSheetAnnotation;
-using ::com::sun::star::sheet::XSheetAnnotationAnchor;
-using ::com::sun::star::sheet::XSheetAnnotationShapeSupplier;
-using ::com::sun::star::sheet::XSheetAnnotations;
-using ::com::sun::star::sheet::XSheetAnnotationsSupplier;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
CommentModel::CommentModel() :
mnAuthorId( -1 )
{
@@ -73,7 +69,7 @@ void Comment::importComment( const AttributeList& rAttribs )
getAddressConverter().convertToCellRangeUnchecked( maModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() );
}
-void Comment::importComment( RecordInputStream& rStrm )
+void Comment::importComment( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> maModel.mnAuthorId >> aBinRange;
@@ -89,7 +85,7 @@ RichStringRef Comment::createText()
void Comment::finalizeImport()
{
- // OOBIN format stores cell range instead of cell address, use first cell of this range
+ // BIFF12 stores cell range instead of cell address, use first cell of this range
OSL_ENSURE( (maModel.maRange.StartColumn == maModel.maRange.EndColumn) &&
(maModel.maRange.StartRow == maModel.maRange.EndRow),
"Comment::finalizeImport - comment anchor should be a single cell" );
@@ -115,9 +111,8 @@ void Comment::finalizeImport()
// position and formatting
pNoteShape->convertFormatting( xAnnoShape );
// visibility
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = pNoteShape->getShapeModel().mxClientData;
- bool bVisible = rxClientData.get() && rxClientData->mbVisible;
- xAnno->setIsVisible( bVisible );
+ const ::oox::vml::ClientData* pClientData = pNoteShape->getClientData();
+ xAnno->setIsVisible( pClientData && pClientData->mbVisible );
}
}
}
@@ -154,4 +149,3 @@ void CommentsBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx
index c87d3028b7cb..b37860c4553e 100644
--- a/oox/source/xls/commentsfragment.cxx
+++ b/oox/source/xls/commentsfragment.cxx
@@ -26,25 +26,26 @@
************************************************************************/
#include "oox/xls/commentsfragment.hxx"
-#include "oox/xls/richstringcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxCommentsFragment::OoxCommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+CommentsFragment::CommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef CommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -56,91 +57,84 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons
if( nElement == XLS_TOKEN( commentList ) ) return this;
break;
case XLS_TOKEN( authors ):
- if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onEndElement()
+ if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onCharacters()
break;
case XLS_TOKEN( commentList ):
if( nElement == XLS_TOKEN( comment ) ) { importComment( rAttribs ); return this; }
break;
case XLS_TOKEN( comment ):
if( (nElement == XLS_TOKEN( text )) && mxComment.get() )
- return new OoxRichStringContext( *this, mxComment->createText() );
+ return new RichStringContext( *this, mxComment->createText() );
break;
}
return 0;
}
-void OoxCommentsFragment::onEndElement( const OUString& rChars )
+void CommentsFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( author ):
- getComments().appendAuthor( rChars );
- break;
- case XLS_TOKEN( comment ):
- mxComment.reset();
- break;
- }
+ if( isCurrentElement( XLS_TOKEN( author ) ) )
+ getComments().appendAuthor( rChars );
+}
+
+void CommentsFragment::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( comment ) ) )
+ mxComment.reset();
}
-ContextHandlerRef OoxCommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_COMMENTS ) return this;
+ if( nRecId == BIFF12_ID_COMMENTS ) return this;
break;
- case OOBIN_ID_COMMENTS:
- if( nRecId == OOBIN_ID_COMMENTAUTHORS ) return this;
- if( nRecId == OOBIN_ID_COMMENTLIST ) return this;
+ case BIFF12_ID_COMMENTS:
+ if( nRecId == BIFF12_ID_COMMENTAUTHORS ) return this;
+ if( nRecId == BIFF12_ID_COMMENTLIST ) return this;
break;
- case OOBIN_ID_COMMENTAUTHORS:
- if( nRecId == OOBIN_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() );
+ case BIFF12_ID_COMMENTAUTHORS:
+ if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( BiffHelper::readString( rStrm ) );
break;
- case OOBIN_ID_COMMENTLIST:
- if( nRecId == OOBIN_ID_COMMENT ) { importComment( rStrm ); return this; }
+ case BIFF12_ID_COMMENTLIST:
+ if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; }
break;
- case OOBIN_ID_COMMENT:
- if( (nRecId == OOBIN_ID_COMMENTTEXT) && mxComment.get() )
+ case BIFF12_ID_COMMENT:
+ if( (nRecId == BIFF12_ID_COMMENTTEXT) && mxComment.get() )
mxComment->createText()->importString( rStrm, true );
break;
}
return 0;
}
-void OoxCommentsFragment::onEndRecord()
+void CommentsFragment::onEndRecord()
{
- switch( getCurrentElement() )
- {
- case OOBIN_ID_COMMENT:
- mxComment.reset();
- break;
- }
+ if( isCurrentElement( BIFF12_ID_COMMENT ) )
+ mxComment.reset();
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxCommentsFragment::getRecordInfos() const
+const RecordInfo* CommentsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_COMMENT, OOBIN_ID_COMMENT + 1 },
- { OOBIN_ID_COMMENTAUTHORS, OOBIN_ID_COMMENTAUTHORS + 1 },
- { OOBIN_ID_COMMENTLIST, OOBIN_ID_COMMENTLIST + 1 },
- { OOBIN_ID_COMMENTS, OOBIN_ID_COMMENTS + 1 },
- { -1, -1 }
+ { BIFF12_ID_COMMENT, BIFF12_ID_COMMENT + 1 },
+ { BIFF12_ID_COMMENTAUTHORS, BIFF12_ID_COMMENTAUTHORS + 1 },
+ { BIFF12_ID_COMMENTLIST, BIFF12_ID_COMMENTLIST + 1 },
+ { BIFF12_ID_COMMENTS, BIFF12_ID_COMMENTS + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
// private --------------------------------------------------------------------
-void OoxCommentsFragment::importComment( const AttributeList& rAttribs )
+void CommentsFragment::importComment( const AttributeList& rAttribs )
{
mxComment = getComments().createComment();
mxComment->importComment( rAttribs );
}
-void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
+void CommentsFragment::importComment( SequenceInputStream& rStrm )
{
mxComment = getComments().createComment();
mxComment->importComment( rStrm );
@@ -150,4 +144,3 @@ void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx
index 317476f25635..51d9170e1794 100644
--- a/oox/source/xls/condformatbuffer.cxx
+++ b/oox/source/xls/condformatbuffer.cxx
@@ -26,109 +26,98 @@
************************************************************************/
#include "oox/xls/condformatbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/ConditionOperator.hpp>
+#include <com/sun/star/sheet/XSheetCellRanges.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/stylesbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::style::XStyleFamiliesSupplier;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ConditionOperator;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetConditionalEntries;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::style::XStyle;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_Int32 OOBIN_CFRULE_TYPE_CELLIS = 1;
-const sal_Int32 OOBIN_CFRULE_TYPE_EXPRESSION = 2;
-const sal_Int32 OOBIN_CFRULE_TYPE_COLORSCALE = 3;
-const sal_Int32 OOBIN_CFRULE_TYPE_DATABAR = 4;
-const sal_Int32 OOBIN_CFRULE_TYPE_TOPTEN = 5;
-const sal_Int32 OOBIN_CFRULE_TYPE_ICONSET = 6;
-
-const sal_Int32 OOBIN_CFRULE_SUB_CELLIS = 0;
-const sal_Int32 OOBIN_CFRULE_SUB_EXPRESSION = 1;
-const sal_Int32 OOBIN_CFRULE_SUB_COLORSCALE = 2;
-const sal_Int32 OOBIN_CFRULE_SUB_DATABAR = 3;
-const sal_Int32 OOBIN_CFRULE_SUB_ICONSET = 4;
-const sal_Int32 OOBIN_CFRULE_SUB_TOPTEN = 5;
-const sal_Int32 OOBIN_CFRULE_SUB_UNIQUE = 7;
-const sal_Int32 OOBIN_CFRULE_SUB_TEXT = 8;
-const sal_Int32 OOBIN_CFRULE_SUB_BLANK = 9;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTBLANK = 10;
-const sal_Int32 OOBIN_CFRULE_SUB_ERROR = 11;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTERROR = 12;
-const sal_Int32 OOBIN_CFRULE_SUB_TODAY = 15;
-const sal_Int32 OOBIN_CFRULE_SUB_TOMORROW = 16;
-const sal_Int32 OOBIN_CFRULE_SUB_YESTERDAY = 17;
-const sal_Int32 OOBIN_CFRULE_SUB_LAST7DAYS = 18;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTMONTH = 19;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTMONTH = 20;
-const sal_Int32 OOBIN_CFRULE_SUB_THISWEEK = 21;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTWEEK = 22;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTWEEK = 23;
-const sal_Int32 OOBIN_CFRULE_SUB_THISMONTH = 24;
-const sal_Int32 OOBIN_CFRULE_SUB_ABOVEAVERAGE = 25;
-const sal_Int32 OOBIN_CFRULE_SUB_BELOWAVERAGE = 26;
-const sal_Int32 OOBIN_CFRULE_SUB_DUPLICATE = 27;
-const sal_Int32 OOBIN_CFRULE_SUB_EQABOVEAVERAGE = 29;
-const sal_Int32 OOBIN_CFRULE_SUB_EQBELOWAVERAGE = 30;
-
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TODAY = 0;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_YESTERDAY = 1;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LAST7DAYS = 2;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISWEEK = 3;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTWEEK = 4;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTMONTH = 5;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TOMORROW = 6;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTWEEK = 7;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTMONTH = 8;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISMONTH = 9;
-
-const sal_uInt16 OOBIN_CFRULE_STOPIFTRUE = 0x0002;
-const sal_uInt16 OOBIN_CFRULE_ABOVEAVERAGE = 0x0004;
-const sal_uInt16 OOBIN_CFRULE_BOTTOM = 0x0008;
-const sal_uInt16 OOBIN_CFRULE_PERCENT = 0x0010;
+const sal_Int32 BIFF12_CFRULE_TYPE_CELLIS = 1;
+const sal_Int32 BIFF12_CFRULE_TYPE_EXPRESSION = 2;
+const sal_Int32 BIFF12_CFRULE_TYPE_COLORSCALE = 3;
+const sal_Int32 BIFF12_CFRULE_TYPE_DATABAR = 4;
+const sal_Int32 BIFF12_CFRULE_TYPE_TOPTEN = 5;
+const sal_Int32 BIFF12_CFRULE_TYPE_ICONSET = 6;
+
+const sal_Int32 BIFF12_CFRULE_SUB_CELLIS = 0;
+const sal_Int32 BIFF12_CFRULE_SUB_EXPRESSION = 1;
+const sal_Int32 BIFF12_CFRULE_SUB_COLORSCALE = 2;
+const sal_Int32 BIFF12_CFRULE_SUB_DATABAR = 3;
+const sal_Int32 BIFF12_CFRULE_SUB_ICONSET = 4;
+const sal_Int32 BIFF12_CFRULE_SUB_TOPTEN = 5;
+const sal_Int32 BIFF12_CFRULE_SUB_UNIQUE = 7;
+const sal_Int32 BIFF12_CFRULE_SUB_TEXT = 8;
+const sal_Int32 BIFF12_CFRULE_SUB_BLANK = 9;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTBLANK = 10;
+const sal_Int32 BIFF12_CFRULE_SUB_ERROR = 11;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTERROR = 12;
+const sal_Int32 BIFF12_CFRULE_SUB_TODAY = 15;
+const sal_Int32 BIFF12_CFRULE_SUB_TOMORROW = 16;
+const sal_Int32 BIFF12_CFRULE_SUB_YESTERDAY = 17;
+const sal_Int32 BIFF12_CFRULE_SUB_LAST7DAYS = 18;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTMONTH = 19;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTMONTH = 20;
+const sal_Int32 BIFF12_CFRULE_SUB_THISWEEK = 21;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTWEEK = 22;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTWEEK = 23;
+const sal_Int32 BIFF12_CFRULE_SUB_THISMONTH = 24;
+const sal_Int32 BIFF12_CFRULE_SUB_ABOVEAVERAGE = 25;
+const sal_Int32 BIFF12_CFRULE_SUB_BELOWAVERAGE = 26;
+const sal_Int32 BIFF12_CFRULE_SUB_DUPLICATE = 27;
+const sal_Int32 BIFF12_CFRULE_SUB_EQABOVEAVERAGE = 29;
+const sal_Int32 BIFF12_CFRULE_SUB_EQBELOWAVERAGE = 30;
+
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TODAY = 0;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_YESTERDAY = 1;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LAST7DAYS = 2;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISWEEK = 3;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTWEEK = 4;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTMONTH = 5;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TOMORROW = 6;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTWEEK = 7;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTMONTH = 8;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISMONTH = 9;
+
+const sal_uInt16 BIFF12_CFRULE_STOPIFTRUE = 0x0002;
+const sal_uInt16 BIFF12_CFRULE_ABOVEAVERAGE = 0x0004;
+const sal_uInt16 BIFF12_CFRULE_BOTTOM = 0x0008;
+const sal_uInt16 BIFF12_CFRULE_PERCENT = 0x0010;
// ----------------------------------------------------------------------------
@@ -160,7 +149,7 @@ CondFormatRuleModel::CondFormatRuleModel() :
{
}
-void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiffOperator( sal_Int32 nOperator )
{
static const sal_Int32 spnOperators[] = {
XML_TOKEN_INVALID, XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -168,7 +157,7 @@ void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
}
-void CondFormatRuleModel::setOobTextType( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiff12TextType( sal_Int32 nOperator )
{
// note: type XML_notContainsText vs. operator XML_notContains
static const sal_Int32 spnTypes[] = { XML_containsText, XML_notContainsText, XML_beginsWith, XML_endsWith };
@@ -210,7 +199,7 @@ void CondFormatRule::appendFormula( const OUString& rFormula )
maModel.maFormulas.push_back( aContext );
}
-void CondFormatRule::importCfRule( RecordInputStream& rStrm )
+void CondFormatRule::importCfRule( SequenceInputStream& rStrm )
{
sal_Int32 nType, nSubType, nOperator, nFmla1Size, nFmla2Size, nFmla3Size;
sal_uInt16 nFlags;
@@ -251,129 +240,129 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
}
// flags
- maModel.mbStopIfTrue = getFlag( nFlags, OOBIN_CFRULE_STOPIFTRUE );
- maModel.mbBottom = getFlag( nFlags, OOBIN_CFRULE_BOTTOM );
- maModel.mbPercent = getFlag( nFlags, OOBIN_CFRULE_PERCENT );
- maModel.mbAboveAverage = getFlag( nFlags, OOBIN_CFRULE_ABOVEAVERAGE );
+ maModel.mbStopIfTrue = getFlag( nFlags, BIFF12_CFRULE_STOPIFTRUE );
+ maModel.mbBottom = getFlag( nFlags, BIFF12_CFRULE_BOTTOM );
+ maModel.mbPercent = getFlag( nFlags, BIFF12_CFRULE_PERCENT );
+ maModel.mbAboveAverage = getFlag( nFlags, BIFF12_CFRULE_ABOVEAVERAGE );
// no flag for equalAverage, must be determined from subtype below...
// Convert the type/operator settings. This is a real mess...
switch( nType )
{
- case OOBIN_CFRULE_TYPE_CELLIS:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_CELLIS:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
maModel.mnType = XML_cellIs;
- maModel.setBinOperator( nOperator );
+ maModel.setBiffOperator( nOperator );
OSL_ENSURE( maModel.mnOperator != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unknown operator" );
break;
- case OOBIN_CFRULE_TYPE_EXPRESSION:
+ case BIFF12_CFRULE_TYPE_EXPRESSION:
// here we have to look at the subtype to find the real type...
switch( nSubType )
{
- case OOBIN_CFRULE_SUB_EXPRESSION:
+ case BIFF12_CFRULE_SUB_EXPRESSION:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_expression;
break;
- case OOBIN_CFRULE_SUB_UNIQUE:
+ case BIFF12_CFRULE_SUB_UNIQUE:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_uniqueValues;
break;
- case OOBIN_CFRULE_SUB_TEXT:
- maModel.setOobTextType( nOperator );
+ case BIFF12_CFRULE_SUB_TEXT:
+ maModel.setBiff12TextType( nOperator );
OSL_ENSURE( maModel.mnType != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unexpected operator value" );
break;
- case OOBIN_CFRULE_SUB_BLANK:
+ case BIFF12_CFRULE_SUB_BLANK:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_containsBlanks;
break;
- case OOBIN_CFRULE_SUB_NOTBLANK:
+ case BIFF12_CFRULE_SUB_NOTBLANK:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_notContainsBlanks;
break;
- case OOBIN_CFRULE_SUB_ERROR:
+ case BIFF12_CFRULE_SUB_ERROR:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_containsErrors;
break;
- case OOBIN_CFRULE_SUB_NOTERROR:
+ case BIFF12_CFRULE_SUB_NOTERROR:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_notContainsErrors;
break;
- case OOBIN_CFRULE_SUB_TODAY:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_TODAY:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_today;
break;
- case OOBIN_CFRULE_SUB_TOMORROW:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_TOMORROW:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_tomorrow;
break;
- case OOBIN_CFRULE_SUB_YESTERDAY:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_YESTERDAY:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_yesterday;
break;
- case OOBIN_CFRULE_SUB_LAST7DAYS:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LAST7DAYS:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_last7Days;
break;
- case OOBIN_CFRULE_SUB_LASTMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LASTMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_lastMonth;
break;
- case OOBIN_CFRULE_SUB_NEXTMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_NEXTMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_nextMonth;
break;
- case OOBIN_CFRULE_SUB_THISWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_THISWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_thisWeek;
break;
- case OOBIN_CFRULE_SUB_NEXTWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_NEXTWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_nextWeek;
break;
- case OOBIN_CFRULE_SUB_LASTWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LASTWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_lastWeek;
break;
- case OOBIN_CFRULE_SUB_THISMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_THISMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_thisMonth;
break;
- case OOBIN_CFRULE_SUB_ABOVEAVERAGE:
+ case BIFF12_CFRULE_SUB_ABOVEAVERAGE:
OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = true;
maModel.mbEqualAverage = false; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_BELOWAVERAGE:
+ case BIFF12_CFRULE_SUB_BELOWAVERAGE:
OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = false;
maModel.mbEqualAverage = false; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_DUPLICATE:
+ case BIFF12_CFRULE_SUB_DUPLICATE:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_duplicateValues;
break;
- case OOBIN_CFRULE_SUB_EQABOVEAVERAGE:
+ case BIFF12_CFRULE_SUB_EQABOVEAVERAGE:
OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = true;
maModel.mbEqualAverage = true; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_EQBELOWAVERAGE:
+ case BIFF12_CFRULE_SUB_EQBELOWAVERAGE:
OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
@@ -382,23 +371,23 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
break;
}
break;
- case OOBIN_CFRULE_TYPE_COLORSCALE:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_COLORSCALE:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_colorScale;
break;
- case OOBIN_CFRULE_TYPE_DATABAR:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_DATABAR:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_dataBar;
break;
- case OOBIN_CFRULE_TYPE_TOPTEN:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_TOPTEN:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
maModel.mnType = XML_top10;
maModel.mnRank = nOperator; // operator field used for rank value
break;
- case OOBIN_CFRULE_TYPE_ICONSET:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_ICONSET:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_iconSet;
break;
@@ -418,7 +407,7 @@ void CondFormatRule::importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority )
static const sal_Int32 spnTypeIds[] = { XML_TOKEN_INVALID, XML_cellIs, XML_expression };
maModel.mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_TOKEN_INVALID );
- maModel.setBinOperator( nOperator );
+ maModel.setBiffOperator( nOperator );
maModel.mnPriority = nPriority;
maModel.mbStopIfTrue = true;
@@ -658,7 +647,7 @@ CondFormatRuleRef CondFormat::importCfRule( const AttributeList& rAttribs )
return xRule;
}
-void CondFormat::importCondFormatting( RecordInputStream& rStrm )
+void CondFormat::importCondFormatting( SequenceInputStream& rStrm )
{
BinRangeList aRanges;
rStrm.skip( 8 );
@@ -666,7 +655,7 @@ void CondFormat::importCondFormatting( RecordInputStream& rStrm )
getAddressConverter().convertToCellRangeList( maModel.maRanges, aRanges, getSheetIndex(), true );
}
-void CondFormat::importCfRule( RecordInputStream& rStrm )
+void CondFormat::importCfRule( SequenceInputStream& rStrm )
{
CondFormatRuleRef xRule = createRule();
xRule->importCfRule( rStrm );
@@ -694,18 +683,17 @@ void CondFormat::importCfHeader( BiffInputStream& rStrm )
void CondFormat::finalizeImport()
{
- Reference< XSheetCellRanges > xRanges = getCellRangeList( maModel.maRanges );
- if( xRanges.is() )
+ try
{
+ Reference< XSheetCellRanges > xRanges( getCellRangeList( maModel.maRanges ), UNO_SET_THROW );
PropertySet aPropSet( xRanges );
- Reference< XSheetConditionalEntries > xEntries;
- aPropSet.getProperty( xEntries, PROP_ConditionalFormat );
- if( xEntries.is() )
- {
- // maRules is sorted by rule priority
- maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
- aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
- }
+ Reference< XSheetConditionalEntries > xEntries( aPropSet.getAnyProperty( PROP_ConditionalFormat ), UNO_QUERY_THROW );
+ // maRules is sorted by rule priority
+ maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
+ aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
+ }
+ catch( Exception& )
+ {
}
}
@@ -737,7 +725,7 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList
return xCondFmt;
}
-CondFormatRef CondFormatBuffer::importCondFormatting( RecordInputStream& rStrm )
+CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm )
{
CondFormatRef xCondFmt = createCondFormat();
xCondFmt->importCondFormatting( rStrm );
@@ -784,4 +772,3 @@ CondFormatRef CondFormatBuffer::createCondFormat()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx
index 8cd3a33615fc..091dc11fb614 100644
--- a/oox/source/xls/condformatcontext.cxx
+++ b/oox/source/xls/condformatcontext.cxx
@@ -27,22 +27,22 @@
#include "oox/xls/condformatcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxCondFormatContext::OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
+CondFormatContext::CondFormatContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef CondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
@@ -54,7 +54,7 @@ ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
+void CondFormatContext::onStartElement( const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -67,34 +67,30 @@ void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
}
}
-void OoxCondFormatContext::onEndElement( const OUString& rChars )
+void CondFormatContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( formula ):
- if( mxCondFmt.get() && mxRule.get() ) mxRule->appendFormula( rChars );
- break;
- }
+ if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt.get() && mxRule.get() )
+ mxRule->appendFormula( rChars );
}
-ContextHandlerRef OoxCondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_CONDFORMATTING:
- return (nRecId == OOBIN_ID_CFRULE) ? this : 0;
+ case BIFF12_ID_CONDFORMATTING:
+ return (nRecId == BIFF12_ID_CFRULE) ? this : 0;
}
return 0;
}
-void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
+void CondFormatContext::onStartRecord( SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_CONDFORMATTING:
+ case BIFF12_ID_CONDFORMATTING:
mxCondFmt = getCondFormats().importCondFormatting( rStrm );
break;
- case OOBIN_ID_CFRULE:
+ case BIFF12_ID_CFRULE:
if( mxCondFmt.get() ) mxCondFmt->importCfRule( rStrm );
break;
}
@@ -104,4 +100,3 @@ void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx
new file mode 100755
index 000000000000..6d0fcd65122f
--- /dev/null
+++ b/oox/source/xls/connectionsbuffer.cxx
@@ -0,0 +1,501 @@
+/*************************************************************************
+ *
+ * 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 "oox/xls/connectionsbuffer.hxx"
+
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/biffinputstream.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_Int32 BIFF12_RECONNECT_AS_REQUIRED = 1;
+const sal_Int32 BIFF12_RECONNECT_ALWAYS = 2;
+const sal_Int32 BIFF12_RECONNECT_NEVER = 3;
+
+const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_ON = 1;
+const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_OFF = 2;
+
+const sal_uInt16 BIFF12_CONNECTION_KEEPALIVE = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_NEW = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_DELETED = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_ONLYUSECONNFILE = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_BACKGROUND = 0x0010;
+const sal_uInt16 BIFF12_CONNECTION_REFRESHONLOAD = 0x0020;
+const sal_uInt16 BIFF12_CONNECTION_SAVEDATA = 0x0040;
+
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCEFILE = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCECONNFILE = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_HAS_DESCRIPTION = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_HAS_NAME = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SSOID = 0x0010;
+
+const sal_uInt32 BIFF12_WEBPR_XML = 0x00000100;
+const sal_uInt32 BIFF12_WEBPR_SOURCEDATA = 0x00000200;
+const sal_uInt32 BIFF12_WEBPR_PARSEPRE = 0x00000400;
+const sal_uInt32 BIFF12_WEBPR_CONSECUTIVE = 0x00000800;
+const sal_uInt32 BIFF12_WEBPR_FIRSTROW = 0x00001000;
+const sal_uInt32 BIFF12_WEBPR_XL97CREATED = 0x00002000;
+const sal_uInt32 BIFF12_WEBPR_TEXTDATES = 0x00004000;
+const sal_uInt32 BIFF12_WEBPR_XL2000REFRESHED = 0x00008000;
+const sal_uInt32 BIFF12_WEBPR_HTMLTABLES = 0x00010000;
+
+const sal_uInt8 BIFF12_WEBPR_HAS_POSTMETHOD = 0x01;
+const sal_uInt8 BIFF12_WEBPR_HAS_EDITPAGE = 0x02;
+const sal_uInt8 BIFF12_WEBPR_HAS_URL = 0x04;
+
+const sal_uInt16 BIFF_DBQUERY_ODBC = 0x0008;
+const sal_uInt16 BIFF_DBQUERY_SQLQUERY = 0x0010;
+const sal_uInt16 BIFF_DBQUERY_SERVERBASEDSQL = 0x0020;
+const sal_uInt16 BIFF_DBQUERY_HTML = 0x0040;
+const sal_uInt16 BIFF_DBQUERY_SAVEPASSWORD = 0x0080;
+const sal_uInt16 BIFF_DBQUERY_HTMLTABLES = 0x0100;
+
+const sal_uInt16 BIFF_QTSETTINGS_KEEPALIVE = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_NEW = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_SOURCEDATA = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_WEBBASEDPROV = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_REINITLIST = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XML = 0x0080;
+
+const sal_uInt16 BIFF_QTSETTINGS_PARSEPRE = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_CONSECUTIVE = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_FIRSTROW = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_XL97CREATED = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_TEXTDATES = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XL2000REFRESHED = 0x0020;
+
+const sal_uInt16 BIFF_QTSETTINGS_TEXTQUERY = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_TABLENAMES = 0x0002;
+
+// ----------------------------------------------------------------------------
+
+OUString lclReadQueryString( BiffInputStream& rStrm, sal_uInt16 nCount )
+{
+ bool bValidRec = true;
+ OUStringBuffer aBuffer;
+ for( sal_uInt16 nIndex = 0; bValidRec && (nIndex < nCount); ++nIndex )
+ {
+ bValidRec = (rStrm.getNextRecId() == BIFF_ID_PCITEM_STRING) && rStrm.startNextRecord();
+ if( bValidRec )
+ aBuffer.append( rStrm.readUniString() );
+ }
+ OSL_ENSURE( bValidRec, "lclReadQueryString - missing PCITEM_STRING records" );
+ return aBuffer.makeStringAndClear();
+}
+
+void lclParseTables( WebPrModel::TablesVector& rTables, const OUString& rTableNames )
+{
+ rTables.clear();
+ OUString aTableNames = rTableNames.trim();
+ while( aTableNames.getLength() > 0 )
+ {
+ sal_Int32 nSep = -1;
+ // table names are enclosed in double quotes
+ if( aTableNames[ 0 ] == '"' )
+ {
+ // search closing quote character
+ sal_Int32 nEndQuote = aTableNames.indexOf( '"', 1 );
+ OSL_ENSURE( nEndQuote >= 1, "lclParseTables - invalid syntax" );
+ if( nEndQuote < 0 )
+ nEndQuote = aTableNames.getLength();
+ else
+ nSep = aTableNames.indexOf( ',', nEndQuote + 1 );
+ // extract text between quote characters
+ OUString aTableName = aTableNames.copy( 1, nEndQuote - 1 ).trim();
+ if( aTableName.getLength() > 0 )
+ rTables.push_back( Any( aTableName ) );
+ else
+ rTables.push_back( Any() );
+ }
+ else
+ {
+ nSep = aTableNames.indexOf( ',' );
+ if( nSep < 0 )
+ nSep = aTableNames.getLength();
+ OUString aTableIndex = aTableNames.copy( 0, nSep ).trim();
+ if( (aTableIndex.getLength() > 0) && (aTableIndex[ 0 ] >= '1') && (aTableIndex[ 0 ] <= '9') )
+ rTables.push_back( Any( aTableIndex.toInt32() ) );
+ else
+ rTables.push_back( Any() );
+ }
+
+ // remove processed item from aTableNames
+ if( (nSep < 0) || (nSep >= aTableNames.getLength()) )
+ aTableNames = OUString();
+ else
+ aTableNames = aTableNames.copy( nSep + 1 ).trim();
+ }
+}
+
+} // namespace
+
+// ============================================================================
+
+WebPrModel::WebPrModel() :
+ mnHtmlFormat( XML_none ),
+ mbXml( false ),
+ mbSourceData( false ),
+ mbParsePre( false ),
+ mbConsecutive( false ),
+ mbFirstRow( false ),
+ mbXl97Created( false ),
+ mbTextDates( false ),
+ mbXl2000Refreshed( false ),
+ mbHtmlTables( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+ConnectionModel::ConnectionModel() :
+ mnId( -1 ),
+ mnType( BIFF12_CONNECTION_UNKNOWN ),
+ mnReconnectMethod( BIFF12_RECONNECT_AS_REQUIRED ),
+ mnCredentials( XML_integrated ),
+ mnInterval( 0 ),
+ mbKeepAlive( false ),
+ mbNew( false ),
+ mbDeleted( false ),
+ mbOnlyUseConnFile( false ),
+ mbBackground( false ),
+ mbRefreshOnLoad( false ),
+ mbSaveData( false ),
+ mbSavePassword( false )
+{
+}
+
+WebPrModel& ConnectionModel::createWebPr()
+{
+ OSL_ENSURE( !mxWebPr.get(), "ConnectionModel::createWebPr - multiple call" );
+ mxWebPr.reset( new WebPrModel );
+ return *mxWebPr;
+}
+
+// ----------------------------------------------------------------------------
+
+Connection::Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId ) :
+ WorkbookHelper( rHelper )
+{
+ maModel.mnId = nConnId;
+}
+
+void Connection::importConnection( const AttributeList& rAttribs )
+{
+ maModel.maName = rAttribs.getXString( XML_name, OUString() );
+ maModel.maDescription = rAttribs.getXString( XML_description, OUString() );
+ maModel.maSourceFile = rAttribs.getXString( XML_sourceFile, OUString() );
+ maModel.maSourceConnFile = rAttribs.getXString( XML_odcFile, OUString() );
+ maModel.maSsoId = rAttribs.getXString( XML_singleSignOnId, OUString() );
+ maModel.mnId = rAttribs.getInteger( XML_id, -1 );
+ // type and reconnectionMethod are using the BIFF12 constants instead of XML tokens
+ maModel.mnType = rAttribs.getInteger( XML_type, BIFF12_CONNECTION_UNKNOWN );
+ maModel.mnReconnectMethod = rAttribs.getInteger( XML_reconnectionMethod, BIFF12_RECONNECT_AS_REQUIRED );
+ maModel.mnCredentials = rAttribs.getToken( XML_credentials, XML_integrated );
+ maModel.mnInterval = rAttribs.getInteger( XML_interval, 0 );
+ maModel.mbKeepAlive = rAttribs.getBool( XML_keepAlive, false );
+ maModel.mbNew = rAttribs.getBool( XML_new, false );
+ maModel.mbDeleted = rAttribs.getBool( XML_deleted, false );
+ maModel.mbOnlyUseConnFile = rAttribs.getBool( XML_onlyUseConnectionFile, false );
+ maModel.mbBackground = rAttribs.getBool( XML_background, false );
+ maModel.mbRefreshOnLoad = rAttribs.getBool( XML_refreshOnLoad, false );
+ maModel.mbSaveData = rAttribs.getBool( XML_saveData, false );
+ maModel.mbSavePassword = rAttribs.getBool( XML_savePassword, false );
+}
+
+void Connection::importWebPr( const AttributeList& rAttribs )
+{
+ WebPrModel& rWebPr = maModel.createWebPr();
+
+ rWebPr.maUrl = rAttribs.getXString( XML_url, OUString() );
+ rWebPr.maPostMethod = rAttribs.getXString( XML_post, OUString() );
+ rWebPr.maEditPage = rAttribs.getXString( XML_editPage, OUString() );
+ rWebPr.mnHtmlFormat = rAttribs.getToken( XML_htmlFormat, XML_none );
+ rWebPr.mbXml = rAttribs.getBool( XML_xml, false );
+ rWebPr.mbSourceData = rAttribs.getBool( XML_sourceData, false );
+ rWebPr.mbParsePre = rAttribs.getBool( XML_parsePre, false );
+ rWebPr.mbConsecutive = rAttribs.getBool( XML_consecutive, false );
+ rWebPr.mbFirstRow = rAttribs.getBool( XML_firstRow, false );
+ rWebPr.mbXl97Created = rAttribs.getBool( XML_xl97, false );
+ rWebPr.mbTextDates = rAttribs.getBool( XML_textDates, false );
+ rWebPr.mbXl2000Refreshed = rAttribs.getBool( XML_xl2000, false );
+ rWebPr.mbHtmlTables = rAttribs.getBool( XML_htmlTables, false );
+}
+
+void Connection::importTables( const AttributeList& /*rAttribs*/ )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importTables - multiple calls" );
+ maModel.mxWebPr->maTables.clear();
+ }
+}
+
+void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ Any aTableAny;
+ switch( nElement )
+ {
+ case XLS_TOKEN( m ): break;
+ case XLS_TOKEN( s ): aTableAny <<= rAttribs.getXString( XML_v, OUString() ); break;
+ case XLS_TOKEN( x ): aTableAny <<= rAttribs.getInteger( XML_v, -1 ); break;
+ default:
+ OSL_ENSURE( false, "Connection::importTable - unexpected element" );
+ return;
+ }
+ maModel.mxWebPr->maTables.push_back( aTableAny );
+ }
+}
+
+void Connection::importConnection( SequenceInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nStrFlags;
+ sal_uInt8 nSavePassword, nCredentials;
+ rStrm.skip( 2 );
+ rStrm >> nSavePassword;
+ rStrm.skip( 1 );
+ maModel.mnInterval = rStrm.readuInt16();
+ rStrm >> nFlags >> nStrFlags >> maModel.mnType >> maModel.mnReconnectMethod >> maModel.mnId >> nCredentials;
+
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCEFILE ) )
+ rStrm >> maModel.maSourceFile;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCECONNFILE ) )
+ rStrm >> maModel.maSourceConnFile;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_DESCRIPTION ) )
+ rStrm >> maModel.maDescription;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_NAME ) )
+ rStrm >> maModel.maName;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SSOID ) )
+ rStrm >> maModel.maSsoId;
+
+ static const sal_Int32 spnCredentials[] = { XML_integrated, XML_none, XML_stored, XML_prompt };
+ maModel.mnCredentials = STATIC_ARRAY_SELECT( spnCredentials, nCredentials, XML_integrated );
+
+ maModel.mbKeepAlive = getFlag( nFlags, BIFF12_CONNECTION_KEEPALIVE );
+ maModel.mbNew = getFlag( nFlags, BIFF12_CONNECTION_NEW );
+ maModel.mbDeleted = getFlag( nFlags, BIFF12_CONNECTION_DELETED );
+ maModel.mbOnlyUseConnFile = getFlag( nFlags, BIFF12_CONNECTION_ONLYUSECONNFILE );
+ maModel.mbBackground = getFlag( nFlags, BIFF12_CONNECTION_BACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF12_CONNECTION_REFRESHONLOAD );
+ maModel.mbSaveData = getFlag( nFlags, BIFF12_CONNECTION_SAVEDATA );
+ maModel.mbSavePassword = nSavePassword == BIFF12_CONNECTION_SAVEPASSWORD_ON;
+}
+
+void Connection::importWebPr( SequenceInputStream& rStrm )
+{
+ WebPrModel& rWebPr = maModel.createWebPr();
+
+ sal_uInt32 nFlags;
+ sal_uInt8 nStrFlags;
+ rStrm >> nFlags >> nStrFlags;
+
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_URL ) )
+ rStrm >> rWebPr.maUrl;
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_POSTMETHOD ) )
+ rStrm >> rWebPr.maPostMethod;
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_EDITPAGE ) )
+ rStrm >> rWebPr.maEditPage;
+
+ static const sal_Int32 spnHmlFormats[] = { XML_none, XML_rtf, XML_all };
+ rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, extractValue< sal_uInt8 >( nFlags, 0, 8 ), XML_none );
+
+ rWebPr.mbXml = getFlag( nFlags, BIFF12_WEBPR_XML );
+ rWebPr.mbSourceData = getFlag( nFlags, BIFF12_WEBPR_SOURCEDATA );
+ rWebPr.mbParsePre = getFlag( nFlags, BIFF12_WEBPR_PARSEPRE );
+ rWebPr.mbConsecutive = getFlag( nFlags, BIFF12_WEBPR_CONSECUTIVE );
+ rWebPr.mbFirstRow = getFlag( nFlags, BIFF12_WEBPR_FIRSTROW );
+ rWebPr.mbXl97Created = getFlag( nFlags, BIFF12_WEBPR_XL97CREATED );
+ rWebPr.mbTextDates = getFlag( nFlags, BIFF12_WEBPR_TEXTDATES );
+ rWebPr.mbXl2000Refreshed = getFlag( nFlags, BIFF12_WEBPR_XL2000REFRESHED );
+ rWebPr.mbHtmlTables = getFlag( nFlags, BIFF12_WEBPR_HTMLTABLES );
+}
+
+void Connection::importWebPrTables( SequenceInputStream& /*rStrm*/ )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importWebPrTables - multiple calls" );
+ maModel.mxWebPr->maTables.clear();
+ }
+}
+
+void Connection::importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ Any aTableAny;
+ switch( nRecId )
+ {
+ case BIFF12_ID_PCITEM_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING: aTableAny <<= BiffHelper::readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break;
+ default:
+ OSL_ENSURE( false, "Connection::importWebPrTable - unexpected record" );
+ return;
+ }
+ maModel.mxWebPr->maTables.push_back( aTableAny );
+ }
+}
+
+void Connection::importDbQuery( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nSqlParamCount, nCommandCount, nPostMethodCount, nServerSqlCount, nOdbcConnCount;
+ rStrm >> nFlags >> nSqlParamCount >> nCommandCount >> nPostMethodCount >> nServerSqlCount >> nOdbcConnCount;
+
+ // same type constants in all BIFF versions
+ maModel.mnType = extractValue< sal_Int32 >( nFlags, 0, 3 );
+ maModel.mbSavePassword = getFlag( nFlags, BIFF_DBQUERY_SAVEPASSWORD );
+
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_ODBC ) == (maModel.mnType == BIFF12_CONNECTION_ODBC), "Connection::importDbQuery - wrong ODBC flag" );
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_SQLQUERY ) != (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong SQL query flag" );
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_HTML ) == (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong HTML flag" );
+
+ if( (maModel.mnType == BIFF12_CONNECTION_HTML) && getFlag( nFlags, BIFF_DBQUERY_HTML ) )
+ {
+ WebPrModel& rWebPr = maModel.createWebPr();
+ rWebPr.mbHtmlTables = getFlag( nFlags, BIFF_DBQUERY_HTMLTABLES );
+
+ // read HTML query URL and post method
+ rWebPr.maUrl = lclReadQueryString( rStrm, nCommandCount );
+ rWebPr.maPostMethod = lclReadQueryString( rStrm, nPostMethodCount );
+ }
+}
+
+void Connection::importQueryTableSettings( BiffInputStream& rStrm )
+{
+ rStrm.skip( 4 );
+ // source data type, again
+ sal_uInt16 nType = rStrm.readuInt16();
+ OSL_ENSURE( nType == maModel.mnType, "Connection::importQueryTableSettings - source data type mismatch" );
+ if( nType == maModel.mnType )
+ {
+ sal_uInt16 nFlags1, nFlags2, nFlags3, nHtmlFormat;
+ rStrm >> nFlags1 >> nFlags2 >> nFlags3;
+ rStrm.skip( 10 );
+ maModel.mnInterval = rStrm.readuInt16();
+ rStrm >> nHtmlFormat;
+
+ // first flags field: generic connection flags
+ maModel.mbKeepAlive = getFlag( nFlags1, BIFF_QTSETTINGS_KEEPALIVE );
+ maModel.mbNew = getFlag( nFlags1, BIFF_QTSETTINGS_NEW );
+
+ // meaning of second flags field is dependent on source data type
+ if( (maModel.mnType == BIFF12_CONNECTION_HTML) && maModel.mxWebPr.get() )
+ {
+ WebPrModel& rWebPr = *maModel.mxWebPr;
+
+ // HTML format is one-based in BIFF8 (but zero-based in BIFF12)
+ static const sal_Int32 spnHmlFormats[] = { XML_none, XML_none, XML_rtf, XML_all };
+ rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, nHtmlFormat, XML_none );
+
+ rWebPr.mbXml = getFlag( nFlags1, BIFF_QTSETTINGS_XML );
+ rWebPr.mbSourceData = getFlag( nFlags1, BIFF_QTSETTINGS_SOURCEDATA );
+ rWebPr.mbParsePre = getFlag( nFlags2, BIFF_QTSETTINGS_PARSEPRE );
+ rWebPr.mbConsecutive = getFlag( nFlags2, BIFF_QTSETTINGS_CONSECUTIVE );
+ rWebPr.mbFirstRow = getFlag( nFlags2, BIFF_QTSETTINGS_FIRSTROW );
+ rWebPr.mbXl97Created = getFlag( nFlags2, BIFF_QTSETTINGS_XL97CREATED );
+ rWebPr.mbTextDates = getFlag( nFlags2, BIFF_QTSETTINGS_TEXTDATES );
+ rWebPr.mbXl2000Refreshed = getFlag( nFlags2, BIFF_QTSETTINGS_XL2000REFRESHED );
+
+ // list of HTML table names or indexes
+ if( getFlag( nFlags3, BIFF_QTSETTINGS_TABLENAMES ) )
+ {
+ // a QUERYTABLESTRING record containing the table names must follow
+ bool bHasQTString = (rStrm.getNextRecId() == BIFF_ID_QUERYTABLESTRING) && rStrm.startNextRecord();
+ OSL_ENSURE( bHasQTString, "Connection::importQueryTableSettings - missing QUERYTABLESTRING record" );
+ if( bHasQTString )
+ {
+ rStrm.skip( 4 );
+ lclParseTables( rWebPr.maTables, rStrm.readUniString() );
+ }
+ }
+ }
+ }
+}
+
+// ============================================================================
+
+ConnectionsBuffer::ConnectionsBuffer( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper ),
+ mnUnusedId( 1 )
+{
+}
+
+Connection& ConnectionsBuffer::createConnection()
+{
+ ConnectionRef xConnection( new Connection( *this ) );
+ maConnections.push_back( xConnection );
+ return *xConnection;
+}
+
+Connection& ConnectionsBuffer::createConnectionWithId()
+{
+ ConnectionRef xConnection( new Connection( *this, mnUnusedId ) );
+ maConnections.push_back( xConnection );
+ insertConnectionToMap( xConnection );
+ return *xConnection;
+}
+
+void ConnectionsBuffer::finalizeImport()
+{
+ for( ConnectionVector::iterator aIt = maConnections.begin(), aEnd = maConnections.end(); aIt != aEnd; ++aIt )
+ insertConnectionToMap( *aIt );
+}
+
+ConnectionRef ConnectionsBuffer::getConnection( sal_Int32 nConnId ) const
+{
+ return maConnectionsById.get( nConnId );
+}
+
+void ConnectionsBuffer::insertConnectionToMap( const ConnectionRef& rxConnection )
+{
+ sal_Int32 nConnId = rxConnection->getConnectionId();
+ if( nConnId > 0 )
+ {
+ OSL_ENSURE( !maConnectionsById.has( nConnId ), "ConnectionsBuffer::insertConnectionToMap - multiple connection identifier" );
+ maConnectionsById[ nConnId ] = rxConnection;
+ mnUnusedId = ::std::max< sal_Int32 >( mnUnusedId, nConnId + 1 );
+ }
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx
index f19204306d1b..7aafcd84cd7e 100644
--- a/oox/source/xls/connectionsfragment.cxx
+++ b/oox/source/xls/connectionsfragment.cxx
@@ -26,88 +26,154 @@
************************************************************************/
#include "oox/xls/connectionsfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/xls/webquerybuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/biffhelper.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
namespace oox {
namespace xls {
-OoxConnectionsFragment::OoxConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+// ============================================================================
+
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+ConnectionContext::ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection ) :
+ WorkbookContextBase( rParent ),
+ mrConnection( rConnection )
{
}
-ContextHandlerRef OoxConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
- case XML_ROOT_CONTEXT:
- if( nElement == XLS_TOKEN( connections ) ) return this;
- break;
-
- case XLS_TOKEN( connections ):
- switch( nElement )
+ case XLS_TOKEN( connection ):
+ if( nElement == XLS_TOKEN( webPr ) )
{
- case XLS_TOKEN( connection ): importConnection( rAttribs ); return this;
+ mrConnection.importWebPr( rAttribs );
+ return this;
}
break;
- case XLS_TOKEN( connection ):
- switch( nElement )
+ case XLS_TOKEN( webPr ):
+ if( nElement == XLS_TOKEN( tables ) )
{
- case XLS_TOKEN( webPr ): importWebPr( rAttribs ); return this;
+ mrConnection.importTables( rAttribs );
+ return this;
}
break;
- case XLS_TOKEN( webPr ):
- switch( nElement )
+ case XLS_TOKEN( tables ):
+ mrConnection.importTable( rAttribs, nElement );
+ break;
+ }
+ return 0;
+}
+
+void ConnectionContext::onStartElement( const AttributeList& rAttribs )
+{
+ if( getCurrentElement() == XLS_TOKEN( connection ) )
+ mrConnection.importConnection( rAttribs );
+}
+
+ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( getCurrentElement() )
+ {
+ case BIFF12_ID_CONNECTION:
+ if( nRecId == BIFF12_ID_WEBPR )
{
- case XLS_TOKEN( tables ): importTables( rAttribs ); return this;
+ mrConnection.importWebPr( rStrm );
+ return this;
}
break;
- case XLS_TOKEN( tables ):
- switch( nElement )
+ case BIFF12_ID_WEBPR:
+ if( nRecId == BIFF12_ID_WEBPRTABLES )
{
- case XLS_TOKEN( s ): importS( rAttribs ); break;
- case XLS_TOKEN( x ): importX( rAttribs ); break;
+ mrConnection.importWebPrTables( rStrm );
+ return this;
}
break;
+
+ case BIFF12_ID_WEBPRTABLES:
+ mrConnection.importWebPrTable( rStrm, nRecId );
+ break;
}
return 0;
}
-void OoxConnectionsFragment::importConnection( const AttributeList& rAttribs )
+void ConnectionContext::onStartRecord( SequenceInputStream& rStrm )
+{
+ if( getCurrentElement() == BIFF12_ID_CONNECTION )
+ mrConnection.importConnection( rStrm );
+}
+
+// ============================================================================
+
+ConnectionsFragment::ConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
- if ( rAttribs.getInteger( XML_type, 0 ) == Connection::CONNECTION_WEBQUERY )
- {
- getWebQueries().importConnection( rAttribs );
- }
}
-void OoxConnectionsFragment::importWebPr( const AttributeList& rAttribs )
+ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- getWebQueries().importWebPr( rAttribs );
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nElement == XLS_TOKEN( connections ) )
+ return this;
+ break;
+
+ case XLS_TOKEN( connections ):
+ if( nElement == XLS_TOKEN( connection ) )
+ return new ConnectionContext( *this, getConnections().createConnection() );
+ break;
+ }
+ return 0;
}
-void OoxConnectionsFragment::importTables( const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
-// sal_Int32 nCount = rAttribs.getInteger( XML_count, 0 );
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nRecId == BIFF12_ID_CONNECTIONS )
+ return this;
+ break;
+
+ case BIFF12_ID_CONNECTIONS:
+ if( nRecId == BIFF12_ID_CONNECTION )
+ return new ConnectionContext( *this, getConnections().createConnection() );
+ break;
+ }
+ return 0;
}
-void OoxConnectionsFragment::importS( const AttributeList& /*rAttribs*/ )
+const RecordInfo* ConnectionsFragment::getRecordInfos() const
{
-// OUString aName = rAttribs.getString( XML_v );
+ static const RecordInfo spRecInfos[] =
+ {
+ { BIFF12_ID_CONNECTIONS, BIFF12_ID_CONNECTIONS + 1 },
+ { BIFF12_ID_CONNECTION, BIFF12_ID_CONNECTION + 1 },
+ { BIFF12_ID_WEBPR, BIFF12_ID_WEBPR + 1 },
+ { BIFF12_ID_WEBPRTABLES, BIFF12_ID_WEBPRTABLES + 1 },
+ { -1, -1 }
+ };
+ return spRecInfos;
}
-void OoxConnectionsFragment::importX( const AttributeList& /*rAttribs*/ )
+void ConnectionsFragment::finalizeImport()
{
-// sal_Int32 nSharedId = rAttribs.getInteger( XML_v, 0 );
+ getConnections().finalizeImport();
}
+// ============================================================================
+
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx
index a02375e2b869..96fcec0042f5 100644
--- a/oox/source/xls/defnamesbuffer.cxx
+++ b/oox/source/xls/defnamesbuffer.cxx
@@ -26,7 +26,7 @@
************************************************************************/
#include "oox/xls/defnamesbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/NamedRangeFlag.hpp>
@@ -34,8 +34,9 @@
#include <com/sun/star/sheet/SingleReference.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
#include <com/sun/star/sheet/XPrintAreas.hpp>
-#include "properties.hxx"
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -43,34 +44,30 @@
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XPrintAreas;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_uInt32 OOBIN_DEFNAME_HIDDEN = 0x00000001;
-const sal_uInt32 OOBIN_DEFNAME_FUNC = 0x00000002;
-const sal_uInt32 OOBIN_DEFNAME_VBNAME = 0x00000004;
-const sal_uInt32 OOBIN_DEFNAME_MACRO = 0x00000008;
-const sal_uInt32 OOBIN_DEFNAME_CALCEXP = 0x00000010;
-const sal_uInt32 OOBIN_DEFNAME_BUILTIN = 0x00000020;
-const sal_uInt32 OOBIN_DEFNAME_PUBLISHED = 0x00008000;
-const sal_uInt32 OOBIN_DEFNAME_WBPARAM = 0x00010000;
+const sal_uInt32 BIFF12_DEFNAME_HIDDEN = 0x00000001;
+const sal_uInt32 BIFF12_DEFNAME_FUNC = 0x00000002;
+const sal_uInt32 BIFF12_DEFNAME_VBNAME = 0x00000004;
+const sal_uInt32 BIFF12_DEFNAME_MACRO = 0x00000008;
+const sal_uInt32 BIFF12_DEFNAME_CALCEXP = 0x00000010;
+const sal_uInt32 BIFF12_DEFNAME_BUILTIN = 0x00000020;
+const sal_uInt32 BIFF12_DEFNAME_PUBLISHED = 0x00008000;
+const sal_uInt32 BIFF12_DEFNAME_WBPARAM = 0x00010000;
const sal_uInt16 BIFF_DEFNAME_HIDDEN = 0x0001;
const sal_uInt16 BIFF_DEFNAME_FUNC = 0x0002;
@@ -84,6 +81,11 @@ const sal_uInt8 BIFF2_DEFNAME_FUNC = 0x02; /// BIFF2 function/comma
const sal_uInt16 BIFF_DEFNAME_GLOBAL = 0; /// 0 = Globally defined name.
+const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001;
+const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002;
+const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004;
+const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008;
+
// ----------------------------------------------------------------------------
const sal_Char* const spcLegacyPrefix = "Excel_BuiltIn_";
@@ -91,20 +93,20 @@ const sal_Char* const spcOoxPrefix = "_xlnm.";
const sal_Char* const sppcBaseNames[] =
{
- "Consolidate_Area", /* OOX */
+ "Consolidate_Area",
"Auto_Open",
"Auto_Close",
- "Extract", /* OOX */
- "Database", /* OOX */
- "Criteria", /* OOX */
- "Print_Area", /* OOX */
- "Print_Titles", /* OOX */
+ "Extract",
+ "Database",
+ "Criteria",
+ "Print_Area",
+ "Print_Titles",
"Recorder",
"Data_Form",
"Auto_Activate",
"Auto_Deactivate",
- "Sheet_Title", /* OOX */
- "_FilterDatabase" /* OOX */
+ "Sheet_Title",
+ "_FilterDatabase"
};
/** Localized names for _xlnm._FilterDatabase as used in BIFF5. */
@@ -116,7 +118,7 @@ const sal_Char* const sppcFilterDbNames[] =
OUString lclGetBaseName( sal_Unicode cBuiltinId )
{
- OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unknown builtin name" );
+ OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unsupported built-in identifier" );
OUStringBuffer aBuffer;
if( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ) )
aBuffer.appendAscii( sppcBaseNames[ cBuiltinId ] );
@@ -125,67 +127,52 @@ OUString lclGetBaseName( sal_Unicode cBuiltinId )
return aBuffer.makeStringAndClear();
}
-OUString lclGetBuiltinName( sal_Unicode cBuiltinId )
+OUString lclGetPrefixedName( sal_Unicode cBuiltinId )
{
return OUStringBuffer().appendAscii( spcOoxPrefix ).append( lclGetBaseName( cBuiltinId ) ).makeStringAndClear();
}
-sal_Unicode lclGetBuiltinIdFromOox( const OUString& rOoxName )
+/** returns the built-in name identifier from a perfixed built-in name, e.g. '_xlnm.Print_Area'. */
+sal_Unicode lclGetBuiltinIdFromPrefixedName( const OUString& rModelName )
{
OUString aPrefix = OUString::createFromAscii( spcOoxPrefix );
sal_Int32 nPrefixLen = aPrefix.getLength();
- if( rOoxName.matchIgnoreAsciiCase( aPrefix ) )
+ if( rModelName.matchIgnoreAsciiCase( aPrefix ) )
{
for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId )
{
OUString aBaseName = lclGetBaseName( cBuiltinId );
sal_Int32 nBaseNameLen = aBaseName.getLength();
- if( (rOoxName.getLength() == nPrefixLen + nBaseNameLen) && rOoxName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) )
+ if( (rModelName.getLength() == nPrefixLen + nBaseNameLen) && rModelName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) )
return cBuiltinId;
}
}
- return OOX_DEFNAME_UNKNOWN;
+ return BIFF_DEFNAME_UNKNOWN;
}
-sal_Unicode lclGetBuiltinIdFromOob( const OUString& rOobName )
+/** returns the built-in name identifier from a built-in base name, e.g. 'Print_Area'. */
+sal_Unicode lclGetBuiltinIdFromBaseName( const OUString& rModelName )
{
for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId )
- if( rOobName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
+ if( rModelName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
return cBuiltinId;
- return OOX_DEFNAME_UNKNOWN;
+ return BIFF_DEFNAME_UNKNOWN;
}
-bool lclIsFilterDatabaseName( const OUString& rName )
+bool lclIsFilterDatabaseName( const OUString& rModelName )
{
for( const sal_Char* const* ppcName = sppcFilterDbNames; ppcName < STATIC_ARRAY_END( sppcFilterDbNames ); ++ppcName )
- if( rName.equalsIgnoreAsciiCaseAscii( *ppcName ) )
+ if( rModelName.equalsIgnoreAsciiCaseAscii( *ppcName ) )
return true;
return false;
}
-} // namespace
-
-// ============================================================================
-
-DefinedNameModel::DefinedNameModel() :
- mnSheet( -1 ),
- mnFuncGroupId( -1 ),
- mbMacro( false ),
- mbFunction( false ),
- mbVBName( false ),
- mbHidden( false )
+OUString lclGetUpcaseModelName( const OUString& rModelName )
{
+ // TODO: i18n?
+ return rModelName.toAsciiUpperCase();
}
-// ============================================================================
-
-namespace {
-
-const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001;
-const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002;
-const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004;
-const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008;
-
void lclConvertRefFlags( sal_Int32& ornFlags, sal_Int32& ornAbsPos, sal_Int32& ornRelPos, sal_Int32 nBasePos, sal_Int32 nApiRelFlag, bool bRel )
{
if( getFlag( ornFlags, nApiRelFlag ) && !bRel )
@@ -235,7 +222,19 @@ Any lclConvertReference( const Any& rRefAny, const CellAddress& rBaseAddress, sa
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+
+DefinedNameModel::DefinedNameModel() :
+ mnSheet( -1 ),
+ mnFuncGroupId( -1 ),
+ mbMacro( false ),
+ mbFunction( false ),
+ mbVBName( false ),
+ mbHidden( false )
+{
+}
+
+// ============================================================================
DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
@@ -245,7 +244,7 @@ DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) :
const OUString& DefinedNameBase::getUpcaseModelName() const
{
if( maUpModelName.getLength() == 0 )
- maUpModelName = maModel.maName.toAsciiUpperCase();
+ maUpModelName = lclGetUpcaseModelName( maModel.maName );
return maUpModelName;
}
@@ -288,7 +287,7 @@ void DefinedNameBase::importOoxFormula( FormulaContext& rContext, sal_Int16 nBas
getFormulaParser().convertErrorToFormula( rContext, BIFF_ERR_NAME );
}
-void DefinedNameBase::importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm )
+void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm )
{
rContext.setBaseAddress( CellAddress( nBaseSheet, 0, 0 ) );
getFormulaParser().importFormula( rContext, rStrm );
@@ -314,7 +313,7 @@ void DefinedNameBase::extractReference( const ApiTokenSequence& rTokens )
DefinedName::DefinedName( const WorkbookHelper& rHelper ) :
DefinedNameBase( rHelper ),
mnTokenIndex( -1 ),
- mcBuiltinId( OOX_DEFNAME_UNKNOWN ),
+ mcBuiltinId( BIFF_DEFNAME_UNKNOWN ),
mnFmlaSize( 0 )
{
}
@@ -328,8 +327,11 @@ void DefinedName::importDefinedName( const AttributeList& rAttribs )
maModel.mbFunction = rAttribs.getBool( XML_function, false );
maModel.mbVBName = rAttribs.getBool( XML_vbProcedure, false );
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
- mcBuiltinId = lclGetBuiltinIdFromOox( maModel.maName );
mnCalcSheet = (maModel.mnSheet >= 0) ? getWorksheets().getCalcSheetIndex( maModel.mnSheet ) : -1;
+
+ /* Detect built-in state from name itself, there is no built-in flag.
+ Built-in names are prexixed with '_xlnm.' instead. */
+ mcBuiltinId = lclGetBuiltinIdFromPrefixedName( maModel.maName );
}
void DefinedName::setFormula( const OUString& rFormula )
@@ -337,7 +339,7 @@ void DefinedName::setFormula( const OUString& rFormula )
maModel.maFormula = rFormula;
}
-void DefinedName::importDefinedName( RecordInputStream& rStrm )
+void DefinedName::importDefinedName( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags;
rStrm >> nFlags;
@@ -347,17 +349,14 @@ void DefinedName::importDefinedName( RecordInputStream& rStrm )
// macro function/command, hidden flag
maModel.mnFuncGroupId = extractValue< sal_Int32 >( nFlags, 6, 9 );
- maModel.mbMacro = getFlag( nFlags, OOBIN_DEFNAME_MACRO );
- maModel.mbFunction = getFlag( nFlags, OOBIN_DEFNAME_FUNC );
- maModel.mbVBName = getFlag( nFlags, OOBIN_DEFNAME_VBNAME );
- maModel.mbHidden = getFlag( nFlags, OOBIN_DEFNAME_HIDDEN );
-
- // get builtin name index from name
- if( getFlag( nFlags, OOBIN_DEFNAME_BUILTIN ) )
- mcBuiltinId = lclGetBuiltinIdFromOob( maModel.maName );
- // unhide built-in names (_xlnm._FilterDatabase is always hidden)
- if( isBuiltinName() )
- maModel.mbHidden = false;
+ maModel.mbMacro = getFlag( nFlags, BIFF12_DEFNAME_MACRO );
+ maModel.mbFunction = getFlag( nFlags, BIFF12_DEFNAME_FUNC );
+ maModel.mbVBName = getFlag( nFlags, BIFF12_DEFNAME_VBNAME );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_DEFNAME_HIDDEN );
+
+ // get built-in name index from name
+ if( getFlag( nFlags, BIFF12_DEFNAME_BUILTIN ) )
+ mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName );
// store token array data
sal_Int64 nRecPos = rStrm.tell();
@@ -419,24 +418,22 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee
maModel.mbVBName = getFlag( nFlags, BIFF_DEFNAME_VBNAME );
maModel.mbHidden = getFlag( nFlags, BIFF_DEFNAME_HIDDEN );
- // get builtin name index from name
+ // get built-in name index from name
if( getFlag( nFlags, BIFF_DEFNAME_BUILTIN ) )
{
- OSL_ENSURE( maModel.maName.getLength() == 1, "DefinedName::importDefinedName - wrong builtin name" );
- if( maModel.maName.getLength() > 0 )
+ // name may be the built-in identifier or the built-in base name
+ if( maModel.maName.getLength() == 1 )
mcBuiltinId = maModel.maName[ 0 ];
+ else
+ mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName );
}
- /* In BIFF5, _xlnm._FilterDatabase appears as hidden user name without
+ /* In BIFF5, '_FilterDatabase' appears as hidden user name without
built-in flag, and even worse, localized. */
else if( (eBiff == BIFF5) && lclIsFilterDatabaseName( maModel.maName ) )
{
- mcBuiltinId = OOX_DEFNAME_FILTERDATABASE;
+ mcBuiltinId = BIFF_DEFNAME_FILTERDATABASE;
}
- // unhide built-in names (_xlnm._FilterDatabase is always hidden)
- if( isBuiltinName() )
- maModel.mbHidden = false;
-
// get sheet index for sheet-local names in BIFF5-BIFF8
switch( getBiff() )
{
@@ -486,18 +483,13 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee
void DefinedName::createNameObject()
{
- // do not create names for (macro) functions
+ // do not create names for (macro) functions or VBA procedures
// #163146# do not ignore hidden names (may be regular names created by VBA scripts)
- if( /*maModel.mbHidden ||*/ maModel.mbFunction )
+ if( /*maModel.mbHidden ||*/ maModel.mbFunction || maModel.mbVBName )
return;
- // convert original name to final Calc name
- if( maModel.mbVBName )
- maCalcName = maModel.maName;
- else if( isBuiltinName() )
- maCalcName = lclGetBuiltinName( mcBuiltinId );
- else
- maCalcName = maModel.maName; //! TODO convert to valid name
+ // convert original name to final Calc name (TODO: filter invalid characters from model name)
+ maCalcName = isBuiltinName() ? lclGetPrefixedName( mcBuiltinId ) : maModel.maName;
// #163146# do not rename sheet-local names by default, this breaks VBA scripts
#if 0
@@ -512,9 +504,9 @@ void DefinedName::createNameObject()
using namespace ::com::sun::star::sheet::NamedRangeFlag;
if( !isGlobalName() ) switch( mcBuiltinId )
{
- case OOX_DEFNAME_CRITERIA: nNameFlags = FILTER_CRITERIA; break;
- case OOX_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
- case OOX_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
+ case BIFF_DEFNAME_CRITERIA: nNameFlags = FILTER_CRITERIA; break;
+ case BIFF_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
+ case BIFF_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
}
// create the name and insert it into the document, maCalcName will be changed to the resulting name
@@ -532,7 +524,7 @@ void DefinedName::convertFormula()
// convert and set formula of the defined name
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
{
SimpleFormulaContext aContext( xTokens, true, false );
implImportOoxFormula( aContext );
@@ -547,10 +539,10 @@ void DefinedName::convertFormula()
case FILTER_UNKNOWN: break;
}
- // set builtin names (print ranges, repeated titles, filter ranges)
+ // set built-in names (print ranges, repeated titles, filter ranges)
if( !isGlobalName() ) switch( mcBuiltinId )
{
- case OOX_DEFNAME_PRINTAREA:
+ case BIFF_DEFNAME_PRINTAREA:
{
Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
ApiCellRangeList aPrintRanges;
@@ -559,7 +551,7 @@ void DefinedName::convertFormula()
xPrintAreas->setPrintAreas( ContainerHelper::vectorToSequence( aPrintRanges ) );
}
break;
- case OOX_DEFNAME_PRINTTITLES:
+ case BIFF_DEFNAME_PRINTTITLES:
{
Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
ApiCellRangeList aTitleRanges;
@@ -605,8 +597,8 @@ void DefinedName::implImportOoxFormula( FormulaContext& rContext )
{
if( mxFormula.get() )
{
- RecordInputStream aStrm( *mxFormula );
- importOobFormula( rContext, mnCalcSheet, aStrm );
+ SequenceInputStream aStrm( *mxFormula );
+ importBiff12Formula( rContext, mnCalcSheet, aStrm );
}
else
importOoxFormula( rContext, mnCalcSheet );
@@ -643,7 +635,7 @@ DefinedNameRef DefinedNamesBuffer::importDefinedName( const AttributeList& rAttr
return xDefName;
}
-void DefinedNamesBuffer::importDefinedName( RecordInputStream& rStrm )
+void DefinedNamesBuffer::importDefinedName( SequenceInputStream& rStrm )
{
createDefinedName()->importDefinedName( rStrm );
}
@@ -655,14 +647,20 @@ void DefinedNamesBuffer::importDefinedName( BiffInputStream& rStrm )
void DefinedNamesBuffer::finalizeImport()
{
- // first insert all names without formula definition into the document
+ // first insert all names without formula definition into the document, and insert them into the maps
for( DefNameVector::iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); aIt != aEnd; ++aIt )
{
DefinedNameRef xDefName = *aIt;
xDefName->createNameObject();
+ // map by sheet index and original model name
+ maModelNameMap[ SheetNameKey( xDefName->getLocalCalcSheet(), xDefName->getUpcaseModelName() ) ] = xDefName;
+ // map by sheet index and built-in identifier
+ if( !xDefName->isGlobalName() && xDefName->isBuiltinName() )
+ maBuiltinMap[ BuiltinKey( xDefName->getLocalCalcSheet(), xDefName->getBuiltinId() ) ] = xDefName;
+ // map by API formula token identifier
sal_Int32 nTokenIndex = xDefName->getTokenIndex();
if( nTokenIndex >= 0 )
- maDefNameMap[ nTokenIndex ] = xDefName;
+ maTokenIdMap[ nTokenIndex ] = xDefName;
}
/* Now convert all name formulas, so that the formula parser can find all
@@ -677,25 +675,22 @@ DefinedNameRef DefinedNamesBuffer::getByIndex( sal_Int32 nIndex ) const
DefinedNameRef DefinedNamesBuffer::getByTokenIndex( sal_Int32 nIndex ) const
{
- return maDefNameMap.get( nIndex );
+ return maTokenIdMap.get( nIndex );
}
DefinedNameRef DefinedNamesBuffer::getByModelName( const OUString& rModelName, sal_Int16 nCalcSheet ) const
{
- DefinedNameRef xGlobalName; // a found global name
- DefinedNameRef xLocalName; // a found local name
- for( DefNameVector::const_iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); (aIt != aEnd) && !xLocalName; ++aIt )
- {
- DefinedNameRef xCurrName = *aIt;
- if( xCurrName->getModelName() == rModelName )
- {
- if( xCurrName->getLocalCalcSheet() == nCalcSheet )
- xLocalName = xCurrName;
- else if( xCurrName->isGlobalName() )
- xGlobalName = xCurrName;
- }
- }
- return xLocalName.get() ? xLocalName : xGlobalName;
+ OUString aUpcaseName = lclGetUpcaseModelName( rModelName );
+ DefinedNameRef xDefName = maModelNameMap.get( SheetNameKey( nCalcSheet, aUpcaseName ) );
+ // lookup global name, if no local name exists
+ if( !xDefName && (nCalcSheet >= 0) )
+ xDefName = maModelNameMap.get( SheetNameKey( -1, aUpcaseName ) );
+ return xDefName;
+}
+
+DefinedNameRef DefinedNamesBuffer::getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const
+{
+ return maBuiltinMap.get( BuiltinKey( nCalcSheet, cBuiltinId ) );
}
DefinedNameRef DefinedNamesBuffer::createDefinedName()
@@ -709,4 +704,3 @@ DefinedNameRef DefinedNamesBuffer::createDefinedName()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 172530692923..e28608f728c6 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -26,19 +26,18 @@
************************************************************************/
#include "oox/xls/drawingfragment.hxx"
-#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/form/binding/XBindableValue.hpp>
-#include <com/sun/star/form/binding/XListEntrySink.hpp>
-#include <com/sun/star/form/binding/XListEntrySource.hpp>
-#include <com/sun/star/form/binding/XValueBinding.hpp>
-#include "properties.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/propertyset.hxx"
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <rtl/strbuf.hxx>
#include "oox/drawingml/connectorshapecontext.hxx"
#include "oox/drawingml/graphicshapecontext.hxx"
-#include "oox/drawingml/shapecontext.hxx"
-#include "oox/drawingml/shapegroupcontext.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/propertyset.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
#include "oox/xls/formulaparser.hxx"
@@ -46,40 +45,33 @@
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::NamedValue;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::form::binding::XBindableValue;
-using ::com::sun::star::form::binding::XListEntrySink;
-using ::com::sun::star::form::binding::XListEntrySource;
-using ::com::sun::star::form::binding::XValueBinding;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::oox::core::ContextHandlerRef;
-using ::oox::drawingml::ConnectorShapeContext;
-using ::oox::drawingml::GraphicalObjectFrameContext;
-using ::oox::drawingml::GraphicShapeContext;
-using ::oox::drawingml::Shape;
-using ::oox::drawingml::ShapePtr;
-using ::oox::drawingml::ShapeContext;
-using ::oox::drawingml::ShapeGroupContext;
-// no using's for ::oox::vml, that may clash with ::oox::drawingml types
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::script;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::oox::core;
+using namespace ::oox::drawingml;
+using namespace ::oox::ole;
+
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+// no using's for ::oox::vml, that may clash with ::oox::drawingml types
+
+// ============================================================================
+// DrawingML
+// ============================================================================
+
namespace {
/** Converts the passed 64-bit integer value from the passed unit to EMUs. */
@@ -418,19 +410,120 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c
// ============================================================================
-OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
+ShapeMacroAttacher::ShapeMacroAttacher( const OUString& rMacroName, const Reference< XShape >& rxShape ) :
+ VbaMacroAttacherBase( rMacroName ),
+ mxShape( rxShape )
+{
+}
+
+void ShapeMacroAttacher::attachMacro( const OUString& rMacroUrl )
+{
+ try
+ {
+ Reference< XEventsSupplier > xSupplier( mxShape, UNO_QUERY_THROW );
+ Reference< XNameReplace > xEvents( xSupplier->getEvents(), UNO_SET_THROW );
+ Sequence< PropertyValue > aEventProps( 2 );
+ aEventProps[ 0 ].Name = CREATE_OUSTRING( "EventType" );
+ aEventProps[ 0 ].Value <<= CREATE_OUSTRING( "Script" );
+ aEventProps[ 1 ].Name = CREATE_OUSTRING( "Script" );
+ aEventProps[ 1 ].Value <<= rMacroUrl;
+ xEvents->replaceByName( CREATE_OUSTRING( "OnClick" ), Any( aEventProps ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+Shape::Shape( const WorksheetHelper& rHelper, const AttributeList& rAttribs, const sal_Char* pcServiceName ) :
+ ::oox::drawingml::Shape( pcServiceName ),
+ WorksheetHelper( rHelper )
+{
+ OUString aMacro = rAttribs.getXString( XML_macro, OUString() );
+ if( aMacro.getLength() > 0 )
+ maMacroName = getFormulaParser().importMacroName( aMacro );
+}
+
+void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
+{
+ if( (maMacroName.getLength() > 0) && mxShape.is() )
+ {
+ VbaMacroAttacherRef xAttacher( new ShapeMacroAttacher( maMacroName, mxShape ) );
+ getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
+ }
+ ::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes );
+}
+
+// ============================================================================
+
+GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
+ const WorksheetHelper& rHelper, const ShapePtr& rxParentShape, const ShapePtr& rxShape ) :
+ ShapeGroupContext( rParent, rxParentShape, rxShape ),
+ WorksheetHelper( rHelper )
+{
+}
+
+/*static*/ ContextHandlerRef GroupShapeContext::createShapeContext( ContextHandler& rParent,
+ const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs,
+ const ShapePtr& rxParentShape, ShapePtr* pxShape )
+{
+ switch( nElement )
+ {
+ case XDR_TOKEN( sp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new ShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( cxnSp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new ConnectorShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( pic ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GraphicShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( graphicFrame ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GraphicalObjectFrameContext( rParent, rxParentShape, xShape, rHelper.getSheetType() != SHEETTYPE_CHARTSHEET );
+ }
+ case XDR_TOKEN( grpSp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GroupShapeContext( rParent, rHelper, rxParentShape, xShape );
+ }
+ }
+ return 0;
+}
+
+Reference< XFastContextHandler > SAL_CALL GroupShapeContext::createFastChildContext(
+ sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw (SAXException, RuntimeException)
+{
+ ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ), mpGroupShapePtr );
+ return xContext.get() ? xContext.get() : ShapeGroupContext::createFastChildContext( nElement, rxAttribs );
+}
+
+// ============================================================================
+
+DrawingFragment::DrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
mxDrawPage( rHelper.getDrawPage(), UNO_QUERY )
{
- OSL_ENSURE( mxDrawPage.is(), "OoxDrawingFragment::OoxDrawingFragment - missing drawing page" );
+ OSL_ENSURE( mxDrawPage.is(), "DrawingFragment::DrawingFragment - missing drawing page" );
maApiSheetSize = getDrawPageSize();
maEmuSheetSize.Width = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) );
maEmuSheetSize.Height = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -453,31 +546,19 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
case XDR_TOKEN( absoluteAnchor ):
case XDR_TOKEN( oneCellAnchor ):
case XDR_TOKEN( twoCellAnchor ):
+ {
switch( nElement )
{
- case XDR_TOKEN( sp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.CustomShape" ) );
- return new ShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( cxnSp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.ConnectorShape" ) );
- return new ConnectorShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( pic ):
- mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) );
- return new GraphicShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( graphicFrame ):
- mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
- return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, getSheetType() != SHEETTYPE_CHARTSHEET );
- case XDR_TOKEN( grpSp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
- return new ShapeGroupContext( *this, ShapePtr(), mxShape );
-
case XDR_TOKEN( from ):
case XDR_TOKEN( to ): return this;
case XDR_TOKEN( pos ): if( mxAnchor.get() ) mxAnchor->importPos( rAttribs ); break;
case XDR_TOKEN( ext ): if( mxAnchor.get() ) mxAnchor->importExt( rAttribs ); break;
case XDR_TOKEN( clientData ): if( mxAnchor.get() ) mxAnchor->importClientData( rAttribs ); break;
+
+ default: return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, ShapePtr(), &mxShape );
}
+ }
break;
case XDR_TOKEN( from ):
@@ -487,14 +568,14 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
case XDR_TOKEN( col ):
case XDR_TOKEN( row ):
case XDR_TOKEN( colOff ):
- case XDR_TOKEN( rowOff ): return this; // collect index in onEndElement()
+ case XDR_TOKEN( rowOff ): return this; // collect index in onCharacters()
}
break;
}
return 0;
}
-void OoxDrawingFragment::onEndElement( const OUString& rChars )
+void DrawingFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -502,8 +583,15 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
case XDR_TOKEN( row ):
case XDR_TOKEN( colOff ):
case XDR_TOKEN( rowOff ):
- if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getPreviousElement(), rChars );
+ if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getParentElement(), rChars );
break;
+ }
+}
+
+void DrawingFragment::onEndElement()
+{
+ switch( getCurrentElement() )
+ {
case XDR_TOKEN( absoluteAnchor ):
case XDR_TOKEN( oneCellAnchor ):
case XDR_TOKEN( twoCellAnchor ):
@@ -513,8 +601,15 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
if( (aShapeRect.X >= 0) && (aShapeRect.Y >= 0) && (aShapeRect.Width >= 0) && (aShapeRect.Height >= 0) )
{
mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aShapeRect );
- // collect all shape positions in the WorksheetHelper base class
- extendShapeBoundingBox( aShapeRect );
+ /* Collect all shape positions in the WorksheetHelper base
+ class. But first, scale EMUs to 1/100 mm. */
+ const UnitConverter& rUnitConv = getUnitConverter();
+ Rectangle aShapeRectHmm(
+ rUnitConv.scaleToMm100( aShapeRect.X, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Y, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Width, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Height, UNIT_EMU ) );
+ extendShapeBoundingBox( aShapeRectHmm );
}
}
mxShape.reset();
@@ -524,6 +619,8 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
}
// ============================================================================
+// VML
+// ============================================================================
namespace {
@@ -538,6 +635,8 @@ private:
sal_Int32 mnRow;
};
+// ----------------------------------------------------------------------------
+
VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) :
mnCol( rPos.Column ),
mnRow( rPos.Row )
@@ -546,18 +645,88 @@ VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) :
bool VmlFindNoteFunc::operator()( const ::oox::vml::ShapeBase& rShape ) const
{
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData;
- return rxClientData.get() && (rxClientData->mnCol == mnCol) && (rxClientData->mnRow == mnRow);
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ return pClientData && (pClientData->mnCol == mnCol) && (pClientData->mnRow == mnRow);
}
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+
+VmlControlMacroAttacher::VmlControlMacroAttacher( const OUString& rMacroName,
+ const Reference< XIndexContainer >& rxCtrlFormIC, sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle ) :
+ VbaMacroAttacherBase( rMacroName ),
+ mxCtrlFormIC( rxCtrlFormIC ),
+ mnCtrlIndex( nCtrlIndex ),
+ mnCtrlType( nCtrlType ),
+ mnDropStyle( nDropStyle )
+{
+}
+
+void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl )
+{
+ ScriptEventDescriptor aEventDesc;
+ aEventDesc.ScriptType = CREATE_OUSTRING( "Script" );
+ aEventDesc.ScriptCode = rMacroUrl;
+
+ // editable drop downs are treated like edit boxes
+ bool bEditDropDown = (mnCtrlType == XML_Drop) && (mnDropStyle == XML_ComboEdit);
+ sal_Int32 nCtrlType = bEditDropDown ? XML_Edit : mnCtrlType;
+
+ switch( nCtrlType )
+ {
+ case XML_Button:
+ case XML_Checkbox:
+ case XML_Radio:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XActionListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "actionPerformed" );
+ break;
+ case XML_Label:
+ case XML_GBox:
+ case XML_Dialog:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XMouseListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "mouseReleased" );
+ break;
+ case XML_Edit:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XTextListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "textChanged" );
+ break;
+ case XML_Spin:
+ case XML_Scroll:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XAdjustmentListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "adjustmentValueChanged" );
+ break;
+ case XML_List:
+ case XML_Drop:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XChangeListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "changed" );
+ break;
+ default:
+ OSL_ENSURE( false, "VmlControlMacroAttacher::attachMacro - unexpected object type" );
+ return;
+ }
+
+ try
+ {
+ Reference< XEventAttacherManager > xEventMgr( mxCtrlFormIC, UNO_QUERY_THROW );
+ xEventMgr->registerScriptEvent( mnCtrlIndex, aEventDesc );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
VmlDrawing::VmlDrawing( const WorksheetHelper& rHelper ) :
::oox::vml::Drawing( rHelper.getOoxFilter(), rHelper.getDrawPage(), ::oox::vml::VMLDRAWING_EXCEL ),
- WorksheetHelper( rHelper )
+ WorksheetHelper( rHelper ),
+ maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() )
{
+ // default font for legacy listboxes and dropdowns: Tahoma, 8pt
+ maListBoxFont.moName = CREATE_OUSTRING( "Tahoma" );
+ maListBoxFont.moColor = CREATE_OUSTRING( "auto" );
+ maListBoxFont.monSize = 160;
}
const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos ) const
@@ -567,11 +736,35 @@ const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos )
bool VmlDrawing::isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const
{
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData;
- return !rxClientData.get() || (rxClientData->mnObjType != XML_Note);
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ return !pClientData || (pClientData->mnObjType != XML_Note);
+}
+
+OUString VmlDrawing::getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const
+{
+ if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
+ {
+ switch( pClientData->mnObjType )
+ {
+ case XML_Button: return CREATE_OUSTRING( "Button" );
+ case XML_Checkbox: return CREATE_OUSTRING( "Check Box" );
+ case XML_Dialog: return CREATE_OUSTRING( "Dialog Frame" );
+ case XML_Drop: return CREATE_OUSTRING( "Drop Down" );
+ case XML_Edit: return CREATE_OUSTRING( "Edit Box" );
+ case XML_GBox: return CREATE_OUSTRING( "Group Box" );
+ case XML_Label: return CREATE_OUSTRING( "Label" );
+ case XML_List: return CREATE_OUSTRING( "List Box" );
+ case XML_Note: return CREATE_OUSTRING( "Comment" );
+ case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? CREATE_OUSTRING( "Object" ) : CREATE_OUSTRING( "Picture" );
+ case XML_Radio: return CREATE_OUSTRING( "Option Button" );
+ case XML_Scroll: return CREATE_OUSTRING( "Scroll Bar" );
+ case XML_Spin: return CREATE_OUSTRING( "Spinner" );
+ }
+ }
+ return ::oox::vml::Drawing::getShapeBaseName( rShape );
}
-bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const
+bool VmlDrawing::convertClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const
{
if( rShapeAnchor.getLength() == 0 )
return false;
@@ -581,71 +774,206 @@ bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUStrin
return (orShapeRect.Width >= 0) && (orShapeRect.Height >= 0);
}
-void VmlDrawing::convertControlClientData( const Reference< XControlModel >& rxCtrlModel,
- const ::oox::vml::ShapeClientData& rClientData ) const
+Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::ShapeBase& rShape,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
- if( rxCtrlModel.is() )
+ // simulate the legacy drawing controls with OLE form controls
+ OUString aShapeName = rShape.getShapeName();
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ if( (aShapeName.getLength() > 0) && pClientData )
{
- PropertySet aPropSet( rxCtrlModel );
+ Rectangle aShapeRect = rShapeRect;
+ const ::oox::vml::TextBox* pTextBox = rShape.getTextBox();
+ EmbeddedControl aControl( aShapeName );
+ switch( pClientData->mnObjType )
+ {
+ case XML_Button:
+ {
+ AxCommandButtonModel& rAxModel = aControl.createModel< AxCommandButtonModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_OPAQUE | AX_FLAGS_WORDWRAP;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
- // printable
- aPropSet.setProperty( PROP_Printable, rClientData.mbPrintObject );
+ case XML_Label:
+ {
+ AxLabelModel& rAxModel = aControl.createModel< AxLabelModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_WORDWRAP;
+ rAxModel.mnBorderStyle = AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
- // linked cell
- if( rClientData.maLinkedCell.getLength() > 0 ) try
- {
- Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW );
-
- // convert formula string to cell address
- FormulaParser& rParser = getFormulaParser();
- TokensFormulaContext aContext( true, false );
- aContext.setBaseAddress( CellAddress( getSheetIndex(), 0, 0 ) );
- rParser.importFormula( aContext, rClientData.maLinkedCell );
- CellAddress aAddress;
- if( rParser.extractCellAddress( aAddress, aContext.getTokens(), true ) )
+ case XML_Edit:
{
- // create argument sequence for createInstanceWithArguments()
- NamedValue aValue;
- aValue.Name = CREATE_OUSTRING( "BoundCell" );
- aValue.Value <<= aAddress;
- Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= aValue;
-
- // create the CellValueBinding instance and set at the control model
- Reference< XValueBinding > xBinding( getDocumentFactory()->createInstanceWithArguments(
- CREATE_OUSTRING( "com.sun.star.table.CellValueBinding" ), aArgs ), UNO_QUERY_THROW );
- xBindable->setValueBinding( xBinding );
+ bool bNumeric = (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_INTEGER) || (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_NUMBER);
+ AxMorphDataModelBase& rAxModel = bNumeric ?
+ static_cast< AxMorphDataModelBase& >( aControl.createModel< AxNumericFieldModel >() ) :
+ static_cast< AxMorphDataModelBase& >( aControl.createModel< AxTextBoxModel >() );
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maValue, pTextBox, pClientData->mnTextHAlign );
+ setFlag( rAxModel.mnFlags, AX_FLAGS_MULTILINE, pClientData->mbMultiLine );
+ setFlag( rAxModel.mnScrollBars, AX_SCROLLBAR_VERTICAL, pClientData->mbVScroll );
+ if( pClientData->mbSecretEdit )
+ rAxModel.mnPasswordChar = '*';
}
- }
- catch( Exception& )
- {
+ break;
+
+ case XML_GBox:
+ {
+ AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnBorderStyle = pClientData->mbNo3D ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_BUMPED;
+
+ /* Move top border of groupbox up by half font height, because
+ Excel specifies Y position of the groupbox border line
+ instead the top border of the caption text. */
+ if( const ::oox::vml::TextFontModel* pFontModel = pTextBox ? pTextBox->getFirstFont() : 0 )
+ {
+ sal_Int32 nFontHeightHmm = getUnitConverter().scaleToMm100( pFontModel->monSize.get( 160 ), UNIT_TWIP );
+ sal_Int32 nYDiff = ::std::min< sal_Int32 >( nFontHeightHmm / 2, aShapeRect.Y );
+ aShapeRect.Y -= nYDiff;
+ aShapeRect.Height += nYDiff;
+ }
+ }
+ break;
+
+ case XML_Checkbox:
+ {
+ AxCheckBoxModel& rAxModel = aControl.createModel< AxCheckBoxModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ convertControlBackground( rAxModel, rShape );
+ rAxModel.maValue = OUString::valueOf( pClientData->mnChecked );
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ bool bTriState = (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_UNCHECKED) && (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_CHECKED);
+ rAxModel.mnMultiSelect = bTriState ? AX_SELCTION_MULTI : AX_SELCTION_SINGLE;
+ }
+ break;
+
+ case XML_Radio:
+ {
+ AxOptionButtonModel& rAxModel = aControl.createModel< AxOptionButtonModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ convertControlBackground( rAxModel, rShape );
+ rAxModel.maValue = OUString::valueOf( pClientData->mnChecked );
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
+
+ case XML_List:
+ {
+ AxListBoxModel& rAxModel = aControl.createModel< AxListBoxModel >();
+ convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
+ rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ switch( pClientData->mnSelType )
+ {
+ case XML_Single: rAxModel.mnMultiSelect = AX_SELCTION_SINGLE; break;
+ case XML_Multi: rAxModel.mnMultiSelect = AX_SELCTION_MULTI; break;
+ case XML_Extend: rAxModel.mnMultiSelect = AX_SELCTION_EXTENDED; break;
+ }
+ }
+ break;
+
+ case XML_Drop:
+ {
+ AxComboBoxModel& rAxModel = aControl.createModel< AxComboBoxModel >();
+ convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
+ rAxModel.mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN;
+ rAxModel.mnShowDropButton = AX_SHOWDROPBUTTON_ALWAYS;
+ rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnListRows = pClientData->mnDropLines;
+ }
+ break;
+
+ case XML_Spin:
+ {
+ AxSpinButtonModel& rAxModel = aControl.createModel< AxSpinButtonModel >();
+ rAxModel.mnMin = pClientData->mnMin;
+ rAxModel.mnMax = pClientData->mnMax;
+ rAxModel.mnPosition = pClientData->mnVal;
+ rAxModel.mnSmallChange = pClientData->mnInc;
+ }
+ break;
+
+ case XML_Scroll:
+ {
+ AxScrollBarModel& rAxModel = aControl.createModel< AxScrollBarModel >();
+ rAxModel.mnMin = pClientData->mnMin;
+ rAxModel.mnMax = pClientData->mnMax;
+ rAxModel.mnPosition = pClientData->mnVal;
+ rAxModel.mnSmallChange = pClientData->mnInc;
+ rAxModel.mnLargeChange = pClientData->mnPage;
+ }
+ break;
+
+ case XML_Dialog:
+ {
+ // fake with a group box
+ AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, XML_Left );
+ rAxModel.mnBorderStyle = AX_BORDERSTYLE_SINGLE;
+ rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
+ }
+ break;
}
- // source range
- if( rClientData.maSourceRange.getLength() > 0 ) try
+ if( ControlModelBase* pAxModel = aControl.getModel() )
{
- Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW );
-
- // convert formula string to cell range
- FormulaParser& rParser = getFormulaParser();
- TokensFormulaContext aContext( true, false );
- aContext.setBaseAddress( CellAddress( getSheetIndex(), 0, 0 ) );
- rParser.importFormula( aContext, rClientData.maSourceRange );
- CellRangeAddress aRange;
- if( rParser.extractCellRange( aRange, aContext.getTokens(), true ) )
+ // create the control shape
+ pAxModel->maSize.first = aShapeRect.Width;
+ pAxModel->maSize.second = aShapeRect.Height;
+ sal_Int32 nCtrlIndex = -1;
+ Reference< XShape > xShape = createAndInsertXControlShape( aControl, rxShapes, aShapeRect, nCtrlIndex );
+
+ // control shape macro
+ if( xShape.is() && (nCtrlIndex >= 0) && (pClientData->maFmlaMacro.getLength() > 0) )
{
- // create argument sequence for createInstanceWithArguments()
- NamedValue aValue;
- aValue.Name = CREATE_OUSTRING( "CellRange" );
- aValue.Value <<= aRange;
- Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= aValue;
-
- // create the EntrySource instance and set at the control model
- Reference< XListEntrySource > xEntrySource( getDocumentFactory()->createInstanceWithArguments(
- CREATE_OUSTRING( "com.sun.star.table.CellRangeListSource" ), aArgs ), UNO_QUERY_THROW );
- xEntrySink->setListEntrySource( xEntrySource );
+ OUString aMacroName = getFormulaParser().importMacroName( pClientData->maFmlaMacro );
+ if( aMacroName.getLength() > 0 )
+ {
+ Reference< XIndexContainer > xFormIC = getControlForm().getXForm();
+ VbaMacroAttacherRef xAttacher( new VmlControlMacroAttacher( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle ) );
+ getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
+ }
}
+
+ return xShape;
+ }
+ }
+
+ return Reference< XShape >();
+}
+
+void VmlDrawing::notifyXShapeInserted( const Reference< XShape >& rxShape,
+ const Rectangle& rShapeRect, const ::oox::vml::ShapeBase& rShape, bool bGroupChild )
+{
+ // collect all shape positions in the WorksheetHelper base class (but not children of group shapes)
+ if( !bGroupChild )
+ extendShapeBoundingBox( rShapeRect );
+
+ // convert settings from VML client data
+ if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
+ {
+ // specific settings for embedded form controls
+ try
+ {
+ Reference< XControlShape > xCtrlShape( rxShape, UNO_QUERY_THROW );
+ Reference< XControlModel > xCtrlModel( xCtrlShape->getControl(), UNO_SET_THROW );
+ PropertySet aPropSet( xCtrlModel );
+
+ // printable
+ aPropSet.setProperty( PROP_Printable, pClientData->mbPrintObject );
+
+ // control source links
+ if( (pClientData->maFmlaLink.getLength() > 0) || (pClientData->maFmlaRange.getLength() > 0) )
+ maControlConv.bindToSources( xCtrlModel, pClientData->maFmlaLink, pClientData->maFmlaRange, getSheetIndex() );
}
catch( Exception& )
{
@@ -653,21 +981,113 @@ void VmlDrawing::convertControlClientData( const Reference< XControlModel >& rxC
}
}
-void VmlDrawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& rShapeRect )
+// private --------------------------------------------------------------------
+
+sal_uInt32 VmlDrawing::convertControlTextColor( const OUString& rTextColor ) const
{
- // collect all shape positions in the WorksheetHelper base class
- extendShapeBoundingBox( rShapeRect );
+ // color attribute not present or 'auto' - use passed default color
+ if( (rTextColor.getLength() == 0) || rTextColor.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "auto" ) ) )
+ return AX_SYSCOLOR_WINDOWTEXT;
+
+ if( rTextColor[ 0 ] == '#' )
+ {
+ // RGB colors in the format '#RRGGBB'
+ if( rTextColor.getLength() == 7 )
+ return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toInt32( 16 ) );
+
+ // RGB colors in the format '#RGB'
+ if( rTextColor.getLength() == 4 )
+ {
+ sal_Int32 nR = rTextColor.copy( 1, 1 ).toInt32( 16 ) * 0x11;
+ sal_Int32 nG = rTextColor.copy( 2, 1 ).toInt32( 16 ) * 0x11;
+ sal_Int32 nB = rTextColor.copy( 3, 1 ).toInt32( 16 ) * 0x11;
+ return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB );
+ }
+
+ OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" ).
+ append( OUStringToOString( rTextColor, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() );
+ return AX_SYSCOLOR_WINDOWTEXT;
+ }
+
+ const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+
+ /* Predefined color names or system color names (resolve to RGB to detect
+ valid color name). */
+ sal_Int32 nColorToken = AttributeConversion::decodeToken( rTextColor );
+ sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT );
+ if( nRgbValue == API_RGB_TRANSPARENT )
+ nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT );
+ if( nRgbValue != API_RGB_TRANSPARENT )
+ return OleHelper::encodeOleColor( nRgbValue );
+
+ // try palette color
+ return OleHelper::encodeOleColor( rGraphicHelper.getPaletteColor( rTextColor.toInt32() ) );
+}
+
+void VmlDrawing::convertControlFontData( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, const ::oox::vml::TextFontModel& rFontModel ) const
+{
+ if( rFontModel.moName.has() )
+ rAxFontData.maFontName = rFontModel.moName.get();
+
+ // font height: convert from twips to points, then to internal representation of AX controls
+ rAxFontData.setHeightPoints( static_cast< sal_Int16 >( (rFontModel.monSize.get( 200 ) + 10) / 20 ) );
+
+ // font effects
+ rAxFontData.mnFontEffects = 0;
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_BOLD, rFontModel.mobBold.get( false ) );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_ITALIC, rFontModel.mobItalic.get( false ) );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, rFontModel.mobStrikeout.get( false ) );
+ sal_Int32 nUnderline = rFontModel.monUnderline.get( XML_none );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, nUnderline != XML_none );
+ rAxFontData.mbDblUnderline = nUnderline == XML_double;
+
+ // font color
+ rnOleTextColor = convertControlTextColor( rFontModel.moColor.get( OUString() ) );
+}
+
+void VmlDrawing::convertControlText( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor,
+ OUString& rCaption, const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const
+{
+ if( pTextBox )
+ {
+ rCaption = pTextBox->getText();
+ if( const ::oox::vml::TextFontModel* pFontModel = pTextBox->getFirstFont() )
+ convertControlFontData( rAxFontData, rnOleTextColor, *pFontModel );
+ }
+
+ switch( nTextHAlign )
+ {
+ case XML_Left: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT; break;
+ case XML_Center: rAxFontData.mnHorAlign = AX_FONTDATA_CENTER; break;
+ case XML_Right: rAxFontData.mnHorAlign = AX_FONTDATA_RIGHT; break;
+ default: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT;
+ }
+}
+
+void VmlDrawing::convertControlBackground( AxMorphDataModelBase& rAxModel, const ::oox::vml::ShapeBase& rShape ) const
+{
+ const ::oox::vml::FillModel& rFillModel = rShape.getTypeModel().maFillModel;
+ bool bHasFill = rFillModel.moFilled.get( true );
+ setFlag( rAxModel.mnFlags, AX_FLAGS_OPAQUE, bHasFill );
+ if( bHasFill )
+ {
+ const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+ sal_Int32 nSysWindowColor = rGraphicHelper.getSystemColor( XML_window, API_RGB_WHITE );
+ ::oox::drawingml::Color aColor = ::oox::vml::ConversionHelper::decodeColor( rGraphicHelper, rFillModel.moColor, rFillModel.moOpacity, nSysWindowColor );
+ sal_Int32 nRgbValue = aColor.getColor( rGraphicHelper );
+ rAxModel.mnBackColor = OleHelper::encodeOleColor( nRgbValue );
+ }
}
// ============================================================================
-OoxVmlDrawingFragment::OoxVmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+VmlDrawingFragment::VmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
::oox::vml::DrawingFragment( rHelper.getOoxFilter(), rFragmentPath, rHelper.getVmlDrawing() ),
WorksheetHelper( rHelper )
{
}
-void OoxVmlDrawingFragment::finalizeImport()
+void VmlDrawingFragment::finalizeImport()
{
::oox::vml::DrawingFragment::finalizeImport();
getVmlDrawing().convertAndInsert();
@@ -677,4 +1097,3 @@ void OoxVmlDrawingFragment::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx
index bde3dd65d723..53c0a3b83bf2 100644
--- a/oox/source/xls/excelchartconverter.cxx
+++ b/oox/source/xls/excelchartconverter.cxx
@@ -26,30 +26,30 @@
************************************************************************/
#include "oox/xls/excelchartconverter.hxx"
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include "oox/drawingml/chart/datasourcemodel.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::data::XDataProvider;
-using ::com::sun::star::chart2::data::XDataReceiver;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::drawingml::chart::DataSequenceModel;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::drawingml::chart::DataSequenceModel;
+using ::rtl::OUString;
+
+// ============================================================================
+
ExcelChartConverter::ExcelChartConverter( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
{
@@ -122,4 +122,3 @@ Reference< XDataSequence > ExcelChartConverter::createDataSequence(
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx
index 5affbfff44a7..aeac1494c338 100644
--- a/oox/source/xls/excelfilter.cxx
+++ b/oox/source/xls/excelfilter.cxx
@@ -26,36 +26,35 @@
************************************************************************/
#include "oox/xls/excelfilter.hxx"
+
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include "oox/dump/biffdumper.hxx"
+#include "oox/dump/xlsbdumper.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/xls/biffdetector.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelchartconverter.hxx"
+#include "oox/xls/excelvbaproject.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/workbookfragment.hxx"
-#include "oox/dump/biffdumper.hxx"
-#include "oox/dump/xlsbdumper.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::xml::sax::XFastDocumentHandler;
-using ::oox::core::BinaryFilterBase;
-using ::oox::core::FragmentHandlerRef;
-using ::oox::core::Relation;
-using ::oox::core::Relations;
-using ::oox::core::XmlFilterBase;
-using ::oox::drawingml::table::TableStyleListPtr;
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+using ::oox::drawingml::table::TableStyleListPtr;
+
+// ============================================================================
+
ExcelFilterBase::ExcelFilterBase() :
mpData( 0 )
{
@@ -86,26 +85,27 @@ void ExcelFilterBase::unregisterWorkbookData()
OUString SAL_CALL ExcelFilter_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelFilter" );
}
Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw()
{
- OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" );
- Sequence< OUString > aSeq( &aServiceName, 1 );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL ExcelFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-ExcelFilter::ExcelFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- XmlFilterBase( rxGlobalFactory )
+ExcelFilter::ExcelFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ XmlFilterBase( rxContext )
{
}
@@ -121,12 +121,12 @@ bool ExcelFilter::importDocument() throw()
this variable (nonpro only). */
OOX_DUMP_FILE( ::oox::dump::xlsb::Dumper );
- OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) );
+ OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) );
if( aWorkbookPath.getLength() == 0 )
return false;
WorkbookHelperRoot aHelper( *this );
- return aHelper.isValid() && importFragment( new OoxWorkbookFragment( aHelper, aWorkbookPath ) );
+ return aHelper.isValid() && importFragment( new WorkbookFragment( aHelper, aWorkbookPath ) );
}
bool ExcelFilter::exportDocument() throw()
@@ -159,6 +159,11 @@ GraphicHelper* ExcelFilter::implCreateGraphicHelper() const
return new ExcelGraphicHelper( getWorkbookData() );
}
+::oox::ole::VbaProject* ExcelFilter::implCreateVbaProject() const
+{
+ return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
OUString ExcelFilter::implGetImplementationName() const
{
return ExcelFilter_getImplementationName();
@@ -168,26 +173,27 @@ OUString ExcelFilter::implGetImplementationName() const
OUString SAL_CALL ExcelBiffFilter_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" );
}
Sequence< OUString > SAL_CALL ExcelBiffFilter_getSupportedServiceNames() throw()
{
- OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" );
- Sequence< OUString > aSeq( &aServiceName, 1 );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL ExcelBiffFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-ExcelBiffFilter::ExcelBiffFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- BinaryFilterBase( rxGlobalFactory )
+ExcelBiffFilter::ExcelBiffFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ BinaryFilterBase( rxContext )
{
}
@@ -233,6 +239,11 @@ GraphicHelper* ExcelBiffFilter::implCreateGraphicHelper() const
return new ExcelGraphicHelper( getWorkbookData() );
}
+::oox::ole::VbaProject* ExcelBiffFilter::implCreateVbaProject() const
+{
+ return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
OUString ExcelBiffFilter::implGetImplementationName() const
{
return ExcelBiffFilter_getImplementationName();
@@ -240,5 +251,64 @@ OUString ExcelBiffFilter::implGetImplementationName() const
// ============================================================================
+OUString SAL_CALL ExcelVbaProjectFilter_getImplementationName() throw()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" );
+}
+
+Sequence< OUString > SAL_CALL ExcelVbaProjectFilter_getSupportedServiceNames() throw()
+{
+ Sequence< OUString > aSeq( 1 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ return aSeq;
+}
+
+Reference< XInterface > SAL_CALL ExcelVbaProjectFilter_createInstance(
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
+{
+ return static_cast< ::cppu::OWeakObject* >( new ExcelVbaProjectFilter( rxContext ) );
+}
+
+// ----------------------------------------------------------------------------
+
+ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ ExcelBiffFilter( rxContext )
+{
+}
+
+bool ExcelVbaProjectFilter::importDocument() throw()
+{
+ // detect BIFF version and workbook stream name
+ OUString aWorkbookName;
+ BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() );
+ OSL_ENSURE( eBiff == BIFF8, "ExcelVbaProjectFilter::ExcelVbaProjectFilter - invalid file format" );
+ if( eBiff != BIFF8 )
+ return false;
+
+ StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false );
+ if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() )
+ return false;
+
+ WorkbookHelperRoot aHelper( *this, eBiff );
+ // set palette colors passed in service constructor
+ Any aPalette = getArgument( CREATE_OUSTRING( "ColorPalette" ) );
+ aHelper.getStyles().importPalette( aPalette );
+ // import the VBA project
+ getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
+ return true;
+}
+
+bool ExcelVbaProjectFilter::exportDocument() throw()
+{
+ return false;
+}
+
+OUString ExcelVbaProjectFilter::implGetImplementationName() const
+{
+ return ExcelVbaProjectFilter_getImplementationName();
+}
+
+// ============================================================================
+
} // namespace xls
} // namespace oox
diff --git a/oox/source/xls/excelhandlers.cxx b/oox/source/xls/excelhandlers.cxx
index aaf551424483..1ffad94d52f1 100644
--- a/oox/source/xls/excelhandlers.cxx
+++ b/oox/source/xls/excelhandlers.cxx
@@ -26,20 +26,23 @@
************************************************************************/
#include "oox/xls/excelhandlers.hxx"
+
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::oox::core::FilterBase;
-using ::oox::core::FragmentHandler2;
-
namespace oox {
namespace xls {
// ============================================================================
+
+using ::oox::core::FilterBase;
+using ::oox::core::FragmentHandler2;
+using ::rtl::OUString;
+
+// ============================================================================
// ============================================================================
-OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
+WorkbookFragmentBase::WorkbookFragmentBase(
const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
WorkbookHelper( rHelper )
@@ -48,14 +51,14 @@ OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
// ============================================================================
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetFragmentBase::WorksheetFragmentBase( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
- WorksheetHelperRoot( rHelper, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
{
}
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
+WorksheetFragmentBase::WorksheetFragmentBase(
const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
WorksheetHelperRoot( rHelper )
@@ -65,108 +68,52 @@ OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
// ============================================================================
// ============================================================================
-namespace {
-
-const sal_uInt16 BIFF_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals.
-const sal_uInt16 BIFF_BOF_MODULE = 0x0006; /// BIFF5-BIFF8 Visual Basic module.
-const sal_uInt16 BIFF_BOF_SHEET = 0x0010; /// BIFF2-BIFF8 worksheet/dialog sheet.
-const sal_uInt16 BIFF_BOF_CHART = 0x0020; /// BIFF2-BIFF8 chart sheet.
-const sal_uInt16 BIFF_BOF_MACRO = 0x0040; /// BIFF4-BIFF8 macro sheet.
-const sal_uInt16 BIFF_BOF_WORKSPACE = 0x0100; /// BIFF3-BIFF8 workspace.
-
-} // namespace
-
-// ============================================================================
-
-BiffHandlerBase::~BiffHandlerBase()
-{
-}
-
-bool BiffHandlerBase::skipRecordBlock( sal_uInt16 nEndRecId )
-{
- sal_uInt16 nStartRecId = mrStrm.getRecId();
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != nEndRecId) )
- if( mrStrm.getRecId() == nStartRecId )
- skipRecordBlock( nEndRecId );
- return !mrStrm.isEof() && (mrStrm.getRecId() == nEndRecId);
-}
-
-bool BiffHandlerBase::isBofRecord() const
-{
- return
- (mrStrm.getRecId() == BIFF2_ID_BOF) ||
- (mrStrm.getRecId() == BIFF3_ID_BOF) ||
- (mrStrm.getRecId() == BIFF4_ID_BOF) ||
- (mrStrm.getRecId() == BIFF5_ID_BOF);
-}
-
-// ============================================================================
-
-BiffContextHandler::BiffContextHandler( const BiffHandlerBase& rParent ) :
- BiffHandlerBase( rParent )
+BiffContextHandler::~BiffContextHandler()
{
}
-// ============================================================================
-
-namespace prv {
-
-BiffFragmentStreamOwner::BiffFragmentStreamOwner( const FilterBase& rFilter, const OUString& rStrmName )
-{
- // do not automatically close the root stream (indicated by empty stream name)
- mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), rStrmName.getLength() > 0 ) );
- mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
-}
+// ----------------------------------------------------------------------------
-BiffFragmentStreamOwner::~BiffFragmentStreamOwner()
+BiffWorkbookContextBase::BiffWorkbookContextBase( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
{
}
-} // namespace prv
-
// ----------------------------------------------------------------------------
-BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName ) :
- prv::BiffFragmentStreamOwner( rFilter, rStrmName ),
- BiffHandlerBase( *mxBiffStrm )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorkbookHelper& rHelper,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
{
}
-BiffFragmentHandler::BiffFragmentHandler( const BiffFragmentHandler& rHandler ) :
- prv::BiffFragmentStreamOwner( rHandler ),
- BiffHandlerBase( rHandler )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorksheetHelper& rHelper ) :
+ WorksheetHelperRoot( rHelper )
{
}
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
-{
- return mrStrm.startNextRecord() ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+// ============================================================================
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
-{
- return mrStrm.startRecordByHandle( nRecHandle ) ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+namespace {
-bool BiffFragmentHandler::skipFragment()
-{
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- if( isBofRecord() )
- skipFragment();
- return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
+const sal_uInt16 BIFF_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals.
+const sal_uInt16 BIFF_BOF_MODULE = 0x0006; /// BIFF5-BIFF8 Visual Basic module.
+const sal_uInt16 BIFF_BOF_SHEET = 0x0010; /// BIFF2-BIFF8 worksheet/dialog sheet.
+const sal_uInt16 BIFF_BOF_CHART = 0x0020; /// BIFF2-BIFF8 chart sheet.
+const sal_uInt16 BIFF_BOF_MACRO = 0x0040; /// BIFF4-BIFF8 macro sheet.
+const sal_uInt16 BIFF_BOF_WORKSPACE = 0x0100; /// BIFF3-BIFF8 workspace.
-BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
+BiffFragmentType lclStartFragment( BiffInputStream& rStrm, BiffType eBiff )
{
BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
/* #i23425# Don't rely on BOF record ID to read BOF contents, but on
the detected BIFF version. */
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// BOF is always written unencrypted
- mrStrm.enableDecoder( false );
- mrStrm.skip( 2 );
- sal_uInt16 nType = mrStrm.readuInt16();
+ rStrm.enableDecoder( false );
+ rStrm.skip( 2 );
+ sal_uInt16 nType = rStrm.readuInt16();
// decide which fragment types are valid for current BIFF version
switch( eBiff )
@@ -219,30 +166,64 @@ BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
return eFragment;
}
-// ============================================================================
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName )
+{
+ // do not automatically close the root stream (indicated by empty stream name)
+ bool bRootStrm = rStrmName.getLength() == 0;
+ mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), !bRootStrm ) );
+ mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
+}
+
+BiffFragmentHandler::~BiffFragmentHandler()
+{
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
+{
+ return mxBiffStrm->startNextRecord() ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
+{
+ return mxBiffStrm->startRecordByHandle( nRecHandle ) ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+bool BiffFragmentHandler::skipFragment()
+{
+ while( mxBiffStrm->startNextRecord() && (mxBiffStrm->getRecId() != BIFF_ID_EOF) )
+ if( BiffHelper::isBofRecord( *mxBiffStrm ) )
+ skipFragment();
+ return !mxBiffStrm->isEof() && (mxBiffStrm->getRecId() == BIFF_ID_EOF);
+}
+
+// ----------------------------------------------------------------------------
BiffWorkbookFragmentBase::BiffWorkbookFragmentBase( const WorkbookHelper& rHelper, const OUString& rStrmName, bool bCloneDecoder ) :
BiffFragmentHandler( rHelper.getBaseFilter(), rStrmName ),
WorkbookHelper( rHelper )
{
if( bCloneDecoder )
- getCodecHelper().cloneDecoder( mrStrm );
+ getCodecHelper().cloneDecoder( getInputStream() );
}
-// ============================================================================
+// ----------------------------------------------------------------------------
BiffWorksheetFragmentBase::BiffWorksheetFragmentBase( const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
BiffFragmentHandler( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
{
}
-// ============================================================================
+// ----------------------------------------------------------------------------
-BiffSkipWorksheetFragment::BiffSkipWorksheetFragment(
- const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
+BiffSkipWorksheetFragment::BiffSkipWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
{
}
@@ -256,4 +237,3 @@ bool BiffSkipWorksheetFragment::importFragment()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx
index ee22dc8398ba..7fc8115cc680 100755
--- a/oox/source/xls/excelvbaproject.cxx
+++ b/oox/source/xls/excelvbaproject.cxx
@@ -38,7 +38,6 @@
#include <rtl/ustrbuf.hxx>
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "properties.hxx"
namespace oox {
namespace xls {
@@ -58,25 +57,12 @@ using ::rtl::OUStringBuffer;
// ============================================================================
-ExcelVbaProject::ExcelVbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) :
- ::oox::ole::VbaProject( rxGlobalFactory, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ),
+ExcelVbaProject::ExcelVbaProject( const Reference< XComponentContext >& rxContext, const Reference< XSpreadsheetDocument >& rxDocument ) :
+ ::oox::ole::VbaProject( rxContext, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ),
mxDocument( rxDocument )
{
}
-void ExcelVbaProject::createMissingModules()
-{
- /* !! HACK !! This function is called from old XLS filter only, must be
- removed when this filter uses the OOX VBA import instead of the old SVX
- VBA import.
- */
-
- // collect and register all sheets without codenames
- prepareImport();
- // manually create the registered dummy modules
- createDummyModules();
-}
-
// protected ------------------------------------------------------------------
namespace {
diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx
index 04fcd2f84648..683ac3582071 100644
--- a/oox/source/xls/externallinkbuffer.cxx
+++ b/oox/source/xls/externallinkbuffer.cxx
@@ -26,7 +26,7 @@
************************************************************************/
#include "oox/xls/externallinkbuffer.hxx"
-#include <rtl/strbuf.hxx>
+
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/DDELinkInfo.hpp>
#include <com/sun/star/sheet/ExternalLinkType.hpp>
@@ -38,53 +38,44 @@
#include <com/sun/star/sheet/XDDELinkResults.hpp>
#include <com/sun/star/sheet/XExternalDocLink.hpp>
#include <com/sun/star/sheet/XExternalDocLinks.hpp>
-#include "oox/helper/attributelist.hxx"
+#include <rtl/strbuf.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheetbuffer.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::Relation;
+using ::oox::core::Relations;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::DDEItemInfo;
-using ::com::sun::star::sheet::DDELinkInfo;
-using ::com::sun::star::sheet::ExternalLinkInfo;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XDDELinks;
-using ::com::sun::star::sheet::XDDELinkResults;
-using ::com::sun::star::sheet::XExternalDocLinks;
-using ::com::sun::star::sheet::XExternalSheetCache;
-using ::oox::core::Relation;
-using ::oox::core::Relations;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-const sal_uInt16 OOBIN_EXTERNALBOOK_BOOK = 0;
-const sal_uInt16 OOBIN_EXTERNALBOOK_DDE = 1;
-const sal_uInt16 OOBIN_EXTERNALBOOK_OLE = 2;
+const sal_uInt16 BIFF12_EXTERNALBOOK_BOOK = 0;
+const sal_uInt16 BIFF12_EXTERNALBOOK_DDE = 1;
+const sal_uInt16 BIFF12_EXTERNALBOOK_OLE = 2;
-const sal_uInt16 OOBIN_EXTNAME_AUTOMATIC = 0x0002;
-const sal_uInt16 OOBIN_EXTNAME_PREFERPIC = 0x0004;
-const sal_uInt16 OOBIN_EXTNAME_STDDOCNAME = 0x0008;
-const sal_uInt16 OOBIN_EXTNAME_OLEOBJECT = 0x0010;
-const sal_uInt16 OOBIN_EXTNAME_ICONIFIED = 0x0020;
+const sal_uInt16 BIFF12_EXTNAME_AUTOMATIC = 0x0002;
+const sal_uInt16 BIFF12_EXTNAME_PREFERPIC = 0x0004;
+const sal_uInt16 BIFF12_EXTNAME_STDDOCNAME = 0x0008;
+const sal_uInt16 BIFF12_EXTNAME_OLEOBJECT = 0x0010;
+const sal_uInt16 BIFF12_EXTNAME_ICONIFIED = 0x0020;
const sal_uInt16 BIFF_EXTNAME_BUILTIN = 0x0001;
const sal_uInt16 BIFF_EXTNAME_AUTOMATIC = 0x0002;
@@ -150,54 +141,54 @@ void ExternalName::importOleItem( const AttributeList& rAttribs )
maExtNameModel.mbIconified = rAttribs.getBool( XML_icon, false );
}
-void ExternalName::importExternalName( RecordInputStream& rStrm )
+void ExternalName::importExternalName( SequenceInputStream& rStrm )
{
rStrm >> maModel.maName;
OSL_ENSURE( maModel.maName.getLength() > 0, "ExternalName::importExternalName - empty name" );
}
-void ExternalName::importExternalNameFlags( RecordInputStream& rStrm )
+void ExternalName::importExternalNameFlags( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
sal_Int32 nSheetId;
rStrm >> nFlags >> nSheetId;
- // index into sheet list of EXTSHEETNAMES (one-based in OOBIN)
+ // index into sheet list of EXTSHEETNAMES (one-based in BIFF12)
maModel.mnSheet = nSheetId - 1;
- // no flag for built-in names, as in OOX...
- maExtNameModel.mbNotify = getFlag( nFlags, OOBIN_EXTNAME_AUTOMATIC );
- maExtNameModel.mbPreferPic = getFlag( nFlags, OOBIN_EXTNAME_PREFERPIC );
- maExtNameModel.mbStdDocName = getFlag( nFlags, OOBIN_EXTNAME_STDDOCNAME );
- maExtNameModel.mbOleObj = getFlag( nFlags, OOBIN_EXTNAME_OLEOBJECT );
- maExtNameModel.mbIconified = getFlag( nFlags, OOBIN_EXTNAME_ICONIFIED );
+ // no flag for built-in names, as in OOXML...
+ maExtNameModel.mbNotify = getFlag( nFlags, BIFF12_EXTNAME_AUTOMATIC );
+ maExtNameModel.mbPreferPic = getFlag( nFlags, BIFF12_EXTNAME_PREFERPIC );
+ maExtNameModel.mbStdDocName = getFlag( nFlags, BIFF12_EXTNAME_STDDOCNAME );
+ maExtNameModel.mbOleObj = getFlag( nFlags, BIFF12_EXTNAME_OLEOBJECT );
+ maExtNameModel.mbIconified = getFlag( nFlags, BIFF12_EXTNAME_ICONIFIED );
OSL_ENSURE( (mrParentLink.getLinkType() == LINKTYPE_OLE) == maExtNameModel.mbOleObj,
"ExternalName::importExternalNameFlags - wrong OLE flag in external name" );
}
-void ExternalName::importDdeItemValues( RecordInputStream& rStrm )
+void ExternalName::importDdeItemValues( SequenceInputStream& rStrm )
{
sal_Int32 nRows, nCols;
rStrm >> nRows >> nCols;
setResultSize( nCols, nRows );
}
-void ExternalName::importDdeItemBool( RecordInputStream& rStrm )
+void ExternalName::importDdeItemBool( SequenceInputStream& rStrm )
{
appendResultValue< double >( (rStrm.readuInt8() == 0) ? 0.0 : 1.0 );
}
-void ExternalName::importDdeItemDouble( RecordInputStream& rStrm )
+void ExternalName::importDdeItemDouble( SequenceInputStream& rStrm )
{
appendResultValue( rStrm.readDouble() );
}
-void ExternalName::importDdeItemError( RecordInputStream& rStrm )
+void ExternalName::importDdeItemError( SequenceInputStream& rStrm )
{
appendResultValue( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) );
}
-void ExternalName::importDdeItemString( RecordInputStream& rStrm )
+void ExternalName::importDdeItemString( SequenceInputStream& rStrm )
{
- appendResultValue( rStrm.readString() );
+ appendResultValue( BiffHelper::readString( rStrm ) );
}
void ExternalName::importExternalName( BiffInputStream& rStrm )
@@ -322,8 +313,8 @@ sal_Int32 ExternalName::getSheetCacheIndex() const
sal_Int32 nCacheIdx = -1;
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOXML/OOBIN: zero-based index into sheet list, -1 means global name
+ case FILTER_OOXML:
+ // OOXML/BIFF12: zero-based index into sheet list, -1 means global name
if( maModel.mnSheet >= 0 )
nCacheIdx = mrParentLink.getSheetIndex( maModel.mnSheet );
break;
@@ -373,14 +364,15 @@ bool ExternalName::getDdeLinkData( OUString& orDdeServer, OUString& orDdeTopic,
// try to create a DDE link and to set the imported link results
if( !mbDdeLinkCreated ) try
{
- Reference< XDDELinks > xDdeLinks( getDdeLinks(), UNO_QUERY_THROW );
+ PropertySet aDocProps( getDocument() );
+ Reference< XDDELinks > xDdeLinks( aDocProps.getAnyProperty( PROP_DDELinks ), UNO_QUERY_THROW );
mxDdeLink = xDdeLinks->addDDELink( mrParentLink.getClassName(), mrParentLink.getTargetUrl(), maModel.maName, ::com::sun::star::sheet::DDELinkMode_DEFAULT );
+ mbDdeLinkCreated = true; // ignore if setting results fails
if( !maResults.empty() )
{
Reference< XDDELinkResults > xResults( mxDdeLink, UNO_QUERY_THROW );
xResults->setResults( ContainerHelper::matrixToSequenceSequence( maResults ) );
}
- mbDdeLinkCreated = true;
}
catch( Exception& )
{
@@ -551,44 +543,44 @@ ExternalNameRef ExternalLink::importOleItem( const AttributeList& rAttribs )
return xExtName;
}
-void ExternalLink::importExternalRef( RecordInputStream& rStrm )
+void ExternalLink::importExternalRef( SequenceInputStream& rStrm )
{
rStrm >> maRelId;
}
-void ExternalLink::importExternalSelf( RecordInputStream& )
+void ExternalLink::importExternalSelf( SequenceInputStream& )
{
meLinkType = LINKTYPE_SELF;
}
-void ExternalLink::importExternalSame( RecordInputStream& )
+void ExternalLink::importExternalSame( SequenceInputStream& )
{
meLinkType = LINKTYPE_SAME;
}
-void ExternalLink::importExternalAddin( RecordInputStream& )
+void ExternalLink::importExternalAddin( SequenceInputStream& )
{
meLinkType = LINKTYPE_UNKNOWN;
}
-void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputStream& rStrm )
+void ExternalLink::importExternalBook( const Relations& rRelations, SequenceInputStream& rStrm )
{
switch( rStrm.readuInt16() )
{
- case OOBIN_EXTERNALBOOK_BOOK:
- parseExternalReference( rRelations, rStrm.readString() );
+ case BIFF12_EXTERNALBOOK_BOOK:
+ parseExternalReference( rRelations, BiffHelper::readString( rStrm ) );
break;
- case OOBIN_EXTERNALBOOK_DDE:
+ case BIFF12_EXTERNALBOOK_DDE:
{
OUString aDdeService, aDdeTopic;
rStrm >> aDdeService >> aDdeTopic;
setDdeOleTargetUrl( aDdeService, aDdeTopic, LINKTYPE_DDE );
}
break;
- case OOBIN_EXTERNALBOOK_OLE:
+ case BIFF12_EXTERNALBOOK_OLE:
{
- OUString aTargetUrl = rRelations.getExternalTargetFromRelId( rStrm.readString() );
- OUString aProgId = rStrm.readString();
+ OUString aTargetUrl = rRelations.getExternalTargetFromRelId( BiffHelper::readString( rStrm ) );
+ OUString aProgId = BiffHelper::readString( rStrm );
setDdeOleTargetUrl( aProgId, aTargetUrl, LINKTYPE_OLE );
}
break;
@@ -597,17 +589,17 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS
}
}
-void ExternalLink::importExtSheetNames( RecordInputStream& rStrm )
+void ExternalLink::importExtSheetNames( SequenceInputStream& rStrm )
{
// load external sheet names and create the sheet caches in the Calc document
OSL_ENSURE( (meLinkType == LINKTYPE_EXTERNAL) || (meLinkType == LINKTYPE_LIBRARY),
"ExternalLink::importExtSheetNames - invalid link type" );
if( meLinkType == LINKTYPE_EXTERNAL ) // ignore sheets of external libraries
for( sal_Int32 nSheet = 0, nCount = rStrm.readInt32(); !rStrm.isEof() && (nSheet < nCount); ++nSheet )
- insertExternalSheet( rStrm.readString() );
+ insertExternalSheet( BiffHelper::readString( rStrm ) );
}
-ExternalNameRef ExternalLink::importExternalName( RecordInputStream& rStrm )
+ExternalNameRef ExternalLink::importExternalName( SequenceInputStream& rStrm )
{
ExternalNameRef xExtName = createExternalName();
xExtName->importExternalName( rStrm );
@@ -724,9 +716,9 @@ FunctionLibraryType ExternalLink::getFuncLibraryType() const
sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const
{
OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" );
- OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+ OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
"ExternalLink::getCalcSheetIndex - invalid sheet index" );
- return ContainerHelper::getVectorElement< sal_Int16 >( maCalcSheets, nTabId, -1 );
+ return ContainerHelper::getVectorElement( maCalcSheets, nTabId, -1 );
}
sal_Int32 ExternalLink::getDocumentLinkIndex() const
@@ -738,9 +730,9 @@ sal_Int32 ExternalLink::getDocumentLinkIndex() const
sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const
{
OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" );
- OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+ OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
"ExternalLink::getSheetCacheIndex - invalid sheet index" );
- return ContainerHelper::getVectorElement< sal_Int32 >( maSheetCaches, nTabId, -1 );
+ return ContainerHelper::getVectorElement( maSheetCaches, nTabId, -1 );
}
Reference< XExternalSheetCache > ExternalLink::getSheetCache( sal_Int32 nTabId ) const
@@ -776,8 +768,8 @@ void ExternalLink::getSheetRange( LinkSheetRange& orSheetRange, sal_Int32 nTabId
sal_Int32 nDocLinkIdx = getDocumentLinkIndex();
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOBIN: passed indexes point into sheet list of EXTSHEETLIST
+ case FILTER_OOXML:
+ // BIFF12: passed indexes point into sheet list of EXTSHEETLIST
orSheetRange.setExternalRange( nDocLinkIdx, getSheetCacheIndex( nTabId1 ), getSheetCacheIndex( nTabId2 ) );
break;
case FILTER_BIFF:
@@ -819,8 +811,8 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const
// private --------------------------------------------------------------------
-#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATIONSTYPE( "externalLinkPath" )
-#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATIONSTYPE( "xlExternalLinkPath/xlLibrary" )
+#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" )
+#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" )
void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType )
{
@@ -839,11 +831,14 @@ void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUStr
OSL_ENSURE( meLinkType != LINKTYPE_UNKNOWN, "ExternalLink::setExternalTargetUrl - empty target URL or unknown target type" );
// create the external document link API object that will contain the sheet caches
- if( meLinkType == LINKTYPE_EXTERNAL )
+ if( meLinkType == LINKTYPE_EXTERNAL ) try
+ {
+ PropertySet aDocProps( getDocument() );
+ Reference< XExternalDocLinks > xDocLinks( aDocProps.getAnyProperty( PROP_ExternalDocLinks ), UNO_QUERY_THROW );
+ mxDocLink = xDocLinks->addDocLink( maTargetUrl );
+ }
+ catch( Exception& )
{
- Reference< XExternalDocLinks > xDocLinks = getExternalDocLinks();
- if( xDocLinks.is() )
- mxDocLink = xDocLinks->addDocLink( maTargetUrl );
}
}
@@ -931,7 +926,7 @@ RefSheetsModel::RefSheetsModel() :
{
}
-void RefSheetsModel::readOobData( RecordInputStream& rStrm )
+void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm )
{
rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2;
}
@@ -947,8 +942,10 @@ void RefSheetsModel::readBiff8Data( BiffInputStream& rStrm )
ExternalLinkBuffer::ExternalLinkBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
+ mxSelfRef( new ExternalLink( rHelper ) ),
mbUseRefSheets( false )
{
+ mxSelfRef->setSelfLinkType();
}
ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList& rAttribs )
@@ -959,7 +956,7 @@ ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList
return xExtLink;
}
-ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm )
+ExternalLinkRef ExternalLinkBuffer::importExternalRef( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
ExternalLinkRef xExtLink = createExternalLink();
@@ -968,25 +965,25 @@ ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm
return xExtLink;
}
-void ExternalLinkBuffer::importExternalSelf( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSelf( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalSelf( rStrm );
}
-void ExternalLinkBuffer::importExternalSame( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSame( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalSame( rStrm );
}
-void ExternalLinkBuffer::importExternalAddin( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalAddin( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalAddin( rStrm );
}
-void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSheets( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::importExternalSheets - missing EXTERNALREFS records" );
mbUseRefSheets = true;
@@ -999,7 +996,7 @@ void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm )
for( size_t nRefId = 0; !rStrm.isEof() && (nRefId < nMaxCount); ++nRefId )
{
RefSheetsModel aRefSheets;
- aRefSheets.readOobData( rStrm );
+ aRefSheets.readBiff12Data( rStrm );
maRefSheets.push_back( aRefSheets );
}
}
@@ -1039,30 +1036,32 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm )
insert the entries of the second record before the entries of the first
record. */
maRefSheets.insert( maRefSheets.begin(), nRefCount, RefSheetsModel() );
- for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(); !rStrm.isEof() && (nRefCount > 0); --nRefCount )
+ for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(), aEnd = aIt + nRefCount; !rStrm.isEof() && (aIt != aEnd); ++aIt )
aIt->readBiff8Data( rStrm );
}
Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const
{
::std::vector< ExternalLinkInfo > aLinkInfos;
- // dummy entry for index 0
- aLinkInfos.push_back( ExternalLinkInfo( ::com::sun::star::sheet::ExternalLinkType::UNKNOWN, Any() ) );
+ // should not be used for BIFF12 documents
+ OSL_ENSURE( (getFilterType() == FILTER_OOXML) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" );
+ // add entry for implicit index 0 (self reference to this document)
+ aLinkInfos.push_back( mxSelfRef->getLinkInfo() );
for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt )
aLinkInfos.push_back( (*aIt)->getLinkInfo() );
return ContainerHelper::vectorToSequence( aLinkInfos );
}
-ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId ) const
+ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUseRefSheets ) const
{
ExternalLinkRef xExtLink;
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOXML: one-based index
- if( !mbUseRefSheets )
- xExtLink = maLinks.get( nRefId - 1 );
- // OOBIN: zero-based index into ref-sheets list
+ case FILTER_OOXML:
+ // OOXML: 0 = this document, otherwise one-based index into link list
+ if( !bUseRefSheets || !mbUseRefSheets )
+ xExtLink = (nRefId == 0) ? mxSelfRef : maLinks.get( nRefId - 1 );
+ // BIFF12: zero-based index into ref-sheets list
else if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
xExtLink = maLinks.get( pRefSheets->mnExtRefId );
break;
@@ -1113,7 +1112,7 @@ LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nT
LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
{
- OSL_ENSURE( ((getFilterType() == FILTER_OOX) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
+ OSL_ENSURE( ((getFilterType() == FILTER_OOXML) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
LinkSheetRange aSheetRange;
if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
@@ -1140,4 +1139,3 @@ const RefSheetsModel* ExternalLinkBuffer::getRefSheets( sal_Int32 nRefId ) const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx
index e1bff95ff724..094b192b817c 100644
--- a/oox/source/xls/externallinkfragment.cxx
+++ b/oox/source/xls/externallinkfragment.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/xls/externallinkfragment.hxx"
+
#include <com/sun/star/sheet/XExternalSheetCache.hpp>
#include "oox/helper/attributelist.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -33,32 +34,30 @@
#include "oox/xls/sheetdatacontext.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XExternalSheetCache;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relation;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxExternalSheetDataContext::OoxExternalSheetDataContext(
- OoxWorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
- OoxWorkbookContextBase( rFragment ),
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+// ============================================================================
+
+ExternalSheetDataContext::ExternalSheetDataContext(
+ WorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
+ WorkbookContextBase( rFragment ),
mxSheetCache( rxSheetCache )
{
- OSL_ENSURE( mxSheetCache.is(), "OoxExternalSheetDataContext::OoxExternalSheetDataContext - missing sheet cache" );
+ OSL_ENSURE( mxSheetCache.is(), "ExternalSheetDataContext::ExternalSheetDataContext - missing sheet cache" );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -69,50 +68,48 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nEleme
if( nElement == XLS_TOKEN( cell ) ) { importCell( rAttribs ); return this; }
break;
case XLS_TOKEN( cell ):
- if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onEndElement()
+ if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onCharacters()
break;
}
return 0;
}
-void OoxExternalSheetDataContext::onEndElement( const OUString& rChars )
+void ExternalSheetDataContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
+ if( isCurrentElement( XLS_TOKEN( v ) ) )
{
- case XLS_TOKEN( v ):
- switch( mnCurrType )
- {
- case XML_b:
- case XML_n:
- setCellValue( Any( rChars.toDouble() ) );
- break;
- case XML_e:
- setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) );
- break;
- case XML_str:
- setCellValue( Any( rChars ) );
- break;
- }
- mnCurrType = XML_TOKEN_INVALID;
- break;
+ switch( mnCurrType )
+ {
+ case XML_b:
+ case XML_n:
+ setCellValue( Any( rChars.toDouble() ) );
+ break;
+ case XML_e:
+ setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) );
+ break;
+ case XML_str:
+ setCellValue( Any( rChars ) );
+ break;
+ }
+ mnCurrType = XML_TOKEN_INVALID;
}
}
-ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_EXTSHEETDATA:
- if( nRecId == OOBIN_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
+ case BIFF12_ID_EXTSHEETDATA:
+ if( nRecId == BIFF12_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
break;
- case OOBIN_ID_EXTROW:
+ case BIFF12_ID_EXTROW:
switch( nRecId )
{
- case OOBIN_ID_EXTCELL_BLANK: importExtCellBlank( rStrm ); break;
- case OOBIN_ID_EXTCELL_BOOL: importExtCellBool( rStrm ); break;
- case OOBIN_ID_EXTCELL_DOUBLE: importExtCellDouble( rStrm ); break;
- case OOBIN_ID_EXTCELL_ERROR: importExtCellError( rStrm ); break;
- case OOBIN_ID_EXTCELL_STRING: importExtCellString( rStrm ); break;
+ case BIFF12_ID_EXTCELL_BLANK: importExtCellBlank( rStrm ); break;
+ case BIFF12_ID_EXTCELL_BOOL: importExtCellBool( rStrm ); break;
+ case BIFF12_ID_EXTCELL_DOUBLE: importExtCellDouble( rStrm ); break;
+ case BIFF12_ID_EXTCELL_ERROR: importExtCellError( rStrm ); break;
+ case BIFF12_ID_EXTCELL_STRING: importExtCellString( rStrm ); break;
}
break;
}
@@ -121,7 +118,7 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32
// private --------------------------------------------------------------------
-void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
+void ExternalSheetDataContext::importCell( const AttributeList& rAttribs )
{
if( getAddressConverter().convertToCellAddress( maCurrPos, rAttribs.getString( XML_r, OUString() ), 0, false ) )
mnCurrType = rAttribs.getToken( XML_t, XML_n );
@@ -129,38 +126,38 @@ void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
mnCurrType = XML_TOKEN_INVALID;
}
-void OoxExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBlank( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( OUString() ) );
}
-void OoxExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBool( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
setCellValue( Any( fValue ) );
}
-void OoxExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellDouble( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( rStrm.readDouble() ) );
}
-void OoxExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellError( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
}
-void OoxExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellString( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
- setCellValue( Any( rStrm.readString() ) );
+ setCellValue( Any( BiffHelper::readString( rStrm ) ) );
}
-void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
+void ExternalSheetDataContext::setCellValue( const Any& rValue )
{
if( mxSheetCache.is() && getAddressConverter().checkCellAddress( maCurrPos, false ) ) try
{
@@ -173,17 +170,15 @@ void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
// ============================================================================
-OoxExternalLinkFragment::OoxExternalLinkFragment( const WorkbookHelper& rHelper,
+ExternalLinkFragment::ExternalLinkFragment( const WorkbookHelper& rHelper,
const OUString& rFragmentPath, ExternalLink& rExtLink ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+ WorkbookFragmentBase( rHelper, rFragmentPath ),
mrExtLink( rExtLink ),
mnResultType( XML_TOKEN_INVALID )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -245,7 +240,7 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement,
}
break;
case XLS_TOKEN( value ):
- if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onEndElement()
+ if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onCharacters()
break;
case XLS_TOKEN( oleLink ):
@@ -258,209 +253,188 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement,
return 0;
}
-void OoxExternalLinkFragment::onEndElement( const OUString& rChars )
+void ExternalLinkFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
+ if( isCurrentElement( XLS_TOKEN( val ) ) )
+ maResultValue = rChars;
+}
+
+void ExternalLinkFragment::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName.get() ) switch( mnResultType )
{
- case XLS_TOKEN( val ):
- maResultValue = rChars;
+ case XML_b:
+ mxExtName->appendResultValue( maResultValue.toDouble() );
break;
- case XLS_TOKEN( value ):
- if( mxExtName.get() ) switch( mnResultType )
- {
- case XML_b:
- mxExtName->appendResultValue( maResultValue.toDouble() );
- break;
- case XML_e:
- mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) );
- break;
- case XML_n:
- mxExtName->appendResultValue( maResultValue.toDouble() );
- break;
- case XML_str:
- mxExtName->appendResultValue( maResultValue );
- break;
- default:
- mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) );
- }
+ case XML_e:
+ mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) );
+ break;
+ case XML_n:
+ mxExtName->appendResultValue( maResultValue.toDouble() );
+ break;
+ case XML_str:
+ mxExtName->appendResultValue( maResultValue );
break;
+ default:
+ mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) );
}
}
-ContextHandlerRef OoxExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_EXTERNALBOOK )
+ if( nRecId == BIFF12_ID_EXTERNALBOOK )
{
mrExtLink.importExternalBook( getRelations(), rStrm );
return this;
}
break;
- case OOBIN_ID_EXTERNALBOOK:
+ case BIFF12_ID_EXTERNALBOOK:
switch( nRecId )
{
- case OOBIN_ID_EXTSHEETDATA:
+ case BIFF12_ID_EXTSHEETDATA:
if( mrExtLink.getLinkType() == LINKTYPE_EXTERNAL )
return createSheetDataContext( rStrm.readInt32() );
break;
- case OOBIN_ID_EXTSHEETNAMES: mrExtLink.importExtSheetNames( rStrm ); break;
- case OOBIN_ID_EXTERNALNAME: mxExtName = mrExtLink.importExternalName( rStrm ); return this;
+ case BIFF12_ID_EXTSHEETNAMES: mrExtLink.importExtSheetNames( rStrm ); break;
+ case BIFF12_ID_EXTERNALNAME: mxExtName = mrExtLink.importExternalName( rStrm ); return this;
}
break;
- case OOBIN_ID_EXTERNALNAME:
+ case BIFF12_ID_EXTERNALNAME:
switch( nRecId )
{
- case OOBIN_ID_EXTERNALNAMEFLAGS: if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm ); break;
- case OOBIN_ID_DDEITEMVALUES: if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm ); return this;
+ case BIFF12_ID_EXTERNALNAMEFLAGS: if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm ); break;
+ case BIFF12_ID_DDEITEMVALUES: if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm ); return this;
}
break;
- case OOBIN_ID_DDEITEMVALUES:
+ case BIFF12_ID_DDEITEMVALUES:
switch( nRecId )
{
- case OOBIN_ID_DDEITEM_BOOL: if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm ); break;
- case OOBIN_ID_DDEITEM_DOUBLE: if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm ); break;
- case OOBIN_ID_DDEITEM_ERROR: if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm ); break;
- case OOBIN_ID_DDEITEM_STRING: if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm ); break;
+ case BIFF12_ID_DDEITEM_BOOL: if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm ); break;
+ case BIFF12_ID_DDEITEM_DOUBLE: if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm ); break;
+ case BIFF12_ID_DDEITEM_ERROR: if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm ); break;
+ case BIFF12_ID_DDEITEM_STRING: if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm ); break;
}
break;
}
return 0;
}
-ContextHandlerRef OoxExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
+ContextHandlerRef ExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
{
- return new OoxExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
+ return new ExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxExternalLinkFragment::getRecordInfos() const
+const RecordInfo* ExternalLinkFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_DDEITEMVALUES, OOBIN_ID_DDEITEMVALUES + 1 },
- { OOBIN_ID_EXTERNALBOOK, OOBIN_ID_EXTERNALBOOK + 228 },
- { OOBIN_ID_EXTERNALNAME, OOBIN_ID_EXTERNALNAME + 10 },
- { OOBIN_ID_EXTROW, -1 },
- { OOBIN_ID_EXTSHEETDATA, OOBIN_ID_EXTSHEETDATA + 1 },
- { -1, -1 }
+ { BIFF12_ID_DDEITEMVALUES, BIFF12_ID_DDEITEMVALUES + 1 },
+ { BIFF12_ID_EXTERNALBOOK, BIFF12_ID_EXTERNALBOOK + 228 },
+ { BIFF12_ID_EXTERNALNAME, BIFF12_ID_EXTERNALNAME + 10 },
+ { BIFF12_ID_EXTROW, -1 },
+ { BIFF12_ID_EXTSHEETDATA, BIFF12_ID_EXTSHEETDATA + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
// ============================================================================
+// ============================================================================
-BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames ) :
- BiffWorkbookFragmentBase( rParent ),
+BiffExternalSheetDataContext::BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames ) :
+ BiffWorkbookContextBase( rHelper ),
mbImportDefNames( bImportDefNames )
{
}
-BiffExternalLinkFragment::~BiffExternalLinkFragment()
+BiffExternalSheetDataContext::~BiffExternalSheetDataContext()
{
}
-bool BiffExternalLinkFragment::importFragment()
+void BiffExternalSheetDataContext::importRecord( BiffInputStream& rStrm )
{
- // process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- {
- if( isBofRecord() )
- skipFragment(); // skip unknown embedded fragments
- else
- importRecord();
- }
- return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
-
-void BiffExternalLinkFragment::importRecord()
-{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF2_ID_DEFINEDNAME: importDefinedName(); break;
+ case BIFF2_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF2_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF3_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF3_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF3_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF3_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF5_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF5_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF_ID_EXTERNALBOOK: importExternalBook(); break;
- case BIFF5_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF5_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF_ID_EXTERNALBOOK: importExternalBook( rStrm ); break;
+ case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF_UNKNOWN: break;
}
}
-void BiffExternalLinkFragment::finalizeImport()
-{
- getDefinedNames().finalizeImport();
-}
-
// private --------------------------------------------------------------------
-void BiffExternalLinkFragment::importExternSheet()
+void BiffExternalSheetDataContext::importExternSheet( BiffInputStream& rStrm )
{
mxSheetCache.clear();
if( getBiff() == BIFF8 )
- getExternalLinks().importExternSheet8( mrStrm );
+ getExternalLinks().importExternSheet8( rStrm );
else
- mxExtLink = getExternalLinks().importExternSheet( mrStrm );
+ mxExtLink = getExternalLinks().importExternSheet( rStrm );
}
-void BiffExternalLinkFragment::importExternalBook()
+void BiffExternalSheetDataContext::importExternalBook( BiffInputStream& rStrm )
{
mxSheetCache.clear();
- mxExtLink = getExternalLinks().importExternalBook( mrStrm );
+ mxExtLink = getExternalLinks().importExternalBook( rStrm );
}
-void BiffExternalLinkFragment::importExternalName()
+void BiffExternalSheetDataContext::importExternalName( BiffInputStream& rStrm )
{
if( mxExtLink.get() )
- mxExtLink->importExternalName( mrStrm );
+ mxExtLink->importExternalName( rStrm );
}
-void BiffExternalLinkFragment::importXct()
+void BiffExternalSheetDataContext::importXct( BiffInputStream& rStrm )
{
mxSheetCache.clear();
if( mxExtLink.get() && (mxExtLink->getLinkType() == LINKTYPE_EXTERNAL) )
@@ -475,64 +449,65 @@ void BiffExternalLinkFragment::importXct()
mxSheetCache = mxExtLink->getSheetCache( 0 );
break;
case BIFF8:
- mrStrm.skip( 2 );
- mxSheetCache = mxExtLink->getSheetCache( mrStrm.readInt16() );
+ rStrm.skip( 2 );
+ mxSheetCache = mxExtLink->getSheetCache( rStrm.readInt16() );
+ break;
+ case BIFF_UNKNOWN:
break;
- case BIFF_UNKNOWN: break;
}
}
}
-void BiffExternalLinkFragment::importCrn()
+void BiffExternalSheetDataContext::importCrn( BiffInputStream& rStrm )
{
if( !mxSheetCache.is() ) return;
sal_uInt8 nCol2, nCol1;
sal_uInt16 nRow;
- mrStrm >> nCol2 >> nCol1 >> nRow;
+ rStrm >> nCol2 >> nCol1 >> nRow;
bool bLoop = true;
- for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !mrStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
+ for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !rStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
{
- switch( mrStrm.readuInt8() )
+ switch( rStrm.readuInt8() )
{
case BIFF_DATATYPE_EMPTY:
- mrStrm.skip( 8 );
+ rStrm.skip( 8 );
setCellValue( aBinAddr, Any( OUString() ) );
break;
case BIFF_DATATYPE_DOUBLE:
- setCellValue( aBinAddr, Any( mrStrm.readDouble() ) );
+ setCellValue( aBinAddr, Any( rStrm.readDouble() ) );
break;
case BIFF_DATATYPE_STRING:
{
- OUString aText = (getBiff() == BIFF8) ? mrStrm.readUniString() : mrStrm.readByteStringUC( false, getTextEncoding() );
+ OUString aText = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( false, getTextEncoding() );
setCellValue( aBinAddr, Any( aText ) );
}
break;
case BIFF_DATATYPE_BOOL:
{
- double fValue = (mrStrm.readuInt8() == 0) ? 0.0 : 1.0;
+ double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
setCellValue( aBinAddr, Any( fValue ) );
- mrStrm.skip( 7 );
+ rStrm.skip( 7 );
}
break;
case BIFF_DATATYPE_ERROR:
- setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( mrStrm.readuInt8() ) ) );
- mrStrm.skip( 7 );
+ setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
+ rStrm.skip( 7 );
break;
default:
- OSL_ENSURE( false, "BiffExternalLinkFragment::importCrn - unknown data type" );
+ OSL_ENSURE( false, "BiffExternalSheetDataContext::importCrn - unknown data type" );
bLoop = false;
}
}
}
-void BiffExternalLinkFragment::importDefinedName()
+void BiffExternalSheetDataContext::importDefinedName( BiffInputStream& rStrm )
{
if( mbImportDefNames )
- getDefinedNames().importDefinedName( mrStrm );
+ getDefinedNames().importDefinedName( rStrm );
}
-void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
+void BiffExternalSheetDataContext::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
{
CellAddress aCellPos;
if( mxSheetCache.is() && getAddressConverter().convertToCellAddress( aCellPos, rBinAddr, 0, false ) ) try
@@ -546,6 +521,28 @@ void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const A
// ============================================================================
+BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent ) :
+ BiffWorkbookFragmentBase( rParent )
+{
+}
+
+bool BiffExternalLinkFragment::importFragment()
+{
+ // process all record in this sheet fragment
+ BiffExternalSheetDataContext aSheetContext( *this, false );
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+ {
+ if( BiffHelper::isBofRecord( rStrm ) )
+ skipFragment(); // skip unknown embedded fragments
+ else
+ aSheetContext.importRecord( rStrm );
+ }
+ return !rStrm.isEof() && (rStrm.getRecId() == BIFF_ID_EOF);
+}
+
+// ============================================================================
+// ============================================================================
+
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index ea353bb48558..ba8485d1f42b 100644..100755
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -26,9 +26,8 @@
************************************************************************/
#include "oox/xls/formulabase.hxx"
+
#include <map>
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/AddressConvention.hpp>
@@ -41,37 +40,28 @@
#include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
#include <com/sun/star/sheet/XFormulaParser.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
using ::rtl::OUStringToOString;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::FormulaToken;
-using ::com::sun::star::sheet::FormulaOpCodeMapEntry;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XFormulaOpCodeMapper;
-using ::com::sun::star::sheet::XFormulaTokens;
-
-namespace oox {
-namespace xls {
// reference helpers ==========================================================
@@ -83,16 +73,16 @@ BinSingleRef2d::BinSingleRef2d() :
{
}
-void BinSingleRef2d::setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
+void BinSingleRef2d::setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
{
- mnCol = nCol & OOBIN_TOK_REF_COLMASK;
- mnRow = nRow & OOBIN_TOK_REF_ROWMASK;
- mbColRel = getFlag( nCol, OOBIN_TOK_REF_COLREL );
- mbRowRel = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
- if( bRelativeAsOffset && mbColRel && (mnCol > (OOBIN_TOK_REF_COLMASK >> 1)) )
- mnCol -= (OOBIN_TOK_REF_COLMASK + 1);
- if( bRelativeAsOffset && mbRowRel && (mnRow > (OOBIN_TOK_REF_ROWMASK >> 1)) )
- mnRow -= (OOBIN_TOK_REF_ROWMASK + 1);
+ mnCol = nCol & BIFF12_TOK_REF_COLMASK;
+ mnRow = nRow & BIFF12_TOK_REF_ROWMASK;
+ mbColRel = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+ mbRowRel = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+ if( bRelativeAsOffset && mbColRel && (mnCol > (BIFF12_TOK_REF_COLMASK >> 1)) )
+ mnCol -= (BIFF12_TOK_REF_COLMASK + 1);
+ if( bRelativeAsOffset && mbRowRel && (mnRow > (BIFF12_TOK_REF_ROWMASK >> 1)) )
+ mnRow -= (BIFF12_TOK_REF_ROWMASK + 1);
}
void BinSingleRef2d::setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset )
@@ -119,12 +109,12 @@ void BinSingleRef2d::setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelat
mnRow -= 0x10000;
}
-void BinSingleRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinSingleRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset )
{
sal_Int32 nRow;
sal_uInt16 nCol;
rStrm >> nRow >> nCol;
- setOobData( nCol, nRow, bRelativeAsOffset );
+ setBiff12Data( nCol, nRow, bRelativeAsOffset );
}
void BinSingleRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -144,13 +134,13 @@ void BinSingleRef2d::readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffs
// ----------------------------------------------------------------------------
-void BinComplexRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinComplexRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset )
{
sal_Int32 nRow1, nRow2;
sal_uInt16 nCol1, nCol2;
rStrm >> nRow1 >> nRow2 >> nCol1 >> nCol2;
- maRef1.setOobData( nCol1, nRow1, bRelativeAsOffset );
- maRef2.setOobData( nCol2, nRow2, bRelativeAsOffset );
+ maRef1.setBiff12Data( nCol1, nRow1, bRelativeAsOffset );
+ maRef2.setBiff12Data( nCol2, nRow2, bRelativeAsOffset );
}
void BinComplexRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -246,8 +236,8 @@ struct FunctionData
{
const sal_Char* mpcOdfFuncName; /// ODF function name.
const sal_Char* mpcOoxFuncName; /// OOXML function name.
- sal_uInt16 mnOobFuncId; /// OOBIN function identifier.
- sal_uInt16 mnBiffFuncId; /// BIFF function identifier.
+ sal_uInt16 mnBiff12FuncId; /// BIFF12 function identifier.
+ sal_uInt16 mnBiffFuncId; /// BIFF2-BIFF8 function identifier.
sal_uInt8 mnMinParamCount; /// Minimum number of parameters.
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
@@ -264,7 +254,7 @@ inline bool FunctionData::isSupported( bool bImportFilter ) const
return !getFlag( mnFlags, bImportFilter ? FUNCFLAG_EXPORTONLY : FUNCFLAG_IMPORTONLY );
}
-const sal_uInt16 NOID = SAL_MAX_UINT16; /// No BIFF/OOBIN function identifier available.
+const sal_uInt16 NOID = SAL_MAX_UINT16; /// No BIFF function identifier available.
const sal_uInt8 MX = SAL_MAX_UINT8; /// Maximum parameter count.
// abbreviations for function return token class
@@ -678,8 +668,8 @@ static const FunctionData saFuncTableBiff5[] =
{ "COUNTBLANK", "COUNTBLANK", 347, 347, 1, 1, V, { RO }, 0 },
{ "ISPMT", "ISPMT", 350, 350, 4, 4, V, { VR }, 0 },
{ 0, "DATEDIF", 351, 351, 3, 3, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc
- { 0, "DATESTRING", 352, 352, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOX spec
- { 0, "NUMBERSTRING", 353, 353, 2, 2, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOX spec
+ { 0, "DATESTRING", 352, 352, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec
+ { 0, "NUMBERSTRING", 353, 353, 2, 2, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec
{ "ROMAN", "ROMAN", 354, 354, 1, 2, V, { VR }, 0 },
// *** EuroTool add-in ***
@@ -722,7 +712,7 @@ static const FunctionData saFuncTableBiff8[] =
{ 0, "RTD", 379, 379, 3, 3, A, { VR, VR, RO }, 0 }
};
-/** Functions new in OOX. */
+/** Functions new in OOXML. */
static const FunctionData saFuncTableOox[] =
{
{ 0, "CUBEVALUE", 380, NOID, 1, MX, V, { VR, RX }, 0 },
@@ -769,7 +759,7 @@ static const FunctionData saFuncTableOdf[] =
{ "PERMUTATIONA", 0, NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALLODF },
{ "PHI", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF },
{ "RRI", 0, NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALLODF },
- { "SHEET", 0, NOID, NOID, 1, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
+ { "SHEET", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
{ "SHEETS", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
{ "SKEWP", 0, NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALLODF },
{ "UNICHAR", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF },
@@ -845,8 +835,8 @@ struct FunctionProviderImpl
FunctionInfoVector maFuncs; /// All function infos in one list.
FuncNameMap maOdfFuncs; /// Maps ODF function names to function data.
FuncNameMap maOoxFuncs; /// Maps OOXML function names to function data.
- FuncIdMap maOobFuncs; /// Maps OOBIN function indexes to function data.
- FuncIdMap maBiffFuncs; /// Maps BIFF function indexes to function data.
+ FuncIdMap maBiff12Funcs; /// Maps BIFF12 function indexes to function data.
+ FuncIdMap maBiffFuncs; /// Maps BIFF2-BIFF8 function indexes to function data.
FuncNameMap maMacroFuncs; /// Maps macro function names to function data.
explicit FunctionProviderImpl( FilterType eFilter, BiffType eBiff, bool bImportFilter );
@@ -869,9 +859,9 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
sal_uInt8 nMaxParam = 0;
switch( eFilter )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
nMaxParam = OOX_MAX_PARAMCOUNT;
- eBiff = BIFF8; // insert all BIFF function tables, then the OOX table
+ eBiff = BIFF8; // insert all BIFF function tables, then the OOXML table
break;
case FILTER_BIFF:
nMaxParam = BIFF_MAX_PARAMCOUNT;
@@ -895,7 +885,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
initFuncs( saFuncTableBiff5, STATIC_ARRAY_END( saFuncTableBiff5 ), nMaxParam, bImportFilter );
if( eBiff >= BIFF8 )
initFuncs( saFuncTableBiff8, STATIC_ARRAY_END( saFuncTableBiff8 ), nMaxParam, bImportFilter );
- if( eFilter == FILTER_OOX )
+ if( eFilter == FILTER_OOXML )
initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter );
initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, bImportFilter );
}
@@ -928,7 +918,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
}
xFuncInfo->mnApiOpCode = -1;
- xFuncInfo->mnOobFuncId = rFuncData.mnOobFuncId;
+ xFuncInfo->mnBiff12FuncId = rFuncData.mnBiff12FuncId;
xFuncInfo->mnBiffFuncId = rFuncData.mnBiffFuncId;
xFuncInfo->mnMinParamCount = rFuncData.mnMinParamCount;
xFuncInfo->mnMaxParamCount = (rFuncData.mnMaxParamCount == MX) ? nMaxParam : rFuncData.mnMaxParamCount;
@@ -941,7 +931,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
xFuncInfo->mbMacroFunc = bMacroCmd || getFlag( rFuncData.mnFlags, FUNCFLAG_MACROFUNC );
xFuncInfo->mbVarParam = bMacroCmd || (rFuncData.mnMinParamCount != rFuncData.mnMaxParamCount) || getFlag( rFuncData.mnFlags, FUNCFLAG_ALWAYSVAR );
- setFlag( xFuncInfo->mnOobFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
+ setFlag( xFuncInfo->mnBiff12FuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
setFlag( xFuncInfo->mnBiffFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
// insert the function info into the member maps
@@ -950,8 +940,8 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
maOdfFuncs[ xFuncInfo->maOdfFuncName ] = xFuncInfo;
if( xFuncInfo->maOoxFuncName.getLength() > 0 )
maOoxFuncs[ xFuncInfo->maOoxFuncName ] = xFuncInfo;
- if( xFuncInfo->mnOobFuncId != NOID )
- maOobFuncs[ xFuncInfo->mnOobFuncId ] = xFuncInfo;
+ if( xFuncInfo->mnBiff12FuncId != NOID )
+ maBiff12Funcs[ xFuncInfo->mnBiff12FuncId ] = xFuncInfo;
if( xFuncInfo->mnBiffFuncId != NOID )
maBiffFuncs[ xFuncInfo->mnBiffFuncId ] = xFuncInfo;
if( xFuncInfo->maBiffMacroName.getLength() > 0 )
@@ -986,9 +976,9 @@ const FunctionInfo* FunctionProvider::getFuncInfoFromOoxFuncName( const OUString
return mxFuncImpl->maOoxFuncs.get( rFuncName ).get();
}
-const FunctionInfo* FunctionProvider::getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const
+const FunctionInfo* FunctionProvider::getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const
{
- return mxFuncImpl->maOobFuncs.get( nFuncId ).get();
+ return mxFuncImpl->maBiff12Funcs.get( nFuncId ).get();
}
const FunctionInfo* FunctionProvider::getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const
@@ -1252,7 +1242,7 @@ bool OpCodeProviderImpl::initFuncOpCode( FunctionInfo& orFuncInfo, const ApiToke
append( '"' ).getStr() );
}
- // add to parser map, if OOX function name exists
+ // add to parser map, if OOXML function name exists
if( bIsValid && (orFuncInfo.maOoxFuncName.getLength() > 0) )
{
// create the parser map entry
@@ -1747,4 +1737,3 @@ void FormulaProcessorBase::convertStringToStringList(
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index 12deadecd695..8b1f1b809d88 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -26,14 +26,13 @@
************************************************************************/
#include "oox/xls/formulaparser.hxx"
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/sheet/ReferenceFlags.hpp>
#include <com/sun/star/sheet/SingleReference.hpp>
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -42,26 +41,20 @@
#include "oox/xls/tablebuffer.hxx"
#include "oox/xls/worksheethelper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaParser;
-using namespace ::com::sun::star::sheet::ReferenceFlags;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::sheet::ReferenceFlags;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
sal_uInt16 lclReadFmlaSize( BiffInputStream& rStrm, BiffType eBiff, const sal_uInt16* pnFmlaSize )
@@ -249,7 +242,7 @@ const ApiToken* FormulaFinalizer::processParameters(
if( !aParamInfoIt.isExcelOnlyParam() )
{
// replace empty second and third parameter in IF function with zeros
- if( (pRealFuncInfo->mnOobFuncId == OOBIN_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
+ if( (pRealFuncInfo->mnBiff12FuncId == BIFF_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
{
maTokens.append< double >( OPCODE_PUSH, 0.0 );
bIsEmpty = false;
@@ -368,10 +361,10 @@ const ApiToken* FormulaFinalizer::findParameters( ParameterPosVector& rParams,
void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, size_t nParam )
{
(void)nParam; // prevent 'unused' warning
- switch( rFuncInfo.mnOobFuncId )
+ switch( rFuncInfo.mnBiff12FuncId )
{
- case OOBIN_FUNC_FLOOR:
- case OOBIN_FUNC_CEILING:
+ case BIFF_FUNC_FLOOR:
+ case BIFF_FUNC_CEILING:
OSL_ENSURE( nParam == 2, "FormulaFinalizer::appendCalcOnlyParameter - unexpected parameter index" );
maTokens.append< double >( OPCODE_PUSH, 1.0 );
maTokens.append( OPCODE_SEP );
@@ -381,9 +374,9 @@ void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, s
void FormulaFinalizer::appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount )
{
- switch( rFuncInfo.mnOobFuncId )
+ switch( rFuncInfo.mnBiff12FuncId )
{
- case OOBIN_FUNC_WEEKNUM:
+ case BIFF_FUNC_WEEKNUM:
if( nParamCount == 1 )
{
maTokens.append< double >( OPCODE_PUSH, 1.0 );
@@ -422,12 +415,12 @@ public:
FormulaContext& rContext,
const OUString& rFormulaString );
- /** Imports and converts a OOBIN token array from the passed stream. */
- virtual void importOobFormula(
+ /** Imports and converts a BIFF12 token array from the passed stream. */
+ virtual void importBiff12Formula(
FormulaContext& rContext,
- RecordInputStream& rStrm );
+ SequenceInputStream& rStrm );
- /** Imports and converts a BIFF token array from the passed stream. */
+ /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */
virtual void importBiffFormula(
FormulaContext& rContext,
BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize );
@@ -439,7 +432,7 @@ public:
const ApiTokenSequence& rTokens );
/** Tries to resolve the passed ref-id to an OLE target URL. */
- OUString resolveOleTarget( sal_Int32 nRefId ) const;
+ OUString resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const;
protected:
typedef ::std::pair< sal_Int32, bool > WhiteSpace;
@@ -589,9 +582,9 @@ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& )
OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" );
}
-void FormulaParserImpl::importOobFormula( FormulaContext&, RecordInputStream& )
+void FormulaParserImpl::importBiff12Formula( FormulaContext&, SequenceInputStream& )
{
- OSL_ENSURE( false, "FormulaParserImpl::importOobFormula - not implemented" );
+ OSL_ENSURE( false, "FormulaParserImpl::importBiff12Formula - not implemented" );
}
void FormulaParserImpl::importBiffFormula( FormulaContext&, BiffInputStream&, const sal_uInt16* )
@@ -605,9 +598,9 @@ void FormulaParserImpl::setFormula( FormulaContext& rContext, const ApiTokenSequ
finalizeImport( rTokens );
}
-OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId ) const
+OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const
{
- const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get();
+ const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, bUseRefSheets ).get();
OSL_ENSURE( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE), "FormulaParserImpl::resolveOleTarget - missing or wrong link" );
if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE) )
return getBaseFilter().getAbsoluteUrl( pExtLink->getTargetUrl() );
@@ -903,7 +896,7 @@ bool FormulaParserImpl::pushValueOperand( const Type& rValue, sal_Int32 nOpCode
bool FormulaParserImpl::pushBoolOperand( bool bValue )
{
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( bValue ? OOBIN_FUNC_TRUE : OOBIN_FUNC_FALSE ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( bValue ? BIFF_FUNC_TRUE : BIFF_FUNC_FALSE ) )
return pushFunctionOperator( pFuncInfo->mnApiOpCode, 0 );
return pushValueOperand< double >( bValue ? 1.0 : 0.0 );
}
@@ -1234,7 +1227,7 @@ OUString FormulaParserImpl::resolveDefinedName( sal_Int32 nTokenIndex ) const
return OUString();
}
-// OOX parser implementation ==================================================
+// OOXML/BIFF12 parser implementation =========================================
class OoxFormulaParserImpl : public FormulaParserImpl
{
@@ -1245,40 +1238,40 @@ public:
FormulaContext& rContext,
const OUString& rFormulaString );
- virtual void importOobFormula(
+ virtual void importBiff12Formula(
FormulaContext& rContext,
- RecordInputStream& rStrm );
+ SequenceInputStream& rStrm );
private:
// import token contents and create API formula token ---------------------
- bool importAttrToken( RecordInputStream& rStrm );
- bool importSpaceToken( RecordInputStream& rStrm );
- bool importTableToken( RecordInputStream& rStrm );
- bool importArrayToken( RecordInputStream& rStrm );
- bool importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importMemAreaToken( RecordInputStream& rStrm, bool bAddData );
- bool importMemFuncToken( RecordInputStream& rStrm );
- bool importNameToken( RecordInputStream& rStrm );
- bool importNameXToken( RecordInputStream& rStrm );
- bool importFuncToken( RecordInputStream& rStrm );
- bool importFuncVarToken( RecordInputStream& rStrm );
- bool importExpToken( RecordInputStream& rStrm );
-
- LinkSheetRange readSheetRange( RecordInputStream& rStrm );
-
- void swapStreamPosition( RecordInputStream& rStrm );
- void skipMemAreaAddData( RecordInputStream& rStrm );
+ bool importAttrToken( SequenceInputStream& rStrm );
+ bool importSpaceToken( SequenceInputStream& rStrm );
+ bool importTableToken( SequenceInputStream& rStrm );
+ bool importArrayToken( SequenceInputStream& rStrm );
+ bool importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importMemAreaToken( SequenceInputStream& rStrm, bool bAddData );
+ bool importMemFuncToken( SequenceInputStream& rStrm );
+ bool importNameToken( SequenceInputStream& rStrm );
+ bool importNameXToken( SequenceInputStream& rStrm );
+ bool importFuncToken( SequenceInputStream& rStrm );
+ bool importFuncVarToken( SequenceInputStream& rStrm );
+ bool importExpToken( SequenceInputStream& rStrm );
+
+ LinkSheetRange readSheetRange( SequenceInputStream& rStrm );
+
+ void swapStreamPosition( SequenceInputStream& rStrm );
+ void skipMemAreaAddData( SequenceInputStream& rStrm );
// convert BIN token and push API operand or operator ---------------------
- bool pushOobName( sal_Int32 nNameId );
- bool pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId );
- bool pushOobFunction( sal_uInt16 nFuncId );
- bool pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
+ bool pushBiff12Name( sal_Int32 nNameId );
+ bool pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId );
+ bool pushBiff12Function( sal_uInt16 nFuncId );
+ bool pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
private:
ApiParserWrapper maApiParser; /// Wrapper for the API formula parser object.
@@ -1307,7 +1300,7 @@ void OoxFormulaParserImpl::importOoxFormula( FormulaContext& rContext, const OUS
finalizeImport( maApiParser.parseFormula( rFormulaString, rContext.getBaseAddress() ) );
}
-void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInputStream& rStrm )
+void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, SequenceInputStream& rStrm )
{
initializeImport( rContext );
@@ -1336,34 +1329,34 @@ void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInp
// base tokens
switch( nBaseId )
{
- case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break;
- case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break;
- case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break;
- case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break;
- case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break;
- case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break;
- case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break;
- case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break;
- case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break;
- case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break;
- case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break;
- case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break;
- case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break;
- case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break;
- case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break;
- case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break;
- case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break;
- case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break;
- case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break;
- case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break;
- case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break;
- case BIFF_TOKID_STR: bOk = pushValueOperand( rStrm.readString( false ) ); break;
- case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break;
- case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break;
- case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break;
- case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break;
- case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break;
- case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break;
+ case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break;
+ case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break;
+ case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break;
+ case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break;
+ case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break;
+ case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break;
+ case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break;
+ case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break;
+ case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break;
+ case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break;
+ case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break;
+ case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break;
+ case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break;
+ case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break;
+ case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break;
+ case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break;
+ case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break;
+ case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break;
+ case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break;
+ case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break;
+ case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break;
+ case BIFF_TOKID_STR: bOk = pushValueOperand( BiffHelper::readString( rStrm, false ) ); break;
+ case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break;
+ case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break;
+ case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break;
+ case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break;
+ case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break;
+ case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break;
default: bOk = false;
}
}
@@ -1409,31 +1402,31 @@ void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInp
// import token contents and create API formula token -------------------------
-bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importAttrToken( SequenceInputStream& rStrm )
{
bool bOk = true;
sal_uInt8 nType;
rStrm >> nType;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
switch( nType )
{
case 0: // sometimes, tAttrSkip tokens miss the type flag
- case OOBIN_TOK_ATTR_VOLATILE:
- case OOBIN_TOK_ATTR_IF:
- case OOBIN_TOK_ATTR_SKIP:
- case OOBIN_TOK_ATTR_ASSIGN:
- case OOBIN_TOK_ATTR_IFERROR:
+ case BIFF_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_IF:
+ case BIFF_TOK_ATTR_SKIP:
+ case BIFF_TOK_ATTR_ASSIGN:
+ case BIFF_TOK_ATTR_IFERROR:
rStrm.skip( 2 );
break;
- case OOBIN_TOK_ATTR_CHOOSE:
+ case BIFF_TOK_ATTR_CHOOSE:
rStrm.skip( 2 * rStrm.readuInt16() + 2 );
break;
- case OOBIN_TOK_ATTR_SUM:
+ case BIFF_TOK_ATTR_SUM:
rStrm.skip( 2 );
- bOk = pushOobFunction( OOBIN_FUNC_SUM, 1 );
+ bOk = pushBiff12Function( BIFF_FUNC_SUM, 1 );
break;
- case OOBIN_TOK_ATTR_SPACE:
- case OOBIN_TOK_ATTR_SPACE_VOLATILE:
+ case BIFF_TOK_ATTR_SPACE:
+ case BIFF_TOK_ATTR_SPACE_VOLATILE:
bOk = importSpaceToken( rStrm );
break;
default:
@@ -1442,7 +1435,7 @@ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
return bOk;
}
-bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importSpaceToken( SequenceInputStream& rStrm )
{
// equal constants in BIFF and OOX
sal_uInt8 nType, nCount;
@@ -1471,7 +1464,7 @@ bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm )
return true;
}
-bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importTableToken( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags, nTableId, nCol1, nCol2;
rStrm.skip( 3 );
@@ -1491,8 +1484,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
bool bFixedStartRow = true;
bool bFixedHeight = false;
- bool bSingleCol = getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN );
- bool bColRange = getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE );
+ bool bSingleCol = getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN );
+ bool bColRange = getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE );
bool bValidRef = !bSingleCol || !bColRange;
OSL_ENSURE( bValidRef, "OoxFormulaParserImpl::importTableToken - illegal combination of single column and column range" );
if( bValidRef )
@@ -1507,11 +1500,11 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
if( bValidRef )
{
- bool bAllRows = getFlag( nFlags, OOBIN_TOK_TABLE_ALL );
- bool bHeaderRows = getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS );
- bool bDataRows = getFlag( nFlags, OOBIN_TOK_TABLE_DATA );
- bool bTotalsRows = getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS );
- bool bThisRow = getFlag( nFlags, OOBIN_TOK_TABLE_THISROW );
+ bool bAllRows = getFlag( nFlags, BIFF12_TOK_TABLE_ALL );
+ bool bHeaderRows = getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS );
+ bool bDataRows = getFlag( nFlags, BIFF12_TOK_TABLE_DATA );
+ bool bTotalsRows = getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS );
+ bool bThisRow = getFlag( nFlags, BIFF12_TOK_TABLE_THISROW );
sal_Int32 nStartDataRow = xTable->getHeaderRows();
sal_Int32 nEndDataRow = nEndRow - xTable->getTotalsRows();
@@ -1567,8 +1560,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
if( (nStartCol == 0) && (nEndCol + 1 == nWidth) && (nStartRow == 0) && (nEndRow + 1 == nHeight) )
return pushValueOperand( nTokenIndex, OPCODE_DBAREA );
// create an OFFSET function call to refer to a subrange of the table
- const FunctionInfo* pRowsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_ROWS );
- const FunctionInfo* pColumnsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_COLUMNS );
+ const FunctionInfo* pRowsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_ROWS );
+ const FunctionInfo* pColumnsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_COLUMNS );
return
pRowsInfo && pColumnsInfo &&
pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
@@ -1590,13 +1583,13 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
(pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
pushFunctionOperatorToken( *pColumnsInfo, 1 )) :
pushValueOperandToken< double >( nEndCol - nStartCol + 1 )) &&
- pushOobFunction( OOBIN_FUNC_OFFSET, 5 );
+ pushBiff12Function( BIFF_FUNC_OFFSET, 5 );
}
}
return pushBiffErrorOperand( BIFF_ERR_REF );
}
-bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importArrayToken( SequenceInputStream& rStrm )
{
rStrm.skip( 14 );
@@ -1622,16 +1615,16 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
appendRawToken( OPCODE_ARRAY_COLSEP );
switch( rStrm.readuInt8() )
{
- case OOBIN_TOK_ARRAY_DOUBLE:
+ case BIFF_TOK_ARRAY_DOUBLE:
appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble();
break;
- case OOBIN_TOK_ARRAY_STRING:
- appendRawToken( OPCODE_PUSH ) <<= rStrm.readString( false );
+ case BIFF_TOK_ARRAY_STRING:
+ appendRawToken( OPCODE_PUSH ) <<= BiffHelper::readString( rStrm, false );
break;
- case OOBIN_TOK_ARRAY_BOOL:
+ case BIFF_TOK_ARRAY_BOOL:
appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 );
break;
- case OOBIN_TOK_ARRAY_ERROR:
+ case BIFF_TOK_ARRAY_ERROR:
appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( rStrm.readuInt8() );
rStrm.skip( 3 );
break;
@@ -1649,37 +1642,37 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
return true;
}
-bool OoxFormulaParserImpl::importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
BinSingleRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
BinComplexRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
LinkSheetRange aSheetRange = readSheetRange( rStrm );
BinSingleRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
LinkSheetRange aSheetRange = readSheetRange( rStrm );
BinComplexRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bAddData )
+bool OoxFormulaParserImpl::importMemAreaToken( SequenceInputStream& rStrm, bool bAddData )
{
rStrm.skip( 6 );
if( bAddData )
@@ -1687,40 +1680,40 @@ bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bA
return true;
}
-bool OoxFormulaParserImpl::importMemFuncToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importMemFuncToken( SequenceInputStream& rStrm )
{
rStrm.skip( 2 );
return true;
}
-bool OoxFormulaParserImpl::importNameToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importNameToken( SequenceInputStream& rStrm )
{
- return pushOobName( rStrm.readInt32() );
+ return pushBiff12Name( rStrm.readInt32() );
}
-bool OoxFormulaParserImpl::importNameXToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importNameXToken( SequenceInputStream& rStrm )
{
sal_Int32 nRefId = rStrm.readInt16();
sal_Int32 nNameId = rStrm.readInt32();
- return pushOobExtName( nRefId, nNameId );
+ return pushBiff12ExtName( nRefId, nNameId );
}
-bool OoxFormulaParserImpl::importFuncToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importFuncToken( SequenceInputStream& rStrm )
{
sal_uInt16 nFuncId;
rStrm >> nFuncId;
- return pushOobFunction( nFuncId );
+ return pushBiff12Function( nFuncId );
}
-bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importFuncVarToken( SequenceInputStream& rStrm )
{
sal_uInt8 nParamCount;
sal_uInt16 nFuncId;
rStrm >> nParamCount >> nFuncId;
- return pushOobFunction( nFuncId, nParamCount );
+ return pushBiff12Function( nFuncId, nParamCount );
}
-bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importExpToken( SequenceInputStream& rStrm )
{
BinAddress aBaseAddr;
rStrm >> aBaseAddr.mnRow;
@@ -1732,19 +1725,19 @@ bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm )
return false;
}
-LinkSheetRange OoxFormulaParserImpl::readSheetRange( RecordInputStream& rStrm )
+LinkSheetRange OoxFormulaParserImpl::readSheetRange( SequenceInputStream& rStrm )
{
return getExternalLinks().getSheetRange( rStrm.readInt16() );
}
-void OoxFormulaParserImpl::swapStreamPosition( RecordInputStream& rStrm )
+void OoxFormulaParserImpl::swapStreamPosition( SequenceInputStream& rStrm )
{
sal_Int64 nRecPos = rStrm.tell();
rStrm.seek( mnAddDataPos );
mnAddDataPos = nRecPos;
}
-void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm )
+void OoxFormulaParserImpl::skipMemAreaAddData( SequenceInputStream& rStrm )
{
swapStreamPosition( rStrm );
rStrm.skip( 16 * rStrm.readInt32() );
@@ -1753,38 +1746,38 @@ void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm )
// convert BIN token and push API operand or operator -------------------------
-bool OoxFormulaParserImpl::pushOobName( sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12Name( sal_Int32 nNameId )
{
- // one-based in OOBIN formulas
+ // one-based in BIFF12 formulas
return pushDefinedNameOperand( getDefinedNames().getByIndex( nNameId - 1 ) );
}
-bool OoxFormulaParserImpl::pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId )
{
if( const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get() )
{
if( pExtLink->getLinkType() == LINKTYPE_SELF )
- return pushOobName( nNameId );
- // external name indexes are one-based in OOBIN
+ return pushBiff12Name( nNameId );
+ // external name indexes are one-based in BIFF12
ExternalNameRef xExtName = pExtLink->getNameByIndex( nNameId - 1 );
return pushExternalNameOperand( xExtName, *pExtLink );
}
return pushBiffErrorOperand( BIFF_ERR_NAME );
}
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId )
{
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
if( pFuncInfo->mnMinParamCount == pFuncInfo->mnMaxParamCount )
return pushFunctionOperator( *pFuncInfo, pFuncInfo->mnMinParamCount );
return pushFunctionOperator( OPCODE_NONAME, 0 );
}
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
{
if( getFlag( nFuncId, BIFF_TOK_FUNCVAR_CMD ) )
nParamCount &= BIFF_TOK_FUNCVAR_COUNTMASK;
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
return pushFunctionOperator( *pFuncInfo, nParamCount );
return pushFunctionOperator( OPCODE_NONAME, nParamCount );
}
@@ -2734,12 +2727,35 @@ bool BiffFormulaParserImpl::pushBiffFunction( sal_uInt16 nFuncId, sal_uInt8 nPar
// ============================================================================
+namespace {
+
+/** Extracts the reference identifier and the remaining data from a formula in
+ the format '[RefID]Remaining'. */
+bool lclExtractRefId( sal_Int32& rnRefId, OUString& rRemainder, const OUString& rFormulaString )
+{
+ if( (rFormulaString.getLength() >= 4) && (rFormulaString[ 0 ] == '[') )
+ {
+ sal_Int32 nBracketClose = rFormulaString.indexOf( ']', 1 );
+ if( nBracketClose >= 2 )
+ {
+ rnRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32();
+ rRemainder = rFormulaString.copy( nBracketClose + 1 );
+ return rRemainder.getLength() > 0;
+ }
+ }
+ return false;
+}
+
+}
+
+// ----------------------------------------------------------------------------
+
FormulaParser::FormulaParser( const WorkbookHelper& rHelper ) :
FormulaProcessorBase( rHelper )
{
switch( getFilterType() )
{
- case FILTER_OOX: mxImpl.reset( new OoxFormulaParserImpl( *this ) ); break;
+ case FILTER_OOXML: mxImpl.reset( new OoxFormulaParserImpl( *this ) ); break;
case FILTER_BIFF: mxImpl.reset( new BiffFormulaParserImpl( *this ) ); break;
case FILTER_UNKNOWN: break;
}
@@ -2754,9 +2770,9 @@ void FormulaParser::importFormula( FormulaContext& rContext, const OUString& rFo
mxImpl->importOoxFormula( rContext, rFormulaString );
}
-void FormulaParser::importFormula( FormulaContext& rContext, RecordInputStream& rStrm ) const
+void FormulaParser::importFormula( FormulaContext& rContext, SequenceInputStream& rStrm ) const
{
- mxImpl->importOobFormula( rContext, rStrm );
+ mxImpl->importBiff12Formula( rContext, rStrm );
}
void FormulaParser::importFormula( FormulaContext& rContext, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ) const
@@ -2791,7 +2807,7 @@ void FormulaParser::convertNameToFormula( FormulaContext& rContext, sal_Int32 nT
void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OUString& rUrl, double fValue ) const
{
OSL_ENSURE( rUrl.getLength() > 0, "FormulaParser::convertNumberToHyperlink - missing URL" );
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_HYPERLINK ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_HYPERLINK ) )
{
ApiTokenSequence aTokens( 6 );
aTokens[ 0 ].OpCode = pFuncInfo->mnApiOpCode;
@@ -2808,27 +2824,15 @@ void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OU
OUString FormulaParser::importOleTargetLink( const OUString& rFormulaString )
{
- // obviously, this would overburden our formula parser, so we parse it manually
- OUString aTargetLink;
- sal_Int32 nFmlaLen = rFormulaString.getLength();
- if( (nFmlaLen >= 8) && (rFormulaString[ 0 ] == '[') )
- {
- // passed string is trimmed already
- sal_Int32 nBracketClose = rFormulaString.indexOf( ']' );
- sal_Int32 nExclamation = rFormulaString.indexOf( '!' );
- if( (nBracketClose >= 2) &&
- (nBracketClose + 1 == nExclamation) &&
- (rFormulaString[ nExclamation + 1 ] == '\'') &&
- (rFormulaString[ nFmlaLen - 1 ] == '\'') )
- {
- sal_Int32 nRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32();
- aTargetLink = mxImpl->resolveOleTarget( nRefId );
- }
- }
- return aTargetLink;
+ sal_Int32 nRefId = -1;
+ OUString aRemainder;
+ if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() >= 3) &&
+ (aRemainder[ 0 ] == '!') && (aRemainder[ 1 ] == '\'') && (aRemainder[ aRemainder.getLength() - 1 ] == '\'') )
+ return mxImpl->resolveOleTarget( nRefId, false );
+ return OUString();
}
-OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm )
+OUString FormulaParser::importOleTargetLink( SequenceInputStream& rStrm )
{
OUString aTargetLink;
sal_Int32 nFmlaSize = rStrm.readInt32();
@@ -2840,7 +2844,7 @@ OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm )
sal_Int32 nNameId;
rStrm >> nToken >> nRefId >> nNameId;
if( nToken == (BIFF_TOKCLASS_VAL|BIFF_TOKID_NAMEX) )
- aTargetLink = mxImpl->resolveOleTarget( nRefId );
+ aTargetLink = mxImpl->resolveOleTarget( nRefId, true );
}
rStrm.seek( nFmlaEndPos );
return aTargetLink;
@@ -2854,8 +2858,60 @@ OUString FormulaParser::importOleTargetLink( BiffInputStream& rStrm, const sal_u
return aTargetLink;
}
+OUString FormulaParser::importMacroName( const OUString& rFormulaString )
+{
+ /* Valid macros are either sheet macros or VBA macros. OOXML and all BIFF
+ documents store defined names for sheet macros, but OOXML documents do
+ not store any defined name for VBA macros (while BIFF documents do).
+ Sheet macros may be defined locally to a sheet, or globally to the
+ document. As a result, all of the following macro specifiers are valid:
+
+ 1) Macros located in the own document:
+ [0]!MySheetMacro (global sheet macro 'MySheetMacro')
+ Macro1!MyMacro (sheet-local sheet macro 'MyMacro')
+ [0]!MyVBAProc (VBA macro 'MyVBAProc')
+ [0]!Mod1.MyVBAProc (VBA macro 'MyVBAProc' from code module 'Mod1')
+
+ 2) Macros from an external document:
+ [2]!MySheetMacro (global external sheet macro 'MySheetMacro')
+ [2]Macro1!MyMacro (sheet-local external sheet macro 'MyMacro')
+ [2]!MyVBAProc (external VBA macro 'MyVBAProc')
+ [2]!Mod1.MyVBAProc (external VBA macro from code module 'Mod1')
+
+ This implementation is only interested in VBA macros from the own
+ document, ignoring the valid syntax 'Macro1!MyMacro' for sheet-local
+ sheet macros.
+ */
+ sal_Int32 nRefId = -1;
+ OUString aRemainder;
+ if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() > 1) && (aRemainder[ 0 ] == '!') )
+ {
+ /* In BIFF12 documents, the reference identifier is always the
+ one-based index of the external link as it is in OOXML documents
+ (it is not an index into the list of reference sheets as used in
+ cell formulas). Index 0 is an implicit placeholder for the own
+ document. In BIFF12 documents, the reference to the own document is
+ stored explicitly, mostly at the top of the list, so index 1 may
+ resolve to the own document too.
+ Passing 'false' to getExternalLink() specifies to ignore the
+ reference sheets list (if existing) and to access the list of
+ external links directly. */
+ const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, false ).get();
+ OSL_ENSURE( pExtLink, "FormulaParser::importMacroName - missing link" );
+ // do not accept macros in external documents (not supported)
+ if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_SELF) )
+ {
+ // ignore sheet macros (defined name for VBA macros may not exist, see above)
+ OUString aMacroName = aRemainder.copy( 1 );
+ const DefinedName* pDefName = getDefinedNames().getByModelName( aMacroName ).get();
+ if( !pDefName || pDefName->isVBName() )
+ return aMacroName;
+ }
+ }
+ return OUString();
+}
+
// ============================================================================
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk
index b5ede953bbfe..6ca6e6a271b9 100644
--- a/oox/source/xls/makefile.mk
+++ b/oox/source/xls/makefile.mk
@@ -42,6 +42,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/addressconverter.obj \
+ $(SLO)$/autofilterbuffer.obj \
$(SLO)$/autofiltercontext.obj \
$(SLO)$/biffcodec.obj \
$(SLO)$/biffdetector.obj \
@@ -53,6 +54,7 @@ SLOFILES = \
$(SLO)$/commentsfragment.obj \
$(SLO)$/condformatbuffer.obj \
$(SLO)$/condformatcontext.obj \
+ $(SLO)$/connectionsbuffer.obj \
$(SLO)$/connectionsfragment.obj \
$(SLO)$/defnamesbuffer.obj \
$(SLO)$/drawingfragment.obj \
@@ -71,6 +73,7 @@ SLOFILES = \
$(SLO)$/pivotcachefragment.obj \
$(SLO)$/pivottablebuffer.obj \
$(SLO)$/pivottablefragment.obj \
+ $(SLO)$/querytablebuffer.obj \
$(SLO)$/querytablefragment.obj \
$(SLO)$/richstring.obj \
$(SLO)$/richstringcontext.obj \
@@ -87,13 +90,12 @@ SLOFILES = \
$(SLO)$/themebuffer.obj \
$(SLO)$/unitconverter.obj \
$(SLO)$/viewsettings.obj \
- $(SLO)$/webquerybuffer.obj \
$(SLO)$/workbookfragment.obj \
$(SLO)$/workbookhelper.obj \
$(SLO)$/workbooksettings.obj \
$(SLO)$/worksheetbuffer.obj \
$(SLO)$/worksheetfragment.obj \
- $(SLO)$/worksheethelper.obj \
+ $(SLO)$/worksheethelper.obj \
$(SLO)$/worksheetsettings.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx
index 4dfb00abeb59..c77381b2a1c8 100644
--- a/oox/source/xls/numberformatsbuffer.cxx
+++ b/oox/source/xls/numberformatsbuffer.cxx
@@ -26,43 +26,37 @@
************************************************************************/
#include "oox/xls/numberformatsbuffer.hxx"
+
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/i18n/NumberFormatIndex.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/util/XNumberFormats.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/i18n/NumberFormatIndex.hpp>
-#include <osl/thread.h>
-#include <rtl/string.hxx>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <rtl/strbuf.hxx>
+#include <rtl/string.hxx>
+#include <osl/thread.h>
#include <rtl/ustrbuf.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormats;
-using ::com::sun::star::util::XNumberFormatTypes;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -2003,10 +1997,10 @@ NumberFormatRef NumberFormatsBuffer::importNumFmt( const AttributeList& rAttribs
return createNumFmt( nNumFmtId, aFmtCode );
}
-void NumberFormatsBuffer::importNumFmt( RecordInputStream& rStrm )
+void NumberFormatsBuffer::importNumFmt( SequenceInputStream& rStrm )
{
sal_Int32 nNumFmtId = rStrm.readuInt16();
- OUString aFmtCode = rStrm.readString();
+ OUString aFmtCode = BiffHelper::readString( rStrm );
createNumFmt( nNumFmtId, aFmtCode );
}
@@ -2120,4 +2114,3 @@ void NumberFormatsBuffer::insertBuiltinFormats()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/ooxformulaparser.cxx b/oox/source/xls/ooxformulaparser.cxx
index ec2668aef0f2..efa69abcb750 100644
--- a/oox/source/xls/ooxformulaparser.cxx
+++ b/oox/source/xls/ooxformulaparser.cxx
@@ -26,27 +26,24 @@
************************************************************************/
#include "oox/xls/ooxformulaparser.hxx"
+
#include <com/sun/star/uno/XComponentContext.hpp>
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::XComponentContext;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::FormulaToken;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
class OOXMLFormulaParserImpl : private FormulaFinalizer
{
public:
@@ -64,7 +61,7 @@ private:
// ----------------------------------------------------------------------------
OOXMLFormulaParserImpl::OOXMLFormulaParserImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
- FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, true ) ),
+ FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, true ) ),
maApiParser( rxFactory, *this )
{
}
@@ -127,7 +124,7 @@ private:
// ----------------------------------------------------------------------------
OOXMLFormulaPrinterImpl::OOXMLFormulaPrinterImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
- OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, false ),
+ OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, false ),
maApiParser( rxFactory, *this )
{
}
@@ -143,7 +140,7 @@ Sequence< OUString > OOXMLFormulaParser_getSupportedServiceNames()
OUString OOXMLFormulaParser_getImplementationName()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.OOXMLFormulaParser" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.FormulaParser" );
}
Reference< XInterface > SAL_CALL OOXMLFormulaParser_createInstance( const Reference< XComponentContext >& ) throw( Exception )
@@ -222,4 +219,3 @@ OUString SAL_CALL OOXMLFormulaParser::printFormula(
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx
index 0a5ce05a37df..188bf78544ec 100644
--- a/oox/source/xls/pagesettings.cxx
+++ b/oox/source/xls/pagesettings.cxx
@@ -26,10 +26,9 @@
************************************************************************/
#include "oox/xls/pagesettings.hxx"
-#include <set>
+
#include <algorithm>
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
+#include <set>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
@@ -38,39 +37,36 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
-#include "properties.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/unitconverter.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::Relations;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::sheet::XHeaderFooterContent;
-using ::com::sun::star::style::XStyle;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextCursor;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::oox::core::Relations;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -80,32 +76,32 @@ const double OOX_MARGIN_DEFAULT_LR = 0.748; /// Left/right d
const double OOX_MARGIN_DEFAULT_TB = 0.984; /// Top/bottom default margin in inches.
const double OOX_MARGIN_DEFAULT_HF = 0.512; /// Header/footer default margin in inches.
-const sal_uInt16 OOBIN_PRINTOPT_HORCENTER = 0x0001;
-const sal_uInt16 OOBIN_PRINTOPT_VERCENTER = 0x0002;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTHEADING = 0x0004;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTGRID = 0x0008;
-
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFEVEN = 0x0001;
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFFIRST = 0x0002;
-const sal_uInt16 OOBIN_HEADERFOOTER_SCALEDOC = 0x0004;
-const sal_uInt16 OOBIN_HEADERFOOTER_ALIGNMARGIN = 0x0008;
-
-const sal_uInt16 OOBIN_PAGESETUP_INROWS = 0x0001;
-const sal_uInt16 OOBIN_PAGESETUP_LANDSCAPE = 0x0002;
-const sal_uInt16 OOBIN_PAGESETUP_INVALID = 0x0004;
-const sal_uInt16 OOBIN_PAGESETUP_BLACKWHITE = 0x0008;
-const sal_uInt16 OOBIN_PAGESETUP_DRAFTQUALITY = 0x0010;
-const sal_uInt16 OOBIN_PAGESETUP_PRINTNOTES = 0x0020;
-const sal_uInt16 OOBIN_PAGESETUP_DEFAULTORIENT = 0x0040;
-const sal_uInt16 OOBIN_PAGESETUP_USEFIRSTPAGE = 0x0080;
-const sal_uInt16 OOBIN_PAGESETUP_NOTES_END = 0x0100; // different to BIFF flag
-
-const sal_uInt16 OOBIN_CHARTPAGESETUP_LANDSCAPE = 0x0001;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_INVALID = 0x0002;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_BLACKWHITE = 0x0004;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DEFAULTORIENT = 0x0008;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_USEFIRSTPAGE = 0x0010;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DRAFTQUALITY = 0x0020;
+const sal_uInt16 BIFF12_PRINTOPT_HORCENTER = 0x0001;
+const sal_uInt16 BIFF12_PRINTOPT_VERCENTER = 0x0002;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTHEADING = 0x0004;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTGRID = 0x0008;
+
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFEVEN = 0x0001;
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFFIRST = 0x0002;
+const sal_uInt16 BIFF12_HEADERFOOTER_SCALEDOC = 0x0004;
+const sal_uInt16 BIFF12_HEADERFOOTER_ALIGNMARGIN = 0x0008;
+
+const sal_uInt16 BIFF12_PAGESETUP_INROWS = 0x0001;
+const sal_uInt16 BIFF12_PAGESETUP_LANDSCAPE = 0x0002;
+const sal_uInt16 BIFF12_PAGESETUP_INVALID = 0x0004;
+const sal_uInt16 BIFF12_PAGESETUP_BLACKWHITE = 0x0008;
+const sal_uInt16 BIFF12_PAGESETUP_DRAFTQUALITY = 0x0010;
+const sal_uInt16 BIFF12_PAGESETUP_PRINTNOTES = 0x0020;
+const sal_uInt16 BIFF12_PAGESETUP_DEFAULTORIENT = 0x0040;
+const sal_uInt16 BIFF12_PAGESETUP_USEFIRSTPAGE = 0x0080;
+const sal_uInt16 BIFF12_PAGESETUP_NOTES_END = 0x0100; // different to BIFF flag
+
+const sal_uInt16 BIFF12_CHARTPAGESETUP_LANDSCAPE = 0x0001;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_INVALID = 0x0002;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_BLACKWHITE = 0x0004;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DEFAULTORIENT= 0x0008;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_USEFIRSTPAGE = 0x0010;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DRAFTQUALITY = 0x0020;
const sal_uInt16 BIFF_PAGESETUP_INROWS = 0x0001;
const sal_uInt16 BIFF_PAGESETUP_PORTRAIT = 0x0002;
@@ -154,7 +150,7 @@ PageSettingsModel::PageSettingsModel() :
{
}
-void PageSettingsModel::setBinPrintErrors( sal_uInt8 nPrintErrors )
+void PageSettingsModel::setBiffPrintErrors( sal_uInt8 nPrintErrors )
{
static const sal_Int32 spnErrorIds[] = { XML_displayed, XML_none, XML_dash, XML_NA };
mnPrintErrors = STATIC_ARRAY_SELECT( spnErrorIds, nPrintErrors, XML_none );
@@ -245,24 +241,24 @@ void PageSettings::importPicture( const Relations& rRelations, const AttributeLi
importPictureData( rRelations, rAttribs.getString( R_TOKEN( id ), OUString() ) );
}
-void PageSettings::importPageMargins( RecordInputStream& rStrm )
+void PageSettings::importPageMargins( SequenceInputStream& rStrm )
{
rStrm >> maModel.mfLeftMargin >> maModel.mfRightMargin
>> maModel.mfTopMargin >> maModel.mfBottomMargin
>> maModel.mfHeaderMargin >> maModel.mfFooterMargin;
}
-void PageSettings::importPrintOptions( RecordInputStream& rStrm )
+void PageSettings::importPrintOptions( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maModel.mbHorCenter = getFlag( nFlags, OOBIN_PRINTOPT_HORCENTER );
- maModel.mbVerCenter = getFlag( nFlags, OOBIN_PRINTOPT_VERCENTER );
- maModel.mbPrintGrid = getFlag( nFlags, OOBIN_PRINTOPT_PRINTGRID );
- maModel.mbPrintHeadings = getFlag( nFlags, OOBIN_PRINTOPT_PRINTHEADING );
+ maModel.mbHorCenter = getFlag( nFlags, BIFF12_PRINTOPT_HORCENTER );
+ maModel.mbVerCenter = getFlag( nFlags, BIFF12_PRINTOPT_VERCENTER );
+ maModel.mbPrintGrid = getFlag( nFlags, BIFF12_PRINTOPT_PRINTGRID );
+ maModel.mbPrintHeadings = getFlag( nFlags, BIFF12_PRINTOPT_PRINTHEADING );
}
-void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importPageSetup( const Relations& rRelations, SequenceInputStream& rStrm )
{
OUString aRelId;
sal_uInt16 nFlags;
@@ -271,18 +267,18 @@ void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStre
>> maModel.mnCopies >> maModel.mnFirstPage
>> maModel.mnFitToWidth >> maModel.mnFitToHeight
>> nFlags >> aRelId;
- maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
+ maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( aRelId );
- maModel.mnOrientation = getFlagValue( nFlags, OOBIN_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
- maModel.mnPageOrder = getFlagValue( nFlags, OOBIN_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
- maModel.mnCellComments = getFlagValue( nFlags, OOBIN_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, OOBIN_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
- maModel.mbValidSettings = !getFlag( nFlags, OOBIN_PAGESETUP_INVALID );
- maModel.mbUseFirstPage = getFlag( nFlags, OOBIN_PAGESETUP_USEFIRSTPAGE );
- maModel.mbBlackWhite = getFlag( nFlags, OOBIN_PAGESETUP_BLACKWHITE );
- maModel.mbDraftQuality = getFlag( nFlags, OOBIN_PAGESETUP_DRAFTQUALITY );
+ maModel.mnOrientation = getFlagValue( nFlags, BIFF12_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+ maModel.mnPageOrder = getFlagValue( nFlags, BIFF12_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
+ maModel.mnCellComments = getFlagValue( nFlags, BIFF12_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF12_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
+ maModel.mbValidSettings = !getFlag( nFlags, BIFF12_PAGESETUP_INVALID );
+ maModel.mbUseFirstPage = getFlag( nFlags, BIFF12_PAGESETUP_USEFIRSTPAGE );
+ maModel.mbBlackWhite = getFlag( nFlags, BIFF12_PAGESETUP_BLACKWHITE );
+ maModel.mbDraftQuality = getFlag( nFlags, BIFF12_PAGESETUP_DRAFTQUALITY );
}
-void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importChartPageSetup( const Relations& rRelations, SequenceInputStream& rStrm )
{
OUString aRelId;
sal_uInt16 nFirstPage, nFlags;
@@ -290,27 +286,27 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInpu
>> maModel.mnCopies >> nFirstPage >> nFlags >> aRelId;
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( aRelId );
maModel.mnFirstPage = nFirstPage; // 16-bit in CHARTPAGESETUP
- maModel.mnOrientation = getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
- maModel.mbValidSettings = !getFlag( nFlags, OOBIN_CHARTPAGESETUP_INVALID );
- maModel.mbUseFirstPage = getFlag( nFlags, OOBIN_CHARTPAGESETUP_USEFIRSTPAGE );
- maModel.mbBlackWhite = getFlag( nFlags, OOBIN_CHARTPAGESETUP_BLACKWHITE );
- maModel.mbDraftQuality = getFlag( nFlags, OOBIN_CHARTPAGESETUP_DRAFTQUALITY );
+ maModel.mnOrientation = getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+ maModel.mbValidSettings = !getFlag( nFlags, BIFF12_CHARTPAGESETUP_INVALID );
+ maModel.mbUseFirstPage = getFlag( nFlags, BIFF12_CHARTPAGESETUP_USEFIRSTPAGE );
+ maModel.mbBlackWhite = getFlag( nFlags, BIFF12_CHARTPAGESETUP_BLACKWHITE );
+ maModel.mbDraftQuality = getFlag( nFlags, BIFF12_CHARTPAGESETUP_DRAFTQUALITY );
}
-void PageSettings::importHeaderFooter( RecordInputStream& rStrm )
+void PageSettings::importHeaderFooter( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags
>> maModel.maOddHeader >> maModel.maOddFooter
>> maModel.maEvenHeader >> maModel.maEvenFooter
>> maModel.maFirstHeader >> maModel.maFirstFooter;
- maModel.mbUseEvenHF = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFEVEN );
- maModel.mbUseFirstHF = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFFIRST );
+ maModel.mbUseEvenHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFEVEN );
+ maModel.mbUseFirstHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFFIRST );
}
-void PageSettings::importPicture( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importPicture( const Relations& rRelations, SequenceInputStream& rStrm )
{
- importPictureData( rRelations, rStrm.readString() );
+ importPictureData( rRelations, BiffHelper::readString( rStrm ) );
}
void PageSettings::importLeftMargin( BiffInputStream& rStrm )
@@ -364,7 +360,7 @@ void PageSettings::importPageSetup( BiffInputStream& rStrm )
if( getBiff() == BIFF8 )
{
- maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
+ maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
maModel.mnCellComments = getFlagValue( nFlags, BIFF_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
}
}
@@ -680,8 +676,8 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
appendField( xContent );
}
break;
- case 'Z': // file path (without file name), BIFF8 and OOX only
- if( (getFilterType() == FILTER_OOX) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
+ case 'Z': // file path (without file name), OOXML, BIFF12, and BIFF8 only
+ if( (getFilterType() == FILTER_OOXML) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
{
Reference< XTextContent > xContent = createField( maFileNameService );
PropertySet aPropSet( xContent );
@@ -749,7 +745,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
break;
case 'K': // text color (not in BIFF)
- if( (getFilterType() == FILTER_OOX) && (pcChar + 6 < pcEnd) )
+ if( (getFilterType() == FILTER_OOXML) && (pcChar + 6 < pcEnd) )
{
setAttributes();
// eat the following 6 characters
@@ -1237,8 +1233,8 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
sal_Int32 nHeight = 0;
if( rContent.getLength() > 0 )
{
- Reference< XHeaderFooterContent > xHFContent;
- if( rPropSet.getProperty( xHFContent, nPropId ) && xHFContent.is() )
+ Reference< XHeaderFooterContent > xHFContent( rPropSet.getAnyProperty( nPropId ), UNO_QUERY );
+ if( xHFContent.is() )
{
double fTotalHeight = mxHFParser->parse( xHFContent, rContent );
rPropSet.setProperty( nPropId, xHFContent );
@@ -1252,4 +1248,3 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx
index d76ab81d07c4..e8ca3539e167 100644
--- a/oox/source/xls/pivotcachebuffer.cxx
+++ b/oox/source/xls/pivotcachebuffer.cxx
@@ -26,20 +26,20 @@
************************************************************************/
#include "oox/xls/pivotcachebuffer.hxx"
+
#include <set>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp>
#include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/XCell.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/defnamesbuffer.hxx"
#include "oox/xls/excelhandlers.hxx"
@@ -48,75 +48,71 @@
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldGroupInfo;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotFieldGrouping;
-using ::oox::core::Relations;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::Relations;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_uInt16 OOBIN_PCDFIELD_SERVERFIELD = 0x0001;
-const sal_uInt16 OOBIN_PCDFIELD_NOUNIQUEITEMS = 0x0002;
-const sal_uInt16 OOBIN_PCDFIELD_DATABASEFIELD = 0x0004;
-const sal_uInt16 OOBIN_PCDFIELD_HASCAPTION = 0x0008;
-const sal_uInt16 OOBIN_PCDFIELD_MEMBERPROPFIELD = 0x0010;
-const sal_uInt16 OOBIN_PCDFIELD_HASFORMULA = 0x0100;
-const sal_uInt16 OOBIN_PCDFIELD_HASPROPERTYNAME = 0x0200;
-
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSEMIMIXED = 0x0001;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASNONDATE = 0x0002;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASDATE = 0x0004;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSTRING = 0x0008;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASBLANK = 0x0010;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMIXED = 0x0020;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISNUMERIC = 0x0040;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISINTEGER = 0x0080;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMINMAX = 0x0100;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASLONGTEXT = 0x0200;
-
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DOUBLE = 0x0001;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_STRING = 0x0002;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_ERROR = 0x0010;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DATE = 0x0020;
-
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOSTART = 0x01;
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOEND = 0x02;
-const sal_uInt8 OOBIN_PCDFRANGEPR_DATEGROUP = 0x04;
-
-const sal_uInt8 OOBIN_PCDEFINITION_SAVEDATA = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_INVALID = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_REFRESHONLOAD = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_OPTIMIZEMEMORY = 0x08;
-const sal_uInt8 OOBIN_PCDEFINITION_ENABLEREFRESH = 0x10;
-const sal_uInt8 OOBIN_PCDEFINITION_BACKGROUNDQUERY = 0x20;
-const sal_uInt8 OOBIN_PCDEFINITION_UPGRADEONREFR = 0x40;
-const sal_uInt8 OOBIN_PCDEFINITION_TUPELCACHE = 0x80;
-
-const sal_uInt8 OOBIN_PCDEFINITION_HASUSERNAME = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_HASRELID = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTSUBQUERY = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTDRILL = 0x08;
-
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASRELID = 0x01;
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASSHEET = 0x02;
+const sal_uInt16 BIFF12_PCDFIELD_SERVERFIELD = 0x0001;
+const sal_uInt16 BIFF12_PCDFIELD_NOUNIQUEITEMS = 0x0002;
+const sal_uInt16 BIFF12_PCDFIELD_DATABASEFIELD = 0x0004;
+const sal_uInt16 BIFF12_PCDFIELD_HASCAPTION = 0x0008;
+const sal_uInt16 BIFF12_PCDFIELD_MEMBERPROPFIELD = 0x0010;
+const sal_uInt16 BIFF12_PCDFIELD_HASFORMULA = 0x0100;
+const sal_uInt16 BIFF12_PCDFIELD_HASPROPERTYNAME = 0x0200;
+
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSEMIMIXED = 0x0001;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASNONDATE = 0x0002;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASDATE = 0x0004;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSTRING = 0x0008;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASBLANK = 0x0010;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMIXED = 0x0020;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISNUMERIC = 0x0040;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISINTEGER = 0x0080;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMINMAX = 0x0100;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASLONGTEXT = 0x0200;
+
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DOUBLE = 0x0001;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_STRING = 0x0002;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_ERROR = 0x0010;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DATE = 0x0020;
+
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOSTART = 0x01;
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOEND = 0x02;
+const sal_uInt8 BIFF12_PCDFRANGEPR_DATEGROUP = 0x04;
+
+const sal_uInt8 BIFF12_PCDEFINITION_SAVEDATA = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_INVALID = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_REFRESHONLOAD = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_OPTIMIZEMEMORY = 0x08;
+const sal_uInt8 BIFF12_PCDEFINITION_ENABLEREFRESH = 0x10;
+const sal_uInt8 BIFF12_PCDEFINITION_BACKGROUNDQUERY = 0x20;
+const sal_uInt8 BIFF12_PCDEFINITION_UPGRADEONREFR = 0x40;
+const sal_uInt8 BIFF12_PCDEFINITION_TUPELCACHE = 0x80;
+
+const sal_uInt8 BIFF12_PCDEFINITION_HASUSERNAME = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_HASRELID = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTSUBQUERY = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTDRILL = 0x08;
+
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASRELID = 0x01;
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASSHEET = 0x02;
+
+// ----------------------------------------------------------------------------
const sal_uInt16 BIFF_PCDSOURCE_WORKSHEET = 0x0001;
const sal_uInt16 BIFF_PCDSOURCE_EXTERNAL = 0x0002;
@@ -216,19 +212,19 @@ void PivotCacheItem::readIndex( const AttributeList& rAttribs )
mnType = XML_x;
}
-void PivotCacheItem::readString( RecordInputStream& rStrm )
+void PivotCacheItem::readString( SequenceInputStream& rStrm )
{
- maValue <<= rStrm.readString();
+ maValue <<= BiffHelper::readString( rStrm );
mnType = XML_s;
}
-void PivotCacheItem::readDouble( RecordInputStream& rStrm )
+void PivotCacheItem::readDouble( SequenceInputStream& rStrm )
{
maValue <<= rStrm.readDouble();
mnType = XML_n;
}
-void PivotCacheItem::readDate( RecordInputStream& rStrm )
+void PivotCacheItem::readDate( SequenceInputStream& rStrm )
{
DateTime aDateTime;
aDateTime.Year = rStrm.readuInt16();
@@ -242,19 +238,19 @@ void PivotCacheItem::readDate( RecordInputStream& rStrm )
mnType = XML_d;
}
-void PivotCacheItem::readBool( RecordInputStream& rStrm )
+void PivotCacheItem::readBool( SequenceInputStream& rStrm )
{
maValue <<= (rStrm.readuInt8() != 0);
mnType = XML_b;
}
-void PivotCacheItem::readError( RecordInputStream& rStrm )
+void PivotCacheItem::readError( SequenceInputStream& rStrm )
{
maValue <<= static_cast< sal_Int32 >( rStrm.readuInt8() );
mnType = XML_e;
}
-void PivotCacheItem::readIndex( RecordInputStream& rStrm )
+void PivotCacheItem::readIndex( SequenceInputStream& rStrm )
{
maValue <<= rStrm.readInt32();
mnType = XML_x;
@@ -342,9 +338,9 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA
}
}
-void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheItemList::importItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- if( nRecId == OOBIN_ID_PCITEM_ARRAY )
+ if( nRecId == BIFF12_ID_PCITEM_ARRAY )
{
importArray( rStrm );
return;
@@ -353,18 +349,18 @@ void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm
PivotCacheItem& rItem = createItem();
switch( nRecId )
{
- case OOBIN_ID_PCITEM_MISSING:
- case OOBIN_ID_PCITEMA_MISSING: break;
- case OOBIN_ID_PCITEM_STRING:
- case OOBIN_ID_PCITEMA_STRING: rItem.readString( rStrm ); break;
- case OOBIN_ID_PCITEM_DOUBLE:
- case OOBIN_ID_PCITEMA_DOUBLE: rItem.readDouble( rStrm ); break;
- case OOBIN_ID_PCITEM_DATE:
- case OOBIN_ID_PCITEMA_DATE: rItem.readDate( rStrm ); break;
- case OOBIN_ID_PCITEM_BOOL:
- case OOBIN_ID_PCITEMA_BOOL: rItem.readBool( rStrm ); break;
- case OOBIN_ID_PCITEM_ERROR:
- case OOBIN_ID_PCITEMA_ERROR: rItem.readError( rStrm ); break;
+ case BIFF12_ID_PCITEM_MISSING:
+ case BIFF12_ID_PCITEMA_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING:
+ case BIFF12_ID_PCITEMA_STRING: rItem.readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_DOUBLE:
+ case BIFF12_ID_PCITEMA_DOUBLE: rItem.readDouble( rStrm ); break;
+ case BIFF12_ID_PCITEM_DATE:
+ case BIFF12_ID_PCITEMA_DATE: rItem.readDate( rStrm ); break;
+ case BIFF12_ID_PCITEM_BOOL:
+ case BIFF12_ID_PCITEMA_BOOL: rItem.readBool( rStrm ); break;
+ case BIFF12_ID_PCITEM_ERROR:
+ case BIFF12_ID_PCITEMA_ERROR: rItem.readError( rStrm ); break;
default: OSL_ENSURE( false, "PivotCacheItemList::importItem - unknown record type" );
}
}
@@ -411,7 +407,7 @@ PivotCacheItem& PivotCacheItemList::createItem()
return maItems.back();
}
-void PivotCacheItemList::importArray( RecordInputStream& rStrm )
+void PivotCacheItemList::importArray( SequenceInputStream& rStrm )
{
sal_uInt16 nType = rStrm.readuInt16();
sal_Int32 nCount = rStrm.readInt32();
@@ -419,10 +415,10 @@ void PivotCacheItemList::importArray( RecordInputStream& rStrm )
{
switch( nType )
{
- case OOBIN_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_STRING: createItem().readString( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_ERROR: createItem().readError( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_DATE: createItem().readDate( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_STRING: createItem().readString( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_ERROR: createItem().readError( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_DATE: createItem().readDate( rStrm ); break;
default:
OSL_ENSURE( false, "PivotCacheItemList::importArray - unknown data type" );
nIdx = nCount;
@@ -477,7 +473,7 @@ PCFieldGroupModel::PCFieldGroupModel() :
{
}
-void PCFieldGroupModel::setBinGroupBy( sal_uInt8 nGroupBy )
+void PCFieldGroupModel::setBiffGroupBy( sal_uInt8 nGroupBy )
{
static const sal_Int32 spnGroupBy[] = { XML_range,
XML_seconds, XML_minutes, XML_hours, XML_days, XML_months, XML_quarters, XML_years };
@@ -562,62 +558,62 @@ void PivotCacheField::importGroupItem( sal_Int32 nElement, const AttributeList&
maGroupItems.importItem( nElement, rAttribs );
}
-void PivotCacheField::importPCDField( RecordInputStream& rStrm )
+void PivotCacheField::importPCDField( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags >> maFieldModel.mnNumFmtId;
maFieldModel.mnSqlType = rStrm.readInt16();
rStrm >> maFieldModel.mnHierarchy >> maFieldModel.mnLevel >> maFieldModel.mnMappingCount >> maFieldModel.maName;
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASCAPTION ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASCAPTION ) )
rStrm >> maFieldModel.maCaption;
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASFORMULA ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASFORMULA ) )
rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
if( maFieldModel.mnMappingCount > 0 )
rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASPROPERTYNAME ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASPROPERTYNAME ) )
rStrm >> maFieldModel.maPropertyName;
- maFieldModel.mbDatabaseField = getFlag( nFlags, OOBIN_PCDFIELD_DATABASEFIELD );
- maFieldModel.mbServerField = getFlag( nFlags, OOBIN_PCDFIELD_SERVERFIELD );
- maFieldModel.mbUniqueList = !getFlag( nFlags, OOBIN_PCDFIELD_NOUNIQUEITEMS );
- maFieldModel.mbMemberPropField = getFlag( nFlags, OOBIN_PCDFIELD_MEMBERPROPFIELD );
+ maFieldModel.mbDatabaseField = getFlag( nFlags, BIFF12_PCDFIELD_DATABASEFIELD );
+ maFieldModel.mbServerField = getFlag( nFlags, BIFF12_PCDFIELD_SERVERFIELD );
+ maFieldModel.mbUniqueList = !getFlag( nFlags, BIFF12_PCDFIELD_NOUNIQUEITEMS );
+ maFieldModel.mbMemberPropField = getFlag( nFlags, BIFF12_PCDFIELD_MEMBERPROPFIELD );
}
-void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFSharedItems( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSEMIMIXED );
- maSharedItemsModel.mbHasNonDate = getFlag( nFlags, OOBIN_PCDFSITEMS_HASNONDATE );
- maSharedItemsModel.mbHasDate = getFlag( nFlags, OOBIN_PCDFSITEMS_HASDATE );
- maSharedItemsModel.mbHasString = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSTRING );
- maSharedItemsModel.mbHasBlank = getFlag( nFlags, OOBIN_PCDFSITEMS_HASBLANK );
- maSharedItemsModel.mbHasMixed = getFlag( nFlags, OOBIN_PCDFSITEMS_HASMIXED );
- maSharedItemsModel.mbIsNumeric = getFlag( nFlags, OOBIN_PCDFSITEMS_ISNUMERIC );
- maSharedItemsModel.mbIsInteger = getFlag( nFlags, OOBIN_PCDFSITEMS_ISINTEGER );
- maSharedItemsModel.mbHasLongText = getFlag( nFlags, OOBIN_PCDFSITEMS_HASLONGTEXT );
+ maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSEMIMIXED );
+ maSharedItemsModel.mbHasNonDate = getFlag( nFlags, BIFF12_PCDFSITEMS_HASNONDATE );
+ maSharedItemsModel.mbHasDate = getFlag( nFlags, BIFF12_PCDFSITEMS_HASDATE );
+ maSharedItemsModel.mbHasString = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSTRING );
+ maSharedItemsModel.mbHasBlank = getFlag( nFlags, BIFF12_PCDFSITEMS_HASBLANK );
+ maSharedItemsModel.mbHasMixed = getFlag( nFlags, BIFF12_PCDFSITEMS_HASMIXED );
+ maSharedItemsModel.mbIsNumeric = getFlag( nFlags, BIFF12_PCDFSITEMS_ISNUMERIC );
+ maSharedItemsModel.mbIsInteger = getFlag( nFlags, BIFF12_PCDFSITEMS_ISINTEGER );
+ maSharedItemsModel.mbHasLongText = getFlag( nFlags, BIFF12_PCDFSITEMS_HASLONGTEXT );
}
-void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
maSharedItems.importItem( nRecId, rStrm );
}
-void PivotCacheField::importPCDFieldGroup( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFieldGroup( SequenceInputStream& rStrm )
{
rStrm >> maFieldGroupModel.mnParentField >> maFieldGroupModel.mnBaseField;
}
-void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFRangePr( SequenceInputStream& rStrm )
{
sal_uInt8 nGroupBy, nFlags;
rStrm >> nGroupBy >> nFlags >> maFieldGroupModel.mfStartValue >> maFieldGroupModel.mfEndValue >> maFieldGroupModel.mfInterval;
- maFieldGroupModel.setBinGroupBy( nGroupBy );
+ maFieldGroupModel.setBiffGroupBy( nGroupBy );
maFieldGroupModel.mbRangeGroup = true;
- maFieldGroupModel.mbDateGroup = getFlag( nFlags, OOBIN_PCDFRANGEPR_DATEGROUP );
- maFieldGroupModel.mbAutoStart = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOSTART );
- maFieldGroupModel.mbAutoEnd = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOEND );
+ maFieldGroupModel.mbDateGroup = getFlag( nFlags, BIFF12_PCDFRANGEPR_DATEGROUP );
+ maFieldGroupModel.mbAutoStart = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOSTART );
+ maFieldGroupModel.mbAutoEnd = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOEND );
OSL_ENSURE( maFieldGroupModel.mbDateGroup == (maFieldGroupModel.mnGroupBy != XML_range), "PivotCacheField::importPCDFRangePr - wrong date flag" );
if( maFieldGroupModel.mbDateGroup )
@@ -627,14 +623,14 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
}
}
-void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- OSL_ENSURE( nRecId == OOBIN_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
- if( nRecId == OOBIN_ID_PCITEM_INDEX )
+ OSL_ENSURE( nRecId == BIFF12_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
+ if( nRecId == BIFF12_ID_PCITEM_INDEX )
maDiscreteItems.push_back( rStrm.readInt32() );
}
-void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
maGroupItems.importItem( nRecId, rStrm );
}
@@ -696,7 +692,7 @@ void PivotCacheField::importPCDFRangePr( BiffInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maFieldGroupModel.setBinGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
+ maFieldGroupModel.setBiffGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
maFieldGroupModel.mbRangeGroup = true;
maFieldGroupModel.mbDateGroup = maFieldGroupModel.mnGroupBy != XML_range;
maFieldGroupModel.mbAutoStart = getFlag( nFlags, BIFF_PCDFRANGEPR_AUTOSTART );
@@ -837,7 +833,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
typedef ::std::vector< GroupItemList > GroupItemMap;
GroupItemMap aItemMap( maGroupItems.size() );
for( IndexVector::const_iterator aBeg = maDiscreteItems.begin(), aIt = aBeg, aEnd = maDiscreteItems.end(); aIt != aEnd; ++aIt )
- if( GroupItemList* pItems = ContainerHelper::getVectorElement( aItemMap, *aIt ) )
+ if( GroupItemList* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) )
pItems->push_back( static_cast< sal_Int32 >( aIt - aBeg ) );
// process all groups
@@ -924,7 +920,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
}
// replace original item names in passed vector with group name
for( GroupItemList::iterator aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
- if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElement( orItemNames, *aIt2 ) )
+ if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElementAccess( orItemNames, *aIt2 ) )
pName->maGroupName = aGroupName;
}
}
@@ -953,7 +949,7 @@ void PivotCacheField::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_In
writeItemToSourceDataCell( rSheetHelper, nCol, nRow, rItem );
}
-void PivotCacheField::importPCRecordItem( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const
+void PivotCacheField::importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const
{
if( hasSharedItems() )
{
@@ -1088,29 +1084,29 @@ void PivotCache::importWorksheetSource( const AttributeList& rAttribs, const Rel
getAddressConverter().convertToCellRangeUnchecked( maSheetSrcModel.maRange, rAttribs.getString( XML_ref, OUString() ), 0 );
}
-void PivotCache::importPCDefinition( RecordInputStream& rStrm )
+void PivotCache::importPCDefinition( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags1, nFlags2;
rStrm.skip( 3 ); // create/refresh version id's
rStrm >> nFlags1 >> maDefModel.mnMissItemsLimit >> maDefModel.mfRefreshedDate >> nFlags2 >> maDefModel.mnRecords;
- if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASUSERNAME ) )
+ if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASUSERNAME ) )
rStrm >> maDefModel.maRefreshedBy;
- if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASRELID ) )
+ if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASRELID ) )
rStrm >> maDefModel.maRelId;
- maDefModel.mbInvalid = getFlag( nFlags1, OOBIN_PCDEFINITION_INVALID );
- maDefModel.mbSaveData = getFlag( nFlags1, OOBIN_PCDEFINITION_SAVEDATA );
- maDefModel.mbRefreshOnLoad = getFlag( nFlags1, OOBIN_PCDEFINITION_REFRESHONLOAD );
- maDefModel.mbOptimizeMemory = getFlag( nFlags1, OOBIN_PCDEFINITION_OPTIMIZEMEMORY );
- maDefModel.mbEnableRefresh = getFlag( nFlags1, OOBIN_PCDEFINITION_ENABLEREFRESH );
- maDefModel.mbBackgroundQuery = getFlag( nFlags1, OOBIN_PCDEFINITION_BACKGROUNDQUERY );
- maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, OOBIN_PCDEFINITION_UPGRADEONREFR );
- maDefModel.mbTupleCache = getFlag( nFlags1, OOBIN_PCDEFINITION_TUPELCACHE );
- maDefModel.mbSupportSubquery = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTSUBQUERY );
- maDefModel.mbSupportDrill = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTDRILL );
+ maDefModel.mbInvalid = getFlag( nFlags1, BIFF12_PCDEFINITION_INVALID );
+ maDefModel.mbSaveData = getFlag( nFlags1, BIFF12_PCDEFINITION_SAVEDATA );
+ maDefModel.mbRefreshOnLoad = getFlag( nFlags1, BIFF12_PCDEFINITION_REFRESHONLOAD );
+ maDefModel.mbOptimizeMemory = getFlag( nFlags1, BIFF12_PCDEFINITION_OPTIMIZEMEMORY );
+ maDefModel.mbEnableRefresh = getFlag( nFlags1, BIFF12_PCDEFINITION_ENABLEREFRESH );
+ maDefModel.mbBackgroundQuery = getFlag( nFlags1, BIFF12_PCDEFINITION_BACKGROUNDQUERY );
+ maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, BIFF12_PCDEFINITION_UPGRADEONREFR );
+ maDefModel.mbTupleCache = getFlag( nFlags1, BIFF12_PCDEFINITION_TUPELCACHE );
+ maDefModel.mbSupportSubquery = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTSUBQUERY );
+ maDefModel.mbSupportDrill = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTDRILL );
}
-void PivotCache::importPCDSource( RecordInputStream& rStrm )
+void PivotCache::importPCDSource( SequenceInputStream& rStrm )
{
sal_Int32 nSourceType;
rStrm >> nSourceType >> maSourceModel.mnConnectionId;
@@ -1118,13 +1114,13 @@ void PivotCache::importPCDSource( RecordInputStream& rStrm )
maSourceModel.mnSourceType = STATIC_ARRAY_SELECT( spnSourceTypes, nSourceType, XML_TOKEN_INVALID );
}
-void PivotCache::importPCDSheetSource( RecordInputStream& rStrm, const Relations& rRelations )
+void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relations& rRelations )
{
sal_uInt8 nIsDefName, nIsBuiltinName, nFlags;
rStrm >> nIsDefName >> nIsBuiltinName >> nFlags;
- if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASSHEET ) )
+ if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASSHEET ) )
rStrm >> maSheetSrcModel.maSheet;
- if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASRELID ) )
+ if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASRELID ) )
rStrm >> maSheetSrcModel.maRelId;
// read cell range or defined name
@@ -1268,7 +1264,7 @@ const PivotCacheField* PivotCache::getCacheField( sal_Int32 nFieldIdx ) const
sal_Int32 PivotCache::getCacheDatabaseIndex( sal_Int32 nFieldIdx ) const
{
- return ContainerHelper::getVectorElement< sal_Int32 >( maDatabaseIndexes, nFieldIdx, -1 );
+ return ContainerHelper::getVectorElement( maDatabaseIndexes, nFieldIdx, -1 );
}
void PivotCache::writeSourceHeaderCells( WorksheetHelper& rSheetHelper ) const
@@ -1290,7 +1286,7 @@ void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 n
pCacheField->writeSourceDataCell( rSheetHelper, maSheetSrcModel.maRange.StartColumn + nCol, maSheetSrcModel.maRange.StartRow + nRow, rItem );
}
-void PivotCache::importPCRecord( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const
+void PivotCache::importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const
{
OSL_ENSURE( (0 < nRow) && (nRow <= maSheetSrcModel.maRange.EndRow - maSheetSrcModel.maRange.StartRow), "PivotCache::importPCRecord - invalid row index" );
sal_Int32 nCol = maSheetSrcModel.maRange.StartColumn;
@@ -1411,7 +1407,7 @@ void PivotCache::finalizeExternalSheetSource()
{
/* If pivot cache is based on external sheet data, try to restore sheet
data from cache records. No support for external defined names or tables,
- sheet name and path to cache records fragment (OOX only) are required. */
+ sheet name and path to cache records fragment (OOXML only) are required. */
bool bHasRelation = (getFilterType() == FILTER_BIFF) || (maDefModel.maRelId.getLength() > 0);
if( bHasRelation && (maSheetSrcModel.maDefName.getLength() == 0) && (maSheetSrcModel.maSheet.getLength() > 0) )
prepareSourceDataSheet();
@@ -1471,6 +1467,29 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
{
switch( getFilterType() )
{
+ /* OOXML/BIFF12 filter: On first call for the cache ID, the pivot
+ cache object is created and inserted into maCaches. Then, the cache
+ definition fragment is read and the cache is returned. On
+ subsequent calls, the created cache will be found in maCaches and
+ returned immediately. */
+ case FILTER_OOXML:
+ {
+ // try to find an imported pivot cache
+ if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
+ return pCache;
+
+ // check if a fragment path exists for the passed cache identifier
+ FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
+ if( aIt == maFragmentPaths.end() )
+ return 0;
+
+ /* Import the cache fragment. This may create a dummy data sheet
+ for external sheet sources. */
+ PivotCache& rCache = createPivotCache( nCacheId );
+ importOoxFragment( new PivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
+ return &rCache;
+ }
+
/* BIFF filter: Pivot table provides 0-based index into list of pivot
cache source links (PIVOTCACHE/PCDSOURCE/... record blocks in
workbook stream). First, this index has to be resolved to the cache
@@ -1485,7 +1504,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
{
/* Resolve cache index to cache identifier and try to find pivot
cache. Cache must exist already for a valid cache index. */
- nCacheId = ContainerHelper::getVectorElement< sal_Int32 >( maCacheIds, nCacheId, -1 );
+ nCacheId = ContainerHelper::getVectorElement( maCacheIds, nCacheId, -1 );
PivotCache* pCache = maCaches.get( nCacheId ).get();
if( !pCache )
return 0;
@@ -1504,29 +1523,6 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
return pCache;
}
- /* OOX/OOBIN filter: On first call for the cache ID, the pivot cache
- object is created and inserted into maCaches. Then, the cache
- definition fragment is read and the cache is returned. On
- subsequent calls, the created cache will be found in maCaches and
- returned immediately. */
- case FILTER_OOX:
- {
- // try to find an imported pivot cache
- if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
- return pCache;
-
- // check if a fragment path exists for the passed cache identifier
- FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
- if( aIt == maFragmentPaths.end() )
- return 0;
-
- /* Import the cache fragment. This may create a dummy data sheet
- for external sheet sources. */
- PivotCache& rCache = createPivotCache( nCacheId );
- importOoxFragment( new OoxPivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
- return &rCache;
- }
-
case FILTER_UNKNOWN:
OSL_ENSURE( false, "PivotCacheBuffer::importPivotCacheFragment - unknown filter type" );
}
@@ -1545,4 +1541,3 @@ PivotCache& PivotCacheBuffer::createPivotCache( sal_Int32 nCacheId )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx
index 440fcd1e0903..d49077af4f91 100644
--- a/oox/source/xls/pivotcachefragment.cxx
+++ b/oox/source/xls/pivotcachefragment.cxx
@@ -26,29 +26,31 @@
************************************************************************/
#include "oox/xls/pivotcachefragment.hxx"
+
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pivotcachebuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxPivotCacheFieldContext::OoxPivotCacheFieldContext( OoxWorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
- OoxWorkbookContextBase( rFragment ),
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotCacheFieldContext::PivotCacheFieldContext( WorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
+ WorkbookContextBase( rFragment ),
mrCacheField( rCacheField )
{
}
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -73,41 +75,41 @@ ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement
return 0;
}
-void OoxPivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrCacheField.importCacheField( rAttribs );
}
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PCDFIELD:
+ case BIFF12_ID_PCDFIELD:
switch( nRecId )
{
- case OOBIN_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItems( rStrm ); return this;
- case OOBIN_ID_PCDFIELDGROUP: mrCacheField.importPCDFieldGroup( rStrm ); return this;
+ case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItems( rStrm ); return this;
+ case BIFF12_ID_PCDFIELDGROUP: mrCacheField.importPCDFieldGroup( rStrm ); return this;
}
break;
- case OOBIN_ID_PCDFIELDGROUP:
+ case BIFF12_ID_PCDFIELDGROUP:
switch( nRecId )
{
- case OOBIN_ID_PCDFRANGEPR: mrCacheField.importPCDFRangePr( rStrm ); break;
- case OOBIN_ID_PCDFDISCRETEPR: return this;
- case OOBIN_ID_PCDFGROUPITEMS: return this;
+ case BIFF12_ID_PCDFRANGEPR: mrCacheField.importPCDFRangePr( rStrm ); break;
+ case BIFF12_ID_PCDFDISCRETEPR: return this;
+ case BIFF12_ID_PCDFGROUPITEMS: return this;
}
break;
- case OOBIN_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItem( nRecId, rStrm ); break;
- case OOBIN_ID_PCDFDISCRETEPR: mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
- case OOBIN_ID_PCDFGROUPITEMS: mrCacheField.importPCDFGroupItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFDISCRETEPR: mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFGROUPITEMS: mrCacheField.importPCDFGroupItem( nRecId, rStrm ); break;
}
return 0;
}
-void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotCacheFieldContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrCacheField.importPCDField( rStrm );
@@ -115,14 +117,14 @@ void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotCacheDefinitionFragment::OoxPivotCacheDefinitionFragment(
+PivotCacheDefinitionFragment::PivotCacheDefinitionFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath, PivotCache& rPivotCache ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+ WorkbookFragmentBase( rHelper, rFragmentPath ),
mrPivotCache( rPivotCache )
{
}
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -143,60 +145,60 @@ ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nE
break;
case XLS_TOKEN( cacheFields ):
- if( nElement == XLS_TOKEN( cacheField ) ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+ if( nElement == XLS_TOKEN( cacheField ) ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
break;
}
return 0;
}
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
+ if( nRecId == BIFF12_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
break;
- case OOBIN_ID_PCDEFINITION:
+ case BIFF12_ID_PCDEFINITION:
switch( nRecId )
{
- case OOBIN_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
- case OOBIN_ID_PCDFIELDS: return this;
+ case BIFF12_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
+ case BIFF12_ID_PCDFIELDS: return this;
}
break;
- case OOBIN_ID_PCDSOURCE:
- if( nRecId == OOBIN_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
+ case BIFF12_ID_PCDSOURCE:
+ if( nRecId == BIFF12_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
break;
- case OOBIN_ID_PCDFIELDS:
- if( nRecId == OOBIN_ID_PCDFIELD ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+ case BIFF12_ID_PCDFIELDS:
+ if( nRecId == BIFF12_ID_PCDFIELD ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
break;
}
return 0;
}
-const RecordInfo* OoxPivotCacheDefinitionFragment::getRecordInfos() const
+const RecordInfo* PivotCacheDefinitionFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_PCDEFINITION, OOBIN_ID_PCDEFINITION + 1 },
- { OOBIN_ID_PCDFDISCRETEPR, OOBIN_ID_PCDFDISCRETEPR + 1 },
- { OOBIN_ID_PCDFGROUPITEMS, OOBIN_ID_PCDFGROUPITEMS + 1 },
- { OOBIN_ID_PCDFIELD, OOBIN_ID_PCDFIELD + 1 },
- { OOBIN_ID_PCDFIELDGROUP, OOBIN_ID_PCDFIELDGROUP + 1 },
- { OOBIN_ID_PCDFIELDS, OOBIN_ID_PCDFIELDS + 1 },
- { OOBIN_ID_PCDFRANGEPR, OOBIN_ID_PCDFRANGEPR + 1 },
- { OOBIN_ID_PCDFSHAREDITEMS, OOBIN_ID_PCDFSHAREDITEMS + 1 },
- { OOBIN_ID_PCITEM_ARRAY, OOBIN_ID_PCITEM_ARRAY + 1 },
- { OOBIN_ID_PCDSHEETSOURCE, OOBIN_ID_PCDSHEETSOURCE + 1 },
- { OOBIN_ID_PCDSOURCE, OOBIN_ID_PCDSOURCE + 1 },
- { -1, -1 }
+ { BIFF12_ID_PCDEFINITION, BIFF12_ID_PCDEFINITION + 1 },
+ { BIFF12_ID_PCDFDISCRETEPR, BIFF12_ID_PCDFDISCRETEPR + 1 },
+ { BIFF12_ID_PCDFGROUPITEMS, BIFF12_ID_PCDFGROUPITEMS + 1 },
+ { BIFF12_ID_PCDFIELD, BIFF12_ID_PCDFIELD + 1 },
+ { BIFF12_ID_PCDFIELDGROUP, BIFF12_ID_PCDFIELDGROUP + 1 },
+ { BIFF12_ID_PCDFIELDS, BIFF12_ID_PCDFIELDS + 1 },
+ { BIFF12_ID_PCDFRANGEPR, BIFF12_ID_PCDFRANGEPR + 1 },
+ { BIFF12_ID_PCDFSHAREDITEMS, BIFF12_ID_PCDFSHAREDITEMS + 1 },
+ { BIFF12_ID_PCITEM_ARRAY, BIFF12_ID_PCITEM_ARRAY + 1 },
+ { BIFF12_ID_PCDSHEETSOURCE, BIFF12_ID_PCDSHEETSOURCE + 1 },
+ { BIFF12_ID_PCDSOURCE, BIFF12_ID_PCDSOURCE + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
-void OoxPivotCacheDefinitionFragment::finalizeImport()
+void PivotCacheDefinitionFragment::finalizeImport()
{
// finalize the cache (check source range etc.)
mrPivotCache.finalizeImport();
@@ -206,15 +208,15 @@ void OoxPivotCacheDefinitionFragment::finalizeImport()
{
OUString aRecFragmentPath = getRelations().getFragmentPathFromRelId( mrPivotCache.getRecordsRelId() );
if( aRecFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxPivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
+ importOoxFragment( new PivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
}
}
// ============================================================================
-OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper& rHelper,
+PivotCacheRecordsFragment::PivotCacheRecordsFragment( const WorkbookHelper& rHelper,
const OUString& rFragmentPath, const PivotCache& rPivotCache ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
+ WorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
mrPivotCache( rPivotCache ),
mnCol( 0 ),
mnRow( 0 ),
@@ -224,7 +226,7 @@ OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper
rPivotCache.writeSourceHeaderCells( *this );
}
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -248,7 +250,7 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
case XLS_TOKEN( b ): aItem.readBool( rAttribs ); break;
case XLS_TOKEN( e ): aItem.readError( rAttribs, getUnitConverter() ); break;
case XLS_TOKEN( x ): aItem.readIndex( rAttribs ); break;
- default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" );
+ default: OSL_ENSURE( false, "PivotCacheRecordsFragment::onCreateContext - unexpected element" );
}
mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
++mnCol;
@@ -258,19 +260,19 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
return 0;
}
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PCRECORDS ) return this;
+ if( nRecId == BIFF12_ID_PCRECORDS ) return this;
break;
- case OOBIN_ID_PCRECORDS:
+ case BIFF12_ID_PCRECORDS:
switch( nRecId )
{
- case OOBIN_ID_PCRECORD: importPCRecord( rStrm ); break;
- case OOBIN_ID_PCRECORDDT: startCacheRecord(); break;
+ case BIFF12_ID_PCRECORD: importPCRecord( rStrm ); break;
+ case BIFF12_ID_PCRECORDDT: startCacheRecord(); break;
default: importPCRecordItem( nRecId, rStrm ); break;
}
break;
@@ -278,11 +280,11 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32
return 0;
}
-const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
+const RecordInfo* PivotCacheRecordsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_PCRECORDS, OOBIN_ID_PCRECORDS + 1 },
+ { BIFF12_ID_PCRECORDS, BIFF12_ID_PCRECORDS + 1 },
{ -1, -1 }
};
return spRecInfos;
@@ -290,35 +292,35 @@ const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
// private --------------------------------------------------------------------
-void OoxPivotCacheRecordsFragment::startCacheRecord()
+void PivotCacheRecordsFragment::startCacheRecord()
{
mnCol = 0;
++mnRow;
mbInRecord = true;
}
-void OoxPivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecord( SequenceInputStream& rStrm )
{
startCacheRecord();
mrPivotCache.importPCRecord( rStrm, *this, mnRow );
mbInRecord = false;
}
-void OoxPivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
if( mbInRecord )
{
PivotCacheItem aItem;
switch( nRecId )
{
- case OOBIN_ID_PCITEM_MISSING: break;
- case OOBIN_ID_PCITEM_STRING: aItem.readString( rStrm ); break;
- case OOBIN_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
- case OOBIN_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
- case OOBIN_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
- case OOBIN_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
- case OOBIN_ID_PCITEM_INDEX: aItem.readIndex( rStrm ); break;
- default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
+ case BIFF12_ID_PCITEM_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING: aItem.readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
+ case BIFF12_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
+ case BIFF12_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
+ case BIFF12_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
+ case BIFF12_ID_PCITEM_INDEX: aItem.readIndex( rStrm ); break;
+ default: OSL_ENSURE( false, "PivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
}
mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
++mnCol;
@@ -345,7 +347,7 @@ bool lclSeekToPCDField( BiffInputStream& rStrm )
// ----------------------------------------------------------------------------
BiffPivotCacheFragment::BiffPivotCacheFragment(
- const WorkbookHelper& rHelper, const ::rtl::OUString& rStrmName, PivotCache& rPivotCache ) :
+ const WorkbookHelper& rHelper, const OUString& rStrmName, PivotCache& rPivotCache ) :
BiffWorkbookFragmentBase( rHelper, rStrmName, true ),
mrPivotCache( rPivotCache )
{
@@ -353,14 +355,15 @@ BiffPivotCacheFragment::BiffPivotCacheFragment(
bool BiffPivotCacheFragment::importFragment()
{
- if( mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_PCDEFINITION) )
+ BiffInputStream& rStrm = getInputStream();
+ if( rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_PCDEFINITION) )
{
// read PCDEFINITION and optional PCDEFINITION2 records
- mrPivotCache.importPCDefinition( mrStrm );
+ mrPivotCache.importPCDefinition( rStrm );
// read cache fields as long as another PCDFIELD record can be found
- while( lclSeekToPCDField( mrStrm ) )
- mrPivotCache.createCacheField( true ).importPCDField( mrStrm );
+ while( lclSeekToPCDField( rStrm ) )
+ mrPivotCache.createCacheField( true ).importPCDField( rStrm );
// finalize the cache (check source range etc.)
mrPivotCache.finalizeImport();
@@ -372,19 +375,18 @@ bool BiffPivotCacheFragment::importFragment()
unchanged. Stream should point to source data table now. */
BiffPivotCacheRecordsContext aContext( *this, mrPivotCache );
if( aContext.isValidSheet() )
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- aContext.importRecord();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+ aContext.importRecord( rStrm );
}
}
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// ============================================================================
-BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext(
- const BiffWorkbookFragmentBase& rFragment, const PivotCache& rPivotCache ) :
- BiffWorksheetContextBase( rFragment, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
+BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext( const WorkbookHelper& rHelper, const PivotCache& rPivotCache ) :
+ BiffWorksheetContextBase( rHelper, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
mrPivotCache( rPivotCache ),
mnColIdx( 0 ),
mnRow( 0 ),
@@ -409,28 +411,28 @@ BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext(
}
}
-void BiffPivotCacheRecordsContext::importRecord()
+void BiffPivotCacheRecordsContext::importRecord( BiffInputStream& rStrm )
{
- if( mrStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
+ if( rStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
{
OSL_ENSURE( mbHasShared, "BiffPivotCacheRecordsContext::importRecord - unexpected PCITEM_INDEXLIST record" );
// PCITEM_INDEXLIST record always in front of a new data row
startNextRow();
- mrPivotCache.importPCItemIndexList( mrStrm, *this, mnRow );
+ mrPivotCache.importPCItemIndexList( rStrm, *this, mnRow );
mbInRow = !maUnsharedCols.empty(); // mbInRow remains true, if unshared items are expected
return;
}
PivotCacheItem aItem;
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
case BIFF_ID_PCITEM_MISSING: break;
- case BIFF_ID_PCITEM_STRING: aItem.readString( mrStrm, *this ); break;
- case BIFF_ID_PCITEM_DOUBLE: aItem.readDouble( mrStrm ); break;
- case BIFF_ID_PCITEM_INTEGER: aItem.readInteger( mrStrm ); break;
- case BIFF_ID_PCITEM_DATE: aItem.readDate( mrStrm ); break;
- case BIFF_ID_PCITEM_BOOL: aItem.readBool( mrStrm ); break;
- case BIFF_ID_PCITEM_ERROR: aItem.readError( mrStrm ); break;
+ case BIFF_ID_PCITEM_STRING: aItem.readString( rStrm, *this ); break;
+ case BIFF_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
+ case BIFF_ID_PCITEM_INTEGER: aItem.readInteger( rStrm ); break;
+ case BIFF_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
+ case BIFF_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
+ case BIFF_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
default: return; // unknown record, ignore
}
@@ -462,4 +464,3 @@ void BiffPivotCacheRecordsContext::startNextRow()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx
index b4e3e1c52a65..7cdeddaa879b 100644
--- a/oox/source/xls/pivottablebuffer.cxx
+++ b/oox/source/xls/pivottablebuffer.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/xls/pivottablebuffer.hxx"
+
#include <set>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -45,37 +46,26 @@
#include <com/sun/star/sheet/XDataPilotField.hpp>
#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
#include <com/sun/star/sheet/XSheetOperation.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldOrientation;
-using ::com::sun::star::sheet::XDataPilotDataLayoutFieldSupplier;
-using ::com::sun::star::sheet::XDataPilotDescriptor;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotTables;
-using ::com::sun::star::sheet::XDataPilotTablesSupplier;
-using ::com::sun::star::sheet::XSheetOperation;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_Int32 OOX_PT_DATALAYOUTFIELD = -2; /// Placeholder index of data layout field.
@@ -85,83 +75,90 @@ const sal_Int32 OOX_PT_NEXT_ITEM = 0x001000FD; /// Calculat
// ----------------------------------------------------------------------------
-const sal_uInt32 OOBIN_PTFIELD_DATAFIELD = 0x00000008;
-const sal_uInt32 OOBIN_PTFIELD_DEFAULT = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_SUM = 0x00000200;
-const sal_uInt32 OOBIN_PTFIELD_COUNTA = 0x00000400;
-const sal_uInt32 OOBIN_PTFIELD_AVERAGE = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_MAX = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_MIN = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_PRODUCT = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_COUNT = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEV = 0x00010000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEVP = 0x00020000;
-const sal_uInt32 OOBIN_PTFIELD_VAR = 0x00040000;
-const sal_uInt32 OOBIN_PTFIELD_VARP = 0x00080000;
-
-const sal_uInt32 OOBIN_PTFIELD_SHOWALL = 0x00000020;
-const sal_uInt32 OOBIN_PTFIELD_OUTLINE = 0x00000040;
-const sal_uInt32 OOBIN_PTFIELD_INSERTBLANKROW = 0x00000080;
-const sal_uInt32 OOBIN_PTFIELD_SUBTOTALTOP = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_INSERTPAGEBREAK = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSORT = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_SORTASCENDING = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOW = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOWTOP = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_MULTIPAGEITEMS = 0x00080000;
-
-const sal_uInt16 OOBIN_PTFITEM_HIDDEN = 0x0001;
-const sal_uInt16 OOBIN_PTFITEM_HIDEDETAILS = 0x0002;
-
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASNAME = 0x01;
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASOLAPCAPTION = 0x02;
-const sal_Int32 OOBIN_PTPAGEFIELD_MULTIITEMS = 0x001000FE;
-
-const sal_uInt16 OOBIN_PTFILTER_HASNAME = 0x0001;
-const sal_uInt16 OOBIN_PTFILTER_HASDESCRIPTION = 0x0002;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE1 = 0x0004;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE2 = 0x0008;
-
-const sal_uInt8 OOBIN_TOP10FILTER_TOP = 0x01;
-const sal_uInt8 OOBIN_TOP10FILTER_PERCENT = 0x02;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWITEMS = 0x00000100;
-const sal_uInt32 OOBIN_PTDEF_DISABLEFIELDLIST = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HIDECALCMEMBERS = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_WITHHIDDENTOTALS = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_HIDEDRILL = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_PRINTDRILL = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HIDEHEADERS = 0x80000000;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYROW = 0x00000004;
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYCOL = 0x00000008;
-const sal_uInt32 OOBIN_PTDEF_ENABLEDRILL = 0x00000020;
-const sal_uInt32 OOBIN_PTDEF_PRESERVEFORMATTING = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_SHOWERROR = 0x00000200;
-const sal_uInt32 OOBIN_PTDEF_SHOWMISSING = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_PAGEOVERTHENDOWN = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_SUBTOTALHIDDENITEMS = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_ROWGRANDTOTALS = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_COLGRANDTOTALS = 0x00004000;
-const sal_uInt32 OOBIN_PTDEF_FIELDPRINTTITLES = 0x00008000;
-const sal_uInt32 OOBIN_PTDEF_ITEMPRINTTITLES = 0x00020000;
-const sal_uInt32 OOBIN_PTDEF_MERGEITEM = 0x00040000;
-const sal_uInt32 OOBIN_PTDEF_HASDATACAPTION = 0x00080000;
-const sal_uInt32 OOBIN_PTDEF_HASGRANDTOTALCAPTION = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_HASPAGESTYLE = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HASPIVOTTABLESTYLE = 0x00400000;
-const sal_uInt32 OOBIN_PTDEF_HASVACATEDSTYLE = 0x00800000;
-const sal_uInt32 OOBIN_PTDEF_HASTAG = 0x40000000;
-
-const sal_uInt32 OOBIN_PTDEF_NOERRORCAPTION = 0x00000040;
-const sal_uInt32 OOBIN_PTDEF_NOMISSINGCAPTION = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_HASROWHEADERCAPTION = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HASCOLHEADERCAPTION = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_FIELDLISTSORTASC = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_NOCUSTOMLISTSORT = 0x00004000;
-
-const sal_uInt8 OOBIN_PTDEF_ROWAXIS = 1;
-const sal_uInt8 OOBIN_PTDEF_COLAXIS = 2;
+const sal_uInt32 BIFF12_PTFIELD_DATAFIELD = 0x00000008;
+const sal_uInt32 BIFF12_PTFIELD_DEFAULT = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_SUM = 0x00000200;
+const sal_uInt32 BIFF12_PTFIELD_COUNTA = 0x00000400;
+const sal_uInt32 BIFF12_PTFIELD_AVERAGE = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_MAX = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_MIN = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_PRODUCT = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_COUNT = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEV = 0x00010000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEVP = 0x00020000;
+const sal_uInt32 BIFF12_PTFIELD_VAR = 0x00040000;
+const sal_uInt32 BIFF12_PTFIELD_VARP = 0x00080000;
+
+const sal_uInt32 BIFF12_PTFIELD_SHOWALL = 0x00000020;
+const sal_uInt32 BIFF12_PTFIELD_OUTLINE = 0x00000040;
+const sal_uInt32 BIFF12_PTFIELD_INSERTBLANKROW = 0x00000080;
+const sal_uInt32 BIFF12_PTFIELD_SUBTOTALTOP = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_INSERTPAGEBREAK = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSORT = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_SORTASCENDING = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOW = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOWTOP = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_MULTIPAGEITEMS = 0x00080000;
+
+const sal_uInt16 BIFF12_PTFITEM_HIDDEN = 0x0001;
+const sal_uInt16 BIFF12_PTFITEM_HIDEDETAILS = 0x0002;
+
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASNAME = 0x01;
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASOLAPCAPTION = 0x02;
+const sal_Int32 BIFF12_PTPAGEFIELD_MULTIITEMS = 0x001000FE;
+
+const sal_uInt16 BIFF12_PTFILTER_HASNAME = 0x0001;
+const sal_uInt16 BIFF12_PTFILTER_HASDESCRIPTION = 0x0002;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE1 = 0x0004;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE2 = 0x0008;
+
+const sal_uInt8 BIFF12_TOP10FILTER_TOP = 0x01;
+const sal_uInt8 BIFF12_TOP10FILTER_PERCENT = 0x02;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWITEMS = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_DISABLEFIELDLIST = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HIDECALCMEMBERS = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_WITHHIDDENTOTALS = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_HIDEDRILL = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_PRINTDRILL = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HIDEHEADERS = 0x80000000;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYROW = 0x00000004;
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYCOL = 0x00000008;
+const sal_uInt32 BIFF12_PTDEF_ENABLEDRILL = 0x00000020;
+const sal_uInt32 BIFF12_PTDEF_PRESERVEFORMATTING = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_USEAUTOFORMAT = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_SHOWERROR = 0x00000200;
+const sal_uInt32 BIFF12_PTDEF_SHOWMISSING = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_PAGEOVERTHENDOWN = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_SUBTOTALHIDDENITEMS = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_ROWGRANDTOTALS = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_COLGRANDTOTALS = 0x00004000;
+const sal_uInt32 BIFF12_PTDEF_FIELDPRINTTITLES = 0x00008000;
+const sal_uInt32 BIFF12_PTDEF_ITEMPRINTTITLES = 0x00020000;
+const sal_uInt32 BIFF12_PTDEF_MERGEITEM = 0x00040000;
+const sal_uInt32 BIFF12_PTDEF_HASDATACAPTION = 0x00080000;
+const sal_uInt32 BIFF12_PTDEF_HASGRANDTOTALCAPTION = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_HASPAGESTYLE = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HASPIVOTTABLESTYLE = 0x00400000;
+const sal_uInt32 BIFF12_PTDEF_HASVACATEDSTYLE = 0x00800000;
+const sal_uInt32 BIFF12_PTDEF_APPLYNUMFMT = 0x01000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFONT = 0x02000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYALIGNMENT = 0x04000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYBORDER = 0x08000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFILL = 0x10000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYPROTECTION = 0x20000000;
+const sal_uInt32 BIFF12_PTDEF_HASTAG = 0x40000000;
+
+const sal_uInt32 BIFF12_PTDEF_NOERRORCAPTION = 0x00000040;
+const sal_uInt32 BIFF12_PTDEF_NOMISSINGCAPTION = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_HASROWHEADERCAPTION = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HASCOLHEADERCAPTION = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_FIELDLISTSORTASC = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_NOCUSTOMLISTSORT = 0x00004000;
+
+const sal_uInt8 BIFF12_PTDEF_ROWAXIS = 1;
+const sal_uInt8 BIFF12_PTDEF_COLAXIS = 2;
// ----------------------------------------------------------------------------
@@ -233,7 +230,7 @@ PTFieldItemModel::PTFieldItemModel() :
{
}
-void PTFieldItemModel::setBinType( sal_uInt16 nType )
+void PTFieldItemModel::setBiffType( sal_uInt16 nType )
{
static const sal_Int32 spnTypes[] = { XML_data, XML_default,
XML_sum, XML_countA, XML_avg, XML_max, XML_min, XML_product, XML_count,
@@ -275,7 +272,7 @@ PTFieldModel::PTFieldModel() :
{
}
-void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
+void PTFieldModel::setBiffAxis( sal_uInt8 nAxis )
{
/* Weird. The axis field is organized as bit field, but only one of the
row/col/page flags are allowed at the same time and refer to the values
@@ -293,7 +290,7 @@ void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
PTPageFieldModel::PTPageFieldModel() :
mnField( -1 ),
- mnItem( OOBIN_PTPAGEFIELD_MULTIITEMS )
+ mnItem( BIFF12_PTPAGEFIELD_MULTIITEMS )
{
}
@@ -309,13 +306,13 @@ PTDataFieldModel::PTDataFieldModel() :
{
}
-void PTDataFieldModel::setBinSubtotal( sal_Int32 nSubtotal )
+void PTDataFieldModel::setBiffSubtotal( sal_Int32 nSubtotal )
{
static sal_Int32 spnSubtotals[] = { XML_sum, XML_count, XML_average, XML_max, XML_min, XML_product, XML_countNums, XML_stdDev, XML_stdDevp, XML_var, XML_varp };
mnSubtotal = STATIC_ARRAY_SELECT( spnSubtotals, nSubtotal, XML_TOKEN_INVALID );
}
-void PTDataFieldModel::setBinShowDataAs( sal_Int32 nShowDataAs )
+void PTDataFieldModel::setBiffShowDataAs( sal_Int32 nShowDataAs )
{
static sal_Int32 spnShowDataAs[] = { XML_normal, XML_difference, XML_percent, XML_percentDiff, XML_runTotal, XML_percentOfRow, XML_percentOfCol, XML_percentOfTotal, XML_index };
mnShowDataAs = STATIC_ARRAY_SELECT( spnShowDataAs, nShowDataAs, XML_TOKEN_INVALID );
@@ -386,60 +383,60 @@ void PivotTableField::importReferenceItem( const AttributeList& rAttribs )
maModel.mnSortRefItem = rAttribs.getInteger( XML_v, -1 );
}
-void PivotTableField::importPTField( RecordInputStream& rStrm )
+void PivotTableField::importPTField( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags1, nFlags2;
rStrm >> nFlags1 >> maModel.mnNumFmtId >> nFlags2 >> maModel.mnAutoShowItems >> maModel.mnAutoShowRankBy;
- maModel.setBinAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
- maModel.mbDataField = getFlag( nFlags1, OOBIN_PTFIELD_DATAFIELD );
- maModel.mbDefaultSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_DEFAULT );
- maModel.mbSumSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_SUM );
- maModel.mbCountASubtotal = getFlag( nFlags1, OOBIN_PTFIELD_COUNTA );
- maModel.mbAverageSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_AVERAGE );
- maModel.mbMaxSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_MAX );
- maModel.mbMinSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_MIN );
- maModel.mbProductSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_PRODUCT );
- maModel.mbCountSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_COUNT );
- maModel.mbStdDevSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_STDDEV );
- maModel.mbStdDevPSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_STDDEVP );
- maModel.mbVarSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_VAR );
- maModel.mbVarPSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_VARP );
-
- maModel.mbShowAll = getFlag( nFlags2, OOBIN_PTFIELD_SHOWALL );
- maModel.mbOutline = getFlag( nFlags2, OOBIN_PTFIELD_OUTLINE );
- maModel.mbSubtotalTop = getFlag( nFlags2, OOBIN_PTFIELD_SUBTOTALTOP );
- maModel.mbInsertBlankRow = getFlag( nFlags2, OOBIN_PTFIELD_INSERTBLANKROW );
- maModel.mbInsertPageBreak = getFlag( nFlags2, OOBIN_PTFIELD_INSERTPAGEBREAK );
- maModel.mbAutoShow = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOW );
- maModel.mbTopAutoShow = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOWTOP );
- maModel.mbMultiPageItems = getFlag( nFlags2, OOBIN_PTFIELD_MULTIPAGEITEMS );
-
- bool bAutoSort = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSORT );
- bool bAscending = getFlag( nFlags2, OOBIN_PTFIELD_SORTASCENDING );
+ maModel.setBiffAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
+ maModel.mbDataField = getFlag( nFlags1, BIFF12_PTFIELD_DATAFIELD );
+ maModel.mbDefaultSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_DEFAULT );
+ maModel.mbSumSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_SUM );
+ maModel.mbCountASubtotal = getFlag( nFlags1, BIFF12_PTFIELD_COUNTA );
+ maModel.mbAverageSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_AVERAGE );
+ maModel.mbMaxSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_MAX );
+ maModel.mbMinSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_MIN );
+ maModel.mbProductSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_PRODUCT );
+ maModel.mbCountSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_COUNT );
+ maModel.mbStdDevSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_STDDEV );
+ maModel.mbStdDevPSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_STDDEVP );
+ maModel.mbVarSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_VAR );
+ maModel.mbVarPSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_VARP );
+
+ maModel.mbShowAll = getFlag( nFlags2, BIFF12_PTFIELD_SHOWALL );
+ maModel.mbOutline = getFlag( nFlags2, BIFF12_PTFIELD_OUTLINE );
+ maModel.mbSubtotalTop = getFlag( nFlags2, BIFF12_PTFIELD_SUBTOTALTOP );
+ maModel.mbInsertBlankRow = getFlag( nFlags2, BIFF12_PTFIELD_INSERTBLANKROW );
+ maModel.mbInsertPageBreak = getFlag( nFlags2, BIFF12_PTFIELD_INSERTPAGEBREAK );
+ maModel.mbAutoShow = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOW );
+ maModel.mbTopAutoShow = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOWTOP );
+ maModel.mbMultiPageItems = getFlag( nFlags2, BIFF12_PTFIELD_MULTIPAGEITEMS );
+
+ bool bAutoSort = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSORT );
+ bool bAscending = getFlag( nFlags2, BIFF12_PTFIELD_SORTASCENDING );
maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual;
}
-void PivotTableField::importPTFItem( RecordInputStream& rStrm )
+void PivotTableField::importPTFItem( SequenceInputStream& rStrm )
{
PTFieldItemModel aModel;
sal_uInt8 nType;
sal_uInt16 nFlags;
rStrm >> nType >> nFlags >> aModel.mnCacheItem;
- aModel.setBinType( nType );
- aModel.mbShowDetails = !getFlag( nFlags, OOBIN_PTFITEM_HIDEDETAILS );
- aModel.mbHidden = getFlag( nFlags, OOBIN_PTFITEM_HIDDEN );
+ aModel.setBiffType( nType );
+ aModel.mbShowDetails = !getFlag( nFlags, BIFF12_PTFITEM_HIDEDETAILS );
+ aModel.mbHidden = getFlag( nFlags, BIFF12_PTFITEM_HIDDEN );
maItems.push_back( aModel );
}
-void PivotTableField::importPTReference( RecordInputStream& rStrm )
+void PivotTableField::importPTReference( SequenceInputStream& rStrm )
{
rStrm >> maModel.mnSortRefField;
}
-void PivotTableField::importPTReferenceItem( RecordInputStream& rStrm )
+void PivotTableField::importPTReferenceItem( SequenceInputStream& rStrm )
{
rStrm >> maModel.mnSortRefItem;
}
@@ -450,7 +447,7 @@ void PivotTableField::importPTField( BiffInputStream& rStrm )
rStrm >> nAxis >> nSubtCount >> nSubtotals;
rStrm.skip( 2 ); // item count
- maModel.setBinAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
+ maModel.setBiffAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
maModel.mbDataField = getFlag( nAxis, BIFF_PTFIELD_DATAFIELD );
maModel.mbDefaultSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_DEFAULT );
@@ -509,7 +506,7 @@ void PivotTableField::importPTFItem( BiffInputStream& rStrm )
sal_Int16 nCacheItem;
rStrm >> nType >> nFlags >> nCacheItem;
- aModel.setBinType( nType );
+ aModel.setBiffType( nType );
aModel.mnCacheItem = nCacheItem;
aModel.mbShowDetails = !getFlag( nFlags, BIFF_PTFITEM_HIDEDETAILS );
aModel.mbHidden = getFlag( nFlags, BIFF_PTFITEM_HIDDEN );
@@ -627,7 +624,7 @@ void PivotTableField::convertPageField( const PTPageFieldModel& rPageField )
if( maModel.mbMultiPageItems )
{
// multiple items may be selected
- OSL_ENSURE( rPageField.mnItem == OOBIN_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
+ OSL_ENSURE( rPageField.mnItem == BIFF12_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
// try to find a single visible item
bool bHasMultiItems = false;
for( ItemModelVector::iterator aIt = maItems.begin(), aEnd = maItems.end(); (aIt != aEnd) && !bHasMultiItems; ++aIt )
@@ -799,7 +796,7 @@ Reference< XDataPilotField > PivotTableField::convertRowColPageField( sal_Int32
aPropSet.setProperty( PROP_LayoutInfo, aLayoutInfo );
aPropSet.setProperty( PROP_ShowEmpty, maModel.mbShowAll );
- // auto show (OOXML3/OOBIN3 only)
+ // auto show (OOXML/BIFF12 only)
if( maModel.mbAutoShow )
{
DataPilotFieldAutoShowInfo aAutoShowInfo;
@@ -909,20 +906,20 @@ void PivotTableFilter::importTop10( const AttributeList& rAttribs )
maModel.mbTopFilter = rAttribs.getBool( XML_top, true );
}
-void PivotTableFilter::importPTFilter( RecordInputStream& rStrm )
+void PivotTableFilter::importPTFilter( SequenceInputStream& rStrm )
{
sal_Int32 nType;
sal_uInt16 nFlags;
rStrm >> maModel.mnField >> maModel.mnMemPropField >> nType;
rStrm.skip( 4 ); // unused
rStrm >> maModel.mnId >> maModel.mnMeasureField >> maModel.mnMeasureHier >> nFlags;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASNAME ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASNAME ) )
rStrm >> maModel.maName;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASDESCRIPTION ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASDESCRIPTION ) )
rStrm >> maModel.maDescription;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE1 ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE1 ) )
rStrm >> maModel.maStrValue1;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE2 ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE2 ) )
rStrm >> maModel.maStrValue2;
static sal_Int32 spnTypes[] =
@@ -949,14 +946,14 @@ void PivotTableFilter::importPTFilter( RecordInputStream& rStrm )
maModel.mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID );
}
-void PivotTableFilter::importTop10Filter( RecordInputStream& rStrm )
+void PivotTableFilter::importTop10Filter( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags;
rStrm >> nFlags >> maModel.mfValue;
- OSL_ENSURE( getFlag( nFlags, OOBIN_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
+ OSL_ENSURE( getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
"PivotTableFilter::importTop10 - unexpected value of percent attribute" );
- maModel.mbTopFilter = getFlag( nFlags, OOBIN_TOP10FILTER_TOP );
+ maModel.mbTopFilter = getFlag( nFlags, BIFF12_TOP10FILTER_TOP );
}
void PivotTableFilter::finalizeImport()
@@ -1000,6 +997,7 @@ PTDefinitionModel::PTDefinitionModel() :
mbPrintDrill( false ),
mbEnableDrill( true ),
mbPreserveFormatting( true ),
+ mbUseAutoFormat( false ),
mbPageOverThenDown( false ),
mbSubtotalHiddenItems( false ),
mbRowGrandTotals( true ),
@@ -1053,6 +1051,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mnPageWrap = rAttribs.getInteger( XML_pageWrap, 0 );
maDefModel.mnIndent = rAttribs.getInteger( XML_indent, 1 );
maDefModel.mnChartFormat = rAttribs.getInteger( XML_chartFormat, 0 );
+ maDefModel.mnAutoFormatId = rAttribs.getInteger( XML_autoFormatId, 0 );
maDefModel.mbDataOnRows = rAttribs.getBool( XML_dataOnRows, false );
maDefModel.mbShowError = rAttribs.getBool( XML_showError, false );
maDefModel.mbShowMissing = rAttribs.getBool( XML_showMissing, true );
@@ -1064,6 +1063,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mbPrintDrill = rAttribs.getBool( XML_printDrill, false );
maDefModel.mbEnableDrill = rAttribs.getBool( XML_enableDrill, true );
maDefModel.mbPreserveFormatting = rAttribs.getBool( XML_preserveFormatting, true );
+ maDefModel.mbUseAutoFormat = rAttribs.getBool( XML_useAutoFormatting, false );
maDefModel.mbPageOverThenDown = rAttribs.getBool( XML_pageOverThenDown, false );
maDefModel.mbSubtotalHiddenItems = rAttribs.getBool( XML_subtotalHiddenItems, false );
maDefModel.mbRowGrandTotals = rAttribs.getBool( XML_rowGrandTotals, true );
@@ -1076,6 +1076,13 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mbShowHeaders = rAttribs.getBool( XML_showHeaders, true );
maDefModel.mbFieldListSortAsc = rAttribs.getBool( XML_fieldListSortAscending, false );
maDefModel.mbCustomListSort = rAttribs.getBool( XML_customListSort, true );
+ maDefModel.mbApplyNumFmt = rAttribs.getBool( XML_applyNumberFormats, false );
+ maDefModel.mbApplyFont = rAttribs.getBool( XML_applyFontFormats, false );
+ maDefModel.mbApplyAlignment = rAttribs.getBool( XML_applyAlignmentFormats, false );
+ maDefModel.mbApplyBorder = rAttribs.getBool( XML_applyBorderFormats, false );
+ maDefModel.mbApplyFill = rAttribs.getBool( XML_applyPatternFormats, false );
+ // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+ maDefModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false );
}
void PivotTable::importLocation( const AttributeList& rAttribs, sal_Int16 nSheet )
@@ -1104,7 +1111,7 @@ void PivotTable::importPageField( const AttributeList& rAttribs )
aModel.maName = rAttribs.getXString( XML_name, OUString() );
aModel.mnField = rAttribs.getInteger( XML_fld, -1 );
// specification is wrong, XML_item is not the cache item, but the field item
- aModel.mnItem = rAttribs.getInteger( XML_item, OOBIN_PTPAGEFIELD_MULTIITEMS );
+ aModel.mnItem = rAttribs.getInteger( XML_item, BIFF12_PTPAGEFIELD_MULTIITEMS );
maPageFields.push_back( aModel );
}
@@ -1121,7 +1128,7 @@ void PivotTable::importDataField( const AttributeList& rAttribs )
maDataFields.push_back( aModel );
}
-void PivotTable::importPTDefinition( RecordInputStream& rStrm )
+void PivotTable::importPTDefinition( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags1, nFlags2, nFlags3;
sal_uInt8 nDataAxis;
@@ -1129,59 +1136,67 @@ void PivotTable::importPTDefinition( RecordInputStream& rStrm )
maDefModel.mnPageWrap = rStrm.readuInt8();
rStrm.skip( 2 ); // refresh versions
rStrm >> maDefModel.mnDataPosition;
- rStrm.skip( 4 ); // 2 bytes autoformat id, 2 bytes unused
+ maDefModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm.skip( 2 ); // unused
rStrm >> maDefModel.mnChartFormat >> maDefModel.mnCacheId >> maDefModel.maName;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASDATACAPTION ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASDATACAPTION ) )
rStrm >> maDefModel.maDataCaption;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASGRANDTOTALCAPTION ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASGRANDTOTALCAPTION ) )
rStrm >> maDefModel.maGrandTotalCaption;
- if( !getFlag( nFlags3, OOBIN_PTDEF_NOERRORCAPTION ) ) // missing flag indicates existing string
+ if( !getFlag( nFlags3, BIFF12_PTDEF_NOERRORCAPTION ) ) // missing flag indicates existing string
rStrm >> maDefModel.maErrorCaption;
- if( !getFlag( nFlags3, OOBIN_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
+ if( !getFlag( nFlags3, BIFF12_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
rStrm >> maDefModel.maMissingCaption;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASPAGESTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASPAGESTYLE ) )
rStrm >> maDefModel.maPageStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASPIVOTTABLESTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASPIVOTTABLESTYLE ) )
rStrm >> maDefModel.maPivotTableStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASVACATEDSTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASVACATEDSTYLE ) )
rStrm >> maDefModel.maVacatedStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASTAG ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASTAG ) )
rStrm >> maDefModel.maTag;
- if( getFlag( nFlags3, OOBIN_PTDEF_HASCOLHEADERCAPTION ) ) // TODO: right order (col/row)? spec is unclear
+ if( getFlag( nFlags3, BIFF12_PTDEF_HASCOLHEADERCAPTION ) ) // TODO: right order (col/row)? spec is unclear
rStrm >> maDefModel.maColHeaderCaption;
- if( getFlag( nFlags3, OOBIN_PTDEF_HASROWHEADERCAPTION ) )
+ if( getFlag( nFlags3, BIFF12_PTDEF_HASROWHEADERCAPTION ) )
rStrm >> maDefModel.maRowHeaderCaption;
- OSL_ENSURE( (nDataAxis == OOBIN_PTDEF_ROWAXIS) || (nDataAxis == OOBIN_PTDEF_COLAXIS),
+ OSL_ENSURE( (nDataAxis == BIFF12_PTDEF_ROWAXIS) || (nDataAxis == BIFF12_PTDEF_COLAXIS),
"PivotTable::importPTDefinition - unexpected axis position for data field" );
maDefModel.mnIndent = extractValue< sal_uInt8 >( nFlags1, 24, 7 );
- maDefModel.mbDataOnRows = nDataAxis == OOBIN_PTDEF_ROWAXIS;
- maDefModel.mbShowError = getFlag( nFlags2, OOBIN_PTDEF_SHOWERROR );
- maDefModel.mbShowMissing = getFlag( nFlags2, OOBIN_PTDEF_SHOWMISSING );
- maDefModel.mbShowItems = getFlag( nFlags1, OOBIN_PTDEF_SHOWITEMS );
- maDefModel.mbDisableFieldList = getFlag( nFlags1, OOBIN_PTDEF_DISABLEFIELDLIST );
- maDefModel.mbShowCalcMembers = !getFlag( nFlags1, OOBIN_PTDEF_HIDECALCMEMBERS );
- maDefModel.mbVisualTotals = !getFlag( nFlags1, OOBIN_PTDEF_WITHHIDDENTOTALS );
- maDefModel.mbShowDrill = !getFlag( nFlags1, OOBIN_PTDEF_HIDEDRILL );
- maDefModel.mbPrintDrill = getFlag( nFlags1, OOBIN_PTDEF_PRINTDRILL );
- maDefModel.mbEnableDrill = getFlag( nFlags2, OOBIN_PTDEF_ENABLEDRILL );
- maDefModel.mbPreserveFormatting = getFlag( nFlags2, OOBIN_PTDEF_PRESERVEFORMATTING );
- maDefModel.mbPageOverThenDown = getFlag( nFlags2, OOBIN_PTDEF_PAGEOVERTHENDOWN );
- maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, OOBIN_PTDEF_SUBTOTALHIDDENITEMS );
- maDefModel.mbRowGrandTotals = getFlag( nFlags2, OOBIN_PTDEF_ROWGRANDTOTALS );
- maDefModel.mbColGrandTotals = getFlag( nFlags2, OOBIN_PTDEF_COLGRANDTOTALS );
- maDefModel.mbFieldPrintTitles = getFlag( nFlags2, OOBIN_PTDEF_FIELDPRINTTITLES );
- maDefModel.mbItemPrintTitles = getFlag( nFlags2, OOBIN_PTDEF_ITEMPRINTTITLES );
- maDefModel.mbMergeItem = getFlag( nFlags2, OOBIN_PTDEF_MERGEITEM );
- maDefModel.mbShowEmptyRow = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYROW );
- maDefModel.mbShowEmptyCol = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYCOL );
- maDefModel.mbShowHeaders = !getFlag( nFlags1, OOBIN_PTDEF_HIDEHEADERS );
- maDefModel.mbFieldListSortAsc = getFlag( nFlags3, OOBIN_PTDEF_FIELDLISTSORTASC );
- maDefModel.mbCustomListSort = !getFlag( nFlags3, OOBIN_PTDEF_NOCUSTOMLISTSORT );
-}
-
-void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet )
+ maDefModel.mbDataOnRows = nDataAxis == BIFF12_PTDEF_ROWAXIS;
+ maDefModel.mbShowError = getFlag( nFlags2, BIFF12_PTDEF_SHOWERROR );
+ maDefModel.mbShowMissing = getFlag( nFlags2, BIFF12_PTDEF_SHOWMISSING );
+ maDefModel.mbShowItems = getFlag( nFlags1, BIFF12_PTDEF_SHOWITEMS );
+ maDefModel.mbDisableFieldList = getFlag( nFlags1, BIFF12_PTDEF_DISABLEFIELDLIST );
+ maDefModel.mbShowCalcMembers = !getFlag( nFlags1, BIFF12_PTDEF_HIDECALCMEMBERS );
+ maDefModel.mbVisualTotals = !getFlag( nFlags1, BIFF12_PTDEF_WITHHIDDENTOTALS );
+ maDefModel.mbShowDrill = !getFlag( nFlags1, BIFF12_PTDEF_HIDEDRILL );
+ maDefModel.mbPrintDrill = getFlag( nFlags1, BIFF12_PTDEF_PRINTDRILL );
+ maDefModel.mbEnableDrill = getFlag( nFlags2, BIFF12_PTDEF_ENABLEDRILL );
+ maDefModel.mbPreserveFormatting = getFlag( nFlags2, BIFF12_PTDEF_PRESERVEFORMATTING );
+ maDefModel.mbUseAutoFormat = getFlag( nFlags2, BIFF12_PTDEF_USEAUTOFORMAT );
+ maDefModel.mbPageOverThenDown = getFlag( nFlags2, BIFF12_PTDEF_PAGEOVERTHENDOWN );
+ maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, BIFF12_PTDEF_SUBTOTALHIDDENITEMS );
+ maDefModel.mbRowGrandTotals = getFlag( nFlags2, BIFF12_PTDEF_ROWGRANDTOTALS );
+ maDefModel.mbColGrandTotals = getFlag( nFlags2, BIFF12_PTDEF_COLGRANDTOTALS );
+ maDefModel.mbFieldPrintTitles = getFlag( nFlags2, BIFF12_PTDEF_FIELDPRINTTITLES );
+ maDefModel.mbItemPrintTitles = getFlag( nFlags2, BIFF12_PTDEF_ITEMPRINTTITLES );
+ maDefModel.mbMergeItem = getFlag( nFlags2, BIFF12_PTDEF_MERGEITEM );
+ maDefModel.mbApplyNumFmt = getFlag( nFlags2, BIFF12_PTDEF_APPLYNUMFMT );
+ maDefModel.mbApplyFont = getFlag( nFlags2, BIFF12_PTDEF_APPLYFONT );
+ maDefModel.mbApplyAlignment = getFlag( nFlags2, BIFF12_PTDEF_APPLYALIGNMENT );
+ maDefModel.mbApplyBorder = getFlag( nFlags2, BIFF12_PTDEF_APPLYBORDER );
+ maDefModel.mbApplyFill = getFlag( nFlags2, BIFF12_PTDEF_APPLYFILL );
+ maDefModel.mbApplyProtection = getFlag( nFlags2, BIFF12_PTDEF_APPLYPROTECTION );
+ maDefModel.mbShowEmptyRow = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYROW );
+ maDefModel.mbShowEmptyCol = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYCOL );
+ maDefModel.mbShowHeaders = !getFlag( nFlags1, BIFF12_PTDEF_HIDEHEADERS );
+ maDefModel.mbFieldListSortAsc = getFlag( nFlags3, BIFF12_PTDEF_FIELDLISTSORTASC );
+ maDefModel.mbCustomListSort = !getFlag( nFlags3, BIFF12_PTDEF_NOCUSTOMLISTSORT );
+}
+
+void PivotTable::importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet )
{
BinRange aBinRange;
rStrm >> aBinRange >> maLocationModel.mnFirstHeaderRow
@@ -1190,29 +1205,29 @@ void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet )
getAddressConverter().convertToCellRangeUnchecked( maLocationModel.maRange, aBinRange, nSheet );
}
-void PivotTable::importPTRowFields( RecordInputStream& rStrm )
+void PivotTable::importPTRowFields( SequenceInputStream& rStrm )
{
importFields( maRowFields, rStrm );
}
-void PivotTable::importPTColFields( RecordInputStream& rStrm )
+void PivotTable::importPTColFields( SequenceInputStream& rStrm )
{
importFields( maColFields, rStrm );
}
-void PivotTable::importPTPageField( RecordInputStream& rStrm )
+void PivotTable::importPTPageField( SequenceInputStream& rStrm )
{
PTPageFieldModel aModel;
sal_uInt8 nFlags;
rStrm >> aModel.mnField >> aModel.mnItem;
rStrm.skip( 4 ); // hierarchy
rStrm >> nFlags;
- if( getFlag( nFlags, OOBIN_PTPAGEFIELD_HASNAME ) )
+ if( getFlag( nFlags, BIFF12_PTPAGEFIELD_HASNAME ) )
rStrm >> aModel.maName;
maPageFields.push_back( aModel );
}
-void PivotTable::importPTDataField( RecordInputStream& rStrm )
+void PivotTable::importPTDataField( SequenceInputStream& rStrm )
{
PTDataFieldModel aModel;
sal_Int32 nSubtotal, nShowDataAs;
@@ -1220,8 +1235,8 @@ void PivotTable::importPTDataField( RecordInputStream& rStrm )
rStrm >> aModel.mnField >> nSubtotal >> nShowDataAs >> aModel.mnBaseField >> aModel.mnBaseItem >> aModel.mnNumFmtId >> nHasName;
if( nHasName == 1 )
rStrm >> aModel.maName;
- aModel.setBinSubtotal( nSubtotal );
- aModel.setBinShowDataAs( nShowDataAs );
+ aModel.setBiffSubtotal( nSubtotal );
+ aModel.setBiffShowDataAs( nShowDataAs );
maDataFields.push_back( aModel );
}
@@ -1297,7 +1312,7 @@ void PivotTable::importPTPageFields( BiffInputStream& rStrm )
rStrm >> nField >> nItem;
rStrm.skip( 2 ); // dropdown object ID
aModel.mnField = nField;
- aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? OOBIN_PTPAGEFIELD_MULTIITEMS : nItem;
+ aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? BIFF12_PTPAGEFIELD_MULTIITEMS : nItem;
maPageFields.push_back( aModel );
}
}
@@ -1311,8 +1326,8 @@ void PivotTable::importPTDataField( BiffInputStream& rStrm )
aModel.maName = lclReadPivotString( *this, rStrm, nNameLen );
aModel.mnField = nField;
- aModel.setBinSubtotal( nSubtotal );
- aModel.setBinShowDataAs( nShowDataAs );
+ aModel.setBiffSubtotal( nSubtotal );
+ aModel.setBiffShowDataAs( nShowDataAs );
aModel.mnBaseField = nBaseField;
switch( nBaseItem )
{
@@ -1506,7 +1521,7 @@ void PivotTable::importField( IndexVector& orFields, const AttributeList& rAttri
orFields.push_back( rAttribs.getInteger( XML_x, -1 ) );
}
-void PivotTable::importFields( IndexVector& orFields, RecordInputStream& rStrm )
+void PivotTable::importFields( IndexVector& orFields, SequenceInputStream& rStrm )
{
OSL_ENSURE( orFields.empty(), "PivotTable::importFields - multiple record instances" );
orFields.clear();
@@ -1550,4 +1565,3 @@ void PivotTableBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx
index 9b34e1bda593..6e28118711c9 100644
--- a/oox/source/xls/pivottablefragment.cxx
+++ b/oox/source/xls/pivottablefragment.cxx
@@ -26,25 +26,28 @@
************************************************************************/
#include "oox/xls/pivottablefragment.hxx"
+
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pivottablebuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxPivotTableFieldContext::OoxPivotTableFieldContext( OoxWorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
- OoxWorksheetContextBase( rFragment ),
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotTableFieldContext::PivotTableFieldContext( WorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
+ WorksheetContextBase( rFragment ),
mrTableField( rTableField )
{
}
-ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -74,43 +77,43 @@ ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement
return 0;
}
-void OoxPivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrTableField.importPivotField( rAttribs );
}
-ContextHandlerRef OoxPivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PTFIELD:
+ case BIFF12_ID_PTFIELD:
switch( nRecId )
{
- case OOBIN_ID_PTFITEMS: return this;
- case OOBIN_ID_AUTOSORTSCOPE: return this;
+ case BIFF12_ID_PTFITEMS: return this;
+ case BIFF12_ID_AUTOSORTSCOPE: return this;
}
break;
- case OOBIN_ID_PTFITEMS:
- if( nRecId == OOBIN_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
+ case BIFF12_ID_PTFITEMS:
+ if( nRecId == BIFF12_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
break;
- case OOBIN_ID_AUTOSORTSCOPE:
- if( nRecId == OOBIN_ID_PIVOTAREA ) return this;
+ case BIFF12_ID_AUTOSORTSCOPE:
+ if( nRecId == BIFF12_ID_PIVOTAREA ) return this;
break;
- case OOBIN_ID_PIVOTAREA:
- if( nRecId == OOBIN_ID_PTREFERENCES ) return this;
+ case BIFF12_ID_PIVOTAREA:
+ if( nRecId == BIFF12_ID_PTREFERENCES ) return this;
break;
- case OOBIN_ID_PTREFERENCES:
- if( nRecId == OOBIN_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
+ case BIFF12_ID_PTREFERENCES:
+ if( nRecId == BIFF12_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
break;
- case OOBIN_ID_PTREFERENCE:
- if( nRecId == OOBIN_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
+ case BIFF12_ID_PTREFERENCE:
+ if( nRecId == BIFF12_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
break;
}
return 0;
}
-void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFieldContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrTableField.importPTField( rStrm );
@@ -118,13 +121,13 @@ void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotTableFilterContext::OoxPivotTableFilterContext( OoxWorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
- OoxWorksheetContextBase( rFragment ),
+PivotTableFilterContext::PivotTableFilterContext( WorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
+ WorksheetContextBase( rFragment ),
mrTableFilter( rTableFilter )
{
}
-ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -141,30 +144,30 @@ ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElemen
return 0;
}
-void OoxPivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrTableFilter.importFilter( rAttribs );
}
-ContextHandlerRef OoxPivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PTFILTER:
- if( nRecId == OOBIN_ID_AUTOFILTER ) return this;
+ case BIFF12_ID_PTFILTER:
+ if( nRecId == BIFF12_ID_AUTOFILTER ) return this;
break;
- case OOBIN_ID_AUTOFILTER:
- if( nRecId == OOBIN_ID_FILTERCOLUMN ) return this;
+ case BIFF12_ID_AUTOFILTER:
+ if( nRecId == BIFF12_ID_FILTERCOLUMN ) return this;
break;
- case OOBIN_ID_FILTERCOLUMN:
- if( nRecId == OOBIN_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
+ case BIFF12_ID_FILTERCOLUMN:
+ if( nRecId == BIFF12_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
break;
}
return 0;
}
-void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFilterContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrTableFilter.importPTFilter( rStrm );
@@ -172,13 +175,13 @@ void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotTableFragment::OoxPivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
- mrPivotTable( rHelper.getPivotTables().createPivotTable() )
+PivotTableFragment::PivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrPivotTable( getPivotTables().createPivotTable() )
{
}
-ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -200,7 +203,7 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
break;
case XLS_TOKEN( pivotFields ):
- if( nElement == XLS_TOKEN( pivotField ) ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+ if( nElement == XLS_TOKEN( pivotField ) ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
break;
case XLS_TOKEN( rowFields ):
if( nElement == XLS_TOKEN( field ) ) mrPivotTable.importRowField( rAttribs );
@@ -215,75 +218,75 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
if( nElement == XLS_TOKEN( dataField ) ) mrPivotTable.importDataField( rAttribs );
break;
case XLS_TOKEN( filters ):
- if( nElement == XLS_TOKEN( filter ) ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+ if( nElement == XLS_TOKEN( filter ) ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
break;
}
return 0;
}
-ContextHandlerRef OoxPivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
+ if( nRecId == BIFF12_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
break;
- case OOBIN_ID_PTDEFINITION:
+ case BIFF12_ID_PTDEFINITION:
switch( nRecId )
{
- case OOBIN_ID_PTLOCATION: mrPivotTable.importPTLocation( rStrm, getSheetIndex() ); break;
- case OOBIN_ID_PTFIELDS: return this;
- case OOBIN_ID_PTROWFIELDS: mrPivotTable.importPTRowFields( rStrm ); break;
- case OOBIN_ID_PTCOLFIELDS: mrPivotTable.importPTColFields( rStrm ); break;
- case OOBIN_ID_PTPAGEFIELDS: return this;
- case OOBIN_ID_PTDATAFIELDS: return this;
- case OOBIN_ID_PTFILTERS: return this;
+ case BIFF12_ID_PTLOCATION: mrPivotTable.importPTLocation( rStrm, getSheetIndex() ); break;
+ case BIFF12_ID_PTFIELDS: return this;
+ case BIFF12_ID_PTROWFIELDS: mrPivotTable.importPTRowFields( rStrm ); break;
+ case BIFF12_ID_PTCOLFIELDS: mrPivotTable.importPTColFields( rStrm ); break;
+ case BIFF12_ID_PTPAGEFIELDS: return this;
+ case BIFF12_ID_PTDATAFIELDS: return this;
+ case BIFF12_ID_PTFILTERS: return this;
}
break;
- case OOBIN_ID_PTFIELDS:
- if( nRecId == OOBIN_ID_PTFIELD ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+ case BIFF12_ID_PTFIELDS:
+ if( nRecId == BIFF12_ID_PTFIELD ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
break;
- case OOBIN_ID_PTPAGEFIELDS:
- if( nRecId == OOBIN_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
+ case BIFF12_ID_PTPAGEFIELDS:
+ if( nRecId == BIFF12_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
break;
- case OOBIN_ID_PTDATAFIELDS:
- if( nRecId == OOBIN_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
+ case BIFF12_ID_PTDATAFIELDS:
+ if( nRecId == BIFF12_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
break;
- case OOBIN_ID_PTFILTERS:
- if( nRecId == OOBIN_ID_PTFILTER ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+ case BIFF12_ID_PTFILTERS:
+ if( nRecId == BIFF12_ID_PTFILTER ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
break;
}
return 0;
}
-const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
+const RecordInfo* PivotTableFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_AUTOFILTER, OOBIN_ID_AUTOFILTER + 1 },
- { OOBIN_ID_AUTOSORTSCOPE, OOBIN_ID_AUTOSORTSCOPE + 1 },
- { OOBIN_ID_FILTERCOLUMN, OOBIN_ID_FILTERCOLUMN + 1 },
- { OOBIN_ID_PIVOTAREA, OOBIN_ID_PIVOTAREA + 1 },
- { OOBIN_ID_PTCOLFIELDS, OOBIN_ID_PTCOLFIELDS + 1 },
- { OOBIN_ID_PTDATAFIELD, OOBIN_ID_PTDATAFIELD + 1 },
- { OOBIN_ID_PTDATAFIELDS, OOBIN_ID_PTDATAFIELDS + 1 },
- { OOBIN_ID_PTDEFINITION, OOBIN_ID_PTDEFINITION + 35 },
- { OOBIN_ID_PTFIELD, OOBIN_ID_PTFIELD + 1 },
- { OOBIN_ID_PTFIELDS, OOBIN_ID_PTFIELDS + 1 },
- { OOBIN_ID_PTFILTER, OOBIN_ID_PTFILTER + 1 },
- { OOBIN_ID_PTFILTERS, OOBIN_ID_PTFILTERS + 1 },
- { OOBIN_ID_PTFITEM, OOBIN_ID_PTFITEM - 1 },
- { OOBIN_ID_PTFITEMS, OOBIN_ID_PTFITEMS + 1 },
- { OOBIN_ID_PTLOCATION, OOBIN_ID_PTLOCATION - 1 },
- { OOBIN_ID_PTPAGEFIELD, OOBIN_ID_PTPAGEFIELD + 1 },
- { OOBIN_ID_PTPAGEFIELDS, OOBIN_ID_PTPAGEFIELDS + 1 },
- { OOBIN_ID_PTREFERENCE, OOBIN_ID_PTREFERENCE + 1 },
- { OOBIN_ID_PTREFERENCEITEM, OOBIN_ID_PTREFERENCEITEM + 1 },
- { OOBIN_ID_PTREFERENCES, OOBIN_ID_PTREFERENCES + 1 },
- { OOBIN_ID_PTROWFIELDS, OOBIN_ID_PTROWFIELDS + 1 },
- { -1, -1 }
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_AUTOSORTSCOPE, BIFF12_ID_AUTOSORTSCOPE + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_PIVOTAREA, BIFF12_ID_PIVOTAREA + 1 },
+ { BIFF12_ID_PTCOLFIELDS, BIFF12_ID_PTCOLFIELDS + 1 },
+ { BIFF12_ID_PTDATAFIELD, BIFF12_ID_PTDATAFIELD + 1 },
+ { BIFF12_ID_PTDATAFIELDS, BIFF12_ID_PTDATAFIELDS + 1 },
+ { BIFF12_ID_PTDEFINITION, BIFF12_ID_PTDEFINITION + 35 },
+ { BIFF12_ID_PTFIELD, BIFF12_ID_PTFIELD + 1 },
+ { BIFF12_ID_PTFIELDS, BIFF12_ID_PTFIELDS + 1 },
+ { BIFF12_ID_PTFILTER, BIFF12_ID_PTFILTER + 1 },
+ { BIFF12_ID_PTFILTERS, BIFF12_ID_PTFILTERS + 1 },
+ { BIFF12_ID_PTFITEM, BIFF12_ID_PTFITEM - 1 },
+ { BIFF12_ID_PTFITEMS, BIFF12_ID_PTFITEMS + 1 },
+ { BIFF12_ID_PTLOCATION, BIFF12_ID_PTLOCATION - 1 },
+ { BIFF12_ID_PTPAGEFIELD, BIFF12_ID_PTPAGEFIELD + 1 },
+ { BIFF12_ID_PTPAGEFIELDS, BIFF12_ID_PTPAGEFIELDS + 1 },
+ { BIFF12_ID_PTREFERENCE, BIFF12_ID_PTREFERENCE + 1 },
+ { BIFF12_ID_PTREFERENCEITEM, BIFF12_ID_PTREFERENCEITEM + 1 },
+ { BIFF12_ID_PTREFERENCES, BIFF12_ID_PTREFERENCES + 1 },
+ { BIFF12_ID_PTROWFIELDS, BIFF12_ID_PTROWFIELDS + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
@@ -291,22 +294,22 @@ const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
// ============================================================================
// ============================================================================
-BiffPivotTableContext::BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable ) :
- BiffWorksheetContextBase( rFragment ),
- mrPivotTable( rPivotTable )
+BiffPivotTableContext::BiffPivotTableContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrPivotTable( getPivotTables().createPivotTable() )
{
}
-void BiffPivotTableContext::importRecord()
+void BiffPivotTableContext::importRecord( BiffInputStream& rStrm )
{
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
- case BIFF_ID_PTDEFINITION: mrPivotTable.importPTDefinition( mrStrm, getSheetIndex() ); break;
- case BIFF_ID_PTDEFINITION2: mrPivotTable.importPTDefinition2( mrStrm ); break;
- case BIFF_ID_PTFIELD: mrPivotTable.createTableField().importPTField( mrStrm ); break;
- case BIFF_ID_PTROWCOLFIELDS: mrPivotTable.importPTRowColFields( mrStrm ); break;
- case BIFF_ID_PTPAGEFIELDS: mrPivotTable.importPTPageFields( mrStrm ); break;
- case BIFF_ID_PTDATAFIELD: mrPivotTable.importPTDataField( mrStrm ); break;
+ case BIFF_ID_PTDEFINITION: mrPivotTable.importPTDefinition( rStrm, getSheetIndex() ); break;
+ case BIFF_ID_PTDEFINITION2: mrPivotTable.importPTDefinition2( rStrm ); break;
+ case BIFF_ID_PTFIELD: mrPivotTable.createTableField().importPTField( rStrm ); break;
+ case BIFF_ID_PTROWCOLFIELDS: mrPivotTable.importPTRowColFields( rStrm ); break;
+ case BIFF_ID_PTPAGEFIELDS: mrPivotTable.importPTPageFields( rStrm ); break;
+ case BIFF_ID_PTDATAFIELD: mrPivotTable.importPTDataField( rStrm ); break;
}
}
@@ -314,4 +317,3 @@ void BiffPivotTableContext::importRecord()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx
new file mode 100644
index 000000000000..28ace4de52d8
--- /dev/null
+++ b/oox/source/xls/querytablebuffer.cxx
@@ -0,0 +1,390 @@
+/*************************************************************************
+ *
+ * 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 "oox/xls/querytablebuffer.hxx"
+
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/sheet/XAreaLink.hpp>
+#include <com/sun/star/sheet/XAreaLinks.hpp>
+#include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
+#include "oox/xls/defnamesbuffer.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt32 BIFF12_QUERYTABLE_HEADERS = 0x00000001;
+const sal_uInt32 BIFF12_QUERYTABLE_ROWNUMBERS = 0x00000002;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEREFRESH = 0x00000004;
+const sal_uInt32 BIFF12_QUERYTABLE_BACKGROUND = 0x00000008;
+const sal_uInt32 BIFF12_QUERYTABLE_FIRSTBACKGROUND = 0x00000010;
+const sal_uInt32 BIFF12_QUERYTABLE_REFRESHONLOAD = 0x00000020;
+const sal_uInt32 BIFF12_QUERYTABLE_FILLFORMULAS = 0x00000100;
+const sal_uInt32 BIFF12_QUERYTABLE_SAVEDATA = 0x00000200;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEEDIT = 0x00000400;
+const sal_uInt32 BIFF12_QUERYTABLE_PRESERVEFORMAT = 0x00000800;
+const sal_uInt32 BIFF12_QUERYTABLE_ADJUSTCOLWIDTH = 0x00001000;
+const sal_uInt32 BIFF12_QUERYTABLE_INTERMEDIATE = 0x00002000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYNUMFMT = 0x00004000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFONT = 0x00008000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYALIGNMENT = 0x00010000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYBORDER = 0x00020000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFILL = 0x00040000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYPROTECTION = 0x00080000;
+
+const sal_uInt16 BIFF_QUERYTABLE_HEADERS = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_ROWNUMBERS = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEREFRESH = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_BACKGROUND = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_FIRSTBACKGROUND = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_REFRESHONLOAD = 0x0020;
+const sal_uInt16 BIFF_QUERYTABLE_DELETEUNUSED = 0x0040;
+const sal_uInt16 BIFF_QUERYTABLE_FILLFORMULAS = 0x0080;
+const sal_uInt16 BIFF_QUERYTABLE_ADJUSTCOLWIDTH = 0x0100;
+const sal_uInt16 BIFF_QUERYTABLE_SAVEDATA = 0x0200;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEEDIT = 0x0400;
+const sal_uInt16 BIFF_QUERYTABLE_OVERWRITEEXISTING = 0x2000;
+
+const sal_uInt16 BIFF_QUERYTABLE_APPLYNUMFMT = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFONT = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYALIGNMENT = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYBORDER = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFILL = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYPROTECTION = 0x0020;
+
+const sal_uInt32 BIFF_QTREFRESH_PRESERVEFORMAT = 0x00000001;
+const sal_uInt32 BIFF_QTREFRESH_ADJUSTCOLWIDTH = 0x00000002;
+
+// ----------------------------------------------------------------------------
+
+void lclAppendWebQueryTableName( OUStringBuffer& rTables, const OUString& rTableName )
+{
+ if( rTableName.getLength() > 0 )
+ {
+ if( rTables.getLength() > 0 )
+ rTables.append( sal_Unicode( ';' ) );
+ rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML__" ) ).append( rTableName );
+ }
+}
+
+void lclAppendWebQueryTableIndex( OUStringBuffer& rTables, sal_Int32 nTableIndex )
+{
+ if( nTableIndex > 0 )
+ {
+ if( rTables.getLength() > 0 )
+ rTables.append( sal_Unicode( ';' ) );
+ rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML_" ) ).append( nTableIndex );
+ }
+}
+
+OUString lclBuildWebQueryTables( const WebPrModel::TablesVector& rTables )
+{
+ if( rTables.empty() )
+ return CREATE_OUSTRING( "HTML_tables" );
+
+ OUStringBuffer aTables;
+ for( WebPrModel::TablesVector::const_iterator aIt = rTables.begin(), aEnd = rTables.end(); aIt != aEnd; ++aIt )
+ {
+ if( aIt->has< OUString >() )
+ lclAppendWebQueryTableName( aTables, aIt->get< OUString >() );
+ else if( aIt->has< sal_Int32 >() )
+ lclAppendWebQueryTableIndex( aTables, aIt->get< sal_Int32 >() );
+ }
+ return aTables.makeStringAndClear();
+}
+
+Reference< XAreaLink > lclFindAreaLink(
+ const Reference< XAreaLinks >& rxAreaLinks, const CellAddress& rDestPos,
+ const OUString& rFileUrl, const OUString& rTables, const OUString& rFilterName, const OUString& rFilterOptions )
+{
+ try
+ {
+ Reference< XEnumerationAccess > xAreaLinksEA( rxAreaLinks, UNO_QUERY_THROW );
+ Reference< XEnumeration > xAreaLinksEnum( xAreaLinksEA->createEnumeration(), UNO_SET_THROW );
+ while( xAreaLinksEnum->hasMoreElements() )
+ {
+ Reference< XAreaLink > xAreaLink( xAreaLinksEnum->nextElement(), UNO_QUERY_THROW );
+ PropertySet aPropSet( xAreaLink );
+ CellRangeAddress aDestArea = xAreaLink->getDestArea();
+ OUString aString;
+ if( (rDestPos.Sheet == aDestArea.Sheet) && (rDestPos.Column == aDestArea.StartColumn) && (rDestPos.Row == aDestArea.StartRow) &&
+ (rTables == xAreaLink->getSourceArea()) &&
+ aPropSet.getProperty( aString, PROP_Url ) && (rFileUrl == aString) &&
+ aPropSet.getProperty( aString, PROP_Filter ) && (rFilterName == aString) &&
+ aPropSet.getProperty( aString, PROP_FilterOptions ) && (rFilterOptions == aString) )
+ return xAreaLink;
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ return Reference< XAreaLink >();
+}
+
+} // namespace
+
+// ============================================================================
+
+QueryTableModel::QueryTableModel() :
+ mnConnId( -1 ),
+ mnGrowShrinkType( XML_insertDelete ),
+ mbHeaders( true ),
+ mbRowNumbers( false ),
+ mbDisableRefresh( false ),
+ mbBackground( true ),
+ mbFirstBackground( false ),
+ mbRefreshOnLoad( false ),
+ mbFillFormulas( false ),
+ mbRemoveDataOnSave( false ),
+ mbDisableEdit( false ),
+ mbPreserveFormat( true ),
+ mbAdjustColWidth( true ),
+ mbIntermediate( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+QueryTable::QueryTable( const WorksheetHelper& rHelper ) :
+ WorksheetHelper( rHelper )
+{
+}
+
+void QueryTable::importQueryTable( const AttributeList& rAttribs )
+{
+ maModel.maDefName = rAttribs.getXString( XML_name, OUString() );
+ maModel.mnConnId = rAttribs.getInteger( XML_connectionId, -1 );
+ maModel.mnGrowShrinkType = rAttribs.getToken( XML_growShrinkType, XML_insertDelete );
+ maModel.mnAutoFormatId = rAttribs.getInteger( XML_autoFormatId, 0 );
+ maModel.mbHeaders = rAttribs.getBool( XML_headers, true );
+ maModel.mbRowNumbers = rAttribs.getBool( XML_rowNumbers, false );
+ maModel.mbDisableRefresh = rAttribs.getBool( XML_disableRefresh, false );
+ maModel.mbBackground = rAttribs.getBool( XML_backgroundRefresh, true );
+ maModel.mbFirstBackground = rAttribs.getBool( XML_firstBackgroundRefresh, false );
+ maModel.mbRefreshOnLoad = rAttribs.getBool( XML_refreshOnLoad, false );
+ maModel.mbFillFormulas = rAttribs.getBool( XML_fillFormulas, false );
+ maModel.mbRemoveDataOnSave = rAttribs.getBool( XML_removeDataOnSave, false );
+ maModel.mbDisableEdit = rAttribs.getBool( XML_disableEdit, false );
+ maModel.mbPreserveFormat = rAttribs.getBool( XML_preserveFormatting, true );
+ maModel.mbAdjustColWidth = rAttribs.getBool( XML_adjustColumnWidth, true );
+ maModel.mbIntermediate = rAttribs.getBool( XML_intermediate, false );
+ maModel.mbApplyNumFmt = rAttribs.getBool( XML_applyNumberFormats, false );
+ maModel.mbApplyFont = rAttribs.getBool( XML_applyFontFormats, false );
+ maModel.mbApplyAlignment = rAttribs.getBool( XML_applyAlignmentFormats, false );
+ maModel.mbApplyBorder = rAttribs.getBool( XML_applyBorderFormats, false );
+ maModel.mbApplyFill = rAttribs.getBool( XML_applyPatternFormats, false );
+ // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+ maModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false );
+}
+
+void QueryTable::importQueryTable( SequenceInputStream& rStrm )
+{
+ sal_uInt32 nFlags;
+ rStrm >> nFlags;
+ maModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm >> maModel.mnConnId >> maModel.maDefName;
+
+ static const sal_Int32 spnGrowShrinkTypes[] = { XML_insertClear, XML_insertDelete, XML_overwriteClear };
+ maModel.mnGrowShrinkType = STATIC_ARRAY_SELECT( spnGrowShrinkTypes, extractValue< sal_uInt8 >( nFlags, 6, 2 ), XML_insertDelete );
+
+ maModel.mbHeaders = getFlag( nFlags, BIFF12_QUERYTABLE_HEADERS );
+ maModel.mbRowNumbers = getFlag( nFlags, BIFF12_QUERYTABLE_ROWNUMBERS );
+ maModel.mbDisableRefresh = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEREFRESH );
+ maModel.mbBackground = getFlag( nFlags, BIFF12_QUERYTABLE_BACKGROUND );
+ maModel.mbFirstBackground = getFlag( nFlags, BIFF12_QUERYTABLE_FIRSTBACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF12_QUERYTABLE_REFRESHONLOAD );
+ maModel.mbFillFormulas = getFlag( nFlags, BIFF12_QUERYTABLE_FILLFORMULAS );
+ maModel.mbRemoveDataOnSave = !getFlag( nFlags, BIFF12_QUERYTABLE_SAVEDATA ); // flag negated in BIFF12
+ maModel.mbDisableEdit = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEEDIT );
+ maModel.mbPreserveFormat = getFlag( nFlags, BIFF12_QUERYTABLE_PRESERVEFORMAT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF12_QUERYTABLE_ADJUSTCOLWIDTH );
+ maModel.mbIntermediate = getFlag( nFlags, BIFF12_QUERYTABLE_INTERMEDIATE );
+ maModel.mbApplyNumFmt = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYNUMFMT );
+ maModel.mbApplyFont = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFONT );
+ maModel.mbApplyAlignment = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYALIGNMENT );
+ maModel.mbApplyBorder = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYBORDER );
+ maModel.mbApplyFill = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFILL );
+ maModel.mbApplyProtection = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYPROTECTION );
+}
+
+void QueryTable::importQueryTable( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nAutoFormatFlags;
+ rStrm >> nFlags;
+ maModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm >> nAutoFormatFlags;
+ rStrm.skip( 4 );
+ maModel.maDefName = rStrm.readUniString();
+
+ bool bDeleteUnused = getFlag( nFlags, BIFF_QUERYTABLE_DELETEUNUSED );
+ bool bOverwriteExisting = getFlag( nFlags, BIFF_QUERYTABLE_OVERWRITEEXISTING );
+ OSL_ENSURE( !bDeleteUnused || !bOverwriteExisting, "QueryTable::importQueryTable - invalid flags" );
+ maModel.mnGrowShrinkType = bDeleteUnused ? XML_insertDelete : (bOverwriteExisting ? XML_overwriteClear : XML_insertClear);
+
+ maModel.mbHeaders = getFlag( nFlags, BIFF_QUERYTABLE_HEADERS );
+ maModel.mbRowNumbers = getFlag( nFlags, BIFF_QUERYTABLE_ROWNUMBERS );
+ maModel.mbDisableRefresh = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEREFRESH );
+ maModel.mbBackground = getFlag( nFlags, BIFF_QUERYTABLE_BACKGROUND );
+ maModel.mbFirstBackground = getFlag( nFlags, BIFF_QUERYTABLE_FIRSTBACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF_QUERYTABLE_REFRESHONLOAD );
+ maModel.mbFillFormulas = getFlag( nFlags, BIFF_QUERYTABLE_FILLFORMULAS );
+ maModel.mbRemoveDataOnSave = !getFlag( nFlags, BIFF_QUERYTABLE_SAVEDATA ); // flag negated in BIFF
+ maModel.mbDisableEdit = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEEDIT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF_QUERYTABLE_ADJUSTCOLWIDTH );
+ maModel.mbApplyNumFmt = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYNUMFMT );
+ maModel.mbApplyFont = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFONT );
+ maModel.mbApplyAlignment = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYALIGNMENT );
+ maModel.mbApplyBorder = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYBORDER );
+ maModel.mbApplyFill = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFILL );
+ maModel.mbApplyProtection = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYPROTECTION );
+
+ // create a new connection object that will store settings from following records
+ OSL_ENSURE( maModel.mnConnId == -1, "QueryTable::importQueryTable - multiple call" );
+ Connection& rConnection = getConnections().createConnectionWithId();
+ maModel.mnConnId = rConnection.getConnectionId();
+
+ // a DBQUERY record with some PCITEM_STRING records must follow
+ bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord();
+ OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" );
+ if( bHasDbQuery )
+ rConnection.importDbQuery( rStrm );
+}
+
+void QueryTable::importQueryTableRefresh( BiffInputStream& rStrm )
+{
+ rStrm.skip( 4 );
+ bool bPivot = rStrm.readuInt16() != 0;
+ OSL_ENSURE( !bPivot, "QueryTable::importQueryTableRefresh - unexpected pivot flag" );
+ if( !bPivot )
+ {
+ rStrm.skip( 2 );
+ sal_uInt32 nFlags = rStrm.readuInt32();
+ maModel.mbPreserveFormat = getFlag( nFlags, BIFF_QTREFRESH_PRESERVEFORMAT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF_QTREFRESH_ADJUSTCOLWIDTH );
+ }
+}
+
+void QueryTable::importQueryTableSettings( BiffInputStream& rStrm )
+{
+ ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+ OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTableSettings - missing connection object" );
+ if( xConnection.get() )
+ xConnection->importQueryTableSettings( rStrm );
+}
+
+void QueryTable::finalizeImport()
+{
+ ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+ OSL_ENSURE( xConnection.get(), "QueryTable::finalizeImport - missing connection object" );
+ if( xConnection.get() && (xConnection->getConnectionType() == BIFF12_CONNECTION_HTML) )
+ {
+ // check that valid web query properties exist
+ const WebPrModel* pWebPr = xConnection->getModel().mxWebPr.get();
+ if( pWebPr && !pWebPr->mbXml )
+ {
+ OUString aFileUrl = getBaseFilter().getAbsoluteUrl( pWebPr->maUrl );
+ if( aFileUrl.getLength() > 0 )
+ {
+ // resolve destination cell range (stored as defined name containing the range)
+ OUString aDefName = maModel.maDefName.replace( ' ', '_' ).replace( '-', '_' );
+ DefinedNameRef xDefName = getDefinedNames().getByModelName( aDefName, getSheetIndex() );
+ OSL_ENSURE( xDefName.get(), "QueryTable::finalizeImport - missing defined name" );
+ if( xDefName.get() )
+ {
+ CellRangeAddress aDestRange;
+ bool bIsRange = xDefName->getAbsoluteRange( aDestRange ) && (aDestRange.Sheet == getSheetIndex());
+ OSL_ENSURE( bIsRange, "QueryTable::finalizeImport - defined name does not contain valid cell range" );
+ if( bIsRange && getAddressConverter().checkCellRange( aDestRange, false, true ) )
+ {
+ CellAddress aDestPos( aDestRange.Sheet, aDestRange.StartColumn, aDestRange.StartRow );
+ // find tables mode: entire document, all tables, or specific tables
+ OUString aTables = pWebPr->mbHtmlTables ? lclBuildWebQueryTables( pWebPr->maTables ) : CREATE_OUSTRING( "HTML_all" );
+ if( aTables.getLength() > 0 ) try
+ {
+ PropertySet aDocProps( getDocument() );
+ Reference< XAreaLinks > xAreaLinks( aDocProps.getAnyProperty( PROP_AreaLinks ), UNO_QUERY_THROW );
+ OUString aFilterName = CREATE_OUSTRING( "calc_HTML_WebQuery" );
+ OUString aFilterOptions;
+ xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions );
+ // set refresh interval (convert minutes to seconds)
+ sal_Int32 nRefreshPeriod = xConnection->getModel().mnInterval * 60;
+ if( nRefreshPeriod > 0 )
+ {
+ PropertySet aPropSet( lclFindAreaLink( xAreaLinks, aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions ) );
+ aPropSet.setProperty( PROP_RefreshPeriod, nRefreshPeriod );
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// ============================================================================
+
+QueryTableBuffer::QueryTableBuffer( const WorksheetHelper& rHelper ) :
+ WorksheetHelper( rHelper )
+{
+}
+
+QueryTable& QueryTableBuffer::createQueryTable()
+{
+ QueryTableVector::value_type xQueryTable( new QueryTable( *this ) );
+ maQueryTables.push_back( xQueryTable );
+ return *xQueryTable;
+}
+
+void QueryTableBuffer::finalizeImport()
+{
+ maQueryTables.forEachMem( &QueryTable::finalizeImport );
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx
index 303852b8492b..c74aa53a581e 100644
--- a/oox/source/xls/querytablefragment.cxx
+++ b/oox/source/xls/querytablefragment.cxx
@@ -26,31 +26,81 @@
************************************************************************/
#include "oox/xls/querytablefragment.hxx"
-#include "oox/xls/webquerybuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/querytablebuffer.hxx"
namespace oox {
namespace xls {
-OoxQueryTableFragment::OoxQueryTableFragment(
- const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+// ============================================================================
+
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+QueryTableFragment::QueryTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrQueryTable( getQueryTables().createQueryTable() )
{
}
-ContextHandlerRef OoxQueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef QueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nElement == XLS_TOKEN( queryTable ) )
+ mrQueryTable.importQueryTable( rAttribs );
+ break;
+ }
+ return 0;
+}
+
+ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nElement == XLS_TOKEN( queryTable ) ) getWebQueries().importQueryTable( rAttribs );
+ if( nRecId == BIFF12_ID_QUERYTABLE )
+ mrQueryTable.importQueryTable( rStrm );
break;
}
return 0;
}
+const RecordInfo* QueryTableFragment::getRecordInfos() const
+{
+ static const RecordInfo spRecInfos[] =
+ {
+ { BIFF12_ID_QUERYTABLE, BIFF12_ID_QUERYTABLE + 1 },
+ { BIFF12_ID_QUERYTABLEREFRESH, BIFF12_ID_QUERYTABLEREFRESH + 1 },
+ { -1, -1 }
+ };
+ return spRecInfos;
+}
+
+// ============================================================================
+
+BiffQueryTableContext::BiffQueryTableContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrQueryTable( getQueryTables().createQueryTable() )
+{
+}
+
+void BiffQueryTableContext::importRecord( BiffInputStream& rStrm )
+{
+ switch( rStrm.getRecId() )
+ {
+ case BIFF_ID_QUERYTABLE: mrQueryTable.importQueryTable( rStrm ); break;
+ case BIFF_ID_QUERYTABLEREFRESH: mrQueryTable.importQueryTableRefresh( rStrm ); break;
+ case BIFF_ID_QUERYTABLESETTINGS: mrQueryTable.importQueryTableSettings( rStrm ); break;
+ }
+}
+
+// ============================================================================
+
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/richstring.cxx b/oox/source/xls/richstring.cxx
index 4e82b1e696f0..5c79373b09b2 100644
--- a/oox/source/xls/richstring.cxx
+++ b/oox/source/xls/richstring.cxx
@@ -26,29 +26,31 @@
************************************************************************/
#include "oox/xls/richstring.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/text/XText.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextRange;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS = 0x02;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS = 0x02;
} // namespace
@@ -105,7 +107,7 @@ void RichStringPortion::convert( const Reference< XText >& rxText, sal_Int32 nXf
// ----------------------------------------------------------------------------
-void FontPortionModel::read( RecordInputStream& rStrm )
+void FontPortionModel::read( SequenceInputStream& rStrm )
{
mnPos = rStrm.readuInt16();
mnFontId = rStrm.readuInt16();
@@ -143,7 +145,7 @@ void FontPortionModelList::appendPortion( const FontPortionModel& rPortion )
back().mnFontId = rPortion.mnFontId;
}
-void FontPortionModelList::importPortions( RecordInputStream& rStrm )
+void FontPortionModelList::importPortions( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
clear();
@@ -190,7 +192,7 @@ PhoneticDataModel::PhoneticDataModel() :
{
}
-void PhoneticDataModel::setBinData( sal_Int32 nType, sal_Int32 nAlignment )
+void PhoneticDataModel::setBiffData( sal_Int32 nType, sal_Int32 nAlignment )
{
static const sal_Int32 spnTypeIds[] = { XML_halfwidthKatakana, XML_fullwidthKatakana, XML_hiragana, XML_noConversion };
mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_fullwidthKatakana );
@@ -213,13 +215,13 @@ void PhoneticSettings::importPhoneticPr( const AttributeList& rAttribs )
maModel.mnAlignment = rAttribs.getToken( XML_alignment, XML_left );
}
-void PhoneticSettings::importPhoneticPr( RecordInputStream& rStrm )
+void PhoneticSettings::importPhoneticPr( SequenceInputStream& rStrm )
{
sal_uInt16 nFontId;
sal_Int32 nType, nAlignment;
rStrm >> nFontId >> nType >> nAlignment;
maModel.mnFontId = nFontId;
- maModel.setBinData( nType, nAlignment );
+ maModel.setBiffData( nType, nAlignment );
}
void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
@@ -227,16 +229,16 @@ void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
// following: range list with cells showing phonetic text
}
-void PhoneticSettings::importStringData( RecordInputStream& rStrm )
+void PhoneticSettings::importStringData( SequenceInputStream& rStrm )
{
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
}
void PhoneticSettings::importStringData( BiffInputStream& rStrm )
@@ -244,7 +246,7 @@ void PhoneticSettings::importStringData( BiffInputStream& rStrm )
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
}
// ============================================================================
@@ -275,7 +277,7 @@ void RichStringPhonetic::setBaseRange( sal_Int32 nBasePos, sal_Int32 nBaseEnd )
// ----------------------------------------------------------------------------
-void PhoneticPortionModel::read( RecordInputStream& rStrm )
+void PhoneticPortionModel::read( SequenceInputStream& rStrm )
{
mnPos = rStrm.readuInt16();
mnBasePos = rStrm.readuInt16();
@@ -308,7 +310,7 @@ void PhoneticPortionModelList::appendPortion( const PhoneticPortionModel& rPorti
}
}
-void PhoneticPortionModelList::importPortions( RecordInputStream& rStrm )
+void PhoneticPortionModelList::importPortions( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
clear();
@@ -380,12 +382,12 @@ void RichString::importPhoneticPr( const AttributeList& rAttribs )
maPhonSettings.importPhoneticPr( rAttribs );
}
-void RichString::importString( RecordInputStream& rStrm, bool bRich )
+void RichString::importString( SequenceInputStream& rStrm, bool bRich )
{
sal_uInt8 nFlags = bRich ? rStrm.readuInt8() : 0;
- OUString aBaseText = rStrm.readString();
+ OUString aBaseText = BiffHelper::readString( rStrm );
- if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+ if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
{
FontPortionModelList aPortions;
aPortions.importPortions( rStrm );
@@ -396,9 +398,9 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich )
createPortion()->setText( aBaseText );
}
- if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+ if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
{
- OUString aPhoneticText = rStrm.readString();
+ OUString aPhoneticText = BiffHelper::readString( rStrm );
PhoneticPortionModelList aPortions;
aPortions.importPortions( rStrm );
maPhonSettings.importStringData( rStrm );
@@ -610,4 +612,3 @@ void RichString::createPhoneticPortions( const ::rtl::OUString& rText, PhoneticP
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/richstringcontext.cxx b/oox/source/xls/richstringcontext.cxx
index 4eb3f5e91a4f..a3cfbe054406 100644
--- a/oox/source/xls/richstringcontext.cxx
+++ b/oox/source/xls/richstringcontext.cxx
@@ -26,28 +26,37 @@
************************************************************************/
#include "oox/xls/richstringcontext.hxx"
-#include "oox/xls/stylesfragment.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/stylesfragment.hxx"
namespace oox {
namespace xls {
// ============================================================================
-// oox.core.ContextHandler2Helper interface -----------------------------------
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
-ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+// ============================================================================
+
+ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( isRootElement() )
{
switch( nElement )
{
- case XLS_TOKEN( t ): mxPortion = mxString->importText( rAttribs ); return this; // collect text in onEndElement()
- case XLS_TOKEN( r ): mxPortion = mxString->importRun( rAttribs ); return this;
- case XLS_TOKEN( rPh ): mxPhonetic = mxString->importPhoneticRun( rAttribs ); return this;
- case XLS_TOKEN( phoneticPr ): mxString->importPhoneticPr( rAttribs ); break;
+ case XLS_TOKEN( t ):
+ mxPortion = mxString->importText( rAttribs );
+ return this; // collect text in onCharacters()
+ case XLS_TOKEN( r ):
+ mxPortion = mxString->importRun( rAttribs );
+ return this;
+ case XLS_TOKEN( rPh ):
+ mxPhonetic = mxString->importPhoneticRun( rAttribs );
+ return this;
+ case XLS_TOKEN( phoneticPr ):
+ mxString->importPhoneticPr( rAttribs );
+ break;
}
}
else switch( getCurrentElement() )
@@ -57,11 +66,11 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
{
case XLS_TOKEN( rPr ):
if( mxPortion.get() )
- return new OoxFontContext( *this, mxPortion->createFont() );
+ return new FontContext( *this, mxPortion->createFont() );
break;
case XLS_TOKEN( t ):
- return this; // collect portion text in onEndElement()
+ return this; // collect portion text in onCharacters()
}
break;
@@ -69,22 +78,24 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
switch( nElement )
{
case XLS_TOKEN( t ):
- return this; // collect phonetic text in onEndElement()
+ return this; // collect phonetic text in onCharacters()
}
break;
}
return 0;
}
-void OoxRichStringContext::onEndElement( const OUString& rChars )
+void RichStringContext::onCharacters( const OUString& rChars )
{
- if( getCurrentElement() == XLS_TOKEN( t ) )
+ if( isCurrentElement( XLS_TOKEN( t ) ) ) switch( getParentElement() )
{
- switch( getPreviousElement() )
- {
- case XLS_TOKEN( rPh ): if( mxPhonetic.get() ) mxPhonetic->setText( rChars ); break;
- default: if( mxPortion.get() ) mxPortion->setText( rChars ); break;
- }
+ case XLS_TOKEN( rPh ):
+ if( mxPhonetic.get() )
+ mxPhonetic->setText( rChars );
+ break;
+ default:
+ if( mxPortion.get() )
+ mxPortion->setText( rChars );
}
}
@@ -92,4 +103,3 @@ void OoxRichStringContext::onEndElement( const OUString& rChars )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx
index a4a2627f3efb..8915f1ae0c7b 100644
--- a/oox/source/xls/scenariobuffer.cxx
+++ b/oox/source/xls/scenariobuffer.cxx
@@ -26,39 +26,33 @@
************************************************************************/
#include "oox/xls/scenariobuffer.hxx"
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/sheet/XScenario.hpp>
#include <com/sun/star/sheet/XScenarios.hpp>
#include <com/sun/star/sheet/XScenariosSupplier.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XScenario;
-using ::com::sun::star::sheet::XScenarios;
-using ::com::sun::star::sheet::XScenariosSupplier;
-using ::com::sun::star::sheet::XSpreadsheet;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_Int32 BIFF_SCENARIO_DELETED = 0x4000;
@@ -108,7 +102,7 @@ void Scenario::importInputCells( const AttributeList& rAttribs )
maCells.push_back( aModel );
}
-void Scenario::importScenario( RecordInputStream& rStrm )
+void Scenario::importScenario( SequenceInputStream& rStrm )
{
rStrm.skip( 2 ); // cell count
// two longs instead of flag field
@@ -117,7 +111,7 @@ void Scenario::importScenario( RecordInputStream& rStrm )
rStrm >> maModel.maName >> maModel.maComment >> maModel.maUser;
}
-void Scenario::importInputCells( RecordInputStream& rStrm )
+void Scenario::importInputCells( SequenceInputStream& rStrm )
{
// TODO: where is the deleted flag?
ScenarioCellModel aModel;
@@ -238,7 +232,7 @@ void SheetScenarios::importScenarios( const AttributeList& rAttribs )
maModel.mnShown = rAttribs.getInteger( XML_show, 0 );
}
-void SheetScenarios::importScenarios( RecordInputStream& rStrm )
+void SheetScenarios::importScenarios( SequenceInputStream& rStrm )
{
maModel.mnCurrent = rStrm.readuInt16();
maModel.mnShown = rStrm.readuInt16();
@@ -303,4 +297,3 @@ void ScenarioBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/scenariocontext.cxx b/oox/source/xls/scenariocontext.cxx
index 8d1341688a74..be44bc8545f2 100644
--- a/oox/source/xls/scenariocontext.cxx
+++ b/oox/source/xls/scenariocontext.cxx
@@ -26,22 +26,25 @@
************************************************************************/
#include "oox/xls/scenariocontext.hxx"
-#include "oox/xls/scenariobuffer.hxx"
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/scenariobuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxScenarioContext::OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
- OoxWorksheetContextBase( rParent ),
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
+ScenarioContext::ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
+ WorksheetContextBase( rParent ),
mrScenario( rSheetScenarios.createScenario() )
{
}
-ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -52,24 +55,24 @@ ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const
return 0;
}
-void OoxScenarioContext::onStartElement( const AttributeList& rAttribs )
+void ScenarioContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrScenario.importScenario( rAttribs );
}
-ContextHandlerRef OoxScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SCENARIO:
- if( nRecId == OOBIN_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
+ case BIFF12_ID_SCENARIO:
+ if( nRecId == BIFF12_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
break;
}
return 0;
}
-void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
+void ScenarioContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrScenario.importScenario( rStrm );
@@ -77,41 +80,41 @@ void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxScenariosContext::OoxScenariosContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment ),
+ScenariosContext::ScenariosContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment ),
mrSheetScenarios( getScenarios().createSheetScenarios( getSheetIndex() ) )
{
}
-ContextHandlerRef OoxScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef ScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
case XLS_TOKEN( scenarios ):
- if( nElement == XLS_TOKEN( scenario ) ) return new OoxScenarioContext( *this, mrSheetScenarios );
+ if( nElement == XLS_TOKEN( scenario ) ) return new ScenarioContext( *this, mrSheetScenarios );
break;
}
return 0;
}
-void OoxScenariosContext::onStartElement( const AttributeList& rAttribs )
+void ScenariosContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrSheetScenarios.importScenarios( rAttribs );
}
-ContextHandlerRef OoxScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SCENARIOS:
- if( nRecId == OOBIN_ID_SCENARIO ) return new OoxScenarioContext( *this, mrSheetScenarios );
+ case BIFF12_ID_SCENARIOS:
+ if( nRecId == BIFF12_ID_SCENARIO ) return new ScenarioContext( *this, mrSheetScenarios );
break;
}
return 0;
}
-void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
+void ScenariosContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrSheetScenarios.importScenarios( rStrm );
@@ -121,4 +124,3 @@ void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx
index c95d52910bec..efdfe801f784 100644
--- a/oox/source/xls/sharedformulabuffer.cxx
+++ b/oox/source/xls/sharedformulabuffer.cxx
@@ -26,30 +26,28 @@
************************************************************************/
#include "oox/xls/sharedformulabuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include "properties.hxx"
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XNamedRange;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
bool operator==( const CellAddress& rAddr1, const CellAddress& rAddr2 )
@@ -113,7 +111,7 @@ void SharedFormulaBuffer::importSharedFmla( const OUString& rFormula, const OUSt
}
}
-void SharedFormulaBuffer::importSharedFmla( RecordInputStream& rStrm, const CellAddress& rBaseAddr )
+void SharedFormulaBuffer::importSharedFmla( SequenceInputStream& rStrm, const CellAddress& rBaseAddr )
{
BinRange aRange;
rStrm >> aRange;
@@ -212,4 +210,3 @@ void SharedFormulaBuffer::updateCachedCell( const CellAddress& rBaseAddr, const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/sharedstringsbuffer.cxx b/oox/source/xls/sharedstringsbuffer.cxx
index f2a92ef06c0a..59d3a905bc40 100644
--- a/oox/source/xls/sharedstringsbuffer.cxx
+++ b/oox/source/xls/sharedstringsbuffer.cxx
@@ -26,16 +26,19 @@
************************************************************************/
#include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/biffinputstream.hxx"
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
+#include "oox/xls/biffinputstream.hxx"
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+// ============================================================================
+
SharedStringsBuffer::SharedStringsBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
{
@@ -81,4 +84,3 @@ void SharedStringsBuffer::convertString( const Reference< XText >& rxText, sal_I
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx
index b868ca08523d..bdb60f6962b8 100644
--- a/oox/source/xls/sharedstringsfragment.cxx
+++ b/oox/source/xls/sharedstringsfragment.cxx
@@ -26,27 +26,28 @@
************************************************************************/
#include "oox/xls/sharedstringsfragment.hxx"
-#include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/richstringcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
+#include "oox/xls/sharedstringsbuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxSharedStringsFragment::OoxSharedStringsFragment(
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+SharedStringsFragment::SharedStringsFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef SharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
@@ -57,42 +58,40 @@ ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement,
case XLS_TOKEN( sst ):
if( nElement == XLS_TOKEN( si ) )
- return new OoxRichStringContext( *this, getSharedStrings().createRichString() );
+ return new RichStringContext( *this, getSharedStrings().createRichString() );
break;
}
return 0;
}
-ContextHandlerRef OoxSharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_SST )
+ if( nRecId == BIFF12_ID_SST )
return this;
break;
- case OOBIN_ID_SST:
- if( nRecId == OOBIN_ID_SI )
+ case BIFF12_ID_SST:
+ if( nRecId == BIFF12_ID_SI )
getSharedStrings().createRichString()->importString( rStrm, true );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxSharedStringsFragment::getRecordInfos() const
+const RecordInfo* SharedStringsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_SST, OOBIN_ID_SST + 1 },
+ { BIFF12_ID_SST, BIFF12_ID_SST + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxSharedStringsFragment::finalizeImport()
+void SharedStringsFragment::finalizeImport()
{
getSharedStrings().finalizeImport();
}
@@ -101,4 +100,3 @@ void OoxSharedStringsFragment::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index 05e4c5bfe767..c515ec02bfbe 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -26,15 +26,15 @@
************************************************************************/
#include "oox/xls/sheetdatacontext.hxx"
+
+#include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
+#include <com/sun/star/sheet/XFormulaTokens.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/XCellRange.hpp>
-#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
#include <com/sun/star/text/XText.hpp>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/formulaparser.hxx"
@@ -42,47 +42,39 @@
#include "oox/xls/sharedformulabuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::CellContentType_EMPTY;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XArrayFormulaTokens;
-using ::com::sun::star::text::XText;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
// record constants -----------------------------------------------------------
-const sal_uInt32 OOBIN_CELL_SHOWPHONETIC = 0x01000000;
-
-const sal_uInt8 OOBIN_DATATABLE_ROW = 0x01;
-const sal_uInt8 OOBIN_DATATABLE_2D = 0x02;
-const sal_uInt8 OOBIN_DATATABLE_REF1DEL = 0x04;
-const sal_uInt8 OOBIN_DATATABLE_REF2DEL = 0x08;
+const sal_uInt32 BIFF12_CELL_SHOWPHONETIC = 0x01000000;
-const sal_uInt16 OOBIN_ROW_THICKTOP = 0x0001;
-const sal_uInt16 OOBIN_ROW_THICKBOTTOM = 0x0002;
-const sal_uInt16 OOBIN_ROW_COLLAPSED = 0x0800;
-const sal_uInt16 OOBIN_ROW_HIDDEN = 0x1000;
-const sal_uInt16 OOBIN_ROW_CUSTOMHEIGHT = 0x2000;
-const sal_uInt16 OOBIN_ROW_CUSTOMFORMAT = 0x4000;
-const sal_uInt8 OOBIN_ROW_SHOWPHONETIC = 0x01;
+const sal_uInt8 BIFF12_DATATABLE_ROW = 0x01;
+const sal_uInt8 BIFF12_DATATABLE_2D = 0x02;
+const sal_uInt8 BIFF12_DATATABLE_REF1DEL = 0x04;
+const sal_uInt8 BIFF12_DATATABLE_REF2DEL = 0x08;
-const sal_uInt8 BIFF_BOOLERR_BOOL = 0;
-const sal_uInt8 BIFF_BOOLERR_ERROR = 1;
+const sal_uInt16 BIFF12_ROW_THICKTOP = 0x0001;
+const sal_uInt16 BIFF12_ROW_THICKBOTTOM = 0x0002;
+const sal_uInt16 BIFF12_ROW_COLLAPSED = 0x0800;
+const sal_uInt16 BIFF12_ROW_HIDDEN = 0x1000;
+const sal_uInt16 BIFF12_ROW_CUSTOMHEIGHT = 0x2000;
+const sal_uInt16 BIFF12_ROW_CUSTOMFORMAT = 0x4000;
+const sal_uInt8 BIFF12_ROW_SHOWPHONETIC = 0x01;
const sal_uInt16 BIFF_DATATABLE_ROW = 0x0004;
const sal_uInt16 BIFF_DATATABLE_2D = 0x0008;
@@ -162,14 +154,12 @@ void ArrayFormulaContext::setTokens( const ApiTokenSequence& rTokens )
// ============================================================================
-OoxSheetDataContext::OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+SheetDataContext::SheetDataContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef SheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -186,7 +176,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
{
case XLS_TOKEN( is ):
mxInlineStr.reset( new RichString( *this ) );
- return new OoxRichStringContext( *this, mxInlineStr );
+ return new RichStringContext( *this, mxInlineStr );
case XLS_TOKEN( v ):
return this;
case XLS_TOKEN( f ):
@@ -198,7 +188,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-void OoxSheetDataContext::onEndElement( const OUString& rChars )
+void SheetDataContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -252,84 +242,85 @@ void OoxSheetDataContext::onEndElement( const OUString& rChars )
break;
default:
- OSL_ENSURE( false, "OoxSheetDataContext::onEndElement - unknown formula type" );
+ OSL_ENSURE( false, "SheetDataContext::onCharacters - unknown formula type" );
}
}
catch( Exception& )
{
}
break;
+ }
+}
- case XLS_TOKEN( c ):
- if( maCurrCell.mxCell.is() )
+void SheetDataContext::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( c ) ) && maCurrCell.mxCell.is() )
+ {
+ if( maCurrCell.mxCell->getType() == CellContentType_EMPTY )
+ {
+ if( maCurrCell.mbHasValueStr )
{
- if( maCurrCell.mxCell->getType() == CellContentType_EMPTY )
- {
- if( maCurrCell.mbHasValueStr )
- {
- // implemented in WorksheetHelper class
- setCell( maCurrCell );
- }
- else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() )
- {
- // convert font settings
- mxInlineStr->finalizeImport();
- // write string to cell
- Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
- if( xText.is() )
- mxInlineStr->convert( xText, maCurrCell.mnXfId );
- }
- else
- {
- // empty cell, update cell type
- maCurrCell.mnCellType = XML_TOKEN_INVALID;
- }
- }
-
- // store the cell formatting data
- setCellFormat( maCurrCell );
+ // implemented in WorksheetHelper class
+ setCell( maCurrCell );
}
- break;
+ else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() )
+ {
+ // convert font settings
+ mxInlineStr->finalizeImport();
+ // write string to cell
+ Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
+ if( xText.is() )
+ mxInlineStr->convert( xText, maCurrCell.mnXfId );
+ }
+ else
+ {
+ // empty cell, update cell type
+ maCurrCell.mnCellType = XML_TOKEN_INVALID;
+ }
+ }
+
+ // store the cell formatting data
+ setCellFormat( maCurrCell );
}
}
-ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SHEETDATA:
+ case BIFF12_ID_SHEETDATA:
switch( nRecId )
{
- case OOBIN_ID_ROW: importRow( rStrm ); return this;
+ case BIFF12_ID_ROW: importRow( rStrm ); return this;
}
break;
- case OOBIN_ID_ROW:
+ case BIFF12_ID_ROW:
switch( nRecId )
{
- case OOBIN_ID_ARRAY: importArray( rStrm ); break;
- case OOBIN_ID_CELL_BOOL: importCellBool( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_BLANK: importCellBlank( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_ERROR: importCellError( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_RK: importCellRk( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_RSTRING: importCellRString( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_SI: importCellSi( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_STRING: importCellString( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_DATATABLE: importDataTable( rStrm ); break;
- case OOBIN_ID_FORMULA_BOOL: importCellBool( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_DOUBLE: importCellDouble( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_ERROR: importCellError( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_STRING: importCellString( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_MULTCELL_BOOL: importCellBool( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_BLANK: importCellBlank( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_ERROR: importCellError( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_RK: importCellRk( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_RSTRING: importCellRString( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_SI: importCellSi( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_STRING: importCellString( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
+ case BIFF12_ID_ARRAY: importArray( rStrm ); break;
+ case BIFF12_ID_CELL_BOOL: importCellBool( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_BLANK: importCellBlank( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_ERROR: importCellError( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_RK: importCellRk( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_RSTRING: importCellRString( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_SI: importCellSi( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_STRING: importCellString( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF12_ID_FORMULA_BOOL: importCellBool( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_DOUBLE: importCellDouble( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_ERROR: importCellError( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_STRING: importCellString( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_MULTCELL_BOOL: importCellBool( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_BLANK: importCellBlank( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_ERROR: importCellError( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_RK: importCellRk( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_RSTRING:importCellRString( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_SI: importCellSi( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_STRING: importCellString( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
}
@@ -338,7 +329,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId,
// private --------------------------------------------------------------------
-void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
+void SheetDataContext::importRow( const AttributeList& rAttribs )
{
RowModel aModel;
aModel.mnFirstRow = aModel.mnLastRow = rAttribs.getInteger( XML_r, -1 );
@@ -356,7 +347,7 @@ void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
setRowModel( aModel );
}
-void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
+void SheetDataContext::importCell( const AttributeList& rAttribs )
{
maCurrCell.reset();
maCurrCell.mxCell = getCell( rAttribs.getString( XML_r, OUString() ), &maCurrCell.maAddress );
@@ -370,7 +361,7 @@ void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
extendUsedArea( maCurrCell.maAddress );
}
-void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
+void SheetDataContext::importFormula( const AttributeList& rAttribs )
{
maCurrCell.maFormulaRef = rAttribs.getString( XML_ref, OUString() );
maCurrCell.mnFormulaType = rAttribs.getToken( XML_t, XML_normal );
@@ -383,7 +374,7 @@ void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
maTableData.mbRef2Deleted = rAttribs.getBool( XML_del2, false );
}
-void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellHeader( SequenceInputStream& rStrm, CellType eCellType )
{
maCurrCell.reset();
@@ -399,14 +390,14 @@ void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType e
maCurrCell.mxCell = getCell( maCurrPos, &maCurrCell.maAddress );
maCurrCell.mnXfId = extractValue< sal_Int32 >( nXfId, 0, 24 );
- maCurrCell.mbShowPhonetic = getFlag( nXfId, OOBIN_CELL_SHOWPHONETIC );
+ maCurrCell.mbShowPhonetic = getFlag( nXfId, BIFF12_CELL_SHOWPHONETIC );
// update used area of the sheet
if( maCurrCell.mxCell.is() )
extendUsedArea( maCurrCell.maAddress );
}
-void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBool( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_b;
@@ -427,14 +418,14 @@ void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCe
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBlank( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellBlank - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellBlank - no formula cells supported" );
importCellHeader( rStrm, eCellType );
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellDouble( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_n;
@@ -449,7 +440,7 @@ void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType e
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellError( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_e;
@@ -464,9 +455,9 @@ void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eC
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRk( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRk - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRk - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -474,9 +465,9 @@ void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCell
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRString( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRString - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRString - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_inlineStr;
Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
@@ -490,9 +481,9 @@ void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellSi( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellSi - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellSi - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_s;
if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -500,7 +491,7 @@ void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCell
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellString( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_inlineStr;
@@ -518,7 +509,7 @@ void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType e
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
+void SheetDataContext::importCellFormula( SequenceInputStream& rStrm )
{
rStrm.skip( 2 );
Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
@@ -529,7 +520,7 @@ void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
}
}
-void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
+void SheetDataContext::importRow( SequenceInputStream& rStrm )
{
RowModel aModel;
@@ -537,23 +528,23 @@ void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
sal_uInt8 nFlags2;
rStrm >> maCurrPos.mnRow >> aModel.mnXfId >> nHeight >> nFlags1 >> nFlags2;
- // row index is 0-based in OOBIN, but RowModel expects 1-based
+ // row index is 0-based in BIFF12, but RowModel expects 1-based
aModel.mnFirstRow = aModel.mnLastRow = maCurrPos.mnRow + 1;
- // row height is in twips in OOBIN, convert to points
+ // row height is in twips in BIFF12, convert to points
aModel.mfHeight = nHeight / 20.0;
aModel.mnLevel = extractValue< sal_Int32 >( nFlags1, 8, 3 );
- aModel.mbCustomHeight = getFlag( nFlags1, OOBIN_ROW_CUSTOMHEIGHT );
- aModel.mbCustomFormat = getFlag( nFlags1, OOBIN_ROW_CUSTOMFORMAT );
- aModel.mbShowPhonetic = getFlag( nFlags2, OOBIN_ROW_SHOWPHONETIC );
- aModel.mbHidden = getFlag( nFlags1, OOBIN_ROW_HIDDEN );
- aModel.mbCollapsed = getFlag( nFlags1, OOBIN_ROW_COLLAPSED );
- aModel.mbThickTop = getFlag( nFlags1, OOBIN_ROW_THICKTOP );
- aModel.mbThickBottom = getFlag( nFlags1, OOBIN_ROW_THICKBOTTOM );
+ aModel.mbCustomHeight = getFlag( nFlags1, BIFF12_ROW_CUSTOMHEIGHT );
+ aModel.mbCustomFormat = getFlag( nFlags1, BIFF12_ROW_CUSTOMFORMAT );
+ aModel.mbShowPhonetic = getFlag( nFlags2, BIFF12_ROW_SHOWPHONETIC );
+ aModel.mbHidden = getFlag( nFlags1, BIFF12_ROW_HIDDEN );
+ aModel.mbCollapsed = getFlag( nFlags1, BIFF12_ROW_COLLAPSED );
+ aModel.mbThickTop = getFlag( nFlags1, BIFF12_ROW_THICKTOP );
+ aModel.mbThickBottom = getFlag( nFlags1, BIFF12_ROW_THICKBOTTOM );
// set row properties in the current sheet
setRowModel( aModel );
}
-void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
+void SheetDataContext::importArray( SequenceInputStream& rStrm )
{
BinRange aRange;
rStrm >> aRange;
@@ -568,12 +559,12 @@ void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
}
}
-void OoxSheetDataContext::importSharedFmla( RecordInputStream& rStrm )
+void SheetDataContext::importSharedFmla( SequenceInputStream& rStrm )
{
getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
}
-void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
+void SheetDataContext::importDataTable( SequenceInputStream& rStrm )
{
BinRange aRange;
rStrm >> aRange;
@@ -586,18 +577,18 @@ void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
rStrm >> aRef1 >> aRef2 >> nFlags;
aModel.maRef1 = FormulaProcessorBase::generateAddress2dString( aRef1, false );
aModel.maRef2 = FormulaProcessorBase::generateAddress2dString( aRef2, false );
- aModel.mbRowTable = getFlag( nFlags, OOBIN_DATATABLE_ROW );
- aModel.mb2dTable = getFlag( nFlags, OOBIN_DATATABLE_2D );
- aModel.mbRef1Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF1DEL );
- aModel.mbRef2Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF2DEL );
+ aModel.mbRowTable = getFlag( nFlags, BIFF12_DATATABLE_ROW );
+ aModel.mb2dTable = getFlag( nFlags, BIFF12_DATATABLE_2D );
+ aModel.mbRef1Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF1DEL );
+ aModel.mbRef2Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF2DEL );
setTableOperation( aTableRange, aModel );
}
}
// ============================================================================
-BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent ) :
- BiffWorksheetContextBase( rParent ),
+BiffSheetDataContext::BiffSheetDataContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
mnBiff2XfId( 0 )
{
mnArrayIgnoreSize = (getBiff() == BIFF2) ? 1 : ((getBiff() <= BIFF4) ? 2 : 6);
@@ -621,80 +612,80 @@ BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rPa
}
}
-void BiffSheetDataContext::importRecord()
+void BiffSheetDataContext::importRecord( BiffInputStream& rStrm )
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
case BIFF2_ID_ARRAY: // #i72713#
- case BIFF3_ID_ARRAY: importArray(); break;
+ case BIFF3_ID_ARRAY: importArray( rStrm ); break;
case BIFF2_ID_BLANK:
- case BIFF3_ID_BLANK: importBlank(); break;
+ case BIFF3_ID_BLANK: importBlank( rStrm ); break;
case BIFF2_ID_BOOLERR:
- case BIFF3_ID_BOOLERR: importBoolErr(); break;
- case BIFF2_ID_INTEGER: importInteger(); break;
- case BIFF_ID_IXFE: mrStrm >> mnBiff2XfId; break;
+ case BIFF3_ID_BOOLERR: importBoolErr( rStrm ); break;
+ case BIFF2_ID_INTEGER: importInteger( rStrm ); break;
+ case BIFF_ID_IXFE: rStrm >> mnBiff2XfId; break;
case BIFF2_ID_LABEL:
- case BIFF3_ID_LABEL: importLabel(); break;
+ case BIFF3_ID_LABEL: importLabel( rStrm ); break;
case BIFF2_ID_NUMBER:
- case BIFF3_ID_NUMBER: importNumber(); break;
- case BIFF_ID_RK: importRk(); break;
+ case BIFF3_ID_NUMBER: importNumber( rStrm ); break;
+ case BIFF_ID_RK: importRk( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_DATATABLE: importDataTable(); break;
- case BIFF2_ID_DATATABLE2: importDataTable(); break;
- case BIFF2_ID_FORMULA: importFormula(); break;
- case BIFF2_ID_ROW: importRow(); break;
+ case BIFF2_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF2_ID_DATATABLE2: importDataTable( rStrm ); break;
+ case BIFF2_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF2_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
- case BIFF3_ID_FORMULA: importFormula(); break;
- case BIFF3_ID_ROW: importRow(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF3_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
- case BIFF4_ID_FORMULA: importFormula(); break;
- case BIFF3_ID_ROW: importRow(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF4_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
case BIFF3_ID_FORMULA:
case BIFF4_ID_FORMULA:
- case BIFF5_ID_FORMULA: importFormula(); break;
- case BIFF_ID_MULTBLANK: importMultBlank(); break;
- case BIFF_ID_MULTRK: importMultRk(); break;
- case BIFF3_ID_ROW: importRow(); break;
- case BIFF_ID_RSTRING: importLabel(); break;
- case BIFF_ID_SHAREDFMLA: importSharedFmla(); break;
+ case BIFF5_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF_ID_MULTBLANK: importMultBlank( rStrm ); break;
+ case BIFF_ID_MULTRK: importMultRk( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
+ case BIFF_ID_RSTRING: importLabel( rStrm ); break;
+ case BIFF_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
case BIFF3_ID_FORMULA:
case BIFF4_ID_FORMULA:
- case BIFF5_ID_FORMULA: importFormula(); break;
- case BIFF_ID_LABELSST: importLabelSst(); break;
- case BIFF_ID_MULTBLANK: importMultBlank(); break;
- case BIFF_ID_MULTRK: importMultRk(); break;
- case BIFF3_ID_ROW: importRow(); break;
- case BIFF_ID_RSTRING: importLabel(); break;
- case BIFF_ID_SHAREDFMLA: importSharedFmla(); break;
+ case BIFF5_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF_ID_LABELSST: importLabelSst( rStrm ); break;
+ case BIFF_ID_MULTBLANK: importMultBlank( rStrm ); break;
+ case BIFF_ID_MULTRK: importMultRk( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
+ case BIFF_ID_RSTRING: importLabel( rStrm ); break;
+ case BIFF_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
@@ -714,44 +705,44 @@ void BiffSheetDataContext::setCurrCell( const BinAddress& rAddr )
extendUsedArea( maCurrCell.maAddress );
}
-void BiffSheetDataContext::importXfId( bool bBiff2 )
+void BiffSheetDataContext::importXfId( BiffInputStream& rStrm, bool bBiff2 )
{
if( bBiff2 )
{
sal_uInt8 nBiff2XfId;
- mrStrm >> nBiff2XfId;
- mrStrm.skip( 2 );
+ rStrm >> nBiff2XfId;
+ rStrm.skip( 2 );
maCurrCell.mnXfId = nBiff2XfId & BIFF2_XF_MASK;
if( maCurrCell.mnXfId == BIFF2_XF_EXTENDED_IDS )
maCurrCell.mnXfId = mnBiff2XfId;
}
else
{
- maCurrCell.mnXfId = mrStrm.readuInt16();
+ maCurrCell.mnXfId = rStrm.readuInt16();
}
}
-void BiffSheetDataContext::importCellHeader( bool bBiff2 )
+void BiffSheetDataContext::importCellHeader( BiffInputStream& rStrm, bool bBiff2 )
{
BinAddress aAddr;
- mrStrm >> aAddr;
+ rStrm >> aAddr;
setCurrCell( aAddr );
- importXfId( bBiff2 );
+ importXfId( rStrm, bBiff2 );
}
-void BiffSheetDataContext::importBlank()
+void BiffSheetDataContext::importBlank( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_BLANK );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BLANK );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importBoolErr()
+void BiffSheetDataContext::importBoolErr( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_BOOLERR );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BOOLERR );
if( maCurrCell.mxCell.is() )
{
sal_uInt8 nValue, nType;
- mrStrm >> nValue >> nType;
+ rStrm >> nValue >> nType;
switch( nType )
{
case BIFF_BOOLERR_BOOL:
@@ -771,33 +762,33 @@ void BiffSheetDataContext::importBoolErr()
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importFormula()
+void BiffSheetDataContext::importFormula( BiffInputStream& rStrm )
{
- importCellHeader( getBiff() == BIFF2 );
+ importCellHeader( rStrm, getBiff() == BIFF2 );
maCurrCell.mnCellType = XML_n;
Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
if( xTokens.is() )
{
- mrStrm.skip( mnFormulaIgnoreSize );
+ rStrm.skip( mnFormulaIgnoreSize );
ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
- getFormulaParser().importFormula( aContext, mrStrm );
+ getFormulaParser().importFormula( aContext, rStrm );
}
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importInteger()
+void BiffSheetDataContext::importInteger( BiffInputStream& rStrm )
{
- importCellHeader( true );
+ importCellHeader( rStrm, true );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( mrStrm.readuInt16() );
+ maCurrCell.mxCell->setValue( rStrm.readuInt16() );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importLabel()
+void BiffSheetDataContext::importLabel( BiffInputStream& rStrm )
{
- bool bBiff2Xf = mrStrm.getRecId() == BIFF2_ID_LABEL;
- importCellHeader( bBiff2Xf );
+ bool bBiff2Xf = rStrm.getRecId() == BIFF2_ID_LABEL;
+ importCellHeader( rStrm, bBiff2Xf );
maCurrCell.mnCellType = XML_inlineStr;
Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
if( xText.is() )
@@ -812,7 +803,7 @@ void BiffSheetDataContext::importLabel()
RichString aString( *this );
if( getBiff() == BIFF8 )
{
- aString.importUniString( mrStrm );
+ aString.importUniString( rStrm );
}
else
{
@@ -821,8 +812,8 @@ void BiffSheetDataContext::importLabel()
if( const Font* pFont = getStyles().getFontFromCellXf( maCurrCell.mnXfId ).get() )
eTextEnc = pFont->getFontEncoding();
BiffStringFlags nFlags = bBiff2Xf ? BIFF_STR_8BITLENGTH : BIFF_STR_DEFAULT;
- setFlag( nFlags, BIFF_STR_EXTRAFONTS, mrStrm.getRecId() == BIFF_ID_RSTRING );
- aString.importByteString( mrStrm, eTextEnc, nFlags );
+ setFlag( nFlags, BIFF_STR_EXTRAFONTS, rStrm.getRecId() == BIFF_ID_RSTRING );
+ aString.importByteString( rStrm, eTextEnc, nFlags );
}
aString.finalizeImport();
aString.convert( xText, maCurrCell.mnXfId );
@@ -830,81 +821,81 @@ void BiffSheetDataContext::importLabel()
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importLabelSst()
+void BiffSheetDataContext::importLabelSst( BiffInputStream& rStrm )
{
- importCellHeader( false );
+ importCellHeader( rStrm, false );
maCurrCell.mnCellType = XML_s;
if( maCurrCell.mxCell.is() )
- setSharedStringCell( maCurrCell.mxCell, mrStrm.readInt32(), maCurrCell.mnXfId );
+ setSharedStringCell( maCurrCell.mxCell, rStrm.readInt32(), maCurrCell.mnXfId );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importMultBlank()
+void BiffSheetDataContext::importMultBlank( BiffInputStream& rStrm )
{
BinAddress aAddr;
- for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+ for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
{
setCurrCell( aAddr );
- importXfId( false );
+ importXfId( rStrm, false );
setCellFormat( maCurrCell );
}
}
-void BiffSheetDataContext::importMultRk()
+void BiffSheetDataContext::importMultRk( BiffInputStream& rStrm )
{
BinAddress aAddr;
- for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+ for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
{
setCurrCell( aAddr );
maCurrCell.mnCellType = XML_n;
- importXfId( false );
- sal_Int32 nRkValue = mrStrm.readInt32();
+ importXfId( rStrm, false );
+ sal_Int32 nRkValue = rStrm.readInt32();
if( maCurrCell.mxCell.is() )
maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( nRkValue ) );
setCellFormat( maCurrCell );
}
}
-void BiffSheetDataContext::importNumber()
+void BiffSheetDataContext::importNumber( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_NUMBER );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_NUMBER );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( mrStrm.readDouble() );
+ maCurrCell.mxCell->setValue( rStrm.readDouble() );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importRk()
+void BiffSheetDataContext::importRk( BiffInputStream& rStrm )
{
- importCellHeader( false );
+ importCellHeader( rStrm, false );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( mrStrm.readInt32() ) );
+ maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( rStrm.readInt32() ) );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importRow()
+void BiffSheetDataContext::importRow( BiffInputStream& rStrm )
{
RowModel aModel;
sal_uInt16 nRow, nHeight;
- mrStrm >> nRow;
- mrStrm.skip( 4 );
- mrStrm >> nHeight;
+ rStrm >> nRow;
+ rStrm.skip( 4 );
+ rStrm >> nHeight;
if( getBiff() == BIFF2 )
{
- mrStrm.skip( 2 );
- aModel.mbCustomFormat = mrStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
+ rStrm.skip( 2 );
+ aModel.mbCustomFormat = rStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
if( aModel.mbCustomFormat )
{
- mrStrm.skip( 5 );
- aModel.mnXfId = mrStrm.readuInt16();
+ rStrm.skip( 5 );
+ aModel.mnXfId = rStrm.readuInt16();
}
}
else
{
- mrStrm.skip( 4 );
- sal_uInt32 nFlags = mrStrm.readuInt32();
+ rStrm.skip( 4 );
+ sal_uInt32 nFlags = rStrm.readuInt32();
aModel.mnXfId = extractValue< sal_Int32 >( nFlags, 16, 12 );
aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 0, 3 );
aModel.mbCustomFormat = getFlag( nFlags, BIFF_ROW_CUSTOMFORMAT );
@@ -924,52 +915,52 @@ void BiffSheetDataContext::importRow()
setRowModel( aModel );
}
-void BiffSheetDataContext::importArray()
+void BiffSheetDataContext::importArray( BiffInputStream& rStrm )
{
BinRange aRange;
- aRange.read( mrStrm, false ); // columns always 8-bit
+ aRange.read( rStrm, false ); // columns always 8-bit
CellRangeAddress aArrayRange;
Reference< XCellRange > xRange = getCellRange( aRange, &aArrayRange );
Reference< XArrayFormulaTokens > xTokens( xRange, UNO_QUERY );
if( xRange.is() && xTokens.is() )
{
- mrStrm.skip( mnArrayIgnoreSize );
+ rStrm.skip( mnArrayIgnoreSize );
ArrayFormulaContext aContext( xTokens, aArrayRange );
- getFormulaParser().importFormula( aContext, mrStrm );
+ getFormulaParser().importFormula( aContext, rStrm );
}
}
-void BiffSheetDataContext::importSharedFmla()
+void BiffSheetDataContext::importSharedFmla( BiffInputStream& rStrm )
{
- getSharedFormulas().importSharedFmla( mrStrm, maCurrCell.maAddress );
+ getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
}
-void BiffSheetDataContext::importDataTable()
+void BiffSheetDataContext::importDataTable( BiffInputStream& rStrm )
{
BinRange aRange;
- aRange.read( mrStrm, false ); // columns always 8-bit
+ aRange.read( rStrm, false ); // columns always 8-bit
CellRangeAddress aTableRange;
if( getAddressConverter().convertToCellRange( aTableRange, aRange, getSheetIndex(), true, true ) )
{
DataTableModel aModel;
BinAddress aRef1, aRef2;
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
case BIFF2_ID_DATATABLE:
- mrStrm.skip( 1 );
- aModel.mbRowTable = mrStrm.readuInt8() != 0;
+ rStrm.skip( 1 );
+ aModel.mbRowTable = rStrm.readuInt8() != 0;
aModel.mb2dTable = false;
- mrStrm >> aRef1;
+ rStrm >> aRef1;
break;
case BIFF2_ID_DATATABLE2:
- mrStrm.skip( 2 );
+ rStrm.skip( 2 );
aModel.mb2dTable = true;
- mrStrm >> aRef1 >> aRef2;
+ rStrm >> aRef1 >> aRef2;
break;
case BIFF3_ID_DATATABLE:
{
sal_uInt16 nFlags;
- mrStrm >> nFlags >> aRef1 >> aRef2;
+ rStrm >> nFlags >> aRef1 >> aRef2;
aModel.mbRowTable = getFlag( nFlags, BIFF_DATATABLE_ROW );
aModel.mb2dTable = getFlag( nFlags, BIFF_DATATABLE_2D );
aModel.mbRef1Deleted = getFlag( nFlags, BIFF_DATATABLE_REF1DEL );
@@ -989,4 +980,3 @@ void BiffSheetDataContext::importDataTable()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index 5a149961c0e2..56c26d8b9f67 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -26,8 +26,7 @@
************************************************************************/
#include "oox/xls/stylesbuffer.hxx"
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
+
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/FontFamily.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
@@ -38,56 +37,51 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XFont2.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XText.hpp>
#include <rtl/tencinfo.h>
#include <rtl/ustrbuf.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/condformatbuffer.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::awt::FontDescriptor;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::XFont2;
-using ::com::sun::star::table::BorderLine;
-using ::com::sun::star::table::TableBorder;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::style::XStyle;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
// OOXML constants ------------------------------------------------------------
-// OOX predefined color indexes (also used in BIFF3-BIFF8)
-const sal_Int32 OOX_COLOR_USEROFFSET = 0; /// First user defined color in palette (OOX).
-const sal_Int32 BIFF_COLOR_USEROFFSET = 8; /// First user defined color in palette (BIFF).
+// OOXML predefined color indexes (also used in BIFF3-BIFF8)
+const sal_Int32 OOX_COLOR_USEROFFSET = 0; /// First user defined color in palette (OOXML/BIFF12).
+const sal_Int32 BIFF_COLOR_USEROFFSET = 8; /// First user defined color in palette (BIFF3-BIFF8).
-// OOX font family (also used in BIFF)
+// OOXML font family (also used in BIFF)
const sal_Int32 OOX_FONTFAMILY_NONE = 0;
const sal_Int32 OOX_FONTFAMILY_ROMAN = 1;
const sal_Int32 OOX_FONTFAMILY_SWISS = 2;
@@ -95,102 +89,102 @@ const sal_Int32 OOX_FONTFAMILY_MODERN = 3;
const sal_Int32 OOX_FONTFAMILY_SCRIPT = 4;
const sal_Int32 OOX_FONTFAMILY_DECORATIVE = 5;
-// OOX cell text direction (also used in BIFF)
+// OOXML cell text direction (also used in BIFF)
const sal_Int32 OOX_XF_TEXTDIR_CONTEXT = 0;
const sal_Int32 OOX_XF_TEXTDIR_LTR = 1;
const sal_Int32 OOX_XF_TEXTDIR_RTL = 2;
-// OOX cell rotation (also used in BIFF)
+// OOXML cell rotation (also used in BIFF)
const sal_Int32 OOX_XF_ROTATION_NONE = 0;
const sal_Int32 OOX_XF_ROTATION_90CCW = 90;
const sal_Int32 OOX_XF_ROTATION_90CW = 180;
const sal_Int32 OOX_XF_ROTATION_STACKED = 255;
-// OOX cell indentation
+// OOXML cell indentation
const sal_Int32 OOX_XF_INDENT_NONE = 0;
-// OOX built-in cell styles (also used in BIFF)
+// OOXML built-in cell styles (also used in BIFF)
const sal_Int32 OOX_STYLE_NORMAL = 0; /// Default cell style.
const sal_Int32 OOX_STYLE_ROWLEVEL = 1; /// RowLevel_x cell style.
const sal_Int32 OOX_STYLE_COLLEVEL = 2; /// ColLevel_x cell style.
const sal_Int32 OOX_STYLE_LEVELCOUNT = 7; /// Number of outline level styles.
-// OOBIN constants ------------------------------------------------------------
-
-// OOBIN color types
-const sal_uInt8 OOBIN_COLOR_AUTO = 0;
-const sal_uInt8 OOBIN_COLOR_INDEXED = 1;
-const sal_uInt8 OOBIN_COLOR_RGB = 2;
-const sal_uInt8 OOBIN_COLOR_THEME = 3;
-
-// OOBIN diagonal borders
-const sal_uInt8 OOBIN_BORDER_DIAG_TLBR = 0x01; /// Top-left to bottom-right.
-const sal_uInt8 OOBIN_BORDER_DIAG_BLTR = 0x02; /// Bottom-left to top-right.
-
-// OOBIN gradient fill
-const sal_Int32 OOBIN_FILL_GRADIENT = 40;
-
-// OOBIN XF flags
-const sal_uInt32 OOBIN_XF_WRAPTEXT = 0x00400000;
-const sal_uInt32 OOBIN_XF_JUSTLASTLINE = 0x00800000;
-const sal_uInt32 OOBIN_XF_SHRINK = 0x01000000;
-const sal_uInt32 OOBIN_XF_LOCKED = 0x10000000;
-const sal_uInt32 OOBIN_XF_HIDDEN = 0x20000000;
-
-// OOBIN XF attribute used flags
-const sal_uInt16 OOBIN_XF_NUMFMT_USED = 0x0001;
-const sal_uInt16 OOBIN_XF_FONT_USED = 0x0002;
-const sal_uInt16 OOBIN_XF_ALIGN_USED = 0x0004;
-const sal_uInt16 OOBIN_XF_BORDER_USED = 0x0008;
-const sal_uInt16 OOBIN_XF_AREA_USED = 0x0010;
-const sal_uInt16 OOBIN_XF_PROT_USED = 0x0020;
-
-// OOBIN DXF constants
-const sal_uInt16 OOBIN_DXF_FILL_PATTERN = 0;
-const sal_uInt16 OOBIN_DXF_FILL_FGCOLOR = 1;
-const sal_uInt16 OOBIN_DXF_FILL_BGCOLOR = 2;
-const sal_uInt16 OOBIN_DXF_FILL_GRADIENT = 3;
-const sal_uInt16 OOBIN_DXF_FILL_STOP = 4;
-const sal_uInt16 OOBIN_DXF_FONT_COLOR = 5;
-const sal_uInt16 OOBIN_DXF_BORDER_TOP = 6;
-const sal_uInt16 OOBIN_DXF_BORDER_BOTTOM = 7;
-const sal_uInt16 OOBIN_DXF_BORDER_LEFT = 8;
-const sal_uInt16 OOBIN_DXF_BORDER_RIGHT = 9;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAG = 10;
-const sal_uInt16 OOBIN_DXF_BORDER_VERT = 11;
-const sal_uInt16 OOBIN_DXF_BORDER_HOR = 12;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGUP = 13;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGDOWN = 14;
-const sal_uInt16 OOBIN_DXF_FONT_NAME = 24;
-const sal_uInt16 OOBIN_DXF_FONT_WEIGHT = 25;
-const sal_uInt16 OOBIN_DXF_FONT_UNDERLINE = 26;
-const sal_uInt16 OOBIN_DXF_FONT_ESCAPEMENT = 27;
-const sal_uInt16 OOBIN_DXF_FONT_ITALIC = 28;
-const sal_uInt16 OOBIN_DXF_FONT_STRIKE = 29;
-const sal_uInt16 OOBIN_DXF_FONT_OUTLINE = 30;
-const sal_uInt16 OOBIN_DXF_FONT_SHADOW = 31;
-const sal_uInt16 OOBIN_DXF_FONT_CONDENSE = 32;
-const sal_uInt16 OOBIN_DXF_FONT_EXTEND = 33;
-const sal_uInt16 OOBIN_DXF_FONT_CHARSET = 34;
-const sal_uInt16 OOBIN_DXF_FONT_FAMILY = 35;
-const sal_uInt16 OOBIN_DXF_FONT_HEIGHT = 36;
-const sal_uInt16 OOBIN_DXF_FONT_SCHEME = 37;
-const sal_uInt16 OOBIN_DXF_NUMFMT_CODE = 38;
-const sal_uInt16 OOBIN_DXF_NUMFMT_ID = 41;
-
-// OOBIN CELLSTYLE flags
-const sal_uInt16 OOBIN_CELLSTYLE_BUILTIN = 0x0001;
-const sal_uInt16 OOBIN_CELLSTYLE_HIDDEN = 0x0002;
-const sal_uInt16 OOBIN_CELLSTYLE_CUSTOM = 0x0004;
-
-// OOBIN and BIFF constants ---------------------------------------------------
+// BIFF12 constants -----------------------------------------------------------
+
+// BIFF12 color types
+const sal_uInt8 BIFF12_COLOR_AUTO = 0;
+const sal_uInt8 BIFF12_COLOR_INDEXED = 1;
+const sal_uInt8 BIFF12_COLOR_RGB = 2;
+const sal_uInt8 BIFF12_COLOR_THEME = 3;
+
+// BIFF12 diagonal borders
+const sal_uInt8 BIFF12_BORDER_DIAG_TLBR = 0x01; /// Top-left to bottom-right.
+const sal_uInt8 BIFF12_BORDER_DIAG_BLTR = 0x02; /// Bottom-left to top-right.
+
+// BIFF12 gradient fill
+const sal_Int32 BIFF12_FILL_GRADIENT = 40;
+
+// BIFF12 XF flags
+const sal_uInt32 BIFF12_XF_WRAPTEXT = 0x00400000;
+const sal_uInt32 BIFF12_XF_JUSTLASTLINE = 0x00800000;
+const sal_uInt32 BIFF12_XF_SHRINK = 0x01000000;
+const sal_uInt32 BIFF12_XF_LOCKED = 0x10000000;
+const sal_uInt32 BIFF12_XF_HIDDEN = 0x20000000;
+
+// BIFF12 XF attribute used flags
+const sal_uInt16 BIFF12_XF_NUMFMT_USED = 0x0001;
+const sal_uInt16 BIFF12_XF_FONT_USED = 0x0002;
+const sal_uInt16 BIFF12_XF_ALIGN_USED = 0x0004;
+const sal_uInt16 BIFF12_XF_BORDER_USED = 0x0008;
+const sal_uInt16 BIFF12_XF_AREA_USED = 0x0010;
+const sal_uInt16 BIFF12_XF_PROT_USED = 0x0020;
+
+// BIFF12 DXF constants
+const sal_uInt16 BIFF12_DXF_FILL_PATTERN = 0;
+const sal_uInt16 BIFF12_DXF_FILL_FGCOLOR = 1;
+const sal_uInt16 BIFF12_DXF_FILL_BGCOLOR = 2;
+const sal_uInt16 BIFF12_DXF_FILL_GRADIENT = 3;
+const sal_uInt16 BIFF12_DXF_FILL_STOP = 4;
+const sal_uInt16 BIFF12_DXF_FONT_COLOR = 5;
+const sal_uInt16 BIFF12_DXF_BORDER_TOP = 6;
+const sal_uInt16 BIFF12_DXF_BORDER_BOTTOM = 7;
+const sal_uInt16 BIFF12_DXF_BORDER_LEFT = 8;
+const sal_uInt16 BIFF12_DXF_BORDER_RIGHT = 9;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAG = 10;
+const sal_uInt16 BIFF12_DXF_BORDER_VERT = 11;
+const sal_uInt16 BIFF12_DXF_BORDER_HOR = 12;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGUP = 13;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGDOWN = 14;
+const sal_uInt16 BIFF12_DXF_FONT_NAME = 24;
+const sal_uInt16 BIFF12_DXF_FONT_WEIGHT = 25;
+const sal_uInt16 BIFF12_DXF_FONT_UNDERLINE = 26;
+const sal_uInt16 BIFF12_DXF_FONT_ESCAPEMENT = 27;
+const sal_uInt16 BIFF12_DXF_FONT_ITALIC = 28;
+const sal_uInt16 BIFF12_DXF_FONT_STRIKE = 29;
+const sal_uInt16 BIFF12_DXF_FONT_OUTLINE = 30;
+const sal_uInt16 BIFF12_DXF_FONT_SHADOW = 31;
+const sal_uInt16 BIFF12_DXF_FONT_CONDENSE = 32;
+const sal_uInt16 BIFF12_DXF_FONT_EXTEND = 33;
+const sal_uInt16 BIFF12_DXF_FONT_CHARSET = 34;
+const sal_uInt16 BIFF12_DXF_FONT_FAMILY = 35;
+const sal_uInt16 BIFF12_DXF_FONT_HEIGHT = 36;
+const sal_uInt16 BIFF12_DXF_FONT_SCHEME = 37;
+const sal_uInt16 BIFF12_DXF_NUMFMT_CODE = 38;
+const sal_uInt16 BIFF12_DXF_NUMFMT_ID = 41;
+
+// BIFF12 CELLSTYLE flags
+const sal_uInt16 BIFF12_CELLSTYLE_BUILTIN = 0x0001;
+const sal_uInt16 BIFF12_CELLSTYLE_HIDDEN = 0x0002;
+const sal_uInt16 BIFF12_CELLSTYLE_CUSTOM = 0x0004;
+
+// BIFF constants -------------------------------------------------------------
// BIFF predefined color indexes
const sal_uInt16 BIFF2_COLOR_BLACK = 0; /// Black (text) in BIFF2.
const sal_uInt16 BIFF2_COLOR_WHITE = 1; /// White (background) in BIFF2.
-// BIFF font flags, also used in OOBIN
+// BIFF font flags, also used in BIFF12
const sal_uInt16 BIFF_FONTFLAG_BOLD = 0x0001;
const sal_uInt16 BIFF_FONTFLAG_ITALIC = 0x0002;
const sal_uInt16 BIFF_FONTFLAG_UNDERLINE = 0x0004;
@@ -202,7 +196,7 @@ const sal_uInt16 BIFF_FONTFLAG_CONDENSE = 0x0040;
// BIFF font weight
const sal_uInt16 BIFF_FONTWEIGHT_BOLD = 450;
-// BIFF font underline, also used in OOBIN
+// BIFF font underline, also used in BIFF12
const sal_uInt8 BIFF_FONTUNDERL_NONE = 0;
const sal_uInt8 BIFF_FONTUNDERL_SINGLE = 1;
const sal_uInt8 BIFF_FONTUNDERL_DOUBLE = 2;
@@ -306,14 +300,14 @@ sal_Int32 lclReadRgbColor( BinaryInputStream& rStrm )
// ============================================================================
ExcelGraphicHelper::ExcelGraphicHelper( const WorkbookHelper& rHelper ) :
- GraphicHelper( rHelper.getGlobalFactory(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ),
+ GraphicHelper( rHelper.getBaseFilter().getComponentContext(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ),
WorkbookHelper( rHelper )
{
}
sal_Int32 ExcelGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
{
- if( getFilterType() == FILTER_OOX )
+ if( getFilterType() == FILTER_OOXML )
return getTheme().getColorByToken( nToken );
return GraphicHelper::getSchemeColor( nToken );
}
@@ -372,7 +366,7 @@ void Color::importColor( const AttributeList& rAttribs )
}
}
-void Color::importColor( RecordInputStream& rStrm )
+void Color::importColor( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags, nIndex;
sal_Int16 nTint;
@@ -387,18 +381,18 @@ void Color::importColor( RecordInputStream& rStrm )
switch( extractValue< sal_uInt8 >( nFlags, 1, 7 ) )
{
- case OOBIN_COLOR_AUTO:
+ case BIFF12_COLOR_AUTO:
setAuto();
rStrm.skip( 4 );
break;
- case OOBIN_COLOR_INDEXED:
+ case BIFF12_COLOR_INDEXED:
setIndexed( nIndex, fTint );
rStrm.skip( 4 );
break;
- case OOBIN_COLOR_RGB:
+ case BIFF12_COLOR_RGB:
setRgb( lclReadRgbColor( rStrm ), fTint );
break;
- case OOBIN_COLOR_THEME:
+ case BIFF12_COLOR_THEME:
setTheme( nIndex, fTint );
rStrm.skip( 4 );
break;
@@ -409,12 +403,12 @@ void Color::importColor( RecordInputStream& rStrm )
}
}
-void Color::importColorId( RecordInputStream& rStrm )
+void Color::importColorId( SequenceInputStream& rStrm )
{
setIndexed( rStrm.readInt32() );
}
-void Color::importColorRgb( RecordInputStream& rStrm )
+void Color::importColorRgb( SequenceInputStream& rStrm )
{
setRgb( lclReadRgbColor( rStrm ) );
}
@@ -429,7 +423,7 @@ void Color::importColorRgb( BiffInputStream& rStrm )
setRgb( lclReadRgbColor( rStrm ) );
}
-RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor )
+SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor )
{
orColor.importColor( rStrm );
return rStrm;
@@ -473,7 +467,7 @@ static const sal_Int32 spnDefColors5[] =
/* 56 */ 0x1D2FBE, 0x286676, 0x004500, 0x453E01, 0x6A2813, 0x85396A, 0x4A3285, 0x424242
};
-/** Default color table for BIFF8/OOX. */
+/** Default color table for BIFF8/BIFF12/OOXML. */
static const sal_Int32 spnDefColors8[] =
{
/* 0 */ PALETTE_EGA_COLORS_LIGHT,
@@ -499,7 +493,7 @@ ColorPalette::ColorPalette( const WorkbookHelper& rHelper ) :
// default colors
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
maColors.insert( maColors.begin(), spnDefColors8, STATIC_ARRAY_END( spnDefColors8 ) );
mnAppendIndex = OOX_COLOR_USEROFFSET;
break;
@@ -524,7 +518,7 @@ void ColorPalette::importPaletteColor( const AttributeList& rAttribs )
appendColor( rAttribs.getIntegerHex( XML_rgb, API_RGB_WHITE ) );
}
-void ColorPalette::importPaletteColor( RecordInputStream& rStrm )
+void ColorPalette::importPaletteColor( SequenceInputStream& rStrm )
{
sal_Int32 nRgb = lclReadRgbColor( rStrm );
appendColor( nRgb & 0xFFFFFF );
@@ -545,6 +539,18 @@ void ColorPalette::importPalette( BiffInputStream& rStrm )
}
}
+void ColorPalette::importPalette( const Any& rPalette )
+{
+ Sequence< sal_Int32 > rColorSeq;
+ if( (rPalette >>= rColorSeq) && rColorSeq.hasElements() )
+ {
+ const sal_Int32* pnColor = rColorSeq.getConstArray();
+ const sal_Int32* pnColorEnd = pnColor + rColorSeq.getLength();
+ for( ; pnColor < pnColorEnd; ++pnColor )
+ appendColor( *pnColor & 0xFFFFFF );
+ }
+}
+
sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const
{
sal_Int32 nColor = API_RGB_TRANSPARENT;
@@ -617,7 +623,7 @@ FontModel::FontModel() :
{
}
-void FontModel::setBinScheme( sal_uInt8 nScheme )
+void FontModel::setBiff12Scheme( sal_uInt8 nScheme )
{
static const sal_Int32 spnSchemes[] = { XML_none, XML_major, XML_minor };
mnScheme = STATIC_ARRAY_SELECT( spnSchemes, nScheme, XML_none );
@@ -785,7 +791,7 @@ void Font::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
}
}
-void Font::importFont( RecordInputStream& rStrm )
+void Font::importFont( SequenceInputStream& rStrm )
{
OSL_ENSURE( !mbDxf, "Font::importFont - unexpected conditional formatting flag" );
@@ -795,71 +801,71 @@ void Font::importFont( RecordInputStream& rStrm )
rStrm.skip( 1 );
rStrm >> maModel.maColor >> nScheme >> maModel.maName;
- // equal constants in BIFF and OOBIN for weight, underline, and escapement
- maModel.setBinScheme( nScheme );
+ // equal constants in all BIFFs for weight, underline, and escapement
+ maModel.setBiff12Scheme( nScheme );
maModel.setBiffHeight( nHeight );
maModel.setBiffWeight( nWeight );
maModel.setBiffUnderline( nUnderline );
maModel.setBiffEscapement( nEscapement );
maModel.mnFamily = nFamily;
maModel.mnCharSet = nCharSet;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
maModel.mbItalic = getFlag( nFlags, BIFF_FONTFLAG_ITALIC );
maModel.mbStrikeout = getFlag( nFlags, BIFF_FONTFLAG_STRIKEOUT );
maModel.mbOutline = getFlag( nFlags, BIFF_FONTFLAG_OUTLINE );
maModel.mbShadow = getFlag( nFlags, BIFF_FONTFLAG_SHADOW );
}
-void Font::importDxfName( RecordInputStream& rStrm )
+void Font::importDxfName( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfName - missing conditional formatting flag" );
- maModel.maName = rStrm.readString( false );
+ maModel.maName = BiffHelper::readString( rStrm, false );
maUsedFlags.mbColorUsed = true;
}
-void Font::importDxfColor( RecordInputStream& rStrm )
+void Font::importDxfColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfColor - missing conditional formatting flag" );
rStrm >> maModel.maColor;
maUsedFlags.mbColorUsed = true;
}
-void Font::importDxfScheme( RecordInputStream& rStrm )
+void Font::importDxfScheme( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfScheme - missing conditional formatting flag" );
- maModel.setBinScheme( rStrm.readuInt8() );
+ maModel.setBiff12Scheme( rStrm.readuInt8() );
maUsedFlags.mbSchemeUsed = true;
}
-void Font::importDxfHeight( RecordInputStream& rStrm )
+void Font::importDxfHeight( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfHeight - missing conditional formatting flag" );
maModel.setBiffHeight( rStrm.readuInt16() );
maUsedFlags.mbHeightUsed = true;
}
-void Font::importDxfWeight( RecordInputStream& rStrm )
+void Font::importDxfWeight( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfWeight - missing conditional formatting flag" );
maModel.setBiffWeight( rStrm.readuInt16() );
maUsedFlags.mbWeightUsed = true;
}
-void Font::importDxfUnderline( RecordInputStream& rStrm )
+void Font::importDxfUnderline( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfUnderline - missing conditional formatting flag" );
maModel.setBiffUnderline( rStrm.readuInt16() );
maUsedFlags.mbUnderlineUsed = true;
}
-void Font::importDxfEscapement( RecordInputStream& rStrm )
+void Font::importDxfEscapement( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfEscapement - missing conditional formatting flag" );
maModel.setBiffEscapement( rStrm.readuInt16() );
maUsedFlags.mbEscapementUsed = true;
}
-void Font::importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm )
+void Font::importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfFlag - missing conditional formatting flag" );
bool bFlag = rStrm.readuInt8() != 0;
@@ -1039,7 +1045,8 @@ void Font::finalizeImport()
// supported script types
if( maUsedFlags.mbNameUsed )
{
- Reference< XDevice > xDevice = getReferenceDevice();
+ PropertySet aDocProps( getDocument() );
+ Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
if( xDevice.is() )
{
Reference< XFont2 > xFont( xDevice->getFont( maApiData.maDesc ), UNO_QUERY );
@@ -1226,7 +1233,7 @@ AlignmentModel::AlignmentModel() :
{
}
-void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
+void AlignmentModel::setBiffHorAlign( sal_uInt8 nHorAlign )
{
static const sal_Int32 spnHorAligns[] = {
XML_general, XML_left, XML_center, XML_right,
@@ -1234,14 +1241,14 @@ void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
mnHorAlign = STATIC_ARRAY_SELECT( spnHorAligns, nHorAlign, XML_general );
}
-void AlignmentModel::setBinVerAlign( sal_uInt8 nVerAlign )
+void AlignmentModel::setBiffVerAlign( sal_uInt8 nVerAlign )
{
static const sal_Int32 spnVerAligns[] = {
XML_top, XML_center, XML_bottom, XML_justify, XML_distributed };
mnVerAlign = STATIC_ARRAY_SELECT( spnVerAligns, nVerAlign, XML_bottom );
}
-void AlignmentModel::setBinTextOrient( sal_uInt8 nTextOrient )
+void AlignmentModel::setBiffTextOrient( sal_uInt8 nTextOrient )
{
static const sal_Int32 spnRotations[] = {
OOX_XF_ROTATION_NONE, OOX_XF_ROTATION_STACKED,
@@ -1295,49 +1302,49 @@ void Alignment::importAlignment( const AttributeList& rAttribs )
maModel.mbJustLastLine = rAttribs.getBool( XML_justifyLastLine, false );
}
-void Alignment::setBinData( sal_uInt32 nFlags )
+void Alignment::setBiff12Data( sal_uInt32 nFlags )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
maModel.mnTextDir = extractValue< sal_Int32 >( nFlags, 26, 2 );
maModel.mnRotation = extractValue< sal_Int32 >( nFlags, 0, 8 );
maModel.mnIndent = extractValue< sal_uInt8 >( nFlags, 8, 8 );
- maModel.mbWrapText = getFlag( nFlags, OOBIN_XF_WRAPTEXT );
- maModel.mbShrink = getFlag( nFlags, OOBIN_XF_SHRINK );
- maModel.mbJustLastLine = getFlag( nFlags, OOBIN_XF_JUSTLASTLINE );
+ maModel.mbWrapText = getFlag( nFlags, BIFF12_XF_WRAPTEXT );
+ maModel.mbShrink = getFlag( nFlags, BIFF12_XF_SHRINK );
+ maModel.mbJustLastLine = getFlag( nFlags, BIFF12_XF_JUSTLASTLINE );
}
void Alignment::setBiff2Data( sal_uInt8 nFlags )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
}
void Alignment::setBiff3Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT ); // new in BIFF3
}
void Alignment::setBiff4Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
- maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
+ maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
}
void Alignment::setBiff5Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
- maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+ maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
}
void Alignment::setBiff8Data( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
maModel.mnTextDir = extractValue< sal_Int32 >( nMiscAttrib, 6, 2 ); // new in BIFF8
maModel.mnRotation = extractValue< sal_Int32 >( nAlign, 8, 8 ); // new in BIFF8
maModel.mnIndent = extractValue< sal_uInt8 >( nMiscAttrib, 0, 4 ); // new in BIFF8
@@ -1375,11 +1382,11 @@ void Alignment::finalizeImport()
}
/* indentation: expressed as number of blocks of 3 space characters in
- OOX, and as multiple of 10 points in BIFF. */
+ OOXML/BIFF12, and as multiple of 10 points in BIFF8. */
sal_Int32 nIndent = 0;
switch( getFilterType() )
{
- case FILTER_OOX: nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE ); break;
+ case FILTER_OOXML: nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE ); break;
case FILTER_BIFF: nIndent = getUnitConverter().scaleToMm100( 10.0 * maModel.mnIndent, UNIT_POINT ); break;
case FILTER_UNKNOWN: break;
}
@@ -1459,10 +1466,10 @@ void Protection::importProtection( const AttributeList& rAttribs )
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
}
-void Protection::setBinData( sal_uInt32 nFlags )
+void Protection::setBiff12Data( sal_uInt32 nFlags )
{
- maModel.mbLocked = getFlag( nFlags, OOBIN_XF_LOCKED );
- maModel.mbHidden = getFlag( nFlags, OOBIN_XF_HIDDEN );
+ maModel.mbLocked = getFlag( nFlags, BIFF12_XF_LOCKED );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_XF_HIDDEN );
}
void Protection::setBiff2Data( sal_uInt8 nNumFmt )
@@ -1645,11 +1652,11 @@ void Border::importColor( sal_Int32 nElement, const AttributeList& rAttribs )
pBorderLine->maColor.importColor( rAttribs );
}
-void Border::importBorder( RecordInputStream& rStrm )
+void Border::importBorder( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags = rStrm.readuInt8();
- maModel.mbDiagTLtoBR = getFlag( nFlags, OOBIN_BORDER_DIAG_TLBR );
- maModel.mbDiagBLtoTR = getFlag( nFlags, OOBIN_BORDER_DIAG_BLTR );
+ maModel.mbDiagTLtoBR = getFlag( nFlags, BIFF12_BORDER_DIAG_TLBR );
+ maModel.mbDiagBLtoTR = getFlag( nFlags, BIFF12_BORDER_DIAG_BLTR );
maModel.maTop.setBiffStyle( rStrm.readuInt16() );
rStrm >> maModel.maTop.maColor;
maModel.maBottom.setBiffStyle( rStrm.readuInt16() );
@@ -1662,7 +1669,7 @@ void Border::importBorder( RecordInputStream& rStrm )
rStrm >> maModel.maDiagonal.maColor;
}
-void Border::importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm )
+void Border::importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Border::importDxfBorder - missing conditional formatting flag" );
if( BorderLineModel* pBorderLine = getBorderLine( nElement ) )
@@ -1823,7 +1830,7 @@ PatternFillModel::PatternFillModel( bool bDxf ) :
maFillColor.setIndexed( OOX_COLOR_WINDOWBACK );
}
-void PatternFillModel::setBinPattern( sal_Int32 nPattern )
+void PatternFillModel::setBiffPattern( sal_Int32 nPattern )
{
static const sal_Int32 spnPatternIds[] = {
XML_none, XML_solid, XML_mediumGray, XML_darkGray,
@@ -1838,8 +1845,8 @@ void PatternFillModel::setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillCo
{
maPatternColor.setIndexed( nPatternColor );
maFillColor.setIndexed( nFillColor );
- // patterns equal in BIFF and OOBIN
- setBinPattern( nPattern );
+ // patterns equal in all BIFFs
+ setBiffPattern( nPattern );
}
// ----------------------------------------------------------------------------
@@ -1854,7 +1861,7 @@ GradientFillModel::GradientFillModel() :
{
}
-void GradientFillModel::readGradient( RecordInputStream& rStrm )
+void GradientFillModel::readGradient( SequenceInputStream& rStrm )
{
sal_Int32 nType;
rStrm >> nType >> mfAngle >> mfLeft >> mfRight >> mfTop >> mfBottom;
@@ -1862,7 +1869,7 @@ void GradientFillModel::readGradient( RecordInputStream& rStrm )
mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID );
}
-void GradientFillModel::readGradientStop( RecordInputStream& rStrm, bool bDxf )
+void GradientFillModel::readGradientStop( SequenceInputStream& rStrm, bool bDxf )
{
Color aColor;
double fPosition;
@@ -1969,11 +1976,11 @@ void Fill::importColor( const AttributeList& rAttribs, double fPosition )
mxGradientModel->maColors[ fPosition ].importColor( rAttribs );
}
-void Fill::importFill( RecordInputStream& rStrm )
+void Fill::importFill( SequenceInputStream& rStrm )
{
OSL_ENSURE( !mbDxf, "Fill::importFill - unexpected conditional formatting flag" );
sal_Int32 nPattern = rStrm.readInt32();
- if( nPattern == OOBIN_FILL_GRADIENT )
+ if( nPattern == BIFF12_FILL_GRADIENT )
{
mxGradientModel.reset( new GradientFillModel );
sal_Int32 nStopCount;
@@ -1986,21 +1993,21 @@ void Fill::importFill( RecordInputStream& rStrm )
else
{
mxPatternModel.reset( new PatternFillModel( mbDxf ) );
- mxPatternModel->setBinPattern( nPattern );
+ mxPatternModel->setBiffPattern( nPattern );
rStrm >> mxPatternModel->maPatternColor >> mxPatternModel->maFillColor;
}
}
-void Fill::importDxfPattern( RecordInputStream& rStrm )
+void Fill::importDxfPattern( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfPattern - missing conditional formatting flag" );
if( !mxPatternModel )
mxPatternModel.reset( new PatternFillModel( mbDxf ) );
- mxPatternModel->setBinPattern( rStrm.readuInt8() );
+ mxPatternModel->setBiffPattern( rStrm.readuInt8() );
mxPatternModel->mbPatternUsed = true;
}
-void Fill::importDxfFgColor( RecordInputStream& rStrm )
+void Fill::importDxfFgColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfFgColor - missing conditional formatting flag" );
if( !mxPatternModel )
@@ -2009,7 +2016,7 @@ void Fill::importDxfFgColor( RecordInputStream& rStrm )
mxPatternModel->mbPattColorUsed = true;
}
-void Fill::importDxfBgColor( RecordInputStream& rStrm )
+void Fill::importDxfBgColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfBgColor - missing conditional formatting flag" );
if( !mxPatternModel )
@@ -2018,7 +2025,7 @@ void Fill::importDxfBgColor( RecordInputStream& rStrm )
mxPatternModel->mbFillColorUsed = true;
}
-void Fill::importDxfGradient( RecordInputStream& rStrm )
+void Fill::importDxfGradient( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfGradient - missing conditional formatting flag" );
if( !mxGradientModel )
@@ -2026,7 +2033,7 @@ void Fill::importDxfGradient( RecordInputStream& rStrm )
mxGradientModel->readGradient( rStrm );
}
-void Fill::importDxfStop( RecordInputStream& rStrm )
+void Fill::importDxfStop( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfStop - missing conditional formatting flag" );
if( !mxGradientModel )
@@ -2096,7 +2103,7 @@ void Fill::finalizeImport()
if( mxPatternModel.get() )
{
- // finalize the OOX data struct
+ // finalize the OOXML data struct
PatternFillModel& rModel = *mxPatternModel;
if( mbDxf )
{
@@ -2248,7 +2255,7 @@ void Xf::importProtection( const AttributeList& rAttribs )
maProtection.importProtection( rAttribs );
}
-void Xf::importXf( RecordInputStream& rStrm, bool bCellXf )
+void Xf::importXf( SequenceInputStream& rStrm, bool bCellXf )
{
maModel.mbCellXf = bCellXf;
maModel.mnStyleXfId = rStrm.readuInt16();
@@ -2257,16 +2264,16 @@ void Xf::importXf( RecordInputStream& rStrm, bool bCellXf )
maModel.mnFillId = rStrm.readuInt16();
maModel.mnBorderId = rStrm.readuInt16();
sal_uInt32 nFlags = rStrm.readuInt32();
- maAlignment.setBinData( nFlags );
- maProtection.setBinData( nFlags );
+ maAlignment.setBiff12Data( nFlags );
+ maProtection.setBiff12Data( nFlags );
// used flags, see comments in Xf::setBiffUsedFlags()
sal_uInt16 nUsedFlags = rStrm.readuInt16();
- maModel.mbFontUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_FONT_USED );
- maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_NUMFMT_USED );
- maModel.mbAlignUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_ALIGN_USED );
- maModel.mbProtUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_PROT_USED );
- maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_BORDER_USED );
- maModel.mbAreaUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_AREA_USED );
+ maModel.mbFontUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_FONT_USED );
+ maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_NUMFMT_USED );
+ maModel.mbAlignUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_ALIGN_USED );
+ maModel.mbProtUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_PROT_USED );
+ maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_BORDER_USED );
+ maModel.mbAreaUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_AREA_USED );
}
void Xf::importXf( BiffInputStream& rStrm )
@@ -2539,7 +2546,7 @@ void Dxf::importProtection( const AttributeList& rAttribs )
mxProtection->importProtection( rAttribs );
}
-void Dxf::importDxf( RecordInputStream& rStrm )
+void Dxf::importDxf( SequenceInputStream& rStrm )
{
sal_Int32 nNumFmtId = -1;
OUString aFmtCode;
@@ -2554,28 +2561,28 @@ void Dxf::importDxf( RecordInputStream& rStrm )
nRecEnd += nSubRecSize;
switch( nSubRecId )
{
- case OOBIN_DXF_FILL_PATTERN: createFill( false )->importDxfPattern( rStrm ); break;
- case OOBIN_DXF_FILL_FGCOLOR: createFill( false )->importDxfFgColor( rStrm ); break;
- case OOBIN_DXF_FILL_BGCOLOR: createFill( false )->importDxfBgColor( rStrm ); break;
- case OOBIN_DXF_FILL_GRADIENT: createFill( false )->importDxfGradient( rStrm ); break;
- case OOBIN_DXF_FILL_STOP: createFill( false )->importDxfStop( rStrm ); break;
- case OOBIN_DXF_FONT_COLOR: createFont( false )->importDxfColor( rStrm ); break;
- case OOBIN_DXF_BORDER_TOP: createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm ); break;
- case OOBIN_DXF_BORDER_BOTTOM: createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm ); break;
- case OOBIN_DXF_BORDER_LEFT: createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm ); break;
- case OOBIN_DXF_BORDER_RIGHT: createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm ); break;
- case OOBIN_DXF_FONT_NAME: createFont( false )->importDxfName( rStrm ); break;
- case OOBIN_DXF_FONT_WEIGHT: createFont( false )->importDxfWeight( rStrm ); break;
- case OOBIN_DXF_FONT_UNDERLINE: createFont( false )->importDxfUnderline( rStrm ); break;
- case OOBIN_DXF_FONT_ESCAPEMENT: createFont( false )->importDxfEscapement( rStrm ); break;
- case OOBIN_DXF_FONT_ITALIC: createFont( false )->importDxfFlag( XML_i, rStrm ); break;
- case OOBIN_DXF_FONT_STRIKE: createFont( false )->importDxfFlag( XML_strike, rStrm ); break;
- case OOBIN_DXF_FONT_OUTLINE: createFont( false )->importDxfFlag( XML_outline, rStrm ); break;
- case OOBIN_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break;
- case OOBIN_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break;
- case OOBIN_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break;
- case OOBIN_DXF_NUMFMT_CODE: aFmtCode = rStrm.readString( false ); break;
- case OOBIN_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break;
+ case BIFF12_DXF_FILL_PATTERN: createFill( false )->importDxfPattern( rStrm ); break;
+ case BIFF12_DXF_FILL_FGCOLOR: createFill( false )->importDxfFgColor( rStrm ); break;
+ case BIFF12_DXF_FILL_BGCOLOR: createFill( false )->importDxfBgColor( rStrm ); break;
+ case BIFF12_DXF_FILL_GRADIENT: createFill( false )->importDxfGradient( rStrm ); break;
+ case BIFF12_DXF_FILL_STOP: createFill( false )->importDxfStop( rStrm ); break;
+ case BIFF12_DXF_FONT_COLOR: createFont( false )->importDxfColor( rStrm ); break;
+ case BIFF12_DXF_BORDER_TOP: createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm ); break;
+ case BIFF12_DXF_BORDER_BOTTOM: createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm ); break;
+ case BIFF12_DXF_BORDER_LEFT: createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm ); break;
+ case BIFF12_DXF_BORDER_RIGHT: createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm ); break;
+ case BIFF12_DXF_FONT_NAME: createFont( false )->importDxfName( rStrm ); break;
+ case BIFF12_DXF_FONT_WEIGHT: createFont( false )->importDxfWeight( rStrm ); break;
+ case BIFF12_DXF_FONT_UNDERLINE: createFont( false )->importDxfUnderline( rStrm ); break;
+ case BIFF12_DXF_FONT_ESCAPEMENT: createFont( false )->importDxfEscapement( rStrm ); break;
+ case BIFF12_DXF_FONT_ITALIC: createFont( false )->importDxfFlag( XML_i, rStrm ); break;
+ case BIFF12_DXF_FONT_STRIKE: createFont( false )->importDxfFlag( XML_strike, rStrm ); break;
+ case BIFF12_DXF_FONT_OUTLINE: createFont( false )->importDxfFlag( XML_outline, rStrm ); break;
+ case BIFF12_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break;
+ case BIFF12_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break;
+ case BIFF12_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break;
+ case BIFF12_DXF_NUMFMT_CODE: aFmtCode = BiffHelper::readString( rStrm, false ); break;
+ case BIFF12_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break;
}
rStrm.seek( nRecEnd );
}
@@ -2844,16 +2851,16 @@ void CellStyle::importCellStyle( const AttributeList& rAttribs )
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
}
-void CellStyle::importCellStyle( RecordInputStream& rStrm )
+void CellStyle::importCellStyle( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> maModel.mnXfId >> nFlags;
maModel.mnBuiltinId = rStrm.readInt8();
maModel.mnLevel = rStrm.readInt8();
rStrm >> maModel.maName;
- maModel.mbBuiltin = getFlag( nFlags, OOBIN_CELLSTYLE_BUILTIN );
- maModel.mbCustom = getFlag( nFlags, OOBIN_CELLSTYLE_CUSTOM );
- maModel.mbHidden = getFlag( nFlags, OOBIN_CELLSTYLE_HIDDEN );
+ maModel.mbBuiltin = getFlag( nFlags, BIFF12_CELLSTYLE_BUILTIN );
+ maModel.mbCustom = getFlag( nFlags, BIFF12_CELLSTYLE_CUSTOM );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_CELLSTYLE_HIDDEN );
}
void CellStyle::importStyle( BiffInputStream& rStrm )
@@ -2945,7 +2952,7 @@ CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs )
return xCellStyle;
}
-CellStyleRef CellStyleBuffer::importCellStyle( RecordInputStream& rStrm )
+CellStyleRef CellStyleBuffer::importCellStyle( SequenceInputStream& rStrm )
{
CellStyleRef xCellStyle( new CellStyle( *this ) );
xCellStyle->importCellStyle( rStrm );
@@ -3093,6 +3100,19 @@ OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) con
// ============================================================================
+AutoFormatModel::AutoFormatModel() :
+ mnAutoFormatId( 0 ),
+ mbApplyNumFmt( false ),
+ mbApplyFont( false ),
+ mbApplyAlignment( false ),
+ mbApplyBorder( false ),
+ mbApplyFill( false ),
+ mbApplyProtection( false )
+{
+}
+
+// ============================================================================
+
StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
maPalette( rHelper ),
@@ -3169,17 +3189,17 @@ CellStyleRef StylesBuffer::importCellStyle( const AttributeList& rAttribs )
return maCellStyles.importCellStyle( rAttribs );
}
-void StylesBuffer::importPaletteColor( RecordInputStream& rStrm )
+void StylesBuffer::importPaletteColor( SequenceInputStream& rStrm )
{
maPalette.importPaletteColor( rStrm );
}
-void StylesBuffer::importNumFmt( RecordInputStream& rStrm )
+void StylesBuffer::importNumFmt( SequenceInputStream& rStrm )
{
maNumFmts.importNumFmt( rStrm );
}
-void StylesBuffer::importCellStyle( RecordInputStream& rStrm )
+void StylesBuffer::importCellStyle( SequenceInputStream& rStrm )
{
maCellStyles.importCellStyle( rStrm );
}
@@ -3236,6 +3256,11 @@ void StylesBuffer::importStyle( BiffInputStream& rStrm )
maCellStyles.importStyle( rStrm );
}
+void StylesBuffer::importPalette( const Any& rPalette )
+{
+ maPalette.importPalette( rPalette );
+}
+
void StylesBuffer::finalizeImport()
{
// fonts first, are needed to finalize unit converter and XFs below
@@ -3319,7 +3344,7 @@ bool StylesBuffer::equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 ) co
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
// in OOXML, borders are assumed to be unique
return false;
@@ -3344,7 +3369,7 @@ bool StylesBuffer::equalFills( sal_Int32 nFillId1, sal_Int32 nFillId2 ) const
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
// in OOXML, fills are assumed to be unique
return false;
@@ -3444,4 +3469,3 @@ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 n
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx
index 217fce443209..c890196dc518 100644
--- a/oox/source/xls/stylesfragment.cxx
+++ b/oox/source/xls/stylesfragment.cxx
@@ -26,23 +26,26 @@
************************************************************************/
#include "oox/xls/stylesfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/helper/attributelist.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxIndexedColorsContext::OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment ) :
- OoxWorkbookContextBase( rFragment )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+IndexedColorsContext::IndexedColorsContext( WorkbookFragmentBase& rFragment ) :
+ WorkbookContextBase( rFragment )
{
}
-ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef IndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -53,12 +56,12 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_INDEXEDCOLORS:
- if( nRecId == OOBIN_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
+ case BIFF12_ID_INDEXEDCOLORS:
+ if( nRecId == BIFF12_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
break;
}
return 0;
@@ -66,7 +69,7 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRec
// ============================================================================
-ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxFont.get() )
mxFont->importAttribs( nElement, rAttribs );
@@ -75,13 +78,13 @@ ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const Att
// ============================================================================
-void OoxBorderContext::onStartElement( const AttributeList& rAttribs )
+void BorderContext::onStartElement( const AttributeList& rAttribs )
{
if( mxBorder.get() && (getCurrentElement() == XLS_TOKEN( border )) )
mxBorder->importBorder( rAttribs );
}
-ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef BorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxBorder.get() ) switch( getCurrentElement() )
{
@@ -98,7 +101,7 @@ ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const A
// ============================================================================
-ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxFill.get() ) switch( getCurrentElement() )
{
@@ -133,13 +136,13 @@ ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const Att
// ============================================================================
-void OoxXfContext::onStartElement( const AttributeList& rAttribs )
+void XfContext::onStartElement( const AttributeList& rAttribs )
{
if( mxXf.get() && (getCurrentElement() == XLS_TOKEN( xf )) )
mxXf->importXf( rAttribs, mbCellXf );
}
-ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef XfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxXf.get() ) switch( getCurrentElement() )
{
@@ -156,16 +159,16 @@ ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const Attri
// ============================================================================
-ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxDxf.get() ) switch( getCurrentElement() )
{
case XLS_TOKEN( dxf ):
switch( nElement )
{
- case XLS_TOKEN( font ): return new OoxFontContext( *this, mxDxf->createFont() );
- case XLS_TOKEN( border ): return new OoxBorderContext( *this, mxDxf->createBorder() );
- case XLS_TOKEN( fill ): return new OoxFillContext( *this, mxDxf->createFill() );
+ case XLS_TOKEN( font ): return new FontContext( *this, mxDxf->createFont() );
+ case XLS_TOKEN( border ): return new BorderContext( *this, mxDxf->createBorder() );
+ case XLS_TOKEN( fill ): return new FillContext( *this, mxDxf->createFill() );
case XLS_TOKEN( numFmt ): mxDxf->importNumFmt( rAttribs ); break;
#if 0
@@ -180,14 +183,12 @@ ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const Attr
// ============================================================================
-OoxStylesFragment::OoxStylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+StylesFragment::StylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef StylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -211,28 +212,28 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
break;
case XLS_TOKEN( colors ):
- if( nElement == XLS_TOKEN( indexedColors ) ) return new OoxIndexedColorsContext( *this );
+ if( nElement == XLS_TOKEN( indexedColors ) ) return new IndexedColorsContext( *this );
break;
case XLS_TOKEN( numFmts ):
if( nElement == XLS_TOKEN( numFmt ) ) getStyles().importNumFmt( rAttribs );
break;
case XLS_TOKEN( fonts ):
- if( nElement == XLS_TOKEN( font ) ) return new OoxFontContext( *this, getStyles().createFont() );
+ if( nElement == XLS_TOKEN( font ) ) return new FontContext( *this, getStyles().createFont() );
break;
case XLS_TOKEN( borders ):
- if( nElement == XLS_TOKEN( border ) ) return new OoxBorderContext( *this, getStyles().createBorder() );
+ if( nElement == XLS_TOKEN( border ) ) return new BorderContext( *this, getStyles().createBorder() );
break;
case XLS_TOKEN( fills ):
- if( nElement == XLS_TOKEN( fill ) ) return new OoxFillContext( *this, getStyles().createFill() );
+ if( nElement == XLS_TOKEN( fill ) ) return new FillContext( *this, getStyles().createFill() );
break;
case XLS_TOKEN( cellXfs ):
- if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createCellXf(), true );
+ if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createCellXf(), true );
break;
case XLS_TOKEN( cellStyleXfs ):
- if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createStyleXf(), false );
+ if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createStyleXf(), false );
break;
case XLS_TOKEN( dxfs ):
- if( nElement == XLS_TOKEN( dxf ) ) return new OoxDxfContext( *this, getStyles().createDxf() );
+ if( nElement == XLS_TOKEN( dxf ) ) return new DxfContext( *this, getStyles().createDxf() );
break;
case XLS_TOKEN( cellStyles ):
if( nElement == XLS_TOKEN( cellStyle ) ) getStyles().importCellStyle( rAttribs );
@@ -241,85 +242,83 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
return 0;
}
-ContextHandlerRef OoxStylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_STYLESHEET ) return this;
+ if( nRecId == BIFF12_ID_STYLESHEET ) return this;
break;
- case OOBIN_ID_STYLESHEET:
+ case BIFF12_ID_STYLESHEET:
switch( nRecId )
{
- case OOBIN_ID_COLORS:
- case OOBIN_ID_NUMFMTS:
- case OOBIN_ID_FONTS:
- case OOBIN_ID_BORDERS:
- case OOBIN_ID_FILLS:
- case OOBIN_ID_CELLXFS:
- case OOBIN_ID_CELLSTYLEXFS:
- case OOBIN_ID_DXFS:
- case OOBIN_ID_CELLSTYLES: return this;
+ case BIFF12_ID_COLORS:
+ case BIFF12_ID_NUMFMTS:
+ case BIFF12_ID_FONTS:
+ case BIFF12_ID_BORDERS:
+ case BIFF12_ID_FILLS:
+ case BIFF12_ID_CELLXFS:
+ case BIFF12_ID_CELLSTYLEXFS:
+ case BIFF12_ID_DXFS:
+ case BIFF12_ID_CELLSTYLES: return this;
}
break;
- case OOBIN_ID_COLORS:
- if( nRecId == OOBIN_ID_INDEXEDCOLORS ) return new OoxIndexedColorsContext( *this );
+ case BIFF12_ID_COLORS:
+ if( nRecId == BIFF12_ID_INDEXEDCOLORS ) return new IndexedColorsContext( *this );
break;
- case OOBIN_ID_NUMFMTS:
- if( nRecId == OOBIN_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
+ case BIFF12_ID_NUMFMTS:
+ if( nRecId == BIFF12_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
break;
- case OOBIN_ID_FONTS:
- if( nRecId == OOBIN_ID_FONT ) getStyles().createFont()->importFont( rStrm );
+ case BIFF12_ID_FONTS:
+ if( nRecId == BIFF12_ID_FONT ) getStyles().createFont()->importFont( rStrm );
break;
- case OOBIN_ID_BORDERS:
- if( nRecId == OOBIN_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
+ case BIFF12_ID_BORDERS:
+ if( nRecId == BIFF12_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
break;
- case OOBIN_ID_FILLS:
- if( nRecId == OOBIN_ID_FILL ) getStyles().createFill()->importFill( rStrm );
+ case BIFF12_ID_FILLS:
+ if( nRecId == BIFF12_ID_FILL ) getStyles().createFill()->importFill( rStrm );
break;
- case OOBIN_ID_CELLXFS:
- if( nRecId == OOBIN_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
+ case BIFF12_ID_CELLXFS:
+ if( nRecId == BIFF12_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
break;
- case OOBIN_ID_CELLSTYLEXFS:
- if( nRecId == OOBIN_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
+ case BIFF12_ID_CELLSTYLEXFS:
+ if( nRecId == BIFF12_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
break;
- case OOBIN_ID_DXFS:
- if( nRecId == OOBIN_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
+ case BIFF12_ID_DXFS:
+ if( nRecId == BIFF12_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
break;
- case OOBIN_ID_CELLSTYLES:
- if( nRecId == OOBIN_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
+ case BIFF12_ID_CELLSTYLES:
+ if( nRecId == BIFF12_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxStylesFragment::getRecordInfos() const
+const RecordInfo* StylesFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_BORDERS, OOBIN_ID_BORDERS + 1 },
- { OOBIN_ID_CELLSTYLES, OOBIN_ID_CELLSTYLES + 1 },
- { OOBIN_ID_CELLSTYLEXFS, OOBIN_ID_CELLSTYLEXFS + 1 },
- { OOBIN_ID_CELLXFS, OOBIN_ID_CELLXFS + 1 },
- { OOBIN_ID_COLORS, OOBIN_ID_COLORS + 1 },
- { OOBIN_ID_DXFS, OOBIN_ID_DXFS + 1 },
- { OOBIN_ID_FILLS, OOBIN_ID_FILLS + 1 },
- { OOBIN_ID_FONTS, OOBIN_ID_FONTS + 1 },
- { OOBIN_ID_INDEXEDCOLORS, OOBIN_ID_INDEXEDCOLORS + 1 },
- { OOBIN_ID_MRUCOLORS, OOBIN_ID_MRUCOLORS + 1 },
- { OOBIN_ID_NUMFMTS, OOBIN_ID_NUMFMTS + 1 },
- { OOBIN_ID_STYLESHEET, OOBIN_ID_STYLESHEET + 1 },
- { OOBIN_ID_TABLESTYLES, OOBIN_ID_TABLESTYLES + 1 },
+ { BIFF12_ID_BORDERS, BIFF12_ID_BORDERS + 1 },
+ { BIFF12_ID_CELLSTYLES, BIFF12_ID_CELLSTYLES + 1 },
+ { BIFF12_ID_CELLSTYLEXFS, BIFF12_ID_CELLSTYLEXFS + 1 },
+ { BIFF12_ID_CELLXFS, BIFF12_ID_CELLXFS + 1 },
+ { BIFF12_ID_COLORS, BIFF12_ID_COLORS + 1 },
+ { BIFF12_ID_DXFS, BIFF12_ID_DXFS + 1 },
+ { BIFF12_ID_FILLS, BIFF12_ID_FILLS + 1 },
+ { BIFF12_ID_FONTS, BIFF12_ID_FONTS + 1 },
+ { BIFF12_ID_INDEXEDCOLORS, BIFF12_ID_INDEXEDCOLORS + 1 },
+ { BIFF12_ID_MRUCOLORS, BIFF12_ID_MRUCOLORS + 1 },
+ { BIFF12_ID_NUMFMTS, BIFF12_ID_NUMFMTS + 1 },
+ { BIFF12_ID_STYLESHEET, BIFF12_ID_STYLESHEET + 1 },
+ { BIFF12_ID_TABLESTYLES, BIFF12_ID_TABLESTYLES + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxStylesFragment::finalizeImport()
+void StylesFragment::finalizeImport()
{
getStyles().finalizeImport();
}
@@ -328,4 +327,3 @@ void OoxStylesFragment::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx
index 452df7a1171a..91fad31e6ee4 100644
--- a/oox/source/xls/tablebuffer.cxx
+++ b/oox/source/xls/tablebuffer.cxx
@@ -26,28 +26,26 @@
************************************************************************/
#include "oox/xls/tablebuffer.hxx"
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
+
#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XDatabaseRange;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
TableModel::TableModel() :
mnId( -1 ),
mnType( XML_worksheet ),
@@ -60,6 +58,7 @@ TableModel::TableModel() :
Table::Table( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
+ maAutoFilters( rHelper ),
mnTokenIndex( -1 )
{
}
@@ -75,7 +74,7 @@ void Table::importTable( const AttributeList& rAttribs, sal_Int16 nSheet )
maModel.mnTotalsRows = rAttribs.getInteger( XML_totalsRowCount, 0 );
}
-void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
+void Table::importTable( SequenceInputStream& rStrm, sal_Int16 nSheet )
{
BinRange aBinRange;
sal_Int32 nType;
@@ -90,22 +89,20 @@ void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
void Table::finalizeImport()
{
- // validate cell range
- maDestRange = maModel.maRange;
- bool bValidRange = getAddressConverter().validateCellRange( maDestRange, true, true );
-
// create database range
- if( bValidRange && (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try
+ if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try
{
- // find an unused name
- Reference< XDatabaseRanges > xDatabaseRanges = getDatabaseRanges();
- Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW );
- OUString aName = ContainerHelper::getUnusedName( xNameAccess, maModel.maDisplayName, '_' );
- xDatabaseRanges->addNewByName( aName, maModel.maRange );
- Reference< XDatabaseRange > xDatabaseRange( xDatabaseRanges->getByName( aName ), UNO_QUERY_THROW );
+ maDBRangeName = maModel.maDisplayName;
+ Reference< XDatabaseRange > xDatabaseRange( createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW );
+ maDestRange = xDatabaseRange->getDataArea();
+
+ // get formula token index of the database range
PropertySet aPropSet( xDatabaseRange );
if( !aPropSet.getProperty( mnTokenIndex, PROP_TokenIndex ) )
mnTokenIndex = -1;
+
+ // filter settings
+ maAutoFilters.finalizeImport( xDatabaseRange );
}
catch( Exception& )
{
@@ -120,24 +117,19 @@ TableBuffer::TableBuffer( const WorkbookHelper& rHelper ) :
{
}
-TableRef TableBuffer::importTable( const AttributeList& rAttribs, sal_Int16 nSheet )
+Table& TableBuffer::createTable()
{
- TableRef xTable( new Table( *this ) );
- xTable->importTable( rAttribs, nSheet );
- insertTable( xTable );
- return xTable;
-}
-
-TableRef TableBuffer::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
-{
- TableRef xTable( new Table( *this ) );
- xTable->importTable( rStrm, nSheet );
- insertTable( xTable );
- return xTable;
+ TableVector::value_type xTable( new Table( *this ) );
+ maTables.push_back( xTable );
+ return *xTable;
}
void TableBuffer::finalizeImport()
{
+ // map all tables by identifier and display name
+ for( TableVector::iterator aIt = maTables.begin(), aEnd = maTables.end(); aIt != aEnd; ++aIt )
+ insertTableToMaps( *aIt );
+ // finalize all valid tables
maIdTables.forEachMem( &Table::finalizeImport );
}
@@ -153,16 +145,16 @@ TableRef TableBuffer::getTable( const OUString& rDispName ) const
// private --------------------------------------------------------------------
-void TableBuffer::insertTable( TableRef xTable )
+void TableBuffer::insertTableToMaps( const TableRef& rxTable )
{
- sal_Int32 nTableId = xTable->getTableId();
- const OUString& rDispName = xTable->getDisplayName();
+ sal_Int32 nTableId = rxTable->getTableId();
+ const OUString& rDispName = rxTable->getDisplayName();
if( (nTableId > 0) && (rDispName.getLength() > 0) )
{
- OSL_ENSURE( maIdTables.find( nTableId ) == maIdTables.end(), "TableBuffer::insertTable - multiple table identifier" );
- maIdTables[ nTableId ] = xTable;
- OSL_ENSURE( maNameTables.find( rDispName ) == maNameTables.end(), "TableBuffer::insertTable - multiple table name" );
- maNameTables[ rDispName ] = xTable;
+ OSL_ENSURE( !maIdTables.has( nTableId ), "TableBuffer::insertTableToMaps - multiple table identifier" );
+ maIdTables[ nTableId ] = rxTable;
+ OSL_ENSURE( !maNameTables.has( rDispName ), "TableBuffer::insertTableToMaps - multiple table name" );
+ maNameTables[ rDispName ] = rxTable;
}
}
@@ -170,4 +162,3 @@ void TableBuffer::insertTable( TableRef xTable )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx
index 800a45cd9530..37503f8577fb 100644
--- a/oox/source/xls/tablefragment.cxx
+++ b/oox/source/xls/tablefragment.cxx
@@ -27,54 +27,75 @@
#include "oox/xls/tablefragment.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/autofilterbuffer.hxx"
+#include "oox/xls/autofiltercontext.hxx"
+#include "oox/xls/tablebuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxTableFragment::OoxTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+TableFragment::TableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrTable( getTables().createTable() )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
if( nElement == XLS_TOKEN( table ) )
- mxTable = getTables().importTable( rAttribs, getSheetIndex() );
+ {
+ mrTable.importTable( rAttribs, getSheetIndex() );
+ return this;
+ }
+ break;
+ case XLS_TOKEN( table ):
+ if( nElement == XLS_TOKEN( autoFilter ) )
+ return new AutoFilterContext( *this, mrTable.createAutoFilter() );
break;
}
return 0;
}
-ContextHandlerRef OoxTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_TABLE )
- mxTable = getTables().importTable( rStrm, getSheetIndex() );
+ if( nRecId == BIFF12_ID_TABLE )
+ {
+ mrTable.importTable( rStrm, getSheetIndex() );
+ return this;
+ }
+ break;
+ case BIFF12_ID_TABLE:
+ if( nRecId == BIFF12_ID_AUTOFILTER )
+ return new AutoFilterContext( *this, mrTable.createAutoFilter() );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxTableFragment::getRecordInfos() const
+const RecordInfo* TableFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_TABLE, OOBIN_ID_TABLE + 1 },
- { -1, -1 }
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 },
+ { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_TABLE, BIFF12_ID_TABLE + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
@@ -83,4 +104,3 @@ const RecordInfo* OoxTableFragment::getRecordInfos() const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx
index 23617287dc57..c3e016327133 100644
--- a/oox/source/xls/themebuffer.cxx
+++ b/oox/source/xls/themebuffer.cxx
@@ -26,16 +26,18 @@
************************************************************************/
#include "oox/xls/themebuffer.hxx"
-#include "oox/xls/stylesbuffer.hxx"
-#include "tokens.hxx"
-using ::oox::drawingml::ClrScheme;
+#include "oox/xls/stylesbuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
+using ::oox::drawingml::ClrScheme;
+
+// ============================================================================
+
namespace {
/** Specifies default theme fonts for a specific locale. */
@@ -91,7 +93,7 @@ ThemeBuffer::ThemeBuffer( const WorkbookHelper& rHelper ) :
{
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
//! TODO: locale dependent font name
mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" );
mxDefFontModel->mfHeight = 11.0;
@@ -119,4 +121,3 @@ sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx
index 170a1f66f2e2..1b5f1e9b072c 100644
--- a/oox/source/xls/unitconverter.cxx
+++ b/oox/source/xls/unitconverter.cxx
@@ -26,30 +26,31 @@
************************************************************************/
#include "oox/xls/unitconverter.hxx"
-#include <rtl/math.hxx>
+
+#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/XFont.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <rtl/math.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/propertyset.hxx"
#include "oox/xls/stylesbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::FontDescriptor;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::DeviceInfo;
-using ::com::sun::star::awt::XFont;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::DateTime;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const double MM100_PER_INCH = 2540.0;
@@ -132,7 +133,8 @@ UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) :
void UnitConverter::finalizeImport()
{
- Reference< XDevice > xDevice = getReferenceDevice();
+ PropertySet aDocProps( getDocument() );
+ Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
if( xDevice.is() )
{
// get reference device metric first, needed to get character widths below
@@ -255,4 +257,3 @@ double UnitConverter::getCoefficient( Unit eUnit ) const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx
index 05dfa7bf9f96..c9658dd41cf9 100644
--- a/oox/source/xls/viewsettings.cxx
+++ b/oox/source/xls/viewsettings.cxx
@@ -26,128 +26,121 @@
************************************************************************/
#include "oox/xls/viewsettings.hxx"
+
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
-#include <com/sun/star/text/WritingMode2.hpp>
#include <comphelper/mediadescriptor.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::document::XViewDataSupplier;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF = 600; /// Default tabbar ratio.
-const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF = 100; /// Default zoom for normal view.
-const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF = 60; /// Default zoom for pagebreak preview.
-const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF = 100; /// Default zoom for page layout view.
-
-const sal_uInt8 OOBIN_PANE_FROZEN = 0x01;
-const sal_uInt8 OOBIN_PANE_FROZENNOSPLIT = 0x02;
-
-const sal_uInt16 OOBIN_SHEETVIEW_WINPROTECTED = 0x0001;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWFORMULAS = 0x0002;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWGRID = 0x0004;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWHEADINGS = 0x0008;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWZEROS = 0x0010;
-const sal_uInt16 OOBIN_SHEETVIEW_RIGHTTOLEFT = 0x0020;
-const sal_uInt16 OOBIN_SHEETVIEW_SELECTED = 0x0040;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWRULER = 0x0080;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWOUTLINE = 0x0100;
-const sal_uInt16 OOBIN_SHEETVIEW_DEFGRIDCOLOR = 0x0200;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWWHITESPACE = 0x0400;
-
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_SELECTED = 0x0001;
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_ZOOMTOFIT = 0x0002;
-
-const sal_uInt8 OOBIN_WBVIEW_HIDDEN = 0x01;
-const sal_uInt8 OOBIN_WBVIEW_MINIMIZED = 0x02;
-const sal_uInt8 OOBIN_WBVIEW_SHOWHORSCROLL = 0x08;
-const sal_uInt8 OOBIN_WBVIEW_SHOWVERSCROLL = 0x10;
-const sal_uInt8 OOBIN_WBVIEW_SHOWTABBAR = 0x20;
-const sal_uInt8 OOBIN_WBVIEW_AUTOFILTERGROUP = 0x40;
-
-const sal_uInt8 BIFF_PANE_BOTTOMRIGHT = 0; /// Bottom-right pane.
-const sal_uInt8 BIFF_PANE_TOPRIGHT = 1; /// Right, or top-right pane.
-const sal_uInt8 BIFF_PANE_BOTTOMLEFT = 2; /// Bottom, or bottom-left pane.
-const sal_uInt8 BIFF_PANE_TOPLEFT = 3; /// Single, top, left, or top-left pane.
-
-const sal_uInt16 BIFF_WINDOW1_HIDDEN = 0x0001;
-const sal_uInt16 BIFF_WINDOW1_MINIMIZED = 0x0002;
-const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL = 0x0008;
-const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL = 0x0010;
-const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR = 0x0020;
-
-const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS = 0x0001;
-const sal_uInt16 BIFF_WINDOW2_SHOWGRID = 0x0002;
-const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS = 0x0004;
-const sal_uInt16 BIFF_WINDOW2_FROZEN = 0x0008;
-const sal_uInt16 BIFF_WINDOW2_SHOWZEROS = 0x0010;
-const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR = 0x0020;
-const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT = 0x0040;
-const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE = 0x0080;
-const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT = 0x0100;
-const sal_uInt16 BIFF_WINDOW2_SELECTED = 0x0200;
-const sal_uInt16 BIFF_WINDOW2_DISPLAYED = 0x0400;
-const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE = 0x0800;
+const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF = 600; /// Default tabbar ratio.
+const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF = 100; /// Default zoom for normal view.
+const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF = 60; /// Default zoom for pagebreak preview.
+const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF = 100; /// Default zoom for page layout view.
+
+const sal_uInt8 BIFF12_PANE_FROZEN = 0x01;
+const sal_uInt8 BIFF12_PANE_FROZENNOSPLIT = 0x02;
+
+const sal_uInt16 BIFF12_SHEETVIEW_WINPROTECTED = 0x0001;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWFORMULAS = 0x0002;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWGRID = 0x0004;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWHEADINGS = 0x0008;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWZEROS = 0x0010;
+const sal_uInt16 BIFF12_SHEETVIEW_RIGHTTOLEFT = 0x0020;
+const sal_uInt16 BIFF12_SHEETVIEW_SELECTED = 0x0040;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWRULER = 0x0080;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWOUTLINE = 0x0100;
+const sal_uInt16 BIFF12_SHEETVIEW_DEFGRIDCOLOR = 0x0200;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWWHITESPACE = 0x0400;
+
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_SELECTED = 0x0001;
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_ZOOMTOFIT = 0x0002;
+
+const sal_uInt8 BIFF12_WBVIEW_HIDDEN = 0x01;
+const sal_uInt8 BIFF12_WBVIEW_MINIMIZED = 0x02;
+const sal_uInt8 BIFF12_WBVIEW_SHOWHORSCROLL = 0x08;
+const sal_uInt8 BIFF12_WBVIEW_SHOWVERSCROLL = 0x10;
+const sal_uInt8 BIFF12_WBVIEW_SHOWTABBAR = 0x20;
+const sal_uInt8 BIFF12_WBVIEW_AUTOFILTERGROUP = 0x40;
+
+const sal_uInt8 BIFF_PANE_BOTTOMRIGHT = 0; /// Bottom-right pane.
+const sal_uInt8 BIFF_PANE_TOPRIGHT = 1; /// Right, or top-right pane.
+const sal_uInt8 BIFF_PANE_BOTTOMLEFT = 2; /// Bottom, or bottom-left pane.
+const sal_uInt8 BIFF_PANE_TOPLEFT = 3; /// Single, top, left, or top-left pane.
+
+const sal_uInt16 BIFF_WINDOW1_HIDDEN = 0x0001;
+const sal_uInt16 BIFF_WINDOW1_MINIMIZED = 0x0002;
+const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL = 0x0008;
+const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL = 0x0010;
+const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR = 0x0020;
+
+const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS = 0x0001;
+const sal_uInt16 BIFF_WINDOW2_SHOWGRID = 0x0002;
+const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS = 0x0004;
+const sal_uInt16 BIFF_WINDOW2_FROZEN = 0x0008;
+const sal_uInt16 BIFF_WINDOW2_SHOWZEROS = 0x0010;
+const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR = 0x0020;
+const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT = 0x0040;
+const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE = 0x0080;
+const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT = 0x0100;
+const sal_uInt16 BIFF_WINDOW2_SELECTED = 0x0200;
+const sal_uInt16 BIFF_WINDOW2_DISPLAYED = 0x0400;
+const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE = 0x0800;
// Attention: view settings in Calc do not use com.sun.star.view.DocumentZoomType!
-const sal_Int16 API_ZOOMTYPE_PERCENT = 0; /// Zoom value in percent.
+const sal_Int16 API_ZOOMTYPE_PERCENT = 0; /// Zoom value in percent.
-const sal_Int32 API_ZOOMVALUE_MIN = 20; /// Minimum zoom in Calc.
-const sal_Int32 API_ZOOMVALUE_MAX = 400; /// Maximum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MIN = 20; /// Minimum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MAX = 400; /// Maximum zoom in Calc.
// no predefined constants for split mode
-const sal_Int16 API_SPLITMODE_NONE = 0; /// No splits in window.
-const sal_Int16 API_SPLITMODE_SPLIT = 1; /// Window is split.
-const sal_Int16 API_SPLITMODE_FREEZE = 2; /// Window has frozen panes.
+const sal_Int16 API_SPLITMODE_NONE = 0; /// No splits in window.
+const sal_Int16 API_SPLITMODE_SPLIT = 1; /// Window is split.
+const sal_Int16 API_SPLITMODE_FREEZE = 2; /// Window has frozen panes.
// no predefined constants for pane idetifiers
-const sal_Int16 API_SPLITPANE_TOPLEFT = 0; /// Top-left, or top pane.
-const sal_Int16 API_SPLITPANE_TOPRIGHT = 1; /// Top-right pane.
-const sal_Int16 API_SPLITPANE_BOTTOMLEFT = 2; /// Bottom-left, bottom, left, or single pane.
-const sal_Int16 API_SPLITPANE_BOTTOMRIGHT = 3; /// Bottom-right, or right pane.
+const sal_Int16 API_SPLITPANE_TOPLEFT = 0; /// Top-left, or top pane.
+const sal_Int16 API_SPLITPANE_TOPRIGHT = 1; /// Top-right pane.
+const sal_Int16 API_SPLITPANE_BOTTOMLEFT = 2; /// Bottom-left, bottom, left, or single pane.
+const sal_Int16 API_SPLITPANE_BOTTOMRIGHT = 3; /// Bottom-right, or right pane.
// ----------------------------------------------------------------------------
-/** Returns the OOXML pane identifier from the passed OOBIN or BIFF pane id. */
-sal_Int32 lclGetOoxPaneId( sal_Int32 nBinPaneId, sal_Int32 nDefaultPaneId )
+/** Returns the OOXML pane identifier from the passed BIFF pane id. */
+sal_Int32 lclGetOoxPaneId( sal_Int32 nBiffPaneId, sal_Int32 nDefaultPaneId )
{
static const sal_Int32 spnPaneIds[] = { XML_bottomRight, XML_topRight, XML_bottomLeft, XML_topLeft };
- return STATIC_ARRAY_SELECT( spnPaneIds, nBinPaneId, nDefaultPaneId );
+ return STATIC_ARRAY_SELECT( spnPaneIds, nBiffPaneId, nDefaultPaneId );
}
} // namespace
@@ -295,7 +288,7 @@ void SheetViewSettings::importChartSheetView( const AttributeList& rAttribs )
rModel.mbZoomToFit = rAttribs.getBool( XML_zoomToFit, false );
}
-void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
+void SheetViewSettings::importSheetView( SequenceInputStream& rStrm )
{
SheetViewModel& rModel = *createSheetView();
sal_uInt16 nFlags;
@@ -312,17 +305,17 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
rModel.maFirstPos = getAddressConverter().createValidCellAddress( aFirstPos, getSheetIndex(), false );
static const sal_Int32 spnViewTypes[] = { XML_normal, XML_pageBreakPreview, XML_pageLayout };
rModel.mnViewType = STATIC_ARRAY_SELECT( spnViewTypes, nViewType, XML_normal );
- rModel.mbSelected = getFlag( nFlags, OOBIN_SHEETVIEW_SELECTED );
- rModel.mbRightToLeft = getFlag( nFlags, OOBIN_SHEETVIEW_RIGHTTOLEFT );
- rModel.mbDefGridColor = getFlag( nFlags, OOBIN_SHEETVIEW_DEFGRIDCOLOR );
- rModel.mbShowFormulas = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWFORMULAS );
- rModel.mbShowGrid = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWGRID );
- rModel.mbShowHeadings = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWHEADINGS );
- rModel.mbShowZeros = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWZEROS );
- rModel.mbShowOutline = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWOUTLINE );
+ rModel.mbSelected = getFlag( nFlags, BIFF12_SHEETVIEW_SELECTED );
+ rModel.mbRightToLeft = getFlag( nFlags, BIFF12_SHEETVIEW_RIGHTTOLEFT );
+ rModel.mbDefGridColor = getFlag( nFlags, BIFF12_SHEETVIEW_DEFGRIDCOLOR );
+ rModel.mbShowFormulas = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWFORMULAS );
+ rModel.mbShowGrid = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWGRID );
+ rModel.mbShowHeadings = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWHEADINGS );
+ rModel.mbShowZeros = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWZEROS );
+ rModel.mbShowOutline = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWOUTLINE );
}
-void SheetViewSettings::importPane( RecordInputStream& rStrm )
+void SheetViewSettings::importPane( SequenceInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" );
if( !maSheetViews.empty() )
@@ -336,11 +329,11 @@ void SheetViewSettings::importPane( RecordInputStream& rStrm )
rModel.maSecondPos = getAddressConverter().createValidCellAddress( aSecondPos, getSheetIndex(), false );
rModel.mnActivePaneId = lclGetOoxPaneId( nActivePaneId, XML_topLeft );
- rModel.mnPaneState = getFlagValue( nFlags, OOBIN_PANE_FROZEN, getFlagValue( nFlags, OOBIN_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
+ rModel.mnPaneState = getFlagValue( nFlags, BIFF12_PANE_FROZEN, getFlagValue( nFlags, BIFF12_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
}
}
-void SheetViewSettings::importSelection( RecordInputStream& rStrm )
+void SheetViewSettings::importSelection( SequenceInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importSelection - missing sheet view model" );
if( !maSheetViews.empty() )
@@ -360,14 +353,14 @@ void SheetViewSettings::importSelection( RecordInputStream& rStrm )
}
}
-void SheetViewSettings::importChartSheetView( RecordInputStream& rStrm )
+void SheetViewSettings::importChartSheetView( SequenceInputStream& rStrm )
{
SheetViewModel& rModel = *createSheetView();
sal_uInt16 nFlags;
rStrm >> nFlags >> rModel.mnCurrentZoom >> rModel.mnWorkbookViewId;
- rModel.mbSelected = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_SELECTED );
- rModel.mbZoomToFit = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_ZOOMTOFIT );
+ rModel.mbSelected = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_SELECTED );
+ rModel.mbZoomToFit = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_ZOOMTOFIT );
}
void SheetViewSettings::importWindow2( BiffInputStream& rStrm )
@@ -502,13 +495,6 @@ void SheetViewSettings::finalizeImport()
xModel->mbShowOutline = true;
}
- // mirrored sheet (this is not a view setting in Calc)
- if( xModel->mbRightToLeft )
- {
- PropertySet aPropSet( getSheet() );
- aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
- }
-
// sheet selected (active sheet must be selected)
bool bSelected = xModel->mbSelected || (getSheetIndex() == getViewSettings().getActiveCalcSheet());
@@ -599,6 +585,11 @@ void SheetViewSettings::finalizeImport()
getViewSettings().setSheetViewSettings( getSheetIndex(), xModel, Any( aPropMap.makePropertyValueSequence() ) );
}
+bool SheetViewSettings::isSheetRightToLeft() const
+{
+ return !maSheetViews.empty() && maSheetViews.front()->mbRightToLeft;
+}
+
// private --------------------------------------------------------------------
SheetViewModelRef SheetViewSettings::createSheetView()
@@ -657,19 +648,19 @@ void ViewSettings::importOleSize( const AttributeList& rAttribs )
mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aRange, 0, true, false );
}
-void ViewSettings::importWorkbookView( RecordInputStream& rStrm )
+void ViewSettings::importWorkbookView( SequenceInputStream& rStrm )
{
WorkbookViewModel& rModel = createWorkbookView();
sal_uInt8 nFlags;
rStrm >> rModel.mnWinX >> rModel.mnWinY >> rModel.mnWinWidth >> rModel.mnWinHeight >> rModel.mnTabBarWidth >> rModel.mnFirstVisSheet >> rModel.mnActiveSheet >> nFlags;
- rModel.mnVisibility = getFlagValue( nFlags, OOBIN_WBVIEW_HIDDEN, XML_hidden, XML_visible );
- rModel.mbShowTabBar = getFlag( nFlags, OOBIN_WBVIEW_SHOWTABBAR );
- rModel.mbShowHorScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWHORSCROLL );
- rModel.mbShowVerScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWVERSCROLL );
- rModel.mbMinimized = getFlag( nFlags, OOBIN_WBVIEW_MINIMIZED );
+ rModel.mnVisibility = getFlagValue( nFlags, BIFF12_WBVIEW_HIDDEN, XML_hidden, XML_visible );
+ rModel.mbShowTabBar = getFlag( nFlags, BIFF12_WBVIEW_SHOWTABBAR );
+ rModel.mbShowHorScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWHORSCROLL );
+ rModel.mbShowVerScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWVERSCROLL );
+ rModel.mbMinimized = getFlag( nFlags, BIFF12_WBVIEW_MINIMIZED );
}
-void ViewSettings::importOleSize( RecordInputStream& rStrm )
+void ViewSettings::importOleSize( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
diff --git a/oox/source/xls/webquerybuffer.cxx b/oox/source/xls/webquerybuffer.cxx
deleted file mode 100644
index 2babebd4a8d7..000000000000
--- a/oox/source/xls/webquerybuffer.cxx
+++ /dev/null
@@ -1,199 +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 "oox/xls/webquerybuffer.hxx"
-#include "oox/helper/attributelist.hxx"
-
-#define DEBUG_OOX_WEBQUERY_BUFFER 1
-
-#if DEBUG_OOX_WEBQUERY_BUFFER
-#include <stdio.h>
-#endif
-
-using ::rtl::OUString;
-
-namespace oox {
-namespace xls {
-
-const sal_Int32 Connection::CONNECTION_ODBC_SOURCE = 1;
-const sal_Int32 Connection::CONNECTION_DAO_SOURCE = 2;
-const sal_Int32 Connection::CONNECTION_FILE_SOURCE = 3;
-const sal_Int32 Connection::CONNECTION_WEBQUERY = 4;
-const sal_Int32 Connection::CONNECTION_OLEDB_SOURCE = 5;
-const sal_Int32 Connection::CONNECTION_TEXT_SOURCE = 6;
-const sal_Int32 Connection::CONNECTION_ADO_RECORD_SET = 7;
-const sal_Int32 Connection::CONNECTION_DSP = 8;
-
-// ============================================================================
-
-WebQueryBuffer::WebQueryBuffer( const WorkbookHelper& rHelper ) :
- WorkbookHelper( rHelper )
-{
- maQueryTableMap.clear();
-}
-
-void WebQueryBuffer::importQueryTable( const AttributeList& rAttribs )
-{
- OUString aName = rAttribs.getString( XML_name, OUString() );
- if ( !aName.getLength() )
- return;
-
- QueryTable aQTable;
- aQTable.mnConnectionId = rAttribs.getInteger( XML_connectionId, 0 );
-
- maQueryTableMap.insert( QueryTableHashMap::value_type( aName, aQTable ) );
-
- // All documented attributes of queryTable:
- // adjustColumnWidth (bool)
- // applyAlignmentFormats (bool)
- // applyBorderFormats (bool)
- // applyFontFormats (bool)
- // applyNumberFormats (bool)
- // applyPatternFormats (bool)
- // applyWidthHeightFormats (bool)
- // autoFormatId (unsigned int)
- // backgroundRefresh (bool)
- // connectionId (unsigned int)
- // disableEdit (bool)
- // disableRefresh (bool)
- // fillFormulas (bool)
- // firstBackgroundRefresh (bool)
- // growShrinkType (insertClear, insertDelete, overwriteClear)
- // headers (bool)
- // intermediate (bool)
- // name (string)
- // preserveFormatting(bool)
- // refreshOnLoad (bool)
- // removeDataOnSave (bool)
- // rowNumbers (bool)
-}
-
-void WebQueryBuffer::importConnection( const AttributeList& rAttribs )
-{
- if ( !rAttribs.hasAttribute( XML_id ) || !rAttribs.hasAttribute( XML_name ) )
- {
- mnCurConnId = -1;
- return;
- }
-
- sal_uInt32 nId = rAttribs.getUnsigned( XML_id, 0 );
- if ( maConnections.size() < (nId + 1) )
- maConnections.resize(nId + 1);
-
- Connection aConn;
- aConn.maName = rAttribs.getString( XML_name, OUString() );
- aConn.mnType = rAttribs.getInteger( XML_type, 0 );
- maConnections[nId] = aConn;
- mnCurConnId = nId;
-
- // All documented attributes of connection.
- // background (bool)
- // credentials (integrated, none, prompt, stored)
- // deleted (bool)
- // description (string)
- // id (unsigned int)
- // interval (unsigned int)
- // keepAlive (bool)
- // minRefreshableVersion (unsigned byte)
- // name (string)
- // new (bool)
- // odcFile (string)
- // onlyUseConnectionFile (bool)
- // reconnectionMethod (unsigned int)
- // refreshedVersion (unsigned byte)
- // refreshOnLoad (bool)
- // saveData (bool)
- // savePassword (bool)
- // singleSignOnId (string)
- // sourceFile (string)
- // type (unsigned int)
-}
-
-void WebQueryBuffer::importWebPr( const AttributeList& rAttribs )
-{
- if ( 0 > mnCurConnId )
- return;
-
- Connection& rConn = maConnections[mnCurConnId];
- rConn.mpProperties.reset( new WebProperties );
- WebProperties* pWebPr = static_cast< WebProperties* >( rConn.mpProperties.get() );
- pWebPr->maURL = rAttribs.getString( XML_url, OUString() );
-
- // All available attributes:
- // consecutive (bool)
- // editPage (string)
- // firstRow (bool)
- // htmlFormat (all, none, rtf)
- // htmlTables (bool)
- // parsePre (bool)
- // post (string)
- // sourceData (bool)
- // textDates (bool)
- // url (string)
- // xl2000 (bool)
- // xl97 (bool)
- // xml (bool)
-}
-
-void WebQueryBuffer::dump() const
-{
-#if DEBUG_OOX_WEBQUERY_BUFFER
- fprintf(stdout, "----------------------------------------\n");
- {
- using ::std::vector;
- vector< Connection >::const_iterator itr = maConnections.begin(), itrEnd = maConnections.end();
- sal_Int32 nId = 0;
- for (; itr != itrEnd; ++itr, ++nId)
- {
- if ( itr->mnType == Connection::CONNECTION_WEBQUERY )
- {
- WebProperties* pWebPr = static_cast< WebProperties* >( itr->mpProperties.get() );
- fprintf(stdout, "WebQueryBuffer::dump: id = %d url = %s\n",
- (int)nId,
- OUStringToOString(pWebPr->maURL, RTL_TEXTENCODING_UTF8).getStr());
- }
- }
- }
-
- QueryTableHashMap::const_iterator itr = maQueryTableMap.begin(), itrEnd = maQueryTableMap.end();
- for (; itr != itrEnd; ++itr)
- {
- fprintf(stdout, "WebQueryBuffer::dump: name = %s connection ID = %d\n",
- OUStringToOString(itr->first, RTL_TEXTENCODING_UTF8).getStr(),
- (int)(itr->second.mnConnectionId));
- }
-
- fprintf(stdout, "----------------------------------------\n");
- fflush(stdout);
-#endif
-}
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx
index 6e43a32495be..dce3c8eb461e 100644
--- a/oox/source/xls/workbookfragment.cxx
+++ b/oox/source/xls/workbookfragment.cxx
@@ -26,14 +26,14 @@
************************************************************************/
#include "oox/xls/workbookfragment.hxx"
+
#include <com/sun/star/table/CellAddress.hpp>
+#include "oox/core/filterbase.hxx"
+#include "oox/drawingml/themefragmenthandler.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/progressbar.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/ole/olestorage.hxx"
-#include "oox/core/filterbase.hxx"
-#include "oox/drawingml/themefragmenthandler.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/chartsheetfragment.hxx"
#include "oox/xls/connectionsfragment.hxx"
@@ -50,25 +50,21 @@
#include "oox/xls/worksheetbuffer.hxx"
#include "oox/xls/worksheetfragment.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::table::CellAddress;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relation;
-using ::oox::drawingml::ThemeFragmentHandler;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::oox::drawingml::ThemeFragmentHandler;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const double PROGRESS_LENGTH_GLOBALS = 0.1; /// 10% of progress bar for globals import.
@@ -77,15 +73,12 @@ const double PROGRESS_LENGTH_GLOBALS = 0.1; /// 10% of progress bar
// ============================================================================
-OoxWorkbookFragment::OoxWorkbookFragment(
- const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+WorkbookFragment::WorkbookFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -128,108 +121,102 @@ ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-void OoxWorkbookFragment::onEndElement( const OUString& rChars )
+void WorkbookFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( definedName ):
- if( mxCurrName.get() ) mxCurrName->setFormula( rChars );
- break;
- }
+ if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName.get() )
+ mxCurrName->setFormula( rChars );
}
-ContextHandlerRef OoxWorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKBOOK ) return this;
+ if( nRecId == BIFF12_ID_WORKBOOK ) return this;
break;
- case OOBIN_ID_WORKBOOK:
+ case BIFF12_ID_WORKBOOK:
switch( nRecId )
{
- case OOBIN_ID_SHEETS:
- case OOBIN_ID_BOOKVIEWS:
- case OOBIN_ID_EXTERNALREFS:
- case OOBIN_ID_PIVOTCACHES: return this;
-
- case OOBIN_ID_FILESHARING: getWorkbookSettings().importFileSharing( rStrm ); break;
- case OOBIN_ID_WORKBOOKPR: getWorkbookSettings().importWorkbookPr( rStrm ); break;
- case OOBIN_ID_CALCPR: getWorkbookSettings().importCalcPr( rStrm ); break;
- case OOBIN_ID_OLESIZE: getViewSettings().importOleSize( rStrm ); break;
- case OOBIN_ID_DEFINEDNAME: getDefinedNames().importDefinedName( rStrm ); break;
+ case BIFF12_ID_SHEETS:
+ case BIFF12_ID_BOOKVIEWS:
+ case BIFF12_ID_EXTERNALREFS:
+ case BIFF12_ID_PIVOTCACHES: return this;
+
+ case BIFF12_ID_FILESHARING: getWorkbookSettings().importFileSharing( rStrm ); break;
+ case BIFF12_ID_WORKBOOKPR: getWorkbookSettings().importWorkbookPr( rStrm ); break;
+ case BIFF12_ID_CALCPR: getWorkbookSettings().importCalcPr( rStrm ); break;
+ case BIFF12_ID_OLESIZE: getViewSettings().importOleSize( rStrm ); break;
+ case BIFF12_ID_DEFINEDNAME: getDefinedNames().importDefinedName( rStrm ); break;
}
break;
- case OOBIN_ID_SHEETS:
- if( nRecId == OOBIN_ID_SHEET ) getWorksheets().importSheet( rStrm );
+ case BIFF12_ID_SHEETS:
+ if( nRecId == BIFF12_ID_SHEET ) getWorksheets().importSheet( rStrm );
break;
- case OOBIN_ID_BOOKVIEWS:
- if( nRecId == OOBIN_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
+ case BIFF12_ID_BOOKVIEWS:
+ if( nRecId == BIFF12_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
break;
- case OOBIN_ID_EXTERNALREFS:
+ case BIFF12_ID_EXTERNALREFS:
switch( nRecId )
{
- case OOBIN_ID_EXTERNALREF: importExternalRef( rStrm ); break;
- case OOBIN_ID_EXTERNALSELF: getExternalLinks().importExternalSelf( rStrm ); break;
- case OOBIN_ID_EXTERNALSAME: getExternalLinks().importExternalSame( rStrm ); break;
- case OOBIN_ID_EXTERNALADDIN: getExternalLinks().importExternalAddin( rStrm ); break;
- case OOBIN_ID_EXTERNALSHEETS: getExternalLinks().importExternalSheets( rStrm ); break;
+ case BIFF12_ID_EXTERNALREF: importExternalRef( rStrm ); break;
+ case BIFF12_ID_EXTERNALSELF: getExternalLinks().importExternalSelf( rStrm ); break;
+ case BIFF12_ID_EXTERNALSAME: getExternalLinks().importExternalSame( rStrm ); break;
+ case BIFF12_ID_EXTERNALADDIN: getExternalLinks().importExternalAddin( rStrm ); break;
+ case BIFF12_ID_EXTERNALSHEETS: getExternalLinks().importExternalSheets( rStrm ); break;
}
break;
- case OOBIN_ID_PIVOTCACHES:
- if( nRecId == OOBIN_ID_PIVOTCACHE ) importPivotCache( rStrm );
+ case BIFF12_ID_PIVOTCACHES:
+ if( nRecId == BIFF12_ID_PIVOTCACHE ) importPivotCache( rStrm );
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorkbookFragment::getRecordInfos() const
+const RecordInfo* WorkbookFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_BOOKVIEWS, OOBIN_ID_BOOKVIEWS + 1 },
- { OOBIN_ID_EXTERNALREFS, OOBIN_ID_EXTERNALREFS + 1 },
- { OOBIN_ID_FUNCTIONGROUPS, OOBIN_ID_FUNCTIONGROUPS + 2 },
- { OOBIN_ID_PIVOTCACHE, OOBIN_ID_PIVOTCACHE + 1 },
- { OOBIN_ID_PIVOTCACHES, OOBIN_ID_PIVOTCACHES + 1 },
- { OOBIN_ID_SHEETS, OOBIN_ID_SHEETS + 1 },
- { OOBIN_ID_WORKBOOK, OOBIN_ID_WORKBOOK + 1 },
- { -1, -1 }
+ { BIFF12_ID_BOOKVIEWS, BIFF12_ID_BOOKVIEWS + 1 },
+ { BIFF12_ID_EXTERNALREFS, BIFF12_ID_EXTERNALREFS + 1 },
+ { BIFF12_ID_FUNCTIONGROUPS, BIFF12_ID_FUNCTIONGROUPS + 2 },
+ { BIFF12_ID_PIVOTCACHE, BIFF12_ID_PIVOTCACHE + 1 },
+ { BIFF12_ID_PIVOTCACHES, BIFF12_ID_PIVOTCACHES + 1 },
+ { BIFF12_ID_SHEETS, BIFF12_ID_SHEETS + 1 },
+ { BIFF12_ID_WORKBOOK, BIFF12_ID_WORKBOOK + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
-void OoxWorkbookFragment::finalizeImport()
+void WorkbookFragment::finalizeImport()
{
ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
// read the theme substream
- OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) );
+ OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
if( aThemeFragmentPath.getLength() > 0 )
importOoxFragment( new ThemeFragmentHandler( getFilter(), aThemeFragmentPath, getTheme() ) );
xGlobalSegment->setPosition( 0.25 );
// read the styles substream (requires finalized theme buffer)
- OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "styles" ) );
+ OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "styles" ) );
if( aStylesFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxStylesFragment( *this, aStylesFragmentPath ) );
+ importOoxFragment( new StylesFragment( *this, aStylesFragmentPath ) );
xGlobalSegment->setPosition( 0.5 );
// read the shared string table substream (requires finalized styles buffer)
- OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "sharedStrings" ) );
+ OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "sharedStrings" ) );
if( aSstFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxSharedStringsFragment( *this, aSstFragmentPath ) );
+ importOoxFragment( new SharedStringsFragment( *this, aSstFragmentPath ) );
xGlobalSegment->setPosition( 0.75 );
// read the connections substream
- OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "connections" ) );
+ OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "connections" ) );
if( aConnFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxConnectionsFragment( *this, aConnFragmentPath ) );
+ importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) );
xGlobalSegment->setPosition( 1.0 );
/* Create fragments for all sheets, before importing them. Needed to do
@@ -248,35 +235,35 @@ void OoxWorkbookFragment::finalizeImport()
{
// get fragment path of the sheet
OUString aFragmentPath = getFragmentPathFromRelation( *pRelation );
- OSL_ENSURE( aFragmentPath.getLength() > 0, "OoxWorkbookFragment::finalizeImport - cannot access sheet fragment" );
+ OSL_ENSURE( aFragmentPath.getLength() > 0, "WorkbookFragment::finalizeImport - cannot access sheet fragment" );
if( aFragmentPath.getLength() > 0 )
{
- ::rtl::Reference< OoxWorksheetFragmentBase > xFragment;
+ ::rtl::Reference< WorksheetFragmentBase > xFragment;
double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength );
// create the fragment according to the sheet type
- if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "worksheet" ) )
+ if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "worksheet" ) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
}
- else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "chartsheet" ) )
+ else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "chartsheet" ) )
{
- xFragment.set( new OoxChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
+ xFragment.set( new ChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
}
- else if( (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlMacrosheet" )) ||
- (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlIntlMacrosheet" )) )
+ else if( (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlMacrosheet" )) ||
+ (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlIntlMacrosheet" )) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
}
- else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "dialogsheet" ) )
+ else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "dialogsheet" ) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
}
// insert the fragment into the map
- OSL_ENSURE( xFragment.is(), "OoxWorkbookFragment::finalizeImport - unknown sheet type" );
- OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "OoxWorkbookFragment::finalizeImport - missing sheet in document" );
+ OSL_ENSURE( xFragment.is(), "WorkbookFragment::finalizeImport - unknown sheet type" );
+ OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "WorkbookFragment::finalizeImport - missing sheet in document" );
if( xFragment.is() && xFragment->isValidSheet() )
aSheetFragments.push_back( xFragment.get() );
}
@@ -297,7 +284,7 @@ void OoxWorkbookFragment::finalizeImport()
}
// open the VBA project storage
- OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATIONSTYPE( "vbaProject" ) );
+ OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) );
if( aVbaFragmentPath.getLength() > 0 )
{
Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath );
@@ -311,45 +298,45 @@ void OoxWorkbookFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxWorkbookFragment::importExternalReference( const AttributeList& rAttribs )
+void WorkbookFragment::importExternalReference( const AttributeList& rAttribs )
{
if( ExternalLink* pExtLink = getExternalLinks().importExternalReference( rAttribs ).get() )
importExternalLinkFragment( *pExtLink );
}
-void OoxWorkbookFragment::importDefinedName( const AttributeList& rAttribs )
+void WorkbookFragment::importDefinedName( const AttributeList& rAttribs )
{
mxCurrName = getDefinedNames().importDefinedName( rAttribs );
}
-void OoxWorkbookFragment::importPivotCache( const AttributeList& rAttribs )
+void WorkbookFragment::importPivotCache( const AttributeList& rAttribs )
{
sal_Int32 nCacheId = rAttribs.getInteger( XML_cacheId, -1 );
OUString aRelId = rAttribs.getString( R_TOKEN( id ), OUString() );
importPivotCacheDefFragment( aRelId, nCacheId );
}
-void OoxWorkbookFragment::importExternalRef( RecordInputStream& rStrm )
+void WorkbookFragment::importExternalRef( SequenceInputStream& rStrm )
{
if( ExternalLink* pExtLink = getExternalLinks().importExternalRef( rStrm ).get() )
importExternalLinkFragment( *pExtLink );
}
-void OoxWorkbookFragment::importPivotCache( RecordInputStream& rStrm )
+void WorkbookFragment::importPivotCache( SequenceInputStream& rStrm )
{
sal_Int32 nCacheId = rStrm.readInt32();
- OUString aRelId = rStrm.readString();
+ OUString aRelId = BiffHelper::readString( rStrm );
importPivotCacheDefFragment( aRelId, nCacheId );
}
-void OoxWorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
+void WorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
{
OUString aFragmentPath = getFragmentPathFromRelId( rExtLink.getRelId() );
if( aFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
+ importOoxFragment( new ExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
}
-void OoxWorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
+void WorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
{
// pivot caches will be imported on demand, here we just store the fragment path in the buffer
getPivotCaches().registerPivotCacheFragment( nCacheId, getFragmentPathFromRelId( rRelId ) );
@@ -431,14 +418,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
// import the workspace globals
ISegmentProgressBarRef xGlobalsProgress = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
bool bLoop = true;
- while( bRet && bLoop && mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( bRet && bLoop && rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_CODEPAGE: setCodePage( mrStrm.readuInt16() ); break;
- case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( mrStrm ); break;
- case BIFF_ID_SHEETHEADER: mrStrm.rewindRecord(); bLoop = false; break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_CODEPAGE: setCodePage( rStrm.readuInt16() ); break;
+ case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( rStrm ); break;
+ case BIFF_ID_SHEETHEADER: rStrm.rewindRecord(); bLoop = false; break;
}
}
xGlobalsProgress->setPosition( 1.0 );
@@ -448,15 +436,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
for( sal_Int32 nWorksheet = 0, nWorksheetCount = rWorksheets.getWorksheetCount(); bNextSheet && (nWorksheet < nWorksheetCount); ++nWorksheet )
{
// try to start a new sheet fragment (with leading SHEETHEADER record)
- bNextSheet = mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_SHEETHEADER);
+ bNextSheet = rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_SHEETHEADER);
if( bNextSheet )
{
double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
ISegmentProgressBarRef xSheetProgress = getProgressBar().createSegment( fSegmentLength );
/* Read current sheet name (sheet substreams may not be in the
same order as SHEET records are). */
- mrStrm.skip( 4 );
- OUString aSheetName = mrStrm.readByteStringUC( false, getTextEncoding() );
+ rStrm.skip( 4 );
+ OUString aSheetName = rStrm.readByteStringUC( false, getTextEncoding() );
sal_Int16 nCurrSheet = rWorksheets.getCalcSheetIndex( aSheetName );
// load the sheet fragment records
BiffFragmentType eSheetFragment = startFragment( getBiff() );
@@ -485,27 +473,28 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
bool bRet = true;
bool bLoop = true;
- while( bRet && bLoop && mrStrm.startNextRecord() )
+ BiffInputStream& rStrm = getInputStream();
+ while( bRet && bLoop && rStrm.startNextRecord() )
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
bool bExtLinkRec = false;
/* #i56376# BIFF5-BIFF8: If an EOF record for globals is missing,
simulate it. The issue is about a document where the sheet fragment
starts directly after the EXTSST record, without terminating the
globals fragment with an EOF record. */
- if( isBofRecord() || (nRecId == BIFF_ID_EOF) )
+ if( BiffHelper::isBofRecord( rStrm ) || (nRecId == BIFF_ID_EOF) )
{
bLoop = false;
}
else switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_CODEPAGE: setCodePage( mrStrm.readuInt16() ); break;
- case BIFF_ID_DATEMODE: rWorkbookSett.importDateMode( mrStrm ); break;
- case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( mrStrm ); break;
- case BIFF_ID_PRECISION: rWorkbookSett.importPrecision( mrStrm ); break;
- case BIFF_ID_WINDOW1: rViewSett.importWindow1( mrStrm ); break;
+ case BIFF_ID_CODEPAGE: setCodePage( rStrm.readuInt16() ); break;
+ case BIFF_ID_DATEMODE: rWorkbookSett.importDateMode( rStrm ); break;
+ case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( rStrm ); break;
+ case BIFF_ID_PRECISION: rWorkbookSett.importPrecision( rStrm ); break;
+ case BIFF_ID_WINDOW1: rViewSett.importWindow1( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
@@ -515,10 +504,10 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF2_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF2_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF2_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF_ID_FONTCOLOR: rStyles.importFontColor( mrStrm ); break;
- case BIFF2_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF2_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF2_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF_ID_FONTCOLOR: rStyles.importFontColor( rStrm ); break;
+ case BIFF2_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF2_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -528,14 +517,14 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF3_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF3_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF2_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF3_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF2_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF3_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF3_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -545,62 +534,62 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF3_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF3_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF3_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF4_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF4_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( mrStrm ); break;
+ case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( rStrm ); break;
case BIFF_ID_CRN: bExtLinkRec = true; break;
case BIFF5_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF5_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF5_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_OLESIZE: rViewSett.importOleSize( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( mrStrm ); break;
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF5_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_OLESIZE: rViewSett.importOleSize( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( rStrm ); break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF5_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF5_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( mrStrm ); break;
- case BIFF_ID_CODENAME: rWorkbookSett.importCodeName( mrStrm ); break;
+ case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( rStrm ); break;
+ case BIFF_ID_CODENAME: rWorkbookSett.importCodeName( rStrm ); break;
case BIFF_ID_CRN: bExtLinkRec = true; break;
case BIFF5_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNALBOOK: bExtLinkRec = true; break;
case BIFF5_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF5_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_OLESIZE: rViewSett.importOleSize( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( mrStrm ); break;
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_SST: rSharedStrings.importSst( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
- case BIFF_ID_USESELFS: rWorkbookSett.importUsesElfs( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF5_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_OLESIZE: rViewSett.importOleSize( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( rStrm ); break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_SST: rSharedStrings.importSst( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
+ case BIFF_ID_USESELFS: rWorkbookSett.importUsesElfs( rStrm ); break;
case BIFF_ID_VBAPROJECT: bHasVbaProject = true; break;
case BIFF_ID_VBAPROJECTEMPTY: bEmptyVbaProject = true; break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF5_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF5_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -609,7 +598,7 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
}
if( bExtLinkRec )
- aExtLinkRecs.push_back( mrStrm.getRecHandle() );
+ aExtLinkRecs.push_back( rStrm.getRecHandle() );
}
// finalize global buffers
@@ -626,16 +615,16 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
if( bRet && !aExtLinkRecs.empty() )
{
// remember current stream position (the EOF record)
- sal_Int64 nEofHandle = mrStrm.getRecHandle();
- // this fragment class implements import of external link records
- BiffExternalLinkFragment aLinkFragment( *this, true );
+ sal_Int64 nEofHandle = rStrm.getRecHandle();
+ // context handler implementing import of external link records
+ BiffExternalSheetDataContext aSheetContext( *this, true );
// import all records by using their cached record handle
- for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && mrStrm.startRecordByHandle( *aIt ); ++aIt )
- aLinkFragment.importRecord();
+ for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && rStrm.startRecordByHandle( *aIt ); ++aIt )
+ aSheetContext.importRecord( rStrm );
// finalize global buffers
- aLinkFragment.finalizeImport();
+ getDefinedNames().finalizeImport();
// seek back to the EOF record of the workbook globals fragment
- bRet = mrStrm.startRecordByHandle( nEofHandle );
+ bRet = rStrm.startRecordByHandle( nEofHandle );
}
// open the VBA project storage
@@ -643,8 +632,8 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
setVbaProjectStorage( getBaseFilter().openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ) );
// #i56376# missing EOF - rewind before worksheet BOF record (see above)
- if( bRet && isBofRecord() )
- mrStrm.rewindRecord();
+ if( bRet && BiffHelper::isBofRecord( rStrm ) )
+ rStrm.rewindRecord();
rProgressBar.setPosition( 1.0 );
return bRet;
@@ -673,6 +662,7 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
createBuffersPerSheet( nCalcSheet );
// preprocess some records
+ BiffInputStream& rStrm = getInputStream();
switch( getBiff() )
{
// load the workbook globals fragment records in BIFF2-BIFF4
@@ -681,12 +671,12 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
case BIFF4:
{
// remember current record to seek back below
- sal_Int64 nRecHandle = mrStrm.getRecHandle();
+ sal_Int64 nRecHandle = rStrm.getRecHandle();
// import the global records
ISegmentProgressBarRef xGlobalsProgress = rProgressBar.createSegment( PROGRESS_LENGTH_GLOBALS );
importGlobalsFragment( *xGlobalsProgress );
// rewind stream to fragment BOF record
- mrStrm.startRecordByHandle( nRecHandle );
+ rStrm.startRecordByHandle( nRecHandle );
}
break;
@@ -694,11 +684,11 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
case BIFF5:
{
// remember current record to seek back below
- sal_Int64 nRecHandle = mrStrm.getRecHandle();
+ sal_Int64 nRecHandle = rStrm.getRecHandle();
// fragment implementing import of external link records
- BiffExternalLinkFragment( *this, false ).importFragment();
+ BiffExternalLinkFragment( *this ).importFragment();
// rewind stream to fragment BOF record
- mrStrm.startRecordByHandle( nRecHandle );
+ rStrm.startRecordByHandle( nRecHandle );
}
break;
@@ -735,4 +725,3 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx
index ceba5690004c..8cd2748101d7 100644
--- a/oox/source/xls/workbookhelper.cxx
+++ b/oox/source/xls/workbookhelper.cxx
@@ -26,31 +26,31 @@
************************************************************************/
#include "oox/xls/workbookhelper.hxx"
-#include <osl/thread.h>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/document/XActionLockable.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
+#include <com/sun/star/sheet/XDatabaseRanges.hpp>
#include <com/sun/star/sheet/XNamedRange.hpp>
#include <com/sun/star/sheet/XNamedRanges.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XExternalDocLinks.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/CellAddress.hpp>
+#include <osl/thread.h>
+#include "oox/drawingml/theme.hxx"
#include "oox/helper/progressbar.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/drawingml/theme.hxx"
+#include "oox/ole/vbaproject.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffcodec.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
#include "oox/xls/defnamesbuffer.hxx"
#include "oox/xls/excelchartconverter.hxx"
#include "oox/xls/excelfilter.hxx"
-#include "oox/xls/excelvbaproject.hxx"
#include "oox/xls/externallinkbuffer.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/pagesettings.hxx"
@@ -63,43 +63,29 @@
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/viewsettings.hxx"
-#include "oox/xls/webquerybuffer.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::document::XActionLockable;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::sheet::XNamedRange;
-using ::com::sun::star::sheet::XNamedRanges;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XExternalDocLinks;
-using ::com::sun::star::style::XStyle;
-using ::com::sun::star::style::XStyleFamiliesSupplier;
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
using ::oox::core::BinaryFilterBase;
using ::oox::core::FilterBase;
using ::oox::core::FragmentHandler;
using ::oox::core::XmlFilterBase;
using ::oox::drawingml::Theme;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
// ============================================================================
@@ -145,22 +131,14 @@ public:
/** Returns a reference to the source/target spreadsheet document model. */
inline Reference< XSpreadsheetDocument > getDocument() const { return mxDoc; }
- /** Returns the reference device of the document. */
- Reference< XDevice > getReferenceDevice() const;
- /** Returns the container for defined names from the Calc document. */
- Reference< XNamedRanges > getNamedRanges() const;
- /** Returns the container for database ranges from the Calc document. */
- Reference< XDatabaseRanges > getDatabaseRanges() const;
- /** Returns the container for external documents from the Calc document. */
- Reference< XExternalDocLinks > getExternalDocLinks() const;
- /** Returns the container for DDE links from the Calc document. */
- Reference< XNameAccess > getDdeLinks() const;
/** Returns the cell or page styles container from the Calc document. */
Reference< XNameContainer > getStyleFamily( bool bPageStyles ) const;
/** Returns the specified cell or page style from the Calc document. */
Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const;
/** Creates and returns a defined name on-the-fly in the Calc document. */
Reference< XNamedRange > createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const;
+ /** Creates and returns a database range on-the-fly in the Calc document. */
+ Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const;
/** Creates and returns a com.sun.star.style.Style object for cells or pages. */
Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const;
@@ -186,8 +164,8 @@ public:
inline TableBuffer& getTables() const { return *mxTables; }
/** Returns the scenarios collection. */
inline ScenarioBuffer& getScenarios() const { return *mxScenarios; }
- /** Returns the web queries. */
- inline WebQueryBuffer& getWebQueries() const { return *mxWebQueries; }
+ /** Returns the collection of external data connections. */
+ inline ConnectionsBuffer& getConnections() const { return *mxConnections; }
/** Returns the collection of pivot caches. */
inline PivotCacheBuffer& getPivotCaches() const { return *mxPivotCaches; }
/** Returns the collection of pivot tables. */
@@ -206,12 +184,12 @@ public:
/** Returns the page/print settings converter. */
inline PageSettingsConverter& getPageSettingsConverter() const { return *mxPageSettConverter; }
- // OOX specific -----------------------------------------------------------
+ // OOXML/BIFF12 specific --------------------------------------------------
- /** Returns the base OOX filter object. */
+ /** Returns the base OOXML/BIFF12 filter object. */
inline XmlFilterBase& getOoxFilter() const { return *mpOoxFilter; }
- // BIFF specific ----------------------------------------------------------
+ // BIFF2-BIFF8 specific ---------------------------------------------------
/** Returns the base BIFF filter object. */
inline BinaryFilterBase& getBiffFilter() const { return *mpBiffFilter; }
@@ -250,7 +228,7 @@ private:
typedef ::std::auto_ptr< DefinedNamesBuffer > DefNamesBfrPtr;
typedef ::std::auto_ptr< TableBuffer > TableBfrPtr;
typedef ::std::auto_ptr< ScenarioBuffer > ScenarioBfrPtr;
- typedef ::std::auto_ptr< WebQueryBuffer > WebQueryBfrPtr;
+ typedef ::std::auto_ptr< ConnectionsBuffer > ConnectionsBfrPtr;
typedef ::std::auto_ptr< PivotCacheBuffer > PivotCacheBfrPtr;
typedef ::std::auto_ptr< PivotTableBuffer > PivotTableBfrPtr;
typedef ::std::auto_ptr< FormulaParser > FormulaParserPtr;
@@ -284,7 +262,7 @@ private:
DefNamesBfrPtr mxDefNames; /// All defined names.
TableBfrPtr mxTables; /// All tables (database ranges).
ScenarioBfrPtr mxScenarios; /// All scenarios.
- WebQueryBfrPtr mxWebQueries; /// Web queries buffer.
+ ConnectionsBfrPtr mxConnections; /// All external data connections.
PivotCacheBfrPtr mxPivotCaches; /// All pivot caches in the document.
PivotTableBfrPtr mxPivotTables; /// All pivot tables in the document.
@@ -295,11 +273,11 @@ private:
ExcelChartConvPtr mxChartConverter; /// Chart object converter.
PageSettConvPtr mxPageSettConverter; /// Page/print settings converter.
- // OOX specific
- XmlFilterBase* mpOoxFilter; /// Base OOX filter object.
+ // OOXML/BIFF12 specific
+ XmlFilterBase* mpOoxFilter; /// Base OOXML/BIFF12 filter object.
- // BIFF specific
- BinaryFilterBase* mpBiffFilter; /// Base BIFF filter object.
+ // BIFF2-BIFF8 specific
+ BinaryFilterBase* mpBiffFilter; /// Base BIFF2-BIFF8 filter object.
BiffCodecHelperPtr mxCodecHelper; /// Encoder/decoder helper.
BiffType meBiff; /// BIFF version for BIFF import/export.
rtl_TextEncoding meTextEnc; /// BIFF byte string text encoding.
@@ -311,7 +289,7 @@ private:
WorkbookData::WorkbookData( ExcelFilter& rFilter ) :
mrBaseFilter( rFilter ),
mrExcelBase( rFilter ),
- meFilterType( FILTER_OOX ),
+ meFilterType( FILTER_OOXML ),
mpOoxFilter( &rFilter ),
mpBiffFilter( 0 ),
meBiff( BIFF_UNKNOWN )
@@ -342,46 +320,6 @@ WorkbookData::~WorkbookData()
// document model -------------------------------------------------------------
-Reference< XDevice > WorkbookData::getReferenceDevice() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XDevice > xDevice;
- aPropSet.getProperty( xDevice, PROP_ReferenceDevice );
- return xDevice;
-}
-
-Reference< XNamedRanges > WorkbookData::getNamedRanges() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XNamedRanges > xNamedRanges;
- aPropSet.getProperty( xNamedRanges, PROP_NamedRanges );
- return xNamedRanges;
-}
-
-Reference< XDatabaseRanges > WorkbookData::getDatabaseRanges() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XDatabaseRanges > xDatabaseRanges;
- aPropSet.getProperty( xDatabaseRanges, PROP_DatabaseRanges );
- return xDatabaseRanges;
-}
-
-Reference< XExternalDocLinks > WorkbookData::getExternalDocLinks() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XExternalDocLinks > xDocLinks;
- aPropSet.getProperty( xDocLinks, PROP_ExternalDocLinks );
- return xDocLinks;
-}
-
-Reference< XNameAccess > WorkbookData::getDdeLinks() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XNameAccess > xDdeLinks;
- aPropSet.getProperty( xDdeLinks, PROP_DDELinks );
- return xDdeLinks;
-}
-
Reference< XNameContainer > WorkbookData::getStyleFamily( bool bPageStyles ) const
{
Reference< XNameContainer > xStylesNC;
@@ -415,16 +353,16 @@ Reference< XStyle > WorkbookData::getStyleObject( const OUString& rStyleName, bo
Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const
{
- // find an unused name
- Reference< XNamedRanges > xNamedRanges = getNamedRanges();
- Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY );
- if( xNameAccess.is() )
- orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-
// create the name and insert it into the Calc document
Reference< XNamedRange > xNamedRange;
- if( xNamedRanges.is() && (orName.getLength() > 0) ) try
+ if( orName.getLength() > 0 ) try
{
+ // find an unused name
+ PropertySet aDocProps( mxDoc );
+ Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY_THROW );
+ orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
+ // create the named range
xNamedRanges->addNewByName( orName, OUString(), CellAddress( 0, 0, 0 ), nNameFlags );
xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
}
@@ -435,6 +373,32 @@ Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName,
return xNamedRange;
}
+Reference< XDatabaseRange > WorkbookData::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
+{
+ // validate cell range
+ CellRangeAddress aDestRange = rRangeAddr;
+ bool bValidRange = getAddressConverter().validateCellRange( aDestRange, true, true );
+
+ // create database range and insert it into the Calc document
+ Reference< XDatabaseRange > xDatabaseRange;
+ if( bValidRange && (orName.getLength() > 0) ) try
+ {
+ // find an unused name
+ PropertySet aDocProps( mxDoc );
+ Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW );
+ orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
+ // create the database range
+ xDatabaseRanges->addNewByName( orName, aDestRange );
+ xDatabaseRange.set( xDatabaseRanges->getByName( orName ), UNO_QUERY );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( xDatabaseRange.is(), "WorkbookData::createDatabaseRangeObject - cannot create database range" );
+ return xDatabaseRange;
+}
+
Reference< XStyle > WorkbookData::createStyleObject( OUString& orStyleName, bool bPageStyle ) const
{
Reference< XStyle > xStyle;
@@ -542,7 +506,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
mxDefNames.reset( new DefinedNamesBuffer( *this ) );
mxTables.reset( new TableBuffer( *this ) );
mxScenarios.reset( new ScenarioBuffer( *this ) );
- mxWebQueries.reset( new WebQueryBuffer( *this ) );
+ mxConnections.reset( new ConnectionsBuffer( *this ) );
mxPivotCaches.reset( new PivotCacheBuffer( *this ) );
mxPivotTables.reset( new PivotTableBuffer( *this ) );
@@ -564,7 +528,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
// disable automatic update of linked sheets and DDE links
aPropSet.setProperty( PROP_IsExecuteLinkEnabled, false );
// #i79890# disable automatic update of defined names
- Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+ Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
if( xLockable.is() )
xLockable->addActionLock();
@@ -585,7 +549,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
mxCodecHelper.reset( new BiffCodecHelper( *this ) );
break;
- case FILTER_OOX:
+ case FILTER_OOXML:
break;
case FILTER_UNKNOWN:
@@ -602,7 +566,7 @@ void WorkbookData::finalize()
// #i74668# do not insert default sheets
aPropSet.setProperty( PROP_IsLoaded, true );
// #i79890# enable automatic update of defined names (before IsAdjustHeightEnabled!)
- Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+ Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
if( xLockable.is() )
xLockable->removeActionLock();
// enable automatic update of linked sheets and DDE links
@@ -613,6 +577,8 @@ void WorkbookData::finalize()
aPropSet.setProperty( PROP_IsUndoEnabled, true );
// disable editing read-only documents (e.g. from read-only files)
aPropSet.setProperty( PROP_IsChangeReadOnlyEnabled, false );
+ // #111099# open forms in alive mode (has no effect, if no controls in document)
+ aPropSet.setProperty( PROP_ApplyFormDesignMode, false );
}
}
@@ -631,7 +597,7 @@ FilterBase& WorkbookHelper::getBaseFilter() const
Reference< XMultiServiceFactory > WorkbookHelper::getGlobalFactory() const
{
- return mrBookData.getBaseFilter().getGlobalFactory();
+ return mrBookData.getBaseFilter().getServiceFactory();
}
FilterType WorkbookHelper::getFilterType() const
@@ -690,10 +656,7 @@ void WorkbookHelper::finalizeWorkbookImport()
contains the workbook code name). */
StorageRef xVbaPrjStrg = mrBookData.getVbaProjectStorage();
if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- {
- ExcelVbaProject aVbaProject( getGlobalFactory(), getDocument() );
- aVbaProject.importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
- }
+ getBaseFilter().getVbaProject().importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
}
// document model -------------------------------------------------------------
@@ -708,31 +671,6 @@ Reference< XMultiServiceFactory > WorkbookHelper::getDocumentFactory() const
return mrBookData.getBaseFilter().getModelFactory();
}
-Reference< XDevice > WorkbookHelper::getReferenceDevice() const
-{
- return mrBookData.getReferenceDevice();
-}
-
-Reference< XNamedRanges > WorkbookHelper::getNamedRanges() const
-{
- return mrBookData.getNamedRanges();
-}
-
-Reference< XDatabaseRanges > WorkbookHelper::getDatabaseRanges() const
-{
- return mrBookData.getDatabaseRanges();
-}
-
-Reference< XExternalDocLinks > WorkbookHelper::getExternalDocLinks() const
-{
- return mrBookData.getExternalDocLinks();
-}
-
-Reference< XNameAccess > WorkbookHelper::getDdeLinks() const
-{
- return mrBookData.getDdeLinks();
-}
-
Reference< XSpreadsheet > WorkbookHelper::getSheetFromDoc( sal_Int16 nSheet ) const
{
Reference< XSpreadsheet > xSheet;
@@ -804,6 +742,11 @@ Reference< XNamedRange > WorkbookHelper::createNamedRangeObject( OUString& orNam
return mrBookData.createNamedRangeObject( orName, nNameFlags );
}
+Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
+{
+ return mrBookData.createDatabaseRangeObject( orName, rRangeAddr );
+}
+
Reference< XStyle > WorkbookHelper::createStyleObject( OUString& orStyleName, bool bPageStyle ) const
{
return mrBookData.createStyleObject( orStyleName, bPageStyle );
@@ -861,9 +804,9 @@ ScenarioBuffer& WorkbookHelper::getScenarios() const
return mrBookData.getScenarios();
}
-WebQueryBuffer& WorkbookHelper::getWebQueries() const
+ConnectionsBuffer& WorkbookHelper::getConnections() const
{
- return mrBookData.getWebQueries();
+ return mrBookData.getConnections();
}
PivotCacheBuffer& WorkbookHelper::getPivotCaches() const
@@ -903,11 +846,11 @@ PageSettingsConverter& WorkbookHelper::getPageSettingsConverter() const
return mrBookData.getPageSettingsConverter();
}
-// OOX specific ---------------------------------------------------------------
+// OOXML/BIFF12 specific ------------------------------------------------------
XmlFilterBase& WorkbookHelper::getOoxFilter() const
{
- OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOX, "WorkbookHelper::getOoxFilter - invalid call" );
+ OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOXML, "WorkbookHelper::getOoxFilter - invalid call" );
return mrBookData.getOoxFilter();
}
@@ -1002,4 +945,3 @@ bool WorkbookHelperRoot::isValid() const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx
index 51d60ebafe3b..6889d42ed2f6 100644
--- a/oox/source/xls/workbooksettings.cxx
+++ b/oox/source/xls/workbooksettings.cxx
@@ -26,48 +26,45 @@
************************************************************************/
#include "oox/xls/workbooksettings.hxx"
+
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <comphelper/mediadescriptor.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::sheet::XCalculatable;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::CodecHelper;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::CodecHelper;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_uInt32 OOBIN_WORKBOOKPR_DATE1904 = 0x00000001;
-const sal_uInt32 OOBIN_WORKBOOKPR_STRIPEXT = 0x00000080;
+const sal_uInt32 BIFF12_WORKBOOKPR_DATE1904 = 0x00000001;
+const sal_uInt32 BIFF12_WORKBOOKPR_STRIPEXT = 0x00000080;
-const sal_uInt16 OOBIN_CALCPR_A1 = 0x0002;
-const sal_uInt16 OOBIN_CALCPR_ITERATE = 0x0004;
-const sal_uInt16 OOBIN_CALCPR_FULLPRECISION = 0x0008;
-const sal_uInt16 OOBIN_CALCPR_CALCCOMPLETED = 0x0010;
-const sal_uInt16 OOBIN_CALCPR_CALCONSAVE = 0x0020;
-const sal_uInt16 OOBIN_CALCPR_CONCURRENT = 0x0040;
-const sal_uInt16 OOBIN_CALCPR_MANUALPROC = 0x0080;
+const sal_uInt16 BIFF12_CALCPR_A1 = 0x0002;
+const sal_uInt16 BIFF12_CALCPR_ITERATE = 0x0004;
+const sal_uInt16 BIFF12_CALCPR_FULLPRECISION = 0x0008;
+const sal_uInt16 BIFF12_CALCPR_CALCCOMPLETED = 0x0010;
+const sal_uInt16 BIFF12_CALCPR_CALCONSAVE = 0x0020;
+const sal_uInt16 BIFF12_CALCPR_CONCURRENT = 0x0040;
+const sal_uInt16 BIFF12_CALCPR_MANUALPROC = 0x0080;
// no predefined constants for show objects mode
const sal_Int16 API_SHOWMODE_SHOW = 0; /// Show drawing objects.
@@ -95,7 +92,7 @@ WorkbookSettingsModel::WorkbookSettingsModel() :
{
}
-void WorkbookSettingsModel::setBinObjectMode( sal_uInt16 nObjMode )
+void WorkbookSettingsModel::setBiffObjectMode( sal_uInt16 nObjMode )
{
static const sal_Int32 spnObjModes[] = { XML_all, XML_placeholders, XML_none };
mnShowObjectMode = STATIC_ARRAY_SELECT( spnObjModes, nObjMode, XML_all );
@@ -158,37 +155,37 @@ void WorkbookSettings::importCalcPr( const AttributeList& rAttribs )
maCalcSettings.mbConcurrent = rAttribs.getBool( XML_concurrentCalc, true );
}
-void WorkbookSettings::importFileSharing( RecordInputStream& rStrm )
+void WorkbookSettings::importFileSharing( SequenceInputStream& rStrm )
{
maFileSharing.mbRecommendReadOnly = rStrm.readuInt16() != 0;
rStrm >> maFileSharing.mnPasswordHash >> maFileSharing.maUserName;
}
-void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm )
+void WorkbookSettings::importWorkbookPr( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags;
rStrm >> nFlags >> maBookSettings.mnDefaultThemeVer >> maBookSettings.maCodeName;
- maBookSettings.setBinObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
+ maBookSettings.setBiffObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
// set flag means: strip external link values
- maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, OOBIN_WORKBOOKPR_STRIPEXT );
- setDateMode( getFlag( nFlags, OOBIN_WORKBOOKPR_DATE1904 ) );
+ maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, BIFF12_WORKBOOKPR_STRIPEXT );
+ setDateMode( getFlag( nFlags, BIFF12_WORKBOOKPR_DATE1904 ) );
}
-void WorkbookSettings::importCalcPr( RecordInputStream& rStrm )
+void WorkbookSettings::importCalcPr( SequenceInputStream& rStrm )
{
sal_Int32 nCalcMode, nProcCount;
sal_uInt16 nFlags;
rStrm >> maCalcSettings.mnCalcId >> nCalcMode >> maCalcSettings.mnIterateCount >> maCalcSettings.mfIterateDelta >> nProcCount >> nFlags;
static const sal_Int32 spnCalcModes[] = { XML_manual, XML_auto, XML_autoNoTable };
- maCalcSettings.mnRefMode = getFlagValue( nFlags, OOBIN_CALCPR_A1, XML_A1, XML_R1C1 );
+ maCalcSettings.mnRefMode = getFlagValue( nFlags, BIFF12_CALCPR_A1, XML_A1, XML_R1C1 );
maCalcSettings.mnCalcMode = STATIC_ARRAY_SELECT( spnCalcModes, nCalcMode, XML_auto );
- maCalcSettings.mnProcCount = getFlagValue< sal_Int32 >( nFlags, OOBIN_CALCPR_MANUALPROC, nProcCount, -1 );
- maCalcSettings.mbCalcOnSave = getFlag( nFlags, OOBIN_CALCPR_CALCONSAVE );
- maCalcSettings.mbCalcCompleted = getFlag( nFlags, OOBIN_CALCPR_CALCCOMPLETED );
- maCalcSettings.mbFullPrecision = getFlag( nFlags, OOBIN_CALCPR_FULLPRECISION );
- maCalcSettings.mbIterate = getFlag( nFlags, OOBIN_CALCPR_ITERATE );
- maCalcSettings.mbConcurrent = getFlag( nFlags, OOBIN_CALCPR_CONCURRENT );
+ maCalcSettings.mnProcCount = getFlagValue< sal_Int32 >( nFlags, BIFF12_CALCPR_MANUALPROC, nProcCount, -1 );
+ maCalcSettings.mbCalcOnSave = getFlag( nFlags, BIFF12_CALCPR_CALCONSAVE );
+ maCalcSettings.mbCalcCompleted = getFlag( nFlags, BIFF12_CALCPR_CALCCOMPLETED );
+ maCalcSettings.mbFullPrecision = getFlag( nFlags, BIFF12_CALCPR_FULLPRECISION );
+ maCalcSettings.mbIterate = getFlag( nFlags, BIFF12_CALCPR_ITERATE );
+ maCalcSettings.mbConcurrent = getFlag( nFlags, BIFF12_CALCPR_CONCURRENT );
}
void WorkbookSettings::setSaveExtLinkValues( bool bSaveExtLinks )
@@ -248,7 +245,7 @@ void WorkbookSettings::importFileSharing( BiffInputStream& rStrm )
void WorkbookSettings::importHideObj( BiffInputStream& rStrm )
{
- maBookSettings.setBinObjectMode( rStrm.readuInt16() );
+ maBookSettings.setBiffObjectMode( rStrm.readuInt16() );
}
void WorkbookSettings::importIteration( BiffInputStream& rStrm )
@@ -288,7 +285,7 @@ void WorkbookSettings::finalizeImport()
PropertySet aPropSet( getDocument() );
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
case FILTER_BIFF:
aPropSet.setProperty( PROP_IgnoreCase, true ); // always in Excel
aPropSet.setProperty( PROP_RegularExpressions, false ); // not supported in Excel
@@ -367,4 +364,3 @@ void WorkbookSettings::setDateMode( bool bDateMode1904 )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx
index 6f8d50ff38f6..6144c35d6a55 100644
--- a/oox/source/xls/worksheetbuffer.cxx
+++ b/oox/source/xls/worksheetbuffer.cxx
@@ -26,37 +26,35 @@
************************************************************************/
#include "oox/xls/worksheetbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XExternalSheetName.hpp>
#include <com/sun/star/sheet/XSheetLinkable.hpp>
-#include "properties.hxx"
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
SheetInfoModel::SheetInfoModel() :
mnBiffHandle( -1 ),
mnSheetId( -1 ),
@@ -97,7 +95,7 @@ void WorksheetBuffer::importSheet( const AttributeList& rAttribs )
insertSheet( aModel );
}
-void WorksheetBuffer::importSheet( RecordInputStream& rStrm )
+void WorksheetBuffer::importSheet( SequenceInputStream& rStrm )
{
sal_Int32 nState;
SheetInfoModel aModel;
@@ -258,4 +256,3 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx
index bee58fdbaff3..4867c7c350c1 100644
--- a/oox/source/xls/worksheetfragment.cxx
+++ b/oox/source/xls/worksheetfragment.cxx
@@ -26,11 +26,12 @@
************************************************************************/
#include "oox/xls/worksheetfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
+
#include "oox/core/filterbase.hxx"
#include "oox/core/relations.hxx"
+#include "oox/helper/attributelist.hxx"
#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/autofiltercontext.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/commentsfragment.hxx"
@@ -38,7 +39,6 @@
#include "oox/xls/drawingfragment.hxx"
#include "oox/xls/externallinkbuffer.hxx"
#include "oox/xls/pagesettings.hxx"
-#include "oox/xls/pivottablebuffer.hxx"
#include "oox/xls/pivottablefragment.hxx"
#include "oox/xls/querytablefragment.hxx"
#include "oox/xls/scenariobuffer.hxx"
@@ -49,23 +49,20 @@
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relations;
-using ::oox::core::RelationsRef;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_uInt16 BIFF_COLINFO_HIDDEN = 0x0001;
@@ -87,23 +84,23 @@ const sal_uInt32 BIFF_DATAVAL_SHOWERROR = 0x00080000;
const sal_uInt32 BIFF_SHRFEATHEAD_SHEETPROT = 2;
-const sal_Int32 OOBIN_OLEOBJECT_CONTENT = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ICON = 4;
-const sal_Int32 OOBIN_OLEOBJECT_ALWAYS = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ONCALL = 3;
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED = 0x0001;
-const sal_uInt16 OOBIN_OLEOBJECT_AUTOLOAD = 0x0002;
+const sal_Int32 BIFF12_OLEOBJECT_CONTENT = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ICON = 4;
+const sal_Int32 BIFF12_OLEOBJECT_ALWAYS = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ONCALL = 3;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_AUTOLOAD = 0x0002;
} // namespace
// ============================================================================
-OoxDataValidationsContext::OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+DataValidationsContext::DataValidationsContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -119,7 +116,7 @@ ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement
{
case XLS_TOKEN( formula1 ):
case XLS_TOKEN( formula2 ):
- return this; // collect formulas in onEndElement()
+ return this; // collect formulas in onCharacters()
}
break;
}
@@ -138,7 +135,7 @@ ApiTokenSequence lclImportDataValFormula( FormulaParser& rParser, const OUString
} // namespace
-void OoxDataValidationsContext::onEndElement( const OUString& rChars )
+void DataValidationsContext::onCharacters( const OUString& rChars )
{
if( mxValModel.get() ) switch( getCurrentElement() )
{
@@ -153,22 +150,27 @@ void OoxDataValidationsContext::onEndElement( const OUString& rChars )
mxValModel->maTokens2 = lclImportDataValFormula(
getFormulaParser(), rChars, mxValModel->maRanges.getBaseAddress() );
break;
- case XLS_TOKEN( dataValidation ):
- setValidation( *mxValModel );
- mxValModel.reset();
- break;
+ }
+}
+
+void DataValidationsContext::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( dataValidation ) ) && mxValModel.get() )
+ {
+ setValidation( *mxValModel );
+ mxValModel.reset();
}
}
-ContextHandlerRef OoxDataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- if( nRecId == OOBIN_ID_DATAVALIDATION )
+ if( nRecId == BIFF12_ID_DATAVALIDATION )
importDataValidation( rStrm );
return 0;
}
-void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttribs )
+void DataValidationsContext::importDataValidation( const AttributeList& rAttribs )
{
mxValModel.reset( new ValidationModel );
getAddressConverter().convertToCellRangeList( mxValModel->maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
@@ -188,7 +190,7 @@ void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttr
mxValModel->mbAllowBlank = rAttribs.getBool( XML_allowBlank, false );
}
-void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
+void DataValidationsContext::importDataValidation( SequenceInputStream& rStrm )
{
ValidationModel aModel;
@@ -196,10 +198,10 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
BinRangeList aRanges;
rStrm >> nFlags >> aRanges >> aModel.maErrorTitle >> aModel.maErrorMessage >> aModel.maInputTitle >> aModel.maInputMessage;
- // equal flags in BIFF and OOBIN
- aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
- aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
- aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+ // equal flags in all BIFFs
+ aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+ aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+ aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
aModel.mbAllowBlank = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
aModel.mbNoDropDown = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
@@ -226,24 +228,22 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
// ============================================================================
-OoxWorksheetFragment::OoxWorksheetFragment( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, eSheetType, nSheet )
+WorksheetFragment::WorksheetFragment( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, eSheetType, nSheet )
{
// import data tables related to this worksheet
- RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "table" ) );
+ RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "table" ) );
for( Relations::const_iterator aIt = xTableRels->begin(), aEnd = xTableRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
// import comments related to this worksheet
- OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "comments" ) );
+ OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) );
if( aCommentsFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxCommentsFragment( *this, aCommentsFragmentPath ) );
+ importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -252,7 +252,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case SHEETTYPE_WORKSHEET: return (nElement == XLS_TOKEN( worksheet )) ? this : 0;
case SHEETTYPE_CHARTSHEET: return 0;
case SHEETTYPE_MACROSHEET: return (nElement == XM_TOKEN( macrosheet )) ? this : 0;
- case SHEETTYPE_DIALOGSHEET: return (nElement == XM_TOKEN( dialogsheet )) ? this : 0;
+ case SHEETTYPE_DIALOGSHEET: return (nElement == XLS_TOKEN( dialogsheet )) ? this : 0;
case SHEETTYPE_MODULESHEET: return 0;
case SHEETTYPE_EMPTYSHEET: return 0;
}
@@ -260,12 +260,14 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( worksheet ):
case XM_TOKEN( macrosheet ):
+ case XLS_TOKEN( dialogsheet ):
switch( nElement )
{
- case XLS_TOKEN( sheetData ): return new OoxSheetDataContext( *this );
- case XLS_TOKEN( autoFilter ): return new OoxAutoFilterContext( *this );
- case XLS_TOKEN( conditionalFormatting ): return new OoxCondFormatContext( *this );
- case XLS_TOKEN( dataValidations ): return new OoxDataValidationsContext( *this );
+ case XLS_TOKEN( sheetData ): return new SheetDataContext( *this );
+ case XLS_TOKEN( conditionalFormatting ): return new CondFormatContext( *this );
+ case XLS_TOKEN( dataValidations ): return new DataValidationsContext( *this );
+ case XLS_TOKEN( autoFilter ): return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
+ case XLS_TOKEN( scenarios ): return new ScenariosContext( *this );
case XLS_TOKEN( sheetViews ):
case XLS_TOKEN( cols ):
@@ -288,8 +290,6 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( picture ): getPageSettings().importPicture( getRelations(), rAttribs ); break;
case XLS_TOKEN( drawing ): importDrawing( rAttribs ); break;
case XLS_TOKEN( legacyDrawing ): importLegacyDrawing( rAttribs ); break;
- case XLS_TOKEN( scenarios ):
- return new OoxScenariosContext( *this );
}
break;
@@ -340,7 +340,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( oddHeader ):
case XLS_TOKEN( oddFooter ):
case XLS_TOKEN( evenHeader ):
- case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onEndElement()
+ case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters()
}
break;
@@ -354,7 +354,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void OoxWorksheetFragment::onEndElement( const OUString& rChars )
+void WorksheetFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -369,134 +369,136 @@ void OoxWorksheetFragment::onEndElement( const OUString& rChars )
}
}
-ContextHandlerRef OoxWorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+ if( nRecId == BIFF12_ID_WORKSHEET ) return this;
break;
- case OOBIN_ID_WORKSHEET:
+ case BIFF12_ID_WORKSHEET:
switch( nRecId )
{
- case OOBIN_ID_SHEETDATA: return new OoxSheetDataContext( *this );
- case OOBIN_ID_CONDFORMATTING: return new OoxCondFormatContext( *this );
- case OOBIN_ID_DATAVALIDATIONS: return new OoxDataValidationsContext( *this );
-
- case OOBIN_ID_SHEETVIEWS:
- case OOBIN_ID_COLS:
- case OOBIN_ID_MERGECELLS:
- case OOBIN_ID_ROWBREAKS:
- case OOBIN_ID_COLBREAKS:
- case OOBIN_ID_OLEOBJECTS:
- case OOBIN_ID_CONTROLS: return this;
-
- case OOBIN_ID_SHEETPR: getWorksheetSettings().importSheetPr( rStrm ); break;
- case OOBIN_ID_DIMENSION: importDimension( rStrm ); break;
- case OOBIN_ID_SHEETFORMATPR: importSheetFormatPr( rStrm ); break;
- case OOBIN_ID_HYPERLINK: importHyperlink( rStrm ); break;
- case OOBIN_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
- case OOBIN_ID_PAGESETUP: getPageSettings().importPageSetup( getRelations(), rStrm ); break;
- case OOBIN_ID_PRINTOPTIONS: getPageSettings().importPrintOptions( rStrm ); break;
- case OOBIN_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
- case OOBIN_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
- case OOBIN_ID_SHEETPROTECTION: getWorksheetSettings().importSheetProtection( rStrm ); break;
- case OOBIN_ID_PHONETICPR: getWorksheetSettings().importPhoneticPr( rStrm ); break;
- case OOBIN_ID_DRAWING: importDrawing( rStrm ); break;
- case OOBIN_ID_LEGACYDRAWING: importLegacyDrawing( rStrm ); break;
- case OOBIN_ID_SCENARIOS:
- return new OoxScenariosContext( *this );
+ case BIFF12_ID_SHEETDATA: return new SheetDataContext( *this );
+ case BIFF12_ID_CONDFORMATTING: return new CondFormatContext( *this );
+ case BIFF12_ID_DATAVALIDATIONS: return new DataValidationsContext( *this );
+ case BIFF12_ID_AUTOFILTER: return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
+ case BIFF12_ID_SCENARIOS: return new ScenariosContext( *this );
+
+ case BIFF12_ID_SHEETVIEWS:
+ case BIFF12_ID_COLS:
+ case BIFF12_ID_MERGECELLS:
+ case BIFF12_ID_ROWBREAKS:
+ case BIFF12_ID_COLBREAKS:
+ case BIFF12_ID_OLEOBJECTS:
+ case BIFF12_ID_CONTROLS: return this;
+
+ case BIFF12_ID_SHEETPR: getWorksheetSettings().importSheetPr( rStrm ); break;
+ case BIFF12_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF12_ID_SHEETFORMATPR: importSheetFormatPr( rStrm ); break;
+ case BIFF12_ID_HYPERLINK: importHyperlink( rStrm ); break;
+ case BIFF12_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
+ case BIFF12_ID_PAGESETUP: getPageSettings().importPageSetup( getRelations(), rStrm ); break;
+ case BIFF12_ID_PRINTOPTIONS: getPageSettings().importPrintOptions( rStrm ); break;
+ case BIFF12_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
+ case BIFF12_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
+ case BIFF12_ID_SHEETPROTECTION: getWorksheetSettings().importSheetProtection( rStrm ); break;
+ case BIFF12_ID_PHONETICPR: getWorksheetSettings().importPhoneticPr( rStrm ); break;
+ case BIFF12_ID_DRAWING: importDrawing( rStrm ); break;
+ case BIFF12_ID_LEGACYDRAWING: importLegacyDrawing( rStrm ); break;
}
break;
- case OOBIN_ID_SHEETVIEWS:
+ case BIFF12_ID_SHEETVIEWS:
switch( nRecId )
{
- case OOBIN_ID_SHEETVIEW: getSheetViewSettings().importSheetView( rStrm ); return this;
+ case BIFF12_ID_SHEETVIEW: getSheetViewSettings().importSheetView( rStrm ); return this;
}
break;
- case OOBIN_ID_SHEETVIEW:
+ case BIFF12_ID_SHEETVIEW:
switch( nRecId )
{
- case OOBIN_ID_PANE: getSheetViewSettings().importPane( rStrm ); break;
- case OOBIN_ID_SELECTION: getSheetViewSettings().importSelection( rStrm ); break;
+ case BIFF12_ID_PANE: getSheetViewSettings().importPane( rStrm ); break;
+ case BIFF12_ID_SELECTION: getSheetViewSettings().importSelection( rStrm ); break;
}
break;
- case OOBIN_ID_COLS:
- if( nRecId == OOBIN_ID_COL ) importCol( rStrm );
+ case BIFF12_ID_COLS:
+ if( nRecId == BIFF12_ID_COL ) importCol( rStrm );
break;
- case OOBIN_ID_MERGECELLS:
- if( nRecId == OOBIN_ID_MERGECELL ) importMergeCell( rStrm );
+ case BIFF12_ID_MERGECELLS:
+ if( nRecId == BIFF12_ID_MERGECELL ) importMergeCell( rStrm );
break;
- case OOBIN_ID_ROWBREAKS:
- if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, true );
+ case BIFF12_ID_ROWBREAKS:
+ if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, true );
break;
- case OOBIN_ID_COLBREAKS:
- if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, false );
+ case BIFF12_ID_COLBREAKS:
+ if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, false );
break;
- case OOBIN_ID_OLEOBJECTS:
- if( nRecId == OOBIN_ID_OLEOBJECT ) importOleObject( rStrm );
+ case BIFF12_ID_OLEOBJECTS:
+ if( nRecId == BIFF12_ID_OLEOBJECT ) importOleObject( rStrm );
break;
- case OOBIN_ID_CONTROLS:
- if( nRecId == OOBIN_ID_CONTROL ) importControl( rStrm );
+ case BIFF12_ID_CONTROLS:
+ if( nRecId == BIFF12_ID_CONTROL ) importControl( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorksheetFragment::getRecordInfos() const
+const RecordInfo* WorksheetFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_CFRULE, OOBIN_ID_CFRULE + 1 },
- { OOBIN_ID_COLBREAKS, OOBIN_ID_COLBREAKS + 1 },
- { OOBIN_ID_COLORSCALE, OOBIN_ID_COLORSCALE + 1 },
- { OOBIN_ID_COLS, OOBIN_ID_COLS + 1 },
- { OOBIN_ID_CONDFORMATTING, OOBIN_ID_CONDFORMATTING + 1 },
- { OOBIN_ID_CONTROLS, OOBIN_ID_CONTROLS + 2 },
- { OOBIN_ID_CUSTOMSHEETVIEW, OOBIN_ID_CUSTOMSHEETVIEW + 1 },
- { OOBIN_ID_CUSTOMSHEETVIEWS, OOBIN_ID_CUSTOMSHEETVIEWS + 3 },
- { OOBIN_ID_DATABAR, OOBIN_ID_DATABAR + 1 },
- { OOBIN_ID_DATAVALIDATIONS, OOBIN_ID_DATAVALIDATIONS + 1 },
- { OOBIN_ID_HEADERFOOTER, OOBIN_ID_HEADERFOOTER + 1 },
- { OOBIN_ID_ICONSET, OOBIN_ID_ICONSET + 1 },
- { OOBIN_ID_MERGECELLS, OOBIN_ID_MERGECELLS + 1 },
- { OOBIN_ID_OLEOBJECTS, OOBIN_ID_OLEOBJECTS + 2 },
- { OOBIN_ID_ROW, -1 },
- { OOBIN_ID_ROWBREAKS, OOBIN_ID_ROWBREAKS + 1 },
- { OOBIN_ID_SCENARIO, OOBIN_ID_SCENARIO + 1 },
- { OOBIN_ID_SCENARIOS, OOBIN_ID_SCENARIOS + 1 },
- { OOBIN_ID_SHEETDATA, OOBIN_ID_SHEETDATA + 1 },
- { OOBIN_ID_SHEETVIEW, OOBIN_ID_SHEETVIEW + 1 },
- { OOBIN_ID_SHEETVIEWS, OOBIN_ID_SHEETVIEWS + 1 },
- { OOBIN_ID_TABLEPARTS, OOBIN_ID_TABLEPARTS + 2 },
- { OOBIN_ID_WORKSHEET, OOBIN_ID_WORKSHEET + 1 },
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_CFRULE, BIFF12_ID_CFRULE + 1 },
+ { BIFF12_ID_COLBREAKS, BIFF12_ID_COLBREAKS + 1 },
+ { BIFF12_ID_COLORSCALE, BIFF12_ID_COLORSCALE + 1 },
+ { BIFF12_ID_COLS, BIFF12_ID_COLS + 1 },
+ { BIFF12_ID_CONDFORMATTING, BIFF12_ID_CONDFORMATTING + 1 },
+ { BIFF12_ID_CONTROLS, BIFF12_ID_CONTROLS + 2 },
+ { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 },
+ { BIFF12_ID_CUSTOMSHEETVIEW, BIFF12_ID_CUSTOMSHEETVIEW + 1 },
+ { BIFF12_ID_CUSTOMSHEETVIEWS, BIFF12_ID_CUSTOMSHEETVIEWS + 3 },
+ { BIFF12_ID_DATABAR, BIFF12_ID_DATABAR + 1 },
+ { BIFF12_ID_DATAVALIDATIONS, BIFF12_ID_DATAVALIDATIONS + 1 },
+ { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_HEADERFOOTER, BIFF12_ID_HEADERFOOTER + 1 },
+ { BIFF12_ID_ICONSET, BIFF12_ID_ICONSET + 1 },
+ { BIFF12_ID_MERGECELLS, BIFF12_ID_MERGECELLS + 1 },
+ { BIFF12_ID_OLEOBJECTS, BIFF12_ID_OLEOBJECTS + 2 },
+ { BIFF12_ID_ROW, -1 },
+ { BIFF12_ID_ROWBREAKS, BIFF12_ID_ROWBREAKS + 1 },
+ { BIFF12_ID_SCENARIO, BIFF12_ID_SCENARIO + 1 },
+ { BIFF12_ID_SCENARIOS, BIFF12_ID_SCENARIOS + 1 },
+ { BIFF12_ID_SHEETDATA, BIFF12_ID_SHEETDATA + 1 },
+ { BIFF12_ID_SHEETVIEW, BIFF12_ID_SHEETVIEW + 1 },
+ { BIFF12_ID_SHEETVIEWS, BIFF12_ID_SHEETVIEWS + 1 },
+ { BIFF12_ID_TABLEPARTS, BIFF12_ID_TABLEPARTS + 2 },
+ { BIFF12_ID_WORKSHEET, BIFF12_ID_WORKSHEET + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxWorksheetFragment::initializeImport()
+void WorksheetFragment::initializeImport()
{
// initial processing in base class WorksheetHelper
initializeWorksheetImport();
// import query table fragments related to this worksheet
- RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "queryTable" ) );
+ RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "queryTable" ) );
for( Relations::const_iterator aIt = xQueryRels->begin(), aEnd = xQueryRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxQueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
// import pivot table fragments related to this worksheet
- RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "pivotTable" ) );
+ RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "pivotTable" ) );
for( Relations::const_iterator aIt = xPivotRels->begin(), aEnd = xPivotRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxPivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
}
-void OoxWorksheetFragment::finalizeImport()
+void WorksheetFragment::finalizeImport()
{
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
@@ -504,13 +506,13 @@ void OoxWorksheetFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxWorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
+void WorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
{
// for whatever reason, this flag is still stored separated from the page settings
getPageSettings().setFitToPagesMode( rAttribs.getBool( XML_fitToPage, false ) );
}
-void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
+void WorksheetFragment::importDimension( const AttributeList& rAttribs )
{
CellRangeAddress aRange;
getAddressConverter().convertToCellRangeUnchecked( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() );
@@ -522,7 +524,7 @@ void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
extendUsedArea( aRange );
}
-void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
+void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
{
// default column settings
setBaseColumnWidth( rAttribs.getInteger( XML_baseColWidth, 8 ) );
@@ -536,7 +538,7 @@ void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
rAttribs.getBool( XML_thickBottom, false ) );
}
-void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
+void WorksheetFragment::importCol( const AttributeList& rAttribs )
{
ColumnModel aModel;
aModel.mnFirstCol = rAttribs.getInteger( XML_min, -1 );
@@ -551,14 +553,14 @@ void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
setColumnModel( aModel );
}
-void OoxWorksheetFragment::importMergeCell( const AttributeList& rAttribs )
+void WorksheetFragment::importMergeCell( const AttributeList& rAttribs )
{
CellRangeAddress aRange;
if( getAddressConverter().convertToCellRange( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
setMergedRange( aRange );
}
-void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
+void WorksheetFragment::importHyperlink( const AttributeList& rAttribs )
{
HyperlinkModel aModel;
if( getAddressConverter().convertToCellRange( aModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
@@ -571,7 +573,7 @@ void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
}
}
-void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
+void WorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
{
PageBreakModel aModel;
aModel.mnColRow = rAttribs.getInteger( XML_id, 0 );
@@ -581,22 +583,22 @@ void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBr
setPageBreak( aModel, bRowBreak );
}
-void OoxWorksheetFragment::importDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importDrawing( const AttributeList& rAttribs )
{
setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxWorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
{
setVmlDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
+void WorksheetFragment::importOleObject( const AttributeList& rAttribs )
{
::oox::vml::OleObjectInfo aInfo;
aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
OSL_ENSURE( rAttribs.hasAttribute( XML_link ) != rAttribs.hasAttribute( R_TOKEN( id ) ),
- "OoxWorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
+ "WorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
aInfo.mbLinked = rAttribs.hasAttribute( XML_link );
if( aInfo.mbLinked )
aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rAttribs.getString( XML_link, OUString() ) );
@@ -609,7 +611,7 @@ void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
getVmlDrawing().registerOleObject( aInfo );
}
-void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
+void WorksheetFragment::importControl( const AttributeList& rAttribs )
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
@@ -618,7 +620,7 @@ void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
getVmlDrawing().registerControl( aInfo );
}
-void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
+void WorksheetFragment::importDimension( SequenceInputStream& rStrm )
{
BinRange aBinRange;
aBinRange.read( rStrm );
@@ -632,7 +634,7 @@ void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
extendUsedArea( aRange );
}
-void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
+void WorksheetFragment::importSheetFormatPr( SequenceInputStream& rStrm )
{
sal_Int32 nDefaultWidth;
sal_uInt16 nBaseWidth, nDefaultHeight, nFlags;
@@ -640,9 +642,9 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
// base column with
setBaseColumnWidth( nBaseWidth );
- // default width is stored as 1/256th of a character in OOBIN, convert to entire character
+ // default width is stored as 1/256th of a character in BIFF12, convert to entire character
setDefaultColumnWidth( static_cast< double >( nDefaultWidth ) / 256.0 );
- // row height is in twips in OOBIN, convert to points; equal flags in BIFF and OOBIN
+ // row height is in twips in BIFF12, convert to points; equal flags in all BIFFs
setDefaultRowSettings(
nDefaultHeight / 20.0,
getFlag( nFlags, BIFF_DEFROW_CUSTOMHEIGHT ),
@@ -651,7 +653,7 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
}
-void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
+void WorksheetFragment::importCol( SequenceInputStream& rStrm )
{
ColumnModel aModel;
@@ -659,12 +661,12 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
sal_uInt16 nFlags;
rStrm >> aModel.mnFirstCol >> aModel.mnLastCol >> nWidth >> aModel.mnXfId >> nFlags;
- // column indexes are 0-based in OOBIN, but ColumnModel expects 1-based
+ // column indexes are 0-based in BIFF12, but ColumnModel expects 1-based
++aModel.mnFirstCol;
++aModel.mnLastCol;
- // width is stored as 1/256th of a character in OOBIN, convert to entire character
+ // width is stored as 1/256th of a character in BIFF12, convert to entire character
aModel.mfWidth = static_cast< double >( nWidth ) / 256.0;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 8, 3 );
aModel.mbShowPhonetic = getFlag( nFlags, BIFF_COLINFO_SHOWPHONETIC );
aModel.mbHidden = getFlag( nFlags, BIFF_COLINFO_HIDDEN );
@@ -673,7 +675,7 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
setColumnModel( aModel );
}
-void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
+void WorksheetFragment::importMergeCell( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
@@ -682,20 +684,20 @@ void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
setMergedRange( aRange );
}
-void OoxWorksheetFragment::importHyperlink( RecordInputStream& rStrm )
+void WorksheetFragment::importHyperlink( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
HyperlinkModel aModel;
if( getAddressConverter().convertToCellRange( aModel.maRange, aBinRange, getSheetIndex(), true, true ) )
{
- aModel.maTarget = getRelations().getExternalTargetFromRelId( rStrm.readString() );
+ aModel.maTarget = getRelations().getExternalTargetFromRelId( BiffHelper::readString( rStrm ) );
rStrm >> aModel.maLocation >> aModel.maTooltip >> aModel.maDisplay;
setHyperlink( aModel );
}
}
-void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
+void WorksheetFragment::importBrk( SequenceInputStream& rStrm, bool bRowBreak )
{
PageBreakModel aModel;
sal_Int32 nManual;
@@ -704,44 +706,44 @@ void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
setPageBreak( aModel, bRowBreak );
}
-void OoxWorksheetFragment::importDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importDrawing( SequenceInputStream& rStrm )
{
- setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
-void OoxWorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importLegacyDrawing( SequenceInputStream& rStrm )
{
- setVmlDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setVmlDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
-void OoxWorksheetFragment::importOleObject( RecordInputStream& rStrm )
+void WorksheetFragment::importOleObject( SequenceInputStream& rStrm )
{
::oox::vml::OleObjectInfo aInfo;
sal_Int32 nAspect, nUpdateMode, nShapeId;
sal_uInt16 nFlags;
rStrm >> nAspect >> nUpdateMode >> nShapeId >> nFlags >> aInfo.maProgId;
- aInfo.mbLinked = getFlag( nFlags, OOBIN_OLEOBJECT_LINKED );
+ aInfo.mbLinked = getFlag( nFlags, BIFF12_OLEOBJECT_LINKED );
if( aInfo.mbLinked )
aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rStrm );
else
- importEmbeddedOleData( aInfo.maEmbeddedData, rStrm.readString() );
+ importEmbeddedOleData( aInfo.maEmbeddedData, BiffHelper::readString( rStrm ) );
aInfo.setShapeId( nShapeId );
- aInfo.mbShowAsIcon = nAspect == OOBIN_OLEOBJECT_ICON;
- aInfo.mbAutoUpdate = nUpdateMode == OOBIN_OLEOBJECT_ALWAYS;
- aInfo.mbAutoLoad = getFlag( nFlags, OOBIN_OLEOBJECT_AUTOLOAD );
+ aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON;
+ aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS;
+ aInfo.mbAutoLoad = getFlag( nFlags, BIFF12_OLEOBJECT_AUTOLOAD );
getVmlDrawing().registerOleObject( aInfo );
}
-void OoxWorksheetFragment::importControl( RecordInputStream& rStrm )
+void WorksheetFragment::importControl( SequenceInputStream& rStrm )
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( rStrm.readInt32() );
- aInfo.maFragmentPath = getFragmentPathFromRelId( rStrm.readString() );
+ aInfo.maFragmentPath = getFragmentPathFromRelId( BiffHelper::readString( rStrm ) );
rStrm >> aInfo.maName;
getVmlDrawing().registerControl( aInfo );
}
-void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
+void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
{
OUString aFragmentPath = getFragmentPathFromRelId( rRelId );
if( aFragmentPath.getLength() > 0 )
@@ -750,8 +752,9 @@ void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbedded
// ============================================================================
-BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, eSheetType, nSheet )
+BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, eSheetType, nSheet )
{
}
@@ -774,9 +777,10 @@ bool BiffWorksheetFragment::importFragment()
PageSettings& rPageSett = getPageSettings();
// process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// skip unknown embedded fragments (BOF/EOF blocks)
skipFragment();
@@ -784,126 +788,130 @@ bool BiffWorksheetFragment::importFragment()
else
{
// cache base stream position to detect if record is already processed
- sal_Int64 nStrmPos = mrStrm.tellBase();
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_Int64 nStrmPos = rStrm.tellBase();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( mrStrm ); break;
- case BIFF_ID_CALCCOUNT: rWorkbookSett.importCalcCount( mrStrm ); break;
- case BIFF_ID_CALCMODE: rWorkbookSett.importCalcMode( mrStrm ); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth(); break;
- case BIFF_ID_DELTA: rWorkbookSett.importDelta( mrStrm ); break;
- case BIFF2_ID_DIMENSION: importDimension(); break;
- case BIFF3_ID_DIMENSION: importDimension(); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( mrStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( mrStrm ); break;
- case BIFF_ID_HORPAGEBREAKS: importPageBreaks( true ); break;
- case BIFF_ID_ITERATION: rWorkbookSett.importIteration( mrStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( mrStrm ); break;
- case BIFF_ID_PANE: rSheetViewSett.importPane( mrStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( mrStrm ); break;
- case BIFF_ID_PRINTGRIDLINES: rPageSett.importPrintGridLines( mrStrm ); break;
- case BIFF_ID_PRINTHEADERS: rPageSett.importPrintHeaders( mrStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( mrStrm ); break;
- case BIFF_ID_REFMODE: rWorkbookSett.importRefMode( mrStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( mrStrm ); break;
- case BIFF_ID_SELECTION: rSheetViewSett.importSelection( mrStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( mrStrm ); break;
- case BIFF_ID_VERPAGEBREAKS: importPageBreaks( false ); break;
+ case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
+ case BIFF_ID_CALCCOUNT: rWorkbookSett.importCalcCount( rStrm ); break;
+ case BIFF_ID_CALCMODE: rWorkbookSett.importCalcMode( rStrm ); break;
+ case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
+ case BIFF_ID_DELTA: rWorkbookSett.importDelta( rStrm ); break;
+ case BIFF2_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF3_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
+ case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
+ case BIFF_ID_HORPAGEBREAKS: importPageBreaks( rStrm, true ); break;
+ case BIFF_ID_ITERATION: rWorkbookSett.importIteration( rStrm ); break;
+ case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
+ case BIFF_ID_PANE: rSheetViewSett.importPane( rStrm ); break;
+ case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
+ case BIFF_ID_PRINTGRIDLINES: rPageSett.importPrintGridLines( rStrm ); break;
+ case BIFF_ID_PRINTHEADERS: rPageSett.importPrintHeaders( rStrm ); break;
+ case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
+ case BIFF_ID_REFMODE: rWorkbookSett.importRefMode( rStrm ); break;
+ case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
+ case BIFF_ID_SELECTION: rSheetViewSett.importSelection( rStrm ); break;
+ case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
+ case BIFF_ID_VERPAGEBREAKS: importPageBreaks( rStrm, false ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF_ID_COLUMNDEFAULT: importColumnDefault(); break;
- case BIFF_ID_COLWIDTH: importColWidth(); break;
- case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLUMNDEFAULT: importColumnDefault( rStrm ); break;
+ case BIFF_ID_COLWIDTH: importColWidth( rStrm ); break;
+ case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells(); break; // #i62300# also in BIFF5
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition(); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break; // #i62300# also in BIFF5
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( mrStrm ); break;
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( mrStrm ); break;
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF_ID_DATAVALIDATION: importDataValidation(); break;
- case BIFF_ID_DATAVALIDATIONS: importDataValidations(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_HYPERLINK: importHyperlink(); break;
- case BIFF_ID_LABELRANGES: importLabelRanges(); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells(); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_PHONETICPR: rWorksheetSett.importPhoneticPr( mrStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( mrStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition(); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SCENARIOS: importScenarios(); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead(); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
+ case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( rStrm ); break;
+ case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF_ID_DATAVALIDATION: importDataValidation( rStrm ); break;
+ case BIFF_ID_DATAVALIDATIONS: importDataValidations( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_HYPERLINK: importHyperlink( rStrm ); break;
+ case BIFF_ID_LABELRANGES: importLabelRanges( rStrm ); break;
+ case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_PHONETICPR: rWorksheetSett.importPhoneticPr( rStrm ); break;
+ case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
+ case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
+ case BIFF_ID_QUERYTABLE: importQueryTable( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SCENARIOS: importScenarios( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
@@ -911,26 +919,41 @@ bool BiffWorksheetFragment::importFragment()
}
}
- // record not processed, try cell records
- if( mrStrm.tellBase() == nStrmPos )
- aSheetData.importRecord();
- // record still not processed, try pivot table records
- if( mxPTContext.get() && (mrStrm.tellBase() == nStrmPos) )
- mxPTContext->importRecord();
+ // record not processed, try record context objects
+ if( rStrm.tellBase() == nStrmPos )
+ {
+ // first, try cell table records
+ aSheetData.importRecord( rStrm );
+ // handle another open record context
+ if( mxContext.get() )
+ {
+ // if it was a cell table record, forget the other record context
+ if( rStrm.tellBase() == nStrmPos )
+ mxContext->importRecord( rStrm );
+ else
+ mxContext.reset();
+ }
+ }
}
}
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// private --------------------------------------------------------------------
-void BiffWorksheetFragment::importColInfo()
+void BiffWorksheetFragment::importAutoFilter( BiffInputStream& rStrm )
+{
+ mxContext.reset( new BiffAutoFilterContext( *this, getAutoFilters().createAutoFilter() ) );
+ mxContext->importRecord( rStrm );
+}
+
+void BiffWorksheetFragment::importColInfo( BiffInputStream& rStrm )
{
sal_uInt16 nFirstCol, nLastCol, nWidth, nXfId, nFlags;
- mrStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
+ rStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
ColumnModel aModel;
// column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -947,18 +970,18 @@ void BiffWorksheetFragment::importColInfo()
setColumnModel( aModel );
}
-void BiffWorksheetFragment::importColumnDefault()
+void BiffWorksheetFragment::importColumnDefault( BiffInputStream& rStrm )
{
sal_uInt16 nFirstCol, nLastCol, nXfId;
- mrStrm >> nFirstCol >> nLastCol >> nXfId;
+ rStrm >> nFirstCol >> nLastCol >> nXfId;
setDefaultColumnFormat( nFirstCol, nLastCol, nXfId );
}
-void BiffWorksheetFragment::importColWidth()
+void BiffWorksheetFragment::importColWidth( BiffInputStream& rStrm )
{
sal_uInt8 nFirstCol, nLastCol;
sal_uInt16 nWidth;
- mrStrm >> nFirstCol >> nLastCol >> nWidth;
+ rStrm >> nFirstCol >> nLastCol >> nWidth;
ColumnModel aModel;
// column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -970,20 +993,20 @@ void BiffWorksheetFragment::importColWidth()
setColumnModel( aModel );
}
-void BiffWorksheetFragment::importDefColWidth()
+void BiffWorksheetFragment::importDefColWidth( BiffInputStream& rStrm )
{
/* Stored as entire number of characters without padding pixels, which
will be added in setBaseColumnWidth(). Call has no effect, if a
width has already been set from the STANDARDWIDTH record. */
- setBaseColumnWidth( mrStrm.readuInt16() );
+ setBaseColumnWidth( rStrm.readuInt16() );
}
-void BiffWorksheetFragment::importDefRowHeight()
+void BiffWorksheetFragment::importDefRowHeight( BiffInputStream& rStrm )
{
sal_uInt16 nFlags = BIFF_DEFROW_CUSTOMHEIGHT, nHeight;
if( getBiff() != BIFF2 )
- mrStrm >> nFlags;
- mrStrm >> nHeight;
+ rStrm >> nFlags;
+ rStrm >> nHeight;
if( getBiff() == BIFF2 )
nHeight &= BIFF2_DEFROW_MASK;
// row height is in twips in BIFF, convert to points
@@ -995,11 +1018,11 @@ void BiffWorksheetFragment::importDefRowHeight()
getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
}
-void BiffWorksheetFragment::importDataValidations()
+void BiffWorksheetFragment::importDataValidations( BiffInputStream& rStrm )
{
sal_Int32 nObjId;
- mrStrm.skip( 10 );
- mrStrm >> nObjId;
+ rStrm.skip( 10 );
+ rStrm >> nObjId;
//! TODO: invalidate object id in drawing object manager
}
@@ -1026,50 +1049,50 @@ ApiTokenSequence lclReadDataValFormula( BiffInputStream& rStrm, FormulaParser& r
} // namespace
-void BiffWorksheetFragment::importDataValidation()
+void BiffWorksheetFragment::importDataValidation( BiffInputStream& rStrm )
{
ValidationModel aModel;
// flags
sal_uInt32 nFlags;
- mrStrm >> nFlags;
- aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
- aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
- aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+ rStrm >> nFlags;
+ aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+ aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+ aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
aModel.mbAllowBlank = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
aModel.mbNoDropDown = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
aModel.mbShowErrorMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWERROR );
// message strings
- aModel.maInputTitle = lclReadDataValMessage( mrStrm );
- aModel.maErrorTitle = lclReadDataValMessage( mrStrm );
- aModel.maInputMessage = lclReadDataValMessage( mrStrm );
- aModel.maErrorMessage = lclReadDataValMessage( mrStrm );
+ aModel.maInputTitle = lclReadDataValMessage( rStrm );
+ aModel.maErrorTitle = lclReadDataValMessage( rStrm );
+ aModel.maInputMessage = lclReadDataValMessage( rStrm );
+ aModel.maErrorMessage = lclReadDataValMessage( rStrm );
// condition formula(s)
FormulaParser& rParser = getFormulaParser();
- aModel.maTokens1 = lclReadDataValFormula( mrStrm, rParser );
- aModel.maTokens2 = lclReadDataValFormula( mrStrm, rParser );
+ aModel.maTokens1 = lclReadDataValFormula( rStrm, rParser );
+ aModel.maTokens2 = lclReadDataValFormula( rStrm, rParser );
// process string list of a list validation (convert to list of string tokens)
if( (aModel.mnType == XML_list) && getFlag( nFlags, BIFF_DATAVAL_STRINGLIST ) )
rParser.convertStringToStringList( aModel.maTokens1, '\0', true );
// cell range list
BinRangeList aRanges;
- mrStrm >> aRanges;
+ rStrm >> aRanges;
getAddressConverter().convertToCellRangeList( aModel.maRanges, aRanges, getSheetIndex(), true );
// set validation data
setValidation( aModel );
}
-void BiffWorksheetFragment::importDimension()
+void BiffWorksheetFragment::importDimension( BiffInputStream& rStrm )
{
// 32-bit row indexes in BIFF8
- bool bInt32Rows = (mrStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
+ bool bInt32Rows = (rStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
BinRange aBinRange;
- aBinRange.read( mrStrm, true, bInt32Rows );
+ aBinRange.read( rStrm, true, bInt32Rows );
/* BIFF stores the used area with end column and end row increased by 1
(first unused column and row). */
if( (aBinRange.maFirst.mnCol < aBinRange.maLast.mnCol) && (aBinRange.maFirst.mnRow < aBinRange.maLast.mnRow) )
@@ -1083,13 +1106,13 @@ void BiffWorksheetFragment::importDimension()
}
}
-void BiffWorksheetFragment::importHyperlink()
+void BiffWorksheetFragment::importHyperlink( BiffInputStream& rStrm )
{
HyperlinkModel aModel;
// read cell range for the hyperlink
BinRange aBiffRange;
- mrStrm >> aBiffRange;
+ rStrm >> aBiffRange;
// #i80006# Excel silently ignores invalid hi-byte of column index (TODO: everywhere?)
aBiffRange.maFirst.mnCol &= 0xFF;
aBiffRange.maLast.mnCol &= 0xFF;
@@ -1097,15 +1120,15 @@ void BiffWorksheetFragment::importHyperlink()
return;
// try to read the StdHlink data
- if( !::oox::ole::OleHelper::importStdHlink( aModel, mrStrm, true ) )
+ if( !::oox::ole::OleHelper::importStdHlink( aModel, rStrm, true ) )
return;
// try to read the optional following SCREENTIP record
- if( (mrStrm.getNextRecId() == BIFF_ID_SCREENTIP) && mrStrm.startNextRecord() )
+ if( (rStrm.getNextRecId() == BIFF_ID_SCREENTIP) && rStrm.startNextRecord() )
{
- mrStrm.skip( 2 ); // repeated record id
+ rStrm.skip( 2 ); // repeated record id
// the cell range, again
- mrStrm >> aBiffRange;
+ rStrm >> aBiffRange;
CellRangeAddress aRange;
if( getAddressConverter().convertToCellRange( aRange, aBiffRange, getSheetIndex(), true, true ) &&
(aRange.StartColumn == aModel.maRange.StartColumn) &&
@@ -1115,7 +1138,7 @@ void BiffWorksheetFragment::importHyperlink()
{
/* This time, we have no string length, no flag field, and a
null-terminated 16-bit character array. */
- aModel.maTooltip = mrStrm.readNulUnicodeArray();
+ aModel.maTooltip = rStrm.readNulUnicodeArray();
}
}
@@ -1123,72 +1146,78 @@ void BiffWorksheetFragment::importHyperlink()
setHyperlink( aModel );
}
-void BiffWorksheetFragment::importLabelRanges()
+void BiffWorksheetFragment::importLabelRanges( BiffInputStream& rStrm )
{
BinRangeList aBiffRowRanges, aBiffColRanges;
- mrStrm >> aBiffRowRanges >> aBiffColRanges;
+ rStrm >> aBiffRowRanges >> aBiffColRanges;
ApiCellRangeList aColRanges, aRowRanges;
getAddressConverter().convertToCellRangeList( aColRanges, aBiffColRanges, getSheetIndex(), true );
getAddressConverter().convertToCellRangeList( aRowRanges, aBiffRowRanges, getSheetIndex(), true );
setLabelRanges( aColRanges, aRowRanges );
}
-void BiffWorksheetFragment::importMergedCells()
+void BiffWorksheetFragment::importMergedCells( BiffInputStream& rStrm )
{
BinRangeList aBiffRanges;
- mrStrm >> aBiffRanges;
+ rStrm >> aBiffRanges;
ApiCellRangeList aRanges;
getAddressConverter().convertToCellRangeList( aRanges, aBiffRanges, getSheetIndex(), true );
for( ApiCellRangeList::const_iterator aIt = aRanges.begin(), aEnd = aRanges.end(); aIt != aEnd; ++aIt )
setMergedRange( *aIt );
}
-void BiffWorksheetFragment::importPageBreaks( bool bRowBreak )
+void BiffWorksheetFragment::importPageBreaks( BiffInputStream& rStrm, bool bRowBreak )
{
PageBreakModel aModel;
aModel.mbManual = true; // only manual breaks stored in BIFF
bool bBiff8 = getBiff() == BIFF8; // skip start/end columns or rows in BIFF8
sal_uInt16 nCount;
- mrStrm >> nCount;
- for( sal_uInt16 nIndex = 0; !mrStrm.isEof() && (nIndex < nCount); ++nIndex )
+ rStrm >> nCount;
+ for( sal_uInt16 nIndex = 0; !rStrm.isEof() && (nIndex < nCount); ++nIndex )
{
- aModel.mnColRow = mrStrm.readuInt16();
+ aModel.mnColRow = rStrm.readuInt16();
setPageBreak( aModel, bRowBreak );
if( bBiff8 )
- mrStrm.skip( 4 );
+ rStrm.skip( 4 );
}
}
-void BiffWorksheetFragment::importPTDefinition()
+void BiffWorksheetFragment::importPTDefinition( BiffInputStream& rStrm )
{
- mxPTContext.reset( new BiffPivotTableContext( *this, getPivotTables().createPivotTable() ) );
- mxPTContext->importRecord();
+ mxContext.reset( new BiffPivotTableContext( *this ) );
+ mxContext->importRecord( rStrm );
}
-void BiffWorksheetFragment::importScenarios()
+void BiffWorksheetFragment::importQueryTable( BiffInputStream& rStrm )
{
- getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( mrStrm );
+ mxContext.reset( new BiffQueryTableContext( *this ) );
+ mxContext->importRecord( rStrm );
}
-void BiffWorksheetFragment::importSharedFeatHead()
+void BiffWorksheetFragment::importScenarios( BiffInputStream& rStrm )
{
- mrStrm.skip( 12 );
- sal_uInt16 nType = mrStrm.readuInt16();
- mrStrm.skip( 5 );
+ getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( rStrm );
+}
+
+void BiffWorksheetFragment::importSharedFeatHead( BiffInputStream& rStrm )
+{
+ rStrm.skip( 12 );
+ sal_uInt16 nType = rStrm.readuInt16();
+ rStrm.skip( 5 );
switch( nType )
{
case BIFF_SHRFEATHEAD_SHEETPROT:
- if( mrStrm.getRemaining() >= 4 )
- getWorksheetSettings().importSheetProtection( mrStrm );
+ if( rStrm.getRemaining() >= 4 )
+ getWorksheetSettings().importSheetProtection( rStrm );
break;
}
}
-void BiffWorksheetFragment::importStandardWidth()
+void BiffWorksheetFragment::importStandardWidth( BiffInputStream& rStrm )
{
sal_uInt16 nWidth;
- mrStrm >> nWidth;
+ rStrm >> nWidth;
// width is stored as 1/256th of a character in BIFF, convert to entire character
double fWidth = static_cast< double >( nWidth ) / 256.0;
// set as default width, will override the width from DEFCOLWIDTH record
@@ -1199,4 +1228,3 @@ void BiffWorksheetFragment::importStandardWidth()
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index d2d42f2be369..48ffac388cfd 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -26,10 +26,10 @@
************************************************************************/
#include "oox/xls/worksheethelper.hxx"
+
#include <algorithm>
-#include <utility>
#include <list>
-#include <rtl/ustrbuf.hxx>
+#include <utility>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -37,33 +37,35 @@
#include <com/sun/star/sheet/TableValidationVisibility.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
-#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
+#include <com/sun/star/sheet/XLabelRanges.hpp>
#include <com/sun/star/sheet/XMultiFormulaTokens.hpp>
-#include <com/sun/star/sheet/XSheetOutline.hpp>
#include <com/sun/star/sheet/XMultipleOperation.hpp>
-#include <com/sun/star/sheet/XLabelRanges.hpp>
+#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
+#include <com/sun/star/sheet/XSheetCondition.hpp>
+#include <com/sun/star/sheet/XSheetOutline.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XMergeable.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/commentsbuffer.hxx"
#include "oox/xls/condformatbuffer.hxx"
#include "oox/xls/drawingfragment.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/pagesettings.hxx"
+#include "oox/xls/querytablebuffer.hxx"
#include "oox/xls/sharedformulabuffer.hxx"
#include "oox/xls/sharedstringsbuffer.hxx"
#include "oox/xls/stylesbuffer.hxx"
@@ -73,72 +75,42 @@
#include "oox/xls/worksheetbuffer.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XDrawPageSupplier;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::sheet::ConditionOperator;
-using ::com::sun::star::sheet::ValidationType;
-using ::com::sun::star::sheet::ValidationAlertStyle;
-using ::com::sun::star::sheet::XCellAddressable;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XLabelRanges;
-using ::com::sun::star::sheet::XMultiFormulaTokens;
-using ::com::sun::star::sheet::XMultipleOperation;
-using ::com::sun::star::sheet::XSheetCellRangeContainer;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetCondition;
-using ::com::sun::star::sheet::XSheetOutline;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::table::BorderLine;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::table::XColumnRowRange;
-using ::com::sun::star::table::XTableColumns;
-using ::com::sun::star::table::XTableRows;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::util::XMergeable;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormatTypes;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
{
- if( xProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
+ if( rxProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
{
double fPosition = static_cast< double >( nRow - rUsedArea.StartRow + 1 ) / (rUsedArea.EndRow - rUsedArea.StartRow + 1);
- if( xProgressBar->getPosition() < fPosition )
- xProgressBar->setPosition( fPosition );
+ if( rxProgressBar->getPosition() < fPosition )
+ rxProgressBar->setPosition( fPosition );
}
}
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, double fPosition )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, double fPosition )
{
- if( xProgressBar.get() )
- xProgressBar->setPosition( fPosition );
+ if( rxProgressBar.get() )
+ rxProgressBar->setPosition( fPosition );
}
// ----------------------------------------------------------------------------
@@ -329,14 +301,14 @@ ValidationModel::ValidationModel() :
{
}
-void ValidationModel::setBinType( sal_uInt8 nType )
+void ValidationModel::setBiffType( sal_uInt8 nType )
{
static const sal_Int32 spnTypeIds[] = {
XML_none, XML_whole, XML_decimal, XML_list, XML_date, XML_time, XML_textLength, XML_custom };
mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_none );
}
-void ValidationModel::setBinOperator( sal_uInt8 nOperator )
+void ValidationModel::setBiffOperator( sal_uInt8 nOperator )
{
static const sal_Int32 spnOperators[] = {
XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -344,7 +316,7 @@ void ValidationModel::setBinOperator( sal_uInt8 nOperator )
mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
}
-void ValidationModel::setBinErrorStyle( sal_uInt8 nErrorStyle )
+void ValidationModel::setBiffErrorStyle( sal_uInt8 nErrorStyle )
{
static const sal_Int32 spnErrorStyles[] = { XML_stop, XML_warning, XML_information };
mnErrorStyle = STATIC_ARRAY_SELECT( spnErrorStyles, nErrorStyle, XML_stop );
@@ -358,7 +330,7 @@ class WorksheetData : public WorkbookHelper
public:
explicit WorksheetData(
const WorkbookHelper& rHelper,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
@@ -416,11 +388,15 @@ public:
inline CondFormatBuffer& getCondFormats() { return maCondFormats; }
/** Returns the buffer for all cell comments in this sheet. */
inline CommentsBuffer& getComments() { return maComments; }
+ /** Returns the auto filters for the sheet. */
+ inline AutoFilterBuffer& getAutoFilters() { return maAutoFilters; }
+ /** Returns the buffer for all web query tables in this sheet. */
+ inline QueryTableBuffer& getQueryTables() { return maQueryTables; }
/** Returns the page/print settings for this sheet. */
inline PageSettings& getPageSettings() { return maPageSett; }
/** Returns the view settings for this sheet. */
inline SheetViewSettings& getSheetViewSettings() { return maSheetViewSett; }
- /** Returns the VML drawing page for this sheet (OOX only!). */
+ /** Returns the VML drawing page for this sheet (OOXML/BIFF12 only!). */
inline VmlDrawing& getVmlDrawing() { return *mxVmlDrawing; }
/** Changes the current sheet type. */
@@ -543,13 +519,6 @@ private:
/** Merges the passed merged range and updates right/bottom cell borders. */
void finalizeMergedRange( const CellRangeAddress& rRange );
- /** Imports the drawing layer of the sheet (DrawingML part). */
- void finalizeDrawing();
- /** Imports the drawing layer of the sheet (VML part). */
- void finalizeVmlDrawing();
- /** Extends the used cell area with the area used by drawing objects. */
- void finalizeUsedArea();
-
/** Converts column properties for all columns in the sheet. */
void convertColumns();
/** Converts column properties. */
@@ -565,6 +534,9 @@ private:
/** Groups columns or rows for the given range. */
void groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastColRow, bool bCollapsed, bool bRows );
+ /** Imports the drawings of the sheet (DML, VML), and updates the used area. */
+ void finalizeDrawings();
+
private:
typedef ::std::auto_ptr< VmlDrawing > VmlDrawingPtr;
@@ -589,6 +561,8 @@ private:
SharedFormulaBuffer maSharedFmlas; /// Buffer for shared formulas in this sheet.
CondFormatBuffer maCondFormats; /// Buffer for conditional formattings.
CommentsBuffer maComments; /// Buffer for all cell comments in this sheet.
+ AutoFilterBuffer maAutoFilters; /// Sheet auto filters (not associated to a table).
+ QueryTableBuffer maQueryTables; /// Buffer for all web query tables in this sheet.
PageSettings maPageSett; /// Page/print settings for this sheet.
SheetViewSettings maSheetViewSett; /// View settings for this sheet.
VmlDrawingPtr mxVmlDrawing; /// Collection of all VML shapes.
@@ -605,7 +579,7 @@ private:
// ----------------------------------------------------------------------------
-WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetData::WorksheetData( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
WorkbookHelper( rHelper ),
maTrueFormula( CREATE_OUSTRING( "=TRUE()" ) ),
maFalseFormula( CREATE_OUSTRING( "=FALSE()" ) ),
@@ -617,9 +591,11 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
maSharedFmlas( *this ),
maCondFormats( *this ),
maComments( *this ),
+ maAutoFilters( *this ),
+ maQueryTables( *this ),
maPageSett( *this ),
maSheetViewSett( *this ),
- mxProgressBar( xProgressBar ),
+ mxProgressBar( rxProgressBar ),
meSheetType( eSheetType ),
mbHasDefWidth( false )
{
@@ -645,7 +621,7 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
maDefRowModel.mbCollapsed = false;
// buffers
- if( getFilterType() == FILTER_OOX )
+ if( getFilterType() == FILTER_OOXML )
mxVmlDrawing.reset( new VmlDrawing( *this ) );
// prepare progress bars
@@ -1021,25 +997,17 @@ void WorksheetData::extendUsedArea( const CellRangeAddress& rRange )
void WorksheetData::extendShapeBoundingBox( const Rectangle& rShapeRect )
{
- // scale EMUs to 1/100 mm
- const UnitConverter& rUnitConv = getUnitConverter();
- Rectangle aShapeRectHmm(
- rUnitConv.scaleToMm100( rShapeRect.X, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Y, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Width, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Height, UNIT_EMU ) );
-
if( (maShapeBoundingBox.Width == 0) && (maShapeBoundingBox.Height == 0) )
{
// width and height of maShapeBoundingBox are assumed to be zero on first cell
- maShapeBoundingBox = aShapeRectHmm;
+ maShapeBoundingBox = rShapeRect;
}
else
{
- sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, aShapeRectHmm.X + aShapeRectHmm.Width );
- sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, aShapeRectHmm.Y + aShapeRectHmm.Height );
- maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, aShapeRectHmm.X );
- maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, aShapeRectHmm.Y );
+ sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, rShapeRect.X + rShapeRect.Width );
+ sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, rShapeRect.Y + rShapeRect.Height );
+ maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, rShapeRect.X );
+ maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, rShapeRect.Y );
maShapeBoundingBox.Width = nEndX - maShapeBoundingBox.X;
maShapeBoundingBox.Height = nEndY - maShapeBoundingBox.Y;
}
@@ -1069,7 +1037,7 @@ void WorksheetData::setDefaultColumnWidth( double fWidth )
void WorksheetData::setColumnModel( const ColumnModel& rModel )
{
- // convert 1-based OOX column indexes to 0-based API column indexes
+ // convert 1-based OOXML column indexes to 0-based API column indexes
sal_Int32 nFirstCol = rModel.mnFirstCol - 1;
sal_Int32 nLastCol = rModel.mnLastCol - 1;
if( (0 <= nFirstCol) && (nFirstCol <= mrMaxApiPos.Column) )
@@ -1093,7 +1061,7 @@ void WorksheetData::setDefaultRowSettings( double fHeight, bool bCustomHeight, b
void WorksheetData::setRowModel( const RowModel& rModel )
{
- // convert 1-based OOX row indexes to 0-based API row indexes
+ // convert 1-based OOXML row indexes to 0-based API row indexes
sal_Int32 nFirstRow = rModel.mnFirstRow - 1;
sal_Int32 nLastRow = rModel.mnLastRow - 1;
if( (0 <= nFirstRow) && (nFirstRow <= mrMaxApiPos.Row) )
@@ -1161,8 +1129,10 @@ void WorksheetData::finalizeWorksheetImport()
finalizeHyperlinkRanges();
finalizeValidationRanges();
finalizeMergedRanges();
+ maAutoFilters.finalizeImport( getSheetIndex() );
maSheetSett.finalizeImport();
maCondFormats.finalizeImport();
+ maQueryTables.finalizeImport();
maPageSett.finalizeImport();
maSheetViewSett.finalizeImport();
maSheetSett.finalizeImport();
@@ -1171,10 +1141,7 @@ void WorksheetData::finalizeWorksheetImport()
convertColumns();
convertRows();
lclUpdateProgressBar( mxFinalProgress, 0.75 );
- finalizeDrawing();
- finalizeVmlDrawing();
- maComments.finalizeImport(); // after VML drawing
- finalizeUsedArea(); // after DML and VML drawing
+ finalizeDrawings();
lclUpdateProgressBar( mxFinalProgress, 1.0 );
// reset current sheet index in global data
@@ -1432,8 +1399,8 @@ void WorksheetData::finalizeValidationRanges() const
{
PropertySet aPropSet( getCellRangeList( aIt->maRanges ) );
- Reference< XPropertySet > xValidation;
- if( aPropSet.getProperty( xValidation, PROP_Validation ) && xValidation.is() )
+ Reference< XPropertySet > xValidation( aPropSet.getAnyProperty( PROP_Validation ), UNO_QUERY );
+ if( xValidation.is() )
{
PropertySet aValProps( xValidation );
namespace csss = ::com::sun::star::sheet;
@@ -1561,42 +1528,6 @@ void WorksheetData::finalizeMergedRange( const CellRangeAddress& rRange )
}
}
-void WorksheetData::finalizeDrawing()
-{
- OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maDrawingPath.getLength() == 0),
- "WorksheetData::finalizeDrawing - unexpected DrawingML path" );
- if( (getFilterType() == FILTER_OOX) && (maDrawingPath.getLength() > 0) )
- importOoxFragment( new OoxDrawingFragment( *this, maDrawingPath ) );
-}
-
-void WorksheetData::finalizeVmlDrawing()
-{
- OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maVmlDrawingPath.getLength() == 0),
- "WorksheetData::finalizeVmlDrawing - unexpected VML path" );
- if( (getFilterType() == FILTER_OOX) && (maVmlDrawingPath.getLength() > 0) )
- importOoxFragment( new OoxVmlDrawingFragment( *this, maVmlDrawingPath ) );
-}
-
-void WorksheetData::finalizeUsedArea()
-{
- /* Extend used area of the sheet by cells covered with drawing objects.
- Needed if the imported document is inserted as "OLE object from file"
- and thus does not provide an OLE size property by itself. */
- if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
- extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
-
- // if no used area is set, default to A1
- if( maUsedArea.StartColumn > maUsedArea.EndColumn )
- maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
- if( maUsedArea.StartRow > maUsedArea.EndRow )
- maUsedArea.StartRow = maUsedArea.EndRow = 0;
-
- /* Register the used area of this sheet in global view settings. The
- global view settings will set the visible area if this document is an
- embedded OLE object. */
- getViewSettings().setSheetUsedArea( maUsedArea );
-}
-
void WorksheetData::convertColumns()
{
sal_Int32 nNextCol = 0;
@@ -1606,7 +1537,7 @@ void WorksheetData::convertColumns()
for( ColumnModelMap::const_iterator aIt = maColModels.begin(), aEnd = maColModels.end(); aIt != aEnd; ++aIt )
{
- // convert 1-based OOX column indexes to 0-based API column indexes
+ // convert 1-based OOXML column indexes to 0-based API column indexes
sal_Int32 nFirstCol = ::std::max( aIt->second.mnFirstCol - 1, nNextCol );
sal_Int32 nLastCol = ::std::min( aIt->second.mnLastCol - 1, nMaxCol );
@@ -1656,7 +1587,7 @@ void WorksheetData::convertRows()
for( RowModelMap::const_iterator aIt = maRowModels.begin(), aEnd = maRowModels.end(); aIt != aEnd; ++aIt )
{
- // convert 1-based OOX row indexes to 0-based API row indexes
+ // convert 1-based OOXML row indexes to 0-based API row indexes
sal_Int32 nFirstRow = ::std::max( aIt->second.mnFirstRow - 1, nNextRow );
sal_Int32 nLastRow = ::std::min( aIt->second.mnLastRow - 1, nMaxRow );
@@ -1761,6 +1692,55 @@ void WorksheetData::groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastC
}
}
+void WorksheetData::finalizeDrawings()
+{
+ switch( getFilterType() )
+ {
+ case FILTER_OOXML:
+ // import DML and VML
+ if( maDrawingPath.getLength() > 0 )
+ importOoxFragment( new DrawingFragment( *this, maDrawingPath ) );
+ if( maVmlDrawingPath.getLength() > 0 )
+ importOoxFragment( new VmlDrawingFragment( *this, maVmlDrawingPath ) );
+ break;
+
+ case FILTER_BIFF:
+ // TODO: import DFF shapes
+ break;
+
+ case FILTER_UNKNOWN:
+ break;
+ }
+
+ // comments (after callout shapes have been imported from VML/DFF)
+ maComments.finalizeImport();
+
+ /* Extend used area of the sheet by cells covered with drawing objects.
+ Needed if the imported document is inserted as "OLE object from file"
+ and thus does not provide an OLE size property by itself. */
+ if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
+ extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
+
+ // if no used area is set, default to A1
+ if( maUsedArea.StartColumn > maUsedArea.EndColumn )
+ maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
+ if( maUsedArea.StartRow > maUsedArea.EndRow )
+ maUsedArea.StartRow = maUsedArea.EndRow = 0;
+
+ /* Register the used area of this sheet in global view settings. The
+ global view settings will set the visible area if this document is an
+ embedded OLE object. */
+ getViewSettings().setSheetUsedArea( maUsedArea );
+
+ /* #i103686# Set right-to-left sheet layout. Must be done after all
+ drawing shapes to simplify calculation of shape coordinates. */
+ if( maSheetViewSett.isSheetRightToLeft() )
+ {
+ PropertySet aPropSet( mxSheet );
+ aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
+ }
+}
+
// ============================================================================
// ============================================================================
@@ -1942,6 +1922,16 @@ CommentsBuffer& WorksheetHelper::getComments() const
return mrSheetData.getComments();
}
+AutoFilterBuffer& WorksheetHelper::getAutoFilters() const
+{
+ return mrSheetData.getAutoFilters();
+}
+
+QueryTableBuffer& WorksheetHelper::getQueryTables() const
+{
+ return mrSheetData.getQueryTables();
+}
+
PageSettings& WorksheetHelper::getPageSettings() const
{
return mrSheetData.getPageSettings();
@@ -2140,44 +2130,51 @@ void WorksheetHelper::setTableOperation( const CellRangeAddress& rRange, const D
void WorksheetHelper::setLabelRanges( const ApiCellRangeList& rColRanges, const ApiCellRangeList& rRowRanges )
{
const CellAddress& rMaxPos = getAddressConverter().getMaxApiAddress();
- Reference< XLabelRanges > xLabelRanges;
PropertySet aPropSet( getSheet() );
- if( !rColRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_ColumnLabelRanges ) && xLabelRanges.is() )
+ if( !rColRanges.empty() )
{
- for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
+ Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_ColumnLabelRanges ), UNO_QUERY );
+ if( xLabelRanges.is() )
{
- CellRangeAddress aDataRange = *aIt;
- if( aDataRange.EndRow < rMaxPos.Row )
+ for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
{
- aDataRange.StartRow = aDataRange.EndRow + 1;
- aDataRange.EndRow = rMaxPos.Row;
- }
- else if( aDataRange.StartRow > 0 )
- {
- aDataRange.EndRow = aDataRange.StartRow - 1;
- aDataRange.StartRow = 0;
+ CellRangeAddress aDataRange = *aIt;
+ if( aDataRange.EndRow < rMaxPos.Row )
+ {
+ aDataRange.StartRow = aDataRange.EndRow + 1;
+ aDataRange.EndRow = rMaxPos.Row;
+ }
+ else if( aDataRange.StartRow > 0 )
+ {
+ aDataRange.EndRow = aDataRange.StartRow - 1;
+ aDataRange.StartRow = 0;
+ }
+ xLabelRanges->addNew( *aIt, aDataRange );
}
- xLabelRanges->addNew( *aIt, aDataRange );
}
}
- if( !rRowRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_RowLabelRanges ) && xLabelRanges.is() )
+ if( !rRowRanges.empty() )
{
- for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
+ Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_RowLabelRanges ), UNO_QUERY );
+ if( xLabelRanges.is() )
{
- CellRangeAddress aDataRange = *aIt;
- if( aDataRange.EndColumn < rMaxPos.Column )
+ for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
{
- aDataRange.StartColumn = aDataRange.EndColumn + 1;
- aDataRange.EndColumn = rMaxPos.Column;
- }
- else if( aDataRange.StartColumn > 0 )
- {
- aDataRange.EndColumn = aDataRange.StartColumn - 1;
- aDataRange.StartColumn = 0;
+ CellRangeAddress aDataRange = *aIt;
+ if( aDataRange.EndColumn < rMaxPos.Column )
+ {
+ aDataRange.StartColumn = aDataRange.EndColumn + 1;
+ aDataRange.EndColumn = rMaxPos.Column;
+ }
+ else if( aDataRange.StartColumn > 0 )
+ {
+ aDataRange.EndColumn = aDataRange.StartColumn - 1;
+ aDataRange.StartColumn = 0;
+ }
+ xLabelRanges->addNew( *aIt, aDataRange );
}
- xLabelRanges->addNew( *aIt, aDataRange );
}
}
}
@@ -2264,8 +2261,8 @@ WorksheetDataOwner::~WorksheetDataOwner()
// ----------------------------------------------------------------------------
-WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, xProgressBar, eSheetType, nSheet ) ) ),
+WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, rxProgressBar, eSheetType, nSheet ) ) ),
WorksheetHelper( *mxSheetData )
{
}
@@ -2292,4 +2289,3 @@ bool WorksheetHelperRoot::isValidSheet() const
} // namespace xls
} // namespace oox
-
diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx
index 0cc9d5f17780..cc1aa45f2012 100644
--- a/oox/source/xls/worksheetsettings.cxx
+++ b/oox/source/xls/worksheetsettings.cxx
@@ -26,41 +26,41 @@
************************************************************************/
#include "oox/xls/worksheetsettings.hxx"
+
+#include <com/sun/star/util/XProtectable.hpp>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pagesettings.hxx"
#include "oox/xls/workbooksettings.hxx"
-#include "oox/core/filterbase.hxx"
-#include "properties.hxx"
-
-#include <com/sun/star/util/XProtectable.hpp>
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::XProtectable;
-using ::oox::core::CodecHelper;
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::CodecHelper;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_uInt8 OOBIN_SHEETPR_FILTERMODE = 0x01;
-const sal_uInt8 OOBIN_SHEETPR_EVAL_CF = 0x02;
+const sal_uInt8 BIFF12_SHEETPR_FILTERMODE = 0x01;
+const sal_uInt8 BIFF12_SHEETPR_EVAL_CF = 0x02;
+
+const sal_uInt32 BIFF_SHEETEXT_NOTABCOLOR = 0x7F;
const sal_uInt16 BIFF_SHEETPR_DIALOGSHEET = 0x0010;
const sal_uInt16 BIFF_SHEETPR_APPLYSTYLES = 0x0020;
const sal_uInt16 BIFF_SHEETPR_SYMBOLSBELOW = 0x0040;
const sal_uInt16 BIFF_SHEETPR_SYMBOLSRIGHT = 0x0080;
const sal_uInt16 BIFF_SHEETPR_FITTOPAGES = 0x0100;
-const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; /// BIFF3-BIFF4
+const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; // BIFF3-BIFF4
const sal_uInt32 BIFF_SHEETPROT_OBJECTS = 0x00000001;
const sal_uInt32 BIFF_SHEETPROT_SCENARIOS = 0x00000002;
@@ -177,7 +177,7 @@ void WorksheetSettings::importPhoneticPr( const AttributeList& rAttribs )
maPhoneticSett.importPhoneticPr( rAttribs );
}
-void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
+void WorksheetSettings::importSheetPr( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags1;
sal_uInt8 nFlags2;
@@ -185,8 +185,8 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
rStrm.skip( 8 ); // sync anchor cell
rStrm >> maSheetSettings.maCodeName;
// sheet settings
- maSheetSettings.mbFilterMode = getFlag( nFlags2, OOBIN_SHEETPR_FILTERMODE );
- // outline settings, equal flags in BIFF and OOBIN
+ maSheetSettings.mbFilterMode = getFlag( nFlags2, BIFF12_SHEETPR_FILTERMODE );
+ // outline settings, equal flags in all BIFFs
maSheetSettings.mbApplyStyles = getFlag( nFlags1, BIFF_SHEETPR_APPLYSTYLES );
maSheetSettings.mbSummaryRight = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSRIGHT );
maSheetSettings.mbSummaryBelow = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSBELOW );
@@ -195,13 +195,13 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
getPageSettings().setFitToPagesMode( getFlag( nFlags1, BIFF_SHEETPR_FITTOPAGES ) );
}
-void WorksheetSettings::importChartSheetPr( RecordInputStream& rStrm )
+void WorksheetSettings::importChartSheetPr( SequenceInputStream& rStrm )
{
rStrm.skip( 2 ); // flags, contains only the 'published' flag
rStrm >> maSheetSettings.maTabColor >> maSheetSettings.maCodeName;
}
-void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm )
+void WorksheetSettings::importSheetProtection( SequenceInputStream& rStrm )
{
rStrm >> maSheetProt.mnPasswordHash;
// no flags field for all these boolean flags?!?
@@ -223,7 +223,7 @@ void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm )
maSheetProt.mbSelectUnlocked = rStrm.readInt32() != 0;
}
-void WorksheetSettings::importChartProtection( RecordInputStream& rStrm )
+void WorksheetSettings::importChartProtection( SequenceInputStream& rStrm )
{
rStrm >> maSheetProt.mnPasswordHash;
// no flags field for all these boolean flags?!?
@@ -231,11 +231,21 @@ void WorksheetSettings::importChartProtection( RecordInputStream& rStrm )
maSheetProt.mbObjects = rStrm.readInt32() != 0;
}
-void WorksheetSettings::importPhoneticPr( RecordInputStream& rStrm )
+void WorksheetSettings::importPhoneticPr( SequenceInputStream& rStrm )
{
maPhoneticSett.importPhoneticPr( rStrm );
}
+void WorksheetSettings::importSheetExt( BiffInputStream& rStrm )
+{
+ rStrm.skip( 16 );
+ sal_uInt32 nFlags;
+ rStrm >> nFlags;
+ sal_uInt8 nColorIdx = extractValue< sal_uInt8 >( nFlags, 0, 7 );
+ if( nColorIdx != BIFF_SHEETEXT_NOTABCOLOR )
+ maSheetSettings.maTabColor.setPaletteClr( nColorIdx );
+}
+
void WorksheetSettings::importSheetPr( BiffInputStream& rStrm )
{
sal_uInt16 nFlags;
@@ -324,10 +334,11 @@ void WorksheetSettings::finalizeImport()
PropertySet aPropSet( getSheet() );
aPropSet.setProperty( PROP_CodeName, maSheetSettings.maCodeName );
- if (!maSheetSettings.maTabColor.isAuto())
+ // sheet tab color
+ if( !maSheetSettings.maTabColor.isAuto() )
{
- sal_Int32 nColor = maSheetSettings.maTabColor.getColor(getBaseFilter().getGraphicHelper());
- aPropSet.setProperty(PROP_TabColor, nColor);
+ sal_Int32 nColor = maSheetSettings.maTabColor.getColor( getBaseFilter().getGraphicHelper() );
+ aPropSet.setProperty( PROP_TabColor, nColor );
}
}
@@ -335,4 +346,3 @@ void WorksheetSettings::finalizeImport()
} // namespace xls
} // namespace oox
-
diff --git a/oox/util/oox.component b/oox/util/oox.component
index 686ee6f1728e..f6519d5a8664 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -28,31 +28,40 @@
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.Impress.oox.PowerPointImport">
- <service name="com.sun.star.comp.ooxpptx"/>
+ <implementation name="com.sun.star.comp.oox.core.FastTokenHandler">
+ <service name="com.sun.star.xml.sax.FastTokenHandler"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.BiffDetector">
+ <implementation name="com.sun.star.comp.oox.FormatDetector">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.ExcelBiffFilter">
- <service name="com.sun.star.comp.oox.ExcelBiffFilter"/>
+ <implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter">
+ <service name="com.sun.star.document.OOXMLDocumentPropertiesImporter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.ExcelFilter">
- <service name="com.sun.star.comp.oox.ExcelFilter"/>
+ <implementation name="com.sun.star.comp.oox.WordVbaProjectFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.FastTokenHandlerService">
- <service name="com.sun.star.xml.sax.FastTokenHandler"/>
+ <implementation name="com.sun.star.comp.oox.ppt.PowerPointImport">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.FormatDetector">
+ <implementation name="com.sun.star.comp.oox.ShapeContextHandler">
+ <service name="com.sun.star.xml.sax.FastShapeContextHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.BiffDetector">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.OOXMLFormulaParser">
- <service name="com.sun.star.sheet.FilterFormulaParser"/>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.ShapeContextHandler">
- <service name="com.sun.star.xml.sax.FastShapeContextHandler"/>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelBiffFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter">
- <service name="com.sun.star.document.OOXMLDocumentPropertiesImporter"/>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelVbaProjectFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.FormulaParser">
+ <service name="com.sun.star.sheet.FilterFormulaParser"/>
</implementation>
</component>
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 537a62be4ba5..3ca8a15296b4 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -109,6 +109,7 @@ my_components = \
log \
mcnttype \
migrationoo2 \
+ msfilter \
msforms \
mysql \
odbc \
diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk
index a6881783776a..4109bfdaae97 100644
--- a/postprocess/packregistry/makefile.mk
+++ b/postprocess/packregistry/makefile.mk
@@ -522,7 +522,7 @@ $(MISC)/lang/fcfg_langpack_%.xcd .ERRREMOVE :
cd $(MISC)/$(@:b).unzip && unzip $(SOLARPCKDIR)/$(@:b).zip
- $(RM) $(MISC)/$(@:b).list
echo '<list>' $(foreach,i,$(shell cd $(MISC) && \
- find $(@:b).unzip -name \*.xcu -size +0c -print) \
+ find $(@:b).unzip -name [^.]\*.xcu -size +0c -print) \
'<filename>$i</filename>') '</list>' > $(MISC)/$(@:b).list
$(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/ -o $@ \
$(SOLARENV)/bin/packregistry.xslt $(MISC)/$(@:b).list
@@ -541,7 +541,7 @@ $(MISC)/lang/registry_%.xcd .ERRREMOVE :
unzip $(SOLARPCKDIR)/fcfg_drivers_$*.zip
- $(RM) $(MISC)/$(@:b).list
echo '<list>' $(foreach,i,$(shell cd $(MISC) && \
- find $(@:b).unzip fcfg_drivers_$*.unzip -name \*.xcu -print) \
+ find $(@:b).unzip fcfg_drivers_$*.unzip -name [^.]\*.xcu -print) \
'<filename>$i</filename>') '</list>' > $(MISC)/$(@:b).list
$(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/ -o $@ \
$(SOLARENV)/bin/packregistry.xslt $(MISC)/$(@:b).list
diff --git a/reportbuilder/util/makefile.pmk b/reportbuilder/util/makefile.pmk
index 566132247f9f..566132247f9f 100755..100644
--- a/reportbuilder/util/makefile.pmk
+++ b/reportbuilder/util/makefile.pmk
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 8ac5053ff39f..dcc327060806 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -51,7 +51,7 @@
#include <com/sun/star/inspection/XNumericControl.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include "metadata.hxx"
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 084bd77f8d5b..c02683a97452 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -66,7 +66,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <vcl/stdtext.hxx>
#include "ModuleHelper.hxx"
diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
index 859c0da38709..d992206b6f54 100644
--- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
+++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
@@ -40,7 +40,7 @@
#include <com/sun/star/inspection/XNumericControl.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include "metadata.hxx"
//........................................................................
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 51461cf356d6..cbdf5a326a43 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -142,7 +142,6 @@ class RscTypCont
Atom nTopImageId;
Atom nNoLabelId;
Atom nVertId;
- Atom nSingleLineId;
Atom nSysWinId;
void Init(); // Initialisiert Klassen und Tabelle
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index d4084f2bc239..11b3f57c1dd2 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -30,154 +30,9 @@
#include <sal/types.h>
#include <tools/solar.h>
-
-// ---------------
-// - Window-Bits -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-typedef sal_Int64 WinBits;
-
-// Window-Bits fuer Window
-#define WB_CLIPCHILDREN ((WinBits)0x00000001)
-#define WB_DIALOGCONTROL ((WinBits)0x00000002)
-#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
-#define WB_BORDER ((WinBits)0x00000008)
-#define WB_NOBORDER ((WinBits)0x00000010)
-#define WB_SIZEABLE ((WinBits)0x00000020)
-#define WB_3DLOOK ((WinBits)0x00000040)
-#define WB_AUTOSIZE ((WinBits)0x00000080)
-
-// Window-Bits fuer SystemWindows
-#define WB_MOVEABLE ((WinBits)0x00000100)
-#define WB_ROLLABLE ((WinBits)0x00000200)
-#define WB_CLOSEABLE ((WinBits)0x00000400)
-#define WB_STANDALONE ((WinBits)0x00000800)
-#define WB_APP ((WinBits)0x00001000)
-#define WB_PINABLE ((WinBits)0x00002000)
-#define WB_SYSTEMWINDOW ((WinBits)0x40000000)
-#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
-
-// Standard-Window-Bits fuer ChildWindows
-#define WB_TABSTOP ((WinBits)0x00000100)
-#define WB_NOTABSTOP ((WinBits)0x00000200)
-#define WB_GROUP ((WinBits)0x00000400)
-#define WB_NOGROUP ((WinBits)0x00000800)
-#define WB_HORZ ((WinBits)0x00001000)
-#define WB_VERT ((WinBits)0x00002000)
-#define WB_LEFT ((WinBits)0x00004000)
-#define WB_CENTER ((WinBits)0x00008000)
-#define WB_RIGHT ((WinBits)0x00010000)
-#define WB_TOP ((WinBits)0x00020000)
-#define WB_VCENTER ((WinBits)0x00040000)
-#define WB_BOTTOM ((WinBits)0x00080000)
-#define WB_DRAG ((WinBits)0x00100000)
-#define WB_SPIN ((WinBits)0x00200000)
-#define WB_REPEAT ((WinBits)0x00400000)
-#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
-#define WB_WORDBREAK ((WinBits)0x01000000)
-#define WB_NOLABEL ((WinBits)0x02000000)
-#define WB_SORT ((WinBits)0x04000000)
-#define WB_DROPDOWN ((WinBits)0x08000000)
-#define WB_AUTOHSCROLL ((WinBits)0x10000000)
-#define WB_DOCKABLE ((WinBits)0x20000000)
-#define WB_AUTOVSCROLL ((WinBits)0x40000000)
-
-#define WB_HIDE ((WinBits)0x80000000)
-#define WB_HSCROLL WB_HORZ
-#define WB_VSCROLL WB_VERT
-#define WB_TOPIMAGE WB_TOP
-
-// Window-Bits for PushButtons
-#define WB_DEFBUTTON ((WinBits)0x10000000)
-#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
-#define WB_RECTSTYLE ((WinBits)0x08000000)
-#define WB_SMALLSTYLE ((WinBits)0x04000000)
-
-// Window-Bits for FixedText
-#define WB_INFO ((WinBits)0x20000000)
-#define WB_PATHELLIPSIS ((WinBits)0x00100000)
-
-// Window-Bits for Edit
-#define WB_PASSWORD ((WinBits)0x01000000)
-#define WB_READONLY ((WinBits)0x02000000)
-#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
-
-// Window-Bits for MultiLineEdit
-#define WB_IGNORETAB ((WinBits)0x20000000)
-
-// Window-Bits for ListBox and MultiListBox
-#define WB_SIMPLEMODE ((WinBits)0x20000000)
-
-// Window-Bits for FixedBitmap
-#define WB_FAST ((WinBits)0x04000000)
-#define WB_SCALE ((WinBits)0x08000000)
-#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
-
-// Window-Bits for ToolBox
-#define WB_LINESPACING ((WinBits)0x01000000)
-#define WB_SCROLL ((WinBits)0x02000000)
-
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
-// Window-Bits for DockingWindows
-#define WB_DOCKBORDER ((WinBits)0x00001000)
-
-// Window-Bits for SplitWindow
-#define WB_NOSPLITDRAW ((WinBits)0x01000000)
-#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
-
-// Window-Bits for MessageBoxen
-#define WB_OK ((WinBits)0x00100000)
-#define WB_OK_CANCEL ((WinBits)0x00200000)
-#define WB_YES_NO ((WinBits)0x00400000)
-#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
-#define WB_RETRY_CANCEL ((WinBits)0x01000000)
-#define WB_DEF_OK ((WinBits)0x02000000)
-#define WB_DEF_CANCEL ((WinBits)0x04000000)
-#define WB_DEF_RETRY ((WinBits)0x08000000)
-#define WB_DEF_YES ((WinBits)0x10000000)
-#define WB_DEF_NO ((WinBits)0x20000000)
-#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Standard-WinBits
-#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
-#define WB_STDMDI (WB_CLOSEABLE)
-#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
-#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDMODELESS (WB_STDDIALOG)
-#define WB_STDMODAL (WB_STDDIALOG)
-#define WB_STDTABDIALOG (WB_STDDIALOG)
-#define WB_STDTABCONTROL 0
-
-// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
-
-// --------------
-// - Help-Types -
-// --------------
-
-#if 0
-// from vcl/inc/help.hxx
-#define OOO_HELP_INDEX ".help:index"
-#define OOO_HELP_HELPONHELP ".help:helponhelp"
-#endif
-
-// --------------
-// - FieldTypes -
-// --------------
-
-// from vcl/inc/fldunit.hxx
-enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
- FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
- FUNIT_PERCENT, FUNIT_100TH_MM };
-
+#include <tools/wintypes.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/mapunit.hxx>
// from vcl/inc/vclenum.hxx
#ifndef ENUM_TIMEFIELDFORMAT_DECLARED
@@ -217,25 +72,6 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE,
#endif
-// ------------
-// - TriState -
-// ------------
-
-// from vcl/inc/wintypes.hxx
-enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
-
-// -----------------
-// - MapMode-Types -
-// -----------------
-
-// from vcl/inc/mapmod.hxx
-enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
- MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
- MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
- MAP_RELATIVE, MAP_REALAPPFONT };
-
-// Das Resourcesystem benutzt den Wert 0xFFFF (freihalten)
-
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -272,14 +108,6 @@ typedef sal_uInt16 WindowBorderStyle;
#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010)
#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000)
-// ---------------
-// - WindowAlign -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
-enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM };
-
// --------------
// - Menu-Types -
// --------------
@@ -338,9 +166,6 @@ typedef sal_uInt16 SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 41c06fd455c3..8b9a088c76cc 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -2277,7 +2277,6 @@ RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper,
pClassTabControl->SetVariable( nId, pCont, NULL, 0,
RSC_TABCONTROL_ITEMLIST );
- INS_WINBIT( pClassTabControl, SingleLine );
INS_WINBIT( pClassTabControl, DropDown );
}
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 54a56a3840d2..aded8db5f865 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -372,8 +372,6 @@ void RscTypCont::Init()
aWinBits.SetConstant( nNoLabelId, sal::static_int_cast<INT32>(WB_NOLABEL) );
nVertId = pHS->getID( "WB_VERT" );
aWinBits.SetConstant( nVertId, sal::static_int_cast<INT32>(WB_VERT) );
- nSingleLineId = pHS->getID( "WB_SINGLELINE" );
- aWinBits.SetConstant( nSingleLineId, sal::static_int_cast<INT32>(WB_SINGLELINE) );
nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" );
aWinBits.SetConstant( nSysWinId, sal::static_int_cast<INT32>(WB_SYSTEMWINDOW) );
}
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index 743f499fb4f0..6956e5b32bf3 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -12,8 +12,9 @@ namespace sax_fastparser {
FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream ) :
mpSerializer(new FastSaxSerializer())
{
- Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
- mxTokenHandler = Reference<xml::sax::XFastTokenHandler> ( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ) ), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW );
+ Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), UNO_SET_THROW );
+ mxTokenHandler.set( xFactory->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ), xContext ), UNO_QUERY_THROW );
mpSerializer->setFastTokenHandler( mxTokenHandler );
mpSerializer->setOutputStream( xOutputStream );
@@ -23,11 +24,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >&
FastSerializerHelper::~FastSerializerHelper()
{
mpSerializer->endDocument();
-
- if (mpSerializer) {
- delete mpSerializer;
- mpSerializer = NULL;
- }
+ delete mpSerializer;
}
void FastSerializerHelper::startElement(const char* elementName, ...)
diff --git a/sc/inc/addruno.hxx b/sc/inc/addruno.hxx
index d6df571a29aa..6e71230b21d4 100644
--- a/sc/inc/addruno.hxx
+++ b/sc/inc/addruno.hxx
@@ -47,7 +47,7 @@ private:
sal_Int32 nRefSheet;
sal_Bool bIsRange;
- sal_Bool ParseUIString( const String& rUIString );
+ sal_Bool ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv = ::formula::FormulaGrammar::CONV_OOO );
public:
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 90aac02aab7f..8fe7425bf759 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1513,6 +1513,8 @@ public:
BOOL ContinueOnlineSpelling(); // TRUE = etwas gefunden
+ void RepaintRange( const ScRange& rRange );
+
BOOL IsIdleDisabled() const { return bIdleDisabled; }
void DisableIdle(BOOL bDo) { bIdleDisabled = bDo; }
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 92424e8178f4..0e37ceb40b06 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -135,6 +135,8 @@ public:
void AfterXMLLoading(sal_Bool bRet);
ScSheetSaveData* GetSheetSaveData();
+ void RepaintRange( const ScRange& rRange );
+
bool HasChangesListeners() const;
void NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges,
diff --git a/sc/inc/fmtuno.hxx b/sc/inc/fmtuno.hxx
index eebd808c30a4..6b79f88f4263 100644
--- a/sc/inc/fmtuno.hxx
+++ b/sc/inc/fmtuno.hxx
@@ -95,7 +95,6 @@ public:
void FillFormat( ScConditionalFormat& rFormat, ScDocument* pDoc,
formula::FormulaGrammar::Grammar eGrammar) const;
- void DataChanged();
// XSheetConditionalEntries
virtual void SAL_CALL addNew( const ::com::sun::star::uno::Sequence<
@@ -157,13 +156,11 @@ class ScTableConditionalEntry : public cppu::WeakImplHelper3<
com::sun::star::lang::XServiceInfo >
{
private:
- ScTableConditionalFormat* pParent;
ScCondFormatEntryItem aData;
ScTableConditionalEntry(); // disabled
public:
- ScTableConditionalEntry(ScTableConditionalFormat* pPar,
- const ScCondFormatEntryItem& aItem);
+ ScTableConditionalEntry(const ScCondFormatEntryItem& aItem);
virtual ~ScTableConditionalEntry();
void GetData(ScCondFormatEntryItem& rData) const;
@@ -241,7 +238,6 @@ public:
ScValidationData* CreateValidationData( ScDocument* pDoc,
formula::FormulaGrammar::Grammar eGrammar ) const;
- void DataChanged();
// XSheetCondition
virtual ::com::sun::star::sheet::ConditionOperator SAL_CALL getOperator()
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index 048d7b638d57..e90a8c46b6a3 100644..100755
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -218,7 +218,7 @@
#include <vcl/dndhelp.hxx>
#include <vcl/edit.hxx>
#include <vcl/field.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/inputctx.hxx>
#include <vcl/jobset.hxx>
@@ -235,7 +235,7 @@
#include <vcl/svapp.hxx>
#include <vcl/vclevent.hxx>
#include <vcl/window.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vos/macros.hxx>
#include <vos/object.hxx>
#include <vos/types.hxx>
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 159da72a34d2..b38bec784b54 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -928,7 +928,6 @@
#define STR_REPLCELLSWARN (STR_START + 91)
#define SCSTR_DPFUNCLISTBOX (STR_START + 92)
-#define STR_PRINT_NOTHING (STR_START + 93)
#define SCSTR_ALLFILTER (STR_START + 94)
#define SCSTR_MOREBTN_MOREOPTIONS (STR_START + 95)
#define SCSTR_MOREBTN_FEWEROPTIONS (STR_START + 96)
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 1e56743d8129..19cceb210b65 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -610,6 +610,7 @@
#define SC_UNONAME_ADDRESS "Address"
#define SC_UNONAME_UIREPR "UserInterfaceRepresentation"
#define SC_UNONAME_PERSREPR "PersistentRepresentation"
+#define SC_UNONAME_XLA1REPR "XLA1Representation"
#define SC_UNONAME_REFSHEET "ReferenceSheet"
// --> PB 2004-08-23 #i33095# Security Options
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index b08838198477..3fff9faf2105 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1432,7 +1432,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified )
}
}
- pSh->Broadcast( ScPaintHint( aRange, PAINT_GRID ) );
+ pDoc->RepaintRange( aRange );
}
}
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index f3b3f1ab32c6..b64babdf2dd7 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -169,8 +169,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove
RemoveFlagsTab( aOldRange.aStart.Col(), aOldRange.aStart.Row(),
aOldRange.aEnd.Col(), aOldRange.aEnd.Row(),
aOldRange.aStart.Tab(), SC_MF_AUTO );
- if (pShell)
- pShell->Broadcast( ScPaintHint( aOldRange, PAINT_GRID ) );
+ RepaintRange( aOldRange );
}
}
}
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e3c9d251fab7..9eb4bad7466d 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -94,6 +94,7 @@
#include "sc.hrc"
#include "charthelper.hxx"
#include "dpobject.hxx"
+#include "docuno.hxx"
#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue()
@@ -902,6 +903,16 @@ void ScDocument::RemoveAutoSpellObj()
pTab[nTab]->RemoveAutoSpellObj();
}
+void ScDocument::RepaintRange( const ScRange& rRange )
+{
+ if ( bIsVisible && pShell )
+ {
+ ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+ if ( pModel )
+ pModel->RepaintRange( rRange ); // locked repaints are checked there
+ }
+}
+
//------------------------------------------------------------------------
BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 4df709768279..4df709768279 100755..100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk
index 95ce6bcec179..51c01febcd36 100755..100644
--- a/sc/source/core/data/makefile.mk
+++ b/sc/source/core/data/makefile.mk
@@ -140,6 +140,7 @@ EXCEPTIONSFILES= \
$(SLO)$/documen3.obj \
$(SLO)$/documen5.obj \
$(SLO)$/documen6.obj \
+ $(SLO)$/documen8.obj \
$(SLO)$/documen9.obj \
$(SLO)$/dpcachetable.obj \
$(SLO)$/dptablecache.obj \
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index a4bc9a473768..999a3194eaa6 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -762,10 +762,13 @@ void ScPostIt::RemoveCaption()
{
pDrawPage->RecalcObjOrdNums();
// create drawing undo action (before removing the object to have valid draw page in undo action)
- if( pDrawLayer && pDrawLayer->IsRecording() )
+ bool bRecording = ( pDrawLayer && pDrawLayer->IsRecording() );
+ if( bRecording )
pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) );
// remove the object from the drawing page, delete if undo is disabled
- pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() );
+ SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() );
+ if( !bRecording )
+ SdrObject::Free( pObj );
}
}
maNoteData.mpCaption = 0;
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index a3319eafd3fd..bfe3fa04a398 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -136,6 +136,13 @@ BOOL __EXPORT ScStyleSheet::SetParent( const String& rParentName )
{
SfxItemSet& rParentSet = pStyle->GetItemSet();
GetItemSet().SetParent( &rParentSet );
+
+ // #i113491# Drag&Drop in the stylist's hierarchical view doesn't execute a slot,
+ // so the repaint has to come from here (after modifying the ItemSet).
+ // RepaintRange checks the document's IsVisible flag and locked repaints.
+ ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument();
+ if (pDoc)
+ pDoc->RepaintRange( ScRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ) );
}
}
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index e534bb9dfb78..151478324ef7 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1267,11 +1267,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
{
UpdatePageBreaks(NULL);
- SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
- if (pDocSh)
- pDocSh->Broadcast( ScPaintHint(
- ScRange(0,0,nTab,MAXCOL,MAXROW,nTab),
- PAINT_GRID ) );
+ pDocument->RepaintRange( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) );
}
}
}
diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index 899169154d8d..36595fe4c956 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -125,7 +125,7 @@
#include <vcl/outdev.hxx>
#include <vcl/pointr.hxx>
#include <vcl/ptrstyle.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/event.hxx>
#include <tools/ownlist.hxx>
#include <svl/itempool.hxx>
diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx
index 75d1c874eba8..c4c2f3b5a4ab 100644
--- a/sc/source/core/tool/formulaparserpool.cxx
+++ b/sc/source/core/tool/formulaparserpool.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/XFilterFormulaParser.hpp>
#include <rtl/instance.hxx>
#include <comphelper/processfactory.hxx>
@@ -62,27 +61,19 @@ public:
const OUString& rNamespace );
private:
- typedef ::std::hash_map<
- OUString,
- Reference< XSingleComponentFactory >,
- OUStringHash,
- ::std::equal_to< OUString > > FactoryMap;
+ typedef ::std::hash_map< OUString, Reference< XSingleComponentFactory >, OUStringHash > FactoryMap;
- Reference< XComponentContext > mxContext; /// Default context of global process factory.
+ Reference< XComponentContext > mxContext; /// Global component context.
FactoryMap maFactories; /// All parser factories, mapped by formula namespace.
};
-ScParserFactoryMap::ScParserFactoryMap()
+ScParserFactoryMap::ScParserFactoryMap() :
+ mxContext( ::comphelper::getProcessComponentContext() )
{
- try
+ if( mxContext.is() ) try
{
- // get process factory and default component context
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW );
- Reference< XPropertySet > xPropSet( xFactory, UNO_QUERY_THROW );
- mxContext.set( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), UNO_QUERY_THROW );
-
// enumerate all implementations of the FormulaParser service
- Reference< XContentEnumerationAccess > xFactoryEA( xFactory, UNO_QUERY_THROW );
+ Reference< XContentEnumerationAccess > xFactoryEA( mxContext->getServiceManager(), UNO_QUERY_THROW );
Reference< XEnumeration > xEnum( xFactoryEA->createContentEnumeration( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FilterFormulaParser" ) ) ), UNO_SET_THROW );
while( xEnum->hasMoreElements() ) try // single try/catch for every element
{
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index f20b63efe7ba..7295d42cc2e2 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -84,8 +84,7 @@
#include <math.h>
-#include <oox/core/tokens.hxx>
-
+using namespace ::oox;
using ::rtl::OString;
static String lcl_GetVbaTabName( SCTAB n )
@@ -791,7 +790,7 @@ void ExcDocument::WriteXml( SvStream& rStrm )
{
InitializeSave();
- XclExpXmlStream aStrm( ::comphelper::getProcessServiceFactory(), rStrm, GetRoot() );
+ XclExpXmlStream aStrm( ::comphelper::getProcessComponentContext(), rStrm, GetRoot() );
sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream();
rWorkbook->startElement( XML_workbook,
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 90ac8011a4bf..e238100f75f8 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -94,7 +94,7 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
aArgs[ 0 ] <<= getProcessServiceFactory();
aArgs[ 1 ] <<= aArgSeq;
uno::Reference< document::XImporter > xImporter( ScfApiHelper::CreateInstanceWithArgs(
- CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" ), aArgs ), uno::UNO_QUERY_THROW );
+ CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" ), aArgs ), uno::UNO_QUERY_THROW );
xImporter->setTargetDocument( xComponent );
MediaDescriptor aMediaDesc;
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 77afeb58d945..60b8e20f9447 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -30,10 +30,9 @@
#include "excimp8.hxx"
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-
#include <scitems.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/mediadescriptor.hxx>
#include <unotools/fltrcfg.hxx>
#include <svtools/wmf.hxx>
@@ -42,6 +41,11 @@
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/docinf.hxx>
+#include <sfx2/frame.hxx>
+
#include <editeng/brshitem.hxx>
#include <editeng/editdata.hxx>
#include <editeng/editeng.hxx>
@@ -54,20 +58,16 @@
#include <editeng/crsditem.hxx>
#include <editeng/flditem.hxx>
#include <svx/xflclit.hxx>
-#include <filter/msfilter/svxmsbas.hxx>
-#include <oox/xls/excelvbaproject.hxx>
-#include <basic/basmgr.hxx>
#include <vcl/graph.hxx>
#include <vcl/bmpacc.hxx>
#include <sot/exchange.hxx>
-#include <sfx2/docinf.hxx>
+#include <svl/stritem.hxx>
#include <tools/string.hxx>
#include <tools/urlobj.hxx>
#include <rtl/math.hxx>
-#include <rtl/ustrbuf.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/charclass.hxx>
#include <drwlayer.hxx>
@@ -103,10 +103,11 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <cppuhelper/component_context.hxx>
-#include <sfx2/app.hxx>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
using namespace com::sun::star;
+using namespace ::comphelper;
using ::rtl::OUString;
@@ -233,22 +234,49 @@ void ImportExcel8::ReadBasic( void )
{
SfxObjectShell* pShell = GetDocShell();
SotStorageRef xRootStrg = GetRootStorage();
- SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get();
- if( pShell && xRootStrg.Is() && pFilterOpt )
+ if( pShell && xRootStrg.Is() ) try
{
- bool bLoadCode = pFilterOpt->IsLoadExcelBasicCode();
- bool bLoadExecutable = pFilterOpt->IsLoadExcelBasicExecutable();
- bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage();
- if( bLoadCode || bLoadStrg )
+ uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW );
+ uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), uno::UNO_SET_THROW );
+ uno::Sequence< beans::NamedValue > aArgSeq( 1 );
+ aArgSeq[ 0 ].Name = CREATE_OUSTRING( "ColorPalette" );
+ aArgSeq[ 0 ].Value <<= GetPalette().CreateColorSequence();
+
+ uno::Sequence< uno::Any > aArgs( 2 );
+ // framework calls filter objects with factory as first argument
+ aArgs[ 0 ] <<= xFactory;
+ aArgs[ 1 ] <<= aArgSeq;
+
+ uno::Reference< document::XImporter > xImporter( xFactory->createInstanceWithArgumentsAndContext(
+ CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ), aArgs, xContext ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ xImporter->setTargetDocument( xComponent );
+
+ MediaDescriptor aMediaDesc;
+ SfxMedium& rMedium = GetMedium();
+ SfxItemSet* pItemSet = rMedium.GetItemSet();
+ if( pItemSet )
{
- SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg );
- bool bAsComment = !bLoadExecutable;
- aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment );
-
- uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY );
- ::oox::xls::ExcelVbaProject aVbaProject( ::comphelper::getProcessServiceFactory(), xDocument );
- aVbaProject.createMissingModules();
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ if( pFileNameItem )
+ aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ if( pPasswordItem )
+ aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if( pEncryptionDataItem )
+ aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
+ aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
+ aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler();
+
+ // call the filter
+ uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW );
+ xFilter->filter( aMediaDesc.getAsConstPropertyValueList() );
+ }
+ catch( uno::Exception& )
+ {
}
}
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 9a66325db419..91758c9affce 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -96,11 +96,9 @@
#include "xcl97rec.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::com::sun::star::uno::Sequence;
-
-
using ::rtl::OString;
//--------------------------------------------------------- class ExcDummy_00 -
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 7bfd57be7290..516f4c3bdee2 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -55,7 +55,7 @@
#include "xestyle.hxx"
#include "xename.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index b2801df7f54a..6ced6f9cc937 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -64,7 +64,7 @@
#include "xename.hxx"
#include "xestyle.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::rtl::OUString;
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 34e48671a3bc..92b48f9633de 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1759,7 +1759,11 @@ void XclExpFmlaCompImpl::AppendTrailingParam( XclExpFuncData& rFuncData )
break;
- default:;
+ default:
+ // #i108420# function without parameters stored as macro call needs the external name reference
+ if( (nParamCount == 0) && rFuncData.IsMacroFunc() )
+ AppendDefaultParam( rFuncData );
+
}
}
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index af275bef7eef..2ba4d1327f92 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -41,9 +41,10 @@
// for filter manager
#include "excrecds.hxx"
-#include <oox/core/tokens.hxx>
#include <formula/grammar.hxx>
+using namespace ::oox;
+
using ::rtl::OString;
// ============================================================================
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 6194a04c27f6..65be5b535d98 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -48,7 +48,7 @@
#include <set>
#include <limits>
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::std::set;
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index ddcdb3243167..3f2e3f506f51 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -51,7 +51,7 @@
#include "xestring.hxx"
#include "xelink.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::com::sun::star::sheet::DataPilotFieldOrientation;
using ::com::sun::star::sheet::DataPilotFieldOrientation_HIDDEN;
diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx
index fed58411aa5c..b596234fe2e4 100644
--- a/sc/source/filter/excel/xerecord.cxx
+++ b/sc/source/filter/excel/xerecord.cxx
@@ -30,7 +30,7 @@
#include "xerecord.hxx"
#include "xeroot.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
// Base classes to export Excel records =======================================
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 356b0d8bab42..0a4e76a47e86 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -32,6 +32,7 @@
#include <utility>
#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
#include <rtl/random.h>
#include <sax/fshelper.hxx>
#include <unotools/streamwrap.hxx>
@@ -46,27 +47,24 @@
#include "rangelst.hxx"
#include "compiler.hxx"
-#include <oox/core/tokens.hxx>
+#include <oox/xls/excelvbaproject.hxx>
#include <formula/grammar.hxx>
#define DEBUG_XL_ENCRYPTION 0
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::lang::XComponent;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::lang::XServiceInfo;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
using ::rtl::OString;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
using ::utl::OStreamWrapper;
using ::std::vector;
-using namespace formula;
-using namespace ::com::sun::star;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+using namespace ::formula;
+using namespace ::oox;
// ============================================================================
@@ -491,8 +489,8 @@ XclExpBiff8Encrypter::XclExpBiff8Encrypter( const XclExpRoot& rRoot ) :
mnOldPos(STREAM_SEEK_TO_END),
mbValid(false)
{
- uno::Sequence< beans::NamedValue > aEncryptionData = rRoot.GetEncryptionData();
- if ( aEncryptionData.getLength() == 0 )
+ Sequence< NamedValue > aEncryptionData = rRoot.GetEncryptionData();
+ if( !aEncryptionData.hasElements() )
// Empty password. Get the default biff8 password.
aEncryptionData = rRoot.GenerateDefaultEncryptionData();
Init( aEncryptionData );
@@ -579,11 +577,11 @@ void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_Int32 nData )
Encrypt(rStrm, static_cast<sal_uInt32>(nData));
}
-void XclExpBiff8Encrypter::Init( const uno::Sequence< beans::NamedValue >& aEncryptionData )
+void XclExpBiff8Encrypter::Init( const Sequence< NamedValue >& rEncryptionData )
{
mbValid = false;
- if ( maCodec.InitCodec( aEncryptionData ) )
+ if( maCodec.InitCodec( rEncryptionData ) )
{
maCodec.GetDocId( mpnDocId );
@@ -599,7 +597,7 @@ void XclExpBiff8Encrypter::Init( const uno::Sequence< beans::NamedValue >& aEncr
// generate salt hash.
::msfilter::MSCodec_Std97 aCodec;
- aCodec.InitCodec( aEncryptionData );
+ aCodec.InitCodec( rEncryptionData );
aCodec.CreateSaltDigest( mpnSalt, mpnSaltDigest );
// verify to make sure it's in good shape.
@@ -609,12 +607,12 @@ void XclExpBiff8Encrypter::Init( const uno::Sequence< beans::NamedValue >& aEncr
sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( sal_Size nStrmPos ) const
{
- return static_cast<sal_uInt32>(nStrmPos / EXC_ENCR_BLOCKSIZE);
+ return static_cast< sal_uInt32 >( nStrmPos / EXC_ENCR_BLOCKSIZE );
}
sal_uInt16 XclExpBiff8Encrypter::GetOffsetInBlock( sal_Size nStrmPos ) const
{
- return static_cast<sal_uInt16>(nStrmPos % EXC_ENCR_BLOCKSIZE);
+ return static_cast< sal_uInt16 >( nStrmPos % EXC_ENCR_BLOCKSIZE );
}
void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBytes )
@@ -681,9 +679,9 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy
mnOldPos = nStrmPos;
}
-rtl::OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId )
+OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId )
{
- rtl::OUStringBuffer sBuf;
+ OUStringBuffer sBuf;
if( sStreamDir )
sBuf.appendAscii( sStreamDir );
sBuf.appendAscii( sStream );
@@ -693,7 +691,7 @@ rtl::OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sS
return sBuf.makeStringAndClear();
}
-rtl::OString XclXmlUtils::ToOString( const Color& rColor )
+OString XclXmlUtils::ToOString( const Color& rColor )
{
char buf[9];
sprintf( buf, "%.2X%.2X%.2X%.2X", rColor.GetTransparency(), rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
@@ -701,37 +699,37 @@ rtl::OString XclXmlUtils::ToOString( const Color& rColor )
return OString( buf );
}
-rtl::OString XclXmlUtils::ToOString( const ::rtl::OUString& s )
+OString XclXmlUtils::ToOString( const OUString& s )
{
return OUStringToOString( s, RTL_TEXTENCODING_UTF8 );
}
-rtl::OString XclXmlUtils::ToOString( const String& s )
+OString XclXmlUtils::ToOString( const String& s )
{
- return rtl::OString( s.GetBuffer(), s.Len(), RTL_TEXTENCODING_UTF8 );
+ return OString( s.GetBuffer(), s.Len(), RTL_TEXTENCODING_UTF8 );
}
-rtl::OString XclXmlUtils::ToOString( const ScAddress& rAddress )
+OString XclXmlUtils::ToOString( const ScAddress& rAddress )
{
String sAddress;
rAddress.Format( sAddress, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
return ToOString( sAddress );
}
-rtl::OString XclXmlUtils::ToOString( const ScfUInt16Vec& rBuffer )
+OString XclXmlUtils::ToOString( const ScfUInt16Vec& rBuffer )
{
const sal_uInt16* pBuffer = &rBuffer [0];
- return ::rtl::OString( pBuffer, rBuffer.size(), RTL_TEXTENCODING_UTF8 );
+ return OString( pBuffer, rBuffer.size(), RTL_TEXTENCODING_UTF8 );
}
-rtl::OString XclXmlUtils::ToOString( const ScRange& rRange )
+OString XclXmlUtils::ToOString( const ScRange& rRange )
{
String sRange;
rRange.Format( sRange, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
return ToOString( sRange );
}
-rtl::OString XclXmlUtils::ToOString( const ScRangeList& rRangeList )
+OString XclXmlUtils::ToOString( const ScRangeList& rRangeList )
{
String s;
rRangeList.Format( s, SCA_VALID, NULL, FormulaGrammar::CONV_XL_A1, ' ' );
@@ -751,12 +749,12 @@ static ScAddress lcl_ToAddress( const XclAddress& rAddress )
return aAddress;
}
-rtl::OString XclXmlUtils::ToOString( const XclAddress& rAddress )
+OString XclXmlUtils::ToOString( const XclAddress& rAddress )
{
return ToOString( lcl_ToAddress( rAddress ) );
}
-rtl::OString XclXmlUtils::ToOString( const XclExpString& s )
+OString XclXmlUtils::ToOString( const XclExpString& s )
{
DBG_ASSERT( !s.IsRich(), "XclXmlUtils::ToOString(XclExpString): rich text string found!" );
return ToOString( s.GetUnicodeBuffer() );
@@ -772,7 +770,7 @@ static ScRange lcl_ToRange( const XclRange& rRange )
return aRange;
}
-rtl::OString XclXmlUtils::ToOString( const XclRangeList& rRanges )
+OString XclXmlUtils::ToOString( const XclRangeList& rRanges )
{
ScRangeList aRanges;
for( XclRangeList::const_iterator i = rRanges.begin(), end = rRanges.end();
@@ -801,7 +799,7 @@ OUString XclXmlUtils::ToOUString( const String& s )
return OUString( s.GetBuffer(), s.Len() );
}
-rtl::OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray )
+OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray )
{
ScCompiler aCompiler( &rDocument, rAddress, *pTokenArray);
aCompiler.SetGrammar(FormulaGrammar::GRAM_NATIVE_XL_A1);
@@ -823,8 +821,8 @@ const char* XclXmlUtils::ToPsz( bool b )
// ============================================================================
-XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot )
- : XmlFilterBase( rSMgr )
+XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot )
+ : XmlFilterBase( rxContext )
, mrRoot( rRoot )
{
Sequence< PropertyValue > aArgs( 1 );
@@ -980,7 +978,7 @@ sax_fastparser::FSHelperPtr XclExpXmlStream::CreateOutputStream (
const Reference< XOutputStream >& xParentRelation,
const char* sContentType,
const char* sRelationshipType,
- ::rtl::OUString* pRelationshipId )
+ OUString* pRelationshipId )
{
OUString sRelationshipId;
if (xParentRelation.is())
@@ -1029,7 +1027,12 @@ bool XclExpXmlStream::exportDocument() throw()
return false;
}
-::rtl::OUString XclExpXmlStream::implGetImplementationName() const
+::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const
+{
+ return new ::oox::xls::ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
+OUString XclExpXmlStream::implGetImplementationName() const
{
return CREATE_OUSTRING( "TODO" );
}
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx
index cd0b083aa208..1c3270015981 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -35,7 +35,7 @@
#include "xestyle.hxx"
#include "xestring.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::rtl::OUString;
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index ccebe9a4280f..da937e405080 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -55,7 +55,7 @@
#include "globstr.hrc"
#include "xestring.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::rtl::OUString;
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index b5ca318a91b4..b5896a352c5b 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -43,7 +43,7 @@
#include "xecontent.hxx"
#include "xeescher.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::rtl::OUString;
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 035afd0a5830..2abd807e8872 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -34,7 +34,7 @@
#include "xelink.hxx"
#include "xestyle.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 7cbd74a836d2..7cbd74a836d2 100644..100755
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index b210d18f479c..4aaf0ac9b944 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -917,14 +917,13 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm )
String aTables( rStrm.ReadUniString() );
const sal_Unicode cSep = ';';
- aTables.SearchAndReplaceAll( ',', cSep );
String aQuotedPairs( RTL_CONSTASCII_USTRINGPARAM( "\"\"" ) );
- xub_StrLen nTokenCnt = aTables.GetQuotedTokenCount( aQuotedPairs, cSep );
+ xub_StrLen nTokenCnt = aTables.GetQuotedTokenCount( aQuotedPairs, ',' );
maTables.Erase();
xub_StrLen nStringIx = 0;
for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
{
- String aToken( aTables.GetQuotedToken( 0, aQuotedPairs, cSep, nStringIx ) );
+ String aToken( aTables.GetQuotedToken( 0, aQuotedPairs, ',', nStringIx ) );
sal_Int32 nTabNum = CharClass::isAsciiNumeric( aToken ) ? aToken.ToInt32() : 0;
if( nTabNum > 0 )
ScGlobal::AddToken( maTables, ScfTools::GetNameFromHTMLIndex( static_cast< sal_uInt32 >( nTabNum ) ), cSep );
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 1559ef5530f5..3045924a7807 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -88,6 +88,19 @@ ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const
return GetDefColorData( nXclIndex );
}
+::com::sun::star::uno::Sequence< sal_Int32 > XclImpPalette::CreateColorSequence() const
+{
+ sal_Int32 nCount = static_cast< sal_Int32 >( maColorTable.size() );
+ ::com::sun::star::uno::Sequence< sal_Int32 > aSeq( nCount );
+ if( nCount > 0 )
+ {
+ sal_Int32* pnSeqColor = aSeq.getArray();
+ for( ColorDataVec::const_iterator aIt = maColorTable.begin(), aEnd = maColorTable.end(); aIt != aEnd; ++aIt, ++pnSeqColor )
+ *pnSeqColor = static_cast< sal_Int32 >( *aIt );
+ }
+ return aSeq;
+}
+
void XclImpPalette::ReadPalette( XclImpStream& rStrm )
{
sal_uInt16 nCount;
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 10a0657c7899..10a0657c7899 100644..100755
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index d613f1279242..aad0061377c9 100644..100755
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -393,7 +393,7 @@ static const XclFunctionInfo saFuncTable_Odf[] =
EXC_FUNCENTRY_ODF( ocVariationen2, 2, 2, 0, "PERMUTATIONA" ),
EXC_FUNCENTRY_ODF( ocPhi, 1, 1, 0, "PHI" ),
EXC_FUNCENTRY_ODF( ocZGZ, 3, 3, 0, "RRI" ),
- EXC_FUNCENTRY_ODF( ocTable, 1, 1, 0, "SHEET" ),
+ EXC_FUNCENTRY_ODF( ocTable, 0, 1, 0, "SHEET" ),
EXC_FUNCENTRY_ODF( ocTables, 0, 1, 0, "SHEETS" ),
EXC_FUNCENTRY_ODF( ocNoName, 1, MX, 0, "SKEWP" ),
EXC_FUNCENTRY_ODF( ocUnichar, 1, 1, 0, "UNICHAR" ),
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index 0dd988d67586..47420ab8dcfd 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -695,9 +695,9 @@ const OUString XclTools::maSbMacroSuffix( RTL_CONSTASCII_USTRINGPARAM( "?languag
OUString XclTools::GetSbMacroUrl( const String& rMacroName, SfxObjectShell* pDocShell )
{
OSL_ENSURE( rMacroName.Len() > 0, "XclTools::GetSbMacroUrl - macro name is empty" );
- ::ooo::vba::VBAMacroResolvedInfo aMacroInfo = ::ooo::vba::resolveVBAMacro( pDocShell, rMacroName, false );
- if( aMacroInfo.IsResolved() )
- return ::ooo::vba::makeMacroURL( aMacroInfo.ResolvedMacro() );
+ ::ooo::vba::MacroResolvedInfo aMacroInfo = ::ooo::vba::resolveVBAMacro( pDocShell, rMacroName, false );
+ if( aMacroInfo.mbFound )
+ return ::ooo::vba::makeMacroURL( aMacroInfo.msResolvedMacro );
return OUString();
}
diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx
index 7ab2aadf1511..d624b7afeaf8 100644
--- a/sc/source/filter/inc/filt_pch.hxx
+++ b/sc/source/filter/inc/filt_pch.hxx
@@ -126,7 +126,7 @@
#include <tools/fract.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/mapmod.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/region.hxx>
#include <svl/lstner.hxx>
#include <patattr.hxx>
@@ -182,7 +182,7 @@
#include <vcl/window.hxx>
#include <vcl/pointr.hxx>
#include <vcl/ptrstyle.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/inputctx.hxx>
#include <vcl/event.hxx>
#include <tools/ownlist.hxx>
@@ -253,7 +253,7 @@
#include <vcl/menu.hxx>
#include <vcl/combobox.hxx>
#include <vcl/combobox.h>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrame.hdl>
#include <com/sun/star/awt/XWindow.hpp>
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 38acef2783e8..b1cc596ad75e 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -37,6 +37,7 @@
#include <string>
#include <oox/core/xmlfilterbase.hxx>
+#include <oox/token/tokens.hxx>
#include <sax/fshelper.hxx>
#include "xlstream.hxx"
@@ -306,7 +307,7 @@ public:
class XclExpXmlStream : public oox::core::XmlFilterBase
{
public:
- XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot );
+ XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot );
virtual ~XclExpXmlStream();
/** Returns the filter root data. */
@@ -342,6 +343,7 @@ public:
void Trace( const char* format, ...);
private:
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
typedef std::map< ::rtl::OUString,
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 104002542a17..80006f354b4b 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -64,6 +64,9 @@ public:
@return The color from current or default palette or COL_AUTO, if nothing else found. */
inline Color GetColor( sal_uInt16 nXclIndex ) const
{ return Color( GetColorData( nXclIndex ) ); }
+ /** Returns the palette colors as UNO sequence. */
+ ::com::sun::star::uno::Sequence< sal_Int32 >
+ CreateColorSequence() const;
/** Reads a PALETTE record. */
void ReadPalette( XclImpStream& rStrm );
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 13eda8619cc0..13eda8619cc0 100644..100755
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index 921da6b8741b..cba56eeccc9e 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -29,7 +29,7 @@
#define SC_XLESCHER_HXX
#include <tools/gen.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include "fapihelper.hxx"
#include "xladdress.hxx"
#include "xlstyle.hxx"
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 209bbc83f6c3..a4a3d233cbde 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -77,7 +77,7 @@
#include "patattr.hxx"
#include "tabprotection.hxx"
-#include <oox/core/tokens.hxx>
+using namespace ::oox;
using ::rtl::OString;
using ::rtl::OUString;
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index ca4bac7eb511..646d245c13f1 100755..100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -156,7 +156,7 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( )
uno::Type SAL_CALL XMLCodeNameProvider::getElementType( )
throw (uno::RuntimeException)
{
- return uno::Type();
+ return getCppuType( static_cast< uno::Sequence< beans::PropertyValue >* >( 0 ) );
}
::sal_Bool SAL_CALL XMLCodeNameProvider::hasElements()
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index b028a0a153ce..4dcd7eb4da86 100755
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -770,11 +770,11 @@ ScTextWnd::ScTextWnd( Window* pParent )
__EXPORT ScTextWnd::~ScTextWnd()
{
- delete pEditView;
- delete pEditEngine;
while (!maAccTextDatas.empty()) {
maAccTextDatas.back()->Dispose();
}
+ delete pEditView;
+ delete pEditEngine;
}
void __EXPORT ScTextWnd::Paint( const Rectangle& rRec )
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index b90a51ed6bee..f9e5a4d7679b 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -35,7 +35,7 @@
#include <vcl/outdev.hxx>
#include <vcl/settings.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/decoview.hxx>
#include "strload.hxx"
#include "global.hxx"
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 038d0a72e824..50d95fbd677d 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3126,6 +3126,8 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
ScSizeMode eMode, USHORT nSizeTwips,
BOOL bRecord, BOOL bApi )
{
+ ScDocShellModificator aModificator( rDocShell );
+
if (!nRangeCnt)
return TRUE;
@@ -3287,6 +3289,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
pDoc->UpdatePageBreaks( nTab );
rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PAINT_ALL);
+ aModificator.SetDocumentModified();
return bSuccess;
}
@@ -4866,9 +4869,11 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
}
// Update hat sein eigenes Undo
-
- pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen
- pLink->Update(); // kein SetInCreate -> Update ausfuehren
+ if (pDoc->IsExecuteLinkEnabled())
+ {
+ pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen
+ pLink->Update(); // kein SetInCreate -> Update ausfuehren
+ }
pLink->SetDoInsert(TRUE); // Default = TRUE
SfxBindings* pBindings = rDocShell.GetViewBindings();
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index e7089349fdb7..901363785cc9 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2605,6 +2605,7 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
if ( pPaintLockData && bIsModified )
{
//! BCA_BRDCST_ALWAYS etc. also needed here?
+ aDocument.InvalidateTableArea(); // #i105279# needed here
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
pPaintLockData->SetModified(); // spaeter...
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index bba756b397cb..78287257c080 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -55,7 +55,6 @@ using namespace ::com::sun::star;
#include <svtools/sfxecode.hxx>
#include <svx/ofaitem.hxx>
#include <sot/formats.hxx>
-#include <svtools/printdlg.hxx>
#include <svl/whiter.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
@@ -1828,373 +1827,6 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */,
}
}
-void lcl_GetPrintData( ScDocShell* pDocShell /*in*/,
- ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/,
- PrintDialog* pPrintDialog /*in*/, bool bForceSelected /*in*/,
- ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/,
- ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/,
- long& rnTotalPages /*out*/, long aPageArr[] /*out*/,
- MultiSelection& rPageRanges /*out*/, ScRange** ppMarkedRange /*out*/ )
-{
- // get settings from print options sub-dialog
- const SfxItemSet& rOptionSet = pPrinter->GetOptions();
- const SfxPoolItem* pItem;
- rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, FALSE, &pItem ) == SFX_ITEM_SET );
- if ( rbHasOptions )
- {
- rOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions();
- }
- else
- {
- // use configuration
- rOptions = SC_MOD()->GetPrintOptions();
- }
-
- // update all pending row heights with a single progress bar,
- // instead of a separate progress for each sheet from ScPrintFunc
- pDocShell->UpdatePendingRowHeights( MAXTAB, true );
-
- // get number of total pages
- rnTotalPages = 0;
- SCTAB nTabCount = pDocument->GetTableCount();
- for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
- {
- ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, NULL, &rOptions );
- long nThisTab = aPrintFunc.GetTotalPages();
- aPageArr[nTab] = nThisTab;
- rnTotalPages += nThisTab;
- }
-
- rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) );
- rPageRanges.Select( Range( 1, rnTotalPages ) );
-
- rbAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
- if ( bForceSelected )
- {
- rbAllTabs = false;
- }
-
- if ( ( pPrintDialog && pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_SELECTED_CELLS ) || bForceSelected )
- {
- if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) )
- {
- pMarkData->MarkToMulti();
- *ppMarkedRange = new ScRange;
- pMarkData->GetMultiMarkArea( **ppMarkedRange );
- pMarkData->MarkToSimple();
- }
- }
-
- PrintDialogRange eDlgOption = pPrintDialog ? pPrintDialog->GetCheckedRange() : PRINTDIALOG_ALL;
- if ( eDlgOption == PRINTDIALOG_RANGE )
- {
- rPageRanges = MultiSelection( pPrintDialog->GetRangeText() );
- }
-
- // get number of total pages if selection
- if ( !rbAllTabs )
- {
- rnTotalPages = 0;
- for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
- {
- if ( *ppMarkedRange ) // selected range is used instead of print ranges -> page count is different
- {
- ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, *ppMarkedRange, &rOptions );
- aPageArr[nTab] = aPrintFunc.GetTotalPages();
- }
- if ( !pMarkData || pMarkData->GetTableSelect( nTab ) )
- {
- rnTotalPages += aPageArr[nTab];
- }
- }
- if ( eDlgOption == PRINTDIALOG_ALL || bForceSelected )
- {
- rPageRanges.Select( Range( 1, rnTotalPages ) );
- }
- }
-}
-
-bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI )
-{
- SfxPrinter* pPrinter = GetPrinter();
- if ( !pPrinter )
- {
- return false;
- }
-
- bool bHasOptions = false;
- ScPrintOptions aOptions;
- bool bAllTabs = true;
- long nTotalPages = 0;
- long aPageArr[MAXTABCOUNT]; // pages per sheet
- MultiSelection aPageRanges; // pages to print
- ScRange* pMarkedRange = NULL;
-
- lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected,
- pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
- aPageArr, aPageRanges, &pMarkedRange );
-
- delete pMarkedRange;
-
- if ( nTotalPages == 0 )
- {
- if ( !bIsAPI )
- {
- WarningBox aWarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
- String( ScResId( STR_PRINT_NOTHING ) ) );
- aWarningBox.Execute();
- }
- return false;
- }
-
- return true;
-}
-
-void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData )
-{
- SfxPrinter* pPrinter = GetPrinter();
- if ( !pPrinter )
- {
- return;
- }
-
- delete pOldJobSetup; // gesetzt nur bei Fehler in StartJob()
- pOldJobSetup = new ScJobSetup( pPrinter ); // Einstellungen merken
-
- // Einstellungen fuer die erste gedruckte Seite muessen hier (vor StartJob) gesetzt werden
- //! Selection etc. mit Print() zusammenfassen !!!
- //! Seiten nur einmal zaehlen
-
- bool bHasOptions = false;
- ScPrintOptions aOptions;
- bool bAllTabs = true;
- long nTotalPages = 0;
- long aPageArr[MAXTABCOUNT]; // pages per sheet
- MultiSelection aPageRanges; // pages to print
- ScRange* pMarkedRange = NULL;
-
- lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, false,
- pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
- aPageArr, aPageRanges, &pMarkedRange );
-
- BOOL bFound = FALSE; // erste Seite gefunden
- long nTabStart = 0;
- SCTAB nTabCount = aDocument.GetTableCount();
- for ( SCTAB nTab=0; nTab<nTabCount && !bFound; nTab++ )
- {
- if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
- {
- long nNext = nTabStart + aPageArr[nTab];
- BOOL bSelected = FALSE;
- for (long nP=nTabStart+1; nP<=nNext; nP++) // 1-basiert
- if (aPageRanges.IsSelected( nP )) // eine Seite von dieser Tabelle selektiert?
- bSelected = TRUE;
-
- if (bSelected)
- {
- ScPrintFunc aPrintFunc( this, pPrinter, nTab );
-
- aPrintFunc.ApplyPrintSettings(); // dann Settings fuer diese Tabelle
- bFound = TRUE;
- }
- nTabStart = nNext;
- }
- }
-
- delete pMarkedRange;
-}
-
-BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
-{
- BOOL bFound = FALSE;
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- if (pDrawLayer)
- {
- SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
- DBG_ASSERT(pPage,"Page ?");
- if (pPage)
- {
- Rectangle aMMRect;
- if ( pRange )
- aMMRect = pDoc->GetMMRect( pRange->aStart.Col(), pRange->aStart.Row(),
- pRange->aEnd.Col(), pRange->aEnd.Row(), nTab );
-
- SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
- SdrObject* pObject = aIter.Next();
- while (pObject && !bFound)
- {
- if (pObject->IsTransparent())
- {
- if ( pRange )
- {
- Rectangle aObjRect = pObject->GetLogicRect();
- if ( aObjRect.IsOver( aMMRect ) )
- bFound = TRUE;
- }
- else
- bFound = TRUE;
- }
-
- pObject = aIter.Next();
- }
- }
- }
-
- return bFound;
-}
-
-void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
- ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI )
-{
- SfxPrinter* pPrinter = GetPrinter();
- if ( !pPrinter )
- {
- return;
- }
-
- bool bHasOptions = false;
- ScPrintOptions aOptions;
- bool bAllTabs = true;
- long nTotalPages = 0;
- long aPageArr[MAXTABCOUNT]; // pages per sheet
- MultiSelection aPageRanges; // pages to print
- ScRange* pMarkedRange = NULL;
-
- lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected,
- pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
- aPageArr, aPageRanges, &pMarkedRange );
-
- USHORT nCollateCopies = 1;
- if ( pPrintDialog && pPrintDialog->IsCollateEnabled() && pPrintDialog->IsCollateChecked() )
- nCollateCopies = pPrintDialog->GetCopyCount();
-
- // test if printed range contains transparent objects
-
- BOOL bHasTransp = FALSE;
- BOOL bAnyPrintRanges = aDocument.HasPrintRange();
- ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
- SCTAB nTabCount = aDocument.GetTableCount();
- for ( SCTAB nTab=0; nTab<nTabCount && !bHasTransp; nTab++ )
- {
- if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
- {
- SfxStyleSheetBase* pStyleSheet = pStylePool->Find(
- aDocument.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE );
- if ( pStyleSheet )
- {
- const SfxItemSet& rSet = pStyleSheet->GetItemSet();
- if ( ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_CHARTS)).GetValue() == VOBJ_MODE_SHOW ||
- ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_OBJECTS)).GetValue() == VOBJ_MODE_SHOW ||
- ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_DRAWINGS)).GetValue() == VOBJ_MODE_SHOW )
- {
- if ( pMarkedRange )
- bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, pMarkedRange );
- else if ( aDocument.GetPrintRangeCount(nTab) )
- {
- USHORT nRangeCount = aDocument.GetPrintRangeCount(nTab);
- for (USHORT i=0; i<nRangeCount; i++)
- bHasTransp = bHasTransp ||
- lcl_HasTransparent( &aDocument, nTab, aDocument.GetPrintRange( nTab, i ) );
- }
- else if (!bAnyPrintRanges || aDocument.IsPrintEntireSheet(nTab))
- bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, NULL );
- }
- }
- }
- }
-
- BOOL bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp );
-
- if ( bContinue )
- {
- for ( USHORT n=0; n<nCollateCopies; n++ )
- {
- long nTabStart = 0;
- long nDisplayStart = 0;
- long nAttrPage = 1;
- long nPrinted = 0;
-
- for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
- {
- if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
- {
- FmFormView* pDrawView = NULL;
- Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX );
-
- // #114135#
- ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL
-
- if(pModel)
- {
- pDrawView = new FmFormView( pModel, pPrinter );
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
- pDrawView->SetPrintPreview( TRUE );
- }
-
- ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions );
- aPrintFunc.SetDrawView( pDrawView );
- nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL );
-
- nTabStart += aPageArr[nTab];
- if ( aDocument.NeedPageResetAfterTab(nTab) )
- nDisplayStart = 0;
- else
- nDisplayStart += aPageArr[nTab];
- nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage
-
- delete pDrawView;
- }
- }
-
- if ( n+1 < nCollateCopies &&
- (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) &&
- ( nPrinted % 2 ) == 1 )
- {
- // #105584# when several collated copies are printed in duplex mode, and there is
- // an odd number of pages, print an empty page between copies, so the first page of
- // the second copy isn't printed on the back of the last page of the first copy.
- // (same as in Writer ViewShell::Prt)
-
- // FIXME: needs to be adapted to XRenderable interface
- #if 0
- pPrinter->StartPage();
- pPrinter->EndPage();
- #endif
- }
- }
- }
-
- delete pMarkedRange;
-
- if (pOldJobSetup)
- {
- pPrinter->SetOrientation( pOldJobSetup->eOrientation );
- pPrinter->SetPaperBin ( pOldJobSetup->nPaperBin );
- pPrinter->SetPaper ( pOldJobSetup->ePaper );
-
- if ( PAPER_USER == pOldJobSetup->ePaper )
- {
- pPrinter->SetMapMode( pOldJobSetup->aUserMapMode );
- pPrinter->SetPaperSizeUser( pOldJobSetup->aUserSize );
- }
-
- delete pOldJobSetup;
- pOldJobSetup = NULL;
- }
-
- if ( bHasOptions )
- {
- // remove PrintOptions from printer ItemSet,
- // so next time the options from the configuration are used
-
- SfxItemSet aSet( pPrinter->GetOptions() );
- aSet.ClearItem( SID_SCPRINTOPTIONS );
- pPrinter->SetOptions( aSet );
- }
-
- PostPaintGridAll(); //! nur wenn geaendert
-}
-
void ScDocShell::GetState( SfxItemSet &rSet )
{
SfxWhichIter aIter(rSet);
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 19147cfaf61f..fe94db107be0 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -45,7 +45,6 @@
class ScEditEngineDefaulter;
class FontList;
-class PrintDialog;
class SfxStyleSheetBasePool;
class SfxStyleSheetHint;
struct ChartSelectionInfo;
@@ -303,13 +302,6 @@ public:
void DoRecalc( BOOL bApi );
void DoHardRecalc( BOOL bApi );
- bool CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData,
- bool bForceSelected, bool bIsAPI );
- void PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData );
- void Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
- ScMarkData* pMarkData, Window* pDialogParent,
- BOOL bForceSelected, BOOL bIsAPI );
-
void UpdateOle( const ScViewData* pViewData, BOOL bSnapSize = FALSE );
BOOL IsOle();
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 7ff97f8d0152..79f4d799223a 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -116,11 +116,7 @@ public:
virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE );
virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
- virtual PrintDialog* CreatePrintDialog( Window* pParent );
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
- virtual void PreparePrint( PrintDialog* pPrintDialog = NULL );
- virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI );
- virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL );
void AddAccessibilityObject( SfxListener& rObject );
void RemoveAccessibilityObject( SfxListener& rObject );
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 28cc2a823928..c3316092d044 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -369,13 +369,7 @@ public:
virtual USHORT SetPrinter( SfxPrinter* pNewPrinter,
USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false );
- virtual PrintDialog* CreatePrintDialog( Window* pParent );
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
- virtual void PreparePrint( PrintDialog* pPrintDialog = NULL );
- virtual ErrCode DoPrint( SfxPrinter *pPrinter,
- PrintDialog *pPrintDialog,
- BOOL bSilent, BOOL bIsAPI );
- virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL );
void ConnectObject( SdrOle2Obj* pObj );
BOOL ActivateObject( SdrOle2Obj* pObj, long nVerb );
diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx
index a1dcbf904694..c7ec17209085 100644
--- a/sc/source/ui/inc/ui_pch.hxx
+++ b/sc/source/ui/inc/ui_pch.hxx
@@ -81,7 +81,7 @@
#include <vcl/outdev.hxx>
#include <vcl/pointr.hxx>
#include <vcl/ptrstyle.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/event.hxx>
#include <limits.h>
#include <tools/errinf.hxx>
@@ -185,7 +185,6 @@
#include <sfx2/ipfrm.hxx>
#include <docsh.hxx>
//REMOVE #include <sfx2/interno.hxx>
-#include <vcl/wintypes.hxx>
#include <sfx2/docfac.hxx>
#include <scitems.hxx>
#include <vcl/virdev.hxx>
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 59da2966cc60..60dc1bc7b115 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -53,6 +53,7 @@ class SfxItemSet;
class SvxBorderLine;
class SvxBoxItem;
class SvxBoxInfoItem;
+class SfxStyleSheetBase;
class SfxStyleSheet;
class SfxPoolItem;
class EditTextObject;
@@ -187,8 +188,8 @@ public:
const SfxStyleSheet* GetStyleSheetFromMarked();
void SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet,
BOOL bRecord = TRUE );
- void RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet );
- void UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet );
+ void RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet );
+ void UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet );
void SetNumberFormat( short nFormatType, ULONG nAdd = 0 );
void SetNumFmtByStr( const String& rCode );
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 9c47a42239cc..17b7b99b2e04 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -553,11 +553,6 @@ String STR_REPLCELLSWARN
Text [ en-US ] = "You are pasting data into cells that already contain data.\nDo you really want to overwrite the existing data?";
};
-String STR_PRINT_NOTHING
-{
- Text [ en-US ] = "There is nothing to print. The selected print range or sheet is empty.";
-};
-
String SCSTR_ALLFILTER
{
Text [ en-US ] = "All";
@@ -749,22 +744,13 @@ StringArray SCSTR_PRINT_OPTIONS
{
< "Pages"; >;
< "~Include output of empty pages"; >;
- < "If checked empty pages that have no cell contents or draw objects are not printed."; >;
- < "Sheets"; >;
- < "Print ~only selected sheets"; >;
- < "If checked only contents from selected sheets are printed, even if you specify a wider range in the Format - Print Ranges dialog. Content from sheets that are not selected will not be printed."; >;
< "Print content"; >;
< "~All sheets"; >;
- < "The printout will be created from all sheets in the document."; >;
< "~Selected sheets"; >;
- < "The printout will be created only from the currently selected sheets."; >;
< "Selected cells"; >;
- < "The printout will be created only from the currently selected cells."; >;
< "Thereof print"; >;
< "All ~pages"; >;
- < "Print all pages of the printable content."; >;
< "Pa~ges"; >;
- < "Print only some pages of the printable content."; >;
< "%PRODUCTNAME %s"; >;
};
};
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 10627222be80..9b3ce8e3d4bc 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -69,7 +69,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
+sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv )
{
if (!pDocShell)
return sal_False;
@@ -78,7 +78,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
sal_Bool bSuccess = sal_False;
if ( bIsRange )
{
- USHORT nResult = aRange.ParseAny( rUIString, pDoc );
+ USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -92,7 +92,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
}
else
{
- USHORT nResult = aRange.aStart.Parse( rUIString, pDoc );
+ USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -118,6 +118,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
};
static uno::Reference<beans::XPropertySetInfo> aRef(new SfxItemPropertySetInfo( aPropertyMap ));
@@ -131,6 +132,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
};
static uno::Reference<beans::XPropertySetInfo> aRef(new SfxItemPropertySetInfo( aPropertyMap ));
@@ -190,8 +192,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
bSuccess = ParseUIString( aUIString );
}
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
+
// parse the file format string
rtl::OUString sRepresentation;
if (aValue >>= sRepresentation)
@@ -212,7 +217,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
// parse the rest like a UI string
- bSuccess = ParseUIString( aUIString );
+ bSuccess = ParseUIString( aUIString, eConv );
}
}
else
@@ -265,17 +270,23 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString&
aRange.aStart.Format( aFormatStr, nFlags, pDoc );
aRet <<= rtl::OUString( aFormatStr );
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
+
// generate file format string - always include sheet
String aFormatStr;
- aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc );
+ aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, eConv );
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
aFormatStr.Append( (sal_Unicode) ':' );
String aSecond;
- aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc );
+ USHORT nFlags = SCA_VALID;
+ if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 )
+ nFlags |= SCA_TAB_3D;
+ aRange.aEnd.Format( aSecond, nFlags, pDoc, eConv );
aFormatStr.Append( aSecond );
}
aRet <<= rtl::OUString( aFormatStr );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 828ec8f09297..eb493f3be426 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -225,53 +225,53 @@ ScPrintUIOptions::ScPrintUIOptions()
sal_Bool bSuppress = rPrintOpt.GetSkipEmpty();
ResStringArray aStrings( ScResId( SCSTR_PRINT_OPTIONS ) );
- DBG_ASSERT( aStrings.Count() >= 19, "resource incomplete" );
- if( aStrings.Count() < 19 ) // bad resource ?
+ DBG_ASSERT( aStrings.Count() >= 10, "resource incomplete" );
+ if( aStrings.Count() < 10 ) // bad resource ?
return;
m_aUIProperties.realloc( 8 );
// create Section for spreadsheet (results in an extra tab page in dialog)
SvtModuleOptions aOpt;
- String aAppGroupname( aStrings.GetString( 18 ) );
+ String aAppGroupname( aStrings.GetString( 9 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) );
- m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
// create subgroup for pages
m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() );
// create a bool option for empty pages
m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ),
- rtl::OUString( aStrings.GetString( 2 ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ),
! bSuppress
);
// create Subgroup for print content
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
- m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
+ m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ),
rtl::OUString(),
aPrintRangeOpt
);
// create a choice for the content to create
- uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpTexts( 3 );
- aChoices[0] = aStrings.GetString( 7 );
- aHelpTexts[0] = aStrings.GetString( 8 );
- aChoices[1] = aStrings.GetString( 9 );
- aHelpTexts[1] = aStrings.GetString( 10 );
- aChoices[2] = aStrings.GetString( 11 );
- aHelpTexts[2] = aStrings.GetString( 12 );
+ uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 );
+ aChoices[0] = aStrings.GetString( 3 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aChoices[1] = aStrings.GetString( 4 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aChoices[2] = aStrings.GetString( 5 );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ),
aChoices,
nContent );
// create Subgroup for print range
aPrintRangeOpt.mbInternalOnly = sal_True;
- m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 13 ) ),
+ m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
rtl::OUString(),
aPrintRangeOpt
);
@@ -279,13 +279,13 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a choice for the range to print
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
aChoices.realloc( 2 );
- aHelpTexts.realloc( 2 );
- aChoices[0] = aStrings.GetString( 14 );
- aHelpTexts[0] = aStrings.GetString( 15 );
- aChoices[1] = aStrings.GetString( 16 );
- aHelpTexts[1] = aStrings.GetString( 17 );
+ aHelpIds.realloc( 2 );
+ aChoices[0] = aStrings.GetString( 7 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) );
+ aChoices[1] = aStrings.GetString( 8 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) );
m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
aPrintRangeName,
aChoices,
0 );
@@ -293,24 +293,11 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(),
- rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
rtl::OUString(),
aPageRangeOpt
);
-
- // "Print only selected sheets" isn't needed because of the "Selected Sheets" choice in "Print content"
-#if 0
- // create subgroup for sheets
- m_aUIProperties[8].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 3 ) ), rtl::OUString() );
-
- // create a bool option for selected pages only
- m_aUIProperties[9].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 4 ) ),
- rtl::OUString( aStrings.GetString( 5 ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsOnlySelectedSheets" ) ),
- i_bSelectedOnly
- );
-#endif
}
void ScPrintUIOptions::SetDefaults()
@@ -449,6 +436,12 @@ ScSheetSaveData* ScModelObj::GetSheetSaveData()
return NULL;
}
+void ScModelObj::RepaintRange( const ScRange& rRange )
+{
+ if (pDocShell)
+ pDocShell->PostPaint( rRange, PAINT_GRID );
+}
+
uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 392533c7cf93..6da02cf9e4e3 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -236,16 +236,11 @@ ScTableConditionalFormat::~ScTableConditionalFormat()
void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry)
{
- ScTableConditionalEntry* pNew = new ScTableConditionalEntry(this, aEntry);
+ ScTableConditionalEntry* pNew = new ScTableConditionalEntry(aEntry);
pNew->acquire();
aEntries.Insert( pNew, LIST_APPEND );
}
-void ScTableConditionalFormat::DataChanged()
-{
- // wenn's mal das "lebende Objekt" ist, muss hier was passieren...
-}
-
// XSheetConditionalFormat
ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(USHORT nIndex) const
@@ -348,7 +343,6 @@ void SAL_CALL ScTableConditionalFormat::addNew(
}
AddEntry_Impl(aEntry);
- DataChanged();
}
void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex )
@@ -360,7 +354,6 @@ void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex )
{
aEntries.Remove(pEntry);
pEntry->release();
- DataChanged();
}
}
@@ -371,8 +364,6 @@ void SAL_CALL ScTableConditionalFormat::clear() throw(uno::RuntimeException)
aEntries.First();
while ( ( pEntry = (ScTableConditionalEntry*)aEntries.Remove() ) != NULL )
pEntry->release();
-
- DataChanged();
}
// XEnumerationAccess
@@ -525,19 +516,14 @@ ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(
//UNUSED2008-05 {
//UNUSED2008-05 }
-ScTableConditionalEntry::ScTableConditionalEntry(ScTableConditionalFormat* pPar,
- const ScCondFormatEntryItem& aItem) :
- pParent( pPar ),
+ScTableConditionalEntry::ScTableConditionalEntry(const ScCondFormatEntryItem& aItem) :
aData( aItem )
{
- if (pParent)
- pParent->acquire();
+ // #i113668# only store the settings, keep no reference to parent object
}
ScTableConditionalEntry::~ScTableConditionalEntry()
{
- if (pParent)
- pParent->release();
}
void ScTableConditionalEntry::GetData(ScCondFormatEntryItem& rData) const
@@ -559,8 +545,6 @@ void SAL_CALL ScTableConditionalEntry::setOperator( sheet::ConditionOperator nOp
{
ScUnoGuard aGuard;
aData.meMode = lcl_ConditionOperatorToMode( nOperator );
- if (pParent)
- pParent->DataChanged();
}
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula1() throw(uno::RuntimeException)
@@ -574,8 +558,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula1( const rtl::OUString& aFormul
{
ScUnoGuard aGuard;
aData.maExpr1 = String( aFormula1 );
- if (pParent)
- pParent->DataChanged();
}
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula2() throw(uno::RuntimeException)
@@ -589,8 +571,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula2( const rtl::OUString& aFormul
{
ScUnoGuard aGuard;
aData.maExpr2 = String( aFormula2 );
- if (pParent)
- pParent->DataChanged();
}
table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(uno::RuntimeException)
@@ -608,8 +588,6 @@ void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddre
{
ScUnoGuard aGuard;
aData.maPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
- if (pParent)
- pParent->DataChanged();
}
// XSheetConditionalEntry
@@ -625,8 +603,6 @@ void SAL_CALL ScTableConditionalEntry::setStyleName( const rtl::OUString& aStyle
{
ScUnoGuard aGuard;
aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SFX_STYLE_FAMILY_PARA );
- if (pParent)
- pParent->DataChanged();
}
//------------------------------------------------------------------------
@@ -739,11 +715,6 @@ ScTableValidationObj::~ScTableValidationObj()
{
}
-void ScTableValidationObj::DataChanged()
-{
- // wenn's mal das "lebende Objekt" ist, muss hier was passieren...
-}
-
// XSheetCondition
sheet::ConditionOperator SAL_CALL ScTableValidationObj::getOperator()
@@ -758,7 +729,6 @@ void SAL_CALL ScTableValidationObj::setOperator( sheet::ConditionOperator nOpera
{
ScUnoGuard aGuard;
nMode = sal::static_int_cast<USHORT>( lcl_ConditionOperatorToMode( nOperator ) );
- DataChanged();
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula1() throw(uno::RuntimeException)
@@ -772,7 +742,6 @@ void SAL_CALL ScTableValidationObj::setFormula1( const rtl::OUString& aFormula1
{
ScUnoGuard aGuard;
aExpr1 = String( aFormula1 );
- DataChanged();
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula2() throw(uno::RuntimeException)
@@ -786,7 +755,6 @@ void SAL_CALL ScTableValidationObj::setFormula2( const rtl::OUString& aFormula2
{
ScUnoGuard aGuard;
aExpr2 = String( aFormula2 );
- DataChanged();
}
table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno::RuntimeException)
@@ -804,7 +772,6 @@ void SAL_CALL ScTableValidationObj::setSourcePosition( const table::CellAddress&
{
ScUnoGuard aGuard;
aSrcPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
- DataChanged();
}
uno::Sequence<sheet::FormulaToken> SAL_CALL ScTableValidationObj::getTokens( sal_Int32 nIndex )
@@ -963,8 +930,6 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= nVal )
meGrammar2 = static_cast< FormulaGrammar::Grammar >(nVal);
}
-
- DataChanged();
}
uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const rtl::OUString& aPropertyName )
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index 28e54de859ad..7c8d80d9fcfa 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -377,14 +377,14 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName )
// if a macro name has been passed, try to attach it to the event
if( rMacroName.getLength() > 0 )
{
- VBAMacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName );
- if( !aResolvedMacro.IsResolved() )
+ MacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName );
+ if( !aResolvedMacro.mbFound )
throw uno::RuntimeException();
script::ScriptEventDescriptor aDescriptor;
aDescriptor.ListenerType = maListenerType;
aDescriptor.EventMethod = maEventMethod;
aDescriptor.ScriptType = CREATE_OUSTRING( "Script" );
- aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.ResolvedMacro() );
+ aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.msResolvedMacro );
xEventMgr->registerScriptEvent( nIndex, aDescriptor );
}
}
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 489da0cc4899..3307398b5ef8 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -530,19 +530,15 @@ void ScDrawView::MarkListHasChanged()
SfxViewFrame* pViewFrame = pViewSh->GetViewFrame();
BOOL bOle = pViewSh->GetViewFrame()->GetFrame().IsInPlace();
+ uno::Sequence< embed::VerbDescriptor > aVerbs;
if ( pOle2Obj && !bOle )
{
uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef();
+ DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" );
if (xObj.is())
- pViewSh->SetVerbs( xObj->getSupportedVerbs() );
- else
- {
- DBG_ERROR("SdrOle2Obj ohne ObjRef");
- pViewSh->SetVerbs( 0 );
- }
+ aVerbs = xObj->getSupportedVerbs();
}
- else
- pViewSh->SetVerbs( 0 );
+ pViewSh->SetVerbs( aVerbs );
// Image-Map Editor
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 12a1bb87211b..3ff7222178f3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -453,7 +453,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
if ( pStyleSheet )
{
- pTabViewShell->RemoveStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->RemoveStyleSheetInUse( pStyleSheet );
pStylePool->Remove( pStyleSheet );
pTabViewShell->InvalidateAttribs();
nRetMask = TRUE;
@@ -556,7 +556,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// Attribute uebernehmen und Style anwenden
pStyleSheet->GetItemSet().Put( aAttrSet );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
// call SetStyleSheetToMarked after adding the ScUndoModifyStyle
// (pStyleSheet pointer is used!)
@@ -578,7 +578,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
pStyleSheet->GetItemSet().Put( aAttrSet );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
// call SetStyleSheetToMarked after adding the ScUndoModifyStyle
// (pStyleSheet pointer is used!)
@@ -868,7 +868,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
(const SvxNumberInfoItem&)
*(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
pTabViewShell->InvalidateAttribs();
}
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 6e28d6ba846d..52d3217d7881 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -44,7 +44,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
-#include <svtools/printdlg.hxx>
#include <svl/stritem.hxx>
#include <svl/whiter.hxx>
#include <vcl/msgbox.hxx>
@@ -484,40 +483,6 @@ USHORT __EXPORT ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif
return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
}
-PrintDialog* __EXPORT ScPreviewShell::CreatePrintDialog( Window* pParent )
-{
- pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
- (void)GetPrinter();
-
- const long nCurPage = pPreview->GetPageNo()+1;
- const long nDocPageMax = pPreview->GetTotalPages();
- PrintDialog* pDlg = new PrintDialog( pParent, true );
-// wenn zu langsam wieder einbauen
-// if ( pPreview->AllTested() )
-// nPageMax = pPreview->GetTotalPages();
-
- pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
- pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
- pDlg->EnableSheetRange( false, PRINTSHEETS_SELECTED_CELLS );
- bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
- pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
-
- if ( nDocPageMax > 0 )
- pDlg->SetRangeText( String::CreateFromInt32( nCurPage ) );
-
- pDlg->EnableRange ( PRINTDIALOG_ALL );
- pDlg->EnableRange ( PRINTDIALOG_RANGE );
- pDlg->SetFirstPage ( 1 );
- pDlg->SetMinPage ( 1 );
- pDlg->SetLastPage ( (USHORT)nDocPageMax );
- pDlg->SetMaxPage ( (USHORT)nDocPageMax );
- pDlg->EnableCollate ();
-
- // Selektion hier nicht
-
- return pDlg;
-}
-
SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
@@ -529,66 +494,6 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt
return 0;
}
-void __EXPORT ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog )
-{
- SfxViewShell::PreparePrint( pPrintDialog );
-
- ScMarkData aMarkData;
- aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE );
- pDocShell->PreparePrint( pPrintDialog, &aMarkData );
-}
-
-ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter,
- PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI )
-{
- ErrCode nRet = ERRCODE_IO_ABORT;
-
- ScMarkData aMarkData;
- aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE );
-
- if ( pDocShell->CheckPrint( pPrintDialog, &aMarkData, false, bIsAPI ) )
- {
- // SfxViewShell::DoPrint calls Print (after StartJob etc.)
- nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
- }
-
- return nRet;
-}
-
-USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog )
-{
- pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
-
- // get the list of affected sheets before SfxViewShell::Print
- bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
-
- ScMarkData aMarkData;
- aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE );
-
- uno::Sequence< sal_Int32 > aSheets;
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
- sal_Int32 nPrinted = 0;
- for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
- {
- if ( bAllTabs || aMarkData.GetTableSelect( nTab ) )
- {
- aSheets.realloc( nPrinted + 1 );
- aSheets[nPrinted] = nTab;
- ++nPrinted;
- }
- }
-
- uno::Sequence < beans::PropertyValue > aProps(1);
- aProps[0].Name = ::rtl::OUString::createFromAscii( "PrintSheets" );
- aProps[0].Value <<= aSheets;
- SetAdditionalPrintOptions( aProps );
-
- SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
- pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, FALSE, bIsAPI );
-
- return 0;
-}
-
//------------------------------------------------------------------------
void __EXPORT ScPreviewShell::Activate(BOOL bMDI)
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 378ea1233cf9..378ea1233cf9 100755..100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 93d1edd7fee5..886a3035a847 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -767,11 +767,13 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
{
nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX();
+ if (nNewDeltaX < 0) nNewDeltaX = 0;
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
}
if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
{
nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY();
+ if (nNewDeltaY < 0) nNewDeltaY = 0;
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
}
@@ -780,7 +782,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
{
nNewDeltaX = nCurX - (nSizeX / 2);
- if (nNewDeltaX < 0) nNewDeltaY = 0;
+ if (nNewDeltaX < 0) nNewDeltaX = 0;
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
}
if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 0835d08de9fd..4596880b7fb6 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -46,7 +46,6 @@
#include <sfx2/request.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/printdlg.hxx>
#include <svl/whiter.hxx>
#include <unotools/moduleoptions.hxx>
#include <rtl/logfile.hxx>
@@ -1159,57 +1158,6 @@ USHORT __EXPORT ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif
return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
}
-PrintDialog* __EXPORT ScTabViewShell::CreatePrintDialog( Window *pParent )
-{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocShell->GetDocument();
-
- pDoc->SetPrintOptions(); // Optionen aus OFA am Printer setzen
- SfxPrinter* pPrinter = GetPrinter();
-
- String aStrRange;
- PrintDialog* pDlg = new PrintDialog( pParent, true );
- SCTAB nTabCount = pDoc->GetTableCount();
- long nDocPageMax = 0;
-
- pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
- pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
- pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_CELLS );
- bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
- pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
-
- // update all pending row heights with a single progress bar,
- // instead of a separate progress for each sheet from ScPrintFunc
- pDocShell->UpdatePendingRowHeights( MAXTAB, true );
-
- for ( SCTAB i=0; i<nTabCount; i++ )
- {
- ScPrintFunc aPrintFunc( pDocShell, pPrinter, i );
- nDocPageMax += aPrintFunc.GetTotalPages();
- }
-
- if ( nDocPageMax > 0 )
- {
- aStrRange = '1';
- if ( nDocPageMax > 1 )
- {
- aStrRange += '-';
- aStrRange += String::CreateFromInt32( nDocPageMax );
- }
- }
-
- pDlg->SetRangeText ( aStrRange );
- pDlg->EnableRange ( PRINTDIALOG_ALL );
- pDlg->EnableRange ( PRINTDIALOG_RANGE );
- pDlg->SetFirstPage ( 1 );
- pDlg->SetMinPage ( 1 );
- pDlg->SetLastPage ( (USHORT)nDocPageMax );
- pDlg->SetMaxPage ( (USHORT)nDocPageMax );
- pDlg->EnableCollate ();
-
- return pDlg;
-}
-
SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
@@ -1221,78 +1169,6 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt
return 0;
}
-void __EXPORT ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog )
-{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
-
- SfxViewShell::PreparePrint( pPrintDialog );
- pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() );
-}
-
-ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter,
- PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI )
-{
- // #72527# if SID_PRINTDOCDIRECT is executed and there's a selection,
- // ask if only the selection should be printed
-
- const ScMarkData& rMarkData = GetViewData()->GetMarkData();
- if ( !pPrintDialog && !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) )
- {
- SvxPrtQryBox aQuery( GetDialogParent() );
- short nBtn = aQuery.Execute();
-
- if ( nBtn == RET_CANCEL )
- return ERRCODE_IO_ABORT;
-
- if ( nBtn == RET_OK )
- bPrintSelected = TRUE;
- }
-
- ErrCode nRet = ERRCODE_IO_ABORT;
-
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
- if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) )
- {
- // get the list of affected sheets before SfxViewShell::Print
- bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
-
- uno::Sequence<sal_Int32> aSheets;
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
- USHORT nPrinted = 0;
- for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
- if ( bAllTabs || rMarkData.GetTableSelect(nTab) )
- {
- aSheets.realloc( nPrinted + 1 );
- aSheets[nPrinted] = nTab;
- ++nPrinted;
- }
-
- uno::Sequence < beans::PropertyValue > aProps(1);
- aProps[0].Name=::rtl::OUString::createFromAscii("PrintSheets");
- aProps[0].Value <<= aSheets;
- SetAdditionalPrintOptions( aProps );
-
- // SfxViewShell::DoPrint calls Print (after StartJob etc.)
- nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
- }
-
- bPrintSelected = FALSE;
-
- return nRet;
-}
-
-USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI,
- PrintDialog* pPrintDialog )
-{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
- pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
-
- SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
- pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(),
- GetDialogParent(), bPrintSelected, bIsAPI );
- return 0;
-}
-
void ScTabViewShell::StopEditShell()
{
if ( pEditShell != NULL && !bDontSwitch )
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 123464cd5fda..ded411aca9ed 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -392,9 +392,11 @@ void ScViewFunc::DoThesaurus( BOOL bRecord )
if (pCell)
{
((ScEditCell*) pCell)->GetData(pTObject);
- pOldTObj = pTObject->Clone();
if (pTObject)
+ {
+ pOldTObj = pTObject->Clone();
pThesaurusEngine->SetText(*pTObject);
+ }
}
}
else
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 231eb4e67562..e0ebb8f3024f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1545,7 +1545,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, BOOL bRecord
}
-void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet )
+void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
{
if ( !pStyleSheet) return;
// -------------------------------------------------------------------
@@ -1572,7 +1572,7 @@ void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet )
pHdl->ForgetLastPattern();
}
-void ScViewFunc::UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet )
+void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
{
if ( !pStyleSheet) return;
// -------------------------------------------------------------------
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 899059ec26b1..e1634ab78f76 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -1250,6 +1250,14 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bundled_Extensions_User
Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":BUNDLED_EXTENSIONS_USER}";
End
+ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bundled_Extensions_Prereg
+ ModuleID = gid_Module_Root_Brand;
+ ProfileID = gid_Brand_Profile_Fundamental_Ini;
+ Section = "Bootstrap";
+ Key = "BUNDLED_EXTENSIONS_PREREG";
+ Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":BUNDLED_EXTENSIONS_PREREG}";
+End
+
ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Shared_Packages_Cache
ModuleID = gid_Module_Root_Brand;
ProfileID = gid_Brand_Profile_Fundamental_Ini;
diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp
index 724316ba6f5e..81bfb6a8dd2d 100644
--- a/scp2/source/ooo/profileitem_ooo.scp
+++ b/scp2/source/ooo/profileitem_ooo.scp
@@ -191,6 +191,16 @@ ProfileItem gid_Profileitem_Uno_Uno_Bundled_Extensions_User
Value = "${$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap) ":UserInstallation}/user/extensions/bundled";
End
+ProfileItem gid_Profileitem_Uno_Uno_Bundled_Extensions_Prereg
+ ProfileID = gid_Profile_Uno_Ini;
+ ModuleID = gid_Module_Root;
+ Section = "Bootstrap";
+ Order = 1;
+ Key = "BUNDLED_EXTENSIONS_PREREG";
+ Value = "$BRAND_BASE_DIR/share/prereg/bundled";
+End
+
+
ProfileItem gid_Profileitem_Uno_Uno_Shared_Packages
ProfileID = gid_Profile_Uno_Ini;
ModuleID = gid_Module_Root;
@@ -287,6 +297,14 @@ ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Bundled_Extensions_User
Value = "${$ORIGIN/" PROFILENAME(uno) ":BUNDLED_EXTENSIONS_USER}";
End
+ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Bundled_Extensions_Prereg
+ ModuleID = gid_Module_Root;
+ ProfileID = gid_Profile_Fundamentalbasis_Ini;
+ Section = "Bootstrap";
+ Key = "BUNDLED_EXTENSIONS_PREREG";
+ Value = "${$ORIGIN/" PROFILENAME(uno) ":BUNDLED_EXTENSIONS_PREREG}";
+End
+
ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Shared_Packages_Cache
ModuleID = gid_Module_Root;
ProfileID = gid_Profile_Fundamentalbasis_Ini;
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 2a80030b7560..2a4cec779f64 100755
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -530,7 +530,6 @@
#include "unotools/pathoptions.hxx"
#include "svl/poolitem.hxx"
#include "svtools/prgsbar.hxx"
-#include "svtools/printdlg.hxx"
#include "svl/ptitem.hxx"
#include "svl/rectitem.hxx"
#include "unotools/saveopt.hxx"
@@ -901,7 +900,7 @@
#include "vcl/virdev.hxx"
#include "vcl/waitobj.hxx"
#include "vcl/window.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vcl/wrkwin.hxx"
#include "vos/diagnose.hxx"
diff --git a/sd/qa/unoapi/sd.sce b/sd/qa/unoapi/sd.sce
index c964c1ba0090..c964c1ba0090 100755..100644
--- a/sd/qa/unoapi/sd.sce
+++ b/sd/qa/unoapi/sd.sce
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index a58577458a67..c3fb301a0fc3 100755
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -163,7 +163,7 @@ void SdDrawDocument::CreateLayoutTemplates()
String aNullStr;
::basegfx::B2DPolyPolygon aNullPolyPolygon;
- Color aNullCol(RGB_Color(COL_BLACK));
+ Color aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
XDash aNullDash;
XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE));
@@ -173,19 +173,20 @@ void SdDrawDocument::CreateLayoutTemplates()
// Linienattribute (Extended OutputDevice)
rISet.Put(XLineStyleItem(XLINE_SOLID));
- rISet.Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
+ rISet.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE)));
rISet.Put(XLineWidthItem(0));
rISet.Put(XLineDashItem(pPool,aNullDash));
rISet.Put(XLineStartItem(pPool,aNullPolyPolygon));
rISet.Put(XLineEndItem(pPool,aNullPolyPolygon));
- rISet.Put(XLineStartWidthItem(300));
- rISet.Put(XLineEndWidthItem(300));
+ rISet.Put(XLineStartWidthItem(200));
+ rISet.Put(XLineEndWidthItem(200));
rISet.Put(XLineStartCenterItem());
rISet.Put(XLineEndCenterItem());
+ rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
// Fuellattribute (Extended OutputDevice)
rISet.Put(XFillStyleItem(XFILL_SOLID));
- rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); // "Blue 8"
+ rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING)));
rISet.Put(XFillGradientItem(pPool,aNullGrad));
rISet.Put(XFillHatchItem(pPool,aNullHatch));
@@ -198,8 +199,8 @@ void SdDrawDocument::CreateLayoutTemplates()
// Schattenattribute (Drawing Engine)
rISet.Put(SdrShadowItem(FALSE));
rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- rISet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz
- rISet.Put(SdrShadowYDistItem(300));
+ rISet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
+ rISet.Put(SdrShadowYDistItem(200));
Font aLatinFont, aCJKFont, aCTLFont;
@@ -310,8 +311,8 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet->Put(SdrShadowItem(TRUE));
pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz
- pISet->Put(SdrShadowYDistItem(300));
+ pISet->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
+ pISet->Put(SdrShadowYDistItem(200));
// ---- Objekt ohne Fllung -------------------------------------------
@@ -322,6 +323,7 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet = &pSheet->GetItemSet();
pISet->Put(XFillStyleItem(XFILL_NONE));
+ pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
// ---- Text ----------------------------------------------------------
@@ -513,6 +515,7 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet = &pSheet->GetItemSet();
pISet->Put(XFillStyleItem(XFILL_NONE));
+ pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT )); // 12 pt
diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src
index f1c7058ddf79..f1c7058ddf79 100755..100644
--- a/sd/source/core/glob.src
+++ b/sd/source/core/glob.src
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 205e007d9e97..ef3d5d0ebe25 100755
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -519,10 +519,11 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
rBackgroundObjectsSet.Put(SdrShadowItem(FALSE));
rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY)));
- rBackgroundObjectsSet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz
- rBackgroundObjectsSet.Put(SdrShadowYDistItem(300));
+ rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
+ rBackgroundObjectsSet.Put(SdrShadowYDistItem(200));
// #i16874# enable kerning by default but only for new documents
rBackgroundObjectsSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) );
+ rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
}
/**************************************************************************
@@ -1029,12 +1030,8 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , FALSE);
- aNumberFormat.SetLSpace( 0 );
- aNumberFormat.SetAbsLSpace( 0 );
- aNumberFormat.SetFirstLineOffset( 0 );
- aNumRule.SetLevel( 0, aNumberFormat );
- for( USHORT i = 1; i < aNumRule.GetLevelCount(); i++ )
+ for( USHORT i = 0; i < aNumRule.GetLevelCount(); i++ )
{
const short nLSpace = (i + 1) * 600;
aNumberFormat.SetLSpace(nLSpace);
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index b77c2563fc03..b77c2563fc03 100755..100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 7f942562b951..7f942562b951 100644..100755
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 8b96e08b4a8c..9cdbc2f0cfba 100644..100755
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1953,6 +1953,16 @@ void CustomAnimationPane::onChange( bool bCreate )
{
CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
+ // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
+ if( bHasText && (aTargets.size() == 1) )
+ {
+ Reference< XShape > xShape( (*aIter), UNO_QUERY );
+ if( xShape.is() && !hasVisibleShape( xShape ) )
+ {
+ mpMainSequence->createTextGroup( pCreated, 1, -1.0, sal_False, sal_False );
+ }
+ }
+
if( bFirst )
bFirst = false;
else
diff --git a/sd/source/ui/annotations/annotations.src b/sd/source/ui/annotations/annotations.src
index 536d10f9a417..536d10f9a417 100644..100755
--- a/sd/source/ui/annotations/annotations.src
+++ b/sd/source/ui/annotations/annotations.src
diff --git a/sd/source/ui/app/menuids3_tmpl.src b/sd/source/ui/app/menuids3_tmpl.src
index aae782b5fe1e..aae782b5fe1e 100644..100755
--- a/sd/source/ui/app/menuids3_tmpl.src
+++ b/sd/source/ui/app/menuids3_tmpl.src
diff --git a/sd/source/ui/app/menuids4_tmpl.src b/sd/source/ui/app/menuids4_tmpl.src
index 61a43aa6d8ba..61a43aa6d8ba 100644..100755
--- a/sd/source/ui/app/menuids4_tmpl.src
+++ b/sd/source/ui/app/menuids4_tmpl.src
diff --git a/sd/source/ui/app/menuids_tmpl.src b/sd/source/ui/app/menuids_tmpl.src
index 1e313bbee2fc..1e313bbee2fc 100644..100755
--- a/sd/source/ui/app/menuids_tmpl.src
+++ b/sd/source/ui/app/menuids_tmpl.src
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 4355da3011c9..3366a0ea98db 100755..100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -46,6 +46,16 @@ using namespace ::com::sun::star::uno;
#define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr))
+template< class T > T getSafeValue( const Any& rAny )
+{
+ T value = T();
+ bool bOk = (rAny >>= value);
+
+ DBG_ASSERT( bOk, "SdOptionsItem, wrong type from configuration!" );
+ (void)bOk;
+
+ return value;
+}
// -----------------
// - SdOptionsItem -
@@ -503,6 +513,9 @@ SdOptionsMisc::SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig ) :
bPreviewChangedEffects( FALSE ),
bPreviewTransitions( TRUE ),
mnDisplay( 0 ),
+ mnPenColor( 0xff0000 ),
+ mnPenWidth( 150.0 ),
+
// The default for 6.1-and-above documents is to use printer-independent
// formatting.
mnPrinterIndependentLayout (1)
@@ -541,7 +554,9 @@ BOOL SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() &&
IsPreviewTransitions() == rOpt.IsPreviewTransitions() &&
GetDisplay() == rOpt.GetDisplay() &&
- IsShowComments() == rOpt.IsShowComments()
+ IsShowComments() == rOpt.IsShowComments() &&
+ GetPresentationPenColor() == rOpt.GetPresentationPenColor() &&
+ GetPresentationPenWidth() == rOpt.GetPresentationPenWidth()
);
}
@@ -583,10 +598,13 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) con
"PreviewChangedEffects",
"PreviewTransitions",
- "Display"
+ "Display",
+
+ "PenColor",
+ "PenWidth"
};
- rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 25 : 16 );
+ rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 16 );
ppNames = aPropNames;
}
@@ -641,6 +659,12 @@ BOOL SdOptionsMisc::ReadData( const Any* pValues )
if( pValues[24].hasValue() )
SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue());
+
+ if( pValues[25].hasValue() )
+ SetPresentationPenColor( getSafeValue< sal_Int32 >( pValues[ 25 ] ) );
+
+ if( pValues[26].hasValue() )
+ SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) );
}
return TRUE;
@@ -684,6 +708,9 @@ BOOL SdOptionsMisc::WriteData( Any* pValues ) const
pValues[ 23 ] <<= IsPreviewTransitions();
pValues[ 24 ] <<= GetDisplay();
+
+ pValues[ 25 ] <<= GetPresentationPenColor();
+ pValues[ 26 ] <<= GetPresentationPenWidth();
}
return TRUE;
@@ -725,6 +752,9 @@ SdOptionsMiscItem::SdOptionsMiscItem( USHORT _nWhich, SdOptions* pOpts, ::sd::Fr
maOptionsMisc.SetDisplay(pOpts->GetDisplay());
maOptionsMisc.SetShowComments( pOpts->IsShowComments() );
+
+ maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() );
+ maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() );
}
if( pView )
@@ -813,6 +843,9 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
pOpts->SetPreviewTransitions( maOptionsMisc.IsPreviewTransitions() );
pOpts->SetDisplay( maOptionsMisc.GetDisplay() );
+
+ pOpts->SetPresentationPenColor( maOptionsMisc.GetPresentationPenColor() );
+ pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() );
}
}
diff --git a/sd/source/ui/app/popup.src b/sd/source/ui/app/popup.src
index 27f91bab3c6d..27f91bab3c6d 100644..100755
--- a/sd/source/ui/app/popup.src
+++ b/sd/source/ui/app/popup.src
diff --git a/sd/source/ui/app/popup2_tmpl.src b/sd/source/ui/app/popup2_tmpl.src
index c76c09df62e6..c76c09df62e6 100644..100755
--- a/sd/source/ui/app/popup2_tmpl.src
+++ b/sd/source/ui/app/popup2_tmpl.src
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 7e87b246d371..4fc88c3a6049 100644..100755
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -784,7 +784,7 @@ String STR_PUBLISH_OUTLINE
};
String STR_EYEDROPPER
{
- Text [ en-US ] = "Eyedropper" ;
+ Text [ en-US ] = "Color Replacer" ;
};
String STR_UNDO_MORPHING
{
diff --git a/sd/source/ui/app/toolbox.src b/sd/source/ui/app/toolbox.src
index 0f3b3c69aeef..0f3b3c69aeef 100644..100755
--- a/sd/source/ui/app/toolbox.src
+++ b/sd/source/ui/app/toolbox.src
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 29425a3bda71..29425a3bda71 100644..100755
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index acbf70d8e687..82ca4d05b996 100755
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -49,7 +49,7 @@
#include <svl/undo.hxx>
#include "DrawDocShell.hxx"
#include <vcl/gdimtf.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include "docprev.hxx"
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index c0d8235e97fb..a1ab9b853ff4 100755
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -312,40 +312,74 @@ void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj)
sal_Bool bUseFillStyle, bUseNoFillStyle;
bUseFillStyle = bUseNoFillStyle = sal_False;
- if (nSlotId == SID_DRAW_RECT || // Rechteck
- nSlotId == SID_DRAW_RECT_ROUND || // Rechteck, rund
- nSlotId == SID_DRAW_SQUARE || // Quadrat
- nSlotId == SID_DRAW_SQUARE_ROUND || // Quadrat, rund
- nSlotId == SID_DRAW_ELLIPSE || // Ellipse
- nSlotId == SID_DRAW_PIE || // Ellipsensegment
- nSlotId == SID_DRAW_ELLIPSECUT || // Ellipsenabschnitt
- nSlotId == SID_DRAW_CIRCLE || // Kreis
- nSlotId == SID_DRAW_CIRCLEPIE || // Kreissegment
- nSlotId == SID_DRAW_CIRCLECUT || // Ellipsenabschnitt
- nSlotId == SID_DRAW_POLYGON || // Polygon
- nSlotId == SID_DRAW_XPOLYGON || // 45ø-Polygon
- nSlotId == SID_DRAW_FREELINE || // Freihandlinie
- nSlotId == SID_DRAW_BEZIER_FILL) // Bezier
+ switch( nSlotId )
+ {
+ case SID_DRAW_RECT:
+ case SID_DRAW_RECT_ROUND:
+ case SID_DRAW_SQUARE:
+ case SID_DRAW_SQUARE_ROUND:
+ case SID_DRAW_ELLIPSE:
+ case SID_DRAW_PIE:
+ case SID_DRAW_ELLIPSECUT:
+ case SID_DRAW_CIRCLE:
+ case SID_DRAW_CIRCLEPIE:
+ case SID_DRAW_CIRCLECUT:
+ case SID_DRAW_POLYGON:
+ case SID_DRAW_XPOLYGON:
+ case SID_DRAW_FREELINE:
+ case SID_DRAW_BEZIER_FILL:
{
bUseFillStyle = sal_True;
+ break;
}
- else if
- (nSlotId == SID_DRAW_RECT_NOFILL || // Rechteck
- nSlotId == SID_DRAW_RECT_ROUND_NOFILL || // Rechteck, rund
- nSlotId == SID_DRAW_SQUARE_NOFILL || // Quadrat
- nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL || // Quadrat, rund
- nSlotId == SID_DRAW_ELLIPSE_NOFILL || // Ellipse
- nSlotId == SID_DRAW_PIE_NOFILL || // Ellipsensegment
- nSlotId == SID_DRAW_ELLIPSECUT_NOFILL || // Ellipsenabschnitt
- nSlotId == SID_DRAW_CIRCLE_NOFILL || // Kreis
- nSlotId == SID_DRAW_CIRCLEPIE_NOFILL || // Kreissegment
- nSlotId == SID_DRAW_CIRCLECUT_NOFILL || // Ellipsenabschnitt
- nSlotId == SID_DRAW_POLYGON_NOFILL || // Polygon
- nSlotId == SID_DRAW_XPOLYGON_NOFILL || // 45ø-Polygon
- nSlotId == SID_DRAW_FREELINE_NOFILL || // Freihandlinie
- nSlotId == SID_DRAW_BEZIER_NOFILL) // Bezier
+ case SID_DRAW_RECT_NOFILL:
+ case SID_DRAW_RECT_ROUND_NOFILL:
+ case SID_DRAW_SQUARE_NOFILL:
+ case SID_DRAW_SQUARE_ROUND_NOFILL:
+ case SID_DRAW_ELLIPSE_NOFILL:
+ case SID_DRAW_PIE_NOFILL:
+ case SID_DRAW_ELLIPSECUT_NOFILL:
+ case SID_DRAW_CIRCLE_NOFILL:
+ case SID_DRAW_CIRCLEPIE_NOFILL:
+ case SID_DRAW_CIRCLECUT_NOFILL:
+ case SID_DRAW_POLYGON_NOFILL:
+ case SID_DRAW_XPOLYGON_NOFILL:
+ case SID_DRAW_FREELINE_NOFILL:
+ case SID_DRAW_LINE:
+ case SID_DRAW_XLINE:
+ case SID_CONNECTOR_ARROW_START:
+ case SID_CONNECTOR_ARROW_END:
+ case SID_CONNECTOR_ARROWS:
+ case SID_CONNECTOR_CIRCLE_START:
+ case SID_CONNECTOR_CIRCLE_END:
+ case SID_CONNECTOR_CIRCLES:
+ case SID_CONNECTOR_LINE:
+ case SID_CONNECTOR_LINE_ARROW_START:
+ case SID_CONNECTOR_LINE_ARROW_END:
+ case SID_CONNECTOR_LINE_ARROWS:
+ case SID_CONNECTOR_LINE_CIRCLE_START:
+ case SID_CONNECTOR_LINE_CIRCLE_END:
+ case SID_CONNECTOR_LINE_CIRCLES:
+ case SID_CONNECTOR_CURVE:
+ case SID_CONNECTOR_CURVE_ARROW_START:
+ case SID_CONNECTOR_CURVE_ARROW_END:
+ case SID_CONNECTOR_CURVE_ARROWS:
+ case SID_CONNECTOR_CURVE_CIRCLE_START:
+ case SID_CONNECTOR_CURVE_CIRCLE_END:
+ case SID_CONNECTOR_CURVE_CIRCLES:
+ case SID_CONNECTOR_LINES:
+ case SID_CONNECTOR_LINES_ARROW_START:
+ case SID_CONNECTOR_LINES_ARROW_END:
+ case SID_CONNECTOR_LINES_ARROWS:
+ case SID_CONNECTOR_LINES_CIRCLE_START:
+ case SID_CONNECTOR_LINES_CIRCLE_END:
+ case SID_CONNECTOR_LINES_CIRCLES:
+ case SID_DRAW_BEZIER_NOFILL:
+ case SID_LINE_ARROW_END:
{
bUseNoFillStyle = sal_True;
+ break;
+ }
}
SetStyleSheet( rAttr, pObj, bUseFillStyle, bUseNoFillStyle );
}
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 5cc3cc49ca88..4d03abd7b8bc 100755
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -163,40 +163,40 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
if (!mpView->IsSnapEnabled())
mpView->SetSnapEnabled(TRUE);
- BOOL bCntrl = rMEvt.IsMod1();
+ BOOL bSnapModPressed = rMEvt.IsMod1();
BOOL bGridSnap = pFrameView->IsGridSnap();
- bGridSnap = (bCntrl != bGridSnap);
+ bGridSnap = (bSnapModPressed != bGridSnap);
if (mpView->IsGridSnap() != bGridSnap)
mpView->SetGridSnap(bGridSnap);
BOOL bBordSnap = pFrameView->IsBordSnap();
- bBordSnap = (bCntrl != bBordSnap);
+ bBordSnap = (bSnapModPressed != bBordSnap);
if (mpView->IsBordSnap() != bBordSnap)
mpView->SetBordSnap(bBordSnap);
BOOL bHlplSnap = pFrameView->IsHlplSnap();
- bHlplSnap = (bCntrl != bHlplSnap);
+ bHlplSnap = (bSnapModPressed != bHlplSnap);
if (mpView->IsHlplSnap() != bHlplSnap)
mpView->SetHlplSnap(bHlplSnap);
BOOL bOFrmSnap = pFrameView->IsOFrmSnap();
- bOFrmSnap = (bCntrl != bOFrmSnap);
+ bOFrmSnap = (bSnapModPressed != bOFrmSnap);
if (mpView->IsOFrmSnap() != bOFrmSnap)
mpView->SetOFrmSnap(bOFrmSnap);
BOOL bOPntSnap = pFrameView->IsOPntSnap();
- bOPntSnap = (bCntrl != bOPntSnap);
+ bOPntSnap = (bSnapModPressed != bOPntSnap);
if (mpView->IsOPntSnap() != bOPntSnap)
mpView->SetOPntSnap(bOPntSnap);
BOOL bOConSnap = pFrameView->IsOConSnap();
- bOConSnap = (bCntrl != bOConSnap);
+ bOConSnap = (bSnapModPressed != bOConSnap);
if (mpView->IsOConSnap() != bOConSnap)
mpView->SetOConSnap(bOConSnap);
@@ -229,7 +229,7 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
if ( bHelpLine
&& !mpView->IsCreateObj()
- && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bCntrl)) )
+ && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
{
mpWindow->CaptureMouse();
mpView->BegDragHelpLine(nHelpLine, pPV);
@@ -285,41 +285,41 @@ BOOL FuDraw::MouseMove(const MouseEvent& rMEvt)
bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
}
- BOOL bCntrl = rMEvt.IsMod1();
+ BOOL bSnapModPressed = rMEvt.IsMod2();
mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
BOOL bGridSnap = pFrameView->IsGridSnap();
- bGridSnap = (bCntrl != bGridSnap);
+ bGridSnap = (bSnapModPressed != bGridSnap);
if (mpView->IsGridSnap() != bGridSnap)
mpView->SetGridSnap(bGridSnap);
BOOL bBordSnap = pFrameView->IsBordSnap();
- bBordSnap = (bCntrl != bBordSnap);
+ bBordSnap = (bSnapModPressed != bBordSnap);
if (mpView->IsBordSnap() != bBordSnap)
mpView->SetBordSnap(bBordSnap);
BOOL bHlplSnap = pFrameView->IsHlplSnap();
- bHlplSnap = (bCntrl != bHlplSnap);
+ bHlplSnap = (bSnapModPressed != bHlplSnap);
if (mpView->IsHlplSnap() != bHlplSnap)
mpView->SetHlplSnap(bHlplSnap);
BOOL bOFrmSnap = pFrameView->IsOFrmSnap();
- bOFrmSnap = (bCntrl != bOFrmSnap);
+ bOFrmSnap = (bSnapModPressed != bOFrmSnap);
if (mpView->IsOFrmSnap() != bOFrmSnap)
mpView->SetOFrmSnap(bOFrmSnap);
BOOL bOPntSnap = pFrameView->IsOPntSnap();
- bOPntSnap = (bCntrl != bOPntSnap);
+ bOPntSnap = (bSnapModPressed != bOPntSnap);
if (mpView->IsOPntSnap() != bOPntSnap)
mpView->SetOPntSnap(bOPntSnap);
BOOL bOConSnap = pFrameView->IsOConSnap();
- bOConSnap = (bCntrl != bOConSnap);
+ bOConSnap = (bSnapModPressed != bOConSnap);
if (mpView->IsOConSnap() != bOConSnap)
mpView->SetOConSnap(bOConSnap);
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 2ddf6a5fb885..5c380da547bc 100644..100755
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -436,6 +436,12 @@ BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
mpView->BegMarkObj(aMDPos);
}
}
+
+ if( bMarked && bTempRotation && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() && (rMEvt.GetClicks() != 2) )
+ {
+ nSlotId = SID_OBJECT_SELECT;
+ Activate();
+ }
}
}
}
@@ -711,6 +717,8 @@ BOOL FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
if (nSlotId == SID_OBJECT_SELECT
&& mpView->IsRotateAllowed()
+
+ && (rMEvt.GetClicks() != 2)
&& (mpViewShell->GetFrameView()->IsClickChangeRotation()
|| (pSingleObj
&& pSingleObj->GetObjInventor()==E3dInventor))
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 2f3111665692..2835821796a1 100755
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -702,6 +702,17 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt)
mpView->EndDragObj( mpView->IsDragWithCopy() );
mpView->ForceMarkedToAnotherPage();
mpView->SetCurrentObj(OBJ_TEXT);
+
+ USHORT nDrgLog = USHORT ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+
+ if ( mpView->IsRotateAllowed() && mpViewShell->GetFrameView()->IsClickChangeRotation() && (rMEvt.GetClicks() != 2) &&
+ !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() &&
+ Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
+ Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ {
+ // toggle to rotation mode
+ mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_ROTATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
+ }
}
else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft())
{
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 38f7223f1d83..2d1ae6404108 100755
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -144,24 +144,10 @@ public:
USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false);
/// Forwarded to the print manager.
- virtual PrintDialog* CreatePrintDialog (::Window *pParent);
-
- /// Forwarded to the print manager.
virtual SfxTabPage* CreatePrintOptionsPage (
::Window *pParent,
const SfxItemSet &rOptions);
- /// Forwarded to the print manager.
- virtual USHORT Print (SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pDialog);
-
- /// Forwarded to the print manager.
- virtual ErrCode DoPrint (
- SfxPrinter *pPrinter,
- PrintDialog *pPrintDialog,
- BOOL bSilent, BOOL bIsAPI );
-
- virtual void PreparePrint (PrintDialog* pPrintDialog);
-
/// Forward methods to main sub shell.
virtual void WriteUserDataSequence (
::com::sun::star::uno::Sequence <
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index 13088dfc64cb..419f661b1405 100755
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -279,6 +279,9 @@ private:
sal_Int32 mnDisplay;
+ sal_Int32 mnPenColor;
+ double mnPenWidth;
+
/** This value controls the device to use for formatting documents.
The currently supported values are 0 for the current printer or 1
for the printer independent virtual device the can be retrieved from
@@ -336,6 +339,12 @@ public:
sal_Int32 GetDisplay() const { Init(); return mnDisplay; }
void SetDisplay( sal_Int32 nDisplay = 0 ) { if( mnDisplay != nDisplay ) { OptionsChanged(); mnDisplay = nDisplay; } }
+ sal_Int32 GetPresentationPenColor() const { Init(); return mnPenColor; }
+ void SetPresentationPenColor( sal_Int32 nPenColor ) { if( mnPenColor != nPenColor ) { OptionsChanged(); mnPenColor = nPenColor; } }
+
+ double GetPresentationPenWidth() const { Init(); return mnPenWidth; }
+ void SetPresentationPenWidth( double nPenWidth ) { if( mnPenWidth != nPenWidth ) { OptionsChanged(); mnPenWidth = nPenWidth; } }
+
void SetStartWithTemplate( BOOL bOn = TRUE ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } }
void SetMarkedHitMovesAlways( BOOL bOn = TRUE ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } }
void SetMoveOnlyDragging( BOOL bOn = TRUE ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } }
diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk
index ad4f4d306c6b..62062d7e5461 100644..100755
--- a/sd/source/ui/slideshow/makefile.mk
+++ b/sd/source/ui/slideshow/makefile.mk
@@ -40,8 +40,7 @@ AUTOSEG=true
.INCLUDE : $(PRJ)$/util$/makefile.pmk
.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
-RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
-ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
+ENABLE_PRESENTER_EXTRA_UI is not used anymore
.ENDIF
# --- Files --------------------------------------------------------
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index fe6f9483b8b6..fe6f9483b8b6 100644..100755
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc
index 709e2a79146e..f086f52cb73f 100644..100755
--- a/sd/source/ui/slideshow/slideshow.hrc
+++ b/sd/source/ui/slideshow/slideshow.hrc
@@ -37,25 +37,20 @@
#define CM_ENDSHOW 7
#define CM_FIRST_SLIDE 8
#define CM_LAST_SLIDE 9
-#define CM_SLIDES 10
+
//CM for extra presenter UI
-#define CM_ERASE_ALLINK 11
-#define CM_ERASE_INK 12
-#define CM_ERASE_INK_PEN 13
-#define CM_ERASE_INK_PEN_VERY_THIN 14
-#define CM_ERASE_INK_PEN_THIN 15
-#define CM_ERASE_INK_PEN_NORMAL 16
-#define CM_ERASE_INK_PEN_THICK 17
-#define CM_ERASE_INK_PEN_VERY_THICK 18
-#define CM_COLOR_PEN 19
-#define CM_WIDTH_PEN 20
-#define CM_WIDTH_PEN_VERY_THIN 21
-#define CM_WIDTH_PEN_THIN 22
-#define CM_WIDTH_PEN_NORMAL 23
-#define CM_WIDTH_PEN_THICK 24
-#define CM_WIDTH_PEN_VERY_THICK 25
-#define CM_PEN_MODE 26
-#define CM_ERASE_MODE 27
-#define CM_POINTER_OPTION 28
+#define CM_ERASE_ALLINK 10
+#define CM_COLOR_PEN 11
+#define CM_WIDTH_PEN 12
+#define CM_WIDTH_PEN_VERY_THIN 13
+#define CM_WIDTH_PEN_THIN 14
+#define CM_WIDTH_PEN_NORMAL 15
+#define CM_WIDTH_PEN_THICK 16
+#define CM_WIDTH_PEN_VERY_THICK 17
+#define CM_PEN_MODE 18
+#define CM_ERASE_MODE 19
+#define CM_POINTER_OPTION 20
+
+#define CM_SLIDES 21 // this must be the last id!
#endif
diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src
index 02c225fb5ea9..78cd2aae0d9f 100644..100755
--- a/sd/source/ui/slideshow/slideshow.src
+++ b/sd/source/ui/slideshow/slideshow.src
@@ -71,20 +71,10 @@ Menu RID_SLIDESHOW_CONTEXTMENU
{
Separator = TRUE;
};
-#ifdef ENABLE_PRESENTER_EXTRA_UI
MenuItem
{
Identifier = CM_PEN_MODE;
- Text [ en-US ] = "~Pen Mode";
- };
- MenuItem
- {
- Identifier = CM_ERASE_MODE;
- Text [ en-US ] = "~Eraser Mode";
- };
- MenuItem
- {
- Separator = TRUE;
+ Text [ en-US ] = "Mouse pointer as ~pen";
};
MenuItem
{
@@ -124,20 +114,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
MenuItem
{
- Separator = TRUE;
- };
- MenuItem
- {
Identifier = CM_COLOR_PEN ;
- Text [ en-US ] = "~Change Pen Color" ;
- };
- MenuItem
- {
- Separator = TRUE;
- };
- MenuItem
- {
- Separator = TRUE;
+ Text [ en-US ] = "~Change Pen Color..." ;
};
MenuItem
{
@@ -150,48 +128,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
MenuItem
{
- Identifier = CM_ERASE_INK_PEN;
- Text [ en-US ] = "~Eraser Width" ;
-
- SubMenu = Menu
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = CM_ERASE_INK_PEN_VERY_THIN;
- Text [ en-US ] = "~Very thin";
- };
- MenuItem
- {
- Identifier = CM_ERASE_INK_PEN_THIN;
- Text [ en-US ] = "~Thin";
- };
- MenuItem
- {
- Identifier = CM_ERASE_INK_PEN_NORMAL;
- Text [ en-US ] = "~Normal";
- };
- MenuItem
- {
- Identifier = CM_ERASE_INK_PEN_THICK;
- Text [ en-US ] = "~Thick";
- };
- MenuItem
- {
- Identifier = CM_ERASE_INK_PEN_VERY_THICK;
- Text [ en-US ] = "~Very Thick";
- };
- };
- };
- };
-#endif
- MenuItem
- {
- Separator = TRUE;
- };
- MenuItem
- {
Identifier = CM_SCREEN;
Text [ en-US ] = "~Screen" ;
@@ -216,6 +152,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU
{
Identifier = CM_ENDSHOW ;
Text [ en-US ] = "~End Show" ;
- };
+ };
};
};
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index ee89da143910..67ac7e94cadb 100755
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -554,13 +554,11 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
, mbInputFreeze(false)
, mbActive(sal_False)
, maPresSettings( pDoc->getPresentationSettings() )
-, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default
-#ifdef ENABLE_PRESENTER_EXTRA_UI
-, mbSwitchPenMode(true)
+, mnUserPaintColor( 0x80ff0000L )
+, mbUsePen(false)
+, mdUserPaintStrokeWidth ( 150.0 )
+#ifdef ENABLE_ERASER_UI
, mbSwitchEraserMode(false)
-, mdUserPaintStrokeWidth ( 4.0 )
-, mbEraseAllInk(false)
-//, mbEraseInk(false)
, mnEraseInkSize(100)
#endif
, mnEntryCounter(0)
@@ -591,10 +589,26 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
mbAutoSaveWasOn = true;
Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) );
+
+ mbUsePen = maPresSettings.mbMouseAsPen;
+
+ SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
+ if( pOptions )
+ {
+ mnUserPaintColor = pOptions->GetPresentationPenColor();
+ mdUserPaintStrokeWidth = pOptions->GetPresentationPenWidth();
+ }
}
SlideshowImpl::~SlideshowImpl()
{
+ SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
+ if( pOptions )
+ {
+ pOptions->SetPresentationPenColor(mnUserPaintColor);
+ pOptions->SetPresentationPenWidth(mdUserPaintStrokeWidth);
+ }
+
Application::RemoveEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) );
maDeactivateTimer.Stop();
@@ -1124,13 +1138,20 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
-1, Any( maPresSettings.mbManual != sal_False ),
beans::PropertyState_DIRECT_VALUE ) );
- if( maPresSettings.mbMouseAsPen )
+ if( mbUsePen )
{
aProperties.push_back(
beans::PropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ),
// User paint color is black by default.
- -1, Any( static_cast<sal_Int32>(0x00000000L) ),
+ -1, Any( mnUserPaintColor ),
+ beans::PropertyState_DIRECT_VALUE ) );
+
+ aProperties.push_back(
+ beans::PropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintStrokeWidth") ),
+ // User paint color is black by default.
+ -1, Any( mdUserPaintStrokeWidth ),
beans::PropertyState_DIRECT_VALUE ) );
}
@@ -1461,14 +1482,14 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects)
void SlideshowImpl::endPresentation()
{
-#ifdef ENABLE_PRESENTER_EXTRA_UI
+/*
if( maPresSettings.mbMouseAsPen)
{
Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY );
if( xDocFactory.is() )
mxShow->registerUserPaintPolygons(xDocFactory);
}
-#endif
+*/
if( !mnEndShowEvent )
mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) );
}
@@ -2203,16 +2224,8 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) );
-#ifdef ENABLE_PRESENTER_EXTRA_UI
- //adding button to contextual menu for erasing functionnalities for UserPaintOverlay
- pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen));
- // Adding button to contextual menu for changing pen color
- pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen));
// Adding button to display if in Pen mode
- pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen));
- // Adding button to displau if in Erase Mode
- pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen));
-#endif
+ pMenu->CheckItem( CM_PEN_MODE, mbUsePen);
const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) );
@@ -2280,105 +2293,44 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK );
}
}
-#ifdef ENABLE_PRESENTER_EXTRA_UI
PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN);
// populate color width list
if( pWidthMenu )
{
- if(! maPresSettings.mbMouseAsPen)
- {
- pMenu->EnableItem( CM_WIDTH_PEN, FALSE );
- }
- else
- {
- sal_Int32 nIterator;
- double nWidth;
+ sal_Int32 nIterator;
+ double nWidth;
- nWidth = 4.0;
- for( nIterator = 1; nIterator < 6; nIterator++)
- {
- switch(nIterator)
- {
- case 1:
- nWidth = 4.0;
- break;
- case 2:
- nWidth = 100.0;
- break;
- case 3:
- nWidth = 150.0;
- break;
- case 4:
- nWidth = 200.0;
- break;
- case 5:
- nWidth = 400.0;
- break;
- default:
- break;
- }
-
- pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE);
- if( nWidth == mdUserPaintStrokeWidth)
- pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) );
-
- }
- }
- }
-
-
- PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN);
-
- // populate eraser width list
- if( pEraseWidthMenu )
- {
- if(! maPresSettings.mbMouseAsPen)
+ nWidth = 4.0;
+ for( nIterator = 1; nIterator < 6; nIterator++)
{
- pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE );
- }
- else
- {
- sal_Int32 nEIterator;
- double nEWidth;
-
- nEWidth = 100.0;
- for( nEIterator = 1; nEIterator < 6; nEIterator++)
+ switch(nIterator)
{
- switch(nEIterator)
- {
- case 1:
- nEWidth = 100.0;
- break;
- case 2:
- nEWidth = 200.0;
- break;
- case 3:
- nEWidth = 300.0;
- break;
- case 4:
- nEWidth = 400.0;
- break;
- case 5:
- nEWidth = 500.0;
- break;
- default:
- break;
- }
-
- pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE);
- if( nEWidth == mnEraseInkSize)
- pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) );
- if( mbSwitchPenMode )
- pMenu->CheckItem( (USHORT)(CM_PEN_MODE));
- if( mbSwitchEraserMode )
- pMenu->CheckItem( (USHORT)(CM_ERASE_MODE));
-
+ case 1:
+ nWidth = 4.0;
+ break;
+ case 2:
+ nWidth = 100.0;
+ break;
+ case 3:
+ nWidth = 150.0;
+ break;
+ case 4:
+ nWidth = 200.0;
+ break;
+ case 5:
+ nWidth = 400.0;
+ break;
+ default:
+ break;
}
+
+ pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE);
+ if( nWidth == mdUserPaintStrokeWidth)
+ pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) );
}
}
-#endif
pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) );
pMenu->Execute( mpShowWindow, maPopupMousePos );
@@ -2442,139 +2394,93 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
}
}
break;
-#ifdef ENABLE_PRESENTER_EXTRA_UI
- if( maPresSettings.mbMouseAsPen )
- {
- case CM_COLOR_PEN:
- {
- //Open a color picker based on SvColorDialog
- ::Color aColor( mnUserPaintColor );
- SvColorDialog aColorDlg( mpShowWindow);
- aColorDlg.SetColor( aColor );
-
- if (aColorDlg.Execute() )
- {
- aColor = aColorDlg.GetColor();
- mnUserPaintColor = aColor.GetColor();
- setPenColor(mnUserPaintColor);
- }
- mbWasPaused = false;
- }
- break;
-
- case CM_WIDTH_PEN_VERY_THIN:
- {
- setPenWidth(4.0);
- mbWasPaused = false;
- }
- break;
-
- case CM_WIDTH_PEN_THIN:
- {
- setPenWidth(100.0);
- mbWasPaused = false;
- }
- break;
-
- case CM_WIDTH_PEN_NORMAL:
- {
- setPenWidth(150.0);
- mbWasPaused = false;
- }
- break;
+ case CM_COLOR_PEN:
+ {
+ //Open a color picker based on SvColorDialog
+ ::Color aColor( mnUserPaintColor );
+ SvColorDialog aColorDlg( mpShowWindow);
+ aColorDlg.SetColor( aColor );
- case CM_WIDTH_PEN_THICK:
+ if (aColorDlg.Execute() )
{
- setPenWidth(200.0);
- mbWasPaused = false;
+ aColor = aColorDlg.GetColor();
+ setPenColor(aColor.GetColor());
}
- break;
+ mbWasPaused = false;
+ }
+ break;
- case CM_WIDTH_PEN_VERY_THICK:
- {
- setPenWidth(400.0);
- mbWasPaused = false;
- }
- break;
- case CM_ERASE_ALLINK:
- {
- setEraseAllInk(true);
- mbWasPaused = false;
- }
- break;
- case CM_PEN_MODE:
- {
- setPenMode(true);
- mbWasPaused = false;
- }
- break;
- case CM_ERASE_MODE:
- {
- setEraserMode(true);
- mbWasPaused = false;
- }
- break;
- case CM_ERASE_INK_PEN_VERY_THIN:
- {
- setEraseInk(100);
- mbWasPaused = false;
- }
- break;
+ case CM_WIDTH_PEN_VERY_THIN:
+ {
+ setPenWidth(4.0);
+ mbWasPaused = false;
+ }
+ break;
- case CM_ERASE_INK_PEN_THIN:
- {
- setEraseInk(200);
- mbWasPaused = false;
- }
- break;
+ case CM_WIDTH_PEN_THIN:
+ {
+ setPenWidth(100.0);
+ mbWasPaused = false;
+ }
+ break;
- case CM_ERASE_INK_PEN_NORMAL:
- {
- setEraseInk(300);
- mbWasPaused = false;
- }
- break;
+ case CM_WIDTH_PEN_NORMAL:
+ {
+ setPenWidth(150.0);
+ mbWasPaused = false;
+ }
+ break;
- case CM_ERASE_INK_PEN_THICK:
- {
- setEraseInk(400);
- mbWasPaused = false;
- }
- break;
- case CM_ERASE_INK_PEN_VERY_THICK:
- {
- setEraseInk(500);
- mbWasPaused = false;
- }
- break;
- }
-#endif
+ case CM_WIDTH_PEN_THICK:
+ {
+ setPenWidth(200.0);
+ mbWasPaused = false;
+ }
+ break;
- case CM_ENDSHOW:
- // in case the user cancels the presentation, switch to current slide
- // in edit mode
- if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
- {
- if( mpSlideController->getCurrentSlideNumber() != -1 )
- {
- mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
- }
- }
- endPresentation();
- break;
- default:
- sal_Int32 nPageNumber = nMenuId - CM_SLIDES;
- const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
- if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
- {
- mpShowWindow->RestartShow( nPageNumber );
- }
- else if( nPageNumber != mpSlideController->getCurrentSlideNumber() )
+ case CM_WIDTH_PEN_VERY_THICK:
+ {
+ setPenWidth(400.0);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ERASE_ALLINK:
+ {
+ setEraseAllInk(true);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_PEN_MODE:
+ {
+ setUsePen(!mbUsePen);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ENDSHOW:
+ // in case the user cancels the presentation, switch to current slide
+ // in edit mode
+ if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
+ {
+ if( mpSlideController->getCurrentSlideNumber() != -1 )
{
- displaySlideNumber( nPageNumber );
+ mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
}
- mbWasPaused = false;
- break;
+ }
+ endPresentation();
+ break;
+ default:
+ sal_Int32 nPageNumber = nMenuId - CM_SLIDES;
+ const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
+ if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
+ {
+ mpShowWindow->RestartShow( nPageNumber );
+ }
+ else if( nPageNumber != mpSlideController->getCurrentSlideNumber() )
+ {
+ displaySlideNumber( nPageNumber );
+ }
+ mbWasPaused = false;
+ break;
}
}
@@ -2960,7 +2866,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq)
switch ( rReq.GetSlot() )
{
case SID_NAVIGATOR_PEN:
- setUsePen(!maPresSettings.mbMouseAsPen);
+ setUsePen(!mbUsePen);
break;
case SID_NAVIGATOR_PAGE:
@@ -3146,7 +3052,7 @@ void SAL_CALL SlideshowImpl::setMouseVisible( sal_Bool bVisible ) throw (Runtime
sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException)
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- return maPresSettings.mbMouseAsPen;
+ return mbUsePen;
}
// --------------------------------------------------------------------
@@ -3154,93 +3060,38 @@ sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException)
void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeException)
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- maPresSettings.mbMouseAsPen = bMouseAsPen;
+ mbUsePen = bMouseAsPen;
if( mxShow.is() ) try
{
- // For Pencolor;
+ // For Pencolor;
Any aValue;
- if( maPresSettings.mbMouseAsPen )
- // TODO: take color from configuration
- aValue <<= mnUserPaintColor;
+ if( mbUsePen )
+ aValue <<= mnUserPaintColor;
beans::PropertyValue aPenProp;
aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" ));
aPenProp.Value = aValue;
mxShow->setProperty( aPenProp );
-#ifdef ENABLE_PRESENTER_EXTRA_UI
- //for StrokeWidth :
- Any aValueWidth;
- if( maPresSettings.mbMouseAsPen )
- aValueWidth <<= mdUserPaintStrokeWidth;
-
- beans::PropertyValue aPenPropWidth;
- aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" ));
- aPenPropWidth.Value = aValueWidth;
-
- mxShow->setProperty( aPenPropWidth );
-
- // for Pen Mode
- Any aValueSwitchPenMode;
- if( maPresSettings.mbMouseAsPen )
- aValueSwitchPenMode <<= mbSwitchPenMode;
- beans::PropertyValue aPenPropSwitchPenMode;
- aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" ));
- aPenPropSwitchPenMode.Value = aValueSwitchPenMode;
- mxShow->setProperty( aPenPropSwitchPenMode );
-
- //for EraseAllInk :
- Any aValueEraseAllInk;
- if( maPresSettings.mbMouseAsPen )
- aValueEraseAllInk <<= mbEraseAllInk;
- beans::PropertyValue aPenPropEraseAllInk;
- aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" ));
- aPenPropEraseAllInk.Value = aValueEraseAllInk;
- mxShow->setProperty( aPenPropEraseAllInk );
- mbEraseAllInk = false; // sets to false so not to have it applied again
-#endif
- }
- catch( Exception& e )
- {
- static_cast<void>(e);
- DBG_ERROR(
- (OString("sd::SlideshowImpl::setUsePen(), "
- "exception caught: ") +
- rtl::OUStringToOString(
- comphelper::anyToString( cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 )).getStr() );
- }
-}
-#ifdef ENABLE_PRESENTER_EXTRA_UI
-void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException)
-{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- maPresSettings.mbMouseAsPen = bMouseAsPen;
- if( mxShow.is() ) try
- {
+ //for StrokeWidth :
+ if( mbUsePen )
+ {
+ beans::PropertyValue aPenPropWidth;
+ aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" ));
+ aPenPropWidth.Value <<= mdUserPaintStrokeWidth;
+ mxShow->setProperty( aPenPropWidth );
- //for EraseInk :
- Any aValueEraseInk;
- if( maPresSettings.mbMouseAsPen )
- aValueEraseInk <<= mnEraseInkSize;
- beans::PropertyValue aPenPropEraseInk;
- aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" ));
- aPenPropEraseInk.Value = aValueEraseInk;
- mxShow->setProperty( aPenPropEraseInk );
-
- // for Erase Mode
- Any aValueSwitchEraserMode;
- if( maPresSettings.mbMouseAsPen )
- aValueSwitchEraserMode <<= mbSwitchEraserMode;
- beans::PropertyValue aPenPropSwitchEraserMode;
- aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" ));
- aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode;
- mxShow->setProperty( aPenPropSwitchEraserMode );
+ // for Pen Mode
+ beans::PropertyValue aPenPropSwitchPenMode;
+ aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" ));
+ aPenPropSwitchPenMode.Value <<= sal_True;
+ mxShow->setProperty( aPenPropSwitchPenMode );
+ }
}
catch( Exception& e )
{
static_cast<void>(e);
DBG_ERROR(
- (OString("sd::SlideshowImpl::setUseEraser(), "
+ (OString("sd::SlideshowImpl::setUsePen(), "
"exception caught: ") +
rtl::OUStringToOString(
comphelper::anyToString( cppu::getCaughtException() ),
@@ -3262,12 +3113,9 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
mdUserPaintStrokeWidth = dStrokeWidth;
- mbSwitchPenMode = true;
- mbSwitchEraserMode = !mbSwitchPenMode;
- if( maPresSettings.mbMouseAsPen )
- setUsePen( sal_True ); // update color and width
+ setUsePen( true ); // enable pen mode, update color and width
}
-#endif
+
// --------------------------------------------------------------------
sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException)
@@ -3282,71 +3130,59 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
mnUserPaintColor = nColor;
-#ifdef ENABLE_PRESENTER_EXTRA_UI
- mbSwitchPenMode = true;
- mbSwitchEraserMode = !mbSwitchPenMode;
-#endif
- if( maPresSettings.mbMouseAsPen )
- setUsePen( sal_True ); // update color
+ setUsePen( true ); // enable pen mode, update color
}
-#ifdef ENABLE_PRESENTER_EXTRA_UI
// --------------------------------------------------------------------
-void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException)
+void SAL_CALL SlideshowImpl::setUseEraser( ::sal_Bool /*_usepen*/ ) throw (css::uno::RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- mbSwitchPenMode = bSwitchPenMode;
-
- if(mbSwitchPenMode == true){
- mbSwitchEraserMode = false;
- }else{
- mbSwitchEraserMode = true;
- }
- if( maPresSettings.mbMouseAsPen )
- setUsePen( sal_True ); // Switch to Pen Mode
-
}
-void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException)
+// --------------------------------------------------------------------
+
+void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException)
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- mbSwitchEraserMode = bSwitchEraserMode;
- if(mbSwitchEraserMode = true){
- mbSwitchPenMode = false;
- }else{
- mbSwitchPenMode = true;
- }
-
- if( maPresSettings.mbMouseAsPen )
- setUseEraser( sal_True ); // Switch to EraseMode
+ setUsePen( bSwitchPenMode ); // SwitchPen Mode
}
-
// --------------------------------------------------------------------
-void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException)
+void SAL_CALL SlideshowImpl::setEraseAllInk(bool bEraseAllInk) throw (RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- mbEraseAllInk=bEraseAllInk;
- mbSwitchPenMode = true;
- mbSwitchEraserMode = false;
- if( maPresSettings.mbMouseAsPen )
- setUsePen( sal_True ); // update erase all ink bool
+ if( bEraseAllInk )
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if( mxShow.is() ) try
+ {
+ beans::PropertyValue aPenPropEraseAllInk;
+ aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" ));
+ aPenPropEraseAllInk.Value <<= bEraseAllInk;
+ mxShow->setProperty( aPenPropEraseAllInk );
+ }
+ catch( Exception& e )
+ {
+ static_cast<void>(e);
+ DBG_ERROR(
+ (OString("sd::SlideshowImpl::setEraseAllInk(), "
+ "exception caught: ") +
+ rtl::OUStringToOString(
+ comphelper::anyToString( cppu::getCaughtException() ),
+ RTL_TEXTENCODING_UTF8 )).getStr() );
+ }
+ }
}
+void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 /*nEraseInkSize*/ ) throw (css::uno::RuntimeException)
+{
+}
-void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException)
+void SAL_CALL SlideshowImpl::setEraserMode( bool /*bSwitchEraserMode*/ ) throw (css::uno::RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- mnEraseInkSize=nEraseInkSize;
- mbSwitchPenMode = false;
- mbSwitchEraserMode = true;
- if( maPresSettings.mbMouseAsPen )
- setUseEraser( sal_True ); // update erase ink size
}
-#endif
+
// --------------------------------------------------------------------
// XSlideShowController Methods
// --------------------------------------------------------------------
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index cb33c4a740c7..98a34959e0b9 100755
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -198,7 +198,6 @@ public:
virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException);
virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException);
-#ifdef ENABLE_PRESENTER_EXTRA_UI
virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException);
virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException);
@@ -206,7 +205,6 @@ public:
virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException);
virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException);
virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException);
-#endif
virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException);
@@ -396,14 +394,9 @@ private:
PresentationSettings maPresSettings;
sal_Int32 mnUserPaintColor;
-#ifdef ENABLE_PRESENTER_EXTRA_UI
- bool mbSwitchPenMode;
- bool mbSwitchEraserMode;
+ bool mbUsePen;
double mdUserPaintStrokeWidth;
- bool mbEraseAllInk;
-// bool mbEraseInk;
- sal_Int32 mnEraseInkSize;
-#endif
+
/// used in updateHdl to prevent recursive calls
sal_Int32 mnEntryCounter;
diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx
index 854009b00c7e..854009b00c7e 100644..100755
--- a/sd/source/ui/table/tableobjectbar.cxx
+++ b/sd/source/ui/table/tableobjectbar.cxx
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index ddbf5cfc4388..b0248647b3dc 100755
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -436,9 +436,10 @@ namespace {
aOpt.GetModuleName( mbImpress ? SvtModuleOptions::E_SIMPRESS : SvtModuleOptions::E_SDRAW ) );
AddDialogControl( vcl::PrinterOptionsHelper::getGroupControlOpt(
aAppGroupname,
- rtl::OUString()
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) )
) );
+ uno::Sequence< rtl::OUString > aHelpIds;
if( mbImpress )
{
vcl::PrinterOptionsHelper::UIControlOptions aPrintOpt;
@@ -449,9 +450,11 @@ namespace {
aPrintOpt )
);
+ aHelpIds.realloc( 1 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ) );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
String( SdResId( _STR_IMPRESS_PRINT_UI_CONTENT ) ),
- CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_CHOICES),
0,
@@ -459,11 +462,12 @@ namespace {
)
);
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ) );
vcl::PrinterOptionsHelper::UIControlOptions
aContentOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ), 1 );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
String( SdResId( _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE ) ),
- CreateChoice(_STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPage" ) ),
GetSlidesPerPageSequence(),
0,
@@ -473,11 +477,12 @@ namespace {
)
);
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ) );
vcl::PrinterOptionsHelper::UIControlOptions
aSlidesPerPageOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPage" ) ), -1, sal_True );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
String( SdResId( _STR_IMPRESS_PRINT_UI_ORDER ) ),
- CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPageOrder" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES),
0,
@@ -495,7 +500,7 @@ namespace {
{
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME) ),
- String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintName" ) ),
sal_False
)
@@ -505,7 +510,7 @@ namespace {
{
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME) ),
- String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintName" ) ),
sal_False
)
@@ -514,7 +519,7 @@ namespace {
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE) ),
- String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintDateTime" ) ),
sal_False
)
@@ -524,7 +529,7 @@ namespace {
{
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN) ),
- String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintHidden" ) ),
sal_False
)
@@ -534,9 +539,13 @@ namespace {
AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_QUALITY) ), rtl::OUString() ) );
+ aHelpIds.realloc( 3 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ) );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ) );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
rtl::OUString(),
- CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES),
0
@@ -546,6 +555,11 @@ namespace {
AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS) ), rtl::OUString() ) );
+ aHelpIds.realloc( 4 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:0" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ) );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ) );
+ aHelpIds[3] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ) );
if( mbImpress )
{
// FIXME: additional dependency on PrintProspect = false
@@ -553,7 +567,7 @@ namespace {
aPageOptionsOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ), 0 );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
rtl::OUString(),
- CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOptions" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES),
0,
@@ -569,7 +583,7 @@ namespace {
aPageOptionsOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), sal_False );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
rtl::OUString(),
- CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOptions" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW),
0,
@@ -589,7 +603,7 @@ namespace {
// brochure printing
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE) ),
- String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_HELP) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ),
sal_False,
aBrochureOpt
@@ -599,9 +613,11 @@ namespace {
vcl::PrinterOptionsHelper::UIControlOptions
aIncludeOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), -1, sal_False );
aIncludeOpt.maGroupHint = OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) );
+ aHelpIds.realloc( 1 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ) );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE) ),
- CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP),
+ aHelpIds,
OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectInclude" ) ),
CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST),
0,
@@ -616,7 +632,7 @@ namespace {
aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) );
AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY) ),
- String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
sal_False,
aPaperTrayOpt
@@ -634,8 +650,12 @@ namespace {
// create a choice for the content to create
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
+ aHelpIds.realloc( 3 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( rtl::OUString(),
- CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP),
+ aHelpIds,
aPrintRangeName,
CreateChoice(mbImpress
? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE
@@ -645,7 +665,7 @@ namespace {
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
AddDialogControl( vcl::PrinterOptionsHelper::getEditControlOpt( rtl::OUString(),
- rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
rtl::OUString(),
aPageRangeOpt )
diff --git a/sd/source/ui/view/DocumentRenderer.hrc b/sd/source/ui/view/DocumentRenderer.hrc
index 3dd57429dd13..aad07d909def 100644..100755
--- a/sd/source/ui/view/DocumentRenderer.hrc
+++ b/sd/source/ui/view/DocumentRenderer.hrc
@@ -30,48 +30,33 @@
#define _STR_IMPRESS_PRINT_UI_PRINT_CONTENT 2
#define _STR_IMPRESS_PRINT_UI_PRINT_GROUP 3
#define _STR_IMPRESS_PRINT_UI_CONTENT 4
-#define _STR_IMPRESS_PRINT_UI_CONTENT_HELP 5
#define _STR_IMPRESS_PRINT_UI_CONTENT_CHOICES 6
#define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE 7
#define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES 8
-#define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP 9
#define _STR_IMPRESS_PRINT_UI_ORDER 10
#define _STR_IMPRESS_PRINT_UI_ORDER_CHOICES 11
-#define _STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP 12
#define _STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT 13
#define _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME 14
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP 15
#define _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE 16
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP 17
#define _STR_IMPRESS_PRINT_UI_IS_PRINT_TIME 18
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_TIME_HELP 19
#define _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN 20
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP 21
#define _STR_IMPRESS_PRINT_UI_OUTPUT_OPTIONS_GROUP 22
#define _STR_IMPRESS_PRINT_UI_QUALITY 23
#define _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES 24
-#define _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP 25
#define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS 26
#define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES 27
#define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW 28
-#define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP 29
#define _STR_IMPRESS_PRINT_UI_BROCHURE 30
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_HELP 31
#define _STR_IMPRESS_PRINT_UI_PAGE_SIDES 32
#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE 33
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_HELP 34
#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST 35
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP 36
#define _STR_IMPRESS_PRINT_UI_PAPER_TRAY_GROUP 37
#define _STR_IMPRESS_PRINT_UI_PAPER_TRAY 38
-#define _STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP 39
#define _STR_IMPRESS_PRINT_UI_PAGE_RANGE 40
#define _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE 41
-#define _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP 42
#define _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE 43
#define _STR_DRAW_PRINT_UI_IS_PRINT_NAME 44
-#define _STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP 45
diff --git a/sd/source/ui/view/DocumentRenderer.src b/sd/source/ui/view/DocumentRenderer.src
index abd82ea0d397..df4e2a30de02 100755
--- a/sd/source/ui/view/DocumentRenderer.src
+++ b/sd/source/ui/view/DocumentRenderer.src
@@ -46,14 +46,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
{
Text [ en-US ] = "Document";
};
- StringArray _STR_IMPRESS_PRINT_UI_CONTENT_HELP
- {
- ItemList [ en-US ] =
- {
- < "Select which parts of the document should be printed"; >;
- < "Select which parts of the document should be printed"; >;
- };
- };
StringArray _STR_IMPRESS_PRINT_UI_CONTENT_CHOICES
{
ItemList [ en-US ] =
@@ -81,14 +73,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
< "9" ; > ;
};
};
- StringArray _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP
- {
- ItemList [ en-US ] =
- {
- < "Select how many slides to print per page." ; >;
- < "Select how many slides to print per page." ; >;
- };
- };
String _STR_IMPRESS_PRINT_UI_ORDER
{
Text [ en-US ] = "Order" ;
@@ -101,15 +85,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
< "Top to bottom, then right" ; > ;
};
};
- StringArray _STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP
- {
- ItemList [ en-US ] =
- {
- < "Specify how to arrange slides on the printed page." ; > ;
- < "Arrange slides horizontally" ; > ;
- < "Arrange slides vertically" ; > ;
- };
- };
String _STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT
{
Text [ en-US ] = "~Contents";
@@ -118,35 +93,18 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
{
Text [ en-US ] = "~Slide name";
};
- String _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP
- {
- Text [ en-US ] = "Specifies whether to print the page name of a document.";
- };
String _STR_DRAW_PRINT_UI_IS_PRINT_NAME
{
Text [ en-US ] = "P~age name";
};
- String _STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP
- {
- Text [ en-US ] = "Specifies whether to print the page name of a document.";
- };
String _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE
{
Text [ en-US ] = "~Date and time";
};
- String _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP
- {
- Text [ en-US ] = "Specifies whether to print the current date and time.";
- };
String _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN
{
Text [ en-US ] = "Hidden pages";
};
- String _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP
- {
- Text [ en-US ] = "Specifies whether to print the pages that are currently hidden from the application.";
- };
-
String _STR_IMPRESS_PRINT_UI_OUTPUT_OPTIONS_GROUP
{
Text [ en-US ] = "Output options";
@@ -164,17 +122,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
< "Black & white" ; > ;
};
};
- StringArray _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP
- {
- ItemList [ en-US ] =
- {
- < "Specify how to treat colors in the printout."; >;
- < "Specifies that you want to print in original colors." ; > ;
- < "Specifies that you want to print colors as grayscale." ; > ;
- < "Specifies that you want to print in black and white." ; > ;
- };
- };
-
String _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS
{
Text [ en-US ] = "~Size";
@@ -199,24 +146,10 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
< "Tile sheet of paper with repeated pages" ; > ;
};
};
- StringArray _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP
- {
- ItemList [ en-US ] =
- {
- < "Specify how to scale slides in the printout."; >;
- < "Specifies that you do not want to further scale pages when printing." ; > ;
- < "Specifies whether to scale down objects that are beyond the margins of the current printer so they fit on the paper in the printer." ; > ;
- < "Specifies that pages are to be printed in tiled format. If the pages or slides are smaller than the paper, several pages or slides will be printed on one page of paper." ; > ;
- };
- };
String _STR_IMPRESS_PRINT_UI_BROCHURE
{
Text [en-US] = "Brochure";
};
- String _STR_IMPRESS_PRINT_UI_BROCHURE_HELP
- {
- Text [en-US] = "Select the \"Brochure\" option to print the document in brochure format.";
- };
String _STR_IMPRESS_PRINT_UI_PAGE_SIDES
{
Text [ en-US ] = "Page sides";
@@ -225,10 +158,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
{
Text [ en-US ] = "Include";
};
- String _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_HELP
- {
- Text [ en-US ] = "Select which pages of a brochure to print.";
- };
StringArray _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST
{
ItemList [ en-US ] =
@@ -238,15 +167,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
< "Back sides / left pages" ; > ;
};
};
- StringArray _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP
- {
- ItemList [ en-US ] =
- {
- < "Print all pages of a brochure." ; > ;
- < "Print only front pages of a brochure." ; > ;
- < "Print only back pages of a brochure." ; > ;
- };
- };
String _STR_IMPRESS_PRINT_UI_PAPER_TRAY_GROUP
{
@@ -256,10 +176,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
{
Text [ en-US ] = "~Use only paper tray from printer preferences";
};
- String _STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP
- {
- Text [ en-US ] = "Determines that the paper tray to be used is the one defined in the printer setup.";
- };
String _STR_IMPRESS_PRINT_UI_PAGE_RANGE
{
Text [en-US] = "Print range";
@@ -274,16 +190,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
};
};
- StringArray _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP
- {
- ItemList [ en-US ] =
- {
- < "Print the whole document."; >;
- < "Print a specified range of the document."; >;
- < "Print only the currently selected content."; >;
- };
- };
-
StringArray _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE
{
ItemList [ en-US ] =
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index e7a39c9d3369..c0f371c867e8 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -648,16 +648,6 @@ USHORT ViewShellBase::SetPrinter (
-PrintDialog* ViewShellBase::CreatePrintDialog (::Window *pParent)
-{
- (void)pParent;
- return NULL;
- // return mpImpl->mpPrintManager->CreatePrintDialog (pParent);
-}
-
-
-
-
SfxTabPage* ViewShellBase::CreatePrintOptionsPage(
::Window *pParent,
const SfxItemSet &rOptions)
@@ -671,42 +661,6 @@ SfxTabPage* ViewShellBase::CreatePrintOptionsPage(
-USHORT ViewShellBase::Print(SfxProgress&, BOOL bIsAPI, PrintDialog* pDlg)
-{
- (void)bIsAPI;
- (void)pDlg;
- return 0;
- // return mpImpl->mpPrintManager->Print (rProgress, bIsAPI, pDlg);
-}
-
-
-
-
-ErrCode ViewShellBase::DoPrint (
- SfxPrinter* pPrinter,
- PrintDialog* pPrintDialog,
- BOOL bSilent, BOOL bIsAPI )
-{
- (void)pPrinter;
- (void)pPrintDialog;
- (void)bSilent;
- (void)bIsAPI;
- return 0;
- //return mpImpl->mpPrintManager->DoPrint (pPrinter, pPrintDialog, bSilent, bIsAPI );
-}
-
-
-
-
-void ViewShellBase::PreparePrint (PrintDialog* pPrintDialog)
-{
- SfxViewShell::PreparePrint (pPrintDialog);
- //mpImpl->mpPrintManager->PreparePrint (pPrintDialog);
-}
-
-
-
-
void ViewShellBase::UIActivating( SfxInPlaceClient* pClient )
{
mpImpl->ShowViewTabBar(false);
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 5fbd400d7520..f2075a50bd3e 100755
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -219,7 +219,7 @@ void DrawViewShell::SelectionHasChanged (void)
}
ViewShellBase& rBase = GetViewShellBase();
- rBase.SetVerbs(0);
+ rBase.SetVerbs( uno::Sequence< embed::VerbDescriptor >() );
try
{
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index d7cc1fc1d84a..d7cc1fc1d84a 100644..100755
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 6f6f49fdc93c..020f95b5af89 100755
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -329,6 +329,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
{
short nSlotId = rReq.GetSlot();
+ if( nSlotId == SID_OBJECT_ROTATE )
+ {
+ // togle rotation
+ if( nOldSId == nSlotId )
+ {
+ nSlotId = SID_OBJECT_SELECT;
+ rReq.SetSlot( nSlotId );
+ }
+ }
+
if (nSlotId == SID_OBJECT_CROOK_ROTATE ||
nSlotId == SID_OBJECT_CROOK_SLANT ||
nSlotId == SID_OBJECT_CROOK_STRETCH)
diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx
index 679c28bb3a93..679c28bb3a93 100644..100755
--- a/sd/source/ui/view/sdruler.cxx
+++ b/sd/source/ui/view/sdruler.cxx
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index d9d074eee395..d9d074eee395 100644..100755
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
diff --git a/set_soenv.in b/set_soenv.in
index 0f31cc3e1a8e..8a99842291de 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1698,6 +1698,16 @@ ToFile( "DYNAMIC_CRT", $DYNAMIC_CRT, "e" );
ToFile( "SET_EXCEPTIONS", $SET_EXCEPTIONS, "e" );
ToFile( "use_shl_versions", $use_shl_versions, "e" );
ToFile( "FLIPCMD", $FLIPCMD, "e" );
+if ( $platform =~ m/darwin/ )
+{
+# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
+# build can assume functions/libraries of that version to be available
+# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
+# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
+# http://developer.apple.com/technotes/tn2002/tn2064.html
+ ToFile( "MACOSX_DEPLOYMENT_TARGET", "10.4", "e" );
+}
+
#
# Writing the variables to file.
# (c = comment, e = environment variable, a = alias, n = newline )
diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index ea186f5a8ba4..1aed8214cb30 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -1127,7 +1127,7 @@ sub register_extensions_sync
$preregdir =~ s/\/\s*$//g;
- my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $preregdir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |";
+ my $systemcall = $executable . " sync --verbose 2\>\&1 |";
print "... $systemcall\n";
diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt
index c73e7fae5838..0be870990b71 100755
--- a/setup_native/source/packinfo/shellscripts_extensions.txt
+++ b/setup_native/source/packinfo/shellscripts_extensions.txt
@@ -2,26 +2,6 @@
%postinstall << END
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/usr/bin/mktemp" ]
-then
- INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
-
#
# Need to check diskless service install and make sure use the correct unpkg
#
@@ -38,7 +18,7 @@ fi
if [ -x $$POSTRUN ]; then
( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
echo "umask 022"
- echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'"
+ echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
) | $$POSTRUN -b -c UNOPKG
if [ "$$?" != "0" ]; then
@@ -48,7 +28,7 @@ if [ -x $$POSTRUN ]; then
fi
else
# No postrun available, try running unopkg directly
- "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$UNOPKG" sync
find "$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
if [ "$$?" != "0" ]; then
echo "\nERROR: Installation of UNO extensions failed."
@@ -58,48 +38,23 @@ else
fi
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/usr/bin/mktemp" ]
-then
- INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
-
# Use postrun command on Solaris where available (OpenSolaris)
if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
echo "umask 022"
- echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'"
+ echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
- echo "rm -rf \"$$INSTDIR\""
) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG
else
# No postrun available, try running unopkg directly
test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0
- "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync
echo "find \"$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
if [ "$$?" != "0" ]; then
echo "\nERROR: Removal of UNO extension failed."
@@ -109,9 +64,6 @@ else
fi
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
exit 0
END
@@ -121,151 +73,47 @@ END
%format rpm
%postinstall << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync
find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync
find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%format deb
%postinstall << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]
-then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]
-then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]
-then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "PRODUCTDIRECTORYNAME/program/unopkg" sync
find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]
-then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-# Find the temp dir
-if [ -n "$$TMPDIR" ]
-then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]
-then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]
-then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]
then
- "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "PRODUCTDIRECTORYNAME/program/unopkg" sync
find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]
-then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 9eaad6959a63..9a748e9f2008 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -58,112 +58,112 @@
The returned string is a file URL.
*/
-static std::_tstring createTempFolder()
-{
- BOOL bExist = FALSE;
- TCHAR szTempName[MAX_PATH];
- do
- {
- bExist = FALSE;
- // Get the temp path.
- TCHAR lpPathBuffer[MAX_PATH];
- DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer);
- if (dwRetVal > MAX_PATH || (dwRetVal == 0))
- {
- //fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError());
- return TEXT("");
- }
- // Create a temporary file.
- UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files
- "upg", // temp file name prefix
- 0, // create unique name
- szTempName); // buffer for name
- if (uRetVal == 0)
- {
- //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
- return TEXT("");
- }
- //Delete the file
- BOOL bDel = DeleteFile(szTempName);
- if (FALSE == bDel)
- {
- //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
- return TEXT("");
- }
- // Create the directory
- BOOL bDir = CreateDirectory(szTempName, NULL);
- if (FALSE == bDir)
- {
- DWORD error =GetLastError();
- if (ERROR_ALREADY_EXISTS == error)
- {
- bExist = TRUE;
- }
- else
- {
- //fprintf(stderr, "CreateDirectory failed with error %d.\n", error);
- return TEXT("");
- }
- }
- } while(bExist);
+// static std::_tstring createTempFolder()
+// {
+// BOOL bExist = FALSE;
+// TCHAR szTempName[MAX_PATH];
+// do
+// {
+// bExist = FALSE;
+// // Get the temp path.
+// TCHAR lpPathBuffer[MAX_PATH];
+// DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer);
+// if (dwRetVal > MAX_PATH || (dwRetVal == 0))
+// {
+// //fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError());
+// return TEXT("");
+// }
+// // Create a temporary file.
+// UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files
+// "upg", // temp file name prefix
+// 0, // create unique name
+// szTempName); // buffer for name
+// if (uRetVal == 0)
+// {
+// //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
+// return TEXT("");
+// }
+// //Delete the file
+// BOOL bDel = DeleteFile(szTempName);
+// if (FALSE == bDel)
+// {
+// //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
+// return TEXT("");
+// }
+// // Create the directory
+// BOOL bDir = CreateDirectory(szTempName, NULL);
+// if (FALSE == bDir)
+// {
+// DWORD error =GetLastError();
+// if (ERROR_ALREADY_EXISTS == error)
+// {
+// bExist = TRUE;
+// }
+// else
+// {
+// //fprintf(stderr, "CreateDirectory failed with error %d.\n", error);
+// return TEXT("");
+// }
+// }
+// } while(bExist);
- std::_tstring cur(szTempName);
- //make a file URL from the path
- std::_tstring ret(TEXT("file:///"));
- for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++)
- {
- if (*i == '\\')
- ret.append(TEXT("/"));
- else
- ret.push_back(*i);
- }
-// MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK);
- return ret.c_str();
-}
+// std::_tstring cur(szTempName);
+// //make a file URL from the path
+// std::_tstring ret(TEXT("file:///"));
+// for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++)
+// {
+// if (*i == '\\')
+// ret.append(TEXT("/"));
+// else
+// ret.push_back(*i);
+// }
+// // MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK);
+// return ret.c_str();
+// }
/** deletes the temporary folder.
The argument must be a file URL.
*/
-static void deleteTempFolder(const std::_tstring& sTempFolder)
-{
- if (sTempFolder.size() == 0)
- return;
- //convert the file URL to a path
- const std::_tstring path(sTempFolder.substr(8));
- std::_tstring path2;
-// MessageBox(NULL, path.c_str(), "del1", MB_OK);
- for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
- {
- if (*i == '/')
- path2.append(TEXT("\\"));
- else
- path2.push_back(*i);
- }
+// static void deleteTempFolder(const std::_tstring& sTempFolder)
+// {
+// if (sTempFolder.size() == 0)
+// return;
+// //convert the file URL to a path
+// const std::_tstring path(sTempFolder.substr(8));
+// std::_tstring path2;
+// // MessageBox(NULL, path.c_str(), "del1", MB_OK);
+// for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
+// {
+// if (*i == '/')
+// path2.append(TEXT("\\"));
+// else
+// path2.push_back(*i);
+// }
- //We need a null terminated string with two nulls in the end
- //for the SHFILEOPSTRUCT
- const TCHAR * szTemp = path2.c_str();
- size_t size = path2.size();
- TCHAR * szTemp2 = new TCHAR[size + 2];
- ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
- memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
+// //We need a null terminated string with two nulls in the end
+// //for the SHFILEOPSTRUCT
+// const TCHAR * szTemp = path2.c_str();
+// size_t size = path2.size();
+// TCHAR * szTemp2 = new TCHAR[size + 2];
+// ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
+// memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
-// MessageBox(NULL, szTemp2, "del3", MB_OK);
- SHFILEOPSTRUCT operation =
- {
- NULL,
- FO_DELETE,
- szTemp2,
- NULL,
- FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
- FALSE,
- NULL,
- NULL
- };
-
- SHFileOperation( &operation);
- delete [] szTemp2;
-}
+// // MessageBox(NULL, szTemp2, "del3", MB_OK);
+// SHFILEOPSTRUCT operation =
+// {
+// NULL,
+// FO_DELETE,
+// szTemp2,
+// NULL,
+// FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
+// FALSE,
+// NULL,
+// NULL
+// };
+
+// SHFileOperation( &operation);
+// delete [] szTemp2;
+// }
@@ -332,21 +332,13 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
if ( hFindUnopkg != INVALID_HANDLE_VALUE )
{
// unopkg.exe exists in program directory
-
- const std::_tstring sTempFolder(createTempFolder());
- std::_tstring sCommandPart1 = sUnoPkgFile + " sync";
- std::_tstring sCommand = sCommandPart1
- + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$BRAND_BASE_DIR/share/prereg/bundled")
- + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml")
- + TEXT(" -env:UserInstallation=") + sTempFolder;
+ std::_tstring sCommand = sUnoPkgFile + " sync";
mystr = "Command: " + sCommand;
//MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
DWORD exitCode = 0;
bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode);
- deleteTempFolder(sTempFolder);
-
// if ( fSuccess )
// {
// mystr = "Executed successfully!";
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index 1d4003fa44e6..45755cdd8799 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -654,7 +654,7 @@
#include "vcl/stdtext.hxx"
#include "vcl/timer.hxx"
#include "vcl/unohelp.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vos/diagnose.hxx"
#include "vos/module.hxx"
#include "vos/mutex.hxx"
diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx
index b9beb12bfeff..9b144b3c20b6 100644
--- a/sfx2/inc/sfx2/event.hxx
+++ b/sfx2/inc/sfx2/event.hxx
@@ -119,7 +119,6 @@ public:
SfxObjectShell* GetObjShell() const { return _pObjShell; }
};
-class PrintDialog;
class Printer;
class SfxPrintingHint : public SfxHint
{
diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx
index f1df0f0aa547..f5cc509dbf0a 100644
--- a/sfx2/inc/sfx2/mnumgr.hxx
+++ b/sfx2/inc/sfx2/mnumgr.hxx
@@ -32,7 +32,7 @@
#ifndef _MENU_HXX //autogen //wg. MENU_APPEND !!!!
#include <vcl/menu.hxx>
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <tools/link.hxx>
#include <com/sun/star/embed/VerbDescriptor.hpp>
#include <com/sun/star/uno/Sequence.hxx>
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx
index ad83bb4a7418..3cf84cf6139e 100644
--- a/sfx2/inc/sfx2/module.hxx
+++ b/sfx2/inc/sfx2/module.hxx
@@ -33,7 +33,7 @@
#include <sfx2/shell.hxx>
#include <sfx2/imgdef.hxx>
#include <sal/types.h>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
class ImageList;
diff --git a/sfx2/inc/sfx2/printer.hxx b/sfx2/inc/sfx2/printer.hxx
index a96033835a84..11f07ea9e7db 100644
--- a/sfx2/inc/sfx2/printer.hxx
+++ b/sfx2/inc/sfx2/printer.hxx
@@ -34,60 +34,11 @@
#include <vcl/print.hxx>
#endif
-class SfxFont;
class SfxTabPage;
class SfxItemSet;
struct SfxPrinter_Impl;
-#define SFX_RANGE_NOTSET ((USHORT)0xFFFF)
-
-// class SfxFontSizeInfo -------------------------------------------------
-
-class SfxFontSizeInfo
-{
-private:
- static USHORT pStaticSizes[];
- Size* pSizes;
- USHORT nSizes;
- BOOL bScalable;
-
-public:
- SfxFontSizeInfo( const SfxFont& rFont, const OutputDevice& rDevice );
- ~SfxFontSizeInfo();
-
- BOOL HasSize(const Size &rSize) const;
- BOOL IsScalable() const { return bScalable; }
-
- USHORT SizeCount() const { return nSizes; }
- const Size& GetSize( USHORT nNo ) const
- { return pSizes[nNo]; }
-};
-
-// class SfxFont ---------------------------------------------------------
-
-class SFX2_DLLPUBLIC SfxFont
-{
-private:
- String aName;
- FontFamily eFamily;
- FontPitch ePitch;
- CharSet eCharSet;
-
- SfxFont& operator=(const SfxFont& rFont); // not implemented
-
-public:
- SfxFont( const FontFamily eFam,
- const String& aName,
- const FontPitch eFontPitch = PITCH_DONTKNOW,
- const CharSet eFontCharSet = RTL_TEXTENCODING_DONTKNOW );
- // ZugriffsMethoden:
- inline const String& GetName() const { return aName; }
- inline FontFamily GetFamily() const { return eFamily; }
- inline FontPitch GetPitch() const { return ePitch; }
- inline CharSet GetCharSet() const { return eCharSet; }
-};
-
// class SfxPrinter ------------------------------------------------------
class SFX2_DLLPUBLIC SfxPrinter : public Printer
@@ -125,19 +76,8 @@ public:
const SfxItemSet& GetOptions() const { return *pOptions; }
void SetOptions( const SfxItemSet &rNewOptions );
- void EnableRange( USHORT nRange );
- void DisableRange( USHORT nRange );
- BOOL IsRangeEnabled( USHORT nRange ) const;
-
BOOL IsKnown() const { return bKnown; }
BOOL IsOriginal() const { return bKnown; }
-
- using OutputDevice::GetFont;
- USHORT GetFontCount();
- const SfxFont* GetFont( USHORT nNo ) const;
- const SfxFont* GetFontByName( const String &rFontName );
-
- BOOL InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects );
};
#endif
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index b58a9e7bdf73..70e7b08319e5 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -59,7 +59,6 @@ class SfxItemPool;
class SfxTabPage;
class SfxPrintMonitor;
class SfxFrameSetDescriptor;
-class PrintDialog;
class Printer;
class SfxPrinter;
class SfxProgress;
@@ -239,13 +238,9 @@ public:
void AdjustVisArea(const Rectangle& rRect);
// Printing Interface
- virtual void PreparePrint( PrintDialog *pPrintDialog = 0 );
- virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI );
- virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0 );
virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE );
virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=FALSE );
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
- virtual PrintDialog* CreatePrintDialog( Window *pParent );
void LockPrinter( BOOL bLock = TRUE );
BOOL IsPrinterLocked() const;
virtual JobSetup GetJobSetup() const;
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 546b6b1c6558..1bde50fec224 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -116,21 +116,6 @@ void SfxApplication::Init
<SfxApplication::OpenClients()>
*/
{
-#ifdef DDE_AVAILABLE
-#ifndef DBG_UTIL
- InitializeDde();
-#else
- if( !InitializeDde() )
- {
- ByteString aStr( "Kein DDE-Service moeglich. Fehler: " );
- if( GetDdeService() )
- aStr += GetDdeService()->GetError();
- else
- aStr += '?';
- DBG_ASSERT( sal_False, aStr.GetBuffer() )
- }
-#endif
-#endif
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src
index fee60404d01c..fee60404d01c 100755..100644
--- a/sfx2/source/dialog/securitypage.src
+++ b/sfx2/source/dialog/securitypage.src
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 2cd195976832..1dc2423bcdaf 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -53,7 +53,6 @@
#include <ucbhelper/content.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <vos/mutex.hxx>
-#include <svtools/printdlg.hxx>
#include <cppuhelper/implbase1.hxx>
#include <sfx2/viewfrm.hxx>
@@ -799,81 +798,8 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
{
if ( !m_xPrintJob.is() )
m_xPrintJob = new SfxPrintJob_Impl( this );
-/*
- PrintDialog* pDlg = pPrintHint->GetPrintDialog();
- Printer* pPrinter = pPrintHint->GetPrinter();
- ::rtl::OUString aPrintFile ( ( pPrinter && pPrinter->IsPrintFileEnabled() ) ? pPrinter->GetPrintFile() : String() );
- ::rtl::OUString aRangeText ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_RANGE) ) ? pDlg->GetRangeText() : String() );
- sal_Bool bSelectionOnly = ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_SELECTION) ) ? sal_True : sal_False );
-
- sal_Int32 nArgs = 2;
- if ( aPrintFile.getLength() )
- nArgs++;
- if ( aRangeText.getLength() )
- nArgs++;
- else if ( bSelectionOnly )
- nArgs++;
-
- m_aPrintOptions.realloc(nArgs);
- m_aPrintOptions[0].Name = DEFINE_CONST_UNICODE("CopyCount");
- m_aPrintOptions[0].Value <<= (sal_Int16) (pPrinter ? pPrinter->GetCopyCount() : 1 );
- m_aPrintOptions[1].Name = DEFINE_CONST_UNICODE("Collate");
- m_aPrintOptions[1].Value <<= (sal_Bool) (pDlg ? pDlg->IsCollateChecked() : sal_False );
-
- if ( bSelectionOnly )
- {
- m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Selection");
- m_aPrintOptions[2].Value <<= bSelectionOnly;
- }
- else if ( aRangeText.getLength() )
- {
- m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Pages");
- m_aPrintOptions[2].Value <<= aRangeText;
- }
-
- if ( aPrintFile.getLength() )
- {
- m_aPrintOptions[nArgs-1].Name = DEFINE_CONST_UNICODE("FileName");
- m_aPrintOptions[nArgs-1].Value <<= aPrintFile;
- }
-*/
m_aPrintOptions = pPrintHint->GetOptions();
}
-/*
- else if ( pPrintHint->GetWhich() == -3 ) // -3 : AdditionalPrintOptions
- {
- uno::Sequence < beans::PropertyValue >& lOldOpts = m_aPrintOptions;
- const uno::Sequence < beans::PropertyValue >& lNewOpts = pPrintHint->GetAdditionalOptions();
- sal_Int32 nOld = lOldOpts.getLength();
- sal_Int32 nAdd = lNewOpts.getLength();
- lOldOpts.realloc( nOld + nAdd );
-
- // assume that all new elements are overwriting old ones and so don't need to be added
- sal_Int32 nTotal = nOld;
- for ( sal_Int32 n=0; n<nAdd; n++ )
- {
- sal_Int32 m;
- for ( m=0; m<nOld; m++ )
- if ( lNewOpts[n].Name == lOldOpts[m].Name )
- // new option overwrites old one
- break;
-
- if ( m == nOld )
- {
- // this is a new option, so add it to the resulting sequence - counter must be incremented
- lOldOpts[nTotal].Name = lNewOpts[n].Name;
- lOldOpts[nTotal++].Value = lNewOpts[n].Value;
- }
- else
- // overwrite old option with new value, counter stays unmodified
- lOldOpts[m].Value = lNewOpts[n].Value;
- }
-
- if ( nTotal != lOldOpts.getLength() )
- // at least one new options has overwritten an old one, so we allocated too much
- lOldOpts.realloc( nTotal );
- }
-*/
else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob
{
view::PrintJobEvent aEvent;
diff --git a/sfx2/source/doc/syspath.cxx b/sfx2/source/doc/syspath.cxx
index a1025370ed24..a1025370ed24 100644..100755
--- a/sfx2/source/doc/syspath.cxx
+++ b/sfx2/source/doc/syspath.cxx
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
index ef5c168c36f0..ef5c168c36f0 100755..100644
--- a/sfx2/source/inc/helpid.hrc
+++ b/sfx2/source/inc/helpid.hrc
diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx
index 0b86a534de52..0b86a534de52 100755..100644
--- a/sfx2/source/menu/thessubmenu.hxx
+++ b/sfx2/source/menu/thessubmenu.hxx
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 310c1a58a578..64bebccd60fd 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -30,7 +30,6 @@
#include <vcl/virdev.hxx>
#include <vcl/metric.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/printdlg.hxx>
#include <unotools/printwarningoptions.hxx>
#include <svtools/printoptions.hxx>
#include <vector>
@@ -47,54 +46,23 @@
#include "sfx2/sfxresid.hxx"
#include "view.hrc"
-#ifdef MSC
-// der ist buggy
-#define NEW_OBJECTS(Class, nCount) ((Class*) new char[ sizeof(Class) * (nCount) ])
-#else
-#define NEW_OBJECTS(Class, nCount) (new Class[nCount])
-#endif
-
-
-USHORT SfxFontSizeInfo::pStaticSizes[] =
-{
- 60,
- 80,
- 100,
- 120,
- 140,
- 180,
- 240,
- 360,
- 480,
- 600,
- 720
-};
-
-//--------------------------------------------------------------------
-
-SV_DECL_PTRARR_DEL(SfxFontArr_Impl,SfxFont*,10,5)
-
// struct SfxPrinter_Impl ------------------------------------------------
struct SfxPrinter_Impl
{
- SfxFontArr_Impl* mpFonts;
BOOL mbAll;
BOOL mbSelection;
BOOL mbFromTo;
BOOL mbRange;
SfxPrinter_Impl() :
- mpFonts ( NULL ),
mbAll ( TRUE ),
mbSelection ( TRUE ),
mbFromTo ( TRUE ),
mbRange ( TRUE ) {}
- ~SfxPrinter_Impl() { delete mpFonts; }
+ ~SfxPrinter_Impl() {}
};
-#define FONTS() pImpl->mpFonts
-
struct SfxPrintOptDlg_Impl
{
sal_Bool mbHelpDisabled;
@@ -103,98 +71,6 @@ struct SfxPrintOptDlg_Impl
mbHelpDisabled ( sal_False ) {}
};
-//--------------------------------------------------------------------
-
-SfxFontSizeInfo::SfxFontSizeInfo( const SfxFont &rFont,
- const OutputDevice &rDevice ) :
-
- pSizes(0),
- nSizes(0),
- bScalable(TRUE)
-
-{
- if ( 0 == rDevice.GetDevFontCount() )
- bScalable = FALSE;
- else
- {
- OutputDevice &rDev = (OutputDevice&) rDevice;
- Font aFont(rFont.GetName(), Size(0,12));
- aFont.SetFamily(rFont.GetFamily());
- aFont.SetPitch(rFont.GetPitch());
- aFont.SetCharSet(rFont.GetCharSet());
-
- // verfuegbare Groessen in die Liste eintragen, Groesse in 10tel Punkt
- int nSizeCount = rDev.GetDevFontSizeCount(aFont);
- pSizes = NEW_OBJECTS(Size, nSizeCount);
- const MapMode aOldMapMode = rDev.GetMapMode();
- MapMode aMap(aOldMapMode);
- aMap.SetMapUnit(MAP_POINT);
- const Fraction aTen(1, 10);
- aMap.SetScaleX(aTen);
- aMap.SetScaleY(aTen);
- rDev.SetMapMode(aMap);
-
- // Es gibt Fonts mit Bitmaps und skalierbaren Groessen
- // In diesem Fall wird der Fonts als skalierbar behandelt.
- BOOL bFoundScalable = FALSE;
- for ( int i = 0; i < nSizeCount; ++i )
- {
- const Size aSize( rDev.GetDevFontSize(aFont, i) );
- if ( aSize.Height() != 0 )
- pSizes[nSizes++] = aSize;
- else
- bFoundScalable |= TRUE;
- }
- if( !bFoundScalable )
- bScalable = FALSE;
- else
- {
- // statische Font-Sizes verwenden
- delete [] pSizes;
- nSizes = 0;
- }
- rDev.SetMapMode(aOldMapMode);
- }
-
- if ( 0 == nSizes )
- {
- nSizes = sizeof(pStaticSizes) / sizeof(USHORT);
- pSizes = NEW_OBJECTS(Size, nSizes);
- for ( USHORT nPos = 0; nPos <nSizes; ++nPos )
- pSizes[nPos] = Size( 0, pStaticSizes[nPos] );
- }
-}
-
-//--------------------------------------------------------------------
-
-SfxFontSizeInfo::~SfxFontSizeInfo()
-{
- delete [] pSizes;
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxFontSizeInfo::HasSize(const Size &rSize) const
-{
- if ( bScalable )
- return TRUE;
- for ( USHORT i = 0; i < nSizes; ++i)
- if ( pSizes[i] == rSize )
- return TRUE;
- return FALSE;
-}
-
-//--------------------------------------------------------------------
-
-SfxFont::SfxFont( const FontFamily eFontFamily, const String& aFontName,
- const FontPitch eFontPitch, const CharSet eFontCharSet ):
- aName( aFontName ),
- eFamily( eFontFamily ),
- ePitch( eFontPitch ),
- eCharSet( eFontCharSet )
-{
-}
-
// class SfxPrinter ------------------------------------------------------
SfxPrinter* SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions )
@@ -335,194 +211,6 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions )
//--------------------------------------------------------------------
-void SfxPrinter::EnableRange( USHORT nRange )
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
-
- if ( eRange == PRINTDIALOG_ALL )
- pImpl->mbAll = TRUE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- pImpl->mbSelection = TRUE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- pImpl->mbFromTo = TRUE;
- else if ( eRange == PRINTDIALOG_RANGE )
- pImpl->mbRange = TRUE;
-}
-
-//--------------------------------------------------------------------
-
-void SfxPrinter::DisableRange( USHORT nRange )
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
-
- if ( eRange == PRINTDIALOG_ALL )
- pImpl->mbAll = FALSE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- pImpl->mbSelection = FALSE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- pImpl->mbFromTo = FALSE;
- else if ( eRange == PRINTDIALOG_RANGE )
- pImpl->mbRange = FALSE;
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const
-{
- PrintDialogRange eRange = (PrintDialogRange)nRange;
- BOOL bRet = FALSE;
-
- if ( eRange == PRINTDIALOG_ALL )
- bRet = pImpl->mbAll;
- else if ( eRange == PRINTDIALOG_SELECTION )
- bRet = pImpl->mbSelection;
- else if ( eRange == PRINTDIALOG_FROMTO )
- bRet = pImpl->mbFromTo;
- else if ( eRange == PRINTDIALOG_RANGE )
- bRet = pImpl->mbRange;
-
- return bRet;
-}
-
-//--------------------------------------------------------------------
-
-SV_IMPL_PTRARR(SfxFontArr_Impl,SfxFont*)
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxFindFont_Impl( const SfxFontArr_Impl& rArr,
- const String& rName )
-{
- const USHORT nCount = rArr.Count();
- for ( USHORT i = 0; i < nCount; ++i )
- {
- const SfxFont *pFont = rArr[i];
- if ( pFont->GetName() == rName )
- return pFont;
- }
- return NULL;
-}
-
-//--------------------------------------------------------------------
-
-void SfxPrinter::UpdateFonts_Impl()
-{
- VirtualDevice *pVirDev = 0;
- const OutputDevice *pOut = this;
-
- // falls kein Drucker gefunden werden konnte, ein
- // temp. Device erzeugen fuer das Erfragen der Fonts
- if( !IsValid() )
- pOut = pVirDev = new VirtualDevice;
-
- int nCount = pOut->GetDevFontCount();
- FONTS() = new SfxFontArr_Impl((BYTE)nCount);
-
- std::vector< Font > aNonRegularFonts;
- for(int i = 0;i < nCount;++i)
- {
- Font aFont(pOut->GetDevFont(i));
- if ( (aFont.GetItalic() != ITALIC_NONE) ||
- (aFont.GetWeight() != WEIGHT_MEDIUM) )
- {
- // First: Don't add non-regular fonts. The font name is not unique so we have
- // to filter the device font list.
- aNonRegularFonts.push_back( aFont );
- }
- else if ( FONTS()->Count() == 0 ||
- (*FONTS())[FONTS()->Count()-1]->GetName() != aFont.GetName() )
- {
- DBG_ASSERT(0 == SfxFindFont_Impl(*FONTS(), aFont.GetName()), "Doppelte Fonts vom SV-Device!");
- SfxFont* pTmp = new SfxFont( aFont.GetFamily(), aFont.GetName(),
- aFont.GetPitch(), aFont.GetCharSet() );
- FONTS()->C40_INSERT(SfxFont, pTmp, FONTS()->Count());
- }
- }
- delete pVirDev;
-
- // Try to add all non-regular fonts. It could be that there was no regular font
- // with the same name added.
- std::vector< Font >::const_iterator pIter;
- for ( pIter = aNonRegularFonts.begin(); pIter != aNonRegularFonts.end(); pIter++ )
- {
- if ( SfxFindFont_Impl( *FONTS(), pIter->GetName() ) == 0 )
- {
- SfxFont* pTmp = new SfxFont( pIter->GetFamily(), pIter->GetName(),
- pIter->GetPitch(), pIter->GetCharSet() );
- FONTS()->C40_INSERT( SfxFont, pTmp, FONTS()->Count() );
- }
- }
-}
-
-//--------------------------------------------------------------------
-
-USHORT SfxPrinter::GetFontCount()
-{
- if ( !FONTS() )
- UpdateFonts_Impl();
- return FONTS()->Count();
-}
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxPrinter::GetFont( USHORT nNo ) const
-{
- DBG_ASSERT( FONTS(), "bitte erst GetFontCount() abfragen!" );
- return (*FONTS())[ nNo ];
-}
-
-//--------------------------------------------------------------------
-
-const SfxFont* SfxPrinter::GetFontByName( const String &rFontName )
-{
- if ( !FONTS() )
- UpdateFonts_Impl();
- return SfxFindFont_Impl(*FONTS(), rFontName);
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects )
-{
- const SvtPrinterOptions aPrinterOpt;
- const SvtPrintFileOptions aPrintFileOpt;
- const SvtBasePrintOptions* pPrinterOpt = &aPrinterOpt;
- const SvtBasePrintOptions* pPrintFileOpt = &aPrintFileOpt;
- PrinterOptions aNewPrinterOptions;
- BOOL bRet = TRUE;
-
- ( ( IsPrintFileEnabled() && GetPrintFile().Len() ) ? pPrintFileOpt : pPrinterOpt )->GetPrinterOptions( aNewPrinterOptions );
-
- if( bAskAboutTransparentObjects && !aNewPrinterOptions.IsReduceTransparency() )
- {
- if ( !Application::IsHeadlessModeEnabled() )
- {
- SvtPrintWarningOptions aWarnOpt;
-
- if( aWarnOpt.IsTransparency() )
- {
- TransparencyPrintWarningBox aWarnBox( pUIParent );
- const USHORT nRet = aWarnBox.Execute();
-
- if( nRet == RET_CANCEL )
- bRet = FALSE;
- else
- {
- aNewPrinterOptions.SetReduceTransparency( nRet != RET_NO );
- aWarnOpt.SetTransparency( !aWarnBox.IsNoWarningChecked() );
- }
- }
- }
- }
-
- if( bRet )
- SetPrinterOptions( aNewPrinterOptions );
-
- return bRet;
-}
-
-//--------------------------------------------------------------------
-
SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent,
SfxViewShell *pViewShell,
const SfxItemSet *pSet ) :
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 4ef4244f28e6..24ed85556466 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -34,7 +34,6 @@
#include <svl/itempool.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/printdlg.hxx>
#include <svtools/prnsetup.hxx>
#include <svl/flagitem.hxx>
#include <svl/stritem.hxx>
@@ -352,30 +351,6 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
}
}
-// -----------------------------------------------------------------------
-
-void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter )
-
-/* [Beschreibung]
-
- Mit dieser Funktion werden die nicht verf"ugbaren Ranges
- vom Printer zum PrintDialog geforwarded.
-*/
-
-{
- if ( !pPrinter )
- return;
-
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) )
- rDlg.DisableRange( PRINTDIALOG_ALL );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) )
- rDlg.DisableRange( PRINTDIALOG_SELECTION );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) )
- rDlg.DisableRange( PRINTDIALOG_FROMTO );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) )
- rDlg.DisableRange( PRINTDIALOG_RANGE );
-}
-
//====================================================================
class SfxDialogExecutor_Impl
@@ -392,7 +367,6 @@ class SfxDialogExecutor_Impl
{
private:
SfxViewShell* _pViewSh;
- PrintDialog* _pPrintParent;
PrinterSetupDialog* _pSetupParent;
SfxItemSet* _pOptions;
sal_Bool _bModified;
@@ -401,7 +375,6 @@ private:
DECL_LINK( Execute, void * );
public:
- SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent );
SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent );
~SfxDialogExecutor_Impl() { delete _pOptions; }
@@ -412,22 +385,9 @@ public:
//--------------------------------------------------------------------
-SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) :
-
- _pViewSh ( pViewSh ),
- _pPrintParent ( pParent ),
- _pSetupParent ( NULL ),
- _pOptions ( NULL ),
- _bModified ( sal_False ),
- _bHelpDisabled ( sal_False )
-
-{
-}
-
SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) :
_pViewSh ( pViewSh ),
- _pPrintParent ( NULL ),
_pSetupParent ( pParent ),
_pOptions ( NULL ),
_bModified ( sal_False ),
@@ -443,27 +403,13 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG )
// Options lokal merken
if ( !_pOptions )
{
- DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" );
- if( _pPrintParent )
- _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone();
- else if( _pSetupParent )
+ DBG_ASSERT( _pSetupParent, "no dialog parent" );
+ if( _pSetupParent )
_pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone();
}
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET );
- if ( eState != SFX_ITEM_UNKNOWN )
- {
- PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange();
- BOOL bValue = ( PRINTSHEETS_ALL != eRange );
- _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) );
- }
- }
-
// Dialog ausf"uhren
- SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast<Window*>(_pPrintParent)
- : static_cast<Window*>(_pSetupParent),
+ SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( static_cast<Window*>(_pSetupParent),
_pViewSh, _pOptions );
if ( _bHelpDisabled )
pDlg->DisableHelp();
@@ -472,15 +418,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG )
delete _pOptions;
_pOptions = pDlg->GetOptions().Clone();
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) )
- {
- _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue()
- ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL );
- }
- }
}
delete pDlg;
@@ -687,7 +624,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
USHORT nDialogRet = RET_CANCEL;
// BOOL bCollate=FALSE;
SfxPrinter* pPrinter = 0;
- PrintDialog* pPrintDlg = 0;
SfxDialogExecutor_Impl* pExecutor = 0;
bool bSilent = false;
BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
@@ -895,16 +831,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// forget new printer, it was taken over (as pPrinter) or deleted
pDlgPrinter = NULL;
- /* Now lets reset the Dialog printer, since its freed */
- if (pPrintDlg)
- pPrintDlg->SetPrinter (pPrinter);
}
else
{
// PrinterDialog is used to transfer information on printing,
// so it will only be deleted here if dialog was cancelled
DELETEZ( pDlgPrinter );
- DELETEZ( pPrintDlg );
rReq.Ignore();
if ( SID_PRINTDOC == nId )
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
@@ -923,80 +855,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
//--------------------------------------------------------------------
-PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ )
-
-/* [Beschreibung]
-
- Diese Methode kann "uberladen werden, um einen speziellen PrintDialog
- zu erzeugen. Dies ist z.B. notwendig wenn spezielle <StarView> Features
- wie drucken von Seitenbereichen.
-*/
-
-{
- #if 0
- PrintDialog *pDlg = new PrintDialog( pParent, false );
- pDlg->SetFirstPage( 1 );
- pDlg->SetLastPage( 9999 );
- pDlg->EnableCollate();
- return pDlg;
- #else
- return NULL;
- #endif
-}
-
-//--------------------------------------------------------------------
-
-void SfxViewShell::PreparePrint( PrintDialog * )
-{
-}
-
-//--------------------------------------------------------------------
-
-
-ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/,
- PrintDialog* /*pPrintDlg*/,
- BOOL /*bSilent*/, BOOL /*bIsAPI*/ )
-{
- #if 0
- // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor
- // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt
- SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent );
- SfxPrinter *pDocPrinter = GetPrinter(TRUE);
- if ( !pPrinter )
- pPrinter = pDocPrinter;
- else if ( pDocPrinter != pPrinter )
- {
- pProgress->RestoreOnEndPrint( pDocPrinter->Clone() );
- SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- }
- pProgress->SetWaitMode(FALSE);
-
- // Drucker starten
- PreparePrint( pPrintDlg );
- SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell();
- if ( pPrinter->StartJob(pObjShell->GetTitle(0)) )
- {
- // Drucken
- Print( *pProgress, bIsAPI, pPrintDlg );
- pProgress->Stop();
- pProgress->DeleteOnEndPrint();
- pPrinter->EndJob();
- }
- else
- {
- // Printer konnte nicht gestartet werden
- delete pProgress;
- }
-
- return pPrinter->GetError();
- #else
- DBG_ERROR( "DoPrint called, dead code !" );
- return ERRCODE_IO_NOTSUPPORTED;
- #endif
-}
-
-//--------------------------------------------------------------------
-
BOOL SfxViewShell::IsPrinterLocked() const
{
return pImp->m_nPrinterLocks > 0;
@@ -1026,13 +884,6 @@ void SfxViewShell::LockPrinter( BOOL bLock)
//--------------------------------------------------------------------
-USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ )
-{
- return 0;
-}
-
-//--------------------------------------------------------------------
-
SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ )
{
return 0;
diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx
index e49f8e7e1b63..7b60a463dd1c 100644
--- a/slideshow/source/engine/color.cxx
+++ b/slideshow/source/engine/color.cxx
@@ -267,7 +267,9 @@ namespace slideshow
RGBColor::RGBColor(const RGBColor& rLHS)
{
- RGBColor(rLHS.getRed(), rLHS.getGreen(), rLHS.getBlue());
+ maRGBTriple.mnRed = rLHS.getRed();
+ maRGBTriple.mnGreen = rLHS.getGreen();
+ maRGBTriple.mnBlue = rLHS.getBlue();
}
RGBColor& RGBColor::operator=( const RGBColor& rLHS ){
diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk
index beac66778518..fdc99cd1ad9f 100644
--- a/slideshow/source/engine/makefile.mk
+++ b/slideshow/source/engine/makefile.mk
@@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : $(PRJ)$/util$/makefile.pmk
.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
-CDEFS+=-DENABLE_PRESENTER_EXTRA_UI
+ENABLE_PRESENTER_EXTRA_UI is not used anymore
.ENDIF
# --- Common ----------------------------------------------------------
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index 84786c26a504..a5d8acea2140 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -653,20 +653,13 @@ ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const&
sal_Int32 nOrdNumStart,
bool bConvertingMasterPage ) :
mxPage( xActualPage ),
-#ifdef ENABLE_PRESENTER_EXTRA_UI
mxPagesSupplier( xPagesSupplier ),
-#else
- mxPagesSupplier( NULL ),
-#endif
mrContext( rContext ),
maPolygons(),
maShapesStack(),
mnAscendingPrio( nOrdNumStart ),
mbConvertingMasterPage( bConvertingMasterPage )
{
-#ifndef ENABLE_PRESENTER_EXTRA_UI
- (void)xPagesSupplier;
-#endif
uno::Reference<drawing::XShapes> const xShapes(
xPage, uno::UNO_QUERY_THROW );
maShapesStack.push( XShapesEntry(xShapes) );
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 55831ba1609f..2534b495ca90 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -139,6 +139,10 @@ public:
virtual PolyPolygonVector getPolygons();
virtual void drawPolygons() const;
virtual bool isPaintOverlayActive() const;
+ virtual void enablePaintOverlay();
+ virtual void disablePaintOverlay();
+ virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth );
+
// TODO(F2): Rework SlideBitmap to no longer be based on XBitmap,
// but on canvas-independent basegfx bitmaps
@@ -156,6 +160,9 @@ private:
virtual bool requestCursor( sal_Int16 nCursorShape );
virtual void resetCursor();
+ void activatePaintOverlay();
+ void deactivatePaintOverlay();
+
/** Query whether the slide has animations at all
If the slide doesn't have animations, show() displays
@@ -174,9 +181,6 @@ private:
*/
bool isShowing() const;
- void enablePaintOverlay();
- void disablePaintOverlay();
-
/// Set all Shapes to their initial attributes for slideshow
bool applyInitialShapeAttributes( const ::com::sun::star::uno::Reference<
::com::sun::star::animations::XAnimationNode >& xRootAnimationNode );
@@ -419,6 +423,13 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra
maContext.mrScreenUpdater.addViewUpdate(mpShapeManager);
}
+void SlideImpl::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth )
+{
+ maUserPaintColor = aUserPaintColor;
+ mdUserPaintStrokeWidth = dUserPaintStrokeWidth;
+ mbUserPaintOverlayEnabled = bUserPaintEnabled;
+}
+
SlideImpl::~SlideImpl()
{
if( mpShapeManager )
@@ -454,9 +465,7 @@ void SlideImpl::dispose()
mpShapeManager.reset();
mxRootNode.clear();
mxDrawPage.clear();
-#ifndef ENABLE_PRESENTER_EXTRA_UI
mxDrawPagesSupplier.clear();
-#endif
}
bool SlideImpl::prefetch()
@@ -542,7 +551,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted )
// ---------------------------------------------------------------
// enable paint overlay, if maUserPaintColor is valid
- enablePaintOverlay();
+ activatePaintOverlay();
// ---------------------------------------------------------------
@@ -566,7 +575,7 @@ void SlideImpl::hide()
// disable user paint overlay under all circumstances,
// this slide now ceases to be active.
- disablePaintOverlay();
+ deactivatePaintOverlay();
// ---------------------------------------------------------------
@@ -888,19 +897,33 @@ bool SlideImpl::implPrefetchShow()
void SlideImpl::enablePaintOverlay()
{
- if( mbUserPaintOverlayEnabled )
+ if( !mbUserPaintOverlayEnabled || !mbPaintOverlayActive )
+ {
+ mbUserPaintOverlayEnabled = true;
+ activatePaintOverlay();
+ }
+}
+
+void SlideImpl::disablePaintOverlay()
+{
+}
+
+void SlideImpl::activatePaintOverlay()
+{
+ if( mbUserPaintOverlayEnabled || !maPolygons.empty() )
{
mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor,
mdUserPaintStrokeWidth,
maContext,
- maPolygons );
+ maPolygons,
+ mbUserPaintOverlayEnabled );
mbPaintOverlayActive = true;
}
}
void SlideImpl::drawPolygons() const
{
- if( mbUserPaintOverlayEnabled )
+ if( mpPaintOverlay )
mpPaintOverlay->drawPolygons();
}
@@ -923,7 +946,7 @@ bool SlideImpl::isPaintOverlayActive() const
return mbPaintOverlayActive;
}
-void SlideImpl::disablePaintOverlay()
+void SlideImpl::deactivatePaintOverlay()
{
if(mbPaintOverlayActive)
maPolygons = mpPaintOverlay->getPolygons();
@@ -1259,12 +1282,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >&
bool bIntrinsicAnimationsAllowed,
bool bDisableAnimationZOrder )
{
-#ifdef ENABLE_PRESENTER_EXTRA_UI
boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue,
-#else
- (void)xDrawPages;
- boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue,
-#endif
rEventMultiplexer, rScreenUpdater,
rActivitiesQueue, rUserEventQueue,
rCursorManager, rViewContainer,
diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx
index 8d9fad06a3e3..d0ab4e33a1e3 100644
--- a/slideshow/source/engine/slide/userpaintoverlay.cxx
+++ b/slideshow/source/engine/slide/userpaintoverlay.cxx
@@ -70,8 +70,9 @@ namespace slideshow
ActivitiesQueue& rActivitiesQueue,
ScreenUpdater& rScreenUpdater,
const UnoViewContainer& rViews,
- Slide& rSlide,
- const PolyPolygonVector& rPolygons ) :
+ Slide& rSlide,
+ const PolyPolygonVector& rPolygons,
+ bool bActive ) :
mrActivitiesQueue( rActivitiesQueue ),
mrScreenUpdater( rScreenUpdater ),
maViews(),
@@ -87,7 +88,8 @@ namespace slideshow
//handle the "remove stroke by stroke" mode of erasing
mbIsEraseModeActivated( false ),
mrSlide(rSlide),
- mnSize(100)
+ mnSize(100),
+ mbActive( bActive )
{
std::for_each( rViews.begin(),
rViews.end(),
@@ -129,6 +131,8 @@ namespace slideshow
bool colorChanged( RGBColor const& rUserColor )
{
+ mbIsLastPointValid = false;
+ mbActive = true;
this->maStrokeColor = rUserColor;
this->mbIsEraseModeActivated = false;
return true;
@@ -141,22 +145,15 @@ namespace slideshow
return true;
}
- bool eraseAllInkChanged( bool const& rEraseAllInk )
+ void repaintWithoutPolygons()
{
- this->mbIsEraseAllModeActivated= rEraseAllInk;
- // if the erase all mode is activated it will remove all ink from slide,
- // therefor destroy all the polygons stored
- if(mbIsEraseAllModeActivated)
- {
- // The Erase Mode should be desactivated
- mbIsEraseModeActivated = false;
// must get access to the instance to erase all polygon
for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end();
aIter!=aEnd;
++aIter )
{
// fully clear view content to background color
- (*aIter)->getCanvas()->clear();
+ //(*aIter)->getCanvas()->clear();
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );
@@ -181,7 +178,19 @@ namespace slideshow
mrScreenUpdater.notifyUpdate(*aIter,true);
}
- maPolygons.clear();
+ }
+
+ bool eraseAllInkChanged( bool const& rEraseAllInk )
+ {
+ this->mbIsEraseAllModeActivated= rEraseAllInk;
+ // if the erase all mode is activated it will remove all ink from slide,
+ // therefor destroy all the polygons stored
+ if(mbIsEraseAllModeActivated)
+ {
+ // The Erase Mode should be desactivated
+ mbIsEraseModeActivated = false;
+ repaintWithoutPolygons();
+ maPolygons.clear();
}
mbIsEraseAllModeActivated=false;
return true;
@@ -198,18 +207,25 @@ namespace slideshow
bool switchPenMode()
{
+ mbIsLastPointValid = false;
+ mbActive = true;
this->mbIsEraseModeActivated = false;
return true;
}
bool switchEraserMode()
{
+ mbIsLastPointValid = false;
+ mbActive = true;
this->mbIsEraseModeActivated = true;
return true;
}
bool disable()
{
+ mbIsLastPointValid = false;
+ mbIsLastMouseDownPosValid = false;
+ mbActive = false;
return true;
}
@@ -235,6 +251,9 @@ namespace slideshow
// MouseEventHandler methods
virtual bool handleMousePressed( const awt::MouseEvent& e )
{
+ if( !mbActive )
+ return false;
+
if (e.Buttons == awt::MouseButton::RIGHT)
{
mbIsLastPointValid = false;
@@ -255,6 +274,9 @@ namespace slideshow
virtual bool handleMouseReleased( const awt::MouseEvent& e )
{
+ if( !mbActive )
+ return false;
+
if (e.Buttons == awt::MouseButton::RIGHT)
{
mbIsLastPointValid = false;
@@ -289,6 +311,9 @@ namespace slideshow
virtual bool handleMouseEntered( const awt::MouseEvent& e )
{
+ if( !mbActive )
+ return false;
+
mbIsLastPointValid = true;
maLastPoint.setX( e.X );
maLastPoint.setY( e.Y );
@@ -298,6 +323,9 @@ namespace slideshow
virtual bool handleMouseExited( const awt::MouseEvent& )
{
+ if( !mbActive )
+ return false;
+
mbIsLastPointValid = false;
mbIsLastMouseDownPosValid = false;
@@ -306,7 +334,16 @@ namespace slideshow
virtual bool handleMouseDragged( const awt::MouseEvent& e )
{
- if(mbIsEraseModeActivated)
+ if( !mbActive )
+ return false;
+
+ if (e.Buttons == awt::MouseButton::RIGHT)
+ {
+ mbIsLastPointValid = false;
+ return false;
+ }
+
+ if(mbIsEraseModeActivated)
{
//define the last point as an object
//we suppose that there's no way this point could be valid
@@ -421,6 +458,14 @@ namespace slideshow
}
+ void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth )
+ {
+ maStrokeColor = aUserPaintColor;
+ mnStrokeWidth = dUserPaintStrokeWidth;
+ mbActive = bUserPaintEnabled;
+ if( !mbActive )
+ disable();
+ }
private:
ActivitiesQueue& mrActivitiesQueue;
@@ -438,17 +483,20 @@ namespace slideshow
bool mbIsEraseModeActivated;
Slide& mrSlide;
sal_Int32 mnSize;
+ bool mbActive;
};
UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor,
double nStrokeWidth,
const SlideShowContext& rContext,
- const PolyPolygonVector& rPolygons )
+ const PolyPolygonVector& rPolygons,
+ bool bActive )
{
UserPaintOverlaySharedPtr pRet( new UserPaintOverlay( rStrokeColor,
nStrokeWidth,
rContext,
- rPolygons ));
+ rPolygons,
+ bActive));
return pRet;
}
@@ -456,7 +504,8 @@ namespace slideshow
UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor,
double nStrokeWidth,
const SlideShowContext& rContext,
- const PolyPolygonVector& rPolygons ) :
+ const PolyPolygonVector& rPolygons,
+ bool bActive ) :
mpHandler( new PaintOverlayHandler( rStrokeColor,
nStrokeWidth,
rContext.mrActivitiesQueue,
@@ -464,7 +513,7 @@ namespace slideshow
rContext.mrViewContainer,
//adding a link to Slide
dynamic_cast<Slide&>(rContext.mrCursorManager),
- rPolygons )),
+ rPolygons, bActive )),
mrMultiplexer( rContext.mrEventMultiplexer )
{
mrMultiplexer.addClickHandler( mpHandler, 3.0 );
@@ -483,6 +532,12 @@ namespace slideshow
mpHandler->drawPolygons();
}
+ void UserPaintOverlay::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth )
+ {
+ mpHandler->update_settings( bUserPaintEnabled, aUserPaintColor, dUserPaintStrokeWidth );
+ }
+
+
UserPaintOverlay::~UserPaintOverlay()
{
try
diff --git a/slideshow/source/engine/slide/userpaintoverlay.hxx b/slideshow/source/engine/slide/userpaintoverlay.hxx
index b92f5f2539b0..3a8e14c600c5 100644
--- a/slideshow/source/engine/slide/userpaintoverlay.hxx
+++ b/slideshow/source/engine/slide/userpaintoverlay.hxx
@@ -69,16 +69,21 @@ namespace slideshow
static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor,
double nStrokeWidth,
const SlideShowContext& rContext,
- const PolyPolygonVector& rPolygons );
+ const PolyPolygonVector& rPolygons,
+ bool bActive);
~UserPaintOverlay();
PolyPolygonVector getPolygons();
void drawPolygons();
+ void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth );
+
+
private:
UserPaintOverlay( const RGBColor& rStrokeColor,
double nStrokeWidth,
const SlideShowContext& rContext,
- const PolyPolygonVector& rPolygons );
+ const PolyPolygonVector& rPolygons,
+ bool bActive );
::boost::shared_ptr<PaintOverlayHandler> mpHandler;
EventMultiplexer& mrMultiplexer;
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index d736c3f52d64..a909ade61ee2 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -458,7 +458,7 @@ private:
boost::optional<RGBColor> maUserPaintColor;
- boost::optional<double> maUserPaintStrokeWidth;
+ double maUserPaintStrokeWidth;
//changed for the eraser project
boost::optional<bool> maEraseAllInk;
@@ -950,7 +950,7 @@ SlideSharedPtr SlideShowImpl::makeSlide(
maShapeCursors,
(aIter != maPolygons.end()) ? aIter->second : PolyPolygonVector(),
maUserPaintColor ? *maUserPaintColor : RGBColor(),
- *maUserPaintStrokeWidth,
+ maUserPaintStrokeWidth,
!!maUserPaintColor,
mbImageAnimationsAllowed,
mbDisableAnimationZOrder) );
@@ -1112,11 +1112,7 @@ void SlideShowImpl::displaySlide(
// precondition: must only be called from the main thread!
DBG_TESTSOLARMUTEX();
-#ifdef ENABLE_PRESENTER_EXTRA_UI
mxDrawPagesSupplier = xDrawPages;
-#else
- mxDrawPagesSupplier = NULL;
-#endif
stopShow(); // MUST call that: results in
// maUserEventQueue.clear(). What's more,
@@ -1620,6 +1616,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
// enable user paint
maUserPaintColor.reset( unoColor2RGBColor( nColor ) );
+ if( mpCurrentSlide && !mpCurrentSlide->isPaintOverlayActive() )
+ mpCurrentSlide->enablePaintOverlay();
+
maEventMultiplexer.notifyUserPaintColor( *maUserPaintColor );
}
else
@@ -1627,10 +1626,11 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
// disable user paint
maUserPaintColor.reset();
maEventMultiplexer.notifyUserPaintDisabled();
+ if( mpCurrentSlide )
+ mpCurrentSlide->disablePaintOverlay();
}
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
+ resetCursor();
return true;
}
@@ -1649,15 +1649,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
maEraseAllInk.reset( nEraseAllInk );
maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk );
}
- else
- {
- // disable user paint
- maEraseAllInk.reset();
- maEventMultiplexer.notifyUserPaintDisabled();
- }
-
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
return true;
}
@@ -1677,9 +1668,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
maEventMultiplexer.notifySwitchPenMode();
}
}
-
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
return true;
}
@@ -1699,8 +1687,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
}
}
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
return true;
}
@@ -1719,15 +1705,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
maEraseInk.reset( nEraseInk );
maEventMultiplexer.notifyEraseInkWidth( *maEraseInk );
}
- else
- {
- // disable user paint
- maEraseInk.reset();
- maEventMultiplexer.notifyUserPaintDisabled();
- }
-
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
return true;
}
@@ -1741,17 +1718,10 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
{
OSL_ENSURE( mbMouseVisible,"setProperty(): User paint overrides invisible mouse" );
// enable user paint stroke width
- maUserPaintStrokeWidth.reset( nWidth );
- maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth );
+ maUserPaintStrokeWidth = nWidth;
+ maEventMultiplexer.notifyUserPaintStrokeWidth( maUserPaintStrokeWidth );
}
- else
- {
- // disable user paint stroke width
- maUserPaintStrokeWidth.reset();
- maEventMultiplexer.notifyUserPaintDisabled();
- }
- if( mnCurrentCursor == awt::SystemPointer::ARROW )
- resetCursor();
+
return true;
}
@@ -2214,6 +2184,8 @@ void SlideShowImpl::notifySlideTransitionEnded( bool bPaintSlide )
"notifySlideTransitionEnded(): Invalid current slide" );
if (mpCurrentSlide)
{
+ mpCurrentSlide->update_settings( !!maUserPaintColor, maUserPaintColor ? *maUserPaintColor : RGBColor(), maUserPaintStrokeWidth );
+
// first init show, to give the animations
// the chance to register SlideStartEvents
const bool bBackgroundLayerRendered( !bPaintSlide );
diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx
index 9f4e6b8f5055..d457d8e16f88 100644
--- a/slideshow/source/inc/slide.hxx
+++ b/slideshow/source/inc/slide.hxx
@@ -121,9 +121,14 @@ namespace slideshow
///Draw the slide Polygons
virtual void drawPolygons() const = 0;
- ///Check if slide is already active
+ ///Check if paint overlay is already active
virtual bool isPaintOverlayActive() const = 0;
+ virtual void enablePaintOverlay() = 0;
+ virtual void disablePaintOverlay() = 0;
+
+ virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0;
+
// Slide bitmaps
// -------------------------------------------------------------------
diff --git a/slideshow/util/makefile.pmk b/slideshow/util/makefile.pmk
index 53724522d5e8..765b5249e5a4 100644
--- a/slideshow/util/makefile.pmk
+++ b/slideshow/util/makefile.pmk
@@ -35,7 +35,7 @@ CDEFS += -DBOOST_SP_ENABLE_DEBUG_HOOKS
.IF "$(COM)"=="MSC"
# disable inlining for MSVC
-CFLAGS += -Ob0
+#CFLAGS += -Ob0
.ENDIF
.ENDIF # "$(debug)"!="" || "$(DEBUG)"!=""
diff --git a/soldep/inc/soldep/soldlg.hxx b/soldep/inc/soldep/soldlg.hxx
index ef57908b6913..63423a97fdaf 100644
--- a/soldep/inc/soldep/soldlg.hxx
+++ b/soldep/inc/soldep/soldlg.hxx
@@ -28,7 +28,7 @@
#ifndef _FMRWRK_SOLDLG_HXX
#define _FMRWRK_SOLDLG_HXX
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/msgbox.hxx>
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
index 85a490af161b..ce459e176b77 100644
--- a/solenv/config/sdev300.ini
+++ b/solenv/config/sdev300.ini
@@ -662,7 +662,7 @@ unxlngi6
JDK14PATH %SOLAR_JDK14PATH%
JDK15PATH %SOLAR_JDK15PATH%
KDE_ROOT /so/env/kde/linux/kde-3.2.2
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxlngi6
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngi6
NO_BSYMBOLIC True
OJDK16PATH %SOLAR_OJDK16PATH%
OS LINUX
@@ -943,7 +943,7 @@ unxlngx6
JDK14PATH %SOLAR_JDK14PATH%
JDK15PATH %SOLAR_JDK15PATH%
KDE_ROOT /so/env/kde/linux-x64/kde-3.5.10
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxlngx6
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngx6
NO_BSYMBOLIC True
OJDK16PATH %SOLAR_OJDK16PATH%
OS LINUX
@@ -1238,7 +1238,7 @@ unxmacxi
JDK13PATH %SOLAR_JDK13PATH%
JDK14PATH %SOLAR_JDK15PATH%
JDK15PATH %SOLAR_JDK15PATH%
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxmacxi
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxmacxi
NO_BSYMBOLIC True
OS MACOSX
OUTPATH unxmacxi
@@ -1489,7 +1489,7 @@ unxsoli4
JDK13PATH %SOLAR_JDK13PATH%
JDK14PATH %SOLAR_JDK14PATH%
JDK15PATH %SOLAR_JDK15PATH%
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxsoli4
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsoli4
OJDK16PATH %SOLAR_OJDK16PATH%
OS SOLARIS
OUTPATH unxsoli4
@@ -1751,7 +1751,7 @@ unxsols4
JDK13PATH %SOLAR_JDK13PATH%
JDK14PATH %SOLAR_JDK14PATH%
JDK15PATH %SOLAR_JDK15PATH%
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxsols4
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsols4
LM_LICENSE_FILE %SOLAR_LICENSE_FILE%
OJDK16PATH %SOLAR_OJDK16PATH%
OS SOLARIS
@@ -2815,7 +2815,7 @@ wntmsci12
GUIBASE WIN
GVER NT351
INPATH wntmsci12%PROEXT%
- LIBMYSQL_PATH %SOLAR_ENV_ROOT%$/mysql-connector-c-6.0.2$/wntmsci12
+ LIBMYSQL_PATH %SOLARROOT%$/mysql-connector-c-6.0.2$/wntmsci12
MOZILLABUILD %SOLARROOT%/mozilla-build-1.3
OS WNT
OUTPATH wntmsci12
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 2d7495026400..b937ac7a35b5 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -211,21 +211,22 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCT
$(call gb_Output_announce,$*,$(true),RES,2)
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(dir $@) $(OUTDIR)/bin \
- $(dir $(call gb_ResTarget_get_imagelist_target,$(1))) && \
+ $(dir $(call gb_ResTarget_get_imagelist_target,$*)) && \
RESPONSEFILE=`$(gb_MKTEMP) $(gb_Helper_MISC)` && \
echo "-r -p \
-lg$(LANGUAGE) \
-fs=$@ \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE) \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE) \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/$(LIBRARY)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \
-lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \
-lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \
- -subMODULE=$(gb_ResTarget_DEFIMAGESLOCATION) \
+ -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \
-subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \
- -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$(1))) \
+ -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \
$(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \
$(gb_ResTarget_RSCCOMMAND) @$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE})
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 03ff66523835..933fc48c09d4 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -55,9 +55,11 @@ gb_LinkTarget_get_external_headers_target = $(WORKDIR)/ExternalHeaders/$(1)
gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1)
gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1)
gb_Module_get_target = $(WORKDIR)/Module/$(1)
+gb_NoexPrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d
gb_NoexPrecompiledHeader_get_target = $(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch
gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o
gb_Package_get_target = $(WORKDIR)/Package/$(1)
+gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d
gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch
gb_ResTarget_get_imagelist_target = $(WORKDIR)/ResTarget/$(1).ilst
gb_ResTarget_get_target = $(WORKDIR)/ResTarget/$(1).res
@@ -109,8 +111,6 @@ $(eval $(call gb_Helper_make_dep_targets,\
LinkTarget \
SrsPartTarget \
SrsTarget \
- PrecompiledHeader \
- NoexPrecompiledHeader \
))
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 230371907324..742d2aef82fc 100755
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -63,7 +63,7 @@ else # ifeq ($(CPUNAME),POWERPC)
gb_CPUDEFS := -DPOWERPC -DPPC
endif
-ifeq ($(SYSBASE), "")
+ifeq ($(strip $(SYSBASE)),)
gb_SDKDIR := /Developer/SDKs/MacOSX10.4u.sdk
else
gb_SDKDIR := $(SYSBASE)/MacOSX10.4u.sdk
@@ -274,7 +274,7 @@ gb_Library__FRAMEWORKS += \
gb_Library_PLAINLIBS_NONE += \
Cocoa \
- objc \
+ objc \
jpeg \
m \
pthread \
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 457f86e795ea..b2e4ab3b8b44 100755
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -53,16 +53,16 @@ gb_COMPILERDEFS := \
# -D$(CVER) \
# -DCVER=$(CVER) \
-ifeq ($(CPUNAME),INTEL)
-gb_CPUDEFS :=
-else # ifeq ($(CPUNAME),SPARC)
-gb_CPUDEFS := -D__sparcv8plus
+gb_CPUDEFS := -D$(CPUNAME)
+ifeq ($(CPUNAME),SPARC)
+gb_CPUDEFS += -D__sparcv8plus
endif
gb_CFLAGS := \
-temp=/tmp \
-KPIC \
-mt \
+ -xldscope=hidden \
-xCC \
-xc99=none \
@@ -70,6 +70,7 @@ gb_CXXFLAGS := \
-temp=/tmp \
-KPIC \
-mt \
+ -xldscope=hidden \
-features=no%altspell \
-library=no%Cstd \
+w2 \
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 678878c86663..108e841a72f4 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m96(Build:9560)
-BUILD=9560
-LAST_MINOR=m96
+RSCREVISION=300m97(Build:9566)
+BUILD=9566
+LAST_MINOR=m97
SOURCEVERSION=DEV300
diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk
index 77a348138e30..ce049a672d23 100644
--- a/solenv/inc/unxmacx.mk
+++ b/solenv/inc/unxmacx.mk
@@ -48,8 +48,9 @@ CDEFS+=-DX_LOCALE
# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
# http://developer.apple.com/technotes/tn2002/tn2064.html
-MACOSX_DEPLOYMENT_TARGET=10.4
-.EXPORT: MACOSX_DEPLOYMENT_TARGET
+# done in setsolar/configure now. left here for documentation
+#MACOSX_DEPLOYMENT_TARGET=10.4
+#.EXPORT: MACOSX_DEPLOYMENT_TARGET
CDEFS+=-DQUARTZ
EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
.ENDIF
diff --git a/solenv/src/reg-component.map b/solenv/src/reg-component.map
index ac2c3750bfe0..ac2c3750bfe0 100755..100644
--- a/solenv/src/reg-component.map
+++ b/solenv/src/reg-component.map
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 1b919471115c..1b919471115c 100755..100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
diff --git a/starmath/inc/toolbox.hxx b/starmath/inc/toolbox.hxx
index fcc1b046f2dd..fcc1b046f2dd 100755..100644
--- a/starmath/inc/toolbox.hxx
+++ b/starmath/inc/toolbox.hxx
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index d414d1e72309..0eae96d02328 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -244,7 +244,7 @@ protected:
const String& rText,
USHORT MaxWidth);
- virtual USHORT Print(SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0);
+ virtual USHORT Print(SfxProgress &rProgress, BOOL bIsAPI);
virtual SfxPrinter *GetPrinter(BOOL bCreate = FALSE);
virtual USHORT SetPrinter(SfxPrinter *pNewPrinter,
USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false);
diff --git a/starmath/sdi/smath.sdi b/starmath/sdi/smath.sdi
index 4b9eaedac599..4b9eaedac599 100755..100644
--- a/starmath/sdi/smath.sdi
+++ b/starmath/sdi/smath.sdi
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 69cecf25f308..69cecf25f308 100755..100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index a33ab14a98bf..a33ab14a98bf 100755..100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 243e16fb6504..53399212da97 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -78,7 +78,7 @@
#include <editeng/unolingu.hxx>
#include <ucbhelper/content.hxx>
#include <vcl/mapmod.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/sfx.hrc>
#include <document.hxx>
diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx
deleted file mode 100644
index bcb768fe600b..000000000000
--- a/starmath/source/math_pch.cxx
+++ /dev/null
@@ -1,833 +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_starmath.hxx"
-
-#define SMDLL 1
-
-#include "starmath.hrc"
-
-#define ITEMID_FONT 1
-#define ITEMID_FONTHEIGHT 2
-#define ITEMID_LRSPACE 3
-#define ITEMID_WEIGHT 4
-
-//--------- ab hier die "generierten"
-#include <tools/string.hxx>
-#include <tools/solar.h>
-#include <tools/list.hxx>
-#include <tools/contnr.hxx>
-#include <tools/rtti.hxx>
-#include <tools/ref.hxx>
-#include <tools/link.hxx>
-#include <svl/brdcst.hxx>
-#include <svl/svarray.hxx>
-#include <tools/debug.hxx>
-#include <svl/hint.hxx>
-#include <svl/smplhint.hxx>
-#include <sot/sotref.hxx>
-#include <tools/globname.hxx>
-#include <sot/factory.hxx>
-#include <vcl/sv.h>
-#include <basic/sbxdef.hxx>
-#include <tools/time.hxx>
-#include <tools/gen.hxx>
-#include <tools/stream.hxx>
-#include <tools/errinf.hxx>
-#include <tools/errcode.hxx>
-#include <sot/object.hxx>
-#include <sot/sotdata.hxx>
-#include <sfx2/shell.hxx>
-#include <sal/types.h>
-#include <sal/config.h>
-#include <tools/date.hxx>
-#include <tools/ownlist.hxx>
-#include <vcl/accel.hxx>
-#include <tools/resid.hxx>
-#include <tools/rc.hxx>
-#include <tools/rc.hxx>
-#include <i18npool/lang.h>
-#include <tools/resmgr.hxx>
-#include <vcl/keycod.hxx>
-#include <vcl/keycodes.hxx>
-#include <vcl/vclenum.hxx>
-#include <vcl/timer.hxx>
-#include <vcl/cmdevt.hxx>
-#include <vcl/font.hxx>
-#include <tools/color.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/region.hxx>
-#include <vcl/mapmod.hxx>
-#include <tools/fract.hxx>
-#include <vcl/wall.hxx>
-#include <vcl/settings.hxx>
-#include <vcl/bitmap.hxx>
-#include <vcl/pointr.hxx>
-#include <vcl/ptrstyle.hxx>
-#include <vcl/wintypes.hxx>
-#include <vcl/inputctx.hxx>
-#include <vcl/event.hxx>
-#include <format.hxx>
-#include <utility.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/image.hxx>
-#include <vcl/ctrl.hxx>
-#include <vcl/window.hxx>
-#include <sfx2/minarray.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/combobox.h>
-#include <vcl/edit.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/lstbox.h>
-#include <usr/guid.hxx>
-#include <usr/sequ.hxx>
-#include <uno/types.h>
-#include <uno/macros.h>
-#include <vos/xception.hxx>
-#include <osl/mutex.h>
-#include <tools/shl.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/imgdef.hxx>
-#include <usr/uno.hxx>
-#include <usr/xiface.hxx>
-#include <usr/ustring.hxx>
-#include <vos/refernce.hxx>
-#include <vos/types.hxx>
-#include <osl/types.h>
-#include <osl/interlck.h>
-#include <vos/object.hxx>
-#include <vos/macros.hxx>
-#include <smdll.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <chaos/cntids.hrc>
-#include <svl/cntwids.hrc>
-#include <svl/solar.hrc>
-#include <svl/lstner.hxx>
-#include <starmath.hrc>
-#include <basic/sbx.hxx>
-#include <basic/sbxform.hxx>
-#include <basic/sbxobj.hxx>
-#include <basic/sbxvar.hxx>
-#include <basic/sbxcore.hxx>
-#include <basic/sbxprop.hxx>
-#include <basic/sbxmeth.hxx>
-#include <tools/unqid.hxx>
-#include <tools/unqidx.hxx>
-#include <svl/poolitem.hxx>
-#include <svtools/args.hxx>
-#include <smmod.hxx>
-#include <vos/thread.hxx>
-#include <osl/thread.h>
-#include <vos/runnable.hxx>
-#include <vcl/apptypes.hxx>
-#include <tools/dynary.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/timer.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/sfx.hrc>
-#include <svl/memberid.hrc>
-#include <vcl/syswin.hxx>
-#include <vcl/virdev.hxx>
-#include <tools/datetime.hxx>
-#include <tools/wldcrd.hxx>
-#include <parse.hxx>
-#include <tools/stack.hxx>
-#include <types.hxx>
-#include <config.hxx>
-#include <svtools/confitem.hxx>
-#include <tools/poly.hxx>
-#include <svx/xpoly.hxx>
-#include <rect.hxx>
-#include <vcl/outdev.hxx>
-#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HXX_
-#include <smart/com/sun/star/frame/XDispatchProviderInterceptor.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCH_HXX_
-#include <smart/com/sun/star/frame/XDispatch.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HXX_
-#include <smart/com/sun/star/frame/XDispatchProvider.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XSTATUSLISTENER_HXX_
-#include <smart/com/sun/star/frame/XStatusListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HXX_
-#include <smart/com/sun/star/frame/FrameSearchFlag.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HXX_
-#include <smart/com/sun/star/frame/XDispatchProviderInterception.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HXX_
-#include <smart/com/sun/star/frame/FeatureStateEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HXX_
-#include <smart/com/sun/star/frame/DispatchDescriptor.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HXX_
-#include <smart/com/sun/star/frame/XFrameActionListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HXX_
-#include <smart/com/sun/star/frame/XComponentLoader.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XFRAME_HXX_
-#include <smart/com/sun/star/frame/XFrame.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HXX_
-#include <smart/com/sun/star/frame/FrameActionEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMEACTION_HXX_
-#include <smart/com/sun/star/frame/FrameAction.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_UTIL_XURLTRANSFORMER_HXX_
-#include <smart/com/sun/star/util/XURLTransformer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HXX_
-#include <smart/com/sun/star/task/XStatusIndicatorFactory.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HXX_
-#include <smart/com/sun/star/task/XStatusIndicatorSupplier.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATOR_HXX_
-#include <smart/com/sun/star/task/XStatusIndicator.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_FRAME_XBROWSEHISTORYREGISTRY_HXX_
-#include <smart/com/sun/star/frame/XBrowseHistoryRegistry.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_IO_BUFFERSIZEEXCEEDEDEXCEPTION_HXX_
-#include <smart/com/sun/star/io/BufferSizeExceededException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_IO_NOTCONNECTEDEXCEPTION_HXX_
-#include <smart/com/sun/star/io/NotConnectedException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_IO_IOEXCEPTION_HXX_
-#include <smart/com/sun/star/io/IOException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_IO_UNEXPECTEDEOFEXCEPTION_HXX_
-#include <smart/com/sun/star/io/UnexpectedEOFException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_IO_WRONGFORMATEXCEPTION_HXX_
-#include <smart/com/sun/star/io/WrongFormatException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/ServiceNotRegisteredException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_NULLPOINTEREXCEPTION_HXX_
-#include <smart/com/sun/star/lang/NullPointerException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_CLASSNOTFOUNDEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/ClassNotFoundException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_NOSUCHMETHODEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/NoSuchMethodException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_SECURITYEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/SecurityException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_NOSUCHFIELDEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/NoSuchFieldException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/DisposedException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_ARRAYINDEXOUTOFBOUNDSEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/ArrayIndexOutOfBoundsException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_ILLEGALACCESSEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/IllegalAccessException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/IndexOutOfBoundsException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/IllegalArgumentException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_NOSUPPORTEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/NoSupportException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/WrappedTargetException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_PARAMINFO_HXX_
-#include <smart/com/sun/star/reflection/ParamInfo.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLARRAY_HXX_
-#include <smart/com/sun/star/reflection/XIdlArray.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLCLASSPROVIDER_HXX_
-#include <smart/com/sun/star/reflection/XIdlClassProvider.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_FIELDACCESSMODE_HXX_
-#include <smart/com/sun/star/reflection/FieldAccessMode.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLCLASS_HXX_
-#include <smart/com/sun/star/reflection/XIdlClass.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLFIELD_HXX_
-#include <smart/com/sun/star/reflection/XIdlField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_PARAMMODE_HXX_
-#include <smart/com/sun/star/reflection/ParamMode.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_METHODMODE_HXX_
-#include <smart/com/sun/star/reflection/MethodMode.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLMEMBER_HXX_
-#include <smart/com/sun/star/reflection/XIdlMember.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLREFLECTION_HXX_
-#include <smart/com/sun/star/reflection/XIdlReflection.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLMETHOD_HXX_
-#include <smart/com/sun/star/reflection/XIdlMethod.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_REFLECTION_INVOCATIONTARGETEXCEPTION_HXX_
-#include <smart/com/sun/star/reflection/InvocationTargetException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVALUES_HXX_
-#include <smart/com/sun/star/beans/PropertyValues.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSET_HXX_
-#include <smart/com/sun/star/beans/XPropertySet.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_
-#include <smart/com/sun/star/beans/PropertyValue.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYSTATE_HXX_
-#include <smart/com/sun/star/beans/PropertyState.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HXX_
-#include <smart/com/sun/star/beans/XPropertySetInfo.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HXX_
-#include <smart/com/sun/star/beans/XMultiPropertySet.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HXX_
-#include <smart/com/sun/star/beans/XFastPropertySet.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HXX_
-#include <smart/com/sun/star/beans/XVetoableChangeListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSTATE_HXX_
-#include <smart/com/sun/star/beans/XPropertyState.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HXX_
-#include <smart/com/sun/star/beans/XPropertyStateChangeListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
-#include <smart/com/sun/star/beans/PropertyAttribute.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HXX_
-#include <smart/com/sun/star/beans/XPropertiesChangeListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HXX_
-#include <smart/com/sun/star/beans/XPropertyChangeListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYACCESS_HXX_
-#include <smart/com/sun/star/beans/XPropertyAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HXX_
-#include <smart/com/sun/star/beans/XPropertyContainer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HXX_
-#include <smart/com/sun/star/beans/PropertyStateChangeEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HXX_
-#include <smart/com/sun/star/beans/PropertyChangeEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_UNKNOWNPROPERTYEXCEPTION_HXX_
-#include <smart/com/sun/star/beans/UnknownPropertyException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_INTROSPECTIONEXCEPTION_HXX_
-#include <smart/com/sun/star/beans/IntrospectionException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYEXISTEXCEPTION_HXX_
-#include <smart/com/sun/star/beans/PropertyExistException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_ILLEGALTYPEEXCEPTION_HXX_
-#include <smart/com/sun/star/beans/IllegalTypeException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVETOEXCEPTION_HXX_
-#include <smart/com/sun/star/beans/PropertyVetoException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HXX_
-#include <smart/com/sun/star/container/XEnumerationAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HXX_
-#include <smart/com/sun/star/container/XHierarchicalNameAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HXX_
-#include <smart/com/sun/star/container/XNameAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HXX_
-#include <smart/com/sun/star/container/XContentEnumerationAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XENUMERATION_HXX_
-#include <smart/com/sun/star/container/XEnumeration.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XELEMENTACCESS_HXX_
-#include <smart/com/sun/star/container/XElementAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XINDEXACCESS_HXX_
-#include <smart/com/sun/star/container/XIndexAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_XEVENTLISTENER_HXX_
-#include <smart/com/sun/star/lang/XEventListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_EVENTOBJECT_HXX_
-#include <smart/com/sun/star/lang/EventObject.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_SCRIPT_XALLLISTENERADAPTERSERVICE_HXX_
-#include <smart/com/sun/star/script/XAllListenerAdapterService.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_SCRIPT_XALLLISTENER_HXX_
-#include <smart/com/sun/star/script/XAllListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_SCRIPT_ALLEVENTOBJECT_HXX_
-#include <smart/com/sun/star/script/AllEventObject.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCOMPONENTENUMERATION_HXX_
-#include <smart/com/sun/star/container/XComponentEnumeration.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_XCOMPONENT_HXX_
-#include <smart/com/sun/star/lang/XComponent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCOMPONENTENUMERATIONACCESS_HXX_
-#include <smart/com/sun/star/container/XComponentEnumerationAccess.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_LISTENEREXISTEXCEPTION_HXX_
-#include <smart/com/sun/star/lang/ListenerExistException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_ELEMENTEXISTEXCEPTION_HXX_
-#include <smart/com/sun/star/container/ElementExistException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_LANG_INVALIDLISTENEREXCEPTION_HXX_
-#include <smart/com/sun/star/lang/InvalidListenerException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HXX_
-#include <smart/com/sun/star/container/NoSuchElementException.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XKEYLISTENER_HXX_
-#include <smart/com/sun/star/awt/XKeyListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XPAINTLISTENER_HXX_
-#include <smart/com/sun/star/awt/XPaintListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_KEYEVENT_HXX_
-#include <smart/com/sun/star/awt/KeyEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_KEYMODIFIER_HXX_
-#include <smart/com/sun/star/awt/KeyModifier.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XMOUSEMOTIONLISTENER_HXX_
-#include <smart/com/sun/star/awt/XMouseMotionListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FOCUSEVENT_HXX_
-#include <smart/com/sun/star/awt/FocusEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOWLISTENER_HXX_
-#include <smart/com/sun/star/awt/XWindowListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XACTIVATELISTENER_HXX_
-#include <smart/com/sun/star/awt/XActivateListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_MOUSEEVENT_HXX_
-#include <smart/com/sun/star/awt/MouseEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTOPWINDOWLISTENER_HXX_
-#include <smart/com/sun/star/awt/XTopWindowListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_PAINTEVENT_HXX_
-#include <smart/com/sun/star/awt/PaintEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_INPUTEVENT_HXX_
-#include <smart/com/sun/star/awt/InputEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_KEYGROUP_HXX_
-#include <smart/com/sun/star/awt/KeyGroup.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_KEY_HXX_
-#include <smart/com/sun/star/awt/Key.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWEVENT_HXX_
-#include <smart/com/sun/star/awt/WindowEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XMOUSELISTENER_HXX_
-#include <smart/com/sun/star/awt/XMouseListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_KEYFUNCTION_HXX_
-#include <smart/com/sun/star/awt/KeyFunction.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FOCUSCHANGEREASON_HXX_
-#include <smart/com/sun/star/awt/FocusChangeReason.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_MOUSEBUTTON_HXX_
-#include <smart/com/sun/star/awt/MouseButton.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XFOCUSLISTENER_HXX_
-#include <smart/com/sun/star/awt/XFocusListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XADJUSTMENTLISTENER_HXX_
-#include <smart/com/sun/star/awt/XAdjustmentListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XACTIONLISTENER_HXX_
-#include <smart/com/sun/star/awt/XActionListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTLISTENER_HXX_
-#include <smart/com/sun/star/awt/XTextListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XSPINLISTENER_HXX_
-#include <smart/com/sun/star/awt/XSpinListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XITEMLISTENER_HXX_
-#include <smart/com/sun/star/awt/XItemListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINERLISTENER_HXX_
-#include <smart/com/sun/star/awt/XVclContainerListener.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XFILEDIALOG_HXX_
-#include <smart/com/sun/star/awt/XFileDialog.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTCOMPONENT_HXX_
-#include <smart/com/sun/star/awt/XTextComponent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XLISTBOX_HXX_
-#include <smart/com/sun/star/awt/XListBox.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XPROGRESSMONITOR_HXX_
-#include <smart/com/sun/star/awt/XProgressMonitor.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_TEXTALIGN_HXX_
-#include <smart/com/sun/star/awt/TextAlign.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XSCROLLBAR_HXX_
-#include <smart/com/sun/star/awt/XScrollBar.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINERPEER_HXX_
-#include <smart/com/sun/star/awt/XVclContainerPeer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTABCONTROLLERMODEL_HXX_
-#include <smart/com/sun/star/awt/XTabControllerModel.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XMESSAGEBOX_HXX_
-#include <smart/com/sun/star/awt/XMessageBox.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTEDITFIELD_HXX_
-#include <smart/com/sun/star/awt/XTextEditField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_STYLE_HXX_
-#include <smart/com/sun/star/awt/Style.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTIMEFIELD_HXX_
-#include <smart/com/sun/star/awt/XTimeField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XVCLWINDOWPEER_HXX_
-#include <smart/com/sun/star/awt/XVclWindowPeer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROLMODEL_HXX_
-#include <smart/com/sun/star/awt/XControlModel.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XSPINFIELD_HXX_
-#include <smart/com/sun/star/awt/XSpinField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XUNOCONTROLCONTAINER_HXX_
-#include <smart/com/sun/star/awt/XUnoControlContainer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTLAYOUTCONSTRAINS_HXX_
-#include <smart/com/sun/star/awt/XTextLayoutConstrains.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XNUMERICFIELD_HXX_
-#include <smart/com/sun/star/awt/XNumericField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XBUTTON_HXX_
-#include <smart/com/sun/star/awt/XButton.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTAREA_HXX_
-#include <smart/com/sun/star/awt/XTextArea.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XIMAGEBUTTON_HXX_
-#include <smart/com/sun/star/awt/XImageButton.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XFIXEDTEXT_HXX_
-#include <smart/com/sun/star/awt/XFixedText.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROLCONTAINER_HXX_
-#include <smart/com/sun/star/awt/XControlContainer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XDIALOG_HXX_
-#include <smart/com/sun/star/awt/XDialog.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SCROLLBARORIENTATION_HXX_
-#include <smart/com/sun/star/awt/ScrollBarOrientation.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XRADIOBUTTON_HXX_
-#include <smart/com/sun/star/awt/XRadioButton.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCURRENCYFIELD_HXX_
-#include <smart/com/sun/star/awt/XCurrencyField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XPATTERNFIELD_HXX_
-#include <smart/com/sun/star/awt/XPatternField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_VCLWINDOWPEERATTRIBUTE_HXX_
-#include <smart/com/sun/star/awt/VclWindowPeerAttribute.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTABCONTROLLER_HXX_
-#include <smart/com/sun/star/awt/XTabController.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINER_HXX_
-#include <smart/com/sun/star/awt/XVclContainer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XDATEFIELD_HXX_
-#include <smart/com/sun/star/awt/XDateField.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCOMBOBOX_HXX_
-#include <smart/com/sun/star/awt/XComboBox.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROL_HXX_
-#include <smart/com/sun/star/awt/XControl.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XCHECKBOX_HXX_
-#include <smart/com/sun/star/awt/XCheckBox.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_MESSAGEBOXCOMMAND_HXX_
-#include <smart/com/sun/star/awt/MessageBoxCommand.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XLAYOUTCONSTRAINS_HXX_
-#include <smart/com/sun/star/awt/XLayoutConstrains.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XPROGRESSBAR_HXX_
-#include <smart/com/sun/star/awt/XProgressBar.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SIMPLEFONTMETRIC_HXX_
-#include <smart/com/sun/star/awt/SimpleFontMetric.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTWEIGHT_HXX_
-#include <smart/com/sun/star/awt/FontWeight.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTSLANT_HXX_
-#include <smart/com/sun/star/awt/FontSlant.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_CHARSET_HXX_
-#include <smart/com/sun/star/awt/CharSet.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTDESCRIPTOR_HXX_
-#include <smart/com/sun/star/awt/FontDescriptor.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTWIDTH_HXX_
-#include <smart/com/sun/star/awt/FontWidth.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XFONT_HXX_
-#include <smart/com/sun/star/awt/XFont.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTTYPE_HXX_
-#include <smart/com/sun/star/awt/FontType.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTUNDERLINE_HXX_
-#include <smart/com/sun/star/awt/FontUnderline.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTSTRIKEOUT_HXX_
-#include <smart/com/sun/star/awt/FontStrikeout.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTFAMILY_HXX_
-#include <smart/com/sun/star/awt/FontFamily.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_FONTPITCH_HXX_
-#include <smart/com/sun/star/awt/FontPitch.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTOPWINDOW_HXX_
-#include <smart/com/sun/star/awt/XTopWindow.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOW_HXX_
-#include <smart/com/sun/star/awt/XWindow.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_POSSIZE_HXX_
-#include <smart/com/sun/star/awt/PosSize.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_VCLCONTAINEREVENT_HXX_
-#include <smart/com/sun/star/awt/VclContainerEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_ITEMEVENT_HXX_
-#include <smart/com/sun/star/awt/ItemEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SPINEVENT_HXX_
-#include <smart/com/sun/star/awt/SpinEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_TEXTEVENT_HXX_
-#include <smart/com/sun/star/awt/TextEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_ADJUSTMENTTYPE_HXX_
-#include <smart/com/sun/star/awt/AdjustmentType.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_ACTIONEVENT_HXX_
-#include <smart/com/sun/star/awt/ActionEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_ADJUSTMENTEVENT_HXX_
-#include <smart/com/sun/star/awt/AdjustmentEvent.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_RECTANGLE_HXX_
-#include <smart/com/sun/star/awt/Rectangle.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SELECTION_HXX_
-#include <smart/com/sun/star/awt/Selection.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SIZE_HXX_
-#include <smart/com/sun/star/awt/Size.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWDESCRIPTOR_HXX_
-#include <smart/com/sun/star/awt/WindowDescriptor.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_INVALIDATESTYLE_HXX_
-#include <smart/com/sun/star/awt/InvalidateStyle.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XTOOLKIT_HXX_
-#include <smart/com/sun/star/awt/XToolkit.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOWPEER_HXX_
-#include <smart/com/sun/star/awt/XWindowPeer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWCLASS_HXX_
-#include <smart/com/sun/star/awt/WindowClass.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XSYSTEMDEPENDENTWINDOWPEER_HXX_
-#include <smart/com/sun/star/awt/XSystemDependentWindowPeer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWATTRIBUTE_HXX_
-#include <smart/com/sun/star/awt/WindowAttribute.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XPOINTER_HXX_
-#include <smart/com/sun/star/awt/XPointer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_SYSTEMPOINTER_HXX_
-#include <smart/com/sun/star/awt/SystemPointer.hxx>
-#endif
-#ifndef _SMART_COM_SUN_STAR_AWT_XVIEW_HXX_
-#include <smart/com/sun/star/awt/XView.hxx>
-#endif
-#include <usr/refl.hxx>
-#include <sfx2/msg.hxx>
-#include <svl/itemset.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <vcl/floatwin.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/window.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/frame.hxx>
-#include <sfx2/objface.hxx>
-#include <vcl/event.hxx>
-#include <svl/eitem.hxx>
-#include <svl/intitem.hxx>
-#include <symbol.hxx>
-#include <svl/itempool.hxx>
-#include <vcl/image.hxx>
-#include <vcl/metric.hxx>
-#include <sfx2/inimgr.hxx>
-#include <node.hxx>
-#include <tools/pstm.hxx>
-#include <tools/table.hxx>
-#include <sfx2/docfac.hxx>
-#include <svl/ownlist.hxx>
-#include <sfx2/objsh.hxx>
-#include <svl/stritem.hxx>
-#include <vcl/mapmod.hxx>
-#include <sfx2/ipfrm.hxx>
-#include <vcl/dialog.hxx>
-#include <sfx2/dispatch.hxx>
-#include <svl/svstdarr.hxx>
-#include <sfx2/bindings.hxx>
-#include <dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/symbol.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <vcl/button.hxx>
-#include <vcl/tabdlg.hxx>
-#include <vcl/tabpage.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/group.hxx>
-#include <svx/optgenrl.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/group.hxx>
-#include <document.hxx>
-#include <vcl/field.hxx>
-#include <vcl/spinfld.hxx>
-#include <vcl/menubtn.hxx>
-#include <vcl/scrbar.hxx>
-#include <svtools/ctrlbox.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/field.hxx>
-#include <svtools/ctrltool.hxx>
-#include <sfx2/interno.hxx>
-#include <sfx2/sfxdefs.hxx>
-#include <sfx2/childwin.hxx>
-#include <sfx2/chalign.hxx>
-#include <vcl/floatwin.hxx>
-#include <sot/storage.hxx>
-#include <rsc/rscsfx.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/btndlg.hxx>
-#include <uno/uno.h>
-#include <uno/string.h>
-#include <uno/sequence.h>
-#include <uno/any.h>
-#include <uno/exceptn.h>
-#include <uno/intrface.h>
-#include <uno/factory.h>
-#include <uno/api.h>
-#include <svx/svxids.hrc>
-#include <view.hxx>
-#include <sfx2/dockwin.hxx>
-#include <vcl/dockwin.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/clientsh.hxx>
-#include <svtools/scrwin.hxx>
-#include <vcl/scrbar.hxx>
-#include <sfx2/ctrlitem.hxx>
-#include <sfx2/viewfac.hxx>
-#include <edit.hxx>
-#include <editeng/editdata.hxx>
-#include <toolbox.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/dockwin.hxx>
-#include <smslots.hxx>
-#include <svl/undo.hxx>
-#include <sfx2/request.hxx>
-#include <svl/whiter.hxx>
-#include <vcl/prntypes.hxx>
-#include <vcl/jobset.hxx>
-#include <vcl/gdimtf.hxx>
-#include <sot/exchange.hxx>
-#include <vcl/wrkwin.hxx>
-#include <tools/sstring.hxx>
-#include <action.hxx>
-#include <sfx2/filedlg.hxx>
-#include <sfx2/iodlg.hxx>
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index bef6d0bec106..601472b62f5a 100644..100755
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -1755,18 +1755,12 @@ StringArray RID_PRINTUIOPTIONS
< "%PRODUCTNAME %s"; >;
< "Contents"; >;
< "~Title"; >;
- < "Specifies whether you want the name of the document to be included in the printout"; >;
< "~Formula text"; >;
- < "Specifies whether to include the contents of the 'Commands' window at the bottom of the printout."; >;
< "B~orders"; >;
- < "Applies a thin border to the formula area in the printout."; >;
< "Size"; >;
< "O~riginal size"; >;
- < "Prints the formula without adjusting the current font size."; >;
< "Fit to ~page"; >;
- < "Adjusts the formula to the page format used in the printout."; >;
< "~Scaling"; >;
- < "Reduces or enlarges the size of the printed formula by a specified enlargement factor."; >;
};
};
diff --git a/starmath/source/toolbox.hrc b/starmath/source/toolbox.hrc
index 29adff303a3e..29adff303a3e 100755..100644
--- a/starmath/source/toolbox.hrc
+++ b/starmath/source/toolbox.hrc
diff --git a/starmath/source/toolbox.src b/starmath/source/toolbox.src
index ead1b32810c3..ead1b32810c3 100755..100644
--- a/starmath/source/toolbox.src
+++ b/starmath/source/toolbox.src
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 108cb9c69e4a..6520f9e8acf7 100755
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -81,8 +81,8 @@ using namespace ::com::sun::star::script;
SmPrintUIOptions::SmPrintUIOptions()
{
ResStringArray aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) );
- DBG_ASSERT( aLocalizedStrings.Count() >= 15, "resource incomplete" );
- if( aLocalizedStrings.Count() < 15 ) // bad resource ?
+ DBG_ASSERT( aLocalizedStrings.Count() >= 9, "resource incomplete" );
+ if( aLocalizedStrings.Count() < 9 ) // bad resource ?
return;
SmModule *pp = SM_MOD();
@@ -100,42 +100,42 @@ SmPrintUIOptions::SmPrintUIOptions()
String aAppGroupname( aLocalizedStrings.GetString( 0 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aOpt.GetModuleName( SvtModuleOptions::E_SMATH ) );
- m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
// create subgroup for print options
m_aUIProperties[1].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() );
// create a bool option for title row (matches to SID_PRINTTITLE)
m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ),
- aLocalizedStrings.GetString( 3 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TitleRow:CheckBox" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_TITLE_ROW ) ),
pConfig->IsPrintTitle() );
// create a bool option for formula text (matches to SID_PRINTTEXT)
- m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
- aLocalizedStrings.GetString( 5 ),
+ m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:FormulaText:CheckBox" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_FORMULA_TEXT ) ),
pConfig->IsPrintFormulaText() );
// create a bool option for border (matches to SID_PRINTFRAME)
- m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
- aLocalizedStrings.GetString( 7 ),
+ m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Border:CheckBox" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_BORDER ) ),
pConfig->IsPrintFrame() );
// create subgroup for print format
- m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 8 ), rtl::OUString() );
+ m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 5 ), rtl::OUString() );
// create a radio button group for print format (matches to SID_PRINTSIZE)
Sequence< rtl::OUString > aChoices( 3 );
- aChoices[0] = aLocalizedStrings.GetString( 9 );
- aChoices[1] = aLocalizedStrings.GetString( 11 );
- aChoices[2] = aLocalizedStrings.GetString( 13 );
- Sequence< rtl::OUString > aHelpTexts( 3 );
- aHelpTexts[0] = aLocalizedStrings.GetString( 10 );
- aHelpTexts[1] = aLocalizedStrings.GetString( 12 );
- aHelpTexts[2] = aLocalizedStrings.GetString( 14 );
+ aChoices[0] = aLocalizedStrings.GetString( 6 );
+ aChoices[1] = aLocalizedStrings.GetString( 7 );
+ aChoices[2] = aLocalizedStrings.GetString( 8 );
+ Sequence< rtl::OUString > aHelpIds( 3 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1" ) );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2" ) );
OUString aPrintFormatProp( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_FORMAT ) );
m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
aPrintFormatProp,
aChoices, static_cast< sal_Int32 >(pConfig->GetPrintSize())
);
@@ -143,7 +143,7 @@ SmPrintUIOptions::SmPrintUIOptions()
// create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM)
vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, sal_True );
m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(),
- aLocalizedStrings.GetString( 14 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintScale:NumericField" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_SCALE ) ),
pConfig->GetPrintZoomFactor(), // initial value
10, // min value
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 748e62e3536e..ad9ff8e618f0 100755
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1156,7 +1156,7 @@ void SmViewShell::Impl_Print(
rOutDev.Pop();
}
-USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog * /*pPrintDialog*/)
+USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/)
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::Print" );
DBG_ASSERT( 0, "SmViewShell::Print: no longer used with new UI print dialog. Should be removed!!" );
diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml
index 7c82d733fa70..7c82d733fa70 100755..100644
--- a/starmath/uiconfig/smath/menubar/menubar.xml
+++ b/starmath/uiconfig/smath/menubar/menubar.xml
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 9c6b71bc6c83..9c6b71bc6c83 100755..100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
diff --git a/svtools/AllLangResTarget_svt.mk b/svtools/AllLangResTarget_svt.mk
index 511cdb4ed13e..ab0895dea07f 100644
--- a/svtools/AllLangResTarget_svt.mk
+++ b/svtools/AllLangResTarget_svt.mk
@@ -57,7 +57,6 @@ $(eval $(call gb_SrsTarget_add_files,svt/res,\
svtools/source/dialogs/colrdlg.src \
svtools/source/dialogs/filedlg2.src \
svtools/source/dialogs/formats.src \
- svtools/source/dialogs/printdlg.src \
svtools/source/dialogs/prnsetup.src \
svtools/source/dialogs/so3res.src \
svtools/source/dialogs/wizardmachine.src \
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 545690bd0f12..80226851dd6a 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -159,7 +159,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/dialogs/filedlg2 \
svtools/source/dialogs/insdlg \
svtools/source/dialogs/mcvmath \
- svtools/source/dialogs/printdlg \
svtools/source/dialogs/prnsetup \
svtools/source/dialogs/property \
svtools/source/dialogs/roadmapwizard \
diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk
index ef656f9ba061..f6a48e845679 100644
--- a/svtools/Package_inc.mk
+++ b/svtools/Package_inc.mk
@@ -113,7 +113,6 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/parrtf.hxx,svtools/par
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupmenucontrollerbase.hxx,svtools/popupmenucontrollerbase.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupwindowcontroller.hxx,svtools/popupwindowcontroller.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prgsbar.hxx,svtools/prgsbar.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printdlg.hxx,svtools/printdlg.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printoptions.hxx,svtools/printoptions.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prnsetup.hxx,svtools/prnsetup.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/roadmap.hxx,svtools/roadmap.hxx))
diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx
index ddedfc5a0369..ebabe33af690 100644
--- a/svtools/inc/pch/precompiled_svtools.hxx
+++ b/svtools/inc/pch/precompiled_svtools.hxx
@@ -419,8 +419,8 @@
#include <unotools/processfactory.hxx>
#include <vcl/dndhelp.hxx>
-#include <vcl/fldunit.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/unohelp.hxx>
#include <vos/mutex.hxx>
diff --git a/svtools/inc/svtools/apearcfg.hxx b/svtools/inc/svtools/apearcfg.hxx
index 8e6018424c4c..5dea74761e17 100644
--- a/svtools/inc/svtools/apearcfg.hxx
+++ b/svtools/inc/svtools/apearcfg.hxx
@@ -37,14 +37,6 @@ class Application;
Beschreibung:
--------------------------------------------------------------------*/
typedef enum {
- LookStardivision = 0,
- LookMotif,
- LookWindows,
- LookOSTwo,
- LookMacintosh
-} SystemLook;
-
-typedef enum {
SnapToButton = 0,
SnapToMiddle,
NoSnap
@@ -59,7 +51,6 @@ typedef enum { // MUST match the order chosen in ListBox LB_DRAG_MODE in optgdlg
class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
{
- short nLookNFeel ;
short nDragMode ;
short nScaleFactor ;
short nSnapMode ;
@@ -69,8 +60,6 @@ class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
#endif
BOOL bMenuMouseFollow ;
- BOOL bSingleLineTabCtrl ;
- BOOL bColoredTabCtrl ;
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
BOOL bFontAntialiasing ;
#endif
@@ -86,9 +75,6 @@ public:
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
- USHORT GetLookNFeel () const { return nLookNFeel; }
- void SetLookNFeel ( USHORT nSet );
-
USHORT GetDragMode () const { return nDragMode; }
void SetDragMode ( USHORT nSet );
@@ -106,9 +92,6 @@ public:
void SetMenuMouseFollow(BOOL bSet) {bMenuMouseFollow = bSet; SetModified();}
BOOL IsMenuMouseFollow() const{return bMenuMouseFollow;}
- void SetSingleLineTabCtrl(BOOL bSet) {bSingleLineTabCtrl = bSet; SetModified();}
- BOOL IsSingleLineTabCtrl()const {return bSingleLineTabCtrl;}
-
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
void SetFontAntiAliasing( BOOL bSet ) { bFontAntialiasing = bSet; SetModified(); }
BOOL IsFontAntiAliasing() const { return bFontAntialiasing; }
@@ -117,9 +100,6 @@ public:
void SetFontAntialiasingMinPixelHeight( USHORT _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); }
#endif
- void SetColoredTabCtrl(BOOL bSet) {bColoredTabCtrl = bSet; SetModified();};
- BOOL IsColoredTabCtrl()const {return bColoredTabCtrl;}
-
static sal_Bool IsInitialized() { return bInitialized; }
static void SetInitialized() { bInitialized = sal_True; }
};
diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index 098b565385ec..bc9770c1bcc8 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -34,9 +34,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <vcl/graph.hxx>
-#ifndef _SV_MAPUNIT_HXX
-#include <vcl/mapunit.hxx>
-#endif
+#include <tools/mapunit.hxx>
#include <rtl/ustring.hxx>
#define NS_UNO ::com::sun::star::uno
diff --git a/svtools/inc/svtools/printdlg.hxx b/svtools/inc/svtools/printdlg.hxx
deleted file mode 100644
index 8c455b910b41..000000000000
--- a/svtools/inc/svtools/printdlg.hxx
+++ /dev/null
@@ -1,297 +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 _SV_PRINTDLG_HXX_
-#define _SV_PRINTDLG_HXX_
-
-#include "svtools/svtdllapi.h"
-
-#ifndef _VCL_DIALOG_HXX
-#include <vcl/dialog.hxx>
-#endif
-#ifndef _VCL_FIXED_HXX
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _VCL_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#ifndef _VCL_GROUP_HXX
-#include <vcl/group.hxx>
-#endif
-#ifndef _VCL_FIELD_HXX
-#include <vcl/field.hxx>
-#endif
-#ifndef _VCL_EDIT_HXX
-#include <vcl/edit.hxx>
-#endif
-#ifndef _VCL_LSTBOX_HXX
-#include <vcl/lstbox.hxx>
-#endif
-#include <svtools/stdctrl.hxx>
-
-class Printer;
-class QueueInfo;
-struct SvtPrinterImpl;
-
-// ---------------------
-// - PrintDialog-Types -
-// ---------------------
-
-enum PrintDialogRange{
- PRINTDIALOG_ALL, PRINTDIALOG_SELECTION, PRINTDIALOG_FROMTO, PRINTDIALOG_RANGE };
-
-enum PrintSheetRange
-{
- PRINTSHEETS_ALL,
- PRINTSHEETS_SELECTED_SHEETS,
- PRINTSHEETS_SELECTED_CELLS
-};
-
-
-// ---------------
-// - PrintDialog -
-// ---------------
-
-class SVT_DLLPUBLIC PrintDialog : public ModalDialog
-{
-private:
- FixedLine maFlPrinter;
- FixedText maFtName;
- ListBox maLbName;
- PushButton maBtnProperties;
- FixedText maFtStatus;
- FixedInfo maFiStatus;
- FixedText maFtType;
- FixedInfo maFiType;
- FixedText maFtLocation;
- FixedInfo maFiLocation;
- FixedText maFtComment;
- FixedInfo maFiComment;
-
- // "Print to file" or "Fax number"
- CheckBox maCbxFilePrint;
- FixedInfo maFiPrintFile;
- FixedText maFiFaxNo;
- Edit maEdtFaxNo;
- //PushButton maBtnBrowse_nomore;
-
- // "Print"
- FixedLine maFlPrint;
- RadioButton maRbtAllSheets;
- RadioButton maRbtSelectedSheets;
- RadioButton maRbtSelectedCells;
-
- // "Print range"
- FixedLine maFlPrintRange;
- RadioButton maRbtAll;
- RadioButton maRbtPages;
- RadioButton maRbtSelection;
- Edit maEdtPages;
-
- FixedLine maFlSepCopiesRange;
-
- // "Copies"
- FixedLine maFlCopies;
- FixedText maFtCopies;
- NumericField maNumCopies;
- FixedImage maImgCollate;
- FixedImage maImgNotCollate;
- CheckBox maCbxCollate;
-
- FixedLine maFlSepButtonLine;
- PushButton maBtnOptions;
- OKButton maBtnOK;
- CancelButton maBtnCancel;
- HelpButton maBtnHelp;
-
- AutoTimer maStatusTimer;
- Printer* mpPrinter;
- SvtPrinterImpl* mpPrinterImpl;
-
- XubString maRangeText;
- USHORT mnCopyCount;
- USHORT mnFirstPage;
- USHORT mnLastPage;
- USHORT mnMinPage;
- USHORT mnMaxPage;
- PrintDialogRange meCheckRange;
- BOOL mbAll;
- BOOL mbSelection;
- BOOL mbFromTo;
- BOOL mbRange;
- BOOL mbCollate;
- BOOL mbCollateCheck;
- BOOL mbOptions;
- bool mbWithSheetsAndCells;
- Link maOptionsHdlLink; // Link zum Options-Handler
- Link maOKHdlLink; // Link zum OK-Handler
-
- String maAllFilterStr;
-
- SVT_DLLPRIVATE void ImplCheckOK();
- SVT_DLLPRIVATE void ImplInitControls();
- SVT_DLLPRIVATE void ImplFillDialogData();
- SVT_DLLPRIVATE void ImplSetInfo();
- SVT_DLLPRIVATE void ImplSetImages();
- SVT_DLLPRIVATE bool ImplGetFilename();
-
- DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplModifyControlHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* );
-
-public:
- PrintDialog( Window* pWindow, bool bWithSheetsAndCells );
- ~PrintDialog();
-
- virtual long OK();
- virtual long ClickOptionsHdl();
-
- void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
- Printer* GetPrinter() const { return mpPrinter; }
-
- inline bool IsSheetRangeAvailable() const { return mbWithSheetsAndCells; }
- void EnableSheetRange( bool bEnable, PrintSheetRange eRange );
- bool IsSheetRangeEnabled( PrintSheetRange eRange ) const;
- void CheckSheetRange( PrintSheetRange eRange );
- PrintSheetRange GetCheckedSheetRange() const;
- bool IsSheetRangeChecked( PrintSheetRange eRange ) const;
-
- void EnableRange( PrintDialogRange eRange );
- void DisableRange( PrintDialogRange eRange );
- BOOL IsRangeEnabled( PrintDialogRange eRange ) const;
-
- void CheckRange( PrintDialogRange eRange = PRINTDIALOG_ALL )
- { meCheckRange = eRange; }
- PrintDialogRange GetCheckedRange() const { return meCheckRange; }
- BOOL IsRangeChecked( PrintDialogRange eRange ) const;
-
- void SetRangeText( const XubString& rRange ) { maRangeText = rRange; }
- const XubString& GetRangeText() const { return maRangeText; }
-
- void SetFirstPage( USHORT nPage = 0 );
- USHORT GetFirstPage() const { return mnFirstPage; }
- void SetLastPage( USHORT nPage = 0 );
- USHORT GetLastPage() const { return mnLastPage; }
-
- void SetMinPage( USHORT nPage = 1 ) { mnMinPage = nPage; }
- USHORT GetMinPage() const { return mnMinPage; }
- void SetMaxPage( USHORT nPage = 65535 ) { mnMaxPage = nPage; }
- USHORT GetMaxPage() const { return mnMaxPage; }
-
- void SetCopyCount( USHORT nCopies = 1 ) { mnCopyCount = nCopies; }
- USHORT GetCopyCount() const { return mnCopyCount; }
-
- void EnableCollate( BOOL bEnable = TRUE )
- { mbCollate = bEnable; }
- BOOL IsCollateEnabled() const { return mbCollate; }
- void CheckCollate( BOOL bCheck = TRUE )
- { mbCollateCheck = bCheck; }
- BOOL IsCollateChecked() const { return mbCollateCheck; }
-
- void ShowOptionsButton( BOOL bShow = TRUE )
- { mbOptions = bShow; }
- BOOL IsOptionsButtonVisible() const { return mbOptions; }
-
- void SetOptionsHdl( const Link& rLink ) { maOptionsHdlLink = rLink; }
- const Link& GetOptionsHdl() const { return maOptionsHdlLink; }
-
- void SetOKHdl( const Link& rLink ) { maOKHdlLink = rLink; }
- const Link& GetOKHdl() const { return maOKHdlLink; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual long Notify( NotifyEvent& rNEvt );
-
- virtual short Execute();
-
- void DisableHelp();
-};
-
-inline void PrintDialog::EnableRange( PrintDialogRange eRange )
-{
- if ( eRange == PRINTDIALOG_ALL )
- mbAll = TRUE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- mbSelection = TRUE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- mbFromTo = TRUE;
- else
- mbRange = TRUE;
-}
-
-inline void PrintDialog::DisableRange( PrintDialogRange eRange )
-{
- if ( eRange == PRINTDIALOG_ALL )
- mbAll = FALSE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- mbSelection = FALSE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- mbFromTo = FALSE;
- else
- mbRange = FALSE;
-}
-
-inline BOOL PrintDialog::IsRangeEnabled( PrintDialogRange eRange ) const
-{
- BOOL bRet;
-
- if ( eRange == PRINTDIALOG_ALL )
- bRet = mbAll;
- else if ( eRange == PRINTDIALOG_SELECTION )
- bRet = mbSelection;
- else if ( eRange == PRINTDIALOG_FROMTO )
- bRet = mbFromTo;
- else
- bRet = mbRange;
-
- return bRet;
-}
-
-inline BOOL PrintDialog::IsRangeChecked( PrintDialogRange eRange ) const
-{
- if ( eRange == meCheckRange )
- return TRUE;
- else
- return FALSE;
-}
-
-inline void PrintDialog::SetFirstPage( USHORT nPage )
-{
- mnFirstPage = nPage;
- if ( nPage && (nPage < mnMinPage) )
- mnMinPage = nPage;
-}
-
-inline void PrintDialog::SetLastPage( USHORT nPage )
-{
- mnLastPage = nPage;
- if ( nPage && (nPage > mnMaxPage) )
- mnMaxPage = nPage;
-}
-
-#endif // _SV_PRINTDLG_HXX_
-
diff --git a/svtools/inc/svtools/svmedit.hxx b/svtools/inc/svtools/svmedit.hxx
index 3bdfdc44e8e9..9c8a4a34dbf6 100644
--- a/svtools/inc/svtools/svmedit.hxx
+++ b/svtools/inc/svtools/svmedit.hxx
@@ -28,7 +28,7 @@
#ifndef _SVEDIT_HXX
#define _SVEDIT_HXX
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/edit.hxx>
#include <svtools/syntaxhighlight.hxx>
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index a40b149d780b..4a95d0c03dcd 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -52,7 +52,6 @@ sal_Bool SvtTabAppearanceCfg::bInitialized = sal_False;
--------------------------------------------------------------------*/
SvtTabAppearanceCfg::SvtTabAppearanceCfg()
:ConfigItem(OUString::createFromAscii("Office.Common/View"))
- ,nLookNFeel ( DEFAULT_LOOKNFEEL )
,nDragMode ( DEFAULT_DRAGMODE )
,nScaleFactor ( DEFAULT_SCALEFACTOR )
,nSnapMode ( DEFAULT_SNAPMODE )
@@ -61,8 +60,6 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT )
#endif
,bMenuMouseFollow(FALSE)
- ,bSingleLineTabCtrl(FALSE)
- ,bColoredTabCtrl(FALSE)
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
,bFontAntialiasing ( TRUE )
#endif
@@ -83,16 +80,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
switch(nProp)
{
case 0: *pValues >>= nScaleFactor; break; //"FontScaling",
- case 1: *pValues >>= nLookNFeel; break; //"LookAndFeel",
- case 2: *pValues >>= nDragMode; break; //"Window/Drag",
- case 3: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
- case 4: bSingleLineTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/SingleLineTab",
- case 5: bColoredTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/ColoredTab",
- case 6: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: *pValues >>= nDragMode; break; //"Window/Drag",
+ case 2: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
+ case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
- case 8: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
- case 9: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
+ case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -116,16 +110,13 @@ const Sequence<OUString>& SvtTabAppearanceCfg::GetPropertyNames()
static const sal_Char* aPropNames[] =
{
"FontScaling" // 0
- ,"LookAndFeel" // 1
- ,"Window/Drag" // 2
- ,"Menu/FollowMouse" // 3
- ,"Dialog/SingleLineTab" // 4
- ,"Dialog/ColoredTab" // 5
- ,"Dialog/MousePositioning" // 6
- ,"Dialog/MiddleMouseButton" // 7
+ ,"Window/Drag" // 1
+ ,"Menu/FollowMouse" // 2
+ ,"Dialog/MousePositioning" // 3
+ ,"Dialog/MiddleMouseButton" // 4
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
- ,"FontAntiAliasing/Enabled" // 8
- ,"FontAntiAliasing/MinPixelHeight" // 9
+ ,"FontAntiAliasing/Enabled" // 5
+ ,"FontAntiAliasing/MinPixelHeight" // 6
#endif
};
const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] );
@@ -153,16 +144,13 @@ void SvtTabAppearanceCfg::Commit()
switch(nProp)
{
case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling",
- case 1: pValues[nProp] <<= nLookNFeel; break; //"LookAndFeel",
- case 2: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
- case 3: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
- case 4: pValues[nProp].setValue(&bSingleLineTabCtrl, rType); break; //"Dialog/SingleLineTab",
- case 5: pValues[nProp].setValue(&bColoredTabCtrl, rType); break; //"Dialog/ColoredTab",
- case 6: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
+ case 2: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
+ case 3: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX ) || defined ( FS_PRIV_DEBUG )
- case 8: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
- case 9: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
+ case 6: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -177,16 +165,6 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt
Beschreibung:
--------------------------------------------------------------------*/
-void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet )
-{
- nLookNFeel = nSet;
- SetModified();
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet )
{
nDragMode = nSet;
@@ -234,26 +212,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// SetStandard...Styles() resets the UseSystemUIFonts flag,
// but we don't want to change it now, so save the flag before ...
BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts();
-
- switch ( nLookNFeel )
- {
- case LookMotif:
- hAppStyle.SetStandardUnixStyles(); break;
-
- case LookOSTwo:
- hAppStyle.SetStandardOS2Styles(); break;
-
- case LookMacintosh:
- hAppStyle.SetStandardMacStyles(); break;
-
- case LookWindows:
- hAppStyle.SetStandardWinStyles(); break;
-
- case LookStardivision:
- default:
- hAppStyle.SetStandardStyles(); break;
- }
-
+ hAppStyle.SetStandardStyles();
// and set it here
hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts );
@@ -298,14 +257,6 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
else
nFollow &= ~MOUSE_FOLLOW_MENU;
hMouseSettings.SetFollow( nFollow );
- sal_uInt16 nTabStyle = 0;
- if(bSingleLineTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_SINGLELINE;
-
- if(bColoredTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_COLOR;
- hAppStyle.SetTabControlStyle(nTabStyle);
-
hAppSettings.SetMouseSettings( hMouseSettings );
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 7b1f2ad87108..7b1f2ad87108 100644..100755
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
deleted file mode 100644
index ab8b69fdcda1..000000000000
--- a/svtools/source/dialogs/printdlg.cxx
+++ /dev/null
@@ -1,791 +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_svtools.hxx"
-#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/print.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/jobset.hxx>
-#include <tools/urlobj.hxx>
-#include "printdlg.hrc"
-#include <svtools/controldims.hrc>
-#include <svtools/prnsetup.hxx>
-#include <svtools/printdlg.hxx>
-#include <svtools/svtdata.hxx>
-#include <svtools/filedlg.hxx>
-#include "svl/pickerhelper.hxx"
-#include <svtools/helpid.hrc>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <comphelper/processfactory.hxx>
-
-using rtl::OUString;
-using namespace com::sun::star;
-
-struct SvtPrinterImpl
-{
- Printer* m_pTempPrinter;
- sal_Bool m_bHelpDisabled;
- PrintSheetRange m_eSheetRange;
-
- SvtPrinterImpl() :
- m_pTempPrinter( NULL ), m_bHelpDisabled( sal_False ), m_eSheetRange( PRINTSHEETS_ALL ) {}
- ~SvtPrinterImpl() { delete m_pTempPrinter; }
-};
-
-#define TEMPPRINTER() mpPrinterImpl->m_pTempPrinter
-
-// =======================================================================
-
-PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) :
- ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRINTDLG ) ),
- maFlPrinter ( this, SvtResId( FL_PRINTER ) ),
- maFtName ( this, SvtResId( FT_NAME ) ),
- maLbName ( this, SvtResId( LB_NAMES ) ),
- maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ),
- maFtStatus ( this, SvtResId( FT_STATUS ) ),
- maFiStatus ( this, SvtResId( FI_STATUS ) ),
- maFtType ( this, SvtResId( FT_TYPE ) ),
- maFiType ( this, SvtResId( FI_TYPE ) ),
- maFtLocation ( this, SvtResId( FT_LOCATION ) ),
- maFiLocation ( this, SvtResId( FI_LOCATION ) ),
- maFtComment ( this, SvtResId( FT_COMMENT ) ),
- maFiComment ( this, SvtResId( FI_COMMENT ) ),
- maCbxFilePrint ( this, SvtResId( CBX_FILEPRINT ) ),
- maFiPrintFile ( this, SvtResId( FI_PRINTFILE ) ),
- maFiFaxNo ( this, SvtResId( FI_FAXNO ) ),
- maEdtFaxNo ( this, SvtResId( EDT_FAXNO ) ),
- maFlPrint ( this, SvtResId( FL_PRINT ) ),
- maRbtAllSheets ( this, SvtResId( RBT_ALL_SHEETS ) ),
- maRbtSelectedSheets ( this, SvtResId( RBT_SELECTED_SHEETS ) ),
- maRbtSelectedCells ( this, SvtResId( RBT_SELECTED_CELLS ) ),
- maFlPrintRange ( this, SvtResId( FL_PRINTRANGE ) ),
- maRbtAll ( this, SvtResId( RBT_ALL ) ),
- maRbtPages ( this, SvtResId( RBT_PAGES ) ),
- maRbtSelection ( this, SvtResId( RBT_SELECTION ) ),
- maEdtPages ( this, SvtResId( EDT_PAGES ) ),
- maFlSepCopiesRange ( this, SvtResId( FL_SEPCOPIESRANGE ) ),
- maFlCopies ( this, SvtResId( FL_COPIES ) ),
- maFtCopies ( this, SvtResId( FT_COPIES ) ),
- maNumCopies ( this, SvtResId( NUM_COPIES ) ),
- maImgCollate ( this, SvtResId( IMG_COLLATE ) ),
- maImgNotCollate ( this, SvtResId( IMG_NOT_COLLATE ) ),
- maCbxCollate ( this, SvtResId( CBX_COLLATE ) ),
- maFlSepButtonLine ( this, SvtResId( FL_SEPBUTTONLINE ) ),
- maBtnOptions ( this, SvtResId( BTN_OPTIONS ) ),
- maBtnOK ( this, SvtResId( BTN_OK ) ),
- maBtnCancel ( this, SvtResId( BTN_CANCEL ) ),
- maBtnHelp ( this, SvtResId( BTN_HELP ) ),
- mbWithSheetsAndCells( bWithSheetsAndCells ),
- maAllFilterStr ( SvtResId( STR_ALLFILTER ) )
-
-{
- FreeResource();
-
- mpPrinter = NULL;
- mpPrinterImpl = new SvtPrinterImpl;
- mnCopyCount = 1;
- mnFirstPage = 0;
- mnLastPage = 0;
- mnMinPage = 1;
- mnMaxPage = 65535;
- meCheckRange = PRINTDIALOG_ALL;
- mbAll = TRUE;
- mbSelection = FALSE;
- mbFromTo = FALSE;
- mbRange = FALSE;
- mbCollate = TRUE;
- mbCollateCheck = TRUE;
- mbOptions = FALSE;
-
- maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE );
- maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) );
- maBtnProperties.SetClickHdl( LINK( this, PrintDialog, ImplPropertiesHdl ) );
- maLbName.SetSelectHdl( LINK( this, PrintDialog, ImplChangePrinterHdl ) );
-
- maFiPrintFile.SetStyle( maFiPrintFile.GetStyle() | WB_PATHELLIPSIS );
-
- Link aLink( LINK( this, PrintDialog, ImplModifyControlHdl ) );
- maCbxFilePrint.SetClickHdl( aLink );
- maRbtAll.SetClickHdl( aLink );
- maRbtPages.SetClickHdl( aLink );
- maRbtSelection.SetClickHdl( aLink );
- maEdtPages.SetModifyHdl( aLink );
- maNumCopies.SetModifyHdl( aLink );
- maCbxCollate.SetClickHdl( aLink );
- maBtnOptions.SetClickHdl( aLink );
- maEdtFaxNo.SetModifyHdl( aLink );
- maBtnOK.SetClickHdl( aLink );
-
- maRbtAll.Check();
- ImplSetImages();
-}
-
-// -----------------------------------------------------------------------
-
-PrintDialog::~PrintDialog()
-{
- ImplFreePrnDlgListBox( &maLbName, FALSE );
- delete mpPrinterImpl;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetImages()
-{
- if( ! GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE ) ), BMP_COLOR_NORMAL );
- maImgNotCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE ) ), BMP_COLOR_NORMAL );
- }
- else
- {
- maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maImgNotCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE_HC ) ), BMP_COLOR_HIGHCONTRAST );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetInfo()
-{
- const QueueInfo* pInfo = Printer::GetQueueInfo( maLbName.GetSelectEntry(), true );
- if ( pInfo )
- {
- maFiType.SetText( pInfo->GetDriver() );
- maFiLocation.SetText( pInfo->GetLocation() );
- maFiComment.SetText( pInfo->GetComment() );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) );
- }
- else
- {
- XubString aTempStr;
- maFiType.SetText( aTempStr );
- maFiLocation.SetText( aTempStr );
- maFiComment.SetText( aTempStr );
- maFiStatus.SetText( aTempStr );
- }
-
-#ifdef UNX
- if( pInfo && pInfo->GetLocation().EqualsAscii( "fax_queue" ) )
- {
- maFiPrintFile.Show( FALSE );
- maCbxFilePrint.Show( FALSE );
- maFiFaxNo.Show( TRUE );
- maEdtFaxNo.Show( TRUE );
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- maEdtFaxNo.SetText( pPrinter->GetJobValue( String::CreateFromAscii( "FAX#" ) ) );
-
- Size aFTSize = maFiFaxNo.GetSizePixel();
- long nTextWidth = maFiFaxNo.GetCtrlTextWidth( maFiFaxNo.GetText() ) + 10;
- if ( aFTSize.Width() < nTextWidth )
- {
- long nDelta = nTextWidth - aFTSize.Width();
- aFTSize.Width() = aFTSize.Width() + nDelta;
- maFiFaxNo.SetSizePixel( aFTSize );
- Size aEdtSize = maEdtFaxNo.GetSizePixel();
- aEdtSize.Width() = aEdtSize.Width() - nDelta;
- Point aEdtPos = maEdtFaxNo.GetPosPixel();
- aEdtPos.X() = aEdtPos.X() + nDelta;
- maEdtFaxNo.SetPosSizePixel( aEdtPos, aEdtSize );
- }
- }
- else
-#endif
- {
- maFiPrintFile.Show( TRUE );
- maCbxFilePrint.Show( TRUE );
- maFiFaxNo.Show( FALSE );
- maEdtFaxNo.Show( FALSE );
- }
-
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplCheckOK()
-{
- // Ueberprueft, ob der OK-Button enabled ist
- BOOL bEnable = TRUE;
-
- if ( bEnable && maRbtPages.IsChecked() )
- bEnable = maEdtPages.GetText().Len() > 0;
-
- if ( bEnable )
- {
- if ( TEMPPRINTER() )
- bEnable = TEMPPRINTER()->IsValid();
- else
- bEnable = mpPrinter->IsValid();
- }
-
- maBtnOK.Enable( bEnable );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplInitControls()
-{
- // Alles
- if ( mbAll )
- {
- maRbtAll.Enable();
- if( meCheckRange == PRINTDIALOG_ALL )
- maRbtAll.Check( TRUE );
- }
- else
- maRbtAll.Enable( FALSE );
-
- // Selektion
- if ( mbSelection )
- {
- maRbtSelection.Enable();
- if ( meCheckRange == PRINTDIALOG_SELECTION )
- maRbtSelection.Check( TRUE );
- }
- else
- maRbtSelection.Enable( FALSE );
-
- // Seiten
- if ( mbRange )
- {
- maRbtPages.Enable();
- maEdtPages.Show();
- maEdtPages.SetText( maRangeText );
-
- if( ( meCheckRange == PRINTDIALOG_FROMTO ) ||
- ( meCheckRange == PRINTDIALOG_RANGE ) )
- {
- maRbtPages.Check( TRUE );
- maEdtPages.Enable();
- }
- else
- maEdtPages.Enable( FALSE );
- }
- else
- {
- maRbtPages.Enable( FALSE );
- maEdtPages.Hide();
- }
-
- // Anzahl Kopien
- maNumCopies.SetValue( mnCopyCount );
-
- // Sortierung
- maCbxCollate.Enable( mbCollate );
- maCbxCollate.Check( mbCollateCheck );
-
- // Zusaetze-Button
- if ( mbOptions )
- maBtnOptions.Show();
-
- if ( !mbWithSheetsAndCells )
- {
- Size aMarginSize =
- LogicToPixel( Size( RSC_SP_CTRL_GROUP_X, RSC_SP_CTRL_GROUP_Y ), MAP_APPFONT );
- long nTempPos = maImgCollate.GetPosPixel().Y() +
- maImgCollate.GetSizePixel().Height() + aMarginSize.Height();
- long nDelta1 = maFlPrintRange.GetPosPixel().Y() - maFlPrint.GetPosPixel().Y();
- long nDelta2 = maFlSepButtonLine.GetPosPixel().Y() - nTempPos;
-
- maFlPrint.Hide();
- maRbtAllSheets.Hide();
- maRbtSelectedSheets.Hide();
- maRbtSelectedCells.Hide();
- maRbtSelection.Show();
-
- Size aNewSize = GetSizePixel();
- aNewSize.Height() -= nDelta2;
- SetSizePixel( aNewSize );
- aNewSize = maFlSepCopiesRange.GetSizePixel();
- aNewSize.Height() -= nDelta2;
- maFlSepCopiesRange.SetSizePixel( aNewSize );
-
- long nDelta = nDelta1;
- Window* pControls[] = { &maFlPrintRange, &maRbtAll,
- &maRbtPages, &maEdtPages, &maRbtSelection, NULL,
- &maFlSepButtonLine, &maBtnOptions, &maBtnOK,
- &maBtnCancel, &maBtnHelp };
- Window** pCtrl = pControls;
- const sal_Int32 nCount = sizeof( pControls ) / sizeof( pControls[0] );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCtrl )
- {
- if ( NULL == *pCtrl )
- {
- nDelta = nDelta2;
- continue;
- }
- Point aNewPos = (*pCtrl)->GetPosPixel();
- aNewPos.Y() -= nDelta;
- (*pCtrl)->SetPosPixel( aNewPos );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplFillDialogData()
-{
- if ( maRbtAll.IsChecked() )
- meCheckRange = PRINTDIALOG_ALL;
- else if( maRbtSelection.IsChecked() )
- meCheckRange = PRINTDIALOG_SELECTION;
- else
- {
- meCheckRange = PRINTDIALOG_RANGE;
- maRangeText = maEdtPages.GetText();
- }
-
- mnCopyCount = (USHORT) maNumCopies.GetValue();
- mbCollateCheck = maCbxCollate.IsChecked();
-
- // In Datei drucken
- if ( maCbxFilePrint.IsChecked() )
- mpPrinter->SetPrintFile( maFiPrintFile.GetText() );
- mpPrinter->EnablePrintFile( maCbxFilePrint.IsChecked() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplStatusHdl, Timer*, EMPTYARG )
-{
- QueueInfo aInfo;
- ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplPropertiesHdl, void*, EMPTYARG )
-{
- if ( !TEMPPRINTER() )
- TEMPPRINTER() = new Printer( mpPrinter->GetJobSetup() );
- TEMPPRINTER()->Setup( this );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplChangePrinterHdl, void*, EMPTYARG )
-{
- TEMPPRINTER() = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties,
- mpPrinter, TEMPPRINTER() );
- ImplSetInfo();
- ImplCheckOK(); // Check if "OK" button can be enabled now!
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::ImplGetFilename()
-{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- static ::rtl::OUString aOldFile;
- if( xFactory.is() )
- {
- uno::Sequence< uno::Any > aTempl( 1 );
- aTempl.getArray()[0] <<= ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION;
- uno::Reference< ui::dialogs::XFilePicker > xFilePicker(
- xFactory->createInstanceWithArguments(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ),
- aTempl ), uno::UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- uno::Reference< ui::dialogs::XFilterManager > xFilterMgr( xFilePicker, uno::UNO_QUERY );
- if( xFilePicker.is() && xFilterMgr.is() )
- {
- try
- {
-#ifdef UNX
- // add PostScript and PDF
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- bool bPS = true, bPDF = true;
- if( pPrinter )
- {
- if( pPrinter->GetCapabilities( PRINTER_CAPABILITIES_PDF ) )
- bPS = false;
- else
- bPDF = false;
- }
- if( bPS )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- if( bPDF )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) );
-#elif defined WNT
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.PRN" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
-#endif
- // add arbitrary files
- xFilterMgr->appendFilter( maAllFilterStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) );
- }
- catch( lang::IllegalArgumentException rExc )
- {
- DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( aOldFile.getLength() )
- {
- INetURLObject aUrl( aOldFile, INET_PROT_FILE );
- xFilePicker->setDefaultName( aUrl.GetLastName() );
- aUrl.CutLastName();
- xFilePicker->setDisplayDirectory( aUrl.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- }
-
- if( xFilePicker->execute() == ui::dialogs::ExecutableDialogResults::OK )
- {
- uno::Sequence< ::rtl::OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- maFiPrintFile.SetText( aOldFile = aObj.PathToFileName() );
- return true;
- }
- return false;
- }
- }
-
- // something went awry, lets try the old fashioned dialogue
- Window* pDlgParent = IsReallyVisible() ? this : GetParent();
- FileDialog aDlg( pDlgParent, WB_STDDIALOG | WB_SAVEAS );
-#ifdef WNT
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "prn" ) ) );
-#elif defined UNX
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "ps" ) ) );
-#endif
-
- if( aOldFile.getLength() )
- aDlg.SetPath( aOldFile );
-
- if( aDlg.Execute() )
- {
- String aTargetFile = aDlg.GetPath();
- maFiPrintFile.SetText( aOldFile = aTargetFile );
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p )
-{
- // Radiobuttons (Umfang)
- if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) )
- {
- BOOL bCheck = maRbtPages.IsChecked();
- maEdtPages.Enable( bCheck );
- if ( p == &maRbtPages )
- maEdtPages.GrabFocus();
- ImplCheckOK();
- }
-
- // Edit-Felder (Seiten)
- if ( p == &maEdtPages )
- ImplCheckOK();
-
- if( p == &maEdtFaxNo )
- {
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- pPrinter->SetJobValue( String::CreateFromAscii( "FAX#" ), maEdtFaxNo.GetText() );
- }
-
- // Anzahl Kopien
- BOOL bNumCopies = FALSE;
-
- if ( !p || p == &maNumCopies )
- {
- if ( p )
- bNumCopies = TRUE;
- //BOOL bCopies = maNumCopies.GetValue() > 1;
- maCbxCollate.Enable( mbCollate );
-
- /*if ( !bCopies )
- maCbxCollate.Check( FALSE );
- else*/
- if ( mbCollateCheck )
- maCbxCollate.Check( TRUE );
- }
-
- // Sortieren
- if ( !p || p == &maCbxCollate || bNumCopies )
- {
- BOOL bCheck = maCbxCollate.IsChecked();
-
- if ( !bNumCopies )
- mbCollateCheck = maCbxCollate.IsChecked();
-
- if( bCheck )
- {
- maImgCollate.Show();
- maImgNotCollate.Hide();
- }
- else
- {
- maImgCollate.Hide();
- maImgNotCollate.Show();
- }
- }
-
- // Zus"atze
- if ( p == &maBtnOptions )
- ClickOptionsHdl();
-
- if( p == &maBtnOK )
- {
- EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : TRUE );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::ClickOptionsHdl()
-{
- if ( maOptionsHdlLink.IsSet() )
- return maOptionsHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::OK()
-{
- if ( maOKHdlLink.IsSet() )
- return maOKHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::EnableSheetRange( bool bEnable, PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Enable( bEnable != false );
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::EnableSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeEnabled( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsEnabled() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeEnabled(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::CheckSheetRange( PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Check();
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::CheckSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-PrintSheetRange PrintDialog::GetCheckedSheetRange() const
-{
- PrintSheetRange eRange = PRINTSHEETS_ALL;
- if ( mbWithSheetsAndCells )
- {
- if ( maRbtSelectedSheets.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_SHEETS;
- else if ( maRbtSelectedCells.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_CELLS;
- }
- return eRange;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeChecked( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsChecked() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeChecked(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::Notify( NotifyEvent& rNEvt )
-{
- if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() )
- ImplStatusHdl( &maStatusTimer );
- else if ( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if ( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F1 && mpPrinterImpl->m_bHelpDisabled )
- return 1; // do nothing
- }
-
- return ModalDialog::Notify( rNEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( rDCEvt.GetType() == DATACHANGED_PRINTER )
- {
- TEMPPRINTER() = ImplPrnDlgUpdatePrinter( mpPrinter, TEMPPRINTER() );
- Printer* pPrn;
- if ( TEMPPRINTER() )
- pPrn = TEMPPRINTER();
- else
- pPrn = mpPrinter;
- ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties );
- ImplSetInfo();
- ImplCheckOK();
- }
- else if ( rDCEvt.GetType() == DATACHANGED_SETTINGS )
- ImplSetImages();
-
- ModalDialog::DataChanged( rDCEvt );
-}
-
-// -----------------------------------------------------------------------
-
-short PrintDialog::Execute()
-{
- if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
- {
- DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
- return FALSE;
- }
-
- // check if the printer brings up its own dialog
- // in that case leave the work to that dialog
- if( mpPrinter->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) )
- return TRUE;
-
- Printer::updatePrinters();
-
- // Controls initialisieren
- ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties );
- ImplSetInfo();
- maStatusTimer.Start();
- ImplInitControls();
- maNumCopies.GrabFocus();
- maNumCopies.SetSelection( Selection( 0, maNumCopies.GetText().Len() ) );
- ImplModifyControlHdl( NULL );
-
- // Dialog starten
- short nRet = ModalDialog::Execute();
-
- // Wenn Dialog mit OK beendet wurde, dann die Daten updaten
- if( nRet == TRUE )
- {
- if ( TEMPPRINTER() )
- mpPrinter->SetPrinterProps( TEMPPRINTER() );
- ImplFillDialogData();
- }
-
- maStatusTimer.Stop();
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DisableHelp()
-{
- mpPrinterImpl->m_bHelpDisabled = sal_True;
- maBtnHelp.Disable();
-}
-
diff --git a/svtools/source/dialogs/printdlg.hrc b/svtools/source/dialogs/printdlg.hrc
deleted file mode 100644
index 83b7b0b28c82..000000000000
--- a/svtools/source/dialogs/printdlg.hrc
+++ /dev/null
@@ -1,74 +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 <svtools/svtools.hrc>
-
-#define FL_PRINTER 1
-#define LB_NAMES 2
-#define BTN_PROPERTIES 3
-#define FT_NAME 4
-#define FT_STATUS 5
-#define FI_STATUS 6
-#define FT_TYPE 7
-#define FI_TYPE 8
-#define FT_LOCATION 9
-#define FI_LOCATION 10
-#define FT_COMMENT 11
-#define FI_COMMENT 12
-#define CBX_FILEPRINT 13
-#define FI_PRINTFILE 14
-#define FI_FAXNO 15
-#define EDT_FAXNO 16
-
-#define FL_PRINT 20
-#define RBT_ALL_SHEETS 21
-#define RBT_SELECTED_SHEETS 22
-#define RBT_SELECTED_CELLS 23
-
-#define FL_PRINTRANGE 30
-#define RBT_ALL 31
-#define RBT_PAGES 32
-#define EDT_PAGES 33
-#define RBT_SELECTION 34
-
-#define FL_SEPCOPIESRANGE 35
-
-#define FL_COPIES 40
-#define FT_COPIES 41
-#define NUM_COPIES 42
-#define CBX_COLLATE 43
-#define IMG_COLLATE 44
-#define IMG_NOT_COLLATE 45
-
-#define FL_SEPBUTTONLINE 50
-#define BTN_OK 51
-#define BTN_CANCEL 52
-#define BTN_HELP 53
-#define BTN_OPTIONS 54
-
-#define STR_ALLFILTER 10
-
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
deleted file mode 100644
index 80c6e465d49a..000000000000
--- a/svtools/source/dialogs/printdlg.src
+++ /dev/null
@@ -1,349 +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 "printdlg.hrc"
-
-#define IMAGE_MAGENTA_MASK Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
-
-ModalDialog DLG_SVT_PRNDLG_PRINTDLG
-{
- HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRINTDLG";
- SVLook = TRUE ;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 265 , 210 ) ;
- Text [ en-US ] = "Print" ;
- FixedLine FL_PRINTER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 253 , 8 ) ;
- Text [ en-US ] = "Printer" ;
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- };
- ListBox LB_NAMES
- {
- HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRINTDLG:LB_NAMES";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 13 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- PushButton BTN_PROPERTIES
- {
- HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_PROPERTIES";
- Pos = MAP_APPFONT ( 193 , 12 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Propert~ies..." ;
- };
- FixedText FT_STATUS
- {
- Pos = MAP_APPFONT ( 12 , 29 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Status" ;
- };
- FixedText FI_STATUS
- {
- Pos = MAP_APPFONT ( 60 , 29 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FI_TYPE
- {
- Pos = MAP_APPFONT ( 60 , 40 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_LOCATION
- {
- Pos = MAP_APPFONT ( 12 , 51 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Location" ;
- };
- FixedText FI_LOCATION
- {
- Pos = MAP_APPFONT ( 60 , 51 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_COMMENT
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Comment" ;
- };
- FixedText FI_COMMENT
- {
- Pos = MAP_APPFONT ( 60 , 62 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FI_FAXNO
- {
- Pos = MAP_APPFONT ( 12 , 75 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Fax number";
- };
- Edit EDT_FAXNO
- {
- HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_FAXNO";
- Border = TRUE;
- Pos = MAP_APPFONT ( 60 , 73 );
- Size = MAP_APPFONT ( 188 , 12 );
- };
- CheckBox CBX_FILEPRINT
- {
- HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_FILEPRINT";
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Print to file" ;
- };
- FixedText FI_PRINTFILE
- {
- Pos = MAP_APPFONT ( 90 , 74 ) ;
- Size = MAP_APPFONT ( 163 , 8 ) ;
- };
- /*!!!
- PushButton BTN_BROWSE
- {
- HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_BROWSE";
- Pos = MAP_APPFONT ( 234 , 75 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
- Hide = TRUE ;
- };
- */
- FixedLine FL_PRINT
- {
- Pos = MAP_APPFONT ( 6 , 91 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print" ;
- };
- RadioButton RBT_ALL_SHEETS
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL_SHEETS";
- Pos = MAP_APPFONT ( 12 , 102 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All sheets" ;
- };
- RadioButton RBT_SELECTED_SHEETS
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_SHEETS";
- Pos = MAP_APPFONT ( 12 , 115 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected sheets" ;
- };
- RadioButton RBT_SELECTED_CELLS
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_CELLS";
- Pos = MAP_APPFONT ( 12 , 128 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected cells" ;
- };
- FixedLine FL_PRINTRANGE
- {
- Pos = MAP_APPFONT ( 6 , 141 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print range" ;
- };
- RadioButton RBT_ALL
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL";
- Pos = MAP_APPFONT ( 12 , 152 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All pages" ;
- };
- RadioButton RBT_PAGES
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_PAGES";
- Pos = MAP_APPFONT ( 12 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "Pages" ;
- };
- Edit EDT_PAGES
- {
- HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_PAGES";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 65 , 164 ) ;
- Size = MAP_APPFONT ( 52 , 12 ) ;
- };
- RadioButton RBT_SELECTION
- {
- HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTION";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 179 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selection" ;
- };
- FixedLine FL_SEPCOPIESRANGE
- {
- Pos = MAP_APPFONT( 126, 102 );
- Size = MAP_APPFONT( 1, 74 );
- Vert = TRUE;
- };
- FixedLine FL_COPIES
- {
- Pos = MAP_APPFONT ( 129 , 91 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Copies" ;
- };
- FixedText FT_COPIES
- {
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 63 , 8 ) ;
- Text [ en-US ] = "Number of copies" ;
- };
- NumericField NUM_COPIES
- {
- HelpID = "svtools:NumericField:DLG_SVT_PRNDLG_PRINTDLG:NUM_COPIES";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 201 , 102 ) ;
- Size = MAP_APPFONT ( 33 , 12 ) ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- StrictFormat = TRUE ;
- First = 1 ;
- Last = 9999 ;
- };
- CheckBox CBX_COLLATE
- {
- HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_COLLATE";
- Pos = MAP_APPFONT ( 201 , 123 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "Co~llate" ;
- };
- FixedImage IMG_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedImage IMG_NOT_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedLine FL_SEPBUTTONLINE
- {
- Pos = MAP_APPFONT( 0, 179 );
- Size = MAP_APPFONT( 265, 8 );
- };
- PushButton BTN_OPTIONS
- {
- HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_OPTIONS";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Options..." ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 100 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 153 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 209 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String STR_ALLFILTER
- {
- Text [ en-US ] = "<All>";
- };
-};
-
-Image RID_IMG_PRNDLG_COLLATE
-{
- ImageBitmap = Bitmap { File = "collate.bmp" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-Image RID_IMG_PRNDLG_NOCOLLATE
-{
- ImageBitmap = Bitmap { File = "ncollate.bmp" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-Image RID_IMG_PRNDLG_COLLATE_HC
-{
- ImageBitmap = Bitmap { File = "collate_h.bmp" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-Image RID_IMG_PRNDLG_NOCOLLATE_HC
-{
- ImageBitmap = Bitmap { File = "ncollate_h.bmp" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
index 16592bac8df7..027fac99c2e8 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
@@ -28,7 +28,7 @@
#ifndef _SV_FILTER_OPTIONS_DIALOG_HXX_
#define _SV_FILTER_OPTIONS_DIALOG_HXX_
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <cppuhelper/implbase5.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 8058213e11bb..5e20e2197fb7 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -30,7 +30,7 @@
#include <vos/mutex.hxx>
#include <tools/debug.hxx>
#include <tools/rcid.h>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#if defined(OS2)
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index cbf87f40b7fc..e49cf0ab62cf 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <svtools/embedtransfer.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/outdev.hxx>
#include <comphelper/storagehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index 59d156f82018..f6c1a594fdd5 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -919,7 +919,7 @@
#include "vcl/cursor.hxx"
#include "vcl/decoview.hxx"
#include "vcl/dndhelp.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "vcl/fntstyle.hxx"
#include "unotools/fontcvt.hxx"
#include "vcl/gdimtf.hxx"
@@ -938,7 +938,7 @@
#include "vcl/unohelp.hxx"
#include "vcl/unohelp2.hxx"
#include "vcl/wall.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vos/mutex.hxx"
#include "vos/ref.hxx"
#include "vos/refernce.hxx"
diff --git a/svx/inc/svx/fmgridif.hxx b/svx/inc/svx/fmgridif.hxx
index 886db3280d60..df21245bc99b 100644
--- a/svx/inc/svx/fmgridif.hxx
+++ b/svx/inc/svx/fmgridif.hxx
@@ -49,7 +49,7 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <toolkit/controls/unocontrol.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <comphelper/uno3.hxx>
diff --git a/svx/inc/svx/fmtools.hxx b/svx/inc/svx/fmtools.hxx
index b39f46e85d14..f98919fe47d8 100644
--- a/svx/inc/svx/fmtools.hxx
+++ b/svx/inc/svx/fmtools.hxx
@@ -71,7 +71,7 @@
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <cppuhelper/weakref.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
diff --git a/svx/inc/svx/xdef.hxx b/svx/inc/svx/xdef.hxx
index 963e4935c617..dd0fbd802291 100644
--- a/svx/inc/svx/xdef.hxx
+++ b/svx/inc/svx/xdef.hxx
@@ -36,7 +36,8 @@
|*
\************************************************************************/
-#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 153, 204, 255 ) // blue 8
+#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0xCF, 0xE7, 0xE5 )
+#define COL_DEFAULT_SHAPE_STROKE RGB_COLORDATA( 128, 128, 128 )
#define XATTR_START 1000
diff --git a/svx/prj/makefile.mk b/svx/prj/makefile.mk
deleted file mode 100644
index 2a0b99e72fd5..000000000000
--- a/svx/prj/makefile.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- cd .. && make -srj9
diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src
index a9cd2fe60b2f..7823007dbe7c 100644
--- a/svx/source/dialog/bmpmask.src
+++ b/svx/source/dialog/bmpmask.src
@@ -289,7 +289,7 @@ DockingWindow RID_SVXDLG_BMPMASK
ImageBitmap = Bitmap { File = "sc10350.bmp" ; };
MASKCOLOR
};
- Text [ en-US ] = "Eyedropper" ;
+ Text [ en-US ] = "Pipette" ;
};
};
};
@@ -300,7 +300,7 @@ DockingWindow RID_SVXDLG_BMPMASK
Pos = MAP_APPFONT ( 22 , 6 ) ;
Size = MAP_APPFONT ( 43 , 14 ) ;
};
- Text [ en-US ] = "Eyedropper" ;
+ Text [ en-US ] = "Color Replacer" ;
Image IMG_PIPETTE
{
diff --git a/svx/source/dialog/contdlg.src b/svx/source/dialog/contdlg.src
index bf587b3b1fda..989bdd93d336 100644
--- a/svx/source/dialog/contdlg.src
+++ b/svx/source/dialog/contdlg.src
@@ -170,7 +170,7 @@ FloatingWindow RID_SVXDLG_CONTOUR
{
Identifier = TBI_PIPETTE ;
HelpId = HID_CONTDLG_PIPETTE ;
- Text [ en-US ] = "Eyedropper" ;
+ Text [ en-US ] = "Pipette" ;
AutoCheck = TRUE ;
};
};
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index f281580b93db..8a5bfa75f7fa 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -276,8 +276,8 @@ BOOL SvxGridTabPage::FillItemSet( SfxItemSet& rCoreSet )
aGridItem.nFldDrawX = (UINT32) nX;
aGridItem.nFldDrawY = (UINT32) nY;
- aGridItem.nFldDivisionX = static_cast<long>(aNumFldDivisionX.GetValue());
- aGridItem.nFldDivisionY = static_cast<long>(aNumFldDivisionY.GetValue());
+ aGridItem.nFldDivisionX = static_cast<long>(aNumFldDivisionX.GetValue()-1);
+ aGridItem.nFldDivisionY = static_cast<long>(aNumFldDivisionY.GetValue()-1);
rCoreSet.Put( aGridItem );
}
@@ -303,12 +303,8 @@ void SvxGridTabPage::Reset( const SfxItemSet& rSet )
SetMetricValue( aMtrFldDrawX , pGridAttr->nFldDrawX, eUnit );
SetMetricValue( aMtrFldDrawY , pGridAttr->nFldDrawY, eUnit );
-// UINT32 nFineX = pGridAttr->nFldDivisionX;
-// UINT32 nFineY = pGridAttr->nFldDivisionY;
-// aNumFldDivisionX.SetValue( nFineX ? (pGridAttr->nFldDrawX / nFineX - 1) : 0 );
-// aNumFldDivisionY.SetValue( nFineY ? (pGridAttr->nFldDrawY / nFineY - 1) : 0 );
- aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX );
- aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY );
+ aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX+1 );
+ aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY+1 );
}
ChangeGridsnapHdl_Impl( &aCbxUseGridsnap );
diff --git a/svx/source/dialog/optgrid.src b/svx/source/dialog/optgrid.src
index 2bc7b430f807..0d65c63f5d2f 100644
--- a/svx/source/dialog/optgrid.src
+++ b/svx/source/dialog/optgrid.src
@@ -140,6 +140,7 @@ TabPage RID_SVXPAGE_GRID
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
+ Minimum = 1 ;
Maximum = 99 ;
Last = 99 ;
StrictFormat = TRUE ;
@@ -149,7 +150,7 @@ TabPage RID_SVXPAGE_GRID
{
Pos = MAP_APPFONT ( 223 , 56 ) ;
Size = MAP_APPFONT ( 29 , 8 ) ;
- Text [ en-US ] = "point(s)" ;
+ Text [ en-US ] = "space(s)" ;
};
NumericField NUM_FLD_DIVISION_Y
{
@@ -160,6 +161,7 @@ TabPage RID_SVXPAGE_GRID
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
+ Minimum = 1 ;
Maximum = 99 ;
Last = 99 ;
StrictFormat = TRUE ;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 7fb9d8330cf6..7cdf707eb811 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1653,11 +1653,14 @@ DbCheckBox::DbCheckBox( DbGridColumn& _rColumn )
namespace
{
- void setCheckBoxStyle( Window* _pWindow, USHORT nStyle )
+ void setCheckBoxStyle( Window* _pWindow, bool bMono )
{
AllSettings aSettings = _pWindow->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- aStyleSettings.SetCheckBoxStyle( nStyle );
+ if( bMono )
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_MONO );
+ else
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() & (~STYLE_OPTION_MONO) );
aSettings.SetStyleSettings( aStyleSettings );
_pWindow->SetSettings( aSettings );
}
@@ -1683,8 +1686,8 @@ void DbCheckBox::Init( Window& rParent, const Reference< XRowSet >& xCursor )
sal_Int16 nStyle = awt::VisualEffect::LOOK3D;
OSL_VERIFY( xModel->getPropertyValue( FM_PROP_VISUALEFFECT ) >>= nStyle );
- setCheckBoxStyle( m_pWindow, nStyle == awt::VisualEffect::FLAT ? STYLE_CHECKBOX_MONO : STYLE_CHECKBOX_WIN );
- setCheckBoxStyle( m_pPainter, nStyle == awt::VisualEffect::FLAT ? STYLE_CHECKBOX_MONO : STYLE_CHECKBOX_WIN );
+ setCheckBoxStyle( m_pWindow, nStyle == awt::VisualEffect::FLAT );
+ setCheckBoxStyle( m_pPainter, nStyle == awt::VisualEffect::FLAT );
sal_Bool bTristate = sal_True;
OSL_VERIFY( xModel->getPropertyValue( FM_PROP_TRISTATE ) >>= bTristate );
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 32ad01aca4a2..9198f02278bb 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -626,7 +626,7 @@ BOOL Gallery::CreateTheme( const String& rThemeName, UINT32 nNumFrom )
if( !HasTheme( rThemeName ) && ( GetUserURL().GetProtocol() != INET_PROT_NOT_VALID ) )
{
- nLastFileNumber=nNumFrom > nLastFileNumber ? nNumFrom : ++nLastFileNumber;
+ nLastFileNumber = nNumFrom > nLastFileNumber ? nNumFrom : nLastFileNumber + 1;
GalleryThemeEntry* pNewEntry = new GalleryThemeEntry( GetUserURL(), rThemeName,
nLastFileNumber,
FALSE, FALSE, TRUE, 0, FALSE );
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index c7a401ed4054..08eebe99b3df 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -60,7 +60,7 @@ size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustom
return (size_t)r1.first.hashCode() + r1.second.hashCode();
};
-TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new SdrCustomShapeGeometryItem(0));
+TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new SdrCustomShapeGeometryItem);
SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem()
: SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
{}
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index e24aa1c29de7..5d4e6d71fbe9 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -121,7 +121,7 @@ namespace sdr
aViewRange,
GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)),
0.0,
- 0);
+ com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>());
updateViewInformation2D(aNewViewInformation2D);
// collect primitive data in a sequence; this will already use the updated ViewInformation2D
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index d2264e219c48..d804cce575a1 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -241,7 +241,7 @@ namespace sdr
aViewRange,
GetXDrawPageForSdrPage(GetSdrPage()),
fCurrentTime,
- 0);
+ uno::Sequence<beans::PropertyValue>());
updateViewInformation2D(aNewViewInformation2D);
// get whole Primitive2DSequence; this will already make use of updated ViewInformation2D
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index d4748a14ed98..845f1c813325 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -296,7 +296,7 @@ namespace sdr
// decompose immediately with neutral ViewInformation. This will
// layout the text to more simple TextPrimitives from drawinglayer
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(
xRetval,
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
index 485afe35f9c1..485afe35f9c1 100755..100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index f52205d88e45..93e3b03d072d 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -138,7 +138,7 @@ namespace sdr
mnStripeLengthPixel(5),
maDrawinglayerOpt(),
maViewTransformation(),
- maViewInformation2D(0),
+ maViewInformation2D(),
mfDiscreteOne(0.0)
{
// set Property 'ReducedDisplayQuality' to true to allow simpler interaction
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index d41b5b1a1c34..058ba94cf3a6 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -902,6 +902,9 @@ void SdrDragMovHdl::TakeSdrDragComment(XubString& rStr) const
bool SdrDragMovHdl::BeginSdrDrag()
{
+ if( !GetDragHdl() )
+ return false;
+
DragStat().Ref1()=GetDragHdl()->GetPos();
DragStat().SetShown(!DragStat().IsShown());
SdrHdlKind eKind=GetDragHdl()->GetKind();
@@ -931,7 +934,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
{
Point aPnt(rNoSnapPnt);
- if (DragStat().CheckMinMoved(rNoSnapPnt))
+ if ( GetDragHdl() && DragStat().CheckMinMoved(rNoSnapPnt))
{
if (GetDragHdl()->GetKind()==HDL_MIRX)
{
@@ -1042,22 +1045,25 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/)
{
- switch (GetDragHdl()->GetKind())
+ if( GetDragHdl() )
{
- case HDL_REF1:
- Ref1()=DragStat().GetNow();
- break;
+ switch (GetDragHdl()->GetKind())
+ {
+ case HDL_REF1:
+ Ref1()=DragStat().GetNow();
+ break;
- case HDL_REF2:
- Ref2()=DragStat().GetNow();
- break;
+ case HDL_REF2:
+ Ref2()=DragStat().GetNow();
+ break;
- case HDL_MIRX:
- Ref1()+=DragStat().GetNow()-DragStat().GetStart();
- Ref2()+=DragStat().GetNow()-DragStat().GetStart();
- break;
+ case HDL_MIRX:
+ Ref1()+=DragStat().GetNow()-DragStat().GetStart();
+ Ref2()+=DragStat().GetNow()-DragStat().GetStart();
+ break;
- default: break;
+ default: break;
+ }
}
return true;
@@ -1066,7 +1072,11 @@ bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/)
void SdrDragMovHdl::CancelSdrDrag()
{
Hide();
- GetDragHdl()->SetPos(DragStat().GetRef1());
+
+ SdrHdl* pHdl = GetDragHdl();
+ if( pHdl )
+ pHdl->SetPos(DragStat().GetRef1());
+
SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX);
if(pHM)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0a0c35aec524..18e04f648725 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -940,7 +940,7 @@ void SdrObject::RecalcBoundRect()
if(xPrimitives.hasElements())
{
// use neutral ViewInformation and get the range of the primitives
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D));
if(!aRange.isEmpty())
@@ -1202,7 +1202,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const
if(xSequence.hasElements())
{
// use neutral ViewInformation
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
// create extractor, process and get result
drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D);
@@ -2431,7 +2431,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas
if(xSequence.hasElements())
{
// use neutral ViewInformation
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
// create extractor, process and get result
drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 4559dacb31d8..65514307bb86 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -354,7 +354,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
if(xSequence.hasElements())
{
// create an extractor with neutral ViewInformation
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
drawinglayer::processor2d::TextAsPolygonExtractor2D aExtractor(aViewInformation2D);
// extract text as polygons
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 1320aef9b17b..51ab577ca74c 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -988,8 +988,6 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice*
if ((IsDraggingPoints() || IsDraggingGluePoints()) && IsMouseHideWhileDraggingPoints())
return Pointer(POINTER_NULL);
- OSL_TRACE("SdrView::GetPreferedPointer(%lx) %lx\n", this, mpCurrentSdrDragMethod);
-
return mpCurrentSdrDragMethod->GetSdrDragPointer();
}
if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsEncirclement() || IsSetPageOrg()) return Pointer(POINTER_ARROW);
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index ffc6c28f9fec..6132139e0164 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/media/ZoomLevel.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <tools/shl.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index 3d377c88fa4d..0435b62cd3c8 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -52,8 +52,8 @@ XOutdevItemPool::XOutdevItemPool(
const XubString aNullStr;
const Bitmap aNullBmp;
const basegfx::B2DPolyPolygon aNullPol;
- const Color aNullLineCol(RGB_Color(COL_BLACK));
- const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING)); // "Blue 8"
+ const Color aNullLineCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
+ const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING));
const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY));
const XDash aNullDash;
const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE));
diff --git a/sw/inc/dochdl.hrc b/sw/inc/dochdl.hrc
index 47b0b8014240..47b0b8014240 100644..100755
--- a/sw/inc/dochdl.hrc
+++ b/sw/inc/dochdl.hrc
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 3dd338a5e129..3dd338a5e129 100755..100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index c5d67217ab2a..89c5a7a1a1be 100644
--- a/sw/inc/modcfg.hxx
+++ b/sw/inc/modcfg.hxx
@@ -28,7 +28,7 @@
#define _MODOPT_HXX
#include <tools/string.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/field.hxx>
#include <svl/svarray.hxx>
#include <unotools/configitem.hxx>
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 7a5f1e2847b1..13e8cb3ddbdd 100644..100755
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -659,7 +659,6 @@
#include "unotools/pathoptions.hxx"
#include "svl/poolitem.hxx"
#include "svtools/prgsbar.hxx"
-#include "svtools/printdlg.hxx"
#include "svtools/prnsetup.hxx"
#include "svl/ptitem.hxx"
#include "svl/rectitem.hxx"
@@ -913,7 +912,7 @@
#include "vcl/event.hxx"
#include "vcl/field.hxx"
#include "vcl/fixed.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "vcl/font.hxx"
#include "unotools/fontcvt.hxx"
#include "vcl/graph.hxx"
@@ -950,7 +949,7 @@
#include "vcl/virdev.hxx"
#include "vcl/waitobj.hxx"
#include "vcl/window.hxx"
-#include "vcl/wintypes.hxx"
+#include "tools/wintypes.hxx"
#include "vcl/wrkwin.hxx"
#include "vos/mutex.hxx"
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index c8e601143877..da2fc80f33ad 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -28,7 +28,7 @@
#define _SWMODULE_HXX
#include <tools/link.hxx>
#include <tools/string.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <svl/lstner.hxx>
#include <unotools/options.hxx>
#include <sfx2/module.hxx>
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index b54922a1b8e7..bc16348abaee 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -198,8 +198,8 @@ SwPrintUIOptions::SwPrintUIOptions(
{
ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
- DBG_ASSERT( aLocalizedStrings.Count() >= 44, "resource incomplete" );
- if( aLocalizedStrings.Count() < 44 ) // bad resource ?
+ DBG_ASSERT( aLocalizedStrings.Count() >= 30, "resource incomplete" );
+ if( aLocalizedStrings.Count() < 30 ) // bad resource ?
return;
// printing HTML sources does not have any valid UI options.
@@ -226,7 +226,7 @@ SwPrintUIOptions::SwPrintUIOptions(
String aAppGroupname( aLocalizedStrings.GetString( 0 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) );
- m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
// create sub section for Contents
m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() );
@@ -234,79 +234,79 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a bool option for background
bool bDefaultVal = rDefaultPrintData.IsPrintPageBackground();
m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ),
- aLocalizedStrings.GetString( 3 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
- bDefaultVal );
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
+ bDefaultVal );
// create a bool option for pictures/graphics AND OLE and drawing objects as well
bDefaultVal = rDefaultPrintData.IsPrintGraphic() || rDefaultPrintData.IsPrintDraw();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
- aLocalizedStrings.GetString( 5 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
+ bDefaultVal );
if (!bWeb)
{
// create a bool option for hidden text
bDefaultVal = rDefaultPrintData.IsPrintHiddenText();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
- aLocalizedStrings.GetString( 7 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
+ bDefaultVal );
// create a bool option for place holder
bDefaultVal = rDefaultPrintData.IsPrintTextPlaceholder();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
- aLocalizedStrings.GetString( 9 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 5 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
+ bDefaultVal );
}
// create a bool option for controls
bDefaultVal = rDefaultPrintData.IsPrintControl();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
- aLocalizedStrings.GetString( 11 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintControls:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
+ bDefaultVal );
// create sub section for Color
- m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 7 ), rtl::OUString() );
// create a bool option for printing text with black font color
bDefaultVal = rDefaultPrintData.IsPrintBlackFont();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 13 ),
- aLocalizedStrings.GetString( 14 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
+ bDefaultVal );
if (!bWeb)
{
// create subgroup for misc options
- m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 15 ) ), rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 9 ) ), rtl::OUString() );
// create a bool option for printing automatically inserted blank pages
bDefaultVal = rDefaultPrintData.IsPrintEmptyPages();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 16 ),
- aLocalizedStrings.GetString( 17 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
+ bDefaultVal );
}
// create a bool option for paper tray
bDefaultVal = rDefaultPrintData.IsPaperFromSetup();
vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt;
aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) );
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 18 ),
- aLocalizedStrings.GetString( 19 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
- bDefaultVal,
- aPaperTrayOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 11 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
+ bDefaultVal,
+ aPaperTrayOpt
+ );
// print range selection
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
aPrintRangeOpt.mbInternalOnly = sal_True;
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 37 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 26 ) ),
rtl::OUString(),
aPrintRangeOpt
);
@@ -315,18 +315,18 @@ SwPrintUIOptions::SwPrintUIOptions(
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
uno::Sequence< rtl::OUString > aChoices( 3 );
uno::Sequence< sal_Bool > aChoicesDisabled( 3 );
- uno::Sequence< rtl::OUString > aHelpText( 3 );
- aChoices[0] = aLocalizedStrings.GetString( 38 );
+ uno::Sequence< rtl::OUString > aHelpIds( 3 );
+ aChoices[0] = aLocalizedStrings.GetString( 27 );
aChoicesDisabled[0] = sal_False;
- aHelpText[0] = aLocalizedStrings.GetString( 39 );
- aChoices[1] = aLocalizedStrings.GetString( 40 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aChoices[1] = aLocalizedStrings.GetString( 28 );
aChoicesDisabled[1] = sal_False;
- aHelpText[1] = aLocalizedStrings.GetString( 41 );
- aChoices[2] = aLocalizedStrings.GetString( 42 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aChoices[2] = aLocalizedStrings.GetString( 29 );
aChoicesDisabled[2] = sal_Bool(! bHasSelection);
- aHelpText[2] = aLocalizedStrings.GetString( 43 );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
m_aUIProperties[nIdx++].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpText,
+ aHelpIds,
aPrintRangeName,
aChoices,
bHasSelection ? 2 /*enable 'Selection' radio button*/ : 0 /* enable 'All pages' */,
@@ -336,7 +336,7 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
m_aUIProperties[nIdx++].Value = getEditControlOpt( rtl::OUString(),
- rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
rtl::OUString(),
aPageRangeOpt
@@ -344,31 +344,31 @@ SwPrintUIOptions::SwPrintUIOptions(
// print content selection
vcl::PrinterOptionsHelper::UIControlOptions aContentsOpt;
aContentsOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPage" ) );
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 20 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 12 ) ),
rtl::OUString(),
aContentsOpt
);
// create a list box for notes content
const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts();
aChoices.realloc( 4 );
- aChoices[0] = aLocalizedStrings.GetString( 21 );
- aChoices[1] = aLocalizedStrings.GetString( 22 );
- aChoices[2] = aLocalizedStrings.GetString( 23 );
- aChoices[3] = aLocalizedStrings.GetString( 24 );
- aHelpText.realloc( 2 );
- aHelpText[0] = aLocalizedStrings.GetString( 25 );
- aHelpText[1] = aLocalizedStrings.GetString( 25 );
+ aChoices[0] = aLocalizedStrings.GetString( 13 );
+ aChoices[1] = aLocalizedStrings.GetString( 14 );
+ aChoices[2] = aLocalizedStrings.GetString( 15 );
+ aChoices[3] = aLocalizedStrings.GetString( 16 );
+ aHelpIds.realloc( 2 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" ) );
vcl::PrinterOptionsHelper::UIControlOptions aAnnotOpt( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), 0, sal_False );
aAnnotOpt.mbEnabled = bHasPostIts;
- m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 26 ),
- aHelpText,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
- aChoices,
- nPrintPostIts,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
- uno::Sequence< sal_Bool >(),
- aAnnotOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 17 ),
+ aHelpIds,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
+ aChoices,
+ nPrintPostIts,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
+ uno::Sequence< sal_Bool >(),
+ aAnnotOpt
+ );
// create subsection for Page settings
vcl::PrinterOptionsHelper::UIControlOptions aPageSetOpt;
@@ -376,16 +376,16 @@ SwPrintUIOptions::SwPrintUIOptions(
if (!bWeb)
{
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 27 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 18 ) ),
rtl::OUString(),
aPageSetOpt
);
uno::Sequence< rtl::OUString > aRLChoices( 3 );
- aRLChoices[0] = aLocalizedStrings.GetString( 28 );
- aRLChoices[1] = aLocalizedStrings.GetString( 29 );
- aRLChoices[2] = aLocalizedStrings.GetString( 30 );
+ aRLChoices[0] = aLocalizedStrings.GetString( 19 );
+ aRLChoices[1] = aLocalizedStrings.GetString( 20 );
+ aRLChoices[2] = aLocalizedStrings.GetString( 21 );
uno::Sequence< rtl::OUString > aRLHelp( 1 );
- aRLHelp[0] = aLocalizedStrings.GetString( 31 );
+ aRLHelp[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintLeftRightPages:ListBox" ) );
// create a choice option for all/left/right pages
// 0 : all pages (left & right)
// 1 : left pages
@@ -397,7 +397,7 @@ SwPrintUIOptions::SwPrintUIOptions(
nPagesChoice = 1;
else if (!rDefaultPrintData.IsPrintLeftPage() && rDefaultPrintData.IsPrintRightPage())
nPagesChoice = 2;
- m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 32 ),
+ m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 22 ),
aRLHelp,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftRightPages" ) ),
aRLChoices,
@@ -409,27 +409,29 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a bool option for brochure
bDefaultVal = rDefaultPrintData.IsPrintProspect();
rtl::OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) );
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 33 ),
- aLocalizedStrings.GetString( 34 ),
- aBrochurePropertyName,
- bDefaultVal,
- aPageSetOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 23 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ),
+ aBrochurePropertyName,
+ bDefaultVal,
+ aPageSetOpt
+ );
if (bCTL)
{
// create a bool option for brochure RTL dependent on brochure
uno::Sequence< rtl::OUString > aBRTLChoices( 2 );
- aBRTLChoices[0] = aLocalizedStrings.GetString( 35 );
- aBRTLChoices[1] = aLocalizedStrings.GetString( 36 );
+ aBRTLChoices[0] = aLocalizedStrings.GetString( 24 );
+ aBRTLChoices[1] = aLocalizedStrings.GetString( 25 );
vcl::PrinterOptionsHelper::UIControlOptions aBrochureRTLOpt( aBrochurePropertyName, -1, sal_True );
+ uno::Sequence< rtl::OUString > aBRTLHelpIds( 1 );
+ aBRTLHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox" ) );
aBrochureRTLOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) );
// RTL brochure choices
// 0 : left-to-right
// 1 : right-to-left
const sal_Int16 nBRTLChoice = rDefaultPrintData.IsPrintProspectRTL() ? 1 : 0;
m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( rtl::OUString(),
- uno::Sequence< rtl::OUString >(),
+ aBRTLHelpIds,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectRTL" ) ),
aBRTLChoices,
nBRTLChoice,
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0bbfc70d5a22..0bbfc70d5a22 100755..100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 282551474e36..64a261fc8ba0 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -54,6 +54,8 @@
#include <mdiexp.hxx> // ...Percent()
#include <poolfmt.hxx>
+#include "vcl/metric.hxx"
+
#define ASC_BUFFLEN 4096
class SwASCIIParser
@@ -129,24 +131,14 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
}
if( rOpt.GetFontName().Len() )
{
- bool bDelete = false;
- const SfxFont* pFnt = 0;
+ Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) );
if( pDoc->getPrinter( false ) )
- pFnt = pDoc->getPrinter( false )->GetFontByName( rOpt.GetFontName() );
-
- if( !pFnt )
- {
- pFnt = new SfxFont( FAMILY_DONTKNOW, rOpt.GetFontName() );
- bDelete = true;
- }
- SvxFontItem aFont( pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), RES_CHRATR_FONT );
+ aTextFont = pDoc->getPrinter( false )->GetFontMetric( aTextFont );
+ SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetName(),
+ aEmptyStr, aTextFont.GetPitch(), aTextFont.GetCharSet(), RES_CHRATR_FONT );
pItemSet->Put( aFont );
pItemSet->Put( aFont, RES_CHRATR_CJK_FONT );
pItemSet->Put( aFont, RES_CHRATR_CTL_FONT );
-
- if( bDelete )
- delete (SfxFont*)pFnt;
}
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0a6151b98388..0ab613730948 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -32,7 +32,7 @@
#include "wrtww8.hxx"
#include "ww8par.hxx"
-#include <oox/core/tokens.hxx>
+#include <oox/token/tokens.hxx>
#include <oox/export/drawingml.hxx>
#include <oox/export/utils.hxx>
#include <oox/export/vmlexport.hxx>
@@ -128,6 +128,7 @@ using rtl::OUString;
using rtl::OUStringBuffer;
using rtl::OUStringToOString;
+using namespace oox;
using namespace docx;
using namespace sax_fastparser;
using namespace nsSwDocInfoSubType;
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 35c126cd6571..a4b5fb3a9514 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
-#include <oox/core/tokens.hxx>
+#include <oox/token/tokens.hxx>
#include <oox/export/drawingml.hxx>
#include <oox/export/vmlexport.hxx>
@@ -62,6 +62,7 @@
using namespace ::comphelper;
using namespace ::com::sun::star;
+using namespace ::oox;
using oox::vml::VMLExport;
diff --git a/sw/source/filter/ww8/docxfootnotes.hxx b/sw/source/filter/ww8/docxfootnotes.hxx
index b9d49f78f560..ec91731bc6dd 100644
--- a/sw/source/filter/ww8/docxfootnotes.hxx
+++ b/sw/source/filter/ww8/docxfootnotes.hxx
@@ -30,7 +30,6 @@
#include <fmtftn.hxx>
-#include <oox/core/tokens.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <sax/fshelper.hxx>
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index 5645891c5b3c..05c30ce7b496 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -40,7 +40,7 @@
#include "xmlbrshe.hxx"
#include <editeng/tstpitem.hxx>
#include <editeng/brshitem.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <swmodule.hxx>
#include <doc.hxx>
#include "fmtornt.hxx"
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 98fe7316ecd5..d4b15b7febd0 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -210,21 +210,15 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if(!pStdFont->IsFontDefault(nFontId))
{
sEntry = pStdFont->GetFontFor(nFontId);
- sal_Bool bDelete = sal_False;
- const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0;
- if(!pFnt)
- {
- pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW,
- ::gsl_getSystemTextEncoding() );
- bDelete = sal_True;
- }
- pFontItem = new SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich);
- if(bDelete)
+
+ Font aFont( sEntry, Size( 0, 10 ) );
+ if( pPrt )
{
- delete (SfxFont*) pFnt;
- bDelete = sal_False;
+ aFont = pPrt->GetFontMetric( aFont );
}
+
+ pFontItem = new SvxFontItem(aFont.GetFamily(), aFont.GetName(),
+ aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich);
}
else
{
@@ -303,25 +297,18 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx]))
{
sEntry = pStdFont->GetFontFor(aFontIdPoolId[nIdx]);
- sal_Bool bDelete = sal_False;
- const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0;
- if(!pFnt)
- {
- pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW,
- ::gsl_getSystemTextEncoding() );
- bDelete = sal_True;
- }
+
+ Font aFont( sEntry, Size( 0, 10 ) );
+ if( pPrt )
+ aFont = pPrt->GetFontMetric( aFont );
+
pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
if( !bHTMLTemplSet ||
SFX_ITEM_SET != pColl->GetAttrSet().GetItemState(
nFontWhich, sal_False ) )
{
- pColl->SetFmtAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
- }
- if(bDelete)
- {
- delete (SfxFont*) pFnt;
+ pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
+ aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
}
}
sal_Int32 nFontHeight = pStdFont->GetFontHeight( static_cast< sal_Int8 >(aFontIdPoolId[nIdx]), 0, eLanguage );
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 0f0eddc5d9ed..400b3439b795 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -1035,7 +1035,6 @@ TabPage TP_OPTSHDWCRSR
};
};
-
StringArray STR_PRINTOPTUI
{
ItemList [en-US] =
@@ -1043,47 +1042,33 @@ StringArray STR_PRINTOPTUI
< "%PRODUCTNAME %s"; >;
< "Contents"; >;
< "Page ba~ckground"; >;
- < "Specifies whether to include colors and objects that are inserted to the background of the page (Format - Page - Background) in the printed document."; >;
< "P~ictures and other graphic objects"; >;
- < "Specifies whether the graphics and drawing or OLE objects of your text document are printed"; >;
< "Hidden te~xt"; >;
- < "Enable this option to print text that is marked as hidden."; >;
< "~Text placeholders"; >;
- < "Enable this option to print text placeholders. Disable this option to leave the text placeholders blank in the printout."; >;
< "Form control~s"; >;
- < "Specifies whether the form control fields of the text document are printed"; >;
< "Color"; >;
< "Print text in blac~k"; >;
- < "Specifies whether to always print text in black."; >;
< "Pages"; >;
< "Print ~automatically inserted blank pages"; >;
- < "If this option is enabled automatically inserted blank pages are printed. This is best if you are printing double-sided. For example, in a book, a \"chapter\" paragraph style has been set to always start with an odd numbered page. If the previous chapter ends on an odd page, %PRODUCTNAME inserts an even numbered blank page. This option controls whether to print that even numbered page or not"; >;
< "~Use only paper tray from printer preferences"; >;
- < "For printers with multiple trays this option specifies whether the paper tray used is specified by the system settings of the printer."; >;
< "Print"; >;
< "None (document only)"; >;
< "Comments only"; >;
< "Place at end of document"; >;
< "Place at end of page"; >;
- < "Specify where to print comments (if any)."; >;
< "~Comments"; >;
< "Page sides";>;
< "All pages"; >;
< "Back sides / left pages"; >;
< "Front sides / right pages"; >;
- < "Specify which pages to include in the output"; >;
< "Include"; >;
< "Broch~ure"; >;
- < "Select the Brochure option to print the document in brochure format."; >;
< "Left-to-right script"; >;
< "Right-to-left script"; >;
< "Range and copies"; >;
< "~All pages"; >;
- < "Print the whole document."; >;
< "Pa~ges"; >;
- < "Print a range of pages of the document."; >;
< "~Selection"; >;
- < "Print only the selected parts of the document"; >;
};
};
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6e6ed773a33d..01ef0a4f7500 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -726,20 +726,12 @@ void lcl_SetColl(SwWrtShell* pWrtShell, USHORT nType,
SfxPrinter* pPrt, const String& rStyle,
USHORT nFontWhich)
{
- BOOL bDelete = FALSE;
- const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(rStyle): 0;
- if(!pFnt)
- {
- pFnt = new SfxFont(FAMILY_DONTKNOW, rStyle);
- bDelete = TRUE;
- }
+ Font aFont( rStyle, Size( 0, 10 ) );
+ if( pPrt )
+ aFont = pPrt->GetFontMetric( aFont );
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType);
- pColl->SetFmtAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
- if(bDelete)
- {
- delete (SfxFont*) pFnt;
- }
+ pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
+ aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
}
/*-- 11.10.2005 15:47:52---------------------------------------------------
@@ -822,22 +814,13 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& )
FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE);
if(sStandard != sShellStd)
{
- BOOL bDelete = FALSE;
- const SfxFont* pFnt = pPrinter ? pPrinter->GetFontByName(sStandard): 0;
- if(!pFnt)
- {
- pFnt = new SfxFont(FAMILY_DONTKNOW, sStandard);
- bDelete = TRUE;
- }
- pWrtShell->SetDefault(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich));
+ Font aFont( sStandard, Size( 0, 10 ) );
+ if( pPrinter )
+ aFont = pPrinter->GetFontMetric( aFont );
+ pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
+ aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(nFontWhich);
- if(bDelete)
- {
- delete (SfxFont*) pFnt;
- bDelete = FALSE;
- }
// lcl_SetColl(pWrtShell, RES_POOLCOLL_STANDARD, pPrinter, sStandard);
bMod = TRUE;
}
@@ -943,15 +926,24 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
// #i94536# prevent duplication of font entries when 'reset' button is pressed
if( !aStandardBox.GetEntryCount() )
{
- const USHORT nCount = pPrt->GetFontCount();
- for (USHORT i = 0; i < nCount; ++i)
+ // get the set of disctinct available family names
+ std::set< String > aFontNames;
+ int nFontNames = pPrt->GetDevFontCount();
+ for( int i = 0; i < nFontNames; i++ )
+ {
+ FontInfo aInf( pPrt->GetDevFont( i ) );
+ aFontNames.insert( aInf.GetName() );
+ }
+
+ // insert to listboxes
+ for( std::set< String >::const_iterator it = aFontNames.begin();
+ it != aFontNames.end(); ++it )
{
- const String &rString = pPrt->GetFont(i)->GetName();
- aStandardBox.InsertEntry( rString );
- aTitleBox .InsertEntry( rString );
- aListBox .InsertEntry( rString );
- aLabelBox .InsertEntry( rString );
- aIdxBox .InsertEntry( rString );
+ aStandardBox.InsertEntry( *it );
+ aTitleBox .InsertEntry( *it );
+ aListBox .InsertEntry( *it );
+ aLabelBox .InsertEntry( *it );
+ aIdxBox .InsertEntry( *it );
}
}
if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_STDFONTS, FALSE, &pItem))
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 355e68bd5c58..4cab48e79d8a 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -58,6 +58,8 @@
#include <ascfldlg.hrc>
#endif
+#include "vcl/metric.hxx"
+
using namespace ::com::sun::star;
@@ -180,11 +182,21 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
bDelPrinter = TRUE;
}
- const USHORT nCount = pPrt->GetFontCount();
- for (USHORT i = 0; i < nCount; ++i)
+
+ // get the set of disctinct available family names
+ std::set< String > aFontNames;
+ int nFontNames = pPrt->GetDevFontCount();
+ for( int i = 0; i < nFontNames; i++ )
+ {
+ FontInfo aInf( pPrt->GetDevFont( i ) );
+ aFontNames.insert( aInf.GetName() );
+ }
+
+ // insert to listbox
+ for( std::set< String >::const_iterator it = aFontNames.begin();
+ it != aFontNames.end(); ++it )
{
- const String &rStr = pPrt->GetFont(i)->GetName();
- aFontLB.InsertEntry( rStr );
+ aFontLB.InsertEntry( *it );
}
if( !aOpt.GetFontName().Len() )
diff --git a/sw/source/ui/dochdl/dochdl.src b/sw/source/ui/dochdl/dochdl.src
index f92ea43681d8..f92ea43681d8 100644..100755
--- a/sw/source/ui/dochdl/dochdl.src
+++ b/sw/source/ui/dochdl/dochdl.src
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index cc789d6e4498..cc789d6e4498 100644..100755
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index d0d8f2cb804a..2b1c9366707e 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -223,7 +223,6 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
SW_DLLPRIVATE virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions );
- SW_DLLPRIVATE virtual PrintDialog* CreatePrintDialog( Window *pParent );
SW_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, BOOL bInner );
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index e48f78f9aa96..c3dfd0f07b2a 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -27,7 +27,7 @@
#ifndef _UITOOL_HXX
#define _UITOOL_HXX
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/field.hxx>
#include <swtypes.hxx>
#include "swdllapi.h"
diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx
index 0758f89af8bf..854b12d4f40e 100644
--- a/sw/source/ui/inc/usrpref.hxx
+++ b/sw/source/ui/inc/usrpref.hxx
@@ -32,7 +32,7 @@
#include <unotools/configitem.hxx>
#include <fldupde.hxx>
#include "viewopt.hxx"
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
/* -----------------------------28.09.00 09:45--------------------------------
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 78817eec874c..0c92d7fdeb65 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -57,7 +57,6 @@ class SvxRuler;
class SvxLRSpaceItem;
class SwDocShell;
class SwScrollbar;
-class PrintDialog;
class SvxVCBrowser;
class SvBorder;
class Ruler;
@@ -355,7 +354,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
// Methoden fuers Printing
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE );
- SW_DLLPRIVATE virtual PrintDialog* CreatePrintDialog( Window* pParent );
SfxTabPage* CreatePrintOptionsPage( Window* pParent,
const SfxItemSet& rSet);
// fuer Readonly-Umschaltung
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index e9bb702b3d66..e9bb702b3d66 100755..100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 37d5e1ed5d69..37d5e1ed5d69 100755..100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index addf6f9db512..fd5d57ae35c0 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -35,7 +35,6 @@
#include <vcl/help.hxx>
#include <vcl/cmdevt.hxx>
#include <vcl/button.hxx>
-#include <svtools/printdlg.hxx>
#include <svl/whiter.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
@@ -1985,18 +1984,6 @@ SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
--------------------------------------------------------------------*/
-PrintDialog* SwPagePreView::CreatePrintDialog( Window *pParent )
-{
- PrintDialog *pDlg = ::CreatePrintDialog( pParent, 1, 0 );
- pDlg->DisableRange( PRINTDIALOG_SELECTION );
- return pDlg;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
// OD 18.12.2002 #103492# - no longer needed ??
Size SwPagePreView::GetOptimalSizePixel() const
{
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 5abe83c3a53d..5c440d55883e 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -39,7 +39,6 @@
#include <svl/eitem.hxx>
#include <unotools/undoopt.hxx>
#include <unotools/lingucfg.hxx>
-#include <svtools/printdlg.hxx>
#include <unotools/useroptions.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
@@ -183,7 +182,7 @@ void SwView::ImpSetVerb( int nSelType )
}
if ( bResetVerbs )
{
- SetVerbs( 0 );
+ SetVerbs( Sequence< embed::VerbDescriptor >() );
bVerbsActive = sal_False;
}
}
diff --git a/sw/source/ui/uiview/view.hrc b/sw/source/ui/uiview/view.hrc
index d2aa60494801..d2aa60494801 100755..100644
--- a/sw/source/ui/uiview/view.hrc
+++ b/sw/source/ui/uiview/view.hrc
diff --git a/sw/source/ui/uiview/viewfunc.hxx b/sw/source/ui/uiview/viewfunc.hxx
index f04db152ec2f..6da6c01bbda4 100644
--- a/sw/source/ui/uiview/viewfunc.hxx
+++ b/sw/source/ui/uiview/viewfunc.hxx
@@ -30,7 +30,6 @@
class ImageButton;
class Point;
-class PrintDialog;
class SfxItemSet;
class SfxPrinter;
class SfxTabPage;
@@ -42,7 +41,6 @@ class Window;
class SwWrtShell;
// folgende Funktionen stehen im viewprt.cxx
-PrintDialog* CreatePrintDialog( Window* , USHORT, SwWrtShell* );
void SetPrinter( IDocumentDeviceAccess*, SfxPrinter*, BOOL bWeb );
SfxTabPage* CreatePrintOptionsPage( Window*, const SfxItemSet& );
void SetAppPrintOptions( ViewShell* pSh, BOOL bWeb );
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index b3f73f7c38e4..b3f73f7c38e4 100644..100755
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 7ddc594dd223..3fdc6f6d61d3 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -49,7 +49,6 @@
#include <svl/flagitem.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/oldprintadaptor.hxx>
-#include <svtools/printdlg.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/prnmon.hxx>
#include <editeng/paperinf.hxx>
@@ -183,42 +182,6 @@ SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent,
}
/*--------------------------------------------------------------------
- Beschreibung: Druckerdialog
- --------------------------------------------------------------------*/
-
-PrintDialog* CreatePrintDialog( Window* pParent, USHORT nPg, SwWrtShell* pSh )
-{
- PrintDialog *pDlg = new PrintDialog( pParent, false );
-// pDlg->ChangeFirstPage( 1 );
-
- if ( !nPg )
- nPg = 1;
-// pDlg->ChangeLastPage( nPg );
-// pDlg->ChangeMaxPage( 9999 );
- pDlg->EnableRange( PRINTDIALOG_FROMTO );
-
- if (pSh && (pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected()))
- pDlg->EnableRange( PRINTDIALOG_SELECTION );
-
- pDlg->SetRangeText( String::CreateFromInt32(nPg) );
- pDlg->EnableRange( PRINTDIALOG_RANGE );
- pDlg->EnableCollate();
- return pDlg;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-PrintDialog* __EXPORT SwView::CreatePrintDialog( Window* pParent )
-{
- // AMA: Hier sollte vielleicht die virtuelle Seitennummer angezeigt werden,
- // aber nur, wenn das Drucken virtuelle Seitennummern und nicht wie
- // bisher (auch beim SWG 2.0) physikalische beachtet werden.
- return ::CreatePrintDialog( pParent, GetWrtShell().GetPhyPageNum(), &GetWrtShell() );
-}
-
-/*--------------------------------------------------------------------
Beschreibung: Print-Dispatcher
--------------------------------------------------------------------*/
diff --git a/sysui/desktop/icons/so7-base-doc.ico b/sysui/desktop/icons/so7-base-doc.ico
index e4beab7270e1..e4beab7270e1 100755..100644
--- a/sysui/desktop/icons/so7-base-doc.ico
+++ b/sysui/desktop/icons/so7-base-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-doc.ico b/sysui/desktop/icons/so7-calc-doc.ico
index 8b34fc606c5d..8b34fc606c5d 100755..100644
--- a/sysui/desktop/icons/so7-calc-doc.ico
+++ b/sysui/desktop/icons/so7-calc-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-tem.ico b/sysui/desktop/icons/so7-calc-tem.ico
index d074a214a90b..d074a214a90b 100755..100644
--- a/sysui/desktop/icons/so7-calc-tem.ico
+++ b/sysui/desktop/icons/so7-calc-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-chart-doc.ico b/sysui/desktop/icons/so7-chart-doc.ico
index bdc613fb30e2..bdc613fb30e2 100755..100644
--- a/sysui/desktop/icons/so7-chart-doc.ico
+++ b/sysui/desktop/icons/so7-chart-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-doc.ico b/sysui/desktop/icons/so7-draw-doc.ico
index c2881862053a..c2881862053a 100755..100644
--- a/sysui/desktop/icons/so7-draw-doc.ico
+++ b/sysui/desktop/icons/so7-draw-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-tem.ico b/sysui/desktop/icons/so7-draw-tem.ico
index 8d713d0f470e..8d713d0f470e 100755..100644
--- a/sysui/desktop/icons/so7-draw-tem.ico
+++ b/sysui/desktop/icons/so7-draw-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-doc.ico b/sysui/desktop/icons/so7-impress-doc.ico
index a8f9518e624b..a8f9518e624b 100755..100644
--- a/sysui/desktop/icons/so7-impress-doc.ico
+++ b/sysui/desktop/icons/so7-impress-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-tem.ico b/sysui/desktop/icons/so7-impress-tem.ico
index ac140b269242..ac140b269242 100755..100644
--- a/sysui/desktop/icons/so7-impress-tem.ico
+++ b/sysui/desktop/icons/so7-impress-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-master-doc.ico b/sysui/desktop/icons/so7-master-doc.ico
index 1c3068715990..1c3068715990 100755..100644
--- a/sysui/desktop/icons/so7-master-doc.ico
+++ b/sysui/desktop/icons/so7-master-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-math-doc.ico b/sysui/desktop/icons/so7-math-doc.ico
index d1cd9bd4c6bd..d1cd9bd4c6bd 100755..100644
--- a/sysui/desktop/icons/so7-math-doc.ico
+++ b/sysui/desktop/icons/so7-math-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-doc.ico b/sysui/desktop/icons/so7-writer-doc.ico
index b8eb3df20564..b8eb3df20564 100755..100644
--- a/sysui/desktop/icons/so7-writer-doc.ico
+++ b/sysui/desktop/icons/so7-writer-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-tem.ico b/sysui/desktop/icons/so7-writer-tem.ico
index 318cce4bc9a7..318cce4bc9a7 100755..100644
--- a/sysui/desktop/icons/so7-writer-tem.ico
+++ b/sysui/desktop/icons/so7-writer-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-app.ico b/sysui/desktop/icons/so8-base-app.ico
index 4a22d3529614..4a22d3529614 100755..100644
--- a/sysui/desktop/icons/so8-base-app.ico
+++ b/sysui/desktop/icons/so8-base-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-doc.ico b/sysui/desktop/icons/so8-base-doc.ico
index bcddbf957630..bcddbf957630 100755..100644
--- a/sysui/desktop/icons/so8-base-doc.ico
+++ b/sysui/desktop/icons/so8-base-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-app.ico b/sysui/desktop/icons/so8-calc-app.ico
index a28cab56157b..a28cab56157b 100755..100644
--- a/sysui/desktop/icons/so8-calc-app.ico
+++ b/sysui/desktop/icons/so8-calc-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-doc.ico b/sysui/desktop/icons/so8-calc-doc.ico
index 5f293dd82c30..5f293dd82c30 100755..100644
--- a/sysui/desktop/icons/so8-calc-doc.ico
+++ b/sysui/desktop/icons/so8-calc-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-tem.ico b/sysui/desktop/icons/so8-calc-tem.ico
index 98bf90678573..98bf90678573 100755..100644
--- a/sysui/desktop/icons/so8-calc-tem.ico
+++ b/sysui/desktop/icons/so8-calc-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-chart-doc.ico b/sysui/desktop/icons/so8-chart-doc.ico
index 01ff8365434b..01ff8365434b 100755..100644
--- a/sysui/desktop/icons/so8-chart-doc.ico
+++ b/sysui/desktop/icons/so8-chart-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-configuration.ico b/sysui/desktop/icons/so8-configuration.ico
index 57f3b6701b30..57f3b6701b30 100755..100644
--- a/sysui/desktop/icons/so8-configuration.ico
+++ b/sysui/desktop/icons/so8-configuration.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-app.ico b/sysui/desktop/icons/so8-draw-app.ico
index 6003ccb3d7c3..6003ccb3d7c3 100755..100644
--- a/sysui/desktop/icons/so8-draw-app.ico
+++ b/sysui/desktop/icons/so8-draw-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-doc.ico b/sysui/desktop/icons/so8-draw-doc.ico
index f4f169bd6fb5..f4f169bd6fb5 100755..100644
--- a/sysui/desktop/icons/so8-draw-doc.ico
+++ b/sysui/desktop/icons/so8-draw-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-tem.ico b/sysui/desktop/icons/so8-draw-tem.ico
index d3f63c38dbe0..d3f63c38dbe0 100755..100644
--- a/sysui/desktop/icons/so8-draw-tem.ico
+++ b/sysui/desktop/icons/so8-draw-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-doc.ico b/sysui/desktop/icons/so8-empty-doc.ico
index b71d2b939ca7..b71d2b939ca7 100755..100644
--- a/sysui/desktop/icons/so8-empty-doc.ico
+++ b/sysui/desktop/icons/so8-empty-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-tem.ico b/sysui/desktop/icons/so8-empty-tem.ico
index 9368b0a81aef..9368b0a81aef 100755..100644
--- a/sysui/desktop/icons/so8-empty-tem.ico
+++ b/sysui/desktop/icons/so8-empty-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-image-doc.ico b/sysui/desktop/icons/so8-image-doc.ico
index 11b4f0f6c718..11b4f0f6c718 100755..100644
--- a/sysui/desktop/icons/so8-image-doc.ico
+++ b/sysui/desktop/icons/so8-image-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-app.ico b/sysui/desktop/icons/so8-impress-app.ico
index 8fae43dab26d..8fae43dab26d 100755..100644
--- a/sysui/desktop/icons/so8-impress-app.ico
+++ b/sysui/desktop/icons/so8-impress-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-doc.ico b/sysui/desktop/icons/so8-impress-doc.ico
index 9a91f89f2900..9a91f89f2900 100755..100644
--- a/sysui/desktop/icons/so8-impress-doc.ico
+++ b/sysui/desktop/icons/so8-impress-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-tem.ico b/sysui/desktop/icons/so8-impress-tem.ico
index f84f813f992c..f84f813f992c 100755..100644
--- a/sysui/desktop/icons/so8-impress-tem.ico
+++ b/sysui/desktop/icons/so8-impress-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-macro-doc.ico b/sysui/desktop/icons/so8-macro-doc.ico
index f3742e1274e7..f3742e1274e7 100755..100644
--- a/sysui/desktop/icons/so8-macro-doc.ico
+++ b/sysui/desktop/icons/so8-macro-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-main-app.ico b/sysui/desktop/icons/so8-main-app.ico
index aa044ad9c702..aa044ad9c702 100755..100644
--- a/sysui/desktop/icons/so8-main-app.ico
+++ b/sysui/desktop/icons/so8-main-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-master-doc.ico b/sysui/desktop/icons/so8-master-doc.ico
index 27a1d2f61c49..27a1d2f61c49 100755..100644
--- a/sysui/desktop/icons/so8-master-doc.ico
+++ b/sysui/desktop/icons/so8-master-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-app.ico b/sysui/desktop/icons/so8-math-app.ico
index 956c259c756a..956c259c756a 100755..100644
--- a/sysui/desktop/icons/so8-math-app.ico
+++ b/sysui/desktop/icons/so8-math-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-doc.ico b/sysui/desktop/icons/so8-math-doc.ico
index e7b88449999f..e7b88449999f 100755..100644
--- a/sysui/desktop/icons/so8-math-doc.ico
+++ b/sysui/desktop/icons/so8-math-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-open.ico b/sysui/desktop/icons/so8-open.ico
index b77a741b338f..b77a741b338f 100755..100644
--- a/sysui/desktop/icons/so8-open.ico
+++ b/sysui/desktop/icons/so8-open.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-printer.ico b/sysui/desktop/icons/so8-printer.ico
index 25e61f8de5d5..25e61f8de5d5 100755..100644
--- a/sysui/desktop/icons/so8-printer.ico
+++ b/sysui/desktop/icons/so8-printer.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-web-doc.ico b/sysui/desktop/icons/so8-web-doc.ico
index 12eeb63cffb2..12eeb63cffb2 100755..100644
--- a/sysui/desktop/icons/so8-web-doc.ico
+++ b/sysui/desktop/icons/so8-web-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-app.ico b/sysui/desktop/icons/so8-writer-app.ico
index 15f7f92d4b45..15f7f92d4b45 100755..100644
--- a/sysui/desktop/icons/so8-writer-app.ico
+++ b/sysui/desktop/icons/so8-writer-app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-doc.ico b/sysui/desktop/icons/so8-writer-doc.ico
index da774be1d3ac..da774be1d3ac 100755..100644
--- a/sysui/desktop/icons/so8-writer-doc.ico
+++ b/sysui/desktop/icons/so8-writer-doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-tem.ico b/sysui/desktop/icons/so8-writer-tem.ico
index 1bdb86c8090f..1bdb86c8090f 100755..100644
--- a/sysui/desktop/icons/so8-writer-tem.ico
+++ b/sysui/desktop/icons/so8-writer-tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_doc.ico b/sysui/desktop/icons/so9_base_doc.ico
index 8cc1d4433c2c..8cc1d4433c2c 100755..100644
--- a/sysui/desktop/icons/so9_base_doc.ico
+++ b/sysui/desktop/icons/so9_base_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_doc.ico b/sysui/desktop/icons/so9_calc_doc.ico
index 2b9e514cb97b..2b9e514cb97b 100755..100644
--- a/sysui/desktop/icons/so9_calc_doc.ico
+++ b/sysui/desktop/icons/so9_calc_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_tem.ico b/sysui/desktop/icons/so9_calc_tem.ico
index 17f4823c4374..17f4823c4374 100755..100644
--- a/sysui/desktop/icons/so9_calc_tem.ico
+++ b/sysui/desktop/icons/so9_calc_tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_chart_doc.ico b/sysui/desktop/icons/so9_chart_doc.ico
index b116c81903b3..b116c81903b3 100755..100644
--- a/sysui/desktop/icons/so9_chart_doc.ico
+++ b/sysui/desktop/icons/so9_chart_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_doc.ico b/sysui/desktop/icons/so9_draw_doc.ico
index 51f95046709a..51f95046709a 100755..100644
--- a/sysui/desktop/icons/so9_draw_doc.ico
+++ b/sysui/desktop/icons/so9_draw_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_tem.ico b/sysui/desktop/icons/so9_draw_tem.ico
index e4b341175bff..e4b341175bff 100755..100644
--- a/sysui/desktop/icons/so9_draw_tem.ico
+++ b/sysui/desktop/icons/so9_draw_tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_doc.ico b/sysui/desktop/icons/so9_empty_doc.ico
index a3970775e3ed..a3970775e3ed 100755..100644
--- a/sysui/desktop/icons/so9_empty_doc.ico
+++ b/sysui/desktop/icons/so9_empty_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_tem.ico b/sysui/desktop/icons/so9_empty_tem.ico
index 1b0088b80277..1b0088b80277 100755..100644
--- a/sysui/desktop/icons/so9_empty_tem.ico
+++ b/sysui/desktop/icons/so9_empty_tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_global_doc.ico b/sysui/desktop/icons/so9_global_doc.ico
index ea4ccb383956..ea4ccb383956 100755..100644
--- a/sysui/desktop/icons/so9_global_doc.ico
+++ b/sysui/desktop/icons/so9_global_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_html_doc.ico b/sysui/desktop/icons/so9_html_doc.ico
index 4e5b8bc99c07..4e5b8bc99c07 100755..100644
--- a/sysui/desktop/icons/so9_html_doc.ico
+++ b/sysui/desktop/icons/so9_html_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_doc.ico b/sysui/desktop/icons/so9_impress_doc.ico
index 5258a8b6aa4c..5258a8b6aa4c 100755..100644
--- a/sysui/desktop/icons/so9_impress_doc.ico
+++ b/sysui/desktop/icons/so9_impress_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_tem.ico b/sysui/desktop/icons/so9_impress_tem.ico
index dcdbddb3b654..dcdbddb3b654 100755..100644
--- a/sysui/desktop/icons/so9_impress_tem.ico
+++ b/sysui/desktop/icons/so9_impress_tem.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_macro_doc.ico b/sysui/desktop/icons/so9_macro_doc.ico
index cd004015e63f..cd004015e63f 100755..100644
--- a/sysui/desktop/icons/so9_macro_doc.ico
+++ b/sysui/desktop/icons/so9_macro_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_doc.ico b/sysui/desktop/icons/so9_math_doc.ico
index 622ae939d23a..622ae939d23a 100755..100644
--- a/sysui/desktop/icons/so9_math_doc.ico
+++ b/sysui/desktop/icons/so9_math_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_doc.ico b/sysui/desktop/icons/so9_writer_doc.ico
index b0cf11a993c9..b0cf11a993c9 100755..100644
--- a/sysui/desktop/icons/so9_writer_doc.ico
+++ b/sysui/desktop/icons/so9_writer_doc.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_tem.ico b/sysui/desktop/icons/so9_writer_tem.ico
index 2e62a1934646..2e62a1934646 100755..100644
--- a/sysui/desktop/icons/so9_writer_tem.ico
+++ b/sysui/desktop/icons/so9_writer_tem.ico
Binary files differ
diff --git a/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas b/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas
index 83ac7f78c3c9..83ac7f78c3c9 100755..100644
--- a/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas
+++ b/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas
diff --git a/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas b/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas
index 6feedeb8004e..6feedeb8004e 100755..100644
--- a/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas
+++ b/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas
diff --git a/testautomation/chart2/optional/ch2_xml_format.bas b/testautomation/chart2/optional/ch2_xml_format.bas
index 25f5d751b58f..25f5d751b58f 100755..100644
--- a/testautomation/chart2/optional/ch2_xml_format.bas
+++ b/testautomation/chart2/optional/ch2_xml_format.bas
diff --git a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
index 0151f5021b3e..0151f5021b3e 100644..100755
--- a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
+++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
index b530b0c2a364..b530b0c2a364 100644..100755
--- a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
+++ b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc
index a89e8fad80d8..a89e8fad80d8 100644..100755
--- a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc
+++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc
diff --git a/testautomation/chart2/required/ch2_updt_calc.bas b/testautomation/chart2/required/ch2_updt_calc.bas
index 02cc2c883269..02cc2c883269 100644..100755
--- a/testautomation/chart2/required/ch2_updt_calc.bas
+++ b/testautomation/chart2/required/ch2_updt_calc.bas
diff --git a/testautomation/chart2/required/includes/ch2_file.inc b/testautomation/chart2/required/includes/ch2_file.inc
index f7166df9c82e..f7166df9c82e 100644..100755
--- a/testautomation/chart2/required/includes/ch2_file.inc
+++ b/testautomation/chart2/required/includes/ch2_file.inc
diff --git a/testautomation/chart2/required/includes/ch2_format.inc b/testautomation/chart2/required/includes/ch2_format.inc
index 42048cbbb7de..42048cbbb7de 100644..100755
--- a/testautomation/chart2/required/includes/ch2_format.inc
+++ b/testautomation/chart2/required/includes/ch2_format.inc
diff --git a/testautomation/chart2/required/includes/ch2_format1.inc b/testautomation/chart2/required/includes/ch2_format1.inc
index dbe1de149c9c..dbe1de149c9c 100644..100755
--- a/testautomation/chart2/required/includes/ch2_format1.inc
+++ b/testautomation/chart2/required/includes/ch2_format1.inc
diff --git a/testautomation/chart2/required/includes/ch2_insert.inc b/testautomation/chart2/required/includes/ch2_insert.inc
index 79923a8198c6..79923a8198c6 100644..100755
--- a/testautomation/chart2/required/includes/ch2_insert.inc
+++ b/testautomation/chart2/required/includes/ch2_insert.inc
diff --git a/testautomation/chart2/required/includes/ch2_insert_ctl.inc b/testautomation/chart2/required/includes/ch2_insert_ctl.inc
index d01f9f8eee5f..d01f9f8eee5f 100644..100755
--- a/testautomation/chart2/required/includes/ch2_insert_ctl.inc
+++ b/testautomation/chart2/required/includes/ch2_insert_ctl.inc
diff --git a/testautomation/chart2/required/includes/ch2_menu.inc b/testautomation/chart2/required/includes/ch2_menu.inc
index d7f5efbee3a5..d7f5efbee3a5 100644..100755
--- a/testautomation/chart2/required/includes/ch2_menu.inc
+++ b/testautomation/chart2/required/includes/ch2_menu.inc
diff --git a/testautomation/chart2/required/includes/ch2_ole.inc b/testautomation/chart2/required/includes/ch2_ole.inc
index 6daf6545de41..6daf6545de41 100644..100755
--- a/testautomation/chart2/required/includes/ch2_ole.inc
+++ b/testautomation/chart2/required/includes/ch2_ole.inc
diff --git a/testautomation/chart2/required/includes/ch2_toolbars.inc b/testautomation/chart2/required/includes/ch2_toolbars.inc
index 32eed54ee370..32eed54ee370 100644..100755
--- a/testautomation/chart2/required/includes/ch2_toolbars.inc
+++ b/testautomation/chart2/required/includes/ch2_toolbars.inc
diff --git a/testautomation/chart2/required/includes/ch2_view.inc b/testautomation/chart2/required/includes/ch2_view.inc
index 39beac14839c..39beac14839c 100644..100755
--- a/testautomation/chart2/required/includes/ch2_view.inc
+++ b/testautomation/chart2/required/includes/ch2_view.inc
diff --git a/testautomation/chart2/required/includes/ch2_window.inc b/testautomation/chart2/required/includes/ch2_window.inc
index 407898e228d1..407898e228d1 100644..100755
--- a/testautomation/chart2/required/includes/ch2_window.inc
+++ b/testautomation/chart2/required/includes/ch2_window.inc
diff --git a/testautomation/chart2/required/includes/ch2_wizard.inc b/testautomation/chart2/required/includes/ch2_wizard.inc
index df97ba6bda43..df97ba6bda43 100644..100755
--- a/testautomation/chart2/required/includes/ch2_wizard.inc
+++ b/testautomation/chart2/required/includes/ch2_wizard.inc
diff --git a/testautomation/chart2/tools/ch_tools_axes.inc b/testautomation/chart2/tools/ch_tools_axes.inc
index ef897fbc345f..ef897fbc345f 100644..100755
--- a/testautomation/chart2/tools/ch_tools_axes.inc
+++ b/testautomation/chart2/tools/ch_tools_axes.inc
diff --git a/testautomation/chart2/tools/ch_tools_chart_type.inc b/testautomation/chart2/tools/ch_tools_chart_type.inc
index 7cf0a1e7d61b..7cf0a1e7d61b 100644..100755
--- a/testautomation/chart2/tools/ch_tools_chart_type.inc
+++ b/testautomation/chart2/tools/ch_tools_chart_type.inc
diff --git a/testautomation/chart2/tools/ch_tools_data_labels.inc b/testautomation/chart2/tools/ch_tools_data_labels.inc
index 879ddae59361..879ddae59361 100644..100755
--- a/testautomation/chart2/tools/ch_tools_data_labels.inc
+++ b/testautomation/chart2/tools/ch_tools_data_labels.inc
diff --git a/testautomation/chart2/tools/ch_tools_grids.inc b/testautomation/chart2/tools/ch_tools_grids.inc
index d909ef7426e1..d909ef7426e1 100644..100755
--- a/testautomation/chart2/tools/ch_tools_grids.inc
+++ b/testautomation/chart2/tools/ch_tools_grids.inc
diff --git a/testautomation/chart2/tools/ch_tools_legend.inc b/testautomation/chart2/tools/ch_tools_legend.inc
index 9c16c71d1af7..9c16c71d1af7 100644..100755
--- a/testautomation/chart2/tools/ch_tools_legend.inc
+++ b/testautomation/chart2/tools/ch_tools_legend.inc
diff --git a/testautomation/chart2/tools/ch_tools_select.inc b/testautomation/chart2/tools/ch_tools_select.inc
index 8df51c8d9279..8df51c8d9279 100644..100755
--- a/testautomation/chart2/tools/ch_tools_select.inc
+++ b/testautomation/chart2/tools/ch_tools_select.inc
diff --git a/testautomation/chart2/tools/ch_tools_statistics.inc b/testautomation/chart2/tools/ch_tools_statistics.inc
index 59bd74496113..59bd74496113 100644..100755
--- a/testautomation/chart2/tools/ch_tools_statistics.inc
+++ b/testautomation/chart2/tools/ch_tools_statistics.inc
diff --git a/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc b/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc
index 4d9847615782..4d9847615782 100644..100755
--- a/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc
+++ b/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc
diff --git a/testautomation/chart2/tools/ch_tools_tab_pages.inc b/testautomation/chart2/tools/ch_tools_tab_pages.inc
index 63d88d35c3ff..63d88d35c3ff 100644..100755
--- a/testautomation/chart2/tools/ch_tools_tab_pages.inc
+++ b/testautomation/chart2/tools/ch_tools_tab_pages.inc
diff --git a/testautomation/chart2/tools/ch_tools_titles.inc b/testautomation/chart2/tools/ch_tools_titles.inc
index c3b64a6fa8f7..c3b64a6fa8f7 100644..100755
--- a/testautomation/chart2/tools/ch_tools_titles.inc
+++ b/testautomation/chart2/tools/ch_tools_titles.inc
diff --git a/testautomation/dbaccess/optional/dba_misc_Macros.bas b/testautomation/dbaccess/optional/dba_misc_Macros.bas
index 659396bb98aa..659396bb98aa 100755..100644
--- a/testautomation/dbaccess/optional/dba_misc_Macros.bas
+++ b/testautomation/dbaccess/optional/dba_misc_Macros.bas
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc b/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc
index 020f0bb8435b..020f0bb8435b 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Grid.inc b/testautomation/dbaccess/optional/includes/ctrl_Grid.inc
index 4b41014a2257..4b41014a2257 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_Grid.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Grid.inc
diff --git a/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc b/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc
index f51b14ea191b..f51b14ea191b 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Several1.inc b/testautomation/dbaccess/optional/includes/ctrl_Several1.inc
index 4e0cd9334800..4e0cd9334800 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_Several1.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Several1.inc
diff --git a/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc b/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc
index 57a7973a8f89..57a7973a8f89 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc
diff --git a/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc b/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc
index 4abf5a19b73d..4abf5a19b73d 100644..100755
--- a/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc
+++ b/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc
diff --git a/testautomation/dbaccess/optional/includes/db_ADOAccess.inc b/testautomation/dbaccess/optional/includes/db_ADOAccess.inc
index aeb14d7616ac..aeb14d7616ac 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_ADOAccess.inc
+++ b/testautomation/dbaccess/optional/includes/db_ADOAccess.inc
diff --git a/testautomation/dbaccess/optional/includes/db_AdabasD.inc b/testautomation/dbaccess/optional/includes/db_AdabasD.inc
index d5498582fa0a..d5498582fa0a 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_AdabasD.inc
+++ b/testautomation/dbaccess/optional/includes/db_AdabasD.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Dbase.inc b/testautomation/dbaccess/optional/includes/db_Dbase.inc
index 7b5a67e7496d..7b5a67e7496d 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Dbase.inc
+++ b/testautomation/dbaccess/optional/includes/db_Dbase.inc
diff --git a/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc b/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc
index 6d690a29225a..6d690a29225a 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc
+++ b/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc
diff --git a/testautomation/dbaccess/optional/includes/db_IndexDesign.inc b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
index a41f2b396042..a41f2b396042 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
+++ b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
index 93f864d7e0d4..93f864d7e0d4 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
+++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
diff --git a/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc
index 0fd0a8bcfb5f..0fd0a8bcfb5f 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc
+++ b/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Query.inc b/testautomation/dbaccess/optional/includes/db_Query.inc
index 46dce6e903c6..46dce6e903c6 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Query.inc
+++ b/testautomation/dbaccess/optional/includes/db_Query.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Relations.inc b/testautomation/dbaccess/optional/includes/db_Relations.inc
index 98a94562c743..98a94562c743 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Relations.inc
+++ b/testautomation/dbaccess/optional/includes/db_Relations.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc b/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc
index 87eb5e1ce240..87eb5e1ce240 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc
+++ b/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Text.inc b/testautomation/dbaccess/optional/includes/db_Text.inc
index 6130aee378b8..6130aee378b8 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Text.inc
+++ b/testautomation/dbaccess/optional/includes/db_Text.inc
diff --git a/testautomation/dbaccess/optional/includes/db_Windows.inc b/testautomation/dbaccess/optional/includes/db_Windows.inc
index 6d675f2dd07f..6d675f2dd07f 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_Windows.inc
+++ b/testautomation/dbaccess/optional/includes/db_Windows.inc
diff --git a/testautomation/dbaccess/optional/includes/db_hsqldb.inc b/testautomation/dbaccess/optional/includes/db_hsqldb.inc
index 061f786017ba..061f786017ba 100644..100755
--- a/testautomation/dbaccess/optional/includes/db_hsqldb.inc
+++ b/testautomation/dbaccess/optional/includes/db_hsqldb.inc
diff --git a/testautomation/dbaccess/optional/includes/misc_Macros.inc b/testautomation/dbaccess/optional/includes/misc_Macros.inc
index e707682e3218..e707682e3218 100644..100755
--- a/testautomation/dbaccess/optional/includes/misc_Macros.inc
+++ b/testautomation/dbaccess/optional/includes/misc_Macros.inc
diff --git a/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc b/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc
index 7e9eabf664d9..7e9eabf664d9 100644..100755
--- a/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc
+++ b/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_DateTime.inc b/testautomation/dbaccess/optional/includes/rpt_DateTime.inc
index 53c9570a5d75..53c9570a5d75 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_DateTime.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_DateTime.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
index 91270481ca7b..91270481ca7b 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc b/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc
index 810b2168c3ce..810b2168c3ce 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_Grouping.inc b/testautomation/dbaccess/optional/includes/rpt_Grouping.inc
index 229aebb7f599..229aebb7f599 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_Grouping.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_Grouping.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc b/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc
index a7fae4c7ffd4..a7fae4c7ffd4 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc
diff --git a/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc b/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc
index b3ee038a2f81..b3ee038a2f81 100644..100755
--- a/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc
diff --git a/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc b/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc
index 34f6cb3e3ecf..34f6cb3e3ecf 100644..100755
--- a/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc
diff --git a/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc b/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc
index b3949b40ed49..b3949b40ed49 100644..100755
--- a/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc
diff --git a/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc b/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc
index 19411fd4f105..19411fd4f105 100644..100755
--- a/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc
diff --git a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
index 67010e64fbfb..67010e64fbfb 100644..100755
--- a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
diff --git a/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc b/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc
index cce02149942f..cce02149942f 100644..100755
--- a/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc
diff --git a/testautomation/dbaccess/required/includes/DatabaseTypes.inc b/testautomation/dbaccess/required/includes/DatabaseTypes.inc
index ae5688374c75..ae5688374c75 100644..100755
--- a/testautomation/dbaccess/required/includes/DatabaseTypes.inc
+++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc
diff --git a/testautomation/dbaccess/required/includes/Forms.inc b/testautomation/dbaccess/required/includes/Forms.inc
index 45c308f2b1f7..45c308f2b1f7 100644..100755
--- a/testautomation/dbaccess/required/includes/Forms.inc
+++ b/testautomation/dbaccess/required/includes/Forms.inc
diff --git a/testautomation/dbaccess/required/includes/MainApp.inc b/testautomation/dbaccess/required/includes/MainApp.inc
index fddb8d34667f..fddb8d34667f 100644..100755
--- a/testautomation/dbaccess/required/includes/MainApp.inc
+++ b/testautomation/dbaccess/required/includes/MainApp.inc
diff --git a/testautomation/dbaccess/required/includes/Query.inc b/testautomation/dbaccess/required/includes/Query.inc
index 0fa9d6addb24..0fa9d6addb24 100644..100755
--- a/testautomation/dbaccess/required/includes/Query.inc
+++ b/testautomation/dbaccess/required/includes/Query.inc
diff --git a/testautomation/dbaccess/required/includes/ReportBuilder01.inc b/testautomation/dbaccess/required/includes/ReportBuilder01.inc
index d1cce59d4d3f..d1cce59d4d3f 100644..100755
--- a/testautomation/dbaccess/required/includes/ReportBuilder01.inc
+++ b/testautomation/dbaccess/required/includes/ReportBuilder01.inc
diff --git a/testautomation/dbaccess/required/includes/Table.inc b/testautomation/dbaccess/required/includes/Table.inc
index 6d478bd35540..6d478bd35540 100644..100755
--- a/testautomation/dbaccess/required/includes/Table.inc
+++ b/testautomation/dbaccess/required/includes/Table.inc
diff --git a/testautomation/dbaccess/required/includes/TableDesign.inc b/testautomation/dbaccess/required/includes/TableDesign.inc
index 9da4d602a6d9..9da4d602a6d9 100644..100755
--- a/testautomation/dbaccess/required/includes/TableDesign.inc
+++ b/testautomation/dbaccess/required/includes/TableDesign.inc
diff --git a/testautomation/dbaccess/required/includes/Wizards.inc b/testautomation/dbaccess/required/includes/Wizards.inc
index 4cde075d0e35..4cde075d0e35 100644..100755
--- a/testautomation/dbaccess/required/includes/Wizards.inc
+++ b/testautomation/dbaccess/required/includes/Wizards.inc
diff --git a/testautomation/dbaccess/required/includes/Xforms01.inc b/testautomation/dbaccess/required/includes/Xforms01.inc
index fcf3e03a98ea..fcf3e03a98ea 100644..100755
--- a/testautomation/dbaccess/required/includes/Xforms01.inc
+++ b/testautomation/dbaccess/required/includes/Xforms01.inc
diff --git a/testautomation/dbaccess/tools/controltools.inc b/testautomation/dbaccess/tools/controltools.inc
index 28b0583c0b42..28b0583c0b42 100644..100755
--- a/testautomation/dbaccess/tools/controltools.inc
+++ b/testautomation/dbaccess/tools/controltools.inc
diff --git a/testautomation/dbaccess/tools/dbinit.inc b/testautomation/dbaccess/tools/dbinit.inc
index 53f192747926..53f192747926 100644..100755
--- a/testautomation/dbaccess/tools/dbinit.inc
+++ b/testautomation/dbaccess/tools/dbinit.inc
diff --git a/testautomation/dbaccess/tools/dbtools.inc b/testautomation/dbaccess/tools/dbtools.inc
index 2e40a3f25726..2e40a3f25726 100644..100755
--- a/testautomation/dbaccess/tools/dbtools.inc
+++ b/testautomation/dbaccess/tools/dbtools.inc
diff --git a/testautomation/dbaccess/tools/formtools.inc b/testautomation/dbaccess/tools/formtools.inc
index ef7105ccef22..ef7105ccef22 100644..100755
--- a/testautomation/dbaccess/tools/formtools.inc
+++ b/testautomation/dbaccess/tools/formtools.inc
diff --git a/testautomation/dbaccess/tools/querytools.inc b/testautomation/dbaccess/tools/querytools.inc
index 29416dac7bf3..29416dac7bf3 100644..100755
--- a/testautomation/dbaccess/tools/querytools.inc
+++ b/testautomation/dbaccess/tools/querytools.inc
diff --git a/testautomation/dbaccess/tools/tabletools.inc b/testautomation/dbaccess/tools/tabletools.inc
index 99c4abf723b3..99c4abf723b3 100644..100755
--- a/testautomation/dbaccess/tools/tabletools.inc
+++ b/testautomation/dbaccess/tools/tabletools.inc
diff --git a/testautomation/extensions/optional/includes/display_name.inc b/testautomation/extensions/optional/includes/display_name.inc
index 080c22fa3a98..080c22fa3a98 100644..100755
--- a/testautomation/extensions/optional/includes/display_name.inc
+++ b/testautomation/extensions/optional/includes/display_name.inc
diff --git a/testautomation/extensions/optional/includes/fileopen.inc b/testautomation/extensions/optional/includes/fileopen.inc
index 922e5ece9adc..922e5ece9adc 100644..100755
--- a/testautomation/extensions/optional/includes/fileopen.inc
+++ b/testautomation/extensions/optional/includes/fileopen.inc
diff --git a/testautomation/extensions/optional/includes/help.inc b/testautomation/extensions/optional/includes/help.inc
index 004fd70ac429..004fd70ac429 100644..100755
--- a/testautomation/extensions/optional/includes/help.inc
+++ b/testautomation/extensions/optional/includes/help.inc
diff --git a/testautomation/extensions/optional/includes/identifiers.inc b/testautomation/extensions/optional/includes/identifiers.inc
index 1a183f6c8025..1a183f6c8025 100644..100755
--- a/testautomation/extensions/optional/includes/identifiers.inc
+++ b/testautomation/extensions/optional/includes/identifiers.inc
diff --git a/testautomation/extensions/optional/includes/meta-inf.inc b/testautomation/extensions/optional/includes/meta-inf.inc
index 4d36586dd908..4d36586dd908 100644..100755
--- a/testautomation/extensions/optional/includes/meta-inf.inc
+++ b/testautomation/extensions/optional/includes/meta-inf.inc
diff --git a/testautomation/extensions/optional/includes/options.inc b/testautomation/extensions/optional/includes/options.inc
index ff30ba00847b..ff30ba00847b 100644..100755
--- a/testautomation/extensions/optional/includes/options.inc
+++ b/testautomation/extensions/optional/includes/options.inc
diff --git a/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/nbproject/private/config.properties b/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/nbproject/private/config.properties
index e69de29bb2d1..e69de29bb2d1 100644..100755
--- a/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/nbproject/private/config.properties
+++ b/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent/nbproject/private/config.properties
diff --git a/testautomation/extensions/optional/input/issues/Logging.xcu b/testautomation/extensions/optional/input/issues/Logging.xcu
index 8bf0f34b6f1b..8bf0f34b6f1b 100644..100755
--- a/testautomation/extensions/optional/input/issues/Logging.xcu
+++ b/testautomation/extensions/optional/input/issues/Logging.xcu
diff --git a/testautomation/extensions/required/e_update.bas b/testautomation/extensions/required/e_update.bas
index 89c85cb139fc..89c85cb139fc 100755..100644
--- a/testautomation/extensions/required/e_update.bas
+++ b/testautomation/extensions/required/e_update.bas
diff --git a/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc
index ab6e04c33e3a..ab6e04c33e3a 100644..100755
--- a/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc
+++ b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc
diff --git a/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc
index 13411aeb849f..13411aeb849f 100644..100755
--- a/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc
+++ b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc
diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc
index c35900b012e4..c35900b012e4 100644..100755
--- a/testautomation/framework/optional/includes/basic_delete_modules.inc
+++ b/testautomation/framework/optional/includes/basic_delete_modules.inc
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
index 89d5614c5b11..89d5614c5b11 100644..100755
--- a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc
index 7e6613cdfcbc..7e6613cdfcbc 100644..100755
--- a/testautomation/framework/optional/includes/basic_documents.inc
+++ b/testautomation/framework/optional/includes/basic_documents.inc
diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc
index 4d5ee502df66..4d5ee502df66 100644..100755
--- a/testautomation/framework/optional/includes/basic_eventbinding.inc
+++ b/testautomation/framework/optional/includes/basic_eventbinding.inc
diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc
index eabaadf3176a..eabaadf3176a 100644..100755
--- a/testautomation/framework/optional/includes/basic_ide.inc
+++ b/testautomation/framework/optional/includes/basic_ide.inc
diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc
index 9d539e2a82a0..9d539e2a82a0 100644..100755
--- a/testautomation/framework/optional/includes/basic_library_export.inc
+++ b/testautomation/framework/optional/includes/basic_library_export.inc
diff --git a/testautomation/framework/optional/includes/basic_library_import.inc b/testautomation/framework/optional/includes/basic_library_import.inc
index f6b62e99c7ea..f6b62e99c7ea 100644..100755
--- a/testautomation/framework/optional/includes/basic_library_import.inc
+++ b/testautomation/framework/optional/includes/basic_library_import.inc
diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc
index dc58e21f1dea..dc58e21f1dea 100644..100755
--- a/testautomation/framework/optional/includes/basic_macros.inc
+++ b/testautomation/framework/optional/includes/basic_macros.inc
diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc
index fe492590c41b..fe492590c41b 100644..100755
--- a/testautomation/framework/optional/includes/basic_modulehide.inc
+++ b/testautomation/framework/optional/includes/basic_modulehide.inc
diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc
index 6b166c54680a..6b166c54680a 100644..100755
--- a/testautomation/framework/optional/includes/basic_modulenames.inc
+++ b/testautomation/framework/optional/includes/basic_modulenames.inc
diff --git a/testautomation/framework/optional/includes/basic_modules.inc b/testautomation/framework/optional/includes/basic_modules.inc
index 14e3aedca6db..14e3aedca6db 100644..100755
--- a/testautomation/framework/optional/includes/basic_modules.inc
+++ b/testautomation/framework/optional/includes/basic_modules.inc
diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc
index b389c750e51d..b389c750e51d 100644..100755
--- a/testautomation/framework/optional/includes/basic_package_export.inc
+++ b/testautomation/framework/optional/includes/basic_package_export.inc
diff --git a/testautomation/framework/optional/includes/basic_protected_libraries.inc b/testautomation/framework/optional/includes/basic_protected_libraries.inc
index 6162352d710f..6162352d710f 100644..100755
--- a/testautomation/framework/optional/includes/basic_protected_libraries.inc
+++ b/testautomation/framework/optional/includes/basic_protected_libraries.inc
diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc
index 97ec55c91505..97ec55c91505 100644..100755
--- a/testautomation/framework/optional/includes/basic_usertemplate.inc
+++ b/testautomation/framework/optional/includes/basic_usertemplate.inc
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
index 81b2764a28f1..81b2764a28f1 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
index 970b8249a412..970b8249a412 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
index dfade69eaafb..dfade69eaafb 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc b/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
index 201dd8eb9862..201dd8eb9862 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
index 4c6f7c20a076..4c6f7c20a076 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
diff --git a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
index 8fc37badb55f..8fc37badb55f 100644..100755
--- a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
+++ b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
diff --git a/testautomation/framework/optional/includes/configuration.inc b/testautomation/framework/optional/includes/configuration.inc
index 0fce11bddd1b..0fce11bddd1b 100644..100755
--- a/testautomation/framework/optional/includes/configuration.inc
+++ b/testautomation/framework/optional/includes/configuration.inc
diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc
index b4de32acd917..b4de32acd917 100644..100755
--- a/testautomation/framework/optional/includes/extras_file_open.inc
+++ b/testautomation/framework/optional/includes/extras_file_open.inc
diff --git a/testautomation/framework/optional/includes/extras_preview.inc b/testautomation/framework/optional/includes/extras_preview.inc
index ca3a24ec9995..ca3a24ec9995 100644..100755
--- a/testautomation/framework/optional/includes/extras_preview.inc
+++ b/testautomation/framework/optional/includes/extras_preview.inc
diff --git a/testautomation/framework/optional/includes/extras_table_autoformat.inc b/testautomation/framework/optional/includes/extras_table_autoformat.inc
index 7ecb2ce9bf30..7ecb2ce9bf30 100644..100755
--- a/testautomation/framework/optional/includes/extras_table_autoformat.inc
+++ b/testautomation/framework/optional/includes/extras_table_autoformat.inc
diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc
index ef20c2a2f1e5..c52ae61c0945 100644
--- a/testautomation/framework/optional/includes/f_usage_tracking.inc
+++ b/testautomation/framework/optional/includes/f_usage_tracking.inc
@@ -100,7 +100,7 @@ testcase tUsageTracking3
kontext "Active"
if ( Active.exists( 2 ) ) then
- qaerrorlog( "Messagebox not required as control should not be enabled (see #i97340#)" )
+ warnlog( "Messagebox not required as control should not be enabled (see #i97340#)" )
Active.ok()
kontext "TextImport"
diff --git a/testautomation/framework/optional/includes/filedlg_allowed_names.inc b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
index a6d54077f4b5..a6d54077f4b5 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_allowed_names.inc
+++ b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
diff --git a/testautomation/framework/optional/includes/filedlg_autocomplete.inc b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
index bfa424378ef4..bfa424378ef4 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_autocomplete.inc
+++ b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
index f9a049c6dbc9..f9a049c6dbc9 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_cjk_files.inc
+++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
index cdeb2f922c98..cdeb2f922c98 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
+++ b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc
index 53917531e275..53917531e275 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_document_properties.inc
+++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc
diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc
index 1d0b91e2710d..1d0b91e2710d 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_filternames.inc
+++ b/testautomation/framework/optional/includes/filedlg_filternames.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders1.inc b/testautomation/framework/optional/includes/filedlg_folders1.inc
index 99cf0831f12c..99cf0831f12c 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders1.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders1.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders2.inc b/testautomation/framework/optional/includes/filedlg_folders2.inc
index e7b6f6e0dcbf..e7b6f6e0dcbf 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders2.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders2.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders3.inc b/testautomation/framework/optional/includes/filedlg_folders3.inc
index 354c95fbc23c..354c95fbc23c 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders3.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders3.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders4.inc b/testautomation/framework/optional/includes/filedlg_folders4.inc
index 6c0bbb881730..6c0bbb881730 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders4.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders4.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders5.inc b/testautomation/framework/optional/includes/filedlg_folders5.inc
index ed3959a6e7e4..ed3959a6e7e4 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders5.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders5.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders6.inc b/testautomation/framework/optional/includes/filedlg_folders6.inc
index e82589bbe1d0..e82589bbe1d0 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders6.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders6.inc
diff --git a/testautomation/framework/optional/includes/filedlg_folders7.inc b/testautomation/framework/optional/includes/filedlg_folders7.inc
index df9c399c7253..df9c399c7253 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_folders7.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders7.inc
diff --git a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
index b4b538b85cf6..b4b538b85cf6 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
+++ b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
diff --git a/testautomation/framework/optional/includes/filedlg_multiselection.inc b/testautomation/framework/optional/includes/filedlg_multiselection.inc
index 32754ec00553..32754ec00553 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_multiselection.inc
+++ b/testautomation/framework/optional/includes/filedlg_multiselection.inc
diff --git a/testautomation/framework/optional/includes/filedlg_passwords.inc b/testautomation/framework/optional/includes/filedlg_passwords.inc
index b9442cd2bfbd..b9442cd2bfbd 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_passwords.inc
+++ b/testautomation/framework/optional/includes/filedlg_passwords.inc
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
index 7758fbe55783..7758fbe55783 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
index 48ed1a59e4a3..48ed1a59e4a3 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
diff --git a/testautomation/framework/optional/includes/filedlg_tools.inc b/testautomation/framework/optional/includes/filedlg_tools.inc
index b04fdc3f92ec..b04fdc3f92ec 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_tools.inc
+++ b/testautomation/framework/optional/includes/filedlg_tools.inc
diff --git a/testautomation/framework/optional/includes/filedlg_triggers.inc b/testautomation/framework/optional/includes/filedlg_triggers.inc
index 1e39d2900895..1e39d2900895 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_triggers.inc
+++ b/testautomation/framework/optional/includes/filedlg_triggers.inc
diff --git a/testautomation/framework/optional/includes/fontworkgallery.inc b/testautomation/framework/optional/includes/fontworkgallery.inc
index c83ce1fb5740..c83ce1fb5740 100644..100755
--- a/testautomation/framework/optional/includes/fontworkgallery.inc
+++ b/testautomation/framework/optional/includes/fontworkgallery.inc
diff --git a/testautomation/framework/optional/includes/help_bookmarks.inc b/testautomation/framework/optional/includes/help_bookmarks.inc
index 04a16951c0a9..04a16951c0a9 100644..100755
--- a/testautomation/framework/optional/includes/help_bookmarks.inc
+++ b/testautomation/framework/optional/includes/help_bookmarks.inc
diff --git a/testautomation/framework/optional/includes/help_compare_applications.inc b/testautomation/framework/optional/includes/help_compare_applications.inc
index 3028c41ecedf..3028c41ecedf 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_applications.inc
+++ b/testautomation/framework/optional/includes/help_compare_applications.inc
diff --git a/testautomation/framework/optional/includes/help_compare_content.inc b/testautomation/framework/optional/includes/help_compare_content.inc
index 73c11940e0dc..73c11940e0dc 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_content.inc
+++ b/testautomation/framework/optional/includes/help_compare_content.inc
diff --git a/testautomation/framework/optional/includes/help_compare_topics.inc b/testautomation/framework/optional/includes/help_compare_topics.inc
index ef060eb18275..ef060eb18275 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_topics.inc
+++ b/testautomation/framework/optional/includes/help_compare_topics.inc
diff --git a/testautomation/framework/optional/includes/help_search.inc b/testautomation/framework/optional/includes/help_search.inc
index 92243b538c4f..92243b538c4f 100644..100755
--- a/testautomation/framework/optional/includes/help_search.inc
+++ b/testautomation/framework/optional/includes/help_search.inc
diff --git a/testautomation/framework/optional/includes/help_view_topics.inc b/testautomation/framework/optional/includes/help_view_topics.inc
index b14c5d5a8511..b14c5d5a8511 100644..100755
--- a/testautomation/framework/optional/includes/help_view_topics.inc
+++ b/testautomation/framework/optional/includes/help_view_topics.inc
diff --git a/testautomation/framework/optional/includes/loadsave_files.inc b/testautomation/framework/optional/includes/loadsave_files.inc
index a9eac8164c22..a9eac8164c22 100644..100755
--- a/testautomation/framework/optional/includes/loadsave_files.inc
+++ b/testautomation/framework/optional/includes/loadsave_files.inc
diff --git a/testautomation/framework/optional/includes/loadsave_new.inc b/testautomation/framework/optional/includes/loadsave_new.inc
index 02e734382fa2..02e734382fa2 100644..100755
--- a/testautomation/framework/optional/includes/loadsave_new.inc
+++ b/testautomation/framework/optional/includes/loadsave_new.inc
diff --git a/testautomation/framework/optional/includes/menuentries.inc b/testautomation/framework/optional/includes/menuentries.inc
index f2006915c8b1..f2006915c8b1 100644..100755
--- a/testautomation/framework/optional/includes/menuentries.inc
+++ b/testautomation/framework/optional/includes/menuentries.inc
diff --git a/testautomation/framework/optional/includes/ole_1.inc b/testautomation/framework/optional/includes/ole_1.inc
index de7efa3bae8d..de7efa3bae8d 100644..100755
--- a/testautomation/framework/optional/includes/ole_1.inc
+++ b/testautomation/framework/optional/includes/ole_1.inc
diff --git a/testautomation/framework/optional/includes/ole_2.inc b/testautomation/framework/optional/includes/ole_2.inc
index a45c885428fb..a45c885428fb 100644..100755
--- a/testautomation/framework/optional/includes/ole_2.inc
+++ b/testautomation/framework/optional/includes/ole_2.inc
diff --git a/testautomation/framework/optional/includes/ole_3.inc b/testautomation/framework/optional/includes/ole_3.inc
index 0636bfacb576..0636bfacb576 100644..100755
--- a/testautomation/framework/optional/includes/ole_3.inc
+++ b/testautomation/framework/optional/includes/ole_3.inc
diff --git a/testautomation/framework/optional/includes/ole_tools.inc b/testautomation/framework/optional/includes/ole_tools.inc
index fdcfb6c62166..fdcfb6c62166 100644..100755
--- a/testautomation/framework/optional/includes/ole_tools.inc
+++ b/testautomation/framework/optional/includes/ole_tools.inc
diff --git a/testautomation/framework/optional/includes/options_asia.inc b/testautomation/framework/optional/includes/options_asia.inc
index 76e990ca69fa..76e990ca69fa 100644..100755
--- a/testautomation/framework/optional/includes/options_asia.inc
+++ b/testautomation/framework/optional/includes/options_asia.inc
diff --git a/testautomation/framework/optional/includes/options_data.inc b/testautomation/framework/optional/includes/options_data.inc
index 4b60f9c99942..4b60f9c99942 100644..100755
--- a/testautomation/framework/optional/includes/options_data.inc
+++ b/testautomation/framework/optional/includes/options_data.inc
diff --git a/testautomation/framework/optional/includes/options_int1.inc b/testautomation/framework/optional/includes/options_int1.inc
index 9c79a79a7d97..9c79a79a7d97 100644..100755
--- a/testautomation/framework/optional/includes/options_int1.inc
+++ b/testautomation/framework/optional/includes/options_int1.inc
diff --git a/testautomation/framework/optional/includes/options_lan1.inc b/testautomation/framework/optional/includes/options_lan1.inc
index ac7f70d18de2..ac7f70d18de2 100644..100755
--- a/testautomation/framework/optional/includes/options_lan1.inc
+++ b/testautomation/framework/optional/includes/options_lan1.inc
diff --git a/testautomation/framework/optional/includes/options_loadsave_html.inc b/testautomation/framework/optional/includes/options_loadsave_html.inc
index d1b7790f539b..d1b7790f539b 100644..100755
--- a/testautomation/framework/optional/includes/options_loadsave_html.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_html.inc
diff --git a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
index c04a110e7ce5..c04a110e7ce5 100644..100755
--- a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
diff --git a/testautomation/framework/optional/includes/options_loadsave_vba.inc b/testautomation/framework/optional/includes/options_loadsave_vba.inc
index be367449553b..be367449553b 100644..100755
--- a/testautomation/framework/optional/includes/options_loadsave_vba.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_vba.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_accessibility.inc b/testautomation/framework/optional/includes/options_ooo_accessibility.inc
index 6e553bd336a3..6e553bd336a3 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_accessibility.inc
+++ b/testautomation/framework/optional/includes/options_ooo_accessibility.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_appearance.inc b/testautomation/framework/optional/includes/options_ooo_appearance.inc
index 72b016b72582..72b016b72582 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_appearance.inc
+++ b/testautomation/framework/optional/includes/options_ooo_appearance.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc
index ccf22af0680e..ccf22af0680e 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc
+++ b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_java.inc b/testautomation/framework/optional/includes/options_ooo_java.inc
index 4b3c1b9dd51d..4b3c1b9dd51d 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_java.inc
+++ b/testautomation/framework/optional/includes/options_ooo_java.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_memory.inc b/testautomation/framework/optional/includes/options_ooo_memory.inc
index 6c2038556af4..6c2038556af4 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_memory.inc
+++ b/testautomation/framework/optional/includes/options_ooo_memory.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_paths.inc b/testautomation/framework/optional/includes/options_ooo_paths.inc
index 85c797665a1e..85c797665a1e 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_paths.inc
+++ b/testautomation/framework/optional/includes/options_ooo_paths.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_print.inc b/testautomation/framework/optional/includes/options_ooo_print.inc
index 35e83eb0d5f2..35e83eb0d5f2 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_print.inc
+++ b/testautomation/framework/optional/includes/options_ooo_print.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_security.inc b/testautomation/framework/optional/includes/options_ooo_security.inc
index 5c839a249af5..5c839a249af5 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_security.inc
+++ b/testautomation/framework/optional/includes/options_ooo_security.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_userdata.inc b/testautomation/framework/optional/includes/options_ooo_userdata.inc
index c1adc7709e70..c1adc7709e70 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_userdata.inc
+++ b/testautomation/framework/optional/includes/options_ooo_userdata.inc
diff --git a/testautomation/framework/optional/includes/options_ooo_view.inc b/testautomation/framework/optional/includes/options_ooo_view.inc
index 52130dcd09d4..52130dcd09d4 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_view.inc
+++ b/testautomation/framework/optional/includes/options_ooo_view.inc
diff --git a/testautomation/framework/optional/includes/scripting_organizers.inc b/testautomation/framework/optional/includes/scripting_organizers.inc
index c3da1313da9c..c3da1313da9c 100644..100755
--- a/testautomation/framework/optional/includes/scripting_organizers.inc
+++ b/testautomation/framework/optional/includes/scripting_organizers.inc
diff --git a/testautomation/framework/optional/includes/security_broken_signature.inc b/testautomation/framework/optional/includes/security_broken_signature.inc
index 1cce0f33af3d..1cce0f33af3d 100644..100755
--- a/testautomation/framework/optional/includes/security_broken_signature.inc
+++ b/testautomation/framework/optional/includes/security_broken_signature.inc
diff --git a/testautomation/framework/optional/includes/security_evilmacro1.inc b/testautomation/framework/optional/includes/security_evilmacro1.inc
index 9927f1652cb3..9927f1652cb3 100644..100755
--- a/testautomation/framework/optional/includes/security_evilmacro1.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro1.inc
diff --git a/testautomation/framework/optional/includes/security_evilmacro2.inc b/testautomation/framework/optional/includes/security_evilmacro2.inc
index 0c687976fba7..0c687976fba7 100644..100755
--- a/testautomation/framework/optional/includes/security_evilmacro2.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro2.inc
diff --git a/testautomation/framework/optional/includes/security_evilmacro3.inc b/testautomation/framework/optional/includes/security_evilmacro3.inc
index c891163ef3e2..c891163ef3e2 100644..100755
--- a/testautomation/framework/optional/includes/security_evilmacro3.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro3.inc
diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc
index ab914fe5125b..ab914fe5125b 100644..100755
--- a/testautomation/framework/optional/includes/security_recommend_password.inc
+++ b/testautomation/framework/optional/includes/security_recommend_password.inc
diff --git a/testautomation/framework/optional/includes/security_trusted_path.inc b/testautomation/framework/optional/includes/security_trusted_path.inc
index 9115ba2e9f5a..9115ba2e9f5a 100644..100755
--- a/testautomation/framework/optional/includes/security_trusted_path.inc
+++ b/testautomation/framework/optional/includes/security_trusted_path.inc
diff --git a/testautomation/framework/optional/includes/standardbar2.inc b/testautomation/framework/optional/includes/standardbar2.inc
index 2b9f8a95d129..2b9f8a95d129 100644..100755
--- a/testautomation/framework/optional/includes/standardbar2.inc
+++ b/testautomation/framework/optional/includes/standardbar2.inc
diff --git a/testautomation/framework/optional/includes/toolbar_behavior.inc b/testautomation/framework/optional/includes/toolbar_behavior.inc
index e9e96f6bb72e..e9e96f6bb72e 100644..100755
--- a/testautomation/framework/optional/includes/toolbar_behavior.inc
+++ b/testautomation/framework/optional/includes/toolbar_behavior.inc
diff --git a/testautomation/framework/required/includes/basic_dialog_export.inc b/testautomation/framework/required/includes/basic_dialog_export.inc
index ecdb26cc6ac0..ecdb26cc6ac0 100644..100755
--- a/testautomation/framework/required/includes/basic_dialog_export.inc
+++ b/testautomation/framework/required/includes/basic_dialog_export.inc
diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
index e6e62995716c..e6e62995716c 100644..100755
--- a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
+++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
diff --git a/testautomation/framework/required/includes/basic_macroassignment.inc b/testautomation/framework/required/includes/basic_macroassignment.inc
index 6dda14b07698..6dda14b07698 100644..100755
--- a/testautomation/framework/required/includes/basic_macroassignment.inc
+++ b/testautomation/framework/required/includes/basic_macroassignment.inc
diff --git a/testautomation/framework/required/includes/basic_organizer.inc b/testautomation/framework/required/includes/basic_organizer.inc
index 7df67c82cd62..7df67c82cd62 100644..100755
--- a/testautomation/framework/required/includes/basic_organizer.inc
+++ b/testautomation/framework/required/includes/basic_organizer.inc
diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc
index 478ba7cd6b90..478ba7cd6b90 100644..100755
--- a/testautomation/framework/required/includes/first.inc
+++ b/testautomation/framework/required/includes/first.inc
diff --git a/testautomation/framework/required/includes/help_browser.inc b/testautomation/framework/required/includes/help_browser.inc
index 858dc46c2779..858dc46c2779 100644..100755
--- a/testautomation/framework/required/includes/help_browser.inc
+++ b/testautomation/framework/required/includes/help_browser.inc
diff --git a/testautomation/framework/required/includes/printer_administration.inc b/testautomation/framework/required/includes/printer_administration.inc
index 6349f381d194..6349f381d194 100644..100755
--- a/testautomation/framework/required/includes/printer_administration.inc
+++ b/testautomation/framework/required/includes/printer_administration.inc
diff --git a/testautomation/framework/required/includes/security_dialogs.inc b/testautomation/framework/required/includes/security_dialogs.inc
index d8f5a096595a..d8f5a096595a 100644..100755
--- a/testautomation/framework/required/includes/security_dialogs.inc
+++ b/testautomation/framework/required/includes/security_dialogs.inc
diff --git a/testautomation/framework/required/includes/standard_toolbar_1.inc b/testautomation/framework/required/includes/standard_toolbar_1.inc
index b7d54bb89180..b7d54bb89180 100644..100755
--- a/testautomation/framework/required/includes/standard_toolbar_1.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_1.inc
diff --git a/testautomation/framework/required/includes/standard_toolbar_3.inc b/testautomation/framework/required/includes/standard_toolbar_3.inc
index 46c71bd93409..46c71bd93409 100644..100755
--- a/testautomation/framework/required/includes/standard_toolbar_3.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_3.inc
diff --git a/testautomation/framework/required/includes/standard_toolbar_4.inc b/testautomation/framework/required/includes/standard_toolbar_4.inc
index fbd21e46d032..fbd21e46d032 100644..100755
--- a/testautomation/framework/required/includes/standard_toolbar_4.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_4.inc
diff --git a/testautomation/framework/required/includes/standard_toolbar_5.inc b/testautomation/framework/required/includes/standard_toolbar_5.inc
index 8e03d1253f84..8e03d1253f84 100644..100755
--- a/testautomation/framework/required/includes/standard_toolbar_5.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_5.inc
diff --git a/testautomation/framework/required/includes/standard_toolbar_6.inc b/testautomation/framework/required/includes/standard_toolbar_6.inc
index ab357cd81013..ab357cd81013 100644..100755
--- a/testautomation/framework/required/includes/standard_toolbar_6.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_6.inc
diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc
index 36089018a589..36089018a589 100644..100755
--- a/testautomation/framework/required/includes/tools_customize.inc
+++ b/testautomation/framework/required/includes/tools_customize.inc
diff --git a/testautomation/framework/required/includes/tools_options.inc b/testautomation/framework/required/includes/tools_options.inc
index 928d533cbe3a..928d533cbe3a 100644..100755
--- a/testautomation/framework/required/includes/tools_options.inc
+++ b/testautomation/framework/required/includes/tools_options.inc
diff --git a/testautomation/framework/required/includes/wizard_mailmerge.inc b/testautomation/framework/required/includes/wizard_mailmerge.inc
index 95f8d6d19a54..95f8d6d19a54 100644..100755
--- a/testautomation/framework/required/includes/wizard_mailmerge.inc
+++ b/testautomation/framework/required/includes/wizard_mailmerge.inc
diff --git a/testautomation/framework/required/includes/wizard_webpage.inc b/testautomation/framework/required/includes/wizard_webpage.inc
index 465fae368db1..465fae368db1 100644..100755
--- a/testautomation/framework/required/includes/wizard_webpage.inc
+++ b/testautomation/framework/required/includes/wizard_webpage.inc
diff --git a/testautomation/framework/tools/includes/CJK_tools.inc b/testautomation/framework/tools/includes/CJK_tools.inc
index 38664ef78501..38664ef78501 100644..100755
--- a/testautomation/framework/tools/includes/CJK_tools.inc
+++ b/testautomation/framework/tools/includes/CJK_tools.inc
diff --git a/testautomation/framework/tools/includes/customize_tools.inc b/testautomation/framework/tools/includes/customize_tools.inc
index 9fbdb6928b08..9fbdb6928b08 100644..100755
--- a/testautomation/framework/tools/includes/customize_tools.inc
+++ b/testautomation/framework/tools/includes/customize_tools.inc
diff --git a/testautomation/framework/tools/includes/fileoperations.inc b/testautomation/framework/tools/includes/fileoperations.inc
index 061f9f606f48..061f9f606f48 100644..100755
--- a/testautomation/framework/tools/includes/fileoperations.inc
+++ b/testautomation/framework/tools/includes/fileoperations.inc
diff --git a/testautomation/framework/tools/includes/formcontrols.inc b/testautomation/framework/tools/includes/formcontrols.inc
index 6755ed2a2cdd..6755ed2a2cdd 100644..100755
--- a/testautomation/framework/tools/includes/formcontrols.inc
+++ b/testautomation/framework/tools/includes/formcontrols.inc
diff --git a/testautomation/framework/tools/includes/help_tools.inc b/testautomation/framework/tools/includes/help_tools.inc
index 9c81084952df..9c81084952df 100644..100755
--- a/testautomation/framework/tools/includes/help_tools.inc
+++ b/testautomation/framework/tools/includes/help_tools.inc
diff --git a/testautomation/framework/tools/includes/i18n_tools.inc b/testautomation/framework/tools/includes/i18n_tools.inc
index f918b1fe5076..f918b1fe5076 100644..100755
--- a/testautomation/framework/tools/includes/i18n_tools.inc
+++ b/testautomation/framework/tools/includes/i18n_tools.inc
diff --git a/testautomation/framework/tools/includes/options_tools.inc b/testautomation/framework/tools/includes/options_tools.inc
index 4f7a05154795..4f7a05154795 100644..100755
--- a/testautomation/framework/tools/includes/options_tools.inc
+++ b/testautomation/framework/tools/includes/options_tools.inc
diff --git a/testautomation/framework/tools/includes/pbrowser_tools.inc b/testautomation/framework/tools/includes/pbrowser_tools.inc
index a6a089150a96..a6a089150a96 100644..100755
--- a/testautomation/framework/tools/includes/pbrowser_tools.inc
+++ b/testautomation/framework/tools/includes/pbrowser_tools.inc
diff --git a/testautomation/framework/tools/includes/private_environment.inc b/testautomation/framework/tools/includes/private_environment.inc
index af81110b3f18..af81110b3f18 100644..100755
--- a/testautomation/framework/tools/includes/private_environment.inc
+++ b/testautomation/framework/tools/includes/private_environment.inc
diff --git a/testautomation/framework/tools/includes/scriptorganizer_tools.inc b/testautomation/framework/tools/includes/scriptorganizer_tools.inc
index 8cf067913d64..8cf067913d64 100644..100755
--- a/testautomation/framework/tools/includes/scriptorganizer_tools.inc
+++ b/testautomation/framework/tools/includes/scriptorganizer_tools.inc
diff --git a/testautomation/framework/tools/includes/spadmin_tools.inc b/testautomation/framework/tools/includes/spadmin_tools.inc
index 77cbdf61a44b..77cbdf61a44b 100644..100755
--- a/testautomation/framework/tools/includes/spadmin_tools.inc
+++ b/testautomation/framework/tools/includes/spadmin_tools.inc
diff --git a/testautomation/framework/tools/includes/webtools.inc b/testautomation/framework/tools/includes/webtools.inc
index 424ace8c959e..424ace8c959e 100644..100755
--- a/testautomation/framework/tools/includes/webtools.inc
+++ b/testautomation/framework/tools/includes/webtools.inc
diff --git a/testautomation/framework/tools/includes/window_tools.inc b/testautomation/framework/tools/includes/window_tools.inc
index 93a09ccf533d..93a09ccf533d 100644..100755
--- a/testautomation/framework/tools/includes/window_tools.inc
+++ b/testautomation/framework/tools/includes/window_tools.inc
diff --git a/testautomation/global/input/empty/please_do_not_delete_this_file b/testautomation/global/input/empty/please_do_not_delete_this_file
index 0b366e10364f..0b366e10364f 100755..100644
--- a/testautomation/global/input/empty/please_do_not_delete_this_file
+++ b/testautomation/global/input/empty/please_do_not_delete_this_file
diff --git a/testautomation/global/required/includes/g_001.inc b/testautomation/global/required/includes/g_001.inc
index 8cbc1bb24526..8cbc1bb24526 100644..100755
--- a/testautomation/global/required/includes/g_001.inc
+++ b/testautomation/global/required/includes/g_001.inc
diff --git a/testautomation/global/required/includes/g_009.inc b/testautomation/global/required/includes/g_009.inc
index 61ef7dd95c37..61ef7dd95c37 100644..100755
--- a/testautomation/global/required/includes/g_009.inc
+++ b/testautomation/global/required/includes/g_009.inc
diff --git a/testautomation/global/required/includes/g_customize.inc b/testautomation/global/required/includes/g_customize.inc
index 07c2dde3927d..07c2dde3927d 100644..100755
--- a/testautomation/global/required/includes/g_customize.inc
+++ b/testautomation/global/required/includes/g_customize.inc
diff --git a/testautomation/global/required/includes/g_numberformatter1.inc b/testautomation/global/required/includes/g_numberformatter1.inc
index 2539e12455e5..2539e12455e5 100644..100755
--- a/testautomation/global/required/includes/g_numberformatter1.inc
+++ b/testautomation/global/required/includes/g_numberformatter1.inc
diff --git a/testautomation/global/required/includes/g_option.inc b/testautomation/global/required/includes/g_option.inc
index 2f7b6aa33ac2..0c40d3c3d08e 100644
--- a/testautomation/global/required/includes/g_option.inc
+++ b/testautomation/global/required/includes/g_option.inc
@@ -756,7 +756,7 @@ testcase tToolsOptionsImprovementProgram
Active.ok()
else
if ( NOT bImportDialogHasBeenDisplayed ) then
- qaerrorlog( "#i97340# Show Data button enabled but no logged data found" )
+ warnlog( "#i97340# Show Data button enabled but no logged data found" )
endif
endif
@@ -767,8 +767,13 @@ testcase tToolsOptionsImprovementProgram
endif
Kontext "OptionenDlg"
- OptionenDlg.cancel()
-
+ if OptionenDlg.Exists then
+ OptionenDlg.cancel()
+ endif
+
+ if GetDocumentCount = 1 then
+ Call hCloseDocument
+ endif
else
' hDeleteFile() returns FALSE if the file is still present for some weird reason
' We should warn about this because the test breaks at a later point then.
diff --git a/testautomation/global/required/includes/g_option_application.inc b/testautomation/global/required/includes/g_option_application.inc
index 233b6cb9d9cc..233b6cb9d9cc 100644..100755
--- a/testautomation/global/required/includes/g_option_application.inc
+++ b/testautomation/global/required/includes/g_option_application.inc
diff --git a/testautomation/global/sid/bars.sid b/testautomation/global/sid/bars.sid
index 227c3108277e..227c3108277e 100644..100755
--- a/testautomation/global/sid/bars.sid
+++ b/testautomation/global/sid/bars.sid
diff --git a/testautomation/global/sid/context.sid b/testautomation/global/sid/context.sid
index 72d6dba96cb1..72d6dba96cb1 100644..100755
--- a/testautomation/global/sid/context.sid
+++ b/testautomation/global/sid/context.sid
diff --git a/testautomation/global/sid/others.sid b/testautomation/global/sid/others.sid
index 99f9cb479ce2..99f9cb479ce2 100644..100755
--- a/testautomation/global/sid/others.sid
+++ b/testautomation/global/sid/others.sid
diff --git a/testautomation/global/system/includes/declare.inc b/testautomation/global/system/includes/declare.inc
index 5fed58be6cfd..5fed58be6cfd 100644..100755
--- a/testautomation/global/system/includes/declare.inc
+++ b/testautomation/global/system/includes/declare.inc
diff --git a/testautomation/global/system/includes/iniinfo.inc b/testautomation/global/system/includes/iniinfo.inc
index 0b83af421eeb..0b83af421eeb 100644..100755
--- a/testautomation/global/system/includes/iniinfo.inc
+++ b/testautomation/global/system/includes/iniinfo.inc
diff --git a/testautomation/global/system/includes/inivalue.inc b/testautomation/global/system/includes/inivalue.inc
index 2cc13be957cb..2cc13be957cb 100644..100755
--- a/testautomation/global/system/includes/inivalue.inc
+++ b/testautomation/global/system/includes/inivalue.inc
diff --git a/testautomation/global/system/includes/status.inc b/testautomation/global/system/includes/status.inc
index 83430bfaa332..83430bfaa332 100644..100755
--- a/testautomation/global/system/includes/status.inc
+++ b/testautomation/global/system/includes/status.inc
diff --git a/testautomation/global/system/includes/sysinfo.inc b/testautomation/global/system/includes/sysinfo.inc
index 30e00585d517..30e00585d517 100644..100755
--- a/testautomation/global/system/includes/sysinfo.inc
+++ b/testautomation/global/system/includes/sysinfo.inc
diff --git a/testautomation/global/tools/closeoffice.bas b/testautomation/global/tools/closeoffice.bas
index da402ecd40f7..da402ecd40f7 100755..100644
--- a/testautomation/global/tools/closeoffice.bas
+++ b/testautomation/global/tools/closeoffice.bas
diff --git a/testautomation/global/tools/includes/optional/t_accels.inc b/testautomation/global/tools/includes/optional/t_accels.inc
index 04718449b13b..04718449b13b 100644..100755
--- a/testautomation/global/tools/includes/optional/t_accels.inc
+++ b/testautomation/global/tools/includes/optional/t_accels.inc
diff --git a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
index f7537d52700c..f7537d52700c 100644..100755
--- a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
index f63d610dbdb8..f63d610dbdb8 100644..100755
--- a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_docfuncs.inc b/testautomation/global/tools/includes/optional/t_docfuncs.inc
index 7f43b7211630..7f43b7211630 100644..100755
--- a/testautomation/global/tools/includes/optional/t_docfuncs.inc
+++ b/testautomation/global/tools/includes/optional/t_docfuncs.inc
diff --git a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
index 654b1b76c515..654b1b76c515 100644..100755
--- a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_key_tools.inc b/testautomation/global/tools/includes/optional/t_key_tools.inc
index 14906c127c68..14906c127c68 100644..100755
--- a/testautomation/global/tools/includes/optional/t_key_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_key_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_locale_strings1.inc b/testautomation/global/tools/includes/optional/t_locale_strings1.inc
index 29c4bcf3cb6b..29c4bcf3cb6b 100644..100755
--- a/testautomation/global/tools/includes/optional/t_locale_strings1.inc
+++ b/testautomation/global/tools/includes/optional/t_locale_strings1.inc
diff --git a/testautomation/global/tools/includes/optional/t_locale_tools.inc b/testautomation/global/tools/includes/optional/t_locale_tools.inc
index 75d18e2c5856..75d18e2c5856 100644..100755
--- a/testautomation/global/tools/includes/optional/t_locale_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_locale_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc
index 13138dfc52ab..13138dfc52ab 100644..100755
--- a/testautomation/global/tools/includes/optional/t_ole.inc
+++ b/testautomation/global/tools/includes/optional/t_ole.inc
diff --git a/testautomation/global/tools/includes/optional/t_security_tools.inc b/testautomation/global/tools/includes/optional/t_security_tools.inc
index 28625be35880..28625be35880 100644..100755
--- a/testautomation/global/tools/includes/optional/t_security_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_security_tools.inc
diff --git a/testautomation/global/tools/includes/optional/t_set_standard_controls.inc b/testautomation/global/tools/includes/optional/t_set_standard_controls.inc
index 8384edcc27d1..8384edcc27d1 100644..100755
--- a/testautomation/global/tools/includes/optional/t_set_standard_controls.inc
+++ b/testautomation/global/tools/includes/optional/t_set_standard_controls.inc
diff --git a/testautomation/global/tools/includes/optional/t_spreadsheet_tools1.inc b/testautomation/global/tools/includes/optional/t_spreadsheet_tools1.inc
index 55da2fc1c9aa..55da2fc1c9aa 100644..100755
--- a/testautomation/global/tools/includes/optional/t_spreadsheet_tools1.inc
+++ b/testautomation/global/tools/includes/optional/t_spreadsheet_tools1.inc
diff --git a/testautomation/global/tools/includes/optional/t_stringtools.inc b/testautomation/global/tools/includes/optional/t_stringtools.inc
index 7f946fd3b046..7f946fd3b046 100644..100755
--- a/testautomation/global/tools/includes/optional/t_stringtools.inc
+++ b/testautomation/global/tools/includes/optional/t_stringtools.inc
diff --git a/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc b/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc
index 77c72a9ec2dc..77c72a9ec2dc 100644..100755
--- a/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc
+++ b/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc
diff --git a/testautomation/global/tools/includes/optional/t_toolbar_writer.inc b/testautomation/global/tools/includes/optional/t_toolbar_writer.inc
index 892dbd09bb36..892dbd09bb36 100644..100755
--- a/testautomation/global/tools/includes/optional/t_toolbar_writer.inc
+++ b/testautomation/global/tools/includes/optional/t_toolbar_writer.inc
diff --git a/testautomation/global/tools/includes/optional/t_ui_filters.inc b/testautomation/global/tools/includes/optional/t_ui_filters.inc
index 7b9dd66e1a40..7b9dd66e1a40 100644..100755
--- a/testautomation/global/tools/includes/optional/t_ui_filters.inc
+++ b/testautomation/global/tools/includes/optional/t_ui_filters.inc
diff --git a/testautomation/global/tools/includes/optional/t_user_info.inc b/testautomation/global/tools/includes/optional/t_user_info.inc
index d4771be2e3c9..d4771be2e3c9 100644..100755
--- a/testautomation/global/tools/includes/optional/t_user_info.inc
+++ b/testautomation/global/tools/includes/optional/t_user_info.inc
diff --git a/testautomation/global/tools/includes/optional/t_xml1.inc b/testautomation/global/tools/includes/optional/t_xml1.inc
index 5afd05cbb22f..5afd05cbb22f 100644..100755
--- a/testautomation/global/tools/includes/optional/t_xml1.inc
+++ b/testautomation/global/tools/includes/optional/t_xml1.inc
diff --git a/testautomation/global/tools/includes/optional/t_xml2.inc b/testautomation/global/tools/includes/optional/t_xml2.inc
index 46dc9b350393..46dc9b350393 100644..100755
--- a/testautomation/global/tools/includes/optional/t_xml2.inc
+++ b/testautomation/global/tools/includes/optional/t_xml2.inc
diff --git a/testautomation/global/tools/includes/optional/t_xml_filter1.inc b/testautomation/global/tools/includes/optional/t_xml_filter1.inc
index 7ccab1c0db88..7ccab1c0db88 100644..100755
--- a/testautomation/global/tools/includes/optional/t_xml_filter1.inc
+++ b/testautomation/global/tools/includes/optional/t_xml_filter1.inc
diff --git a/testautomation/global/tools/includes/required/t_lists.inc b/testautomation/global/tools/includes/required/t_lists.inc
index 9fa2172fbccf..9fa2172fbccf 100644..100755
--- a/testautomation/global/tools/includes/required/t_lists.inc
+++ b/testautomation/global/tools/includes/required/t_lists.inc
diff --git a/testautomation/global/tools/includes/required/t_option.inc b/testautomation/global/tools/includes/required/t_option.inc
index 4f4467263072..4f4467263072 100644..100755
--- a/testautomation/global/tools/includes/required/t_option.inc
+++ b/testautomation/global/tools/includes/required/t_option.inc
diff --git a/testautomation/global/tools/includes/required/t_option2.inc b/testautomation/global/tools/includes/required/t_option2.inc
index 7e97c58d2848..7e97c58d2848 100644..100755
--- a/testautomation/global/tools/includes/required/t_option2.inc
+++ b/testautomation/global/tools/includes/required/t_option2.inc
diff --git a/testautomation/global/tools/includes/required/t_tools1.inc b/testautomation/global/tools/includes/required/t_tools1.inc
index 051afec0ad24..051afec0ad24 100644..100755
--- a/testautomation/global/tools/includes/required/t_tools1.inc
+++ b/testautomation/global/tools/includes/required/t_tools1.inc
diff --git a/testautomation/global/tools/includes/required/t_tools3.inc b/testautomation/global/tools/includes/required/t_tools3.inc
index 4b29928a1b93..4b29928a1b93 100644..100755
--- a/testautomation/global/tools/includes/required/t_tools3.inc
+++ b/testautomation/global/tools/includes/required/t_tools3.inc
diff --git a/testautomation/global/win/edia_p_s.win b/testautomation/global/win/edia_p_s.win
index da1f30a7f696..7cd8e58ed94e 100755
--- a/testautomation/global/win/edia_p_s.win
+++ b/testautomation/global/win/edia_p_s.win
@@ -114,91 +114,91 @@ Currency sym:WIZARDS_HID_DLGDEPOT_LSTMARKETS
OKButton sym:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY
CancelButton sym:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY
-*Printing .HelpId:vcl:PrintDialog:Dialog
-PreviewWindow .HelpId:vcl:PrintDialog:Preview
-PreviewPageNumber .HelpId:vcl:PrintDialog:PageEdit
-ScrollBackward .HelpId:vcl:PrintDialog:BackwardBtn
-ScrollForward .HelpId:vcl:PrintDialog:ForwardBtn
-Print .HelpId:vcl:PrintDialog:OK
-Cancel .HelpId:vcl:PrintDialog:Cancel
+*Printing .HelpID:vcl:PrintDialog:Dialog
+PreviewWindow .HelpID:vcl:PrintDialog:Preview
+PreviewPageNumber .HelpID:vcl:PrintDialog:PageEdit
+ScrollBackward .HelpID:vcl:PrintDialog:BackwardBtn
+ScrollForward .HelpID:vcl:PrintDialog:ForwardBtn
+Print .HelpID:vcl:PrintDialog:OK
+Cancel .HelpID:vcl:PrintDialog:Cancel
-PrintingTabControl .HelpId:vcl:PrintDialog:TabPages
-TabPrintGeneral .HelpId:vcl:PrintDialog:JobPage
-TabApplication .HelpId:vcl:PrintDialog:TabPage:10
-TabLayout .HelpId:vcl:PrintDialog:NUpPage
-TabOptions .HelpId:vcl:PrintDialog:OptPage
-
-*TabPrintGeneral .HelpId:vcl:PrintDialog:JobPage
-PrinterList .HelpId:vcl:PrintDialog:JobPage:PrinterList
-NumberOfCopies .HelpId:vcl:PrintDialog:JobPage:Copies
-Collate .HelpId:vcl:PrintDialog:JobPage:Collate
-PrintNotes .HelpId:vcl:PrintDialog:PrintAnnotationMode:ListBox
-AllPages .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0
-AllSlides .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0
-AllSheets .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0
-Pages .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1
-Slides .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1
-SelectedSheets .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1
-PrintAllPages .HelpId:vcl:PrintDialog:PrintRange:RadioButton:0
-PrintPages .HelpId:vcl:PrintDialog:PrintRange:RadioButton:1
-PageRange .HelpId:vcl:PrintDialog:PageRange:Edit
-Selection .HelpId:vcl:PrintDialog:PrintContent:RadioButton:2
-SelectedCells .HelpId:vcl:PrintDialog:PrintContent:RadioButton:2
-Details .HelpId:vcl:PrintDialog:JobPage:DetailsBtn
-Properties .HelpId:vcl:PrintDialog:JobPage:Properties
-PageCount .HelpId:vcl:PrintDialog:NumPagesText
-PartsToPrint .HelpId:vcl:PrintDialog:PageContentType:ListBox
-SlidesPerPage .HelpId:vcl:PrintDialog:SlidesPerPage:ListBox
-ArrangeSlides .HelpId:vcl:PrintDialog:SlidesPerPageOrder:ListBox
-
-*TabApplication .HelpId:vcl:PrintDialog:TabPage:10
-PrintPageBackground .HelpId:vcl:PrintDialog:PrintPageBackground:CheckBox
-PrintGraphicsAndDiagrams .HelpId:vcl:PrintDialog:PrintTablesGraphicsAndDiagrams:CheckBox
-PrintPicturesAndObjects .HelpId:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox
-PrintHiddenText .HelpId:vcl:PrintDialog:PrintHiddenText:CheckBox
-PrintTextPlaceholder .HelpId:vcl:PrintDialog:PrintTextPlaceholder:CheckBox
-PrintFormControls .HelpId:vcl:PrintDialog:PrintControls:CheckBox
-PrintTextInBlack .HelpId:vcl:PrintDialog:PrintBlackFonts:CheckBox
-PrintBlankPages .HelpId:vcl:PrintDialog:PrintEmptyPages:CheckBox
-IncludeEmptyPages .HelpId:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox
-SlideName .HelpId:vcl:PrintDialog:IsPrintName:CheckBox
-DateAndTime .HelpId:vcl:PrintDialog:IsPrintDateTime:CheckBox
-HiddenPages .HelpId:vcl:PrintDialog:IsPrintHidden:CheckBox
-TilePaper .HelpId:vcl:PrintDialog:PageOptions:RadioButton:3
-OriginalColors .HelpId:vcl:PrintDialog:Quality:RadioButton:0
-Grayscale .HelpId:vcl:PrintDialog:Quality:RadioButton:1
-BlackAndWhite .HelpId:vcl:PrintDialog:Quality:RadioButton:2
-MultiplePages .HelpId:vcl:PrintDialog:PageOptions:RadioButton:2
-TitleRow .HelpId:vcl:PrintDialog:TitleRow:CheckBox
-FormulaText .HelpId:vcl:PrintDialog:FormulaText:CheckBox
-Borders .HelpId:vcl:PrintDialog:Border:CheckBox
-OriginalSize .HelpId:vcl:PrintDialog:PageOptions:RadioButton:0
-OriginalSizeMath .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:0
-FitToPage .HelpId:vcl:PrintDialog:PageOptions:RadioButton:1
-FitToPageMath .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:1
-Scaling .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:2
-ScalingFactor .HelpId:vcl:PrintDialog:PrintScale:NumericField
-
-*TabLayout .HelpId:vcl:PrintDialog:NUpPage
-PagesPerSheet .HelpId:vcl:PrintDialog:NUpPage:PagesPerSheet
-NumberOfPages .HelpId:vcl:PrintDialog:NUpPage:PagesPerSheetBox
-NumberOfColumns .HelpId:vcl:PrintDialog:NUpPage:ColumnsBox
-NumberOfRows .HelpId:vcl:PrintDialog:NUpPage:RowsBox
-BorderAroundPages .HelpId:vcl:PrintDialog:NUpPage:BorderBox
-Brochure .HelpId:vcl:PrintDialog:NUpPage:Brochure
-DistanceBetweenPages .HelpId:vcl:PrintDialog:NUpPage:PageMarginBox
-MarginToSheetBorder .HelpId:vcl:PrintDialog:NUpPage:SheetMarginBox
-PaperOrientation .HelpId:vcl:PrintDialog:NUpPage:OrientationBox
-PrintOrder .HelpId:vcl:PrintDialog:NUpPage:OrderBox
-IncludePages .HelpId:vcl:PrintDialog:PrintLeftRightPages:ListBox
-PrintBrochureRTL .HelpId:vcl:PrintDialog:PrintProspectRTL:ListBox
-BrochurePageSides .HelpId:vcl:PrintDialog:PrintProspectInclude:ListBox
-
-*TabOptions .HelpId:vcl:PrintDialog:OptPage
-PrintToFile .HelpId:vcl:PrintDialog:OptPage:ToFile
-PrintAsSingleJobs .HelpId:vcl:PrintDialog:OptPage:SingleJobs
-PrintReverse .HelpId:vcl:PrintDialog:OptPage:Reverse
-PaperTrayFromPrefs .HelpId:vcl:PrintDialog:PrintPaperFromSetup:CheckBox
+PrintingTabControl .HelpID:vcl:PrintDialog:TabPages
+TabPrintGeneral .HelpID:vcl:PrintDialog:JobPage
+TabApplication .HelpID:vcl:PrintDialog:TabPage:AppPage
+TabLayout .HelpID:vcl:PrintDialog:NUpPage
+TabOptions .HelpID:vcl:PrintDialog:OptPage
+
+*TabPrintGeneral .HelpID:vcl:PrintDialog:JobPage
+PrinterList .HelpID:vcl:PrintDialog:JobPage:PrinterList
+NumberOfCopies .HelpID:vcl:PrintDialog:JobPage:Copies
+Collate .HelpID:vcl:PrintDialog:JobPage:Collate
+PrintNotes .HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText
+AllPages .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0
+AllSlides .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0
+AllSheets .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0
+Pages .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1
+Slides .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1
+SelectedSheets .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1
+PrintAllPages .HelpID:vcl:PrintDialog:PrintRange:RadioButton:0
+PrintPages .HelpID:vcl:PrintDialog:PrintRange:RadioButton:1
+PageRange .HelpID:vcl:PrintDialog:PageRange:Edit
+Selection .HelpID:vcl:PrintDialog:PrintContent:RadioButton:2
+SelectedCells .HelpID:vcl:PrintDialog:PrintContent:RadioButton:2
+Details .HelpID:vcl:PrintDialog:JobPage:DetailsBtn
+Properties .HelpID:vcl:PrintDialog:JobPage:Properties
+PageCount .HelpID:vcl:PrintDialog:NumPagesText
+PartsToPrint .HelpID:vcl:PrintDialog:PageContentType:ListBox
+SlidesPerPage .HelpID:vcl:PrintDialog:SlidesPerPage:ListBox
+ArrangeSlides .HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox
+
+*TabApplication .HelpID:vcl:PrintDialog:TabPage:AppPage
+PrintPageBackground .HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox
+PrintGraphicsAndDiagrams .HelpID:vcl:PrintDialog:PrintTablesGraphicsAndDiagrams:CheckBox
+PrintPicturesAndObjects .HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox
+PrintHiddenText .HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox
+PrintTextPlaceholder .HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox
+PrintFormControls .HelpID:vcl:PrintDialog:PrintControls:CheckBox
+PrintTextInBlack .HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox
+PrintBlankPages .HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox
+IncludeEmptyPages .HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox
+SlideName .HelpID:vcl:PrintDialog:IsPrintName:CheckBox
+DateAndTime .HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox
+HiddenPages .HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox
+TilePaper .HelpID:vcl:PrintDialog:PageOptions:RadioButton:3
+OriginalColors .HelpID:vcl:PrintDialog:Quality:RadioButton:0
+Grayscale .HelpID:vcl:PrintDialog:Quality:RadioButton:1
+BlackAndWhite .HelpID:vcl:PrintDialog:Quality:RadioButton:2
+MultiplePages .HelpID:vcl:PrintDialog:PageOptions:RadioButton:2
+TitleRow .HelpID:vcl:PrintDialog:TitleRow:CheckBox
+FormulaText .HelpID:vcl:PrintDialog:FormulaText:CheckBox
+Borders .HelpID:vcl:PrintDialog:Border:CheckBox
+OriginalSize .HelpID:vcl:PrintDialog:PageOptions:RadioButton:0
+OriginalSizeMath .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0
+FitToPage .HelpID:vcl:PrintDialog:PageOptions:RadioButton:1
+FitToPageMath .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1
+Scaling .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2
+ScalingFactor .HelpID:vcl:PrintDialog:PrintScale:NumericField
+
+*TabLayout .HelpID:vcl:PrintDialog:NUpPage
+PagesPerSheet .HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet
+NumberOfPages .HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox
+NumberOfColumns .HelpID:vcl:PrintDialog:NUpPage:ColumnsBox
+NumberOfRows .HelpID:vcl:PrintDialog:NUpPage:RowsBox
+BorderAroundPages .HelpID:vcl:PrintDialog:NUpPage:BorderBox
+Brochure .HelpID:vcl:PrintDialog:NUpPage:Brochure
+DistanceBetweenPages .HelpID:vcl:PrintDialog:NUpPage:PageMarginBox
+MarginToSheetBorder .HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox
+PaperOrientation .HelpID:vcl:PrintDialog:NUpPage:OrientationBox
+PrintOrder .HelpID:vcl:PrintDialog:NUpPage:OrderBox
+IncludePages .HelpID:vcl:PrintDialog:PrintLeftRightPages:ListBox
+PrintBrochureRTL .HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox
+BrochurePageSides .HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox
+
+*TabOptions .HelpID:vcl:PrintDialog:OptPage
+PrintToFile .HelpID:vcl:PrintDialog:OptPage:ToFile
+PrintAsSingleJobs .HelpID:vcl:PrintDialog:OptPage:SingleJobs
+PrintReverse .HelpID:vcl:PrintDialog:OptPage:ToReverse
+PaperTrayFromPrefs .HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox
*PurchaseStarOffice sym:TAB_HID_LICENSING_DIALOG
TabPurchase sym:TAB_HID_TP_PURCHASE
diff --git a/testautomation/graphics/optional/g_accessability.bas b/testautomation/graphics/optional/g_accessability.bas
index 1113dcb4324f..1113dcb4324f 100755..100644
--- a/testautomation/graphics/optional/g_accessability.bas
+++ b/testautomation/graphics/optional/g_accessability.bas
diff --git a/testautomation/graphics/optional/g_area.bas b/testautomation/graphics/optional/g_area.bas
index 3ad024ced1f6..3ad024ced1f6 100755..100644
--- a/testautomation/graphics/optional/g_area.bas
+++ b/testautomation/graphics/optional/g_area.bas
diff --git a/testautomation/graphics/optional/g_arrangealign.bas b/testautomation/graphics/optional/g_arrangealign.bas
index 3d9f2e2ab4ab..3d9f2e2ab4ab 100755..100644
--- a/testautomation/graphics/optional/g_arrangealign.bas
+++ b/testautomation/graphics/optional/g_arrangealign.bas
diff --git a/testautomation/graphics/optional/g_autocorrection.bas b/testautomation/graphics/optional/g_autocorrection.bas
index b4fb2af0b472..b4fb2af0b472 100755..100644
--- a/testautomation/graphics/optional/g_autocorrection.bas
+++ b/testautomation/graphics/optional/g_autocorrection.bas
diff --git a/testautomation/graphics/optional/g_character.bas b/testautomation/graphics/optional/g_character.bas
index e13eccb813c3..e13eccb813c3 100755..100644
--- a/testautomation/graphics/optional/g_character.bas
+++ b/testautomation/graphics/optional/g_character.bas
diff --git a/testautomation/graphics/optional/g_clipboard.bas b/testautomation/graphics/optional/g_clipboard.bas
index 47b48949a162..47b48949a162 100755..100644
--- a/testautomation/graphics/optional/g_clipboard.bas
+++ b/testautomation/graphics/optional/g_clipboard.bas
diff --git a/testautomation/graphics/optional/g_clipexport.bas b/testautomation/graphics/optional/g_clipexport.bas
index d75eef694394..d75eef694394 100755..100644
--- a/testautomation/graphics/optional/g_clipexport.bas
+++ b/testautomation/graphics/optional/g_clipexport.bas
diff --git a/testautomation/graphics/optional/g_convertto.bas b/testautomation/graphics/optional/g_convertto.bas
index 8283981462ee..8283981462ee 100755..100644
--- a/testautomation/graphics/optional/g_convertto.bas
+++ b/testautomation/graphics/optional/g_convertto.bas
diff --git a/testautomation/graphics/optional/g_crossfading.bas b/testautomation/graphics/optional/g_crossfading.bas
index 0c8102e70bde..0c8102e70bde 100755..100644
--- a/testautomation/graphics/optional/g_crossfading.bas
+++ b/testautomation/graphics/optional/g_crossfading.bas
diff --git a/testautomation/graphics/optional/g_customshapes.bas b/testautomation/graphics/optional/g_customshapes.bas
index 960fb7a2e19b..960fb7a2e19b 100755..100644
--- a/testautomation/graphics/optional/g_customshapes.bas
+++ b/testautomation/graphics/optional/g_customshapes.bas
diff --git a/testautomation/graphics/optional/g_demoguide.bas b/testautomation/graphics/optional/g_demoguide.bas
index c3a8fe861724..c3a8fe861724 100755..100644
--- a/testautomation/graphics/optional/g_demoguide.bas
+++ b/testautomation/graphics/optional/g_demoguide.bas
diff --git a/testautomation/graphics/optional/g_dimensions.bas b/testautomation/graphics/optional/g_dimensions.bas
index 3644dfd3b0d8..3644dfd3b0d8 100755..100644
--- a/testautomation/graphics/optional/g_dimensions.bas
+++ b/testautomation/graphics/optional/g_dimensions.bas
diff --git a/testautomation/graphics/optional/g_edit.bas b/testautomation/graphics/optional/g_edit.bas
index 305967f73112..305967f73112 100755..100644
--- a/testautomation/graphics/optional/g_edit.bas
+++ b/testautomation/graphics/optional/g_edit.bas
diff --git a/testautomation/graphics/optional/g_export_html.bas b/testautomation/graphics/optional/g_export_html.bas
index faa2783b6d2f..faa2783b6d2f 100755..100644
--- a/testautomation/graphics/optional/g_export_html.bas
+++ b/testautomation/graphics/optional/g_export_html.bas
diff --git a/testautomation/graphics/optional/g_findreplace.bas b/testautomation/graphics/optional/g_findreplace.bas
index 9de7acfa2bc5..9de7acfa2bc5 100755..100644
--- a/testautomation/graphics/optional/g_findreplace.bas
+++ b/testautomation/graphics/optional/g_findreplace.bas
diff --git a/testautomation/graphics/optional/g_format.bas b/testautomation/graphics/optional/g_format.bas
index 1c03f7bf8801..1c03f7bf8801 100755..100644
--- a/testautomation/graphics/optional/g_format.bas
+++ b/testautomation/graphics/optional/g_format.bas
diff --git a/testautomation/graphics/optional/g_group.bas b/testautomation/graphics/optional/g_group.bas
index 93f542bcc027..93f542bcc027 100755..100644
--- a/testautomation/graphics/optional/g_group.bas
+++ b/testautomation/graphics/optional/g_group.bas
diff --git a/testautomation/graphics/optional/g_imagemap.bas b/testautomation/graphics/optional/g_imagemap.bas
index b2dd4a62c182..b2dd4a62c182 100755..100644
--- a/testautomation/graphics/optional/g_imagemap.bas
+++ b/testautomation/graphics/optional/g_imagemap.bas
diff --git a/testautomation/graphics/optional/g_insert.bas b/testautomation/graphics/optional/g_insert.bas
index a006e2f04c3e..a006e2f04c3e 100755..100644
--- a/testautomation/graphics/optional/g_insert.bas
+++ b/testautomation/graphics/optional/g_insert.bas
diff --git a/testautomation/graphics/optional/g_line.bas b/testautomation/graphics/optional/g_line.bas
index c1327e21bc96..c1327e21bc96 100755..100644
--- a/testautomation/graphics/optional/g_line.bas
+++ b/testautomation/graphics/optional/g_line.bas
diff --git a/testautomation/graphics/optional/g_load_save.bas b/testautomation/graphics/optional/g_load_save.bas
index b68da93657fc..b68da93657fc 100755..100644
--- a/testautomation/graphics/optional/g_load_save.bas
+++ b/testautomation/graphics/optional/g_load_save.bas
diff --git a/testautomation/graphics/optional/g_mediaplayer.bas b/testautomation/graphics/optional/g_mediaplayer.bas
index e237ce752a2d..e237ce752a2d 100755..100644
--- a/testautomation/graphics/optional/g_mediaplayer.bas
+++ b/testautomation/graphics/optional/g_mediaplayer.bas
diff --git a/testautomation/graphics/optional/g_navigator.bas b/testautomation/graphics/optional/g_navigator.bas
index cc165c76b37e..cc165c76b37e 100755..100644
--- a/testautomation/graphics/optional/g_navigator.bas
+++ b/testautomation/graphics/optional/g_navigator.bas
diff --git a/testautomation/graphics/optional/g_ole.bas b/testautomation/graphics/optional/g_ole.bas
index 98f99e4ab931..98f99e4ab931 100755..100644
--- a/testautomation/graphics/optional/g_ole.bas
+++ b/testautomation/graphics/optional/g_ole.bas
diff --git a/testautomation/graphics/optional/g_paneview.bas b/testautomation/graphics/optional/g_paneview.bas
index 021a95cfbfad..021a95cfbfad 100755..100644
--- a/testautomation/graphics/optional/g_paneview.bas
+++ b/testautomation/graphics/optional/g_paneview.bas
diff --git a/testautomation/graphics/optional/g_paragraph.bas b/testautomation/graphics/optional/g_paragraph.bas
index 502728773a6e..502728773a6e 100755..100644
--- a/testautomation/graphics/optional/g_paragraph.bas
+++ b/testautomation/graphics/optional/g_paragraph.bas
diff --git a/testautomation/graphics/optional/g_savepictureas.bas b/testautomation/graphics/optional/g_savepictureas.bas
index 332632dcdac6..332632dcdac6 100755..100644
--- a/testautomation/graphics/optional/g_savepictureas.bas
+++ b/testautomation/graphics/optional/g_savepictureas.bas
diff --git a/testautomation/graphics/optional/g_shaddow.bas b/testautomation/graphics/optional/g_shaddow.bas
index c6e963ae1658..c6e963ae1658 100755..100644
--- a/testautomation/graphics/optional/g_shaddow.bas
+++ b/testautomation/graphics/optional/g_shaddow.bas
diff --git a/testautomation/graphics/optional/g_slidelayer.bas b/testautomation/graphics/optional/g_slidelayer.bas
index 3ffd9a4ab37a..3ffd9a4ab37a 100755..100644
--- a/testautomation/graphics/optional/g_slidelayer.bas
+++ b/testautomation/graphics/optional/g_slidelayer.bas
diff --git a/testautomation/graphics/optional/g_stylist.bas b/testautomation/graphics/optional/g_stylist.bas
index 50da6610c41a..50da6610c41a 100755..100644
--- a/testautomation/graphics/optional/g_stylist.bas
+++ b/testautomation/graphics/optional/g_stylist.bas
diff --git a/testautomation/graphics/optional/g_tables.bas b/testautomation/graphics/optional/g_tables.bas
index dee2e14c67a5..dee2e14c67a5 100755..100644
--- a/testautomation/graphics/optional/g_tables.bas
+++ b/testautomation/graphics/optional/g_tables.bas
diff --git a/testautomation/graphics/optional/g_toolbars.bas b/testautomation/graphics/optional/g_toolbars.bas
index b643e02c9e9b..b643e02c9e9b 100755..100644
--- a/testautomation/graphics/optional/g_toolbars.bas
+++ b/testautomation/graphics/optional/g_toolbars.bas
diff --git a/testautomation/graphics/optional/g_tools.bas b/testautomation/graphics/optional/g_tools.bas
index 4e79a89ca469..4e79a89ca469 100755..100644
--- a/testautomation/graphics/optional/g_tools.bas
+++ b/testautomation/graphics/optional/g_tools.bas
diff --git a/testautomation/graphics/optional/g_zoom.bas b/testautomation/graphics/optional/g_zoom.bas
index 1b494950ce44..1b494950ce44 100755..100644
--- a/testautomation/graphics/optional/g_zoom.bas
+++ b/testautomation/graphics/optional/g_zoom.bas
diff --git a/testautomation/graphics/optional/gallery.bas b/testautomation/graphics/optional/gallery.bas
index 9b81954f8902..9b81954f8902 100755..100644
--- a/testautomation/graphics/optional/gallery.bas
+++ b/testautomation/graphics/optional/gallery.bas
diff --git a/testautomation/graphics/optional/gallery2.bas b/testautomation/graphics/optional/gallery2.bas
index d467b0a74876..d467b0a74876 100755..100644
--- a/testautomation/graphics/optional/gallery2.bas
+++ b/testautomation/graphics/optional/gallery2.bas
diff --git a/testautomation/graphics/optional/i_animation.bas b/testautomation/graphics/optional/i_animation.bas
index 85503fc790c1..85503fc790c1 100755..100644
--- a/testautomation/graphics/optional/i_animation.bas
+++ b/testautomation/graphics/optional/i_animation.bas
diff --git a/testautomation/graphics/optional/i_headerfooter.bas b/testautomation/graphics/optional/i_headerfooter.bas
index e050b914ca9e..e050b914ca9e 100755..100644
--- a/testautomation/graphics/optional/i_headerfooter.bas
+++ b/testautomation/graphics/optional/i_headerfooter.bas
diff --git a/testautomation/graphics/optional/i_pengine.bas b/testautomation/graphics/optional/i_pengine.bas
index 5ddefe26ca94..5ddefe26ca94 100755..100644
--- a/testautomation/graphics/optional/i_pengine.bas
+++ b/testautomation/graphics/optional/i_pengine.bas
diff --git a/testautomation/graphics/optional/i_saveloadlayout.bas b/testautomation/graphics/optional/i_saveloadlayout.bas
index 137007da7c8f..137007da7c8f 100755..100644
--- a/testautomation/graphics/optional/i_saveloadlayout.bas
+++ b/testautomation/graphics/optional/i_saveloadlayout.bas
diff --git a/testautomation/graphics/optional/i_shape.bas b/testautomation/graphics/optional/i_shape.bas
index 0ebb3c1e4864..0ebb3c1e4864 100755..100644
--- a/testautomation/graphics/optional/i_shape.bas
+++ b/testautomation/graphics/optional/i_shape.bas
diff --git a/testautomation/graphics/optional/i_slidecopy.bas b/testautomation/graphics/optional/i_slidecopy.bas
index c780904e542d..c780904e542d 100755..100644
--- a/testautomation/graphics/optional/i_slidecopy.bas
+++ b/testautomation/graphics/optional/i_slidecopy.bas
diff --git a/testautomation/graphics/optional/i_view.bas b/testautomation/graphics/optional/i_view.bas
index 7dacea82d1b2..7dacea82d1b2 100755..100644
--- a/testautomation/graphics/optional/i_view.bas
+++ b/testautomation/graphics/optional/i_view.bas
diff --git a/testautomation/graphics/required/d_opt.bas b/testautomation/graphics/required/d_opt.bas
index 1447b1f4e276..1447b1f4e276 100755..100644
--- a/testautomation/graphics/required/d_opt.bas
+++ b/testautomation/graphics/required/d_opt.bas
diff --git a/testautomation/graphics/required/d_updt.bas b/testautomation/graphics/required/d_updt.bas
index 40dd64e3b50c..40dd64e3b50c 100755..100644
--- a/testautomation/graphics/required/d_updt.bas
+++ b/testautomation/graphics/required/d_updt.bas
diff --git a/testautomation/graphics/required/i_opt.bas b/testautomation/graphics/required/i_opt.bas
index eb159ac83a55..eb159ac83a55 100755..100644
--- a/testautomation/graphics/required/i_opt.bas
+++ b/testautomation/graphics/required/i_opt.bas
diff --git a/testautomation/graphics/required/i_updt_1.bas b/testautomation/graphics/required/i_updt_1.bas
index f829cc9b8713..f829cc9b8713 100755..100644
--- a/testautomation/graphics/required/i_updt_1.bas
+++ b/testautomation/graphics/required/i_updt_1.bas
diff --git a/testautomation/graphics/required/i_updt_2.bas b/testautomation/graphics/required/i_updt_2.bas
index 3d61eea42a4b..3d61eea42a4b 100755..100644
--- a/testautomation/graphics/required/i_updt_2.bas
+++ b/testautomation/graphics/required/i_updt_2.bas
diff --git a/testautomation/math/optional/includes/m_106_.inc b/testautomation/math/optional/includes/m_106_.inc
index 6136ebfdeb9f..6136ebfdeb9f 100644..100755
--- a/testautomation/math/optional/includes/m_106_.inc
+++ b/testautomation/math/optional/includes/m_106_.inc
diff --git a/testautomation/math/required/includes/m_002_.inc b/testautomation/math/required/includes/m_002_.inc
index eff8ba5b82a8..eff8ba5b82a8 100644..100755
--- a/testautomation/math/required/includes/m_002_.inc
+++ b/testautomation/math/required/includes/m_002_.inc
diff --git a/testautomation/math/required/includes/m_003_.inc b/testautomation/math/required/includes/m_003_.inc
index 152fd1429849..152fd1429849 100644..100755
--- a/testautomation/math/required/includes/m_003_.inc
+++ b/testautomation/math/required/includes/m_003_.inc
diff --git a/testautomation/math/required/includes/m_004_.inc b/testautomation/math/required/includes/m_004_.inc
index 8f49d5633c4f..8f49d5633c4f 100644..100755
--- a/testautomation/math/required/includes/m_004_.inc
+++ b/testautomation/math/required/includes/m_004_.inc
diff --git a/testautomation/math/required/includes/m_006_.inc b/testautomation/math/required/includes/m_006_.inc
index cea7bb704512..cea7bb704512 100644..100755
--- a/testautomation/math/required/includes/m_006_.inc
+++ b/testautomation/math/required/includes/m_006_.inc
diff --git a/testautomation/math/required/includes/m_007_.inc b/testautomation/math/required/includes/m_007_.inc
index fc8269c05c21..fc8269c05c21 100644..100755
--- a/testautomation/math/required/includes/m_007_.inc
+++ b/testautomation/math/required/includes/m_007_.inc
diff --git a/testautomation/math/required/includes/m_010_.inc b/testautomation/math/required/includes/m_010_.inc
index 7f3cd8944a50..7f3cd8944a50 100644..100755
--- a/testautomation/math/required/includes/m_010_.inc
+++ b/testautomation/math/required/includes/m_010_.inc
diff --git a/testautomation/math/required/includes/m_020_.inc b/testautomation/math/required/includes/m_020_.inc
index ae79e24300b2..ae79e24300b2 100644..100755
--- a/testautomation/math/required/includes/m_020_.inc
+++ b/testautomation/math/required/includes/m_020_.inc
diff --git a/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc b/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc
index 25926d626bd4..25926d626bd4 100644..100755
--- a/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc
+++ b/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc
diff --git a/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc b/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc
index 6bfa955a483a..6bfa955a483a 100644..100755
--- a/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc
+++ b/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc
diff --git a/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc
index 301bac08a49c..301bac08a49c 100644..100755
--- a/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc
+++ b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_editmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_editmenu.inc
index c90e44d30f01..c90e44d30f01 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_editmenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_editmenu.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_helpmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_helpmenu.inc
index 89495d36907e..89495d36907e 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_helpmenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_helpmenu.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc
index b8c749c27cd9..b8c749c27cd9 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc b/testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc
index f11857cf44ad..f11857cf44ad 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc
index e7568390c38a..e7568390c38a 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc
diff --git a/testautomation/spreadsheet/required/includes/c_upd_windowmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_windowmenu.inc
index 56adf3af682a..56adf3af682a 100644..100755
--- a/testautomation/spreadsheet/required/includes/c_upd_windowmenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_windowmenu.inc
diff --git a/testautomation/spreadsheet/tools/includes/c_cell_tools.inc b/testautomation/spreadsheet/tools/includes/c_cell_tools.inc
index 0693f1daf19c..0693f1daf19c 100644..100755
--- a/testautomation/spreadsheet/tools/includes/c_cell_tools.inc
+++ b/testautomation/spreadsheet/tools/includes/c_cell_tools.inc
diff --git a/testautomation/spreadsheet/tools/includes/c_select_tools.inc b/testautomation/spreadsheet/tools/includes/c_select_tools.inc
index f1087ca3fe8b..f1087ca3fe8b 100644..100755
--- a/testautomation/spreadsheet/tools/includes/c_select_tools.inc
+++ b/testautomation/spreadsheet/tools/includes/c_select_tools.inc
diff --git a/testautomation/spreadsheet/tools/includes/c_tool_l10n_mnomics.inc b/testautomation/spreadsheet/tools/includes/c_tool_l10n_mnomics.inc
index 43dd2945c22a..43dd2945c22a 100644..100755
--- a/testautomation/spreadsheet/tools/includes/c_tool_l10n_mnomics.inc
+++ b/testautomation/spreadsheet/tools/includes/c_tool_l10n_mnomics.inc
diff --git a/testautomation/spreadsheet/tools/includes/c_tool_options.inc b/testautomation/spreadsheet/tools/includes/c_tool_options.inc
index 89bc7a4e0ad3..89bc7a4e0ad3 100644..100755
--- a/testautomation/spreadsheet/tools/includes/c_tool_options.inc
+++ b/testautomation/spreadsheet/tools/includes/c_tool_options.inc
diff --git a/testautomation/writer/optional/includes/CJKCTLDependency/CJKCTLDependency1.inc b/testautomation/writer/optional/includes/CJKCTLDependency/CJKCTLDependency1.inc
index 90e1c423a51f..90e1c423a51f 100644..100755
--- a/testautomation/writer/optional/includes/CJKCTLDependency/CJKCTLDependency1.inc
+++ b/testautomation/writer/optional/includes/CJKCTLDependency/CJKCTLDependency1.inc
diff --git a/testautomation/writer/optional/includes/autotext/w_autotext.inc b/testautomation/writer/optional/includes/autotext/w_autotext.inc
index 19e2955f27ab..19e2955f27ab 100644..100755
--- a/testautomation/writer/optional/includes/autotext/w_autotext.inc
+++ b/testautomation/writer/optional/includes/autotext/w_autotext.inc
diff --git a/testautomation/writer/optional/includes/calculate/w_calculate.inc b/testautomation/writer/optional/includes/calculate/w_calculate.inc
index ccbc196d46aa..ccbc196d46aa 100644..100755
--- a/testautomation/writer/optional/includes/calculate/w_calculate.inc
+++ b/testautomation/writer/optional/includes/calculate/w_calculate.inc
diff --git a/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate1.inc b/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate1.inc
index 9c432380228a..9c432380228a 100644..100755
--- a/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate1.inc
+++ b/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate1.inc
diff --git a/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate2.inc b/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate2.inc
index 85e2ae9aa1f0..85e2ae9aa1f0 100644..100755
--- a/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate2.inc
+++ b/testautomation/writer/optional/includes/chinesetranslate/w_chinesetranslate2.inc
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
index 659bb2a4ddb7..659bb2a4ddb7 100644..100755
--- a/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
diff --git a/testautomation/writer/optional/includes/filter/w_filter.inc b/testautomation/writer/optional/includes/filter/w_filter.inc
index 43a47baf0d2a..43a47baf0d2a 100644..100755
--- a/testautomation/writer/optional/includes/filter/w_filter.inc
+++ b/testautomation/writer/optional/includes/filter/w_filter.inc
diff --git a/testautomation/writer/optional/includes/fontwork/w_fontwork1.inc b/testautomation/writer/optional/includes/fontwork/w_fontwork1.inc
index 6fff78a962fe..6fff78a962fe 100644..100755
--- a/testautomation/writer/optional/includes/fontwork/w_fontwork1.inc
+++ b/testautomation/writer/optional/includes/fontwork/w_fontwork1.inc
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc
index c6c38ddfe934..c6c38ddfe934 100644..100755
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
index 1a3624487ffb..1a3624487ffb 100644..100755
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc
index 561768ee8320..561768ee8320 100644..100755
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc
index 23ec4e96ff06..23ec4e96ff06 100644..100755
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc
diff --git a/testautomation/writer/optional/includes/option/wh_o_3.inc b/testautomation/writer/optional/includes/option/wh_o_3.inc
index 58b87a72ea08..58b87a72ea08 100644..100755
--- a/testautomation/writer/optional/includes/option/wh_o_3.inc
+++ b/testautomation/writer/optional/includes/option/wh_o_3.inc
diff --git a/testautomation/writer/optional/includes/option/wr_o_5.inc b/testautomation/writer/optional/includes/option/wr_o_5.inc
index c8676fb164f2..c8676fb164f2 100644..100755
--- a/testautomation/writer/optional/includes/option/wr_o_5.inc
+++ b/testautomation/writer/optional/includes/option/wr_o_5.inc
diff --git a/testautomation/writer/optional/includes/redlining/w_redlining2.inc b/testautomation/writer/optional/includes/redlining/w_redlining2.inc
index 4b442a8b3464..4b442a8b3464 100644..100755
--- a/testautomation/writer/optional/includes/redlining/w_redlining2.inc
+++ b/testautomation/writer/optional/includes/redlining/w_redlining2.inc
diff --git a/testautomation/writer/optional/includes/section/w_section_1.inc b/testautomation/writer/optional/includes/section/w_section_1.inc
index da7417779401..da7417779401 100644..100755
--- a/testautomation/writer/optional/includes/section/w_section_1.inc
+++ b/testautomation/writer/optional/includes/section/w_section_1.inc
diff --git a/testautomation/writer/optional/includes/section/w_section_2.inc b/testautomation/writer/optional/includes/section/w_section_2.inc
index 1d79405dfd82..1d79405dfd82 100644..100755
--- a/testautomation/writer/optional/includes/section/w_section_2.inc
+++ b/testautomation/writer/optional/includes/section/w_section_2.inc
diff --git a/testautomation/writer/optional/includes/section/w_section_tools.inc b/testautomation/writer/optional/includes/section/w_section_tools.inc
index 2d441cad8450..2d441cad8450 100644..100755
--- a/testautomation/writer/optional/includes/section/w_section_tools.inc
+++ b/testautomation/writer/optional/includes/section/w_section_tools.inc
diff --git a/testautomation/writer/optional/includes/stylist/w_stylist.inc b/testautomation/writer/optional/includes/stylist/w_stylist.inc
index 65f156412f83..65f156412f83 100644..100755
--- a/testautomation/writer/optional/includes/stylist/w_stylist.inc
+++ b/testautomation/writer/optional/includes/stylist/w_stylist.inc
diff --git a/testautomation/writer/optional/includes/table/w_204_.inc b/testautomation/writer/optional/includes/table/w_204_.inc
index a5a94662c350..a5a94662c350 100644..100755
--- a/testautomation/writer/optional/includes/table/w_204_.inc
+++ b/testautomation/writer/optional/includes/table/w_204_.inc
diff --git a/testautomation/writer/optional/includes/table/w_204a_.inc b/testautomation/writer/optional/includes/table/w_204a_.inc
index 0132f14ebe5d..0132f14ebe5d 100644..100755
--- a/testautomation/writer/optional/includes/table/w_204a_.inc
+++ b/testautomation/writer/optional/includes/table/w_204a_.inc
diff --git a/testautomation/writer/optional/includes/table/w_204b_.inc b/testautomation/writer/optional/includes/table/w_204b_.inc
index 56b6e8781b2b..56b6e8781b2b 100644..100755
--- a/testautomation/writer/optional/includes/table/w_204b_.inc
+++ b/testautomation/writer/optional/includes/table/w_204b_.inc
diff --git a/testautomation/writer/optional/includes/textframes/w_textframes2.inc b/testautomation/writer/optional/includes/textframes/w_textframes2.inc
index 4fca2bdbddb6..466b0c99ab15 100644
--- a/testautomation/writer/optional/includes/textframes/w_textframes2.inc
+++ b/testautomation/writer/optional/includes/textframes/w_textframes2.inc
@@ -868,7 +868,7 @@ testcase tTextframes_28
printlog "Insert a frame"
Call fInsertFrame(30, 30, 60, 60)
-
+ Sleep 2
printlog "Naming the frame"
Call fFormatFrame("TabZusaetze")
ObjektName.SetText sFrameName1
@@ -885,7 +885,7 @@ testcase tTextframes_28
printlog "Insert another frame"
Call fInsertFrame(50, 50, 80, 80)
-
+ Sleep 2
printlog "Naming the frame"
Call fFormatFrame("TabZusaetze")
ObjektName.SetText sFrameName2
diff --git a/testautomation/writer/optional/input/import/dostext.txt b/testautomation/writer/optional/input/import/dostext.txt
index 7e6c1044cd3a..7e6c1044cd3a 100644..100755
--- a/testautomation/writer/optional/input/import/dostext.txt
+++ b/testautomation/writer/optional/input/import/dostext.txt
diff --git a/testautomation/writer/optional/w_CJKCTLDependency.bas b/testautomation/writer/optional/w_CJKCTLDependency.bas
index f19d922cab47..f19d922cab47 100755..100644
--- a/testautomation/writer/optional/w_CJKCTLDependency.bas
+++ b/testautomation/writer/optional/w_CJKCTLDependency.bas
diff --git a/testautomation/writer/optional/w_alternative_text.bas b/testautomation/writer/optional/w_alternative_text.bas
index 0096aed4ad3c..0096aed4ad3c 100755..100644
--- a/testautomation/writer/optional/w_alternative_text.bas
+++ b/testautomation/writer/optional/w_alternative_text.bas
diff --git a/testautomation/writer/optional/w_autotext.bas b/testautomation/writer/optional/w_autotext.bas
index e30eb667cc7f..e30eb667cc7f 100755..100644
--- a/testautomation/writer/optional/w_autotext.bas
+++ b/testautomation/writer/optional/w_autotext.bas
diff --git a/testautomation/writer/optional/w_calculate.bas b/testautomation/writer/optional/w_calculate.bas
index cb38acdb02ca..cb38acdb02ca 100755..100644
--- a/testautomation/writer/optional/w_calculate.bas
+++ b/testautomation/writer/optional/w_calculate.bas
diff --git a/testautomation/writer/optional/w_chinesetranslate.bas b/testautomation/writer/optional/w_chinesetranslate.bas
index 07c14cf06f5a..07c14cf06f5a 100755..100644
--- a/testautomation/writer/optional/w_chinesetranslate.bas
+++ b/testautomation/writer/optional/w_chinesetranslate.bas
diff --git a/testautomation/writer/optional/w_drawing_tools.bas b/testautomation/writer/optional/w_drawing_tools.bas
index 888e94d4ec4f..888e94d4ec4f 100755..100644
--- a/testautomation/writer/optional/w_drawing_tools.bas
+++ b/testautomation/writer/optional/w_drawing_tools.bas
diff --git a/testautomation/writer/optional/w_dropdownLB.bas b/testautomation/writer/optional/w_dropdownLB.bas
index c3978bd8e0cc..c3978bd8e0cc 100755..100644
--- a/testautomation/writer/optional/w_dropdownLB.bas
+++ b/testautomation/writer/optional/w_dropdownLB.bas
diff --git a/testautomation/writer/optional/w_fields.bas b/testautomation/writer/optional/w_fields.bas
index 6a9d363dae3c..6a9d363dae3c 100755..100644
--- a/testautomation/writer/optional/w_fields.bas
+++ b/testautomation/writer/optional/w_fields.bas
diff --git a/testautomation/writer/optional/w_fontwork.bas b/testautomation/writer/optional/w_fontwork.bas
index 99c2574cc175..99c2574cc175 100755..100644
--- a/testautomation/writer/optional/w_fontwork.bas
+++ b/testautomation/writer/optional/w_fontwork.bas
diff --git a/testautomation/writer/optional/w_formatpage.bas b/testautomation/writer/optional/w_formatpage.bas
index 5354809b1696..5354809b1696 100755..100644
--- a/testautomation/writer/optional/w_formatpage.bas
+++ b/testautomation/writer/optional/w_formatpage.bas
diff --git a/testautomation/writer/optional/w_formatparagraph.bas b/testautomation/writer/optional/w_formatparagraph.bas
index 785e177a9d15..785e177a9d15 100755..100644
--- a/testautomation/writer/optional/w_formatparagraph.bas
+++ b/testautomation/writer/optional/w_formatparagraph.bas
diff --git a/testautomation/writer/optional/w_hhConversion.bas b/testautomation/writer/optional/w_hhConversion.bas
index 594623540f25..594623540f25 100755..100644
--- a/testautomation/writer/optional/w_hhConversion.bas
+++ b/testautomation/writer/optional/w_hhConversion.bas
diff --git a/testautomation/writer/optional/w_hyphenation.bas b/testautomation/writer/optional/w_hyphenation.bas
index 666ec36b75fd..666ec36b75fd 100755..100644
--- a/testautomation/writer/optional/w_hyphenation.bas
+++ b/testautomation/writer/optional/w_hyphenation.bas
diff --git a/testautomation/writer/optional/w_insertgraphic.bas b/testautomation/writer/optional/w_insertgraphic.bas
index 381dcd9d3f89..381dcd9d3f89 100755..100644
--- a/testautomation/writer/optional/w_insertgraphic.bas
+++ b/testautomation/writer/optional/w_insertgraphic.bas
diff --git a/testautomation/writer/optional/w_loadsave.bas b/testautomation/writer/optional/w_loadsave.bas
index b0fd90f259b9..b0fd90f259b9 100755..100644
--- a/testautomation/writer/optional/w_loadsave.bas
+++ b/testautomation/writer/optional/w_loadsave.bas
diff --git a/testautomation/writer/optional/w_navigator.bas b/testautomation/writer/optional/w_navigator.bas
index 97a188ea5ff9..97a188ea5ff9 100755..100644
--- a/testautomation/writer/optional/w_navigator.bas
+++ b/testautomation/writer/optional/w_navigator.bas
diff --git a/testautomation/writer/optional/w_redlining.bas b/testautomation/writer/optional/w_redlining.bas
index 13babf613ebf..13babf613ebf 100755..100644
--- a/testautomation/writer/optional/w_redlining.bas
+++ b/testautomation/writer/optional/w_redlining.bas
diff --git a/testautomation/writer/optional/w_section.bas b/testautomation/writer/optional/w_section.bas
index e0cabbb27c01..e0cabbb27c01 100755..100644
--- a/testautomation/writer/optional/w_section.bas
+++ b/testautomation/writer/optional/w_section.bas
diff --git a/testautomation/writer/optional/w_sorting.bas b/testautomation/writer/optional/w_sorting.bas
index 18fa47675597..18fa47675597 100755..100644
--- a/testautomation/writer/optional/w_sorting.bas
+++ b/testautomation/writer/optional/w_sorting.bas
diff --git a/testautomation/writer/optional/w_spellcheck.bas b/testautomation/writer/optional/w_spellcheck.bas
index 13d20ffb860f..13d20ffb860f 100755..100644
--- a/testautomation/writer/optional/w_spellcheck.bas
+++ b/testautomation/writer/optional/w_spellcheck.bas
diff --git a/testautomation/writer/optional/w_stylist.bas b/testautomation/writer/optional/w_stylist.bas
index f91a4ca9ea22..f91a4ca9ea22 100755..100644
--- a/testautomation/writer/optional/w_stylist.bas
+++ b/testautomation/writer/optional/w_stylist.bas
diff --git a/testautomation/writer/optional/w_textframes.bas b/testautomation/writer/optional/w_textframes.bas
index 80f2f2bfaec3..80f2f2bfaec3 100755..100644
--- a/testautomation/writer/optional/w_textframes.bas
+++ b/testautomation/writer/optional/w_textframes.bas
diff --git a/testautomation/writer/optional/w_undo.bas b/testautomation/writer/optional/w_undo.bas
index 52c5f73b3045..52c5f73b3045 100755..100644
--- a/testautomation/writer/optional/w_undo.bas
+++ b/testautomation/writer/optional/w_undo.bas
diff --git a/testautomation/writer/required/includes/w_001a_.inc b/testautomation/writer/required/includes/w_001a_.inc
index b33751752512..b33751752512 100644..100755
--- a/testautomation/writer/required/includes/w_001a_.inc
+++ b/testautomation/writer/required/includes/w_001a_.inc
diff --git a/testautomation/writer/required/includes/w_002_.inc b/testautomation/writer/required/includes/w_002_.inc
index 20ddaf92a6b9..20ddaf92a6b9 100644..100755
--- a/testautomation/writer/required/includes/w_002_.inc
+++ b/testautomation/writer/required/includes/w_002_.inc
diff --git a/testautomation/writer/required/includes/w_003_.inc b/testautomation/writer/required/includes/w_003_.inc
index 1e9f5a7b65ce..1e9f5a7b65ce 100644..100755
--- a/testautomation/writer/required/includes/w_003_.inc
+++ b/testautomation/writer/required/includes/w_003_.inc
diff --git a/testautomation/writer/required/includes/w_005_.inc b/testautomation/writer/required/includes/w_005_.inc
index a1f4d1d4f8f3..a1f4d1d4f8f3 100644..100755
--- a/testautomation/writer/required/includes/w_005_.inc
+++ b/testautomation/writer/required/includes/w_005_.inc
diff --git a/testautomation/writer/required/includes/w_005b_.inc b/testautomation/writer/required/includes/w_005b_.inc
index 707af57a1b6a..707af57a1b6a 100644..100755
--- a/testautomation/writer/required/includes/w_005b_.inc
+++ b/testautomation/writer/required/includes/w_005b_.inc
diff --git a/testautomation/writer/required/includes/w_006_.inc b/testautomation/writer/required/includes/w_006_.inc
index ba671b26d1ff..ba671b26d1ff 100644..100755
--- a/testautomation/writer/required/includes/w_006_.inc
+++ b/testautomation/writer/required/includes/w_006_.inc
diff --git a/testautomation/writer/required/includes/w_008_.inc b/testautomation/writer/required/includes/w_008_.inc
index 1cd171219a65..1cd171219a65 100644..100755
--- a/testautomation/writer/required/includes/w_008_.inc
+++ b/testautomation/writer/required/includes/w_008_.inc
diff --git a/testautomation/writer/required/includes/w_009_.inc b/testautomation/writer/required/includes/w_009_.inc
index fcc0b0e64cf8..fcc0b0e64cf8 100644..100755
--- a/testautomation/writer/required/includes/w_009_.inc
+++ b/testautomation/writer/required/includes/w_009_.inc
diff --git a/testautomation/writer/required/includes/w_010_.inc b/testautomation/writer/required/includes/w_010_.inc
index 5e2a596fbfd9..5e2a596fbfd9 100644..100755
--- a/testautomation/writer/required/includes/w_010_.inc
+++ b/testautomation/writer/required/includes/w_010_.inc
diff --git a/testautomation/writer/required/includes/w_010_1.inc b/testautomation/writer/required/includes/w_010_1.inc
index 5b746eaf4ad2..5b746eaf4ad2 100644..100755
--- a/testautomation/writer/required/includes/w_010_1.inc
+++ b/testautomation/writer/required/includes/w_010_1.inc
diff --git a/testautomation/writer/required/includes/w_011_.inc b/testautomation/writer/required/includes/w_011_.inc
index bc2fc42cf6b7..bc2fc42cf6b7 100644..100755
--- a/testautomation/writer/required/includes/w_011_.inc
+++ b/testautomation/writer/required/includes/w_011_.inc
diff --git a/testautomation/writer/tools/includes/w_get_locale_strings.inc b/testautomation/writer/tools/includes/w_get_locale_strings.inc
index 23cd09eedadb..23cd09eedadb 100644..100755
--- a/testautomation/writer/tools/includes/w_get_locale_strings.inc
+++ b/testautomation/writer/tools/includes/w_get_locale_strings.inc
diff --git a/testautomation/writer/tools/includes/w_locale_strings2.inc b/testautomation/writer/tools/includes/w_locale_strings2.inc
index 354bcc44b936..354bcc44b936 100644..100755
--- a/testautomation/writer/tools/includes/w_locale_strings2.inc
+++ b/testautomation/writer/tools/includes/w_locale_strings2.inc
diff --git a/testautomation/writer/tools/includes/w_tool1.inc b/testautomation/writer/tools/includes/w_tool1.inc
index a39fa5773102..a39fa5773102 100644..100755
--- a/testautomation/writer/tools/includes/w_tool1.inc
+++ b/testautomation/writer/tools/includes/w_tool1.inc
diff --git a/testautomation/writer/tools/includes/w_tool4.inc b/testautomation/writer/tools/includes/w_tool4.inc
index c2133c1ff4bc..c2133c1ff4bc 100644..100755
--- a/testautomation/writer/tools/includes/w_tool4.inc
+++ b/testautomation/writer/tools/includes/w_tool4.inc
diff --git a/testautomation/writer/tools/includes/w_tool5.inc b/testautomation/writer/tools/includes/w_tool5.inc
index 6ac59f3f8365..6ac59f3f8365 100644..100755
--- a/testautomation/writer/tools/includes/w_tool5.inc
+++ b/testautomation/writer/tools/includes/w_tool5.inc
diff --git a/testautomation/writer/tools/includes/w_tool6.inc b/testautomation/writer/tools/includes/w_tool6.inc
index 33ddca87709e..9bc7ed688d9b 100644
--- a/testautomation/writer/tools/includes/w_tool6.inc
+++ b/testautomation/writer/tools/includes/w_tool6.inc
@@ -38,6 +38,10 @@ sub wOfficeRestart
FileExit "SynchronMode", TRUE
Call hStartTheOffice
+
+ ' Open new document
+ Call hNewDocument
+
end sub
'--------------------------------------------------------------
diff --git a/testautomation/writer/tools/includes/w_tool7.inc b/testautomation/writer/tools/includes/w_tool7.inc
index 1079a4c3dbcc..1079a4c3dbcc 100644..100755
--- a/testautomation/writer/tools/includes/w_tool7.inc
+++ b/testautomation/writer/tools/includes/w_tool7.inc
diff --git a/testautomation/writer/tools/includes/w_tools_autocorrection.inc b/testautomation/writer/tools/includes/w_tools_autocorrection.inc
index 0b745c207696..0b745c207696 100644..100755
--- a/testautomation/writer/tools/includes/w_tools_autocorrection.inc
+++ b/testautomation/writer/tools/includes/w_tools_autocorrection.inc
diff --git a/testautomation/writer/tools/includes/w_tools_drawing.inc b/testautomation/writer/tools/includes/w_tools_drawing.inc
index 6fd3064f4d88..6fd3064f4d88 100644..100755
--- a/testautomation/writer/tools/includes/w_tools_drawing.inc
+++ b/testautomation/writer/tools/includes/w_tools_drawing.inc
diff --git a/testautomation/writer/tools/includes/w_tools_hyphenation.inc b/testautomation/writer/tools/includes/w_tools_hyphenation.inc
index 8511197269db..8511197269db 100644..100755
--- a/testautomation/writer/tools/includes/w_tools_hyphenation.inc
+++ b/testautomation/writer/tools/includes/w_tools_hyphenation.inc
diff --git a/testautomation/writer/tools/includes/w_tools_undo.inc b/testautomation/writer/tools/includes/w_tools_undo.inc
index 8040b34dc841..8040b34dc841 100644..100755
--- a/testautomation/writer/tools/includes/w_tools_undo.inc
+++ b/testautomation/writer/tools/includes/w_tools_undo.inc
diff --git a/testautomation/xml/optional/docbook_losa.bas b/testautomation/xml/optional/docbook_losa.bas
index e622c279d185..e622c279d185 100755..100644
--- a/testautomation/xml/optional/docbook_losa.bas
+++ b/testautomation/xml/optional/docbook_losa.bas
diff --git a/testautomation/xml/optional/includes/c_datapilot_pagefields.inc b/testautomation/xml/optional/includes/c_datapilot_pagefields.inc
index c35cf7785f0b..c35cf7785f0b 100644..100755
--- a/testautomation/xml/optional/includes/c_datapilot_pagefields.inc
+++ b/testautomation/xml/optional/includes/c_datapilot_pagefields.inc
diff --git a/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc b/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc
index f6a50d831649..f6a50d831649 100644..100755
--- a/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc
+++ b/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc
diff --git a/testautomation/xml/optional/includes/docbook_001.inc b/testautomation/xml/optional/includes/docbook_001.inc
index aa2a2322f791..aa2a2322f791 100644..100755
--- a/testautomation/xml/optional/includes/docbook_001.inc
+++ b/testautomation/xml/optional/includes/docbook_001.inc
diff --git a/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc b/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc
index 0cbf8244512e..0cbf8244512e 100644..100755
--- a/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc
+++ b/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc
diff --git a/testautomation/xml/optional/includes/sxd7_01.inc b/testautomation/xml/optional/includes/sxd7_01.inc
index 0c1069ff930f..0c1069ff930f 100644..100755
--- a/testautomation/xml/optional/includes/sxd7_01.inc
+++ b/testautomation/xml/optional/includes/sxd7_01.inc
diff --git a/testautomation/xml/optional/includes/sxd7_02.inc b/testautomation/xml/optional/includes/sxd7_02.inc
index 74212989c26b..74212989c26b 100644..100755
--- a/testautomation/xml/optional/includes/sxd7_02.inc
+++ b/testautomation/xml/optional/includes/sxd7_02.inc
diff --git a/testautomation/xml/optional/includes/sxd7_03.inc b/testautomation/xml/optional/includes/sxd7_03.inc
index 22d812bc93f2..22d812bc93f2 100644..100755
--- a/testautomation/xml/optional/includes/sxd7_03.inc
+++ b/testautomation/xml/optional/includes/sxd7_03.inc
diff --git a/testautomation/xml/optional/includes/sxd7_04.inc b/testautomation/xml/optional/includes/sxd7_04.inc
index 5c32c2a48d05..5c32c2a48d05 100644..100755
--- a/testautomation/xml/optional/includes/sxd7_04.inc
+++ b/testautomation/xml/optional/includes/sxd7_04.inc
diff --git a/testautomation/xml/optional/includes/sxd7_05.inc b/testautomation/xml/optional/includes/sxd7_05.inc
index a958ebe1841f..a958ebe1841f 100644..100755
--- a/testautomation/xml/optional/includes/sxd7_05.inc
+++ b/testautomation/xml/optional/includes/sxd7_05.inc
diff --git a/testautomation/xml/optional/includes/sxi7_01.inc b/testautomation/xml/optional/includes/sxi7_01.inc
index 43ebe8a8c99c..43ebe8a8c99c 100644..100755
--- a/testautomation/xml/optional/includes/sxi7_01.inc
+++ b/testautomation/xml/optional/includes/sxi7_01.inc
diff --git a/testautomation/xml/optional/includes/sxm7_01.inc b/testautomation/xml/optional/includes/sxm7_01.inc
index e8f7fd94260e..e8f7fd94260e 100644..100755
--- a/testautomation/xml/optional/includes/sxm7_01.inc
+++ b/testautomation/xml/optional/includes/sxm7_01.inc
diff --git a/testautomation/xml/optional/includes/sxw7_01.inc b/testautomation/xml/optional/includes/sxw7_01.inc
index 7f1452ad687b..7f1452ad687b 100644..100755
--- a/testautomation/xml/optional/includes/sxw7_01.inc
+++ b/testautomation/xml/optional/includes/sxw7_01.inc
diff --git a/testautomation/xml/optional/includes/sxw7_01a.inc b/testautomation/xml/optional/includes/sxw7_01a.inc
index f0121277b1e0..f0121277b1e0 100644..100755
--- a/testautomation/xml/optional/includes/sxw7_01a.inc
+++ b/testautomation/xml/optional/includes/sxw7_01a.inc
diff --git a/testautomation/xml/optional/includes/sxw7_02.inc b/testautomation/xml/optional/includes/sxw7_02.inc
index 659e574ed720..659e574ed720 100644..100755
--- a/testautomation/xml/optional/includes/sxw7_02.inc
+++ b/testautomation/xml/optional/includes/sxw7_02.inc
diff --git a/testautomation/xml/optional/includes/sxw7_03.inc b/testautomation/xml/optional/includes/sxw7_03.inc
index 6dc71c8e663a..6dc71c8e663a 100644..100755
--- a/testautomation/xml/optional/includes/sxw7_03.inc
+++ b/testautomation/xml/optional/includes/sxw7_03.inc
diff --git a/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc b/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc
index f38ed4158049..f38ed4158049 100644..100755
--- a/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc
+++ b/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc
diff --git a/testautomation/xml/required/includes/oasis_graphics_01.inc b/testautomation/xml/required/includes/oasis_graphics_01.inc
index 9c323d46386b..9c323d46386b 100644..100755
--- a/testautomation/xml/required/includes/oasis_graphics_01.inc
+++ b/testautomation/xml/required/includes/oasis_graphics_01.inc
diff --git a/testautomation/xml/tools/includes/itools1.inc b/testautomation/xml/tools/includes/itools1.inc
index 762856de69cf..762856de69cf 100644..100755
--- a/testautomation/xml/tools/includes/itools1.inc
+++ b/testautomation/xml/tools/includes/itools1.inc
diff --git a/testgraphical/prj/d.lst b/testgraphical/prj/d.lst
index e69de29bb2d1..e69de29bb2d1 100644..100755
--- a/testgraphical/prj/d.lst
+++ b/testgraphical/prj/d.lst
diff --git a/toolkit/AllLangResTarget_tk.mk b/toolkit/AllLangResTarget_tk.mk
index 571d5dfbff70..784063934112 100644
--- a/toolkit/AllLangResTarget_tk.mk
+++ b/toolkit/AllLangResTarget_tk.mk
@@ -27,7 +27,7 @@
$(eval $(call gb_AllLangResTarget_AllLangResTarget,tk))
-$(eval $(call gb_AllLangResTarget_set_reslocation,tk,toolkit/source/awt))
+$(eval $(call gb_AllLangResTarget_set_reslocation,tk,toolkit))
$(eval $(call gb_AllLangResTarget_add_srs,tk,\
toolkit/awt \
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index 5d013e8a74c4..b4b219b850e2 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -38,9 +38,9 @@
#include <tools/string.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/combobox.h>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <vcl/lstbox.h>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
class Button;
class ComboBox;
diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx
index d0baff3b8343..77be02429484 100644
--- a/toolkit/inc/pch/precompiled_toolkit.hxx
+++ b/toolkit/inc/pch/precompiled_toolkit.hxx
@@ -327,7 +327,7 @@
#include "vcl/gradient.hxx"
#include "vcl/image.hxx"
#include "vcl/jobset.hxx"
-#include "vcl/mapunit.hxx"
+#include "tools/mapunit.hxx"
#include "vcl/menu.hxx"
#include "vcl/metric.hxx"
#include "vcl/outdev.hxx"
diff --git a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
index 3f37ac58200f..31de39bf1fc3 100644
--- a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
+++ b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
@@ -41,7 +41,7 @@
#include <osl/mutex.hxx>
#include <osl/module.h>
#include <tools/link.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <toolkit/dllapi.h>
diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx
index cc11f3a586bb..fc35c480d854 100644
--- a/toolkit/inc/toolkit/helper/vclunohelper.hxx
+++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx
@@ -64,8 +64,8 @@ namespace com { namespace sun { namespace star { namespace awt {
#include <vcl/bitmapex.hxx>
#include <vcl/region.hxx>
#include <vcl/metric.hxx>
-#include <vcl/mapunit.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/mapunit.hxx>
+#include <tools/fldunit.hxx>
#include <tools/poly.hxx>
class Window;
diff --git a/toolkit/source/awt/vclxplugin.hxx b/toolkit/source/awt/vclxplugin.hxx
index 49a2b2950854..2b42eecc5872 100644
--- a/toolkit/source/awt/vclxplugin.hxx
+++ b/toolkit/source/awt/vclxplugin.hxx
@@ -29,7 +29,7 @@
#define LAYOUT_AWT_VCLXPLUGIN_HXX
#include <toolkit/awt/vclxwindow.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
class Control;
namespace layoutimpl
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 06c9167336a8..6c6b9dc4b2c8 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -173,7 +173,7 @@ namespace toolkit
_pWindow->SetStyle( nStyle );
}
- static void setVisualEffect( const Any& _rValue, Window* _pWindow, void (StyleSettings::*pSetter)( USHORT ), sal_Int16 _nFlatBits, sal_Int16 _n3DBits )
+ static void setVisualEffect( const Any& _rValue, Window* _pWindow )
{
AllSettings aSettings = _pWindow->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
@@ -183,22 +183,22 @@ namespace toolkit
switch ( nStyle )
{
case FLAT:
- (aStyleSettings.*pSetter)( _nFlatBits );
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() & ~STYLE_OPTION_MONO );
break;
case LOOK3D:
default:
- (aStyleSettings.*pSetter)( _n3DBits );
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_MONO );
}
aSettings.SetStyleSettings( aStyleSettings );
_pWindow->SetSettings( aSettings );
}
- static Any getVisualEffect( Window* _pWindow, USHORT (StyleSettings::*pGetter)( ) const, sal_Int16 _nFlatBits )
+ static Any getVisualEffect( Window* _pWindow )
{
Any aEffect;
StyleSettings aStyleSettings = _pWindow->GetSettings().GetStyleSettings();
- if ( (aStyleSettings.*pGetter)() == _nFlatBits )
+ if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
aEffect <<= (sal_Int16)FLAT;
else
aEffect <<= (sal_Int16)LOOK3D;
@@ -961,7 +961,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- ::toolkit::setVisualEffect( Value, pCheckBox, &StyleSettings::SetCheckBoxStyle, STYLE_CHECKBOX_MONO, STYLE_CHECKBOX_WIN );
+ ::toolkit::setVisualEffect( Value, pCheckBox );
break;
case BASEPROPERTY_TRISTATE:
@@ -998,7 +998,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- aProp = ::toolkit::getVisualEffect( pCheckBox, &StyleSettings::GetCheckBoxStyle, STYLE_CHECKBOX_MONO );
+ aProp = ::toolkit::getVisualEffect( pCheckBox );
break;
case BASEPROPERTY_TRISTATE:
aProp <<= (sal_Bool)pCheckBox->IsTriStateEnabled();
@@ -1133,7 +1133,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- ::toolkit::setVisualEffect( Value, pButton, &StyleSettings::SetRadioButtonStyle, STYLE_RADIOBUTTON_MONO, STYLE_RADIOBUTTON_WIN );
+ ::toolkit::setVisualEffect( Value, pButton );
break;
case BASEPROPERTY_STATE:
@@ -1176,7 +1176,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- aProp = ::toolkit::getVisualEffect( pButton, &StyleSettings::GetRadioButtonStyle, STYLE_RADIOBUTTON_MONO );
+ aProp = ::toolkit::getVisualEffect( pButton );
break;
case BASEPROPERTY_STATE:
aProp <<= (sal_Int16) ( pButton->IsChecked() ? 1 : 0 );
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index 7ffafdf0ddb6..adc40b0426d7 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -198,7 +198,7 @@ void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::s
::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] );
rowHeaders.erase(rowHeaders.begin() + index);
- Sequence< Any >& rowData ( (Sequence< Any >&)data[index] );
+ Sequence< Any > rowData ( (Sequence< Any >&)data[index] );
data.erase(data.begin() + index);
broadcast_remove( index, headerName, rowData);
}
@@ -241,7 +241,7 @@ void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
{
rowHeaders.clear();
data.clear();
- broadcast_remove( -1, ::rtl::OUString(), 0);
+ broadcast_remove( -1, ::rtl::OUString(), Sequence< Any >());
}
//---------------------------------------------------------------------
void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx
index 637539f6dd6f..0154b4403501 100644
--- a/tools/inc/tools/fldunit.hxx
+++ b/tools/inc/tools/fldunit.hxx
@@ -32,7 +32,6 @@
// - FieldTypes -
// --------------
-// By changes you must also change: rsc/vclrsc.hxx
enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
diff --git a/tools/inc/tools/mapunit.hxx b/tools/inc/tools/mapunit.hxx
index 0b5f5d044d19..b30d3865d862 100644
--- a/tools/inc/tools/mapunit.hxx
+++ b/tools/inc/tools/mapunit.hxx
@@ -32,7 +32,6 @@
// - MapMode-Types -
// -----------------
-// By changes you must also change: rsc/vclrsc.hxx
enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 9c7052e22d77..cfa08c325573 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -124,7 +124,6 @@ typedef USHORT WindowType;
// - Window-Bits -
// ---------------
-// By changes you must also change: rsc/vclrsc.hxx
typedef sal_Int64 WinBits;
// Window-Bits fuer Window
@@ -239,9 +238,6 @@ typedef sal_Int64 WinBits;
#define WB_SCROLL ((WinBits)0x02000000)
#define WB_FORCETABCYCLE ((WinBits)0x04000000)
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
// Window-Bits for DockingWindows
#define WB_DOCKBORDER ((WinBits)0x00001000)
@@ -305,7 +301,6 @@ typedef sal_Int64 WinBits;
// - WindowAlign -
// ---------------
-// By changes you must also change: rsc/vclrsc.hxx
enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM,
IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT,
@@ -317,7 +312,6 @@ enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
// - TriState -
// ------------
-// By changes you must also change: rsc/vclrsc.hxx
enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index 5c0136fab063..5c0136fab063 100644..100755
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
diff --git a/unotools/inc/unotools/lingucfg.hxx b/unotools/inc/unotools/lingucfg.hxx
index 9a26bdd73021..9a26bdd73021 100644..100755
--- a/unotools/inc/unotools/lingucfg.hxx
+++ b/unotools/inc/unotools/lingucfg.hxx
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 39233f022534..39233f022534 100644..100755
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index ee233f5ac9de..ee233f5ac9de 100755..100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 6402653d3bda..b0630a5514b2 100755
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -42,7 +42,7 @@
#include "tools/solar.h" // USHORT
#include "tools/errcode.hxx" // ErrCode
#include "tools/rc.hxx" // Resource
-#include "vcl/wintypes.hxx" // WinBits
+#include "tools/wintypes.hxx" // WinBits
namespace com { namespace sun { namespace star {
namespace awt {
diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc
index c292befb1663..c292befb1663 100755..100644
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
index 736e0f9ae1df..736e0f9ae1df 100755..100644
--- a/uui/source/logindlg.src
+++ b/uui/source/logindlg.src
diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx
index 39bbfb7d820c..39bbfb7d820c 100755..100644
--- a/uui/source/loginerr.hxx
+++ b/uui/source/loginerr.hxx
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 1622be0b38ab..1622be0b38ab 100755..100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 348d2f833e15..348d2f833e15 100755..100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
diff --git a/uui/source/passworddlg.hrc b/uui/source/passworddlg.hrc
index e9a8bb5b5b04..e9a8bb5b5b04 100755..100644
--- a/uui/source/passworddlg.hrc
+++ b/uui/source/passworddlg.hrc
diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx
index b94dbab82444..b94dbab82444 100755..100644
--- a/uui/source/passworddlg.hxx
+++ b/uui/source/passworddlg.hxx
diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src
index 3d4307ad4f80..3d4307ad4f80 100755..100644
--- a/uui/source/passworderrs.src
+++ b/uui/source/passworderrs.src
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index cf6d655ff353..bddd756f6836 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -311,8 +311,8 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u
if ( !xModel.is() )
xModel = getCurrentDocument();
- VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( xModel ), aMacroName );
- if( aMacroInfo.IsResolved() )
+ MacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( xModel ), aMacroName );
+ if( aMacroInfo.mbFound )
{
// handle the arguments
const uno::Any* aArgsPtrArray[] = { &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15, &varg16, &varg17, &varg18, &varg19, &varg20, &varg21, &varg22, &varg23, &varg24, &varg25, &varg26, &varg27, &varg28, &varg29, &varg30 };
@@ -338,7 +338,7 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u
uno::Any aRet;
uno::Any aDummyCaller;
- executeMacro( aMacroInfo.MacroDocContext(), aMacroInfo.ResolvedMacro(), aArgs, aRet, aDummyCaller );
+ executeMacro( aMacroInfo.mpDocContext, aMacroInfo.msResolvedMacro, aArgs, aRet, aDummyCaller );
}
else
{
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index 56b89c27bb5b..157d54eca7d5 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -78,10 +78,10 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
{
// get the current model
uno::Reference< frame::XModel > xModel( pCBarHelper->getModel() );
- VBAMacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true );
- if ( aResolvedMacro.IsResolved() )
+ MacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true );
+ if ( aResolvedMacro.mbFound )
{
- rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.ResolvedMacro() );
+ rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro );
OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() );
setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( aCommandURL ) );
ApplyChange();
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index b88086cd6d1d..8000a7cdf66e 100755
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -196,8 +196,8 @@ const VbaEventsHelperBase::EventHandlerInfo& VbaEventsHelperBase::getEventHandle
append( sal_Unicode( '.' ) ).append( rInfo.maMacroName ).makeStringAndClear();
break;
}
- VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( mpShell, aMacroName, false );
- return aMacroInfo.IsResolved() ? ::rtl::OUString( aMacroInfo.ResolvedMacro() ) : ::rtl::OUString();
+ MacroResolvedInfo aMacroInfo = resolveVBAMacro( mpShell, aMacroName, false );
+ return aMacroInfo.mbFound ? ::rtl::OUString( aMacroInfo.msResolvedMacro ) : ::rtl::OUString();
}
void VbaEventsHelperBase::stopListening()
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 06af0358c52b..5a476e0a54cc 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -360,68 +360,29 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
- YIELD_GUARD;
-
- SalData* pSalData = GetSalData();
- #if 1 // currently do some really bad hack
- if( ! pSalData->maFrames.empty() )
+ NSApplicationTerminateReply aReply = NSTerminateNow;
{
- /* #i92766# something really weird is going on with the retain count of
- our windows; sometimes we get a duplicate free before exit on one of our
- NSWindows. The reason is unclear; to avoid this currently we retain them once more
-
- FIXME: this is a really bad hack, relying on the system to catch the leaked
- resources. Find out what really goes on here and fix it !
- */
- std::vector< NSWindow* > aHackRetainedWindows;
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
- {
- #if OSL_DEBUG_LEVEL > 1
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, [(*it)->mpWindow retainCount],
- typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- #endif
- [(*it)->mpWindow retain];
- aHackRetainedWindows.push_back( (*it)->mpWindow );
- }
- if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) )
+ YIELD_GUARD;
+
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->maFrames.empty() )
{
- for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin();
- it != aHackRetainedWindows.end(); ++it )
- {
- // clean up the retaing count again from the shutdown workaround
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "releasing %p\n", (*it) );
- #endif
- [(*it) release];
- }
- return NSTerminateCancel;
+ // the following QueryExit will likely present a message box, activate application
+ [NSApp activateIgnoringOtherApps: YES];
+ aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
}
- #if OSL_DEBUG_LEVEL > 1
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
+
+ if( aReply == NSTerminateNow )
{
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
+ ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() );
+ GetpApp()->AppEvent( aEv );
+ ImplImageTreeSingletonRef()->shutDown();
+ // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
+ // can occur in Desktop::doShutdown for example
}
- #endif
}
- #else // the clean version follows
- return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
- #endif
- ImplImageTreeSingletonRef()->shutDown();
- return NSTerminateNow;
+
+ return aReply;
}
-(void)systemColorsChanged: (NSNotification*) pNotification
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index d19290d8320a..93945570dc96 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -322,6 +322,9 @@ class ControllerProperties
GDIMetaFile aMtf;
PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
VirtualDevice aDev;
+ if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
+ aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
// see salprn.cxx, currently we pretend to be a 720dpi device on printers
aDev.SetReferenceDevice( 720, 720 );
aDev.EnableOutput( TRUE );
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index e1daf649f6da..070c0753637d 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -2356,8 +2356,10 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
const ImplFontCharMap* pMap = mpMacFontData->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no charmap" );
+ pMap->AddReference(); // TODO: add and use RAII object instead
// get unicode<->glyph encoding
+ // TODO? avoid sft mapping by using the pMap itself
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
for(; --nCharCount >= 0; nChar = pMap->GetNextChar( nChar ) )
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 240a915e4e12..bc87ea444710 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -154,7 +154,9 @@ static AquaSalFrame* getMouseContainerFrame()
NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
{ pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
pFrame->VCLToCocoa( aRect );
- return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
+ return pNSWindow;
}
-(AquaSalFrame*)getSalFrame
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index ab92445b5e03..ddd023a3aaa4 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -78,7 +78,6 @@ public:
~Button();
virtual void Click();
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index e1f39cc78966..6be9fd8d42c5 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -34,7 +34,7 @@
#include <tools/time.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/combobox.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx
index 4176d5b4454f..dad10fb62b33 100644
--- a/vcl/inc/vcl/lazydelete.hxx
+++ b/vcl/inc/vcl/lazydelete.hxx
@@ -39,6 +39,8 @@
#include <stdio.h>
#endif
+#include <com/sun/star/lang/XComponent.hpp>
+
namespace vcl
{
/* Helpers for lazy object deletion
@@ -256,6 +258,43 @@ namespace vcl
// ownership is transfered !
T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; }
};
+
+ /** Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit
+ template class makes sure that a static UNO object is disposed
+ and released at the right time.
+
+ Use like
+ static DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory>
+ xStaticFactory (<create factory object>);
+ Reference<lang::XMultiServiceFactory> xFactory (xStaticFactory.get());
+ if (xFactory.is())
+ <do something with xFactory>
+ */
+ template <typename I>
+ class DeleteUnoReferenceOnDeinit : public ::vcl::DeleteOnDeinitBase
+ {
+ ::com::sun::star::uno::Reference<I> m_xI;
+ virtual void doCleanup() { set(NULL); }
+ public:
+ DeleteUnoReferenceOnDeinit(const ::com::sun::star::uno::Reference<I>& r_xI ) : m_xI( r_xI ) {
+ addDeinitContainer( this ); }
+ virtual ~DeleteUnoReferenceOnDeinit() {}
+
+ ::com::sun::star::uno::Reference<I> get (void) { return m_xI; }
+
+ void set (const ::com::sun::star::uno::Reference<I>& r_xNew )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, ::com::sun::star::uno::UNO_QUERY);
+ m_xI = r_xNew;
+ if (xComponent.is()) try
+ {
+ xComponent->dispose();
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+ };
}
#endif
diff --git a/vcl/inc/vcl/mapmod.hxx b/vcl/inc/vcl/mapmod.hxx
index b2ea32958e90..260a5f4f86c2 100644
--- a/vcl/inc/vcl/mapmod.hxx
+++ b/vcl/inc/vcl/mapmod.hxx
@@ -33,7 +33,7 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <tools/resid.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
class SvStream;
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index 4bbf7176ddb2..7ad233449d93 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -39,8 +39,6 @@
#include <hash_map>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
-
class ImplDevFontListData;
class ImplGetDevFontList;
class ImplGetDevSizeList;
@@ -54,6 +52,8 @@ class ConvertChar;
struct FontMatchStatus;
class OutputDevice;
+namespace com { namespace sun { namespace star { namespace lang { struct Locale; }}}}
+
// ----------------------
// - ImplFontAttributes -
// ----------------------
@@ -140,7 +140,7 @@ public:
virtual ImplFontData* Clone() const = 0;
protected:
- ImplFontData( const ImplDevFontAttributes&, int nMagic );
+ explicit ImplFontData( const ImplDevFontAttributes&, int nMagic );
void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
long mnWidth; // Width (in pixels)
@@ -199,8 +199,8 @@ private:
ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyh fallback substitution
public:
- ImplDevFontList();
- ~ImplDevFontList();
+ explicit ImplDevFontList();
+ virtual ~ImplDevFontList();
// fill the list with device fonts
void Add( ImplFontData* );
@@ -226,7 +226,7 @@ public:
ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const;
//used by 2-level font fallback
- ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const;
+ ImplDevFontListData* ImplFindByLocale( com::sun::star::lang::Locale& ) const;
protected:
void InitMatchData() const;
@@ -267,7 +267,7 @@ struct ImplKernPairData
class ImplFontMetricData : public ImplFontAttributes
{
public:
- ImplFontMetricData( const ImplFontSelectData& );
+ explicit ImplFontMetricData( const ImplFontSelectData& );
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
@@ -327,7 +327,7 @@ public: // TODO: hide members behind accessor methods
class VCL_DLLPUBLIC ImplFontEntry
{
public:
- ImplFontEntry( const ImplFontSelectData& );
+ explicit ImplFontEntry( const ImplFontSelectData& );
virtual ~ImplFontEntry();
public: // TODO: make data members private
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 810fbd353f8c..40d88ca373db 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -208,6 +208,11 @@ public:
BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; }
void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; }
+
+ // read printer options from configuration, parameter decides whether the set for
+ // print "to printer" or "to file" should be read.
+ // returns true if config was read, false if an error occured
+ bool ReadFromConfig( bool bFile );
};
// -----------
@@ -313,7 +318,12 @@ public:
BOOL Setup( Window* pWindow = NULL );
BOOL SetPrinterProps( const Printer* pPrinter );
- void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; }
+ // SetPrinterOptions is used internally only now
+ // in earlier times it was used only to set the options loaded directly from the configuration
+ // in SfxPrinter::InitJob, this is now handled internally
+ // should the need arise to set the printer options outside vcl, also a method would have to be devised
+ // to not override these again internally
+ SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions );
const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
BOOL SetOrientation( Orientation eOrient );
@@ -349,10 +359,6 @@ public:
BOOL IsPrinting() const { return mbPrinting; }
- void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; }
- const XubString& GetPrintFile() const { return maPrintFile; }
- void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; }
- BOOL IsPrintFileEnabled() const { return mbPrintFile; }
BOOL AbortJob();
const XubString& GetCurJobName() const { return maJobName; }
USHORT GetCurPage() const { return mnCurPage; }
@@ -538,6 +544,7 @@ public:
SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const;
SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
};
class VCL_DLLPUBLIC PrinterOptionsHelper
@@ -620,28 +627,34 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
, mbEnabled( i_bEnabled ) {}
};
+ // note: in the following helper functions HelpIds are expected as an rtl::OUString
+ // the normal HelpId form is rtl::OString (byte string instead of UTF16 string)
+ // this is because the whole interface is base on UNO properties; in fact the structures
+ // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
+ // transported via UTF16 strings.
+
// general control
static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rType,
const com::sun::star::beans::PropertyValue* i_pValue = NULL,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a group (e.g. a TabPage); following controls will be grouped in it until the next
// group begins
- static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
+ static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId );
// create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next
// subgroup or group begins
// setting bJobPage = true will make the subgroup appear on the first page of the print dialog
static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a bool option (usually a checkbox)
static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
@@ -649,7 +662,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a set of choices (either a radio button group or a list box)
static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
@@ -661,7 +674,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create an integer range (e.g. a spin field)
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue = -1,
@@ -672,7 +685,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a string field
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index 1d16a2241485..d21e517d12f7 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -59,6 +59,7 @@ namespace vcl
VirtualDevice maPageVDev;
rtl::OUString maReplacementString;
rtl::OUString maToolTipString;
+ bool mbGreyscale;
FixedLine maHorzDim;
FixedLine maVertDim;
@@ -73,7 +74,8 @@ namespace vcl
virtual void DataChanged( const DataChangedEvent& );
void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
- sal_Int32 i_nDPIX, sal_Int32 i_nDPIY
+ sal_Int32 i_nDPIX, sal_Int32 i_nDPIY,
+ bool i_bGreyscale
);
};
diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx
deleted file mode 100644
index d9e25c0cada9..000000000000
--- a/vcl/inc/vcl/salatype.hxx
+++ /dev/null
@@ -1,47 +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 _SV_SALATYPE_HXX
-#define _SV_SALATYPE_HXX
-
-#include <vcl/sv.h>
-
-// ---------------------
-// - Application-Types -
-// ---------------------
-
-// Derzeit doppelt und in apptypes.hxx auch vorhanden
-
-#define INPUT_MOUSE 0x0001
-#define INPUT_KEYBOARD 0x0002
-#define INPUT_PAINT 0x0004
-#define INPUT_TIMER 0x0008
-#define INPUT_OTHER 0x0010
-#define INPUT_MOUSEANDKEYBOARD (INPUT_MOUSE | INPUT_KEYBOARD)
-#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER)
-
-#endif // _SV_SALATYPE_HXX
diff --git a/vcl/inc/vcl/salctype.hxx b/vcl/inc/vcl/salctype.hxx
index 1566f02a1299..0cb037ad40e1 100644
--- a/vcl/inc/vcl/salctype.hxx
+++ b/vcl/inc/vcl/salctype.hxx
@@ -28,6 +28,9 @@
#ifndef _SV_SALCTYPE_HXX
#define _SV_SALCTYPE_HXX
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
#include <vcl/graph.hxx>
// -----------
@@ -77,4 +80,13 @@ typedef ULONG (*SALGRFCVTPROC)( void* pInst,
ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
ULONG nOutFormat, void** ppOutBuffer );
+// -------------------
+// - BitmapConverter -
+// -------------------
+
+namespace vcl
+{
+com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+}
+
#endif // _SV_SALCTYPE_HXX
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index d8276406746e..b4769c045708 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -36,7 +36,6 @@
#include "vos/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
-#include "vcl/salctrlhandle.hxx"
#include <map>
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index 19c34cbc5e34..621cf0e90c5a 100644..100755
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -175,6 +175,7 @@ typedef sal_uInt32 ControlPart;
#define PART_MENU_ITEM 250
#define PART_MENU_ITEM_CHECK_MARK 251
#define PART_MENU_ITEM_RADIO_MARK 252
+#define PART_MENU_SEPARATOR 253
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
@@ -432,6 +433,24 @@ public:
int maTopDockingAreaHeight;
};
+/* MenupopupValue:
+ *
+ * Value container for menu items; specifies the rectangle for the whole item which
+ * may be useful when drawing parts with a smaller rectangle.
+ */
+class MenupopupValue : public ImplControlValue
+{
+public:
+ MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 )
+ {}
+ MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
+ : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth )
+ , maItemRect( i_rItemRect )
+ {}
+ virtual ~MenupopupValue();
+ Rectangle maItemRect;
+};
+
/* PushButtonValue:
*
* Value container for pushbuttons specifying additional drawing hints
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index 24fd30750501..cc5cbcbc4d0f 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -423,10 +423,6 @@ private:
ULONG mnOptions;
USHORT mnScreenZoom;
USHORT mnScreenFontZoom;
- USHORT mnRadioButtonStyle;
- USHORT mnCheckBoxStyle;
- USHORT mnPushButtonStyle;
- USHORT mnTabControlStyle;
USHORT mnHighContrast;
USHORT mnUseSystemUIFonts;
USHORT mnAutoMnemonic;
@@ -457,11 +453,6 @@ private:
#define STYLE_OPTION_SPINARROW ((ULONG)0x00000080)
#define STYLE_OPTION_SPINUPDOWN ((ULONG)0x00000100)
#define STYLE_OPTION_NOMNEMONICS ((ULONG)0x00000200)
-#define STYLE_OPTION_WINSTYLE ((ULONG)0x00010000)
-#define STYLE_OPTION_OS2STYLE ((ULONG)0x00020000)
-#define STYLE_OPTION_MACSTYLE ((ULONG)0x00040000)
-#define STYLE_OPTION_UNIXSTYLE ((ULONG)0x00080000)
-#define STYLE_OPTION_SYSTEMSTYLE ((ULONG)0x000F0000)
#define STYLE_OPTION_HIDEDISABLED ((ULONG)0x00100000)
#define DRAGFULL_OPTION_WINDOWMOVE ((ULONG)0x00000001)
@@ -488,28 +479,8 @@ private:
#define DISPLAY_OPTION_AA_DISABLE ((ULONG)0x00000001)
-#define STYLE_RADIOBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_RADIOBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_RADIOBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_RADIOBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0005)
-#define STYLE_RADIOBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_CHECKBOX_WIN ((USHORT)0x0001)
-#define STYLE_CHECKBOX_OS2 ((USHORT)0x0002)
-#define STYLE_CHECKBOX_MAC ((USHORT)0x0003)
-#define STYLE_CHECKBOX_UNIX ((USHORT)0x0004)
-#define STYLE_CHECKBOX_MONO ((USHORT)0x0005)
-#define STYLE_CHECKBOX_STYLE ((USHORT)0x000F)
-
-#define STYLE_PUSHBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_PUSHBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_PUSHBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_PUSHBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_PUSHBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_TABCONTROL_SINGLELINE ((USHORT)0x0001)
-#define STYLE_TABCONTROL_COLOR ((USHORT)0x0002)
+#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0001) // legacy
+#define STYLE_CHECKBOX_MONO ((USHORT)0x0001) // legacy
#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((ULONG)0)
#define STYLE_TOOLBAR_ICONSIZE_SMALL ((ULONG)1)
@@ -813,23 +784,6 @@ public:
const Font& GetIconFont() const
{ return mpData->maIconFont; }
- void SetRadioButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnRadioButtonStyle = nStyle; }
- USHORT GetRadioButtonStyle() const
- { return mpData->mnRadioButtonStyle; }
- void SetCheckBoxStyle( USHORT nStyle )
- { CopyData(); mpData->mnCheckBoxStyle = nStyle; }
- USHORT GetCheckBoxStyle() const
- { return mpData->mnCheckBoxStyle; }
- void SetPushButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnPushButtonStyle = nStyle; }
- USHORT GetPushButtonStyle() const
- { return mpData->mnPushButtonStyle; }
- void SetTabControlStyle( USHORT nStyle )
- { CopyData(); mpData->mnTabControlStyle = nStyle; }
- USHORT GetTabControlStyle() const
- { return mpData->mnTabControlStyle; }
-
void SetBorderSize( long nSize )
{ CopyData(); mpData->mnBorderSize = nSize; }
long GetBorderSize() const
@@ -971,10 +925,6 @@ public:
{ CopyData(); mpData->maWorkspaceGradient = rWall; }
void SetStandardStyles();
- void SetStandardWinStyles();
- void SetStandardOS2Styles();
- void SetStandardMacStyles();
- void SetStandardUnixStyles();
const StyleSettings& operator =( const StyleSettings& rSet );
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index e915644aa8ec..432a30c3a748 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -31,11 +31,7 @@
#include "svl/solar.hrc"
#define SV_RESID_STDOFFSET 0
-#define SV_RESID_WINOFFSET 1
-#define SV_RESID_OS2OFFSET 2
-#define SV_RESID_MACOFFSET 3
-#define SV_RESID_UNIXOFFSET 4
-#define SV_RESID_MONOOFFSET 5
+#define SV_RESID_MONOOFFSET 1
// Achtung: Diese Id's muessen min. 10 Werte auseinanderliegen, da
// je nach Style noch ein Offset aufgerechnet wird
diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx
index c7a745516856..0f0627fb41e3 100644
--- a/vcl/inc/vcl/symbol.hxx
+++ b/vcl/inc/vcl/symbol.hxx
@@ -71,9 +71,6 @@ typedef USHORT SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_MENU SYMBOL_SPIN_DOWN
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index ad702ac4dc54..430a99235b52 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -63,13 +63,9 @@ private:
long mnMaxPageWidth;
USHORT mnActPageId;
USHORT mnCurPageId;
- USHORT mnFirstPagePos;
- USHORT mnLastFirstPagePos;
BOOL mbFormat;
BOOL mbRestoreHelpId;
BOOL mbRestoreUnqId;
- BOOL mbSingleLine;
- BOOL mbScroll;
BOOL mbSmallInvalidate;
BOOL mbExtraSpace;
Link maActivateHdl;
@@ -78,22 +74,17 @@ private:
using Control::ImplInitSettings;
SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const;
- SAL_DLLPRIVATE void ImplScrollBtnsColor();
- SAL_DLLPRIVATE void ImplSetScrollBtnsState();
- SAL_DLLPRIVATE void ImplPosScrollBtns();
SAL_DLLPRIVATE Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth );
SAL_DLLPRIVATE Rectangle ImplGetTabRect( USHORT nPos, long nWidth = -1, long nHeight = -1 );
SAL_DLLPRIVATE void ImplChangeTabPage( USHORT nId, USHORT nOldId );
SAL_DLLPRIVATE BOOL ImplPosCurTabPage();
SAL_DLLPRIVATE void ImplActivateTabPage( BOOL bNext );
- SAL_DLLPRIVATE void ImplSetFirstPagePos( USHORT nPagePos );
SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false );
SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false );
SAL_DLLPRIVATE void ImplFreeLayoutData();
SAL_DLLPRIVATE long ImplHandleKeyEvent( const KeyEvent& rKeyEvent );
- DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn );
DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, ListBox* );
DECL_DLLPRIVATE_LINK( ImplWindowEventListener, VclSimpleEvent* );
@@ -156,9 +147,6 @@ public:
void SetCurPageId( USHORT nPageId );
USHORT GetCurPageId() const;
- void SetFirstPageId( USHORT nPageId );
- USHORT GetFirstPageId() const { return GetPageId( mnFirstPagePos ); }
-
void SelectTabPage( USHORT nPageId );
void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; }
diff --git a/vcl/inc/vcl/windata.hxx b/vcl/inc/vcl/windata.hxx
deleted file mode 100644
index 9436352e4927..000000000000
--- a/vcl/inc/vcl/windata.hxx
+++ /dev/null
@@ -1,49 +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 _SV_WINDATA_HXX
-#define _SV_WINDATA_HXX
-
-#include <vcl/sv.h>
-
-class SalFrame;
-class Window;
-
-// --------------
-// - Prototypes -
-// --------------
-
-long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent );
-
-// -----------
-// - HitTest -
-// -----------
-
-#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001)
-#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002)
-
-#endif // _SV_WINDATA_HXX
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index 73b6f1078ca9..c710156422bf 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -38,7 +38,7 @@
#ifndef _SV_POINTR_HXX
#include <vcl/pointr.hxx>
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/vclevent.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
@@ -56,7 +56,6 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SalControlHandle;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -105,7 +104,18 @@ namespace vcl {
}
+// --------------
+// - Prototypes -
+// --------------
+long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent );
+
+// -----------
+// - HitTest -
+// -----------
+
+#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001)
+#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002)
// ---------------
// - ImplWinData -
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index fa136f6d514d..5ba3b615904e 100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -35,7 +35,7 @@
#ifndef _SV_POINTR_HXX
#include <vcl/pointr.hxx>
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#ifndef _SV_APPTYPES_HXX
#include <vcl/apptypes.hxx>
#endif
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index df564f36ee0a..9d74f281d680 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -43,7 +43,7 @@
#ifndef _SV_SALIDS_HRC
#include <salids.hrc>
#endif
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <saldata.hxx>
#include <salinst.h>
#include <salframe.h>
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index f3314c725255..f465dc741a60 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -2122,8 +2122,6 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// --- Style settings ---
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
-
// General settings
LONG nDisplayTime = PrfQueryProfileInt( HINI_PROFILE, (PSZ)aControlPanel, (PSZ)"LogoDisplayTime", -1 );
ULONG nSalDisplayTime;
@@ -2145,32 +2143,26 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// Size settings
aStyleSettings.SetScrollBarSize( WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL ) );
- if ( bCompBorder )
- {
- aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
- }
+ aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
// Color settings
- if ( bCompBorder )
- {
- aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
- aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
- aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
- aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
- aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
- aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
- aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- }
+ aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
+ aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
+ aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
+ aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
+ aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
+ aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetRadioCheckTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetGroupTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWSTATICTEXT, 0 ) ) );
@@ -2187,11 +2179,8 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
Color aMenuHighColor = ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0 ) );
if ( ImplSalIsSameColor( aMenuHighColor, aStyleSettings.GetMenuColor() ) )
{
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
- aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
- }
+ aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
+ aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
}
else
{
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 196bdeb19c0e..307064f7555d 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -41,7 +41,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\field.hxx %_DEST%\inc%_EXT%\vcl\field.hxx
..\inc\vcl\fixbrd.hxx %_DEST%\inc%_EXT%\vcl\fixbrd.hxx
..\inc\vcl\fixed.hxx %_DEST%\inc%_EXT%\vcl\fixed.hxx
-..\inc\vcl\fldunit.hxx %_DEST%\inc%_EXT%\vcl\fldunit.hxx
..\inc\vcl\floatwin.hxx %_DEST%\inc%_EXT%\vcl\floatwin.hxx
..\inc\vcl\fntstyle.hxx %_DEST%\inc%_EXT%\vcl\fntstyle.hxx
..\inc\vcl\font.hxx %_DEST%\inc%_EXT%\vcl\font.hxx
@@ -69,7 +68,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\lstbox.h %_DEST%\inc%_EXT%\vcl\lstbox.h
..\inc\vcl\lstbox.hxx %_DEST%\inc%_EXT%\vcl\lstbox.hxx
..\inc\vcl\mapmod.hxx %_DEST%\inc%_EXT%\vcl\mapmod.hxx
-..\inc\vcl\mapunit.hxx %_DEST%\inc%_EXT%\vcl\mapunit.hxx
..\inc\vcl\menu.hxx %_DEST%\inc%_EXT%\vcl\menu.hxx
..\inc\vcl\menubtn.hxx %_DEST%\inc%_EXT%\vcl\menubtn.hxx
..\inc\vcl\metaact.hxx %_DEST%\inc%_EXT%\vcl\metaact.hxx
@@ -128,7 +126,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\waitobj.hxx %_DEST%\inc%_EXT%\vcl\waitobj.hxx
..\inc\vcl\wall.hxx %_DEST%\inc%_EXT%\vcl\wall.hxx
..\inc\vcl\window.hxx %_DEST%\inc%_EXT%\vcl\window.hxx
-..\inc\vcl\wintypes.hxx %_DEST%\inc%_EXT%\vcl\wintypes.hxx
..\inc\vcl\wrkwin.hxx %_DEST%\inc%_EXT%\vcl\wrkwin.hxx
..\inc\vcl\threadex.hxx %_DEST%\inc%_EXT%\vcl\threadex.hxx
..\inc\vcl\evntpost.hxx %_DEST%\inc%_EXT%\vcl\evntpost.hxx
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2a04389d8f44..73eaa8f965d2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -38,7 +38,6 @@
#include <vcl/salbmp.hxx>
#include <vcl/salobj.hxx>
#include <vcl/salmenu.hxx>
-#include <vcl/salctrlhandle.hxx>
// this file contains the virtual destructors of the sal interface
// compilers ususally put their vtables where the destructor is
@@ -161,7 +160,4 @@ Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
SalMenuItem::~SalMenuItem()
{
}
-SalControlHandle::~SalControlHandle()
-{
-}
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index b91afbbae9fe..dbc792039f80 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -419,10 +419,6 @@ ImplStyleData::ImplStyleData()
mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME;
mnScreenZoom = 100;
mnScreenFontZoom = 100;
- mnRadioButtonStyle = 0;
- mnCheckBoxStyle = 0;
- mnPushButtonStyle = 0;
- mnTabControlStyle = 0;
mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME;
mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE |
DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE |
@@ -523,10 +519,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnCursorBlinkTime = rData.mnCursorBlinkTime;
mnScreenZoom = rData.mnScreenZoom;
mnScreenFontZoom = rData.mnScreenFontZoom;
- mnRadioButtonStyle = rData.mnRadioButtonStyle;
- mnCheckBoxStyle = rData.mnCheckBoxStyle;
- mnPushButtonStyle = rData.mnPushButtonStyle;
- mnTabControlStyle = rData.mnTabControlStyle;
mnLogoDisplayTime = rData.mnLogoDisplayTime;
mnDragFullOptions = rData.mnDragFullOptions;
mnAnimationOptions = rData.mnAnimationOptions;
@@ -617,12 +609,6 @@ void ImplStyleData::SetStandardStyles()
maHighlightLinkColor = Color( COL_LIGHTBLUE );
maFontColor = Color( COL_BLACK );
- mnRadioButtonStyle &= ~STYLE_RADIOBUTTON_STYLE;
- mnCheckBoxStyle &= ~STYLE_CHECKBOX_STYLE;
- mnPushButtonStyle &= ~STYLE_PUSHBUTTON_STYLE;
- mnTabControlStyle = 0;
-
- mnOptions &= ~(STYLE_OPTION_SYSTEMSTYLE | STDSYS_STYLE);
mnBorderSize = 1;
mnTitleHeight = 18;
mnFloatTitleHeight = 13;
@@ -874,34 +860,6 @@ void StyleSettings::SetStandardStyles()
// -----------------------------------------------------------------------
-void StyleSettings::SetStandardWinStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardOS2Styles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardMacStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardUnixStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
Color StyleSettings::GetFaceGradientColor() const
{
// compute a brighter face color that can be used in gradients
@@ -1036,10 +994,6 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnAntialiasedMin == rSet.mpData->mnAntialiasedMin) &&
(mpData->mnScreenZoom == rSet.mpData->mnScreenZoom) &&
(mpData->mnScreenFontZoom == rSet.mpData->mnScreenFontZoom) &&
- (mpData->mnRadioButtonStyle == rSet.mpData->mnRadioButtonStyle) &&
- (mpData->mnCheckBoxStyle == rSet.mpData->mnCheckBoxStyle) &&
- (mpData->mnPushButtonStyle == rSet.mpData->mnPushButtonStyle) &&
- (mpData->mnTabControlStyle == rSet.mpData->mnTabControlStyle) &&
(mpData->mnHighContrast == rSet.mpData->mnHighContrast) &&
(mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) &&
(mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) &&
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index e503172eb2c6..dd1ea7c0469e 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -45,7 +45,6 @@
#include "vcl/event.hxx"
#include "vcl/vclevent.hxx"
#include "vcl/virdev.hxx"
-#include "vcl/windata.hxx"
#include "vcl/window.h"
#include "vcl/wrkwin.hxx"
#include "vcl/idlemgr.hxx"
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index db7649a90258..82bec2214dff 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -769,47 +769,6 @@ BOOL Button::IsTextDisplayEnabled()
}
// -----------------------------------------------------------------------
-void Button::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Control::DataChanged( rDCEvt );
-
- // The flag SETTINGS_IN_UPDATE_SETTINGS is set when the settings changed due to a
- // Application::SettingsChanged event. In this scenario we want to keep the style settings
- // of our radio buttons and our check boxes.
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
- ( rDCEvt.GetFlags() & SETTINGS_IN_UPDATE_SETTINGS ) )
-
- {
- const AllSettings* pOldSettings = rDCEvt.GetOldSettings();
- if ( pOldSettings )
- {
- BOOL bResetStyleSettings = FALSE;
- AllSettings aAllSettings = GetSettings();
- StyleSettings aStyleSetting = aAllSettings.GetStyleSettings();
-
- USHORT nCheckBoxStyle = aStyleSetting.GetCheckBoxStyle();
- if ( nCheckBoxStyle != pOldSettings->GetStyleSettings().GetCheckBoxStyle() )
- {
- aStyleSetting.SetCheckBoxStyle( pOldSettings->GetStyleSettings().GetCheckBoxStyle() );
- bResetStyleSettings = TRUE;
- }
-
- USHORT nRadioButtonStyle = aStyleSetting.GetRadioButtonStyle();
- if ( nRadioButtonStyle != pOldSettings->GetStyleSettings().GetRadioButtonStyle() )
- {
- aStyleSetting.SetRadioButtonStyle( pOldSettings->GetStyleSettings().GetRadioButtonStyle() );
- bResetStyleSettings = TRUE;
- }
-
- if ( bResetStyleSettings )
- {
- aAllSettings.SetStyleSettings( pOldSettings->GetStyleSettings() );
- SetSettings( aAllSettings );
- }
- }
- }
-}
-
void Button::SetSmallSymbol (bool small)
{
ImplSetSmallSymbol (small);
@@ -925,125 +884,6 @@ void PushButton::ImplDrawPushButtonFrame( Window* pDev,
StyleSettings aStyleSettings = pDev->GetSettings().GetStyleSettings();
if ( pDev->IsControlBackground() )
aStyleSettings.Set3DColors( pDev->GetControlBackground() );
-
- USHORT nPushButtonSysStyle = aStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- pDev->SetLineColor();
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( rRect );
-
- if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
- (pDev->GetOutDevType() == OUTDEV_PRINTER) )
- nStyle |= BUTTON_DRAW_MONO;
-
- if ( nStyle & BUTTON_DRAW_DEFAULT )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Top() ),
- Point( rRect.Right()-3, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom() ),
- Point( rRect.Right()-3, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+3 ),
- Point( rRect.Left(), rRect.Bottom()-3 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+3 ),
- Point( rRect.Right(), rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-2 ) );
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom()-1 ),
- Point( rRect.Right()-3, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+3 ),
- Point( rRect.Right()-1, rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Right()-3, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-3 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top() ),
- Point( rRect.Right()-2, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom() ),
- Point( rRect.Right()-2, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+2 ),
- Point( rRect.Left(), rRect.Bottom()-2 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+2 ),
- Point( rRect.Right(), rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-1 ) );
-
- pDev->SetLineColor();
- if ( nStyle & BUTTON_DRAW_CHECKED )
- pDev->SetFillColor( aStyleSettings.GetCheckedColor() );
- else
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( Rectangle( rRect.Left()+2, rRect.Top()+2, rRect.Right()-2, rRect.Bottom()-2 ) );
-
- if ( !(nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED)) )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom()-1 ),
- Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+2 ),
- Point( rRect.Right()-1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->SetLineColor( aStyleSettings.GetLightColor() );
- }
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
-
- if ( !(nStyle & BUTTON_DRAW_MONO) )
- {
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top()+1 ),
- Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawLine( Point( rRect.Left()+1, rRect.Top()+2 ),
- Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Top()+2, rRect.Right()+2 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- rRect.Left()++;
- rRect.Top()++;
- rRect.Right()++;
- rRect.Bottom()++;
- }
-
- return;
- }
}
DecorationView aDecoView( pDev );
@@ -1070,20 +910,6 @@ BOOL PushButton::ImplHitTestPushButton( Window* pDev,
Point aTempPoint;
Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() );
- if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) )
- {
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
-
- USHORT nPushButtonSysStyle = rStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- aTestRect.Left() += 2;
- aTestRect.Top() += 2;
- aTestRect.Right() -= 2;
- aTestRect.Bottom() -= 2;
- }
- }
-
return aTestRect.IsInside( rPos );
}
@@ -3274,7 +3100,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetRadioButtonStyle() & STYLE_RADIOBUTTON_STYLE;
+ USHORT nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_RADIOBUTTON_MONO;
@@ -4192,7 +4018,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetCheckBoxStyle() & STYLE_CHECKBOX_STYLE;
+ USHORT nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_CHECKBOX_MONO;
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 1c83779da1a9..c264d01916fc 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -78,15 +78,6 @@ void MenuButton::ImplExecuteMenu()
Point aPos( 0, 1 );
Size aSize = GetSizePixel();
Rectangle aRect( aPos, aSize );
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if ( !((GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) ||
- !(rStyleSettings.GetOptions() & STYLE_OPTION_MACSTYLE)) )
- {
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
- }
SetPressed( TRUE );
EndSelection();
mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN );
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 9c82bb096dec..4261965995fa 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -770,64 +770,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
if ( bEnabled )
{
nStyle = BUTTON_DRAW_NOLIGHTBORDER;
- // pressed thumbs only in OS2 style
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
- nStyle |= BUTTON_DRAW_PRESSED;
aTempRect = aDecoView.DrawButton( maThumbRect, nStyle );
- // OS2 style requires pattern on the thumb
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- if ( GetStyle() & WB_HORZ )
- {
- if ( aTempRect.GetWidth() > 6 )
- {
- long nX = aTempRect.Center().X();
- nX -= 6;
- if ( nX < aTempRect.Left() )
- nX = aTempRect.Left();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nX > aTempRect.Right()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- }
- }
- }
- else
- {
- if ( aTempRect.GetHeight() > 6 )
- {
- long nY = aTempRect.Center().Y();
- nY -= 6;
- if ( nY < aTempRect.Top() )
- nY = aTempRect.Top();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nY > aTempRect.Bottom()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- }
- }
- }
- pOutDev->SetLineColor();
- }
}
else
{
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index daf733a57a33..26a4c1cfd205 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -713,13 +713,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
mnMouseOff = rMousePos.X()-aCenterPos.X();
else
mnMouseOff = rMousePos.Y()-aCenterPos.Y();
-
- // Im OS2-Look geben wir den Thumb gedrueckt aus
- if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- mnStateFlags |= SLIDER_STATE_THUMB_DOWN;
- ImplDraw( SLIDER_DRAW_THUMB );
- }
}
else if ( ImplIsPageUp( rMousePos ) )
{
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index e9696aa8c492..2c81b6af241b 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -75,8 +75,6 @@ struct ImplTabItem
struct ImplTabCtrlData
{
- PushButton* mpLeftBtn;
- PushButton* mpRightBtn;
std::hash_map< int, int > maLayoutPageIdToLine;
std::hash_map< int, int > maLayoutLineToPageId;
std::vector< Rectangle > maTabRectangles;
@@ -88,27 +86,6 @@ struct ImplTabCtrlData
// -----------------------------------------------------------------------
-#if 0
-// not used
-#define TABCOLORCOUNT 10
-
-static ColorData aImplTabColorAry[TABCOLORCOUNT] =
-{
- RGB_COLORDATA( 80, 216, 248 ),
- RGB_COLORDATA( 128, 216, 168 ),
- RGB_COLORDATA( 128, 144, 248 ),
- RGB_COLORDATA( 208, 180, 168 ),
- RGB_COLORDATA( 248, 252, 168 ),
- RGB_COLORDATA( 168, 144, 168 ),
- RGB_COLORDATA( 248, 144, 80 ),
- RGB_COLORDATA( 248, 216, 80 ),
- RGB_COLORDATA( 248, 180, 168 ),
- RGB_COLORDATA( 248, 216, 168 )
-};
-#endif
-
-// -----------------------------------------------------------------------
-
#define TAB_OFFSET 3
#define TAB_TABOFFSET_X 3
#define TAB_TABOFFSET_Y 3
@@ -132,9 +109,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
- // no single line tabs since NWF
- nStyle &= ~WB_SINGLELINE;
-
Control::ImplInit( pParent, nStyle, NULL );
mnLastWidth = 0;
@@ -143,18 +117,12 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mnMaxPageWidth = 0;
mnActPageId = 0;
mnCurPageId = 0;
- mnFirstPagePos = 0;
- mnLastFirstPagePos = 0;
mbFormat = TRUE;
mbRestoreHelpId = FALSE;
mbRestoreUnqId = FALSE;
- mbSingleLine = FALSE;
- mbScroll = FALSE;
mbSmallInvalidate = FALSE;
mbExtraSpace = FALSE;
mpTabCtrlData = new ImplTabCtrlData;
- mpTabCtrlData->mpLeftBtn = NULL;
- mpTabCtrlData->mpRightBtn = NULL;
mpTabCtrlData->mpListBox = NULL;
@@ -226,8 +194,6 @@ void TabControl::ImplInitSettings( BOOL bFont,
SetBackground( pParent->GetBackground() );
}
}
-
- ImplScrollBtnsColor();
}
// -----------------------------------------------------------------------
@@ -299,10 +265,6 @@ TabControl::~TabControl()
{
if( mpTabCtrlData->mpListBox )
delete mpTabCtrlData->mpListBox;
- if ( mpTabCtrlData->mpLeftBtn )
- delete mpTabCtrlData->mpLeftBtn;
- if ( mpTabCtrlData->mpRightBtn )
- delete mpTabCtrlData->mpRightBtn;
delete mpTabCtrlData;
}
}
@@ -323,74 +285,6 @@ ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
// -----------------------------------------------------------------------
-void TabControl::ImplScrollBtnsColor()
-{
- if ( mpTabCtrlData && mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn->SetControlForeground();
- mpTabCtrlData->mpRightBtn->SetControlForeground();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplSetScrollBtnsState()
-{
- if ( mbScroll )
- {
- mpTabCtrlData->mpLeftBtn->Enable( mnFirstPagePos != 0 );
- mpTabCtrlData->mpRightBtn->Enable( mnFirstPagePos < mnLastFirstPagePos );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplPosScrollBtns()
-{
- if ( mbScroll )
- {
- if ( !mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpLeftBtn->SetSymbol( SYMBOL_PREV );
- mpTabCtrlData->mpLeftBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
- if ( !mpTabCtrlData->mpRightBtn )
- {
- mpTabCtrlData->mpRightBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpRightBtn->SetSymbol( SYMBOL_NEXT );
- mpTabCtrlData->mpRightBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
-
- Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
- aRect.Left() -= TAB_OFFSET;
- aRect.Top() -= TAB_OFFSET;
- aRect.Right() += TAB_OFFSET;
- aRect.Bottom() += TAB_OFFSET;
- long nX = aRect.Right()-mnBtnSize+1;
- long nY = aRect.Top()-mnBtnSize;
- mpTabCtrlData->mpRightBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- nX -= mnBtnSize;
- mpTabCtrlData->mpLeftBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- ImplScrollBtnsColor();
- ImplSetScrollBtnsState();
- mpTabCtrlData->mpLeftBtn->Show();
- mpTabCtrlData->mpRightBtn->Show();
- }
- else
- {
- if ( mpTabCtrlData )
- {
- if ( mpTabCtrlData->mpLeftBtn )
- mpTabCtrlData->mpLeftBtn->Hide();
- if ( mpTabCtrlData->mpRightBtn )
- mpTabCtrlData->mpRightBtn->Hide();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
{
pItem->maFormatText = pItem->maText;
@@ -524,8 +418,6 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
nMaxWidth = mnMaxPageWidth;
nMaxWidth -= GetItemsOffset().X();
- mbScroll = FALSE;
-
USHORT nLines = 0;
USHORT nCurLine = 0;
long nLineWidthAry[100];
@@ -650,8 +542,6 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
mnLastWidth = nWidth;
mnLastHeight = nHeight;
mbFormat = FALSE;
-
- ImplPosScrollBtns();
}
return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle();
@@ -795,13 +685,6 @@ void TabControl::ImplActivateTabPage( BOOL bNext )
// -----------------------------------------------------------------------
-void TabControl::ImplSetFirstPagePos( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
void TabControl::ImplShowFocus()
{
if ( !GetPageCount() || mpTabCtrlData->mpListBox )
@@ -1101,14 +984,6 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
// -----------------------------------------------------------------------
-IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG )
-{
- ImplSetScrollBtnsState();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
{
SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) );
@@ -1387,19 +1262,14 @@ void TabControl::Resize()
// Feststellen, was invalidiert werden muss
Size aNewSize = Control::GetOutputSizePixel();
long nNewWidth = aNewSize.Width();
- if ( mbScroll )
- mbSmallInvalidate = FALSE;
- else
+ for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
+ it != mpTabCtrlData->maItemList.end(); ++it )
{
- for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
- it != mpTabCtrlData->maItemList.end(); ++it )
+ if ( !it->mbFullVisible ||
+ (it->maRect.Right()-2 >= nNewWidth) )
{
- if ( !it->mbFullVisible ||
- (it->maRect.Right()-2 >= nNewWidth) )
- {
- mbSmallInvalidate = FALSE;
- break;
- }
+ mbSmallInvalidate = FALSE;
+ break;
}
}
@@ -2013,13 +1883,6 @@ USHORT TabControl::GetCurPageId() const
// -----------------------------------------------------------------------
-void TabControl::SetFirstPageId( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
void TabControl::SelectTabPage( USHORT nPageId )
{
if ( nPageId && (nPageId != mnCurPageId) )
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index d949f519d197..188b4e49f0c5 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -28,14 +28,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/bitmap.hxx>
-#include <vcl/impbmpconv.hxx>
-#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
-#include <tools/stream.hxx>
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <cppuhelper/compbase1.hxx>
+#include "vcl/bitmap.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/salctype.hxx"
+#include "vos/mutex.hxx"
+#include "tools/stream.hxx"
+#include "com/sun/star/script/XInvocation.hpp"
+#include "com/sun/star/awt/XBitmap.hpp"
+#include "cppuhelper/compbase1.hxx"
using namespace com::sun::star::uno;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index f4ea98484c33..ca50e4bf6c82 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1686,15 +1686,15 @@ void ImplDevFontList::InitMatchData() const
}
//----------------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const
+ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const
{
// get the default font for a specified locale
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
- String aDefault = rDefaults.getUserInterfaceFont( lc );
+ const String aDefault = rDefaults.getUserInterfaceFont( rLocale );
ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault );
if( pFontData )
return pFontData;
- return 0;
+ return NULL;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index 521f4d7ea62d..b5b745b708fa 100644..100755
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -87,6 +87,10 @@ MenubarValue::~MenubarValue()
{
}
+MenupopupValue::~MenupopupValue()
+{
+}
+
PushButtonValue::~PushButtonValue()
{
}
@@ -200,49 +204,20 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im
case CTRL_GENERIC:
aResult.reset( new ImplControlValue( rVal ) );
break;
- default:
- OSL_ENSURE( 0, "unknown ImplControlValue type !" );
- break;
- }
- return aResult;
-}
-
-#if 0
-static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta )
-{
- switch( aValue.getType() )
- {
- case CTRL_SLIDER:
- {
- SliderValue* pSlVal = static_cast<SliderValue*>(const_cast<ImplControlValue*>(&aValue));
- pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SCROLLBAR:
- {
- ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(const_cast<ImplControlValue*>(&aValue));
- pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SPINBOX:
- case CTRL_SPINBUTTONS:
+ case CTRL_MENU_POPUP:
{
- SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(const_cast<ImplControlValue*>(&aValue));
- pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() );
- pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() );
+ const MenupopupValue* pMVal = static_cast<const MenupopupValue*>(&rVal);
+ MenupopupValue* pNew = new MenupopupValue( *pMVal );
+ pNew->maItemRect = rDev.ImplLogicToDevicePixel( pMVal->maItemRect );
+ aResult.reset( pNew );
}
break;
- case CTRL_TOOLBAR:
- {
- ToolbarValue* pTVal = static_cast<ToolbarValue*>(const_cast<ImplControlValue*>(&aValue));
- pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() );
- }
+ default:
+ OSL_ENSURE( 0, "unknown ImplControlValue type !" );
break;
}
+ return aResult;
}
-#endif
BOOL OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
@@ -254,20 +229,6 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
if( !lcl_enableNativeWidget( *this ) )
return FALSE;
- /*
- if( !IsInPaint() && IsPaintTransparent() )
- {
- // only required if called directly (ie, we're not in Paint() ):
- // force redraw (Paint()) for transparent controls
- // to trigger a repaint of the background
- Region aClipRgn( GetClipRegion() );
- if( !rControlRegion.IsEmpty() )
- aClipRgn.Intersect( rControlRegion );
- Invalidate( aClipRgn, INVALIDATE_UPDATE );
- return TRUE;
- }
- */
-
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
if ( !ImplGetGraphics() )
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 2ea9bfcc4c11..78456992340f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -57,8 +57,14 @@
#include <comphelper/processfactory.hxx>
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::container;
int nImplSysDialog = 0;
@@ -130,6 +136,105 @@ PrinterOptions::~PrinterOptions()
{
}
+#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceTransparency"))
+#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedTransparencyMode"))
+#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceGradients"))
+#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientMode"))
+#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientStepCount"))
+#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceBitmaps"))
+#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapMode"))
+#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution"))
+#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency"))
+#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales"))
+
+bool PrinterOptions::ReadFromConfig( bool i_bFile )
+{
+ bool bSuccess = false;
+ // save old state in case something goes wrong
+ PrinterOptions aOldValues( *this );
+
+ // get the configuration service
+ Reference< XMultiServiceFactory > xConfigProvider;
+ Reference< XNameAccess > xConfigAccess;
+ try
+ {
+ // get service provider
+ Reference< XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() );
+ // create configuration hierachical access name
+ if( xSMgr.is() )
+ {
+ try
+ {
+ xConfigProvider = Reference< XMultiServiceFactory >(
+ xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider" ))),
+ UNO_QUERY );
+ if( xConfigProvider.is() )
+ {
+ Sequence< Any > aArgs(1);
+ PropertyValue aVal;
+ aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
+ if( i_bFile )
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/File" ) );
+ else
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/Printer" ) );
+ aArgs.getArray()[0] <<= aVal;
+ xConfigAccess = Reference< XNameAccess >(
+ xConfigProvider->createInstanceWithArguments(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )), aArgs ),
+ UNO_QUERY );
+ if( xConfigAccess.is() )
+ {
+ Reference< XPropertySet > xSet( xConfigAccess, UNO_QUERY );
+ if( xSet.is() )
+ {
+ sal_Int32 nValue = 0;
+ sal_Bool bValue = 0;
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bValue )
+ SetReduceTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nValue )
+ SetReducedTransparencyMode( (PrinterTransparencyMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bValue )
+ SetReduceGradients( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nValue )
+ SetReducedGradientMode( (PrinterGradientMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nValue )
+ SetReducedGradientStepCount( (USHORT)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bValue )
+ SetReduceBitmaps( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nValue )
+ SetReducedBitmapMode( (PrinterBitmapMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nValue )
+ SetReducedBitmapResolution( (USHORT)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bValue )
+ SetReducedBitmapIncludesTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bValue )
+ SetConvertToGreyscales( bValue );
+
+ bSuccess = true;
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+
+ if( ! bSuccess )
+ *this = aOldValues;
+ return bSuccess;
+}
+
+void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions )
+{
+ *mpPrinterOptions = i_rOptions;
+}
+
// -------------
// - QueueInfo -
// -------------
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 98eac5e982d3..8207282add99 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -533,10 +533,6 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSingleValue->Value >>= bSinglePrintJobs;
}
- // remark: currently it is still possible to use EnablePrintFile and
- // SetPrintFileName to redirect printout into file
- // it can be argued that those methods should be removed in favor
- // of only using the LocalFileName property
beans::PropertyValue* pFileValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ) );
if( pFileValue )
{
@@ -553,6 +549,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
XubString* pPrintFile = NULL;
if ( mbPrintFile )
pPrintFile = &maPrintFile;
+ mpPrinterOptions->ReadFromConfig( mbPrintFile );
maJobName = i_rJobName;
mnCurPage = 1;
@@ -733,6 +730,13 @@ void PrinterController::setPrinter( const boost::shared_ptr<Printer>& i_rPrinter
mpImplData->mnFixedPaperBin = -1;
}
+void PrinterController:: resetPrinterOptions( bool i_bFileOutput )
+{
+ PrinterOptions aOpt;
+ aOpt.ReadFromConfig( i_bFileOutput );
+ mpImplData->mpPrinter->SetPrinterOptions( aOpt );
+}
+
bool PrinterController::setupPrinter( Window* i_pParent )
{
bool bRet = false;
@@ -1729,7 +1733,7 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV
}
Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpTexts,
+ const Sequence< rtl::OUString >& i_rHelpIds,
const rtl::OUString& i_rType,
const PropertyValue* i_pVal,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
@@ -1738,7 +1742,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
sal_Int32 nElements =
1 // ControlType
+ (i_rTitle.getLength() ? 1 : 0) // Text
- + (i_rHelpTexts.getLength() ? 1 : 0) // HelpText
+ + (i_rHelpIds.getLength() ? 1 : 0) // HelpId
+ (i_pVal ? 1 : 0) // Property
+ i_rControlOptions.maAddProps.getLength() // additional props
+ (i_rControlOptions.maGroupHint.getLength() ? 1 : 0) // grouping
@@ -1761,10 +1765,10 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
aCtrl[nUsed++].Value = makeAny( i_rTitle );
}
- if( i_rHelpTexts.getLength() )
+ if( i_rHelpIds.getLength() )
{
- aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
- aCtrl[nUsed++].Value = makeAny( i_rHelpTexts );
+ aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpId" ) );
+ aCtrl[nUsed++].Value = makeAny( i_rHelpIds );
}
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) );
aCtrl[nUsed++].Value = makeAny( i_rType );
@@ -1813,53 +1817,53 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
return makeAny( aCtrl );
}
-Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText )
+Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
}
Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
NULL, i_rControlOptions );
}
Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_bValue );
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
}
Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpText,
+ const Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
@@ -1882,11 +1886,11 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
- return getUIControlOpt( i_rTitle, i_rHelpText, i_rType, &aVal, aOpt );
+ return getUIControlOpt( i_rTitle, i_rHelpId, i_rType, &aVal, aOpt );
}
Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue,
@@ -1905,17 +1909,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
aOpt.maAddProps[nUsed++].Value = makeAny( i_nMaxValue );
}
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ),
&aVal,
aOpt
@@ -1923,23 +1927,23 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
}
Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_rValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ),
&aVal,
i_rControlOptions
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index 6d2360dae6cb..b786184fa2f3 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -81,67 +81,3 @@ String SV_BUTTONTEXT_ABORT
Text [ en-US ] = "~Abort";
};
-/* HelpTexte, die wir derzeit nicht mehr verwenden:
-SV_BUTTONHELPTEXT_OK
-{
- Text = "Schließt dieses Dialogfeld und speichert alle vorgenommenen Änderungen." ;
-};
-
-SV_BUTTONHELPTEXT_CANCEL
-{
- Text = "Schließt dieses Dialogfeld, ohne Ihre Änderungen zu speichern." ;
-};
-
-SV_BUTTONHELPTEXT_HELP
-{
- Text = "Zeigt Hilfe zu diesem Fenster an." ;
-};
-
-SV_BUTTONHELPTEXT_MORE
-{
- Text = "Zeigt weitere EinstellmÖglichkeiten an oder versteckt diese wieder." ;
-};
-
-Finnische-Texte:
-OK OK
-CANCEL Peruuta
-HELP ~Ohje
-MORE ~Enemmän
-YES ~Kyllä
-NO ~Ei
-RETRY ~Yritäuudelleen
-*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index fdb1e755c86a..000d7215d80d 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -38,25 +38,6 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
File = "check.bmp";
};
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_WINOFFSET)
-{
- File = "checkwin.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_OS2OFFSET)
-{
- File = "checkos2.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MACOFFSET)
-{
- File = "checkmac.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_UNIXOFFSET)
-{
- File = "checkunx.bmp";
-};
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
{
@@ -80,26 +61,6 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
File = "radio.bmp";
};
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_WINOFFSET)
-{
- File = "radiowin.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_OS2OFFSET)
-{
- File = "radioos2.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MACOFFSET)
-{
- File = "radiomac.bmp";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_UNIXOFFSET)
-{
- File = "radiounx.bmp";
-};
-
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
{
File = "radiomono.bmp";
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 436ab40bdc5f..04ab77f09288 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,7 +29,7 @@
ModalDialog SV_DLG_PRINT
{
- HelpID = "vcl:ModalDialog:SV_DLG_PRINT";
+ HelpID = ".HelpID:vcl:PrintDialog:Dialog";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -45,16 +45,19 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 240, 195 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "~Print";
+ HelpID = ".HelpID:vcl:PrintDialog:OK";
};
CancelButton SV_PRINT_CANCEL
{
Pos = MAP_APPFONT( 295, 195 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Cancel";
};
HelpButton SV_PRINT_HELP
{
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Help";
};
Window SV_PRINT_PAGE_PREVIEW
@@ -62,16 +65,16 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 130, 130 );
Border = FALSE;
+ HelpID = ".HelpID:vcl:PrintDialog:Preview";
};
NumericField SV_PRINT_PAGE_EDIT
{
- HelpID = "vcl:NumericField:SV_DLG_PRINT:SV_PRINT_PAGE_EDIT";
Pos = MAP_APPFONT( 5, 140 );
Size = MAP_APPFONT( 30, 12 );
SVLook = TRUE;
Spin = FALSE;
Border = TRUE;
- HelpText [en-US] = "Select page to display in preview.";
+ HelpID = ".HelpID:vcl:PrintDialog:PageEdit";
};
FixedText SV_PRINT_PAGE_TXT
{
@@ -79,26 +82,25 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 30, 12 );
Text [ en-US ] = "/ %n";
VCenter = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:NumPagesText";
};
PushButton SV_PRINT_PAGE_FORWARD
{
- HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_FORWARD";
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page forward.";
+ HelpID = ".HelpID:vcl:PrintDialog:ForwardBtn";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
- HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_BACKWARD";
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page backward.";
+ HelpID = ".HelpID:vcl:PrintDialog:BackwardBtn";
};
TabControl SV_PRINT_TABCTRL
{
- HelpID = "vcl:TabControl:SV_DLG_PRINT:SV_PRINT_TABCTRL";
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
+ HelpID = ".HelpID:vcl:PrintDialog:TabPages";
};
FixedLine SV_PRINT_BUTTONLINE
{
@@ -128,7 +130,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
- HelpID = "vcl:TabPage:SV_PRINT_TAB_NUP";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -138,38 +140,28 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 150, 10 );
Text [en-US] = "Layout";
};
- RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
- {
- HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_DEFAULT_BTN";
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 10 );
- Text [en-US] = "~Default";
- HelpText [en-US] = "Print one page per sheet of paper.";
- };
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
- HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BROCHURE_BTN";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:Brochure";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
- HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BTN";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
- HelpText [en-US] = "Print multiple pages per sheet of paper.";
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
- HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BOX";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
DropDown = TRUE;
CurPos = 0;
- HelpText [en-US] = "Select how many pages to print per sheet of paper.";
StringList [en-US] =
{
< "1"; 1; >;
@@ -190,7 +182,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
- HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_COLS_EDT";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:ColumnsBox";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -198,7 +190,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of columns.";
};
FixedText SV_PRINT_PRT_NUP_TIMES_TXT
{
@@ -209,7 +200,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
- HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ROWS_EDT";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:RowsBox";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -217,7 +208,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of rows.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT
{
@@ -227,14 +217,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
- HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PageMarginBox";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between individual pages on each sheet of paper.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT
{
@@ -250,14 +239,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
- HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between the printed pages and paper edge.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT
{
@@ -273,7 +261,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
- HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORIENTATION_BOX";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrientationBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -285,7 +273,6 @@ ModalDialog SV_DLG_PRINT
< "Portrait"; SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT; >;
< "Landscape"; SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE; >;
};
- HelpText [en-US] = "Select the orientation of the paper.";
};
FixedText SV_PRINT_PRT_NUP_ORDER_TXT
{
@@ -295,7 +282,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
- HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrderBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 50 );
DropDown = TRUE;
@@ -308,21 +295,19 @@ ModalDialog SV_DLG_PRINT
< "top to bottom, then left"; SV_PRINT_PRT_NUP_ORDER_TBRL; >;
< "right to left, then down"; SV_PRINT_PRT_NUP_ORDER_RLTB; >;
};
- HelpText [en-US] = "Select order in which pages are to be printed.";
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BORDER_CB";
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:BorderBox";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
- HelpText [en-US] = "Check to draw a border around each page.";
};
};
TabPage SV_PRINT_TAB_JOB
{
- HelpID = "vcl:TabPage:SV_PRINT_TAB_JOB";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage";
Text [en-US] = "General";
Hide = TRUE;
@@ -334,20 +319,18 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
- HelpID = "vcl:ListBox:SV_PRINT_TAB_JOB:SV_PRINT_PRINTERS";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:PrinterList";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
Sort = TRUE;
- HelpText [en-US] = "Select the printer to print on.";
};
CheckBox SV_PRINT_DETAILS_BTN
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_DETAILS_BTN";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:DetailsBtn";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
- HelpText [en-US] = "Show/Hide detailed information of the selected printer.";
};
FixedText SV_PRINT_STATUS_TXT
{
@@ -369,11 +352,10 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
- HelpID = "vcl:PushButton:SV_PRINT_TAB_JOB:SV_PRINT_PRT_SETUP";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Properties";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
- HelpText [en-US] = "Call the setup dialog of the selected printer.";
};
FixedLine SV_PRINT_COPIES
{
@@ -389,7 +371,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
- HelpID = "vcl:NumericField:SV_PRINT_TAB_JOB:SV_PRINT_COPYCOUNT_FIELD";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Copies";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -397,7 +379,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 16384;
Value = 1;
- HelpText [en-US] = "Select the number of copies to be produced.";
};
FixedImage SV_PRINT_COLLATE_IMAGE
{
@@ -406,11 +387,10 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_COLLATE";
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Collate";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
- HelpText [en-US] = "Select whether copies should be collated or not.";
};
Image SV_PRINT_COLLATE_IMG
@@ -436,9 +416,9 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_OPT
{
- HelpID = "vcl:TabPage:SV_PRINT_TAB_OPT";
Text [en-US] = "Options";
Hide = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage";
FixedLine SV_PRINT_OPT_PRINT_FL
{
@@ -448,27 +428,24 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_TOFILE";
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToFile";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
- HelpText [en-US] = "Check to send output to a file instead of the actual printer.";
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_SINGLEJOBS";
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:SingleJobs";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
- HelpText [en-US] = "Check to not rely on the printer to create collated copies but create a print job for each copy instead.";
};
CheckBox SV_PRINT_OPT_REVERSE
{
- HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_REVERSE";
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
Pos = MAP_APPFONT( 10, 50 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print in ~reverse page order";
- HelpText [en-US] = "Check to print pages in reverse order.";
};
};
};
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index e5c3dc525cec..d51988d4d5d3 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -44,71 +44,6 @@
// =======================================================================
-void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect,
- USHORT nStyle, BOOL bClose )
-{
- DecorationView aView( pDev );
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
- Rectangle aRect = rRect;
- Color aColor1;
- Color aColor2;
-
- pDev->SetFillColor();
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- aColor1 = rStyleSettings.GetShadowColor();
- aColor2 = rStyleSettings.GetLightColor();
- }
- else
- {
- aColor1 = rStyleSettings.GetLightColor();
- aColor2 = rStyleSettings.GetShadowColor();
- }
- aView.DrawFrame( aRect, aColor1, aColor2 );
-
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- if ( bClose )
- {
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ),
- Point( aRect.Right()-1, aRect.Top()+2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) );
- }
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- if ( bClose )
- {
- pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ),
- Point( aRect.Left()+1, aRect.Bottom()-2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() );
- }
-}
-
-// =======================================================================
-
static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
SymbolType eType )
{
@@ -630,41 +565,6 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
pDev->DrawRect( aRect );
}
break;
-
- case SYMBOL_OS2CLOSE:
- {
- Rectangle aRect( nCenterX-n2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- ImplDrawOS2Symbol( pDev, aRect, 0, TRUE );
- }
- break;
-
- case SYMBOL_OS2FLOAT:
- {
- Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4,
- nCenterX+n2-4, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- DecorationView aDecoView( pDev );
- Rectangle aRect2( nCenterX-n2, nCenterY-n2,
- nCenterX-n2+2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect2,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- Rectangle aRect3( nCenterX+n2-2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect3,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- }
- break;
-
- case SYMBOL_OS2HIDE:
- {
- Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3,
- nCenterX+n2-3, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- }
- break;
}
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 52ad54957dd0..5909ab9f8489 100644..100755
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -96,6 +96,7 @@ DBG_NAME( Menu )
#define EXTRASPACEY 2
#define EXTRAITEMHEIGHT 4
+#define GUTTERBORDER 8
// document closer
#define IID_DOCUMENTCLOSE 1
@@ -2670,14 +2671,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
// Separator
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
- aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
- pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- aTmpPos.Y()++;
- pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- pWin->SetLineColor();
+ bool bNativeOk = false;
+ if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
+ PART_MENU_SEPARATOR ) )
+ {
+ ControlState nState = 0;
+ if ( pData->bEnabled )
+ nState |= CTRL_STATE_ENABLED;
+ if ( bHighlighted )
+ nState |= CTRL_STATE_SELECTED;
+ Size aSz( pData->aSz );
+ aSz.Width() = aOutSz.Width() - 2*nOuterSpace;
+ Rectangle aItemRect( aPos, aSz );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect );
+ bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR,
+ aItemRect,
+ nState,
+ aVal,
+ OUString() );
+ }
+ if( ! bNativeOk )
+ {
+ aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
+ aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
+ pWin->SetLineColor( rSettings.GetShadowColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ aTmpPos.Y()++;
+ pWin->SetLineColor( rSettings.GetLightColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ pWin->SetLineColor();
+ }
}
Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) );
@@ -2722,10 +2745,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
- ImplControlValue(),
+ aVal,
OUString() );
}
else if ( pData->bChecked ) // by default do nothing for unchecked items
@@ -2845,16 +2869,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aDecoView.DrawSymbol(
Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ),
SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle );
-// if ( pData->nBits & MIB_POPUPSELECT )
-// {
-// aTmpPos.Y() += nFontHeight/2 ;
-// pWin->SetLineColor( rSettings.GetShadowColor() );
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor( rSettings.GetLightColor() );
-// aTmpPos.Y()++;
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor();
-// }
}
if ( pThisItemOnly && bHighlighted )
@@ -4724,10 +4738,11 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
+ MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
aCtrlRect,
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
if( bHighlight &&
IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
@@ -4736,7 +4751,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
- ImplControlValue(),
+ aVal,
OUString() ) )
{
bDrawItemRect = bHighlight;
@@ -5071,10 +5086,11 @@ void MenuFloatingWindow::Paint( const Rectangle& )
long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0;
Size aPxSize( GetOutputSizePixel() );
aPxSize.Width() -= nX;
+ ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
Rectangle( Point( nX, 0 ), aPxSize ),
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
ImplInitClipRegion();
}
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 73420e6ef8b5..574cef4e5a07 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -60,15 +60,12 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
-#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ":" b ) )
-#define SMHID1( a ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ) )
-
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
, maOrigSize( 10, 10 )
, maPageVDev( *this )
, maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) )
+ , mbGreyscale( false )
, maHorzDim( this, WB_HORZ | WB_CENTER )
, maVertDim( this, WB_VERT | WB_VCENTER )
{
@@ -269,6 +266,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
maPageVDev.Erase();
maPageVDev.Push();
maPageVDev.SetMapMode( MAP_100TH_MM );
+ ULONG nOldDrawMode = maPageVDev.GetDrawMode();
+ if( mbGreyscale )
+ maPageVDev.SetDrawMode( maPageVDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();
@@ -278,6 +280,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
SetMapMode( MAP_PIXEL );
maPageVDev.SetMapMode( MAP_PIXEL );
DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev );
+ maPageVDev.SetDrawMode( nOldDrawMode );
DecorationView aVw( this );
Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) );
@@ -309,7 +312,8 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
const Size& i_rOrigSize,
const rtl::OUString& i_rReplacement,
sal_Int32 i_nDPIX,
- sal_Int32 i_nDPIY
+ sal_Int32 i_nDPIY,
+ bool i_bGreyscale
)
{
rtl::OUStringBuffer aBuf( 256 );
@@ -323,6 +327,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
maOrigSize = i_rOrigSize;
maReplacementString = i_rReplacement;
+ mbGreyscale = i_bGreyscale;
maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
maPageVDev.EnableOutput( TRUE );
@@ -469,28 +474,6 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
maPageMarginEdt.SetDecimalDigits( nDigits );
maSheetMarginEdt.SetDecimalDigits( nDigits );
- SMHID1( "NUpPage" );
- maNupLine.SMHID2("NUpPage", "Layout");
- maBrochureBtn.SMHID2("NUpPage", "Brochure" );
- maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" );
- maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" );
- maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" );
- maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" );
- maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" );
- maNupTimesTxt.SMHID2( "NUpPage", "Rows" );
- maNupRowsEdt.SMHID2( "NUpPage", "RowsBox" );
- maPageMarginTxt1.SMHID2( "NUpPage", "PageMargin" );
- maPageMarginEdt.SMHID2( "NUpPage", "PageMarginBox" );
- maPageMarginTxt2.SMHID2( "NUpPage", "PageMarginCont" );
- maSheetMarginTxt1.SMHID2( "NUpPage", "SheetMargin" );
- maSheetMarginEdt.SMHID2( "NUpPage", "SheetMarginBox" );
- maSheetMarginTxt2.SMHID2( "NUpPage", "SheetMarginCont" );
- maNupOrientationTxt.SMHID2( "NUpPage", "Orientation" );
- maNupOrientationBox.SMHID2( "NUpPage", "OrientationBox" );
- maNupOrderTxt.SMHID2( "NUpPage", "Order" );
- maNupOrderBox.SMHID2( "NUpPage", "OrderBox" );
- maBorderCB.SMHID2( "NUpPage", "BorderBox" );
-
setupLayout();
}
@@ -638,24 +621,6 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
{
FreeResource();
- SMHID1( "JobPage" );
- maPrinterFL.SMHID2( "JobPage", "Printer" );
- maPrinters.SMHID2( "JobPage", "PrinterList" );
- maDetailsBtn.SMHID2( "JobPage", "DetailsBtn" );
- maStatusLabel.SMHID2( "JobPage", "StatusLabel" );
- maStatusTxt.SMHID2( "JobPage", "StatusText" );
- maLocationLabel.SMHID2( "JobPage", "LocationLabel" );
- maLocationTxt.SMHID2( "JobPage", "LocationText" );
- maCommentLabel.SMHID2( "JobPage", "CommentLabel" );
- maCommentTxt.SMHID2( "JobPage", "CommentText" );
- maSetupButton.SMHID2( "JobPage", "Properties" );
- maCopies.SMHID2( "JobPage", "CopiesLine" );
- maCopySpacer.SMHID2( "JobPage", "CopySpacer" );
- maCopyCount.SMHID2( "JobPage", "CopiesText" );
- maCopyCountField.SMHID2( "JobPage", "Copies" );
- maCollateBox.SMHID2( "JobPage", "Collate" );
- maCollateImage.SMHID2( "JobPage", "CollateImage" );
-
maCopySpacer.Show();
maStatusTxt.Show();
maCommentTxt.Show();
@@ -779,11 +744,6 @@ PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rRe
, maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
{
FreeResource();
- SMHID1( "OptPage" );
- maOptionsLine.SMHID2( "OptPage", "Options" );
- maToFileBox.SMHID2( "OptPage", "ToFile" );
- maCollateSingleJobsBox.SMHID2( "OptPage", "SingleJobs" );
- maReverseOrderBox.SMHID2( "OptPage", "Reverse" );
setupLayout();
}
@@ -875,9 +835,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// init reverse print
maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() );
- // get the first page
- preparePreview( true, true );
-
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
for( std::vector< rtl::OUString >::const_iterator it = rQueues.begin();
@@ -908,6 +865,12 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( Printer::GetDefaultPrinterName() ) ) );
}
}
+ // not printing to file
+ maPController->resetPrinterOptions( false );
+
+ // get the first page
+ preparePreview( true, true );
+
// update the text fields for the printer
updatePrinterText();
@@ -995,18 +958,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
}
}
- // set HelpIDs
- SMHID1( "Dialog" );
- maOKButton.SMHID1( "OK" );
- maCancelButton.SMHID1( "Cancel" );
- maHelpButton.SMHID1( "Help" );
- maPreviewWindow.SMHID1( "Preview" );
- maNumPagesText.SMHID1( "NumPagesText" );
- maPageEdit.SMHID1( "PageEdit" );
- maForwardBtn.SMHID1( "ForwardBtn" );
- maBackwardBtn.SMHID1( "BackwardBtn" );
- maTabCtrl.SMHID1( "TabPages" );
-
// append further tab pages
if( mbShowLayoutPage )
{
@@ -1104,6 +1055,11 @@ void PrintDialog::readFromSettings()
}
}
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
+ if( maOptionsPage.maToFileBox.IsChecked() )
+ {
+ maPController->resetPrinterOptions( true );
+ preparePreview( true, true );
+ }
}
void PrintDialog::storeToSettings()
@@ -1144,39 +1100,18 @@ bool PrintDialog::isSingleJobs()
return maOptionsPage.maCollateSingleJobsBox.IsChecked();
}
-static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
+void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex )
{
- rtl::OStringBuffer aBuf( 256 );
- aBuf.append( HELPID_PREFIX );
- if( i_rPropName.getLength() )
- {
- aBuf.append( ':' );
- aBuf.append( rtl::OUStringToOString( i_rPropName, RTL_TEXTENCODING_UTF8 ) );
- }
- if( i_pType )
- {
- aBuf.append( ':' );
- aBuf.append( i_pType );
- }
- if( i_nId >= 0 )
- {
- aBuf.append( ':' );
- aBuf.append( i_nId );
- }
- i_pWindow->SetHelpId( aBuf.makeStringAndClear() );
+ if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() )
+ i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) );
}
-static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
+static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex )
{
// without a help text set and the correct smartID,
// help texts will be retrieved from the online help system
-
- // passed help texts for optional UI is used only for native dialogs which currently
- // cannot access the same (rather implicit) mechanism
- #if 0
if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
- #endif
}
void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1213,6 +1148,7 @@ void PrintDialog::setupOptionalUI()
Sequence< rtl::OUString > aChoices;
Sequence< sal_Bool > aChoicesDisabled;
Sequence< rtl::OUString > aHelpTexts;
+ Sequence< rtl::OUString > aHelpIds;
sal_Int64 nMinValue = 0, nMaxValue = 0;
sal_Int32 nCurHelpText = 0;
rtl::OUString aGroupingHint;
@@ -1287,6 +1223,18 @@ void PrintDialog::setupOptionalUI()
}
}
}
+ else if( rEntry.Name.equalsAscii( "HelpId" ) )
+ {
+ if( ! (rEntry.Value >>= aHelpIds ) )
+ {
+ rtl::OUString aHelpId;
+ if( (rEntry.Value >>= aHelpId) )
+ {
+ aHelpIds.realloc( 1 );
+ *aHelpIds.getArray() = aHelpId;
+ }
+ }
+ }
else if( rEntry.Name.equalsAscii( "HintNoLayoutPage" ) )
{
sal_Bool bNoLayoutPage = sal_False;
@@ -1359,7 +1307,7 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetTabPage( nOptPageId, pNewGroup );
// set help id
- setSmartId( pNewGroup, "TabPage", nOptPageId );
+ setHelpId( pNewGroup, aHelpIds, 0 );
// set help text
setHelpText( pNewGroup, aHelpTexts, 0 );
@@ -1390,7 +1338,7 @@ void PrintDialog::setupOptionalUI()
pNewSub->Show();
// set help id
- setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) );
+ setHelpId( pNewSub, aHelpIds, 0 );
// set help text
setHelpText( pNewSub, aHelpTexts, 0 );
// add group to current column
@@ -1470,7 +1418,7 @@ void PrintDialog::setupOptionalUI()
maControlToPropertyMap[pNewBox] = aPropertyName;
// set help id
- setSmartId( pNewBox, "CheckBox", -1, aPropertyName );
+ setHelpId( pNewBox, aHelpIds, 0 );
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
@@ -1493,9 +1441,10 @@ void PrintDialog::setupOptionalUI()
pHeading->Show();
// set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
+ setHelpId( pHeading, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pHeading, aHelpTexts, nCurHelpText++ );
+ setHelpText( pHeading, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
@@ -1531,9 +1480,10 @@ void PrintDialog::setupOptionalUI()
maControlToNumValMap[pBtn] = m;
// set help id
- setSmartId( pBtn, "RadioButton", m, aPropertyName );
+ setHelpId( pBtn, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pBtn, aHelpTexts, nCurHelpText++ );
+ setHelpText( pBtn, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add the radio button to the column
pLabel->setLabel( pBtn );
}
@@ -1557,9 +1507,6 @@ void PrintDialog::setupOptionalUI()
pHeading->SetText( aText );
pHeading->Show();
- // set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
-
// add to row
pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
@@ -1586,7 +1533,7 @@ void PrintDialog::setupOptionalUI()
pList->Show();
// set help id
- setSmartId( pList, "ListBox", -1, aPropertyName );
+ setHelpId( pList, aHelpIds, 0 );
// set help text
setHelpText( pList, aHelpTexts, 0 );
@@ -1619,7 +1566,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "NumericField", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1646,7 +1593,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "Edit", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1936,7 +1883,8 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr,
- aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY()
+ aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(),
+ aPrt->GetPrinterOptions().IsConvertToGreyscales()
);
maForwardBtn.Enable( mnCurPage < nPages-1 );
@@ -2127,6 +2075,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox )
String aNewPrinter( pBox->GetSelectEntry() );
// set new printer
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) );
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
// update text fields
updatePrinterText();
}
@@ -2157,8 +2106,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
Help* pHelp = Application::GetHelp();
if( pHelp )
{
- // FIXME: find out proper help URL and use here
- pHelp->Start( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ), GetParent() );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton );
}
}
else if( pButton == &maForwardBtn )
@@ -2172,7 +2120,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
getLayout()->resize();
+ preparePreview( true, true );
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fe2af486c53a..0762a07476e2 100755..100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -35,7 +35,6 @@
#include "vcl/salinst.hxx"
#include "vcl/salgtype.hxx"
#include "vcl/salgdi.hxx"
-#include "vcl/salctrlhandle.hxx"
#include "vcl/unohelp.hxx"
#include "tools/time.hxx"
@@ -44,7 +43,6 @@
#include "tools/rc.h"
#endif
#include "vcl/svdata.hxx"
-#include "vcl/windata.hxx"
#include "vcl/dbggui.hxx"
#include "vcl/outfont.hxx"
#include "vcl/outdev.h"
@@ -68,6 +66,7 @@
#include "unotools/fontcfg.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
+#include "vcl/salctype.hxx"
#include "vcl/button.hxx" // Button::GetStandardText
#include "vcl/taskpanelist.hxx"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -90,7 +89,6 @@
#include "vcl/unowrap.hxx"
#include "vcl/dndlcon.hxx"
#include "vcl/dndevdis.hxx"
-#include "vcl/impbmpconv.hxx"
#include "unotools/confignode.hxx"
#include "vcl/gdimtf.hxx"
@@ -270,19 +268,41 @@ bool Window::ImplCheckUIFont( const Font& rFont )
if( ImplGetSVData()->maGDIData.mbNativeFontConfig )
return true;
+ // create a text string using the localized text of important buttons
String aTestText;
- aTestText.Append( Button::GetStandardText( BUTTON_OK ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CANCEL ) );
- aTestText.Append( Button::GetStandardText( BUTTON_YES ) );
- aTestText.Append( Button::GetStandardText( BUTTON_NO ) );
- aTestText.Append( Button::GetStandardText( BUTTON_RETRY ) );
- aTestText.Append( Button::GetStandardText( BUTTON_HELP ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CLOSE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_MORE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_LESS ) );
- aTestText.Append( Button::GetStandardText( BUTTON_ABORT ) );
+ static const StandardButtonType aTestButtons[] =
+ {
+ BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT,
+ BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_IGNORE,
+ BUTTON_RETRY, BUTTON_HELP
+ };
- return HasGlyphs( rFont, aTestText ) >= aTestText.Len();
+ const int nTestButtonCount = sizeof(aTestButtons)/sizeof(*aTestButtons);
+ for( int n = 0; n < nTestButtonCount; ++n )
+ {
+ String aButtonStr = Button::GetStandardText( aTestButtons[n] );
+ // #i115432# ignore mnemonic+accelerator part of each string
+ // TODO: use a string filtering method when it becomes available
+ const int nLen = aButtonStr.Len();
+ bool bInside = false;
+ for( int i = 0; i < nLen; ++i ) {
+ const sal_Unicode c = aButtonStr.GetChar( i );
+ if( (c == '('))
+ bInside = true;
+ if( (c == ')'))
+ bInside = false;
+ if( (c == '~')
+ || (c == '(') || (c == ')')
+ || ((c >= 'A') && (c <= 'Z') && bInside) )
+ aButtonStr.SetChar( i, ' ' );
+ }
+ // append sanitized button text to test string
+ aTestText.Append( aButtonStr );
+ }
+
+ const int nFirstChar = HasGlyphs( rFont, aTestText );
+ const bool bUIFontOk = (nFirstChar >= aTestText.Len());
+ return bUIFontOk;
}
// -----------------------------------------------------------------------
@@ -9716,11 +9736,14 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
// =========================================
if ( xFactory.is() )
{
- static Reference<lang::XMultiServiceFactory> xCanvasFactory(
- xFactory->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star."
- "rendering.CanvasFactory") ) ), UNO_QUERY );
+ static ::vcl::DeleteUnoReferenceOnDeinit<XMultiServiceFactory> xStaticCanvasFactory(
+ Reference<XMultiServiceFactory>(
+ xFactory->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.rendering.CanvasFactory") ) ),
+ UNO_QUERY ));
+ uno::Reference<XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+
if(xCanvasFactory.is())
{
#ifdef WNT
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index c964ad0d739b..2fce7e52f24c 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -42,7 +42,6 @@
#include <unotools/localedatawrapper.hxx>
#include <vcl/svdata.hxx>
#include <vcl/dbggui.hxx>
-#include <vcl/windata.hxx>
#include <vcl/timer.hxx>
#include <vcl/event.hxx>
#include <vcl/sound.hxx>
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 318f593ac6a3..ff615f5ede74 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -737,7 +737,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
{
BOOL returnVal = FALSE;
// get a GC with current clipping region set
- SelectFont();
+ GetFontGC();
// theme changed ?
@@ -3687,7 +3687,8 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
{
// The GC can't be null, otherwise we'd have no clip region
- if( SelectFont() == NULL )
+ GC aFontGC = GetFontGC();
+ if( aFontGC == NULL )
{
std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" );
return( FALSE );
@@ -3702,7 +3703,7 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe
gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ),
gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ),
GetDrawable(), m_nScreen, GetVisual().GetDepth(),
- SelectFont(),
+ aFontGC,
0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() );
return( TRUE );
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index d04d5c0ce684..9181ee3fd40d 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3339,7 +3339,9 @@ void GtkSalFrame::IMHandler::updateIMSpotLocation()
aArea.y = aPosEvent.mnY;
aArea.width = aPosEvent.mnWidth;
aArea.height = aPosEvent.mnHeight;
+ m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true );
gtk_im_context_set_cursor_location( m_pIMContext, &aArea );
+ m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel();
}
void GtkSalFrame::IMHandler::setInputContext( SalInputContext* )
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index fc788b2a0530..09e359ca3f71 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -38,7 +38,7 @@
#include <vcl/salframe.hxx>
#include <vcl/svdata.hxx>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <vcl/saldatabasic.hxx>
#include <sal/types.h>
diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx
index 297bc8edec17..a22a57b976c8 100644
--- a/vcl/unx/inc/i18n_im.hxx
+++ b/vcl/unx/inc/i18n_im.hxx
@@ -56,10 +56,6 @@ public:
Bool FilterEvent( XEvent *pEvent, XLIB_Window window );
Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler);
- #ifdef _USE_PRINT_EXTENSION_
- void Invalidate() { mbUseable = False; }
- #endif
-
SalI18N_InputMethod();
~SalI18N_InputMethod();
};
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 99c9bea699d6..89efad3cde4d 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -269,15 +269,10 @@ public:
class SalI18N_InputMethod;
class SalI18N_KeyboardExtension;
-class XlfdStorage;
-class ExtendedFontStruct;
-class ExtendedXlfd;
class AttributeProvider;
class SalUnicodeConverter;
class SalConverterCache;
-DECLARE_LIST( SalFontCache, ExtendedFontStruct* )
-
extern "C" {
struct SnDisplay;
struct SnLauncheeContext;
@@ -349,8 +344,6 @@ protected:
SalI18N_KeyboardExtension *mpKbdExtension;
AttributeProvider *mpFactory;
- XlfdStorage *mpFontList;
- const ExtendedXlfd *mpFallbackFactory;
Display *pDisp_; // X Display
int m_nDefaultScreen; // XDefaultScreen
@@ -374,8 +367,6 @@ protected:
XLIB_Cursor aPointerCache_[POINTER_COUNT];
SalFrame* m_pCapture;
- mutable SalFontCache* m_pFontCache;
-
// Keyboard
BOOL bNumLockFromXS_; // Num Lock handled by X Server
int nNumLockIndex_; // modifier index in modmap
@@ -397,7 +388,6 @@ protected:
mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access
- void DestroyFontCache();
virtual long Dispatch( XEvent *pEvent ) = 0;
void InitXinerama();
void InitRandR( XLIB_Window aRoot ) const;
@@ -434,14 +424,6 @@ public:
void PrintEvent( const ByteString &rComment,
XEvent *pEvent ) const;
- XlfdStorage* GetXlfdList() const;
- ExtendedFontStruct*
- GetFont( const ExtendedXlfd *pFont,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- const ExtendedXlfd*
- GetFallbackFactory()
- { return mpFallbackFactory; }
-
void Beep() const;
void ModifierMapping();
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index b5fdce50eee9..8af62a5c6607 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -28,18 +28,15 @@
#ifndef _SV_SALGDI_H
#define _SV_SALGDI_H
-
-// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-class SalFontCacheItem;
-
// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "salstd.hxx"
#include "vcl/salgdi.hxx"
#include "vcl/salgtype.hxx"
#include "tools/fract.hxx"
#include "vcl/dllapi.h"
+#include <vcl/vclenum.hxx>
+#include <vcl/sallayout.hxx>
#include <deque>
-#include "xfont.hxx"
// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
struct ImplFontMetricData;
@@ -100,7 +97,6 @@ protected:
Pixel nPenPixel_;
GC pFontGC_; // Font attributes
- ExtendedFontStructRef mXFont[ MAX_FALLBACK ];
ServerFont* mpServerFont[ MAX_FALLBACK ];
SalColor nTextColor_;
@@ -185,7 +181,7 @@ protected:
const SalBitmap &rTransparentBitmap,
SalColor nTransparentColor );
- GC SelectFont();
+ GC GetFontGC();
bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
void drawMaskedBitmap( const SalTwoRect* pPosAry,
@@ -193,9 +189,6 @@ protected:
const SalBitmap& rTransparentBitmap );
protected:
- void DrawStringUCS2MB( ExtendedFontStruct& rFont, const Point&,
- const sal_Unicode* pStr, int nLength );
-
void DrawPrinterString( const SalLayout& );
void DrawServerFontString( const ServerFontLayout& );
@@ -386,19 +379,8 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const
#ifdef DBG_UTIL
#define stderr0( s ) fprintf( stderr, s )
-#define stderr1( s, a ) fprintf( stderr, s, a )
-#define stderr2( s, a, b ) fprintf( stderr, s, a, b )
-#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c )
-#define stdass0( b ) (void)( !(b) \
- ? fprintf( stderr, "\"%s\" (%s line %d)\n", \
- #b, __FILE__, __LINE__ ) \
- : 0 )
#else
#define stderr0( s ) ;
-#define stderr1( s, a ) ;
-#define stderr2( s, a, b ) ;
-#define stderr3( s, a, b, c ) ;
-#define stdass0( b ) ;
#endif
#endif // _SV_SALGDI_H
diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx
deleted file mode 100644
index 4041ed7ce67d..000000000000
--- a/vcl/unx/inc/xfont.hxx
+++ /dev/null
@@ -1,162 +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 EXTENDED_FONTSTRUCT_HXX
-#define EXTENDED_FONTSTRUCT_HXX
-
-#ifndef _XLIB_H_
-#include <tools/prex.h>
-#include <X11/Xlib.h>
-#include <tools/postx.h>
-#endif
-#include <tools/ref.hxx>
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-#include <vcl/sallayout.hxx>
-
-typedef unsigned short sal_MultiByte;
-
-class ImplFontMetricData;
-class ExtendedXlfd;
-
-struct VerticalTextItem
-{
- BOOL mbFixed;
- XFontStruct* mpXFontStruct;
- const sal_Unicode* mpString;
- int mnLength;
- int mnTransX;
- int mnTransY;
- int mnFixedAdvance;
- int* mpAdvanceAry;
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int nFixedAdvance )
- : mbFixed( TRUE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mnFixedAdvance( nFixedAdvance )
- {}
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int* pAdvanceAry )
- : mbFixed( FALSE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mpAdvanceAry( pAdvanceAry )
- {}
-
- ~VerticalTextItem()
- {
- if (!mbFixed)
- {
- delete( mpAdvanceAry );
- }
- }
-};
-
-class ExtendedFontStruct : public SvRefBase
-{
- private:
- Display* mpDisplay;
- Size maPixelSize;
- float mfXScale;
- float mfYScale;
- sal_Size mnDefaultWidth;
- sal_Bool mbVertical;
- rtl_TextEncoding mnCachedEncoding;
- rtl_TextEncoding mnAsciiEncoding;
-
- ExtendedXlfd* mpXlfd;
- XFontStruct** mpXFontStruct;
-
- // unicode range cache
- mutable sal_uInt32* mpRangeCodes;
- mutable int mnRangeCount;
-
- int LoadEncoding( rtl_TextEncoding nEncoding );
- FontPitch GetSpacing( rtl_TextEncoding nEncoding );
- bool GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent ) ;
-
- sal_Size GetDefaultWidth();
- sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray,
- rtl_TextEncoding nEncoding );
- sal_Size GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray );
- sal_Size GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray, ExtendedFontStruct *pFallback );
- public:
- ExtendedFontStruct( Display* pDisplay,
- const Size& rPixelSize, sal_Bool bVertical,
- ExtendedXlfd* pXlfd );
- ~ExtendedFontStruct();
- bool Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding );
- XFontStruct* GetFontStruct( sal_Unicode nChar,
- rtl_TextEncoding *pEncoding );
- bool ToImplFontMetricData( ImplFontMetricData *pMetric );
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- sal_Size GetCharWidth( sal_Unicode,
- sal_Int32* pPhysWidth, sal_Int32* pLogWidth );
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
- bool HasUnicodeChar( sal_Unicode ) const;
-};
-
-// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting
-// to ExtendedFontStruct (it's not possible to separate decl and impl into
-// a separate source file: all ref member functions are inline
-SV_DECL_IMPL_REF( ExtendedFontStruct );
-
-class X11FontLayout : public GenericSalLayout
-{
-public:
- X11FontLayout( ExtendedFontStruct& );
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
- virtual void DrawText( SalGraphics& ) const;
-
-private:
- ExtendedFontStruct& mrFont;
-};
-
-#endif /* EXTENDED_FONTSTRUCT_HXX */
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 354c4d433d42..92d5f75f7315 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -375,11 +375,6 @@ sal_GetServerVendor( Display *p_display )
{ vendor_none, NULL, 0 },
};
-#ifdef _USE_PRINT_EXTENSION_
- if ( ! XSalIsDisplay( p_display ) )
- return vendor_xprinter;
-#endif
-
// handle regular server vendors
char *p_name = ServerVendor( p_display );
vendor_t *p_vendor;
@@ -508,7 +503,6 @@ BOOL SalDisplay::BestVisual( Display *pDisplay,
SalDisplay::SalDisplay( Display *display ) :
mpInputMethod( NULL ),
- mpFallbackFactory ( NULL ),
pDisp_( display ),
m_pWMAdaptor( NULL ),
m_pDtIntegrator( NULL ),
@@ -557,7 +551,6 @@ void SalDisplay::doDestruct()
m_pDtIntegrator = NULL;
X11SalBitmap::ImplDestroyCache();
X11SalGraphics::releaseGlyphPeer();
- DestroyFontCache();
if( IsDisplay() )
{
@@ -814,8 +807,6 @@ void SalDisplay::Init()
eWindowManager_ = otherwm;
nProperties_ = PROPERTY_DEFAULT;
hEventGuard_ = NULL;
- m_pFontCache = NULL;
- mpFontList = (XlfdStorage*)NULL;
mpFactory = (AttributeProvider*)NULL;
m_pCapture = NULL;
m_bXinerama = false;
@@ -2575,6 +2566,7 @@ void SalDisplay::PrintInfo() const
fprintf( stderr, "\tProperties \t0x%lX\n", GetProperties() );
if( eWindowManager_ != otherwm )
fprintf( stderr, "\tWindowmanager \t%d\n", eWindowManager_ );
+ fprintf( stderr, "\tWMName \t%s\n", rtl::OUStringToOString( getWMAdaptor()->getWindowManagerName(), osl_getThreadTextEncoding() ).getStr() );
}
fprintf( stderr, "Screen\n" );
fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n",
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 88af0b70ef7e..f125d5f98fa6 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -45,7 +45,7 @@
#include "sm.hxx"
#include "vcl/salwtype.hxx"
-#include "vcl/salatype.hxx"
+#include "vcl/apptypes.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
#include "vos/mutex.hxx"
diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk
index 536aadcac015..123fcbcf9131 100644
--- a/vcl/unx/source/gdi/makefile.mk
+++ b/vcl/unx/source/gdi/makefile.mk
@@ -53,29 +53,19 @@ SLOFILES= \
$(SLO)$/salvd.obj \
$(SLO)$/dtint.obj \
$(SLO)$/salcvt.obj \
- $(SLO)$/xfont.obj \
- $(SLO)$/xlfd_attr.obj \
- $(SLO)$/xlfd_extd.obj \
- $(SLO)$/xlfd_smpl.obj \
$(SLO)$/salgdi3.obj \
$(SLO)$/gcach_xpeer.obj \
$(SLO)$/xrender_peer.obj \
$(SLO)$/pspgraphics.obj
EXCEPTIONSFILES=\
- $(SLO)$/xlfd_extd.obj \
$(SLO)$/salgdi.obj \
$(SLO)$/salbmp.obj \
$(SLO)$/salgdi3.obj \
$(SLO)$/salcvt.obj
-.IF "$(USE_XPRINT)" == "TRUE"
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-SLOFILES+=$(SLO)$/xprintext.obj
-.ELSE
SLOFILES+=$(SLO)$/salprnpsp.obj
EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj
-.ENDIF
.IF "$(OS)"=="SOLARIS"
SLOFILES+=$(SLO)$/cdeint.obj
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 9215f2e25b16..9dfbfff22d03 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -113,10 +113,7 @@ X11SalGraphics::X11SalGraphics()
pFontGC_ = NULL;
for( int i = 0; i < MAX_FALLBACK; ++i )
- {
- mXFont[i] = NULL;
mpServerFont[i] = NULL;
- }
nTextPixel_ = 0;
nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
@@ -338,13 +335,8 @@ GC X11SalGraphics::SelectBrush()
{
XSetFillStyle ( pDisplay, pBrushGC_, FillSolid );
XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ );
- #if defined(_USE_PRINT_EXTENSION_)
- XSetBackground( pDisplay, pBrushGC_,
- WhitePixel(pDisplay, DefaultScreen(pDisplay)) );
- #else
if( bPrinter_ )
XSetTile( pDisplay, pBrushGC_, None );
- #endif
}
else
{
@@ -757,6 +749,7 @@ void X11SalGraphics::SetXORMode( bool bSet, bool )
{
bXORMode_ = bSet;
bPenGC_ = FALSE;
+ bFontGC_ = FALSE;
bBrushGC_ = FALSE;
bMonoGC_ = FALSE;
bCopyGC_ = FALSE;
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 62e575ebc5ef..d9f81c0f67d2 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -46,11 +46,7 @@
#include "salgdi.h"
#include "pspgraphics.h"
#include "salvd.h"
-#include "xfont.hxx"
#include <vcl/sysdata.hxx>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
#include "salcvt.hxx"
#include "vcl/printergfx.hxx"
@@ -112,391 +108,6 @@ struct _XRegion
};
using namespace rtl;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ----------------------------------------------------------------------------
-//
-// manage X11 fonts and self rastered fonts
-//
-// ----------------------------------------------------------------------------
-
-#ifndef _USE_PRINT_EXTENSION_
-
-class FontLookup
-{
- public:
-
- struct hash;
- struct equal;
- typedef ::std::hash_set< FontLookup,
- FontLookup::hash,
- FontLookup::equal > fl_hashset;
-
- private:
-
- rtl::OString maName;
- FontWeight mnWeight;
- FontItalic mnItalic;
- sal_Bool mbDisplay;
-
- public:
-
- FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr );
- FontLookup (const Xlfd& rFont);
- FontLookup (const FontLookup &rRef) :
- maName (rRef.maName),
- mnWeight (rRef.mnWeight),
- mnItalic (rRef.mnItalic),
- mbDisplay(rRef.mbDisplay)
- {}
- ~FontLookup ()
- {}
-
- static void BuildSet (fl_hashset& rSet);
- static bool InSet (const fl_hashset& rSet, const Xlfd& rXfld);
- bool InSet (const fl_hashset& rSet) const;
-
- bool operator== (const FontLookup &rRef) const
- {
- return (abs(mnWeight - rRef.mnWeight) < 2)
- && (mnItalic == rRef.mnItalic)
- && (maName == rRef.maName)
- && (mbDisplay== rRef.mbDisplay);
- }
- FontLookup& operator= (const FontLookup &rRef)
- {
- mnWeight = rRef.mnWeight;
- mnItalic = rRef.mnItalic;
- maName = rRef.maName;
- mbDisplay= rRef.mbDisplay;
-
- return *this;
- }
- size_t Hash() const
- {
- return maName.hashCode ();
- }
-
- struct equal
- {
- bool operator()(const FontLookup &r1, const FontLookup &r2) const
- {
- return r1 == r2;
- }
- };
- struct hash
- {
- size_t operator()(const FontLookup &rArg) const
- {
- return rArg.Hash();
- }
- };
-};
-
-FontLookup::FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr )
-{
- psp::FastPrintFontInfo aInfo;
- if (rMgr.getFontFastInfo (*it, aInfo))
- {
- mnItalic = PspGraphics::ToFontItalic (aInfo.m_eItalic);
- mnWeight = PspGraphics::ToFontWeight (aInfo.m_eWeight);
- mbDisplay= aInfo.m_eType == psp::fonttype::Builtin
- || aInfo.m_eType == psp::fonttype::Unknown ? False : True;
- maName = rtl::OUStringToOString
- ( aInfo.m_aFamilyName,
- RTL_TEXTENCODING_ISO_8859_1).toAsciiLowerCase();
-
- sal_Int32 n_length = maName.getLength();
- const sal_Char* p_from = maName.getStr();
- sal_Char* p_to = (sal_Char*)alloca (n_length + 1);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < n_length; i++)
- {
- if ( p_from[i] != ' ' )
- p_to[j++] = p_from[i];
- }
- maName = rtl::OString (p_to, j);
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
- }
- else
- {
- mnItalic = ITALIC_DONTKNOW;
- mnWeight = WEIGHT_DONTKNOW;
- mbDisplay= False;
- }
-}
-
-FontLookup::FontLookup (const Xlfd& rFont)
-{
- AttributeProvider* pFactory = rFont.mpFactory;
- Attribute* pAttr;
-
- pAttr = pFactory->RetrieveSlant (rFont.mnSlant);
- mnItalic = (FontItalic)pAttr->GetValue();
- pAttr = pFactory->RetrieveWeight (rFont.mnWeight);
- mnWeight = (FontWeight)pAttr->GetValue();
- pAttr = pFactory->RetrieveFamily (rFont.mnFamily);
- maName = pAttr->GetKey();
-
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
-
- mbDisplay = True;
-}
-
-void
-FontLookup::BuildSet (FontLookup::fl_hashset &rSet)
-{
- ::std::list< psp::fontID > aIdList;
-
- psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
- rMgr.getFontList( aIdList, NULL, false );
-
- ::std::list< psp::fontID >::iterator it;
- for (it = aIdList.begin(); it != aIdList.end(); ++it)
- {
- FontLookup aItem (it, rMgr);
- rSet.insert (aItem);
- }
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet) const
-{
- fl_hashset::const_iterator it = rSet.find(*this);
- return it == rSet.end() ? false : true;
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet, const Xlfd& rXlfd)
-{
- FontLookup aNeedle (rXlfd);
- return aNeedle.InSet (rSet);
-}
-
-#endif
-
-// ----------------------------------------------------------------------------
-//
-// SalDisplay
-//
-// ----------------------------------------------------------------------------
-
-XlfdStorage*
-SalDisplay::GetXlfdList() const
-{
- if ( mpFontList != NULL )
- {
- return mpFontList;
- }
- else
- {
- const_cast<SalDisplay*>(this)->mpFactory = new AttributeProvider;
- const_cast<SalDisplay*>(this)->mpFontList = new XlfdStorage;
- const_cast<SalDisplay*>(this)->mpFallbackFactory = new VirtualXlfd;
-
- int i, nFontCount;
- const int nMaxCount = 64 * 1024 - 1;
- Display *pDisplay = GetDisplay();
- char **ppFontList = XListFonts(pDisplay, "-*", nMaxCount, &nFontCount);
-
- //
- // create a list of simple Xlfd font information
- //
-
- Xlfd *pXlfdList = (Xlfd*)malloc( nFontCount * sizeof(Xlfd) );
- int nXlfdCount = 0;
-
- for ( i = 0; i < nFontCount; i++ )
- {
- if ( pXlfdList[ nXlfdCount ].FromString(ppFontList[i], mpFactory) )
- ++nXlfdCount;
- }
-
- XFreeFontNames( ppFontList );
-
- mpFactory->AddClassification();
- // add some pretty print description
- mpFactory->AddAnnotation();
- // misc feature checking
- mpFactory->TagFeature();
-
- // sort according to font style
- qsort( pXlfdList, nXlfdCount, sizeof(Xlfd), XlfdCompare );
-
-#ifndef _USE_PRINT_EXTENSION_
- // create a list of fonts already managed by the fontmanager
- FontLookup::fl_hashset aSet;
- FontLookup::BuildSet (aSet);
-#endif
-
- //
- // create a font list with merged encoding information
- //
-
- BitmapXlfdStorage aBitmapList;
- ScalableXlfd *pScalableFont = NULL;
-
- int nFrom = 0;
- for ( i = 0; i < nXlfdCount; i++ )
- {
- // exclude openlook glyph and cursor
- Attribute *pAttr = mpFactory->RetrieveFamily(pXlfdList[i].mnFamily);
- if ( pAttr->HasFeature( XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR) )
- continue;
- // exclude fonts with unknown encoding
- if ( pXlfdList[i].GetEncoding() == RTL_TEXTENCODING_DONTKNOW )
- continue;
- // exclude "interface system" and "interface user"
- if (pAttr->HasFeature( XLFD_FEATURE_APPLICATION_FONT ) )
- continue;
- // exclude fonts already managed by fontmanager, anyway keep
- // gui fonts: they are candidates for GetInterfaceFont ()
- if (pXlfdList[i].Fonttype() == eTypeScalable)
- ((VirtualXlfd*)mpFallbackFactory)->FilterInterfaceFont (pXlfdList + i);
-#ifndef _USE_PRINT_EXTENSION_
- if (FontLookup::InSet (aSet, pXlfdList[i]))
- continue;
-#endif
- Bool bSameOutline = pXlfdList[i].SameFontoutline(pXlfdList + nFrom);
- XlfdFonttype eType = pXlfdList[i].Fonttype();
-
- // flush the old merged font list if the name doesn't match any more
- if ( !bSameOutline )
- {
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- pScalableFont = NULL;
- aBitmapList.Reset();
- }
-
- // merge the font or generate a new one
- switch( eType )
- {
- case eTypeScalable:
- if ( pScalableFont == NULL )
- pScalableFont = new ScalableXlfd;
- pScalableFont->AddEncoding(pXlfdList + i);
- break;
-
- case eTypeBitmap:
- aBitmapList.AddBitmapFont( pXlfdList + i );
- break;
-
- case eTypeScalableBitmap:
- // ignore scaled X11 bitmap fonts because they look too ugly
- default:
- break;
- }
-
- nFrom = i;
- }
-
- // flush the merged list into the global list
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- if (mpFallbackFactory->NumEncodings() > 0)
- mpFontList->Add( mpFallbackFactory );
- // cleanup the list of simple font information
- if ( pXlfdList != NULL )
- free( pXlfdList );
-
- return mpFontList;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-ExtendedFontStruct*
-SalDisplay::GetFont( const ExtendedXlfd *pRequestedFont,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- // TODO: either get rid of X11 fonts or get rid of the non-hashmapped cache
- if( !m_pFontCache )
- {
- m_pFontCache = new SalFontCache( 64, 64, 16 ); // ???
- }
- else
- {
- ExtendedFontStruct *pItem;
- for ( pItem = m_pFontCache->First();
- pItem != NULL;
- pItem = m_pFontCache->Next() )
- {
- if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) )
- {
- if( m_pFontCache->GetCurPos() )
- {
- m_pFontCache->Remove( pItem );
- m_pFontCache->Insert( pItem, 0UL );
- }
- return pItem;
- }
- }
- }
-
- // before we expand the cache, we look for very old and unused items
- if( m_pFontCache->Count() >= 64 )
- {
- ExtendedFontStruct *pItem;
- for ( pItem = m_pFontCache->Last();
- pItem != NULL;
- pItem = m_pFontCache->Prev() )
- {
- if( 1 == pItem->GetRefCount() )
- {
- m_pFontCache->Remove( pItem );
- pItem->ReleaseRef();
- if( m_pFontCache->Count() < 64 )
- break;
- }
- }
- }
-
- ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(),
- rPixelSize, bVertical,
- const_cast<ExtendedXlfd*>(pRequestedFont) );
- m_pFontCache->Insert( pItem, 0UL );
- pItem->AddRef();
-
- return pItem;
-}
-
-// ---------------------------------------------------------------------------
-
-void
-SalDisplay::DestroyFontCache()
-{
- if( m_pFontCache )
- {
- ExtendedFontStruct *pItem = m_pFontCache->First();
- while( pItem )
- {
- delete pItem;
- pItem = m_pFontCache->Next();
- }
- delete m_pFontCache;
- }
- if( mpFontList )
- {
- mpFontList->Dispose();
- delete mpFontList;
- }
- if ( mpFactory )
- {
- delete mpFactory;
- }
-
- m_pFontCache = (SalFontCache*)NULL;
- mpFontList = (XlfdStorage*)NULL;
- mpFactory = (AttributeProvider*)NULL;
-}
-
// ===========================================================================
// PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#)
@@ -538,7 +149,7 @@ void PspKernInfo::Initialize() const
// ----------------------------------------------------------------------------
GC
-X11SalGraphics::SelectFont()
+X11SalGraphics::GetFontGC()
{
Display *pDisplay = GetXDisplay();
@@ -549,18 +160,10 @@ X11SalGraphics::SelectFont()
values.fill_rule = EvenOddRule; // Pict import/ Gradient
values.graphics_exposures = False;
values.foreground = nTextPixel_;
-#ifdef _USE_PRINT_EXTENSION_
- values.background = xColormap_->GetWhitePixel();
- pFontGC_ = XCreateGC( pDisplay, hDrawable_,
- GCSubwindowMode | GCFillRule
- | GCGraphicsExposures | GCBackground | GCForeground,
- &values );
-#else
pFontGC_ = XCreateGC( pDisplay, hDrawable_,
GCSubwindowMode | GCFillRule
| GCGraphicsExposures | GCForeground,
&values );
-#endif
}
if( !bFontGC_ )
{
@@ -594,8 +197,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
{
- mXFont[i] = NULL; // ->ReleaseRef()
-
if( mpServerFont[i] != NULL )
{
// old server side font is no longer referenced
@@ -614,18 +215,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
if( !pEntry->mpFontData )
return false;
- // handle the request for a native X11-font
- if( ImplX11FontData::CheckFontData( *pEntry->mpFontData ) )
- {
- const ImplX11FontData* pRequestedFont = static_cast<const ImplX11FontData*>( pEntry->mpFontData );
- const ExtendedXlfd& rX11Font = pRequestedFont->GetExtendedXlfd();
-
- Size aReqSize( pEntry->mnWidth, pEntry->mnHeight );
- mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ );
- bFontGC_ = FALSE;
- return true;
- }
-
// handle the request for a non-native X11-font => use the GlyphCache
ServerFont* pServerFont = GlyphCache::GetInstance().CacheFont( *pEntry );
if( pServerFont != NULL )
@@ -674,83 +263,6 @@ void ImplServerFontEntry::HandleFontOptions( void )
//--------------------------------------------------------------------------
-inline sal_Unicode SwapBytes( const sal_Unicode nIn )
-{
- return ((nIn >> 8) & 0x00ff) | ((nIn & 0x00ff) << 8);
-}
-
-// draw string in a specific multibyte encoding
-static void
-ConvertTextItem16( XTextItem16* pTextItem, rtl_TextEncoding nEncoding )
-{
- if ( (pTextItem == NULL) || (pTextItem->nchars <= 0) )
- return;
-
- SalConverterCache* pCvt = SalConverterCache::GetInstance();
- // convert the string into the font encoding
- sal_Size nSize;
- sal_Size nBufferSize = pTextItem->nchars * 2;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferSize );
-
- nSize = pCvt->ConvertStringUTF16( (sal_Unicode*)pTextItem->chars, pTextItem->nchars,
- pBuffer, nBufferSize, nEncoding);
-
- sal_Char *pTextChars = (sal_Char*)pTextItem->chars;
- unsigned int n = 0, m = 0;
-
- if ( nEncoding == RTL_TEXTENCODING_GB_2312
- || nEncoding == RTL_TEXTENCODING_GBT_12345
- || nEncoding == RTL_TEXTENCODING_GBK
- || nEncoding == RTL_TEXTENCODING_BIG5 )
- {
- // GB and Big5 needs special treatment since chars can be single or
- // double byte: encoding is
- // [ 0x00 - 0x7f ] | [ 0x81 - 0xfe ] [ 0x40 - 0x7e 0x80 - 0xfe ]
- while ( n < nSize )
- {
- if ( (unsigned char)pBuffer[ n ] < 0x80 )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- else
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- }
- pTextItem->nchars = m / 2;
- }
- else
- if ( pCvt->IsSingleByteEncoding(nEncoding) )
- {
- // Single Byte encoding has to be padded
- while ( n < nSize )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize;
- }
- else
- {
- while ( n < nSize )
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize / 2;
- }
-
- // XXX FIXME
- if ( (nEncoding == RTL_TEXTENCODING_GB_2312)
- || (nEncoding == RTL_TEXTENCODING_EUC_KR) )
- {
- for (unsigned int n_char = 0; n_char < m; n_char++ )
- pTextChars[ n_char ] &= 0x7F;
- }
-}
-
-//--------------------------------------------------------------------------
namespace {
class CairoWrapper
@@ -1289,7 +801,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
}
// prepare context
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal );
@@ -1376,7 +888,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
aGCVal.fill_style = FillStippled;
@@ -1439,61 +951,6 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
//--------------------------------------------------------------------------
-void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
- const Point& rPoint, const sal_Unicode* pStr, int nLength )
-{
- Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
-
- if( rFont.GetAsciiEncoding() == RTL_TEXTENCODING_UNICODE )
- {
- // plain Unicode, can handle all chars and can be handled straight forward
- XFontStruct* pFontStruct = rFont.GetFontStruct( RTL_TEXTENCODING_UNICODE );
- if( !pFontStruct )
- return;
-
- XSetFont( pDisplay, nGC, pFontStruct->fid );
-
- #ifdef OSL_LITENDIAN
- sal_Unicode *pBuffer = (sal_Unicode*)alloca( nLength * sizeof(sal_Unicode) );
- for ( int i = 0; i < nLength; i++ )
- pBuffer[ i ] = SwapBytes(pStr[ i ]) ;
- #else
- sal_Unicode *pBuffer = const_cast<sal_Unicode*>(pStr);
- #endif
-
- XDrawString16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), (XChar2b*)pBuffer, nLength );
- }
- else
- {
- XTextItem16 *pTextItem = (XTextItem16*)alloca( nLength * sizeof(XTextItem16) );
- XChar2b *pMBChar = (XChar2b*)pStr;
- int nItem = 0;
-
- DBG_ASSERT( nLength<=1, "#i49902# DrawStringUCS2MB with nLength>1 => problems with XOrg6.8.[0123]");
-
- for( int nChar = 0; nChar < nLength; ++nChar )
- {
- rtl_TextEncoding nEnc;
- XFontStruct* pFontStruct = rFont.GetFontStruct( pStr[nChar], &nEnc );
- if( !pFontStruct )
- continue;
-
- pTextItem[ nItem ].chars = pMBChar + nChar;
- pTextItem[ nItem ].delta = 0;
- pTextItem[ nItem ].font = pFontStruct->fid;
- pTextItem[ nItem ].nchars = 1;
-
- ConvertTextItem16( &pTextItem[ nItem ], nEnc );
- ++nItem;
- }
-
- XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem );
- }
-}
-
-//--------------------------------------------------------------------------
-
const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
{
if( !mpServerFont[0] )
@@ -1575,15 +1032,6 @@ void RegisterFontSubstitutors( ImplDevFontList* );
void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
{
- // allow disabling of native X11 fonts
- static const char* pEnableX11FontStr = getenv( "SAL_ENABLE_NATIVE_XFONTS" );
- if( pEnableX11FontStr && (pEnableX11FontStr[0] != '0') )
- {
- // announce X11 fonts
- XlfdStorage* pX11FontList = GetDisplay()->GetXlfdList();
- pX11FontList->AnnounceFonts( pList );
- }
-
// prepare the GlyphCache using psprint's font infos
X11GlyphCache& rGC = X11GlyphCache::GetInstance();
@@ -1766,12 +1214,6 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
long rDummyFactor;
mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
- else if( mXFont[nFallbackLevel] != NULL )
- {
- mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
- if ( bFontVertical_ )
- pMetric->mnOrientation = 0;
- }
}
// ---------------------------------------------------------------------------
@@ -1859,10 +1301,6 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
#endif
pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
}
- else if( mXFont[ nFallbackLevel ] )
- pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] );
- else
- pLayout = NULL;
return pLayout;
}
@@ -1926,7 +1364,6 @@ BOOL X11SalGraphics::CreateFontSubset(
const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1934,25 +1371,19 @@ const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const s
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen )
{
-#ifndef _USE_PRINT_EXTENSION_
PspGraphics::DoFreeEmbedFontData( pData, nLen );
-#endif
}
//--------------------------------------------------------------------------
const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pFont, const Ucs2OStrMap** pNonEncoded )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1960,9 +1391,6 @@ const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pF
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
deleted file mode 100644
index f6d19909cd4a..000000000000
--- a/vcl/unx/source/gdi/xfont.cxx
+++ /dev/null
@@ -1,780 +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_vcl.hxx"
-
-#include <salunx.h>
-#include "xfont.hxx"
-#include "xlfd_extd.hxx"
-#include "salcvt.hxx"
-#include <tools/string.hxx>
-#include <vcl/outfont.hxx>
-#include <saldisp.hxx>
-#include <salgdi.h>
-
-// for GetMirroredChar
-#include <vcl/svapp.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-#include <cstdio>
-#endif
-
-#include <algorithm>
-
-#define VCLASS_ROTATE 0
-#define VCLASS_ROTATE_REVERSE 1
-#define VCLASS_TRANSFORM1 2
-#define VCLASS_TRANSFORM2 3
-#define VCLASS_CJK 4
-#define VCLASS_DONTKNOW 5
-#define VCLASS_FONT_NUM 2 // Other than rotate and rotate_reverse,
- // don't have spacial font
-
-// Select the max size of a font, which is token for real
-// This routine is (and should be) called only once, the result should be
-// stored in some static variable
-
-static int GetMaxFontHeight()
-{
- static int nMaxFontHeight = 0;
- if( nMaxFontHeight <= 0 )
- {
- const char *pFontHeight = getenv ("SAL_MAXFONTHEIGHT");
- if( pFontHeight )
- nMaxFontHeight = atoi( pFontHeight );
- static const int DEFAULT_MAXFONTHEIGHT = 250;
- if (nMaxFontHeight <= 20)
- nMaxFontHeight = DEFAULT_MAXFONTHEIGHT;
- }
-
- return nMaxFontHeight;
-}
-
-
-ExtendedFontStruct::ExtendedFontStruct( Display* pDisplay, const Size& rPixelSize,
- sal_Bool bVertical, ExtendedXlfd* pXlfd ) :
- mpDisplay( pDisplay ),
- maPixelSize( rPixelSize ),
- mfXScale(1.0), mfYScale(1.0),
- mbVertical( bVertical ),
- mnCachedEncoding( RTL_TEXTENCODING_DONTKNOW ),
- mpXlfd( pXlfd ),
- mpRangeCodes(NULL),
- mnRangeCount(-1)
-{
- if( !maPixelSize.Width() )
- maPixelSize.Width() = maPixelSize.Height();
- mnAsciiEncoding = GetAsciiEncoding (NULL);
- mnDefaultWidth = GetDefaultWidth();
-
- mpXFontStruct = (XFontStruct**)calloc( mpXlfd->NumEncodings(),
- sizeof(XFontStruct*) );
-}
-
-ExtendedFontStruct::~ExtendedFontStruct()
-{
- delete[] mpRangeCodes;
-
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[nIdx] != NULL )
- XFreeFont( mpDisplay, mpXFontStruct[nIdx] );
-
- free(mpXFontStruct);
-}
-
-rtl_TextEncoding
-ExtendedFontStruct::GetAsciiEncoding( int *pAsciiRange ) const
-{
- return mpXlfd->GetAsciiEncoding( pAsciiRange );
-}
-
-FontPitch
-ExtendedFontStruct::GetSpacing( rtl_TextEncoding nEncoding )
-{
- return mpXlfd->GetPitch( nEncoding );
-}
-
-static XFontStruct*
-LoadXFont (Display* pDisplay, const char* pFontName)
-{
- XFontStruct* pFont = XLoadQueryFont (pDisplay, pFontName);
- if ((pFont != NULL) && (pFont->fid == 0))
- pFont->fid = XLoadFont(pDisplay, pFontName);
-
-#ifdef HDU_DEBUG
- fprintf( stderr, "XLoadFont \"%s\" => %d\n", pFontName, (pFont!= NULL) );
-#endif
- return pFont;
-}
-
-int
-ExtendedFontStruct::LoadEncoding( rtl_TextEncoding nEncoding )
-{
- int nIdx = mpXlfd->GetEncodingIdx( nEncoding );
- if ( (nIdx < 0) || (mpXFontStruct[ nIdx ] != NULL) )
- return nIdx;
-
- // limit font height that gets requested from the XServer
- // see BugId #44528# FontWork (-> #45038#) and as well Bug #47127#
- int nReqPixelHeight = maPixelSize.Height();
- if( nReqPixelHeight > GetMaxFontHeight() )
- nReqPixelHeight = GetMaxFontHeight();
- else if( nReqPixelHeight < 2 )
- nReqPixelHeight = 2;
-
- // get the X11 font from a matching XLFD
- ByteString aFontName;
- mpXlfd->ToString( aFontName, nReqPixelHeight, nEncoding );
- mpXFontStruct[ nIdx ] = LoadXFont( mpDisplay, aFontName.GetBuffer() );
- if (mpXFontStruct[nIdx] == NULL)
- mpXFontStruct[nIdx] = LoadXFont( mpDisplay, "fixed" );
-
- // calculate correction factors to improve matching
- // the selected font size to the used bitmap font
- int nRealPixelSize = mpXlfd->GetPixelSize();
- if( !nRealPixelSize ) // check for scalable mpXlfd
- nRealPixelSize = nReqPixelHeight;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Width()) )
- mfXScale = (float)maPixelSize.Width() / nRealPixelSize;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Height()) )
- mfYScale = (float)maPixelSize.Height() / nRealPixelSize;
-
- return nIdx;
-}
-
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( rtl_TextEncoding nEncoding )
-{
- int nIdx = LoadEncoding( nEncoding );
- return nIdx < 0 ? NULL : mpXFontStruct[nIdx] ;
-}
-
-bool
-ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent )
-{
- pCharStruct->lbearing = 0;
- pCharStruct->rbearing = 0;
- pCharStruct->width = 0;
- pCharStruct->ascent = 0;
- pCharStruct->descent = 0;
-
- *pAscent = 0;
- *pDescent = 0;
-
- int nIdx;
-
- // check if there is at least one encoding already loaded
- bool bEmpty = true;
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- bEmpty &= (mpXFontStruct[nIdx] == NULL);
- if ( bEmpty )
- LoadEncoding( mpXlfd->GetAsciiEncoding() );
-
- // get the max bounding box from all font structs
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[ nIdx ] != NULL )
- {
- *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent );
- *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent );
-
- XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds);
-
- pCharStruct->lbearing = std::max( pMaxBounds->lbearing,
- pCharStruct->lbearing );
- pCharStruct->rbearing = std::max( pMaxBounds->rbearing,
- pCharStruct->rbearing );
- pCharStruct->width = std::max( pMaxBounds->width,
- pCharStruct->width );
- pCharStruct->ascent = std::max( pMaxBounds->ascent,
- pCharStruct->ascent );
- pCharStruct->descent = std::max( pMaxBounds->descent,
- pCharStruct->descent );
- }
-
- // apply correction factors to better match selected size to available size
- if( mfYScale != 1.0 )
- {
- *pAscent = int(*pAscent * mfYScale);
- *pDescent = int(*pDescent * mfYScale);
- pCharStruct->ascent = (short int)(pCharStruct->ascent * mfYScale);
- pCharStruct->descent = (short int)(pCharStruct->descent * mfYScale);
- }
- if( mfXScale != 1.0 )
- {
- pCharStruct->lbearing = (short int)(pCharStruct->lbearing * mfXScale);
- pCharStruct->rbearing = (short int)(pCharStruct->rbearing * mfXScale);
- pCharStruct->width = (short int)(pCharStruct->width * mfXScale);
- }
-
- return (pCharStruct->width > 0);
-}
-
-bool
-ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric)
-{
- pFontMetric->mnOrientation = 0;
- pFontMetric->mnSlant = 0;
- pFontMetric->mbDevice = true;
- pFontMetric->mbScalableFont = mpXlfd->IsScalable();
- pFontMetric->mbKernableFont = false;
- pFontMetric->mbSymbolFlag= mpXlfd->IsSymbolFont();
- pFontMetric->meFamily = mpXlfd->GetFamilyType();
- pFontMetric->meWeight = mpXlfd->GetWeight();
- pFontMetric->mePitch = mpXlfd->GetPitch();
- pFontMetric->meItalic = mpXlfd->GetSlant();
-
- int nAscent, nDescent;
- XCharStruct aBoundingBox;
- if ( GetFontBoundingBox(&aBoundingBox, &nAscent, &nDescent) )
- {
- pFontMetric->mnWidth = aBoundingBox.width;
- pFontMetric->mnAscent = aBoundingBox.ascent;
- pFontMetric->mnDescent = aBoundingBox.descent;
- pFontMetric->mnIntLeading = std::max(0, aBoundingBox.ascent - nAscent
- + aBoundingBox.descent - nDescent );
- pFontMetric->mnExtLeading = 0; // TODO!!!
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool
-ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- if( mpXlfd != pXlfd )
- return false;
-
- if( bVertical != mbVertical )
- return FALSE;
-
- if( rPixelSize.Height() != maPixelSize.Height() )
- return FALSE;
-
- long nReqWidth = rPixelSize.Width();
- if( !nReqWidth )
- nReqWidth = rPixelSize.Height();
- if( nReqWidth != maPixelSize.Width() )
- return FALSE;
-
- return true;
-}
-
-// Get an appropriate x-font that contains a glyph for the given unicode
-// code point.
-// This routine is designed to be called for each character in a text.
-// It first checks the given encoding to optimize for the fact that two
-// adjacent characters in a text most probably have the same encoding
-// In the first call initialize pEncodingInOut to dontknow, this causes
-// EncodingHasChar() to fail and thus bootstraps the encoding, otherwise
-// make sure that the initial value of pFontInOut matches the encoding and
-// that the encoding is valid for the font.
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( sal_Unicode nChar, rtl_TextEncoding *pEncoding )
-{
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
-
- if ( pCvt->EncodingHasChar(mnAsciiEncoding, nChar) )
- {
- *pEncoding = mnAsciiEncoding;
- return GetFontStruct (mnAsciiEncoding);
- }
- else
- if ( pCvt->EncodingHasChar(mnCachedEncoding, nChar) )
- {
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- else
- {
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- {
- rtl_TextEncoding nEnc = mpXlfd->GetEncoding(nIdx);
- if ( (nEnc != mnCachedEncoding) && (nEnc != mnAsciiEncoding)
- && pCvt->EncodingHasChar(nEnc, nChar))
- {
- mnCachedEncoding = nEnc;
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- }
- }
-
- *pEncoding = RTL_TEXTENCODING_DONTKNOW;
- return NULL;
-}
-
-// ---------------------------------------------------------------------------
-// utility functions to handle xfontstruct information, this is all to
-// calculate charwidth information
-// ---------------------------------------------------------------------------
-
-static bool
-CharExists( const XCharStruct* pChar )
-{
- if ( pChar == NULL )
- return false;
-
- return pChar->width
- || pChar->ascent || pChar->descent
- || pChar->lbearing || pChar->rbearing;
-}
-
-// this relies on non-null per_char information in the fontstruct
-static XCharStruct*
-GetCharinfo( const XFontStruct *pXFontStruct, sal_MultiByte nChar )
-{
- unsigned int nRow = nChar >> 8;
- unsigned int nCol = nChar & 0xFF;
-
- unsigned int nMinRow = pXFontStruct->min_byte1;
- unsigned int nMaxRow = pXFontStruct->max_byte1;
- unsigned int nMinCol = pXFontStruct->min_char_or_byte2;
- unsigned int nMaxCol = pXFontStruct->max_char_or_byte2;
-
- if ( nRow >= nMinRow && nRow <= nMaxRow
- && nCol >= nMinCol && nCol <= nMaxCol )
- {
- return &pXFontStruct->per_char[
- (nRow-nMinRow) * (nMaxCol-nMinCol+1) + (nCol-nMinCol) ];
- }
-
- return NULL;
-}
-
-static sal_Size
-QueryCharWidth16( Display* pDisplay, XLIB_Font nFontID, sal_MultiByte nChar,
- sal_Size nDefaultWidth )
-{
- int nDirection, nFontAscent, nFontDescent;
- XCharStruct aBoundingBox;
-
- XQueryTextExtents16( pDisplay, nFontID, (XChar2b*)&nChar, 1,
- &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox );
-
- return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth;
-}
-
-#if 0
-// currently not used
-static sal_Size
-QueryCharWidth8( XFontStruct* pXFontStruct, sal_Char nChar,
- sal_Size nDefaultWidth )
-{
- int nDirection, nFontAscent, nFontDescent;
- XCharStruct aBoundingBox;
-
- XTextExtents( pXFontStruct, &nChar, 1,
- &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox );
-
- return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth;
-}
-#endif
-
-sal_Size
-ExtendedFontStruct::GetDefaultWidth()
-{
- return (maPixelSize.Width() + 1) / 2;
-}
-
-// Handle single byte fonts which do not require conversion, this exploits
-// the fact that unicode equals latin1 or ansi1252 in the range [0..0xff] and
-// is compatible with iso8859-X at least in the range to 0x7f
-sal_Size
-ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, rtl_TextEncoding nEncoding )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( nEncoding );
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // fixed width font
- for ( int nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // variable width font
- int nMinChar = pXFontStruct->min_char_or_byte2;
- int nMaxChar = pXFontStruct->max_char_or_byte2;
-
- int nIdx = nFrom;
-
- for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]);
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- for ( ; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// Handle utf16 encoded fonts, which do not require conversion
-sal_Size
-ExtendedFontStruct::GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( RTL_TEXTENCODING_UNICODE );
- FontPitch nSpacing = mpXlfd->GetPitch( RTL_TEXTENCODING_UNICODE );
-
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( nSpacing == PITCH_VARIABLE
- && pXFontStruct->per_char == NULL)
- {
- // get per_char information from the server
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = QueryCharWidth16( mpDisplay, pXFontStruct->fid,
- nIdx, mnDefaultWidth );
- }
- else
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // really a fixed width font
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = GetCharinfo( pXFontStruct, nIdx );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// handle non unicode fonts that are converted into encoding matching the
-// font in fontstruct, 8 and 16 bit fonts are handled the same way
-sal_Size
-ExtendedFontStruct::GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, ExtendedFontStruct *pFallback )
-{
- if ( nFrom > nTo )
- return 0;
-
- sal_Char pBuffer[64];
-
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
- for ( sal_Int32 nIdx = nFrom ; nIdx <= nTo ; nIdx++, pWidthArray++ )
- {
- FontPitch nSpacing;
- sal_Size nSize;
- sal_Unicode nUniIdx = (sal_Unicode)nIdx;
-
- // get a matching fontstruct
- rtl_TextEncoding nEnc;
- XFontStruct *pFont;
-
- if ( (pFont = GetFontStruct(nUniIdx, &nEnc)) != NULL )
- {
- nSpacing = GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx, &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx = '?', &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- {
- // TODO What should the default value be?
- nSpacing = PITCH_FIXED;
- }
-
- if ( pFont )
- {
- nSize = pCvt->ConvertStringUTF16(&nUniIdx, 1, pBuffer, sizeof(pBuffer), nEnc);
- // XXX FIXME
- if ((nEnc == RTL_TEXTENCODING_GB_2312) || (nEnc == RTL_TEXTENCODING_EUC_KR))
- {
- for (unsigned int n_char = 0; n_char < nSize; n_char++ )
- pBuffer[ n_char ] &= 0x7F;
- }
- }
-
- // query font metrics
- if ( pFont && (nSize == 1 || nSize == 2) )
- {
- sal_MultiByte nChar = (nSize == 1) ? (unsigned char)pBuffer[0] :
- ((sal_MultiByte)pBuffer[0] << 8) + (sal_MultiByte)pBuffer[1];
-
- if ( nSpacing == PITCH_VARIABLE
- && pFont->per_char == NULL)
- {
- // get per_char information from the x-server
- *pWidthArray = QueryCharWidth16( mpDisplay, pFont->fid,
- nChar, mnDefaultWidth );
- }
- else
- if ( (pFont->max_bounds.width == pFont->min_bounds.width)
- || (pFont->per_char == NULL) )
- {
- // fixed width font
- *pWidthArray = pFont->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- XCharStruct* pChar = GetCharinfo( pFont, nChar );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
- else
- {
- // conversion error
- *pWidthArray = mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-sal_Size
-ExtendedFontStruct::GetCharWidth( sal_Unicode cChar, sal_Int32 *pPhysicalWidth,
- sal_Int32 *pLogicalWidth )
-{
- sal_Size nConverted = 0;
-
- // dispatch querying of metrics to most promising encoding candidate
- int nAsciiRange;
- rtl_TextEncoding nEncoding = mpXlfd->GetAsciiEncoding(&nAsciiRange);
- if ( nEncoding == RTL_TEXTENCODING_UNICODE )
- {
- // if we have a unicode encoded system font than we get the charwidth
- // straight forward
- nConverted = GetCharWidthUTF16( cChar, cChar, pPhysicalWidth );
- }
- else
- {
- if ( cChar < nAsciiRange )
- {
- // optimize the most frequent case, requesting only the latin1
- // chars which are mappable to a single encoding
- nConverted = GetCharWidth8( cChar, cChar, pPhysicalWidth, nEncoding );
- }
-
- // if further requests are pending, then the according unicode
- // codepoint has to be dispatched to one of the system fonts and
- // converted to this fonts encoding
- nConverted += GetCharWidth16( cChar + nConverted, cChar,
- pPhysicalWidth + nConverted, NULL );
- }
-
- // convert physical width to logical width, apply correction factor if needed
- *pLogicalWidth = *pPhysicalWidth;
- if( mfXScale != 1.0 )
- *pLogicalWidth = sal_Int32(*pLogicalWidth * mfXScale);
-
- return nConverted;
-}
-
-bool ExtendedFontStruct::HasUnicodeChar( sal_Unicode cChar ) const
-{
- // #i18818# return false if there are no known encodings
- if( !mnRangeCount )
- return false;
-
- // init unicode range cache if needed
- if( mnRangeCount < 0 )
- {
- mnRangeCount = mpXlfd->GetFontCodeRanges( NULL );
- if( !mnRangeCount )
- return false;
- mpRangeCodes = new sal_uInt32[ 2*mnRangeCount ];
- mpXlfd->GetFontCodeRanges( mpRangeCodes );
- // TODO: make sure everything is sorted
- }
-
- // binary search in unicode ranges
- int nLower = 0;
- int nMid = mnRangeCount;
- int nUpper = 2 * mnRangeCount - 1;
- while( nLower < nUpper )
- {
- if( cChar >= mpRangeCodes[ nMid ] )
- nLower = nMid;
- else
- nUpper = nMid - 1;
- nMid = (nLower + nUpper + 1) / 2;
- }
- if( (nMid == 0) && (cChar < mpRangeCodes[0]) )
- return false;
- return (nMid & 1) ? false: true;
-}
-
-int ExtendedFontStruct::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- // make sure unicode range cache is initialized
- HasUnicodeChar(0);
-
- // transfer range pairs if requested
- if( pCodePairs )
- {
- for( int i = 0; i < 2*mnRangeCount; ++i )
- pCodePairs[i] = mpRangeCodes[i];
- }
-
- return mnRangeCount;
-}
-
-// =======================================================================
-
-X11FontLayout::X11FontLayout( ExtendedFontStruct& rFont )
-: mrFont( rFont )
-{}
-
-// -----------------------------------------------------------------------
-
-bool X11FontLayout::LayoutText( ImplLayoutArgs& rArgs )
-{
- Point aNewPos( 0, 0 );
- bool bRightToLeft;
- int nCharPos;
-
- for( nCharPos = -1; rArgs.GetNextPos( &nCharPos, &bRightToLeft ); )
- {
- sal_UCS4 cChar = rArgs.mpStr[ nCharPos ];
- if( bRightToLeft )
- cChar = GetMirroredChar( cChar );
- int nGlyphIndex = cChar | GF_ISCHAR;
-
- // check if the font supports the char
- if( !mrFont.HasUnicodeChar( cChar ) )
- {
- // try to replace the failing char using the same font
- const char* pApproxUTF8 = GetAutofallback( cChar );
- cChar = 0;
- if( pApproxUTF8 )
- {
- String aApproxStr( pApproxUTF8, RTL_TEXTENCODING_UTF8 );
- if( aApproxStr.Len() == 1 )
- {
- // TODO: support Autofallback for len>1
- sal_Unicode cApprox = aApproxStr.GetChar( 0 );
- if( mrFont.HasUnicodeChar( cApprox ) )
- nGlyphIndex = (cChar = cApprox) | GF_ISCHAR;
- }
- }
- // request fallback glyph if necessary
- if( !cChar )
- {
- rArgs.NeedFallback( nCharPos, bRightToLeft );
- if( rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK )
- nGlyphIndex = 0; // drop NotDef fallback glyphs
- }
- }
-
- sal_Int32 nPhysGlyphWidth, nLogGlyphWidth;
- mrFont.GetCharWidth( cChar, &nPhysGlyphWidth, &nLogGlyphWidth );
- int nGlyphFlags = (nPhysGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER;
- if( bRightToLeft )
- nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nPhysGlyphWidth );
- aGI.mnNewWidth = nLogGlyphWidth;
- AppendGlyph( aGI );
-
- aNewPos.X() += nLogGlyphWidth;
- }
-
- return (nCharPos >= 0);
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
-{
- GenericSalLayout::AdjustLayout( rArgs );
- SetOrientation( 0 ); // X11 fonts are to be rotated in upper layers
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::DrawText( SalGraphics& rSalGraphics ) const
-{
- static const int MAXGLYPHS = 160;
- int nMaxGlyphs = GetOrientation() ? 1 : MAXGLYPHS;
-
- // workaround for #i49902# similar to #b6228733 with XDrawText items
- // => output each item separately for non-unicode font encodings!
- // this is done here instead of in DrawStringUCS2MB() because
- // it needs the item positions and they are easily available here
- if( mrFont.GetAsciiEncoding() != RTL_TEXTENCODING_UNICODE )
- nMaxGlyphs = 1;
-
- Point aPos;
- sal_GlyphId aGlyphAry[ MAXGLYPHS ];
- sal_Unicode pStr[ MAXGLYPHS ];
- for( int nStart=0;;)
- {
- int nGlyphCount = GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart );
- if( !nGlyphCount )
- break;
-
- for( int i = 0; i < nGlyphCount; ++i )
- pStr[ i ] = aGlyphAry[ i ] & GF_IDXMASK;
-
- static_cast<X11SalGraphics&>(rSalGraphics).DrawStringUCS2MB( mrFont, aPos, pStr, nGlyphCount );
- }
-}
-
-// =======================================================================
diff --git a/vcl/unx/source/gdi/xlfd_attr.cxx b/vcl/unx/source/gdi/xlfd_attr.cxx
deleted file mode 100644
index ca49a8548afb..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.cxx
+++ /dev/null
@@ -1,686 +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_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sal/alloca.h>
-#include "xlfd_attr.hxx"
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute is a container for simple name value pairs
-// eg. ( "times", FAMILY_ROMAN ) or ( "demi bold", WEIGHT_SEMIBOLD )
-// enriched with an annotation which is a pretty-printed version of the
-// string, i.e. "itc avant garde" would get an annotation of "Itc Avant Garde"
-//
-//
-// ---------------------------------------------------------------------------
-
-// release the stored string
-void
-Attribute::Release()
-{
- if ( mpAnnotation != NULL )
- delete mpAnnotation;
- if ( mpKeyName != NULL )
- delete mpKeyName;
- if ( mpName != NULL )
- free( (void*)mpName );
-}
-
-// get a private copy of the given argument
-void
-Attribute::SetName( const char *p, int nLen )
-{
- mpName = (char*)malloc( nLen + 1 );
- mnLength = nLen;
- memcpy( (void*)mpName, p, mnLength );
- ((char*)mpName)[ mnLength ] = '\0';
-}
-
-// Compare whether two strings a equal for the first nLen bytes
-// i.e. arial == arialnarrow
-int
-Attribute::Compare( const char *p, int nLen )
-{
- return strncmp( mpName, p, nLen );
-}
-
-// Get a all lowercase name with all blanks removed
-const rtl::OString&
-Attribute::GetKey ()
-{
- static rtl::OString aEmptyStr;
-
- if (mpKeyName != NULL)
- return *mpKeyName;
- if (mnLength == 0)
- return aEmptyStr;
-
- sal_Char* pBuffer = (sal_Char*)alloca (mnLength);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < mnLength; i++)
- {
- if ( mpName[i] != ' ' )
- pBuffer[j++] = mpName[i];
- }
- mpKeyName = new rtl::OString(pBuffer, j);
-
- return *mpKeyName;
-}
-
-void
-Attribute::InitKey ()
-{
- mpKeyName = NULL;
-}
-
-// Compare two strings, they have to be equal for nLen bytes, after nLen
-// bytes both strings have to be terminated either by '\0' or by '-'
-// this is for comparing a string being a substring in a Xlfd with a
-// zeroterminated string
-Bool
-Attribute::ExactMatch( const char *p, int nLen )
-{
- Bool bMatch;
- if ( nLen > 0 )
- bMatch = Compare( p, nLen ) == 0;
- else
- bMatch = True;
- if ( bMatch )
- {
- char c1 = p[ nLen ];
- char c2 = mpName[ nLen ];
- bMatch = (c1 == '-' || c1 == '\0') && (c2 == '-' || c2 == '\0');
- }
-
- return bMatch;
-}
-
-void
-Attribute::TagFeature( unsigned short nFeature )
-{
- if ( (nFeature & XLFD_FEATURE_NARROW)
- && (strstr(mpName, "narrow") != NULL) )
- {
- mnFeature |= XLFD_FEATURE_NARROW;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_CURSOR)
- && (strcmp(mpName, "open look cursor") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_CURSOR;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_GLYPH)
- && (strcmp(mpName, "open look glyph") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_GLYPH;
- }
-
- if ( (nFeature & XLFD_FEATURE_APPLICATION_FONT)
- && ( (strcmp(mpName, "interface user") == 0)
- || (strcmp(mpName, "interface system") == 0)))
- {
- mnFeature |= XLFD_FEATURE_APPLICATION_FONT;
- }
-
- if (nFeature & XLFD_FEATURE_INTERFACE_FONT)
- {
- // european
- if (strcmp(mpName, "arial") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ | XLFD_FEATURE_MQ);
- else
- if (strcmp(mpName, "helvetica") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ);
- else
- if ( (strcmp(mpName, "lucidux sans") == 0)
- || (strcmp(mpName, "luxi sans") == 0))
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ | XLFD_FEATURE_LQ);
- else
- if (strcmp(mpName, "charter") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ);
- else
- // japanese
- if ( (strcmp(mpName, "hg mincho l") == 0) /* Solaris: jisx0208 jisx0201 */
- || (strcmp(mpName, "heiseimin") == 0) /* Solaris: jisx0212 */
- || (strcmp(mpName, "minchol") == 0) /* TurboLinux */
- || (strcmp(mpName, "mincho") == 0)) /* Redhat 6.2 JP */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // chinese
- if ( (strcmp(mpName, "kai") == 0) /* Solaris */
- || (strcmp(mpName, "ar pl mingti2l big5") == 0)) /* TurboLinux */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // korean
- if ( (strcmp(mpName, "myeongjo") == 0)) /* Solaris */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- }
-
- if ( nFeature & XLFD_FEATURE_REDUNDANTSTYLE )
- {
- switch ( mpName[0] )
- {
- case '\0':
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'b':
- if ( (strcmp(mpName, "bold") == 0)
- || (strcmp(mpName, "bold italic") == 0)
- || (strcmp(mpName, "bold sans") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'd':
- if ( (strcmp(mpName, "demi") == 0)
- || (strcmp(mpName, "demi italic") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'i':
- if ( strcmp(mpName, "italic") == 0 )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 's':
- if ( (strcmp(mpName, "sans") == 0)
- || (strcmp(mpName, "serif") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
- }
- }
-}
-
-// given Attribute classifications, strings have to be in alphabetical
-// order, since they are treated by binary search algorithm
-
-#define InitializeAttributeWith( p, a ) p, sizeof(p) - 1, a, 0, NULL, NULL
-#define MembersOf( p ) (sizeof(p) / sizeof(p[0]) )
-
-const Attribute pFamilyAttribute[] = {
- { InitializeAttributeWith( "arial", FAMILY_SWISS ) },
- { InitializeAttributeWith( "arioso", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "avant garde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "avantgarde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "bembo", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "bookman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "conga", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "courier", FAMILY_MODERN ) },
- { InitializeAttributeWith( "curl", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "fixed", FAMILY_MODERN ) },
- { InitializeAttributeWith( "gill", FAMILY_SWISS ) },
- { InitializeAttributeWith( "helmet", FAMILY_MODERN ) },
- { InitializeAttributeWith( "helvetica", FAMILY_SWISS ) },
- { InitializeAttributeWith( "international", FAMILY_MODERN ) },
- { InitializeAttributeWith( "lucida", FAMILY_SWISS ) },
- { InitializeAttributeWith( "new century schoolbook", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "palatino", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "roman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "sans serif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "sansserif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "serf", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "serif", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "times", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "utopia", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "zapf chancery", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "zapfchancery", FAMILY_SCRIPT ) }
-};
-
-const Attribute pWeightAttribute[] = {
- { InitializeAttributeWith( "black", WEIGHT_BLACK ) },
- { InitializeAttributeWith( "bold", WEIGHT_BOLD ) },
- { InitializeAttributeWith( "book", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "demi", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demi bold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demibold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "light", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "medium", WEIGHT_MEDIUM ) },
- { InitializeAttributeWith( "normal", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "regular", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "roman", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "ultrabold", WEIGHT_ULTRABOLD ) }
-};
-
-const Attribute pSlantAttribute[] = {
- { InitializeAttributeWith( "i", ITALIC_NORMAL ) },
- { InitializeAttributeWith( "o", ITALIC_OBLIQUE ) },
- { InitializeAttributeWith( "r", ITALIC_NONE ) }
-};
-
-const Attribute pSetwidthAttribute[] = {
- { InitializeAttributeWith( "bold", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "condensed", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "double wide", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "expanded", WIDTH_EXPANDED ) },
- { InitializeAttributeWith( "extracondensed", WIDTH_EXTRA_CONDENSED ) },
- { InitializeAttributeWith( "extraexpanded", WIDTH_EXTRA_EXPANDED ) },
- { InitializeAttributeWith( "medium", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "narrow", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "normal", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WIDTH_SEMI_CONDENSED ) },
- { InitializeAttributeWith( "semiexpanded", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "ultracondensed", WIDTH_ULTRA_CONDENSED ) },
- { InitializeAttributeWith( "ultraexpanded", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "wide", WIDTH_EXPANDED ) }
-};
-
-const Attribute pEnhancedCharsetAttribute[] = {
- { InitializeAttributeWith( "iso8859-1", RTL_TEXTENCODING_MS_1252 ) },
- { InitializeAttributeWith( "iso8859_1", RTL_TEXTENCODING_MS_1252 ) }
-};
-
-// -------------------------------------------------------------------------
-//
-// String handling utility functions
-//
-// -------------------------------------------------------------------------
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString )
-{
- if ( pAttribute == NULL )
- return ;
-
- int nLength = pAttribute->GetLength();
- char *pBuffer = (char*)alloca( nLength + 1);
-
- pBuffer[ 0 ] = '-';
- memcpy( pBuffer + 1, pAttribute->GetName(), nLength );
- rString.Append( pBuffer, nLength + 1);
-}
-
-//
-// Prettify the font name: make each leading character of a fontname
-// uppercase. For example
-// times new roman -> Times New Roman
-//
-
-static void
-ToUpper( char *pCharacter )
-{
- // replace [a,z] with [A,Z]
- if ( (*pCharacter >= 97) && (*pCharacter <= 122) )
- *pCharacter -= 32;
-}
-
-static String*
-Capitalize( const char *pStr, int nLength )
-{
- char *pCopy = (char*)alloca( nLength + 1 );
- char *pPtr = pCopy;
- memcpy( pPtr, pStr, nLength + 1 );
-
- // loop over string data and uppercase first char and all chars
- // following a space (other white space would be unexpected here)
- char nPreviousChar = ' ';
- while ( *pPtr )
- {
- if ( nPreviousChar == ' ' )
- ToUpper( pPtr );
- nPreviousChar = *pPtr++;
- }
-
- return new String( pCopy, RTL_TEXTENCODING_ISO_8859_1 );
-}
-
-String*
-AnnotateString( const Attribute& rAttribute )
-{
- return Capitalize(rAttribute.GetName(), rAttribute.GetLength());
-}
-
-String*
-AnnotateSlant( const Attribute& rAttribute )
-{
- const char* pStr = rAttribute.GetName();
- int nLen = rAttribute.GetLength();
-
- static const struct {
- const char *pFrom; const char *pTo;
- } pTranslation[] = {
- { "r", "Roman" },
- { "o", "Oblique" },
- { "i", "Italic" },
- { "ri", "Reverse Italic" },
- { "ro", "Reverse Oblique" },
- { "ot", "Other" }
- };
-
- for ( unsigned int i = 0; i < MembersOf(pTranslation); i++ )
- if ( strcmp(pStr, pTranslation[i].pFrom) == 0 )
- {
- return new String( pTranslation[i].pTo,
- RTL_TEXTENCODING_ISO_8859_1 );
- }
-
- return Capitalize(pStr, nLen);
-}
-
-String*
-AnnotateNone( const Attribute& )
-{
- return new String();
-}
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeStorage::AttributeStorage( unsigned short nDefaultValue ) :
- mpList( NULL ),
- mnSize( 0 ),
- mnCount( 0 ),
- mnLastmatch( 0 ),
- mnDefaultValue( nDefaultValue )
-{
-}
-
-AttributeStorage::~AttributeStorage()
-{
- if ( mpList != NULL )
- {
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].Release();
- free( mpList );
- }
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeStorage::Dump()
-{
- fprintf(stderr, "AttributeStorage: size=%i, used=%i\n", mnSize, mnCount);
- for ( int i = 0; i < mnCount; i++ )
- {
- ByteString aAnnotation = ByteString(
- mpList[i].GetAnnotation(),
- RTL_TEXTENCODING_ISO_8859_1 );
- fprintf(stderr, "\t%4i: <%s><len=%i><val=%i><%s>\n", i, mpList[i].GetName(),
- mpList[i].GetLength(), mpList[i].GetValue(),
- aAnnotation.GetBuffer() );
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-Attribute*
-AttributeStorage::Retrieve( unsigned short nIndex ) const
-{
- return nIndex < mnCount ? &mpList[ nIndex ] : (Attribute*)NULL ;
-}
-
-// pClassification contains a list of name-value pairs. If names in
-// the AttributeStorage match those in the pClassification then
-// the according value is copied. Matching means match for the length
-// of the string in pClassification (i.e. arial matches arialnarrow)
-// the strings in pClassification must be in alphabetical order, all
-// strings Lowercase
-void
-AttributeStorage::AddClassification( Attribute *pClassification,
- unsigned short nNum )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- unsigned int nLower = 0;
- unsigned int nUpper = nNum;
- unsigned int nCurrent;
- int nComparison = 1;
- Attribute *pHaystack = 0, *pNeedle;
-
- pNeedle = &mpList[ i ];
-
- // binary search
- while ( nLower < nUpper )
- {
- nCurrent = (nLower + nUpper) / 2;
- pHaystack = &pClassification[ nCurrent ];
- nComparison = pNeedle->Compare( pHaystack->GetName(),
- pHaystack->GetLength() );
- if (nComparison < 0)
- nUpper = nCurrent;
- else
- if (nComparison > 0)
- nLower = nCurrent + 1;
- else
- break;
- }
-
- // if there's a match store the according classification in the
- // Attribute storage, otherwise do nothing since defaults are
- // already provided in AttributeStorage::Insert()
- if ( nComparison == 0 )
- pNeedle->SetValue( pHaystack->GetValue() );
- }
-}
-
-void
-AttributeStorage::AddClassification( AttributeClassifierT Classify )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- Attribute& rCurrent = mpList[i] ;
- int nValue = Classify( rCurrent.GetName() );
- rCurrent.SetValue( nValue );
- }
-}
-
-void
-AttributeStorage::AddAnnotation( AttributeAnnotatorT Annotate )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- String* pAnnotation = Annotate( mpList[i] );
- mpList[i].SetAnnotation( pAnnotation );
- }
-}
-
-void
-AttributeStorage::TagFeature( unsigned short nFeature )
-{
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].TagFeature( nFeature );
-}
-
-// Enlarge the list of Attributes
-void
-AttributeStorage::Enlarge()
-{
- if ( mnSize == 0 )
- {
- mnSize = 8;
- mpList = (Attribute*) malloc( mnSize * sizeof(Attribute) );
- }
- else
- {
- mnSize = mnSize < 32768 ? (mnSize * 2) : 65535;
- mpList = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) );
- }
-}
-
-// nLength is the length as it would be reported by strlen(3)
-// for an null-terminated string. if a string is part of a Xlfd
-// the field separator '-' is taken as '\0'
-// the AttributeStorage itself is NOT sorted to make sure that the
-// leased keys are still valid
-unsigned short
-AttributeStorage::Insert( const char *pString, int nLength )
-{
- // check whether the last match is still equal to the current
- // string since XListFonts lists fonts in sets of similar fontnames
- if ( mnLastmatch < mnCount )
- {
- if ( mpList[mnLastmatch].ExactMatch(pString, nLength) )
- return mnLastmatch;
- }
-
- // otherwise search in list
- for ( int i = 0; i < mnCount; i++ )
- {
- if ( mpList[i].ExactMatch(pString, nLength) )
- return mnLastmatch = i;
- }
-
- // if still not found we have to Insert the new string
- if ( mnSize == mnCount )
- Enlarge();
- mpList[mnCount].SetName( pString, nLength );
- mpList[mnCount].SetValue( mnDefaultValue );
- mpList[mnCount].SetAnnotation( NULL );
- mpList[mnCount].SetFeature( XLFD_FEATURE_NONE );
- mpList[mnCount].InitKey( );
- mnLastmatch = mnCount;
- mnCount = mnCount < 65535 ? mnCount + 1 : mnCount;
-
- return mnLastmatch;
-}
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages.
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeProvider::AttributeProvider ()
-{
- mpField[eXLFDFoundry ] = new AttributeStorage(0);
- mpField[eXLFDFamilyName ] = new AttributeStorage(FAMILY_DONTKNOW);
- mpField[eXLFDWeightName ] = new AttributeStorage(WEIGHT_NORMAL);
- mpField[eXLFDSlant ] = new AttributeStorage(ITALIC_NONE);
- mpField[eXLFDSetwidthName] = new AttributeStorage(WIDTH_NORMAL);
- mpField[eXLFDAddstyleName] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
- mpField[eXLFDCharset ] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
-}
-
-AttributeProvider::~AttributeProvider()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- delete mpField[ i ];
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeProvider::Dump()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- mpField[ i ]->Dump();
-}
-#endif
-
-extern "C" rtl_TextEncoding
-GetTextEncodingFromAddStylename( const sal_Char *pAddStylename )
-{
- int nBufferLength = strlen( pAddStylename ) + 1;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferLength );
- for ( int i = 0; i < nBufferLength; i++ )
- pBuffer[i] = pAddStylename[i] == '_' ? '-' : pAddStylename[i] ;
-
- return rtl_getTextEncodingFromUnixCharset( pBuffer );
-}
-
-
-// classification information is needed before sorting because of course the
-// classification is the sort criteria
-void
-AttributeProvider::AddClassification()
-{
- /* mpField[ eXLFDFoundry ] doesn't need classification */
- mpField[ eXLFDFamilyName ]->AddClassification(
- (Attribute*)pFamilyAttribute,
- MembersOf(pFamilyAttribute) );
- mpField[ eXLFDWeightName ]->AddClassification(
- (Attribute*)pWeightAttribute,
- MembersOf(pWeightAttribute) );
- mpField[ eXLFDSlant ]->AddClassification(
- (Attribute*)pSlantAttribute,
- MembersOf(pSlantAttribute) );
- mpField[ eXLFDSetwidthName ]->AddClassification(
- (Attribute*)pSetwidthAttribute,
- MembersOf(pSetwidthAttribute) );
- mpField[ eXLFDAddstyleName ]->AddClassification(
- GetTextEncodingFromAddStylename );
- mpField[ eXLFDCharset ]->AddClassification(
- rtl_getTextEncodingFromUnixCharset );
-}
-
-// add some pretty print description
-void
-AttributeProvider::AddAnnotation()
-{
- mpField[ eXLFDFoundry ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDFamilyName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDWeightName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDSlant ]->AddAnnotation( AnnotateSlant );
- mpField[ eXLFDSetwidthName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDAddstyleName ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDCharset ]->AddAnnotation( AnnotateNone );
-}
-
-// this is the misc or any section: dirty hacks for dirty xlfd usage
-void
-AttributeProvider::TagFeature()
-{
- mpField[ eXLFDFamilyName ]->TagFeature(
- XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR
- | XLFD_FEATURE_NARROW
- | XLFD_FEATURE_INTERFACE_FONT
- | XLFD_FEATURE_APPLICATION_FONT);
-
- mpField[ eXLFDSetwidthName ]->TagFeature(
- XLFD_FEATURE_NARROW );
-
- mpField[ eXLFDAddstyleName ]->TagFeature(
- XLFD_FEATURE_REDUNDANTSTYLE );
-}
-
diff --git a/vcl/unx/source/gdi/xlfd_attr.hxx b/vcl/unx/source/gdi/xlfd_attr.hxx
deleted file mode 100644
index b721310da506..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.hxx
+++ /dev/null
@@ -1,228 +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 XLFD_ATTRIBUTE_HXX
-#define XLFD_ATTRIBUTE_HXX
-
-#include <salunx.h>
-#include <tools/string.hxx>
-
-
-struct Attribute {
-
- const char* mpName;
- unsigned short mnLength;
- unsigned short mnValue;
- unsigned short mnFeature;
- String* mpAnnotation;
- rtl::OString* mpKeyName;
-
- const char* GetName() const
- { return mpName; }
- unsigned short GetValue() const
- { return mnValue; }
- unsigned short GetLength() const
- { return mnLength; }
- Bool HasFeature( unsigned short nFeature ) const
- { return ((mnFeature & nFeature) != 0); }
- const String &GetAnnotation() const
- { return *mpAnnotation; }
- const rtl::OString&
- GetKey();
- void InitKey();
-
- void SetName( const char *p, int nLen );
- void SetValue( unsigned short nIn )
- { mnValue = nIn; }
- void SetAnnotation( String *pString )
- { mpAnnotation = pString; }
- void SetFeature( unsigned short nFeature )
- { mnFeature = nFeature; }
- void TagFeature( unsigned short nFeature );
-
- int Compare( const char *p, int nLen );
- Bool ExactMatch( const char *p, int nLen );
- void Release();
-};
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString );
-
-
-typedef String*(*AttributeAnnotatorT)(const Attribute &rAttribute);
-extern "C" {
-typedef rtl_TextEncoding(*AttributeClassifierT)(const char* pStr);
-}
-
-#define XLFD_FEATURE_NONE 0x0000
-#define XLFD_FEATURE_NARROW 0x0001
-#define XLFD_FEATURE_OL_GLYPH 0x0002
-#define XLFD_FEATURE_OL_CURSOR 0x0004
-#define XLFD_FEATURE_REDUNDANTSTYLE 0x0008
-#define XLFD_FEATURE_APPLICATION_FONT 0x0010
-
-#define XLFD_FEATURE_INTERFACE_FONT 0x0020
-#define XLFD_FEATURE_LQ 0x0040
-#define XLFD_FEATURE_MQ 0x0080
-#define XLFD_FEATURE_HQ 0x0100
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-class AttributeStorage {
-
- private:
-
- Attribute* mpList;
- unsigned short mnSize;
- unsigned short mnCount;
- unsigned short mnLastmatch;
- unsigned short mnDefaultValue;
-
- void Enlarge();
- AttributeStorage();
-
- public:
-
- AttributeStorage( unsigned short nDefaultValue );
- ~AttributeStorage();
- unsigned short Insert( const char *pString, int nLength );
- Attribute* Retrieve( unsigned short nIndex ) const ;
- void AddClassification( Attribute *pClassification,
- unsigned short nNum );
- void AddClassification( AttributeClassifierT Classify );
- void TagFeature( unsigned short nFeature );
- void AddAnnotation( AttributeAnnotatorT Annotate );
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-};
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages. For XLFD
-// interpretation and efficient storage, AttributeStorages for foundry,
-// family_name, weight_name, slant, setwidth_name, add_style_name and combined
-// charset_registry and charset_encoding are used. pixel_size, point_size,
-// resolution_x and resolution_y are stored as numbers. please note that this
-// does not allow storage of matrix-enhanced fonts. spacing is stored as
-// a char, since only the 'm', 'c' and 'p' types are defined.
-//
-//
-// ---------------------------------------------------------------------------
-
-enum eXLFDAttributeT {
- eXLFDFoundry = 0,
- eXLFDFamilyName,
- eXLFDWeightName,
- eXLFDSlant,
- eXLFDSetwidthName,
- eXLFDAddstyleName,
- eXLFDCharset,
- eXLFDMaxEntry
-};
-
-class AttributeProvider {
-
- private:
-
- AttributeStorage* mpField[ eXLFDMaxEntry ];
-
- AttributeStorage* GetField( eXLFDAttributeT eXLFDField )
- { return mpField[ eXLFDField]; }
- public:
-
- AttributeProvider ();
- ~AttributeProvider ();
-
- void AddClassification();
- void AddAnnotation();
- void TagFeature();
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-
- // these are just shortcuts or proxies for the most common used
- // AttributeStorage functionality
- AttributeStorage* GetFoundry()
- { return GetField(eXLFDFoundry); }
- AttributeStorage* GetFamily()
- { return GetField(eXLFDFamilyName); }
- AttributeStorage* GetWeight()
- { return GetField(eXLFDWeightName); }
- AttributeStorage* GetSlant()
- { return GetField(eXLFDSlant); }
- AttributeStorage* GetSetwidth()
- { return GetField(eXLFDSetwidthName); }
- AttributeStorage* GetAddstyle()
- { return GetField(eXLFDAddstyleName); }
- AttributeStorage* GetCharset()
- { return GetField(eXLFDCharset); }
-
- Attribute* RetrieveFoundry( unsigned short nIndex )
- { return GetFoundry()->Retrieve(nIndex); }
- Attribute* RetrieveFamily( unsigned short nIndex )
- { return GetFamily()->Retrieve(nIndex); }
- Attribute* RetrieveWeight( unsigned short nIndex )
- { return GetWeight()->Retrieve(nIndex); }
- Attribute* RetrieveSlant( unsigned short nIndex )
- { return GetSlant()->Retrieve(nIndex); }
- Attribute* RetrieveSetwidth( unsigned short nIndex )
- { return GetSetwidth()->Retrieve(nIndex); }
- Attribute* RetrieveAddstyle( unsigned short nIndex )
- { return GetAddstyle()->Retrieve(nIndex); }
- Attribute* RetrieveCharset( unsigned short nIndex )
- { return GetCharset()->Retrieve(nIndex); }
-
- unsigned short InsertFoundry( const char *pString, int nLength )
- { return GetFoundry()->Insert(pString, nLength); }
- unsigned short InsertFamily( const char *pString, int nLength )
- { return GetFamily()->Insert(pString, nLength); }
- unsigned short InsertWeight( const char *pString, int nLength )
- { return GetWeight()->Insert(pString, nLength); }
- unsigned short InsertSlant( const char *pString, int nLength )
- { return GetSlant()->Insert(pString, nLength); }
- unsigned short InsertSetwidth( const char *pString, int nLength )
- { return GetSetwidth()->Insert(pString, nLength);}
- unsigned short InsertAddstyle( const char *pString, int nLength )
- { return GetAddstyle()->Insert(pString, nLength);}
- unsigned short InsertCharset( const char *pString, int nLength )
- { return GetCharset()->Insert(pString, nLength); }
-};
-
-#endif /* XLFD_ATTRIBUTE_HXX */
-
diff --git a/vcl/unx/source/gdi/xlfd_extd.cxx b/vcl/unx/source/gdi/xlfd_extd.cxx
deleted file mode 100644
index 73731eddf115..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.cxx
+++ /dev/null
@@ -1,1001 +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_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
-#include <vcl/outfont.hxx>
-#include <rtl/alloc.h>
-
-#ifndef _RTL_TENCINFO_H_
-#include <rtl/tencinfo.h>
-#endif
-
-#include <set>
-
-// --------------------------------------------------------------------------
-
-ImplX11FontData::ImplX11FontData( const ExtendedXlfd& rXlfd, int nHeight )
-: ImplFontData( rXlfd, X11IFD_MAGIC ),
- mrXlfd( rXlfd )
-{
- mnHeight = nHeight;
- mnWidth = 0;
-}
-
-ImplFontEntry* ImplX11FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const
-{
- ImplFontEntry* pEntry = new ImplFontEntry( rFSD );
- return pEntry;
-}
-
-sal_IntPtr ImplX11FontData::GetFontId() const
-{
- return reinterpret_cast<sal_IntPtr>(&mrXlfd);
-}
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- X -p- X )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-ExtendedXlfd::EncodingInfo&
-ExtendedXlfd::EncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mcSpacing = pXlfd->mcSpacing;
- mnResolutionX = pXlfd->mnResolutionX;
- mnResolutionY = pXlfd->mnResolutionY;
- mnAddstyle = pXlfd->mnAddstyle;
- mnCharset = pXlfd->mnCharset;
- mnEncoding = pXlfd->GetEncoding();
-
- return *this;
-}
-
-// ------ base class --------------------------------------------------------
-
-ExtendedXlfd::ExtendedXlfd( bool bScalable )
-: mbScalable( bScalable ),
- mnEncodings( 0 ),
- mnEncCapacity( 0 ),
- mpEncodingInfo( NULL )
-{
- mbOrientation = false;
- mbDevice = false;
- mbSubsettable = false;
- mbEmbeddable = false;
-
- mnQuality = -1;
-}
-
-ExtendedXlfd::~ExtendedXlfd()
-{
- if ( mnEncodings != 0 )
- rtl_freeMemory( mpEncodingInfo );
-}
-
-inline void*
-Realloc( void *pPtr, sal_Size nSize )
-{
- return rtl_reallocateMemory( pPtr, nSize );
-}
-
-int
-ExtendedXlfd::GetEncodingIdx( rtl_TextEncoding nEncoding ) const
-{
- for ( int i = 0; i < mnEncodings; i++ )
- if ( nEncoding == mpEncodingInfo[i].mnEncoding )
- return i;
- return -1;
-}
-
-bool
-ExtendedXlfd::HasEncoding( rtl_TextEncoding nEncoding ) const
-{
- return !(GetEncodingIdx( nEncoding ) < 0) ;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding( int i ) const
-{
- if ( i < mnEncodings && i >= 0 )
- return mpEncodingInfo[i].mnEncoding;
-
- return RTL_TEXTENCODING_DONTKNOW;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding() const
-{
- return mnEncodings == 1 ? mpEncodingInfo[0].mnEncoding : RTL_TEXTENCODING_DONTKNOW;
-}
-
-// query the most unicode / Ascii compatible font: either one of the fonts
-// is utf16 encoded or there's a single byte font which is unicode
-// compatible for the first 256 chars (latin1) or for at least 128
-// chars (most latin-X encodings, cyrillic encodings)
-rtl_TextEncoding
-ExtendedXlfd::GetAsciiEncoding( int *pAsciiRange ) const
-{
- rtl_TextEncoding nBestEncoding = RTL_TEXTENCODING_DONTKNOW;
- int nLargestRange = 0x0000;
-
- for ( int i = 0; i < mnEncodings && nLargestRange < 0xffff; i++ )
- {
- rtl_TextEncoding nCurEncoding = mpEncodingInfo[i].mnEncoding;
- switch ( nCurEncoding )
- {
- case RTL_TEXTENCODING_UNICODE:
- nLargestRange = 0xffff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- nLargestRange = 0x00ff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_2:
- case RTL_TEXTENCODING_ISO_8859_4:
- case RTL_TEXTENCODING_ISO_8859_5:
- case RTL_TEXTENCODING_ISO_8859_6:
- case RTL_TEXTENCODING_ISO_8859_7:
- case RTL_TEXTENCODING_ISO_8859_8:
- case RTL_TEXTENCODING_ISO_8859_9:
- case RTL_TEXTENCODING_ISO_8859_13:
- case RTL_TEXTENCODING_ISO_8859_15:
- case RTL_TEXTENCODING_MS_1251:
- case RTL_TEXTENCODING_KOI8_R:
- case RTL_TEXTENCODING_JIS_X_0201:
- if ( nLargestRange < 0x0080 )
- {
- nLargestRange = 0x0080;
- nBestEncoding = nCurEncoding;
- }
- break;
-
- default:
- if ( nLargestRange == 0x0000 )
- {
- nBestEncoding = nCurEncoding;
- }
- break;
- }
- }
-
- if ( pAsciiRange != NULL )
- *pAsciiRange = nLargestRange;
-
- return nBestEncoding;
-}
-
-bool
-ExtendedXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- if ( HasEncoding(nEncoding) )
- return false;
-
- if ( mnEncodings == 0 )
- {
- // bootstrap
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
- mpFactory = pXlfd->mpFactory;
-
- Attribute *pFamilyAttr = mpFactory->RetrieveFamily( mnFamily );
- Attribute *pWeightAttr = mpFactory->RetrieveWeight( mnWeight );
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth( mnSetwidth );
- Attribute *pSlantAttr = mpFactory->RetrieveSlant( mnSlant );
-
- meFamily = GetFamilyType();
- meWeight = GetWeight();
- meItalic = GetSlant();
- meWidthType = GetWidthType();
- mbSymbolFlag= (GetEncoding() == RTL_TEXTENCODING_SYMBOL);
- mePitch = GetPitch();
-
- maName = pFamilyAttr->GetAnnotation();
-
- // the helvetica narrow hack
- if ( ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW)
- && pWidthAttr->HasFeature(XLFD_FEATURE_NARROW) )
- {
- static const String aNarrow( RTL_CONSTASCII_USTRINGPARAM(" Narrow") );
- maName += aNarrow;
- }
-
- // stylename = weight + slant + width
- // XXX Fix me: there may be a space missing between them
- if ( meWeight != WEIGHT_NORMAL )
- maStyleName += pWeightAttr->GetAnnotation();
- if ( meItalic != ITALIC_NONE )
- maStyleName += pSlantAttr->GetAnnotation();
- if ( (meWidthType != WIDTH_NORMAL)
- && (! pWidthAttr->HasFeature(XLFD_FEATURE_NARROW)) )
- maStyleName += pWidthAttr->GetAnnotation();
- }
-
- if( mnEncodings <= mnEncCapacity )
- {
- mnEncCapacity += mnEncodings + 4;
- mpEncodingInfo = (EncodingInfo*)Realloc( mpEncodingInfo, mnEncCapacity * sizeof(EncodingInfo) );
- }
-
- mpEncodingInfo[ mnEncodings ] = pXlfd;
- mnEncodings += 1;
- return true;
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, char* /*pMatricsString*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-static FontPitch GetPitchFromX11Pitch( const char cSpacing )
-{
- switch ( cSpacing )
- {
- case 'c': // fall through
- case 'm': return PITCH_FIXED;
- case 'p': return PITCH_VARIABLE;
- default: return PITCH_DONTKNOW;
- }
-}
-
-// you must not call any of the ExtendedXlfd::GetXXX() functions if the
-// ExtendedXlfd is really empty (i.e. mnEncodings is zero)
-
-FontPitch ExtendedXlfd::GetPitch() const
-{
- if( mnEncodings > 1 )
- return PITCH_VARIABLE;
- if( mnEncodings == 1 )
- return GetPitchFromX11Pitch( mpEncodingInfo[0].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontPitch ExtendedXlfd::GetPitch( rtl_TextEncoding nEncoding ) const
-{
- for ( int nIdx = 0; nIdx < mnEncodings; nIdx++ )
- if ( mpEncodingInfo[nIdx].mnEncoding == nEncoding )
- return GetPitchFromX11Pitch( mpEncodingInfo[nIdx].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontFamily ExtendedXlfd::GetFamilyType() const
-{
- Attribute *pFamilyAttr= mpFactory->RetrieveFamily(mnFamily);
- return (FontFamily)pFamilyAttr->GetValue();
-}
-
-FontWeight ExtendedXlfd::GetWeight() const
-{
- Attribute *pWeightAttr = mpFactory->RetrieveWeight(mnWeight);
- return (FontWeight)pWeightAttr->GetValue();
-}
-
-FontItalic ExtendedXlfd::GetSlant() const
-{
- Attribute *pSlantAttr = mpFactory->RetrieveSlant(mnSlant);
- return (FontItalic)pSlantAttr->GetValue();
-}
-
-FontWidth ExtendedXlfd::GetWidthType() const
-{
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth(mnSetwidth);
- return (FontWidth)pWidthAttr->GetValue();
-}
-
-class CodeRange
-{
-public:
- CodeRange( int nMin, int nEnd ) : mnMin( nMin ), mnEnd( nEnd ) {}
-
- sal_uInt32 GetMin() const { return mnMin; }
- sal_uInt32 GetEnd() const { return mnEnd; }
-
- bool operator<( const CodeRange& r ) const
- { return (mnMin<r.mnMin) || ((mnMin==r.mnMin) && (mnEnd<r.mnEnd)); }
-
-private:
- sal_uInt32 mnMin, mnEnd;
-};
-
-
-int ExtendedXlfd::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- bool bHasUnicode = false;
- bool bHasUnknownEncoding = false;
-
- // approximate unicode ranges from encodings
- typedef std::set<CodeRange> RangeSet;
- RangeSet aRangeSet;
-
- for( unsigned short i = 0; i < mnEncodings; ++i )
- {
- // TODO: move encoding -> unicode range mapping to RTL
- // NOTE: for now only some are VERY roughly approximated
- const rtl_TextEncoding eEncoding = mpEncodingInfo[i].mnEncoding;
- switch( mpEncodingInfo[i].mnEncoding )
- {
- case RTL_TEXTENCODING_SYMBOL: // postscript symbol encoding
- aRangeSet.insert( CodeRange( 0x0020, 0x0100 ) ); // symbol aliasing
- aRangeSet.insert( CodeRange( 0xF020, 0xF100 ) );
- break;
-
- case RTL_TEXTENCODING_ISO_8859_15:
- aRangeSet.insert( CodeRange( 0x20AC, 0x20AD ) ); // Euro currency symbol
- // fall through
- case RTL_TEXTENCODING_APPLE_ROMAN:
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- case RTL_TEXTENCODING_IBM_437:
- case RTL_TEXTENCODING_IBM_852:
- aRangeSet.insert( CodeRange( 0x0020, 0x0080 ) );
- aRangeSet.insert( CodeRange( 0x00A0, 0x0100 ) );
- break;
-
- // Traditional, Simplified, Japanese
- case RTL_TEXTENCODING_APPLE_CHINSIMP:
- case RTL_TEXTENCODING_APPLE_CHINTRAD:
- case RTL_TEXTENCODING_APPLE_JAPANESE:
- case RTL_TEXTENCODING_SHIFT_JIS:
- case RTL_TEXTENCODING_GB_2312:
- case RTL_TEXTENCODING_GBT_12345:
- case RTL_TEXTENCODING_GBK:
- case RTL_TEXTENCODING_BIG5:
- case RTL_TEXTENCODING_EUC_JP:
- case RTL_TEXTENCODING_EUC_CN:
- case RTL_TEXTENCODING_EUC_TW:
- case RTL_TEXTENCODING_ISO_2022_JP:
- case RTL_TEXTENCODING_ISO_2022_CN:
- case RTL_TEXTENCODING_GB_18030:
- case RTL_TEXTENCODING_BIG5_HKSCS:
- case RTL_TEXTENCODING_JIS_X_0201:
- case RTL_TEXTENCODING_JIS_X_0208:
- case RTL_TEXTENCODING_JIS_X_0212:
- case RTL_TEXTENCODING_MS_932:
- case RTL_TEXTENCODING_MS_936:
- case RTL_TEXTENCODING_MS_950:
- aRangeSet.insert( CodeRange( 0x3000, 0xA000 ) );
- aRangeSet.insert( CodeRange( 0xF900, 0xFB00 ) );
- break;
-
- // Korean
- case RTL_TEXTENCODING_APPLE_KOREAN:
- case RTL_TEXTENCODING_MS_949:
- case RTL_TEXTENCODING_MS_1361:
- case RTL_TEXTENCODING_EUC_KR:
- case RTL_TEXTENCODING_ISO_2022_KR:
- aRangeSet.insert( CodeRange( 0x1100, 0x1200 ) );
- aRangeSet.insert( CodeRange( 0x3130, 0x3190 ) );
- aRangeSet.insert( CodeRange( 0xAC00, 0xD7A4 ) );
- break;
-
- // unknown encoding
- case RTL_TEXTENCODING_DONTKNOW:
- bHasUnknownEncoding = true;
- break;
-
- // Unicode
- case RTL_TEXTENCODING_UNICODE:
- case RTL_TEXTENCODING_UTF7:
- case RTL_TEXTENCODING_UTF8:
- bHasUnicode = true;
- break;
-
- // misc 8bit encodings
- default:
- if( !rtl_isOctetTextEncoding( eEncoding ) )
- bHasUnknownEncoding = true;
- else
- {
- // use the unicode converter to get the coverage of an 8bit encoding
- rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter( eEncoding );
- rtl_UnicodeToTextContext aCvtContext = rtl_createTextToUnicodeContext( aConverter );
- if( !aConverter || !aCvtContext )
- bHasUnknownEncoding = true;
- else
- {
- sal_Char cCharsInp[ 0x100 ];
- for( int j = 0x20; j < 0x080; ++j )
- cCharsInp[ j-0x20 ] = j;
- for( int j = 0xA0; j < 0x100; ++j )
- cCharsInp[ j-0x40 ] = j;
-
- sal_Unicode cCharsOut[ 0x100 ];
- sal_uInt32 nCvtInfo;
- sal_Size nSrcCvtBytes;
- int nOutLen = rtl_convertTextToUnicode(
- aConverter, aCvtContext,
- cCharsInp, 0xC0,
- cCharsOut, sizeof(cCharsOut)/sizeof(*cCharsOut),
- RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
- | RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE,
- &nCvtInfo, &nSrcCvtBytes );
-
- for( int j = 0; j < nOutLen; ++j )
- aRangeSet.insert( CodeRange( cCharsOut[j], cCharsOut[j]+1 ) );
-
- rtl_destroyTextToUnicodeConverter( aCvtContext );
- rtl_destroyTextToUnicodeConverter( aConverter );
- }
- }
- break;
- }
- }
-
- // unicode encoded fonts usually do not cover the entire unicode range
- // => only use them to determine coverage when no other encodings are available
- if( aRangeSet.empty() && (bHasUnicode || bHasUnknownEncoding) )
- {
- if( pCodePairs )
- {
- pCodePairs[0] = 0x0020;
- pCodePairs[1] = 0xD800;
- pCodePairs[2] = 0xE000;
- pCodePairs[3] = 0xFFFE;
- }
- return 2;
- }
-
- if( aRangeSet.empty() )
- return 0;
-
- // sort and merge the code pairs
- sal_uInt32* pDst = pCodePairs;
- RangeSet::const_iterator it = aRangeSet.begin();
- for( sal_uInt32 nEnd = 0; it != aRangeSet.end(); ++it )
- {
- // check overlap with to previous range
- const CodeRange& rSrc = *it;
- if( nEnd < rSrc.GetMin() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- {
- pDst[0] = rSrc.GetMin();
- pDst[1] = rSrc.GetEnd();
- }
- pDst += 2;
- }
- else
- {
- // merge overlapping ranges
- if( nEnd < rSrc.GetEnd() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- pDst[-1] = nEnd;
- }
- }
- }
-
- int nRangeCount = (pDst - pCodePairs) / 2;
- return nRangeCount;
-}
-
-// ------ class to handle scalable bitmap fonts ------------------------------
-
-ScalableBitmapXlfd::ScalableBitmapXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableBitmapXlfd::~ScalableBitmapXlfd()
-{}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-";
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionX );
- rString += '-';
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionY );
- rString += '-';
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableBitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 0;
- return pFontData;
-}
-
-// ------ class to handle true bitmap fonts ----------------------------------
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-BitmapXlfd::BitmapXlfd( )
-: ExtendedXlfd( false )
-{}
-
-BitmapXlfd::~BitmapXlfd( )
-{}
-
-bool
-BitmapXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- if ( mnEncodings == 0 )
- {
- mnPixelSize = pXlfd->mnPixelSize;
- mnPointSize = pXlfd->mnPointSize;
- mnAverageWidth = pXlfd->mnAverageWidth;
- }
-
- return ExtendedXlfd::AddEncoding( pXlfd );
-}
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
- rString += '-';
- rString += ByteString::CreateFromInt32( mnPixelSize );
- rString += "-*-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* BitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, mnPixelSize );
- pFontData->mnQuality= 100;
- return pFontData;
-}
-
-// ------ class to handle true scalable fonts --------------------------------
-
-ScalableXlfd::ScalableXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableXlfd::~ScalableXlfd()
-{}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 200;
- return pFontData;
-}
-
-/* ------- virtual fonts for user interface ------------------------------- */
-
-VirtualXlfd::ExtEncodingInfo&
-VirtualXlfd::ExtEncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
-
- return *this;
-}
-
-VirtualXlfd::VirtualXlfd()
-: ExtendedXlfd( true ),
- mnExtCapacity(0),
- mpExtEncodingInfo(NULL)
-{
- mnFoundry = 0;
- mnFamily = 0;
- mnWeight = 0;
- mnSlant = 0;
- mnSetwidth = 0;
-}
-
-VirtualXlfd::~VirtualXlfd()
-{
- if ( mpExtEncodingInfo != NULL )
- rtl_freeMemory( mpExtEncodingInfo );
-}
-
-int
-VirtualXlfd::GetFontQuality (unsigned short nFamily)
-{
- Attribute *pFamily = mpFactory->RetrieveFamily(nFamily);
- int nQuality = 0;
-
- if (pFamily->HasFeature(XLFD_FEATURE_HQ))
- nQuality += 16;
- if (pFamily->HasFeature(XLFD_FEATURE_MQ))
- nQuality += 8;
- if (pFamily->HasFeature(XLFD_FEATURE_LQ))
- nQuality += 4;
- return nQuality;
-}
-
-bool
-VirtualXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- // add new font
- bool bRC = ExtendedXlfd::AddEncoding( pXlfd );
-
- int nIdx;
- if( bRC )
- {
- // new encoding => append the new pXlfd
- nIdx = mnEncodings - 1;
- if( nIdx >= mnExtCapacity )
- {
- mnExtCapacity = mnEncCapacity;
- mpExtEncodingInfo = (ExtEncodingInfo*)Realloc( mpExtEncodingInfo,
- mnExtCapacity * sizeof(ExtEncodingInfo) );
- }
- }
- else
- {
- // existing encoding => check if the new pXlfd is better
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- nIdx = GetEncodingIdx( nEncoding );
-
- int nOldQuality = GetFontQuality( mpExtEncodingInfo[nIdx].mnFamily );
- int nNewQuality = GetFontQuality( pXlfd->mnFamily );
- if( nOldQuality >= nNewQuality )
- return false;
- }
-
- mpExtEncodingInfo[ nIdx ] = pXlfd;
- return true;
-}
-
-void
-VirtualXlfd::FilterInterfaceFont (const Xlfd *pXlfd)
-{
- Attribute *pAttr;
- AttributeProvider *pFactory = pXlfd->mpFactory;
-
- if (! pXlfd->Fonttype() == TYPE_SCALABLE)
- return;
- pAttr = pFactory->RetrieveFamily(pXlfd->mnFamily);
- if (! pAttr->HasFeature(XLFD_FEATURE_INTERFACE_FONT))
- return;
- pAttr = pFactory->RetrieveSlant(pXlfd->mnSlant);
- if (! (FontItalic)pAttr->GetValue() == ITALIC_NONE)
- return;
- pAttr = pFactory->RetrieveSetwidth(pXlfd->mnSetwidth);
- if (pAttr->HasFeature(XLFD_FEATURE_NARROW))
- return;
- pAttr = pFactory->RetrieveWeight(pXlfd->mnWeight);
- FontWeight eWeight = (FontWeight)pAttr->GetValue();
- if ((eWeight != WEIGHT_NORMAL) && (eWeight != WEIGHT_MEDIUM))
- return;
-
- AddEncoding (pXlfd);
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* VirtualXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
-
- // family name
- static const String aFontName( RTL_CONSTASCII_USTRINGPARAM("Interface User") );
- pFontData->maName = aFontName;
- // pFontData->maStyleName = aStyleName;
- pFontData->meFamily = FAMILY_SWISS;
- pFontData->meWeight = WEIGHT_NORMAL;
- pFontData->meItalic = ITALIC_NONE;
- pFontData->meWidthType = WIDTH_NORMAL;
- pFontData->mePitch = PITCH_VARIABLE;
-
- pFontData->mbSymbolFlag = false;
- pFontData->mbOrientation= false;
- pFontData->mbDevice = true;
- pFontData->mnQuality = 100;
-
- return pFontData;
-}
-
-// ------ font list -------------------------------------------------------
-
-XlfdStorage::XlfdStorage()
-{
- maXlfdList.reserve( 256 );
-}
-
-void
-XlfdStorage::Dispose()
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- delete *it;
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Reset()
-{
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Add( const ExtendedXlfd* pXlfd )
-{
- if ( pXlfd != NULL )
- maXlfdList.push_back( pXlfd );
-}
-
-void
-XlfdStorage::Add( const XlfdStorage* pXlfd )
-{
- if ( !pXlfd || pXlfd->maXlfdList.empty() )
- return;
-
- maXlfdList.reserve( maXlfdList.size() + pXlfd->maXlfdList.size() );
- XlfdList::const_iterator it = pXlfd->maXlfdList.begin();
- for(; it != pXlfd->maXlfdList.end(); ++it )
- maXlfdList.push_back( *it );
-}
-
-void XlfdStorage::AnnounceFonts( ImplDevFontList* pList ) const
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- const ExtendedXlfd* pXlfd = *it;
- ImplFontData* pFontData = pXlfd->GetImplFontData();
- pList->Add( pFontData );
- }
-}
-
-// ------ bitmap font list --------------------------------------------------
-
-void
-BitmapXlfdStorage::AddBitmapFont( const Xlfd *pXlfd )
-{
- if ( pXlfd == NULL )
- return;
-
- int nPixelSize = pXlfd->mnPixelSize;
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- BitmapXlfd* pBitmapXlfd = (BitmapXlfd*)*it;
- if( nPixelSize == pBitmapXlfd->GetPixelSize() )
- {
- // we need to add an encoding to an existing bitmap font
- pBitmapXlfd->AddEncoding( pXlfd );
- return;
- }
- }
-
- // we have a new bitmap font
- BitmapXlfd* pBitmapXlfd = new BitmapXlfd;
- pBitmapXlfd->AddEncoding( pXlfd );
- Add( pBitmapXlfd );
-}
diff --git a/vcl/unx/source/gdi/xlfd_extd.hxx b/vcl/unx/source/gdi/xlfd_extd.hxx
deleted file mode 100644
index 523f87fac477..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.hxx
+++ /dev/null
@@ -1,272 +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 XLFD_EXTENDED_HXX
-#define XLFD_EXTENDED_HXX
-
-#include <salunx.h>
-#ifndef _VCL_VCLENUM_HXX
-#include <vcl/enum.hxx>
-#endif
-#ifndef _VCL_OUTFONT_HXX
-#include <vcl/outfont.hxx>
-#endif
-
-#include <vector>
-
-class Xlfd;
-class AttributeProvider;
-class ImplDevFontList;
-class ByteString;
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- * -p- * )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-// base class
-
-class ExtendedXlfd : public ImplDevFontAttributes
-{
- public:
- ExtendedXlfd( bool bScalable );
- virtual ~ExtendedXlfd();
- virtual bool AddEncoding( const Xlfd* );
- bool HasEncoding( rtl_TextEncoding ) const;
- int GetEncodingIdx( rtl_TextEncoding nEncoding ) const;
- unsigned short NumEncodings() const
- { return mnEncodings; }
- virtual int GetPixelSize() const
- { return 0; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const = 0;
- bool IsScalable() const { return mbScalable; }
- virtual FontFamily GetFamilyType() const;
- virtual FontWeight GetWeight() const;
- virtual FontItalic GetSlant() const;
- virtual FontWidth GetWidthType() const;
- virtual FontPitch GetPitch() const;
- virtual FontPitch GetPitch( rtl_TextEncoding ) const;
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- rtl_TextEncoding GetEncoding() const;
- rtl_TextEncoding GetEncoding( int i ) const;
-
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
-
- protected:
- AttributeProvider* mpFactory;
-
- public:
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- bool mbScalable;
-
- protected:
- unsigned short mnEncodings;
- unsigned short mnEncCapacity;
- struct EncodingInfo {
- unsigned char mcSpacing;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned short mnAddstyle;
- unsigned short mnCharset;
- rtl_TextEncoding mnEncoding;
-
- EncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpEncodingInfo;
-};
-
-// class to handle scalable bitmap fonts
-
-class ScalableBitmapXlfd : public ExtendedXlfd {
-
- public:
- ScalableBitmapXlfd();
- virtual ~ScalableBitmapXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to handle true bitmap fonts
-
-class ScalableXlfd;
-
-class BitmapXlfd : public ExtendedXlfd {
-
- public:
- BitmapXlfd();
- ~BitmapXlfd();
- bool AddEncoding( const Xlfd* );
- virtual int GetPixelSize() const
- { return mnPixelSize; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnAverageWidth;
-};
-
-// class to handle true scalable fonts
-
-class ScalableXlfd : public ExtendedXlfd {
-
- friend class BitmapXlfd;
-
- public:
- ScalableXlfd();
- virtual ~ScalableXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
-
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to maintain a list of fonts ( bitmap and scalable )
-
-class XlfdStorage {
-
- public:
- XlfdStorage();
-
- void Dispose();
- void Reset();
-
- void Add( const ExtendedXlfd *pXlfd );
- void Add( const XlfdStorage *pXlfd );
- void AnnounceFonts( ImplDevFontList* ) const;
-
- protected:
-
- typedef ::std::vector<const ExtendedXlfd*> XlfdList;
- XlfdList maXlfdList;
-};
-
-// list of fonts specific for bitmap fonts
-
-class BitmapXlfdStorage : public XlfdStorage {
-
- public:
-
- void AddBitmapFont( const Xlfd *pXlfd );
-};
-
-
-/* Virtual font for User Interface */
-
-class VirtualXlfd : public ExtendedXlfd
-{
- private:
-
- int GetFontQuality (unsigned short nFamily);
-
- public:
- VirtualXlfd();
- virtual ~VirtualXlfd();
- virtual bool AddEncoding( const Xlfd* );
- void FilterInterfaceFont (const Xlfd *pXlfd);
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnExtCapacity;
- struct ExtEncodingInfo {
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
-
- ExtEncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpExtEncodingInfo;
-
- friend class ExtEncodingInfo;
-};
-
-
-// class to describe a X11 physically available font face
-
-class ImplX11FontData : public ImplFontData
-{
-private:
- enum { X11IFD_MAGIC = 0x111FDA1C };
- const ExtendedXlfd& mrXlfd;
-
-public:
- ImplX11FontData( const ExtendedXlfd&, int nHeight );
- const ExtendedXlfd& GetExtendedXlfd() const { return mrXlfd; }
- virtual ImplFontData* Clone() const { return new ImplX11FontData( *this ); }
- virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
- virtual sal_IntPtr GetFontId() const;
-
- static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( X11IFD_MAGIC ); }
-};
-
-#endif /* XLFD_EXTENDED_HXX */
diff --git a/vcl/unx/source/gdi/xlfd_smpl.cxx b/vcl/unx/source/gdi/xlfd_smpl.cxx
deleted file mode 100644
index 6cf18d98de1e..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.cxx
+++ /dev/null
@@ -1,268 +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_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-Xlfd::Xlfd()
-{
-}
-
-// XlfdCompare abi has to be qsort(3) compatible, the sorting result must
-// guarantee that fonts with SameFontoutline() are successive
-// XlfdCompare relies on vFrom->mpFactory eq vTo->mpFactory. Since comparing
-// Xlfd's is done by comparing attributes there is no way around this.
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo )
-{
- const Xlfd *pFrom = (Xlfd*)vFrom;
- const Xlfd *pTo = (Xlfd*)vTo;
-
- // Compare outline description
- if ( pFrom->mnFoundry != pTo->mnFoundry )
- return (int)pFrom->mnFoundry - (int)pTo->mnFoundry;
- if ( pFrom->mnFamily != pTo->mnFamily )
- return (int)pFrom->mnFamily - (int)pTo->mnFamily;
- if ( pFrom->mnWeight != pTo->mnWeight )
- return (int)pFrom->mnWeight - (int)pTo->mnWeight;
- if ( pFrom->mnSlant != pTo->mnSlant )
- return (int)pFrom->mnSlant - (int)pTo->mnSlant;
- if ( pFrom->mnSetwidth != pTo->mnSetwidth )
- return (int)pFrom->mnSetwidth - (int)pTo->mnSetwidth;
-
- // Addstyle name is futile tricky. it may contain encoding information
- // (like "ansi_1251") which Compares equal, or it may contain style
- // information (like "serif") which Compares unequal, anyway if the font
- // is "interface user" or "interface system" then compare equal anyway to
- // build fontsets as large as possible
- if ( pFrom->mnAddstyle == pTo->mnAddstyle )
- return 0;
-
- AttributeProvider *pFactory = pFrom->mpFactory;
- Attribute *pFamily = pFactory->RetrieveFamily( pFrom->mnFamily );
- if ( pFamily->HasFeature(XLFD_FEATURE_APPLICATION_FONT) )
- return 0;
-
- Attribute *pFromAddStyle = pFactory->RetrieveAddstyle( pFrom->mnAddstyle );
- Attribute *pToAddStyle = pFactory->RetrieveAddstyle( pTo->mnAddstyle );
-
- // if both addstyles denote encodings or if one denotes an
- // encoding and the other denotes a style which really
- // duplicates weight and slant information
-
- int nFromCompare = (pFromAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pFromAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pFrom->mnAddstyle;
- int nToCompare = (pToAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pToAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pTo->mnAddstyle;
-
- return nFromCompare - nToCompare;
-}
-
-// check whether two fonts are identical as appearance is concerned
-// this does not Compare the actual scaling of two fonts
-Bool
-Xlfd::SameFontoutline( const Xlfd* pComparedTo ) const
-{
- void* pThis = (void*)this;
- return XlfdCompare( (void*)pThis, (void*)pComparedTo ) == 0 ;
-}
-
-unsigned short
-Xlfd::GetEncoding() const
-{
- Attribute *pAddstyle = mpFactory->RetrieveAddstyle( mnAddstyle );
- if ( pAddstyle->GetValue() != RTL_TEXTENCODING_DONTKNOW )
- return pAddstyle->GetValue();
-
- Attribute *pEncoding = mpFactory->RetrieveCharset( mnCharset );
- return pEncoding->GetValue();
-}
-
-XlfdFonttype
-Xlfd::Fonttype() const
-{
- if ( (mnAverageWidth == 0) && (mnPixelSize == 0) && (mnPointSize == 0) )
- {
- return (mnResolutionX == 0)
- && (mnResolutionY == 0) ? eTypeScalable : eTypeScalableBitmap;
- }
-
- return eTypeBitmap;
-}
-
-void
-Advance( const char** pFrom, const char** pTo )
-{
- const char *pTmp = *pTo;
-
- for( ; (*pTmp != '\0') && (*pTmp++ != '-'); )
- {}
- *pFrom = *pTo;
- *pTo = pTmp;
-}
-
-Bool
-Xlfd::IsConformant (const char* pXlfd) const
-{
- // X FontNameRegistry prefix "-"
- if (*pXlfd++ != '-')
- return False;
-
- // All Xlfd FontName fields are defined
- int nNumFields = 1;
- while (*pXlfd != '\0')
- {
- if (*pXlfd++ == '-')
- nNumFields++;
- }
- // enough entries ?
- if (nNumFields != 14)
- return False;
- // and the last one is not empty as well ?
- if (*(pXlfd - 1) == '-')
- return False;
-
- return True;
-}
-
-// this is the real workhorse function. Since this is called for every font
-// in the fontpath it has to be as fast a possible
-Bool
-Xlfd::FromString( const char* pXlfdstring, AttributeProvider *pFactory )
-{
- if (!IsConformant(pXlfdstring))
- return False;
-
- const char* pFrom = pXlfdstring + 1;
- const char* pTo = pFrom;
- mpFactory = pFactory;
-
- Advance( &pFrom, &pTo ); //-foundry-*
- mnFoundry = mpFactory->InsertFoundry( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-family-*
- mnFamily = mpFactory->InsertFamily( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-*-weight-*
- mnWeight = mpFactory->InsertWeight( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-slant-*
- mnSlant = mpFactory->InsertSlant( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-setwidth-*
- mnSetwidth = mpFactory->InsertSetwidth( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-Addstyle-*
- mnAddstyle = mpFactory->InsertAddstyle( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-height-*
- mnPixelSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-pt height-*
- mnPointSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-x resolution-*
- mnResolutionX = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-y resolution-*
- mnResolutionY = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-spacing-*
- mcSpacing = pFrom == pTo ? '\0' : *pFrom;
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-average-*
- mnAverageWidth = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-*-registry-encoding
- const char* pTmp = pFrom;
- Advance( &pTmp, &pTo );
- mnCharset = mpFactory->InsertCharset( pFrom, pTo - pFrom );
-
- // sanity check whether we have really found a valid XLFD, if not
- // throw away the whole font, since we have no idea what parts of
- // the XLFD contains the error.
- if ( !(pTo > pFrom) )
- return False;
-
- // a non-empty family name is essential, since otherwise the font
- // would match the "default font" #52299#
- Attribute* pFamily = mpFactory->RetrieveFamily( mnFamily );
- const char* pFamilyName = pFamily->GetName();
- if ( pFamilyName[0] == '\0' )
- return False;
-
- // well done
- return True;
-}
-
-#if OSL_DEBUG_LEVEL > 1
-// pure debug for now: this is only to inspect/pretty print a Xlfd struct
-const char*
-Xlfd::ToString( ByteString &rString ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
- AppendAttribute( mpFactory->RetrieveAddstyle(mnAddstyle), rString );
-
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPixelSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPointSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionX ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionY ) );
- rString.Append("-"); rString.Append( (char)mcSpacing );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnAverageWidth ) );
-
- AppendAttribute( mpFactory->RetrieveCharset(mnCharset), rString );
-
- return rString.GetBuffer() ;
-}
-
-void
-Xlfd::Dump() const
-{
- ByteString aString;
- fprintf(stderr, "Xlfd: %s\n", ToString(aString) );
-}
-#endif
-
diff --git a/vcl/unx/source/gdi/xlfd_smpl.hxx b/vcl/unx/source/gdi/xlfd_smpl.hxx
deleted file mode 100644
index f62ac381e6b9..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.hxx
+++ /dev/null
@@ -1,92 +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 XLFD_SIMPLE_HXX
-#define XLFD_SIMPLE_HXX
-
-#include <salunx.h>
-#include <vcl/vclenum.hxx>
-#include <tools/string.hxx>
-
-class AttributeProvider;
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-enum XlfdFonttype {
- eTypeUnknown = TYPE_DONTKNOW,
- eTypeBitmap = TYPE_RASTER,
- eTypeScalableBitmap = TYPE_VECTOR,
- eTypeScalable = TYPE_SCALABLE
-};
-
-class Xlfd {
-
- public:
-
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- unsigned short mnAddstyle;
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned char mcSpacing;
- unsigned short mnAverageWidth;
- unsigned short mnCharset;
-
- // all foundry, family, weight ... information referres
- // to this factory
- AttributeProvider *mpFactory;
-
- Bool IsConformant( const char* pXlfdstring ) const;
-
- public:
- Xlfd();
- Bool FromString( const char* pXlfdstring,
- AttributeProvider *pFactory );
- Bool SameFontoutline( const Xlfd *pComparedTo ) const ;
- XlfdFonttype Fonttype() const ;
- unsigned short GetEncoding() const ;
- #if OSL_DEBUG_LEVEL > 1
- const char* ToString( ByteString &rString ) const ;
- void Dump() const;
- #endif
-};
-
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo );
-
-#endif /* XLFD_SIMPLE_HXX */
-
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 9934277302e1..11c20aa40f5a 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -3588,9 +3588,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if( FocusIn == pEvent->type )
{
-#ifndef _USE_PRINT_EXTENSION_
vcl_sal::PrinterUpdate::update();
-#endif
mbInputFocus = True;
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index d21e9dcb3eed..8d1de2ed30f0 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -125,7 +125,6 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \
$(INC)$/vcl$/virdev.hxx \
$(INC)$/vcl$/wall.hxx \
$(INC)$/vcl$/waitobj.hxx \
- $(INC)$/vcl$/wintypes.hxx \
$(INC)$/vcl$/window.hxx \
$(INC)$/vcl$/wrkwin.hxx
diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk
index 3144acc4bc05..8ec15475bc90 100644
--- a/vcl/util/target.pmk
+++ b/vcl/util/target.pmk
@@ -37,8 +37,3 @@ ONLYDLL .SETDIR=$(PRJ)$/util: $(SLOFILES)
dmake debug=t prjpch=t linkinc=t compinc=t ..$/$(OUTPATH)$/bin$/sv$(DLLPOSTFIX).dll
@echo "READY"
-.IF "$(USE_XPRINT)"!="TRUE"
-.ELSE
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-.ENDIF
-
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index f95f1e0ca96b..48180bbe185b 100644..100755
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -33,6 +33,8 @@
#include <vcl/salwtype.hxx>
#include <wincomp.hxx>
+#include "osl/module.h"
+
#include <set> // for hMenu validation
#include <map>
@@ -46,6 +48,8 @@ class Font;
struct HDCCache;
struct TempFontItem;
+typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(WIN_BOOL*);
+
// --------------------
// - Standard-Defines -
// --------------------
@@ -131,12 +135,15 @@ public:
SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none
TempFontItem* mpTempFontItem;
BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ BOOL mbThemeMenuSupport;
// for GdiPlus GdiplusStartup/GdiplusShutdown
ULONG_PTR gdiplusToken;
std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle()
std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries
+ oslModule maDwmLib;
+ DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
};
inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
@@ -154,7 +161,6 @@ struct SalShlData
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
WORD mnVersion; // System-Version (311 == 3.11)
- WIN_BOOL mbWNT; // kein W16/W95/W98 sondern ein NT
WIN_BOOL mbW40; // Is System-Version >= 4.0
WIN_BOOL mbWXP; // Windows XP
WIN_BOOL mbWPrinter; // true: use unicode printer functions
diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx
index bb8a198a96e6..5f94029ad817 100644
--- a/vcl/win/source/app/saldata.cxx
+++ b/vcl/win/source/app/saldata.cxx
@@ -119,42 +119,28 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong )
{
- if ( aSalShlData.mbWNT )
- return SetWindowLongW( hWnd, nIndex, dwNewLong );
- else
- return SetWindowLongA( hWnd, nIndex, dwNewLong );
+ return SetWindowLongW( hWnd, nIndex, dwNewLong );
}
// -----------------------------------------------------------------------
LONG ImplGetWindowLong( HWND hWnd, int nIndex )
{
- if ( aSalShlData.mbWNT )
- return GetWindowLongW( hWnd, nIndex );
- else
- return GetWindowLongA( hWnd, nIndex );
+ return GetWindowLongW( hWnd, nIndex );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- if ( aSalShlData.mbWNT )
- return PostMessageW( hWnd, nMsg, wParam, lParam );
- else
- return PostMessageA( hWnd, nMsg, wParam, lParam );
+ return PostMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- WIN_BOOL bRet;
- if ( aSalShlData.mbWNT )
- bRet = SendMessageW( hWnd, nMsg, wParam, lParam );
- else
- bRet = SendMessageA( hWnd, nMsg, wParam, lParam );
-
+ WIN_BOOL bRet = SendMessageW( hWnd, nMsg, wParam, lParam );
return bRet;
}
@@ -162,29 +148,20 @@ WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
{
- if ( aSalShlData.mbWNT )
- return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
- else
- return GetMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
+ return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
}
// -----------------------------------------------------------------------
WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
{
- if ( aSalShlData.mbWNT )
- return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
- else
- return PeekMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
+ return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
}
// -----------------------------------------------------------------------
LONG ImplDispatchMessage( CONST MSG *lpMsg )
{
- if ( aSalShlData.mbWNT )
- return DispatchMessageW( lpMsg );
- else
- return DispatchMessageA( lpMsg );
+ return DispatchMessageW( lpMsg );
}
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index a05d2d0b6502..2a2a1827a515 100644..100755
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -47,7 +47,7 @@
#include <salobj.h>
#include <vcl/salsys.hxx>
#include <saltimer.h>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
@@ -434,9 +434,12 @@ SalData::SalData()
mpFirstIcon = 0; // icon cache, points to first icon, NULL if none
mpTempFontItem = 0;
mbThemeChanged = FALSE; // true if visual theme was changed: throw away theme handles
+ mbThemeMenuSupport = FALSE;
// init with NULL
gdiplusToken = 0;
+ maDwmLib = 0;
+ mpDwmIsCompositionEnabled = 0;
initKeyCodeMap();
@@ -503,7 +506,6 @@ SalInstance* CreateSalInstance()
SalData* pSalData = GetSalData();
// determine the windows version
- aSalShlData.mbWNT = 0;
aSalShlData.mbWXP = 0;
aSalShlData.mbWPrinter = 0;
WORD nVer = (WORD)GetVersion();
@@ -516,7 +518,6 @@ SalInstance* CreateSalInstance()
{
if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
- aSalShlData.mbWNT = 1;
// Windows XP ?
if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
@@ -531,8 +532,6 @@ SalInstance* CreateSalInstance()
// register frame class
if ( !pSalData->mhPrevInst )
{
- if ( aSalShlData.mbWNT )
- {
WNDCLASSEXW aWndClassEx;
aWndClassEx.cbSize = sizeof( aWndClassEx );
aWndClassEx.style = CS_OWNDC;
@@ -568,53 +567,11 @@ SalInstance* CreateSalInstance()
aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
if ( !RegisterClassExW( &aWndClassEx ) )
return NULL;
- }
- else
- {
- WNDCLASSEXA aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = CS_OWNDC;
- aWndClassEx.lpfnWndProc = SalFrameWndProcA;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hCursor = 0;
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEA;
- ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.style |= CS_SAVEBITS;
- aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalComWndProcA;
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
- }
}
- HWND hComWnd;
- if ( aSalShlData.mbWNT )
- {
- hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
pSalData->mhInst, NULL );
- }
- else
- {
- hComWnd = CreateWindowExA( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEA,
- "", WS_POPUP, 0, 0, 0, 0, 0, 0,
- pSalData->mhInst, NULL );
- }
if ( !hComWnd )
return NULL;
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index c8e0210196e6..91662fb8aded 100644..100755
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1366,10 +1366,6 @@ int CALLBACK SalEnumQueryFontProcExA( const ENUMLOGFONTEXA*,
bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
{
- bool bAvailable = false;
-
- if ( aSalShlData.mbWNT )
- {
// Test, if Font available
LOGFONTW aLogFont;
memset( &aLogFont, 0, sizeof( aLogFont ) );
@@ -1381,27 +1377,9 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
aLogFont.lfFaceName[nNameLen] = 0;
- EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
- (LPARAM)(void*)&bAvailable, 0 );
- }
- else
- {
- ByteString aTemp = ImplSalGetWinAnsiString( rName );
-
- // Test, if Font available
- LOGFONTA aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
-
- UINT nNameLen = aTemp.Len();
- if ( nNameLen > sizeof( aLogFont.lfFaceName )-1 )
- nNameLen = sizeof( aLogFont.lfFaceName )-1;
- memcpy( aLogFont.lfFaceName, aTemp.GetBuffer(), nNameLen );
- aLogFont.lfFaceName[nNameLen] = 0;
-
- EnumFontFamiliesExA( hDC, &aLogFont, (FONTENUMPROCA)SalEnumQueryFontProcExA,
+ bool bAvailable = false;
+ EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
(LPARAM)(void*)&bAvailable, 0 );
- }
return bAvailable;
}
@@ -1564,7 +1542,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
// only required for virtual devices, see below for details
hdcScreen = GetDC(0);
- if( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
LOGFONTW aLogFont;
ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
@@ -1624,63 +1602,6 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
hNewFont = hNewFont2;
}
}
- else
- {
- if( !mpLogFont )
- // mpLogFont is needed for getting the kerning pairs
- // TODO: get them from somewhere else
- mpLogFont = new LOGFONTA;
- LOGFONTA& aLogFont = *mpLogFont;
- ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
-
- // on the display we prefer Courier New when Courier is a
- // bitmap only font and we need to stretch or rotate it
- if( mbScreen
- && (i_pFont->mnWidth != 0
- || i_pFont->mnOrientation != 0
- || i_pFont->mpFontData == NULL
- || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight))
- && !bImplSalCourierScalable
- && bImplSalCourierNew
- && (stricmp( aLogFont.lfFaceName, "Courier" ) == 0) )
- strncpy( aLogFont.lfFaceName, "Courier New", 11 );
-
- // limit font requests to MAXFONTHEIGHT to work around driver problems
- // TODO: share MAXFONTHEIGHT font instance
- if( -aLogFont.lfHeight <= MAXFONTHEIGHT )
- o_rFontScale = 1.0;
- else
- {
- o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT;
- aLogFont.lfHeight = -MAXFONTHEIGHT;
- aLogFont.lfWidth = static_cast<LONG>( aLogFont.lfWidth / o_rFontScale );
- }
-
- hNewFont = ::CreateFontIndirectA( &aLogFont );
- if( hdcScreen )
- {
- // select font into screen hdc first to get an antialiased font
- // see knowledge base article 305290:
- // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface"
- ::SelectFont( hdcScreen, ::SelectFont( hdcScreen , hNewFont ) );
- }
- o_rOldFont = ::SelectFont( mhDC, hNewFont );
-
- TEXTMETRICA aTextMetricA;
- // when the font doesn't work try a replacement
- if ( !::GetTextMetricsA( mhDC, &aTextMetricA ) )
- {
- // the selected font doesn't work => try a replacement
- // TODO: use its font fallback instead
- LOGFONTA aTempLogFont = aLogFont;
- strncpy( aTempLogFont.lfFaceName, "Courier New", 11 );
- aTempLogFont.lfPitchAndFamily = FIXED_PITCH;
- HFONT hNewFont2 = CreateFontIndirectA( &aTempLogFont );
- ::SelectFont( mhDC, hNewFont2 );
- ::DeleteFont( hNewFont );
- hNewFont = hNewFont2;
- }
- }
if( hdcScreen )
::ReleaseDC( NULL, hdcScreen );
@@ -1767,18 +1688,9 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// temporarily change the HDC to the font in the fallback level
HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] );
- if ( aSalShlData.mbWNT )
- {
wchar_t aFaceName[LF_FACESIZE+60];
if( ::GetTextFaceW( mhDC, sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) )
pMetric->maName = reinterpret_cast<const sal_Unicode*>(aFaceName);
- }
- else
- {
- char aFaceName[LF_FACESIZE+60];
- if( ::GetTextFaceA( mhDC, sizeof(aFaceName), aFaceName ) )
- pMetric->maName = ImplSalGetUniString( aFaceName );
- }
// get the font metric
TEXTMETRICA aWinMetric;
@@ -1842,11 +1754,6 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
pMetric->mnAscent += nHalfTmpExtLeading;
pMetric->mnDescent += nOtherHalfTmpExtLeading;
-
- // #109280# HACK korean only: increase descent for wavelines and impr
- if( !aSalShlData.mbWNT )
- if( mpWinFontData[nFallbackLevel]->SupportsKorean() )
- pMetric->mnDescent += pMetric->mnExtLeading;
}
pMetric->mnMinKashida = GetMinKashidaWidth();
@@ -2000,45 +1907,21 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
}
mnFontKernPairCount = 0;
- if ( aSalShlData.mbWNT )
+ KERNINGPAIR* pPairs = NULL;
+ int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
+ if( nCount )
{
- KERNINGPAIR* pPairs = NULL;
- int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
- if( nCount )
- {
-#ifdef GCP_KERN_HACK
- pPairs = new KERNINGPAIR[ nCount+1 ];
- mpFontKernPairs = pPairs;
- mnFontKernPairCount = nCount;
- ::GetKerningPairsW( mhDC, nCount, pPairs );
-#else // GCP_KERN_HACK
- pPairs = pKernPairs;
- nCount = (nCount < nPairs) : nCount : nPairs;
- ::GetKerningPairsW( mhDC, nCount, pPairs );
- return nCount;
-#endif // GCP_KERN_HACK
- }
- }
- else
- {
- if ( !mnFontCharSetCount )
- ImplGetAllFontCharSets( this );
-
- if ( mnFontCharSetCount <= 1 )
- ImplAddKerningPairs( this );
- else
- {
- // Query All Kerning Pairs from all possible CharSets
- for ( BYTE i = 0; i < mnFontCharSetCount; i++ )
- {
- mpLogFont->lfCharSet = mpFontCharSets[i];
- HFONT hNewFont = CreateFontIndirectA( mpLogFont );
- HFONT hOldFont = SelectFont( mhDC, hNewFont );
- ImplAddKerningPairs( this );
- SelectFont( mhDC, hOldFont );
- DeleteFont( hNewFont );
- }
- }
+ #ifdef GCP_KERN_HACK
+ pPairs = new KERNINGPAIR[ nCount+1 ];
+ mpFontKernPairs = pPairs;
+ mnFontKernPairCount = nCount;
+ ::GetKerningPairsW( mhDC, nCount, pPairs );
+ #else // GCP_KERN_HACK
+ pPairs = pKernPairs;
+ nCount = (nCount < nPairs) : nCount : nPairs;
+ ::GetKerningPairsW( mhDC, nCount, pPairs );
+ return nCount;
+ #endif // GCP_KERN_HACK
}
mbFontKernInit = FALSE;
@@ -2270,19 +2153,7 @@ void ImplReleaseTempFonts( SalData& rSalData )
}
else
{
- if( aSalShlData.mbWNT )
- ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
- else
- {
- // poor man's string conversion because converter is gone
- int nLen = p->maFontFilePath.getLength();
- char* pNameA = new char[ nLen + 1 ];
- for( int i = 0; i < nLen; ++i )
- pNameA[i] = (char)(p->maFontFilePath.getStr())[i];
- pNameA[ nLen ] = 0;
- ::RemoveFontResourceA( pNameA );
- delete[] pNameA;
- }
+ ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
}
rSalData.mpTempFontItem = p->mpNextItem;
@@ -2424,14 +2295,6 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
return false;
UINT nPreferedCharSet = DEFAULT_CHARSET;
- if ( !aSalShlData.mbWNT )
- {
- // for W98 guess charset preference from active codepage
- CHARSETINFO aCharSetInfo;
- DWORD nCP = GetACP();
- if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
- nPreferedCharSet = aCharSetInfo.ciCharset;
- }
// create matching FontData struct
aDFA.mbSymbolFlag = false; // TODO: how to know it without accessing the font?
@@ -2536,24 +2399,12 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
aInfo.mnPreferedCharSet = aCharSetInfo.ciCharset;
- if ( aSalShlData.mbWNT )
- {
- LOGFONTW aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
- aInfo.mpLogFontW = &aLogFont;
- EnumFontFamiliesExW( mhDC, &aLogFont,
+ LOGFONTW aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+ aInfo.mpLogFontW = &aLogFont;
+ EnumFontFamiliesExW( mhDC, &aLogFont,
(FONTENUMPROCW)SalEnumFontsProcExW, (LPARAM)(void*)&aInfo, 0 );
- }
- else
- {
- LOGFONTA aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
- aInfo.mpLogFontA = &aLogFont;
- EnumFontFamiliesExA( mhDC, &aLogFont,
- (FONTENUMPROCA)SalEnumFontsProcExA, (LPARAM)(void*)&aInfo, 0 );
- }
// Feststellen, was es fuer Courier-Schriften auf dem Bildschirm gibt,
// um in SetFont() evt. Courier auf Courier New zu mappen
@@ -2592,12 +2443,7 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
GLYPHMETRICS aGM;
aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0;
aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0;
- DWORD nSize = GDI_ERROR;
- if ( aSalShlData.mbWNT )
- nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
- else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
- nSize = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
-
+ DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
if( nSize == GDI_ERROR )
return false;
@@ -2617,7 +2463,6 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
{
rB2DPolyPoly.clear();
- BOOL bRet = FALSE;
HDC hDC = mhDC;
// use unity matrix
@@ -2631,171 +2476,160 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
nIndex &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
- DWORD nSize1 = GDI_ERROR;
- if ( aSalShlData.mbWNT )
- nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
- else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
- nSize1 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
-
+ const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
if( !nSize1 ) // blank glyphs are ok
- bRet = TRUE;
- else if( nSize1 != GDI_ERROR )
- {
- BYTE* pData = new BYTE[ nSize1 ];
- DWORD nSize2;
- if ( aSalShlData.mbWNT )
- nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
- else
- nSize2 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
+ return TRUE;
+ else if( nSize1 == GDI_ERROR )
+ return FALSE;
- if( nSize1 == nSize2 )
- {
- bRet = TRUE;
+ BYTE* pData = new BYTE[ nSize1 ];
+ const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
+
+ if( nSize1 != nSize2 )
+ return FALSE;
+
+ // TODO: avoid tools polygon by creating B2DPolygon directly
+ int nPtSize = 512;
+ Point* pPoints = new Point[ nPtSize ];
+ BYTE* pFlags = new BYTE[ nPtSize ];
+
+ TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
+ while( (BYTE*)pHeader < pData+nSize2 )
+ {
+ // only outline data is interesting
+ if( pHeader->dwType != TT_POLYGON_TYPE )
+ break;
- int nPtSize = 512;
- Point* pPoints = new Point[ nPtSize ];
- BYTE* pFlags = new BYTE[ nPtSize ];
+ // get start point; next start points are end points
+ // of previous segment
+ USHORT nPnt = 0;
- TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
- while( (BYTE*)pHeader < pData+nSize2 )
+ long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
+ long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt++ ] = POLY_NORMAL;
+
+ bool bHasOfflinePoints = false;
+ TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
+ pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
+ while( (BYTE*)pCurve < (BYTE*)pHeader )
+ {
+ int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
+ if( nPtSize < nNeededSize )
{
- // only outline data is interesting
- if( pHeader->dwType != TT_POLYGON_TYPE )
- break;
-
- // get start point; next start points are end points
- // of previous segment
- USHORT nPnt = 0;
-
- long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
- long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt++ ] = POLY_NORMAL;
-
- bool bHasOfflinePoints = false;
- TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
- pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
- while( (BYTE*)pCurve < (BYTE*)pHeader )
+ Point* pOldPoints = pPoints;
+ BYTE* pOldFlags = pFlags;
+ nPtSize = 2 * nNeededSize;
+ pPoints = new Point[ nPtSize ];
+ pFlags = new BYTE[ nPtSize ];
+ for( USHORT i = 0; i < nPnt; ++i )
{
- int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
- if( nPtSize < nNeededSize )
- {
- Point* pOldPoints = pPoints;
- BYTE* pOldFlags = pFlags;
- nPtSize = 2 * nNeededSize;
- pPoints = new Point[ nPtSize ];
- pFlags = new BYTE[ nPtSize ];
- for( USHORT i = 0; i < nPnt; ++i )
- {
- pPoints[ i ] = pOldPoints[ i ];
- pFlags[ i ] = pOldFlags[ i ];
- }
- delete[] pOldPoints;
- delete[] pOldFlags;
- }
+ pPoints[ i ] = pOldPoints[ i ];
+ pFlags[ i ] = pOldFlags[ i ];
+ }
+ delete[] pOldPoints;
+ delete[] pOldFlags;
+ }
- int i = 0;
- if( TT_PRIM_LINE == pCurve->wType )
+ int i = 0;
+ if( TT_PRIM_LINE == pCurve->wType )
+ {
+ while( i < pCurve->cpfx )
+ {
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt ] = POLY_NORMAL;
+ ++nPnt;
+ }
+ }
+ else if( TT_PRIM_QSPLINE == pCurve->wType )
+ {
+ bHasOfflinePoints = true;
+ while( i < pCurve->cpfx )
+ {
+ // get control point of quadratic bezier spline
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ Point aControlP( nX, nY );
+
+ // calculate first cubic control point
+ // P0 = 1/3 * (PBeg + 2 * PQControl)
+ nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+0 ] = POLY_CONTROL;
+
+ // calculate endpoint of segment
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+
+ if ( i+1 >= pCurve->cpfx )
{
- while( i < pCurve->cpfx )
- {
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt ] = POLY_NORMAL;
- ++nPnt;
- }
+ // endpoint is either last point in segment => advance
+ ++i;
}
- else if( TT_PRIM_QSPLINE == pCurve->wType )
+ else
{
- bHasOfflinePoints = true;
- while( i < pCurve->cpfx )
- {
- // get control point of quadratic bezier spline
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- Point aControlP( nX, nY );
-
- // calculate first cubic control point
- // P0 = 1/3 * (PBeg + 2 * PQControl)
- nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+0 ] = POLY_CONTROL;
-
- // calculate endpoint of segment
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
-
- if ( i+1 >= pCurve->cpfx )
- {
- // endpoint is either last point in segment => advance
- ++i;
- }
- else
- {
- // or endpoint is the middle of two control points
- nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
- nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
- nX = (nX + 1) / 2;
- nY = (nY + 1) / 2;
- // no need to advance, because the current point
- // is the control point in next bezier spline
- }
-
- pPoints[ nPnt+2 ] = Point( nX, nY );
- pFlags[ nPnt+2 ] = POLY_NORMAL;
-
- // calculate second cubic control point
- // P1 = 1/3 * (PEnd + 2 * PQControl)
- nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+1 ] = POLY_CONTROL;
-
- nPnt += 3;
- }
+ // or endpoint is the middle of two control points
+ nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
+ nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
+ nX = (nX + 1) / 2;
+ nY = (nY + 1) / 2;
+ // no need to advance, because the current point
+ // is the control point in next bezier spline
}
- // next curve segment
- pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
- }
+ pPoints[ nPnt+2 ] = Point( nX, nY );
+ pFlags[ nPnt+2 ] = POLY_NORMAL;
- // end point is start point for closed contour
- // disabled, because Polygon class closes the contour itself
- // pPoints[nPnt++] = pPoints[0];
- // #i35928#
- // Added again, but add only when not yet closed
- if(pPoints[nPnt - 1] != pPoints[0])
- {
- if( bHasOfflinePoints )
- pFlags[nPnt] = pFlags[0];
+ // calculate second cubic control point
+ // P1 = 1/3 * (PEnd + 2 * PQControl)
+ nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+1 ] = POLY_CONTROL;
- pPoints[nPnt++] = pPoints[0];
+ nPnt += 3;
}
+ }
- // convert y-coordinates W32 -> VCL
- for( int i = 0; i < nPnt; ++i )
- pPoints[i].Y() = -pPoints[i].Y();
+ // next curve segment
+ pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
+ }
- // insert into polypolygon
- Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
- // convert to B2DPolyPolygon
- // TODO: get rid of the intermediate PolyPolygon
- rB2DPolyPoly.append( aPoly.getB2DPolygon() );
- }
+ // end point is start point for closed contour
+ // disabled, because Polygon class closes the contour itself
+ // pPoints[nPnt++] = pPoints[0];
+ // #i35928#
+ // Added again, but add only when not yet closed
+ if(pPoints[nPnt - 1] != pPoints[0])
+ {
+ if( bHasOfflinePoints )
+ pFlags[nPnt] = pFlags[0];
- delete[] pPoints;
- delete[] pFlags;
+ pPoints[nPnt++] = pPoints[0];
}
- delete[] pData;
+ // convert y-coordinates W32 -> VCL
+ for( int i = 0; i < nPnt; ++i )
+ pPoints[i].Y() = -pPoints[i].Y();
+
+ // insert into polypolygon
+ Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
+ // convert to B2DPolyPolygon
+ // TODO: get rid of the intermediate PolyPolygon
+ rB2DPolyPoly.append( aPoly.getB2DPolygon() );
}
+ delete[] pPoints;
+ delete[] pFlags;
+
+ delete[] pData;
+
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
@@ -2803,7 +2637,7 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
- return bRet;
+ return TRUE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 8197fb37cd6d..97e3e1b48c79 100755
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -188,6 +188,8 @@ void SalData::deInitNWF( void )
iter++;
}
aThemeMap.clear();
+ if( maDwmLib )
+ osl_unloadModule( maDwmLib );
}
static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
@@ -286,6 +288,22 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL ||
+ nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -867,15 +885,23 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_MENUBAR )
{
- if( nPart != PART_ENTIRE_CONTROL )
- return FALSE;
-
- if( aValue.getType() == CTRL_MENUBAR )
+ if( nPart == PART_ENTIRE_CONTROL )
{
- const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
- rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ if( aValue.getType() == CTRL_MENUBAR )
+ {
+ const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+ rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ }
+ return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
}
- return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
if( nType == CTRL_PROGRESS )
@@ -954,6 +980,69 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption );
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_ENTIRE_CONTROL )
+ {
+ RECT aGutterRC = rc;
+ aGutterRC.left += aValue.getNumericVal();
+ aGutterRC.right = aGutterRC.left+3;
+ return
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, aCaption ) &&
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption )
+ ;
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption );
+ }
+ else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ if( (nState & CTRL_STATE_PRESSED) )
+ {
+ RECT aBGRect = rc;
+ if( aValue.getType() == CTRL_MENU_POPUP )
+ {
+ const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) );
+ aBGRect.left = rMVal.maItemRect.Left();
+ aBGRect.top = rMVal.maItemRect.Top();
+ aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl
+ aBGRect.right = rMVal.getNumericVal();
+
+ // FIXME: magic
+ aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1;
+ }
+ iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED;
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
+ if( nPart == PART_MENU_ITEM_CHECK_MARK )
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED;
+ else
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption );
+ }
+ else
+ return true; // unchecked: do nothing
+ }
+ else if( nPart == PART_MENU_SEPARATOR )
+ {
+ rc.left += aValue.getNumericVal(); // adjust for gutter position
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) );
+ // center the separator inside the passed rectangle
+ long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2;
+ rc.top += nDY;
+ rc.bottom = rc.top+aRect.GetHeight()-1;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPSEPARATOR, 0, rc, aCaption );
+ }
+ }
+ }
+
return false;
}
@@ -1027,6 +1116,11 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -1040,6 +1134,16 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
hTheme = getThemeHandle( mhWnd, L"Trackbar" );
break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR
+ )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
default:
hTheme = NULL;
break;
@@ -1196,7 +1300,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
if( hTheme )
{
- // get borderr size
+ // get border size
Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
@@ -1225,6 +1329,29 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
}
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ HTHEME hTheme = getThemeHandle( mhWnd, L"Menu");
+ Rectangle aBoxRect( rControlRegion );
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPCHECK,
+ MC_CHECKMARKNORMAL,
+ aBoxRect ) );
+ if( aBoxRect.GetWidth() && aBoxRect.GetHeight() )
+ {
+ rNativeContentRegion = aRect;
+ rNativeBoundingRegion = rNativeContentRegion;
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+
if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) )
{
HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar");
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 82fa9bb4b5e1..a4c588f059d4 100644..100755
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -244,24 +244,11 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- HFONT hHugeFont = 0;
- if( aSalShlData.mbWNT )
- {
- LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectW( &aLogFont);
- }
- else
- {
- LOGFONTA aLogFont;
- ::GetObjectA( mhFont, sizeof(LOGFONTA), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectA( &aLogFont);
- }
-
+ LOGFONTW aLogFont;
+ ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
+ aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
+ aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
+ HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -671,57 +658,31 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #108267#, limit the number of glyphs to avoid paint errors
- UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
- if( mnDrawOptions || aSalShlData.mbWNT )
- {
- // #108267#, break up into glyph portions of a limited size required by Win32 API
- const unsigned int maxGlyphCount = 8192;
- UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
- UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
-
- if( numGlyphPortions )
- {
- // #108267#,#109387# break up string into smaller chunks
- // the output positions will be updated by windows (SetTextAlign)
- unsigned int i,n;
- POINT oldPos;
- UINT oldTa = ::GetTextAlign( aHDC );
- ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
- ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
- for( i=n=0; n<numGlyphPortions; n++, i+=maxGlyphCount )
- ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ // #108267#, break up into glyph portions of a limited size required by Win32 API
+ const unsigned int maxGlyphCount = 8192;
+ UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
+ UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
+
+ if( numGlyphPortions )
+ {
+ // #108267#,#109387# break up string into smaller chunks
+ // the output positions will be updated by windows (SetTextAlign)
+ POINT oldPos;
+ UINT oldTa = ::GetTextAlign( aHDC );
+ ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
+ ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
+ unsigned int i = 0;
+ for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
- ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign( aHDC, oldTa );
- }
- else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
+ mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
+ ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ ::SetTextAlign( aHDC, oldTa );
}
else
- {
- // #108267#, On Win9x, we get paint errors when drawing huge strings, even when
- // split into pieces (see above), seems to be a problem in the internal text clipping
- // so we just cut off the string
- if( !mpGlyphOrigAdvs )
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs, limitedGlyphCount, NULL );
- else
- {
- // workaround for problem in #106259#
- long nXPos = mnBaseAdv;
- for( unsigned int i = 0; i < limitedGlyphCount; ++i )
- {
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs+i, 1, NULL );
- nXPos += mpGlyphAdvances[ i ];
- aPos = GetDrawPosition( Point( nXPos, 0 ) );
- }
- }
- }
+ ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
+ mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index f0ca1d68ef41..89a191c99ef6 100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -508,7 +508,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
}
// create frame
- if ( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
LPCWSTR pClassName;
if ( bSubFrame )
@@ -536,17 +536,6 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ );
#endif
}
- else
- {
- LPCSTR pClassName;
- if ( bSubFrame )
- pClassName = SAL_SUBFRAME_CLASSNAMEA;
- else
- pClassName = SAL_FRAME_CLASSNAMEA;
- hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, pInst->mhInst, (void*)pFrame );
- }
if ( !hWnd )
{
delete pFrame;
@@ -617,21 +606,10 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
nExSysStyle = 0;
}
- HWND hWnd = NULL;
- if ( aSalShlData.mbWNT )
- {
- LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
- hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
+ LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
+ HWND hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
- }
- else
- {
- LPCSTR pClassName = SAL_SUBFRAME_CLASSNAMEA;
- hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
- }
return hWnd;
}
@@ -2531,7 +2509,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
int nKeyLen = 0;
if ( lParam )
{
- if ( aSalShlData.mbWNT )
+ if ( true/*aSalShlData.mbWNT*/ )
{
nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen );
// #i12401# the current unicows.dll has a bug in CharUpperBuffW, which corrupts the stack
@@ -2553,32 +2531,6 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
}
}
}
- else // !mbWnt
- {
- sal_Char aAnsiKeyBuf[ nMaxKeyLen ];
- int nAnsiKeyLen = GetKeyNameTextA( lParam, aAnsiKeyBuf, nMaxKeyLen );
- DBG_ASSERT( nAnsiKeyLen <= nMaxKeyLen, "Invalid key name length!" );
- if( nAnsiKeyLen > nMaxKeyLen )
- nAnsiKeyLen = 0;
- else if( nAnsiKeyLen > 0 )
- {
- // Capitalize just the first letter of key names
- // TODO: check MCBS key names
- CharLowerBuffA( aAnsiKeyBuf, nAnsiKeyLen );
-
- bool bUpper = true;
- for( sal_Char *pA=aAnsiKeyBuf, *pE=pA+nAnsiKeyLen; pA < pE; ++pA )
- {
- if( bUpper )
- CharUpperBuffA( pA, 1 );
- bUpper = (*pA=='+') || (*pA=='-') || (*pA==' ') || (*pA=='.');
- }
-
- // Convert to Unicode and copy the data in the Unicode Buffer
- nKeyLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
- aAnsiKeyBuf, nAnsiKeyLen, aKeyBuf, nMaxKeyLen );
- }
- }
}
if ( (nKeyLen > 0) || pReplace )
@@ -2883,6 +2835,29 @@ static long ImplA2I( const BYTE* pStr )
}
// -----------------------------------------------------------------------
+static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( WIN_BOOL* pOut )
+{
+ *pOut = FALSE;
+ return S_OK;
+}
+
+static WIN_BOOL ImplDwmIsCompositionEnabled()
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpDwmIsCompositionEnabled )
+ {
+ rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
+ pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ if( pSalData->maDwmLib )
+ pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
+ if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
+ pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
+ }
+ WIN_BOOL aResult = FALSE;
+ HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
+ return nError == S_OK && aResult;
+}
+
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
@@ -2915,30 +2890,26 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
}
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
// TODO: once those options vanish: just set bCompBorder to TRUE
// to have the system colors read
aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() );
- if ( bCompBorder )
- {
- aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
- aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
- aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
- if ( aSalShlData.mnVersion >= 410 )
- {
- aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
- }
- aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
- aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
- aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
- aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
- }
+ aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
+ aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
+ aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
+ if ( aSalShlData.mnVersion >= 410 )
+ {
+ aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
+ }
+ aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
+ aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
+ aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+ aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_APPWORKSPACE ) ) );
aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
@@ -2960,37 +2931,52 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
- aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
- aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
- aStyleSettings.SetUseFlatBorders( FALSE );
- aStyleSettings.SetUseFlatMenues( FALSE );
- aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
- aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
- if ( aSalShlData.mbWXP )
+
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 0;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+ GetSalData()->mbThemeMenuSupport = FALSE;
+ aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
+ aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
+ aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
+ aStyleSettings.SetUseFlatBorders( FALSE );
+ aStyleSettings.SetUseFlatMenues( FALSE );
+ aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
+ aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
+ if ( aSalShlData.mbWXP )
+ {
+ // only xp supports a different menu bar color
+ long bFlatMenues = 0;
+ SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
+ if( bFlatMenues )
{
- // only xp supports a different menu bar color
- long bFlatMenues = 0;
- SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
- if( bFlatMenues )
- {
- aStyleSettings.SetUseFlatMenues( TRUE );
- aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
- aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
- aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
-
- // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
- // this is not active in the classic style appearance
- aStyleSettings.SetUseFlatBorders( TRUE );
- }
+ aStyleSettings.SetUseFlatMenues( TRUE );
+ aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
+ aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
+ aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+
+ // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
+ // this is not active in the classic style appearance
+ aStyleSettings.SetUseFlatBorders( TRUE );
}
}
+ // check if vista or newer runs
+ // in Aero theme (and similar ?) the menu text color does not change
+ // for selected items; also on WinXP and earlier menus are not themed
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 &&
+ ImplDwmIsCompositionEnabled()
+ )
+ {
+ // in aero menuitem highlight text is drawn in the same color as normal
+ aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 2;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+ GetSalData()->mbThemeMenuSupport = TRUE;
+ }
// Bei hellgrau geben wir die Farbe vor, damit es besser aussieht
if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY )
aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
@@ -3027,7 +3013,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
Font aAppFont = aStyleSettings.GetAppFont();
Font aIconFont = aStyleSettings.GetIconFont();
HDC hDC = GetDC( 0 );
- if ( aSalShlData.mbWNT )
+ if( true/*aSalShlData.mbWNT*/ )
{
NONCLIENTMETRICSW aNonClientMetrics;
aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
@@ -3044,23 +3030,6 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont );
}
}
- else
- {
- NONCLIENTMETRICSA aNonClientMetrics;
- aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
- if ( SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
- {
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
- ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
-
- LOGFONTA aLogFont;
- if ( SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
- ImplSalUpdateStyleFontA( hDC, aLogFont, aIconFont );
- }
- }
// get screen font resolution to calculate toolbox item size
long nDPIY = GetDeviceCaps( hDC, LOGPIXELSY );
@@ -3649,27 +3618,7 @@ static void ImplUpdateInputLang( WinSalFrame* pFrame )
// If we are on Windows NT we use Unicode FrameProcs and so we
// get Unicode charcodes directly from Windows
// no need to set up a code page
- if ( aSalShlData.mbWNT )
- return;
-
- if ( !nLang )
- {
- pFrame->mnInputLang = 0;
- pFrame->mnInputCodePage = GetACP();
- }
- else if ( bLanguageChange )
- {
- sal_Char aBuf[10];
- if ( GetLocaleInfoA( MAKELCID( nLang, SORT_DEFAULT ), LOCALE_IDEFAULTANSICODEPAGE,
- aBuf, sizeof(aBuf) ) > 0 )
- {
- pFrame->mnInputCodePage = ImplStrToNum( aBuf );
- if ( !pFrame->mnInputCodePage )
- pFrame->mnInputCodePage = GetACP();
- }
- else
- pFrame->mnInputCodePage = GetACP();
- }
+ return;
}
@@ -3679,29 +3628,7 @@ static sal_Unicode ImplGetCharCode( WinSalFrame* pFrame, WPARAM nCharCode )
// If we are on Windows NT we use Unicode FrameProcs and so we
// get Unicode charcodes directly from Windows
- if ( aSalShlData.mbWNT )
- return (sal_Unicode)nCharCode;
-
- sal_Char aCharBuf[2];
- int nCharLen;
- WCHAR c;
- if ( nCharCode > 0xFF )
- {
- aCharBuf[0] = (sal_Char)(nCharCode>>8);
- aCharBuf[1] = (sal_Char)nCharCode;
- nCharLen = 2;
- }
- else
- {
- aCharBuf[0] = (sal_Char)nCharCode;
- nCharLen = 1;
- }
- if ( ::MultiByteToWideChar( pFrame->mnInputCodePage,
- MB_PRECOMPOSED,
- aCharBuf, nCharLen, &c, 1 ) )
- return (sal_Unicode)c;
- else
- return (sal_Unicode)nCharCode;
+ return (sal_Unicode)nCharCode;
}
// -----------------------------------------------------------------------
@@ -4507,16 +4434,8 @@ static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
{
if ( lParam )
{
- if ( aSalShlData.mbWNT )
- {
if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 )
nSalEvent = SALEVENT_PRINTERCHANGED;
- }
- else
- {
- if ( stricmp( (const char*)lParam, "devices" ) == 0 )
- nSalEvent = SALEVENT_PRINTERCHANGED;
- }
}
}
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index 6d00242ef313..bf0f29bb72d3 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -534,20 +534,10 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
// Hook installieren, wenn es das erste SalObject ist
if ( !pSalData->mpFirstObject )
{
- if ( aSalShlData.mbWNT )
- {
- pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
- SalSysMsgProc,
- pSalData->mhInst,
- pSalData->mnAppThreadId );
- }
- else
- {
- pSalData->mhSalObjMsgHook = SetWindowsHookExA( WH_CALLWNDPROC,
+ pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
SalSysMsgProc,
pSalData->mhInst,
pSalData->mnAppThreadId );
- }
}
if ( !pSalData->mbObjClassInit )
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 10e7cefa591f..0f7221552923 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -73,8 +73,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
try
{
// use the oox.core.FilterDetect implementation to extract the decrypted ZIP package
- uno::Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
- ::oox::core::FilterDetect aDetector( xFactory );
+ ::oox::core::FilterDetect aDetector( m_xContext );
xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc );
}
catch( uno::Exception& )
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index b7046a495bd8..b00fd433c884 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns:rng="http://relaxng.org/ns/structure/1.0">
- <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="XML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="RELATIONSHIPS"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="OFFICE"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="THEME"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="DOC_DRAWINGML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="DRAWINGML"/>
- <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="VML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="PICTURE"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="VML_DOC"/>
- <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="DOC"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="MATH"/>
- <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="SML"/>
- <namespace-alias name="http://sprm" alias="sprm" id="SPRM"/>
+ <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="xml"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="officeRel"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="vmlOffice"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="officeRelTheme"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="dmlWordDr"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="dml"/>
+ <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="vml"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="dmlPicture"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="vmlWord"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="doc"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="officeMath"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="schema"/>
+ <namespace-alias name="http://sprm" alias="sprm" id="sprm"/>
<token tokenid="ooxml:shape"/>
<token tokenid="ooxml:token"/>
<token tokenid="ooxml:inputstream"/>
diff --git a/writerfilter/source/ooxml/namespaceids.xsl b/writerfilter/source/ooxml/namespaceids.xsl
index 45828761da0c..4a1f3b2ba381 100644
--- a/writerfilter/source/ooxml/namespaceids.xsl
+++ b/writerfilter/source/ooxml/namespaceids.xsl
@@ -67,7 +67,7 @@ const sal_uInt32 </xsl:text>
<xsl:call-template name="namespaceid"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="@id"/>
-<xsl:text> &lt;&lt; 16;</xsl:text>
+<xsl:text>;</xsl:text>
</xsl:for-each>
</xsl:template>
diff --git a/writerfilter/source/resourcemodel/namespace_preprocess.pl b/writerfilter/source/resourcemodel/namespace_preprocess.pl
index 22c172329f61..66644b70fd47 100644
--- a/writerfilter/source/resourcemodel/namespace_preprocess.pl
+++ b/writerfilter/source/resourcemodel/namespace_preprocess.pl
@@ -30,31 +30,16 @@ EOF
# print the mapping
open ( NAMESPACES, $ARGV0 ) || die "can't open namespace file: $!";
-$group = 0;
-$i = 1;
while ( <NAMESPACES> )
{
chomp( $_ );
- $_ =~ s/\s*//g;
- if ( $_ =~ m/^$/ )
- {
- # Start a new group
- $i = 0;
- $group++;
- }
- elsif ( $_ =~ m/^[^#]/ )
- {
- # Neither an empty line nor a comment
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
- $_ =~ s/-/_/g;
- $no = $group*10 + $i;
- print <<EOF;
- <xsl:when test="\$id = '$_'">
- <xsl:text>$no</xsl:text>
+ # line format is: numeric-id short-name namespace-URL
+ $_ =~ /^([0-9]+)\s+([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
+ print <<EOF;
+ <xsl:when test="\$id = '$2'">
+ <xsl:text>$1</xsl:text>
</xsl:when>
EOF
- ++$i;
- }
}
print <<EOF;
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index f1113c1e114f..d798f6c42f81 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -42,6 +42,7 @@
#include <string.h>
// Extensible help
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -1587,10 +1588,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
if( !m_bUserPackagesLoaded )
{
- Reference< XPackageManager > xUserManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
- m_aUserPackagesSeq = xUserManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext);
+ m_aUserPackagesSeq = xExtensionManager->getDeployedExtensions
+ ( rtl::OUString::createFromAscii("user"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
m_bUserPackagesLoaded = true;
}
@@ -1616,10 +1616,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
if( !m_bSharedPackagesLoaded )
{
- Reference< XPackageManager > xSharedManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
- m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext);
+ m_aSharedPackagesSeq = xExtensionManager->getDeployedExtensions
+ ( rtl::OUString::createFromAscii("shared"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
m_bSharedPackagesLoaded = true;
}
@@ -1645,10 +1644,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP
if( !m_bBundledPackagesLoaded )
{
- Reference< XPackageManager > xBundledManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("bundled") );
- m_aBundledPackagesSeq = xBundledManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext);
+ m_aBundledPackagesSeq = xExtensionManager->getDeployedExtensions
+ ( rtl::OUString::createFromAscii("bundled"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
m_bBundledPackagesLoaded = true;
}
diff --git a/xmloff/source/forms/handler/property_handler_base.cxx b/xmloff/source/forms/handler/property_handler_base.cxx
index d599e0e259fe..d599e0e259fe 100755..100644
--- a/xmloff/source/forms/handler/property_handler_base.cxx
+++ b/xmloff/source/forms/handler/property_handler_base.cxx
diff --git a/xmloff/source/forms/handler/vcl_date_handler.cxx b/xmloff/source/forms/handler/vcl_date_handler.cxx
index a8404ed04e05..a8404ed04e05 100755..100644
--- a/xmloff/source/forms/handler/vcl_date_handler.cxx
+++ b/xmloff/source/forms/handler/vcl_date_handler.cxx
diff --git a/xmloff/source/forms/handler/vcl_date_handler.hxx b/xmloff/source/forms/handler/vcl_date_handler.hxx
index 44a7f7395ceb..44a7f7395ceb 100755..100644
--- a/xmloff/source/forms/handler/vcl_date_handler.hxx
+++ b/xmloff/source/forms/handler/vcl_date_handler.hxx
diff --git a/xmloff/source/forms/handler/vcl_time_handler.cxx b/xmloff/source/forms/handler/vcl_time_handler.cxx
index 98ea739d04a4..98ea739d04a4 100755..100644
--- a/xmloff/source/forms/handler/vcl_time_handler.cxx
+++ b/xmloff/source/forms/handler/vcl_time_handler.cxx
diff --git a/xmloff/source/forms/handler/vcl_time_handler.hxx b/xmloff/source/forms/handler/vcl_time_handler.hxx
index 7ed6f0aa5730..7ed6f0aa5730 100755..100644
--- a/xmloff/source/forms/handler/vcl_time_handler.hxx
+++ b/xmloff/source/forms/handler/vcl_time_handler.hxx
diff --git a/xmloff/source/forms/property_group.hxx b/xmloff/source/forms/property_group.hxx
index bca354f14e92..bca354f14e92 100755..100644
--- a/xmloff/source/forms/property_group.hxx
+++ b/xmloff/source/forms/property_group.hxx
diff --git a/xmloff/source/forms/property_meta_data.hxx b/xmloff/source/forms/property_meta_data.hxx
index f246a7bfd745..f246a7bfd745 100755..100644
--- a/xmloff/source/forms/property_meta_data.hxx
+++ b/xmloff/source/forms/property_meta_data.hxx
diff --git a/xmlreader/prj/d.lst b/xmlreader/prj/d.lst
index fcb99bd30266..fcb99bd30266 100755..100644
--- a/xmlreader/prj/d.lst
+++ b/xmlreader/prj/d.lst
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 71ff13fb3f82..d4bc76e627b5 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -895,7 +895,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: buildC
if (pChainContext)
CertFreeCertificateChain(pChainContext);
- return NULL ;
+ return Sequence< Reference < XCertificate > >();
}
Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: createCertificateFromRaw( const Sequence< sal_Int8 >& rawCertificate ) throw( SecurityException , RuntimeException ) {
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d5928b027075..48d27e4e6737 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -206,7 +206,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
return serial ;
} else {
- return NULL ;
+ return Sequence< sal_Int8 >();
}
}
@@ -367,7 +367,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
return issuerUid ;
} else {
- return NULL ;
+ return Sequence< sal_Int8 >();
}
}
@@ -379,7 +379,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
return subjectUid ;
} else {
- return NULL ;
+ return Sequence< sal_Int8 >();
}
}
@@ -403,7 +403,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
return xExtns ;
} else {
- return NULL ;
+ return Sequence< Reference< XCertificateExtension > >();
}
}
@@ -443,7 +443,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
return rawCert ;
} else {
- return NULL ;
+ return Sequence< sal_Int8 >();
}
}
@@ -548,7 +548,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
}
}
- return NULL;
+ return Sequence< sal_Int8 >();
}
::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl::getSubjectPublicKeyAlgorithm()
@@ -582,7 +582,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
}
else
{
- return NULL ;
+ return Sequence< sal_Int8 >();
}
}