summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Module_ooo.mk1
-rw-r--r--Repository.mk6
-rw-r--r--RepositoryFixes.mk12
-rw-r--r--autodoc/source/parser_i/idoc/docu_pe2.cxx126
-rw-r--r--autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx9
-rw-r--r--basctl/source/basicide/baside2b.cxx1
-rw-r--r--basctl/source/basicide/basidesh.cxx5
-rw-r--r--basctl/source/basicide/bastype2.cxx2
-rw-r--r--basic/source/app/app.cxx9
-rw-r--r--basic/source/app/app.hxx1
-rw-r--r--basic/source/app/appwin.cxx8
-rw-r--r--basic/source/runtime/dllmgr.cxx17
-rwxr-xr-xbasic/source/runtime/step2.cxx2
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx5
-rwxr-xr-xcanvas/source/directx/dx_textlayout_drawhelper.cxx7
-rw-r--r--canvas/source/vcl/canvasfont.cxx5
-rwxr-xr-x[-rw-r--r--]cli_ure/version/version.txt24
-rw-r--r--codemaker/source/bonobowrappermaker/corbaoptions.cxx3
-rw-r--r--codemaker/source/cppumaker/cppuoptions.cxx17
-rw-r--r--codemaker/source/cunomaker/cunooptions.cxx5
-rw-r--r--codemaker/source/idlmaker/idloptions.cxx5
-rw-r--r--codemaker/source/javamaker/javaoptions.cxx17
-rw-r--r--configure.in29
-rw-r--r--cppcanvas/inc/cppcanvas/renderer.hxx3
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx10
-rw-r--r--cpputools/source/registercomponent/registercomponent.cxx4
-rw-r--r--cui/source/tabpages/numpages.cxx11
-rwxr-xr-x[-rw-r--r--]cui/source/tabpages/page.cxx7
-rw-r--r--desktop/os2/source/applauncher/makefile.mk6
-rw-r--r--desktop/os2/source/applauncher/os2quickstart.cxx (renamed from desktop/os2/source/applauncher/quickstart.cxx)0
-rw-r--r--desktop/prj/build.lst5
-rw-r--r--desktop/prj/d.lst7
-rw-r--r--desktop/source/app/app.cxx12
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx2
-rw-r--r--desktop/util/ooverinfo.rc2
-rwxr-xr-xdesktop/util/ooverinfo2.rc2
-rw-r--r--[-rwxr-xr-x]desktop/util/verinfo.rc4
-rw-r--r--desktop/win32/source/QuickStart/OOQuickStart.rc (renamed from sysui/source/win32/QuickStart/OOQuickStart.rc)8
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.cpp (renamed from sysui/source/win32/QuickStart/QuickStart.cpp)0
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.h (renamed from sysui/source/win32/QuickStart/QuickStart.h)0
-rw-r--r--desktop/win32/source/QuickStart/StdAfx.h (renamed from sysui/source/win32/QuickStart/StdAfx.h)0
-rw-r--r--desktop/win32/source/QuickStart/makefile.mk (renamed from sysui/source/win32/QuickStart/makefile.mk)0
-rw-r--r--desktop/win32/source/QuickStart/resource.h (renamed from sysui/source/win32/QuickStart/resource.h)0
-rw-r--r--desktop/win32/source/QuickStart/so/QuickStart.rc (renamed from sysui/source/win32/QuickStart/so/QuickStart.rc)8
-rw-r--r--desktop/win32/source/QuickStart/so/makefile.mk (renamed from sysui/source/win32/QuickStart/so/makefile.mk)4
-rw-r--r--desktop/win32/source/applauncher/makefile.mk4
-rw-r--r--desktop/win32/source/guiloader/makefile.mk4
-rw-r--r--dmake/config.h.in3
-rwxr-xr-xdmake/configure2
-rwxr-xr-xdmake/configure.in2
-rw-r--r--dmake/dmake.c50
-rw-r--r--dmake/expand.c668
-rw-r--r--dmake/function.c68
-rw-r--r--dmake/infer.c389
-rw-r--r--dmake/parse.c204
-rw-r--r--dmake/rulparse.c779
-rw-r--r--dmake/sysintf.c22
-rw-r--r--dmake/unix/runargv.c171
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx2
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx20
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx2
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx5
-rw-r--r--dtrans/source/win32/dtobj/XTDataObject.cxx2
-rw-r--r--dtrans/source/win32/dtobj/XTDataObject.hxx2
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/fontitem.hxx21
-rwxr-xr-x[-rw-r--r--]editeng/inc/editeng/svxacorr.hxx1
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/editobj.cxx4
-rw-r--r--editeng/source/editeng/edtspell.cxx7
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/edtspell.hxx1
-rwxr-xr-xediteng/source/editeng/impedit4.cxx10
-rwxr-xr-x[-rw-r--r--]editeng/source/editeng/textconv.cxx10
-rw-r--r--editeng/source/items/numitem.cxx2
-rwxr-xr-x[-rw-r--r--]editeng/source/items/textitem.cxx20
-rwxr-xr-x[-rw-r--r--]editeng/source/misc/svxacorr.cxx51
-rwxr-xr-x[-rw-r--r--]editeng/source/uno/unofdesc.cxx10
-rw-r--r--extensions/source/ole/unoobjw.cxx2
-rw-r--r--filter/source/docbook/sofftodocbookheadings.xsl87
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_draw.xsl4
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_draw.xsl4
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl1610
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl118
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl113
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/header.xsl9
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl2
-rw-r--r--filter/source/xsltdialog/xmlfilterjar.cxx16
-rw-r--r--filter/source/xsltfilter/Manifest2
-rw-r--r--filter/source/xsltfilter/com/sun/star/comp/xsltfilter/Base64.java (renamed from filter/source/xsltfilter/Base64.java)2
-rw-r--r--filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java (renamed from filter/source/xsltfilter/XSLTFilterOLEExtracter.java)2
-rw-r--r--filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java (renamed from filter/source/xsltfilter/XSLTransformer.java)57
-rw-r--r--filter/source/xsltfilter/makefile.mk10
-rw-r--r--framework/inc/services/substitutepathvars.hxx205
-rwxr-xr-xframework/qa/complex/path_substitution/PathSubstitutionTest.java24
-rw-r--r--framework/qa/unoapi/makefile.mk48
-rw-r--r--framework/source/services/substitutepathvars.cxx329
-rw-r--r--graphite/graphite-2.3.1_debug.patch13
-rw-r--r--graphite/makefile.mk2
-rw-r--r--idlc/inc/idlc/idlctypes.hxx2
-rw-r--r--idlc/inc/idlc/options.hxx17
-rw-r--r--idlc/source/astexpression.cxx21
-rw-r--r--idlc/source/idlcmain.cxx19
-rw-r--r--idlc/source/options.cxx547
-rw-r--r--idlc/source/preproc/eval.c15
-rw-r--r--idlc/source/preproc/lex.c10
-rw-r--r--idlc/source/preproc/unix.c1
-rw-r--r--instsetoo_native/util/openoffice.lst8
-rw-r--r--moz/prj/d.lst19
-rw-r--r--odk/examples/CLI/CSharp/Spreadsheet/Makefile15
-rw-r--r--odk/examples/CLI/VB.NET/WriterDemo/Makefile7
-rw-r--r--odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components10
-rw-r--r--odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java32
-rw-r--r--odk/examples/DevelopersGuide/Charts/Makefile36
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components8
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java36
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile39
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile41
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx56
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile41
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java18
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components8
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/Makefile44
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx67
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx21
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components11
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/Makefile57
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java22
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components8
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java14
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile10
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/Makefile2
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components8
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java17
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile23
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile4
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk21
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components8
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java14
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile10
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile47
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx58
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile2
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile2
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java18
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/SampleFilter.components10
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile38
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx53
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx58
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile46
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java14
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile44
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile115
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java32
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java32
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java32
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile38
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini2
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc2
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components9
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java24
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components8
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java63
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/Makefile20
-rw-r--r--odk/examples/cpp/DocumentLoader/DocumentLoader.cxx39
-rw-r--r--odk/examples/cpp/DocumentLoader/Makefile37
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/Makefile55
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/exports.cxx65
-rw-r--r--odk/examples/cpp/counter/Makefile42
-rw-r--r--odk/examples/cpp/counter/counter.cxx58
-rw-r--r--odk/examples/cpp/counter/countermain.cxx68
-rw-r--r--odk/examples/cpp/remoteclient/Makefile65
-rw-r--r--odk/examples/cpp/remoteclient/remoteclient.cxx54
-rwxr-xr-x[-rw-r--r--]odk/examples/java/EmbedDocument/EmbeddedObject/Makefile12
-rw-r--r--odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components8
-rwxr-xr-xodk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java14
-rw-r--r--odk/examples/java/MinimalComponent/Makefile18
-rw-r--r--odk/examples/java/MinimalComponent/MinimalComponent.components8
-rw-r--r--odk/examples/java/MinimalComponent/MinimalComponent.java14
-rw-r--r--odk/examples/java/PropertySet/Makefile10
-rw-r--r--odk/examples/java/PropertySet/PropTest.components8
-rw-r--r--odk/examples/java/PropertySet/PropTest.java14
-rw-r--r--odk/examples/java/Spreadsheet/CalcAddins.components9
-rw-r--r--odk/examples/java/Spreadsheet/CalcAddins.java16
-rw-r--r--odk/examples/java/Spreadsheet/Makefile58
-rw-r--r--odk/examples/java/ToDo/Makefile10
-rw-r--r--odk/examples/java/ToDo/ToDo.components8
-rw-r--r--odk/examples/java/ToDo/ToDo.java12
-rw-r--r--odk/settings/component.uno.def1
-rw-r--r--odk/settings/settings.mk65
-rw-r--r--odk/util/check.pl2
-rw-r--r--odk/util/makefile.pmk2
-rw-r--r--offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl2
-rw-r--r--offapi/com/sun/star/animations/XAnimationListener.idl2
-rw-r--r--offapi/com/sun/star/awt/EnhancedMouseEvent.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlButtonModel.idl12
-rw-r--r--offapi/com/sun/star/awt/UnoControlCheckBoxModel.idl8
-rw-r--r--offapi/com/sun/star/awt/UnoControlComboBoxModel.idl4
-rw-r--r--offapi/com/sun/star/awt/UnoControlContainerModel.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl10
-rw-r--r--offapi/com/sun/star/awt/UnoControlDateFieldModel.idl12
-rw-r--r--offapi/com/sun/star/awt/UnoControlDialogModel.idl6
-rw-r--r--offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlEditModel.idl14
-rw-r--r--offapi/com/sun/star/awt/UnoControlFileControlModel.idl6
-rw-r--r--offapi/com/sun/star/awt/UnoControlFixedHyperlinkModel.idl4
-rw-r--r--offapi/com/sun/star/awt/UnoControlFixedTextModel.idl4
-rw-r--r--offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl10
-rw-r--r--offapi/com/sun/star/awt/UnoControlImageControlModel.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlListBoxModel.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl10
-rw-r--r--offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl6
-rw-r--r--offapi/com/sun/star/awt/UnoControlProgressBarModel.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlRadioButtonModel.idl8
-rw-r--r--offapi/com/sun/star/awt/UnoControlScrollBarModel.idl12
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/awt/UnoControlSpinButtonModel.idl2
-rw-r--r--offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl12
-rw-r--r--offapi/com/sun/star/awt/XEnhancedMouseClickHandler.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridColumn.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridColumnEvent.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridDataEvent.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridInvalidDataException.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridInvalidModelException.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGrid.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGridModel.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumn.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnListener.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnModel.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridControl.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataListener.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataModel.idl2
-rw-r--r--offapi/com/sun/star/configuration/DefaultProvider.idl4
-rw-r--r--offapi/com/sun/star/configuration/Update.idl2
-rw-r--r--offapi/com/sun/star/configuration/XUpdate.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/InteractionHandler.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/Layer.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/LayerFilter.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/MergeRecoveryRequest.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/Schema.idl2
-rw-r--r--offapi/com/sun/star/configuration/backend/StratumCreationException.idl2
-rw-r--r--offapi/com/sun/star/deployment/DeploymentException.idl2
-rw-r--r--offapi/com/sun/star/deployment/ExtensionManager.idl2
-rw-r--r--offapi/com/sun/star/deployment/ExtensionRemovedException.idl2
-rw-r--r--offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl2
-rw-r--r--offapi/com/sun/star/deployment/PackageRegistryBackend.idl2
-rw-r--r--offapi/com/sun/star/deployment/PlatformException.idl2
-rw-r--r--offapi/com/sun/star/deployment/XExtensionManager.idl2
-rwxr-xr-xoffapi/com/sun/star/deployment/XPackage.idl4
-rw-r--r--offapi/com/sun/star/deployment/XPackageManager.idl2
-rw-r--r--offapi/com/sun/star/deployment/XPackageManagerFactory.idl2
-rw-r--r--offapi/com/sun/star/deployment/XPackageRegistry.idl2
-rw-r--r--offapi/com/sun/star/deployment/XPackageTypeInfo.idl2
-rw-r--r--offapi/com/sun/star/deployment/thePackageManagerFactory.idl2
-rw-r--r--offapi/com/sun/star/deployment/ui/PackageManagerDialog.idl2
-rw-r--r--offapi/com/sun/star/deployment/ui/UpdateRequiredDialog.idl2
-rw-r--r--offapi/com/sun/star/document/CorruptedFilterConfigurationException.idl2
-rw-r--r--offapi/com/sun/star/document/DocumentEvent.idl2
-rw-r--r--offapi/com/sun/star/document/XDocumentEventBroadcaster.idl2
-rw-r--r--offapi/com/sun/star/document/XDocumentEventListener.idl2
-rw-r--r--offapi/com/sun/star/document/XMLBasicExporter.idl2
-rw-r--r--offapi/com/sun/star/document/XMLBasicImporter.idl2
-rw-r--r--offapi/com/sun/star/document/XMLOasisBasicExporter.idl2
-rw-r--r--offapi/com/sun/star/document/XMLOasisBasicImporter.idl2
-rw-r--r--offapi/com/sun/star/form/FormComponent.idl2
-rw-r--r--offapi/com/sun/star/form/XErrorListener.idl1
-rw-r--r--offapi/com/sun/star/form/component/GridControl.idl2
-rw-r--r--offapi/com/sun/star/form/inspection/DefaultFormComponentInspectorModel.idl4
-rw-r--r--offapi/com/sun/star/form/runtime/FeatureState.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/FilterEvent.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/FormFeature.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/FormOperations.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/XFeatureInvalidation.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/XFilterController.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/XFilterControllerListener.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/XFormController.idl2
-rw-r--r--offapi/com/sun/star/form/runtime/XFormOperations.idl2
-rw-r--r--offapi/com/sun/star/frame/CommandGroup.idl2
-rw-r--r--offapi/com/sun/star/frame/DispatchInformation.idl2
-rw-r--r--offapi/com/sun/star/frame/Frame.idl2
-rw-r--r--offapi/com/sun/star/frame/LayoutManager.idl2
-rw-r--r--offapi/com/sun/star/frame/LayoutManagerEvents.idl2
-rw-r--r--offapi/com/sun/star/frame/ModuleManager.idl2
-rw-r--r--offapi/com/sun/star/frame/PopupMenuController.idl2
-rw-r--r--offapi/com/sun/star/frame/PopupMenuControllerFactory.idl2
-rw-r--r--offapi/com/sun/star/frame/StatusbarController.idl2
-rw-r--r--offapi/com/sun/star/frame/StatusbarControllerFactory.idl2
-rw-r--r--offapi/com/sun/star/frame/ToolbarController.idl2
-rw-r--r--offapi/com/sun/star/frame/TransientDocumentsDocumentContentFactory.idl2
-rw-r--r--offapi/com/sun/star/frame/UnknownModuleException.idl2
-rw-r--r--offapi/com/sun/star/frame/XDispatchInformationProvider.idl2
-rw-r--r--offapi/com/sun/star/frame/XInplaceLayout.idl2
-rw-r--r--offapi/com/sun/star/frame/XLayoutManager.idl2
-rw-r--r--offapi/com/sun/star/frame/XLayoutManagerEventBroadcaster.idl2
-rw-r--r--offapi/com/sun/star/frame/XLayoutManagerListener.idl2
-rw-r--r--offapi/com/sun/star/frame/XMenuBarAcceptor.idl2
-rw-r--r--offapi/com/sun/star/frame/XMenuBarMergingAcceptor.idl2
-rw-r--r--offapi/com/sun/star/frame/XModule.idl2
-rw-r--r--offapi/com/sun/star/frame/XModuleManager.idl2
-rw-r--r--offapi/com/sun/star/frame/XPopupMenuController.idl2
-rw-r--r--offapi/com/sun/star/frame/XStatusbarController.idl2
-rw-r--r--offapi/com/sun/star/frame/XSubToolbarController.idl2
-rw-r--r--offapi/com/sun/star/frame/XSynchronousDispatch.idl2
-rw-r--r--offapi/com/sun/star/frame/XToolbarController.idl2
-rw-r--r--offapi/com/sun/star/frame/XToolbarControllerListener.idl2
-rw-r--r--offapi/com/sun/star/frame/XTransientDocumentsDocumentContentFactory.idl2
-rw-r--r--offapi/com/sun/star/geometry/AffineMatrix2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/AffineMatrix3D.idl2
-rw-r--r--offapi/com/sun/star/geometry/EllipticalArc.idl2
-rw-r--r--offapi/com/sun/star/geometry/IntegerBezierSegment2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/IntegerPoint2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/IntegerRectangle2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/IntegerSize2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/Matrix2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/RealBezierSegment2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/RealPoint2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/RealRectangle2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/RealRectangle3D.idl2
-rw-r--r--offapi/com/sun/star/geometry/RealSize2D.idl2
-rw-r--r--offapi/com/sun/star/geometry/XMapping2D.idl2
-rw-r--r--offapi/com/sun/star/i18n/OrdinalSuffix.idl2
-rw-r--r--offapi/com/sun/star/i18n/TextConversionOption.idl2
-rw-r--r--offapi/com/sun/star/i18n/XOrdinalSuffix.idl2
-rw-r--r--offapi/com/sun/star/linguistic2/ConversionDictionary.idl2
-rw-r--r--offapi/com/sun/star/linguistic2/ConversionDictionaryType.idl2
-rw-r--r--offapi/com/sun/star/linguistic2/ConversionPropertyType.idl2
-rw-r--r--offapi/com/sun/star/linguistic2/XConversionPropertyType.idl2
-rw-r--r--offapi/com/sun/star/mail/MailAttachment.idl2
-rw-r--r--offapi/com/sun/star/mail/MailException.idl2
-rw-r--r--offapi/com/sun/star/mail/MailMessage.idl2
-rw-r--r--offapi/com/sun/star/mail/MailServer.idl2
-rw-r--r--offapi/com/sun/star/mail/MailServiceProvider.idl2
-rw-r--r--offapi/com/sun/star/mail/MailServiceType.idl2
-rw-r--r--offapi/com/sun/star/mail/NoMailServiceProviderException.idl2
-rw-r--r--offapi/com/sun/star/mail/NoMailTransportProviderException.idl2
-rw-r--r--offapi/com/sun/star/mail/SendMailMessageFailedException.idl2
-rw-r--r--offapi/com/sun/star/mail/XAuthenticator.idl2
-rw-r--r--offapi/com/sun/star/mail/XConnectionListener.idl2
-rw-r--r--offapi/com/sun/star/mail/XMailMessage.idl2
-rw-r--r--offapi/com/sun/star/mail/XMailServer.idl2
-rw-r--r--offapi/com/sun/star/mail/XMailService.idl2
-rw-r--r--offapi/com/sun/star/mail/XMailServiceProvider.idl2
-rw-r--r--offapi/com/sun/star/mail/XSmtpService.idl2
-rw-r--r--offapi/com/sun/star/rendering/AnimationAttributes.idl2
-rw-r--r--offapi/com/sun/star/rendering/AnimationRepeat.idl2
-rw-r--r--offapi/com/sun/star/rendering/CanvasFactory.idl2
-rw-r--r--offapi/com/sun/star/rendering/Caret.idl2
-rw-r--r--offapi/com/sun/star/rendering/CompositeOperation.idl2
-rw-r--r--offapi/com/sun/star/rendering/EmphasisMark.idl2
-rw-r--r--offapi/com/sun/star/rendering/FillRule.idl2
-rw-r--r--offapi/com/sun/star/rendering/FloatingPointBitmapFormat.idl2
-rw-r--r--offapi/com/sun/star/rendering/FloatingPointBitmapLayout.idl2
-rw-r--r--offapi/com/sun/star/rendering/FontInfo.idl2
-rw-r--r--offapi/com/sun/star/rendering/FontMetrics.idl2
-rw-r--r--offapi/com/sun/star/rendering/FontRequest.idl2
-rw-r--r--offapi/com/sun/star/rendering/IntegerBitmapLayout.idl2
-rw-r--r--offapi/com/sun/star/rendering/InterpolationMode.idl2
-rw-r--r--offapi/com/sun/star/rendering/PathCapType.idl2
-rw-r--r--offapi/com/sun/star/rendering/PathJoinType.idl2
-rw-r--r--offapi/com/sun/star/rendering/RenderState.idl2
-rw-r--r--offapi/com/sun/star/rendering/RenderingIntent.idl2
-rw-r--r--offapi/com/sun/star/rendering/RepaintResult.idl2
-rw-r--r--offapi/com/sun/star/rendering/StringContext.idl2
-rw-r--r--offapi/com/sun/star/rendering/TextDirection.idl2
-rw-r--r--offapi/com/sun/star/rendering/TextHit.idl2
-rw-r--r--offapi/com/sun/star/rendering/Texture.idl2
-rw-r--r--offapi/com/sun/star/rendering/TexturingMode.idl2
-rw-r--r--offapi/com/sun/star/rendering/ViewState.idl2
-rw-r--r--offapi/com/sun/star/rendering/VolatileContentDestroyedException.idl2
-rw-r--r--offapi/com/sun/star/rendering/XAnimatedSprite.idl2
-rw-r--r--offapi/com/sun/star/rendering/XAnimation.idl2
-rw-r--r--offapi/com/sun/star/rendering/XBezierPolyPolygon2D.idl2
-rw-r--r--offapi/com/sun/star/rendering/XBitmap.idl2
-rw-r--r--offapi/com/sun/star/rendering/XBitmapCanvas.idl2
-rw-r--r--offapi/com/sun/star/rendering/XBitmapPalette.idl2
-rw-r--r--offapi/com/sun/star/rendering/XBufferController.idl2
-rw-r--r--offapi/com/sun/star/rendering/XCachedPrimitive.idl2
-rw-r--r--offapi/com/sun/star/rendering/XCanvas.idl2
-rw-r--r--offapi/com/sun/star/rendering/XIntegerBitmap.idl2
-rw-r--r--offapi/com/sun/star/rendering/XLinePolyPolygon2D.idl2
-rw-r--r--offapi/com/sun/star/rendering/XPolyPolygon2D.idl2
-rw-r--r--offapi/com/sun/star/rendering/XTextLayout.idl2
-rw-r--r--offapi/com/sun/star/report/XReportControlFormat.idl2
-rw-r--r--offapi/com/sun/star/resource/OfficeResourceLoader.idl2
-rwxr-xr-xoffapi/com/sun/star/script/browse/BrowseNode.idl2
-rwxr-xr-xoffapi/com/sun/star/script/browse/BrowseNodeFactory.idl4
-rw-r--r--offapi/com/sun/star/sdb/DatabaseContext.idl2
-rw-r--r--offapi/com/sun/star/sdb/DatabaseDocument.idl2
-rw-r--r--offapi/com/sun/star/sdb/DocumentSaveRequest.idl2
-rw-r--r--offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl2
-rw-r--r--offapi/com/sun/star/sdb/XDatabaseRegistrations.idl2
-rw-r--r--offapi/com/sun/star/sdb/XDatabaseRegistrationsListener.idl2
-rw-r--r--offapi/com/sun/star/sdb/XInteractionDocumentSave.idl2
-rw-r--r--offapi/com/sun/star/sdb/application/DatabaseObject.idl2
-rw-r--r--offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl2
-rw-r--r--offapi/com/sun/star/sdb/application/XTableUIProvider.idl2
-rw-r--r--offapi/com/sun/star/sdbc/DataType.idl2
-rw-r--r--offapi/com/sun/star/security/SerialNumberAdapter.idl2
-rw-r--r--offapi/com/sun/star/sheet/ActivationEvent.idl2
-rw-r--r--offapi/com/sun/star/sheet/CellAreaLink.idl2
-rw-r--r--offapi/com/sun/star/sheet/DDEItemInfo.idl2
-rw-r--r--offapi/com/sun/star/sheet/DDELinkInfo.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotDescriptor.idl6
-rw-r--r--offapi/com/sun/star/sheet/DataPilotItem.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotOutputRangeType.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotSource.idl6
-rw-r--r--offapi/com/sun/star/sheet/DataPilotSourceMember.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotTable.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotTableHeaderData.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotTablePositionData.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotTablePositionType.idl2
-rw-r--r--offapi/com/sun/star/sheet/DataPilotTableResultData.idl2
-rw-r--r--offapi/com/sun/star/sheet/DatabaseImportDescriptor.idl4
-rw-r--r--offapi/com/sun/star/sheet/DatabaseRange.idl4
-rw-r--r--offapi/com/sun/star/sheet/ExternalDocLink.idl2
-rw-r--r--offapi/com/sun/star/sheet/ExternalDocLinks.idl2
-rw-r--r--offapi/com/sun/star/sheet/ExternalLinkInfo.idl2
-rw-r--r--offapi/com/sun/star/sheet/ExternalLinkType.idl2
-rw-r--r--offapi/com/sun/star/sheet/ExternalSheetCache.idl2
-rw-r--r--offapi/com/sun/star/sheet/FormulaParser.idl2
-rw-r--r--offapi/com/sun/star/sheet/SheetCell.idl2
-rw-r--r--offapi/com/sun/star/sheet/SheetCellRange.idl2
-rw-r--r--offapi/com/sun/star/sheet/TablePageStyle.idl4
-rw-r--r--offapi/com/sun/star/sheet/XActivationBroadcaster.idl2
-rw-r--r--offapi/com/sun/star/sheet/XActivationEventListener.idl2
-rw-r--r--offapi/com/sun/star/sheet/XDataPilotTable2.idl2
-rw-r--r--offapi/com/sun/star/sheet/XDrillDownDataSupplier.idl2
-rw-r--r--offapi/com/sun/star/sheet/XEnhancedMouseClickBroadcaster.idl2
-rw-r--r--offapi/com/sun/star/sheet/XExternalDocLink.idl2
-rw-r--r--offapi/com/sun/star/sheet/XExternalDocLinks.idl2
-rw-r--r--offapi/com/sun/star/sheet/XExternalSheetCache.idl2
-rw-r--r--offapi/com/sun/star/sheet/XScenarioEnhanced.idl2
-rw-r--r--offapi/com/sun/star/smarttags/SmartTagAction.idl2
-rw-r--r--offapi/com/sun/star/smarttags/SmartTagRecognizer.idl2
-rw-r--r--offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl2
-rw-r--r--offapi/com/sun/star/smarttags/XSmartTagAction.idl2
-rw-r--r--offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl2
-rw-r--r--offapi/com/sun/star/style/CharacterProperties.idl2
-rw-r--r--offapi/com/sun/star/style/NumberingType.idl2
-rw-r--r--offapi/com/sun/star/task/XRestartManager.idl2
-rw-r--r--offapi/com/sun/star/text/BaseFrameProperties.idl2
-rw-r--r--offapi/com/sun/star/text/Cell.idl2
-rw-r--r--offapi/com/sun/star/text/DocumentSettings.idl8
-rw-r--r--offapi/com/sun/star/text/FootnoteSettings.idl2
-rw-r--r--offapi/com/sun/star/text/GenericTextDocument.idl18
-rw-r--r--offapi/com/sun/star/text/LineNumberingProperties.idl2
-rw-r--r--offapi/com/sun/star/text/Paragraph.idl2
-rw-r--r--offapi/com/sun/star/text/PositionLayoutDir.idl2
-rw-r--r--offapi/com/sun/star/text/RelOrientation.idl2
-rw-r--r--offapi/com/sun/star/text/Shape.idl10
-rw-r--r--offapi/com/sun/star/text/TextMarkupType.idl2
-rw-r--r--offapi/com/sun/star/text/TextPortion.idl2
-rw-r--r--offapi/com/sun/star/text/TextTableRow.idl2
-rw-r--r--offapi/com/sun/star/text/ViewSettings.idl20
-rw-r--r--offapi/com/sun/star/text/XTextMarkup.idl2
-rw-r--r--offapi/com/sun/star/text/fieldmaster/Database.idl4
-rw-r--r--offapi/com/sun/star/text/textfield/DatabaseName.idl4
-rw-r--r--offapi/com/sun/star/text/textfield/DatabaseNextSet.idl4
-rw-r--r--offapi/com/sun/star/text/textfield/DatabaseNumberOfSet.idl4
-rw-r--r--offapi/com/sun/star/text/textfield/DatabaseSetNumber.idl4
-rw-r--r--offapi/com/sun/star/ucb/TransientDocumentsContentProvider.idl2
-rw-r--r--offapi/com/sun/star/ucb/TransientDocumentsDocumentContent.idl2
-rw-r--r--offapi/com/sun/star/ucb/TransientDocumentsFolderContent.idl2
-rw-r--r--offapi/com/sun/star/ucb/TransientDocumentsRootContent.idl2
-rw-r--r--offapi/com/sun/star/ucb/TransientDocumentsStreamContent.idl2
-rw-r--r--offapi/com/sun/star/ui/ConfigurableUIElement.idl2
-rw-r--r--offapi/com/sun/star/ui/ConfigurationEvent.idl2
-rw-r--r--offapi/com/sun/star/ui/DockingArea.idl2
-rw-r--r--offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl2
-rw-r--r--offapi/com/sun/star/ui/ImageType.idl2
-rw-r--r--offapi/com/sun/star/ui/ItemDescriptor.idl2
-rw-r--r--offapi/com/sun/star/ui/ItemStyle.idl2
-rw-r--r--offapi/com/sun/star/ui/ItemType.idl2
-rw-r--r--offapi/com/sun/star/ui/ModuleUICategoryDescription.idl2
-rw-r--r--offapi/com/sun/star/ui/ModuleUICommandDescription.idl2
-rw-r--r--offapi/com/sun/star/ui/ModuleUIConfigurationManager.idl2
-rw-r--r--offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl2
-rw-r--r--offapi/com/sun/star/ui/ModuleWindowStateConfiguration.idl2
-rw-r--r--offapi/com/sun/star/ui/UICategoryDescription.idl2
-rw-r--r--offapi/com/sun/star/ui/UICommandDescription.idl2
-rw-r--r--offapi/com/sun/star/ui/UIConfigurationManager.idl2
-rw-r--r--offapi/com/sun/star/ui/UIElement.idl2
-rw-r--r--offapi/com/sun/star/ui/UIElementFactory.idl2
-rw-r--r--offapi/com/sun/star/ui/UIElementFactoryManager.idl2
-rw-r--r--offapi/com/sun/star/ui/UIElementSettings.idl2
-rw-r--r--offapi/com/sun/star/ui/UIElementType.idl2
-rw-r--r--offapi/com/sun/star/ui/WindowContentFactory.idl2
-rw-r--r--offapi/com/sun/star/ui/WindowStateConfiguration.idl2
-rw-r--r--offapi/com/sun/star/ui/XAcceleratorConfiguration.idl2
-rw-r--r--offapi/com/sun/star/ui/XDockingAreaAcceptor.idl2
-rw-r--r--offapi/com/sun/star/ui/XModuleUIConfigurationManager.idl2
-rw-r--r--offapi/com/sun/star/ui/XModuleUIConfigurationManagerSupplier.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfiguration.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationListener.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationManager.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationManagerSupplier.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationPersistence.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationStorage.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIElementFactory.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIElementFactoryRegistration.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIElementSettings.idl2
-rw-r--r--offapi/com/sun/star/ui/XUIFunctionListener.idl2
-rw-r--r--offapi/com/sun/star/util/Endianness.idl2
-rw-r--r--offapi/com/sun/star/util/OfficeInstallationDirectories.idl2
-rw-r--r--offapi/com/sun/star/util/PathSubstitution.idl82
-rw-r--r--offapi/com/sun/star/util/XBroadcaster.idl2
-rw-r--r--offapi/com/sun/star/util/XOfficeInstallationDirectories.idl2
-rw-r--r--offapi/com/sun/star/xml/dom/XNode.idl2
-rw-r--r--offapi/drafts/com/sun/star/form/ListEntryEvent.idl77
-rw-r--r--offapi/drafts/com/sun/star/form/XBindableValue.idl81
-rw-r--r--offapi/drafts/com/sun/star/form/XListEntryListener.idl92
-rw-r--r--offapi/drafts/com/sun/star/form/XListEntrySink.idl71
-rw-r--r--offapi/drafts/com/sun/star/form/XListEntrySource.idl103
-rw-r--r--offapi/drafts/com/sun/star/form/XValueBinding.idl101
-rw-r--r--offapi/prj/build.lst3
-rw-r--r--offapi/prj/d.lst8
-rw-r--r--offapi/type_reference/typelibrary_history.txt5
-rw-r--r--offapi/type_reference/types.rdbbin7307264 -> 7307264 bytes
-rw-r--r--offapi/util/makefile.mk1
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Office/Canvas.xcu2
-rw-r--r--package/inc/ZipPackageFolder.hxx7
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx635
-rw-r--r--postprocess/packcomponents/makefile.mk4
-rw-r--r--registry/tools/checksingleton.cxx459
-rw-r--r--registry/tools/fileurl.cxx90
-rw-r--r--registry/tools/fileurl.hxx (renamed from offapi/drafts/com/sun/star/form/IncompatibleTypesException.idl)34
-rw-r--r--registry/tools/makefile.mk18
-rw-r--r--registry/tools/options.cxx153
-rw-r--r--registry/tools/options.hxx67
-rw-r--r--registry/tools/rdbedit.cxx318
-rw-r--r--registry/tools/regcompare.cxx1555
-rw-r--r--registry/tools/regmerge.cxx277
-rw-r--r--registry/tools/regview.cxx72
-rwxr-xr-xrhino/makefile.mk3
-rw-r--r--rhino/rhino1_5R5-updateToolTip.patch23
-rw-r--r--rsc/source/tools/rscchar.cxx16
-rw-r--r--sal/osl/unx/file.cxx3
-rw-r--r--sal/osl/unx/file_misc.cxx6
-rw-r--r--sal/osl/unx/file_path_helper.cxx80
-rw-r--r--sal/osl/unx/process_impl.cxx19
-rw-r--r--sal/osl/unx/profile.c1
-rw-r--r--sal/osl/unx/socket.c39
-rw-r--r--sal/rtl/source/alloc.c1541
-rw-r--r--sal/rtl/source/alloc_arena.c37
-rw-r--r--sal/rtl/source/alloc_cache.c53
-rwxr-xr-xsal/rtl/source/alloc_fini.cxx (renamed from sal/rtl/source/memory_fini.cxx)23
-rw-r--r--sal/rtl/source/alloc_global.c10
-rw-r--r--sal/rtl/source/alloc_impl.h24
-rw-r--r--sal/rtl/source/makefile.mk9
-rwxr-xr-x[-rw-r--r--]sc/source/core/data/documen9.cxx4
-rwxr-xr-x[-rw-r--r--]sc/source/core/tool/autoform.cxx2
-rw-r--r--scp2/source/ooo/scpaction_ooo.scp9
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java44
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java44
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java77
-rwxr-xr-xsd/source/core/stlpool.cxx3
-rw-r--r--[-rwxr-xr-x]sd/source/ui/framework/factories/BasicViewFactory.cxx3
-rwxr-xr-xsd/source/ui/framework/factories/BasicViewFactory.hxx1
-rwxr-xr-xsd/source/ui/framework/module/ModuleController.cxx4
-rwxr-xr-xsd/source/ui/func/fuhhconv.cxx10
-rwxr-xr-xsd/source/ui/presenter/PresenterTextView.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx5
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/TaskPaneFocusManager.cxx19
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/TaskPaneFocusManager.hxx1
-rwxr-xr-xsd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx2
-rw-r--r--sdext/source/pdfimport/config/description.xml2
-rw-r--r--sdext/source/pdfimport/filterdet.cxx4
-rw-r--r--sdext/source/pdfimport/inc/pdfparse.hxx2
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx147
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfparse.cxx4
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx11
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.hxx4
-rwxr-xr-xsdext/source/pdfimport/wrapper/wrapper.cxx52
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx19
-rw-r--r--set_soenv.in4
-rw-r--r--sfx2/qa/cppunit/makefile.mk (renamed from unoxml/source/dom/makefile.mk)76
-rw-r--r--sfx2/qa/unoapi/makefile.mk48
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx46
-rwxr-xr-x[-rw-r--r--]sfx2/source/view/viewprn.cxx50
-rw-r--r--slideshow/source/engine/animationnodes/basenode.hxx2
-rw-r--r--slideshow/source/engine/shapes/drawshape.hxx2
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx5
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx2
-rw-r--r--slideshow/source/engine/transitions/randomwipe.cxx10
-rwxr-xr-xsolenv/bin/build.pl6
-rw-r--r--solenv/bin/modules/installer/epmfile.pm12
-rw-r--r--solenv/bin/modules/installer/simplepackage.pm1
-rw-r--r--solenv/config/sdev300.ini5
-rw-r--r--solenv/gbuild/LinkTarget.mk4
-rwxr-xr-xsolenv/gbuild/platform/linux.mk8
-rwxr-xr-xsolenv/gbuild/platform/macosx.mk7
-rwxr-xr-xsolenv/gbuild/platform/solaris.mk7
-rwxr-xr-xsolenv/gbuild/platform/windows.mk19
-rw-r--r--solenv/gbuild/platform/winmingw.mk15
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/unxlngppc.mk3
-rw-r--r--soltools/cpp/_eval.c13
-rw-r--r--soltools/cpp/_lex.c2
-rw-r--r--sot/source/sdstor/stgio.cxx3
-rw-r--r--store/source/lockbyte.cxx3
-rw-r--r--store/source/lockbyte.hxx2
-rw-r--r--store/source/object.hxx2
-rw-r--r--store/source/storbase.cxx3
-rw-r--r--store/source/stordir.hxx2
-rw-r--r--svl/qa/complex/passwordcontainer/makefile.mk134
-rw-r--r--svtools/qa/unoapi/makefile.mk48
-rw-r--r--svtools/source/contnr/svlbox.cxx1
-rwxr-xr-x[-rw-r--r--]svtools/source/filter.vcl/filter/FilterConfigItem.cxx0
-rw-r--r--svx/source/dialog/svxruler.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/mnuctrls/fntctl.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdibrow.cxx6
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdmodel.cxx40
-rwxr-xr-xsw/JunitTest_sw_complex.mk13
-rwxr-xr-xsw/inc/fmtmeta.hxx25
-rw-r--r--sw/inc/ndhints.hxx10
-rw-r--r--sw/inc/swtypes.hxx2
-rw-r--r--sw/inc/txtatr.hxx21
-rw-r--r--sw/inc/txtrfmrk.hxx2
-rw-r--r--sw/inc/txttxmrk.hxx3
-rw-r--r--sw/inc/unotext.hxx12
-rw-r--r--sw/qa/complex/accessibility/makefile.mk (renamed from unoxml/qa/complex/unoxml/makefile.mk)23
-rw-r--r--sw/qa/complex/checkColor/makefile.mk (renamed from unoxml/source/events/makefile.mk)42
-rw-r--r--sw/qa/complex/writer/TestDocument.java3
-rw-r--r--sw/qa/unoapi/makefile.mk48
-rwxr-xr-x[-rw-r--r--]sw/source/core/crsr/swcrsr.cxx11
-rw-r--r--sw/source/core/doc/doclay.cxx18
-rwxr-xr-x[-rw-r--r--]sw/source/core/doc/tblafmt.cxx4
-rwxr-xr-x[-rw-r--r--]sw/source/core/edit/acorrect.cxx20
-rw-r--r--sw/source/core/edit/autofmt.cxx3
-rwxr-xr-x[-rw-r--r--]sw/source/core/inc/acorrect.hxx1
-rw-r--r--sw/source/core/text/txttab.cxx112
-rw-r--r--sw/source/core/txtnode/atrref.cxx2
-rw-r--r--sw/source/core/txtnode/atrtox.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx85
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx26
-rw-r--r--sw/source/core/txtnode/thints.cxx9
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx18
-rwxr-xr-x[-rw-r--r--]sw/source/core/txtnode/txtedt.cxx10
-rw-r--r--sw/source/core/unocore/unorefmk.cxx2
-rw-r--r--sw/source/core/unocore/unotext.cxx55
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.cxx17
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/wrtw8nds.cxx24
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx1
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx1
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx5
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx52
-rw-r--r--sw/source/ui/app/apphdl.cxx23
-rw-r--r--sw/source/ui/app/swmodul1.cxx7
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/index/cnttab.src4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/lingu/hhcwrp.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/shells/textsh.cxx8
-rw-r--r--sw/source/ui/table/tabledlg.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxdoc.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxvw.cxx2
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx6
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sglobal/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sweb/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swform/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swreport/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swriter/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swxform/menubar/menubar.xml2
-rw-r--r--sysui/desktop/icons/makefile.mk63
-rwxr-xr-xsysui/desktop/icons/so7-base-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-calc-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-calc-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-chart-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-draw-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-draw-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-impress-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-impress-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-master-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-math-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-writer-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so7-writer-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-base-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-base-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-calc-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-calc-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-calc-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-chart-doc.icobin10134 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-configuration.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-draw-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-draw-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-draw-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-empty-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-empty-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-image-doc.icobin10134 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-impress-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-impress-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-impress-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-macro-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-main-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-master-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-math-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-math-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-open.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-printer.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-web-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-writer-app.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-writer-doc.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so8-writer-tem.icobin25214 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_base_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_base_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_calc_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_calc_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_calc_tem.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_chart_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_draw_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_draw_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_draw_tem.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_empty_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_empty_tem.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_global_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_html_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_impress_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_impress_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_impress_tem.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_macro_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_main_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_math_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_math_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_open.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_writer_app.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_writer_doc.icobin295606 -> 0 bytes
-rwxr-xr-xsysui/desktop/icons/so9_writer_tem.icobin295606 -> 0 bytes
-rw-r--r--sysui/prj/build.lst6
-rw-r--r--sysui/prj/d.lst4
-rwxr-xr-xtestautomation/chart2/optional/includes/ch2_lvl1a.inc1
-rw-r--r--testautomation/global/tools/includes/optional/t_ole.inc22
-rw-r--r--testautomation/graphics/optional/includes/global/g_stylist.inc10
-rw-r--r--testautomation/graphics/optional/includes/impress/i_us2_present.inc3
-rw-r--r--testautomation/graphics/required/includes/global/id_004.inc2
-rw-r--r--testautomation/writer/optional/includes/clipboard/clipbrd_func.inc9
-rw-r--r--testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc8
-rw-r--r--testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc2
-rw-r--r--testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc4
-rw-r--r--testautomation/writer/optional/includes/fields/w_fields2.inc2
-rw-r--r--testautomation/writer/optional/includes/fields/w_fields3.inc4
-rw-r--r--testautomation/writer/optional/includes/fields/w_fields4.inc2
-rw-r--r--testautomation/writer/optional/includes/fields/w_fields5.inc4
-rw-r--r--testautomation/writer/optional/includes/formatcharacter/w_format_character1.inc2
-rw-r--r--testautomation/writer/optional/includes/formatpage/w_formatpage1.inc4
-rw-r--r--testautomation/writer/optional/includes/formatparagraph/w_formatparagraph1.inc4
-rw-r--r--testautomation/writer/optional/includes/formatparagraph/w_formatparagraph2.inc6
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc2
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc6
-rw-r--r--testautomation/writer/optional/includes/loadsave/w_loadsave.inc2
-rw-r--r--testautomation/writer/optional/includes/navigator/w_navigator.inc10
-rw-r--r--testautomation/writer/optional/includes/number/w_205_.inc24
-rw-r--r--testautomation/writer/optional/includes/number/w_205a_.inc2
-rw-r--r--testautomation/writer/optional/includes/option/wh_o_2.inc2
-rw-r--r--testautomation/writer/optional/includes/redlining/w_redlining1.inc4
-rw-r--r--testautomation/writer/optional/includes/redlining/w_redlining2.inc2
-rw-r--r--testautomation/writer/optional/includes/regression/issuezilla/w_issuezilla_regression.inc4
-rw-r--r--testautomation/writer/optional/includes/section/w_section_2.inc2
-rw-r--r--testautomation/writer/optional/includes/shortcut/w_shortcuts.inc2
-rw-r--r--testautomation/writer/optional/includes/spellcheck/w_spellcheck.inc22
-rw-r--r--testautomation/writer/optional/includes/stylist/w_stylist.inc16
-rw-r--r--testautomation/writer/optional/includes/textframes/w_textframes2.inc4
-rw-r--r--testautomation/writer/required/includes/w_001_.inc2
-rw-r--r--testautomation/writer/required/includes/w_001a_.inc2
-rw-r--r--testautomation/writer/required/includes/w_001b_.inc16
-rw-r--r--testautomation/writer/required/includes/w_002_.inc4
-rw-r--r--testautomation/writer/required/includes/w_004_.inc3
-rw-r--r--testautomation/writer/required/includes/w_004b_.inc12
-rw-r--r--testautomation/writer/required/includes/w_005b_.inc2
-rw-r--r--testautomation/writer/required/includes/w_007_.inc2
-rw-r--r--testautomation/writer/required/includes/w_010_.inc8
-rw-r--r--testautomation/writer/required/includes/w_011_.inc6
-rw-r--r--testautomation/writer/required/includes/w_020_.inc4
-rw-r--r--testautomation/writer/tools/includes/w_tool1.inc4
-rwxr-xr-xtestautomation/writer/tools/includes/w_tool2.inc2
-rw-r--r--testautomation/writer/tools/includes/w_tool6.inc2
-rw-r--r--testautomation/writer/tools/includes/w_tools_undo.inc140
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx2
-rw-r--r--testtools/source/bridgetest/cppobj.cxx4
-rwxr-xr-xtesttools/source/cliversioning/version_libs/version_3_3.dllbin0 -> 11776 bytes
-rw-r--r--toolkit/qa/unoapi/makefile.mk48
-rw-r--r--tools/inc/tools/mempool.hxx17
-rwxr-xr-xtools/source/memtools/mempool.cxx14
-rw-r--r--tools/workben/makefile.mk68
-rw-r--r--tools/workben/mempooltest.cxx18
-rw-r--r--udkapi/com/sun/star/container/XStringKeyMap.idl2
-rw-r--r--udkapi/com/sun/star/io/XAsyncOutputMonitor.idl2
-rwxr-xr-xudkapi/com/sun/star/java/InvalidJavaSettingsException.idl2
-rw-r--r--udkapi/com/sun/star/java/JavaNotFoundException.idl2
-rwxr-xr-xudkapi/com/sun/star/java/RestartRequiredException.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XInterfaceTypeDescription2.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XParameter.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XPublished.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XServiceConstructorDescription.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XServiceTypeDescription2.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XSingletonTypeDescription2.idl2
-rw-r--r--udkapi/com/sun/star/reflection/XStructTypeDescription.idl2
-rw-r--r--udkapi/com/sun/star/script/BasicErrorException.idl2
-rw-r--r--udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl2
-rw-r--r--udkapi/com/sun/star/uri/RelativeUriExcessParentSegments.idl2
-rw-r--r--udkapi/com/sun/star/uri/UriReferenceFactory.idl2
-rw-r--r--udkapi/com/sun/star/uri/UriSchemeParser_vndDOTsunDOTstarDOTscript.idl2
-rw-r--r--udkapi/com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.idl2
-rw-r--r--udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl2
-rw-r--r--udkapi/com/sun/star/uri/XUriReference.idl2
-rw-r--r--udkapi/com/sun/star/uri/XUriReferenceFactory.idl2
-rw-r--r--udkapi/com/sun/star/uri/XUriSchemeParser.idl2
-rw-r--r--udkapi/com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.idl2
-rw-r--r--udkapi/com/sun/star/uri/XVndSunStarScriptUrl.idl2
-rw-r--r--unodevtools/source/skeletonmaker/skeletonmaker.cxx3
-rwxr-xr-x[-rw-r--r--]unoil/climaker/version.txt6
-rw-r--r--unoil/util/makefile.mk2
-rw-r--r--unoxml/JunitTest_unordf_complex.mk52
-rw-r--r--unoxml/JunitTest_unoxml_complex.mk52
-rw-r--r--unoxml/Library_unordf.mk74
-rw-r--r--unoxml/Library_unoxml.mk96
-rw-r--r--unoxml/Makefile (renamed from offapi/drafts/com/sun/star/form/makefile.mk)32
-rw-r--r--unoxml/Module_unoxml.mk40
-rw-r--r--unoxml/prj/build.lst10
-rw-r--r--unoxml/prj/d.lst5
-rw-r--r--unoxml/prj/makefile.mk (renamed from unoxml/source/xpath/makefile.mk)32
-rw-r--r--unoxml/qa/complex/unoxml/DOMTest.java2986
-rw-r--r--unoxml/qa/complex/unoxml/TestDocument.java3
-rw-r--r--unoxml/source/dom/attr.cxx172
-rw-r--r--unoxml/source/dom/attr.hxx50
-rw-r--r--unoxml/source/dom/attributesmap.cxx163
-rw-r--r--unoxml/source/dom/attributesmap.hxx53
-rw-r--r--unoxml/source/dom/cdatasection.cxx14
-rw-r--r--unoxml/source/dom/cdatasection.hxx25
-rw-r--r--unoxml/source/dom/characterdata.cxx77
-rw-r--r--unoxml/source/dom/characterdata.hxx31
-rw-r--r--unoxml/source/dom/childlist.cxx41
-rw-r--r--unoxml/source/dom/childlist.hxx30
-rw-r--r--unoxml/source/dom/comment.cxx11
-rw-r--r--unoxml/source/dom/comment.hxx25
-rw-r--r--unoxml/source/dom/document.cxx739
-rw-r--r--unoxml/source/dom/document.hxx85
-rw-r--r--unoxml/source/dom/documentbuilder.cxx151
-rw-r--r--unoxml/source/dom/documentbuilder.hxx42
-rw-r--r--unoxml/source/dom/documentfragment.cxx26
-rw-r--r--unoxml/source/dom/documentfragment.hxx24
-rw-r--r--unoxml/source/dom/documenttype.cxx37
-rw-r--r--unoxml/source/dom/documenttype.hxx24
-rw-r--r--unoxml/source/dom/domimplementation.cxx47
-rw-r--r--unoxml/source/dom/domimplementation.hxx20
-rw-r--r--unoxml/source/dom/element.cxx651
-rw-r--r--unoxml/source/dom/element.hxx35
-rw-r--r--unoxml/source/dom/elementlist.cxx98
-rw-r--r--unoxml/source/dom/elementlist.hxx55
-rw-r--r--unoxml/source/dom/entitiesmap.cxx54
-rw-r--r--unoxml/source/dom/entitiesmap.hxx52
-rw-r--r--unoxml/source/dom/entity.cxx36
-rw-r--r--unoxml/source/dom/entity.hxx28
-rw-r--r--unoxml/source/dom/entityreference.cxx30
-rw-r--r--unoxml/source/dom/entityreference.hxx29
-rw-r--r--unoxml/source/dom/node.cxx796
-rw-r--r--unoxml/source/dom/node.hxx81
-rw-r--r--unoxml/source/dom/notation.cxx21
-rw-r--r--unoxml/source/dom/notation.hxx24
-rw-r--r--unoxml/source/dom/notationsmap.cxx57
-rw-r--r--unoxml/source/dom/notationsmap.hxx50
-rw-r--r--unoxml/source/dom/processinginstruction.cxx99
-rw-r--r--unoxml/source/dom/processinginstruction.hxx36
-rw-r--r--unoxml/source/dom/saxbuilder.cxx35
-rw-r--r--unoxml/source/dom/saxbuilder.hxx8
-rw-r--r--unoxml/source/dom/text.cxx49
-rw-r--r--unoxml/source/dom/text.hxx36
-rw-r--r--unoxml/source/events/event.cxx61
-rw-r--r--unoxml/source/events/event.hxx55
-rw-r--r--unoxml/source/events/eventdispatcher.cxx143
-rw-r--r--unoxml/source/events/eventdispatcher.hxx80
-rw-r--r--unoxml/source/events/mouseevent.cxx54
-rw-r--r--unoxml/source/events/mouseevent.hxx53
-rw-r--r--unoxml/source/events/mutationevent.cxx44
-rw-r--r--unoxml/source/events/mutationevent.hxx50
-rw-r--r--unoxml/source/events/testlistener.cxx4
-rw-r--r--unoxml/source/events/testlistener.hxx35
-rw-r--r--unoxml/source/events/uievent.cxx44
-rw-r--r--unoxml/source/events/uievent.hxx51
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx5
-rw-r--r--unoxml/source/rdf/librdf_services.cxx5
-rw-r--r--unoxml/source/rdf/makefile.mk92
-rw-r--r--unoxml/source/service/makefile.mk86
-rw-r--r--unoxml/source/service/services.cxx4
-rw-r--r--unoxml/source/xpath/nodelist.cxx31
-rw-r--r--unoxml/source/xpath/nodelist.hxx29
-rw-r--r--unoxml/source/xpath/xpathapi.cxx133
-rw-r--r--unoxml/source/xpath/xpathapi.hxx30
-rw-r--r--unoxml/source/xpath/xpathobject.cxx112
-rw-r--r--unoxml/source/xpath/xpathobject.hxx39
-rwxr-xr-xvcl/aqua/inc/salframeview.h1
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.cxx43
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.hxx2
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm5
-rw-r--r--vcl/inc/vcl/cursor.hxx6
-rw-r--r--vcl/source/control/ilstbox.cxx2
-rw-r--r--vcl/source/gdi/jobset.cxx7
-rwxr-xr-xvcl/source/gdi/print3.cxx28
-rw-r--r--vcl/source/window/cursor.cxx20
-rwxr-xr-x[-rw-r--r--]vcl/source/window/printdlg.cxx11
-rw-r--r--vcl/source/window/window.cxx7
-rw-r--r--vcl/unx/kde4/KDEData.cxx2
-rw-r--r--vcl/unx/kde4/KDEData.hxx2
-rw-r--r--vcl/unx/kde4/KDESalDisplay.cxx2
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx16
-rw-r--r--vcl/unx/kde4/KDESalFrame.hxx6
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx22
-rw-r--r--vcl/unx/kde4/KDESalGraphics.hxx14
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx4
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx4
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx2
-rw-r--r--vcl/unx/kde4/VCLKDEApplication.cxx2
-rw-r--r--vcl/unx/kde4/VCLKDEApplication.hxx2
-rwxr-xr-xvcl/win/source/gdi/salgdi.cxx4
-rw-r--r--xmloff/source/core/xmlexp.cxx9
-rw-r--r--xmloff/source/style/xmlnume.cxx24
-rw-r--r--xmloff/source/style/xmlnumi.cxx16
-rw-r--r--xmloff/source/text/XMLAutoTextEventExport.cxx3
-rw-r--r--xmloff/source/text/txtprhdl.cxx3
-rw-r--r--xmloff/source/transform/PropertyActionsOOo.cxx2
-rw-r--r--xpdf/makefile.mk2
-rw-r--r--xpdf/xpdf-3.02-ooopwd.patch101
927 files changed, 16134 insertions, 11239 deletions
diff --git a/Module_ooo.mk b/Module_ooo.mk
index 307daf7c4b00..f35cc58c0eaa 100644
--- a/Module_ooo.mk
+++ b/Module_ooo.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
sw \
toolkit \
tools \
+ unoxml \
xmloff \
vbahelper \
))
diff --git a/Repository.mk b/Repository.mk
index 87bbafa59baf..9259250a8b84 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -75,6 +75,8 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
tk \
tl \
utl \
+ unordf \
+ unoxml \
vbahelper \
vcl \
xcr \
@@ -87,8 +89,10 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
))
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
- icuuc \
cppunit \
+ icuuc \
+ rdf \
+ xslt \
))
diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk
index 406cb6a9eee6..10e06091b845 100644
--- a/RepositoryFixes.mk
+++ b/RepositoryFixes.mk
@@ -75,6 +75,8 @@ gb_Library_FILENAMES := $(patsubst tl:itl%,tl:itools%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst vbahelper:ivbahelper%,vbahelper:vbahelper%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst vos3:ivos3%,vos3:ivos%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst xml2:ixml2%,xml2:libxml2$(gb_Library_IARCEXT),$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst xslt:ixslt%,xslt:libxslt$(gb_Library_IARCEXT),$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst rdf:irdf%,rdf:librdf.dll$(gb_Library_IARCEXT),$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst z:iz%,z:zlib%,$(gb_Library_FILENAMES))
ifeq ($(gb_PRODUCT),$(true))
gb_Library_FILENAMES := $(patsubst stl:istl%,stl:stlport_vc71%,$(gb_Library_FILENAMES))
@@ -120,6 +122,8 @@ gb_Library_FILENAMES := $(patsubst tl:itl%,tl:itools%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst vbahelper:ivbahelper%,vbahelper:vbahelper%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst vos3:ivos3%,vos3:ivos%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst xml2:ixml2%,xml2:libxml2%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst xslt:ixslt%,xslt:libxslt%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst rdf:irdf%,rdf:librdf%,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := $(patsubst z:iz%,z:zlib%,$(gb_Library_FILENAMES))
ifeq ($(gb_PRODUCT),$(true))
gb_Library_FILENAMES := $(patsubst stl:istl%,stl:stlport_vc71%,$(gb_Library_FILENAMES))
@@ -179,6 +183,14 @@ ifeq ($(SYSTEM_LIBXML),YES)
gb_Library_TARGETS := $(filter-out xml2,$(gb_Library_TARGETS))
endif
+ifeq ($(SYSTEM_LIBXSLT),YES)
+gb_Library_TARGETS := $(filter-out xslt,$(gb_Library_TARGETS))
+endif
+
+ifeq ($(SYSTEM_REDLAND),YES)
+gb_Library_TARGETS := $(filter-out rdf,$(gb_Library_TARGETS))
+endif
+
ifeq ($(SYSTEM_ICU),YES)
gb_Library_TARGETS := $(filter-out icuuc,$(gb_Library_TARGETS))
endif
diff --git a/autodoc/source/parser_i/idoc/docu_pe2.cxx b/autodoc/source/parser_i/idoc/docu_pe2.cxx
index 084dbbf0660c..30400dc5945a 100644
--- a/autodoc/source/parser_i/idoc/docu_pe2.cxx
+++ b/autodoc/source/parser_i/idoc/docu_pe2.cxx
@@ -30,6 +30,7 @@
// NOT FULLY DEFINED SERVICES
+#include <cctype>
#include <ary/doc/d_oldidldocu.hxx>
#include <ary_i/d_token.hxx>
#include <parser/parserinfo.hxx>
@@ -128,7 +129,7 @@ SapiDocu_PE::Process_AtTag( const Tok_AtTag & i_rToken )
else if (i_rToken.Id() == Tok_AtTag::since)
{
pCurAtTag = new DT_SinceAtTag;
- fCurTokenAddFunction = &SapiDocu_PE::SetCurSinceAtTagVersion;
+ fCurTokenAddFunction = &SapiDocu_PE::SetCurSinceAtTagVersion_OOo;
}
else
{
@@ -495,10 +496,11 @@ SapiDocu_PE::SetCurSeeAlsoAtTagLinkText_3( DYN ary::inf::DocuToken & let_drNewTo
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
}
-
+const String
+ C_sSinceFormat("Correct version format: \"OOo <major>.<minor>[.<micro> if micro is not 0]\".");
void
-SapiDocu_PE::SetCurSinceAtTagVersion( DYN ary::inf::DocuToken & let_drNewToken )
+SapiDocu_PE::SetCurSinceAtTagVersion_OOo( DYN ary::inf::DocuToken & let_drNewToken )
{
csv_assert(pCurAtTag);
@@ -511,26 +513,62 @@ SapiDocu_PE::SetCurSinceAtTagVersion( DYN ary::inf::DocuToken & let_drNewToken )
const String
sVersion(pToken->GetText());
- const char
- cFirst = *sVersion.begin();
- const char
- cCiphersend = '9' + 1;
+ if (NOT CheckVersionSyntax_OOo(sVersion))
+ {
+ Cerr() << "Version information in @since tag has incorrect format.\n"
+ << "Found: \"" << sVersion << "\"\n"
+ << C_sSinceFormat
+ << Endl();
+ exit(1);
+ }
+
const autodoc::CommandLine &
rCommandLine = autodoc::CommandLine::Get_();
+ if (NOT rCommandLine.DoesTransform_SinceTag())
+ pCurAtTag->AddToken(let_drNewToken);
+ fCurTokenAddFunction = &SapiDocu_PE::SetCurSinceAtTagVersion_Number;
+}
- if ( rCommandLine.DoesTransform_SinceTag())
- {
- // The @since version number shall be interpreted,
+void
+SapiDocu_PE::SetCurSinceAtTagVersion_Number( DYN ary::inf::DocuToken & let_drNewToken )
+{
+ csv_assert(pCurAtTag);
- if ( NOT csv::in_range('0', cFirst, cCiphersend) )
+ DT_TextToken * pToken = dynamic_cast< DT_TextToken* >(&let_drNewToken);
+ if (pToken == 0)
+ {
+ if (dynamic_cast< DT_White* >(&let_drNewToken) != 0)
{
- // But this is a non-number-part, so we wait for
- // the next one.
- delete &let_drNewToken;
- return;
+ String &
+ sValue = pCurAtTag->Access_Text().Access_TextOfFirstToken();
+ StreamLock
+ sHelp(1000);
+ sValue = sHelp() << sValue << " " << c_str;
}
- else if (rCommandLine.DisplayOf_SinceTagValue(sVersion).empty())
+
+ delete &let_drNewToken;
+ return;
+ }
+
+ const String
+ sVersion(pToken->GetText());
+ if (NOT CheckVersionSyntax_Number(sVersion))
+ {
+ Cerr() << "Version information in @since tag has incorrect format.\n"
+ << "Found: \"" << sVersion << "\"\n"
+ << C_sSinceFormat
+ << Endl();
+ exit(1);
+ }
+
+ const autodoc::CommandLine &
+ rCommandLine = autodoc::CommandLine::Get_();
+ if ( rCommandLine.DoesTransform_SinceTag())
+ {
+ pCurAtTag->AddToken(let_drNewToken);
+
+ if (rCommandLine.DisplayOf_SinceTagValue(sVersion).empty())
{
// This is the numbered part, but we don't know it.
delete &let_drNewToken;
@@ -544,10 +582,10 @@ SapiDocu_PE::SetCurSinceAtTagVersion( DYN ary::inf::DocuToken & let_drNewToken )
throw X_Docu("since", sl().c_str());
}
}
-
- // Either since tags are not specially interpreted, or
- // we got a known one.
- pCurAtTag->AddToken(let_drNewToken);
+ else
+ {
+ AddDocuToken2SinceAtTag(let_drNewToken);
+ }
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2SinceAtTag;
}
@@ -573,6 +611,54 @@ SapiDocu_PE::AddDocuToken2SinceAtTag( DYN ary::inf::DocuToken & let_drNewToken )
delete &let_drNewToken;
}
+bool
+SapiDocu_PE::CheckVersionSyntax_OOo(const String & i_versionPart1)
+{
+ return i_versionPart1 == "OOo"
+ OR i_versionPart1 == "OpenOffice.org";
+}
+
+bool
+SapiDocu_PE::CheckVersionSyntax_Number(const String & i_versionPart2)
+{
+ if (i_versionPart2.length () == 0)
+ return false;
+
+ const char
+ pt = '.';
+ unsigned int countDigit = 0;
+ unsigned int countPoint = 0;
+ const char *
+ pFirstPoint = 0;
+ const char *
+ pLastPoint = 0;
+
+ for ( const char * p = i_versionPart2.begin();
+ *p != 0;
+ ++p )
+ {
+ if ( std::isdigit(*p) )
+ ++countDigit;
+ else if (*p == pt)
+ {
+ if (countPoint == 0)
+ pFirstPoint = p;
+ pLastPoint = p;
+ ++countPoint;
+ }
+ }
+
+ if ( countDigit + countPoint == i_versionPart2.length() // only digits and points
+ AND pFirstPoint != 0 AND countPoint < 3 // 1 or 2 points
+ AND pFirstPoint + 1 != pLastPoint // there are digits between two points
+ AND *i_versionPart2.begin() != pt AND *(pLastPoint + 1) != 0 // points are surrounded by digits
+ AND (*(pLastPoint + 1) != '0' OR pLastPoint == pFirstPoint) ) // the first micro-digit is not 0
+ {
+ return true;
+ }
+ return false;
+}
+
const char *
AtTagTitle( const Tok_AtTag & i_rToken )
{
diff --git a/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx b/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx
index 2d1757bbb308..89bf5b504b0f 100644
--- a/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx
+++ b/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx
@@ -144,13 +144,20 @@ class SapiDocu_PE : public TokenInterpreter
void SetCurSeeAlsoAtTagLinkText_3(
DYN ary::inf::DocuToken &
let_drNewToken );
- void SetCurSinceAtTagVersion(
+ void SetCurSinceAtTagVersion_OOo(
+ DYN ary::inf::DocuToken &
+ let_drNewToken );
+ void SetCurSinceAtTagVersion_Number(
DYN ary::inf::DocuToken &
let_drNewToken );
void AddDocuToken2SinceAtTag(
DYN ary::inf::DocuToken &
let_drNewToken );
+ bool CheckVersionSyntax_OOo(
+ const String & i_versionPart1 );
+ bool CheckVersionSyntax_Number(
+ const String & i_versionPart2 );
// DATA
Dyn<ary::doc::OldIdlDocu>
pDocu;
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 25aa457cfcc2..e92c2fa0453a 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -465,6 +465,7 @@ void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt )
{
pBindings->Invalidate( SID_SAVEDOC );
pBindings->Invalidate( SID_DOC_MODIFIED );
+ pBindings->Invalidate( SID_UNDO );
}
if ( rKEvt.GetKeyCode().GetCode() == KEY_INSERT )
pBindings->Invalidate( SID_ATTR_INSERT );
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 2786aa3311be..e7088aff5096 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -309,7 +309,10 @@ void BasicIDEShell::onDocumentSave( const ScriptDocument& /*_rDocument*/ )
void BasicIDEShell::onDocumentSaveDone( const ScriptDocument& /*_rDocument*/ )
{
- // not interested in
+ // #i115671: Update SID_SAVEDOC after saving is completed
+ SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
+ if ( pBindings )
+ pBindings->Invalidate( SID_SAVEDOC );
}
void BasicIDEShell::onDocumentSaveAs( const ScriptDocument& /*_rDocument*/ )
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 356973647060..a66619a0a159 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -383,7 +383,7 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const
// dialogs
if ( nMode & BROWSEMODE_DIALOGS )
{
- Reference< script::XLibraryContainer > xDlgLibContainer( rDocument.getLibraryContainer( E_SCRIPTS ) );
+ Reference< script::XLibraryContainer > xDlgLibContainer( rDocument.getLibraryContainer( E_DIALOGS ) );
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryLoaded( aOULibName ) )
{
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index cd3e1dd0061f..34f9e5096fb1 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -857,6 +857,15 @@ void BasicFrame::Resize()
}
}
+Rectangle BasicFrame::GetInnerRect() const
+{
+ Rectangle aRect( Point(0,0), GetOutputSizePixel() );
+ aRect.Bottom() = pStatus->GetPosPixel().Y()-1;
+ if( aRect.Bottom() < 0 ) // sanity check
+ aRect.Bottom() = 0;
+ return aRect;
+}
+
void BasicFrame::Move()
{
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx
index 5a501ec5efcf..47dd5056fb58 100644
--- a/basic/source/app/app.hxx
+++ b/basic/source/app/app.hxx
@@ -188,6 +188,7 @@ public:
void SetAppMode( const String &aNewMode ){ aAppMode = aNewMode; UpdateTitle(); }
String GenRealString( const String &aResString );
+ Rectangle GetInnerRect() const;
};
diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx
index 4d0a5f95fca4..eb80a96f4183 100644
--- a/basic/source/app/appwin.cxx
+++ b/basic/source/app/appwin.cxx
@@ -121,14 +121,8 @@ void AppWin::Maximize()
pFrame->nMaximizedWindows++;
nWinState = TT_WIN_STATE_MAX;
}
- sal_Int32 nTitleHeight;
- {
- sal_Int32 nDummy1, nDummy2, nDummy3;
- pFrame->GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 );
- }
- Size aSize = pFrame->GetOutputSizePixel();
- aSize.Height() -= nTitleHeight;
+ Size aSize = pFrame->GetInnerRect().GetSize();
aSize.Height() -= 2;
aSize.Width() -= 2;
SetSizePixel( aSize );
diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx
index 8cc6ce7edd82..8baf819372ba 100644
--- a/basic/source/runtime/dllmgr.cxx
+++ b/basic/source/runtime/dllmgr.cxx
@@ -36,6 +36,7 @@
#include "basic/sbx.hxx"
#include "basic/sbxvar.hxx"
+#include "runtime.hxx"
#include "osl/thread.h"
#include "rtl/ref.hxx"
#include "rtl/string.hxx"
@@ -266,9 +267,15 @@ SbError marshal(
std::vector< char > & blob, std::size_t offset, MarshalData & data)
{
OSL_ASSERT(variable != 0);
- if ((variable->GetFlags() & SBX_REFERENCE) == 0) {
- if ((variable->GetType() & SbxARRAY) == 0) {
- switch (variable->GetType()) {
+
+ SbxDataType eVarType = variable->GetType();
+ bool bByVal = (variable->GetFlags() & SBX_REFERENCE) == 0;
+ if( !bByVal && !SbiRuntime::isVBAEnabled() && eVarType == SbxSTRING )
+ bByVal = true;
+
+ if (bByVal) {
+ if ((eVarType & SbxARRAY) == 0) {
+ switch (eVarType) {
case SbxINTEGER:
add(blob, variable->GetInteger(), outer ? 4 : 2, offset);
break;
@@ -317,8 +324,8 @@ SbError marshal(
}
}
} else {
- if ((variable->GetType() & SbxARRAY) == 0) {
- switch (variable->GetType()) {
+ if ((eVarType & SbxARRAY) == 0) {
+ switch (eVarType) {
case SbxINTEGER:
case SbxLONG:
case SbxSINGLE:
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 02b22a35b732..bbb3668b5b69 100755
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -521,7 +521,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
pPar->Put( NULL, 0 );
}
// Index-Access bei UnoObjekten beruecksichtigen
- else if( pElem->GetType() == SbxOBJECT && (!pElem->ISA(SbxMethod) || !pElem->IsBroadcaster()) )
+ else if( pElem->GetType() == SbxOBJECT && (!pElem->ISA(SbxMethod) || (bVBAEnabled && !pElem->IsBroadcaster()) ) )
{
pPar = pElem->GetParameters();
if ( pPar )
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index e90276f2ba33..5da2e10e7969 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -30,6 +30,8 @@
#include <canvas/debug.hxx>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
#include <rtl/math.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -83,6 +85,9 @@ namespace cairocanvas
// TODO(F2): improve panose->vclenum conversion
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+ maFont->SetPitch(
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+ ? PITCH_FIXED : PITCH_VARIABLE);
maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index b246cf5bedeb..7fd29805e2f7 100755
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -39,6 +39,7 @@
#include <boost/scoped_array.hpp>
#include <boost/bind.hpp>
#include <com/sun/star/rendering/FontRequest.hpp>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <com/sun/star/rendering/XCanvasFont.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/scopeguard.hxx>
@@ -132,6 +133,9 @@ namespace dxcanvas
aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+ aFont.SetPitch(
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+ ? PITCH_FIXED : PITCH_VARIABLE);
aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
@@ -264,6 +268,9 @@ namespace dxcanvas
aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+ aFont.SetPitch(
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+ ? PITCH_FIXED : PITCH_VARIABLE);
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 4ca0084983db..9f10c788bd24 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -35,6 +35,8 @@
#include <i18npool/mslangid.hxx>
#include <vcl/metric.hxx>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
#include "canvasfont.hxx"
#include "textlayout.hxx"
@@ -63,6 +65,9 @@ namespace vclcanvas
// TODO(F2): improve panose->vclenum conversion
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+ maFont->SetPitch(
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+ ? PITCH_FIXED : PITCH_VARIABLE);
maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
diff --git a/cli_ure/version/version.txt b/cli_ure/version/version.txt
index 8cbdedf654d4..b5ec562837f6 100644..100755
--- a/cli_ure/version/version.txt
+++ b/cli_ure/version/version.txt
@@ -25,23 +25,23 @@
#
#*************************************************************************
-CLI_URETYPES_NEW_VERSION=1.0.7.0
-CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.6.0
-CLI_URETYPES_POLICY_VERSION=7.0.0.0
+CLI_URETYPES_NEW_VERSION=1.0.8.0
+CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.7.0
+CLI_URETYPES_POLICY_VERSION=8.0.0.0
CLI_URETYPES_POLICY_ASSEMBLY=policy.1.0.cli_uretypes
-CLI_BASETYPES_NEW_VERSION=1.0.18.0
-CLI_BASETYPES_OLD_VERSION=1.0.0.0-1.0.17.0
-CLI_BASETYPES_POLICY_VERSION=18.0.0.0
+CLI_BASETYPES_NEW_VERSION=1.0.19.0
+CLI_BASETYPES_OLD_VERSION=1.0.0.0-1.0.18.0
+CLI_BASETYPES_POLICY_VERSION=19.0.0.0
CLI_BASETYPES_POLICY_ASSEMBLY=policy.1.0.cli_basetypes
-CLI_URE_NEW_VERSION=1.0.21.0
-CLI_URE_OLD_VERSION=1.0.0.0-1.0.20.0
-CLI_URE_POLICY_VERSION=21.0.0.0
+CLI_URE_NEW_VERSION=1.0.22.0
+CLI_URE_OLD_VERSION=1.0.0.0-1.0.21.0
+CLI_URE_POLICY_VERSION=22.0.0.0
CLI_URE_POLICY_ASSEMBLY=policy.1.0.cli_ure
-CLI_CPPUHELPER_NEW_VERSION=1.0.21.0
-CLI_CPPUHELPER_OLD_VERSION=1.0.0.0-1.0.20.0
-CLI_CPPUHELPER_POLICY_VERSION=21.0.0.0
+CLI_CPPUHELPER_NEW_VERSION=1.0.22.0
+CLI_CPPUHELPER_OLD_VERSION=1.0.0.0-1.0.21.0
+CLI_CPPUHELPER_POLICY_VERSION=22.0.0.0
CLI_CPPUHELPER_POLICY_ASSEMBLY=policy.1.0.cli_cppuhelper
diff --git a/codemaker/source/bonobowrappermaker/corbaoptions.cxx b/codemaker/source/bonobowrappermaker/corbaoptions.cxx
index 3c644b6ff4dd..1bb75810031a 100644
--- a/codemaker/source/bonobowrappermaker/corbaoptions.cxx
+++ b/codemaker/source/bonobowrappermaker/corbaoptions.cxx
@@ -247,9 +247,8 @@ OString CorbaOptions::prepareHelp()
OString CorbaOptions::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
+ OString version(m_program);
version += m_program + " Version 2.0\n\n";
-
return version;
}
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index 1bc398391c9d..da8ce2089c6e 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -34,6 +34,12 @@
#include "osl/thread.h"
#include "osl/process.h"
+#ifdef SAL_UNX
+#define SEPARATOR '/'
+#else
+#define SEPARATOR '\\'
+#endif
+
using namespace rtl;
sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
@@ -46,7 +52,9 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
bCmdFile = sal_True;
- m_program = av[0];
+ OString name(av[0]);
+ sal_Int32 index = name.lastIndexOf(SEPARATOR);
+ m_program = name.copy((index > 0 ? index+1 : 0));
if (ac < 2)
{
@@ -338,7 +346,7 @@ OString CppuOptions::prepareHelp()
help += " necessary information is available for bridging the type in UNO.\n";
help += " -G = generate only target files which does not exists.\n";
help += " -Gc = generate only target files which content will be changed.\n";
- help += " -X<file> = extra types which will not be taken into account for generation.\n";
+ help += " -X<file> = extra types which will not be taken into account for generation.\n\n";
help += prepareVersion();
return help;
@@ -346,9 +354,8 @@ OString CppuOptions::prepareHelp()
OString CppuOptions::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 2.0\n\n";
-
+ OString version(m_program);
+ version += " Version 2.0\n\n";
return version;
}
diff --git a/codemaker/source/cunomaker/cunooptions.cxx b/codemaker/source/cunomaker/cunooptions.cxx
index 50a1223d004f..909ab3edc8dd 100644
--- a/codemaker/source/cunomaker/cunooptions.cxx
+++ b/codemaker/source/cunomaker/cunooptions.cxx
@@ -321,9 +321,8 @@ OString CunoOptions::prepareHelp()
OString CunoOptions::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 1.0\n\n";
-
+ OString version(m_program);
+ version += " Version 1.0\n\n";
return version;
}
diff --git a/codemaker/source/idlmaker/idloptions.cxx b/codemaker/source/idlmaker/idloptions.cxx
index 306e43293223..e495f555e5cb 100644
--- a/codemaker/source/idlmaker/idloptions.cxx
+++ b/codemaker/source/idlmaker/idloptions.cxx
@@ -242,9 +242,8 @@ OString IdlOptions::prepareHelp()
OString IdlOptions::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 2.0\n\n";
-
+ OString version(m_program);
+ version += " Version 2.0\n\n";
return version;
}
diff --git a/codemaker/source/javamaker/javaoptions.cxx b/codemaker/source/javamaker/javaoptions.cxx
index 24b9b1509cfc..58235bd32616 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -33,6 +33,12 @@
#include "osl/process.h"
#include "osl/thread.h"
+#ifdef SAL_UNX
+#define SEPARATOR '/'
+#else
+#define SEPARATOR '\\'
+#endif
+
using namespace rtl;
sal_Bool JavaOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
@@ -45,7 +51,9 @@ sal_Bool JavaOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
bCmdFile = sal_True;
- m_program = av[0];
+ OString name(av[0]);
+ sal_Int32 index = name.lastIndexOf(SEPARATOR);
+ m_program = name.copy((index > 0 ? index+1 : 0));
if (ac < 2)
{
@@ -282,7 +290,7 @@ OString JavaOptions::prepareHelp()
help += " -nD = no dependent types are generated.\n";
help += " -G = generate only target files which does not exists.\n";
help += " -Gc = generate only target files which content will be changed.\n";
- help += " -X<file> = extra types which will not be taken into account for generation.\n";
+ help += " -X<file> = extra types which will not be taken into account for generation.\n\n";
help += prepareVersion();
return help;
@@ -290,9 +298,8 @@ OString JavaOptions::prepareHelp()
OString JavaOptions::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 2.0\n\n";
-
+ OString version(m_program);
+ version += " Version 2.0\n\n";
return version;
}
diff --git a/configure.in b/configure.in
index eca0540550a5..ec4d9ce11df4 100644
--- a/configure.in
+++ b/configure.in
@@ -1946,6 +1946,30 @@ fi
AC_SUBST(LFS_CFLAGS)
dnl ===================================================================
+dnl Check if valgrind.h is available
+dnl ===================================================================
+if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
+ dnl Test $prefix (currently only testing for /usr and /usr/local)
+ dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
+ VALGRIND_CFLAGS=""
+ prev_cppflags=$CPPFLAGS
+ if test -z "$VALGRIND_CFLAGS"; then
+ CPPFLAGS="-I/usr/include/valgrind"
+ AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
+ fi
+ if test -z "$VALGRIND_CFLAGS"; then
+ CPPFLAGS="-I/usr/local/include/valgrind"
+ AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
+ fi
+ if test -n "$VALGRIND_CFLAGS"; then
+ CPPFLAGS=$VALGRIND_CFLAGS
+ AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
+ fi
+ CPPFLAGS=$prev_cppflags
+fi
+AC_SUBST([VALGRIND_CFLAGS])
+
+dnl ===================================================================
dnl Check if cups/cups.h is available
dnl ===================================================================
if test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then
@@ -3458,9 +3482,10 @@ if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
AC_MSG_RESULT(yes)
fi
if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
- if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/)); fi
+ if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/)); fi
else
- AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/`, false)
+ AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ |
+$SED -e s/c++/strip/`, false)
fi
if test "$MINGWSTRIP" = "false"; then
AC_MSG_ERROR(MinGW32 binutils needed. Install them.)
diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx
index 0b8bb43d7e3e..09852ff9e530 100644
--- a/cppcanvas/inc/cppcanvas/renderer.hxx
+++ b/cppcanvas/inc/cppcanvas/renderer.hxx
@@ -136,6 +136,9 @@ namespace cppcanvas
/// Optionally forces the given font letter form (italics etc.) for all text actions
::boost::optional< sal_Int8 > maFontLetterForm;
+ /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
+ ::boost::optional< sal_Int8 > maFontProportion;
+
/// Optionally forces underlining for all text actions
::boost::optional< bool > maFontUnderline;
};
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index e8a6468611f7..1e0611ab037a 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <com/sun/star/rendering/ViewState.hpp>
#include <com/sun/star/rendering/RenderState.hpp>
#include <com/sun/star/rendering/XCanvasFont.hpp>
@@ -863,6 +864,12 @@ namespace cppcanvas
rParms.mrParms.maFontLetterForm.is_initialized() ?
*rParms.mrParms.maFontLetterForm :
(rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
+ aFontRequest.FontDescription.FontDescription.Proportion =
+ rParms.mrParms.maFontProportion.is_initialized() ?
+ *rParms.mrParms.maFontProportion :
+ (rFont.GetPitch() == PITCH_FIXED)
+ ? rendering::PanoseProportion::MONO_SPACED
+ : rendering::PanoseProportion::ANYTHING;
LanguageType aLang = rFont.GetLanguage();
aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
@@ -2980,7 +2987,8 @@ namespace cppcanvas
if( rParams.maFontName.is_initialized() ||
rParams.maFontWeight.is_initialized() ||
rParams.maFontLetterForm.is_initialized() ||
- rParams.maFontUnderline.is_initialized() )
+ rParams.maFontUnderline.is_initialized() ||
+ rParams.maFontProportion.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx
index c487d95c59a5..f13fae54c508 100644
--- a/cpputools/source/registercomponent/registercomponent.cxx
+++ b/cpputools/source/registercomponent/registercomponent.cxx
@@ -575,7 +575,7 @@ void DoIt::operator() (const OUString & url) throw()
if ( ! _bSilent )
{
- fprintf(stderr, "register component '%s' in registry '%s' succesful!\n", sUrl.getStr(), _sRegName.getStr());
+ fprintf(stderr, "register component '%s' in registry '%s' successful!\n", sUrl.getStr(), _sRegName.getStr());
}
}
@@ -604,7 +604,7 @@ void DoIt::operator() (const OUString & url) throw()
if (bRet)
{
if ( ! _bSilent )
- fprintf(stderr, "revoke component '%s' from registry '%s' succesful!\n", sUrl.getStr(), _sRegName.getStr());
+ fprintf(stderr, "revoke component '%s' from registry '%s' successful!\n", sUrl.getStr(), _sRegName.getStr());
}
else
{
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5d2e85da8a3b..708c840ee407 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -613,6 +613,9 @@ IMPL_LINK(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
{
SvxNumberFormat aFmt(pActNum->GetLevel(i));
aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
aFmt.SetBulletFont(&rActBulletFont);
aFmt.SetBulletChar(cChar );
aFmt.SetCharFmtName(sBulletCharFmtName);
@@ -859,6 +862,9 @@ IMPL_LINK(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering;
if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
{
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
if( pLevelSettings->sBulletFont.getLength() &&
pLevelSettings->sBulletFont.compareTo(
rActBulletFont.GetName()))
@@ -908,9 +914,10 @@ IMPL_LINK(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
aFmt.SetCharFmtName(sNumCharFmtName);
// #62069# // #92724#
aFmt.SetBulletRelSize(100);
+ // #i93908#
+ aFmt.SetPrefix(pLevelSettings->sPrefix);
+ aFmt.SetSuffix(pLevelSettings->sSuffix);
}
- aFmt.SetPrefix(pLevelSettings->sPrefix);
- aFmt.SetSuffix(pLevelSettings->sSuffix);
pActNum->SetLevel(i, aFmt);
}
}
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 5bc52b99f3a9..0000fe6e1714 100644..100755
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -608,6 +608,7 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet )
ResStringArray aPaperAry( CUI_RES( nAryId ) );
sal_uInt32 nCnt = aPaperAry.Count();
+ sal_uInt16 nUserPos = LISTBOX_ENTRY_NOTFOUND;
for ( sal_uInt32 i = 0; i < nCnt; ++i )
{
String aStr = aPaperAry.GetString(i);
@@ -617,9 +618,11 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet )
if ( eSize == ePaper )
nActPos = nPos;
+ if( eSize == PAPER_USER )
+ nUserPos = nPos;
}
- // aktuelles Papierformat selektieren
- aPaperSizeBox.SelectEntryPos( nActPos );
+ // preselect current paper format - #115915#: ePaper might not be in aPaperSizeBox so use PAPER_USER instead
+ aPaperSizeBox.SelectEntryPos( nActPos != LISTBOX_ENTRY_NOTFOUND ? nActPos : nUserPos );
// Applikationsspezifisch
diff --git a/desktop/os2/source/applauncher/makefile.mk b/desktop/os2/source/applauncher/makefile.mk
index bf71b57c2fdf..7eec8aee9c23 100644
--- a/desktop/os2/source/applauncher/makefile.mk
+++ b/desktop/os2/source/applauncher/makefile.mk
@@ -47,7 +47,7 @@ OBJFILES= \
$(OBJ)$/sbase.obj \
$(OBJ)$/smath.obj \
$(OBJ)$/officeloader.obj \
- $(OBJ)$/quickstart.obj
+ $(OBJ)$/os2quickstart.obj
APP1TARGET=swriter
APP1NOSAL=TRUE
@@ -106,13 +106,13 @@ APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/officeloader.obj
-APP8TARGET=quickstart
+APP8TARGET=os2quickstart
APP8NOSAL=TRUE
APP8LINKRES=$(MISC)$/$(TARGET)8.res
APP8ICON=$(SOLARRESDIR)$/icons$/ooo-main-app.ico
APP8OBJS = \
$(OBJ)$/launcher.obj\
- $(OBJ)$/quickstart.obj
+ $(OBJ)$/os2quickstart.obj
# --- Targets ------------------------------------------------------
diff --git a/desktop/os2/source/applauncher/quickstart.cxx b/desktop/os2/source/applauncher/os2quickstart.cxx
index 63585434bb50..63585434bb50 100644
--- a/desktop/os2/source/applauncher/quickstart.cxx
+++ b/desktop/os2/source/applauncher/os2quickstart.cxx
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index fc782c35a71b..f1dee0761ccd 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -17,6 +17,9 @@ dt desktop\win32\source\guistdio nmake - w dt_guistdio dt_inc N
dt desktop\win32\source\applauncher nmake - w dt_applauncher dt_inc NULL
dt desktop\win32\source\applauncher\ooo nmake - w dt_applauncher_ooo dt_applauncher.w dt_inc NULL
dt desktop\win32\source\rebase nmake - w dt_rebase dt_inc NULL
+dt desktop\win32\source\QuickStart nmake - w dt_win32_quickstart NULL
+dt desktop\win32\source\QuickStart\so nmake - w dt_win32_quickstart_so dt_win32_quickstart.w NULL
+
dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL
dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL
dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL
@@ -35,7 +38,7 @@ dt desktop\source\deployment\registry\configuration nmake - all dt_dp_registry_c
dt desktop\source\deployment\registry\help nmake - all dt_dp_registry_help dt_inc NULL
dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_executable dt_inc NULL
dt desktop\scripts nmake - u dt_scripts dt_inc NULL
-dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL
+dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w dt_win32_quickstart_so.w NULL
dt desktop\zipintro nmake - all dt_zipintro NULL
dt desktop\registry\data\org\openoffice\Office nmake - all sn_regconfig NULL
dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index b6e14a5ce722..be7b77388763 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -31,7 +31,7 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\swriter.exe %_DEST%\bin%_EXT%\swriter.exe
..\%__SRC%\bin\sbase.exe %_DEST%\bin%_EXT%\sbase.exe
..\%__SRC%\bin\sweb.exe %_DEST%\bin%_EXT%\sweb.exe
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
+..\%__SRC%\bin\os2quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
..\%__SRC%\bin\so\scalc.exe %_DEST%\bin%_EXT%\so\scalc.exe
..\%__SRC%\bin\so\sdraw.exe %_DEST%\bin%_EXT%\so\sdraw.exe
..\%__SRC%\bin\so\simpress.exe %_DEST%\bin%_EXT%\so\simpress.exe
@@ -40,6 +40,11 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\so\sbase.exe %_DEST%\bin%_EXT%\so\sbase.exe
..\%__SRC%\bin\so\sweb.exe %_DEST%\bin%_EXT%\so\sweb.exe
+..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
+..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe
+..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe
+..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe
+
..\%__SRC%\misc\soffice.exe.manifest %_DEST%\bin%_EXT%\soffice.exe.manifest
..\%__SRC%\misc\soffice.bin.manifest %_DEST%\bin%_EXT%\soffice.bin.manifest
..\%__SRC%\bin\wrp*.dll %_DEST%\bin%_EXT%\wrp*.dll
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a2f602082fe4..3b5ed1916f9b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1215,7 +1215,7 @@ void Desktop::retrieveCrashReporterState()
{
static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
static const ::rtl::OUString CFG_PATH_CRASHREPORTER = ::rtl::OUString::createFromAscii("CrashReporter" );
- static const ::rtl::OUString CFG_ENTRY_ENABLED = ::rtl::OUString::createFromAscii("Enabled" );
+ static const ::rtl::OUString CFG_ENTRY_ENABLED = ::rtl::OUString::createFromAscii("Enabled" );
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -1627,7 +1627,8 @@ void Desktop::Main()
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
m_pLockfile = new Lockfile;
- if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) {
+ if ( !pCmdLineArgs->IsHeadless() && !pCmdLineArgs->IsInvisible() &&
+ !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) {
// Lockfile exists, and user clicked 'no'
return;
}
@@ -1802,7 +1803,7 @@ void Desktop::Main()
if ( !pExecGlobals->bRestartRequested )
{
- if ((!pCmdLineArgs->WantsToLoadDocument() ) &&
+ if ((!pCmdLineArgs->WantsToLoadDocument() && !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsHeadless() ) &&
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
(!bExistsRecoveryData ) &&
(!bExistsSessionData ) &&
@@ -2116,9 +2117,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 ),
@@ -3203,6 +3204,7 @@ void Desktop::OpenSplashScreen()
sal_Bool bVisible = sal_False;
// Show intro only if this is normal start (e.g. no server, no quickstart, no printing )
if ( !pCmdLine->IsInvisible() &&
+ !pCmdLine->IsHeadless() &&
!pCmdLine->IsQuickstart() &&
!pCmdLine->IsMinimized() &&
!pCmdLine->IsNoLogo() &&
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 8bd8a6191201..a8a1025959f1 100755..100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -165,7 +165,7 @@ public:
m_bWarnUser( false )
{}
- Dialog * activeDialog() { return m_pDialogHelper->getWindow(); }
+ Dialog * activeDialog() { return m_pDialogHelper ? m_pDialogHelper->getWindow() : NULL; }
void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc
index 6d92e2a99500..3ddff6b66b02 100644
--- a/desktop/util/ooverinfo.rc
+++ b/desktop/util/ooverinfo.rc
@@ -112,7 +112,7 @@ VS_VERSION_INFO versioninfo
15 ICON "icons\\oasis-formula.ico"
16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
-18 ICON "icons\\ooo-configuration.ico"
+18 ICON "icons\\empty-document.ico"
19 ICON "icons\\ooo3_open.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\ooo3_writer_app.ico"
diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc
index 17af6818551e..caacb294122d 100755
--- a/desktop/util/ooverinfo2.rc
+++ b/desktop/util/ooverinfo2.rc
@@ -50,7 +50,7 @@ ICON 14 "icons/oasis-database.ico"
ICON 15 "icons/oasis-formula.ico"
ICON 16 "icons/oasis-web-template.ico"
ICON 17 "icons/empty-document.ico"
-ICON 18 "icons/ooo-configuration.ico"
+ICON 18 "icons/empty-document.ico"
ICON 19 "icons/ooo-open.ico"
ICON 20 "icons/empty-document.ico"
ICON 21 "icons/ooo-writer-app.ico"
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index 7d589956ec83..5a2b03769963 100755..100644
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -117,8 +117,8 @@ VS_VERSION_INFO versioninfo
15 ICON "icons\\oasis-formula.ico"
16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
-18 ICON "icons\\so8-configuration.ico"
-19 ICON "icons\\so9_open.ico"
+18 ICON "icons\\empty-document.ico"
+19 ICON "icons\\so9_main_app.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\so9_writer_app.ico"
22 ICON "icons\\so9_calc_app.ico"
diff --git a/sysui/source/win32/QuickStart/OOQuickStart.rc b/desktop/win32/source/QuickStart/OOQuickStart.rc
index 0dc4dab256b6..9baf7e864f5f 100644
--- a/sysui/source/win32/QuickStart/OOQuickStart.rc
+++ b/desktop/win32/source/QuickStart/OOQuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
+ICON_ACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "icons/ooo3_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "icons/ooo3_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/sysui/source/win32/QuickStart/QuickStart.cpp b/desktop/win32/source/QuickStart/QuickStart.cpp
index 3467e35524f8..3467e35524f8 100644
--- a/sysui/source/win32/QuickStart/QuickStart.cpp
+++ b/desktop/win32/source/QuickStart/QuickStart.cpp
diff --git a/sysui/source/win32/QuickStart/QuickStart.h b/desktop/win32/source/QuickStart/QuickStart.h
index d0afd98ec430..d0afd98ec430 100644
--- a/sysui/source/win32/QuickStart/QuickStart.h
+++ b/desktop/win32/source/QuickStart/QuickStart.h
diff --git a/sysui/source/win32/QuickStart/StdAfx.h b/desktop/win32/source/QuickStart/StdAfx.h
index a4bdd66f630c..a4bdd66f630c 100644
--- a/sysui/source/win32/QuickStart/StdAfx.h
+++ b/desktop/win32/source/QuickStart/StdAfx.h
diff --git a/sysui/source/win32/QuickStart/makefile.mk b/desktop/win32/source/QuickStart/makefile.mk
index 41242d849dfb..41242d849dfb 100644
--- a/sysui/source/win32/QuickStart/makefile.mk
+++ b/desktop/win32/source/QuickStart/makefile.mk
diff --git a/sysui/source/win32/QuickStart/resource.h b/desktop/win32/source/QuickStart/resource.h
index d34beb00c5c9..d34beb00c5c9 100644
--- a/sysui/source/win32/QuickStart/resource.h
+++ b/desktop/win32/source/QuickStart/resource.h
diff --git a/sysui/source/win32/QuickStart/so/QuickStart.rc b/desktop/win32/source/QuickStart/so/QuickStart.rc
index c48dc2358d0d..732904dc745a 100644
--- a/sysui/source/win32/QuickStart/so/QuickStart.rc
+++ b/desktop/win32/source/QuickStart/so/QuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
+ICON_ACTIVE ICON DISCARDABLE "icons/so9_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "icons/so9_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "icons/so9_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "icons/so9_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/sysui/source/win32/QuickStart/so/makefile.mk b/desktop/win32/source/QuickStart/so/makefile.mk
index 6c7897232576..50154c7d50b2 100644
--- a/sysui/source/win32/QuickStart/so/makefile.mk
+++ b/desktop/win32/source/QuickStart/so/makefile.mk
@@ -41,6 +41,8 @@ UWINAPILIB =
# --- Resources ----------------------------------------------------
+.IF "$(LINK_SO)"=="TRUE"
+
RCFILES=QuickStart.rc
INCPRE=..
@@ -68,6 +70,8 @@ APP1STDLIBS+=$(SHELL32LIB)\
APP1NOSVRES=$(RES)$/$(TARGET).res
+.ENDIF # "$(LINK_SO)"=="TRUE"
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk
index f0f5743f38a1..d08309bbed24 100644
--- a/desktop/win32/source/applauncher/makefile.mk
+++ b/desktop/win32/source/applauncher/makefile.mk
@@ -53,6 +53,7 @@ OBJFILES= \
$(OBJ)$/sweb.obj
# SO launcher
+.IF "$(LINK_SO)"=="TRUE"
.IF "$(BUILD_SPECIAL)"!=""
APP1DEPN= $(APP1RES) verinfo.rc
APP1TARGET=so$/swriter
@@ -139,7 +140,8 @@ APP7VERINFO=verinfo.rc
APP7PRODUCTDEF+=-DRES_APP_NAME=sweb
-.ENDIF # "$(BUILD_SPECIAL)"!=""
+.ENDIF # "$(BUILD_SPECIAL)"!=""
+.ENDIF # "$(LINK_SO)"=="TRUE"
# --- Targets ------------------------------------------------------
diff --git a/desktop/win32/source/guiloader/makefile.mk b/desktop/win32/source/guiloader/makefile.mk
index 5bb1c523ff19..7912471fba13 100644
--- a/desktop/win32/source/guiloader/makefile.mk
+++ b/desktop/win32/source/guiloader/makefile.mk
@@ -48,14 +48,16 @@ APP1OBJS=\
$(SOLARLIBDIR)$/pathutils-obj.obj
STDLIB1=$(SHLWAPILIB)
+.IF "$(LINK_SO)"=="TRUE"
APP2TARGET=so$/guiloader
APP2NOSAL=TRUE
-APP2ICON=$(SOLARRESDIR)$/icons/so8-main-app.ico
+APP2ICON=$(SOLARRESDIR)$/icons/so9_main_app.ico
APP2OBJS=\
$(OBJ)$/extendloaderenvironment.obj \
$(OBJ)$/genericloader.obj \
$(SOLARLIBDIR)$/pathutils-obj.obj
STDLIB2=$(SHLWAPILIB)
+.ENDIF # "$(LINK_SO)"=="TRUE"
# --- Targets ------------------------------------------------------
diff --git a/dmake/config.h.in b/dmake/config.h.in
index c8aa63a861b9..ed639aa99b03 100644
--- a/dmake/config.h.in
+++ b/dmake/config.h.in
@@ -55,6 +55,9 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
/* Define to 1 if you have the `settz' function. */
#undef HAVE_SETTZ
diff --git a/dmake/configure b/dmake/configure
index f8a1bd822914..7e6d05ab8a65 100755
--- a/dmake/configure
+++ b/dmake/configure
@@ -7437,7 +7437,7 @@ done
-for ac_func in getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday
+for ac_func in getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday setenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/dmake/configure.in b/dmake/configure.in
index 498c7b2372de..c903d94faab8 100755
--- a/dmake/configure.in
+++ b/dmake/configure.in
@@ -211,7 +211,7 @@ AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday)
+AC_CHECK_FUNCS(getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday setenv)
# Usefull, but special to newlib/MSVC
AC_CHECK_FUNCS(strlwr)
diff --git a/dmake/dmake.c b/dmake/dmake.c
index b96bf4ce3146..ddfe3a88ad06 100644
--- a/dmake/dmake.c
+++ b/dmake/dmake.c
@@ -380,16 +380,19 @@ char **argv;
_warn = TRUE;
/* If -r was not given find and parse startup-makefile. */
- if( Rules ) {
- char *fname;
-
- /* Search_file() also checks the environment variable. */
- if( (mkfil=Search_file("MAKESTARTUP", &fname)) != NIL(FILE) ) {
- Parse(mkfil);
- Def_macro( "MAKESTARTUP", fname, M_EXPANDED|M_MULTI|M_FORCE );
- }
- else
- Fatal( "Configuration file `%s' not found", fname );
+ if( Rules )
+ {
+ char *fname = NIL(char);
+
+ /* Search_file() also checks the environment variable. */
+ if( (mkfil=Search_file("MAKESTARTUP", &fname)) != NIL(FILE) )
+ {
+ Parse(mkfil);
+ Def_macro( "MAKESTARTUP", fname, M_EXPANDED|M_MULTI|M_FORCE );
+ }
+ else
+ Fatal( "Configuration file `%s' not found", fname );
+ if ( fname != NIL(char)) { FREE( fname ); fname = NIL(char); }
}
/* Define the targets set on the command line now. */
@@ -428,8 +431,7 @@ char **argv;
char *p;
if( strcmp(f, "stdin") == 0 ) f = "-";
- p = DmStrAdd( "-f", f, FALSE );
- Def_macro( "MAKEFILE", p, M_PRECIOUS|M_NOEXPORT );
+ Def_macro( "MAKEFILE", p = DmStrAdd( "-f", f, FALSE ), M_PRECIOUS|M_NOEXPORT ); FREE(p);
Parse( mkfil );
}
else if( !Rules )
@@ -663,23 +665,25 @@ char **rname;
*/
if( (hp = GET_MACRO(macname)) != NIL(HASH) ) {
- /* Only expand if needed. */
- if( hp->ht_flag & M_EXPANDED ) {
- ename = fname = DmStrDup(hp->ht_value);
- } else {
- ename = fname = Expand(hp->ht_value);
- }
+ /* Only expand if needed. */
+ if( hp->ht_flag & M_EXPANDED ) {
+ ename = fname = DmStrDup(hp->ht_value);
+ } else {
+ ename = fname = Expand(hp->ht_value);
+ }
- if( hp->ht_flag & M_PRECIOUS ) fil = Openfile(fname, FALSE, FALSE);
+ if( hp->ht_flag & M_PRECIOUS ) fil = Openfile(fname, FALSE, FALSE);
}
if( fil == NIL(FILE) ) {
- fname=Expand(Read_env_string(macname));
- if( (fil = Openfile(fname, FALSE, FALSE)) != NIL(FILE) ) FREE(ename);
+ fname=Expand(Read_env_string(macname));
+ if( (fil = Openfile(fname, FALSE, FALSE)) != NIL(FILE) ) FREE(ename);
}
- if( fil == NIL(FILE) && hp != NIL(HASH) )
- fil = Openfile(fname=ename, FALSE, FALSE);
+ if( fil == NIL(FILE) && hp != NIL(HASH) ) {
+ if ( fname != NIL(char) ) { FREE(fname); fname = NIL(char); }
+ fil = Openfile(fname=ename, FALSE, FALSE);
+ }
if( rname ) *rname = fname;
diff --git a/dmake/expand.c b/dmake/expand.c
index b7232303177e..50bbbdc46760 100644
--- a/dmake/expand.c
+++ b/dmake/expand.c
@@ -133,23 +133,23 @@ char *src; /* pointer to source string */
/* START <+...+> KLUDGE */
if( (ks=DmStrStr(start,"<+")) != NIL(char)
- && (ke=DmStrStr(ks,"+>")) != NIL(char) ){
- char *t1, *t2;
-
- res = DmStrJoin( res, t2=Expand(t1=DmSubStr(start,ks)), -1, TRUE);
- FREE(t1); FREE(t2);
-
- t1 = DmSubStr(ks+2, ke+1); t1[ke-ks-2] = ')';
- t2 = DmStrJoin( "$(mktmp ", t1, -1,FALSE);
- FREE(t1);
- res = DmStrJoin( res, t2=Expand(t2), -1, TRUE);
- FREE(t2);
- src = ke+2;
+ && (ke=DmStrStr(ks,"+>")) != NIL(char) ) {
+ char *t1, *t2;
+
+ res = DmStrJoin( res, t2=Expand(t1=DmSubStr(start,ks)), -1, TRUE);
+ FREE(t1); FREE(t2);
+
+ t1 = DmSubStr(ks+2, ke+1); t1[ke-ks-2] = ')';
+ t2 = DmStrJoin( "$(mktmp ", t1, -1,FALSE);
+ FREE(t1);
+ res = DmStrJoin( res, t1=Expand(t2), -1, TRUE);
+ FREE(t1); FREE(t2);
+ src = ke+2;
}
/* END <+...+> KLUDGE */
else {
- res = DmStrJoin( res, tmp = ScanToken(start,&src,TRUE), -1, TRUE );
- FREE( tmp );
+ res = DmStrJoin( res, tmp = ScanToken(start,&src,TRUE), -1, TRUE );
+ FREE( tmp );
}
}
@@ -726,36 +726,36 @@ int doexpand; /* If TRUE enables macro expansion */
break;
case '\\': /* Transform \<nl> -> ' '. */
- if( s[1] != '\n' ) {
- done = !lev;
- break;
- } else {
- size_t len;
- s[1] = ' ';
- len = strlen(s+1)+1;
- memmove( s, s+1, len );
- }
- /*FALLTHRU*/
+ if( s[1] != '\n' ) {
+ done = !lev;
+ break;
+ } else {
+ size_t len;
+ s[1] = ' ';
+ len = strlen(s+1)+1;
+ memmove( s, s+1, len );
+ }
+ /*FALLTHRU*/
case ' ':
case '\t':
if ( lev == 1 ) fflag = 1;
break;
case '\0': /* check for null */
- *ps = s;
- done = TRUE;
- if( lev ) { /* catch $( or ${ without closing bracket */
- Fatal( "Syntax error in macro [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
- } else
- Fatal( "DEBUG: This cannot occur! [%s].\n", start );
- break;
-
- case ')': /* close macro brace */
- case '}':
+ *ps = s;
+ done = TRUE;
+ if( lev ) { /* catch $( or ${ without closing bracket */
+ Fatal( "Syntax error in macro [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
+ } else
+ Fatal( "DEBUG: This cannot occur! [%s].\n", start );
+ break;
+
+ case ')': /* close macro brace */
+ case '}':
if( !lev ) /* A closing bracket without an .. */
- Fatal("Syntax error in macro [$%s]. Closing bracket [%c] cannot be a macro name.\n", start, *s );
+ Fatal("Syntax error in macro [$%s]. Closing bracket [%c] cannot be a macro name.\n", start, *s );
else if( *s == edelim ) --lev;
- /*FALLTHRU*/
+ /*FALLTHRU*/
default: /* Done when lev == 0. This means either no */
done = !lev; /* opening bracket (single letter macro) or */
@@ -768,14 +768,14 @@ int doexpand; /* If TRUE enables macro expansion */
/* Check if this is a $A type macro. If so then we have to
* handle it a little differently. */
if( bflag )
- macro_name = DmSubStr( start+1, s-1 );
+ macro_name = DmSubStr( start+1, s-1 );
else
- macro_name = DmSubStr( start, s );
+ macro_name = DmSubStr( start, s );
/* If we don't have to expand the macro we're done. */
if (!doexpand) {
- *ps = s;
- DB_RETURN(macro_name);
+ *ps = s;
+ DB_RETURN(macro_name);
}
/* Check to see if the macro name contains spaces, if so then treat it
@@ -783,251 +783,251 @@ int doexpand; /* If TRUE enables macro expansion */
* deal with it. We do not call the function expander if the function
* invocation begins with a '$' */
if( fflag && *macro_name != '$' ) {
- result = Exec_function(macro_name);
+ result = Exec_function(macro_name);
}
else {
- /* Check if the macro is a recursive macro name, if so then
- * EXPAND the name before expanding the value */
- if( strchr( macro_name, '$' ) != NIL(char) ) {
- recurse_name = Expand( macro_name );
- FREE( macro_name );
- macro_name = recurse_name;
- }
+ /* Check if the macro is a recursive macro name, if so then
+ * EXPAND the name before expanding the value */
+ if( strchr( macro_name, '$' ) != NIL(char) ) {
+ recurse_name = Expand( macro_name );
+ FREE( macro_name );
+ macro_name = recurse_name;
+ }
- /* Code to do value expansion goes here, NOTE: macros whose assign bit
- is one have been evaluated and assigned, they contain no further
- expansions and thus do not need their values expanded again. */
+ /* Code to do value expansion goes here, NOTE: macros whose assign bit
+ is one have been evaluated and assigned, they contain no further
+ expansions and thus do not need their values expanded again. */
- if( (hp = GET_MACRO( macro_name )) != NIL(HASH) ) {
- if( hp->ht_flag & M_MARK )
- Fatal( "Detected circular macro [%s]", hp->ht_name );
+ if( (hp = GET_MACRO( macro_name )) != NIL(HASH) ) {
+ if( hp->ht_flag & M_MARK )
+ Fatal( "Detected circular macro [%s]", hp->ht_name );
- if( !(hp->ht_flag & M_EXPANDED) ) {
- hp->ht_flag |= M_MARK;
- result = Expand( hp->ht_value );
- hp->ht_flag ^= M_MARK;
- }
- else if( hp->ht_value != NIL(char) )
- result = DmStrDup( hp->ht_value );
- else
- result = DmStrDup( "" );
+ if( !(hp->ht_flag & M_EXPANDED) ) {
+ hp->ht_flag |= M_MARK;
+ result = Expand( hp->ht_value );
+ hp->ht_flag ^= M_MARK;
+ }
+ else if( hp->ht_value != NIL(char) )
+ result = DmStrDup( hp->ht_value );
+ else
+ result = DmStrDup( "" );
- }
- else {
- /* The use of an undefined macro implicitly defines it but
- * leaves its value to NIL(char). */
- hp = Def_macro( macro_name, NIL(char), M_EXPANDED );
- /* Setting M_INIT assures that this macro is treated unset like
- * default internal macros. (Necessary for *= and *:=) */
- hp->ht_flag |= M_INIT;
-
- result = DmStrDup( "" );
- }
- /* Mark macros as used only if we are not expanding them for
- * the purpose of a .IF test, so we can warn about redef after use*/
- if( !If_expand ) hp->ht_flag |= M_USED;
+ }
+ else {
+ /* The use of an undefined macro implicitly defines it but
+ * leaves its value to NIL(char). */
+ hp = Def_macro( macro_name, NIL(char), M_EXPANDED );
+ /* Setting M_INIT assures that this macro is treated unset like
+ * default internal macros. (Necessary for *= and *:=) */
+ hp->ht_flag |= M_INIT;
+
+ result = DmStrDup( "" );
+ }
+ /* Mark macros as used only if we are not expanding them for
+ * the purpose of a .IF test, so we can warn about redef after use*/
+ if( !If_expand ) hp->ht_flag |= M_USED;
}
if( mflag ) {
- char separator;
- int modifier_list = 0;
- int aug_mod = FALSE;
- char *pat1;
- char *pat2;
- char *p;
-
- /* We are inside of a macro expansion. The "build up macro name,
- * find its while loop above should have caught all \<nl> and
- * converted them to a real space. Let's verify this. */
- for( p=s; *p && *p != edelim && *p; p++ ) {
- if( p[0] == '\\' && p[1] == '\n' ) {
- size_t len;
- p[1] = ' ';
- len = strlen(p+1)+1;
- memmove( p, p+1, len );
- }
- }
- if( !*p )
- Fatal( "Syntax error in macro modifier pattern [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
-
- /* Yet another brain damaged AUGMAKE kludge. We should accept the
- * AUGMAKE bullshit of $(f:pat=sub) form of macro expansion. In
- * order to do this we will forgo the normal processing if the
- * AUGMAKE solution pans out, otherwise we will try to process the
- * modifiers ala dmake.
- *
- * So we look for = in modifier string.
- * If found we process it and not do the normal stuff */
-
- for( p=s; *p && *p != '=' && *p != edelim; p++ );
-
- if( *p == '=' ) {
- char *tmp;
-
- pat1 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
- s = p+1;
- p = _scan_ballanced_parens(s+1, edelim);
-
- if ( !*p ) {
- Fatal( "Incomplete macro expression [%s]", s );
- p = s+1;
+ char separator;
+ int modifier_list = 0;
+ int aug_mod = FALSE;
+ char *pat1;
+ char *pat2;
+ char *p;
+
+ /* We are inside of a macro expansion. The "build up macro name,
+ * find its while loop above should have caught all \<nl> and
+ * converted them to a real space. Let's verify this. */
+ for( p=s; *p && *p != edelim && *p; p++ ) {
+ if( p[0] == '\\' && p[1] == '\n' ) {
+ size_t len;
+ p[1] = ' ';
+ len = strlen(p+1)+1;
+ memmove( p, p+1, len );
+ }
+ }
+ if( !*p )
+ Fatal( "Syntax error in macro modifier pattern [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
+
+ /* Yet another brain damaged AUGMAKE kludge. We should accept the
+ * AUGMAKE bullshit of $(f:pat=sub) form of macro expansion. In
+ * order to do this we will forgo the normal processing if the
+ * AUGMAKE solution pans out, otherwise we will try to process the
+ * modifiers ala dmake.
+ *
+ * So we look for = in modifier string.
+ * If found we process it and not do the normal stuff */
+
+ for( p=s; *p && *p != '=' && *p != edelim; p++ );
+
+ if( *p == '=' ) {
+ char *tmp;
+
+ pat1 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
+ s = p+1;
+ p = _scan_ballanced_parens(s+1, edelim);
+
+ if ( !*p ) {
+ Fatal( "Incomplete macro expression [%s]", s );
+ p = s+1;
+ }
+ pat2 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
+
+ result = Apply_edit( result, pat1, pat2, TRUE, TRUE );
+ FREE( pat1 );
+ FREE( pat2 );
+ s = p;
+ aug_mod = TRUE;
}
- pat2 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
-
- result = Apply_edit( result, pat1, pat2, TRUE, TRUE );
- FREE( pat1 );
- FREE( pat2 );
- s = p;
- aug_mod = TRUE;
- }
- if( !aug_mod )
- while( *s && *s != edelim ) { /* while not at end of macro */
- char switch_char;
+ if( !aug_mod )
+ while( *s && *s != edelim ) { /* while not at end of macro */
+ char switch_char;
- switch( switch_char = *s++ ) {
- case '1': modifier_list |= JUST_FIRST_FLAG; break;
+ switch( switch_char = *s++ ) {
+ case '1': modifier_list |= JUST_FIRST_FLAG; break;
- case 'b':
- case 'B': modifier_list |= FILE_FLAG; break;
+ case 'b':
+ case 'B': modifier_list |= FILE_FLAG; break;
- case 'd':
- case 'D': modifier_list |= DIRECTORY_FLAG; break;
+ case 'd':
+ case 'D': modifier_list |= DIRECTORY_FLAG; break;
- case 'f':
- case 'F': modifier_list |= FILE_FLAG | SUFFIX_FLAG; break;
+ case 'f':
+ case 'F': modifier_list |= FILE_FLAG | SUFFIX_FLAG; break;
- case 'e':
- case 'E': modifier_list |= SUFFIX_FLAG; break;
+ case 'e':
+ case 'E': modifier_list |= SUFFIX_FLAG; break;
- case 'l':
- case 'L': modifier_list |= TOLOWER_FLAG; break;
+ case 'l':
+ case 'L': modifier_list |= TOLOWER_FLAG; break;
- case 'i':
- case 'I': modifier_list |= INFNAME_FLAG; break;
+ case 'i':
+ case 'I': modifier_list |= INFNAME_FLAG; break;
- case 'u':
- case 'U': modifier_list |= TOUPPER_FLAG; break;
+ case 'u':
+ case 'U': modifier_list |= TOUPPER_FLAG; break;
- case 'm':
- case 'M':
- if( modifier_list || ( (*s != edelim) && (*s != ':') ) ) {
+ case 'm':
+ case 'M':
+ if( modifier_list || ( (*s != edelim) && (*s != ':') ) ) {
Warning( "Map escape modifier must appear alone, ignored");
modifier_list = 0;
- }
- else {
+ }
+ else {
/* map the escape codes in the separator string first */
for(p=result; (p = strchr(p,ESCAPE_CHAR)) != NIL(char); p++)
- Map_esc( p );
- }
- /* find the end of the macro spec, or the start of a new
- * modifier list for further processing of the result */
+ Map_esc( p );
+ }
+ /* find the end of the macro spec, or the start of a new
+ * modifier list for further processing of the result */
- for( ; (*s != edelim) && (*s != ':') && *s; s++ );
- if( !*s )
- Fatal( "Syntax error in macro. [$%s].\n", start );
- if( *s == ':' ) s++;
- break;
+ for( ; (*s != edelim) && (*s != ':') && *s; s++ );
+ if( !*s )
+ Fatal( "Syntax error in macro. [$%s].\n", start );
+ if( *s == ':' ) s++;
+ break;
- case 'n':
- case 'N': modifier_list |= NORMPATH_FLAG; break;
+ case 'n':
+ case 'N': modifier_list |= NORMPATH_FLAG; break;
- case 'S':
- case 's':
- if( modifier_list ) {
+ case 'S':
+ case 's':
+ if( modifier_list ) {
Warning( "Edit modifier must appear alone, ignored");
modifier_list = 0;
- }
- else {
+ }
+ else {
separator = *s++;
for( p=s; *p != separator && *p; p++ );
if( !*p )
- Fatal( "Syntax error in subst macro. [$%s].\n", start );
+ Fatal( "Syntax error in subst macro. [$%s].\n", start );
else {
- char *t1, *t2;
- pat1 = DmSubStr( s, p );
- for(s=p=p+1; (*p != separator) && *p; p++ );
- /* Before the parsing fixes in iz36027 the :s macro modifier
- * erroneously worked with patterns with missing pattern
- * separator, i.e. $(XXX:s#pat#sub). This is an error because
- * it prohibits the use of following macro modifiers.
- * I.e. $(XXX:s#pat#sub:u) falsely replaces with "sub:u".
- * ??? Remove this special case once OOo compiles without
- * any of this warnings. */
- if( !*p ) {
- if( *(p-1) == edelim ) {
- p--;
- Warning( "Syntax error in subst macro. Bracket found, but third delimiter [%c] missing in [$%s].\n", separator, start );
- }
- else {
- Fatal( "Syntax error in subst macro. Third delimiter [%c] missing in [$%s].\n", separator, start );
+ char *t1, *t2;
+ pat1 = DmSubStr( s, p );
+ for(s=p=p+1; (*p != separator) && *p; p++ );
+ /* Before the parsing fixes in iz36027 the :s macro modifier
+ * erroneously worked with patterns with missing pattern
+ * separator, i.e. $(XXX:s#pat#sub). This is an error because
+ * it prohibits the use of following macro modifiers.
+ * I.e. $(XXX:s#pat#sub:u) falsely replaces with "sub:u".
+ * ??? Remove this special case once OOo compiles without
+ * any of this warnings. */
+ if( !*p ) {
+ if( *(p-1) == edelim ) {
+ p--;
+ Warning( "Syntax error in subst macro. Bracket found, but third delimiter [%c] missing in [$%s].\n", separator, start );
+ }
+ else {
+ Fatal( "Syntax error in subst macro. Third delimiter [%c] missing in [$%s].\n", separator, start );
+ }
}
- }
- pat2 = DmSubStr( s, p );
- t1 = Expand(pat1); FREE(pat1);
- t2 = Expand(pat2); FREE(pat2);
- result = Apply_edit( result, t1, t2, TRUE, FALSE );
- FREE( t1 );
- FREE( t2 );
+ pat2 = DmSubStr( s, p );
+ t1 = Expand(pat1); FREE(pat1);
+ t2 = Expand(pat2); FREE(pat2);
+ result = Apply_edit( result, t1, t2, TRUE, FALSE );
+ FREE( t1 );
+ FREE( t2 );
}
s = p;
- }
- /* find the end of the macro spec, or the start of a new
- * modifier list for further processing of the result */
-
- for( ; (*s != edelim) && (*s != ':') && *s; s++ );
- if( !*s )
- Fatal( "Syntax error in macro. [$%s].\n", start );
- if( *s == ':' ) s++;
- break;
-
- case 'T':
- case 't':
- case '^':
- case '+':
- if( modifier_list ) {
+ }
+ /* find the end of the macro spec, or the start of a new
+ * modifier list for further processing of the result */
+
+ for( ; (*s != edelim) && (*s != ':') && *s; s++ );
+ if( !*s )
+ Fatal( "Syntax error in macro. [$%s].\n", start );
+ if( *s == ':' ) s++;
+ break;
+
+ case 'T':
+ case 't':
+ case '^':
+ case '+':
+ if( modifier_list ) {
Warning( "Tokenize modifier must appear alone, ignored");
modifier_list = 0;
- }
- else {
+ }
+ else {
separator = *s++;
if( separator == '$' ) {
- p = _scan_ballanced_parens(s,'\0');
-
- if ( *p ) {
- char *tmp;
- pat1 = Expand(tmp = DmSubStr(s-1,p));
- FREE(tmp);
- result = Tokenize(result, pat1, switch_char, TRUE);
- FREE(pat1);
- }
- else {
- Warning( "Incomplete macro expression [%s]", s );
- }
- s = p;
+ p = _scan_ballanced_parens(s,'\0');
+
+ if ( *p ) {
+ char *tmp;
+ pat1 = Expand(tmp = DmSubStr(s-1,p));
+ FREE(tmp);
+ result = Tokenize(result, pat1, switch_char, TRUE);
+ FREE(pat1);
+ }
+ else {
+ Warning( "Incomplete macro expression [%s]", s );
+ }
+ s = p;
}
else if ( separator == '\"' ) {
- /* we change the semantics to allow $(v:t")") */
- for (p = s; *p && *p != separator; p++)
- if (*p == '\\')
- if (p[1] == '\\' || p[1] == '"')
- p++;
-
- if( *p == 0 )
- Fatal( "Unterminated separator string" );
- else {
- pat1 = DmSubStr( s, p );
- result = Tokenize( result, pat1, switch_char, TRUE);
- FREE( pat1 );
- }
- s = p;
+ /* we change the semantics to allow $(v:t")") */
+ for (p = s; *p && *p != separator; p++)
+ if (*p == '\\')
+ if (p[1] == '\\' || p[1] == '"')
+ p++;
+
+ if( *p == 0 )
+ Fatal( "Unterminated separator string" );
+ else {
+ pat1 = DmSubStr( s, p );
+ result = Tokenize( result, pat1, switch_char, TRUE);
+ FREE( pat1 );
+ }
+ s = p;
}
else {
Warning(
- "Separator must be a quoted string or macro expression");
+ "Separator must be a quoted string or macro expression");
}
/* find the end of the macro spec, or the start of a new
@@ -1035,26 +1035,26 @@ int doexpand; /* If TRUE enables macro expansion */
for( ; (*s != edelim) && (*s != ':'); s++ );
if( *s == ':' ) s++;
- }
- break;
+ }
+ break;
- case ':':
- if( modifier_list ) {
+ case ':':
+ if( modifier_list ) {
result = Apply_modifiers( modifier_list, result );
modifier_list = 0;
- }
- break;
+ }
+ break;
- default:
- Warning( "Illegal modifier in macro, ignored" );
- break;
- }
- }
+ default:
+ Warning( "Illegal modifier in macro, ignored" );
+ break;
+ }
+ }
- if( modifier_list ) /* apply modifier */
- result = Apply_modifiers( modifier_list, result );
+ if( modifier_list ) /* apply modifier */
+ result = Apply_modifiers( modifier_list, result );
- s++;
+ s++;
}
*ps = s;
@@ -1077,68 +1077,68 @@ char *s;
char **ps;
int *flag;
{
- char *t;
- char *start;
- char *res;
- int lev = 1;
- int done = 0;
-
- DB_ENTER( "_scan_brace" );
-
- start = s;
- while( !done )
- switch( *s++ ) {
- case '{':
- if( *s == '{' ) break; /* ignore {{ */
- lev++;
- break;
-
- case '}':
- if( *s == '}' ) break; /* ignore }} */
- if( lev )
- if( --lev == 0 ) done = TRUE;
- break;
-
- case '$':
- if( *s == '{' || *s == '}' ) {
- if( (t = strchr(s,'}')) != NIL(char) )
- s = t;
- s++;
- }
- break;
+ char *t;
+ char *start;
+ char *res;
+ int lev = 1;
+ int done = 0;
+
+ DB_ENTER( "_scan_brace" );
+
+ start = s;
+ while( !done )
+ switch( *s++ ) {
+ case '{':
+ if( *s == '{' ) break; /* ignore {{ */
+ lev++;
+ break;
+
+ case '}':
+ if( *s == '}' ) break; /* ignore }} */
+ if( lev )
+ if( --lev == 0 ) done = TRUE;
+ break;
+
+ case '$':
+ if( *s == '{' || *s == '}' ) {
+ if( (t = strchr(s,'}')) != NIL(char) )
+ s = t;
+ s++;
+ }
+ break;
- case '\0':
- if( lev ) {
- done = TRUE;
- s--;
- /* error malformed macro expansion */
- }
- break;
+ case '\0':
+ if( lev ) {
+ done = TRUE;
+ s--;
+ /* error malformed macro expansion */
}
+ break;
+ }
- start = DmSubStr( start, (lev) ? s : s-1 );
+ start = DmSubStr( start, (lev) ? s : s-1 );
- if( lev ) {
- /* Braces were not ballanced so just return the string.
- * Do not expand it. */
+ if( lev ) {
+ /* Braces were not ballanced so just return the string.
+ * Do not expand it. */
- res = DmStrJoin( "{", start, -1, FALSE );
- *flag = 0;
- }
- else {
- *flag = 1;
- res = Expand( start );
+ res = DmStrJoin( "{", start, -1, FALSE );
+ *flag = 0;
+ }
+ else {
+ *flag = 1;
+ res = Expand( start );
- if( (t = DmStrSpn( res, " \t" )) != res ) {
- size_t len = strlen(t)+1;
- memmove( res, t, len );
- }
- }
+ if( (t = DmStrSpn( res, " \t" )) != res ) {
+ size_t len = strlen(t)+1;
+ memmove( res, t, len );
+ }
+ }
- FREE( start ); /* this is ok! start is assigned a DmSubStr above */
- *ps = s;
+ FREE( start ); /* this is ok! start is assigned a DmSubStr above */
+ *ps = s;
- DB_RETURN( res );
+ DB_RETURN( res );
}
@@ -1155,31 +1155,31 @@ _cross_prod( x, y )/*
char *x;
char *y;
{
- static char *buf = NULL;
- static int buf_siz = 0;
- char *brkx;
- char *brky;
- char *cy;
- char *cx;
- char *res;
- int i;
-
- if( *x && *y ) {
- res = DmStrDup( "" ); cx = x;
- while( *cx ) {
- cy = y;
- brkx = DmStrPbrk( cx, " \t\n" );
- if( (brkx-cx == 2) && *cx == '\"' && *(cx+1) == '\"' ) cx = brkx;
-
- while( *cy ) {
+ static char *buf = NULL;
+ static int buf_siz = 0;
+ char *brkx;
+ char *brky;
+ char *cy;
+ char *cx;
+ char *res;
+ int i;
+
+ if( *x && *y ) {
+ res = DmStrDup( "" ); cx = x;
+ while( *cx ) {
+ cy = y;
+ brkx = DmStrPbrk( cx, " \t\n" );
+ if( (brkx-cx == 2) && *cx == '\"' && *(cx+1) == '\"' ) cx = brkx;
+
+ while( *cy ) {
brky = DmStrPbrk( cy, " \t\n" );
if( (brky-cy == 2) && *cy == '\"' && *(cy+1) == '\"' ) cy = brky;
i = brkx-cx + brky-cy + 2;
if( i > buf_siz ) { /* grow buf to the correct size */
- if( buf != NIL(char) ) FREE( buf );
- if( (buf = MALLOC( i, char )) == NIL(char)) No_ram();
- buf_siz = i;
+ if( buf != NIL(char) ) FREE( buf );
+ if( (buf = MALLOC( i, char )) == NIL(char)) No_ram();
+ buf_siz = i;
}
strncpy( buf, cx, (i = brkx-cx) );
@@ -1189,16 +1189,16 @@ char *y;
strcat( buf, " " );
res = DmStrJoin( res, buf, -1, TRUE );
cy = DmStrSpn( brky, " \t\n" );
- }
- cx = DmStrSpn( brkx, " \t\n" );
}
+ cx = DmStrSpn( brkx, " \t\n" );
+ }
- FREE( x );
- res[ strlen(res)-1 ] = '\0';
- }
- else
- res = DmStrJoin( x, y, -1, TRUE );
+ FREE( x );
+ res[ strlen(res)-1 ] = '\0';
+ }
+ else
+ res = DmStrJoin( x, y, -1, TRUE );
- FREE( y );
- return( res );
+ FREE( y );
+ return( res );
}
diff --git a/dmake/function.c b/dmake/function.c
index c0942db09213..cd86810849e5 100644
--- a/dmake/function.c
+++ b/dmake/function.c
@@ -465,45 +465,45 @@ static char *
_exec_uniq( args )
char *args;
{
- char *res = NIL(char);
- char *data = Expand(args);
- char **tokens;
- char **tokens_after;
- char *p;
- char *white = " \t\n";
- int j;
- int i;
- char *last = "";
- int k = 0;
-
- for(i=0,p=DmStrSpn(data,white);*p;p=DmStrSpn(DmStrPbrk(p,white),white),i++);
-
- if( i != 0 ) {
- TALLOC(tokens, i, char *);
- TALLOC(tokens_after, i, char *);
-
- for( i=0,p=DmStrSpn(data,white); *p; p=DmStrSpn(p,white),i++){
- tokens[i] = p;
- p = DmStrPbrk(p,white);
- if( *p ) *p++ = '\0';
- }
-
- qsort( tokens, i, sizeof(char *), _mystrcmp );
-
- for( j=0; j<i; j++ ) {
- if (strcmp(tokens[j], last) != 0) {
+ char *res = NIL(char);
+ char *data = Expand(args);
+ char **tokens;
+ char **tokens_after;
+ char *p;
+ char *white = " \t\n";
+ int j;
+ int i;
+ char *last = "";
+ int k = 0;
+
+ for(i=0,p=DmStrSpn(data,white);*p;p=DmStrSpn(DmStrPbrk(p,white),white),i++);
+
+ if( i != 0 ) {
+ TALLOC(tokens, i, char *);
+ TALLOC(tokens_after, i, char *);
+
+ for( i=0,p=DmStrSpn(data,white); *p; p=DmStrSpn(p,white),i++){
+ tokens[i] = p;
+ p = DmStrPbrk(p,white);
+ if( *p ) *p++ = '\0';
+ }
+
+ qsort( tokens, i, sizeof(char *), _mystrcmp );
+
+ for( j=0; j<i; j++ ) {
+ if (strcmp(tokens[j], last) != 0) {
tokens_after[k++] = tokens[j];
last = tokens[j];
- }
}
+ }
- for( j=0; j<k; j++ ) res = DmStrApp(res, tokens_after[j]);
- FREE(data);
- FREE(tokens);
- FREE(tokens_after);
- }
+ for( j=0; j<k; j++ ) res = DmStrApp(res, tokens_after[j]);
+ FREE(tokens);
+ FREE(tokens_after);
+ }
- return(res);
+ FREE(data);
+ return(res);
}
static int
diff --git a/dmake/infer.c b/dmake/infer.c
index e424b34fb201..02682bc16f19 100644
--- a/dmake/infer.c
+++ b/dmake/infer.c
@@ -66,157 +66,162 @@ Infer_recipe( cp, setdirroot )/*
CELLPTR cp;
CELLPTR setdirroot;
{
- ICELLPTR nomatch, match;
-
- DB_ENTER("Infer_recipe");
-
- if( cp->ce_attr & A_NOINFER ) {DB_VOID_RETURN;}
-
- DB_PRINT("inf", ("Inferring rule for [%s]", cp->CE_NAME));
-
- match = NIL(ICELL);
- nomatch = add_iset( NIL(ICELL), NIL(ICELL), NIL(CELL), NIL(DFALINK),
- setdirroot, Prep+count_dots(cp->CE_NAME), 0,
- DmStrDup(cp->CE_NAME), NIL(char),
- cp->ce_time != (time_t)0L);
-
- /* Make sure we try whole heartedly to infer at least one suffix */
- if( nomatch->ic_dmax == 0 ) ++nomatch->ic_dmax;
-
- DB_EXECUTE( "inf", _dump_iset("nomatch",nomatch); );
-
- /* If nomatch is non-empty there was no match with an existing
- * prerrequisite, try to derive one. */
- while( nomatch != NIL(ICELL) ) {
- ICELLPTR new_nomatch = NIL(ICELL);
- ICELLPTR ic, pmatch, mmatch;
- CELLPTR prereq;
-
- for( ic=nomatch; ic != NIL(ICELL); ic=ic->ic_next ) {
- int ipush = FALSE;
-
- if( ic->ic_dir ) ipush = Push_dir(ic->ic_dir, ic->ic_name, FALSE);
- match = union_iset(match, derive_prerequisites(ic, &new_nomatch));
- if( ipush ) Pop_dir(FALSE);
- }
-
- DB_EXECUTE( "inf", _dump_iset("match",match); );
- DB_EXECUTE( "inf", _dump_iset("nomatch",new_nomatch); );
-
- /* We have now deduced the two sets MATCH and NOMATCH. MATCH holds the
- * set of edges that we encountered that matched. If this set is empty
- * then we can apply transitive closure (if enabled) to the elements of
- * NOMATCH to see if we can find some other method to make the target.
- *
- * If MATCH is non-empty, we have found a method for making the target.
- * It is the shortest method for doing so (ie. uses fewest number of
- * steps). If MATCH contains more than one element then we have a
- * possible ambiguity.
- */
- if( match == NIL(ICELL) ) {
- nomatch = new_nomatch;
-
- /* Skip the rest and try one level deeper. */
- if( Transitive ) continue;
-
- goto all_done;
- }
-
- /* Ok, we have a set of possible matches in MATCH, we should check the
- * set for ambiguity. If more than one inference path exists of the
- * same depth, then we may issue an ambiguous inference error message.
- *
- * The message is suppressed if MATCH contains two elements and one of
- * them is the empty-prerequisite-rule. In this case we ignore the
- * ambiguity and take the rule that infers the prerequisite.
- *
- * Also if there are any chains that rely on a non-existant prerequisite
- * that may get made because it has a recipe then we prefer any that
- * rely on existing final prerequisites over those that we have to make.
- */
-
- /* Split out those that have to be made from those that end in
- * prerequisites that already exist. */
- pmatch = mmatch = NIL(ICELL);
- for(; match; match = ic ) {
- /* This loop checks all possible matches. */
- DB_PRINT("inf", ("Target [%s] : prerequisite [%s]",
- match->ic_meta->CE_NAME, match->ic_name));
-
- ic = match->ic_next;
- match->ic_next = NIL(ICELL);
-
- if( match->ic_exists )
+ ICELLPTR nomatch, match;
+
+ DB_ENTER("Infer_recipe");
+
+ if( cp->ce_attr & A_NOINFER ) {DB_VOID_RETURN;}
+
+ DB_PRINT("inf", ("Inferring rule for [%s]", cp->CE_NAME));
+
+ match = NIL(ICELL);
+ {
+ char *tmp;
+ nomatch = add_iset( NIL(ICELL), NIL(ICELL), NIL(CELL), NIL(DFALINK),
+ setdirroot, Prep+count_dots(cp->CE_NAME), 0,
+ tmp = DmStrDup(cp->CE_NAME), NIL(char),
+ cp->ce_time != (time_t)0L);
+ FREE(tmp);
+ }
+
+ /* Make sure we try whole heartedly to infer at least one suffix */
+ if( nomatch->ic_dmax == 0 ) ++nomatch->ic_dmax;
+
+ DB_EXECUTE( "inf", _dump_iset("nomatch",nomatch); );
+
+ /* If nomatch is non-empty there was no match with an existing
+ * prerrequisite, try to derive one. */
+ while( nomatch != NIL(ICELL) ) {
+ ICELLPTR new_nomatch = NIL(ICELL);
+ ICELLPTR ic, pmatch, mmatch;
+ CELLPTR prereq;
+
+ for( ic=nomatch; ic != NIL(ICELL); ic=ic->ic_next ) {
+ int ipush = FALSE;
+
+ if( ic->ic_dir ) ipush = Push_dir(ic->ic_dir, ic->ic_name, FALSE);
+ match = union_iset(match, derive_prerequisites(ic, &new_nomatch));
+ if( ipush ) Pop_dir(FALSE);
+ }
+
+ DB_EXECUTE( "inf", _dump_iset("match",match); );
+ DB_EXECUTE( "inf", _dump_iset("nomatch",new_nomatch); );
+
+ /* We have now deduced the two sets MATCH and NOMATCH. MATCH holds the
+ * set of edges that we encountered that matched. If this set is empty
+ * then we can apply transitive closure (if enabled) to the elements of
+ * NOMATCH to see if we can find some other method to make the target.
+ *
+ * If MATCH is non-empty, we have found a method for making the target.
+ * It is the shortest method for doing so (ie. uses fewest number of
+ * steps). If MATCH contains more than one element then we have a
+ * possible ambiguity.
+ */
+ if( match == NIL(ICELL) ) {
+ nomatch = new_nomatch;
+
+ /* Skip the rest and try one level deeper. */
+ if( Transitive ) continue;
+
+ goto all_done;
+ }
+
+ /* Ok, we have a set of possible matches in MATCH, we should check the
+ * set for ambiguity. If more than one inference path exists of the
+ * same depth, then we may issue an ambiguous inference error message.
+ *
+ * The message is suppressed if MATCH contains two elements and one of
+ * them is the empty-prerequisite-rule. In this case we ignore the
+ * ambiguity and take the rule that infers the prerequisite.
+ *
+ * Also if there are any chains that rely on a non-existant prerequisite
+ * that may get made because it has a recipe then we prefer any that
+ * rely on existing final prerequisites over those that we have to make.
+ */
+
+ /* Split out those that have to be made from those that end in
+ * prerequisites that already exist. */
+ pmatch = mmatch = NIL(ICELL);
+ for(; match; match = ic ) {
+ /* This loop checks all possible matches. */
+ DB_PRINT("inf", ("Target [%s] : prerequisite [%s]",
+ match->ic_meta->CE_NAME, match->ic_name));
+
+ ic = match->ic_next;
+ match->ic_next = NIL(ICELL);
+
+ if( match->ic_exists )
pmatch = union_iset(pmatch, match);
- else
+ else
mmatch = union_iset(mmatch, match);
- }
+ }
- /* Prefer %-targets with existing prerequisites. */
- if( pmatch )
- match = pmatch;
- else
- match = mmatch;
+ /* Prefer %-targets with existing prerequisites. */
+ if( pmatch )
+ match = pmatch;
+ else
+ match = mmatch;
- /* Make sure it is unique. It would be easy to check
- * match->ic_meta->ce_prq for existence and prefer no prerequisites
- * over prerequisites that are present, but we are currently not
- * doing it. */
- if( match->ic_next != NIL(ICELL) ) {
- int count = 1;
+ /* Make sure it is unique. It would be easy to check
+ * match->ic_meta->ce_prq for existence and prefer no prerequisites
+ * over prerequisites that are present, but we are currently not
+ * doing it. */
+ if( match->ic_next != NIL(ICELL) ) {
+ int count = 1;
- Warning( "Ambiguous inference chains for target '%s'", cp->CE_NAME );
- for( ic=match; ic; ic=ic->ic_next )
+ Warning( "Ambiguous inference chains for target '%s'", cp->CE_NAME );
+ for( ic=match; ic; ic=ic->ic_next )
(void) dump_inf_chain(ic, TRUE, count++);
- Warning( "First matching rule is chosen.");
- }
-
- /* MATCH now points at the derived prerequisite chain(s). We must now
- * take cp, and construct the correct graph so that the make may
- * proceed. */
-
- /* The folowing shows only the first element, i.e. the last matching
- * recipe that was found. */
- if( Verbose & V_INFER ) {
- char *tmp = dump_inf_chain(match, TRUE, FALSE);
- printf("%s: Inferring prerequistes and recipes using:\n%s: ... %s\n",
- Pname, Pname, tmp );
- FREE(tmp); }
+ Warning( "First matching rule is chosen.");
+ }
+
+ /* MATCH now points at the derived prerequisite chain(s). We must now
+ * take cp, and construct the correct graph so that the make may
+ * proceed. */
+
+ /* The folowing shows only the first element, i.e. the last matching
+ * recipe that was found. */
+ if( Verbose & V_INFER ) {
+ char *tmp = dump_inf_chain(match, TRUE, FALSE);
+ printf("%s: Inferring prerequistes and recipes using:\n%s: ... %s\n",
+ Pname, Pname, tmp );
+ FREE(tmp);
+ }
- pmatch = NIL(ICELL);
- prereq = NIL(CELL);
+ pmatch = NIL(ICELL);
+ prereq = NIL(CELL);
- /* This loop treats the inferred targets last to first. */
- while( match ) {
- CELLPTR infcell=NIL(CELL);
+ /* This loop treats the inferred targets last to first. */
+ while( match ) {
+ CELLPTR infcell=NIL(CELL);
- /* Compute the inferred prerequisite first. */
- if( match->ic_name ) {
+ /* Compute the inferred prerequisite first. */
+ if( match->ic_name ) {
if( match->ic_meta )
- infcell = Def_cell( match->ic_name );
+ infcell = Def_cell( match->ic_name );
else
- infcell = cp;
+ infcell = cp;
infcell->ce_flag |= F_TARGET;
if( infcell != cp ) {
- infcell->ce_flag |= F_INFER|F_REMOVE;
- DB_PRINT("remove", ("Mark for deletion [%s]",
- infcell->CE_NAME));
+ infcell->ce_flag |= F_INFER|F_REMOVE;
+ DB_PRINT("remove", ("Mark for deletion [%s]",
+ infcell->CE_NAME));
}
if( !match->ic_flag )
- infcell->ce_attr |= A_NOINFER;
- }
+ infcell->ce_attr |= A_NOINFER;
+ }
- /* Add global prerequisites from previous rule if there are any and
- * the recipe. */
- if( pmatch ) {
+ /* Add global prerequisites from previous rule if there are any and
+ * the recipe. */
+ if( pmatch ) {
CELLPTR imeta = pmatch->ic_meta;
LINKPTR lp;
DB_PRINT("inf", ("%%-target [%s] - infered target [%s]\n",
- imeta->CE_NAME, infcell->CE_NAME));
+ imeta->CE_NAME, infcell->CE_NAME));
infcell->ce_per = pmatch->ic_dfa->dl_per;
infcell->ce_attr |= (imeta->ce_attr & A_TRANSFER);
@@ -226,31 +231,31 @@ CELLPTR setdirroot;
* the this target it might have been created and stated
* therefore these values need to be reset. */
if( infcell->ce_attr & A_PHONY ){
- infcell->ce_time = 0L;
- infcell->ce_flag &= ~F_STAT;
+ infcell->ce_time = 0L;
+ infcell->ce_flag &= ~F_STAT;
}
if( !(infcell->ce_flag & F_RULES) ) {
- infcell->ce_flag |= (imeta->ce_flag&(F_SINGLE|F_GROUP))|F_RULES;
- infcell->ce_recipe = imeta->ce_recipe;
+ infcell->ce_flag |= (imeta->ce_flag&(F_SINGLE|F_GROUP))|F_RULES;
+ infcell->ce_recipe = imeta->ce_recipe;
}
/* Add any conditional macro definitions that may be associated
* with the inferred cell. */
if (imeta->ce_cond != NIL(STRING)) {
- STRINGPTR sp,last;
-
- last = infcell->ce_cond;
- for(sp=imeta->ce_cond; sp; sp=sp->st_next) {
- STRINGPTR new;
- TALLOC(new, 1, STRING);
- new->st_string = DmStrDup(sp->st_string);
- if(last)
- last->st_next = new;
- else
- infcell->ce_cond = new;
- last = new;
- }
+ STRINGPTR sp,last;
+
+ last = infcell->ce_cond;
+ for(sp=imeta->ce_cond; sp; sp=sp->st_next) {
+ STRINGPTR new;
+ TALLOC(new, 1, STRING);
+ new->st_string = DmStrDup(sp->st_string);
+ if(last)
+ last->st_next = new;
+ else
+ infcell->ce_cond = new;
+ last = new;
+ }
}
pmatch->ic_dfa->dl_per = NIL(char);
@@ -258,63 +263,63 @@ CELLPTR setdirroot;
/* If infcell already had a .SETDIR directory set then modify it
* based on whether it was the original cell or some intermediary. */
if( imeta->ce_dir ) {
- if( infcell->ce_dir && infcell == cp ) {
- /* cp->ce_dir was set and we have pushed the directory prior
- * to calling this routine.
- * We build a new path by appending imeta->ce_dir to the
- * current directory of the original cell.
- * We should therefore pop it and push the new concatenated
- * directory required by the inference.
- * This leaks memory as cp->ce_dir is not freed before
- * setting the new the new infcell->ce_dir value but as
- * the pointer could be a `A_POOL` member we accept this. */
- infcell->ce_dir = DmStrDup(Build_path(infcell->ce_dir,
- imeta->ce_dir));
- }
- else {
- /* Inherit a copy of the .SETDIR value. Use a copy because
- * the original could have been freed in the meantime
- * in Make() by the FREE() before _pool_lookup(). This can
- * also leak if infcell->ce_dir was set before. */
- infcell->ce_dir = DmStrDup(imeta->ce_dir);
- }
+ if( infcell->ce_dir && infcell == cp ) {
+ /* cp->ce_dir was set and we have pushed the directory prior
+ * to calling this routine.
+ * We build a new path by appending imeta->ce_dir to the
+ * current directory of the original cell.
+ * We should therefore pop it and push the new concatenated
+ * directory required by the inference.
+ * This leaks memory as cp->ce_dir is not freed before
+ * setting the new the new infcell->ce_dir value but as
+ * the pointer could be a `A_POOL` member we accept this. */
+ infcell->ce_dir = DmStrDup(Build_path(infcell->ce_dir,
+ imeta->ce_dir));
+ }
+ else {
+ /* Inherit a copy of the .SETDIR value. Use a copy because
+ * the original could have been freed in the meantime
+ * in Make() by the FREE() before _pool_lookup(). This can
+ * also leak if infcell->ce_dir was set before. */
+ infcell->ce_dir = DmStrDup(imeta->ce_dir);
+ }
}
for( lp=imeta->ce_indprq; lp != NIL(LINK); lp=lp->cl_next ) {
- char *name = lp->cl_prq->CE_NAME;
- CELLPTR tcp;
-
- name = buildname( cp->CE_NAME, name, infcell->ce_per );
- tcp = Def_cell( name );
- tcp->ce_flag |= F_REMOVE;
- Add_prerequisite( infcell, tcp, FALSE, FALSE );
-
- if( Verbose & V_INFER )
- printf( "%s: Inferred indirect prerequisite [%s]\n",
- Pname, name );
- FREE(name);
+ char *name = lp->cl_prq->CE_NAME;
+ CELLPTR tcp;
+
+ name = buildname( cp->CE_NAME, name, infcell->ce_per );
+ tcp = Def_cell( name );
+ tcp->ce_flag |= F_REMOVE;
+ Add_prerequisite( infcell, tcp, FALSE, FALSE );
+
+ if( Verbose & V_INFER )
+ printf( "%s: Inferred indirect prerequisite [%s]\n",
+ Pname, name );
+ FREE(name);
}
- }
+ }
- /* Add the previous cell as the prerequisite */
- if( prereq )
+ /* Add the previous cell as the prerequisite */
+ if( prereq )
(Add_prerequisite(infcell,prereq,FALSE,FALSE))->cl_flag |=F_TARGET;
- pmatch = match; /* Previous member in inference chain ... */
- prereq = infcell; /* is a prerequisite to the next match. */
- /* ip->ic_parent is the next target in the inference chain to be
- * build. If it is empty we are done. */
- match = match->ic_parent;
- }
+ pmatch = match; /* Previous member in inference chain ... */
+ prereq = infcell; /* is a prerequisite to the next match. */
+ /* ip->ic_parent is the next target in the inference chain to be
+ * build. If it is empty we are done. */
+ match = match->ic_parent;
+ }
- DB_PRINT("inf", ("Terminated due to a match"));
- break;
- }
+ DB_PRINT("inf", ("Terminated due to a match"));
+ break;
+ }
-all_done:
- free_icells();
+ all_done:
+ free_icells();
- DB_VOID_RETURN;
+ DB_VOID_RETURN;
}
diff --git a/dmake/parse.c b/dmake/parse.c
index 2344192b8541..550f14223a91 100644
--- a/dmake/parse.c
+++ b/dmake/parse.c
@@ -35,142 +35,142 @@ Parse( fil )/*
============== Parse the makefile input */
FILE *fil;
{
- int rule = FALSE; /* have seen a recipe line */
- char *p; /* termporary pointer into Buffer */
- char *pTmpBuf;
+ int rule = FALSE; /* have seen a recipe line */
+ char *p; /* termporary pointer into Buffer */
+ char *pTmpBuf;
- DB_ENTER( "Parse" );
+ DB_ENTER( "Parse" );
- State = NORMAL_SCAN;
- Group = FALSE; /* true if scanning a group rcpe */
- while( TRUE ) {
- if( Get_line( Buffer, fil ) ) {
- if( Group ) Fatal( "Incomplete rule recipe group detected" );
+ State = NORMAL_SCAN;
+ Group = FALSE; /* true if scanning a group rcpe */
+ while( TRUE ) {
+ if( Get_line( Buffer, fil ) ) {
+ if( Group ) Fatal( "Incomplete rule recipe group detected" );
- /* If we are still in RULE_SCAN mode there might be unbound recipes. */
- if( State == RULE_SCAN )
+ /* If we are still in RULE_SCAN mode there might be unbound recipes. */
+ if( State == RULE_SCAN )
Bind_rules_to_targets( F_DEFAULT );
- if( fil != NIL( FILE ) ) /* end of parsable input */
+ if( fil != NIL( FILE ) ) /* end of parsable input */
Closefile();
- DB_VOID_RETURN;
- }
- else {
+ DB_VOID_RETURN;
+ }
+ else {
#ifdef _MPW
- if ( Buffer[0] == 10 )
- pTmpBuf = Buffer+1;
- else
+ if ( Buffer[0] == 10 )
+ pTmpBuf = Buffer+1;
+ else
#endif
- pTmpBuf = Buffer;
+ pTmpBuf = Buffer;
#ifdef _MPW
- p = pTmpBuf;
- while ( *p )
- {
- if ( *p == 10 )
- *p = '\t';
- p++;
- }
+ p = pTmpBuf;
+ while ( *p )
+ {
+ if ( *p == 10 )
+ *p = '\t';
+ p++;
+ }
#endif
- switch( State ) {
- case RULE_SCAN:
+ switch( State ) {
+ case RULE_SCAN:
- /* Check for the `[' that starts off a group recipe definition.
- * It must appear as the first non-white space
- * character in the line. */
+ /* Check for the `[' that starts off a group recipe definition.
+ * It must appear as the first non-white space
+ * character in the line. */
- p = DmStrSpn( Buffer, " \t\r\n" );
- if( Set_group_attributes( p ) ) {
+ p = DmStrSpn( Buffer, " \t\r\n" );
+ if( Set_group_attributes( p ) ) {
if( Group )
- Fatal( "New group recipe begin found within group recipe." );
+ Fatal( "New group recipe begin found within group recipe." );
else if( rule )
- Fatal( "Cannot mix single and group recipe lines." );
+ Fatal( "Cannot mix single and group recipe lines." );
+ else
+ Group = TRUE;
+
+ rule = TRUE;
+
+ break; /* ignore the group start */
+ }
+
+ if( Group ) {
+ if( *p != ']' ) {
+ Add_recipe_to_list( pTmpBuf, TRUE, TRUE );
+ rule = TRUE;
+ }
else
- Group = TRUE;
-
- rule = TRUE;
-
- break; /* ignore the group start */
- }
-
- if( Group ) {
- if( *p != ']' ) {
- Add_recipe_to_list( pTmpBuf, TRUE, TRUE );
- rule = TRUE;
- }
- else
- State = NORMAL_SCAN;
- }
- else {
- if( *pTmpBuf == '\t'
- || (Notabs && *pTmpBuf == ' ') ) {
- Add_recipe_to_list( pTmpBuf, FALSE, FALSE );
- rule = TRUE;
- }
- else if( *p == ']' )
- Fatal( "Found unmatched ']'" );
- else if( *pTmpBuf ) /* Something that was no recipe. */
- State = NORMAL_SCAN;
+ State = NORMAL_SCAN;
+ }
+ else {
+ if( *pTmpBuf == '\t'
+ || (Notabs && *pTmpBuf == ' ') ) {
+ Add_recipe_to_list( pTmpBuf, FALSE, FALSE );
+ rule = TRUE;
+ }
+ else if( *p == ']' )
+ Fatal( "Found unmatched ']'" );
+ else if( *pTmpBuf ) /* Something that was no recipe. */
+ State = NORMAL_SCAN;
/* The only thing that was not handled was an empty line. */
- }
+ }
- if( State == RULE_SCAN ) break; /* ie. keep going */
+ if( State == RULE_SCAN ) break; /* ie. keep going */
- Bind_rules_to_targets( (Group) ? F_GROUP: F_DEFAULT );
+ Bind_rules_to_targets( (Group) ? F_GROUP: F_DEFAULT );
- rule = FALSE;
- if( Group ) {
- Group = FALSE;
- break;
- }
- /*FALLTRHOUGH*/
+ rule = FALSE;
+ if( Group ) {
+ Group = FALSE;
+ break;
+ }
+ /*FALLTRHOUGH*/
- /* In this case we broke out of the rule scan because we do not
- * have a recipe line that begins with a <TAB>, so lets
- * try to scan the thing as a macro or rule definition. */
+ /* In this case we broke out of the rule scan because we do not
+ * have a recipe line that begins with a <TAB>, so lets
+ * try to scan the thing as a macro or rule definition. */
- case NORMAL_SCAN:
- if( !*pTmpBuf ) continue; /* we have null input line */
+ case NORMAL_SCAN:
+ if( !*pTmpBuf ) continue; /* we have null input line */
- /* STUPID AUGMAKE uses "include" at the start of a line as
- * a signal to include a new file, so let's look for it.
- * if we see it replace it by .INCLUDE: and stick this back
- * into the buffer. */
- if( !strncmp( "include", pTmpBuf, 7 ) &&
- (pTmpBuf[7] == ' ' || pTmpBuf[7] == '\t') )
- {
- char *tmp;
+ /* STUPID AUGMAKE uses "include" at the start of a line as
+ * a signal to include a new file, so let's look for it.
+ * if we see it replace it by .INCLUDE: and stick this back
+ * into the buffer. */
+ if( !strncmp( "include", pTmpBuf, 7 ) &&
+ (pTmpBuf[7] == ' ' || pTmpBuf[7] == '\t') )
+ {
+ char *tmp;
- tmp = DmStrJoin( ".INCLUDE:", pTmpBuf+7, -1, FALSE );
- strcpy( pTmpBuf, tmp );
- FREE( tmp );
- }
+ tmp = DmStrJoin( ".INCLUDE:", pTmpBuf+7, -1, FALSE );
+ strcpy( pTmpBuf, tmp );
+ FREE( tmp );
+ }
- /* look for a macro definition, they all contain an = sign
- * if we fail to recognize it as a legal macro op then try to
- * parse the same line as a rule definition, it's one or the
- * other */
+ /* look for a macro definition, they all contain an = sign
+ * if we fail to recognize it as a legal macro op then try to
+ * parse the same line as a rule definition, it's one or the
+ * other */
- if( Parse_macro(pTmpBuf, M_DEFAULT) ) break;/* it's a macro def*/
- if( Parse_rule_def( &State ) ) break;/* it's a rule def */
+ if( Parse_macro(pTmpBuf, M_DEFAULT) ) break;/* it's a macro def*/
+ if( Parse_rule_def( &State ) ) break;/* it's a rule def */
- /* if it is an empty or blank line then ignore it */
- if( !*Buffer || *DmStrSpn( Buffer, " \t\r\n" ) == '\0' ) break;
+ /* if it is an empty or blank line then ignore it */
+ if( !*Buffer || *DmStrSpn( Buffer, " \t\r\n" ) == '\0' ) break;
- /* otherwise assume it was a line of unrecognized input, or a
- * recipe line out of place so print a message */
+ /* otherwise assume it was a line of unrecognized input, or a
+ * recipe line out of place so print a message */
- Fatal( "Expecting macro or rule defn, found neither" );
- break;
+ Fatal( "Expecting macro or rule defn, found neither" );
+ break;
- default:
- Fatal( "Internal -- UNKNOWN Parser state %d", State );
- }
+ default:
+ Fatal( "Internal -- UNKNOWN Parser state %d", State );
}
- }
+ }
+ }
}
diff --git a/dmake/rulparse.c b/dmake/rulparse.c
index af7915fb129b..f47f166ef7ae 100644
--- a/dmake/rulparse.c
+++ b/dmake/rulparse.c
@@ -75,72 +75,72 @@ Parse_rule_def( state )/*
*/
int *state;
{
- TKSTR input; /* input string struct for token search */
- CELLPTR targets; /* list of targets if any */
- CELLPTR prereq; /* list of prereq if any */
- CELLPTR prereqtail; /* tail of prerequisite list */
- CELLPTR cp; /* temporary cell pointer for list making */
- char *result; /* temporary storage for result */
- char *tok; /* temporary pointer for tokens */
- char *set_dir; /* value of setdir attribute */
- char *brk; /* break char list for Get_token */
- char *firstrcp; /* first recipe line, from ; in rule line */
- t_attr attr; /* sum of attribute flags for current tgts*/
- t_attr at; /* temp place to keep an attribute code */
- int op; /* rule operator */
- int special; /* indicate special targets in rule */
- int augmeta; /* indicate .<suffix> like target */
- int percent; /* indicate percent rule target */
- int percent_prq; /* indicate mixed %-rule prereq possible */
-
- DB_ENTER( "Parse_rule_def" );
-
- op = 0;
- attr = 0;
- special = 0;
- augmeta = 0;
- percent = 0;
- set_dir = NIL( char );
- targets = NIL(CELL);
- prereq = NIL(CELL);
- prereqtail = NIL(CELL);
- percent_prq = 0;
-
- /* Check to see if the line is of the form:
- * targets : prerequisites; first recipe line
- * If so remember the first_recipe part of the line. */
-
- firstrcp = strchr( Buffer, ';' );
- if( firstrcp != NIL( char ) ) {
- *firstrcp++ = 0;
- firstrcp = DmStrSpn( firstrcp, " \t" );
- }
-
- result = Expand( Buffer );
- /* Remove CONTINUATION_CHAR, keep the <nl> */
- for( brk=strchr(result,CONTINUATION_CHAR); brk != NIL(char); brk=strchr(brk,CONTINUATION_CHAR) )
- if( brk[1] == '\n' )
- *brk = ' ';
- else
- brk++;
-
- DB_PRINT( "par", ("Scanning: [%s]", result) );
-
- SET_TOKEN( &input, result );
- brk = ":-^!|";
- Def_targets = TRUE;
+ TKSTR input; /* input string struct for token search */
+ CELLPTR targets; /* list of targets if any */
+ CELLPTR prereq; /* list of prereq if any */
+ CELLPTR prereqtail; /* tail of prerequisite list */
+ CELLPTR cp; /* temporary cell pointer for list making */
+ char *result; /* temporary storage for result */
+ char *tok; /* temporary pointer for tokens */
+ char *set_dir; /* value of setdir attribute */
+ char *brk; /* break char list for Get_token */
+ char *firstrcp; /* first recipe line, from ; in rule line */
+ t_attr attr; /* sum of attribute flags for current tgts*/
+ t_attr at; /* temp place to keep an attribute code */
+ int op; /* rule operator */
+ int special; /* indicate special targets in rule */
+ int augmeta; /* indicate .<suffix> like target */
+ int percent; /* indicate percent rule target */
+ int percent_prq; /* indicate mixed %-rule prereq possible */
+
+ DB_ENTER( "Parse_rule_def" );
+
+ op = 0;
+ attr = 0;
+ special = 0;
+ augmeta = 0;
+ percent = 0;
+ set_dir = NIL( char );
+ targets = NIL(CELL);
+ prereq = NIL(CELL);
+ prereqtail = NIL(CELL);
+ percent_prq = 0;
+
+ /* Check to see if the line is of the form:
+ * targets : prerequisites; first recipe line
+ * If so remember the first_recipe part of the line. */
+
+ firstrcp = strchr( Buffer, ';' );
+ if( firstrcp != NIL( char ) ) {
+ *firstrcp++ = 0;
+ firstrcp = DmStrSpn( firstrcp, " \t" );
+ }
+
+ result = Expand( Buffer );
+ /* Remove CONTINUATION_CHAR, keep the <nl> */
+ for( brk=strchr(result,CONTINUATION_CHAR); brk != NIL(char); brk=strchr(brk,CONTINUATION_CHAR) )
+ if( brk[1] == '\n' )
+ *brk = ' ';
+ else
+ brk++;
+
+ DB_PRINT( "par", ("Scanning: [%s]", result) );
+
+ SET_TOKEN( &input, result );
+ brk = ":-^!|";
+ Def_targets = TRUE;
+
+ /* Scan the input rule line collecting targets, the operator, and any
+ * prerequisites. Stop when we run out of targets and prerequisites. */
+
+ while( *(tok = Get_token( &input, brk, TRUE )) != '\0' )
+ if( !op ) {
+ /* we are scanning targets and attributes
+ * check to see if token is an operator. */
+
+ op = Rule_op( tok );
- /* Scan the input rule line collecting targets, the operator, and any
- * prerequisites. Stop when we run out of targets and prerequisites. */
-
- while( *(tok = Get_token( &input, brk, TRUE )) != '\0' )
if( !op ) {
- /* we are scanning targets and attributes
- * check to see if token is an operator. */
-
- op = Rule_op( tok );
-
- if( !op ) {
/* Define a new cell, or get pointer to pre-existing cell. */
/* Do we need cells for attributes? If not move the definition
* to the target part. */
@@ -151,209 +151,209 @@ int *state;
DB_PRINT( "par", ("tg_cell [%s]", tok) );
if( (at = _is_attribute(tok)) != 0 ) {
- /* Ignore .SILENT when -vr is active. */
- if( (Verbose & V_FORCEECHO) && (at == A_SILENT) )
- at = 0;
+ /* Ignore .SILENT when -vr is active. */
+ if( (Verbose & V_FORCEECHO) && (at == A_SILENT) )
+ at = 0;
- /* Logically OR the attributes specified into one main
- * ATTRIBUTE mask. */
+ /* Logically OR the attributes specified into one main
+ * ATTRIBUTE mask. */
- if( at == A_SETDIR ) {
- if( set_dir != NIL( char ) )
- Warning( "Multiple .SETDIR attribute ignored" );
- else
- set_dir = DmStrDup( tok );
- }
+ if( at == A_SETDIR ) {
+ if( set_dir != NIL( char ) )
+ Warning( "Multiple .SETDIR attribute ignored" );
+ else
+ set_dir = DmStrDup( tok );
+ }
- attr |= at;
+ attr |= at;
}
else {
- /* Not an attribute, this must be a target. */
- int tmp;
-
- tmp = _is_special( tok );
-
- if( _is_percent( tok ) ) {
- /* First %-target checks if there were non-%-targets before. */
- if( !percent && targets != NIL(CELL) )
- Fatal( "A %%-target must not be mixed with non-%%-targets, offending target [%s]", tok );
-
- percent++;
- cp->ce_flag |= F_PERCENT;
- } else {
- if( percent )
- Fatal( "A non-%%-target must not be mixed with %%-targets, offending target [%s]", tok );
- }
-
- if( _is_magic( tok ) ) {
- /* Check that AUGMAKE targets are not mixed with other
- * targets. The return value of _is_magic() is discarded and
- * calculated again in _do_targets() if this rule definition
- * really is a .<suffix> like target.
- * If we would allow only one target per line we could easily
- * store the result for later, but for multiple .<suffix>
- * targets this creates too much overhead.
- * These targets should be rare (obsolete?) anyway. */
- if( !augmeta && targets != NIL(CELL) )
- Fatal( "An AUGMAKE meta target must not be mixed with non AUGMAKE meta targets, offending target [%s]", tok );
-
- augmeta++;
- cp->ce_flag |= F_MAGIC; /* do_magic will also add F_PERCENT later. */
- } else {
- if( augmeta )
- Fatal( "A non AUGMAKE meta target must not be mixed with AUGMAKE meta targets, offending target [%s]", tok );
- }
-
- if( special )
- Fatal( "Special target must appear alone, found [%s]", tok );
- else if( !(cp->ce_flag & F_MARK) ) {
- /* Targets are kept in this list in lexically sorted order.
- * This allows for easy equality comparison of target
- * sets.*/
- CELLPTR prev,cur;
- for(prev=NIL(CELL),cur=targets;cur;prev=cur,cur=cur->ce_link)
- if(strcmp(cur->CE_NAME,cp->CE_NAME) > 0)
- break;
-
- cp->ce_link = cur;
-
- if (!prev)
- targets = cp;
+ /* Not an attribute, this must be a target. */
+ int tmp;
+
+ tmp = _is_special( tok );
+
+ if( _is_percent( tok ) ) {
+ /* First %-target checks if there were non-%-targets before. */
+ if( !percent && targets != NIL(CELL) )
+ Fatal( "A %%-target must not be mixed with non-%%-targets, offending target [%s]", tok );
+
+ percent++;
+ cp->ce_flag |= F_PERCENT;
+ } else {
+ if( percent )
+ Fatal( "A non-%%-target must not be mixed with %%-targets, offending target [%s]", tok );
+ }
+
+ if( _is_magic( tok ) ) {
+ /* Check that AUGMAKE targets are not mixed with other
+ * targets. The return value of _is_magic() is discarded and
+ * calculated again in _do_targets() if this rule definition
+ * really is a .<suffix> like target.
+ * If we would allow only one target per line we could easily
+ * store the result for later, but for multiple .<suffix>
+ * targets this creates too much overhead.
+ * These targets should be rare (obsolete?) anyway. */
+ if( !augmeta && targets != NIL(CELL) )
+ Fatal( "An AUGMAKE meta target must not be mixed with non AUGMAKE meta targets, offending target [%s]", tok );
+
+ augmeta++;
+ cp->ce_flag |= F_MAGIC; /* do_magic will also add F_PERCENT later. */
+ } else {
+ if( augmeta )
+ Fatal( "A non AUGMAKE meta target must not be mixed with AUGMAKE meta targets, offending target [%s]", tok );
+ }
+
+ if( special )
+ Fatal( "Special target must appear alone, found [%s]", tok );
+ else if( !(cp->ce_flag & F_MARK) ) {
+ /* Targets are kept in this list in lexically sorted order.
+ * This allows for easy equality comparison of target
+ * sets.*/
+ CELLPTR prev,cur;
+ for(prev=NIL(CELL),cur=targets;cur;prev=cur,cur=cur->ce_link)
+ if(strcmp(cur->CE_NAME,cp->CE_NAME) > 0)
+ break;
+
+ cp->ce_link = cur;
+
+ if (!prev)
+ targets = cp;
+ else
+ prev->ce_link = cp;
+
+ cp->ce_flag |= F_MARK | F_EXPLICIT;
+ special = tmp;
+ }
else
- prev->ce_link = cp;
-
- cp->ce_flag |= F_MARK | F_EXPLICIT;
- special = tmp;
- }
- else
- Warning( "Duplicate target [%s]", cp->CE_NAME );
+ Warning( "Duplicate target [%s]", cp->CE_NAME );
}
- }
- else {
+ }
+ else {
/* found an operator so empty out break list and clear mark
* bits on target list, setting them all to F_VISITED*/
brk = "";
for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) {
- cp->ce_flag ^= F_MARK;
- cp->ce_flag |= F_VISITED;
+ cp->ce_flag ^= F_MARK;
+ cp->ce_flag |= F_VISITED;
}
Def_targets = FALSE;
- }
}
- else {
- /* Scanning prerequisites so build the prerequisite list. We use
- * F_MARK flag to make certain we have only a single copy of the
- * prerequisite in the list */
+ }
+ else {
+ /* Scanning prerequisites so build the prerequisite list. We use
+ * F_MARK flag to make certain we have only a single copy of the
+ * prerequisite in the list */
- cp = Def_cell( tok );
+ cp = Def_cell( tok );
- /* %-prerequisits require eiter a %-target or this might be a rule of
- * the "ATTRIBUTE_LIST : targets" form. */
- if( _is_percent( tok ) ) {
+ /* %-prerequisits require eiter a %-target or this might be a rule of
+ * the "ATTRIBUTE_LIST : targets" form. */
+ if( _is_percent( tok ) ) {
if( percent || ((targets == NIL(CELL)) && attr) )
- percent_prq = 1;
+ percent_prq = 1;
else
- Fatal( "Syntax error in %% rule, missing %% target");
- }
+ Fatal( "Syntax error in %% rule, missing %% target");
+ }
- if( cp->ce_flag & F_VISITED ) {
+ if( cp->ce_flag & F_VISITED ) {
if( cp->ce_attr & A_COMPOSITE )
- continue;
+ continue;
else
- Fatal( "Detected circular dependency in graph at [%s]",
- cp->CE_NAME );
- }
- else if( !(cp->ce_flag & F_MARK) ) {
+ Fatal( "Detected circular dependency in graph at [%s]",
+ cp->CE_NAME );
+ }
+ else if( !(cp->ce_flag & F_MARK) ) {
DB_PRINT( "par", ("pq_cell [%s]", tok) );
cp->ce_flag |= F_MARK;
if( prereqtail == NIL(CELL) ) /* keep prereq's in order */
- prereq = cp;
+ prereq = cp;
else
- prereqtail->ce_link = cp;
+ prereqtail->ce_link = cp;
prereqtail = cp;
cp->ce_link = NIL(CELL);
- }
- else if( !(cp->ce_attr & A_LIBRARY) && (Verbose & V_WARNALL))
- Warning("Duplicate entry [%s] in prerequisite list",cp->CE_NAME);
}
-
- /* Check to see if we have a percent rule that has only global
- * prerequisites, i.e. they are of the form: "%.a : foo".
- * If so then set the flag so that later on, we don't issue
- * an error if such targets supply an empty set of rules. */
-
- if( percent && !percent_prq && (prereq != NIL(CELL)) )
- _sv_globprq_only = 1;
-
- /* It's ok to have targets with attributes, and no prerequisites, but it's
- * not ok to have no targets and no attributes, or no operator */
-
- if( !op ) {
- CLEAR_TOKEN( &input );
- DB_PRINT( "par", ("Not a rule [%s]", Buffer) );
- DB_RETURN( 0 );
- }
-
- /* More than one percent target didn't work with prior versions. */
- if( (percent > 1) && !(op & R_OP_OR) )
- Warning( "Prior to dmake 4.5 only one\n"
- "%%-target per target-definition worked reliably. Check your makefiles.\n" );
-
- if( !attr && targets == NIL(CELL) ) {
- Fatal( "Missing targets or attributes in rule" );
- if( set_dir != NIL( char )) FREE( set_dir );
- DB_RETURN( 0 );
- }
-
- /* We have established we have a legal rules line, so we must process it.
- * In doing so we must handle any special targets. Special targets must
- * appear alone possibly accompanied by attributes.
- * NOTE: special != 0 ==> targets != NIL(CELL) */
-
- if( prereqtail != NIL(CELL) ) prereqtail->ce_link = NIL(CELL);
-
- /* Clear out MARK bits used in duplicate checking. I originally wanted
- * to do this as the lists get processed but that got too error prone
- * so I bit the bullit and added these two loops. */
-
- for( cp=prereq; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_MARK;
- for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_VISITED;
-
- /* Check to see if the previous recipe was bound, if not the call
- * Bind_rules_to_targets() to bind the recipe (_sv_rules) to the
- * target(s) (_sv_targets). */
- /* was: if( _sv_rules != NIL(STRING) ) Bind_rules_to_targets( F_DEFAULT );*/
- /* Only Add_recipe_to_list() sets _sv_rules and Bind_rules_to_targets()
- * clears the (static) variables again. Bind_rules_to_targets() is
- * (should be) called after State is leaving RULE_SCAN in Parse().
- * Abort if there are unbound recipes. FIXME: Remove this paragraph
- * if this never occurs. */
- if( _sv_rules != NIL(STRING) )
- Fatal( "Internal Error: _sv_rules not empty." );
-
- /* Add the first recipe line to the list */
- if( firstrcp != NIL( char ) )
- Add_recipe_to_list( firstrcp, TRUE, FALSE );
-
- /* Save these prior to calling _do_targets, since _build_graph needs the
- * _sv_setdir value for matching edges. */
- _sv_op = op;
- _sv_setdir = set_dir;
-
- if( special )
- /* _do_special() can alter *state */
- _do_special( special, op, attr, set_dir, targets, prereq, state );
- else
- *state = _do_targets( op, attr, set_dir, targets, prereq );
-
- if( (*state != RULE_SCAN) && (_sv_rules != NIL(STRING)) )
- Fatal( "Unexpected recipe found." );
-
- DB_RETURN( 1 );
+ else if( !(cp->ce_attr & A_LIBRARY) && (Verbose & V_WARNALL))
+ Warning("Duplicate entry [%s] in prerequisite list",cp->CE_NAME);
+ }
+
+ /* Check to see if we have a percent rule that has only global
+ * prerequisites, i.e. they are of the form: "%.a : foo".
+ * If so then set the flag so that later on, we don't issue
+ * an error if such targets supply an empty set of rules. */
+
+ if( percent && !percent_prq && (prereq != NIL(CELL)) )
+ _sv_globprq_only = 1;
+
+ /* It's ok to have targets with attributes, and no prerequisites, but it's
+ * not ok to have no targets and no attributes, or no operator */
+
+ CLEAR_TOKEN( &input ); FREE(result); result = NIL(char);
+ if( !op ) {
+ DB_PRINT( "par", ("Not a rule [%s]", Buffer) );
+ DB_RETURN( 0 );
+ }
+
+ /* More than one percent target didn't work with prior versions. */
+ if( (percent > 1) && !(op & R_OP_OR) )
+ Warning( "Prior to dmake 4.5 only one\n"
+ "%%-target per target-definition worked reliably. Check your makefiles.\n" );
+
+ if( !attr && targets == NIL(CELL) ) {
+ Fatal( "Missing targets or attributes in rule" );
+ if( set_dir != NIL( char )) FREE( set_dir );
+ DB_RETURN( 0 );
+ }
+
+ /* We have established we have a legal rules line, so we must process it.
+ * In doing so we must handle any special targets. Special targets must
+ * appear alone possibly accompanied by attributes.
+ * NOTE: special != 0 ==> targets != NIL(CELL) */
+
+ if( prereqtail != NIL(CELL) ) prereqtail->ce_link = NIL(CELL);
+
+ /* Clear out MARK bits used in duplicate checking. I originally wanted
+ * to do this as the lists get processed but that got too error prone
+ * so I bit the bullit and added these two loops. */
+
+ for( cp=prereq; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_MARK;
+ for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_VISITED;
+
+ /* Check to see if the previous recipe was bound, if not the call
+ * Bind_rules_to_targets() to bind the recipe (_sv_rules) to the
+ * target(s) (_sv_targets). */
+ /* was: if( _sv_rules != NIL(STRING) ) Bind_rules_to_targets( F_DEFAULT );*/
+ /* Only Add_recipe_to_list() sets _sv_rules and Bind_rules_to_targets()
+ * clears the (static) variables again. Bind_rules_to_targets() is
+ * (should be) called after State is leaving RULE_SCAN in Parse().
+ * Abort if there are unbound recipes. FIXME: Remove this paragraph
+ * if this never occurs. */
+ if( _sv_rules != NIL(STRING) )
+ Fatal( "Internal Error: _sv_rules not empty." );
+
+ /* Add the first recipe line to the list */
+ if( firstrcp != NIL( char ) )
+ Add_recipe_to_list( firstrcp, TRUE, FALSE );
+
+ /* Save these prior to calling _do_targets, since _build_graph needs the
+ * _sv_setdir value for matching edges. */
+ _sv_op = op;
+ _sv_setdir = set_dir;
+
+ if( special )
+ /* _do_special() can alter *state */
+ _do_special( special, op, attr, set_dir, targets, prereq, state );
+ else
+ *state = _do_targets( op, attr, set_dir, targets, prereq );
+
+ if( (*state != RULE_SCAN) && (_sv_rules != NIL(STRING)) )
+ Fatal( "Unexpected recipe found." );
+
+ DB_RETURN( 1 );
}
@@ -576,240 +576,239 @@ CELLPTR target;
CELLPTR prereq;
int *state;
{
- HASHPTR hp; /* pointer to macro def cell */
- CELLPTR cp; /* temporary pointer into cells list */
- CELLPTR dp; /* pointer to directory dir cell */
- LINKPTR lp; /* pointer at prerequisite list */
- char *dir; /* current dir to prepend */
- char *path; /* resulting path to try to read */
- char *name; /* File name for processing a .INCLUDE */
- char *tmp; /* temporary string pointer */
- FILE *fil; /* File descriptor returned by Openfile */
+ HASHPTR hp; /* pointer to macro def cell */
+ CELLPTR cp; /* temporary pointer into cells list */
+ CELLPTR dp; /* pointer to directory dir cell */
+ LINKPTR lp; /* pointer at prerequisite list */
+ char *dir; /* current dir to prepend */
+ char *path; /* resulting path to try to read */
+ char *name; /* File name for processing a .INCLUDE */
+ char *tmp; /* temporary string pointer */
+ FILE *fil; /* File descriptor returned by Openfile */
- DB_ENTER( "_do_special" );
+ DB_ENTER( "_do_special" );
- target->ce_flag = F_SPECIAL; /* mark the target as special */
+ target->ce_flag = F_SPECIAL; /* mark the target as special */
- switch( special ) {
- case ST_EXPORT:
- for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
- DB_PRINT( "par", ("Exporting [%s]", prereq->CE_NAME) );
- hp = GET_MACRO( prereq->CE_NAME );
+ switch( special ) {
+ case ST_EXPORT:
+ for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
+ DB_PRINT( "par", ("Exporting [%s]", prereq->CE_NAME) );
+ hp = GET_MACRO( prereq->CE_NAME );
- if( hp != NIL(HASH) ) {
- char *tmpstr = hp->ht_value;
+ if( hp != NIL(HASH) ) {
+ char *tmpstr = hp->ht_value;
- if( tmpstr == NIL(char) ) tmpstr = "";
+ if( tmpstr == NIL(char) ) tmpstr = "";
- if( Write_env_string( prereq->CE_NAME, tmpstr ) != 0 )
+ if( Write_env_string( prereq->CE_NAME, tmpstr ) != 0 )
Warning( "Could not export %s", prereq->CE_NAME );
- }
- }
- break;
+ }
+ }
+ break;
- /* Simply cause the parser to fail on the next input read */
- case ST_EXIT:
- Skip_to_eof = TRUE;
- break;
+ /* Simply cause the parser to fail on the next input read */
+ case ST_EXIT:
+ Skip_to_eof = TRUE;
+ break;
- case ST_IMPORT:
- for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
- char *tmpstr;
+ case ST_IMPORT:
+ for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
+ char *tmpstr;
- DB_PRINT( "par", ("Importing [%s]", prereq->CE_NAME) );
+ DB_PRINT( "par", ("Importing [%s]", prereq->CE_NAME) );
- if( strcmp(prereq->CE_NAME, ".EVERYTHING") == 0 ) {
- t_attr sattr = Glob_attr;
- Glob_attr |= A_SILENT;
+ if( strcmp(prereq->CE_NAME, ".EVERYTHING") == 0 ) {
+ t_attr sattr = Glob_attr;
+ Glob_attr |= A_SILENT;
- ReadEnvironment();
+ ReadEnvironment();
- Glob_attr = sattr;
- }
- else {
- tmpstr = Read_env_string( prereq->CE_NAME );
+ Glob_attr = sattr;
+ }
+ else {
+ tmpstr = Read_env_string( prereq->CE_NAME );
- if( tmpstr != NIL(char) )
+ if( tmpstr != NIL(char) )
Def_macro(prereq->CE_NAME, tmpstr, M_EXPANDED|M_LITERAL);
- else
+ else
if( !((Glob_attr | attr) & A_IGNORE) )
- Fatal("Imported macro `%s' not found",prereq->CE_NAME);
- }
- }
+ Fatal("Imported macro `%s' not found",prereq->CE_NAME);
+ }
+ }
- attr &= ~A_IGNORE;
- break;
+ attr &= ~A_IGNORE;
+ break;
- case ST_INCLUDE:
- {
- int pushed = FALSE;
- int first = (attr & A_FIRST);
- int ignore = (((Glob_attr | attr) & A_IGNORE) != 0);
- int found = FALSE;
- int noinf = (attr & A_NOINFER);
- LINKPTR prqlnk = NIL(LINK);
- LINKPTR prqlst = NIL(LINK);
+ case ST_INCLUDE:
+ {
+ int pushed = FALSE;
+ int first = (attr & A_FIRST);
+ int ignore = (((Glob_attr | attr) & A_IGNORE) != 0);
+ int found = FALSE;
+ int noinf = (attr & A_NOINFER);
+ LINKPTR prqlnk = NIL(LINK);
+ LINKPTR prqlst = NIL(LINK);
- if( prereq == NIL(CELL) ) Fatal( "No .INCLUDE file(s) specified" );
+ if( prereq == NIL(CELL) ) Fatal( "No .INCLUDE file(s) specified" );
- dp = Def_cell( ".INCLUDEDIRS" );
+ dp = Def_cell( ".INCLUDEDIRS" );
- if( (attr & A_SETDIR) && *(dir = strchr(set_dir, '=')+1) )
+ if( (attr & A_SETDIR) && *(dir = strchr(set_dir, '=')+1) )
pushed = Push_dir( dir, ".INCLUDE", ignore );
- for( cp=prereq; cp != NIL(CELL); cp = cp->ce_link ) {
+ for( cp=prereq; cp != NIL(CELL); cp = cp->ce_link ) {
LINKPTR ltmp;
TALLOC(ltmp, 1, LINK);
ltmp->cl_prq = cp;
if( prqlnk == NIL(LINK) )
- prqlst = ltmp;
+ prqlst = ltmp;
else
- prqlnk->cl_next = ltmp;
+ prqlnk->cl_next = ltmp;
prqlnk = ltmp;
- }
+ }
- for( ; prqlst != NIL(LINK); FREE(prqlst), prqlst=prqlnk ) {
+ for( ; prqlst != NIL(LINK); FREE(prqlst), prqlst=prqlnk ) {
prqlnk = prqlst->cl_next;
cp = prqlst->cl_prq;
name = cp->CE_NAME;
/* Leave this here, it ensures that prqlst gets propely free'd */
if ( first && found )
- continue;
+ continue;
if( *name == '<' ) {
- /* We have a file name enclosed in <....>
- * so get rid of the <> arround the file name */
+ /* We have a file name enclosed in <....>
+ * so get rid of the <> arround the file name */
- name++;
- if( (tmp = strrchr( name, '>' )) != NIL( char ) )
- *tmp = 0;
+ name++;
+ if( (tmp = strrchr( name, '>' )) != NIL( char ) )
+ *tmp = 0;
- if( If_root_path( name ) )
- fil = Openfile( name, FALSE, FALSE );
- else
- fil = NIL(FILE);
+ if( If_root_path( name ) )
+ fil = Openfile( name, FALSE, FALSE );
+ else
+ fil = NIL(FILE);
}
else
- fil = Openfile( name, FALSE, FALSE );
+ fil = Openfile( name, FALSE, FALSE );
if( fil == NIL(FILE) && !If_root_path( name ) ) { /*if true ==> not found in current dir*/
- /* Now we must scan the list of prerequisites for .INCLUDEDIRS
- * looking for the file in each of the specified directories.
- * if we don't find it then we issue an error. The error
- * message is suppressed if the .IGNORE attribute of attr is
- * set. If a file is found we call Parse on the file to
- * perform the parse and then continue on from where we left
- * off. */
+ /* Now we must scan the list of prerequisites for .INCLUDEDIRS
+ * looking for the file in each of the specified directories.
+ * if we don't find it then we issue an error. The error
+ * message is suppressed if the .IGNORE attribute of attr is
+ * set. If a file is found we call Parse on the file to
+ * perform the parse and then continue on from where we left
+ * off. */
- for(lp=dp->CE_PRQ; lp && fil == NIL(FILE); lp=lp->cl_next) {
- dir = lp->cl_prq->CE_NAME;
- if( strchr(dir, '$') ) dir = Expand(dir);
- path = Build_path( dir, name );
+ for(lp=dp->CE_PRQ; lp && fil == NIL(FILE); lp=lp->cl_next) {
+ dir = lp->cl_prq->CE_NAME;
+ if( strchr(dir, '$') ) dir = Expand(dir);
+ path = Build_path( dir, name );
- DB_PRINT( "par", ("Trying to include [%s]", path) );
+ DB_PRINT( "par", ("Trying to include [%s]", path) );
- fil = Openfile( path, FALSE, FALSE );
- if( dir != lp->cl_prq->CE_NAME ) FREE(dir);
- }
+ fil = Openfile( path, FALSE, FALSE );
+ if( dir != lp->cl_prq->CE_NAME ) FREE(dir);
+ }
}
if (!noinf && fil == NIL(FILE)) {
- t_attr glob = Glob_attr;
- t_attr cattr = prqlst->cl_prq->ce_attr;
+ t_attr glob = Glob_attr;
+ t_attr cattr = prqlst->cl_prq->ce_attr;
- prqlst->cl_next = NIL(LINK);
- Glob_attr |= (attr&A_IGNORE);
- prqlst->cl_prq->ce_attr &= ~A_FRINGE;
+ prqlst->cl_next = NIL(LINK);
+ Glob_attr |= (attr&A_IGNORE);
+ prqlst->cl_prq->ce_attr &= ~A_FRINGE;
- if( Verbose & V_FILE_IO )
- printf( "%s: Inferring include file [%s].\n",
- Pname, name );
- fil = TryFiles(prqlst);
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Inferring include file [%s].\n",
+ Pname, name );
+ fil = TryFiles(prqlst);
- Glob_attr = glob;
- prqlst->cl_prq->ce_attr |= (cattr & A_FRINGE);
+ Glob_attr = glob;
+ prqlst->cl_prq->ce_attr |= (cattr & A_FRINGE);
}
if( fil != NIL(FILE) ) {
- if( Verbose & V_FILE_IO )
- printf( "%s: Parsing include file [%s].\n",
- Pname, name );
- Parse( fil );
- found = TRUE;
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Parsing include file [%s].\n",
+ Pname, name );
+ Parse( fil );
+ found = TRUE;
}
else if( !(ignore || first) )
- Fatal( "Include file %s, not found", name );
+ Fatal( "Include file %s, not found", name );
else if( Verbose & V_FILE_IO )
- printf( "%s: Include file [%s] was not found.\n",
- Pname, name );
- }
+ printf( "%s: Include file [%s] was not found.\n",
+ Pname, name );
+ }
- if ( !ignore && first && !found )
+ if ( !ignore && first && !found )
Fatal( "No include file was found" );
- if( pushed ) Pop_dir(FALSE);
- attr &= ~(A_IGNORE|A_SETDIR|A_FIRST|A_NOINFER);
- }
- break;
+ if( pushed ) Pop_dir(FALSE);
+ attr &= ~(A_IGNORE|A_SETDIR|A_FIRST|A_NOINFER);
+ }
+ break;
+
+ case ST_SOURCE:
+ if( prereq != NIL(CELL) )
+ _do_targets( op & (R_OP_CL | R_OP_MI | R_OP_UP), attr, set_dir,
+ target, prereq );
+ else {
+ /* The old semantics of .SOURCE were that an empty list of
+ * prerequisites clears the .SOURCE list. So we must implement
+ * that here as a clearout prerequisite operation. Since this is
+ * a standard operation with the :- opcode we can simply call the
+ * proper routine with the target cell and it should do the trick
+ */
- case ST_SOURCE:
- if( prereq != NIL(CELL) )
- _do_targets( op & (R_OP_CL | R_OP_MI | R_OP_UP), attr, set_dir,
- target, prereq );
- else {
- /* The old semantics of .SOURCE were that an empty list of
- * prerequisites clears the .SOURCE list. So we must implement
- * that here as a clearout prerequisite operation. Since this is
- * a standard operation with the :- opcode we can simply call the
- * proper routine with the target cell and it should do the trick
- */
+ if( op == R_OP_CL || (op & R_OP_MI) )
+ Clear_prerequisites( target );
+ }
- if( op == R_OP_CL || (op & R_OP_MI) )
- Clear_prerequisites( target );
- }
+ op &= ~(R_OP_MI | R_OP_UP);
+ break;
- op &= ~(R_OP_MI | R_OP_UP);
- break;
-
- case ST_KEEP:
- if( Keep_state != NIL(char) ) break;
- Def_macro( ".KEEP_STATE", "_state.mk", M_EXPANDED );
- break;
+ case ST_KEEP:
+ if( Keep_state != NIL(char) ) break;
+ Def_macro( ".KEEP_STATE", "_state.mk", M_EXPANDED );
+ break;
- case ST_REST:
- /* The rest of the special targets can all take recipes, as such they
- * must be able to affect the state of the parser. */
+ case ST_REST:
+ /* The rest of the special targets can all take recipes, as such they
+ * must be able to affect the state of the parser. */
- {
- int s_targ = Target;
+ {
+ int s_targ = Target;
- Target = TRUE;
- _sp_target = TRUE;
- *state = _do_targets( op, attr, set_dir, target, prereq );
- Target = s_targ;
+ Target = TRUE;
+ _sp_target = TRUE;
+ *state = _do_targets( op, attr, set_dir, target, prereq );
+ Target = s_targ;
- target->ce_flag |= F_TARGET;
+ target->ce_flag |= F_TARGET;
- attr = A_DEFAULT;
- op = R_OP_CL;
- }
- break;
+ attr = A_DEFAULT;
+ op = R_OP_CL;
+ }
+ break;
- default:break;
- }
+ default:break;
+ }
- if( op != R_OP_CL ) Warning( "Modifier(s) for operator ignored" );
- if( attr != A_DEFAULT ) Warning( "Extra attributes ignored" );
+ if( op != R_OP_CL ) Warning( "Modifier(s) for operator ignored" );
+ if( attr != A_DEFAULT ) Warning( "Extra attributes ignored" );
- DB_VOID_RETURN;
+ DB_VOID_RETURN;
}
-
static int
_do_targets( op, attr, set_dir, targets, prereq )/*
===================================================
diff --git a/dmake/sysintf.c b/dmake/sysintf.c
index d7b482a3e405..65104114923f 100644
--- a/dmake/sysintf.c
+++ b/dmake/sysintf.c
@@ -420,7 +420,6 @@ char *ename;
}
-
/*
** Set the value of the environment string ename to value.
** Returns 0 if success, non-zero if failure
@@ -430,16 +429,23 @@ Write_env_string(ename, value)
char *ename;
char *value;
{
- char* p;
- char* envstr = DmStrAdd(ename, value, FALSE);
+#if defined(HAVE_SETENV)
- p = envstr+strlen(ename); /* Don't change this code, DmStrAdd does not */
- *p++ = '='; /* add the space if *value is 0, it does */
- if( !*value ) *p = '\0'; /* allocate enough memory for one though. */
+ return( setenv(ename, value, 1) );
- return( putenv(envstr) );
-}
+#else /* !HAVE_SETENV */
+
+ char* p;
+ char* envstr = DmStrAdd(ename, value, FALSE);
+ p = envstr+strlen(ename); /* Don't change this code, DmStrAdd does not */
+ *p++ = '='; /* add the space if *value is 0, it does */
+ if( !*value ) *p = '\0'; /* allocate enough memory for one though. */
+
+ return( putenv(envstr) ); /* Possibly leaking 'envstr' */
+
+#endif /* !HAVE_SETENV */
+}
PUBLIC void
diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c
index 4be342bbb273..e8e39d21bd3d 100644
--- a/dmake/unix/runargv.c
+++ b/dmake/unix/runargv.c
@@ -878,41 +878,36 @@ int wfc;
/* Never change MAXPROCESS after _procs is allocated. */
if( _procs_size != Max_proc ) {
- /* If procs was never initialize this is OK, do it now. */
- if( _procs == NIL(PR) ) {
- _procs_size = Max_proc;
- TALLOC( _procs, Max_proc, PR );
+ /* If procs was never initialize this is OK, do it now. */
+ if( _procs == NIL(PR) ) {
+ _procs_size = Max_proc;
+ TALLOC( _procs, Max_proc, PR );
#if defined(USE_CREATEPROCESS)
- TALLOC( _wpList, Max_proc, HANDLE );
+ TALLOC( _wpList, Max_proc, HANDLE );
- /* Signed int values are cast to DMHANDLE in various places, use this
- * sanity check to verify that DMHANDLE is large enough. */
- if( sizeof(int) > sizeof(DMHANDLE) )
- Fatal( "Internal Error: Check type of DMHANDLE!" );
+ /* Signed int values are cast to DMHANDLE in various places, use this
+ * sanity check to verify that DMHANDLE is large enough. */
+ if( sizeof(int) > sizeof(DMHANDLE) )
+ Fatal( "Internal Error: Check type of DMHANDLE!" );
#endif
- }
- else {
- Fatal( "MAXPROCESS changed from `%d' to `%d' after a command was executed!", _procs_size, Max_proc );
- }
+ }
+ else {
+ Fatal( "MAXPROCESS changed from `%d' to `%d' after a command was executed!", _procs_size, Max_proc );
+ }
}
if( Measure & M_RECIPE )
Do_profile_output( "s", M_RECIPE, target );
- /* If _use_i!=-1 then this function is called by _finished_child()
- * ( through runargv() ). */
+ /* If _use_i ! =-1 then this function is called by _finished_child() ( through runargv() ),
+ and we re-use the process queue number given by _use_i. */
if( (i = _use_i) == -1 ) {
- for( i=0; i<Max_proc; i++ )
- if( !_procs[i].pr_valid )
- break;
- }
- else {
- /* Re-use the process queue number given by _use_i.
- * Free the pointer before using it again below. */
- FREE( _procs[i].pr_dir );
+ for( i=0; i<Max_proc; i++ )
+ if( !_procs[i].pr_valid )
+ break;
}
- pp = _procs+i;
+ pp = &(_procs[i]);
pp->pr_valid = 1;
pp->pr_pid = pid.pid;
@@ -921,7 +916,9 @@ int wfc;
pp->pr_ignore = ignore;
pp->pr_last = last;
pp->pr_wfc = wfc;
- /* Freed above and after the last recipe in _finished child(). */
+
+ if( pp->pr_dir != NIL(char) )
+ FREE(pp->pr_dir);
pp->pr_dir = DmStrDup(Get_current_dir());
Current_target = NIL(CELL);
@@ -953,80 +950,80 @@ _finished_child(cid, status)/*
DMHANDLE cid;
int status;
{
- register int i;
- char *dir;
-
- if((int)cid < 1) { /* Force int. */
- /* internal command */
- i = -((int)cid);
- }
- else {
- for( i=0; i<Max_proc; i++ )
- if( _procs[i].pr_valid && _procs[i].pr_pid == cid )
+ register int i;
+ char *dir;
+
+ if((int)cid < 1) { /* Force int. */
+ /* internal command */
+ i = -((int)cid);
+ }
+ else {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid && _procs[i].pr_pid == cid )
break;
- /* Some children we didn't make esp true if using /bin/sh to execute a
- * a pipe and feed the output as a makefile into dmake. */
- if( i == Max_proc ) {
- Warning("Internal Warning: finished pid %d is not in pq!?", cid);
- return;
- }
- }
+ /* Some children we didn't make esp true if using /bin/sh to execute a
+ * a pipe and feed the output as a makefile into dmake. */
+ if( i == Max_proc ) {
+ Warning("Internal Warning: finished pid %d is not in pq!?", cid);
+ return;
+ }
+ }
- /* Not a running process anymore, the next runargv() will not use
- * _attach_cmd(). */
- _procs[i].pr_valid = 0;
+ /* Not a running process anymore, the next runargv() will not use
+ * _attach_cmd(). */
+ _procs[i].pr_valid = 0;
- if( Measure & M_RECIPE )
- Do_profile_output( "e", M_RECIPE, _procs[i].pr_target );
+ if( Measure & M_RECIPE )
+ Do_profile_output( "e", M_RECIPE, _procs[i].pr_target );
- _proc_cnt--;
- dir = DmStrDup(Get_current_dir());
- Set_dir( _procs[i].pr_dir );
+ _proc_cnt--;
+ dir = DmStrDup(Get_current_dir());
+ Set_dir( _procs[i].pr_dir );
- if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
- RCPPTR rp = _procs[i].pr_recipe;
+ if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
+ RCPPTR rp = _procs[i].pr_recipe;
- Current_target = _procs[i].pr_target;
- Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
- Current_target = NIL(CELL);
+ Current_target = _procs[i].pr_target;
+ Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
+ Current_target = NIL(CELL);
- if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
- _procs[i].pr_last = TRUE;
- goto ABORT_REMAINDER_OF_RECIPE;
- }
+ if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
+ _procs[i].pr_last = TRUE;
+ goto ABORT_REMAINDER_OF_RECIPE;
+ }
- _procs[i].pr_recipe = rp->prp_next;
+ _procs[i].pr_recipe = rp->prp_next;
- _use_i = i;
- /* Run next recipe line. The rp->prp_attr propagates a possible
- * wfc condition. */
- runargv( _procs[i].pr_target, rp->prp_group,
- rp->prp_last, rp->prp_attr, &rp->prp_cmd );
- _use_i = -1;
+ _use_i = i;
+ /* Run next recipe line. The rp->prp_attr propagates a possible
+ * wfc condition. */
+ runargv( _procs[i].pr_target, rp->prp_group,
+ rp->prp_last, rp->prp_attr, &rp->prp_cmd );
+ _use_i = -1;
- FREE( rp->prp_cmd );
- FREE( rp );
+ FREE( rp->prp_cmd );
+ FREE( rp );
- /* If all process queues are used wait for the next process to
- * finish. Is this really needed here? */
- if( _proc_cnt == Max_proc ) {
- Wait_for_child( FALSE, -1 );
- }
- }
- else {
- /* empty the queue on abort. */
- if( _abort_flg )
- _procs[i].pr_recipe = NIL(RCP);
+ /* If all process queues are used wait for the next process to
+ * finish. Is this really needed here? */
+ if( _proc_cnt == Max_proc ) {
+ Wait_for_child( FALSE, -1 );
+ }
+ }
+ else {
+ /* empty the queue on abort. */
+ if( _abort_flg )
+ _procs[i].pr_recipe = NIL(RCP);
- Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
+ Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
- ABORT_REMAINDER_OF_RECIPE:
- if( _procs[i].pr_last ) {
- FREE(_procs[i].pr_dir ); /* Set in _add_child() */
+ ABORT_REMAINDER_OF_RECIPE:
+ if( _procs[i].pr_last ) {
+ FREE(_procs[i].pr_dir ); _procs[i].pr_dir = NIL(char); /* Set in _add_child() */
- if( !Doing_bang ) {
+ if( !Doing_bang ) {
/* Update_time_stamp() triggers the deletion of intermediate
* targets. This starts a new process queue, so we have to
* clear the _use_i variable. */
@@ -1035,12 +1032,12 @@ int status;
_use_i = -1;
Update_time_stamp( _procs[i].pr_target );
_use_i = my_use_i;
- }
}
- }
+ }
+ }
- Set_dir(dir);
- FREE(dir);
+ Set_dir(dir);
+ FREE(dir);
}
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
index 6dffd80b332e..da7aedc6f983 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -65,6 +65,7 @@ namespace drawinglayer
bool bSymbol = false,
bool bVertical = false,
bool bItalic = false,
+ bool bMonospaced = false,
bool bOutline = false,
bool bRTL = false,
bool bBiDiStrong = false);
@@ -89,6 +90,7 @@ namespace drawinglayer
bool getOutline() const;
bool getRTL() const;
bool getBiDiStrong() const;
+ bool getMonospaced() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 7d10d3a37384..d4246376d9ca 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -55,6 +55,7 @@ namespace drawinglayer
unsigned mbOutline : 1; // Outline Flag
unsigned mbRTL : 1; // RTL Flag
unsigned mbBiDiStrong : 1; // BiDi Flag
+ unsigned mbMonospaced : 1;
ImpFontAttribute(
const String& rFamilyName,
@@ -63,6 +64,7 @@ namespace drawinglayer
bool bSymbol,
bool bVertical,
bool bItalic,
+ bool bMonospaced,
bool bOutline,
bool bRTL,
bool bBiDiStrong)
@@ -75,7 +77,8 @@ namespace drawinglayer
mbItalic(bItalic),
mbOutline(bOutline),
mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong)
+ mbBiDiStrong(bBiDiStrong),
+ mbMonospaced(bMonospaced)
{
}
@@ -89,6 +92,7 @@ namespace drawinglayer
bool getOutline() const { return mbOutline; }
bool getRTL() const { return mbRTL; }
bool getBiDiStrong() const { return mbBiDiStrong; }
+ bool getMonospaced() const { return mbMonospaced; }
bool operator==(const ImpFontAttribute& rCompare) const
{
@@ -100,7 +104,8 @@ namespace drawinglayer
&& getItalic() == rCompare.getItalic()
&& getOutline() == rCompare.getOutline()
&& getRTL() == rCompare.getRTL()
- && getBiDiStrong() == rCompare.getBiDiStrong());
+ && getBiDiStrong() == rCompare.getBiDiStrong()
+ && getMonospaced() == rCompare.getMonospaced());
}
static ImpFontAttribute* get_global_default()
@@ -112,7 +117,7 @@ namespace drawinglayer
pDefault = new ImpFontAttribute(
String(), String(),
0,
- false, false, false, false, false, false);
+ false, false, false, false, false, false, false);
// never delete; start with RefCount 1, not 0
pDefault->mnRefCount++;
@@ -129,11 +134,12 @@ namespace drawinglayer
bool bSymbol,
bool bVertical,
bool bItalic,
+ bool bMonospaced,
bool bOutline,
bool bRTL,
bool bBiDiStrong)
: mpFontAttribute(new ImpFontAttribute(
- rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
+ rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
{
}
@@ -246,6 +252,12 @@ namespace drawinglayer
return mpFontAttribute->getBiDiStrong();
}
+ bool FontAttribute::getMonospaced() const
+ {
+ return mpFontAttribute->getMonospaced();
+ }
+
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index c9774bea3f34..9aafd195a707 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -406,6 +406,7 @@ namespace drawinglayer
aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
aRetval.SetOutline(rFontAttribute.getOutline());
+ aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
#ifdef WIN32
@@ -445,6 +446,7 @@ namespace drawinglayer
RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
rFont.IsVertical(),
ITALIC_NONE != rFont.GetItalic(),
+ PITCH_FIXED == rFont.GetPitch(),
rFont.IsOutline(),
bRTL,
bBiDiStrong);
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index e20f1a417dcc..23661fe3747b 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -57,6 +57,7 @@
#include <basegfx/tuple/b2i64tuple.hxx>
#include <basegfx/range/b2irange.hxx>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/StrokeAttributes.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
@@ -1517,6 +1518,10 @@ namespace drawinglayer
aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO;
// TODO(F2): improve vclenum->panose conversion
aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight());
+ aFontRequest.FontDescription.FontDescription.Proportion =
+ rFontAttr.getMonospaced()
+ ? rendering::PanoseProportion::MONO_SPACED
+ : rendering::PanoseProportion::ANYTHING;
aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0;
// init CellSize to 1.0, else a default font height will be used
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx
index e17a931d7380..8b86048cd330 100644
--- a/dtrans/source/win32/dtobj/XTDataObject.cxx
+++ b/dtrans/source/win32/dtobj/XTDataObject.cxx
@@ -36,7 +36,7 @@
#ifndef _TXDATAOBJECT_HXX_
#include "XTDataObject.hxx"
#endif
-#include <com/sun/star/datatransfer/dataflavor.hpp>
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
#include "..\misc\ImplHelper.hxx"
#include "DTransHelper.hxx"
#include "TxtCnvtHlp.hxx"
diff --git a/dtrans/source/win32/dtobj/XTDataObject.hxx b/dtrans/source/win32/dtobj/XTDataObject.hxx
index b7b20af56ac7..b9794cad029e 100644
--- a/dtrans/source/win32/dtobj/XTDataObject.hxx
+++ b/dtrans/source/win32/dtobj/XTDataObject.hxx
@@ -42,7 +42,7 @@
#endif
#ifndef _FETCLIST_HXX_
-#include "FEtcList.hxx"
+#include "FetcList.hxx"
#endif
#if defined _MSC_VER
diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx
index 4ec96052769c..c64c8d99d9e4 100644..100755
--- a/editeng/inc/editeng/fontitem.hxx
+++ b/editeng/inc/editeng/fontitem.hxx
@@ -81,30 +81,23 @@ public:
String &rText, const IntlWrapper * = 0 ) const;
// ZugriffsMethoden:
- inline String &GetFamilyName() { return aFamilyName; }
+ void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
inline const String &GetFamilyName() const { return aFamilyName; }
- inline String &GetStyleName() { return aStyleName; }
+ void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
inline const String &GetStyleName() const { return aStyleName; }
- inline FontFamily &GetFamily() { return eFamily; }
+ void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
inline FontFamily GetFamily() const { return eFamily; }
- inline FontPitch &GetPitch() { return ePitch; }
+ void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
inline FontPitch GetPitch() const { return ePitch; }
- inline rtl_TextEncoding &GetCharSet() { return eTextEncoding; }
+ void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
+
inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
- inline SvxFontItem& operator=(const SvxFontItem& rFont)
- {
- aFamilyName = rFont.GetFamilyName();
- aStyleName = rFont.GetStyleName();
- eFamily = rFont.GetFamily();
- ePitch = rFont.GetPitch();
- eTextEncoding = rFont.GetCharSet();
- return *this;
- }
+ SvxFontItem& operator=(const SvxFontItem& rFont);
static void EnableStoreUnicodeNames( sal_Bool bEnable );
diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx
index f355a669a304..73dc7664562e 100644..100755
--- a/editeng/inc/editeng/svxacorr.hxx
+++ b/editeng/inc/editeng/svxacorr.hxx
@@ -79,6 +79,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0;
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0;
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0;
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0;
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& ) = 0;
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index cda87dea9f7d..cb042b721c4d 100644..100755
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1472,7 +1472,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetAttribs().Remove( nAttr );
XEditAttribute* pNewAttr = CreateAttrib( aNewFontItem, pAttr->GetStart(), pAttr->GetEnd() );
@@ -1503,7 +1503,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetParaAttribs().Put( aNewFontItem );
for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ )
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index afc329040e29..5fc43f461cac 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -583,8 +583,13 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt )
sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+
+sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
// Eigentlich ein Replace einfuehren => Entspr. UNDO
- sal_uInt16 nEnd = nPos+rTxt.Len();
+ sal_uInt16 nEnd = nPos+nSourceLength;
if ( nEnd > pCurNode->Len() )
nEnd = pCurNode->Len();
diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx
index 3ed82ac367f1..49978cdd310d 100644..100755
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -158,6 +158,7 @@ public:
virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd );
virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt );
virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& );
virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 4b4b5e4514a8..71caa4f176fa 100755
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1682,11 +1682,11 @@ void ImpEditEngine::SetLanguageAndFont(
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index b92284eb60bf..d2dc1c8a846d 100644..100755
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -302,11 +302,11 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel,
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet(pFont->GetCharSet());
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 8c0e533a40f4..5f2dc3a2d803 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -406,6 +406,8 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
---------------------------------------------------------------------------*/
SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
{
+ if (& rFormat == this) { return *this; }
+
SetNumberingType(rFormat.GetNumberingType());
eNumAdjust = rFormat.eNumAdjust ;
nInclUpperLevels = rFormat.nInclUpperLevels ;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index f1dc1f6c6f85..f0fa8cd02d8f 100644..100755
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -256,6 +256,16 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName,
}
// -----------------------------------------------------------------------
+SvxFontItem& SvxFontItem::operator=(const SvxFontItem& rFont)
+{
+ aFamilyName = rFont.GetFamilyName();
+ aStyleName = rFont.GetStyleName();
+ eFamily = rFont.GetFamily();
+ ePitch = rFont.GetPitch();
+ eTextEncoding = rFont.GetCharSet();
+ return *this;
+}
+// -----------------------------------------------------------------------
sal_Bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
@@ -3806,11 +3816,11 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo
aOutTypeArr[ n ].nLanguage,
DEFAULTFONT_FLAGS_ONLYONE, 0 ) );
SvxFontItem* pItem = aItemArr[ n ];
- pItem->GetFamily() = aFont.GetFamily();
- pItem->GetFamilyName() = aFont.GetName();
- pItem->GetStyleName().Erase();
- pItem->GetPitch() = aFont.GetPitch();
- pItem->GetCharSet() = aFont.GetCharSet();
+ pItem->SetFamily( aFont.GetFamily() );
+ pItem->SetFamilyName( aFont.GetName() );
+ pItem->SetStyleName( String() );
+ pItem->SetPitch( aFont.GetPitch());
+ pItem->SetCharSet(aFont.GetCharSet());
}
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e15e92200e0c..1eebd5349fe4 100644..100755
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -47,6 +47,7 @@
#include <com/sun/star/i18n/UnicodeType.hdl>
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <unotools/localedatawrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -139,6 +140,41 @@ inline int IsUpperLetter( sal_Int32 nCharType )
0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType);
}
+bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt,
+ xub_StrLen nStt, xub_StrLen nEnd )
+{
+ for( ; nStt < nEnd; ++nStt )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ sal_Int32 nCharType;
+ sal_Int32 nChType;
+ nCharType = rCC.getCharacterType( rTxt, nStt );
+ nChType = rCC.getType( rTxt, nStt );
+#endif
+ short nScript = rCC.getScript( rTxt, nStt );
+ switch( nScript )
+ {
+ case ::com::sun::star::i18n::UnicodeScript_kCJKRadicalsSupplement:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKSymbolPunctuation:
+ case ::com::sun::star::i18n::UnicodeScript_kHiragana:
+ case ::com::sun::star::i18n::UnicodeScript_kKatakana:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulCompatibilityJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kEnclosedCJKLetterMonth:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibility:
+ case ::com::sun::star::i18n::UnicodeScript_k_CJKUnifiedIdeographsExtensionA:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKUnifiedIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulSyllable:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibilityIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHalfwidthFullwidthForm:
+ return true;
+ default: ; //do nothing
+ }
+
+ }
+ return false;
+}
+
sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt,
xub_StrLen nStt, xub_StrLen nEnd )
{
@@ -456,7 +492,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt,
sal_Unicode cSave = rTxt.GetChar( nSttPos );
String sChar( cSave );
rCC.toLower( sChar );
- if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ))
+ if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ))
{
if( SaveWordWrdSttLst & nFlags )
rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave );
@@ -888,7 +924,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
String sChar( *pWordStt );
rCC.toUpper( sChar );
return sChar != *pWordStt &&
- rDoc.Replace( xub_StrLen( pWordStt - pStart ), sChar );
+ rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar );
}
aText = *pPrevPara;
@@ -1068,7 +1104,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() );
String sChar( cSave );
rCC.toUpper( sChar );
- sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar );
+ sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar );
// das Wort will vielleicht jemand haben
if( bRet && SaveWordCplSttLst & nFlags )
@@ -1299,7 +1335,7 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
eLang = MsLangId::getSystemLanguage();
CharClass& rCC = GetCharClass( eLang );
- // Bug 19285: Symbolzeichen nicht anfassen
+ // no symbol characters
if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos ))
break;
@@ -1368,13 +1404,16 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else
{
nRet = 0;
+ bool bUnsupported = lcl_IsUnsupportedUnicodeChar( rCC, rTxt, nCapLttrPos, nInsPos );
// Grossbuchstabe am Satz-Anfang ??
- if( IsAutoCorrFlag( CptlSttSntnc ) &&
+ if( !bUnsupported &&
+ IsAutoCorrFlag( CptlSttSntnc ) &&
FnCptlSttSntnc( rDoc, rTxt, sal_True, nCapLttrPos, nInsPos, eLang ) )
nRet |= CptlSttSntnc;
// Zwei Grossbuchstaben am Wort-Anfang ??
- if( IsAutoCorrFlag( CptlSttWrd ) &&
+ if( !bUnsupported &&
+ IsAutoCorrFlag( CptlSttWrd ) &&
FnCptlSttWrd( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) )
nRet |= CptlSttWrd;
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index d81af6ccff0c..bc2245e7e6a9 100644..100755
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -91,11 +91,11 @@ void SvxUnoFontDescriptor::FillItemSet( const awt::FontDescriptor& rDesc, SfxIte
{
SvxFontItem aFontItem( EE_CHAR_FONTINFO );
- aFontItem.GetFamilyName()= rDesc.Name;
- aFontItem.GetStyleName() = rDesc.StyleName;
- aFontItem.GetFamily() = (FontFamily)rDesc.Family;
- aFontItem.GetCharSet() = rDesc.CharSet;
- aFontItem.GetPitch() = (FontPitch)rDesc.Pitch;
+ aFontItem.SetFamilyName( rDesc.Name);
+ aFontItem.SetStyleName( rDesc.StyleName);
+ aFontItem.SetFamily( (FontFamily)rDesc.Family);
+ aFontItem.SetCharSet( rDesc.CharSet );
+ aFontItem.SetPitch( (FontPitch)rDesc.Pitch);
rSet.Put(aFontItem);
}
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 496ec6fea8db..182726cd95bc 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -931,7 +931,7 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT *
// try to write back out parameter
if (outIndex.getLength() > 0)
{
- const INT16* pOutIndex = outIndex.getConstArray();
+ const sal_Int16* pOutIndex = outIndex.getConstArray();
const Any* pOutParams = outParams.getConstArray();
for (sal_Int32 i = 0; i < outIndex.getLength(); i++)
diff --git a/filter/source/docbook/sofftodocbookheadings.xsl b/filter/source/docbook/sofftodocbookheadings.xsl
index cfddf901b2d4..3fda55612a05 100644
--- a/filter/source/docbook/sofftodocbookheadings.xsl
+++ b/filter/source/docbook/sofftodocbookheadings.xsl
@@ -163,20 +163,20 @@
<!-- if the first heading is not of the section1 level -->
<xsl:if test="generate-id(.) != generate-id($firstHeading)">
<!-- create an anonymous section1 and embrace all headings preceding the first real existent section1 -->
- <xsl:text disable-output-escaping="yes">&lt;sect1&gt;</xsl:text>
- <title></title>
- <!-- create sections for all the first section1 preluding headings -->
- <xsl:for-each select="key('getHeadingsByOutline', $section1_OutlineLevel)[1]/preceding::text:h">
- <xsl:call-template name="make-section">
- <xsl:with-param name="previousSectionLevel" select="$section1_OutlineLevel"/>
- <xsl:with-param name="currentSectionLevel">
- <xsl:call-template name="getSectionLevel">
- <xsl:with-param name="outlineLevel" select="@text:level"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- <xsl:text disable-output-escaping="yes">&lt;/sect1&gt;</xsl:text>
+ <xsl:element name="sect1">
+ <title></title>
+ <!-- create sections for all the first section1 preluding headings -->
+ <xsl:for-each select="key('getHeadingsByOutline', $section1_OutlineLevel)[1]/preceding::text:h">
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="previousSectionLevel" select="$section1_OutlineLevel"/>
+ <xsl:with-param name="currentSectionLevel">
+ <xsl:call-template name="getSectionLevel">
+ <xsl:with-param name="outlineLevel" select="@text:level"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
</xsl:if>
</xsl:for-each>
<!-- match all headings, which are mapped to section1 to create a nested section structure used in docbook (see first comment after copyright) -->
@@ -278,30 +278,22 @@
<xsl:choose>
<!-- empty title as it is an empty section between two headings with an outline level difference higher than 1 -->
<xsl:when test="$currentSectionLevel &gt; $previousSectionLevel+1">
- <xsl:text disable-output-escaping="yes">&lt;sect</xsl:text>
- <xsl:value-of select="$previousSectionLevel +1"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
- <title></title>
- <xsl:call-template name="make-section">
- <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
- <xsl:with-param name="previousSectionLevel" select="$previousSectionLevel +1"/>
- </xsl:call-template>
- <xsl:text disable-output-escaping="yes">&lt;/sect</xsl:text>
- <xsl:value-of select="$previousSectionLevel +1"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:element name="{concat('sect', $previousSectionLevel + 1)}">
+ <title></title>
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
+ <xsl:with-param name="previousSectionLevel" select="$previousSectionLevel +1"/>
+ </xsl:call-template>
+ </xsl:element>
</xsl:when>
<xsl:otherwise>
- <xsl:text disable-output-escaping="yes">&lt;sect</xsl:text>
- <xsl:value-of select="$currentSectionLevel"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
- <title>
- <xsl:apply-templates/>
- </title>
- <xsl:apply-templates select="key('nestedContent', generate-id())"/>
- <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
- <xsl:text disable-output-escaping="yes">&lt;/sect</xsl:text>
- <xsl:value-of select="$currentSectionLevel"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:element name="{concat('sect', $currentSectionLevel)}">
+ <title>
+ <xsl:apply-templates/>
+ </title>
+ <xsl:apply-templates select="key('nestedContent', generate-id())"/>
+ <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
+ </xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -370,23 +362,12 @@
</appendix>
</xsl:when>
<xsl:otherwise>
- <xsl:variable name="sectvar">
- <xsl:text>sect</xsl:text>
- <xsl:value-of select="count(ancestor::text:section)+1"/>
- </xsl:variable>
- <xsl:variable name="idvar">
- <xsl:text> id="</xsl:text>
- <xsl:value-of select="@text:name"/>
- <xsl:text>"</xsl:text>
- </xsl:variable>
- <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
- <xsl:value-of select="$sectvar"/>
- <xsl:value-of select="$idvar"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
- <xsl:apply-templates/>
- <xsl:text disable-output-escaping="yes">&lt;/</xsl:text>
- <xsl:value-of select="$sectvar"/>
- <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:element name="{concat('sect', count(ancestor::text:section) + 1)}">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@text:name"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl b/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
index 40b146f1481e..2badb7cd6814 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
@@ -27,7 +27,7 @@
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xalan="http://xml.apache.org/xalan" xmlns:oleextracter="MyOleExtracter" xmlns:ole="java:XSLTFilterOLEExtracter" xmlns:java="http://saxon.sf.net/java-type" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw xalan ole oleextracter java" extension-element-prefixes="oleextracter">
<xsl:include href="ooo2wordml_custom_draw.xsl"/>
- <xsl:param name="oleExtractor" as="java:XSLTFilterOLEExtracter" select="ole:new()"/>
+ <xsl:param name="oleExtractor" as="java:com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter" select="ole:new()"/>
<xsl:param name="XMultiServiceFactory" as="java:com.sun.star.lang.XMultiServiceFactory" select="ole:init($oleExtractor, 'uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager')"/>
<xsl:key name="stroke-dash-style" match="draw:stroke-dash" use="@draw:name"/>
@@ -1880,6 +1880,6 @@
</xsl:template>
<xsl:template match="draw:object-ole"/>
<xalan:component prefix="oleextracter" elements="init exit" functions="getByName insertByName">
- <xalan:script lang="javaclass" src="xalan://XSLTFilterOLEExtracter"/>
+ <xalan:script lang="javaclass" src="xalan://com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter"/>
</xalan:component>
</xsl:stylesheet>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl b/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
index e0737d1374fa..0a1228779268 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
@@ -28,7 +28,7 @@
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xalan="http://xml.apache.org/xalan" xmlns:oleextracter="MyOleExtracter" xmlns:ole="java:XSLTFilterOLEExtracter" xmlns:java="http://saxon.sf.net/java-type" exclude-result-prefixes="w wx aml o dt v xalan ole oleextracter java" extension-element-prefixes="oleextracter">
<xsl:include href="wordml2ooo_custom_draw.xsl"/>
<xsl:include href="wordml2ooo_path.xsl"/>
- <xsl:param name="oleExtractor" as="java:XSLTFilterOLEExtracter" select="ole:new()"/>
+ <xsl:param name="oleExtractor" as="java:com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter" select="ole:new()"/>
<xsl:param name="XMultiServiceFactory" as="java:com.sun.star.lang.XMultiServiceFactory" select="ole:init($oleExtractor, 'uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager')"/>
@@ -2208,6 +2208,6 @@
</xsl:choose>
</xsl:template>
<xalan:component prefix="oleextracter" elements="init exit" functions="getByName insertByName">
- <xalan:script lang="javaclass" src="xalan://XSLTFilterOLEExtracter"/>
+ <xalan:script lang="javaclass" src="xalan://com.sun.star.comp.xsltfilter.XSLTFilterOLEExtracter"/>
</xalan:component>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl b/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
index 2aa2fdc50bc3..5f75027d33e6 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
+<?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.
@@ -24,805 +24,805 @@
<http://www.openoffice.org/license.html>
for a copy of the LGPLv3 License.
--->
-<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
--->
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:dom="http://www.w3.org/2001/xml-events"
- xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
- xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
- xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
- xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
- xmlns:math="http://www.w3.org/1998/Math/MathML"
- xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
- xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
- xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
- xmlns:ooo="http://openoffice.org/2004/office"
- xmlns:oooc="http://openoffice.org/2004/calc"
- xmlns:ooow="http://openoffice.org/2004/writer"
- xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
- xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
- xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
- xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- xmlns:xforms="http://www.w3.org/2002/xforms"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xt="http://www.jclark.com/xt"
- xmlns:common="http://exslt.org/common"
- xmlns:xalan="http://xml.apache.org/xalan"
- exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xt common xalan">
-
-
-
- <!-- ***************************************** -->
- <!-- *** Gathering office style properties *** -->
- <!-- ***************************************** -->
-
- <!-- REASON FOR STYLESHEET:
- In the OpenOffice documents styles are represented by a hierarchy.
- (e.g. most styles are inherited from a default style).
- Many other languages (as XHTML/CSS) do not support inherited styles.
- The style inheritance have to be made flat/absolute for each style.
-
- A further reason was, that the earlier style collection mechanism
- had problems with CSS inline, which do not inherit from XML office defaults
- nor font:family defaults as the style header does
- (cp. stylesheet 'style_collector.xsl' and the 'write-default-styles' template)
-
- RESULT OF STYLESHEET:
- All styles will be returned in a variable containing styles with their inherited *:
-
- <all-styles>
- <style style:family="foo" style:name="x1">
- <* fo:padding-left="0cm" fo:margin-right="0cm" />
- </style>
- <style style:family="muh" style:name="x2" >
- <* fo:padding-left="3cm" ... />
- </style>
- ...
-
- </all-styles>
- -->
-
-
- <xsl:template name="collect-global-odf-properties">
- <!-- to access the variable as a node-set by XPATH expressions, it is necessary to convert it
- from a result-tree-fragment (RTF) to a node set by a in a XSLT 1.0 non standarized function -->
- <xsl:variable name="globalDataRTF">
- <xsl:call-template name="collect-document-links-RTF" />
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
- <xsl:template name="collect-style-properties">
- <xsl:param name="globalData" />
-
- <!-- Add the input file references to the new collected style properties -->
- <xsl:variable name="globalDataRTF">
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="collect-style-properties-RTF">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-document-links-RTF">
- <!-- works for zipped office files, unzipped office files as for flat filter single office file format as well -->
- <xsl:variable name="documentLinksRTF">
- <xsl:choose>
- <xsl:when test="office:document-content">
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="document(concat($sourceBaseURL, 'styles.xml'))" />
- </xsl:element>
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="document(concat($sourceBaseURL, 'meta.xml'))" />
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="/" />
- </xsl:element>
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="/" />
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="common:node-set($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="xalan:nodeset($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="xt:node-set($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:template name="collect-document-links">
- <xsl:param name="documentLinks" />
-
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="$documentLinks/styles-file/*" />
- </xsl:element>
-
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="$documentLinks/meta-file/*" />
- </xsl:element>
-
- <xsl:copy-of select="$documentLinks/styles-file/*/office:styles" />
- <xsl:copy-of select="$documentLinks/styles-file/*/office:font-face-decls" />
-
- <!-- office:automatic-styles may be containted in two files (i.e. content.xml and styles.xml).
- Wild card necessary as top level element differs from flat office files ("SampleName.fsxw") -->
- <xsl:copy-of select="/*/office:automatic-styles" />
-
- </xsl:template>
-
-
- <xsl:template name="collect-style-properties-RTF">
- <xsl:param name="globalData" />
-
- <!--** DEFAULT STYLES: First adding some office defaults unwritten in XML -->
- <xsl:variable name="defaultOfficeStyle-RTF">
- <xsl:element name="style" namespace="">
- <xsl:element name="style:properties" />
- </xsl:element>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="common:node-set($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="xalan:nodeset($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="xt:node-set($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: 'Nodeset'</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-properties-defaults">
- <xsl:param name="globalData" />
- <xsl:param name="defaultOfficeStyle" />
-
- <!--** DEFAULT STYLES: Adding the default styles of a style:family, by adding each office:styles/style:default-style element **-->
- <xsl:variable name="defaultFamilyStyles-RTF">
- <xsl:for-each select="$globalData/office:styles/style:default-style">
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:call-template name="create-inherited-style-properties">
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- </xsl:call-template>
- </xsl:element>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="common:node-set($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="xalan:nodeset($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="xt:node-set($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-properties">
- <xsl:param name="globalData" />
- <xsl:param name="defaultOfficeStyle" />
- <xsl:param name="defaultFamilyStyles" />
-
- <!--** traversee all style trees - branch after branch - collecting style properties **-->
- <xsl:element name="all-doc-styles" namespace="">
-
- <!-- Background Information:
-
- There are two different types of styles in the Office:
- 1) The office:styles from the user pre-defined style templates
- 2) The automatic:styles, which are created whenever a user uses explicit style formatting.
-
- The office:styles only have parent styles in the office:styles,
- but automatic:styles may inherit from both office:styles and themself.
- -->
-
- <!--** traversee all office:styles trees beginning with the top-level styles **-->
- <xsl:for-each select="$globalData/office:styles/style:style[not(@style:parent-style-name)]">
- <!-- Looking for parents from style:family
- <xsl:for-each select="$globalData/office:styles/style:style[@style:family=current()/@style:family][not(@style:parent-style-name)]"> -->
- <xsl:choose>
- <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <!--** creates a style element with style:name and style:family attribute and
- an element representing the absolute style properties style:property ** -->
- </xsl:for-each>
-
- <!--** traversee all office:automatic-styles trees beginning with the top-level styles **-->
- <xsl:for-each select="$globalData/office:automatic-styles/style:style[not(@style:parent-style-name)]">
- <!--** creates a style element with style:name and style:family attribute and
- an element representing the absolute style properties style:property ** -->
- <xsl:choose>
- <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:for-each>
-
- </xsl:element>
- <!-- debug output in case only styles should be given out (regression test) -->
- <xsl:if test="$onlyStyleOutputEnabled">
- <xsl:element name="defaultOfficeStyle" namespace="">
- <xsl:copy-of select="$defaultOfficeStyle" />
- </xsl:element>
- <xsl:element name="defaultFamilyStyles" namespace="">
- <xsl:copy-of select="$defaultFamilyStyles" />
- </xsl:element>
- </xsl:if>
-
- </xsl:template>
-
-
- <xsl:template name="inherit-style-for-self-and-children">
- <xsl:param name="globalData" />
- <xsl:param name="inheritedStyleProperties" />
- <xsl:param name="searchOnlyInAutomaticStyles" />
-
- <!--** create an absolute style by inherting properties from the given parent properties **-->
- <xsl:variable name="newStyleProperties-RTF">
- <xsl:call-template name="create-inherited-style-properties">
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:variable name="newStyleProperties" select="common:node-set($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:variable name="newStyleProperties" select="xalan:nodeset($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:variable name="newStyleProperties" select="xt:node-set($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="get-children">
- <xsl:param name="globalData" />
- <xsl:param name="searchOnlyInAutomaticStyles" />
- <xsl:param name="inheritedStyleProperties" select="*" />
-
-<!-- QUESTION: Parent style is only unique by name and family, but what about cross family inheritance? -->
- <!-- For each child style (that is every style which has the given parentStyleName as style:parent-style-name and the same style:family -->
- <xsl:variable name="parentStyleFamily" select="@style:family" />
- <xsl:variable name="parentStyleName" select="@style:name" />
- <xsl:if test="not($searchOnlyInAutomaticStyles)">
- <xsl:for-each select="$globalData/office:styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="$globalData/office:automatic-styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
-
-
- <xsl:template name="create-inherited-style-properties">
- <xsl:param name="inheritedStyleProperties" />
-
- <xsl:element name="style:properties">
- <!-- Writing all inherited style properties -->
- <xsl:for-each select="$inheritedStyleProperties/@*">
- <xsl:sort select="name()" />
- <xsl:copy-of select="." />
- </xsl:for-each>
-
- <!--All current attributes will override already inserted attributes of the same name
- XSLT Spec: "Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name." -->
- <xsl:for-each select="*/@*[name() != 'style:font-size-rel']">
- <xsl:copy-of select="." />
- </xsl:for-each>
-
- <xsl:if test="*/@style:font-size-rel">
-<!--
- The intheritedStyleProperties should include a absolute Font Size, but
- <style:properties
- xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
- xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
- style:font-name="Courier New"
- fo:language="en"
- fo:country="US"
- style:font-name-asian=Courier New"
- style:font-name-complex="Courier New"/>
--->
- <xsl:variable name="fontSizeAbsolute">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$inheritedStyleProperties/@fo:font-size" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="fontSizeRelative">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="*/@style:font-size-rel" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:attribute name="fo:font-size">
- <xsl:value-of select="$fontSizeAbsolute + $fontSizeRelative"/>
- <xsl:text>pt</xsl:text>
- </xsl:attribute>
- </xsl:if>
-
- <!-- providing tabulator indentation -->
- <xsl:copy-of select="$inheritedStyleProperties/style:tab-stops"/>
- <xsl:copy-of select="*/style:tab-stops"/>
- </xsl:element>
- </xsl:template>
-
- <!-- debugging & testing purpose -->
- <xsl:template name="write-collected-styles">
- <xsl:param name="globalData" />
-
- <xsl:message>&lt;all-doc-styles&gt;</xsl:message>
- <xsl:for-each select="$globalData/all-doc-styles/style">
- <xsl:message>&lt;style</xsl:message>
- <xsl:message>style:family="<xsl:value-of select="current()/@style:family" />"&gt;</xsl:message>
- <xsl:message>style:name="<xsl:value-of select="current()/@style:name" />" </xsl:message>
- <xsl:message> &lt;*</xsl:message>
- <xsl:for-each select="*/@*">
- <xsl:message>
- <xsl:text></xsl:text>
- <xsl:value-of select="name()" />="<xsl:value-of select="." />"</xsl:message>
- </xsl:for-each>
- <xsl:message>/&gt;</xsl:message>
- <xsl:message>&lt;/style&gt;</xsl:message>
- </xsl:for-each>
- <xsl:message>&lt;/all-doc-styles&gt;</xsl:message>
- </xsl:template>
-
- <xsl:template name="map-odf-style-properties">
- <xsl:param name="globalData" />
-
- <xsl:choose>
- <!--+++++ DEBUG STYLE OUTPUT FOR REGRESSION TEST +++++-->
- <!-- create styles file from the style variable (testing switch) -->
- <xsl:when test="$onlyStyleOutputEnabled">
-
- <xsl:element name="debug-output" namespace="">
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="map-odf-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
-
- <!-- create XHTML file -->
- <xsl:otherwise>
- <!-- to access the variable like a node-set it is necessary to convert it
- from a result-tree-fragment (RTF) to a node set using the James Clark extension -->
- <xsl:variable name="globalDataRTF">
- <!-- raw properties still needed for table width attribute creation -->
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="map-odf-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- REASON FOR TEMPLATE:
- The OpenOffice style properities gathered in the variable 'globalData' have to be mapped to the CSS style format
- -->
- <xsl:template name="map-odf-properties">
- <xsl:param name="globalData" />
- <xsl:element name="all-styles" namespace="">
- <xsl:for-each select="$globalData/all-doc-styles/style">
- <xsl:sort select="@style:family" />
- <xsl:sort select="@style:name" />
-
- <xsl:call-template name="writeUsedStyles">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="style" select="."/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
-
- <xsl:key name="elementUsingStyle" match="/*/office:body//*" use="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name | @table:default-cell-style-name"/>
- <xsl:key name="listLabelStyleInStyles" match="/*/office:styles/text:list-style/* |
- /*/office:styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
-
- <xsl:key name="listLabelStyleInContent" match="/*/office:automatic-styles/text:list-style/* | /*/office:automatic-styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
-
-
- <xsl:variable name="documentRoot" select="/" />
- <xsl:template name="writeUsedStyles">
- <xsl:param name="globalData" />
- <xsl:param name="style"/>
-
- <!-- for-each changes the key environment from the previously globalData back to the document root -->
- <xsl:for-each select="$documentRoot">
- <!-- only styles, which are used in the content are written as CSS styles -->
- <xsl:choose>
- <xsl:when test="key('elementUsingStyle', $style/@style:name)/@* or key('listLabelStyleInContent', $style/@style:name)/@*">
- <xsl:call-template name="writeUsedStyles2">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="style" select="$style" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="not(office:document-content)">
- <xsl:if test="key('listLabelStyleInStyles', $style/@style:name)/@* or /*/office:styles/text:notes-configuration[@text:citation-style-name = $style/@style:name or /*/office:styles/@text:citation-body-style-name=$style/@style:name]">
- <!-- if there are consecutive paragraphs with borders (OR background AND margin ), only the first and the last have the top/bottom border
- unless style:join-border="false" -->
- <xsl:call-template name="writeUsedStyles2">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="style" select="$style" />
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="document($stylesFileURL)">
- <xsl:if test="key('listLabelStyleInStyles', $style/@style:name)/@* or /*/office:styles/text:notes-configuration[@text:citation-style-name = $style/@style:name or /*/office:styles/@text:citation-body-style-name=$style/@style:name]">
- <!-- if there are consecutive paragraphs with borders (OR background AND margin ), only the first and the last have the top/bottom border
- unless style:join-border="false" -->
- <xsl:call-template name="writeUsedStyles2">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="style" select="$style" />
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="writeUsedStyles2">
- <xsl:param name="globalData" />
- <xsl:param name="style"/>
- <xsl:choose>
- <xsl:when test="
- $style/@style:family='paragraph'
- and((
- (
- $style/*/@fo:border-top
- or $style/*/@fo:border-bottom
- or $style/*/@fo:border
- )
- and
- (
- not($style/*/@style:join-border)
- or $style/*/@style:join-border = 'true'
- )
- )
- or
- (
- (
- $style/*/@fo:margin-top
- or $style/*/@fo:margin-bottom
- or $style/*/@fo:margin
- )
- and
- ( $style/*/@fo:background-color
- and
- not($style/*/fo:background-color='transparent')
- )
- )
- )">
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="$style/@style:family" />
- <xsl:attribute name="style:name"><xsl:value-of select="concat($style/@style:name, '_borderStart')" /></xsl:attribute>
- <xsl:element name="final-properties" namespace="">
- <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-bottom')][not(name() = 'fo:padding-bottom')][not(name() = 'fo:margin-bottom')][not(name() = 'fo:margin')]">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-bottom' or name() = 'fo:margin']">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:text> border-bottom-style:none; </xsl:text>
- </xsl:element>
- </xsl:element>
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="$style/@style:family" />
- <xsl:copy-of select="$style/@style:name" />
- <xsl:attribute name="mergedBorders"><xsl:value-of select="true()" /></xsl:attribute>
- <xsl:element name="final-properties" namespace="">
- <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-top') and not(name() = 'fo:border-bottom')][not(name() = 'fo:padding-top') and not(name() = 'fo:padding-bottom')][not(name() = 'fo:margin-top') and not(name() = 'fo:margin-bottom')][not(name() = 'fo:margin')]">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin-bottom' or name() = 'fo:margin']">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:text> border-top-style:none; border-bottom-style:none; </xsl:text>
- </xsl:element>
- </xsl:element>
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="$style/@style:family" />
- <xsl:attribute name="style:name"><xsl:value-of select="concat($style/@style:name, '_borderEnd')" /></xsl:attribute>
- <xsl:element name="final-properties" namespace="">
- <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-top')][not(name() = 'fo:padding-top')][not(name() = 'fo:margin-top')][not(name() = 'fo:margin')]">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin']">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <xsl:text> border-top-style:none;</xsl:text>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="not(key('listLabelStyleInStyles', $style/@style:name)/@*)">
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="$style/@style:family" />
- <xsl:copy-of select="$style/@style:name" />
- <xsl:element name="final-properties" namespace="">
- <xsl:apply-templates select="$style/*/@*">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="style" namespace="">
- <xsl:attribute name="style:family">none</xsl:attribute>
- <xsl:attribute name="style:name"><xsl:value-of select="$style/@style:name"/></xsl:attribute>
- <xsl:element name="final-properties" namespace="">
- <xsl:apply-templates select="$style/*/@*">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template mode="paragraphMerge" match="@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right">
- <xsl:text>padding</xsl:text>
- <xsl:value-of select="substring-after(name(), 'fo:margin')"/>
- <xsl:text>:</xsl:text>
- <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
- <xsl:choose>
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
-</xsl:stylesheet> \ No newline at end of file
+-->
+<!--
+ For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+-->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:dom="http://www.w3.org/2001/xml-events"
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+ xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ xmlns:ooo="http://openoffice.org/2004/office"
+ xmlns:oooc="http://openoffice.org/2004/calc"
+ xmlns:ooow="http://openoffice.org/2004/writer"
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ xmlns:xforms="http://www.w3.org/2002/xforms"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xt="http://www.jclark.com/xt"
+ xmlns:common="http://exslt.org/common"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xt common xalan">
+
+
+
+ <!-- ***************************************** -->
+ <!-- *** Gathering office style properties *** -->
+ <!-- ***************************************** -->
+
+ <!-- REASON FOR STYLESHEET:
+ In the OpenOffice documents styles are represented by a hierarchy.
+ (e.g. most styles are inherited from a default style).
+ Many other languages (as XHTML/CSS) do not support inherited styles.
+ The style inheritance have to be made flat/absolute for each style.
+
+ A further reason was, that the earlier style collection mechanism
+ had problems with CSS inline, which do not inherit from XML office defaults
+ nor font:family defaults as the style header does
+ (cp. stylesheet 'style_collector.xsl' and the 'write-default-styles' template)
+
+ RESULT OF STYLESHEET:
+ All styles will be returned in a variable containing styles with their inherited *:
+
+ <all-styles>
+ <style style:family="foo" style:name="x1">
+ <* fo:padding-left="0cm" fo:margin-right="0cm" />
+ </style>
+ <style style:family="muh" style:name="x2" >
+ <* fo:padding-left="3cm" ... />
+ </style>
+ ...
+
+ </all-styles>
+ -->
+
+
+ <xsl:template name="collect-global-odf-properties">
+ <!-- to access the variable as a node-set by XPATH expressions, it is necessary to convert it
+ from a result-tree-fragment (RTF) to a node set by a in a XSLT 1.0 non standarized function -->
+ <xsl:variable name="globalDataRTF">
+ <xsl:call-template name="collect-document-links-RTF" />
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <xsl:template name="collect-style-properties">
+ <xsl:param name="globalData" />
+
+ <!-- Add the input file references to the new collected style properties -->
+ <xsl:variable name="globalDataRTF">
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="collect-style-properties-RTF">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-document-links-RTF">
+ <!-- works for zipped office files, unzipped office files as for flat filter single office file format as well -->
+ <xsl:variable name="documentLinksRTF">
+ <xsl:choose>
+ <xsl:when test="office:document-content">
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="document(concat($sourceBaseURL, 'styles.xml'), .)" />
+ </xsl:element>
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="document(concat($sourceBaseURL, 'meta.xml'), .)" />
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="/" />
+ </xsl:element>
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="/" />
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="common:node-set($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="xalan:nodeset($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="xt:node-set($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+
+ <xsl:template name="collect-document-links">
+ <xsl:param name="documentLinks" />
+
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="$documentLinks/styles-file/*" />
+ </xsl:element>
+
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="$documentLinks/meta-file/*" />
+ </xsl:element>
+
+ <xsl:copy-of select="$documentLinks/styles-file/*/office:styles" />
+ <xsl:copy-of select="$documentLinks/styles-file/*/office:font-face-decls" />
+
+ <!-- office:automatic-styles may be containted in two files (i.e. content.xml and styles.xml).
+ Wild card necessary as top level element differs from flat office files ("SampleName.fsxw") -->
+ <xsl:copy-of select="/*/office:automatic-styles" />
+
+ </xsl:template>
+
+
+ <xsl:template name="collect-style-properties-RTF">
+ <xsl:param name="globalData" />
+
+ <!--** DEFAULT STYLES: First adding some office defaults unwritten in XML -->
+ <xsl:variable name="defaultOfficeStyle-RTF">
+ <xsl:element name="style" namespace="">
+ <xsl:element name="style:properties" />
+ </xsl:element>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="common:node-set($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="xalan:nodeset($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="xt:node-set($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: 'Nodeset'</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-properties-defaults">
+ <xsl:param name="globalData" />
+ <xsl:param name="defaultOfficeStyle" />
+
+ <!--** DEFAULT STYLES: Adding the default styles of a style:family, by adding each office:styles/style:default-style element **-->
+ <xsl:variable name="defaultFamilyStyles-RTF">
+ <xsl:for-each select="$globalData/office:styles/style:default-style">
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:call-template name="create-inherited-style-properties">
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="common:node-set($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="xalan:nodeset($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="xt:node-set($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-properties">
+ <xsl:param name="globalData" />
+ <xsl:param name="defaultOfficeStyle" />
+ <xsl:param name="defaultFamilyStyles" />
+
+ <!--** traversee all style trees - branch after branch - collecting style properties **-->
+ <xsl:element name="all-doc-styles" namespace="">
+
+ <!-- Background Information:
+
+ There are two different types of styles in the Office:
+ 1) The office:styles from the user pre-defined style templates
+ 2) The automatic:styles, which are created whenever a user uses explicit style formatting.
+
+ The office:styles only have parent styles in the office:styles,
+ but automatic:styles may inherit from both office:styles and themself.
+ -->
+
+ <!--** traversee all office:styles trees beginning with the top-level styles **-->
+ <xsl:for-each select="$globalData/office:styles/style:style[not(@style:parent-style-name)]">
+ <!-- Looking for parents from style:family
+ <xsl:for-each select="$globalData/office:styles/style:style[@style:family=current()/@style:family][not(@style:parent-style-name)]"> -->
+ <xsl:choose>
+ <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--** creates a style element with style:name and style:family attribute and
+ an element representing the absolute style properties style:property ** -->
+ </xsl:for-each>
+
+ <!--** traversee all office:automatic-styles trees beginning with the top-level styles **-->
+ <xsl:for-each select="$globalData/office:automatic-styles/style:style[not(@style:parent-style-name)]">
+ <!--** creates a style element with style:name and style:family attribute and
+ an element representing the absolute style properties style:property ** -->
+ <xsl:choose>
+ <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+
+ </xsl:element>
+ <!-- debug output in case only styles should be given out (regression test) -->
+ <xsl:if test="$onlyStyleOutputEnabled">
+ <xsl:element name="defaultOfficeStyle" namespace="">
+ <xsl:copy-of select="$defaultOfficeStyle" />
+ </xsl:element>
+ <xsl:element name="defaultFamilyStyles" namespace="">
+ <xsl:copy-of select="$defaultFamilyStyles" />
+ </xsl:element>
+ </xsl:if>
+
+ </xsl:template>
+
+
+ <xsl:template name="inherit-style-for-self-and-children">
+ <xsl:param name="globalData" />
+ <xsl:param name="inheritedStyleProperties" />
+ <xsl:param name="searchOnlyInAutomaticStyles" />
+
+ <!--** create an absolute style by inherting properties from the given parent properties **-->
+ <xsl:variable name="newStyleProperties-RTF">
+ <xsl:call-template name="create-inherited-style-properties">
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:variable name="newStyleProperties" select="common:node-set($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:variable name="newStyleProperties" select="xalan:nodeset($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:variable name="newStyleProperties" select="xt:node-set($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="get-children">
+ <xsl:param name="globalData" />
+ <xsl:param name="searchOnlyInAutomaticStyles" />
+ <xsl:param name="inheritedStyleProperties" select="*" />
+
+<!-- QUESTION: Parent style is only unique by name and family, but what about cross family inheritance? -->
+ <!-- For each child style (that is every style which has the given parentStyleName as style:parent-style-name and the same style:family -->
+ <xsl:variable name="parentStyleFamily" select="@style:family" />
+ <xsl:variable name="parentStyleName" select="@style:name" />
+ <xsl:if test="not($searchOnlyInAutomaticStyles)">
+ <xsl:for-each select="$globalData/office:styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="$globalData/office:automatic-styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+
+ <xsl:template name="create-inherited-style-properties">
+ <xsl:param name="inheritedStyleProperties" />
+
+ <xsl:element name="style:properties">
+ <!-- Writing all inherited style properties -->
+ <xsl:for-each select="$inheritedStyleProperties/@*">
+ <xsl:sort select="name()" />
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+
+ <!--All current attributes will override already inserted attributes of the same name
+ XSLT Spec: "Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name." -->
+ <xsl:for-each select="*/@*[name() != 'style:font-size-rel']">
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+
+ <xsl:if test="*/@style:font-size-rel">
+<!--
+ The intheritedStyleProperties should include a absolute Font Size, but
+ <style:properties
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ style:font-name="Courier New"
+ fo:language="en"
+ fo:country="US"
+ style:font-name-asian=Courier New"
+ style:font-name-complex="Courier New"/>
+-->
+ <xsl:variable name="fontSizeAbsolute">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$inheritedStyleProperties/@fo:font-size" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="fontSizeRelative">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="*/@style:font-size-rel" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:attribute name="fo:font-size">
+ <xsl:value-of select="$fontSizeAbsolute + $fontSizeRelative"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+
+ <!-- providing tabulator indentation -->
+ <xsl:copy-of select="$inheritedStyleProperties/style:tab-stops"/>
+ <xsl:copy-of select="*/style:tab-stops"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- debugging & testing purpose -->
+ <xsl:template name="write-collected-styles">
+ <xsl:param name="globalData" />
+
+ <xsl:message>&lt;all-doc-styles&gt;</xsl:message>
+ <xsl:for-each select="$globalData/all-doc-styles/style">
+ <xsl:message>&lt;style</xsl:message>
+ <xsl:message>style:family="<xsl:value-of select="current()/@style:family" />"&gt;</xsl:message>
+ <xsl:message>style:name="<xsl:value-of select="current()/@style:name" />" </xsl:message>
+ <xsl:message> &lt;*</xsl:message>
+ <xsl:for-each select="*/@*">
+ <xsl:message>
+ <xsl:text></xsl:text>
+ <xsl:value-of select="name()" />="<xsl:value-of select="." />"</xsl:message>
+ </xsl:for-each>
+ <xsl:message>/&gt;</xsl:message>
+ <xsl:message>&lt;/style&gt;</xsl:message>
+ </xsl:for-each>
+ <xsl:message>&lt;/all-doc-styles&gt;</xsl:message>
+ </xsl:template>
+
+ <xsl:template name="map-odf-style-properties">
+ <xsl:param name="globalData" />
+
+ <xsl:choose>
+ <!--+++++ DEBUG STYLE OUTPUT FOR REGRESSION TEST +++++-->
+ <!-- create styles file from the style variable (testing switch) -->
+ <xsl:when test="$onlyStyleOutputEnabled">
+
+ <xsl:element name="debug-output" namespace="">
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="map-odf-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+
+ <!-- create XHTML file -->
+ <xsl:otherwise>
+ <!-- to access the variable like a node-set it is necessary to convert it
+ from a result-tree-fragment (RTF) to a node set using the James Clark extension -->
+ <xsl:variable name="globalDataRTF">
+ <!-- raw properties still needed for table width attribute creation -->
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="map-odf-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- REASON FOR TEMPLATE:
+ The OpenOffice style properities gathered in the variable 'globalData' have to be mapped to the CSS style format
+ -->
+ <xsl:template name="map-odf-properties">
+ <xsl:param name="globalData" />
+ <xsl:element name="all-styles" namespace="">
+ <xsl:for-each select="$globalData/all-doc-styles/style">
+ <xsl:sort select="@style:family" />
+ <xsl:sort select="@style:name" />
+
+ <xsl:call-template name="writeUsedStyles">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="style" select="."/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:key name="elementUsingStyle" match="*" use="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name | @table:default-cell-style-name"/>
+ <xsl:key name="listLabelStyleInStyles" match="/*/office:styles/text:list-style/* |
+ /*/office:styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
+
+ <xsl:key name="listLabelStyleInContent" match="/*/office:automatic-styles/text:list-style/* | /*/office:automatic-styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
+
+
+ <xsl:variable name="documentRoot" select="/" />
+ <xsl:template name="writeUsedStyles">
+ <xsl:param name="globalData" />
+ <xsl:param name="style"/>
+
+ <!-- for-each changes the key environment from the previously globalData back to the document root -->
+ <xsl:for-each select="$documentRoot">
+ <!-- only styles, which are used in the content are written as CSS styles -->
+ <xsl:choose>
+ <xsl:when test="key('elementUsingStyle', $style/@style:name)/@* or key('listLabelStyleInContent', $style/@style:name)/@*">
+ <xsl:call-template name="writeUsedStyles2">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="style" select="$style" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="not(office:document-content)">
+ <xsl:if test="key('listLabelStyleInStyles', $style/@style:name)/@* or /*/office:styles/text:notes-configuration[@text:citation-style-name = $style/@style:name or /*/office:styles/@text:citation-body-style-name=$style/@style:name]">
+ <!-- if there are consecutive paragraphs with borders (OR background AND margin ), only the first and the last have the top/bottom border
+ unless style:join-border="false" -->
+ <xsl:call-template name="writeUsedStyles2">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="style" select="$style" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="document($stylesFileURL)">
+ <xsl:if test="key('listLabelStyleInStyles', $style/@style:name)/@* or /*/office:styles/text:notes-configuration[@text:citation-style-name = $style/@style:name or /*/office:styles/@text:citation-body-style-name=$style/@style:name]">
+ <!-- if there are consecutive paragraphs with borders (OR background AND margin ), only the first and the last have the top/bottom border
+ unless style:join-border="false" -->
+ <xsl:call-template name="writeUsedStyles2">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="style" select="$style" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="writeUsedStyles2">
+ <xsl:param name="globalData" />
+ <xsl:param name="style"/>
+ <xsl:choose>
+ <xsl:when test="
+ $style/@style:family='paragraph'
+ and((
+ (
+ $style/*/@fo:border-top
+ or $style/*/@fo:border-bottom
+ or $style/*/@fo:border
+ )
+ and
+ (
+ not($style/*/@style:join-border)
+ or $style/*/@style:join-border = 'true'
+ )
+ )
+ or
+ (
+ (
+ $style/*/@fo:margin-top
+ or $style/*/@fo:margin-bottom
+ or $style/*/@fo:margin
+ )
+ and
+ ( $style/*/@fo:background-color
+ and
+ not($style/*/fo:background-color='transparent')
+ )
+ )
+ )">
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="$style/@style:family" />
+ <xsl:attribute name="style:name"><xsl:value-of select="concat($style/@style:name, '_borderStart')" /></xsl:attribute>
+ <xsl:element name="final-properties" namespace="">
+ <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-bottom')][not(name() = 'fo:padding-bottom')][not(name() = 'fo:margin-bottom')][not(name() = 'fo:margin')]">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-bottom' or name() = 'fo:margin']">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:text> border-bottom-style:none; </xsl:text>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="$style/@style:family" />
+ <xsl:copy-of select="$style/@style:name" />
+ <xsl:attribute name="mergedBorders"><xsl:value-of select="true()" /></xsl:attribute>
+ <xsl:element name="final-properties" namespace="">
+ <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-top') and not(name() = 'fo:border-bottom')][not(name() = 'fo:padding-top') and not(name() = 'fo:padding-bottom')][not(name() = 'fo:margin-top') and not(name() = 'fo:margin-bottom')][not(name() = 'fo:margin')]">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin-bottom' or name() = 'fo:margin']">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:text> border-top-style:none; border-bottom-style:none; </xsl:text>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="$style/@style:family" />
+ <xsl:attribute name="style:name"><xsl:value-of select="concat($style/@style:name, '_borderEnd')" /></xsl:attribute>
+ <xsl:element name="final-properties" namespace="">
+ <xsl:apply-templates select="$style/*/@*[not(name() = 'fo:border-top')][not(name() = 'fo:padding-top')][not(name() = 'fo:margin-top')][not(name() = 'fo:margin')]">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin']">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <xsl:text> border-top-style:none;</xsl:text>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="not(key('listLabelStyleInStyles', $style/@style:name)/@*)">
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="$style/@style:family" />
+ <xsl:copy-of select="$style/@style:name" />
+ <xsl:element name="final-properties" namespace="">
+ <xsl:apply-templates select="$style/*/@*">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="style" namespace="">
+ <xsl:attribute name="style:family">none</xsl:attribute>
+ <xsl:attribute name="style:name"><xsl:value-of select="$style/@style:name"/></xsl:attribute>
+ <xsl:element name="final-properties" namespace="">
+ <xsl:apply-templates select="$style/*/@*">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template mode="paragraphMerge" match="@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right">
+ <xsl:text>padding</xsl:text>
+ <xsl:value-of select="substring-after(name(), 'fo:margin')"/>
+ <xsl:text>:</xsl:text>
+ <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
+ <xsl:choose>
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
index 5934e2e3a87e..acdc3dd0412d 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
@@ -2,23 +2,23 @@
<!--
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>
@@ -50,7 +50,7 @@
<xsl:param name="globalData"/>
<xsl:choose>
- <xsl:when test="*/text:tab[1] or */*/text:tab[1]">
+ <xsl:when test="parent::table-of-content and */text:tab[1] or */*/text:tab[1]">
<xsl:call-template name="createIndexBodyTable">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:call-template>
@@ -93,18 +93,18 @@
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">0</xsl:attribute>
- <xsl:if test="parent::*/@text:style-name">
+ <xsl:if test="parent::*/@text:style-name">
<!-- parent as index:body has no style -->
- <xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/@style:rel-width"/>
- <xsl:if test="$value">
- <xsl:attribute name="width">
- <xsl:value-of select="$value"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="class">
- <xsl:value-of select="translate(parent::*/@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
+ <xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/@style:rel-width"/>
+ <xsl:if test="$value">
+ <xsl:attribute name="width">
+ <xsl:value-of select="$value"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(parent::*/@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
<xsl:element namespace="{$namespace}" name="colgroup">
<xsl:choose>
@@ -489,32 +489,66 @@ Scenarios unmatched:
<!-- CREATION OF A CONTENT TABLE LINK -->
<!-- ************************************** -->
+ <xsl:key name="bookmark" match="text:bookmark | text:bookmark-start" use="@text:name"/>
<!-- content table link -->
<xsl:template match="text:a" mode="content-table">
<xsl:param name="globalData"/>
- <xsl:variable name="text">
- <xsl:choose>
- <!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text,
- furthermore that a tab will separate the to be neglected page number -->
- <xsl:when test="text:tab">
- <xsl:value-of select="text()[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="text()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- REFERENCE HANDLING - HREF -->
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text>
- <xsl:value-of select='concat("a_", translate(normalize-space($text), "&#xA;&amp;&lt;&gt;.,;: %()[]/\+", "_______________________________"))'/>
- </xsl:attribute>
- <xsl:value-of select="$text"/>
- </xsl:element>
+ <xsl:variable name="name" select="substring(@xlink:href,2)"/>
+
+ <xsl:variable name="text">
+ <xsl:choose>
+ <!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text,
+ furthermore that a tab will separate the to be neglected page number -->
+ <xsl:when test="text:tab">
+ <xsl:call-template name="write-text-without-line-numbers">
+ <xsl:with-param name="textCount" select="count(text())"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="text()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- REFERENCE HANDLING - HREF -->
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:choose>
+ <xsl:when test="key('bookmark',$name)">
+ <xsl:value-of select="$name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select='concat("a_", translate(normalize-space($text), "&#xA;&amp;&lt;&gt;.,;: %()[]/\+", "_______________________________"))'/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:value-of select="$text"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Heuristic: write out text separated by elements, leaving the last number out (mostly text number) -->
+ <xsl:template name="write-text-without-line-numbers">
+ <xsl:param name="textCount"/>
+ <xsl:param name="textNodeNumber" select="1"/>
+
+ <xsl:choose>
+ <xsl:when test="$textCount &gt; $textNodeNumber">
+ <xsl:value-of select="text()[$textNodeNumber]"/>
+ <xsl:call-template name="write-text-without-line-numbers">
+ <xsl:with-param name="textCount" select="$textCount"/>
+ <xsl:with-param name="textNodeNumber" select="$textNodeNumber + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="not(number(text()[$textNodeNumber]) &gt; -1)">
+ <xsl:value-of select="text()[$textNodeNumber]"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
</xsl:template>
<xsl:template match="text:s" mode="content-table">
@@ -542,13 +576,13 @@ Scenarios unmatched:
</xsl:element>
</xsl:if>
</xsl:template>
-
+
<xsl:template match="text()" mode="content-table">
- <!-- Heuristic to remove page numbers (useless in HTML) in the content table
+ <!-- Heuristic to remove page numbers (useless in HTML) in the content table
usually after a tab -->
<xsl:if test="name(preceding-sibling::*[1]) != 'text:tab' and not(number() &gt; -1)">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
-
+
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 1c47b8f25ce8..99c2b45d1b0a 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -57,7 +57,6 @@
<xsl:key match="style:master-page" name="masterPageElements" use="@style:name"/>
<xsl:key match="style:page-layout" name="pageLayoutElements" use="@style:name"/>
<xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
-
<xsl:template name="create-body">
<xsl:param name="globalData"/>
<xsl:call-template name="create-body.collect-page-properties">
@@ -76,7 +75,8 @@
<xsl:if test="key('elementUsingStyle', ../@style:name)">
<!-- Check every master-page-name if it is not emtpy and return as ';' separated list -->
<xsl:if test="string-length(../@style:master-page-name) &gt; 0">
- <xsl:value-of select="../@style:master-page-name"/>;</xsl:if>
+ <xsl:value-of select="../@style:master-page-name"/>;
+ </xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:variable>
@@ -86,7 +86,7 @@
<xsl:variable name="pagePropertiesRTF">
<xsl:choose>
<xsl:when test="not($pageLayoutName) or $pageLayoutName = ''">
- <xsl:value-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
+ <xsl:copy-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
</xsl:when>
<xsl:otherwise>
<!-- Find the according style:page-layout and store the properties in a variable -->
@@ -404,7 +404,7 @@
&#160; is an unbreakable whitespace to give conent to the element and force a browser not to ignore the element -->
<div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
</xsl:when>
- <xsl:when test="text:tab">
+ <xsl:when test="text:tab and not(ancestor::text:index-body)">
<!-- If there is a tabulator (ie. text:tab) within a paragraph, a heuristic for ODF tabulators creates a
span for every text:tab embracing the following text nodes aligning them according to the tabulator.
A line break or another text:tab starts a new text:span, line break even the tab counter for the line.
@@ -511,8 +511,9 @@
<!-- every frame sibling have to be incapuslated within a div with left indent -->
<xsl:element name="span">
<xsl:choose>
- <xsl:when test="count($tabStops/style:tab-stop) &lt; 3">
+ <xsl:when test="count($tabStops/style:tab-stop) &gt; 0 and count($tabStops/style:tab-stop) &lt; 3">
<!-- only allow the heuristic when the style has less than 3 TABS -->
+ <!-- ignore heuristics if no TABS are defined -->
<xsl:attribute name="style">
<xsl:call-template name="createTabIndent">
<xsl:with-param name="globalData" select="$globalData"/>
@@ -615,6 +616,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
+ <!--<xsl:message>TAB: tabCount=
+ <xsl:value-of select="$tabCount"/>, tabPosition=
+ <xsl:value-of select="$tabPosition"/>, tabIndent=
+ <xsl:value-of select="$tabIndent"/>
+ </xsl:message>-->
<xsl:choose>
<xsl:when test="$tabIndent='NaN'">
<xsl:variable name="tabPositionTmp">
@@ -785,7 +791,7 @@
<xsl:with-param name="globalData" select="$globalData"/>
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
<xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
</xsl:call-template>
<!-- next elements will be called after the creation with the new indent (plus width of frame) -->
</xsl:when>
@@ -891,7 +897,9 @@
<xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
</xsl:call-template>
<!-- after the last draw:frame sibling the CSS float is disabled -->
- <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
+ <xsl:if test="@text:anchor-type!='as-char'">
+ <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
+ </xsl:if>
</xsl:template>
<xsl:template name="getPageMarginLeft">
@@ -903,7 +911,8 @@
<xsl:if test="key('elementUsingStyle', ../@style:name)">
<!-- Check every master-page-name if it is not emtpy and return as ';' separated list -->
<xsl:if test="string-length(../@style:master-page-name) &gt; 0">
- <xsl:value-of select="../@style:master-page-name"/>;</xsl:if>
+ <xsl:value-of select="../@style:master-page-name"/>;
+ </xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:variable>
@@ -1030,21 +1039,21 @@
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>-->
- <xsl:call-template name="createDrawFrame2">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="svgY" select="$svgY"/>
- </xsl:call-template>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="true()"/>
- <xsl:with-param name="noDivBefore" select="false()"/>
- </xsl:apply-templates>
+ <xsl:call-template name="createDrawFrame2">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="svgY" select="$svgY"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="true()"/>
+ <xsl:with-param name="noDivBefore" select="false()"/>
+ </xsl:apply-templates>
<!--
</xsl:otherwise>
@@ -1058,20 +1067,31 @@
<xsl:param name="leftPosition" />
<xsl:param name="svgY" />
- <xsl:comment>Next 'div' is a draw:frame.</xsl:comment>
- <xsl:element name="div">
+ <xsl:variable name="elem-name">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char'">span</xsl:when>
+ <xsl:otherwise>div</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:comment>Next '
+ <xsl:value-of select="$elem-name"/>' is a draw:frame.
+ </xsl:comment>
+ <xsl:element name="{$elem-name}">
<xsl:attribute name="style">
<xsl:call-template name="widthAndHeight"/>
-
- <!-- all images float (CSS float reltaive) with a left position calculated by svg:x - parentMarginLeft - previousFrameWidths -->
- <xsl:text> float:left; padding:0; position:relative; left:</xsl:text>
- <xsl:value-of select="$leftPosition"/>
- <xsl:text>cm; </xsl:text>
- <!-- if the frame is anchored on a char -->
- <xsl:if test="@text:anchor-type='char'">
- <xsl:text>top:</xsl:text>
- <xsl:value-of select="$svgY"/>
+ <!-- MIB -->
+ <xsl:text> padding:0; </xsl:text>
+ <xsl:if test="@text:anchor-type!='as-char'">
+ <!-- all images float (CSS float reltaive) with a left position calculated by svg:x - parentMarginLeft - previousFrameWidths -->
+ <xsl:text> float:left; position:relative; left:</xsl:text>
+ <xsl:value-of select="$leftPosition"/>
<xsl:text>cm; </xsl:text>
+ <!-- if the frame is anchored on a char -->
+ <xsl:if test="@text:anchor-type='char'">
+ <xsl:text>top:</xsl:text>
+ <xsl:value-of select="$svgY"/>
+ <xsl:text>cm; </xsl:text>
+ </xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:apply-templates select="@*">
@@ -1083,6 +1103,8 @@
</xsl:element>
</xsl:template>
+ <xsl:template match="svg:desc"/>
+
<xsl:template name="widthAndHeight">
<xsl:if test="@svg:height | @svg:width">
<xsl:choose>
@@ -1498,7 +1520,9 @@
<xsl:message>
Accessibility Warning:
No alternate text ('svg:desc' element) set for
- image '<xsl:value-of select="@xlink:href"/>'!</xsl:message>
+ image '
+ <xsl:value-of select="@xlink:href"/>'!
+ </xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
@@ -1926,7 +1950,6 @@
<xsl:when test="$isEmptyList or $isListHeader">
<xsl:apply-templates>
<xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isListHeader or $isNextLevelNumberingReset"/>
<xsl:with-param name="itemLabel" select="$itemLabelNew"/>
<xsl:with-param name="listLevel" select="$listLevel + 1"/>
<xsl:with-param name="listStyleName" select="$listStyleName"/>
@@ -2206,7 +2229,7 @@
<xsl:when test="$currentListLevel &lt; $listLevel">
<xsl:choose>
<!-- if it has content the counting is ended -->
- <xsl:when test="not($isEmptyList or $isListHeader)">
+ <xsl:when test="*[name() = 'text:h' or name() = 'text:p'] or $isListHeader">
<!-- 2DO: Perhaps the children still have to be processed -->
<xsl:value-of select="$itemNumber + $pseudoLevel"/>
</xsl:when>
@@ -2261,7 +2284,7 @@
<xsl:with-param name="pseudoLevel">
<xsl:choose>
<!-- empty list item does not count -->
- <xsl:when test="$isEmptyList or $isListHeader">
+ <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p']) or $isListHeader">
<xsl:value-of select="$pseudoLevel"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
@@ -2853,6 +2876,20 @@
</xsl:apply-templates>
</xsl:template>
+ <!-- ***************** -->
+ <!-- *** Bookmarks *** -->
+ <!-- ***************** -->
+
+ <xsl:template match="text:bookmark|text:bookmark-start">
+ <xsl:element name="a">
+ <xsl:attribute name="name">
+ <xsl:value-of select="@text:name"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:bookmark-end"/>
+
<!-- DISABLING this tab handling as the tab width is only relative
<xsl:template match="text:tab">
<xsl:param name="globalData"/>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index ab2c9bbaa866..7e834862c2d6 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -441,15 +441,16 @@
<link rel="transformation" href="http://xml.openoffice.org/odf2xhtml/rdf-extract.xsl" />
-->
- <!-- base URL of document for resolving relative links -->
+ <!-- base URL of document for resolving relative links
+ NOTE: CHROME has a problem, with relative references as from content table, referencing to root directory instead of document
<xsl:element name="base">
- <xsl:attribute name="href">
+ <xsl:attribute name="href">-->
<!-- earlier 'targetURL' was used for an absoulte reference of base provided by the Office (file URL)
<xsl:value-of select="$targetURL" />
now '.' let relative links work, even if document has been moved -->
- <xsl:text>.</xsl:text>
+ <!--<xsl:text>.</xsl:text>
</xsl:attribute>
- </xsl:element>
+ </xsl:element>-->
</xsl:template>
<!-- generic template for adding common meta tags -->
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
index f0ac642a00eb..3d2cd7881bed 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
@@ -79,7 +79,7 @@
indent = "no"
omit-xml-declaration = "no"
doctype-public = "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
- doctype-system = "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" />
+ doctype-system = "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" />
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index 0a01310b3b40..8e61dcebfe8b 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -389,8 +389,20 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU
if( !createDirectory( rURL ) )
return false;
- SvFileStream aOutputStream(rURL, STREAM_WRITE );
- Reference< XOutputStream > xOS( new utl::OOutputStreamWrapper( aOutputStream ) );
+ ::osl::File file(rURL);
+ ::osl::FileBase::RC rc =
+ file.open(OpenFlag_Write|OpenFlag_Create);
+ if (::osl::FileBase::E_EXIST == rc) {
+ rc = file.open(OpenFlag_Write);
+ if (::osl::FileBase::E_None == rc) {
+ file.setSize(0); // #i97170# truncate
+ }
+ }
+ if (::osl::FileBase::E_None != rc) {
+ throw RuntimeException();
+ }
+ Reference< XOutputStream > const xOS(
+ new comphelper::OSLOutputStreamWrapper(file));
return copyStreams( xIS, xOS );
}
diff --git a/filter/source/xsltfilter/Manifest b/filter/source/xsltfilter/Manifest
index b189662d31e3..e20aea34d7bc 100644
--- a/filter/source/xsltfilter/Manifest
+++ b/filter/source/xsltfilter/Manifest
@@ -1,3 +1,3 @@
-RegistrationClassName: XSLTransformer
+RegistrationClassName: com.sun.star.comp.xsltfilter.XSLTransformer
Class-Path: saxon9.jar
UNO-Type-Path:
diff --git a/filter/source/xsltfilter/Base64.java b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/Base64.java
index 1032282ea8a6..f92012e854f5 100644
--- a/filter/source/xsltfilter/Base64.java
+++ b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/Base64.java
@@ -1,3 +1,5 @@
+package com.sun.star.comp.xsltfilter;
+
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
diff --git a/filter/source/xsltfilter/XSLTFilterOLEExtracter.java b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java
index f91146b45bb9..078e03135ced 100644
--- a/filter/source/xsltfilter/XSLTFilterOLEExtracter.java
+++ b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java
@@ -1,3 +1,5 @@
+package com.sun.star.comp.xsltfilter;
+
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
diff --git a/filter/source/xsltfilter/XSLTransformer.java b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
index 315170ec7f98..1a6d8cf16d8d 100644
--- a/filter/source/xsltfilter/XSLTransformer.java
+++ b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
@@ -1,3 +1,5 @@
+package com.sun.star.comp.xsltfilter;
+
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,6 +79,7 @@ import com.sun.star.uno.UnoRuntime;
//Uno to java Adaptor
import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter;
import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter;
+import javax.xml.transform.Templates;
import net.sf.saxon.FeatureKeys;
@@ -97,7 +100,6 @@ public class XSLTransformer
*/
private XInputStream m_xis;
private XOutputStream m_xos; // private static HashMap templatecache;
- private static final int STREAM_BUFFER_SIZE = 4000;
private static final String STATSPROP = "XSLTransformer.statsfile";
private static PrintStream statsp;
private String stylesheeturl;
@@ -110,11 +112,11 @@ public class XSLTransformer
private Thread t; // listeners
private Vector listeners = new Vector(); //
private XMultiServiceFactory svcfactory; // cache for transformations by stylesheet
- private static Hashtable transformers = new Hashtable();
+ private static Hashtable xsltReferences = new Hashtable();
// struct for cached stylesheets
private static class Transformation {
- public Transformer transformer;
+ public Templates cachedXSLT;
public long lastmod;
}
// Resolve URIs to an empty source
@@ -259,9 +261,10 @@ public class XSLTransformer
// in order to help performance and to remedy a a possible memory
// leak in xalan, where it seems, that Transformer instances cannot
// be reclaimed though they are no longer referenced here, we use
- // a cache of weak references to transformers created for specific
+ // a cache of weak references (ie. xsltReferences) created for specific
// style sheet URLs see also #i48384#
+ Templates xsltTemplate = null;
Transformer transformer = null;
Transformation transformation = null;
// File stylefile = new File(new URI(stylesheeturl));
@@ -278,36 +281,37 @@ public class XSLTransformer
}
}
- synchronized (transformers) {
+ synchronized (xsltReferences) {
java.lang.ref.WeakReference ref = null;
- // try to get the transformer reference from the cache
- if ((ref = (java.lang.ref.WeakReference) transformers.get(stylesheeturl)) == null ||
+ // try to get the xsltTemplate reference from the cache
+ if ((ref = (java.lang.ref.WeakReference) xsltReferences.get(stylesheeturl)) == null ||
(transformation = ((Transformation) ref.get())) == null ||
((Transformation) ref.get()).lastmod < lastmod) {
// we cannot find a valid reference for this stylesheet
// or the stylsheet was updated
if (ref != null) {
- transformers.remove(stylesheeturl);
+ xsltReferences.remove(stylesheeturl);
}
- // create new transformer for this stylesheet
+ // create new xsltTemplate for this stylesheet
TransformerFactory tfactory = TransformerFactory.newInstance();
debug("TransformerFactory is '" + tfactory.getClass().getName() + "'");
// some external saxons (Debian, Ubuntu, ...) have this disabled
// per default
tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
- transformer = tfactory.newTransformer(new StreamSource(stylesheeturl));
- transformer.setOutputProperty("encoding", "UTF-8");
- // transformer.setURIResolver(XSLTransformer.this);
+ xsltTemplate = tfactory.newTemplates(new StreamSource(stylesheeturl));
// store the transformation into the cache
transformation = new Transformation();
transformation.lastmod = lastmod;
- transformation.transformer = transformer;
+ transformation.cachedXSLT = xsltTemplate;
ref = new java.lang.ref.WeakReference(transformation);
- transformers.put(stylesheeturl, ref);
+ xsltReferences.put(stylesheeturl, ref);
}
}
- transformer = transformation.transformer;
+ xsltTemplate = transformation.cachedXSLT;
+ transformer = xsltTemplate.newTransformer();
+ transformer.setOutputProperty("encoding", "UTF-8");
+ // transformer.setURIResolver(XSLTransformer.this);
// invalid to set 'null' as parameter as 'null' is not a valid Java object
if (sourceurl != null) {
@@ -356,12 +360,33 @@ public class XSLTransformer
if (is != null) {
is.close();
}
+ } catch (java.lang.Throwable ex) {
+ if (statsp != null) {
+ statsp.println(ex.getClass().getName() + ": " + ex.getMessage());
+ ex.printStackTrace(statsp);
+ }
+ }
+ try {
if (os != null) {
os.close();
}
+ } catch (java.lang.Throwable ex) {
+ if (statsp != null) {
+ statsp.println(ex.getClass().getName() + ": " + ex.getMessage());
+ ex.printStackTrace(statsp);
+ }
+ }
+ try {
if (m_xis != null) {
m_xis.closeInput();
}
+ } catch (java.lang.Throwable ex) {
+ if (statsp != null) {
+ statsp.println(ex.getClass().getName() + ": " + ex.getMessage());
+ ex.printStackTrace(statsp);
+ }
+ }
+ try {
if (m_xos != null) {
m_xos.closeOutput();
}
@@ -469,7 +494,7 @@ public class XSLTransformer
public static XSingleServiceFactory __getServiceFactory(
String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey) {
XSingleServiceFactory xSingleServiceFactory = null;
- if (implName.equals(XSLTransformer.class.getName())) {
+ if (implName.indexOf("XSLTransformer") != -1) {
xSingleServiceFactory = FactoryHelper.getServiceFactory(XSLTransformer.class,
_serviceName, multiFactory, regKey);
}
diff --git a/filter/source/xsltfilter/makefile.mk b/filter/source/xsltfilter/makefile.mk
index f96534df4e2d..b275a1c5f71d 100644
--- a/filter/source/xsltfilter/makefile.mk
+++ b/filter/source/xsltfilter/makefile.mk
@@ -26,7 +26,7 @@
#*************************************************************************
PRJ = ..$/..
PRJNAME = filter
-#PACKAGE = com$/sun$/star$/documentconversion$/XSLTFilter
+PACKAGE = com/sun/star/comp/xsltfilter
TARGET =XSLTFilter
ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO
@@ -62,7 +62,7 @@ JAVAFILES = $(subst,$(CLASSDIR)$/, $(subst,.class,.java $(JAVACLASSFILES)))
CUSTOMMANIFESTFILE = Manifest
JARCOMPRESS = TRUE
-JARCLASSDIRS = XSLTransformer*.class XSLTFilterOLEExtracter*.class
+JARCLASSDIRS = com/sun/star/comp/xsltfilter
JARTARGET = $(TARGET).jar
.IF "$(SYSTEM_SAXON)" == "YES"
@@ -72,7 +72,11 @@ JARFILES += saxon9.jar
.ENDIF
# --- Files --------------------------------------------------------
-JAVACLASSFILES=$(CLASSDIR)$/XSLTransformer.class $(CLASSDIR)$/XSLTFilterOLEExtracter.class
+JAVACLASSFILES= \
+ $(CLASSDIR)/com/sun/star/comp/xsltfilter/XSLTransformer.class \
+ $(CLASSDIR)/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.class \
+ $(CLASSDIR)/com/sun/star/comp/xsltfilter/Base64.class \
+
.ENDIF
# --- Targets ------------------------------------------------------
diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx
index 9bf4b1ead43d..8825386d1b57 100644
--- a/framework/inc/services/substitutepathvars.hxx
+++ b/framework/inc/services/substitutepathvars.hxx
@@ -36,7 +36,7 @@
#include <hash_map>
//_________________________________________________________________________________________________________________
-// my own includes
+// my own includes
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx>
@@ -46,7 +46,7 @@
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
-// interface includes
+// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
@@ -54,7 +54,7 @@
#include <com/sun/star/util/XStringSubstitution.hpp>
//_________________________________________________________________________________________________________________
-// other includes
+// other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
@@ -68,24 +68,24 @@ namespace framework
// Must be zero value based
enum EnvironmentType
{
- ET_HOST = 0 ,
- ET_YPDOMAIN ,
- ET_DNSDOMAIN ,
- ET_NTDOMAIN ,
- ET_OS ,
- ET_UNKNOWN ,
- ET_COUNT
+ ET_HOST = 0 ,
+ ET_YPDOMAIN ,
+ ET_DNSDOMAIN ,
+ ET_NTDOMAIN ,
+ ET_OS ,
+ ET_UNKNOWN ,
+ ET_COUNT
};
// Must be zero value based
enum OperatingSystem
{
- OS_WINDOWS = 0,
- OS_UNIX ,
- OS_SOLARIS ,
- OS_LINUX ,
- OS_UNKNOWN ,
- OS_COUNT
+ OS_WINDOWS = 0,
+ OS_UNIX ,
+ OS_SOLARIS ,
+ OS_LINUX ,
+ OS_UNKNOWN ,
+ OS_COUNT
};
struct SubstituteRule
@@ -97,15 +97,16 @@ struct SubstituteRule
EnvironmentType aType ) :
aSubstVariable( aVarName ), aSubstValue( aValue ), aEnvValue( aVal ), aEnvType( aType ) {}
- rtl::OUString aSubstVariable;
- rtl::OUString aSubstValue;
- com::sun::star::uno::Any aEnvValue;
- EnvironmentType aEnvType;
+ rtl::OUString aSubstVariable;
+ rtl::OUString aSubstValue;
+ com::sun::star::uno::Any aEnvValue;
+ EnvironmentType aEnvType;
};
struct SubstitutePathNotify
{
SubstitutePathNotify() {};
+
const com::sun::star::uno::Sequence<rtl::OUString> aPropertyNames;
};
@@ -131,45 +132,45 @@ class SubstitutePathVariables_Impl : public utl::ConfigItem
static OperatingSystem GetOperatingSystemFromString( const rtl::OUString& );
static EnvironmentType GetEnvTypeFromString( const rtl::OUString& );
- void GetSharePointsRules( SubstituteVariables& aSubstVarMap );
+ void GetSharePointsRules( SubstituteVariables& aSubstVarMap );
/** is called from the ConfigManager before application ends or from the
PropertyChangeListener if the sub tree broadcasts changes. */
- virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
- virtual void Commit();
-
- private:
- // Wrapper methods for low-level functions
- OperatingSystem GetOperatingSystem();
- const rtl::OUString& GetYPDomainName();
- const rtl::OUString& GetDNSDomainName();
- const rtl::OUString& GetNTDomainName();
- const rtl::OUString& GetHostName();
-
- sal_Bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule );
-
- void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq );
- void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName,
- const rtl::OUString& aSharePointNodeName,
- SubstituteRuleVector& aRuleSet );
-
- // Stored values for domains and host
- sal_Bool m_bYPDomainRetrieved;
- rtl::OUString m_aYPDomain;
- sal_Bool m_bDNSDomainRetrieved;
- rtl::OUString m_aDNSDomain;
- sal_Bool m_bNTDomainRetrieved;
- rtl::OUString m_aNTDomain;
- sal_Bool m_bHostRetrieved;
- rtl::OUString m_aHost;
- sal_Bool m_bOSRetrieved;
- OperatingSystem m_eOSType;
-
- Link m_aListenerNotify;
- const rtl::OUString m_aSharePointsNodeName;
- const rtl::OUString m_aDirPropertyName;
- const rtl::OUString m_aEnvPropertyName;
- const rtl::OUString m_aLevelSep;
+ virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
+ virtual void Commit();
+
+ private:
+ // Wrapper methods for low-level functions
+ OperatingSystem GetOperatingSystem();
+ const rtl::OUString& GetYPDomainName();
+ const rtl::OUString& GetDNSDomainName();
+ const rtl::OUString& GetNTDomainName();
+ const rtl::OUString& GetHostName();
+
+ bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule );
+
+ void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq );
+ void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName,
+ const rtl::OUString& aSharePointNodeName,
+ SubstituteRuleVector& aRuleSet );
+
+ // Stored values for domains and host
+ bool m_bYPDomainRetrieved;
+ rtl::OUString m_aYPDomain;
+ bool m_bDNSDomainRetrieved;
+ rtl::OUString m_aDNSDomain;
+ bool m_bNTDomainRetrieved;
+ rtl::OUString m_aNTDomain;
+ bool m_bHostRetrieved;
+ rtl::OUString m_aHost;
+ bool m_bOSRetrieved;
+ OperatingSystem m_eOSType;
+
+ Link m_aListenerNotify;
+ const rtl::OUString m_aSharePointsNodeName;
+ const rtl::OUString m_aDirPropertyName;
+ const rtl::OUString m_aEnvPropertyName;
+ const rtl::OUString m_aLevelSep;
};
enum PreDefVariable
@@ -234,8 +235,8 @@ struct ReSubstUserVarOrder
typedef std::list< ReSubstFixedVarOrder > ReSubstFixedVarOrderVector;
typedef std::list< ReSubstUserVarOrder > ReSubstUserVarOrderVector;
-class SubstitutePathVariables : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo>
+class SubstitutePathVariables : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo >
{
friend class SubstitutePathVariables_Impl;
@@ -254,51 +255,51 @@ class SubstitutePathVariables : private ThreadHelpBase
virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- protected:
- DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* );
-
- void SetPredefinedPathVariables( PredefinedPathVariables& );
- rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const;
-
- // Special case (transient) values can change during runtime!
- // Don't store them in the pre defined struct
- rtl::OUString GetWorkPath() const;
- rtl::OUString GetWorkVariableValue() const;
- rtl::OUString GetPathVariableValue() const;
-
- rtl::OUString GetHomeVariableValue() const;
-
- // XStringSubstitution implementation methods
- rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, sal_Bool bSustRequired )
- throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText )
- throw (::com::sun::star::uno::RuntimeException);
- ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable )
- throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
-
- private:
- class VarNameToIndexMap : public std::hash_map< ::rtl::OUString,
- PreDefVariable,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
+ protected:
+ DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* );
+
+ void SetPredefinedPathVariables( PredefinedPathVariables& );
+ rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const;
+
+ // Special case (transient) values can change during runtime!
+ // Don't store them in the pre defined struct
+ rtl::OUString GetWorkPath() const;
+ rtl::OUString GetWorkVariableValue() const;
+ rtl::OUString GetPathVariableValue() const;
+
+ rtl::OUString GetHomeVariableValue() const;
+
+ // XStringSubstitution implementation methods
+ rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, bool bSustRequired )
+ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText )
+ throw (::com::sun::star::uno::RuntimeException);
+ ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable )
+ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+
+ private:
+ class VarNameToIndexMap : public std::hash_map< ::rtl::OUString,
+ PreDefVariable,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > >
{
- VarNameToIndexMap().swap( *this );
- }
- };
-
- // heavy used string
- const rtl::OUString m_aVarStart;
- const rtl::OUString m_aVarEnd;
-
- VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access
- SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name!
- PredefinedPathVariables m_aPreDefVars; // All predefined variables
- SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration
- ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup)
- ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ inline void free()
+ {
+ VarNameToIndexMap().swap( *this );
+ }
+ };
+
+ // heavy used string
+ const rtl::OUString m_aVarStart;
+ const rtl::OUString m_aVarEnd;
+
+ VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access
+ SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name!
+ PredefinedPathVariables m_aPreDefVars; // All predefined variables
+ SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration
+ ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup)
+ ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
};
}
diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
index aeea9907e6bc..e936fbf6ccad 100755
--- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java
+++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
@@ -63,20 +63,20 @@ public class PathSubstitutionTest
/**
* Create an array with all substitution variables
*/
- @Before private void initialize()
+ @Before public void initialize()
{
substVars = new VariableContainer();
- substVars.add("$(prog)", false, true);
- substVars.add("$(inst)", false, true);
- substVars.add("$(user)", false, true);
- substVars.add("$(work)", false, true);
- substVars.add("$(home)", false, true);
- substVars.add("$(temp)", false, true);
+ substVars.add("$(prog)", true, true);
+ substVars.add("$(inst)", true, true);
+ substVars.add("$(user)", true, true);
+ substVars.add("$(work)", true, true);
+ substVars.add("$(home)", true, true);
+ substVars.add("$(temp)", true, true);
substVars.add("$(lang)", false, false);
substVars.add("$(langid)", false, false);
substVars.add("$(vlang)", false, false);
// path won't resubstitute
- substVars.add("$(path)", false, false);
+ substVars.add("$(path)", true, false);
}
/**
@@ -106,8 +106,6 @@ public class PathSubstitutionTest
return;
}
-// initialize();
-
for (int i = 0; i < substVars.size(); i++)
{
String var = substVars.getVariable(i);
@@ -148,6 +146,12 @@ public class PathSubstitutionTest
//in middle of text works
substString = "file:///starting/" + var + "/path";
+ String sCanSubstAllPos;
+ if (substVars.onlySubstituteAtBegin(i))
+ sCanSubstAllPos = "NO";
+ else
+ sCanSubstAllPos = "YES";
+ System.out.println("Variable can substitute within string: "+sCanSubstAllPos);
System.out.println("Substitute '" + substString + "'");
newValue = oObj.substituteVariables(substString, false);
System.out.println("Return value '" + newValue + "'");
diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..38a6cf7cced8
--- /dev/null
+++ b/framework/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = framework
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/framework/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 90c460b74298..5fde74764eda 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -29,7 +29,7 @@
#include "precompiled_framework.hxx"
//_________________________________________________________________________________________________________________
-// my own includes
+// my own includes
//_________________________________________________________________________________________________________________
#include "services/substitutepathvars.hxx"
#include <threadhelp/resetableguard.hxx>
@@ -37,12 +37,12 @@
#include "services.h"
//_________________________________________________________________________________________________________________
-// interface includes
+// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/beans/XPropertySet.hpp>
//_________________________________________________________________________________________________________________
-// includes of other projects
+// includes of other projects
//_________________________________________________________________________________________________________________
#include <unotools/configitem.hxx>
#include <unotools/localfilehelper.hxx>
@@ -69,38 +69,38 @@
#include <string.h>
//_________________________________________________________________________________________________________________
-// Defines
+// Defines
//_________________________________________________________________________________________________________________
//
-#define STRPOS_NOTFOUND (sal_Int32)-1
+#define STRPOS_NOTFOUND (sal_Int32)-1
-#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val ))
+#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val ))
-#define SEARCHPATH_DELIMITER ';'
+#define SEARCHPATH_DELIMITER ';'
// Variable start/end characters
-#define SIGN_STARTVARIABLE ASCII_STR("$(")
-#define SIGN_ENDVARIABLE ASCII_STR(")")
+#define SIGN_STARTVARIABLE ASCII_STR("$(")
+#define SIGN_ENDVARIABLE ASCII_STR(")")
// Length of SUBSTITUTE_... to replace it with real values.
-#define REPLACELENGTH_INST 7
-#define REPLACELENGTH_PROG 7
-#define REPLACELENGTH_USER 7
-#define REPLACELENGTH_WORK 7
-#define REPLACELENGTH_HOME 7
-#define REPLACELENGTH_TEMP 7
-#define REPLACELENGTH_PATH 7
+#define REPLACELENGTH_INST 7
+#define REPLACELENGTH_PROG 7
+#define REPLACELENGTH_USER 7
+#define REPLACELENGTH_WORK 7
+#define REPLACELENGTH_HOME 7
+#define REPLACELENGTH_TEMP 7
+#define REPLACELENGTH_PATH 7
#define REPLACELENGTH_INSTPATH 11
#define REPLACELENGTH_PROGPATH 11
#define REPLACELENGTH_USERPATH 11
#define REPLACELENGTH_INSTURL 10
#define REPLACELENGTH_PROGURL 10
#define REPLACELENGTH_USERURL 10
-#define REPLACELENGTH_PATH 7
-#define REPLACELENGTH_LANG 7
-#define REPLACELENGTH_LANGID 9
-#define REPLACELENGTH_VLANG 8
+#define REPLACELENGTH_PATH 7
+#define REPLACELENGTH_LANG 7
+#define REPLACELENGTH_LANGID 9
+#define REPLACELENGTH_VLANG 8
#define REPLACELENGTH_WORKDIRURL 13
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
#define REPLACELENGTH_BASEINSTURL 14
@@ -108,27 +108,28 @@
// <--
// Name of the pre defined path variables
-#define VARIABLE_INST "$(inst)"
-#define VARIABLE_PROG "$(prog)"
-#define VARIABLE_USER "$(user)"
-#define VARIABLE_WORK "$(work)"
-#define VARIABLE_HOME "$(home)"
-#define VARIABLE_TEMP "$(temp)"
-#define VARIABLE_PATH "$(path)"
-#define VARIABLE_LANG "$(lang)"
-#define VARIABLE_LANGID "$(langid)"
-#define VARIABLE_VLANG "$(vlang)"
-#define VARIABLE_INSTPATH "$(instpath)"
-#define VARIABLE_PROGPATH "$(progpath)"
-#define VARIABLE_USERPATH "$(userpath)"
-#define VARIABLE_INSTURL "$(insturl)"
-#define VARIABLE_PROGURL "$(progurl)"
-#define VARIABLE_USERURL "$(userurl)"
-#define VARIABLE_WORKDIRURL "$(workdirurl)"
+#define VARIABLE_INST "$(inst)"
+#define VARIABLE_PROG "$(prog)"
+#define VARIABLE_USER "$(user)"
+#define VARIABLE_WORK "$(work)"
+#define VARIABLE_HOME "$(home)"
+#define VARIABLE_TEMP "$(temp)"
+#define VARIABLE_PATH "$(path)"
+#define VARIABLE_LANG "$(lang)"
+#define VARIABLE_LANGID "$(langid)"
+#define VARIABLE_VLANG "$(vlang)"
+#define VARIABLE_INSTPATH "$(instpath)"
+#define VARIABLE_PROGPATH "$(progpath)"
+#define VARIABLE_USERPATH "$(userpath)"
+#define VARIABLE_INSTURL "$(insturl)"
+#define VARIABLE_PROGURL "$(progurl)"
+#define VARIABLE_USERURL "$(userurl)"
+#define VARIABLE_WORKDIRURL "$(workdirurl)"
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
-#define VARIABLE_BASEINSTURL "$(baseinsturl)"
-#define VARIABLE_USERDATAURL "$(userdataurl)"
+#define VARIABLE_BASEINSTURL "$(baseinsturl)"
+#define VARIABLE_USERDATAURL "$(userdataurl)"
// <--
+#define VARIABLE_BRANDBASEURL "$(brandbaseurl)"
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
@@ -137,7 +138,7 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
//_________________________________________________________________________________________________________________
-// Namespace
+// Namespace
//_________________________________________________________________________________________________________________
//
@@ -149,6 +150,7 @@ struct FixedVariable
const char* pVarName;
PreDefVariable nEnumValue;
int nStrLen;
+ bool bAbsPath;
};
struct TableEntry
@@ -162,11 +164,11 @@ struct TableEntry
// of the string
static TableEntry aOSTable[OS_COUNT] =
{
- { "WINDOWS" , 7 },
- { "UNIX" , 4 },
- { "SOLARIS" , 7 },
- { "LINUX" , 5 },
- { "" , 0 } // unknown
+ { "WINDOWS" , 7 },
+ { "UNIX" , 4 },
+ { "SOLARIS" , 7 },
+ { "LINUX" , 5 },
+ { "" , 0 } // unknown
};
// Table with valid environment variables
@@ -174,12 +176,12 @@ static TableEntry aOSTable[OS_COUNT] =
// the length of the string.
static TableEntry aEnvTable[ET_COUNT] =
{
- { "HOST" , 4 },
- { "YPDOMAIN" , 8 },
- { "DNSDOMAIN" , 9 },
- { "NTDOMAIN" , 8 },
- { "OS" , 2 },
- { "" , 0 } // unknown
+ { "HOST" , 4 },
+ { "YPDOMAIN" , 8 },
+ { "DNSDOMAIN" , 9 },
+ { "NTDOMAIN" , 8 },
+ { "OS" , 2 },
+ { "" , 0 } // unknown
};
// Priority table for the environment types. Lower numbers define
@@ -187,44 +189,43 @@ static TableEntry aEnvTable[ET_COUNT] =
// that the first match wins!!
static sal_Int16 aEnvPrioTable[ET_COUNT] =
{
- 1, // ET_HOST
- 2, // ET_IPDOMAIN
- 2, // ET_DNSDOMAIN
- 2, // ET_NTDOMAIN
- 3, // ET_OS
- 99, // ET_UNKNOWN
+ 1, // ET_HOST
+ 2, // ET_IPDOMAIN
+ 2, // ET_DNSDOMAIN
+ 2, // ET_NTDOMAIN
+ 3, // ET_OS
+ 99, // ET_UNKNOWN
};
// Table with all fixed/predefined variables supported.
static FixedVariable aFixedVarTable[] =
{
- { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST },
- { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG },
- { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER },
- { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK }, // Special variable (transient)!
- { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME },
- { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP },
- { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH },
- { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG },
- { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID },
- { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG },
- { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH },
- { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH },
- { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH },
- { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL },
- { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL },
- { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL },
- { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL }, // Special variable (transient) and don't use for resubstitution!
+ { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST, true },
+ { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG, true },
+ { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER, true },
+ { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK, true }, // Special variable (transient)!
+ { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME, true },
+ { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP, true },
+ { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH, true },
+ { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG, false },
+ { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID, false },
+ { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG, false },
+ { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH, true },
+ { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH, true },
+ { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH, true },
+ { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL, true },
+ { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL, true },
+ { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL, true },
+ { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL,true }, // Special variable (transient) and don't use for resubstitution!
// --> PB 2004-10-27 #i32656# - new variable of hierachy service
- { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL },
- { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL },
+ { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL,true },
+ { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL,true },
// <--
- { "$(brandbaseurl)", PREDEFVAR_BRANDBASEURL,
- RTL_CONSTASCII_LENGTH("$(brandbaseurl)") }
+ { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true }
};
//_________________________________________________________________________________________________________________
-// Implementation helper classes
+// Implementation helper classes
//_________________________________________________________________________________________________________________
//
@@ -252,11 +253,11 @@ EnvironmentType SubstitutePathVariables_Impl::GetEnvTypeFromString( const rtl::O
SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link& aNotifyLink ) :
utl::ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Substitution" ))),
- m_bYPDomainRetrieved( sal_False ),
- m_bDNSDomainRetrieved( sal_False ),
- m_bNTDomainRetrieved( sal_False ),
- m_bHostRetrieved( sal_False ),
- m_bOSRetrieved( sal_False ),
+ m_bYPDomainRetrieved( false ),
+ m_bDNSDomainRetrieved( false ),
+ m_bNTDomainRetrieved( false ),
+ m_bHostRetrieved( false ),
+ m_bOSRetrieved( false ),
m_aListenerNotify( aNotifyLink ),
m_aSharePointsNodeName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SharePoints" ))),
m_aDirPropertyName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/Directory" ))),
@@ -302,10 +303,9 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu
// We have found an active rule
aActiveRule.aSubstVariable = aSharePointNames[ nSharePoints ];
aSubstVarMap.insert( SubstituteVariables::value_type(
- aActiveRule.aSubstVariable, aActiveRule ));
+ aActiveRule.aSubstVariable, aActiveRule ));
}
}
-
++nSharePoints;
}
}
@@ -322,7 +322,7 @@ void SubstitutePathVariables_Impl::Commit()
//_________________________________________________________________________________________________________________
-// private methods
+// private methods
//_________________________________________________________________________________________________________________
//
@@ -407,18 +407,19 @@ const rtl::OUString& SubstitutePathVariables_Impl::GetHostName()
return m_aHost;
}
-sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )
+bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )
{
- sal_Bool bResult = sal_False;
+ bool bResult = sal_False;
if ( !aRuleSet.empty() )
{
- sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
const sal_uInt32 nCount = aRuleSet.size();
+
+ sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ )
{
const SubstituteRule& aRule = aRuleSet[nIndex];
- EnvironmentType eEnvType = aRule.aEnvType;
+ EnvironmentType eEnvType = aRule.aEnvType;
// Check if environment type has a higher priority than current one!
if ( nPrioCurrentRule > aEnvPrioTable[eEnvType] )
@@ -433,13 +434,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
aHostStr = aHostStr.toAsciiLowerCase();
// Pattern match if domain environment match
- WildCard aPattern(aHostStr);
- sal_Bool bMatch = aPattern.Matches(aHost);
+ WildCard aPattern(aHostStr);
+ bool bMatch = aPattern.Matches(aHost);
if ( bMatch )
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
@@ -462,13 +463,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
aDomain = GetNTDomainName();
// Pattern match if domain environment match
- WildCard aPattern(aDomainStr);
- sal_Bool bMatch = aPattern.Matches(aDomain);
+ WildCard aPattern(aDomainStr);
+ bool bMatch = aPattern.Matches(aDomain);
if ( bMatch )
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
@@ -481,24 +482,24 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
sal_Int16 nValue = 0;
aRule.aEnvValue >>= nValue;
- sal_Bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS );
+ bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS );
OperatingSystem eRuleOSType = (OperatingSystem)nValue;
// Match if OS identical or rule is set to UNIX and OS is LINUX/SOLARIS!
if (( eRuleOSType == eOSType ) || ( eRuleOSType == OS_UNIX && bUnix ))
{
- aActiveRule = aRule;
- bResult = sal_True;
- nPrioCurrentRule = aEnvPrioTable[eEnvType];
+ aActiveRule = aRule;
+ bResult = true;
+ nPrioCurrentRule = aEnvPrioTable[eEnvType];
}
}
break;
- case ET_UNKNOWN: // nothing to do
- break;
+ case ET_UNKNOWN: // nothing to do
+ break;
- default:
- break;
+ default:
+ break;
}
}
}
@@ -514,9 +515,9 @@ void SubstitutePathVariables_Impl::ReadSharePointsFromConfiguration( Sequence< r
}
void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
- const rtl::OUString& aSharePointName,
- const rtl::OUString& aSharePointNodeName,
- SubstituteRuleVector& rRuleSet )
+ const rtl::OUString& aSharePointName,
+ const rtl::OUString& aSharePointNodeName,
+ SubstituteRuleVector& rRuleSet )
{
Sequence< rtl::OUString > aSharePointMappingsNodeNames = GetNodeNames( aSharePointNodeName, utl::CONFIG_NAME_LOCAL_PATH );
@@ -569,7 +570,7 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
}
// Decode the environment and optional the operatng system settings
- Any aEnvValue;
+ Any aEnvValue;
EnvironmentType eEnvType = GetEnvTypeFromString( aEnvUsed );
if ( eEnvType == ET_OS )
{
@@ -588,13 +589,12 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
}
//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
+// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
- ::cppu::OWeakObject ,
- SERVICENAME_SUBSTITUTEPATHVARIABLES ,
- IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES
- )
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
+ ::cppu::OWeakObject ,
+ SERVICENAME_SUBSTITUTEPATHVARIABLES ,
+ IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES )
DEFINE_INIT_SERVICE ( SubstitutePathVariables, {} )
@@ -626,16 +626,15 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
// Sort predefined/fixed variable to path length
for ( i = 0; i < PREDEFVAR_COUNT; i++ )
{
- if (( i != PREDEFVAR_WORKDIRURL ) &&
- ( i != PREDEFVAR_PATH ))
+ if (( i != PREDEFVAR_WORKDIRURL ) && ( i != PREDEFVAR_PATH ))
{
// Special path variables, don't include into automatic resubstituion search!
// $(workdirurl) is not allowed to resubstitute! This variable is the value of path settings entry
// and it could be possible that it will be resubstituted by itself!!
// Example: WORK_PATH=c:\test, $(workdirurl)=WORK_PATH => WORK_PATH=$(workdirurl) and this cannot be substituted!
ReSubstFixedVarOrder aFixedVar;
- aFixedVar.eVariable = aFixedVarTable[i].nEnumValue;
- aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength();
+ aFixedVar.eVariable = aFixedVarTable[i].nEnumValue;
+ aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength();
m_aReSubstFixedVarOrder.push_back( aFixedVar );
}
}
@@ -650,8 +649,8 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
aStrBuffer.append( m_aVarStart );
aStrBuffer.append( pIter->second.aSubstVariable );
aStrBuffer.append( m_aVarEnd );
- aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear();
- aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength();
+ aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear();
+ aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength();
m_aReSubstUserVarOrder.push_back( aUserOrderVar );
}
m_aReSubstUserVarOrder.sort();
@@ -687,7 +686,7 @@ throw ( NoSuchElementException, RuntimeException )
}
//_________________________________________________________________________________________________________________
-// protected methods
+// protected methods
//_________________________________________________________________________________________________________________
//
@@ -702,7 +701,7 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo
rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" );
- String aResult;
+ String aResult;
rtl::OUString aTemp;
osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp );
@@ -718,7 +717,7 @@ rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString&
rtl::OUString SubstitutePathVariables::GetWorkPath() const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkPath" );
- rtl::OUString aWorkPath;
+ rtl::OUString aWorkPath;
::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
@@ -739,7 +738,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
::rtl::OUString::createFromAscii("Work"),
::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
- // fallback to $HOME in case platform dependend config layer does not return
+ // fallback to $HOME in case platform dependend config layer does not return
// an usuable work dir value.
if (aWorkPath.getLength() < 1)
{
@@ -773,7 +772,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
rtl::OUString aPathList( pEnv, strlen( pEnv ), gsl_getSystemTextEncoding() );
rtl::OUStringBuffer aPathStrBuffer( aPathList.getLength() * PATH_EXTEND_FACTOR / 100 );
- sal_Bool bAppendSep = sal_False;
+ bool bAppendSep = false;
sal_Int32 nToken = 0;
do
{
@@ -784,7 +783,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
if ( bAppendSep )
aPathStrBuffer.appendAscii( ";" ); // Office uses ';' as path separator
aPathStrBuffer.append( aTmp );
- bAppendSep = sal_True;
+ bAppendSep = true;
}
}
while(nToken>=0);
@@ -795,7 +794,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
return aRetStr;
}
-rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired )
+rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" );
@@ -811,9 +810,9 @@ throw ( NoSuchElementException, RuntimeException )
// Search for first occure of "$(...".
sal_Int32 nDepth = 0;
sal_Int32 bSubstitutionCompleted = sal_False;
- sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string
+ sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string
sal_Int32 nLength = 0; // = count of letters from "$(" to ")" in string
- sal_Bool bVarNotSubstituted = sal_False;
+ bool bVarNotSubstituted = false;
// Have we found any variable like "$(...)"?
if ( nPosition != STRPOS_NOTFOUND )
@@ -826,17 +825,17 @@ throw ( NoSuchElementException, RuntimeException )
}
// Is there something to replace ?
- sal_Bool bWorkRetrieved = sal_False;
- sal_Bool bWorkDirURLRetrieved = sal_False;
+ bool bWorkRetrieved = false;
+ bool bWorkDirURLRetrieved = false;
while ( !bSubstitutionCompleted && nDepth < nMaxRecursiveDepth )
{
while ( ( nPosition != STRPOS_NOTFOUND ) && ( nLength > 3 ) ) // "$(" ")"
{
// YES; Get the next variable for replace.
- sal_Int32 nReplaceLength = 0;
- rtl::OUString aReplacement;
- rtl::OUString aSubString = aWorkText.copy( nPosition, nLength );
- rtl::OUString aSubVarString;
+ sal_Int32 nReplaceLength = 0;
+ rtl::OUString aReplacement;
+ rtl::OUString aSubString = aWorkText.copy( nPosition, nLength );
+ rtl::OUString aSubVarString;
// Path variables are not case sensitive!
aSubVarString = aSubString.toAsciiLowerCase();
@@ -851,17 +850,24 @@ throw ( NoSuchElementException, RuntimeException )
{
// Transient value, retrieve it again
m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkVariableValue();
- bWorkRetrieved = sal_True;
+ bWorkRetrieved = true;
}
else if ( nIndex == PREDEFVAR_WORKDIRURL && !bWorkDirURLRetrieved )
{
// Transient value, retrieve it again
m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkPath();
- bWorkDirURLRetrieved = sal_True;
+ bWorkDirURLRetrieved = true;
}
- aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ];
- nReplaceLength = nLength;
+ // Check preconditions to substitue path variables.
+ // 1. A path variable can only be substituted if it follows a SEARCHPATH_DELIMITER ';'!
+ // 2. It's located exactly at the start of the string being substituted!
+ if (( aFixedVarTable[ int( nIndex ) ].bAbsPath && (( nPosition == 0 ) || (( nPosition > 0 ) && ( aWorkText[nPosition-1] == ';')))) ||
+ ( !aFixedVarTable[ int( nIndex ) ].bAbsPath ))
+ {
+ aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ];
+ nReplaceLength = nLength;
+ }
}
else
{
@@ -870,7 +876,7 @@ throw ( NoSuchElementException, RuntimeException )
SubstituteVariables::const_iterator pIter = m_aSubstVarMap.find( aVarName );
if ( pIter != m_aSubstVarMap.end() )
{
- // found!
+ // Found.
aReplacement = pIter->second.aSubstValue;
nReplaceLength = nLength;
}
@@ -885,7 +891,7 @@ throw ( NoSuchElementException, RuntimeException )
else
{
// Variable not known
- bVarNotSubstituted = sal_False;
+ bVarNotSubstituted = false;
nPosition += nLength;
}
@@ -1017,8 +1023,8 @@ throw ( RuntimeException )
}
// Due to a recursive definition this code must exchange variables with variables!
- sal_Bool bResubstitutionCompleted = sal_False;
- sal_Bool bVariableFound = sal_False;
+ bool bResubstitutionCompleted = false;
+ bool bVariableFound = false;
// Get transient predefined path variable $(work) value before starting resubstitution
m_aPreDefVars.m_FixedVar[ PREDEFVAR_WORK ] = GetWorkVariableValue();
@@ -1032,7 +1038,7 @@ throw ( RuntimeException )
sal_Int32 nPos = aURL.indexOf( aValue );
if ( nPos >= 0 )
{
- sal_Bool bMatch = sal_True;
+ bool bMatch = true;
if ( pIterFixed->eVariable == PREDEFVAR_LANG ||
pIterFixed->eVariable == PREDEFVAR_LANGID ||
pIterFixed->eVariable == PREDEFVAR_VLANG )
@@ -1058,7 +1064,7 @@ throw ( RuntimeException )
aStrBuffer.append( m_aPreDefVars.m_FixedVarNames[ (sal_Int32)pIterFixed->eVariable ] ); // Get the variable name for struct var name array!
aStrBuffer.append( aURL.copy( nPos + aValue.getLength(), ( aURL.getLength() - ( nPos + aValue.getLength() )) ));
aURL = aStrBuffer.makeStringAndClear();
- bVariableFound = sal_True; // Resubstitution not finished yet!
+ bVariableFound = true; // Resubstitution not finished yet!
break;
}
}
@@ -1079,12 +1085,12 @@ throw ( RuntimeException )
aStrBuffer.append( m_aVarEnd );
aStrBuffer.append( aURL.copy( nPos + aVarValue.getLength(), ( aURL.getLength() - ( nPos + aVarValue.getLength() )) ));
aURL = aStrBuffer.makeStringAndClear();
- bVariableFound = sal_True; // Resubstitution not finished yet!
+ bVariableFound = true; // Resubstitution not finished yet!
}
}
if ( !bVariableFound )
- bResubstitutionCompleted = sal_True;
+ bResubstitutionCompleted = true;
else
bVariableFound = sal_False; // Next resubstitution
}
@@ -1150,7 +1156,7 @@ throw ( NoSuchElementException, RuntimeException )
void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" );
- Any aAny;
+ Any aAny;
::rtl::OUString aOfficePath;
::rtl::OUString aUserPath;
::rtl::OUString aTmp;
@@ -1194,14 +1200,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Detect the program directory
// Set $(prog), $(progpath), $(progurl)
INetURLObject aProgObj(
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] );
- if ( !aProgObj.HasError() &&
- aProgObj.insertName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) )
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] );
+ if ( !aProgObj.HasError() && aProgObj.insertName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) )
{
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE);
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
- aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE);
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
+ aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ];
}
// Detect the language type of the current office
@@ -1216,7 +1220,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Set $(lang)
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_LANG ] = ConvertOSLtoUCBURL(
- rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) ));
+ rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) ));
+
// Set $(vlang)
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_VLANG ] = aLocaleStr;
@@ -1241,7 +1246,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
aPreDefPathVariables.m_FixedVar[ PREDEFVAR_TEMP ] = ConvertOSLtoUCBURL( aTmp );
aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR"));
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR"));
rtl::Bootstrap::expandMacros(
aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL]);
}
diff --git a/graphite/graphite-2.3.1_debug.patch b/graphite/graphite-2.3.1_debug.patch
new file mode 100644
index 000000000000..583fac711e2b
--- /dev/null
+++ b/graphite/graphite-2.3.1_debug.patch
@@ -0,0 +1,13 @@
+--- misc/silgraphite-2.3.1/engine/src/segment/SegmentAux.cpp 2008-08-21 16:24:32.000000000 +0200
++++ misc/build/silgraphite-2.3.1/engine/src/segment/SegmentAux.cpp 2011-02-21 13:22:23.159834368 +0100
+@@ -247,7 +247,9 @@
+ GlyphSetIterator::reference GlyphSetIterator::operator*() const
+ {
+ assert(m_pseg != 0);
+- assert(m_vit != std::vector<int>::const_iterator());
++ // #i116227# the check below is well meant but breaks itself when using stlport with debug facilities
++ // a valid iterator cannot be compared to an empty one in that case
++ // assert(m_vit != std::vector<int>::const_iterator());
+ // in the case of a non-contiguous list
+ return m_pseg->m_prgginf[(*m_vit) - m_pseg->m_isloutGinf0];
+ }
diff --git a/graphite/makefile.mk b/graphite/makefile.mk
index b9ecb7aea396..f4434909bfe4 100644
--- a/graphite/makefile.mk
+++ b/graphite/makefile.mk
@@ -47,7 +47,7 @@ all:
.IF "$(ENABLE_GRAPHITE)"=="TRUE"
TARFILE_NAME=silgraphite-2.3.1
TARFILE_MD5=d35724900f6a4105550293686688bbb3
-PATCH_FILES=graphite-2.3.1.patch
+PATCH_FILES=graphite-2.3.1.patch graphite-2.3.1_debug.patch
# convert line-endings to avoid problems when patching
CONVERTFILES=\
diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx
index 47eaa802b28d..41451ee9060f 100644
--- a/idlc/inc/idlc/idlctypes.hxx
+++ b/idlc/inc/idlc/idlctypes.hxx
@@ -32,7 +32,9 @@
#include <hash_map>
#include <list>
#include <vector>
+#include <string>
#include <set>
+
#include <sal/types.h>
#include <rtl/ustring.hxx>
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index 7eba788a4ea9..383150bd4b40 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -50,18 +50,29 @@ public:
class Options
{
public:
- Options();
+ explicit Options(char const * progname);
~Options();
+ static bool checkArgument(std::vector< std::string > & rArgs, char const * arg, size_t len);
+ static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename);
+
+ bool initOptions(std::vector< std::string > & rArgs)
+ throw(IllegalArgument);
+ bool badOption(char const * reason, std::string const & rArg)
+ throw(IllegalArgument);
+ bool setOption(char const * option, std::string const & rArg);
+
+#if 0 /* @@@ */
sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False)
throw( IllegalArgument );
+#endif /* @@@ */
::rtl::OString prepareHelp();
::rtl::OString prepareVersion();
const ::rtl::OString& getProgramName() const;
- sal_Bool isValid(const ::rtl::OString& option);
- const ::rtl::OString getOption(const ::rtl::OString& option)
+ bool isValid(const ::rtl::OString& option);
+ const ::rtl::OString& getOption(const ::rtl::OString& option)
throw( IllegalArgument );
const StringVector& getInputFiles() const { return m_inputFiles; }
diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index a93c13ecf8ba..357da1ab362e 100644
--- a/idlc/source/astexpression.cxx
+++ b/idlc/source/astexpression.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idlc.hxx"
+
#include <idlc/astexpression.hxx>
#include <idlc/astconstant.hxx>
#include <idlc/astscope.hxx>
@@ -34,6 +35,7 @@
#include <limits.h>
#include <float.h>
+#include <memory> // auto_ptr<>
#undef MAXCHAR
#define MAXCHAR 127
@@ -927,7 +929,6 @@ AstExprValue* AstExpression::eval_internal(EvalKind ek)
AstExprValue* AstExpression::eval_bin_op(EvalKind ek)
{
- AstExprValue *retval = NULL;
ExprType eType = ET_double;
if ( m_combOperator == EC_mod )
@@ -950,7 +951,7 @@ AstExprValue* AstExpression::eval_bin_op(EvalKind ek)
if (m_subExpr2->getExprValue() == NULL)
return NULL;
- retval = new AstExprValue();
+ std::auto_ptr< AstExprValue > retval(new AstExprValue());
retval->et = eType;
switch (m_combOperator)
@@ -971,20 +972,18 @@ AstExprValue* AstExpression::eval_bin_op(EvalKind ek)
break;
case EC_div:
if (m_subExpr2->getExprValue()->u.dval == 0.0)
- return NULL;
+ return NULL;
retval->u.dval = m_subExpr1->getExprValue()->u.dval / m_subExpr2->getExprValue()->u.dval;
break;
default:
return NULL;
}
- return retval;
+ return retval.release();
}
AstExprValue* AstExpression::eval_bit_op(EvalKind ek)
{
- AstExprValue *retval = NULL;
-
if (ek != EK_const && ek != EK_positive_int)
return NULL;
if (m_subExpr1 == NULL || m_subExpr2 == NULL)
@@ -1002,7 +1001,7 @@ AstExprValue* AstExpression::eval_bit_op(EvalKind ek)
if (m_subExpr2->getExprValue() == NULL)
return NULL;
- retval = new AstExprValue;
+ std::auto_ptr< AstExprValue > retval(new AstExprValue());
retval->et = ET_long;
switch (m_combOperator)
@@ -1026,13 +1025,11 @@ AstExprValue* AstExpression::eval_bit_op(EvalKind ek)
return NULL;
}
- return retval;
+ return retval.release();
}
AstExprValue* AstExpression::eval_un_op(EvalKind ek)
{
- AstExprValue *retval = NULL;
-
if (m_exprValue != NULL)
return m_exprValue;
@@ -1047,7 +1044,7 @@ AstExprValue* AstExpression::eval_un_op(EvalKind ek)
if (m_subExpr1->getExprValue() == NULL)
return NULL;
- retval = new AstExprValue();
+ std::auto_ptr< AstExprValue > retval(new AstExprValue());
retval->et = ET_double;
switch (m_combOperator)
@@ -1068,7 +1065,7 @@ AstExprValue* AstExpression::eval_un_op(EvalKind ek)
return NULL;
}
- return retval;
+ return retval.release();
}
AstExprValue* AstExpression::eval_symbol(EvalKind ek)
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx
index 006131f727df..cc2963f5f446 100644
--- a/idlc/source/idlcmain.cxx
+++ b/idlc/source/idlcmain.cxx
@@ -27,26 +27,35 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idlc.hxx"
-#include <idlc/idlc.hxx>
+
+#include "idlc/idlc.hxx"
#include "sal/main.h"
+#include <string.h>
+
using namespace ::rtl;
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
- Options options;
+ std::vector< std::string > args;
+ for (int i = 1; i < argc; i++)
+ {
+ if (!Options::checkArgument (args, argv[i], strlen(argv[i])))
+ return (1);
+ }
+ Options options(argv[0]);
try
{
- if (!options.initOptions(argc, argv))
- exit(1);
+ if (!options.initOptions(args))
+ return (0);
}
catch( IllegalArgument& e)
{
fprintf(stderr, "Illegal argument: %s\n%s",
e.m_message.getStr(),
options.prepareVersion().getStr());
- exit(99);
+ return (99);
}
setIdlc(&options);
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index c90bce43b3bc..310afa2a4d60 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -28,13 +28,26 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idlc.hxx"
+#include "idlc/options.hxx"
+
+#include "osl/diagnose.h"
+#include "rtl/string.hxx"
+#include "rtl/strbuf.hxx"
+
#include <stdio.h>
-#include /*MSVC trouble: <cstring>*/ <string.h>
-#include <idlc/options.hxx>
+#include <string.h>
+
+using rtl::OString;
+using rtl::OStringBuffer;
-using namespace rtl;
+#ifdef SAL_UNX
+#define SEPARATOR '/'
+#else
+#define SEPARATOR '\\'
+#endif
-Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false)
+Options::Options(char const * progname)
+ : m_program(progname), m_stdin(false), m_verbose(false), m_quiet(false)
{
}
@@ -42,273 +55,282 @@ Options::~Options()
{
}
-sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
- throw( IllegalArgument )
+// static
+bool Options::checkArgument (std::vector< std::string > & rArgs, char const * arg, size_t len)
{
- sal_Bool ret = sal_True;
- sal_uInt16 j=0;
-
- if (!bCmdFile)
+ bool result = ((arg != 0) && (len > 0));
+ OSL_PRECOND(result, "idlc::Options::checkArgument(): invalid arguments");
+ if (result)
+ {
+ switch(arg[0])
{
- bCmdFile = sal_True;
-
- m_program = av[0];
-
- if (ac < 2)
+ case '@':
+ if ((result = (len > 1)) == true)
+ {
+ // "@<cmdfile>"
+ result = Options::checkCommandFile (rArgs, &(arg[1]));
+ }
+ break;
+ case '-':
+ if ((result = (len > 1)) == true)
+ {
+ // "-<option>"
+ switch (arg[1])
{
- fprintf(stderr, "%s", prepareHelp().getStr());
- ret = sal_False;
+ case 'O':
+ case 'I':
+ case 'D':
+ {
+ // "-<option>[<param>]
+ std::string option(&(arg[0]), 2);
+ rArgs.push_back(option);
+ if (len > 2)
+ {
+ // "-<option><param>"
+ std::string param(&(arg[2]), len - 2);
+ rArgs.push_back(param);
+ }
+ break;
+ }
+ default:
+ // "-<option>" ([long] option, w/o param)
+ rArgs.push_back(std::string(arg, len));
+ break;
}
+ }
+ break;
+ default:
+ // "<param>"
+ rArgs.push_back(std::string(arg, len));
+ break;
+ }
+ }
+ return (result);
+}
- j = 1;
- } else
+// static
+bool Options::checkCommandFile (std::vector< std::string > & rArgs, char const * filename)
+{
+ FILE * fp = fopen(filename, "r");
+ if (fp == 0)
{
- j = 0;
+ fprintf(stderr, "ERROR: can't open command file \"%s\"\n", filename);
+ return (false);
}
- char *s=NULL;
- for (; j < ac; j++)
+ std::string buffer;
+ buffer.reserve(256);
+
+ bool quoted = false;
+ int c = EOF;
+ while ((c = fgetc(fp)) != EOF)
{
- if (av[j][0] == '-')
+ switch(c)
{
- switch (av[j][1])
- {
- case 'O':
- if (av[j][2] == '\0')
- {
- if (j < ac - 1 && av[j+1][0] != '-')
- {
- j++;
- s = av[j];
- } else
- {
- OString tmp("'-O', please check");
- if (j <= ac - 1)
- {
- tmp += " your input '" + OString(av[j+1]) + "'";
- }
-
- throw IllegalArgument(tmp);
- }
- } else
- {
- s = av[j] + 2;
- }
-
- m_options["-O"] = OString(s);
- break;
- case 'I':
- {
- if (av[j][2] == '\0')
- {
- if (j < ac - 1 && av[j+1][0] != '-')
- {
- j++;
- s = av[j];
- } else
- {
- OString tmp("'-I', please check");
- if (j <= ac - 1)
- {
- tmp += " your input '" + OString(av[j+1]) + "'";
- }
-
- throw IllegalArgument(tmp);
- }
- } else
- {
- s = av[j] + 2;
- }
+ case '\"':
+ quoted = !quoted;
+ break;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ if (!quoted)
+ {
+ if (!buffer.empty())
+ {
+ // append current argument.
+ if (!Options::checkArgument(rArgs, buffer.c_str(), buffer.size()))
+ {
+ (void) fclose(fp);
+ return (false);
+ }
+ buffer.clear();
+ }
+ break;
+ }
+ default:
+ // quoted white-space fall through
+ buffer.push_back(sal::static_int_cast<char>(c));
+ break;
+ }
+ }
+ if (!buffer.empty())
+ {
+ // append unterminated argument.
+ if (!Options::checkArgument(rArgs, buffer.c_str(), buffer.size()))
+ {
+ (void) fclose(fp);
+ return (false);
+ }
+ buffer.clear();
+ }
+ return (fclose(fp) == 0);
+}
- OString inc(s);
- if ( inc.indexOf(';') > 0 )
- {
- OString tmp(s);
- sal_Int32 nIndex = 0;
- inc = OString();
- do inc = inc + " -I\"" + tmp.getToken( 0, ';', nIndex ) +"\""; while( nIndex != -1 );
- } else
- inc = OString("-I\"") + s + "\"";
+bool Options::badOption(char const * reason, std::string const & rArg) throw(IllegalArgument)
+{
+ OStringBuffer message;
+ if (reason != 0)
+ {
+ message.append(reason); message.append(" option '"); message.append(rArg.c_str()); message.append("'");
+ throw IllegalArgument(message.makeStringAndClear());
+ }
+ return false;
+}
- if (m_options.count("-I") > 0)
- {
- OString tmp(m_options["-I"]);
- tmp = tmp + " " + inc;
- m_options["-I"] = tmp;
- } else
- {
- m_options["-I"] = inc;
- }
- }
- break;
- case 'D':
- if (av[j][2] == '\0')
- {
- if (j < ac - 1 && av[j+1][0] != '-')
- {
- j++;
- s = av[j];
- } else
- {
- OString tmp("'-D', please check");
- if (j <= ac - 1)
- {
- tmp += " your input '" + OString(av[j+1]) + "'";
- }
+bool Options::setOption(char const * option, std::string const & rArg)
+{
+ bool result = (0 == strcmp(option, rArg.c_str()));
+ if (result)
+ m_options[rArg.c_str()] = OString(rArg.c_str(), rArg.size());
+ return (result);
+}
- throw IllegalArgument(tmp);
- }
- } else
- {
- s = av[j];
- }
+bool Options::initOptions(std::vector< std::string > & rArgs) throw(IllegalArgument)
+{
+ std::vector< std::string >::const_iterator first = rArgs.begin(), last = rArgs.end();
+ for (; first != last; ++first)
+ {
+ if ((*first)[0] != '-')
+ {
+ OString filename((*first).c_str(), (*first).size());
+ OString tmp(filename.toAsciiLowerCase());
+ if (tmp.lastIndexOf(".idl") != (tmp.getLength() - 4))
+ {
+ throw IllegalArgument("'" + filename + "' is not a valid input file, only '*.idl' files will be accepted");
+ }
+ m_inputFiles.push_back(filename);
+ continue;
+ }
- if (m_options.count("-D") > 0)
- {
- OString tmp(m_options["-D"]);
- tmp = tmp + " " + s;
- m_options["-D"] = tmp;
- } else
- m_options["-D"] = OString(s);
- break;
- case 'C':
- if (av[j][2] != '\0')
- {
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- }
- if (m_options.count("-C") == 0)
- m_options["-C"] = OString(av[j]);
- break;
- case 'c':
- if (av[j][2] == 'i' && av[j][3] == 'd' && av[j][4] == '\0')
- {
- if (m_options.count("-cid") == 0)
- m_options["-cid"] = OString(av[j]);
- } else
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- break;
- case 'v':
- if ( 0 == strcmp( &av[j][1], "verbose" ) )
- {
- m_verbose = true;
- }
- else
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- break;
- case 'q':
- if ( 0 == strcmp( &av[j][1], "quiet" ) )
- {
- m_quiet = true;
- }
- else
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- break;
- case 'w':
- if (av[j][2] == 'e' && av[j][3] == '\0') {
- if (m_options.count("-we") == 0)
- m_options["-we"] = OString(av[j]);
- } else {
- if (av[j][2] == '\0') {
- if (m_options.count("-w") == 0)
- m_options["-w"] = OString(av[j]);
- } else
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- }
- break;
- case 'h':
- case '?':
- if (av[j][2] != '\0')
- {
- throw IllegalArgument(OString(av[j]) + ", please check your input");
- } else
- {
- fprintf(stdout, "%s", prepareHelp().getStr());
- exit(0);
- }
- case 's':
- if (/*MSVC trouble: std::*/strcmp(&av[j][2], "tdin") == 0)
- {
- m_stdin = true;
- break;
- }
- // fall through
- default:
- throw IllegalArgument("the option is unknown" + OString(av[j]));
- }
- } else
+ std::string const option(*first);
+ switch((*first)[1])
+ {
+ case 'O':
+ {
+ if (!((++first != last) && ((*first)[0] != '-')))
{
- if (av[j][0] == '@')
- {
- FILE* cmdFile = fopen(av[j]+1, "r");
- if( cmdFile == NULL )
- {
- fprintf(stderr, "%s", prepareHelp().getStr());
- ret = sal_False;
- } else
- {
- int rargc=0;
- char* rargv[512];
- char buffer[512]="";
-
- int i=0;
- int found = 0;
- char c;
- while ( fscanf(cmdFile, "%c", &c) != EOF )
- {
- if (c=='\"') {
- if (found) {
- found=0;
- } else {
- found=1;
- continue;
- }
- } else {
- if (c!=13 && c!=10) {
- if (found || c!=' ') {
- buffer[i++]=c;
- continue;
- }
- }
- if (i==0)
- continue;
- }
- buffer[i]='\0';
- found=0;
- i=0;
- rargv[rargc]= strdup(buffer);
- rargc++;
- buffer[0]='\0';
- }
- if (buffer[0] != '\0') {
- buffer[i]='\0';
- rargv[rargc]= strdup(buffer);
- rargc++;
- }
- fclose(cmdFile);
-
- ret = initOptions(rargc, rargv, bCmdFile);
-
- long ii = 0;
- for (ii=0; ii < rargc; ii++)
- {
- free(rargv[ii]);
- }
- }
- } else
- {
- OString name(av[j]);
- name = name.toAsciiLowerCase();
- if ( name.lastIndexOf(".idl") != (name.getLength() - 4) )
- {
- throw IllegalArgument("'" + OString(av[j]) +
- "' is not a valid input file, only '*.idl' files will be accepted");
- }
- m_inputFiles.push_back(av[j]);
- }
+ return badOption("invalid", option);
+ }
+ OString param((*first).c_str(), (*first).size());
+ m_options["-O"] = param;
+ break;
+ }
+ case 'I':
+ {
+ if (!((++first != last) && ((*first)[0] != '-')))
+ {
+ return badOption("invalid", option);
+ }
+ OString param((*first).c_str(), (*first).size());
+ {
+ // quote param token(s).
+ OStringBuffer buffer;
+ sal_Int32 k = 0;
+ do
+ {
+ OStringBuffer token; token.append("-I\""); token.append(param.getToken(0, ';', k)); token.append("\"");
+ if (buffer.getLength() > 0)
+ buffer.append(' ');
+ buffer.append(token);
+ } while (k != -1);
+ param = buffer.makeStringAndClear();
+ }
+ if (m_options.count("-I") > 0)
+ {
+ // append param.
+ OStringBuffer buffer(m_options["-I"]);
+ buffer.append(' '); buffer.append(param);
+ param = buffer.makeStringAndClear();
+ }
+ m_options["-I"] = param;
+ break;
+ }
+ case 'D':
+ {
+ if (!((++first != last) && ((*first)[0] != '-')))
+ {
+ return badOption("invalid", option);
+ }
+ OString param("-D"); param += OString((*first).c_str(), (*first).size());
+ if (m_options.count("-D") > 0)
+ {
+ OStringBuffer buffer(m_options["-D"]);
+ buffer.append(' '); buffer.append(param);
+ param = buffer.makeStringAndClear();
}
+ m_options["-D"] = param;
+ break;
+ }
+ case 'C':
+ {
+ if (!setOption("-C", option))
+ {
+ return badOption("invalid", option);
+ }
+ break;
+ }
+ case 'c':
+ {
+ if (!setOption("-cid", option))
+ {
+ return badOption("invalid", option);
+ }
+ break;
+ }
+ case 'q':
+ {
+ if (!setOption("-quiet", option))
+ {
+ return badOption("invalid", option);
+ }
+ m_quiet = true;
+ break;
+ }
+ case 'v':
+ {
+ if (!setOption("-verbose", option))
+ {
+ return badOption("invalid", option);
+ }
+ m_verbose = true;
+ break;
+ }
+ case 'w':
+ {
+ if (!(setOption("-w", option) || setOption("-we", option)))
+ {
+ return badOption("invalid", option);
+ }
+ break;
+ }
+ case 'h':
+ case '?':
+ {
+ if (!(setOption("-h", option) || setOption("-?", option)))
+ {
+ return badOption("invalid", option);
+ }
+ {
+ (void) fprintf(stdout, "%s", prepareHelp().getStr());
+ return (false);
+ }
+ // break; // Unreachable
+ }
+ case 's':
+ {
+ if (!setOption("-stdin", option))
+ {
+ return badOption("invalid", option);
+ }
+ m_stdin = true;
+ break;
+ }
+ default:
+ return badOption("unknown", option);
}
-
- return ret;
+ }
+ return (true);
}
OString Options::prepareHelp()
@@ -335,7 +357,7 @@ OString Options::prepareHelp()
help += " requirements.\n";
help += " -w = display warning messages.\n";
help += " -we = treat warnings as errors.\n";
- help += " -h|-? = print this help message and exit.\n";
+ help += " -h|-? = print this help message and exit.\n\n";
help += prepareVersion();
return help;
@@ -343,8 +365,8 @@ OString Options::prepareHelp()
OString Options::prepareVersion()
{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 1.1\n\n";
+ OString version(m_program);
+ version += " Version 1.1\n\n";
return version;
}
@@ -353,19 +375,18 @@ const OString& Options::getProgramName() const
return m_program;
}
-sal_Bool Options::isValid(const OString& option)
+bool Options::isValid(const OString& option)
{
return (m_options.count(option) > 0);
}
-const OString Options::getOption(const OString& option)
+const OString& Options::getOption(const OString& option)
throw( IllegalArgument )
{
- if (m_options.count(option) > 0)
- {
- return m_options[option];
- } else
+ if (!isValid(option))
{
throw IllegalArgument("Option is not valid or currently not set.");
}
+ return m_options[option];
}
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/idlc/source/preproc/eval.c b/idlc/source/preproc/eval.c
index cd3adc2204c7..bed61eb95f00 100644
--- a/idlc/source/preproc/eval.c
+++ b/idlc/source/preproc/eval.c
@@ -24,9 +24,11 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
+#include "cpp.h"
+
#include <stdlib.h>
#include <string.h>
-#include "cpp.h"
#define NSTAK 32
#define SGN 0
@@ -736,10 +738,10 @@ struct value
}
else
{
- static char cvcon[]
- = "b\bf\fn\nr\rt\tv\v''\"\"??\\\\";
+ static char cvcon[] = "b\bf\fn\nr\rt\tv\v''\"\"??\\\\";
+ static int cvlen = sizeof(cvcon) - 1;
- for (i = 0; i < (int)sizeof(cvcon); i += 2)
+ for (i = 0; i < cvlen; i += 2)
{
if (*p == cvcon[i])
{
@@ -748,9 +750,8 @@ struct value
}
}
p += 1;
- if (i >= (int)sizeof(cvcon))
- error(WARNING,
- "Undefined escape in character constant");
+ if (i >= cvlen)
+ error(WARNING,"Undefined escape in character constant");
}
}
else
diff --git a/idlc/source/preproc/lex.c b/idlc/source/preproc/lex.c
index fd6d00792984..856ee72bfc53 100644
--- a/idlc/source/preproc/lex.c
+++ b/idlc/source/preproc/lex.c
@@ -290,7 +290,7 @@ void
bigfsm[j][fp->state] = (short) nstate;
continue;
case C_ALPH:
- for (j = 0; j <= 256; j++)
+ for (j = 0; j < 256; j++)
if (('a' <= j && j <= 'z') || ('A' <= j && j <= 'Z')
|| j == '_')
bigfsm[j][fp->state] = (short) nstate;
@@ -687,9 +687,13 @@ void
if (s->fd >= 0)
{
- close(s->fd);
- dofree(s->inb);
+ (void) close(s->fd);
+ dofree(s->filename);
}
+
+ if (s->inb)
+ dofree(s->inb);
+
cursource = s->next;
dofree(s);
}
diff --git a/idlc/source/preproc/unix.c b/idlc/source/preproc/unix.c
index 4997e317e697..808b1d90dbd3 100644
--- a/idlc/source/preproc/unix.c
+++ b/idlc/source/preproc/unix.c
@@ -91,6 +91,7 @@ void
maketokenrow(3, &tr);
gettokens(&tr, 1);
doadefine(&tr, c);
+ dofree(tr.bp); tr.bp = 0;
unsetsource();
break;
diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index caf297c6c470..8ea316d1baa2 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -6,7 +6,7 @@ Globals
{
OOOBASEVERSION 3.4
OOOPACKAGEVERSION 3.4.0
- UREPACKAGEVERSION 1.8.0
+ UREPACKAGEVERSION 3.4.0
URELAYERVERSION 1
BASISROOTNAME OpenOffice.org
UNIXBASISROOTNAME openoffice.org
@@ -23,7 +23,7 @@ Globals
USE_FILEVERSION 1
LIBRARYVERSION 9.4.0
POOLPRODUCT 1
- REGISTRATION_HOST https://registration2.services.openoffice.org/RegistrationWeb
+ REGISTRATION_HOST https://hs-ws1.oracle.com/RegistrationWeb
REGISTRATIONURL http://survey.services.openoffice.org/user/index.php
PROGRESSBARCOLOR 14,133,205
PROGRESSSIZE 320,7
@@ -254,8 +254,8 @@ URE
variables
{
PRODUCTNAME URE
- PRODUCTVERSION 1.8
- PACKAGEVERSION 1.8
+ PRODUCTVERSION 3.4
+ PACKAGEVERSION 3.4
PACKAGEREVISION 1
PRODUCTEXTENSION
LONG_PRODUCTEXTENSION
diff --git a/moz/prj/d.lst b/moz/prj/d.lst
index dda8503f5f9d..67bd28bb164b 100644
--- a/moz/prj/d.lst
+++ b/moz/prj/d.lst
@@ -236,5 +236,22 @@ mkdir: %_DEST%\inc%_EXT%\mozilla\xpcom_obsolete
..\%__SRC%\inc\xpnet\* %_DEST%\inc%_EXT%\mozilla\xpnet
..\%__SRC%\inc\zlib\* %_DEST%\inc%_EXT%\mozilla\zlib
..\%__SRC%\inc\xpcom_obsolete\* %_DEST%\inc%_EXT%\mozilla\xpcom_obsolete
-..\%__SRC%\lib\* %_DEST%\lib%_EXT%
+
+..\%__SRC%\lib\libldap50.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libmozjs.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libmozz.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libmsgbaseutil.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libnssckbi.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libnssdbm3.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libnssutil3.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libprldap50.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libxpcom.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libxpcom_compat.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\libxpcom_core.* %_DEST%\lib%_EXT%
+..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%
+..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%
+
+mkdir: %_DEST%\lib%_EXT%\sqlite
+..\%__SRC%\lib\libsqlite3.* %_DEST%\lib%_EXT%\sqlite
+
..\%__SRC%\bin\*.zip %_DEST%\bin%_EXT%
diff --git a/odk/examples/CLI/CSharp/Spreadsheet/Makefile b/odk/examples/CLI/CSharp/Spreadsheet/Makefile
index cbe43167905d..bae593f34069 100644
--- a/odk/examples/CLI/CSharp/Spreadsheet/Makefile
+++ b/odk/examples/CLI/CSharp/Spreadsheet/Makefile
@@ -25,10 +25,7 @@ CLI_LIB_LOCATION = $(PRJ)\cli
# Targets
.PHONY : ALL
-ALL : SpreadsheetSample \
- GeneralTableSample \
- ViewSample \
- Info
+ALL : Info
include $(SETTINGS)/stdtarget.mk
@@ -56,7 +53,8 @@ GeneralTableSample : $(SPREADSHEET_OUT)/GeneralTableSample.exe
ViewSample : $(SPREADSHEET_OUT)/ViewSample.exe
.PHONY : Info
-Info :
+ifeq "$(OS)" "WIN"
+Info : SpreadsheetSample GenerateTableSample ViewSample
@echo -------------------------------------------------------------------------------
@echo Please use one of the following commands to execute the examples!
@echo -
@@ -64,7 +62,12 @@ Info :
@echo $(MAKE) SpreadsheetSample.run
@echo $(MAKE) ViewSample.run
@echo -------------------------------------------------------------------------------
-
+else
+Info :
+ @echo --------------------------------------------------------------------------------
+ @echo This example works only under Windows!
+ @echo --------------------------------------------------------------------------------
+endif
%.run : $(SPREADSHEET_OUT)/%.exe
@echo -------------------------------------------------------------------------------
diff --git a/odk/examples/CLI/VB.NET/WriterDemo/Makefile b/odk/examples/CLI/VB.NET/WriterDemo/Makefile
index ac60d7ef4536..2fd3f993ce2c 100644
--- a/odk/examples/CLI/VB.NET/WriterDemo/Makefile
+++ b/odk/examples/CLI/VB.NET/WriterDemo/Makefile
@@ -42,12 +42,19 @@ $(WRITERDEMO_OUT)/%.exe: %.vb
-reference:System.Windows.Forms.dll \
$^
+ifeq "$(OS)" "WIN"
WriterDemo : $(WRITERDEMO_OUT)/WriterDemo.exe
@echo -------------------------------------------------------------------------------
@echo Please use the following command to execute the example!
@echo -
@echo $(MAKE) WriterDemo.run
@echo -------------------------------------------------------------------------------
+else
+WriterDemo :
+ @echo --------------------------------------------------------------------------------
+ @echo This example works only under Windows!
+ @echo --------------------------------------------------------------------------------
+endif
%.run : $(WRITERDEMO_OUT)/%.exe
@echo -------------------------------------------------------------------------------
diff --git a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components
new file mode 100644
index 000000000000..e9a7baa48056
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="JavaSampleChartAddIn.uno.jar">
+ <implementation name="JavaSampleChartAddIn">
+ <service name="com.sun.star.comp.Chart.JavaSampleChartAddIn"/>
+ <service name="com.sun.star.chart.Diagram"/>
+ <service name="com.sun.star.chart.ChartAxisYSupplier"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
index 10a137a316d5..06239b6c9851 100644
--- a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
+++ b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
@@ -459,18 +459,22 @@ public class JavaSampleChartAddIn extends WeakBase implements
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey regKey )
- {
- boolean bResult = true;
-
- String[] aServices = getSupportedServiceNames_Static();
- int i, nLength = aServices.length;
-
- for( i = 0; i < nLength; ++i )
- {
- bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- JavaSampleChartAddIn.class.getName(), aServices[ i ], regKey );
- }
- return bResult;
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey regKey )
+// {
+// boolean bResult = true;
+
+// String[] aServices = getSupportedServiceNames_Static();
+// int i, nLength = aServices.length;
+
+// for( i = 0; i < nLength; ++i )
+// {
+// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// JavaSampleChartAddIn.class.getName(), aServices[ i ], regKey );
+// }
+// return bResult;
+// }
}
diff --git a/odk/examples/DevelopersGuide/Charts/Makefile b/odk/examples/DevelopersGuide/Charts/Makefile
index f35f8fcbb9f7..d6727662bfbb 100644
--- a/odk/examples/DevelopersGuide/Charts/Makefile
+++ b/odk/examples/DevelopersGuide/Charts/Makefile
@@ -57,14 +57,15 @@ APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
APP5_NAME=SelectionChangeListener
APP5_JAR=$(SAMPLE_CLASS_OUT)/$(APP5_NAME).jar
-COMPONENT_NAME=JavaSampleChartAddIn
-COMPONENT_PACKAGE = $(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME = $(COMPONENT_NAME).uno.jar
-COMPONENT_JAR = $(SAMPLE_CLASS_OUT)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE = $(SAMPLE_CLASS_OUT)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(SAMPLE_CLASS_OUT)/$(COMPONENT_NAME)/META-INF/manifest.xml
-COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=JavaSampleChartAddIn
+COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME = $(COMP_NAME).uno.jar
+COMP_JAR = $(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE = $(SAMPLE_CLASS_OUT)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(SAMPLE_CLASS_OUT)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
COMPJAVAFILES = \
JavaSampleChartAddIn.java
@@ -79,7 +80,7 @@ COMPCLASSFILES= $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(COMPJAVAFILES))
APP_CLASSFILES= $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(APP_JAVAFILES))
APP_CLASSNAMES= $(patsubst %.java,%.class,$(APP_JAVAFILES))
-$(COMPONENT_NAME)_CLASSFILES = $(COMPONENT_NAME).class
+$(COMP_NAME)_CLASSFILES = $(COMP_NAME).class
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT))
@@ -122,7 +123,7 @@ $(SAMPLE_CLASS_OUT)/%.jar : $(SAMPLE_CLASS_OUT)/%.mf $(SAMPLE_CLASS_OUT)/%.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(COMPCLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(COMPCLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
@@ -133,22 +134,23 @@ $(SAMPLE_CLASS_OUT)/%/manifest.xml :
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_CLASS_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component pacakge file
-$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) -u $(<F)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) ../../../bin/$(@F) -u META-INF/manifest.xml
-$(COMP_REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -195,4 +197,4 @@ AddInChart.ods.load : $(REGISTERFLAG)
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components
new file mode 100644
index 000000000000..c47f26b0187d
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="AsyncJob.uno.jar">
+ <implementation name="com.sun.star.comp.framework.java.services.AsyncJob">
+ <service name="com.sun.star.task.AsyncJob"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
index 14c2659e48a7..790a52d46fb1 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
+++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
@@ -312,7 +312,22 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob
// Because we need a parent anytime.
// And showing e.g. a java dialog can make some trouble
// inside office ... but we have no chance here.
- javax.swing.JOptionPane.showMessageDialog(null, sMessage, sTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE);
+ final java.lang.String sFinalTitle = sTitle;
+ final java.lang.String sFinalMessage = sMessage;
+
+ // On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call
+ // SwingUtilities.invokeLater always on a fresh thread to avoid that problem
+ // (also, the current thread must not wait for that fresh thread to terminate,
+ // as that would cause a deadlock if this thread is the AppKit thread):
+ final Runnable doRun = new Runnable() {
+ public void run() {
+ javax.swing.JOptionPane.showMessageDialog(null, sFinalMessage, sFinalTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE);
+ }
+ };
+
+ new Thread( doRun ) {
+ public void run() { javax.swing.SwingUtilities.invokeLater(doRun); }
+ }.start();
}
//___________________________________________
@@ -415,12 +430,15 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob
}
//___________________________________________
-
- public synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey)
- {
- return Factory.writeRegistryServiceInfo(
- AsyncJob.IMPLEMENTATIONNAME,
- AsyncJob.SERVICENAMES,
- xRegKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey)
+// {
+// return Factory.writeRegistryServiceInfo(
+// AsyncJob.IMPLEMENTATIONNAME,
+// AsyncJob.SERVICENAMES,
+// xRegKey);
+// }
}
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile
index 8b40d9ec87ff..052cea359530 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile
@@ -42,16 +42,17 @@ include $(SETTINGS)/std.mk
include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
-COMPONENT_NAME=AsyncJob
-OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME)
-OUT_COMP_MISC=$(OUT_MISC)/$(COMPONENT_NAME)
-COMPONENT_PACKAGE=$(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME=$(COMPONENT_NAME).uno.jar
-COMPONENT_JAR=$(OUT_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
-REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=AsyncJob
+OUT_COMP_CLASS=$(OUT_CLASS)/$(COMP_NAME)
+OUT_COMP_MISC=$(OUT_MISC)/$(COMP_NAME)
+COMP_PACKAGE=$(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME=$(COMP_NAME).uno.jar
+COMP_JAR=$(OUT_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
JAVAFILES = AsyncJob.java
@@ -76,7 +77,7 @@ $(CLASSFILES) : $(JAVAFILES)
$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) .
@@ -91,24 +92,24 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)Jobs.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) Addons.xcu Jobs.xcu $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) Addons.xcu Jobs.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_CLASS)) && $(SDK_ZIP) ../bin/$(@F) $(<F)
- $(SDK_ZIP) -u $@ Addons.xcu Jobs.xcu
+ $(SDK_ZIP) -u $@ Addons.xcu Jobs.xcu $(COMP_COMPONENTS)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -132,5 +133,5 @@ DevGuideJobsAddon : $(REGISTERFLAG)
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_MISC))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR)))
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile
index c5429565e406..98bbab16ba2c 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile
@@ -43,14 +43,15 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=ProtocolHandlerAddon_cpp
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME)
OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml
-COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag
@@ -70,12 +71,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -86,7 +87,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -105,16 +107,28 @@ $(OUT_COMP_GEN)/%/manifest.xml :
@echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)org.openoffice.Office.addon.example$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.frame.ProtocolHandler$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
# rule for component package file
-$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
- cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_NAME).components
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
$(SDK_ZIP) -u $@ Addons.xcu ProtocolHandler.xcu
cd $(subst /,$(PS),$(OUT_COMP_GEN)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
@@ -144,5 +158,6 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
index 724c4996f308..ae8a7bc1476f 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star::registry;
/**
* Gives the environment this component belongs to.
*/
-extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
@@ -72,33 +72,37 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char *
* @param pServiceManager the service manager
* @param pRegistryKey the registry key
*/
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey)
-{
- sal_Bool result = sal_False;
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+//
+// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey)
+// {
+// sal_Bool result = sal_False;
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) );
+// if (pRegistryKey)
+// {
+// try
+// {
+// Reference< XRegistryKey > xNewKey(
+// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
+// OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) );
- const Sequence< OUString > & rSNL =
- Addon_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
+// const Sequence< OUString > & rSNL =
+// Addon_getSupportedServiceNames();
+// const OUString * pArray = rSNL.getConstArray();
+// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+// xNewKey->createKey( pArray[nPos] );
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- // we should not ignore exceptions
- }
- }
- return result;
-}
+// return sal_True;
+// }
+// catch (InvalidRegistryException &)
+// {
+// // we should not ignore exceptions
+// }
+// }
+// return result;
+// }
/**
* This function is called to get service factories for an implementation.
@@ -108,7 +112,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
* @param pRegistryKey the registry key for this component, need for persistent data
* @return a component factory
*/
-extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
{
void * pRet = 0;
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile
index ac6a0670a05a..82a87aea4ecf 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile
@@ -42,17 +42,18 @@ include $(SETTINGS)/std.mk
include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
-COMPONENT_NAME=ProtocolHandlerAddon_java
-OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME)
-OUT_COMP_MISC=$(OUT_MISC)/$(COMPONENT_NAME)
-COMPONENT_PACKAGE=$(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME=$(COMPONENT_NAME).uno.jar
-COMPONENT_JAR=$(OUT_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
-
-REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=ProtocolHandlerAddon_java
+OUT_COMP_CLASS=$(OUT_CLASS)/$(COMP_NAME)
+OUT_COMP_MISC=$(OUT_MISC)/$(COMP_NAME)
+COMP_PACKAGE=$(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME=$(COMP_NAME).uno.jar
+COMP_JAR=$(OUT_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_COMPONENTS=$(COMP_NAME).components
+
+REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMP_NAME)_register_component.flag
JAVAFILES = ProtocolHandlerAddon.java
@@ -77,7 +78,7 @@ $(CLASSFILES) : $(JAVAFILES)
$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) .
@@ -92,25 +93,25 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) Addons.xcu ProtocolHandler.xcu $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_MISC))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_MISC))
cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
- $(SDK_ZIP) -u $@ Addons.xcu ProtocolHandler.xcu
+ $(SDK_ZIP) -u $@ Addons.xcu ProtocolHandler.xcu $(COMP_COMPONENTS)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -134,5 +135,5 @@ DevGuideProtocolHandlerAddon : $(REGISTERFLAG)
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_MISC))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR)))
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
index ad3b0efe8747..debc2ce8d8af 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
@@ -273,11 +273,15 @@ public class ProtocolHandlerAddon {
* structures) of a single
* registry key accessible.
*/
- public static boolean __writeRegistryServiceInfo(
- XRegistryKey xRegistryKey ) {
- return Factory.writeRegistryServiceInfo(
- ProtocolHandlerAddonImpl.class.getName(),
- ProtocolHandlerAddonImpl.getServiceNames(),
- xRegistryKey );
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// XRegistryKey xRegistryKey ) {
+// return Factory.writeRegistryServiceInfo(
+// ProtocolHandlerAddonImpl.class.getName(),
+// ProtocolHandlerAddonImpl.getServiceNames(),
+// xRegistryKey );
+// }
}
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components
new file mode 100644
index 000000000000..13665ebbc3c5
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="ProtocolHandlerAddon_java.uno.jar">
+ <implementation name="ProtocolHandlerAddon$ProtocolHandlerAddonImpl">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/Makefile b/odk/examples/DevelopersGuide/Components/CppComponent/Makefile
index 0a4e7eee4cae..b89d58bd6211 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/Makefile
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/Makefile
@@ -49,7 +49,7 @@ SAMPLE_SLO_OUT=$(OUT_SLO)/$(SAMPLE_NAME)
SAMPLE_OBJ_OUT=$(OUT_OBJ)/$(SAMPLE_NAME)
COMP_NAME=CppComponent
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
APP1_NAME= TestCppComponent
APP1_BINARY= $(OUT_BIN)/$(APP1_NAME)$(EXE_EXT)
@@ -59,7 +59,8 @@ COMP_RDB = $(SAMPLE_GEN_OUT)/$(COMP_RDB_NAME)
COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(SAMPLE_GEN_OUT)/$(COMP_NAME)/META-INF/manifest.xml
-COMP_MAPFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.map
+#COMP_MAPFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(SAMPLE_GEN_OUT)/$(COMP_NAME).components
COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_register_component.flag
COMP_TYPEFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_types.flag
@@ -103,12 +104,12 @@ $(SAMPLE_SLO_OUT)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(SAMPLE_INC_OUT) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -119,7 +120,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -136,16 +138,31 @@ $(SAMPLE_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
-$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) $(COMP_RDB) $(COMP_UNOPKG_MANIFEST)
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)my_module.my_sc_implementation.MyService1$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)my_module.MyService1$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)my_module.my_sc_implementation.MyService2$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)my_module.MyService2$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
+$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) $(COMP_RDB) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(UNOPKG_PLATFORM))
- cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_RDB_NAME) $(UNOPKG_PLATFORM)/$(<F)
+ cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_NAME).components
+ cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(UNOPKG_PLATFORM)/$(<F)
cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
@@ -216,5 +233,6 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_SLO_OUT))
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_OBJ_OUT))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/$(COMP_NAME)*))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/*$(APP1_NAME)*))
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
index a3c13216066d..c0462395939c 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
@@ -244,42 +244,47 @@ Reference< XInterface > SAL_CALL create_MyService2Impl(
}
/*
-extern "C" void SAL_CALL component_getImplementationEnvironment(
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
sal_Char const ** ppEnvTypeName, uno_Environment ** )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry )
-{
- if (xRegistry)
- {
- try
- {
- // implementation of MyService1A
- Reference< registry::XRegistryKey > xKey(
- xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "my_module.my_sc_implementation.MyService1/UNO/SERVICES") ) ) );
- // subkeys denote implemented services of implementation
- xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "my_module.MyService1") ) );
- // implementation of MyService1B
- xKey = xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "my_module.my_sc_implementation.MyService2/UNO/SERVICES") ) );
- // subkeys denote implemented services of implementation
- xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "my_module.MyService2") ) );
- return sal_True; // success
- }
- catch (registry::InvalidRegistryException &)
- {
- // function fails if exception caught
- }
- }
- return sal_False;
-}
-extern "C" void * SAL_CALL component_getFactory(
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+//
+// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+// lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry )
+// {
+// if (xRegistry)
+// {
+// try
+// {
+// // implementation of MyService1A
+// Reference< registry::XRegistryKey > xKey(
+// xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
+// "my_module.my_sc_implementation.MyService1/UNO/SERVICES") ) ) );
+// // subkeys denote implemented services of implementation
+// xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
+// "my_module.MyService1") ) );
+// // implementation of MyService1B
+// xKey = xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
+// "my_module.my_sc_implementation.MyService2/UNO/SERVICES") ) );
+// // subkeys denote implemented services of implementation
+// xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(
+// "my_module.MyService2") ) );
+// return sal_True; // success
+// }
+// catch (registry::InvalidRegistryException &)
+// {
+// // function fails if exception caught
+// }
+// }
+// return sal_False;
+// }
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
sal_Char const * implName, lang::XMultiServiceFactory * xMgr, void * )
{
Reference< lang::XSingleComponentFactory > xFactory;
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
index 8589f8e88ab7..8876c2381870 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
@@ -199,20 +199,25 @@ static struct ::cppu::ImplementationEntry s_component_entries [] =
extern "C"
{
-void SAL_CALL component_getImplementationEnvironment(
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
sal_Char const ** ppEnvTypeName, uno_Environment ** )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry )
-{
- return ::cppu::component_writeInfoHelper(
- xMgr, xRegistry, ::my_sc_impl::s_component_entries );
-}
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+//
+// sal_Bool SAL_CALL component_writeInfo(
+// lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry )
+// {
+// return ::cppu::component_writeInfoHelper(
+// xMgr, xRegistry, ::my_sc_impl::s_component_entries );
+// }
+
-void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
sal_Char const * implName, lang::XMultiServiceFactory * xMgr,
registry::XRegistryKey * xRegistry )
{
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components b/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components
new file mode 100644
index 000000000000..67ac8696dbe2
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="JavaComponent.uno.jar">
+ <implementation name="TestComponentA">
+ <service name="com.sun.star.test.SomethingA"/>
+ </implementation>
+ <implementation name="TestComponentB">
+ <service name="com.sun.star.test.SomethingB"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile b/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile
index 55f8cbc12425..327d4f2d3f36 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile
@@ -43,21 +43,23 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
-COMPONENT_NAME=JavaComponent
-OUT_COMP_CLASS = $(OUT_CLASS)/$(COMPONENT_NAME)
-OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
-COMPONENT_RDB_NAME = $(COMPONENT_NAME).uno.rdb
-COMPONENT_RDB = $(OUT_COMP_GEN)/$(COMPONENT_RDB_NAME)
-COMPONENT_PACKAGE = $(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME = $(COMPONENT_NAME).uno.jar
-COMPONENT_JAR = $(OUT_COMP_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
+COMP_NAME=JavaComponent
+OUT_COMP_CLASS = $(OUT_CLASS)/$(COMP_NAME)
+OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME)
+COMP_RDB_NAME = $(COMP_NAME).uno.rdb
+COMP_RDB = $(OUT_COMP_GEN)/$(COMP_RDB_NAME)
+COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME = $(COMP_NAME).uno.jar
+COMP_JAR = $(OUT_COMP_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_COMPONENTS=$(COMP_NAME).components
+
APP1_NAME=TestJavaComponent
APP1_JAR=$(OUT_COMP_CLASS)/$(APP1_NAME).jar
-REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMPONENT_NAME)_register_component.flag
+REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag
IDLFILES = XSomethingA.idl \
XSomethingB.idl \
@@ -80,9 +82,9 @@ GENURDFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/%.urd,$(IDLFILES))
COMPCLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(COMPJAVAFILES))
-$(COMPONENT_NAME)_CLASSFILES = $(patsubst %.java,%.class,$(COMPJAVAFILES))
+$(COMP_NAME)_CLASSFILES = $(patsubst %.java,%.class,$(COMPJAVAFILES))
-$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES))
+$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES))
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_COMP_CLASS))
@@ -109,9 +111,9 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(REGMERGE) $@ /UCR $(GENURDFILES)
-$(OUT_COMP_CLASS)/$(PACKAGE)/%.class : $(COMPONENT_RDB)
+$(OUT_COMP_CLASS)/$(PACKAGE)/%.class : $(COMP_RDB)
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMPONENT_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
+ $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMP_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
$(OUT_COMP_CLASS)/%.class : %.java $(GENCLASSFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
@@ -134,11 +136,11 @@ $(OUT_COMP_CLASS)/%.mf :
$(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(APP1_NAME).class $(COMPCLASSFILES) $(GENCLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- +cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(basename $(@F)).class $($(COMPONENT_NAME)_CLASSFILES)
+ +cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(basename $(@F)).class $($(COMP_NAME)_CLASSFILES)
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(COMPCLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(COMPCLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
@@ -151,24 +153,25 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component pacakge file
-$(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(COPY) $(subst /,$(PS),$(COMPONENT_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME)
+ $(COPY) $(subst /,$(PS),$(COMP_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
+ $(SDK_ZIP) $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
- $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_COMP_CLASS)/$(COMPONENT_RDB_NAME)))
+ $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_COMP_CLASS)/$(COMP_RDB_NAME)))
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -200,5 +203,5 @@ JavaComponentExample : $(REGISTERFLAG) $(APP1_JAR)
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java
index dee8899510e4..15980bb04a64 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java
@@ -57,15 +57,19 @@ public class TestServiceProvider
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){
- boolean bregA= FactoryHelper.writeRegistryServiceInfo(
- TestComponentA.class.getName(),
- TestComponentA.__serviceName, regKey);
- boolean bregB= FactoryHelper.writeRegistryServiceInfo(
- TestComponentB.class.getName(),
- TestComponentB.__serviceName, regKey);
- return bregA && bregB;
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){
+// boolean bregA= FactoryHelper.writeRegistryServiceInfo(
+// TestComponentA.class.getName(),
+// TestComponentA.__serviceName, regKey);
+// boolean bregB= FactoryHelper.writeRegistryServiceInfo(
+// TestComponentB.class.getName(),
+// TestComponentB.__serviceName, regKey);
+// return bregA && bregB;
+// }
}
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components
new file mode 100644
index 000000000000..94a4848c0ee1
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="LicenseTest.uno.jar">
+ <implementation name="LicenseTest$_LicenseTest">
+ <service name="org.openoffice.LicenseTest"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java
index 211638c46c58..d7b6716dcdcc 100644
--- a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java
@@ -148,11 +148,15 @@ public class LicenseTest {
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return Factory.writeRegistryServiceInfo(_LicenseTest.class.getName(),
- _LicenseTest.getServiceNames(),
- regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// return Factory.writeRegistryServiceInfo(_LicenseTest.class.getName(),
+// _LicenseTest.getServiceNames(),
+// regKey);
+// }
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile b/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile
index 976de2d07b40..c82f0ba7e014 100644
--- a/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile
@@ -62,6 +62,7 @@ COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
COMP_LOCAL_FILES = description.xml registration/license_de.txt registration/license_en_US.txt
+COMP_COMPONENTS=$(COMP_NAME).components
IDLFILES = LicenseTest.idl
@@ -130,15 +131,16 @@ $(COMP_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_LOCAL_FILES)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_LOCAL_FILES) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $(COMP_RDB_NAME)
+ $(SDK_ZIP) $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) $(COMP_RDB_NAME)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
$(SDK_ZIP) -u $@ $(COMP_LOCAL_FILES)
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/Makefile
index 6dffc4cbad7a..7070493a8cf1 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/Makefile
@@ -59,7 +59,7 @@ $(SUBDIRS) :
org/openoffice/comp/test : org/openoffice/test
-ComponentsThumbsExample : $(COMPONENT_PACKAGE)
+ComponentsThumbsExample : $(COMP_PACKAGE)
@echo --------------------------------------------------------------------------------
@echo Please use one of the following command to execute the example!
@echo -
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components
new file mode 100644
index 000000000000..11d958fe82a0
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="ImageShrink.uno.jar">
+ <implementation name="org.openoffice.comp.test.ImageShrink">
+ <service name="org.openoffice.test.ImageShrink"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
index 7fe4307d8a80..5565d7d20780 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
@@ -93,12 +93,17 @@ public class ImageShrink extends WeakBase
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- //System.out.println(ImageShrink.class.getName());
- return FactoryHelper.writeRegistryServiceInfo( ImageShrink.class.getName(),
- __serviceName,
- regKey);
- }
+
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// //System.out.println(ImageShrink.class.getName());
+// return FactoryHelper.writeRegistryServiceInfo( ImageShrink.class.getName(),
+// __serviceName,
+// regKey);
+// }
// XFilter implementation (a sub-interface of XImageShrinkFilter)
public void cancel() {
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile
index 2b990e22ae2e..6894e1d9bb49 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile
@@ -74,7 +74,7 @@ $(OUT_COMP_CLASS)/%.mf :
@echo Application-Class: $(subst /,.,$(PACKAGE)).$*>> $@
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMPONENT_NAME).class
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMP_NAME).class
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(basename $(@F))).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES))
@@ -87,18 +87,19 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(COPY) $(subst /,$(PS),$(COMPONENT_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME)
+ $(COPY) $(subst /,$(PS),$(COMP_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS))
+ $(SDK_ZIP) $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
- $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_CLASS)/$(COMPONENT_RDB_NAME)))
+ $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_CLASS)/$(COMP_RDB_NAME)))
$(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(APP1_NAME).class
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
@@ -106,11 +107,11 @@ $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(A
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -122,7 +123,7 @@ endif
.PHONY: clean
clean :
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(APP1_JAR)))
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile
index 698670084a23..fc453a11f948 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile
@@ -64,9 +64,9 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(REGMERGE) $@ /UCR $(GENURDFILES)
-$(OUT_COMP_CLASS)/%.class : $(COMPONENT_RDB)
+$(OUT_COMP_CLASS)/%.class : $(COMP_RDB)
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMPONENT_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
+ $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMP_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
.PHONY: clean
clean :
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk b/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk
index ae6a5c94f0fa..cec8a3f4c655 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk
@@ -1,16 +1,17 @@
OUT_COMP_CLASS = $(OUT_CLASS)/ComponentThumbsExample
OUT_COMP_GEN = $(OUT_MISC)/ComponentThumbsExample
-COMPONENT_NAME=ImageShrink
-COMPONENT_RDB_NAME = $(COMPONENT_NAME).uno.rdb
-COMPONENT_RDB = $(OUT_COMP_GEN)/$(COMPONENT_RDB_NAME)
-COMPONENT_PACKAGE = $(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME = $(COMPONENT_NAME).uno.jar
-COMPONENT_JAR = $(OUT_COMP_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
-REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=ImageShrink
+COMP_RDB_NAME = $(COMP_NAME).uno.rdb
+COMP_RDB = $(OUT_COMP_GEN)/$(COMP_RDB_NAME)
+COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME = $(COMP_NAME).uno.jar
+COMP_JAR = $(OUT_COMP_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
IDL_PACKAGE=org/openoffice/test
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components
new file mode 100644
index 000000000000..56d7c8eb8f45
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="DialogComponent.uno.jar">
+ <implementation name="DialogComponent$_DialogComponent">
+ <service name="com.sun.star.test.TestDialogHandler"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index f7ad9ad4b7c8..9d6409e26674 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
@@ -316,9 +316,13 @@ public class DialogComponent {
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return Factory.writeRegistryServiceInfo(_DialogComponent.class.getName(),
- _DialogComponent.getServiceNames(),
- regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// return Factory.writeRegistryServiceInfo(_DialogComponent.class.getName(),
+// _DialogComponent.getServiceNames(),
+// regKey);
+// }
}
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile b/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile
index 8726029ec222..7afc11f0834c 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile
@@ -61,6 +61,7 @@ COMP_JAR=$(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
IDLFILES = XTestDialogHandler.idl \
TestDialogHandler.idl
@@ -131,15 +132,16 @@ $(COMP_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $(COMP_RDB_NAME)
+ $(SDK_ZIP) $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) $(COMP_RDB_NAME)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile b/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile
index cbd28b982eac..f1451d3d1a67 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile
@@ -43,7 +43,7 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=DatabaseSDBCDriverSkeleton
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
COMP_LIBRARY=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME)
OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
OUT_COMP_MISC=$(OUT_MISC)/$(COMP_NAME)
@@ -51,9 +51,10 @@ OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(OUT_COMP_MISC)/$(COMP_NAME)/META-INF/manifest.xml
-COMP_MAPFILE = $(OUT_COMP_MISC)/$(COMP_NAME).uno.map
+#COMP_MAPFILE = $(OUT_COMP_MISC)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(OUT_COMP_MISC)/$(COMP_NAME).components
-REGISTERFLAG = $(OUT_COMP_MISC)/devguide_$(COMP_NAME)_register_component.flag
+COMP_REGISTERFLAG = $(OUT_COMP_MISC)/devguide_$(COMP_NAME)_register_component.flag
CXXFILES = SConnection.cxx \
SDatabaseMetaData.cxx \
@@ -78,12 +79,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) $(STL_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -94,7 +95,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -109,18 +110,30 @@ $(OUT_COMP_MISC)/%/manifest.xml :
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_MISC)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
-$(COMP_PACKAGE) : $(COMP_LIBRARY) $(COMP_UNOPKG_MANIFEST)
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.sdbc.SkeletonDriver$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.sdbc.Driver$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
+$(COMP_PACKAGE) : $(COMP_LIBRARY) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_MISC)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_MISC)/$(UNOPKG_PLATFORM))
- cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
+ cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_NAME).components
+ cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
cd $(subst /,$(PS),$(OUT_COMP_MISC)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMP_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
@@ -134,7 +147,7 @@ else
@echo --------------------------------------------------------------------------------
endif
-DatabaseSDBCDriverSkeletonExample : $(REGISTERFLAG)
+DatabaseSDBCDriverSkeletonExample : $(COMP_REGISTERFLAG)
@echo --------------------------------------------------------------------------------
@echo The Database SDBC skeleton driver component was installed if SDK_AUTO_DEPLOYMENT = YES.
@echo You can use this component inside your office installation, see the example
@@ -147,4 +160,6 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_MISC))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_LIBRARY)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
index 820d96f83c46..07f2b5712970 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
@@ -32,6 +32,7 @@
*
*************************************************************************/
+#include <sal/types.h>
#include "SDriver.hxx"
#include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
@@ -55,8 +56,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
//***************************************************************************************
//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
+// The required C-Api must be provided!
+// It contains of 3 special functions that have to be exported.
//
//---------------------------------------------------------------------------------------
@@ -118,7 +119,7 @@ struct ProviderRequest
//---------------------------------------------------------------------------------------
-extern "C" void SAL_CALL component_getImplementationEnvironment(
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char **ppEnvTypeName,
uno_Environment **ppEnv
)
@@ -126,33 +127,36 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
//---------------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void* pServiceManager,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- SkeletonDriver::getImplementationName_Static(),
- SkeletonDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
+// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+// void* pServiceManager,
+// void* pRegistryKey
+// )
+// {
+// if (pRegistryKey)
+// try
+// {
+// Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
+
+// REGISTER_PROVIDER(
+// SkeletonDriver::getImplementationName_Static(),
+// SkeletonDriver::getSupportedServiceNames_Static(), xKey);
+
+// return sal_True;
+// }
+// catch (::com::sun::star::registry::InvalidRegistryException& )
+// {
+// OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
+// }
+
+// return sal_False;
+// }
//---------------------------------------------------------------------------------------
-extern "C" void* SAL_CALL component_getFactory(
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
void* pRegistryKey)
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile
index d6778b59be70..4eb8d30bec4b 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile
@@ -60,7 +60,7 @@ include $(SETTINGS)/stdtarget.mk
$(OUT_SHL_SLO)/%.$(OBJ_EXT) : %.c
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(CC) $(CC_FLAGS) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
+ $(CC) $(CC_FLAGS_JNI) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES_JNI) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(SHL_NAME).$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile
index 71c50df5ea2e..7052c2f968cc 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile
@@ -61,7 +61,7 @@ include $(SETTINGS)/stdtarget.mk
$(OUT_SHL_SLO)/%.$(OBJ_EXT) : %.c
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(CC) $(CC_FLAGS) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
+ $(CC) $(CC_FLAGS_JNI) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES_JNI) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
$(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(SHL_NAME).$(SHAREDLIB_EXT) : $(SLOFILES) $(SHL_NAME).def
-$(MKDIR) $(subst /,$(PS),$(@D))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
index 24eb92a3109c..475fb4963dbc 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
@@ -723,11 +723,15 @@ public class AsciiReplaceFilter
*
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey xRegistryKey )
- {
- return Factory.writeRegistryServiceInfo(
- _AsciiReplaceFilter.class.getName(),
- _AsciiReplaceFilter.m_serviceNames,
- xRegistryKey );
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey xRegistryKey )
+// {
+// return Factory.writeRegistryServiceInfo(
+// _AsciiReplaceFilter.class.getName(),
+// _AsciiReplaceFilter.m_serviceNames,
+// xRegistryKey );
+// }
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile
index e84e53ed3fc0..d0ce80991c11 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile
@@ -55,6 +55,7 @@ COMP_JAR = $(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_MANIFESTFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(SAMPLE_GEN_OUT)/$(COMP_NAME)/META-INF/manifest.xml
COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
# often the java files are structured in a hierarchy similar to the package,
# for the example we know the package
@@ -98,15 +99,16 @@ $(SAMPLE_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)TypeDetection.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_JAR) TypeDetection.xcu $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) TypeDetection.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_ZIP) $@ TypeDetection.xcu
+ $(SDK_ZIP) -u $@ $(COMP_COMPONENTS)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/SampleFilter.components b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/SampleFilter.components
new file mode 100644
index 000000000000..f288f7e9497d
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/SampleFilter.components
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="SampleFilter.uno.jar">
+ <implementation name="OfficeDev.samples.Filter.AsciiReplaceFilter$_AsciiReplaceFilter">
+ <service name="com.sun.star.comp.ansifilter.AsciiReplaceFilter"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile
index 11a200398426..8a458d9d8570 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile
@@ -43,7 +43,7 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=FlatXmlTypeDetection
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME)
OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME)
OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
@@ -52,7 +52,8 @@ COMP_RDB = $(OUT_COMP_GEN)/$(COMP_RDB_NAME)
COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml
-COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
+#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag
@@ -72,12 +73,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -88,7 +89,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -105,17 +106,29 @@ $(OUT_COMP_GEN)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlTypeDetection.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)devguide.officedev.samples.filter.FlatXmlDetect$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.document.ExtendedTypeDetection$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
# rule for component package file
-$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlTypeDetection.xcu $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlTypeDetection.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(SDK_ZIP) $@ FlatXmlTypeDetection.xcu
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_NAME).components
cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
cd $(subst /,$(PS),$(OUT_COMP_GEN)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
@@ -146,5 +159,6 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
index 92c164d348c8..69103b728175 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
@@ -50,41 +50,44 @@ using namespace ::com::sun::star::registry;
extern "C"
{
//==================================================================================================
-void SAL_CALL component_getImplementationEnvironment(
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
+// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+// void * pServiceManager, void * pRegistryKey )
+// {
+// if (pRegistryKey)
+// {
+// try
+// {
+// Reference< XRegistryKey > xNewKey(
+// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
+// xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
- const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
+// const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames();
+// const OUString * pArray = rSNL.getConstArray();
+// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+// xNewKey->createKey( pArray[nPos] );
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
+// return sal_True;
+// }
+// catch (InvalidRegistryException &)
+// {
+// OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+// }
+// }
+// return sal_False;
+// }
//==================================================================================================
-void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
void * pRet = 0;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
index b1cf3afbf536..7ebb628b29a9 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
@@ -318,38 +318,42 @@ using namespace XFlatXml;
extern "C"
{
-void SAL_CALL component_getImplementationEnvironment(
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
-void * SAL_CALL component_getFactory(
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+//
+// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey )
+// {
+// if (pRegistryKey)
+// {
+// try
+// {
+// Reference< XRegistryKey > xNewKey(
+// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
+// OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
+
+// const Sequence< OUString > & rSNL = getSupportedServiceNames();
+// const OUString * pArray = rSNL.getConstArray();
+// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+// xNewKey->createKey( pArray[nPos] );
+
+// return sal_True;
+// }
+// catch (InvalidRegistryException &)
+// {
+// OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+// }
+// }
+// return sal_False;
+// }
+
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
void * pRet = 0;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile
index 09a4cfafa4dd..a9e987777cf7 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile
@@ -43,16 +43,17 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=FlatXmlFilter_cpp
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME)
OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME)
OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml
-COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
-REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag
+COMP_REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag
CXXFILES = FlatXml.cxx
@@ -69,12 +70,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -85,7 +86,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -102,21 +103,33 @@ $(OUT_COMP_GEN)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlFilter_cpp.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)devguide.officedev.samples.filter.FlatXmlCpp$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)devguide.officedev.samples.filter.FlatXmlCpp$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
# rule for component package file
-$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlFilter_cpp.xcu $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlFilter_cpp.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(SDK_ZIP) $@ FlatXmlFilter_cpp.xcu
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_NAME).components
cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
cd $(subst /,$(PS),$(OUT_COMP_GEN)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMP_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
@@ -130,7 +143,7 @@ else
@echo --------------------------------------------------------------------------------
endif
-FlatXmlFilterCppExample : $(REGISTERFLAG)
+FlatXmlFilterCppExample : $(COMP_REGISTERFLAG)
@echo --------------------------------------------------------------------------------
@echo The C++ FlatXmlFilter component is installed if SDK_AUTO_DEPLOYMENT = YES.
@echo You can use the filters "$(QM)DevGuide FlatXML ...$(QM)" inside your office installation
@@ -143,6 +156,7 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
index cf95e1637c08..689d9b84fac6 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
@@ -264,10 +264,14 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
- {
- return FactoryHelper.writeRegistryServiceInfo(__implName,
- __serviceName, regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
+// {
+// return FactoryHelper.writeRegistryServiceInfo(__implName,
+// __serviceName, regKey);
+// }
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components
new file mode 100644
index 000000000000..87359c3ecda6
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="FlatXmlFilter_java.uno.jar">
+ <implementation name="FlatXml">
+ <service name="devguide.officedev.samples.filter.FlatXmlJava"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile
index afd060aee7be..a619e9d9c9d0 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile
@@ -42,15 +42,16 @@ include $(SETTINGS)/std.mk
include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
-COMPONENT_NAME=FlatXmlFilter_java
-OUT_COMP_CLASS = $(OUT_CLASS)/$(COMPONENT_NAME)
-COMPONENT_PACKAGE = $(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME = $(COMPONENT_NAME).uno.jar
-COMPONENT_JAR = $(OUT_COMP_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
-REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=FlatXmlFilter_java
+OUT_COMP_CLASS = $(OUT_CLASS)/$(COMP_NAME)
+COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME = $(COMP_NAME).uno.jar
+COMP_JAR = $(OUT_COMP_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
JAVAFILES = \
FlatXml.java \
@@ -58,9 +59,9 @@ JAVAFILES = \
CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES))
-#$(COMPONENT_NAME)_CLASSFILES = FlatXml.class FlatXml$(dlr)_FlatXml.class
+#$(COMP_NAME)_CLASSFILES = FlatXml.class FlatXml$(dlr)_FlatXml.class
-$(COMPONENT_NAME)_CLASSFILES = *.class
+$(COMP_NAME)_CLASSFILES = *.class
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_COMP_CLASS))
@@ -82,7 +83,7 @@ $(CLASSFILES) : $(JAVAFILES)
$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
@@ -95,23 +96,24 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlFilter_java.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) FlatXmlFilter_java.xcu $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) FlatXmlFilter_java.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_ZIP) $@ FlatXmlFilter_java.xcu
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) -u $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -121,7 +123,7 @@ else
@echo --------------------------------------------------------------------------------
endif
-FlatXmlFilterJavaExample : $(REGISTERFLAG)
+FlatXmlFilterJavaExample : $(COMP_REGISTERFLAG)
@echo --------------------------------------------------------------------------------
@echo The Java FlatXmlFilter component is installed if SDK_AUTO_DEPLOYMENT = YES.
@echo You can use the filters "$(QM)DevGuide FlatXML ...$(QM)" inside your office installation
@@ -137,5 +139,5 @@ FlatXmlFilterJavaExample : $(REGISTERFLAG)
.PHONY: clean
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile
index c2ac5900e862..83491a844dfb 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile
@@ -45,29 +45,32 @@ include $(SETTINGS)/dk.mk
EXAMPLE_NAME=OfficeDevLinguisticExample
OUT_COMP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
-COMPONENT1_NAME=SampleHyphenator
-COMPONENT1_PACKAGE = $(OUT_BIN)/$(COMPONENT1_NAME).$(UNOOXT_EXT)
-COMPONENT1_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT1_NAME).$(UNOOXT_EXT)")
-COMPONENT1_JAR_NAME = $(COMPONENT1_NAME).uno.jar
-COMPONENT1_JAR = $(OUT_COMP_CLASS)/$(COMPONENT1_JAR_NAME)
-COMPONENT1_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT1_NAME).uno.Manifest
-COMPONENT1_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT1_NAME)/META-INF/manifest.xml
-
-COMPONENT2_NAME=SampleSpellChecker
-COMPONENT2_PACKAGE = $(OUT_BIN)/$(COMPONENT2_NAME).$(UNOOXT_EXT)
-COMPONENT2_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT2_NAME).$(UNOOXT_EXT)")
-COMPONENT2_JAR_NAME = $(COMPONENT2_NAME).uno.jar
-COMPONENT2_JAR = $(OUT_COMP_CLASS)/$(COMPONENT2_JAR_NAME)
-COMPONENT2_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT2_NAME).uno.Manifest
-COMPONENT2_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT2_NAME)/META-INF/manifest.xml
-
-COMPONENT3_NAME=SampleThesaurus
-COMPONENT3_PACKAGE = $(OUT_BIN)/$(COMPONENT3_NAME).$(UNOOXT_EXT)
-COMPONENT3_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT3_NAME).$(UNOOXT_EXT)")
-COMPONENT3_JAR_NAME = $(COMPONENT3_NAME).uno.jar
-COMPONENT3_JAR = $(OUT_COMP_CLASS)/$(COMPONENT3_JAR_NAME)
-COMPONENT3_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT3_NAME).uno.Manifest
-COMPONENT3_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT3_NAME)/META-INF/manifest.xml
+COMP1_NAME=SampleHyphenator
+COMP1_PACKAGE = $(OUT_BIN)/$(COMP1_NAME).$(UNOOXT_EXT)
+COMP1_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP1_NAME).$(UNOOXT_EXT)")
+COMP1_JAR_NAME = $(COMP1_NAME).uno.jar
+COMP1_JAR = $(OUT_COMP_CLASS)/$(COMP1_JAR_NAME)
+COMP1_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP1_NAME).uno.Manifest
+COMP1_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP1_NAME)/META-INF/manifest.xml
+COMP1_COMPONENTS=$(COMP1_NAME).components
+
+COMP2_NAME=SampleSpellChecker
+COMP2_PACKAGE = $(OUT_BIN)/$(COMP2_NAME).$(UNOOXT_EXT)
+COMP2_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP2_NAME).$(UNOOXT_EXT)")
+COMP2_JAR_NAME = $(COMP2_NAME).uno.jar
+COMP2_JAR = $(OUT_COMP_CLASS)/$(COMP2_JAR_NAME)
+COMP2_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP2_NAME).uno.Manifest
+COMP2_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP2_NAME)/META-INF/manifest.xml
+COMP2_COMPONENTS=$(COMP2_NAME).components
+
+COMP3_NAME=SampleThesaurus
+COMP3_PACKAGE = $(OUT_BIN)/$(COMP3_NAME).$(UNOOXT_EXT)
+COMP3_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP3_NAME).$(UNOOXT_EXT)")
+COMP3_JAR_NAME = $(COMP3_NAME).uno.jar
+COMP3_JAR = $(OUT_COMP_CLASS)/$(COMP3_JAR_NAME)
+COMP3_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP3_NAME).uno.Manifest
+COMP3_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP3_NAME)/META-INF/manifest.xml
+COMP3_COMPONENTS=$(COMP2_NAME).components
APP1_NAME=LinguisticExamples
APP1_JAR=$(OUT_COMP_CLASS)/$(APP1_NAME).jar
@@ -89,22 +92,22 @@ JAVAFILES = \
CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES))
-$(COMPONENT1_NAME)_CLASSFILES = XHyphenatedWord_impl.class \
+$(COMP1_NAME)_CLASSFILES = XHyphenatedWord_impl.class \
XPossibleHyphens_impl.class \
PropChgHelper.class \
PropChgHelper_Hyph.class \
OneInstanceFactory.class \
- $(COMPONENT1_NAME).class
+ $(COMP1_NAME).class
-$(COMPONENT2_NAME)_CLASSFILES = XSpellAlternatives_impl.class \
+$(COMP2_NAME)_CLASSFILES = XSpellAlternatives_impl.class \
PropChgHelper_Spell.class \
PropChgHelper.class \
OneInstanceFactory.class \
- $(COMPONENT2_NAME).class
+ $(COMP2_NAME).class
-$(COMPONENT3_NAME)_CLASSFILES = XMeaning_impl.class \
+$(COMP3_NAME)_CLASSFILES = XMeaning_impl.class \
OneInstanceFactory.class \
- $(COMPONENT3_NAME).class
+ $(COMP3_NAME).class
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_COMP_CLASS))
@@ -126,67 +129,59 @@ $(CLASSFILES) : $(JAVAFILES)
# rules for the component jars and the packages doesn't work proper and we
# defined explicit rules
-#$(OUT_COMP_CLASS)/%.jar : $(OUT_COMP_CLASS)/%.Manifest $(CLASSFILES)
-# -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-# -$(MKDIR) $(subst /,$(PS),$(@D))
-# cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
-
# rule for component package manifest
$(OUT_COMP_CLASS)/%/manifest.xml :
-$(MKDIR) $(subst /,$(PS),$(@D))
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)" >> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).components$(QM)"/$(CSEP) >> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
-#$(OUT_BIN)/%.uno.pkg : $(OUT_COMP_CLASS)/%.uno.jar $(OUT_COMP_CLASS)/%/META-INF/manifest.xml
-# -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-# -$(MKDIR) $(subst /,$(PS),$(@D))
-# cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
-# cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-
-$(COMPONENT1_JAR) : $(COMPONENT1_MANIFESTFILE) $(CLASSFILES)
+$(COMP1_JAR) : $(COMP1_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
-$(COMPONENT1_PACKAGE) : $(COMPONENT1_JAR) $(COMPONENT1_UNOPKG_MANIFEST)
+$(COMP1_PACKAGE) : $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST) $(COMP1_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP1_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(COMPONENT2_JAR) : $(COMPONENT2_MANIFESTFILE) $(CLASSFILES)
+$(COMP2_JAR) : $(COMP2_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
-$(COMPONENT2_PACKAGE) : $(COMPONENT2_JAR) $(COMPONENT2_UNOPKG_MANIFEST)
+$(COMP2_PACKAGE) : $(COMP2_JAR) $(COMP2_UNOPKG_MANIFEST) $(COMP2_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP2_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(COMPONENT3_JAR) : $(COMPONENT3_MANIFESTFILE) $(CLASSFILES)
+$(COMP3_JAR) : $(COMP3_MANIFESTFILE) $(CLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
-$(COMPONENT3_PACKAGE) : $(COMPONENT3_JAR) $(COMPONENT3_UNOPKG_MANIFEST)
+$(COMP3_PACKAGE) : $(COMP3_JAR) $(COMP3_UNOPKG_MANIFEST) $(COMP3_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP3_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMPONENT1_PACKAGE) $(COMPONENT2_PACKAGE) $(COMPONENT3_PACKAGE)
+$(REGISTERFLAG) : $(COMP1_PACKAGE) $(COMP2_PACKAGE) $(COMP3_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
- $(DEPLOYTOOL) $(COMPONENT1_PACKAGE_URL)
- $(DEPLOYTOOL) $(COMPONENT2_PACKAGE_URL)
- $(DEPLOYTOOL) $(COMPONENT3_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP1_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP2_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP3_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -220,8 +215,8 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR)
@echo -
@echo $(MAKE) $(APP1_NAME).run
@echo --------
- @echo Before you can run the examples the components "$(QM)$(COMPONENT1_NAME)$(QM)",
- @echo "$(QM)$(COMPONENT2_NAME)$(QM)" and "$(QM)$(COMPONENT3_NAME)$(QM)" must be deployed.
+ @echo Before you can run the examples the components "$(QM)$(COMP1_NAME)$(QM)",
+ @echo "$(QM)$(COMP2_NAME)$(QM)" and "$(QM)$(COMP3_NAME)$(QM)" must be deployed.
@echo The components will be automatically deployed if SDK_AUTO_DEPLOYMENT = YES.
@echo --------------------------------------------------------------------------------
@@ -231,7 +226,7 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR)
.PHONY: clean
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT1_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT2_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT3_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP1_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP2_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP3_PACKAGE_URL)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components
new file mode 100644
index 000000000000..bf083b386a31
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="SampleHyphenator.uno.jar">
+ <implementation name="SampleHyphenator">
+ <service name="com.sun.star.linguistic2.Hyphenator"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
index adad109f9a87..8008fcd5affd 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
@@ -488,7 +488,7 @@ public class SampleHyphenator extends ComponentBase implements
// __________ static things __________
- public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleHyphenator";
+ public static String _aSvcImplName = SampleHyphenator.class.getName();
public static String[] getSupportedServiceNames_Static()
{
@@ -531,18 +531,22 @@ public class SampleHyphenator extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey xRegKey )
- {
- boolean bResult = true;
- String[] aServices = getSupportedServiceNames_Static();
- int i, nLength = aServices.length;
- for( i = 0; i < nLength; ++i )
- {
- bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _aSvcImplName, aServices[i], xRegKey );
- }
- return bResult;
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// com.sun.star.registry.XRegistryKey xRegKey )
+// {
+// boolean bResult = true;
+// String[] aServices = getSupportedServiceNames_Static();
+// int i, nLength = aServices.length;
+// for( i = 0; i < nLength; ++i )
+// {
+// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _aSvcImplName, aServices[i], xRegKey );
+// }
+// return bResult;
+// }
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components
new file mode 100644
index 000000000000..bb489918b843
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="SampleSpellChecker.uno.jar">
+ <implementation name="SampleSpellChecker">
+ <service name="com.sun.star.linguistic2.SpellChecker"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
index 9e2cd5a81853..6d28867a3e1d 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
@@ -431,7 +431,7 @@ public class SampleSpellChecker extends ComponentBase implements
// __________ static things __________
- public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleSpellChecker";
+ public static String _aSvcImplName = SampleSpellChecker.class.getName();
public static String[] getSupportedServiceNames_Static()
{
@@ -474,18 +474,22 @@ public class SampleSpellChecker extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey xRegKey )
- {
- boolean bResult = true;
- String[] aServices = getSupportedServiceNames_Static();
- int i, nLength = aServices.length;
- for( i = 0; i < nLength; ++i )
- {
- bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _aSvcImplName, aServices[i], xRegKey );
- }
- return bResult;
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// com.sun.star.registry.XRegistryKey xRegKey )
+// {
+// boolean bResult = true;
+// String[] aServices = getSupportedServiceNames_Static();
+// int i, nLength = aServices.length;
+// for( i = 0; i < nLength; ++i )
+// {
+// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _aSvcImplName, aServices[i], xRegKey );
+// }
+// return bResult;
+// }
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components
new file mode 100644
index 000000000000..025f42451f26
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="SampleThesaurus.uno.jar">
+ <implementation name="SampleThesaurus">
+ <service name="com.sun.star.linguistic2.Thesaurus"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
index 7e5bbb1bf442..fd56a5683882 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
@@ -268,7 +268,7 @@ public class SampleThesaurus extends ComponentBase implements
// __________ static things __________
- public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleThesaurus";
+ public static String _aSvcImplName = SampleThesaurus.class.getName();
public static String[] getSupportedServiceNames_Static()
{
@@ -311,18 +311,22 @@ public class SampleThesaurus extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey xRegKey )
- {
- boolean bResult = true;
- String[] aServices = getSupportedServiceNames_Static();
- int i, nLength = aServices.length;
- for( i = 0; i < nLength; ++i )
- {
- bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _aSvcImplName, aServices[i], xRegKey );
- }
- return bResult;
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// com.sun.star.registry.XRegistryKey xRegKey )
+// {
+// boolean bResult = true;
+// String[] aServices = getSupportedServiceNames_Static();
+// int i, nLength = aServices.length;
+// for( i = 0; i < nLength; ++i )
+// {
+// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _aSvcImplName, aServices[i], xRegKey );
+// }
+// return bResult;
+// }
}
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile
index 05880e3acf72..09d8246b14e0 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile
+++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile
@@ -49,17 +49,11 @@ SAMPLE_OBJ_OUT=$(OUT_OBJ)/$(SAMPLE_NAME)
APP1_NAME=office_connect
APP1_BINARY=$(OUT_BIN)/$(APP1_NAME)$(EXE_EXT)
-APP1_RDB=$(OUT_BIN)/office_connect.rdb
-APP1_ENV_FLAG = $(SAMPLE_GEN_OUT)/cpp_$(SAMPLE_NAME)_prepare_env.flag
APP2_NAME=string_samples
APP2_BINARY=$(OUT_BIN)/$(APP2_NAME)$(EXE_EXT)
-ifeq "$(OS)" "WIN"
-INI_EXTENSION=.ini
-else
-INI_EXTENSION=rc
-endif
+ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(OFFICE_TYPES)
CXXFILES = \
office_connect.cxx \
@@ -72,14 +66,6 @@ ALL : \
include $(SETTINGS)/stdtarget.mk
-$(OUT_BIN)/%$(INI_EXTENSION) : %$(INI_EXTENSION)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- $(COPY) $< $(subst /,$(PS),$@)
-
-$(OUT_BIN)/%.rdb :
- -$(MKDIR) $(subst /,$(PS),$(@D))
- $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES)
-
$(SAMPLE_OBJ_OUT)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(SAMPLE_INC_OUT) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
@@ -98,27 +84,16 @@ ifeq "$(OS)" "MACOSX"
endif
endif
-$(OUT_BIN)/office_connect$(EXE_EXT) : $(APP1_ENV_FLAG) $(OUT_BIN)/office_connect$(INI_EXTENSION) $(SAMPLE_OBJ_OUT)/office_connect.$(OBJ_EXT)
+$(OUT_BIN)/office_connect$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/office_connect.$(OBJ_EXT)
$(OUT_BIN)/string_samples$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/string_samples.$(OBJ_EXT)
-$(APP1_ENV_FLAG) : $(APP1_RDB)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
- @echo --------------------------------------------------------------------------------
- @echo Register necessary runtime components in $(APP1_RDB)
- @echo --------------------------------------------------------------------------------
- $(REGCOMP) -register -r $(APP1_RDB) -c connector.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(APP1_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(APP1_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(APP1_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
- @echo bla > $@
-
-
ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY)
@echo --------------------------------------------------------------------------------
@echo Note: For the "$(QM)$(APP1_NAME)$(QM)" example you need a running office listening
- @echo $(SQM) $(SQM)on port 2083. Before you run the example you have to start your office with
+ @echo $(SQM) $(SQM)on port 2083. The example use the defaultBootstrap_InitialComponentContext method and provides
+ @echo $(SQM) $(SQM)the additional office types via the UNO environment variable -env:URE_MORE_TYPES=...
+ @echo $(SQM) $(SQM)Before you can run this example you have to start your office in listening mode.
@echo -
@echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
@echo -----
@@ -131,6 +106,9 @@ ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY)
%.run: $(OUT_BIN)/%$(EXE_EXT)
cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
+$(API1_NAME).run: $(API1_BINARY)
+ cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_OFFICE_TYPES)
+
.PHONY: clean
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_INC_OUT))
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini
deleted file mode 100644
index c10b97b57bd3..000000000000
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-UNO_TYPES=$SYSBINDIR/office_connect.rdb
-UNO_SERVICES=$SYSBINDIR/office_connect.rdb \ No newline at end of file
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc
deleted file mode 100644
index ab2c6f10b7e5..000000000000
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc
+++ /dev/null
@@ -1,2 +0,0 @@
-UNO_TYPES=$SYSBINDIR/office_connect.rdb
-UNO_SERVICES=$SYSBINDIR/office_connect.rdb
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components
new file mode 100644
index 000000000000..6212c72d4215
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="ExampleAddIn.uno.jar">
+ <implementation name="ExampleAddIn$_ExampleAddIn">
+ <service name="com.sun.star.sheet.AddIn"/>
+ <service name="org.openoffice.sheet.addin.ExampleAddIn"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 44f17a50c83d..d44de20e345e 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
@@ -116,7 +116,7 @@ public class ExampleAddIn
{
static private final String aExampleService = "org.openoffice.sheet.addin.ExampleAddIn";
static private final String aAddInService = "com.sun.star.sheet.AddIn";
- static private final String aImplName = "ExampleAddIn";
+ static private final String aImplName = _ExampleAddIn.class.getName();
private static final short FUNCTION_INVALID = -1;
private static final short FUNCTION_INCREMENT = 0;
@@ -301,14 +301,18 @@ public class ExampleAddIn
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey regKey)
- {
- // register for both the base AddIn and the own service
- return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _ExampleAddIn.aImplName, _ExampleAddIn.aExampleService, regKey)
- && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _ExampleAddIn.aImplName, _ExampleAddIn.aAddInService, regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// com.sun.star.registry.XRegistryKey regKey)
+// {
+// // register for both the base AddIn and the own service
+// return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _ExampleAddIn.aImplName, _ExampleAddIn.aExampleService, regKey)
+// && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _ExampleAddIn.aImplName, _ExampleAddIn.aAddInService, regKey);
+// }
}
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components
new file mode 100644
index 000000000000..f0881c1f5570
--- /dev/null
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="ExampleDataPilotSource.uno.jar">
+ <implementation name="ExampleDataPilotSource$_ExampleDataPilotSource">
+ <service name="com.sun.star.sheet.DataPilotSource"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
index 80f5ff15a4d2..8c827d0cc2f8 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
@@ -765,7 +765,7 @@ public class ExampleDataPilotSource
com.sun.star.lang.XServiceInfo
{
static private final String aServiceName = "com.sun.star.sheet.DataPilotSource";
- static private final String aImplName = "ExampleDataPilotSource";
+ static private final String aImplName = _ExampleDataPilotSource.class.getName();
private ExampleSettings aSettings = new ExampleSettings();
private ExampleDimensions aDimensions;
@@ -780,27 +780,34 @@ public class ExampleDataPilotSource
{
// If the first argument (Source) is a number between 2 and 10,
// use it as member count, otherwise keep the default value.
- if ( aArguments.length >= 1 )
+ try
{
- String aSource = (String) aArguments[0];
- if ( aSource != null )
- {
- try
- {
- int nValue = Integer.parseInt( aSource );
- if ( nValue >= 2 && nValue <= 10 )
- aSettings.nMemberCount = nValue;
- }
- catch ( NumberFormatException e )
- {
- System.out.println( "Error: caught exception in " +
- "ExampleDataPilotSource.initialize!\nException Message = "
- + e.getMessage());
- e.printStackTrace();
- }
- }
+ if ( aArguments.length >= 1 )
+ {
+ String aSource = com.sun.star.uno.AnyConverter.toString(aArguments[0]);
+ if ( aSource != null && aSource.length() > 0)
+ {
+ int nValue = Integer.parseInt( aSource );
+ if ( nValue >= 2 && nValue <= 10 )
+ aSettings.nMemberCount = nValue;
}
}
+ }
+ catch ( NumberFormatException e )
+ {
+ System.out.println( "Error: caught exception in " +
+ "ExampleDataPilotSource.initialize!\nException Message = "
+ + e.getMessage());
+ e.printStackTrace();
+ }
+ catch ( com.sun.star.lang.IllegalArgumentException e )
+ {
+ System.out.println( "Error: caught exception in " +
+ "ExampleDataPilotSource.initialize!\nException Message = "
+ + e.getMessage());
+ e.printStackTrace();
+ }
+ }
// XDataPilotResults
@@ -970,12 +977,16 @@ public class ExampleDataPilotSource
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey regKey)
- {
- return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- _ExampleDataPilotSource.aImplName,
- _ExampleDataPilotSource.aServiceName, regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(
+// com.sun.star.registry.XRegistryKey regKey)
+// {
+// return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
+// _ExampleDataPilotSource.aImplName,
+// _ExampleDataPilotSource.aServiceName, regKey);
+// }
}
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/Makefile b/odk/examples/DevelopersGuide/Spreadsheet/Makefile
index 3c1748327bac..84fdd9432dd8 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/Makefile
+++ b/odk/examples/DevelopersGuide/Spreadsheet/Makefile
@@ -59,6 +59,7 @@ COMP1_JAR=$(SAMPLE_CLASS_OUT)/$(COMP1_JAR_NAME)
COMP1_MANIFESTFILE=$(COMP1_GEN_OUT)/$(COMP1_NAME).uno.Manifest
COMP1_UNOPKG_MANIFEST=$(COMP1_GEN_OUT)/$(COMP1_NAME)/META-INF/manifest.xml
COMP1_REGISTERFLAG=$(SAMPLE_GEN_OUT)/devguide_$(COMP1_NAME)_register_component.flag
+COMP1_COMPONENTS=$(COMP1_NAME).components
# Example DataPilot component
COMP2_NAME=ExampleDataPilotSource
@@ -71,6 +72,7 @@ COMP2_JAR=$(SAMPLE_CLASS_OUT)/$(COMP2_JAR_NAME)
COMP2_MANIFESTFILE=$(COMP2_GEN_OUT)/$(COMP2_NAME).uno.Manifest
COMP2_UNOPKG_MANIFEST=$(COMP2_GEN_OUT)/$(COMP2_NAME)/META-INF/manifest.xml
COMP2_REGISTERFLAG=$(SAMPLE_GEN_OUT)/devguide_$(COMP2_NAME)_register_component.flag
+COMP2_COMPONENTS=$(COMP2_NAME).components
#REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(SAMPLE_NAME)_register_component.flag
@@ -176,8 +178,8 @@ $(COMP1_UNOPKG_MANIFEST) :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(COMP1_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(COMP1_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP1_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
$(COMP2_UNOPKG_MANIFEST) :
@@ -185,22 +187,24 @@ $(COMP2_UNOPKG_MANIFEST) :
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(COMP2_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP2_COMPONENTS)$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
-$(COMP1_PACKAGE) : $(COMP1_RDB) $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST)
+$(COMP1_PACKAGE) : $(COMP1_RDB) $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST) $(COMP1_COMPONENTS)
echo "####" $(@)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP1_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP1_COMPONENTS)
+ cd $(subst /,$(PS),$(COMP1_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP1_JAR_NAME)
cd $(subst /,$(PS),$(COMP1_GEN_OUT)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../../bin/$(@F) META-INF/manifest.xml
-$(COMP2_PACKAGE) : $(COMP2_JAR) $(COMP2_UNOPKG_MANIFEST)
+$(COMP2_PACKAGE) : $(COMP2_JAR) $(COMP2_UNOPKG_MANIFEST) $(COMP2_COMPONENTS)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP2_COMPONENTS)
+ cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(COMP2_GEN_OUT)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../../bin/$(@F) META-INF/manifest.xml
$(SAMPLE_GEN_OUT)/devguide_$(COMP1_NAME)_register_component.flag : $(OUT_BIN)/$(COMP1_NAME).$(UNOOXT_EXT)
diff --git a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
index a2ea5b4f9107..02eabbc5c3c5 100644
--- a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
+++ b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
@@ -48,6 +48,7 @@
#include <osl/file.hxx>
#include <osl/process.h>
+#include <rtl/process.h>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
@@ -71,35 +72,21 @@ using namespace com::sun::star::registry;
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
OUString sConnectionString(RTL_CONSTASCII_USTRINGPARAM("uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"));
- if (argc < 2)
+
+ sal_Int32 nCount = (sal_Int32)rtl_getAppCommandArgCount();
+
+ if (nCount < 1)
{
- printf("using: DocumentLoader <file_url> [<uno_connection_url>]\n\n"
- "example: DocumentLoader \"file:///e:/temp/test.odt\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n");
+ printf("using: DocumentLoader -env:URE_MORE_TYPES=<office_types_rdb_url> <file_url> [<uno_connection_url>]\n\n"
+ "example: DocumentLoader -env:URE_MORE_TYPES=\"file:///.../basis-link/program/offapi.rdb\" \"file:///e:/temp/test.odt\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n");
exit(1);
}
- if (argc == 3)
+ if (nCount == 2)
{
- sConnectionString = OUString::createFromAscii(argv[2]);
+ rtl_getAppCommandArg(1, &sConnectionString.pData);
}
- // Creates a simple registry service instance.
- Reference< XSimpleRegistry > xSimpleRegistry(
- ::cppu::createSimpleRegistry() );
-
- // Connects the registry to a persistent data source represented by an URL.
- xSimpleRegistry->open( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "DocumentLoader.rdb") ), sal_True, sal_False );
-
- /* Bootstraps an initial component context with service manager upon a given
- registry. This includes insertion of initial services:
- - (registry) service manager, shared lib loader,
- - simple registry, nested registry,
- - implementation registration
- - registry typedescription provider, typedescription manager (also
- installs it into cppu core)
- */
- Reference< XComponentContext > xComponentContext(
- ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) );
+ Reference< XComponentContext > xComponentContext(::cppu::defaultBootstrap_InitialComponentContext());
/* Gets the service manager instance to be used (or null). This method has
been added for convenience, because the service manager is a often used
@@ -151,9 +138,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
/* Loads a component specified by an URL into the specified new or existing
frame.
*/
- OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl;
+ OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl, sArgDocUrl;
+ rtl_getAppCommandArg(0, &sArgDocUrl.pData);
+
osl_getProcessWorkingDir(&sWorkingDir.pData);
- osl::FileBase::getFileURLFromSystemPath( OUString::createFromAscii(argv[1]), sDocPathUrl);
+ osl::FileBase::getFileURLFromSystemPath( sArgDocUrl, sDocPathUrl);
osl::FileBase::getAbsoluteFileURL( sWorkingDir, sDocPathUrl, sAbsoluteDocUrl);
Reference< XComponent > xComponent = xComponentLoader->loadComponentFromURL(
diff --git a/odk/examples/cpp/DocumentLoader/Makefile b/odk/examples/cpp/DocumentLoader/Makefile
index 91e6f49ce41e..6cbd8bdd8e92 100644
--- a/odk/examples/cpp/DocumentLoader/Makefile
+++ b/odk/examples/cpp/DocumentLoader/Makefile
@@ -43,19 +43,17 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMPONENT_NAME=DocumentLoader
-COMPONENT_RDB_NAME = $(COMPONENT_NAME).rdb
-COMPONENT_RDB = $(OUT_BIN)/$(COMPONENT_RDB_NAME)
OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME)
OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME)
-COMPOENNT_ENV_FLAG = $(OUT_MISC)/cpp_$(COMPONENT_NAME)_prepare_env.flag
-
CXXFILES = DocumentLoader.cxx
OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
+ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(OFFICE_TYPES)
+
# Targets
.PHONY: ALL
ALL : \
@@ -63,12 +61,6 @@ ALL : \
include $(SETTINGS)/stdtarget.mk
-# This example type library will be extended by the URE and office types
-$(OUT_BIN)/%.rdb :
- -$(MKDIR) $(subst /,$(PS),$(@D))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
- $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES)
-
$(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
@@ -87,41 +79,30 @@ ifeq "$(OS)" "MACOSX"
endif
endif
-$(COMPOENNT_ENV_FLAG) : $(COMPONENT_RDB)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
- @echo --------------------------------------------------------------------------------
- @echo Register necessary runtime components in the DocumentLoader.rdb
- @echo --------------------------------------------------------------------------------
- $(REGCOMP) -register -r $(COMPONENT_RDB) -c connector.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMPONENT_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMPONENT_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMPONENT_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
- @echo bla > $@
-
-CppDocumentLoaderExample : $(OUT_BIN)/DocumentLoader$(EXE_EXT) $(COMPOENNT_ENV_FLAG)
+CppDocumentLoaderExample : $(OUT_BIN)/DocumentLoader$(EXE_EXT)
@echo --------------------------------------------------------------------------------
@echo The example loads the "$(QM)test.odt$(QM)" document in the DocumentLoader example directory.
- @echo I you want to load your own document, please use: DocumentLoader "$(QM)filename$(QM)" [connection_url]
+ @echo If you want to load your own document, please use:
+ @echo $(SQM) $(SQM)DocumentLoader -env:URE_MORE_TYPES="$(QM)<fileurl_office_types_rdb>$(QM)" "$(QM)filename$(QM)" [connection_url]
@echo -
@echo Use the following command to execute the example!
@echo -
@echo $(MAKE) DocumentLoader.run
@echo -
@echo NOTE: This example does not use the new UNO bootstrap mechanism, it uses still a socket
- @echo $(SQM) $(SQM)connection. Before you can run this example you have to start your office in listening mode.
+ @echo $(SQM) $(SQM)connection. The example use the defaultBootstrap_InitialComponentContext method and provides
+ @echo $(SQM) $(SQM)the additional office types via the UNO environment variable -env:URE_MORE_TYPES=...
+ @echo $(SQM) $(SQM)Before you can run this example you have to start your office in listening mode.
@echo -
@echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
@echo --------------------------------------------------------------------------------
%.run: $(OUT_BIN)/DocumentLoader$(EXE_EXT)
- cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt"))
+ cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_OFFICE_TYPES) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt"))
.PHONY: clean
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPOENNT_ENV_FLAG)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_RDB)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/DocumentLoader*))
diff --git a/odk/examples/cpp/complextoolbarcontrols/Makefile b/odk/examples/cpp/complextoolbarcontrols/Makefile
index a21590d03d67..8e6223305346 100644
--- a/odk/examples/cpp/complextoolbarcontrols/Makefile
+++ b/odk/examples/cpp/complextoolbarcontrols/Makefile
@@ -51,8 +51,8 @@ COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml
COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
-
-REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
+COMP_REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag
COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag
CXXFILES = \
@@ -79,12 +79,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
$(CC) $(CC_FLAGS) $(STL_INCLUDES) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
+#$(COMP_MAPFILE) : $(SLOFILES)
+# -$(MKDIR) $(subst /,$(PS),$(@D))
+# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
+#ifeq "$(OS)" "MACOSX"
+# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
+#endif
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
@@ -95,7 +95,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -114,24 +115,42 @@ $(OUT_COMP_GEN)/%/manifest.xml :
@echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)WriterWindowState.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:meda-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)CalcWindowState.xcu$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
+
+# @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
+# @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
+$(COMP_COMPONENTS) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)vnd.My.impl.NewDocListener$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)vnd.My.NewDocListener$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)vnd.demo.Impl.ProtocolHandler$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)vnd.demo.ProtocolHandler$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
# rule for component package file
-$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu WriterWindowState.xcu CalcWindowState.xcu $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu WriterWindowState.xcu CalcWindowState.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
- cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_NAME).components
+ cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
$(SDK_ZIP) -u $@ Addons.xcu ProtocolHandler.xcu WriterWindowState.xcu CalcWindowState.xcu logo_small.png logo_big.png
cd $(subst /,$(PS),$(OUT_COMP_GEN)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
-$(REGISTERFLAG) : $(COMP_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
$(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@@ -144,14 +163,14 @@ else
@echo --------------------------------------------------------------------------------
endif
-Example : $(REGISTERFLAG)
+Example : $(COMP_REGISTERFLAG)
@echo --------------------------------------------------------------------------------
@echo The "$(QM)ProtocolHandler$(QM)" addon component was installed if SDK_AUTO_DEPLOYMENT = YES.
@echo You can use this component inside your office installation, see the example
@echo description.
@echo --------------------------------------------------------------------------------
-run: $(COMP1_REGISTERFLAG)
+run: $(COMP1_COMP_REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice" -writer
@@ -161,6 +180,6 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
diff --git a/odk/examples/cpp/complextoolbarcontrols/exports.cxx b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
index 5f79bda6b080..4c365fc7ffe7 100644
--- a/odk/examples/cpp/complextoolbarcontrols/exports.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
@@ -41,17 +41,17 @@
namespace css = ::com::sun::star;
-static void writeInfo(const css::uno::Reference< css::registry::XRegistryKey >& xRegistryKey ,
- const char* pImplementationName,
- const char* pServiceName )
-{
- ::rtl::OUStringBuffer sKey(256);
- sKey.append (::rtl::OUString::createFromAscii(pImplementationName));
- sKey.appendAscii("/UNO/SERVICES/");
- sKey.append (::rtl::OUString::createFromAscii(pServiceName));
-
- xRegistryKey->createKey(sKey.makeStringAndClear());
-}
+// static void writeInfo(const css::uno::Reference< css::registry::XRegistryKey >& xRegistryKey ,
+// const char* pImplementationName,
+// const char* pServiceName )
+// {
+// ::rtl::OUStringBuffer sKey(256);
+// sKey.append (::rtl::OUString::createFromAscii(pImplementationName));
+// sKey.appendAscii("/UNO/SERVICES/");
+// sKey.append (::rtl::OUString::createFromAscii(pServiceName));
+
+// xRegistryKey->createKey(sKey.makeStringAndClear());
+// }
extern "C"
{
@@ -62,27 +62,30 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
+// This method not longer necessary since OOo 3.4 where the component registration was
+// was changed to passive component registration. For more details see
+// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
//==================================================================================================
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* pServiceManager,
- void* pRegistryKey )
-{
- if (!pRegistryKey)
- return sal_False;
-
- try
- {
- css::uno::Reference< css::registry::XRegistryKey > xKey(reinterpret_cast< css::registry::XRegistryKey* >(pRegistryKey), css::uno::UNO_QUERY);
-
- writeInfo( xKey, MYLISTENER_IMPLEMENTATIONNAME , MYLISTENER_SERVICENAME );
- writeInfo( xKey, MYPROTOCOLHANDLER_IMPLEMENTATIONNAME, MYPROTOCOLHANDLER_SERVICENAME );
-
- return sal_True;
- }
- catch(const css::registry::InvalidRegistryException&)
- { OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); }
-
- return sal_False;
-}
+// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* pServiceManager,
+// void* pRegistryKey )
+// {
+// if (!pRegistryKey)
+// return sal_False;
+
+// try
+// {
+// css::uno::Reference< css::registry::XRegistryKey > xKey(reinterpret_cast< css::registry::XRegistryKey* >(pRegistryKey), css::uno::UNO_QUERY);
+
+// writeInfo( xKey, MYLISTENER_IMPLEMENTATIONNAME , MYLISTENER_SERVICENAME );
+// writeInfo( xKey, MYPROTOCOLHANDLER_IMPLEMENTATIONNAME, MYPROTOCOLHANDLER_SERVICENAME );
+
+// return sal_True;
+// }
+// catch(const css::registry::InvalidRegistryException&)
+// { OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); }
+
+// return sal_False;
+// }
//==================================================================================================
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplName ,
diff --git a/odk/examples/cpp/counter/Makefile b/odk/examples/cpp/counter/Makefile
index 5e7f620a645c..161145f7dea6 100644
--- a/odk/examples/cpp/counter/Makefile
+++ b/odk/examples/cpp/counter/Makefile
@@ -43,15 +43,18 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=counter
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME)
COMP_RDB_NAME = $(COMP_NAME).uno.rdb
COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME)
-COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME)
OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME)
OUT_COMP_OBJ = $(OUT_OBJ)/$(COMP_NAME)
OUT_COMP_SLO = $(OUT_SLO)/$(COMP_NAME)
+COMP_SERVICES=$(SHAREDLIB_OUT)/counterservices.rdb
+
+ENV_EXAMPLE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(COMP_RDB)
+ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=$(URLPREFIX)$(COMP_SERVICES)
COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag
@@ -84,12 +87,12 @@ $(OUT_BIN)/%.rdb : $(GENURDFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
$(REGMERGE) $@ /UCR $(GENURDFILES)
- $(REGMERGE) $@ / $(URE_TYPES)
+# $(REGMERGE) $@ / $(URE_TYPES)
$(COMP_TYPEFLAG) : $(COMP_RDB) $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
- $(CPPUMAKER) -Gc -BUCR -O$(OUT_COMP_INC) $(TYPESLIST) $(COMP_RDB)
+ $(CPPUMAKER) -Gc -BUCR -O$(OUT_COMP_INC) $(TYPESLIST) $(COMP_RDB) -X $(URE_TYPES)
echo flagged > $@
$(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG)
@@ -102,13 +105,6 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
-
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
@@ -118,7 +114,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -138,16 +134,33 @@ else
$(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB)
endif
+$(COMP_SERVICES) :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.example.cpp.Counter$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)foo.Counter$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
-CppCounterExample : $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL)
+CppCounterExample : $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL) $(COMP_SERVICES)
@echo --------------------------------------------------------------------------------
@echo Please use the following command to execute the example!
@echo -
@echo $(MAKE) countermain.run
+ @echo -
+ @echo NOTE: The example makes use of the URE and use the defaultBootstrap_InitialComponentContext method.
+ @echo $(SQM) $(SQM)The additional example IDL types are provided via the UNO environment variable -env:URE_MORE_TYPES=...
+ @echo $(SQM) $(SQM)and the example component is made available via -env:URE_MORE_SERVICES=...
+ @echo $(SQM) $(SQM)Please check the generated $(QM)$(COMP_SERVICES)$(QM) to see how you can specify your own components in such an environment
+ @echo $(SQM) $(SQM)and how to use the passive UNO registration.
@echo --------------------------------------------------------------------------------
%.run: $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL)
- cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@)
+ cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_EXAMPLE_TYPES) $(ENV_COMP_SERVICES)
.PHONY: clean
clean :
@@ -159,3 +172,4 @@ clean :
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_RDB)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/countermain*))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_SERVICES)))
diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx
index 0e6dbd0c5eb2..1029fab1f964 100644
--- a/odk/examples/cpp/counter/counter.cxx
+++ b/odk/examples/cpp/counter/counter.cxx
@@ -167,7 +167,7 @@ Reference< XInterface > SAL_CALL MyCounterImpl_create(
/**
* Gives the environment this component belongs to.
*/
-extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
@@ -179,33 +179,33 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char *
* @param pServiceManager the service manager
* @param pRegistryKey the registry key
*/
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey)
-{
- sal_Bool result = sal_False;
-
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME "/UNO/SERVICES") ) ) );
-
- const Sequence< OUString > & rSNL =
- MyCounterImpl::getSupportedServiceNames_Static();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- // we should not ignore exceptions
- }
- }
- return result;
-}
+// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey)
+// {
+// sal_Bool result = sal_False;
+
+// if (pRegistryKey)
+// {
+// try
+// {
+// Reference< XRegistryKey > xNewKey(
+// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
+// OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME "/UNO/SERVICES") ) ) );
+
+// const Sequence< OUString > & rSNL =
+// MyCounterImpl::getSupportedServiceNames_Static();
+// const OUString * pArray = rSNL.getConstArray();
+// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+// xNewKey->createKey( pArray[nPos] );
+
+// return sal_True;
+// }
+// catch (InvalidRegistryException &)
+// {
+// // we should not ignore exceptions
+// }
+// }
+// return result;
+// }
/**
* This function is called to get service factories for an implementation.
@@ -215,7 +215,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
* @param pRegistryKey the registry key for this component, need for persistent data
* @return a component factory
*/
-extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
{
void * pRet = 0;
diff --git a/odk/examples/cpp/counter/countermain.cxx b/odk/examples/cpp/counter/countermain.cxx
index 0fb4bb1f0ddb..aaaa5f1af7ba 100644
--- a/odk/examples/cpp/counter/countermain.cxx
+++ b/odk/examples/cpp/counter/countermain.cxx
@@ -68,55 +68,37 @@ using namespace ::rtl;
//=======================================================================
SAL_IMPLEMENT_MAIN()
{
- Reference< XSimpleRegistry > xReg = createSimpleRegistry();
- OSL_ENSURE( xReg.is(), "### cannot get service instance of \"com.sun.star.regiystry.SimpleRegistry\"!" );
-
- xReg->open(OUString::createFromAscii("counter.uno.rdb"), sal_False, sal_False);
- OSL_ENSURE( xReg->isValid(), "### cannot open test registry \"counter.uno.rdb\"!" );
-
- Reference< XComponentContext > xContext = bootstrap_InitialComponentContext(xReg);
- OSL_ENSURE( xContext.is(), "### cannot creage intial component context!" );
-
- Reference< XMultiComponentFactory > xMgr = xContext->getServiceManager();
- OSL_ENSURE( xMgr.is(), "### cannot get initial service manager!" );
-
- // register my counter component
- Reference< XImplementationRegistration > xImplReg(
- xMgr->createInstanceWithContext(OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration"), xContext), UNO_QUERY);
- OSL_ENSURE( xImplReg.is(), "### cannot get service instance of \"com.sun.star.registry.ImplementationRegistration\"!" );
-
- if (xImplReg.is())
- {
- xImplReg->registerImplementation(
- OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), // loader for component
-#ifdef UNX
-#ifdef MACOSX
- OUString::createFromAscii("counter.uno.dylib"), // component location
-#else
- OUString::createFromAscii("counter.uno.so"), // component location
-#endif
-#else
- OUString::createFromAscii("counter.uno.dll"), // component location
-#endif
- Reference< XSimpleRegistry >() // registry omitted,
- // defaulting to service manager registry used
- );
-
- // get a counter instance
- Reference< XInterface > xx ;
- xx = xMgr->createInstanceWithContext(OUString::createFromAscii("foo.Counter"), xContext);
+ try {
+
+ Reference< XComponentContext > xContext(::cppu::defaultBootstrap_InitialComponentContext());
+ OSL_ENSURE( xContext.is(), "### bootstrap failed!\n" );
+
+ Reference< XMultiComponentFactory > xMgr = xContext->getServiceManager();
+ OSL_ENSURE( xMgr.is(), "### cannot get initial service manager!" );
+
+ Reference< XInterface > xx = xMgr->createInstanceWithContext(
+ OUString::createFromAscii("foo.Counter"), xContext);
+
+ OSL_ENSURE( xx.is(), "### cannot get service instance of \"foo.Counter\"!" );
+
Reference< XCountable > xCount( xx, UNO_QUERY );
- OSL_ENSURE( xCount.is(), "### cannot get service instance of \"foo.Counter\"!" );
+ OSL_ENSURE( xCount.is(), "### cannot query XCountable interface of service instance \"foo.Counter\"!" );
if (xCount.is())
{
- xCount->setCount( 42 );
- fprintf( stdout , "%d," , xCount->getCount() );
- fprintf( stdout , "%d," , xCount->increment() );
- fprintf( stdout , "%d\n" , xCount->decrement() );
+ xCount->setCount( 42 );
+ fprintf( stdout , "%d," , (int)xCount->getCount() );
+ fprintf( stdout , "%d," , (int)xCount->increment() );
+ fprintf( stdout , "%d\n" , (int)xCount->decrement() );
}
+
+ Reference< XComponent >::query( xContext )->dispose();
+
+ } catch( Exception& e) {
+ printf("Error: caught exception:\n %s\n",
+ OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr());
+ exit(1);
}
- Reference< XComponent >::query( xContext )->dispose();
return 0;
}
diff --git a/odk/examples/cpp/remoteclient/Makefile b/odk/examples/cpp/remoteclient/Makefile
index 40d51deb7cf1..96b2ef9b12cd 100644
--- a/odk/examples/cpp/remoteclient/Makefile
+++ b/odk/examples/cpp/remoteclient/Makefile
@@ -43,17 +43,18 @@ include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=remoteclientsample
-COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME)
COMP_RDB_NAME = $(COMP_NAME).uno.rdb
COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME)
-COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+COMP_SERVICES=$(SHAREDLIB_OUT)/remoteclientsample.rdb
+
+ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=$(URLPREFIX)$(COMP_SERVICES)
OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME)
OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
-COMP_ENV_FLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_prepare_env.flag
COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag
CXXFILES = remoteclient.cxx
@@ -77,13 +78,6 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
-$(COMP_MAPFILE) : $(SLOFILES)
- -$(MKDIR) $(subst /,$(PS),$(@D))
- cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
-ifeq "$(OS)" "MACOSX"
- nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
-endif
-
ifeq "$(OS)" "WIN"
$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
@@ -93,7 +87,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib
$(LINK_MANIFEST)
else
-$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE)
+$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
@@ -102,40 +96,41 @@ ifeq "$(OS)" "MACOSX"
endif
endif
-$(COMP_ENV_FLAG) : $(COMP_RDB) $(OUT_BIN)/remoteserver.rdb
+$(COMP_SERVICES) :
-$(MKDIR) $(subst /,$(PS),$(@D))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
- @echo --------------------------------------------------------------------------------
- @echo Register necessary runtime components in remoteserver/remoteclientsample rdb
- @echo --------------------------------------------------------------------------------
- $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c connector.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c remotebridge.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c bridgefac.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c uuresolver.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c streams.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMP_RDB) -c connector.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMP_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMP_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT)
- $(REGCOMP) -register -r $(COMP_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT)
- @echo bla > $@
-
-CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG)
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.product.example.RemoteClientSample$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.bridge.example.RemoteClientSample$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
+ @echo $(OSEP)/components$(CSEP) >> $@
+
+
+#CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG)
+CppClientExample : $(COMP_IMPL) $(COMP_SERVICES)
@echo --------------------------------------------------------------------------------
@echo The remoteclient C++ component can be used by using the uno binary. Use the
@echo the follwong command to start the example. The run target starts a remote
@echo server and connect with the client to this server.
@echo -
@echo $(MAKE) remoteclient.run
+ @echo -
+ @echo NOTE: The example uses the $(QM)uno$(QM) tool to prepare a working UNO environment.
+ @echo $(SQM) $(SQM)The example component is made available via -env:URE_MORE_SERVICES=...
+ @echo $(SQM) $(SQM)Please check the generated $(QM)$(COMP_SERVICES)$(QM) to see how you can specify your own components in such an environment
+ @echo $(SQM) $(SQM)and how to use the passive UNO registration.
@echo --------------------------------------------------------------------------------
-%.run: $(COMP_IMPL) $(COMP_ENV_FLAG)
+%.run: $(COMP_IMPL)
@echo Start the remote server process ...
@echo -
ifeq "$(OS)" "WIN"
- start uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \
+ start uno $(ENV_COMP_SERVICES) --singleaccept -s com.sun.star.io.Pipe \
-u "uno:socket,host=localhost,port=2083;urp;MyPipe"
else
- uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \
+ uno $(ENV_COMP_SERVICES) --singleaccept -s com.sun.star.io.Pipe \
-u "uno:socket,host=localhost,port=2083;urp;MyPipe" &
@echo waiting on the server process ...
sleep 5
@@ -145,8 +140,8 @@ endif
@echo -
@echo Start remote client process ...
@echo -
- uno -l $(COMP_IMPL) -c com.sun.star.comp.product.example.RemoteClientSample \
- -rw $(COMP_RDB) -- "uno:socket,host=localhost,port=2083;urp;MyPipe"
+ uno $(ENV_COMP_SERVICES) -s com.sun.star.bridge.example.RemoteClientSample \
+ -- "uno:socket,host=localhost,port=2083;urp;MyPipe"
@echo -
.PHONY: clean
@@ -154,7 +149,7 @@ clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_ENV_FLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_SERVICES)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb))
+# -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb))
diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx
index cbec4d4bf84c..324f27d0bcec 100644
--- a/odk/examples/cpp/remoteclient/remoteclient.cxx
+++ b/odk/examples/cpp/remoteclient/remoteclient.cxx
@@ -227,39 +227,41 @@ using namespace remotebridges_officeclient;
extern "C"
{
//==================================================================================================
-void SAL_CALL component_getImplementationEnvironment(
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
- const Sequence< OUString > & rSNL = getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
+//==================================================================================================
+// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+// void * pServiceManager, void * pRegistryKey )
+// {
+// if (pRegistryKey)
+// {
+// try
+// {
+// Reference< XRegistryKey > xNewKey(
+// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
+// OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
+
+// const Sequence< OUString > & rSNL = getSupportedServiceNames();
+// const OUString * pArray = rSNL.getConstArray();
+// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+// xNewKey->createKey( pArray[nPos] );
+
+// return sal_True;
+// }
+// catch (InvalidRegistryException &)
+// {
+// OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+// }
+// }
+// return sal_False;
+// }
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
//==================================================================================================
-void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
void * pRet = 0;
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile b/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile
index 6b75f4ed72ac..62fb17e5e0ac 100644..100755
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile
@@ -57,6 +57,7 @@ COMP_JAR=$(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
PACKAGE = org/openoffice/examples/embedding
@@ -99,18 +100,19 @@ $(COMP_GEN_OUT)/%/manifest.xml :
-$(MKDIR) $(subst /,$(PS),$(@D))
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).uno.jar$(QM)"/$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(SAMPLE_NAME).xcu$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(SDK_ZIP) $@ $(COMP_JAR_NAME) $(SAMPLE_NAME).xcu
- cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) $@ $(COMP_JAR_NAME)
+ $(SDK_ZIP) $@ $(SAMPLE_NAME).xcu
+ $(SDK_ZIP) $@ -u $(COMP_NAME).components
+ cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u $@ $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u $@ META-INF/manifest.xml
$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components
new file mode 100644
index 000000000000..421706f7418f
--- /dev/null
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="OwnEmbeddedObject.uno.jar">
+ <implementation name="org.openoffice.examples.embedding.OwnEmbeddedObjectFactory">
+ <service name="org.openoffice.examples.embedding.Factory69474366FD6F480683748EDD1B6E771D"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
index fd8f2793c9c5..a146e04d3ca1 100755
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
@@ -37,11 +37,15 @@ public final class OwnEmbeddedObjectFactory extends WeakBase
return xFactory;
}
- public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {
- return Factory.writeRegistryServiceInfo(m_implementationName,
- m_serviceNames,
- xRegistryKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {
+// return Factory.writeRegistryServiceInfo(m_implementationName,
+// m_serviceNames,
+// xRegistryKey);
+// }
// com.sun.star.lang.XServiceInfo:
public String getImplementationName() {
diff --git a/odk/examples/java/MinimalComponent/Makefile b/odk/examples/java/MinimalComponent/Makefile
index 8fd4ade8fb9d..23530a89358d 100644
--- a/odk/examples/java/MinimalComponent/Makefile
+++ b/odk/examples/java/MinimalComponent/Makefile
@@ -61,6 +61,7 @@ COMP_JAR=$(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
APP1_NAME=TestMinimalComponent
APP1_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP1_NAME)
@@ -152,19 +153,20 @@ $(COMP_JAR) : $(COMP_JAR_MANIFEST) $(COMP_CLASSFILES)
$(COMP_GEN_OUT)/%/manifest.xml :
-$(MKDIR) $(subst /,$(PS),$(@D))
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
- @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
- @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP)>> $@
+ @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP)>> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP)>> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $(COMP_RDB_NAME)
+ $(SDK_ZIP) $@ $(COMP_NAME).components
+ cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) $(COMP_RDB_NAME)
cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.components b/odk/examples/java/MinimalComponent/MinimalComponent.components
new file mode 100644
index 000000000000..9e413f2b64a2
--- /dev/null
+++ b/odk/examples/java/MinimalComponent/MinimalComponent.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="MinimalComponent.uno.jar">
+ <implementation name="MinimalComponent$_MinimalComponent">
+ <service name="org.openoffice.MinimalComponent"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.java b/odk/examples/java/MinimalComponent/MinimalComponent.java
index 47129efc00d2..d4811ab29f1a 100644
--- a/odk/examples/java/MinimalComponent/MinimalComponent.java
+++ b/odk/examples/java/MinimalComponent/MinimalComponent.java
@@ -163,9 +163,13 @@ public class MinimalComponent {
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return Factory.writeRegistryServiceInfo(_MinimalComponent.class.getName(),
- _MinimalComponent.getServiceNames(),
- regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// return Factory.writeRegistryServiceInfo(_MinimalComponent.class.getName(),
+// _MinimalComponent.getServiceNames(),
+// regKey);
+// }
}
diff --git a/odk/examples/java/PropertySet/Makefile b/odk/examples/java/PropertySet/Makefile
index 0a382d15042e..7a79f340d79c 100644
--- a/odk/examples/java/PropertySet/Makefile
+++ b/odk/examples/java/PropertySet/Makefile
@@ -52,6 +52,7 @@ COMP_JAR=$(COMP_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_JAR_MANIFEST=$(COMP_CLASS_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
COMP_JAVAFILES = PropTest.java
@@ -89,15 +90,16 @@ $(COMP_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(<F)
+ $(SDK_ZIP) $@ $(COMP_NAME).components
+ cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) META-INF/manifest.xml
diff --git a/odk/examples/java/PropertySet/PropTest.components b/odk/examples/java/PropertySet/PropTest.components
new file mode 100644
index 000000000000..320e3511c335
--- /dev/null
+++ b/odk/examples/java/PropertySet/PropTest.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="PropTest.uno.jar">
+ <implementation name="PropTest">
+ <service name="PropTest"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/java/PropertySet/PropTest.java b/odk/examples/java/PropertySet/PropTest.java
index e8652c7689bb..396cb15b084a 100644
--- a/odk/examples/java/PropertySet/PropTest.java
+++ b/odk/examples/java/PropertySet/PropTest.java
@@ -257,9 +257,13 @@ public class PropTest extends PropertySet implements XServiceInfo
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
- {
- return FactoryHelper.writeRegistryServiceInfo( PropTest.class.getName(),
- PropTest.__serviceName, regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
+// {
+// return FactoryHelper.writeRegistryServiceInfo( PropTest.class.getName(),
+// PropTest.__serviceName, regKey);
+// }
}
diff --git a/odk/examples/java/Spreadsheet/CalcAddins.components b/odk/examples/java/Spreadsheet/CalcAddins.components
new file mode 100644
index 000000000000..c16c4a3a99e7
--- /dev/null
+++ b/odk/examples/java/Spreadsheet/CalcAddins.components
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="CalcAddins.uno.jar">
+ <implementation name="CalcAddins$_CalcAddins">
+ <service name="org.openoffice.sheet.addin.CalcAddins"/>
+ <service name="com.sun.star.sheet.AddIn"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/java/Spreadsheet/CalcAddins.java b/odk/examples/java/Spreadsheet/CalcAddins.java
index 6a052a7e2eea..58de5d492869 100644
--- a/odk/examples/java/Spreadsheet/CalcAddins.java
+++ b/odk/examples/java/Spreadsheet/CalcAddins.java
@@ -295,10 +295,14 @@ public class CalcAddins {
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(),
- _CalcAddins.__serviceName, regKey)
- && FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(),
- _CalcAddins.ADDIN_SERVICE, regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// return FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(),
+// _CalcAddins.__serviceName, regKey)
+// && FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(),
+// _CalcAddins.ADDIN_SERVICE, regKey);
+// }
}
diff --git a/odk/examples/java/Spreadsheet/Makefile b/odk/examples/java/Spreadsheet/Makefile
index 4a251ae2062b..52d73a4406ca 100644
--- a/odk/examples/java/Spreadsheet/Makefile
+++ b/odk/examples/java/Spreadsheet/Makefile
@@ -53,16 +53,17 @@ APP2_JAR=$(OUT_COMP_CLASS)/$(APP2_NAME).jar
APP3_NAME=ChartTypeChange
APP3_JAR=$(OUT_COMP_CLASS)/$(APP3_NAME).jar
-COMPONENT_NAME=CalcAddins
-COMPONENT_RDB_NAME=$(COMPONENT_NAME).uno.rdb
-COMPONENT_RDB=$(OUT_COMP_GEN)/$(COMPONENT_RDB_NAME)
-COMPONENT_PACKAGE=$(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT)
-COMPONENT_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)")
-COMPONENT_JAR_NAME=$(COMPONENT_NAME).uno.jar
-COMPONENT_JAR=$(OUT_COMP_CLASS)/$(COMPONENT_JAR_NAME)
-COMPONENT_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest
-COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml
-REGISTERFLAG=$(OUT_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag
+COMP_NAME=CalcAddins
+COMP_RDB_NAME=$(COMP_NAME).uno.rdb
+COMP_RDB=$(OUT_COMP_GEN)/$(COMP_RDB_NAME)
+COMP_PACKAGE=$(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME=$(COMP_NAME).uno.jar
+COMP_JAR=$(OUT_COMP_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_REGISTERFLAG=$(OUT_MISC)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
IDLFILES = XCalcAddins.idl
@@ -80,11 +81,11 @@ GENURDFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/%.urd,$(IDLFILES))
COMPCLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(COMPJAVAFILES))
#COMPCLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class))
-$(COMPONENT_NAME)_CLASSFILES = $(COMPONENT_NAME).class \
- $(COMPONENT_NAME)$(QUOTE)$$_$(COMPONENT_NAME).class
+$(COMP_NAME)_CLASSFILES = $(COMP_NAME).class \
+ $(COMP_NAME)$(QUOTE)$$_$(COMP_NAME).class
-#$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class))
-$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES))
+#$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class))
+$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES))
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_COMP_CLASS))
@@ -110,10 +111,10 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(REGMERGE) $@ /UCR $(GENURDFILES)
-#$(OUT_COMP_GEN)/%.java : $(COMPONENT_RDB)
-$(GENCLASSFILES) : $(COMPONENT_RDB)
+#$(OUT_COMP_GEN)/%.java : $(COMP_RDB)
+$(GENCLASSFILES) : $(COMP_RDB)
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMPONENT_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
+ $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMP_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES)
$(OUT_COMP_CLASS)/%.class : %.java
-$(MKDIR) $(subst /,$(PS),$(@D))
@@ -139,7 +140,7 @@ $(OUT_COMP_CLASS)/%.jar : $(OUT_COMP_CLASS)/%.mf $(OUT_COMP_CLASS)/%.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
# rule for component jar file
-$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(COMPCLASSFILES)
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(COMPCLASSFILES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
@@ -152,24 +153,25 @@ $(OUT_COMP_CLASS)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_CLASS))
- cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME)
+ $(SDK_ZIP) $@ -u $(COMP_NAME).components
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_COMP_CLASS)/$(<F)))
-$(REGISTERFLAG) : $(COMPONENT_PACKAGE)
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL)
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@@ -183,7 +185,7 @@ $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(APP1_NAME).c
$(APP2_JAR) : $(OUT_COMP_CLASS)/$(APP2_NAME).mf $(OUT_COMP_CLASS)/$(APP2_NAME).class
$(APP3_JAR) : $(OUT_COMP_CLASS)/$(APP3_NAME).mf $(OUT_COMP_CLASS)/$(APP3_NAME).class
-$(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
+$(EXAMPLE_NAME) : $(COMP_REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
@echo --------------------------------------------------------------------------------
@echo Please use the following command to execute the examples!
@echo -
@@ -202,12 +204,12 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
%.run: $(OUT_COMP_CLASS)/%.jar
$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
-CalcAddins.ods.load : $(REGISTERFLAG)
+CalcAddins.ods.load : $(COMP_REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@)
.PHONY: clean
clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL)))
- -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))
diff --git a/odk/examples/java/ToDo/Makefile b/odk/examples/java/ToDo/Makefile
index 476ff6620dbc..d597e969aa24 100644
--- a/odk/examples/java/ToDo/Makefile
+++ b/odk/examples/java/ToDo/Makefile
@@ -54,6 +54,7 @@ COMP_JAR=$(COMP_CLASS_OUT)/$(COMP_JAR_NAME)
COMP_JAR_MANIFEST=$(COMP_CLASS_OUT)/$(COMP_NAME).uno.Manifest
COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
IDLFILES = XToDo.idl \
ToDo.idl
@@ -121,15 +122,16 @@ $(COMP_GEN_OUT)/%/manifest.xml :
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@
@echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@
- @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@
- @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
# rule for component package file
-$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST)
+$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(@D))
- cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_RDB_NAME)
+ $(SDK_ZIP) $@ $(COMP_NAME).components
+ cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME)
cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME)
cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) META-INF/manifest.xml
diff --git a/odk/examples/java/ToDo/ToDo.components b/odk/examples/java/ToDo/ToDo.components
new file mode 100644
index 000000000000..0b667b96a87e
--- /dev/null
+++ b/odk/examples/java/ToDo/ToDo.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="ToDo.uno.jar">
+ <implementation name="ToDo$ToDoImpl">
+ <service name="org.openoffice.ToDo"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java
index 87257c406903..780c001e346e 100644
--- a/odk/examples/java/ToDo/ToDo.java
+++ b/odk/examples/java/ToDo/ToDo.java
@@ -957,9 +957,13 @@ public class ToDo {
* @param regKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return Factory.writeRegistryServiceInfo(ToDoImpl.class.getName(),
- ToDoImpl.getServiceNames(), regKey);
- }
+ // This method not longer necessary since OOo 3.4 where the component registration
+ // was changed to passive component registration. For more details see
+ // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration
+
+// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+// return Factory.writeRegistryServiceInfo(ToDoImpl.class.getName(),
+// ToDoImpl.getServiceNames(), regKey);
+// }
}
diff --git a/odk/settings/component.uno.def b/odk/settings/component.uno.def
index 72a4eb2fa96d..d0c2def3434e 100644
--- a/odk/settings/component.uno.def
+++ b/odk/settings/component.uno.def
@@ -1,4 +1,3 @@
EXPORTS
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk
index 188ff880255e..748800b265c1 100644
--- a/odk/settings/settings.mk
+++ b/odk/settings/settings.mk
@@ -79,6 +79,7 @@ EMPTYSTRING=
PATH_SEPARATOR=;
# use this for release version
+CC_FLAGS_JNI=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa
CC_FLAGS=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa
ifeq "$(CPP_MANIFEST)" "true"
#CC_FLAGS+=-EHa -Zc:wchar_t-
@@ -88,6 +89,7 @@ else
LINK_MANIFEST=
endif
ifeq "$(DEBUG)" "yes"
+CC_FLAGS_JNI+=-Zi
CC_FLAGS+=-Zi
endif
@@ -98,6 +100,7 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu
# define for used compiler necessary for UNO
# -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
+CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
CC_OUTPUT_SWITCH=-Fo
@@ -196,8 +199,10 @@ endif
EMPTYSTRING=
PATH_SEPARATOR=:
-CC_FLAGS=-c -KPIC
+CC_FLAGS_JNI=-c -KPIC
+CC_FLAGS=-c -KPIC -xldscope=hidden
ifeq "$(DEBUG)" "yes"
+CC_FLAGS_JNI+=-g
CC_FLAGS+=-g
endif
CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
@@ -207,15 +212,17 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu
# define for used compiler necessary for UNO
# -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
-CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5
+CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
+CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE
CC_OUTPUT_SWITCH=-o
-LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R $$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
+LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
# means if used CC is lower then version 5.5 use option -instance=static
ifeq ($(OO_SDK_CC_55_OR_HIGHER),)
LIBRARY_LINK_FLAGS+=-instances=static
endif
-COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
+#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
+COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
@@ -334,11 +341,15 @@ endif
EMPTYSTRING=
PATH_SEPARATOR=:
+CC_FLAGS_JNI=-c -fpic
+CC_FLAGS=-c -fpic -fvisibility=hidden
# -O is necessary for inlining (see gcc documentation)
ifeq "$(DEBUG)" "yes"
-CC_FLAGS=-c -g -fpic
+CC_FLAGS_JNI+=-g
+CC_FLAGS+=-g
else
-CC_FLAGS=-c -O -fpic
+CC_FLAGS_JNI+=-O
+CC_FLAGS+=-O
endif
ifeq "$(PROCTYPE)" "ppc"
@@ -348,7 +359,8 @@ endif
SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux"
CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
-CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
# define for used compiler necessary for UNO
#-DCPPU_ENV=gcc2 -- gcc 2.91/2.95
@@ -361,7 +373,8 @@ LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
ifeq "$(PROCTYPE)" "ppc"
LIBRARY_LINK_FLAGS+=-fPIC
endif
-COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
+#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
+COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
#EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive
@@ -387,7 +400,12 @@ PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
# Default is MacOSX on a Intel machine
PLATFORM=macosx
-ifeq "$(PROCTYPE)" "i686"
+ifeq "$(PROCTYPE)" "i386"
+PACKAGE_LIB_DIR=macosx_x86.plt
+UNOPKG_PLATFORM=MacOSX_x86
+JAVA_PROC_TYPE=x86
+else
+ifeq "$(PROCTYPE)" "x86_64"
PACKAGE_LIB_DIR=macosx_x86.plt
UNOPKG_PLATFORM=MacOSX_x86
JAVA_PROC_TYPE=x86
@@ -396,6 +414,7 @@ PACKAGE_LIB_DIR=macosx_ppc.plt
UNOPKG_PLATFORM=MacOSX_PowerPC
JAVA_PROC_TYPE=ppc
endif
+endif
JAVABIN=Commands
GCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2)
@@ -457,17 +476,22 @@ INSTALL_NAME_URELIBS_BIN=install_name_tool -change @____________________________
EMPTYSTRING=
PATH_SEPARATOR=:
+CC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION)
+CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden
# -O is necessary for inlining (see gcc documentation)
ifeq "$(DEBUG)" "yes"
-CC_FLAGS=-malign-natural -c -g -fPIC -fno-common $(GCC_ARCH_OPTION)
+CC_FLAGS_JNI+=-g
+CC_FLAGS+=-g
else
-CC_FLAGS=-malign-natural -c -O -fPIC -fno-common $(GCC_ARCH_OPTION)
+CC_FLAGS_JNI+=-O
+CC_FLAGS+=-O
endif
SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
-CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
CC_OUTPUT_SWITCH=-o
@@ -475,7 +499,8 @@ LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(G
#-fPIC -fno-common
# install_name '@executable_path$/(@:f)'
-COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE)
+#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE)
+COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
@@ -578,22 +603,28 @@ endif
EMPTYSTRING=
PATH_SEPARATOR=:
+CC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS)
+CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden
# -O is necessary for inlining (see gcc documentation)
ifeq "$(DEBUG)" "yes"
-CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS)
+CC_FLAGS_JNI+=-g
+CC_FLAGS+=-g
else
-CC_FLAGS=-c -O -fPIC -DPIC $(PTHREAD_CFLAGS)
+CC_FLAGS_JNI+=-O
+CC_FLAGS+=-O
endif
SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
-CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
CC_OUTPUT_SWITCH=-o
LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
-COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
+#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
+COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
#EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
diff --git a/odk/util/check.pl b/odk/util/check.pl
index 6bf3fdd62b2f..490210c382b8 100644
--- a/odk/util/check.pl
+++ b/odk/util/check.pl
@@ -347,7 +347,9 @@ if (-d "$StartDir") {
"animations",
"auth",
"awt",
+ "awt/tab",
"awt/tree",
+ "awt/grid",
"beans",
"bridge",
"bridge/oleautomation",
diff --git a/odk/util/makefile.pmk b/odk/util/makefile.pmk
index deb4e6d62c5e..39fea4880062 100644
--- a/odk/util/makefile.pmk
+++ b/odk/util/makefile.pmk
@@ -26,7 +26,7 @@
#*************************************************************************
# used for sdk common files
-PRODUCT_RELEASE=3.3
+PRODUCT_RELEASE=3.4
OFFICENAME=OpenOffice.org
SDKDIRNAME=openoffice.org$(PRODUCT_RELEASE)_sdk
OFFICEPRODUCTNAME=$(OFFICENAME) $(PRODUCT_RELEASE)
diff --git a/offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl b/offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl
index 95afd25a634d..645925c312f6 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module accessibility {
<type>XAccessibleText</type> interface and extents it with a notion
of line numbers</p>
- @since OOo 3.0.0
+ @since OOo 3.0
*/
/// not yet published
diff --git a/offapi/com/sun/star/animations/XAnimationListener.idl b/offapi/com/sun/star/animations/XAnimationListener.idl
index 1a71cae3457b..d1f4f453ee60 100644
--- a/offapi/com/sun/star/animations/XAnimationListener.idl
+++ b/offapi/com/sun/star/animations/XAnimationListener.idl
@@ -43,7 +43,7 @@
/** makes it possible to register listeners, which are called whenever
an animation event occurs.
- @since #i71351#
+ @since OOo 3.0
*/
interface XAnimationListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/awt/EnhancedMouseEvent.idl b/offapi/com/sun/star/awt/EnhancedMouseEvent.idl
index f866397e0613..99f0ee3c8b01 100644
--- a/offapi/com/sun/star/awt/EnhancedMouseEvent.idl
+++ b/offapi/com/sun/star/awt/EnhancedMouseEvent.idl
@@ -42,7 +42,7 @@
@see MouseEvent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published struct EnhancedMouseEvent: com::sun::star::awt::MouseEvent
diff --git a/offapi/com/sun/star/awt/UnoControlButtonModel.idl b/offapi/com/sun/star/awt/UnoControlButtonModel.idl
index bbcf7000157e..8b1b7bee2052 100644
--- a/offapi/com/sun/star/awt/UnoControlButtonModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlButtonModel.idl
@@ -95,7 +95,7 @@ published service UnoControlButtonModel
If set to <FALSE/>, the focus is preserved when the user operates the button control with
the mouse.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean FocusOnClick;
@@ -183,7 +183,7 @@ published service UnoControlButtonModel
/** specifies that the text may be displayed on more than one line.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean MultiLine;
@@ -208,7 +208,7 @@ published service UnoControlButtonModel
set to <TRUE/>, the button is repeatedly pressed while you hold
down the mouse button.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -222,7 +222,7 @@ published service UnoControlButtonModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -261,7 +261,7 @@ published service UnoControlButtonModel
<p>The default for this property is <FALSE/>, which means the button behaves like a usual
push button.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Toggle;
@@ -269,7 +269,7 @@ published service UnoControlButtonModel
/** specifies the vertical alignment of the text in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
diff --git a/offapi/com/sun/star/awt/UnoControlCheckBoxModel.idl b/offapi/com/sun/star/awt/UnoControlCheckBoxModel.idl
index 7870f03f4aec..e6eb9754175d 100644
--- a/offapi/com/sun/star/awt/UnoControlCheckBoxModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlCheckBoxModel.idl
@@ -65,7 +65,7 @@ published service UnoControlCheckBoxModel
2: right
</pre>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short Align;
@@ -155,7 +155,7 @@ published service UnoControlCheckBoxModel
/** specifies that the text may be displayed on more than one line.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean MultiLine;
@@ -205,7 +205,7 @@ published service UnoControlCheckBoxModel
/** specifies the vertical alignment of the text in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
@@ -218,7 +218,7 @@ published service UnoControlCheckBoxModel
@see com::sun::star::awt::VisualEffect
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short VisualEffect;
diff --git a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl
index eedd7b78c346..c332d19c989a 100644
--- a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl
@@ -96,7 +96,7 @@ published service UnoControlComboBoxModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -149,7 +149,7 @@ published service UnoControlComboBoxModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
diff --git a/offapi/com/sun/star/awt/UnoControlContainerModel.idl b/offapi/com/sun/star/awt/UnoControlContainerModel.idl
index 9fda3791781f..1fa71bcf1b7c 100644
--- a/offapi/com/sun/star/awt/UnoControlContainerModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlContainerModel.idl
@@ -79,7 +79,7 @@ published service UnoControlContainerModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl b/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl
index 1789e23fff32..b9ee632dad73 100644
--- a/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl
@@ -80,7 +80,7 @@ published service UnoControlCurrencyFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -139,7 +139,7 @@ published service UnoControlCurrencyFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -167,7 +167,7 @@ published service UnoControlCurrencyFieldModel
/** specifies whether the mouse should show repeating behaviour, i.e.
repeatedly trigger an action when keeping pressed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -181,7 +181,7 @@ published service UnoControlCurrencyFieldModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -267,7 +267,7 @@ published service UnoControlCurrencyFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl b/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl
index 193f1a325b72..d134d0fc450c 100644
--- a/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl
@@ -80,7 +80,7 @@ published service UnoControlDateFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -180,7 +180,7 @@ published service UnoControlDateFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -201,7 +201,7 @@ published service UnoControlDateFieldModel
/** specifies whether the mouse should show repeating behaviour, i.e.
repeatedly trigger an action when keeping pressed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -215,7 +215,7 @@ published service UnoControlDateFieldModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -241,7 +241,7 @@ published service UnoControlDateFieldModel
/** specifies the text displayed in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string Text;
@@ -279,7 +279,7 @@ published service UnoControlDateFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlDialogModel.idl b/offapi/com/sun/star/awt/UnoControlDialogModel.idl
index ff6188e5276e..f8970413cdd3 100644
--- a/offapi/com/sun/star/awt/UnoControlDialogModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlDialogModel.idl
@@ -161,7 +161,7 @@ published service UnoControlDialogModel
/** If set to true the dialog will have the desktop as parent.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
[optional, property] boolean DesktopAsParent;
@@ -169,7 +169,7 @@ published service UnoControlDialogModel
background image.
@see Graphic
- @since OOo 2.4.0
+ @since OOo 2.4
*/
[optional, property] string ImageURL;
@@ -184,7 +184,7 @@ published service UnoControlDialogModel
to an empty string.</li>
</ul></p>
- @since OOo 2.4.0
+ @since OOo 2.4
*/
[optional, property, transient] com::sun::star::graphic::XGraphic Graphic;
diff --git a/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl b/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl
index a91065f72d66..e153c8c47370 100644
--- a/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl
+++ b/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module awt {
/** specifies a service to load a dialog model and allows to access the control models inside
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service UnoControlDialogModelProvider : com::sun::star::container::XNameContainer
{
diff --git a/offapi/com/sun/star/awt/UnoControlEditModel.idl b/offapi/com/sun/star/awt/UnoControlEditModel.idl
index 2cd7a55725f5..dffbae58da48 100644
--- a/offapi/com/sun/star/awt/UnoControlEditModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlEditModel.idl
@@ -72,7 +72,7 @@ published service UnoControlEditModel
/** If set to true an horizontal scrollbar will be added automaticly
when needed.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
[optional, property] boolean AutoHScroll;
@@ -81,7 +81,7 @@ published service UnoControlEditModel
/** If set to true an vertical scrollbar will be added automaticly
when needed.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
[optional, property] boolean AutoVScroll;
@@ -110,7 +110,7 @@ published service UnoControlEditModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -170,7 +170,7 @@ published service UnoControlEditModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -196,7 +196,7 @@ published service UnoControlEditModel
No matter which line end format is used in this new text then, usual control implementations
should recognize all line end formats and display them properly.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short LineEndFormat;
@@ -218,7 +218,7 @@ published service UnoControlEditModel
/** specifies whether the control paints it background or not.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
[optional, property] boolean PaintTransparent;
@@ -279,7 +279,7 @@ published service UnoControlEditModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlFileControlModel.idl b/offapi/com/sun/star/awt/UnoControlFileControlModel.idl
index e609a51512ae..cec080c3fcb2 100644
--- a/offapi/com/sun/star/awt/UnoControlFileControlModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlFileControlModel.idl
@@ -80,7 +80,7 @@ published service UnoControlFileControlModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -127,7 +127,7 @@ published service UnoControlFileControlModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -173,7 +173,7 @@ published service UnoControlFileControlModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlFixedHyperlinkModel.idl b/offapi/com/sun/star/awt/UnoControlFixedHyperlinkModel.idl
index 8d5938d21f6f..e4a6bd3dbd58 100644
--- a/offapi/com/sun/star/awt/UnoControlFixedHyperlinkModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlFixedHyperlinkModel.idl
@@ -93,7 +93,7 @@ service UnoControlFixedHyperlinkModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -175,7 +175,7 @@ service UnoControlFixedHyperlinkModel
/** specifies the vertical alignment of the text in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl b/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl
index b6981556a8f4..84e8311fbc32 100644
--- a/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl
@@ -93,7 +93,7 @@ published service UnoControlFixedTextModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -169,7 +169,7 @@ published service UnoControlFixedTextModel
/** specifies the vertical alignment of the text in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
diff --git a/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl b/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl
index 9ada06455b1e..0f61b6910b7d 100644
--- a/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl
@@ -96,7 +96,7 @@ published service UnoControlFormattedFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -196,7 +196,7 @@ published service UnoControlFormattedFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -226,7 +226,7 @@ published service UnoControlFormattedFieldModel
/** specifies whether the mouse should show repeating behaviour, i.e.
repeatedly trigger an action when keeping pressed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -240,7 +240,7 @@ published service UnoControlFormattedFieldModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -312,7 +312,7 @@ published service UnoControlFormattedFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlImageControlModel.idl b/offapi/com/sun/star/awt/UnoControlImageControlModel.idl
index aadf3074fcbe..7e6dfa8641be 100644
--- a/offapi/com/sun/star/awt/UnoControlImageControlModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlImageControlModel.idl
@@ -75,7 +75,7 @@ published service UnoControlImageControlModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl
index 1ecf338bf095..3a9ea516c257 100644
--- a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl
@@ -91,7 +91,7 @@ published service UnoControlListBoxModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl b/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl
index fd3b4c0877bb..5b019d7f82c5 100644
--- a/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl
@@ -80,7 +80,7 @@ published service UnoControlNumericFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -133,7 +133,7 @@ published service UnoControlNumericFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -155,7 +155,7 @@ published service UnoControlNumericFieldModel
/** specifies whether the mouse should show repeating behaviour, i.e.
repeatedly trigger an action when keeping pressed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -169,7 +169,7 @@ published service UnoControlNumericFieldModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -255,7 +255,7 @@ published service UnoControlNumericFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl b/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl
index 8b4b6ccf601c..2f9f09fd5b3f 100644
--- a/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl
@@ -80,7 +80,7 @@ published service UnoControlPatternFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -133,7 +133,7 @@ published service UnoControlPatternFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -214,7 +214,7 @@ published service UnoControlPatternFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/UnoControlProgressBarModel.idl b/offapi/com/sun/star/awt/UnoControlProgressBarModel.idl
index 1ffb7ace534a..3d54d391e3db 100644
--- a/offapi/com/sun/star/awt/UnoControlProgressBarModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlProgressBarModel.idl
@@ -73,7 +73,7 @@ published service UnoControlProgressBarModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/awt/UnoControlRadioButtonModel.idl b/offapi/com/sun/star/awt/UnoControlRadioButtonModel.idl
index 6676e98e7e6e..cd8568f956ea 100644
--- a/offapi/com/sun/star/awt/UnoControlRadioButtonModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlRadioButtonModel.idl
@@ -66,7 +66,7 @@ published service UnoControlRadioButtonModel
2: right
</pre>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short Align;
@@ -156,7 +156,7 @@ published service UnoControlRadioButtonModel
/** specifies that the text may be displayed on more than one line.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean MultiLine;
@@ -199,7 +199,7 @@ published service UnoControlRadioButtonModel
/** specifies the vertical alignment of the text in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
@@ -212,7 +212,7 @@ published service UnoControlRadioButtonModel
@see com::sun::star::awt::VisualEffect
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short VisualEffect;
diff --git a/offapi/com/sun/star/awt/UnoControlScrollBarModel.idl b/offapi/com/sun/star/awt/UnoControlScrollBarModel.idl
index 3a190405430f..d81e25e369f7 100644
--- a/offapi/com/sun/star/awt/UnoControlScrollBarModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlScrollBarModel.idl
@@ -52,7 +52,7 @@ published service UnoControlScrollBarModel
/** specifies the RGB color to be used for the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::util::Color BackgroundColor;
@@ -81,7 +81,7 @@ published service UnoControlScrollBarModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -118,7 +118,7 @@ published service UnoControlScrollBarModel
<FALSE/> means, that the window is only updated after the user has
released the mouse button.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean LiveScroll;
@@ -144,7 +144,7 @@ published service UnoControlScrollBarModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -174,7 +174,7 @@ published service UnoControlScrollBarModel
/** specifies the RGB color to be used when painting symbols which are
part of the control's appearance, such as the arrow buttons.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] com::sun::star::util::Color SymbolColor;
@@ -182,7 +182,7 @@ published service UnoControlScrollBarModel
/** specifies that the control can be reached with the TAB key.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Tabstop;
diff --git a/offapi/com/sun/star/awt/UnoControlSpinButtonModel.idl b/offapi/com/sun/star/awt/UnoControlSpinButtonModel.idl
index cb55a369a15d..c2e4eca935e1 100644..100755
--- a/offapi/com/sun/star/awt/UnoControlSpinButtonModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlSpinButtonModel.idl
@@ -76,7 +76,7 @@ service UnoControlSpinButtonModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl b/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl
index 2673e152bb00..ba62cca41c7f 100644
--- a/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl
@@ -80,7 +80,7 @@ published service UnoControlTimeFieldModel
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
@@ -127,7 +127,7 @@ published service UnoControlTimeFieldModel
/** specifies whether the selection in the control should be hidden when
the control is not active (focused).
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean HideInactiveSelection;
@@ -148,7 +148,7 @@ published service UnoControlTimeFieldModel
/** specifies whether the mouse should show repeating behaviour, i.e.
repeatedly trigger an action when keeping pressed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean Repeat;
@@ -162,7 +162,7 @@ published service UnoControlTimeFieldModel
mouse button and to press it again. The delay between two such triggers
is specified with this property.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RepeatDelay;
@@ -188,7 +188,7 @@ published service UnoControlTimeFieldModel
/** specifies the text displayed in the control.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string Text;
@@ -259,7 +259,7 @@ published service UnoControlTimeFieldModel
/** specifies the vertical alignment of the text in the control.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional, property] com::sun::star::style::VerticalAlignment VerticalAlign;
};
diff --git a/offapi/com/sun/star/awt/XEnhancedMouseClickHandler.idl b/offapi/com/sun/star/awt/XEnhancedMouseClickHandler.idl
index 547bab7c6efc..64dde0ed9390 100644
--- a/offapi/com/sun/star/awt/XEnhancedMouseClickHandler.idl
+++ b/offapi/com/sun/star/awt/XEnhancedMouseClickHandler.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module awt {
/** makes it possible to receive enhanced events from the mouse.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XEnhancedMouseClickHandler: ::com::sun::star::lang::XEventListener
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
index db69a6b5d842..36e41d9384f9 100644
--- a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
+++ b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
@@ -38,7 +38,7 @@
//=============================================================================
/** If you do not want to implement the <type>XGridColumnModel</type> yourself, use this service.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service DefaultGridColumnModel
{
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
index 8c2726f42851..c802db2f870e 100644
--- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
@@ -43,7 +43,7 @@
<p>The implementation will implicitly increase its column count if you add a row which has more values than
the current column count.</p>
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service DefaultGridDataModel : ::com::sun::star::awt::grid::XMutableGridDataModel;
diff --git a/offapi/com/sun/star/awt/grid/GridColumn.idl b/offapi/com/sun/star/awt/grid/GridColumn.idl
index a87aef84f7d3..383ff37eb673 100644
--- a/offapi/com/sun/star/awt/grid/GridColumn.idl
+++ b/offapi/com/sun/star/awt/grid/GridColumn.idl
@@ -39,7 +39,7 @@
/** Represents a column as used by the <type>DefaultGridColumnModel</type>
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service GridColumn
{
diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
index 4ab6e71caf51..22380b944a83 100644
--- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
/** An event used by a <type>XGridColumn</type> to notify changes in the column.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
struct GridColumnEvent: com::sun::star::lang::EventObject
{
diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
index 3ac05f0ec1ae..7430f3d97e66 100644
--- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module awt { module grid {
@see XMutableGridDataModel
@see XGridDataListener
- @since OOo 3.3.0
+ @since OOo 3.3
*/
struct GridDataEvent: com::sun::star::lang::EventObject
{
diff --git a/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl
index af1f90dfdc8b..ab180207a187 100644
--- a/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl
+++ b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module awt { module grid {
/** Exception is thrown to indicate that set data is invalid, e.g. type of data is unknown
or data count doesn't match with column count.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
exception GridInvalidDataException : com::sun::star::uno::RuntimeException
{
diff --git a/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl
index 9d96daf624bb..791f691f20c6 100644
--- a/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl
+++ b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module awt { module grid {
/** Exception is thrown when data or column model isn't set.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
exception GridInvalidModelException : com::sun::star::uno::RuntimeException
{
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
index 542c27085dcb..5141e8a52cce 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
@@ -66,7 +66,7 @@
The <type>XGridSelection</type> interface provides a bunch of methods to set and get selection for the grid control.
</p>
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service UnoControlGrid
{
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
index a348d4b3e23c..02b4d93f621d 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module awt { module grid {
/** specifies the standard model of a <type>UnoControlGrid</type> control.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
service UnoControlGridModel
{
diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl
index a73025d7715a..aa69a83441ea 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumn.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
/** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridColumn
{
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
index 9a8a02eca8f2..09ac590ba3f2 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid {
/** An instance of this interface is used by the <type>XGridColumnModel</type> to
get notifications about column model changes.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridColumnListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
index 257f597fc7d2..434be67ed3f8 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module awt { module grid {
If you do not need your own model implementation, you can also use the <type>DefaultGridColumnModel</type>.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridColumnModel
{
diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl
index 3c2c3d241528..b742c1acb484 100644
--- a/offapi/com/sun/star/awt/grid/XGridControl.idl
+++ b/offapi/com/sun/star/awt/grid/XGridControl.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid {
@see UnoControlGrid
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridControl : XGridSelection
{
diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
index 709f048c08ce..9a324aee2668 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module awt { module grid {
<p>Usually you must not implement this interface yourself, but you must notify it correctly if
you implement the <type>XGridDataModel</type> yourself</p>.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridDataListener: com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
index 1ff15e1310e0..469a4d1eb3bf 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module awt { module grid {
If you do not need your own model implementation, you can also use the <type>DefaultGridDataModel</type>.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XGridDataModel
{
diff --git a/offapi/com/sun/star/configuration/DefaultProvider.idl b/offapi/com/sun/star/configuration/DefaultProvider.idl
index b41bdeec33a5..0fc09a078acc 100644
--- a/offapi/com/sun/star/configuration/DefaultProvider.idl
+++ b/offapi/com/sun/star/configuration/DefaultProvider.idl
@@ -78,14 +78,14 @@ published service DefaultProvider
/** Enable setting/getting locale for Provider
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface com::sun::star::lang::XLocalizable;
/** Property to enable/disable asynchronous write-back from in-memory cache to backend(s)
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional,property] boolean EnableAsync;
diff --git a/offapi/com/sun/star/configuration/Update.idl b/offapi/com/sun/star/configuration/Update.idl
index 790a4bb40235..8cd52a1c1a77 100644
--- a/offapi/com/sun/star/configuration/Update.idl
+++ b/offapi/com/sun/star/configuration/Update.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module configuration {
<p>This singleton is unpublished and unstable.</p>
- @since OOo 3.3.0
+ @since OOo 3.3
*/
singleton Update: XUpdate;
diff --git a/offapi/com/sun/star/configuration/XUpdate.idl b/offapi/com/sun/star/configuration/XUpdate.idl
index c3316ea5dc45..16455528fc48 100644
--- a/offapi/com/sun/star/configuration/XUpdate.idl
+++ b/offapi/com/sun/star/configuration/XUpdate.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module configuration {
<p>This interface is unpublished and unstable.</p>
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XUpdate {
void insertExtensionXcsFile([in] boolean shared, [in] string fileUri);
diff --git a/offapi/com/sun/star/configuration/backend/InteractionHandler.idl b/offapi/com/sun/star/configuration/backend/InteractionHandler.idl
index 82a3595a6b08..108a3e0484c3 100644
--- a/offapi/com/sun/star/configuration/backend/InteractionHandler.idl
+++ b/offapi/com/sun/star/configuration/backend/InteractionHandler.idl
@@ -67,7 +67,7 @@ module com { module sun { module star { module configuration { module backend {
<LI>Approve, Disapprove, Abort</LI>
</UL></P>
- @since OOo 2.0.0
+ @since OOo 2.0
@see com::sun::star::task::InteractionHandler
*/
diff --git a/offapi/com/sun/star/configuration/backend/Layer.idl b/offapi/com/sun/star/configuration/backend/Layer.idl
index 8b9429810b15..545bddad641e 100644
--- a/offapi/com/sun/star/configuration/backend/Layer.idl
+++ b/offapi/com/sun/star/configuration/backend/Layer.idl
@@ -102,7 +102,7 @@ published service Layer
/**
The URL of the layer data.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[property,optional,readonly] string URL ;
diff --git a/offapi/com/sun/star/configuration/backend/LayerFilter.idl b/offapi/com/sun/star/configuration/backend/LayerFilter.idl
index ec5a209aa8ac..357b5ba6b2e7 100644
--- a/offapi/com/sun/star/configuration/backend/LayerFilter.idl
+++ b/offapi/com/sun/star/configuration/backend/LayerFilter.idl
@@ -54,7 +54,7 @@ module com { module sun { module star { module configuration { module backend {
@see com::sun::star::configuration::backend::DataImporter
Service that supports applying a <type>LayerFilter</type> to imported data.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service LayerFilter
{
diff --git a/offapi/com/sun/star/configuration/backend/MergeRecoveryRequest.idl b/offapi/com/sun/star/configuration/backend/MergeRecoveryRequest.idl
index c5d44ac4b7bf..133fc8080e66 100644
--- a/offapi/com/sun/star/configuration/backend/MergeRecoveryRequest.idl
+++ b/offapi/com/sun/star/configuration/backend/MergeRecoveryRequest.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module configuration { module backend {
/** is passed to an <type>InteractionHandler<type> when merging fails due to
invalid layer data or access problems.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception MergeRecoveryRequest: ::com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/configuration/backend/Schema.idl b/offapi/com/sun/star/configuration/backend/Schema.idl
index 873f7c464b15..61150a60435a 100644
--- a/offapi/com/sun/star/configuration/backend/Schema.idl
+++ b/offapi/com/sun/star/configuration/backend/Schema.idl
@@ -72,7 +72,7 @@ published service Schema
/**
The URL of the layer data.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[property,optional,readonly] string URL ;
diff --git a/offapi/com/sun/star/configuration/backend/StratumCreationException.idl b/offapi/com/sun/star/configuration/backend/StratumCreationException.idl
index f425118de937..825c81a254ef 100644
--- a/offapi/com/sun/star/configuration/backend/StratumCreationException.idl
+++ b/offapi/com/sun/star/configuration/backend/StratumCreationException.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module configuration { module backend {
/** is passed to an <type>InteractionHandler<type> when creating a stratum backend fails.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception StratumCreationException : BackendSetupException
{
diff --git a/offapi/com/sun/star/deployment/DeploymentException.idl b/offapi/com/sun/star/deployment/DeploymentException.idl
index 3c07d803a48a..fd40cf0e8aec 100644
--- a/offapi/com/sun/star/deployment/DeploymentException.idl
+++ b/offapi/com/sun/star/deployment/DeploymentException.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module deployment {
/** A DeploymentException reflects a deployment error.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception DeploymentException : com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/deployment/ExtensionManager.idl b/offapi/com/sun/star/deployment/ExtensionManager.idl
index 1911ce04dd81..4494da1a9d0f 100644
--- a/offapi/com/sun/star/deployment/ExtensionManager.idl
+++ b/offapi/com/sun/star/deployment/ExtensionManager.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module deployment {
/singletons/com.sun.star.deployment.ExtensionManager
</code>.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
singleton ExtensionManager : XExtensionManager;
diff --git a/offapi/com/sun/star/deployment/ExtensionRemovedException.idl b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl
index 1cd400e248d6..0d0e06c96977 100644
--- a/offapi/com/sun/star/deployment/ExtensionRemovedException.idl
+++ b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl
@@ -39,7 +39,7 @@ interface XPackage;
because the extension was removed. <member>XPackage::isRemoved</member> will
return true on that object.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
exception ExtensionRemovedException: com::sun::star::uno::Exception {
diff --git a/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl
index 0f0407b0e989..79599b7fb53b 100644
--- a/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl
+++ b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl
@@ -39,7 +39,7 @@ interface XPackage;
called with a different value for the <code>removed</code> parameter and that
the <type>XPackage</type> object created by that call still exist.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
exception InvalidRemovedParameterException: com::sun::star::uno::Exception {
/** the value of the <code>removed</code> parameter which was used in
diff --git a/offapi/com/sun/star/deployment/PackageRegistryBackend.idl b/offapi/com/sun/star/deployment/PackageRegistryBackend.idl
index 0ac85465284b..ee76030eb54b 100644
--- a/offapi/com/sun/star/deployment/PackageRegistryBackend.idl
+++ b/offapi/com/sun/star/deployment/PackageRegistryBackend.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module deployment {
are related to a <type>XPackageManager</type> instance.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service PackageRegistryBackend : XPackageRegistry
{
diff --git a/offapi/com/sun/star/deployment/PlatformException.idl b/offapi/com/sun/star/deployment/PlatformException.idl
index fca14c2f2c6a..c67b204a59fb 100644
--- a/offapi/com/sun/star/deployment/PlatformException.idl
+++ b/offapi/com/sun/star/deployment/PlatformException.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module deployment {
/** A DeploymentException indicates that the current platform
is not supported.
- @since OOo 3.0.0
+ @since OOo 3.0
*/
exception PlatformException : com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/deployment/XExtensionManager.idl b/offapi/com/sun/star/deployment/XExtensionManager.idl
index 679ba2ba5a66..b7528251d86c 100644
--- a/offapi/com/sun/star/deployment/XExtensionManager.idl
+++ b/offapi/com/sun/star/deployment/XExtensionManager.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module deployment {
in the user, shared and bundled repository.
@see ExtensionManager
- @since OOo 3.3.0
+ @since OOo 3.3
*/
interface XExtensionManager
{
diff --git a/offapi/com/sun/star/deployment/XPackage.idl b/offapi/com/sun/star/deployment/XPackage.idl
index a6a2f6adf851..ede234382974 100755
--- a/offapi/com/sun/star/deployment/XPackage.idl
+++ b/offapi/com/sun/star/deployment/XPackage.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module deployment {
/** Objects of this interface reflect a bound package and are issued by a
<type>PackageRegistryBackend</type>.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPackage
{
@@ -100,7 +100,7 @@ interface XPackage
After updateing the OpenOffice.org, some dependencies for packages might
no longer be satisfied.
- @since OOo 3.2.0
+ @since OOo 3.2
@param xCmdEnv
command environment for error handling and other interaction.
diff --git a/offapi/com/sun/star/deployment/XPackageManager.idl b/offapi/com/sun/star/deployment/XPackageManager.idl
index da329bb9367f..5ece66a87392 100644
--- a/offapi/com/sun/star/deployment/XPackageManager.idl
+++ b/offapi/com/sun/star/deployment/XPackageManager.idl
@@ -67,7 +67,7 @@ module com { module sun { module star { module deployment {
</p>
@see thePackageManagerFactory
- @since OOo 2.0.0
+ @since OOo 2.0
@deprecated
Use <type>XExtensionManager</type>.
*/
diff --git a/offapi/com/sun/star/deployment/XPackageManagerFactory.idl b/offapi/com/sun/star/deployment/XPackageManagerFactory.idl
index 4b5b7183ba47..f7e67543f4cd 100644
--- a/offapi/com/sun/star/deployment/XPackageManagerFactory.idl
+++ b/offapi/com/sun/star/deployment/XPackageManagerFactory.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module deployment {
exclusively.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@deprecated
Use <type>XExtensionManager</type>.
*/
diff --git a/offapi/com/sun/star/deployment/XPackageRegistry.idl b/offapi/com/sun/star/deployment/XPackageRegistry.idl
index a8e3f556781d..1ab29f0970ba 100644
--- a/offapi/com/sun/star/deployment/XPackageRegistry.idl
+++ b/offapi/com/sun/star/deployment/XPackageRegistry.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module deployment {
/** Interface to bind an UNO package.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPackageRegistry
{
diff --git a/offapi/com/sun/star/deployment/XPackageTypeInfo.idl b/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
index 7252f73d200b..9ba54160ade9 100644
--- a/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
+++ b/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module deployment {
/** Objects of this interface provide information about a package's type.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPackageTypeInfo
{
diff --git a/offapi/com/sun/star/deployment/thePackageManagerFactory.idl b/offapi/com/sun/star/deployment/thePackageManagerFactory.idl
index 85e95acea598..a0fbd4a35b7a 100644
--- a/offapi/com/sun/star/deployment/thePackageManagerFactory.idl
+++ b/offapi/com/sun/star/deployment/thePackageManagerFactory.idl
@@ -42,7 +42,7 @@ module com { module sun { module star { module deployment {
</code>.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@deprecated
Use <type>XExtensionManager</type>.
*/
diff --git a/offapi/com/sun/star/deployment/ui/PackageManagerDialog.idl b/offapi/com/sun/star/deployment/ui/PackageManagerDialog.idl
index 0f2b58d941f9..dc635ebb6347 100644
--- a/offapi/com/sun/star/deployment/ui/PackageManagerDialog.idl
+++ b/offapi/com/sun/star/deployment/ui/PackageManagerDialog.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module deployment { module ui {
packages of the user and shared installation as well as currently open
documents.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service PackageManagerDialog : com::sun::star::ui::dialogs::XAsynchronousExecutableDialog
{
diff --git a/offapi/com/sun/star/deployment/ui/UpdateRequiredDialog.idl b/offapi/com/sun/star/deployment/ui/UpdateRequiredDialog.idl
index 35b314b74f92..6e475539bab9 100644
--- a/offapi/com/sun/star/deployment/ui/UpdateRequiredDialog.idl
+++ b/offapi/com/sun/star/deployment/ui/UpdateRequiredDialog.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module deployment { module ui {
/** The <type>UpdateRequiredDialog</type> is used to show a list of extensions not compatible with this office version.
- @since OOo 3.2.0
+ @since OOo 3.2
*/
service UpdateRequiredDialog : com::sun::star::ui::dialogs::XExecutableDialog
{
diff --git a/offapi/com/sun/star/document/CorruptedFilterConfigurationException.idl b/offapi/com/sun/star/document/CorruptedFilterConfigurationException.idl
index af7116b085ea..e3fbf81c7223 100644
--- a/offapi/com/sun/star/document/CorruptedFilterConfigurationException.idl
+++ b/offapi/com/sun/star/document/CorruptedFilterConfigurationException.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module document {
/** This exception is thrown in case the global filter configuration
does not exists or contains corrupted data.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published exception CorruptedFilterConfigurationException : ::com::sun::star::uno::RuntimeException
{
diff --git a/offapi/com/sun/star/document/DocumentEvent.idl b/offapi/com/sun/star/document/DocumentEvent.idl
index 1ec7f599ad6a..caa717a8217a 100644
--- a/offapi/com/sun/star/document/DocumentEvent.idl
+++ b/offapi/com/sun/star/document/DocumentEvent.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module document {
anymore.</p>
@see XDocumentEventBroadcaster
- @since OpenOffice.org 3.1
+ @since OOo 3.1
*/
struct DocumentEvent : ::com::sun::star::lang::EventObject
{
diff --git a/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl b/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
index 845660d9db7b..bd7bbf52722c 100644
--- a/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
+++ b/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
@@ -58,7 +58,7 @@ interface XDocumentEventListener;
anymore.</p>
@see DocumentEvent
- @since OpenOffice.org 3.1
+ @since OOo 3.1
*/
interface XDocumentEventBroadcaster
{
diff --git a/offapi/com/sun/star/document/XDocumentEventListener.idl b/offapi/com/sun/star/document/XDocumentEventListener.idl
index 207286df8b79..2fa8e1583f1a 100644
--- a/offapi/com/sun/star/document/XDocumentEventListener.idl
+++ b/offapi/com/sun/star/document/XDocumentEventListener.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module document {
anymore.</p>
@see XDocumentEventBroadcaster
- @since OpenOffice.org 3.1
+ @since OOo 3.1
*/
interface XDocumentEventListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/document/XMLBasicExporter.idl b/offapi/com/sun/star/document/XMLBasicExporter.idl
index 4e11911e3181..7766282276dd 100644
--- a/offapi/com/sun/star/document/XMLBasicExporter.idl
+++ b/offapi/com/sun/star/document/XMLBasicExporter.idl
@@ -53,7 +53,7 @@ module com { module sun { module star { module document {
from which the data should be exported. After that, the export is started
by calling the <method>XFilter::filter</method> method.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service XMLBasicExporter
{
diff --git a/offapi/com/sun/star/document/XMLBasicImporter.idl b/offapi/com/sun/star/document/XMLBasicImporter.idl
index 38f3bf3ff086..74b789c954ed 100644
--- a/offapi/com/sun/star/document/XMLBasicImporter.idl
+++ b/offapi/com/sun/star/document/XMLBasicImporter.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module document {
The <type scope="com::sun::star::xml::sax">XDocumentHandler</type>
interface is used to stream the XML data into the filter.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service XMLBasicImporter
{
diff --git a/offapi/com/sun/star/document/XMLOasisBasicExporter.idl b/offapi/com/sun/star/document/XMLOasisBasicExporter.idl
index 8c59e34f4301..b5817e99e8ee 100644
--- a/offapi/com/sun/star/document/XMLOasisBasicExporter.idl
+++ b/offapi/com/sun/star/document/XMLOasisBasicExporter.idl
@@ -53,7 +53,7 @@ module com { module sun { module star { module document {
from which the data should be exported. After that, the export is started
by calling the <method>XFilter::filter</method> method.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service XMLOasisBasicExporter
{
diff --git a/offapi/com/sun/star/document/XMLOasisBasicImporter.idl b/offapi/com/sun/star/document/XMLOasisBasicImporter.idl
index c0aadd8c4941..c77c6395a9be 100644
--- a/offapi/com/sun/star/document/XMLOasisBasicImporter.idl
+++ b/offapi/com/sun/star/document/XMLOasisBasicImporter.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module document {
The <type scope="com::sun::star::xml::sax">XDocumentHandler</type>
interface is used to stream the XML data into the filter.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service XMLOasisBasicImporter
{
diff --git a/offapi/com/sun/star/form/FormComponent.idl b/offapi/com/sun/star/form/FormComponent.idl
index 27bae9588631..489f97e66795 100644
--- a/offapi/com/sun/star/form/FormComponent.idl
+++ b/offapi/com/sun/star/form/FormComponent.idl
@@ -104,7 +104,7 @@ published service FormComponent
will always be set, even if you do not specify it in the
<member scope="com::sun::star::beans">XPropertyContainer::addProperty</member> call.</p>
- @since OpenOffice.org 2.3.0
+ @since OOo 2.3
*/
[optional] service com::sun::star::beans::PropertyBag;
diff --git a/offapi/com/sun/star/form/XErrorListener.idl b/offapi/com/sun/star/form/XErrorListener.idl
index 4b329e1e6d03..7f6a6c4c74a2 100644
--- a/offapi/com/sun/star/form/XErrorListener.idl
+++ b/offapi/com/sun/star/form/XErrorListener.idl
@@ -51,7 +51,6 @@
<p>Please do <em><b>not</b></em> use anymore, this interface is superseeded
by <type scope="com::sun::star::sdb">XSQLErrorListener</type>.</p>
-@since foo
@deprecated
*/
published interface XErrorListener: com::sun::star::lang::XEventListener
diff --git a/offapi/com/sun/star/form/component/GridControl.idl b/offapi/com/sun/star/form/component/GridControl.idl
index f3077ec037ac..b39dc67e9fef 100644
--- a/offapi/com/sun/star/form/component/GridControl.idl
+++ b/offapi/com/sun/star/form/component/GridControl.idl
@@ -162,7 +162,7 @@ published service GridControl
<p>Not every border style (see <member>Border</member>) may support coloring.
For instance, usually a border with 3D effect will ignore the BorderColor setting.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long BorderColor;
diff --git a/offapi/com/sun/star/form/inspection/DefaultFormComponentInspectorModel.idl b/offapi/com/sun/star/form/inspection/DefaultFormComponentInspectorModel.idl
index b743fe4be85b..11140ee20476 100644
--- a/offapi/com/sun/star/form/inspection/DefaultFormComponentInspectorModel.idl
+++ b/offapi/com/sun/star/form/inspection/DefaultFormComponentInspectorModel.idl
@@ -62,7 +62,7 @@ service DefaultFormComponentInspectorModel : com::sun::star::inspection::XObject
/** creates a default DefaultFormComponentInspectorModel, providing factories for all
handlers listed above.
- @since OOo 2.2.0
+ @since OOo 2.2
*/
createDefault();
@@ -85,7 +85,7 @@ service DefaultFormComponentInspectorModel : com::sun::star::inspection::XObject
@see XObjectInspectorModel::MinHelpTextLines
@see XObjectInspectorModel::MaxHelpTextLines
- @since OOo 2.2.0
+ @since OOo 2.2
*/
createWithHelpSection(
[in] long minHelpTextLines,
diff --git a/offapi/com/sun/star/form/runtime/FeatureState.idl b/offapi/com/sun/star/form/runtime/FeatureState.idl
index 996aff1e8076..f50c8d36ce05 100644
--- a/offapi/com/sun/star/form/runtime/FeatureState.idl
+++ b/offapi/com/sun/star/form/runtime/FeatureState.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module form { module runtime {
@see XFormOperations
- @since OpenOffice.org 2.2.0
+ @since OOo 2.2
*/
struct FeatureState
{
diff --git a/offapi/com/sun/star/form/runtime/FilterEvent.idl b/offapi/com/sun/star/form/runtime/FilterEvent.idl
index b7cc035113cb..f58b9e101e6f 100644
--- a/offapi/com/sun/star/form/runtime/FilterEvent.idl
+++ b/offapi/com/sun/star/form/runtime/FilterEvent.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module form { module runtime {
@see XFilterController
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
struct FilterEvent : ::com::sun::star::lang::EventObject
{
diff --git a/offapi/com/sun/star/form/runtime/FormFeature.idl b/offapi/com/sun/star/form/runtime/FormFeature.idl
index 57ebcc8ef7b7..13045b0f6bb9 100644
--- a/offapi/com/sun/star/form/runtime/FormFeature.idl
+++ b/offapi/com/sun/star/form/runtime/FormFeature.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module form { module runtime {
/** specifies the operations on a user interface form, as supported by the
<type>XFormOperations</type> interface.
- @since OpenOffice.org 2.2.0
+ @since OOo 2.2
*/
constants FormFeature
{
diff --git a/offapi/com/sun/star/form/runtime/FormOperations.idl b/offapi/com/sun/star/form/runtime/FormOperations.idl
index aa4b7e825c8c..c96844ded821 100644
--- a/offapi/com/sun/star/form/runtime/FormOperations.idl
+++ b/offapi/com/sun/star/form/runtime/FormOperations.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module form { module runtime {
/** encapsulates operations on a database form which has a UI representation,
and is interacting with the user.
- @since OpenOffice.org 2.2.0
+ @since OOo 2.2
*/
service FormOperations : XFormOperations
{
diff --git a/offapi/com/sun/star/form/runtime/XFeatureInvalidation.idl b/offapi/com/sun/star/form/runtime/XFeatureInvalidation.idl
index b435e64a6d81..0f1ca0df7578 100644
--- a/offapi/com/sun/star/form/runtime/XFeatureInvalidation.idl
+++ b/offapi/com/sun/star/form/runtime/XFeatureInvalidation.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module form { module runtime {
@see XFormOperations
- @since OpenOffice.org 2.2.0
+ @since OOo 2.2
*/
interface XFeatureInvalidation
{
diff --git a/offapi/com/sun/star/form/runtime/XFilterController.idl b/offapi/com/sun/star/form/runtime/XFilterController.idl
index 8f3fded592d9..e1c3f0f69fee 100644
--- a/offapi/com/sun/star/form/runtime/XFilterController.idl
+++ b/offapi/com/sun/star/form/runtime/XFilterController.idl
@@ -73,7 +73,7 @@ interface XFilterControllerListener;
@see com::sun::star::sdb::XSingleSelectQueryAnalyzer::getStructuredFilter
@see com::sun::star::sdb::SQLFilterOperator
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
interface XFilterController
{
diff --git a/offapi/com/sun/star/form/runtime/XFilterControllerListener.idl b/offapi/com/sun/star/form/runtime/XFilterControllerListener.idl
index c737f9b24c70..86068c745640 100644
--- a/offapi/com/sun/star/form/runtime/XFilterControllerListener.idl
+++ b/offapi/com/sun/star/form/runtime/XFilterControllerListener.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module form { module runtime {
/** is implemented by components listening for events fired by an <type>XFilterController</type>.
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
interface XFilterControllerListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/form/runtime/XFormController.idl b/offapi/com/sun/star/form/runtime/XFormController.idl
index 983b0bd61f07..482c66f06262 100644
--- a/offapi/com/sun/star/form/runtime/XFormController.idl
+++ b/offapi/com/sun/star/form/runtime/XFormController.idl
@@ -248,7 +248,7 @@ interface XFormControllerContext;
@see ::com::sun::star::form::binding::BindableControlModel
@see ::com::sun::star::sdb::DataSource::Settings
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
interface XFormController
{
diff --git a/offapi/com/sun/star/form/runtime/XFormOperations.idl b/offapi/com/sun/star/form/runtime/XFormOperations.idl
index f6f040ccc199..9775fb87e64a 100644
--- a/offapi/com/sun/star/form/runtime/XFormOperations.idl
+++ b/offapi/com/sun/star/form/runtime/XFormOperations.idl
@@ -93,7 +93,7 @@ interface XFeatureInvalidation;
@see FormFeature
- @since OpenOffice.org 2.2.0
+ @since OOo 2.2
*/
interface XFormOperations : ::com::sun::star::lang::XComponent
{
diff --git a/offapi/com/sun/star/frame/CommandGroup.idl b/offapi/com/sun/star/frame/CommandGroup.idl
index d8058379922e..6cad9c9c4f88 100644
--- a/offapi/com/sun/star/frame/CommandGroup.idl
+++ b/offapi/com/sun/star/frame/CommandGroup.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module frame {
@see XDispatchInformationProvider
@see Controller
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published constants CommandGroup
{
diff --git a/offapi/com/sun/star/frame/DispatchInformation.idl b/offapi/com/sun/star/frame/DispatchInformation.idl
index 49789f003b8a..861699f018e7 100644
--- a/offapi/com/sun/star/frame/DispatchInformation.idl
+++ b/offapi/com/sun/star/frame/DispatchInformation.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module frame {
@see XDispatchInformationProvider
@see Controller
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published struct DispatchInformation
{
diff --git a/offapi/com/sun/star/frame/Frame.idl b/offapi/com/sun/star/frame/Frame.idl
index 2111775c9948..27ae448134dd 100644
--- a/offapi/com/sun/star/frame/Frame.idl
+++ b/offapi/com/sun/star/frame/Frame.idl
@@ -127,7 +127,7 @@ published service Frame
//-------------------------------------------------------------------------
/** provides information about supported commands
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface XDispatchInformationProvider;
diff --git a/offapi/com/sun/star/frame/LayoutManager.idl b/offapi/com/sun/star/frame/LayoutManager.idl
index 7a2f25f39d20..e54df74e59d3 100644
--- a/offapi/com/sun/star/frame/LayoutManager.idl
+++ b/offapi/com/sun/star/frame/LayoutManager.idl
@@ -72,7 +72,7 @@
the size and position of those user interface elements.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service LayoutManager
diff --git a/offapi/com/sun/star/frame/LayoutManagerEvents.idl b/offapi/com/sun/star/frame/LayoutManagerEvents.idl
index 8a7bafcf9880..3a41716d9b61 100644
--- a/offapi/com/sun/star/frame/LayoutManagerEvents.idl
+++ b/offapi/com/sun/star/frame/LayoutManagerEvents.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module frame {
@see com::sun::star::frame::LayoutManager
@see com::sun::star::frame::XLayoutManagerEventBroadcaster
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants LayoutManagerEvents
{
diff --git a/offapi/com/sun/star/frame/ModuleManager.idl b/offapi/com/sun/star/frame/ModuleManager.idl
index 4b8c1cb8723a..7a102da72bef 100644
--- a/offapi/com/sun/star/frame/ModuleManager.idl
+++ b/offapi/com/sun/star/frame/ModuleManager.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module frame {
of office modules.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleManager
diff --git a/offapi/com/sun/star/frame/PopupMenuController.idl b/offapi/com/sun/star/frame/PopupMenuController.idl
index 0d24f19e6cd5..eab60de2fd2c 100644
--- a/offapi/com/sun/star/frame/PopupMenuController.idl
+++ b/offapi/com/sun/star/frame/PopupMenuController.idl
@@ -65,7 +65,7 @@ module com { module sun { module star { module frame {
worked on. This list gets changes consistently during a work session.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service PopupMenuController
diff --git a/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl b/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
index b0d6d71bb1bd..4bf62ffb1efa 100644
--- a/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
+++ b/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module frame {
it contains a registered command URL.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service PopupMenuControllerFactory
diff --git a/offapi/com/sun/star/frame/StatusbarController.idl b/offapi/com/sun/star/frame/StatusbarController.idl
index 861c4364e1f0..9331f95b1816 100644
--- a/offapi/com/sun/star/frame/StatusbarController.idl
+++ b/offapi/com/sun/star/frame/StatusbarController.idl
@@ -64,7 +64,7 @@
@see com::sun::star::frame::XDispatchProvider
@see com::sun::star::frame::XStatusbarController
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service StatusbarController
diff --git a/offapi/com/sun/star/frame/StatusbarControllerFactory.idl b/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
index 01d26117f1c1..dd2b756c319a 100644
--- a/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
+++ b/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
@@ -51,7 +51,7 @@ module com { module sun { module star { module frame {
if it contains a registered command URL.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service StatusbarControllerFactory
diff --git a/offapi/com/sun/star/frame/ToolbarController.idl b/offapi/com/sun/star/frame/ToolbarController.idl
index 674b35af4e6c..8f49b0ae17ea 100644
--- a/offapi/com/sun/star/frame/ToolbarController.idl
+++ b/offapi/com/sun/star/frame/ToolbarController.idl
@@ -67,7 +67,7 @@
@see com::sun::star::frame::XDispatchProvider
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ToolbarController
diff --git a/offapi/com/sun/star/frame/TransientDocumentsDocumentContentFactory.idl b/offapi/com/sun/star/frame/TransientDocumentsDocumentContentFactory.idl
index 326981516522..0f982fa0f4cb 100644
--- a/offapi/com/sun/star/frame/TransientDocumentsDocumentContentFactory.idl
+++ b/offapi/com/sun/star/frame/TransientDocumentsDocumentContentFactory.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module frame {
/** specifies a factory for
<type scope="com::sun::star::ucb">TransientDocumentsDocumentContent</type>s.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsDocumentContentFactory
{
diff --git a/offapi/com/sun/star/frame/UnknownModuleException.idl b/offapi/com/sun/star/frame/UnknownModuleException.idl
index c1c9aad21d8a..9b3169c1dcbe 100644
--- a/offapi/com/sun/star/frame/UnknownModuleException.idl
+++ b/offapi/com/sun/star/frame/UnknownModuleException.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module frame {
* module could not be classified or does not have
* a valid configuration.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception UnknownModuleException : ::com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/frame/XDispatchInformationProvider.idl b/offapi/com/sun/star/frame/XDispatchInformationProvider.idl
index 3bf6886ba17b..a7f50d78c79c 100644
--- a/offapi/com/sun/star/frame/XDispatchInformationProvider.idl
+++ b/offapi/com/sun/star/frame/XDispatchInformationProvider.idl
@@ -56,7 +56,7 @@ module com { module sun { module star { module frame {
@see Frame
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XDispatchInformationProvider: com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XInplaceLayout.idl b/offapi/com/sun/star/frame/XInplaceLayout.idl
index 71344418bda3..fa2d8944f878 100644
--- a/offapi/com/sun/star/frame/XInplaceLayout.idl
+++ b/offapi/com/sun/star/frame/XInplaceLayout.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module frame {
@deprecated
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XInplaceLayout : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XLayoutManager.idl b/offapi/com/sun/star/frame/XLayoutManager.idl
index 5699fe00687b..1801140d2965 100644
--- a/offapi/com/sun/star/frame/XLayoutManager.idl
+++ b/offapi/com/sun/star/frame/XLayoutManager.idl
@@ -95,7 +95,7 @@ module com { module sun { module star { module frame {
@see com::sun::star::frame::XFrame
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XLayoutManager : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XLayoutManagerEventBroadcaster.idl b/offapi/com/sun/star/frame/XLayoutManagerEventBroadcaster.idl
index b79827dd4b3e..fc7636e21e56 100644
--- a/offapi/com/sun/star/frame/XLayoutManagerEventBroadcaster.idl
+++ b/offapi/com/sun/star/frame/XLayoutManagerEventBroadcaster.idl
@@ -40,7 +40,7 @@
@see ::com::sun::star::frame::LayoutManager
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XLayoutManagerEventBroadcaster : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XLayoutManagerListener.idl b/offapi/com/sun/star/frame/XLayoutManagerListener.idl
index 593ba510c08c..1a1cd9266917 100644
--- a/offapi/com/sun/star/frame/XLayoutManagerListener.idl
+++ b/offapi/com/sun/star/frame/XLayoutManagerListener.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module frame {
@see ::com::sun::star::frame::LayoutManager
@see ::com::sun::star::frame::LayoutManagerEvents
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XLayoutManagerListener : com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/frame/XMenuBarAcceptor.idl b/offapi/com/sun/star/frame/XMenuBarAcceptor.idl
index 7eec81bb5308..a5c2f54676d8 100644
--- a/offapi/com/sun/star/frame/XMenuBarAcceptor.idl
+++ b/offapi/com/sun/star/frame/XMenuBarAcceptor.idl
@@ -46,7 +46,7 @@ module com { module sun { module star { module frame {
@deprecated
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMenuBarAcceptor : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XMenuBarMergingAcceptor.idl b/offapi/com/sun/star/frame/XMenuBarMergingAcceptor.idl
index b7c6a1b13c19..500c069006ee 100644
--- a/offapi/com/sun/star/frame/XMenuBarMergingAcceptor.idl
+++ b/offapi/com/sun/star/frame/XMenuBarMergingAcceptor.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module frame {
/** provides functions to set and remove a merged menu bar for inplace
editing.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMenuBarMergingAcceptor : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XModule.idl b/offapi/com/sun/star/frame/XModule.idl
index c302892d5df5..26b2d4cf5f0e 100644
--- a/offapi/com/sun/star/frame/XModule.idl
+++ b/offapi/com/sun/star/frame/XModule.idl
@@ -58,7 +58,7 @@ module com { module sun { module star { module frame {
@see XModuleManager
- @since OOo 2.3.0
+ @since OOo 2.3
*/
interface XModule : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XModuleManager.idl b/offapi/com/sun/star/frame/XModuleManager.idl
index 7c8527c84d73..0e1d8b8fe00e 100644
--- a/offapi/com/sun/star/frame/XModuleManager.idl
+++ b/offapi/com/sun/star/frame/XModuleManager.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module frame {
//===============================================
/** can be used to identify office modules.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XModuleManager : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XPopupMenuController.idl b/offapi/com/sun/star/frame/XPopupMenuController.idl
index ffc7db109f4a..cf65f41f8038 100644
--- a/offapi/com/sun/star/frame/XPopupMenuController.idl
+++ b/offapi/com/sun/star/frame/XPopupMenuController.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module frame {
briefs the controller whenever the popup menu gets activated by a user.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPopupMenuController : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XStatusbarController.idl b/offapi/com/sun/star/frame/XStatusbarController.idl
index d9e035ad03bc..5ded8dc55c1a 100644
--- a/offapi/com/sun/star/frame/XStatusbarController.idl
+++ b/offapi/com/sun/star/frame/XStatusbarController.idl
@@ -62,7 +62,7 @@ module com { module sun { module star { module frame {
@see com::sun::star::frame::XDispatchProvider
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XStatusbarController : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XSubToolbarController.idl b/offapi/com/sun/star/frame/XSubToolbarController.idl
index e0de8b9b8e2f..a9614e5ba04a 100644
--- a/offapi/com/sun/star/frame/XSubToolbarController.idl
+++ b/offapi/com/sun/star/frame/XSubToolbarController.idl
@@ -47,7 +47,7 @@
@see com::sun::star::frame::ToolbarController
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XSubToolbarController : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XSynchronousDispatch.idl b/offapi/com/sun/star/frame/XSynchronousDispatch.idl
index b016e42932a3..7357bc209513 100644
--- a/offapi/com/sun/star/frame/XSynchronousDispatch.idl
+++ b/offapi/com/sun/star/frame/XSynchronousDispatch.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module frame {
//=============================================================================
/** additional interfaces for dispatch objects: allow to execute with return value
- @since OOo 2.0.0
+ @since OOo 2.0
@see XDispatch
*/
published interface XSynchronousDispatch: com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/frame/XToolbarController.idl b/offapi/com/sun/star/frame/XToolbarController.idl
index 1ca2c8fa9278..07bf0bbd9ec2 100644
--- a/offapi/com/sun/star/frame/XToolbarController.idl
+++ b/offapi/com/sun/star/frame/XToolbarController.idl
@@ -53,7 +53,7 @@
@see com::sun::star::frame::XDispatchProvider
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XToolbarController : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XToolbarControllerListener.idl b/offapi/com/sun/star/frame/XToolbarControllerListener.idl
index 6450d8ef910e..63b7b6ae4cca 100644
--- a/offapi/com/sun/star/frame/XToolbarControllerListener.idl
+++ b/offapi/com/sun/star/frame/XToolbarControllerListener.idl
@@ -36,7 +36,7 @@
@see com::sun::star::frame::ToolbarController
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XToolbarControllerListener : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/frame/XTransientDocumentsDocumentContentFactory.idl b/offapi/com/sun/star/frame/XTransientDocumentsDocumentContentFactory.idl
index ec3259b4ad06..9fc7172fd203 100644
--- a/offapi/com/sun/star/frame/XTransientDocumentsDocumentContentFactory.idl
+++ b/offapi/com/sun/star/frame/XTransientDocumentsDocumentContentFactory.idl
@@ -56,7 +56,7 @@ module com { module sun { module star { module frame {
@see com::sun::star::document::OfficeDocument
@see com::sun::star::ucb::TransientDocumentsDocumentContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XTransientDocumentsDocumentContentFactory : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/geometry/AffineMatrix2D.idl b/offapi/com/sun/star/geometry/AffineMatrix2D.idl
index ad122bc7ebeb..2a6c65459c4d 100644
--- a/offapi/com/sun/star/geometry/AffineMatrix2D.idl
+++ b/offapi/com/sun/star/geometry/AffineMatrix2D.idl
@@ -65,7 +65,7 @@ module com { module sun { module star { module geometry {
printer, Then, the total transformation matrix and the device
resolution determine the actual measurement unit.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct AffineMatrix2D
{
diff --git a/offapi/com/sun/star/geometry/AffineMatrix3D.idl b/offapi/com/sun/star/geometry/AffineMatrix3D.idl
index 945fccc1880c..a7d9f9b5b000 100644
--- a/offapi/com/sun/star/geometry/AffineMatrix3D.idl
+++ b/offapi/com/sun/star/geometry/AffineMatrix3D.idl
@@ -67,7 +67,7 @@ module com { module sun { module star { module geometry {
Only then the total transformation matrix (oncluding projection to 2D)
and the device resolution determine the actual measurement unit in 3D.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct AffineMatrix3D
{
diff --git a/offapi/com/sun/star/geometry/EllipticalArc.idl b/offapi/com/sun/star/geometry/EllipticalArc.idl
index 620cbead640a..3dff5ced8c9b 100644
--- a/offapi/com/sun/star/geometry/EllipticalArc.idl
+++ b/offapi/com/sun/star/geometry/EllipticalArc.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module geometry {
constrains. Thus, there are two flags indicating which one of those
ellipses should be taken.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct EllipticalArc
{
diff --git a/offapi/com/sun/star/geometry/IntegerBezierSegment2D.idl b/offapi/com/sun/star/geometry/IntegerBezierSegment2D.idl
index f26418aaf5c4..3ed8334178b4 100644
--- a/offapi/com/sun/star/geometry/IntegerBezierSegment2D.idl
+++ b/offapi/com/sun/star/geometry/IntegerBezierSegment2D.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module geometry {
ignored.<p>
@see com.sun.star.rendering.XBezierPolyPolygon2D
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct IntegerBezierSegment2D
{
diff --git a/offapi/com/sun/star/geometry/IntegerPoint2D.idl b/offapi/com/sun/star/geometry/IntegerPoint2D.idl
index 2b1e0d83efa6..ce2d60ab51a7 100644
--- a/offapi/com/sun/star/geometry/IntegerPoint2D.idl
+++ b/offapi/com/sun/star/geometry/IntegerPoint2D.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module geometry {
This structure contains x and y integer-valued coordinates of a
two-dimensional point.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct IntegerPoint2D
{
diff --git a/offapi/com/sun/star/geometry/IntegerRectangle2D.idl b/offapi/com/sun/star/geometry/IntegerRectangle2D.idl
index 289c3f081665..a9dc994717bb 100644
--- a/offapi/com/sun/star/geometry/IntegerRectangle2D.idl
+++ b/offapi/com/sun/star/geometry/IntegerRectangle2D.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module geometry {
/** This structure contains the necessary information for a
two-dimensional rectangle.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct IntegerRectangle2D
{
diff --git a/offapi/com/sun/star/geometry/IntegerSize2D.idl b/offapi/com/sun/star/geometry/IntegerSize2D.idl
index 3c8b665fedc3..cf3e1a215adb 100644
--- a/offapi/com/sun/star/geometry/IntegerSize2D.idl
+++ b/offapi/com/sun/star/geometry/IntegerSize2D.idl
@@ -33,7 +33,7 @@ module com { module sun { module star { module geometry {
The data is stored integer-valued.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct IntegerSize2D
{
diff --git a/offapi/com/sun/star/geometry/Matrix2D.idl b/offapi/com/sun/star/geometry/Matrix2D.idl
index 4d2bacb24e2f..d0e8bf357f2a 100644
--- a/offapi/com/sun/star/geometry/Matrix2D.idl
+++ b/offapi/com/sun/star/geometry/Matrix2D.idl
@@ -68,7 +68,7 @@ module com { module sun { module star { module geometry {
printer. Then, the total transformation matrix and the device
resolution determine the actual measurement unit.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct Matrix2D
{
diff --git a/offapi/com/sun/star/geometry/RealBezierSegment2D.idl b/offapi/com/sun/star/geometry/RealBezierSegment2D.idl
index 97a9772fb006..6ec7e1b8b83d 100644
--- a/offapi/com/sun/star/geometry/RealBezierSegment2D.idl
+++ b/offapi/com/sun/star/geometry/RealBezierSegment2D.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module geometry {
ignored.<p>
@see com.sun.star.rendering.XBezierPolyPolygon2D
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RealBezierSegment2D
{
diff --git a/offapi/com/sun/star/geometry/RealPoint2D.idl b/offapi/com/sun/star/geometry/RealPoint2D.idl
index 8c0e594aa5e6..1ac34b7a380e 100644
--- a/offapi/com/sun/star/geometry/RealPoint2D.idl
+++ b/offapi/com/sun/star/geometry/RealPoint2D.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module geometry {
This structure contains x and y real-valued coordinates of a
two-dimensional point.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RealPoint2D
{
diff --git a/offapi/com/sun/star/geometry/RealRectangle2D.idl b/offapi/com/sun/star/geometry/RealRectangle2D.idl
index b12ead639200..39cd783f3c08 100644
--- a/offapi/com/sun/star/geometry/RealRectangle2D.idl
+++ b/offapi/com/sun/star/geometry/RealRectangle2D.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module geometry {
/** This structure contains the necessary information for a
two-dimensional rectangle.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RealRectangle2D
{
diff --git a/offapi/com/sun/star/geometry/RealRectangle3D.idl b/offapi/com/sun/star/geometry/RealRectangle3D.idl
index 826c73c27679..4265ae3088ae 100644
--- a/offapi/com/sun/star/geometry/RealRectangle3D.idl
+++ b/offapi/com/sun/star/geometry/RealRectangle3D.idl
@@ -32,7 +32,7 @@ module com { module sun { module star { module geometry {
/** This structure contains the necessary information for a
three-dimensional cube.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RealRectangle3D
{
diff --git a/offapi/com/sun/star/geometry/RealSize2D.idl b/offapi/com/sun/star/geometry/RealSize2D.idl
index 5ed2fc8a34c3..dab80a5c7deb 100644
--- a/offapi/com/sun/star/geometry/RealSize2D.idl
+++ b/offapi/com/sun/star/geometry/RealSize2D.idl
@@ -33,7 +33,7 @@ module com { module sun { module star { module geometry {
The data is stored real-valued.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RealSize2D
{
diff --git a/offapi/com/sun/star/geometry/XMapping2D.idl b/offapi/com/sun/star/geometry/XMapping2D.idl
index bf435389582a..1d2465d91f8e 100644
--- a/offapi/com/sun/star/geometry/XMapping2D.idl
+++ b/offapi/com/sun/star/geometry/XMapping2D.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module geometry {
pair of real numbers there must be another pair that is mapped
upon them.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMapping2D : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/i18n/OrdinalSuffix.idl b/offapi/com/sun/star/i18n/OrdinalSuffix.idl
index 500ef74ccffc..d754a572e058 100644
--- a/offapi/com/sun/star/i18n/OrdinalSuffix.idl
+++ b/offapi/com/sun/star/i18n/OrdinalSuffix.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module i18n {
/** provides access to locale specific ordinal suffix systems.
- @since OOo2.2
+ @since OOo 2.2
@internal
diff --git a/offapi/com/sun/star/i18n/TextConversionOption.idl b/offapi/com/sun/star/i18n/TextConversionOption.idl
index 8f70cfb08bac..d21e3e3151e1 100644
--- a/offapi/com/sun/star/i18n/TextConversionOption.idl
+++ b/offapi/com/sun/star/i18n/TextConversionOption.idl
@@ -59,7 +59,7 @@ published constants TextConversionOption
/** Use Taiwan, HongKong SAR, and Macao SAR character variants for
Simplified to Traditionary Chinese conversion
- @since OOo 2.0.0
+ @since OOo 2.0
*/
const long USE_CHARACTER_VARIANTS = 2; // (1 << 1)
};
diff --git a/offapi/com/sun/star/i18n/XOrdinalSuffix.idl b/offapi/com/sun/star/i18n/XOrdinalSuffix.idl
index 7da294782791..382cb4dafd31 100644
--- a/offapi/com/sun/star/i18n/XOrdinalSuffix.idl
+++ b/offapi/com/sun/star/i18n/XOrdinalSuffix.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module i18n {
/** provides access to locale specific ordinal suffix systems.
- @since OOo2.2
+ @since OOo 2.2
@internal
diff --git a/offapi/com/sun/star/linguistic2/ConversionDictionary.idl b/offapi/com/sun/star/linguistic2/ConversionDictionary.idl
index ab242d2c40f6..b501478f8ebd 100644
--- a/offapi/com/sun/star/linguistic2/ConversionDictionary.idl
+++ b/offapi/com/sun/star/linguistic2/ConversionDictionary.idl
@@ -69,7 +69,7 @@ published service ConversionDictionary
[optional] interface com::sun::star::util::XFlushable;
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface com::sun::star::linguistic2::XConversionPropertyType;
};
diff --git a/offapi/com/sun/star/linguistic2/ConversionDictionaryType.idl b/offapi/com/sun/star/linguistic2/ConversionDictionaryType.idl
index cf5d93d49f73..cd06ee9bc5ee 100644
--- a/offapi/com/sun/star/linguistic2/ConversionDictionaryType.idl
+++ b/offapi/com/sun/star/linguistic2/ConversionDictionaryType.idl
@@ -44,7 +44,7 @@ constants ConversionDictionaryType
/** Dictionary type for the conversion between Simplified and Traditionary Chinese
- @since OOo 2.0.0
+ @since OOo 2.0
*/
const short SCHINESE_TCHINESE = 2;
};
diff --git a/offapi/com/sun/star/linguistic2/ConversionPropertyType.idl b/offapi/com/sun/star/linguistic2/ConversionPropertyType.idl
index e0e2e37357fe..424ece6e23d6 100644
--- a/offapi/com/sun/star/linguistic2/ConversionPropertyType.idl
+++ b/offapi/com/sun/star/linguistic2/ConversionPropertyType.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module linguistic2 {
@see com::sun::star::linguistic2::XConversionDictionary
@see com::sun::star::linguistic2::XConversionPropertyType
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants ConversionPropertyType
{
diff --git a/offapi/com/sun/star/linguistic2/XConversionPropertyType.idl b/offapi/com/sun/star/linguistic2/XConversionPropertyType.idl
index 0a847f046e78..7dcccf3d05f8 100644
--- a/offapi/com/sun/star/linguistic2/XConversionPropertyType.idl
+++ b/offapi/com/sun/star/linguistic2/XConversionPropertyType.idl
@@ -56,7 +56,7 @@ module com { module sun { module star { module linguistic2 {
@see com::sun::star::linguistic2::XConversionDictionary
@see com::sun::star::linguistic2::ConversionPropertyType
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XConversionPropertyType : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/mail/MailAttachment.idl b/offapi/com/sun/star/mail/MailAttachment.idl
index a30aadfa0304..ef45f157ac31 100644
--- a/offapi/com/sun/star/mail/MailAttachment.idl
+++ b/offapi/com/sun/star/mail/MailAttachment.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module mail {
@see ::com::sun::star::mail::XMailMessage
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct MailAttachment
{
diff --git a/offapi/com/sun/star/mail/MailException.idl b/offapi/com/sun/star/mail/MailException.idl
index 5f5bfff11f81..2022c2aee483 100644
--- a/offapi/com/sun/star/mail/MailException.idl
+++ b/offapi/com/sun/star/mail/MailException.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module mail {
An MailException is the base of all mail related
exceptions.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception MailException: com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/mail/MailMessage.idl b/offapi/com/sun/star/mail/MailMessage.idl
index 2112865d00f8..71dea28cb36c 100644
--- a/offapi/com/sun/star/mail/MailMessage.idl
+++ b/offapi/com/sun/star/mail/MailMessage.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module mail {
interface XMailMessage;
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service MailMessage: XMailMessage
{
diff --git a/offapi/com/sun/star/mail/MailServer.idl b/offapi/com/sun/star/mail/MailServer.idl
index f6b448946eb4..2ae7afc016bf 100644
--- a/offapi/com/sun/star/mail/MailServer.idl
+++ b/offapi/com/sun/star/mail/MailServer.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module mail {
interface XMailServer;
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service MailServer: XMailServer
{
diff --git a/offapi/com/sun/star/mail/MailServiceProvider.idl b/offapi/com/sun/star/mail/MailServiceProvider.idl
index af48d9e9b3e7..0645d9556e66 100644
--- a/offapi/com/sun/star/mail/MailServiceProvider.idl
+++ b/offapi/com/sun/star/mail/MailServiceProvider.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module mail {
interface XMailService;
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service MailServiceProvider: XMailServiceProvider
{
diff --git a/offapi/com/sun/star/mail/MailServiceType.idl b/offapi/com/sun/star/mail/MailServiceType.idl
index 94aa985a06c2..ecb960b3ed12 100644
--- a/offapi/com/sun/star/mail/MailServiceType.idl
+++ b/offapi/com/sun/star/mail/MailServiceType.idl
@@ -31,7 +31,7 @@
module com { module sun { module star { module mail {
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
enum MailServiceType
{
diff --git a/offapi/com/sun/star/mail/NoMailServiceProviderException.idl b/offapi/com/sun/star/mail/NoMailServiceProviderException.idl
index a8e3d52396b9..f1a2074d66ea 100644
--- a/offapi/com/sun/star/mail/NoMailServiceProviderException.idl
+++ b/offapi/com/sun/star/mail/NoMailServiceProviderException.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::MailService
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception NoMailServiceProviderException: com::sun::star::mail::MailException
{
diff --git a/offapi/com/sun/star/mail/NoMailTransportProviderException.idl b/offapi/com/sun/star/mail/NoMailTransportProviderException.idl
index 3cad64b8f900..fa275ed7f7f2 100644
--- a/offapi/com/sun/star/mail/NoMailTransportProviderException.idl
+++ b/offapi/com/sun/star/mail/NoMailTransportProviderException.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::MailServer
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception NoMailTransportProviderException: com::sun::star::mail::MailException
{
diff --git a/offapi/com/sun/star/mail/SendMailMessageFailedException.idl b/offapi/com/sun/star/mail/SendMailMessageFailedException.idl
index 8987bf587596..91a6cb29b5d8 100644
--- a/offapi/com/sun/star/mail/SendMailMessageFailedException.idl
+++ b/offapi/com/sun/star/mail/SendMailMessageFailedException.idl
@@ -42,7 +42,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::XMailServer
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception SendMailMessageFailedException: com::sun::star::mail::MailException
{
diff --git a/offapi/com/sun/star/mail/XAuthenticator.idl b/offapi/com/sun/star/mail/XAuthenticator.idl
index 564ad4e484f1..6ae813a161ef 100644
--- a/offapi/com/sun/star/mail/XAuthenticator.idl
+++ b/offapi/com/sun/star/mail/XAuthenticator.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module mail {
An implementation of this interface may for instance show a
dialog to query the user for the necessary data.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XAuthenticator: ::com::sun::star::uno::XInterface {
diff --git a/offapi/com/sun/star/mail/XConnectionListener.idl b/offapi/com/sun/star/mail/XConnectionListener.idl
index 5ca8511f7c97..cd5153f5e96e 100644
--- a/offapi/com/sun/star/mail/XConnectionListener.idl
+++ b/offapi/com/sun/star/mail/XConnectionListener.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::XMailServer
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XConnectionListener: ::com::sun::star::lang::XEventListener {
diff --git a/offapi/com/sun/star/mail/XMailMessage.idl b/offapi/com/sun/star/mail/XMailMessage.idl
index b87ea1ca6c5c..abc3017297d7 100644
--- a/offapi/com/sun/star/mail/XMailMessage.idl
+++ b/offapi/com/sun/star/mail/XMailMessage.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::XMailServer
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMailMessage: ::com::sun::star::uno::XInterface {
diff --git a/offapi/com/sun/star/mail/XMailServer.idl b/offapi/com/sun/star/mail/XMailServer.idl
index 8d0ad232ed61..401a13424566 100644
--- a/offapi/com/sun/star/mail/XMailServer.idl
+++ b/offapi/com/sun/star/mail/XMailServer.idl
@@ -95,7 +95,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::XMailMessage
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMailServer: ::com::sun::star::uno::XInterface {
diff --git a/offapi/com/sun/star/mail/XMailService.idl b/offapi/com/sun/star/mail/XMailService.idl
index cc8ba05e0703..f06937b79d57 100644
--- a/offapi/com/sun/star/mail/XMailService.idl
+++ b/offapi/com/sun/star/mail/XMailService.idl
@@ -82,7 +82,7 @@ module com { module sun { module star { module mail {
/**
Represents a mail server abstraction.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMailService: ::com::sun::star::uno::XInterface {
diff --git a/offapi/com/sun/star/mail/XMailServiceProvider.idl b/offapi/com/sun/star/mail/XMailServiceProvider.idl
index 5f389a57ee58..5430a45fced0 100644
--- a/offapi/com/sun/star/mail/XMailServiceProvider.idl
+++ b/offapi/com/sun/star/mail/XMailServiceProvider.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module mail {
/**
A factory for creating different mail services.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XMailServiceProvider: ::com::sun::star::uno::XInterface {
diff --git a/offapi/com/sun/star/mail/XSmtpService.idl b/offapi/com/sun/star/mail/XSmtpService.idl
index 278e9ebe85f1..9ffec785bf09 100644
--- a/offapi/com/sun/star/mail/XSmtpService.idl
+++ b/offapi/com/sun/star/mail/XSmtpService.idl
@@ -64,7 +64,7 @@ module com { module sun { module star { module mail {
@see com::sun::star::mail::XMailService
@see com::sun::star::mail::XMailMessage
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XSmtpService: ::com::sun::star::mail::XMailService {
diff --git a/offapi/com/sun/star/rendering/AnimationAttributes.idl b/offapi/com/sun/star/rendering/AnimationAttributes.idl
index e1d2f1a1eeb5..330ec3d75b30 100644
--- a/offapi/com/sun/star/rendering/AnimationAttributes.idl
+++ b/offapi/com/sun/star/rendering/AnimationAttributes.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module rendering {
/** This structure contains attributes needed to run an animation.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct AnimationAttributes
{
diff --git a/offapi/com/sun/star/rendering/AnimationRepeat.idl b/offapi/com/sun/star/rendering/AnimationRepeat.idl
index 8bde41c46b99..2f72a6b69fbc 100644
--- a/offapi/com/sun/star/rendering/AnimationRepeat.idl
+++ b/offapi/com/sun/star/rendering/AnimationRepeat.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module rendering {
animation is driven through, thus defining the possible repeat
modes.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants AnimationRepeat
{
diff --git a/offapi/com/sun/star/rendering/CanvasFactory.idl b/offapi/com/sun/star/rendering/CanvasFactory.idl
index d735dc368855..7935d5f30b1a 100644
--- a/offapi/com/sun/star/rendering/CanvasFactory.idl
+++ b/offapi/com/sun/star/rendering/CanvasFactory.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module rendering {
a service name to try first.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service CanvasFactory : com::sun::star::lang::XMultiComponentFactory;
diff --git a/offapi/com/sun/star/rendering/Caret.idl b/offapi/com/sun/star/rendering/Caret.idl
index 7d04213987ee..8d8999160ac2 100644
--- a/offapi/com/sun/star/rendering/Caret.idl
+++ b/offapi/com/sun/star/rendering/Caret.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module rendering {
This structure is used from the <type>XTextLayout</type> interface
to transport information regarding a text caret.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct Caret
{
diff --git a/offapi/com/sun/star/rendering/CompositeOperation.idl b/offapi/com/sun/star/rendering/CompositeOperation.idl
index 0c1c4448ee05..169e7af6517c 100644
--- a/offapi/com/sun/star/rendering/CompositeOperation.idl
+++ b/offapi/com/sun/star/rendering/CompositeOperation.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module rendering {
different composite modes (wherein Aa and Ab denote source and
destination alpha, respectively).<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants CompositeOperation
{
diff --git a/offapi/com/sun/star/rendering/EmphasisMark.idl b/offapi/com/sun/star/rendering/EmphasisMark.idl
index be0847a0dcd2..fe9d3d683f55 100644
--- a/offapi/com/sun/star/rendering/EmphasisMark.idl
+++ b/offapi/com/sun/star/rendering/EmphasisMark.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module rendering {
These constants control the automatic rendering of emphasis marks
for a given font.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants EmphasisMark
{
diff --git a/offapi/com/sun/star/rendering/FillRule.idl b/offapi/com/sun/star/rendering/FillRule.idl
index ff0aab58ab9a..ffea263b4bb3 100644
--- a/offapi/com/sun/star/rendering/FillRule.idl
+++ b/offapi/com/sun/star/rendering/FillRule.idl
@@ -32,7 +32,7 @@ module com { module sun { module star { module rendering {
/** Determines which algorithm to use when determining inside and
outside of filled poly-polygons.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
enum FillRule
{
diff --git a/offapi/com/sun/star/rendering/FloatingPointBitmapFormat.idl b/offapi/com/sun/star/rendering/FloatingPointBitmapFormat.idl
index 7fd0a972f56f..0c10b65ff572 100644
--- a/offapi/com/sun/star/rendering/FloatingPointBitmapFormat.idl
+++ b/offapi/com/sun/star/rendering/FloatingPointBitmapFormat.idl
@@ -31,7 +31,7 @@ module com { module sun { module star { module rendering {
/** This structure describes format of a floating point bitmap.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants FloatingPointBitmapFormat
{
diff --git a/offapi/com/sun/star/rendering/FloatingPointBitmapLayout.idl b/offapi/com/sun/star/rendering/FloatingPointBitmapLayout.idl
index bef73dc7fc35..714a20e8bf3e 100644
--- a/offapi/com/sun/star/rendering/FloatingPointBitmapLayout.idl
+++ b/offapi/com/sun/star/rendering/FloatingPointBitmapLayout.idl
@@ -42,7 +42,7 @@ module com { module sun { module star { module rendering {
This structure collects all necessary information to describe the
memory layout of a bitmap having floating point color channels<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct FloatingPointBitmapLayout
{
diff --git a/offapi/com/sun/star/rendering/FontInfo.idl b/offapi/com/sun/star/rendering/FontInfo.idl
index 1492168d45bc..ed2beaba1c5b 100644
--- a/offapi/com/sun/star/rendering/FontInfo.idl
+++ b/offapi/com/sun/star/rendering/FontInfo.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module rendering {
/** This structure provides information about a specific font.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct FontInfo
{
diff --git a/offapi/com/sun/star/rendering/FontMetrics.idl b/offapi/com/sun/star/rendering/FontMetrics.idl
index 3339c17d9bdd..71b8f9d3dce6 100644
--- a/offapi/com/sun/star/rendering/FontMetrics.idl
+++ b/offapi/com/sun/star/rendering/FontMetrics.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module rendering {
underlying font technology, actual device output might be off by
up to one device pixel from the transformed metrics.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct FontMetrics
{
diff --git a/offapi/com/sun/star/rendering/FontRequest.idl b/offapi/com/sun/star/rendering/FontRequest.idl
index a39871968297..b9da5f1425d4 100644
--- a/offapi/com/sun/star/rendering/FontRequest.idl
+++ b/offapi/com/sun/star/rendering/FontRequest.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module rendering {
<member>FontInfo::StyleName</member> empty, if font selection
should only happen via the PANOSE description.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct FontRequest
{
diff --git a/offapi/com/sun/star/rendering/IntegerBitmapLayout.idl b/offapi/com/sun/star/rendering/IntegerBitmapLayout.idl
index 45787bc206e7..fae628f0d9b6 100644
--- a/offapi/com/sun/star/rendering/IntegerBitmapLayout.idl
+++ b/offapi/com/sun/star/rendering/IntegerBitmapLayout.idl
@@ -42,7 +42,7 @@ module com { module sun { module star { module rendering {
This structure collects all necessary information to describe the
memory layout of a bitmap having integer color channels<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct IntegerBitmapLayout
{
diff --git a/offapi/com/sun/star/rendering/InterpolationMode.idl b/offapi/com/sun/star/rendering/InterpolationMode.idl
index 01dc1e14c9a2..00fc8e7e4cd0 100644
--- a/offapi/com/sun/star/rendering/InterpolationMode.idl
+++ b/offapi/com/sun/star/rendering/InterpolationMode.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module rendering {
takes place between two consecutive frames of a discrete animation
sequence.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants InterpolationMode
{
diff --git a/offapi/com/sun/star/rendering/PathCapType.idl b/offapi/com/sun/star/rendering/PathCapType.idl
index e436eaa738db..e72f9a24dff2 100644
--- a/offapi/com/sun/star/rendering/PathCapType.idl
+++ b/offapi/com/sun/star/rendering/PathCapType.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module rendering {
different shapes (which are, of course, only visible for strokes
wider than one device pixel).<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants PathCapType
{
diff --git a/offapi/com/sun/star/rendering/PathJoinType.idl b/offapi/com/sun/star/rendering/PathJoinType.idl
index b2fc8d31d747..99e2fad61bb4 100644
--- a/offapi/com/sun/star/rendering/PathJoinType.idl
+++ b/offapi/com/sun/star/rendering/PathJoinType.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module rendering {
several different shapes (which are of course only visible for
strokes wider than one device pixel).<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants PathJoinType
{
diff --git a/offapi/com/sun/star/rendering/RenderState.idl b/offapi/com/sun/star/rendering/RenderState.idl
index 7ba8d8e35536..ecb5b169d3a3 100644
--- a/offapi/com/sun/star/rendering/RenderState.idl
+++ b/offapi/com/sun/star/rendering/RenderState.idl
@@ -45,7 +45,7 @@ interface XPolyPolygon2D;
state, i.e. the common setup required to render each individual
<type>XCanvas</type> primitive.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct RenderState
{
diff --git a/offapi/com/sun/star/rendering/RenderingIntent.idl b/offapi/com/sun/star/rendering/RenderingIntent.idl
index 51ed8a96767b..25ebd6046cc1 100644
--- a/offapi/com/sun/star/rendering/RenderingIntent.idl
+++ b/offapi/com/sun/star/rendering/RenderingIntent.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module rendering {
href="http://en.wikipedia.org/wiki/Rendering_intent">Wikipedia</a>
for a thorough explanation.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants RenderingIntent
{
diff --git a/offapi/com/sun/star/rendering/RepaintResult.idl b/offapi/com/sun/star/rendering/RepaintResult.idl
index 9e221b3ff504..8b66654150fa 100644
--- a/offapi/com/sun/star/rendering/RepaintResult.idl
+++ b/offapi/com/sun/star/rendering/RepaintResult.idl
@@ -32,7 +32,7 @@ module com { module sun { module star { module rendering {
/** These constants specify the result of the
<type>XCachedPrimitive</type> render operation.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants RepaintResult
{
diff --git a/offapi/com/sun/star/rendering/StringContext.idl b/offapi/com/sun/star/rendering/StringContext.idl
index 54c4b5868e98..3f9c833ceb74 100644
--- a/offapi/com/sun/star/rendering/StringContext.idl
+++ b/offapi/com/sun/star/rendering/StringContext.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module rendering {
here, because in several languages, glyph selection is context
dependent.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct StringContext
{
diff --git a/offapi/com/sun/star/rendering/TextDirection.idl b/offapi/com/sun/star/rendering/TextDirection.idl
index 33eea1fd4036..cec5d680be0f 100644
--- a/offapi/com/sun/star/rendering/TextDirection.idl
+++ b/offapi/com/sun/star/rendering/TextDirection.idl
@@ -33,7 +33,7 @@ module com { module sun { module star { module rendering {
This also changes the interpretation of the start point.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants TextDirection
{
diff --git a/offapi/com/sun/star/rendering/TextHit.idl b/offapi/com/sun/star/rendering/TextHit.idl
index 7451086d57a3..2b0c5305b925 100644
--- a/offapi/com/sun/star/rendering/TextHit.idl
+++ b/offapi/com/sun/star/rendering/TextHit.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module rendering {
This structure is used from the <type>XTextLayout</type> interface
to transport information regarding hit tests.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct TextHit
{
diff --git a/offapi/com/sun/star/rendering/Texture.idl b/offapi/com/sun/star/rendering/Texture.idl
index a8eacf515c76..ea033b3e21a8 100644
--- a/offapi/com/sun/star/rendering/Texture.idl
+++ b/offapi/com/sun/star/rendering/Texture.idl
@@ -51,7 +51,7 @@ interface XParametricPolyPolygon2D;
as the hatch and the gradient. The transformation member can then
be used to scale the complete texture as it fits suit.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct Texture
{
diff --git a/offapi/com/sun/star/rendering/TexturingMode.idl b/offapi/com/sun/star/rendering/TexturingMode.idl
index b44a78eae6ce..10ca7679caa5 100644
--- a/offapi/com/sun/star/rendering/TexturingMode.idl
+++ b/offapi/com/sun/star/rendering/TexturingMode.idl
@@ -32,7 +32,7 @@ module com { module sun { module star { module rendering {
/** Enumeration of possible values to spread a texture across a
primitive.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants TexturingMode
{
diff --git a/offapi/com/sun/star/rendering/ViewState.idl b/offapi/com/sun/star/rendering/ViewState.idl
index b0ed7b62d3b5..fe4de1fc17bf 100644
--- a/offapi/com/sun/star/rendering/ViewState.idl
+++ b/offapi/com/sun/star/rendering/ViewState.idl
@@ -41,7 +41,7 @@ interface XPolyPolygon2D;
i.e. the invariant setup used when painting a whole view of
something.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
struct ViewState
{
diff --git a/offapi/com/sun/star/rendering/VolatileContentDestroyedException.idl b/offapi/com/sun/star/rendering/VolatileContentDestroyedException.idl
index 23e0531f876f..718444f91a25 100644
--- a/offapi/com/sun/star/rendering/VolatileContentDestroyedException.idl
+++ b/offapi/com/sun/star/rendering/VolatileContentDestroyedException.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module rendering {
When accessing or rendering XVolatileBitmap data, that has
been invalidated by the system, this exception will be thrown.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception VolatileContentDestroyedException : ::com::sun::star::uno::Exception
{
diff --git a/offapi/com/sun/star/rendering/XAnimatedSprite.idl b/offapi/com/sun/star/rendering/XAnimatedSprite.idl
index 6824b36e4f07..aa10e68f9ae1 100644
--- a/offapi/com/sun/star/rendering/XAnimatedSprite.idl
+++ b/offapi/com/sun/star/rendering/XAnimatedSprite.idl
@@ -54,7 +54,7 @@ module com { module sun { module star { module rendering {
This interface can be used to control an animated sprite object on
an XSpriteCanvas. Sprites are moving, animated objects.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XAnimatedSprite : XSprite
{
diff --git a/offapi/com/sun/star/rendering/XAnimation.idl b/offapi/com/sun/star/rendering/XAnimation.idl
index 004f350ef564..8dd196bb7b6e 100644
--- a/offapi/com/sun/star/rendering/XAnimation.idl
+++ b/offapi/com/sun/star/rendering/XAnimation.idl
@@ -58,7 +58,7 @@ module com { module sun { module star { module rendering {
is used by the <type>XCanvas</type> interface to render generic
animations.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XAnimation : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XBezierPolyPolygon2D.idl b/offapi/com/sun/star/rendering/XBezierPolyPolygon2D.idl
index 973d33e8dfd1..8d245d1c00a2 100644
--- a/offapi/com/sun/star/rendering/XBezierPolyPolygon2D.idl
+++ b/offapi/com/sun/star/rendering/XBezierPolyPolygon2D.idl
@@ -54,7 +54,7 @@ module com { module sun { module star { module rendering {
By convention, a <type>RealBezierSegment2D</type> is a straight
line segment, if all three contained points are strictly equal.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XBezierPolyPolygon2D : XPolyPolygon2D
{
diff --git a/offapi/com/sun/star/rendering/XBitmap.idl b/offapi/com/sun/star/rendering/XBitmap.idl
index 3eedd46357e2..c061d2908f2e 100644
--- a/offapi/com/sun/star/rendering/XBitmap.idl
+++ b/offapi/com/sun/star/rendering/XBitmap.idl
@@ -55,7 +55,7 @@ interface XBitmapCanvas;
<type>XIeeeDoubleBitmap</type>, <type>XIeeeFloatBitmap</type> and
<type>XHalfFloatBitmap</type> interfaces.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XBitmap : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XBitmapCanvas.idl b/offapi/com/sun/star/rendering/XBitmapCanvas.idl
index b87be2ae8394..fed3cd4238dc 100644
--- a/offapi/com/sun/star/rendering/XBitmapCanvas.idl
+++ b/offapi/com/sun/star/rendering/XBitmapCanvas.idl
@@ -59,7 +59,7 @@ module com { module sun { module star { module rendering {
bitmapped canvases, where additional methods for accessing and
moving of bitmap content are provided.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XBitmapCanvas : XCanvas
{
diff --git a/offapi/com/sun/star/rendering/XBitmapPalette.idl b/offapi/com/sun/star/rendering/XBitmapPalette.idl
index b89bc8221cd0..f36629285d9a 100644
--- a/offapi/com/sun/star/rendering/XBitmapPalette.idl
+++ b/offapi/com/sun/star/rendering/XBitmapPalette.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module rendering {
/** Interface to access the palette of a color-indexed bitmap.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XBitmapPalette : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XBufferController.idl b/offapi/com/sun/star/rendering/XBufferController.idl
index d4222e263aac..93bfea9158f3 100644
--- a/offapi/com/sun/star/rendering/XBufferController.idl
+++ b/offapi/com/sun/star/rendering/XBufferController.idl
@@ -42,7 +42,7 @@ module com { module sun { module star { module rendering {
This interface provides methods to enable and control
double/multi-buffering facilities on screen devices.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XBufferController : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XCachedPrimitive.idl b/offapi/com/sun/star/rendering/XCachedPrimitive.idl
index c24a74df3135..9793374ad913 100644
--- a/offapi/com/sun/star/rendering/XCachedPrimitive.idl
+++ b/offapi/com/sun/star/rendering/XCachedPrimitive.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module rendering {
This interface provides a method to quickly redraw some
<type>XCanvas</type> primitives, using cached data.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XCachedPrimitive : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XCanvas.idl b/offapi/com/sun/star/rendering/XCanvas.idl
index e88de735ce7c..e731e535d3c9 100644
--- a/offapi/com/sun/star/rendering/XCanvas.idl
+++ b/offapi/com/sun/star/rendering/XCanvas.idl
@@ -148,7 +148,7 @@ interface XTextLayout;
<member>getDevice()</member> call) - they will then internally
optimize to the underlying graphics subsystem.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XCanvas : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XIntegerBitmap.idl b/offapi/com/sun/star/rendering/XIntegerBitmap.idl
index c56d46d948c1..b416d30debd1 100644
--- a/offapi/com/sun/star/rendering/XIntegerBitmap.idl
+++ b/offapi/com/sun/star/rendering/XIntegerBitmap.idl
@@ -52,7 +52,7 @@ module com { module sun { module star { module rendering {
/** This is a specialized interface for bitmaps having integer color
channels.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XIntegerBitmap : XIntegerReadOnlyBitmap
{
diff --git a/offapi/com/sun/star/rendering/XLinePolyPolygon2D.idl b/offapi/com/sun/star/rendering/XLinePolyPolygon2D.idl
index a44e1d4fa7dd..bbd2606297ba 100644
--- a/offapi/com/sun/star/rendering/XLinePolyPolygon2D.idl
+++ b/offapi/com/sun/star/rendering/XLinePolyPolygon2D.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module rendering {
/** Specialized interface for a 2D poly-polygon containing only straight line segments.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XLinePolyPolygon2D : XPolyPolygon2D
{
diff --git a/offapi/com/sun/star/rendering/XPolyPolygon2D.idl b/offapi/com/sun/star/rendering/XPolyPolygon2D.idl
index 47b61210d3fd..dc99fabee053 100644
--- a/offapi/com/sun/star/rendering/XPolyPolygon2D.idl
+++ b/offapi/com/sun/star/rendering/XPolyPolygon2D.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module rendering {
/** Generic interface for poly-polygons in 2D.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPolyPolygon2D : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/rendering/XTextLayout.idl b/offapi/com/sun/star/rendering/XTextLayout.idl
index e4e2d2e76eca..062a1c86a4ba 100644
--- a/offapi/com/sun/star/rendering/XTextLayout.idl
+++ b/offapi/com/sun/star/rendering/XTextLayout.idl
@@ -90,7 +90,7 @@ interface XPolyPolygon2D;
might be off by up to one device pixel from the transformed
metrics.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XTextLayout : ::com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/report/XReportControlFormat.idl b/offapi/com/sun/star/report/XReportControlFormat.idl
index 608b1e7aa5f4..672ff99549e7 100644
--- a/offapi/com/sun/star/report/XReportControlFormat.idl
+++ b/offapi/com/sun/star/report/XReportControlFormat.idl
@@ -143,7 +143,7 @@ interface XReportControlFormat
/** If this optional property is <TRUE/>, then the characters are invisible.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[attribute,bound] boolean CharHidden
{
diff --git a/offapi/com/sun/star/resource/OfficeResourceLoader.idl b/offapi/com/sun/star/resource/OfficeResourceLoader.idl
index 7930a34e5571..20178ca533e7 100644
--- a/offapi/com/sun/star/resource/OfficeResourceLoader.idl
+++ b/offapi/com/sun/star/resource/OfficeResourceLoader.idl
@@ -70,7 +70,7 @@ module com { module sun { module star { module resource {
OpenOffice.org build), you are <strong>strongly</strong> discouraged from using the <type>OfficeResoureLoader</type>
service in a component which targets more than one particular OpenOffice.org build.</p>
- @since OpenOffice.org 2.0.3
+ @since OOo 2.0.3
*/
singleton OfficeResourceLoader : XResourceBundleLoader;
diff --git a/offapi/com/sun/star/script/browse/BrowseNode.idl b/offapi/com/sun/star/script/browse/BrowseNode.idl
index fa209b84efa1..502f16f5799a 100755
--- a/offapi/com/sun/star/script/browse/BrowseNode.idl
+++ b/offapi/com/sun/star/script/browse/BrowseNode.idl
@@ -46,7 +46,7 @@ module com {
XBrowseNode interface. XInvocation is an optional interface that is used
to execute macros, or to create/delete/rename macros or macro containers.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service BrowseNode
{
diff --git a/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl b/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
index b54d8e7e6137..92897a44080a 100755
--- a/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
+++ b/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module script { module browse {
/**
This service is used to create Root XBrowseNodes.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service BrowseNodeFactory
{
@@ -52,7 +52,7 @@ service BrowseNodeFactory
/singletons/com.sun.star.script.theBrowseNodeFactory
</pre>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
singleton theBrowseNodeFactory
{
diff --git a/offapi/com/sun/star/sdb/DatabaseContext.idl b/offapi/com/sun/star/sdb/DatabaseContext.idl
index d2e660058e70..ac990e02c709 100644
--- a/offapi/com/sun/star/sdb/DatabaseContext.idl
+++ b/offapi/com/sun/star/sdb/DatabaseContext.idl
@@ -96,7 +96,7 @@ published service DatabaseContext
are maintained, so if possible at all, you should use this interface, instead of modifying or
querying the configuration data directly.</p>
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
[optional] interface XDatabaseRegistrations;
};
diff --git a/offapi/com/sun/star/sdb/DatabaseDocument.idl b/offapi/com/sun/star/sdb/DatabaseDocument.idl
index b7a626579ec5..6690c2929de4 100644
--- a/offapi/com/sun/star/sdb/DatabaseDocument.idl
+++ b/offapi/com/sun/star/sdb/DatabaseDocument.idl
@@ -43,7 +43,7 @@
module com { module sun { module star { module sdb {
/** specifies a link to a document associated with a database document
- @since OOo 2.0.0
+ @since OOo 2.0
@deprecated
*/
published service DatabaseDocument
diff --git a/offapi/com/sun/star/sdb/DocumentSaveRequest.idl b/offapi/com/sun/star/sdb/DocumentSaveRequest.idl
index f3a90b4f467f..a2a579fc47ac 100644
--- a/offapi/com/sun/star/sdb/DocumentSaveRequest.idl
+++ b/offapi/com/sun/star/sdb/DocumentSaveRequest.idl
@@ -44,7 +44,7 @@
<p>
Usually thrown if someone tries to save a document which hasn't a name yet.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception DocumentSaveRequest: com::sun::star::task::ClassifiedInteractionRequest
{
diff --git a/offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl b/offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl
index afbf45b192bb..1d12f2dca011 100644
--- a/offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl
+++ b/offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl
@@ -63,7 +63,7 @@ module com { module sun { module star { module sdb {
@see com::sun::star::sdb::XOfficeDatabaseDocument
@see com::sun::star::document::OfficeDocument
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service OfficeDatabaseDocument
{
diff --git a/offapi/com/sun/star/sdb/XDatabaseRegistrations.idl b/offapi/com/sun/star/sdb/XDatabaseRegistrations.idl
index 81f878d2441d..8151e7e22de9 100644
--- a/offapi/com/sun/star/sdb/XDatabaseRegistrations.idl
+++ b/offapi/com/sun/star/sdb/XDatabaseRegistrations.idl
@@ -47,7 +47,7 @@ interface XDatabaseRegistrationsListener;
if possible at all, use this interface, instead of modifying or querying the configuration
data directly.</p>
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
interface XDatabaseRegistrations
{
diff --git a/offapi/com/sun/star/sdb/XDatabaseRegistrationsListener.idl b/offapi/com/sun/star/sdb/XDatabaseRegistrationsListener.idl
index 57135f8de012..9ba6c6e6df9a 100644
--- a/offapi/com/sun/star/sdb/XDatabaseRegistrationsListener.idl
+++ b/offapi/com/sun/star/sdb/XDatabaseRegistrationsListener.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module sdb {
@see XDatabaseRegistrations
- @since OpenOffice.org 3.3
+ @since OOo 3.3
*/
interface XDatabaseRegistrationsListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/sdb/XInteractionDocumentSave.idl b/offapi/com/sun/star/sdb/XInteractionDocumentSave.idl
index e4de2af39d98..4d89d66a6ca4 100644
--- a/offapi/com/sun/star/sdb/XInteractionDocumentSave.idl
+++ b/offapi/com/sun/star/sdb/XInteractionDocumentSave.idl
@@ -43,7 +43,7 @@ module com { module sun { module star { module sdb {
This continuation is typically used in conjunction with a
<type scope="com::sun::star::sdb">DocumentSaveRequest</type>.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XInteractionDocumentSave: com::sun::star::task::XInteractionContinuation
{
diff --git a/offapi/com/sun/star/sdb/application/DatabaseObject.idl b/offapi/com/sun/star/sdb/application/DatabaseObject.idl
index 3239d69a58f4..46f9f95a7500 100644
--- a/offapi/com/sun/star/sdb/application/DatabaseObject.idl
+++ b/offapi/com/sun/star/sdb/application/DatabaseObject.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module sdb { module application {
/** denotes different objects within a database document
- @since OOo 2.2.0
+ @since OOo 2.2
@see DatabaseObjectContainer
*/
diff --git a/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl b/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl
index 7c14255045e1..088ed540897c 100644
--- a/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl
+++ b/offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl
@@ -52,7 +52,7 @@ module com { module sun { module star { module sdb { module application {
@see com::sun::star::frame::Controller
@see com::sun::star::sdb::DatabaseDocument
- @since OOo 2.2.0
+ @since OOo 2.2
*/
interface XDatabaseDocumentUI
{
diff --git a/offapi/com/sun/star/sdb/application/XTableUIProvider.idl b/offapi/com/sun/star/sdb/application/XTableUIProvider.idl
index ec31ace643aa..85333795d8d2 100644
--- a/offapi/com/sun/star/sdb/application/XTableUIProvider.idl
+++ b/offapi/com/sun/star/sdb/application/XTableUIProvider.idl
@@ -45,7 +45,7 @@ interface XDatabaseDocumentUI;
@see com::sun::star::sdb::Connection
- @since OOo 2.2.0
+ @since OOo 2.2
*/
interface XTableUIProvider
{
diff --git a/offapi/com/sun/star/sdbc/DataType.idl b/offapi/com/sun/star/sdbc/DataType.idl
index 2d07982530f6..9d3bb20e5c7b 100644
--- a/offapi/com/sun/star/sdbc/DataType.idl
+++ b/offapi/com/sun/star/sdbc/DataType.idl
@@ -133,7 +133,7 @@ published constants DataType
/** identifies the generic SQL type
* <code>BOOLEAN</code>.
*
- * @since OOo 2.0.0
+ * @since OOo 2.0
*/
const long BOOLEAN = 16;
};
diff --git a/offapi/com/sun/star/security/SerialNumberAdapter.idl b/offapi/com/sun/star/security/SerialNumberAdapter.idl
index 258426fe3f1b..adeb0ca71079 100644
--- a/offapi/com/sun/star/security/SerialNumberAdapter.idl
+++ b/offapi/com/sun/star/security/SerialNumberAdapter.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module security {
<p>An implementation of this service enables the conversion of certificate
serial number to and from a string</p>
- @since OOo 3.1.0
+ @since OOo 3.1
*/
service SerialNumberAdapter : XSerialNumberAdapter;
diff --git a/offapi/com/sun/star/sheet/ActivationEvent.idl b/offapi/com/sun/star/sheet/ActivationEvent.idl
index 481b4cca723a..f53c3509874b 100644
--- a/offapi/com/sun/star/sheet/ActivationEvent.idl
+++ b/offapi/com/sun/star/sheet/ActivationEvent.idl
@@ -44,7 +44,7 @@
/** describes a change of the active sheet. The new active sheet is given
with this event.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published struct ActivationEvent: com::sun::star::lang::EventObject
diff --git a/offapi/com/sun/star/sheet/CellAreaLink.idl b/offapi/com/sun/star/sheet/CellAreaLink.idl
index 75c0a4d810b1..90e51f941eb8 100644
--- a/offapi/com/sun/star/sheet/CellAreaLink.idl
+++ b/offapi/com/sun/star/sheet/CellAreaLink.idl
@@ -106,7 +106,7 @@ published service CellAreaLink
/** specifies the time between two refresh actions in seconds.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RefreshPeriod;
diff --git a/offapi/com/sun/star/sheet/DDEItemInfo.idl b/offapi/com/sun/star/sheet/DDEItemInfo.idl
index bf884ea7cbfb..9ad23080fbd5 100644
--- a/offapi/com/sun/star/sheet/DDEItemInfo.idl
+++ b/offapi/com/sun/star/sheet/DDEItemInfo.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module sheet {
A DDE connection consists of the DDE service name, the DDE topic and a
list of DDE items which may contain cached result sets.
- @since OOo3.1
+ @since OOo 3.1
*/
struct DDEItemInfo
{
diff --git a/offapi/com/sun/star/sheet/DDELinkInfo.idl b/offapi/com/sun/star/sheet/DDELinkInfo.idl
index b9df62f3cd70..96c4b8e5c244 100644
--- a/offapi/com/sun/star/sheet/DDELinkInfo.idl
+++ b/offapi/com/sun/star/sheet/DDELinkInfo.idl
@@ -51,7 +51,7 @@ module com { module sun { module star { module sheet {
single quotes they are escaped by doubling them, as usual, for example
<code>=[2]!'''Sheet name''.A1'</code> in a "soffice" service.</p>
- @since OOo3.1
+ @since OOo 3.1
*/
struct DDELinkInfo
{
diff --git a/offapi/com/sun/star/sheet/DataPilotDescriptor.idl b/offapi/com/sun/star/sheet/DataPilotDescriptor.idl
index 992afdef5ed9..939ff469b674 100644
--- a/offapi/com/sun/star/sheet/DataPilotDescriptor.idl
+++ b/offapi/com/sun/star/sheet/DataPilotDescriptor.idl
@@ -80,7 +80,7 @@ published service DataPilotDescriptor
/** specifies parameters to create the data pilot table from a database.
@see DatabaseImportDescriptor
- @since OOo 3.3.0
+ @since OOo 3.3
*/
[optional, property] sequence< com::sun::star::beans::PropertyValue > ImportDescriptor;
@@ -90,7 +90,7 @@ published service DataPilotDescriptor
/** specifies the name of a <type>DataPilotSource</type> implementation
for the data pilot table.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
[optional, property] string SourceServiceName;
@@ -100,7 +100,7 @@ published service DataPilotDescriptor
/** specifies arguments that are passed to the implementation named by
<member>SourceServiceName</member>.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
[optional, property] sequence< com::sun::star::beans::PropertyValue > ServiceArguments;
diff --git a/offapi/com/sun/star/sheet/DataPilotItem.idl b/offapi/com/sun/star/sheet/DataPilotItem.idl
index 54f21820ed25..84be9bdc879a 100644
--- a/offapi/com/sun/star/sheet/DataPilotItem.idl
+++ b/offapi/com/sun/star/sheet/DataPilotItem.idl
@@ -77,7 +77,7 @@ service DataPilotItem
/** specifies the item's position in its field if sorting is manual.
- @since OOo 2.4.0
+ @since OOo 2.4
*/
[optional, property] long Position;
};
diff --git a/offapi/com/sun/star/sheet/DataPilotOutputRangeType.idl b/offapi/com/sun/star/sheet/DataPilotOutputRangeType.idl
index 7bb0bbbc9438..ffd9d274db97 100644
--- a/offapi/com/sun/star/sheet/DataPilotOutputRangeType.idl
+++ b/offapi/com/sun/star/sheet/DataPilotOutputRangeType.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::XDataPilotTable2
- @since OOo 3.0.0
+ @since OOo 3.0
*/
constants DataPilotOutputRangeType
{
diff --git a/offapi/com/sun/star/sheet/DataPilotSource.idl b/offapi/com/sun/star/sheet/DataPilotSource.idl
index d96bd6d1ba76..3629d48fd756 100644
--- a/offapi/com/sun/star/sheet/DataPilotSource.idl
+++ b/offapi/com/sun/star/sheet/DataPilotSource.idl
@@ -100,7 +100,7 @@ published service DataPilotSource
/** specifies the number of row fields.
- @since OOo 3.0.0
+ @since OOo 3.0
*/
[readonly, property, optional] long RowFieldCount;
@@ -108,7 +108,7 @@ published service DataPilotSource
/** specifies the number of column fields.
- @since OOo 3.0.0
+ @since OOo 3.0
*/
[readonly, property, optional] long ColumnFieldCount;
@@ -116,7 +116,7 @@ published service DataPilotSource
/** specifies the number of data fields.
- @since OOo 3.0.0
+ @since OOo 3.0
*/
[readonly, property, optional] long DataFieldCount;
};
diff --git a/offapi/com/sun/star/sheet/DataPilotSourceMember.idl b/offapi/com/sun/star/sheet/DataPilotSourceMember.idl
index 754fc955c30a..c83f1031e57a 100644
--- a/offapi/com/sun/star/sheet/DataPilotSourceMember.idl
+++ b/offapi/com/sun/star/sheet/DataPilotSourceMember.idl
@@ -86,7 +86,7 @@ published service DataPilotSourceMember
/** specifies the member's position in its hierarchy level if sorting
is manual.
- @since OOo 2.4.0
+ @since OOo 2.4
*/
[optional, property] boolean Position;
};
diff --git a/offapi/com/sun/star/sheet/DataPilotTable.idl b/offapi/com/sun/star/sheet/DataPilotTable.idl
index c2385c46e5fa..19c5b143a952 100644
--- a/offapi/com/sun/star/sheet/DataPilotTable.idl
+++ b/offapi/com/sun/star/sheet/DataPilotTable.idl
@@ -66,7 +66,7 @@ published service DataPilotTable
/** allows notification of modifications to the data pilot table.
- @since OOo 3.3.0
+ @since OOo 3.3
*/
[optional] interface com::sun::star::util::XModifyBroadcaster;
diff --git a/offapi/com/sun/star/sheet/DataPilotTableHeaderData.idl b/offapi/com/sun/star/sheet/DataPilotTableHeaderData.idl
index c98e4bbc2820..670b47db4f6a 100644
--- a/offapi/com/sun/star/sheet/DataPilotTableHeaderData.idl
+++ b/offapi/com/sun/star/sheet/DataPilotTableHeaderData.idl
@@ -51,7 +51,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::DataPilotFieldFilter
@see com::sun::star::sheet::DataResult
- @since OOo 3.0.0
+ @since OOo 3.0
*/
struct DataPilotTableHeaderData
{
diff --git a/offapi/com/sun/star/sheet/DataPilotTablePositionData.idl b/offapi/com/sun/star/sheet/DataPilotTablePositionData.idl
index aa97b0dba922..203990299c89 100644
--- a/offapi/com/sun/star/sheet/DataPilotTablePositionData.idl
+++ b/offapi/com/sun/star/sheet/DataPilotTablePositionData.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::DataPiotTableResultData
@see com::sun::star::sheet::DataPiotTableHeaderData
- @since OOo 3.0.0
+ @since OOo 3.0
*/
struct DataPilotTablePositionData
{
diff --git a/offapi/com/sun/star/sheet/DataPilotTablePositionType.idl b/offapi/com/sun/star/sheet/DataPilotTablePositionType.idl
index 8ef568079f12..f9b254921c6f 100644
--- a/offapi/com/sun/star/sheet/DataPilotTablePositionType.idl
+++ b/offapi/com/sun/star/sheet/DataPilotTablePositionType.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::DataPilotTableResultData
@see com::sun::star::sheet::DataPilotTableHeaderData
- @since OOo 3.0.0
+ @since OOo 3.0
*/
constants DataPilotTablePositionType
{
diff --git a/offapi/com/sun/star/sheet/DataPilotTableResultData.idl b/offapi/com/sun/star/sheet/DataPilotTableResultData.idl
index b0adfdfa4e3d..ff8f7064d537 100644
--- a/offapi/com/sun/star/sheet/DataPilotTableResultData.idl
+++ b/offapi/com/sun/star/sheet/DataPilotTableResultData.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::DataPilotFieldFilter
@see com::sun::star::sheet::DataResult
- @since OOo 3.0.0
+ @since OOo 3.0
*/
struct DataPilotTableResultData
{
diff --git a/offapi/com/sun/star/sheet/DatabaseImportDescriptor.idl b/offapi/com/sun/star/sheet/DatabaseImportDescriptor.idl
index eab5d41f3adf..0044b8801a03 100644
--- a/offapi/com/sun/star/sheet/DatabaseImportDescriptor.idl
+++ b/offapi/com/sun/star/sheet/DatabaseImportDescriptor.idl
@@ -72,7 +72,7 @@ published service DatabaseImportDescriptor
/** specifies whether the SQL statement is given directly to the database
or is parsed before.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean IsNative;
@@ -80,7 +80,7 @@ published service DatabaseImportDescriptor
//-------------------------------------------------------------------------
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string ConnectionResource;
diff --git a/offapi/com/sun/star/sheet/DatabaseRange.idl b/offapi/com/sun/star/sheet/DatabaseRange.idl
index ef8ddb62e508..09ea307c1b90 100644
--- a/offapi/com/sun/star/sheet/DatabaseRange.idl
+++ b/offapi/com/sun/star/sheet/DatabaseRange.idl
@@ -134,7 +134,7 @@ published service DatabaseRange
/** specifies the time between two refresh actions in seconds.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] long RefreshPeriod;
@@ -142,7 +142,7 @@ published service DatabaseRange
/** specifies whether the imported data is only a selection of the database.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean FromSelection;
diff --git a/offapi/com/sun/star/sheet/ExternalDocLink.idl b/offapi/com/sun/star/sheet/ExternalDocLink.idl
index 357b0b4812ba..2c9842daa50e 100644
--- a/offapi/com/sun/star/sheet/ExternalDocLink.idl
+++ b/offapi/com/sun/star/sheet/ExternalDocLink.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::XExternalDocLink
- @since OOo 3.1.0
+ @since OOo 3.1
*/
service ExternalDocLink : XExternalDocLink
{
diff --git a/offapi/com/sun/star/sheet/ExternalDocLinks.idl b/offapi/com/sun/star/sheet/ExternalDocLinks.idl
index f0f216a0caf9..5f05d8666315 100644
--- a/offapi/com/sun/star/sheet/ExternalDocLinks.idl
+++ b/offapi/com/sun/star/sheet/ExternalDocLinks.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::ExternalDocLink
@see com::sun::star::sheet::XExternalDocLinks
- @since OOo 3.1.0
+ @since OOo 3.1
*/
service ExternalDocLinks : XExternalDocLinks
{
diff --git a/offapi/com/sun/star/sheet/ExternalLinkInfo.idl b/offapi/com/sun/star/sheet/ExternalLinkInfo.idl
index fa8590f7f678..0ad8d6dadeb4 100644
--- a/offapi/com/sun/star/sheet/ExternalLinkInfo.idl
+++ b/offapi/com/sun/star/sheet/ExternalLinkInfo.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module sheet {
//=============================================================================
/** describes an external link in a formula.
- @since OOo3.1
+ @since OOo 3.1
*/
struct ExternalLinkInfo
{
diff --git a/offapi/com/sun/star/sheet/ExternalLinkType.idl b/offapi/com/sun/star/sheet/ExternalLinkType.idl
index 7803a4c3b291..976524506775 100644
--- a/offapi/com/sun/star/sheet/ExternalLinkType.idl
+++ b/offapi/com/sun/star/sheet/ExternalLinkType.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module sheet {
<type>ExternalLinkInfo</type>, used with
<member>FormulaParser::ExternalLinks</member>.
- @since OOo3.1
+ @since OOo 3.1
*/
constants ExternalLinkType
{
diff --git a/offapi/com/sun/star/sheet/ExternalSheetCache.idl b/offapi/com/sun/star/sheet/ExternalSheetCache.idl
index 93652a6058f7..aabfb37d69da 100644
--- a/offapi/com/sun/star/sheet/ExternalSheetCache.idl
+++ b/offapi/com/sun/star/sheet/ExternalSheetCache.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::ExternalDocLink
@see com::sun::star::sheet::XExternalSheetCache
- @since OOo 3.1.0
+ @since OOo 3.1
*/
service ExternalSheetCache : XExternalSheetCache
{
diff --git a/offapi/com/sun/star/sheet/FormulaParser.idl b/offapi/com/sun/star/sheet/FormulaParser.idl
index 27fba17ff0c0..acf4eca4910b 100644
--- a/offapi/com/sun/star/sheet/FormulaParser.idl
+++ b/offapi/com/sun/star/sheet/FormulaParser.idl
@@ -103,7 +103,7 @@ service FormulaParser
that indices are 1-based, the sequence must start with an empty
element.</p>
- @since OOo3.1
+ @since OOo 3.1
*/
[property] sequence< ExternalLinkInfo > ExternalLinks;
diff --git a/offapi/com/sun/star/sheet/SheetCell.idl b/offapi/com/sun/star/sheet/SheetCell.idl
index ecde3d5c3594..3e9f8066a059 100644
--- a/offapi/com/sun/star/sheet/SheetCell.idl
+++ b/offapi/com/sun/star/sheet/SheetCell.idl
@@ -241,7 +241,7 @@ published service SheetCell
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface com::sun::star::util::XModifyBroadcaster;
diff --git a/offapi/com/sun/star/sheet/SheetCellRange.idl b/offapi/com/sun/star/sheet/SheetCellRange.idl
index b87d52b7f0c4..d6b42ffa7cef 100644
--- a/offapi/com/sun/star/sheet/SheetCellRange.idl
+++ b/offapi/com/sun/star/sheet/SheetCellRange.idl
@@ -350,7 +350,7 @@ published service SheetCellRange
/**
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface com::sun::star::util::XModifyBroadcaster;
diff --git a/offapi/com/sun/star/sheet/TablePageStyle.idl b/offapi/com/sun/star/sheet/TablePageStyle.idl
index 6673fb80f9de..686fb113d62c 100644
--- a/offapi/com/sun/star/sheet/TablePageStyle.idl
+++ b/offapi/com/sun/star/sheet/TablePageStyle.idl
@@ -197,7 +197,7 @@ published service TablePageStyle
/** contains the number of horizontal pages the sheet will printed on.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[property, optional] short ScaleToPagesX;
@@ -206,7 +206,7 @@ published service TablePageStyle
/** contains the number of vertical pages the sheet will printed on.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[property, optional] short ScaleToPagesY;
diff --git a/offapi/com/sun/star/sheet/XActivationBroadcaster.idl b/offapi/com/sun/star/sheet/XActivationBroadcaster.idl
index 7c57ab280508..e49a97e21d33 100644
--- a/offapi/com/sun/star/sheet/XActivationBroadcaster.idl
+++ b/offapi/com/sun/star/sheet/XActivationBroadcaster.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module sheet {
/** provides methods to add and remove XActivationEventListener
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XActivationBroadcaster: com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/sheet/XActivationEventListener.idl b/offapi/com/sun/star/sheet/XActivationEventListener.idl
index ede31cf591d0..7a129c0ae5df 100644
--- a/offapi/com/sun/star/sheet/XActivationEventListener.idl
+++ b/offapi/com/sun/star/sheet/XActivationEventListener.idl
@@ -60,7 +60,7 @@ published interface XActivationEventListener: com::sun::star::lang::XEventListen
@see ActivationEvent
@see XSpreadsheetViewEventProvieder
- @since OOo 2.0.0
+ @since OOo 2.0
*/
void activeSpreadsheetChanged( [in] com::sun::star::sheet::ActivationEvent aEvent );
diff --git a/offapi/com/sun/star/sheet/XDataPilotTable2.idl b/offapi/com/sun/star/sheet/XDataPilotTable2.idl
index df7ec30041a8..a0fbd5934e8d 100644
--- a/offapi/com/sun/star/sheet/XDataPilotTable2.idl
+++ b/offapi/com/sun/star/sheet/XDataPilotTable2.idl
@@ -65,7 +65,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::XDataPilotTable
- @since OOo 3.0.0
+ @since OOo 3.0
*/
interface XDataPilotTable2: com::sun::star::sheet::XDataPilotTable
{
diff --git a/offapi/com/sun/star/sheet/XDrillDownDataSupplier.idl b/offapi/com/sun/star/sheet/XDrillDownDataSupplier.idl
index ec5e6e2cb9c7..f63d99a65aa1 100644
--- a/offapi/com/sun/star/sheet/XDrillDownDataSupplier.idl
+++ b/offapi/com/sun/star/sheet/XDrillDownDataSupplier.idl
@@ -57,7 +57,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::DataPilotSource
- @since OOo 3.0.0
+ @since OOo 3.0
*/
interface XDrillDownDataSupplier: com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/sheet/XEnhancedMouseClickBroadcaster.idl b/offapi/com/sun/star/sheet/XEnhancedMouseClickBroadcaster.idl
index 58461f90296a..16de0542a669 100644
--- a/offapi/com/sun/star/sheet/XEnhancedMouseClickBroadcaster.idl
+++ b/offapi/com/sun/star/sheet/XEnhancedMouseClickBroadcaster.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module sheet {
/** provides methods to add and remove EnhancedMouseClickHandler
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XEnhancedMouseClickBroadcaster: com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/sheet/XExternalDocLink.idl b/offapi/com/sun/star/sheet/XExternalDocLink.idl
index 1a9662dbeed7..80b249e7d520 100644
--- a/offapi/com/sun/star/sheet/XExternalDocLink.idl
+++ b/offapi/com/sun/star/sheet/XExternalDocLink.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::ExternalDocLink
- @since OOo 3.1.0
+ @since OOo 3.1
*/
interface XExternalDocLink
{
diff --git a/offapi/com/sun/star/sheet/XExternalDocLinks.idl b/offapi/com/sun/star/sheet/XExternalDocLinks.idl
index 642b3c57eb14..0f9085ad7149 100644
--- a/offapi/com/sun/star/sheet/XExternalDocLinks.idl
+++ b/offapi/com/sun/star/sheet/XExternalDocLinks.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::ExternalDocLinks
- @since OOo 3.1.0
+ @since OOo 3.1
*/
interface XExternalDocLinks
{
diff --git a/offapi/com/sun/star/sheet/XExternalSheetCache.idl b/offapi/com/sun/star/sheet/XExternalSheetCache.idl
index 23827d7a04e2..89a1f70fb390 100644
--- a/offapi/com/sun/star/sheet/XExternalSheetCache.idl
+++ b/offapi/com/sun/star/sheet/XExternalSheetCache.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::ExternalSheetCache
- @since OOo 3.1.0
+ @since OOo 3.1
*/
interface XExternalSheetCache
{
diff --git a/offapi/com/sun/star/sheet/XScenarioEnhanced.idl b/offapi/com/sun/star/sheet/XScenarioEnhanced.idl
index cd4b895f1258..e61f6103e3b9 100644
--- a/offapi/com/sun/star/sheet/XScenarioEnhanced.idl
+++ b/offapi/com/sun/star/sheet/XScenarioEnhanced.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module sheet {
@see com::sun::star::sheet::XScenario
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XScenarioEnhanced: com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/smarttags/SmartTagAction.idl b/offapi/com/sun/star/smarttags/SmartTagAction.idl
index a07c93eb5385..73c28ee87e07 100644
--- a/offapi/com/sun/star/smarttags/SmartTagAction.idl
+++ b/offapi/com/sun/star/smarttags/SmartTagAction.idl
@@ -46,7 +46,7 @@ module com { module sun { module star { module smarttags {
that can be performed for a smart tag which has been recognized
by a <type>SmartTagRecognizer</type> service.</p>
- @since OOo 2.3.0
+ @since OOo 2.3
*/
service SmartTagAction : XSmartTagAction {};
diff --git a/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl
index 60223c89d4ac..e77cbe1bd87f 100644
--- a/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl
+++ b/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module smarttags {
associated with specific actions which are defined by
implementations of the <type>SmartTagAction</type> service.</p>
- @since OOo 2.3.0
+ @since OOo 2.3
*/
service SmartTagRecognizer : XSmartTagRecognizer {};
diff --git a/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl b/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl
index b72034a64cb7..c4624cad3058 100644
--- a/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl
+++ b/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl
@@ -37,7 +37,7 @@
/** specifies the which type of text is passed to
<method>XSmartTagRecognizer::recognize()</method></p>
- @since OOo 2.3.0
+ @since OOo 2.3
*/
enum SmartTagRecognizerMode
diff --git a/offapi/com/sun/star/smarttags/XSmartTagAction.idl b/offapi/com/sun/star/smarttags/XSmartTagAction.idl
index 271dd84b0d19..696f7cdccfc0 100644
--- a/offapi/com/sun/star/smarttags/XSmartTagAction.idl
+++ b/offapi/com/sun/star/smarttags/XSmartTagAction.idl
@@ -64,7 +64,7 @@ module com { module sun { module star { module smarttags {
/** provides access to smart tag actions.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
interface XSmartTagAction: com::sun::star::lang::XInitialization
diff --git a/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
index c84d75878a8b..9c51e4a5ad0e 100644
--- a/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
+++ b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
@@ -65,7 +65,7 @@ module com { module sun { module star { module smarttags {
/**
provides access to a smart tag recognizer.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
interface XSmartTagRecognizer: com::sun::star::lang::XInitialization
diff --git a/offapi/com/sun/star/style/CharacterProperties.idl b/offapi/com/sun/star/style/CharacterProperties.idl
index 6c6bf3d99a7b..fb6556b508ae 100644
--- a/offapi/com/sun/star/style/CharacterProperties.idl
+++ b/offapi/com/sun/star/style/CharacterProperties.idl
@@ -428,7 +428,7 @@ published service CharacterProperties
/** If this optional property is <TRUE/>, then the characters are invisible.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean CharHidden;
diff --git a/offapi/com/sun/star/style/NumberingType.idl b/offapi/com/sun/star/style/NumberingType.idl
index 25094b1ed677..21196a8cafb0 100644
--- a/offapi/com/sun/star/style/NumberingType.idl
+++ b/offapi/com/sun/star/style/NumberingType.idl
@@ -226,7 +226,7 @@ published constants NumberingType
//-------------------------------------------------------------------------
/** Numbering in Hebrew alphabet letters
- @since OOo 2.0.0
+ @since OOo 2.0
*/
const short CHARS_HEBREW = 33;
diff --git a/offapi/com/sun/star/task/XRestartManager.idl b/offapi/com/sun/star/task/XRestartManager.idl
index 102a1044d2e8..c53d0954b415 100644
--- a/offapi/com/sun/star/task/XRestartManager.idl
+++ b/offapi/com/sun/star/task/XRestartManager.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module task {
//=============================================================================
/** allows to try to restart the office.
- @since OOo3.3
+ @since OOo 3.3
*/
published interface XRestartManager : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/text/BaseFrameProperties.idl b/offapi/com/sun/star/text/BaseFrameProperties.idl
index e6ede2e36349..cac2ea15296b 100644
--- a/offapi/com/sun/star/text/BaseFrameProperties.idl
+++ b/offapi/com/sun/star/text/BaseFrameProperties.idl
@@ -335,7 +335,7 @@ published service BaseFrameProperties
of the shape, if the text document setting ConsiderTextWrapOnObjPos
is <TRUE/>. Valid values are given by <member>WrapInfluenceOnPosition</member></p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short WrapInfluenceOnPosition;
diff --git a/offapi/com/sun/star/text/Cell.idl b/offapi/com/sun/star/text/Cell.idl
index 7669f10afa34..f1161117e8b2 100644
--- a/offapi/com/sun/star/text/Cell.idl
+++ b/offapi/com/sun/star/text/Cell.idl
@@ -93,7 +93,7 @@ service Cell
<li>CellProtection: non-functional implementation.</li>
</ul>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service com::sun::star::table::CellProperties;
diff --git a/offapi/com/sun/star/text/DocumentSettings.idl b/offapi/com/sun/star/text/DocumentSettings.idl
index 19c4d75997cb..0917cb46768d 100644
--- a/offapi/com/sun/star/text/DocumentSettings.idl
+++ b/offapi/com/sun/star/text/DocumentSettings.idl
@@ -139,7 +139,7 @@ published service DocumentSettings
a proportional line spacing is only applied below a text line and
it's always added to the paragraph spacing between two paragraphs.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean UseFormerLineSpacing;
// ------------------------------------------------------------
@@ -156,7 +156,7 @@ published service DocumentSettings
the spacing of the last paragraph respectively table of a table
cell isn't added at the bottom of this table cell.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean AddParaSpacingToTableCells;
// ------------------------------------------------------------
@@ -174,7 +174,7 @@ published service DocumentSettings
its vertical position, doesn't include the lower spacing and the
line spacing of the previous paragraph.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean UseFormerObjectPositioning;
@@ -191,7 +191,7 @@ published service DocumentSettings
If <FALSE/> (default value), the former object positioning
algorithm (known from OpenOffice.org 1.1) is applied.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean ConsiderTextWrapOnObjPos;
diff --git a/offapi/com/sun/star/text/FootnoteSettings.idl b/offapi/com/sun/star/text/FootnoteSettings.idl
index e11354bd1b7c..42c6cc20d52f 100644
--- a/offapi/com/sun/star/text/FootnoteSettings.idl
+++ b/offapi/com/sun/star/text/FootnoteSettings.idl
@@ -126,7 +126,7 @@ published service FootnoteSettings
/** contains the name of the character style that is used
for footnote/endnote anchor in the text.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string AnchorCharStyleName;
diff --git a/offapi/com/sun/star/text/GenericTextDocument.idl b/offapi/com/sun/star/text/GenericTextDocument.idl
index c1562b5ddf49..7a7e06ce5f34 100644
--- a/offapi/com/sun/star/text/GenericTextDocument.idl
+++ b/offapi/com/sun/star/text/GenericTextDocument.idl
@@ -179,22 +179,28 @@ published service GenericTextDocument
[optional] interface com::sun::star::style::XStyleFamiliesSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::text::XBookmarksSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::text::XDocumentIndexesSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::text::XTextFieldsSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::text::XTextFramesSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::text::XTextSectionsSupplier;
- /// @since OOo 1.1.2
+ /** @since OOo 1.1.2
+ */
[optional] interface com::sun::star::util::XNumberFormatsSupplier;
//-------------------------------------------------------------------------
diff --git a/offapi/com/sun/star/text/LineNumberingProperties.idl b/offapi/com/sun/star/text/LineNumberingProperties.idl
index 5a965b100963..b91d82dbc1bb 100644
--- a/offapi/com/sun/star/text/LineNumberingProperties.idl
+++ b/offapi/com/sun/star/text/LineNumberingProperties.idl
@@ -103,7 +103,7 @@ published service LineNumberingProperties
<p>If set to <FALSE/> the line numbering will be continous.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean RestartAtEachPage;
diff --git a/offapi/com/sun/star/text/Paragraph.idl b/offapi/com/sun/star/text/Paragraph.idl
index 4c8330eb1f06..ee75fed06ca6 100644
--- a/offapi/com/sun/star/text/Paragraph.idl
+++ b/offapi/com/sun/star/text/Paragraph.idl
@@ -142,7 +142,7 @@ published service Paragraph
interface com::sun::star::container::XEnumerationAccess;
/** gives access to a sequence of properties.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional] interface ::com::sun::star::beans::XTolerantMultiPropertySet;
};
diff --git a/offapi/com/sun/star/text/PositionLayoutDir.idl b/offapi/com/sun/star/text/PositionLayoutDir.idl
index 72e420876171..359318dbf831 100644
--- a/offapi/com/sun/star/text/PositionLayoutDir.idl
+++ b/offapi/com/sun/star/text/PositionLayoutDir.idl
@@ -37,7 +37,7 @@
/** These values specify the layout direction, in which the position attributes
of a shape are given
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants PositionLayoutDir
{
diff --git a/offapi/com/sun/star/text/RelOrientation.idl b/offapi/com/sun/star/text/RelOrientation.idl
index eb30a465a1f6..f0e6e2c1e98a 100644
--- a/offapi/com/sun/star/text/RelOrientation.idl
+++ b/offapi/com/sun/star/text/RelOrientation.idl
@@ -108,7 +108,7 @@ published constants RelOrientation
/** at the top of the text line, only sensible for vertical orientation.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
const short TEXT_LINE = 9;
diff --git a/offapi/com/sun/star/text/Shape.idl b/offapi/com/sun/star/text/Shape.idl
index 43d64efcf9c9..a7fe22ae5935 100644
--- a/offapi/com/sun/star/text/Shape.idl
+++ b/offapi/com/sun/star/text/Shape.idl
@@ -184,7 +184,7 @@ published service Shape
of the shape, if the text document setting ConsiderTextWrapOnObjPos
is <TRUE/>. Valid values are given by <member>WrapInfluenceOnPosition</member></p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short WrapInfluenceOnPosition;
@@ -197,7 +197,7 @@ published service Shape
transformation property of the included service com::sun::star::drawing::Shape
converted to the horizontal left-to-right layout.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, readonly, property] com::sun::star::drawing::HomogenMatrix3 TransformationInHoriL2R;
//-------------------------------------------------------------------------
@@ -206,7 +206,7 @@ published service Shape
<p>Valid values are given by <member>PositionLayoutDir</member></p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] short PositionLayoutDir;
//-------------------------------------------------------------------------
@@ -218,7 +218,7 @@ published service Shape
start position property of the included service com::sun::star::drawing::Shape
converted to the horizontal left-to-right layout.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, readonly, property] com::sun::star::awt::Point StartPositionInHoriL2R;
//-------------------------------------------------------------------------
@@ -230,7 +230,7 @@ published service Shape
end position property of the included service com::sun::star::drawing::Shape
converted to the horizontal left-to-right layout.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, readonly, property] com::sun::star::awt::Point EndPositionInHoriL2R;
};
diff --git a/offapi/com/sun/star/text/TextMarkupType.idl b/offapi/com/sun/star/text/TextMarkupType.idl
index f5ea4e59f1ec..c752004d4687 100644
--- a/offapi/com/sun/star/text/TextMarkupType.idl
+++ b/offapi/com/sun/star/text/TextMarkupType.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module text {
<p>These constants are used with
<method>XTextMarkup::commitTextMarkup()</method></p>
- @since OOo 2.3.0
+ @since OOo 2.3
*/
constants TextMarkupType
diff --git a/offapi/com/sun/star/text/TextPortion.idl b/offapi/com/sun/star/text/TextPortion.idl
index 6c23d9fa1655..3bfc745d97da 100644
--- a/offapi/com/sun/star/text/TextPortion.idl
+++ b/offapi/com/sun/star/text/TextPortion.idl
@@ -85,7 +85,7 @@ published service TextPortion
//-------------------------------------------------------------------------
/** gives access to a sequence of properties.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional]
interface ::com::sun::star::beans::XTolerantMultiPropertySet;
diff --git a/offapi/com/sun/star/text/TextTableRow.idl b/offapi/com/sun/star/text/TextTableRow.idl
index 1d5947a051a9..b1eca1467b89 100644
--- a/offapi/com/sun/star/text/TextTableRow.idl
+++ b/offapi/com/sun/star/text/TextTableRow.idl
@@ -111,7 +111,7 @@ published service TextTableRow
/** If <TRUE/>, the row is allowed to be split at page or column breaks.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property, maybevoid] boolean IsSplitAllowed;
diff --git a/offapi/com/sun/star/text/ViewSettings.idl b/offapi/com/sun/star/text/ViewSettings.idl
index 007a8f1e617d..102ab0c1dc1c 100644
--- a/offapi/com/sun/star/text/ViewSettings.idl
+++ b/offapi/com/sun/star/text/ViewSettings.idl
@@ -260,7 +260,7 @@ published service ViewSettings
//-------------------------------------------------------------------------
/** Specifies whether to display the grid or not
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean IsRasterVisible;
@@ -268,7 +268,7 @@ published service ViewSettings
/** Specifies whether to move frames, drawing elements, and form
functions only between grid points.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] boolean IsSnapToRaster;
@@ -278,7 +278,7 @@ published service ViewSettings
<p>The value must be greater or equal to 0, and the application
may enforce an upper bound for the value.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@throws com::sun::star::lang::IllegalArgumentException
if the value is out of bounds.
*/
@@ -290,7 +290,7 @@ published service ViewSettings
<p>The value must be greater or equal to 0, and the application
may enforce an upper bound for the value.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@throws com::sun::star::lang::IllegalArgumentException
if the value is out of bounds.
*/
@@ -303,7 +303,7 @@ published service ViewSettings
<p>The value must be greater than 0. The application
may enforce more restricting bounds for the value.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@throws com::sun::star::lang::IllegalArgumentException
if the value is out of bounds.
*/
@@ -316,7 +316,7 @@ published service ViewSettings
<p>The value must be greater than 0. The application
may enforce more restricting bounds for the value.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
@throws com::sun::star::lang::IllegalArgumentException
if the value is out of bounds.
*/
@@ -325,7 +325,7 @@ published service ViewSettings
//-------------------------------------------------------------------------
/** If this property is <TRUE/>, hidden characters are displayed
- @since OOo 3.0.0
+ @since OOo 3.0
*/
[optional, property] boolean ShowHiddenCharacters;
//-------------------------------------------------------------------------
@@ -334,7 +334,7 @@ published service ViewSettings
<p>This option controls the use of the settings ShowHiddenCharacters,
ShowTabstops, ShowSpaces, ShowBreaks and ShowParaBreaks </p>
- @since OOo 3.0.0
+ @since OOo 3.0
*/
[optional, property] boolean ShowNonprintingCharacters;
//-------------------------------------------------------------------------
@@ -342,7 +342,7 @@ published service ViewSettings
<p>Uses values <type scope="com::sun::star::awt">FieldUnit</type></p>
- @since OOo 3.1.0
+ @since OOo 3.1
*/
[optional, property] long HorizontalRulerMetric;
//-------------------------------------------------------------------------
@@ -350,7 +350,7 @@ published service ViewSettings
<p>Uses values from <type scope="com::sun::star::awt">FieldUnit</type></p>
- @since OOo 3.1.0
+ @since OOo 3.1
*/
[optional, property] long VerticalRulerMetric;
};
diff --git a/offapi/com/sun/star/text/XTextMarkup.idl b/offapi/com/sun/star/text/XTextMarkup.idl
index f8dc3f834e73..877e31c7377f 100644
--- a/offapi/com/sun/star/text/XTextMarkup.idl
+++ b/offapi/com/sun/star/text/XTextMarkup.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module text {
/** provides functionality to markup text.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
interface XTextMarkup
diff --git a/offapi/com/sun/star/text/fieldmaster/Database.idl b/offapi/com/sun/star/text/fieldmaster/Database.idl
index 921c86ff8c94..f37e3d5e2fbf 100644
--- a/offapi/com/sun/star/text/fieldmaster/Database.idl
+++ b/offapi/com/sun/star/text/fieldmaster/Database.idl
@@ -70,13 +70,13 @@ published service Database
//------------------------------------------------------------------------
/** indicates the URL of a database file.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseURL;
//------------------------------------------------------------------------
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseResource;
//------------------------------------------------------------------------
diff --git a/offapi/com/sun/star/text/textfield/DatabaseName.idl b/offapi/com/sun/star/text/textfield/DatabaseName.idl
index f051aa72b7f1..92c5dc5d8a8f 100644
--- a/offapi/com/sun/star/text/textfield/DatabaseName.idl
+++ b/offapi/com/sun/star/text/textfield/DatabaseName.idl
@@ -62,12 +62,12 @@ published service DatabaseName
[property] string DataTableName;
/** indicates the URL of a database file.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseURL;
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseResource;
diff --git a/offapi/com/sun/star/text/textfield/DatabaseNextSet.idl b/offapi/com/sun/star/text/textfield/DatabaseNextSet.idl
index 01b762b1e113..a9b593e1ef49 100644
--- a/offapi/com/sun/star/text/textfield/DatabaseNextSet.idl
+++ b/offapi/com/sun/star/text/textfield/DatabaseNextSet.idl
@@ -66,12 +66,12 @@ published service DatabaseNextSet
[property] string Condition;
/** indicates the URL of a database file.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseURL;
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseResource;
diff --git a/offapi/com/sun/star/text/textfield/DatabaseNumberOfSet.idl b/offapi/com/sun/star/text/textfield/DatabaseNumberOfSet.idl
index 1ad00c840bce..ea5c54b0f131 100644
--- a/offapi/com/sun/star/text/textfield/DatabaseNumberOfSet.idl
+++ b/offapi/com/sun/star/text/textfield/DatabaseNumberOfSet.idl
@@ -71,12 +71,12 @@ published service DatabaseNumberOfSet
[property] long SetNumber;
/** indicates the URL of a database file.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseURL;
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseResource;
diff --git a/offapi/com/sun/star/text/textfield/DatabaseSetNumber.idl b/offapi/com/sun/star/text/textfield/DatabaseSetNumber.idl
index 3af3ab3516ce..f4417d564c03 100644
--- a/offapi/com/sun/star/text/textfield/DatabaseSetNumber.idl
+++ b/offapi/com/sun/star/text/textfield/DatabaseSetNumber.idl
@@ -72,12 +72,12 @@ published service DatabaseSetNumber
[property] long SetNumber;
/** indicates the URL of a database file.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseURL;
/** indicates a connection URL, which locates a database driver.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
[optional, property] string DataBaseResource;
diff --git a/offapi/com/sun/star/ucb/TransientDocumentsContentProvider.idl b/offapi/com/sun/star/ucb/TransientDocumentsContentProvider.idl
index d985376b4c78..f654819a6d8d 100644
--- a/offapi/com/sun/star/ucb/TransientDocumentsContentProvider.idl
+++ b/offapi/com/sun/star/ucb/TransientDocumentsContentProvider.idl
@@ -57,7 +57,7 @@ module com { module sun { module star { module ucb {
@see TransientDocumentsFolderContent
@see TransientDocumentsStreamContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsContentProvider
{
diff --git a/offapi/com/sun/star/ucb/TransientDocumentsDocumentContent.idl b/offapi/com/sun/star/ucb/TransientDocumentsDocumentContent.idl
index a6bf588ad873..54314f5bd24b 100644
--- a/offapi/com/sun/star/ucb/TransientDocumentsDocumentContent.idl
+++ b/offapi/com/sun/star/ucb/TransientDocumentsDocumentContent.idl
@@ -82,7 +82,7 @@ module com { module sun { module star { module ucb {
@see TransientDocumentsFolderContent
@see TransientDocumentsStreamContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsDocumentContent
{
diff --git a/offapi/com/sun/star/ucb/TransientDocumentsFolderContent.idl b/offapi/com/sun/star/ucb/TransientDocumentsFolderContent.idl
index a2233e4c5f40..68ad0be1f7bb 100644
--- a/offapi/com/sun/star/ucb/TransientDocumentsFolderContent.idl
+++ b/offapi/com/sun/star/ucb/TransientDocumentsFolderContent.idl
@@ -81,7 +81,7 @@ module com { module sun { module star { module ucb {
@see TransientDocumentsDocumentContent
@see TransientDocumentsStreamContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsFolderContent
{
diff --git a/offapi/com/sun/star/ucb/TransientDocumentsRootContent.idl b/offapi/com/sun/star/ucb/TransientDocumentsRootContent.idl
index 0d33d0415560..cf953bb3d60a 100644
--- a/offapi/com/sun/star/ucb/TransientDocumentsRootContent.idl
+++ b/offapi/com/sun/star/ucb/TransientDocumentsRootContent.idl
@@ -79,7 +79,7 @@ module com { module sun { module star { module ucb {
@see TransientDocumentsFolderContent
@see TransientDocumentsStreamContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsRootContent
{
diff --git a/offapi/com/sun/star/ucb/TransientDocumentsStreamContent.idl b/offapi/com/sun/star/ucb/TransientDocumentsStreamContent.idl
index aede99473933..7aaf3d4574db 100644
--- a/offapi/com/sun/star/ucb/TransientDocumentsStreamContent.idl
+++ b/offapi/com/sun/star/ucb/TransientDocumentsStreamContent.idl
@@ -79,7 +79,7 @@ module com { module sun { module star { module ucb {
@see TransientDocumentsDocumentContent
@see TransientDocumentsFolderContent
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service TransientDocumentsStreamContent
{
diff --git a/offapi/com/sun/star/ui/ConfigurableUIElement.idl b/offapi/com/sun/star/ui/ConfigurableUIElement.idl
index 88d2a96416e8..afde83a344bd 100644
--- a/offapi/com/sun/star/ui/ConfigurableUIElement.idl
+++ b/offapi/com/sun/star/ui/ConfigurableUIElement.idl
@@ -74,7 +74,7 @@ module com { module sun { module star { module ui {
</ul>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ConfigurableUIElement
diff --git a/offapi/com/sun/star/ui/ConfigurationEvent.idl b/offapi/com/sun/star/ui/ConfigurationEvent.idl
index 9001f3d2b333..b778bda9ac8a 100644
--- a/offapi/com/sun/star/ui/ConfigurationEvent.idl
+++ b/offapi/com/sun/star/ui/ConfigurationEvent.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module ui {
/** this event is broadcasted by a configuration manager whenever the state of
user interface element has changed.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published struct ConfigurationEvent : ::com::sun::star::container::ContainerEvent
diff --git a/offapi/com/sun/star/ui/DockingArea.idl b/offapi/com/sun/star/ui/DockingArea.idl
index 9a4170dc1173..f376581e0c7e 100644
--- a/offapi/com/sun/star/ui/DockingArea.idl
+++ b/offapi/com/sun/star/ui/DockingArea.idl
@@ -44,7 +44,7 @@ module com { module sun { module star { module ui {
@see com::sun::star::frame::XLayoutManager
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
enum DockingArea
diff --git a/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl b/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
index 58ff8da73fa0..f0552332946d 100644
--- a/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
+++ b/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module ui {
by using an UNO service manager. It provides then access to
the global accelerator configuration.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service GlobalAcceleratorConfiguration : XAcceleratorConfiguration
{};
diff --git a/offapi/com/sun/star/ui/ImageType.idl b/offapi/com/sun/star/ui/ImageType.idl
index fb35073f9d38..7fa2d949cb15 100644
--- a/offapi/com/sun/star/ui/ImageType.idl
+++ b/offapi/com/sun/star/ui/ImageType.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module ui {
the current image set of an image manager.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants ImageType
{
diff --git a/offapi/com/sun/star/ui/ItemDescriptor.idl b/offapi/com/sun/star/ui/ItemDescriptor.idl
index 8732f300b96d..b6e9c2404330 100644
--- a/offapi/com/sun/star/ui/ItemDescriptor.idl
+++ b/offapi/com/sun/star/ui/ItemDescriptor.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module ui {
You could have a menu or a toolbox working with the same item descriptor.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ItemDescriptor
{
diff --git a/offapi/com/sun/star/ui/ItemStyle.idl b/offapi/com/sun/star/ui/ItemStyle.idl
index 78e11cde05fd..9efb3aa81cc8 100644
--- a/offapi/com/sun/star/ui/ItemStyle.idl
+++ b/offapi/com/sun/star/ui/ItemStyle.idl
@@ -56,7 +56,7 @@ module com { module sun { module star { module ui {
</ul>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants ItemStyle
{
diff --git a/offapi/com/sun/star/ui/ItemType.idl b/offapi/com/sun/star/ui/ItemType.idl
index 35271779ca12..677624489126 100644
--- a/offapi/com/sun/star/ui/ItemType.idl
+++ b/offapi/com/sun/star/ui/ItemType.idl
@@ -31,7 +31,7 @@ module com { module sun { module star { module ui {
/** Determins the type of an item.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants ItemType
{
diff --git a/offapi/com/sun/star/ui/ModuleUICategoryDescription.idl b/offapi/com/sun/star/ui/ModuleUICategoryDescription.idl
index 3b410d9dc799..3253b1152221 100644
--- a/offapi/com/sun/star/ui/ModuleUICategoryDescription.idl
+++ b/offapi/com/sun/star/ui/ModuleUICategoryDescription.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module ui {
or Calc.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleUICategoryDescription
diff --git a/offapi/com/sun/star/ui/ModuleUICommandDescription.idl b/offapi/com/sun/star/ui/ModuleUICommandDescription.idl
index 100c31073b7f..dc8c58947079 100644
--- a/offapi/com/sun/star/ui/ModuleUICommandDescription.idl
+++ b/offapi/com/sun/star/ui/ModuleUICommandDescription.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module ui {
that are part of a single OpenOffice.org module, like Writer or Calc.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleUICommandDescription
diff --git a/offapi/com/sun/star/ui/ModuleUIConfigurationManager.idl b/offapi/com/sun/star/ui/ModuleUIConfigurationManager.idl
index 44ee22856610..24eb4d4c22ce 100644
--- a/offapi/com/sun/star/ui/ModuleUIConfigurationManager.idl
+++ b/offapi/com/sun/star/ui/ModuleUIConfigurationManager.idl
@@ -63,7 +63,7 @@ module com { module sun { module star { module ui {
this layer.</br>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleUIConfigurationManager
diff --git a/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl b/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl
index 835fecc0e5ab..0a405a1ac64b 100644
--- a/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl
+++ b/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module ui {
/** specifies a central user interface configuration provider which gives
access to module based user interface configuration managers.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleUIConfigurationManagerSupplier
diff --git a/offapi/com/sun/star/ui/ModuleWindowStateConfiguration.idl b/offapi/com/sun/star/ui/ModuleWindowStateConfiguration.idl
index 09c2d9657e49..c07651c82b30 100644
--- a/offapi/com/sun/star/ui/ModuleWindowStateConfiguration.idl
+++ b/offapi/com/sun/star/ui/ModuleWindowStateConfiguration.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module ui {
Calc.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service ModuleWindowStateConfiguration
diff --git a/offapi/com/sun/star/ui/UICategoryDescription.idl b/offapi/com/sun/star/ui/UICategoryDescription.idl
index 9853b43fc769..5698ff74fccf 100644
--- a/offapi/com/sun/star/ui/UICategoryDescription.idl
+++ b/offapi/com/sun/star/ui/UICategoryDescription.idl
@@ -46,7 +46,7 @@ module com { module sun { module star { module ui {
implementations which provides all commands to a user.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
//=============================================================================
diff --git a/offapi/com/sun/star/ui/UICommandDescription.idl b/offapi/com/sun/star/ui/UICommandDescription.idl
index 76d7c179731b..bd1f35926149 100644
--- a/offapi/com/sun/star/ui/UICommandDescription.idl
+++ b/offapi/com/sun/star/ui/UICommandDescription.idl
@@ -46,7 +46,7 @@ module com { module sun { module star { module ui {
are part of OpenOffice.org modules, like Writer or Calc.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UICommandDescription
diff --git a/offapi/com/sun/star/ui/UIConfigurationManager.idl b/offapi/com/sun/star/ui/UIConfigurationManager.idl
index 4e9b56cd4c97..509bd71e93d4 100644
--- a/offapi/com/sun/star/ui/UIConfigurationManager.idl
+++ b/offapi/com/sun/star/ui/UIConfigurationManager.idl
@@ -52,7 +52,7 @@ module com { module sun { module star { module ui {
/** specifies a user interface configuration manager which controls
all customizeable user interface elements of an object.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UIConfigurationManager
diff --git a/offapi/com/sun/star/ui/UIElement.idl b/offapi/com/sun/star/ui/UIElement.idl
index 580a660f734e..610cfa73ae25 100644
--- a/offapi/com/sun/star/ui/UIElement.idl
+++ b/offapi/com/sun/star/ui/UIElement.idl
@@ -63,7 +63,7 @@ module com { module sun { module star { module ui {
before it can be used.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UIElement
diff --git a/offapi/com/sun/star/ui/UIElementFactory.idl b/offapi/com/sun/star/ui/UIElementFactory.idl
index 5e0e171c7da1..24c4fa4f0501 100644
--- a/offapi/com/sun/star/ui/UIElementFactory.idl
+++ b/offapi/com/sun/star/ui/UIElementFactory.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module ui {
service to provide access to itself.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UIElementFactory
diff --git a/offapi/com/sun/star/ui/UIElementFactoryManager.idl b/offapi/com/sun/star/ui/UIElementFactoryManager.idl
index c814a58f6b8e..8a150c1af2cc 100644
--- a/offapi/com/sun/star/ui/UIElementFactoryManager.idl
+++ b/offapi/com/sun/star/ui/UIElementFactoryManager.idl
@@ -49,7 +49,7 @@ module com { module sun { module star { module ui {
<type scope="com::sun::star::lang">ServiceManager</type>.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UIElementFactoryManager
diff --git a/offapi/com/sun/star/ui/UIElementSettings.idl b/offapi/com/sun/star/ui/UIElementSettings.idl
index 575ff9ca1d71..f10eec663683 100644
--- a/offapi/com/sun/star/ui/UIElementSettings.idl
+++ b/offapi/com/sun/star/ui/UIElementSettings.idl
@@ -51,7 +51,7 @@ module com { module sun { module star { module ui {
although limitations based on the real user interface element may be visible.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service UIElementSettings
{
diff --git a/offapi/com/sun/star/ui/UIElementType.idl b/offapi/com/sun/star/ui/UIElementType.idl
index 0b4301f54f2a..182d75694a85 100644
--- a/offapi/com/sun/star/ui/UIElementType.idl
+++ b/offapi/com/sun/star/ui/UIElementType.idl
@@ -35,7 +35,7 @@ module com { module sun { module star { module ui {
/** determine the type of a user interface element which is controlled
by a layout manager.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants UIElementType
{
diff --git a/offapi/com/sun/star/ui/WindowContentFactory.idl b/offapi/com/sun/star/ui/WindowContentFactory.idl
index c1ea6a94d9b8..991c92c812cf 100644
--- a/offapi/com/sun/star/ui/WindowContentFactory.idl
+++ b/offapi/com/sun/star/ui/WindowContentFactory.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module ui {
The specific type of the created window depends on the provided arguments.
</p>
- @since OOo 3.1.0
+ @since OOo 3.1
*/
service WindowContentFactory : com::sun::star::lang::XSingleComponentFactory
diff --git a/offapi/com/sun/star/ui/WindowStateConfiguration.idl b/offapi/com/sun/star/ui/WindowStateConfiguration.idl
index c5243e4144fa..915bdfad93b0 100644
--- a/offapi/com/sun/star/ui/WindowStateConfiguration.idl
+++ b/offapi/com/sun/star/ui/WindowStateConfiguration.idl
@@ -48,7 +48,7 @@ module com { module sun { module star { module ui {
part of OpenOffice.org modules, like Writer or Calc.
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
service WindowStateConfiguration
diff --git a/offapi/com/sun/star/ui/XAcceleratorConfiguration.idl b/offapi/com/sun/star/ui/XAcceleratorConfiguration.idl
index 2969f22a7f8c..46f04e31064f 100644
--- a/offapi/com/sun/star/ui/XAcceleratorConfiguration.idl
+++ b/offapi/com/sun/star/ui/XAcceleratorConfiguration.idl
@@ -77,7 +77,7 @@ module com { module sun { module star { module ui {
@see AcceleratorConfiguration
@see <type scope="dom::sun::star::util">XFlushable</type>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XAcceleratorConfiguration
{
diff --git a/offapi/com/sun/star/ui/XDockingAreaAcceptor.idl b/offapi/com/sun/star/ui/XDockingAreaAcceptor.idl
index 8e6d9a01a4ac..f3912a12c1a6 100644
--- a/offapi/com/sun/star/ui/XDockingAreaAcceptor.idl
+++ b/offapi/com/sun/star/ui/XDockingAreaAcceptor.idl
@@ -59,7 +59,7 @@ module com { module sun { module star { module ui {
@see com::sun::star::frame::XFrame
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
diff --git a/offapi/com/sun/star/ui/XModuleUIConfigurationManager.idl b/offapi/com/sun/star/ui/XModuleUIConfigurationManager.idl
index a6b6fd32ac64..66fe267d2fef 100644
--- a/offapi/com/sun/star/ui/XModuleUIConfigurationManager.idl
+++ b/offapi/com/sun/star/ui/XModuleUIConfigurationManager.idl
@@ -69,7 +69,7 @@ module com { module sun { module star { module ui {
configuration manager uses.</br>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XModuleUIConfigurationManager : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XModuleUIConfigurationManagerSupplier.idl b/offapi/com/sun/star/ui/XModuleUIConfigurationManagerSupplier.idl
index 0a6b9cfef0dc..a1f9942627a7 100644
--- a/offapi/com/sun/star/ui/XModuleUIConfigurationManagerSupplier.idl
+++ b/offapi/com/sun/star/ui/XModuleUIConfigurationManagerSupplier.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module ui {
/** allows to retrieve user interface configuration managers related to
OpenOffice.org modules.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XModuleUIConfigurationManagerSupplier : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIConfiguration.idl b/offapi/com/sun/star/ui/XUIConfiguration.idl
index d8c38e43bb70..95ec91a65f5b 100644
--- a/offapi/com/sun/star/ui/XUIConfiguration.idl
+++ b/offapi/com/sun/star/ui/XUIConfiguration.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module ui {
<p>This can be useful for UI to enable/disable some functions without
actually accessing the data.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfiguration : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIConfigurationListener.idl b/offapi/com/sun/star/ui/XUIConfigurationListener.idl
index cc8a8a14eed2..2e89eee6bea0 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationListener.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationListener.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module ui {
/** supplies information about changes of a user interface
configuration manager.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfigurationListener : com::sun::star::lang::XEventListener
diff --git a/offapi/com/sun/star/ui/XUIConfigurationManager.idl b/offapi/com/sun/star/ui/XUIConfigurationManager.idl
index 3958441ee486..95025ac3a516 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationManager.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationManager.idl
@@ -70,7 +70,7 @@ module com { module sun { module star { module ui {
controls the structure of all customizable user interface
elements.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfigurationManager : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIConfigurationManagerSupplier.idl b/offapi/com/sun/star/ui/XUIConfigurationManagerSupplier.idl
index 8ffc2482d834..a1f091623a30 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationManagerSupplier.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationManagerSupplier.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module ui {
/** allows to retrieve the user interface configuration manager related to
an object.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfigurationManagerSupplier : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIConfigurationPersistence.idl b/offapi/com/sun/star/ui/XUIConfigurationPersistence.idl
index 696362d0882c..aae269b58c26 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationPersistence.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationPersistence.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module ui {
interface configuration data to a storage and to retrieve information
about the current state.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfigurationPersistence : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIConfigurationStorage.idl b/offapi/com/sun/star/ui/XUIConfigurationStorage.idl
index 2f07b995c486..47aee612d0f5 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationStorage.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationStorage.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module ui {
/** supplies functions to change or get information about the storage
of a user interface configuration manager.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIConfigurationStorage : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIElementFactory.idl b/offapi/com/sun/star/ui/XUIElementFactory.idl
index 7a86842508ac..708ccadf22bf 100644
--- a/offapi/com/sun/star/ui/XUIElementFactory.idl
+++ b/offapi/com/sun/star/ui/XUIElementFactory.idl
@@ -67,7 +67,7 @@ module com { module sun { module star { module ui {
</ul>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIElementFactory : ::com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIElementFactoryRegistration.idl b/offapi/com/sun/star/ui/XUIElementFactoryRegistration.idl
index 1d945ad02609..5b453d3de8e0 100644
--- a/offapi/com/sun/star/ui/XUIElementFactoryRegistration.idl
+++ b/offapi/com/sun/star/ui/XUIElementFactoryRegistration.idl
@@ -76,7 +76,7 @@ module com { module sun { module star { module ui {
</ul>
</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIElementFactoryRegistration : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIElementSettings.idl b/offapi/com/sun/star/ui/XUIElementSettings.idl
index 082598935500..ab5604b6a937 100644
--- a/offapi/com/sun/star/ui/XUIElementSettings.idl
+++ b/offapi/com/sun/star/ui/XUIElementSettings.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module ui {
/** provides functions to retrieve and change user interface element structure
data and to update its visible representation.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIElementSettings : com::sun::star::uno::XInterface
diff --git a/offapi/com/sun/star/ui/XUIFunctionListener.idl b/offapi/com/sun/star/ui/XUIFunctionListener.idl
index 9325e59af751..e62670bec558 100644
--- a/offapi/com/sun/star/ui/XUIFunctionListener.idl
+++ b/offapi/com/sun/star/ui/XUIFunctionListener.idl
@@ -39,7 +39,7 @@
/** special interface to receive notification that a user interface
element will execute a function.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XUIFunctionListener : com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/util/Endianness.idl b/offapi/com/sun/star/util/Endianness.idl
index c48698a0cbc7..86a1fb7a82bd 100644
--- a/offapi/com/sun/star/util/Endianness.idl
+++ b/offapi/com/sun/star/util/Endianness.idl
@@ -34,7 +34,7 @@ module com { module sun { module star { module util {
The endianness specifies the order in which the bytes of larger
types are laid out in memory.<p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
constants Endianness
{
diff --git a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
index 2a79d6affd48..027f7ec6c656 100644
--- a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
+++ b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module util {
possibility to share one office user data directory among parallel office
installtions.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service OfficeInstallationDirectories
{
diff --git a/offapi/com/sun/star/util/PathSubstitution.idl b/offapi/com/sun/star/util/PathSubstitution.idl
index 455465ddf06a..dd55f74dccb4 100644
--- a/offapi/com/sun/star/util/PathSubstitution.idl
+++ b/offapi/com/sun/star/util/PathSubstitution.idl
@@ -48,57 +48,65 @@ module com { module sun { module star { module util {
/** A service to support the substitution and resubstitution of path variables.
- <p>
- A path variable must be specified with the following synatx: "$("&lt;variable-name&gt;")".
- Path variables are not case sensitive and are always provided as a UCB-complient URL's
- (for example: "file:///c:/temp" or "file:///usr/install"). This is mandatory to support an
- optional remote file system.<br>
- A user defined list of path variables is supported. This list is stored in the Office
- configuration file (org/openoffice/Office/Substitution.xml). Please have a look at the
- schema definition file which configuration structure this file uses.<br>
- There is also a set of variables that have pre-defined values:
- </p>
- <dl>
- <dt>$(inst)</dt>
- <dd>Installation path of the Office Basis layer.</dd>
- <dt>$(prog)</dt>
- <dd>Program path of the Office Basis layer.</dd>
+ <p>
+ A path variable must be specified with the following synatx: "$("&lt;variable-name&gt;")".
+ Path variables are not case sensitive and are always provided as a UCB-complient URL's
+ (for example: "file:///c:/temp" or "file:///usr/install"). This is mandatory to support an
+ optional remote file system.<br>
+ A user defined list of path variables is supported. This list is stored in the Office
+ configuration file (org/openoffice/Office/Substitution.xml). Please have a look at the
+ schema definition file which configuration structure this file uses.<br>
+ There is also a set of variables that have pre-defined values:
+ </p>
+ <dl>
+ <dt>$(inst)</dt>
+ <dd>Installation path of the Office Basis layer.</dd>
+ <dt>$(prog)</dt>
+ <dd>Program path of the Office Basis layer.</dd>
<dt>$(brandbaseurl)</dt>
<dd>Installation path of the the Office Brand layer.</dd>
- <dt>$(user)</dt>
- <dd>The user installation directory.</dd>
- <dt>$(work)</dt>
- <dd>The work directory of the user. Under Windows this would be the
- "MyDocuments" subdirectory. Under Unix this would be the home-directory</dd>
+ <dt>$(user)</dt>
+ <dd>The user installation directory.</dd>
+ <dt>$(work)</dt>
+ <dd>The work directory of the user. Under Windows this would be the
+ "MyDocuments" subdirectory. Under Unix this would be the home-directory</dd>
<dt>$(home)</dt>
- <dd>The home directory of the user. Under Unix this would be the home-
- directory. Under Windows this would be the "Documents and Settings\<username>"
- subdirectory.</dd>
+ <dd>The home directory of the user. Under Unix this would be the home-
+ directory. Under Windows this would be the "Documents and Settings\<username>"
+ subdirectory.</dd>
<dt>$(temp)</dt>
- <dd>The current temporary directory.</dd>
+ <dd>The current temporary directory.</dd>
<dt>$(path)</dt>
- <dd>The value of PATH environment variable.</dd>
+ <dd>The value of PATH environment variable.</dd>
<dt>$(lang)</dt>
- <dd>The country code used by the Office, like 01=english, 49=german.</dd>
- <dt>$(langid)</dt>
- <dd>The language code used by the Office, like 0x0009=english, 0x0409=english us.</dd>
+ <dd>The country code used by the Office, like 01=english, 49=german.</dd>
+ <dt>$(langid)</dt>
+ <dd>The language code used by the Office, like 0x0009=english, 0x0409=english us.</dd>
<dt>$(vlang)</dt>
- <dd>The language used by the Office as a string. Like "german" for a german Office.</dd>
- </dl>
+ <dd>The language used by the Office as a string. Like "german" for a german Office.</dd>
+ </dl>
+ <p>
+ Attention: Most predefined variables describe an absolute path.
+ The only exceptions are: $(lang), $(langid) and $(vlang).
+ Therefore the service implementation should only substitute variables which
+ are located at the start of a provided path string or are part of a multi-path.
+ This special service is not designed to be a text substiution but shall
+ provide (a) valid substituted path(s).
+ </p>
@since OOo 1.1.2
*/
published service PathSubstitution
{
- //-------------------------------------------------------------------------
- /** Interface to exchange path variables with defined paths and to resubstitute paths with path variables.
+ //-------------------------------------------------------------------------
+ /** Interface to exchange path variables with defined paths and to resubstitute paths with path variables.
- <p>
- To resubstitute path variables the caller must provide pathes as UCB-compliant URL's.
- </p>
- */
- interface com::sun::star::util::XStringSubstitution;
+ <p>
+ To resubstitute path variables the caller must provide pathes as UCB-compliant URL's.
+ </p>
+ */
+ interface com::sun::star::util::XStringSubstitution;
};
//=============================================================================
diff --git a/offapi/com/sun/star/util/XBroadcaster.idl b/offapi/com/sun/star/util/XBroadcaster.idl
index a622fcef7b98..eb9a0d4cc320 100644
--- a/offapi/com/sun/star/util/XBroadcaster.idl
+++ b/offapi/com/sun/star/util/XBroadcaster.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module util {
/** allows to control notification behaviour of a broadcaster.
- @since 3.0
+ @since OOo 3.0
*/
interface XBroadcaster: com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl b/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl
index d79d0cffc79f..b8cabbb25e34 100644
--- a/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl
+++ b/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl
@@ -45,7 +45,7 @@ module com { module sun { module star { module util {
later. In many cases, storing the reference directly would destroy the
relocatability of an office installation.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/xml/dom/XNode.idl b/offapi/com/sun/star/xml/dom/XNode.idl
index a86220300412..7f7ffc14aa0e 100644
--- a/offapi/com/sun/star/xml/dom/XNode.idl
+++ b/offapi/com/sun/star/xml/dom/XNode.idl
@@ -79,7 +79,7 @@ information.</p>
</table></p>
@see <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113">Document Object Model (DOM) Level 2 Core Specification</a> </p>
-@since OOo 2.0.0
+@since OOo 2.0
*/
interface XNode : com::sun::star::uno::XInterface
{
diff --git a/offapi/drafts/com/sun/star/form/ListEntryEvent.idl b/offapi/drafts/com/sun/star/form/ListEntryEvent.idl
deleted file mode 100644
index 9f7b8443f7da..000000000000
--- a/offapi/drafts/com/sun/star/form/ListEntryEvent.idl
+++ /dev/null
@@ -1,77 +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 __drafts_com_sun_star_form_ListEntryEvent_idl__
-#define __drafts_com_sun_star_form_ListEntryEvent_idl__
-
-#ifndef __com_sun_star_lang_EventObject_idl__
-#include <com/sun/star/lang/EventObject.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-//=============================================================================
-
-/** specifies the event which is notified when a change in a string entry
- list occured
-
- @see XListEntrySource
- @see XListEntryListener
-
- @deprecated
- This structure is superseeded by <type scope="com::sun::star::form::binding">ListEntryEvent</type>
-*/
-struct ListEntryEvent : com::sun::star::lang::EventObject
-{
- /** denotes the position where a change occured.
-
- <p>The concrete semantics of the value depends on the concrete
- event being notified.</p>
- */
- long Position;
-
- /** denotes the number of changed entries, in case a change of
- an entry <em>range</em> is being notified.
- */
- long Count;
-
- /** denotes the changed entries
-
- <p>The concrete semantics of the value depends on the concrete
- event being notified.</p>
- */
- sequence< string >
- Entries;
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/drafts/com/sun/star/form/XBindableValue.idl b/offapi/drafts/com/sun/star/form/XBindableValue.idl
deleted file mode 100644
index fafb1edda83d..000000000000
--- a/offapi/drafts/com/sun/star/form/XBindableValue.idl
+++ /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 __drafts_com_sun_star_form_XBindableValue_idl__
-#define __drafts_com_sun_star_form_XBindableValue_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-#ifndef __drafts_com_sun_star_form_IncompatibleTypesException_idl__
-#include <drafts/com/sun/star/form/IncompatibleTypesException.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-interface XValueBinding;
-
-//=============================================================================
-
-/** specifies support for being bound to an external value
-
- @see XValueBinding
-
- @deprecated
- This interface is superseeded by <type scope="com::sun::star::form::binding">XBindableValue</type>
-*/
-interface XBindableValue : com::sun::star::uno::XInterface
-{
- /** sets an external instance which controls the value of the component
-
- <p>Any previously active binding will be revoked. There can be only one!</p>
-
- @param XValueBinding
- the new binding which is to be used by the component. May be <NULL/>,
- in this case only the current binding is revoked.
-
- @throws <type>IncompatibleTypesException</type>
- if the new binding (provided it's not <NULL/>) supports only types
- which are incompatible with the types of the bindable component.
- */
- void setValueBinding( [in] XValueBinding aBinding )
- raises ( IncompatibleTypesException );
-
- /** retrieves the external instance which currently controls the value of the
- component
- */
- XValueBinding
- getValueBinding( );
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/drafts/com/sun/star/form/XListEntryListener.idl b/offapi/drafts/com/sun/star/form/XListEntryListener.idl
deleted file mode 100644
index e9e49d799d26..000000000000
--- a/offapi/drafts/com/sun/star/form/XListEntryListener.idl
+++ /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 __drafts_com_sun_star_form_XListEntryListener_idl__
-#define __drafts_com_sun_star_form_XListEntryListener_idl__
-
-#ifndef __com_sun_star_lang_XEventListener_idl__
-#include <com/sun/star/lang/XEventListener.idl>
-#endif
-#ifndef __drafts_com_sun_star_form_ListEntryEvent_idl__
-#include <drafts/com/sun/star/form/ListEntryEvent.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-//=============================================================================
-
-/** specifies a listener for changes in a string entry list
-
- @deprecated
- This interface is superseeded by <type scope="com::sun::star::form::binding">XListEntryListener</type>
-*/
-interface XListEntryListener : com::sun::star::lang::XEventListener
-{
- /** notifies the listener that a single entry in the list has change
-
- @param Source
- is the event describing the change. The <member>ListEntryEvent::Position</member>
- member denotes the position of the changed entry, the first (and only) element
- of the <member>ListEntryEvent::Entries</member> member denotes the new string
- */
- void entryChanged( [in] ListEntryEvent Source );
-
- /** notifies the listener that a range of entries has been inserted into the list
-
- @param Source
- is the event describing the change. The <member>ListEntryEvent::Position</member>
- member denotes the position of the first inserted entry, the
- <member>ListEntryEvent::Entries</member> member contains the strings which have
- been inserted.
- */
- void entryRangeInserted( [in] ListEntryEvent Source );
-
- /** notifies the listener that a range of entries has been removed from the list
-
- @param Source
- is the event describing the change. The <member>ListEntryEvent::Position</member>
- member denotes the position of the first removed entry, the
- <member>ListEntryEvent::Count</member> member the number of removed entries.
- */
- void entryRangeRemoved( [in] ListEntryEvent Source );
-
- /** notifies the listener that all entries of the list have changed.
-
- <p>The listener should retrieve the complete new list by calling the
- <member>XListEntrySource::getAllListEntries</member> method of the event source
- (which is denoted by <member scope="com::sun::star::lang">EventObject::Source</member>).
- */
- void allEntriesChanged( [in] com::sun::star::lang::EventObject Source );
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/drafts/com/sun/star/form/XListEntrySink.idl b/offapi/drafts/com/sun/star/form/XListEntrySink.idl
deleted file mode 100644
index 3cd163189c1d..000000000000
--- a/offapi/drafts/com/sun/star/form/XListEntrySink.idl
+++ /dev/null
@@ -1,71 +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 __drafts_com_sun_star_form_XListEntrySink_idl__
-#define __drafts_com_sun_star_form_XListEntrySink_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-interface XListEntrySource;
-
-//=============================================================================
-
-/** specifies support for indirect manipulation of of a string list
-
- @deprecated
- This interface is superseeded by <type scope="com::sun::star::form::binding">XListEntrySink</type>
-*/
-interface XListEntrySink : com::sun::star::uno::XInterface
-{
- /** sets the new source for the list entries of the component
-
- <p>The list represented by this component will be cleared, and initially
- filled with the entries from the new list source.</p>
-
- @param Source
- the new source for the list entries. May be <NULL/>, in this
- case, the current source is revoked.
- */
- void setListEntrySource( [in] XListEntrySource Source );
-
- /** retrieves the current source for the list entries of the component.
- */
- XListEntrySource
- getListEntrySource( );
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/drafts/com/sun/star/form/XListEntrySource.idl b/offapi/drafts/com/sun/star/form/XListEntrySource.idl
deleted file mode 100644
index 095b8a703d5a..000000000000
--- a/offapi/drafts/com/sun/star/form/XListEntrySource.idl
+++ /dev/null
@@ -1,103 +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 __drafts_com_sun_star_form_XListEntrySource_idl__
-#define __drafts_com_sun_star_form_XListEntrySource_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-#ifndef __com_sun_star_lang_NullPointerException_idl__
-#include <com/sun/star/lang/NullPointerException.idl>
-#endif
-#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
-#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-interface XListEntryListener;
-
-//=============================================================================
-
-/** specifies a source of string list entries
-
- <p>The interface supports foreign components which actively retrieve list entries,
- as well as components which want to passively being notified of changes in the list.</p>
-
- @see XListEntrySink
-
- @deprecated
- This interface is superseeded by <type scope="com::sun::star::form::binding">XListEntrySource</type>
-*/
-interface XListEntrySource : com::sun::star::uno::XInterface
-{
- /** retrieves the number of entries in the list
- */
- long getListEntryCount( );
-
- /** provides access to a single list entry
-
- @throws <type scope="com::sun::star::lang">IndexOutOfBoundsException</type>
- if the given position does not denote a valid index in the list
-
- @see getListEntryCount
- */
- string getListEntry( [in] long Position )
- raises( com::sun::star::lang::IndexOutOfBoundsException );
-
- /** provides access to the entirety of all list entries
- */
- sequence< string >
- getAllListEntries( );
-
- /** adds a listener which will be notified about changes in the list
- reflected by the component.
-
- @throws <type scope="com::sun::star::lang">NullPointerException</type>
- if the given listener is <NULL/>
- */
- void addListEntryListener( [in] XListEntryListener Listener )
- raises( com::sun::star::lang::NullPointerException );
-
- /** revokes the given listener from the list of components which will
- be notfiied about changes in the entry list.
-
- @throws <type scope="com::sun::star::lang">NullPointerException</type>
- if the given listener is <NULL/>
- */
- void removeListEntryListener( [in] XListEntryListener Listener )
- raises( com::sun::star::lang::NullPointerException );
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/drafts/com/sun/star/form/XValueBinding.idl b/offapi/drafts/com/sun/star/form/XValueBinding.idl
deleted file mode 100644
index a62c164ebfce..000000000000
--- a/offapi/drafts/com/sun/star/form/XValueBinding.idl
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __drafts_com_sun_star_form_XValueBinding_idl__
-#define __drafts_com_sun_star_form_XValueBinding_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-#ifndef __com_sun_star_lang_NoSupportException_idl__
-#include <com/sun/star/lang/NoSupportException.idl>
-#endif
-#ifndef __drafts_com_sun_star_form_IncompatibleTypesException_idl__
-#include <drafts/com/sun/star/form/IncompatibleTypesException.idl>
-#endif
-
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-//=============================================================================
-
-/** specifies a binding to a value which can be read and written.
-
- @deprecated
- This interface is superseeded by <type scope="com::sun::star::form::binding">XValueBinding</type>
-*/
-interface XValueBinding : com::sun::star::uno::XInterface
-{
- //-------------------------------------------------------------------------
- /** determines the types which are supported by this binding for value exchange
-
- @see supportsType
- */
- sequence< type >
- getSupportedValueTypes( );
-
- /** determines whether a given type is supported by this binding for value exchange
-
- <p>Calling this method is equal to calling <member>getSupportedValueTypes</member>,
- and looking up the given type in the resulting type sequence.</p>
-
- @see getSupportedValueTypes
- */
- boolean supportsType( [in] type aType );
-
- /** retrieves the current value
-
- @throws <type>IncompatibleTypesException</type>
- if the requested value type is not supported by the binding
- @see getSupportedValueTypes
- @see supportsType
- */
- any getValue( [in] type aType )
- raises( IncompatibleTypesException );
-
- /** sets the current value
-
- @throws <type>IncompatibleTypesException</type>
- if the given value type is not supported by the binding
- @throws <type scope="com::sun::star::lang">NoSupportException</type>
- if the value currently cannot be changed (e.g. because it's readonly),
- or if the binding in general does not support write access to it's binding
-
- @see getSupportedValueTypes
- @see supportsType
- @see ValueBinding
- */
- void setValue( [in] any aValue )
- raises( IncompatibleTypesException, com::sun::star::lang::NoSupportException );
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/prj/build.lst b/offapi/prj/build.lst
index a4ed8a8ceaf8..c3a5f06d43bb 100644
--- a/offapi/prj/build.lst
+++ b/offapi/prj/build.lst
@@ -106,5 +106,4 @@ oa offapi\com\sun\star\geometry nmake - all oa_geometry NULL
oa offapi\com\sun\star\rendering nmake - all oa_rendering oa_geometry NULL
oa offapi\com\sun\star\rdf nmake - all oa_rdf oa_datatransfer oa_text NULL
oa offapi\com\sun\star\office nmake - all oa_office oa_text NULL
-oa offapi\drafts\com\sun\star\form nmake - all oa_drafts_form NULL
-oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_awttab oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme oa_script_vba NULL
+oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_awttab oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme oa_script_vba NULL
diff --git a/offapi/prj/d.lst b/offapi/prj/d.lst
index a271a7159130..ab0e4eb7a293 100644
--- a/offapi/prj/d.lst
+++ b/offapi/prj/d.lst
@@ -110,12 +110,6 @@ mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\xml\sax
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\xml\wrapper
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\xml\xpath
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\xsd
-mkdir: %COMMON_DEST%\idl%_EXT%\drafts
-mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com
-mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun
-mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star
-mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star\form
-
..\%__SRC%\ucr\offapi.db %_DEST%\bin%_EXT%\offapi.rdb
..\%__SRC%\ucrdoc\offapi_doc.db %_DEST%\bin%_EXT%\offapi_doc.rdb
@@ -228,5 +222,3 @@ mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star\form
..\com\sun\star\xml\wrapper\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\xml\wrapper
..\com\sun\star\xml\xpath\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\xml\xpath
..\com\sun\star\xsd\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\xsd
-
-..\drafts\com\sun\star\form\*.idl %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star\form
diff --git a/offapi/type_reference/typelibrary_history.txt b/offapi/type_reference/typelibrary_history.txt
index 16745ab9f7eb..a678ca7d6a7d 100644
--- a/offapi/type_reference/typelibrary_history.txt
+++ b/offapi/type_reference/typelibrary_history.txt
@@ -158,7 +158,10 @@
Update reference type library with the version of OOo 3.2.1. The new
reference type library is taken from the release source tree OOO320 m19.
+11/09/10 (JSC): TaskID=i114887
+ remove drafts module from reference rdb. The odl drafts type are not used
+ and i cleaned up the module and the type library.
+
01/28/11 (JSC): TaskID=116682
Update css.awt.UnoControlDialog to reflect the supported XDialog2 interface
additionally to XDialog
-
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 02cd79c9eb4f..1f9d5aea0fb8 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk
index dd91e2d99456..f0837e21ca8b 100644
--- a/offapi/util/makefile.mk
+++ b/offapi/util/makefile.mk
@@ -133,7 +133,6 @@ UNOIDLDBFILES= \
$(UCR)$/cssgallery.db \
$(UCR)$/cssxsd.db \
$(UCR)$/cssinspection.db \
- $(UCR)$/dcssform.db \
$(UCR)$/xsec-security.db \
$(UCR)$/xsec-crypto.db \
$(UCR)$/xsec-csax.db \
diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
index 00030d71bf9b..a51ff5b244c8 100755
--- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
@@ -14,6 +14,8 @@
<value>
<!-- Matrox G550 - blank display on 2nd head -->
4139 9511 260313131 1 5 13 1 1320
+ <!-- Matrox G550 - blank display (single head?) -->
+ 4139 9511 255987755 1 6 12 1 1930
<!-- Matrox G400 - random crashes -->
4139 1317 54005803 4 5 12 1 1200
<!-- Mobility Radeon M6 16MB - blank screen 1st slide on internal LCD -->
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 037c27f1fdd7..635aca16ba92 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -39,7 +39,12 @@ namespace beans
{
struct PropertyValue;
}
+namespace packages
+{
+ class ContentInfo;
+}
} } }
+
class ZipFile;
class ZipPackage;
class ZipOutputStream;
@@ -85,6 +90,8 @@ public:
void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
+ bool saveChild(const rtl::OUString &rShortName, const com::sun::star::packages::ContentInfo &rInfo, rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, com::sun::star::uno::Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool & rRandomPool);
+
// Recursive functions
void saveContents(rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, com::sun::star::uno::Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool & rRandomPool)
throw(::com::sun::star::uno::RuntimeException);
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index ba83b34910ed..5bb5b4db89b6 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -48,8 +48,8 @@
using namespace com::sun::star::packages::zip::ZipConstants;
using namespace com::sun::star::packages::zip;
-using namespace com::sun::star::container;
using namespace com::sun::star::packages;
+using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
@@ -305,12 +305,10 @@ static void ImplSetStoredData( ZipEntry & rEntry, Reference < XInputStream> & rS
rEntry.nCrc = aCRC32.getValue();
}
-void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool)
- throw(RuntimeException)
+bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo &rInfo, OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool)
{
- sal_Bool bWritingFailed = sal_False;
- ZipPackageFolder *pFolder = NULL;
- ZipPackageStream *pStream = NULL;
+ bool bSuccess = true;
+
const OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) );
const OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) );
const OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) );
@@ -320,386 +318,407 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
const OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) );
const OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) );
- sal_Bool bHaveEncryptionKey = rEncryptionKey.getLength() ? sal_True : sal_False;
+ Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);
- if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != embed::StorageFormats::OFOPXML )
+ OSL_ENSURE( ( rInfo.bFolder && rInfo.pFolder ) || ( !rInfo.bFolder && rInfo.pStream ), "A valid child object is expected!" );
+ if ( rInfo.bFolder )
{
- // it is an empty subfolder, use workaround to store it
- ZipEntry* pTempEntry = new ZipEntry();
- ZipPackageFolder::copyZipEntry ( *pTempEntry, aEntry );
- pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( rPath, RTL_TEXTENCODING_UTF8 ).getLength() );
- pTempEntry->nExtraLen = -1;
- pTempEntry->sPath = rPath;
+ OUString sTempName = rPath + rShortName + OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
- try
+ if ( rInfo.pFolder->GetMediaType().getLength() )
{
- vos::ORef < EncryptionData > aEmptyEncr;
- rZipOut.putNextEntry ( *pTempEntry, aEmptyEncr, sal_False );
- rZipOut.rawCloseEntry();
- }
- catch ( ZipException& )
- {
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
- }
- catch ( IOException& )
- {
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
+ aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
+ aPropSet[PKG_MNFST_MEDIATYPE].Value <<= rInfo.pFolder->GetMediaType();
+ aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
+ aPropSet[PKG_MNFST_VERSION].Value <<= rInfo.pFolder->GetVersion();
+ aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
+ aPropSet[PKG_MNFST_FULLPATH].Value <<= sTempName;
}
- }
+ else
+ aPropSet.realloc( 0 );
- for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end();
- aCI != aEnd;
- aCI++)
+ rInfo.pFolder->saveContents( sTempName, rManList, rZipOut, rEncryptionKey, rRandomPool);
+ }
+ else
{
- const OUString &rShortName = (*aCI).first;
- const ContentInfo &rInfo = *(*aCI).second;
-
- Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);
+ // if pTempEntry is necessary, it will be released and passed to the ZipOutputStream
+ // and be deleted in the ZipOutputStream destructor
+ auto_ptr < ZipEntry > pAutoTempEntry ( new ZipEntry );
+ ZipEntry* pTempEntry = pAutoTempEntry.get();
- if ( rInfo.bFolder )
- pFolder = rInfo.pFolder;
- else
- pStream = rInfo.pStream;
+ // In case the entry we are reading is also the entry we are writing, we will
+ // store the ZipEntry data in pTempEntry
- if ( rInfo.bFolder )
- {
- OUString sTempName = rPath + rShortName + OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
+ ZipPackageFolder::copyZipEntry ( *pTempEntry, rInfo.pStream->aEntry );
+ pTempEntry->sPath = rPath + rShortName;
+ pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( pTempEntry->sPath, RTL_TEXTENCODING_UTF8 ).getLength() );
- if ( pFolder->GetMediaType().getLength() )
- {
- aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
- aPropSet[PKG_MNFST_MEDIATYPE].Value <<= pFolder->GetMediaType();
- aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
- aPropSet[PKG_MNFST_VERSION].Value <<= pFolder->GetVersion();
- aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
- aPropSet[PKG_MNFST_FULLPATH].Value <<= sTempName;
- }
- else
- aPropSet.realloc( 0 );
+ sal_Bool bToBeEncrypted = rInfo.pStream->IsToBeEncrypted() && (rEncryptionKey.getLength() || rInfo.pStream->HasOwnKey());
+ sal_Bool bToBeCompressed = bToBeEncrypted ? sal_True : rInfo.pStream->IsToBeCompressed();
- pFolder->saveContents( sTempName, rManList, rZipOut, rEncryptionKey, rRandomPool);
- }
- else
- {
- // if pTempEntry is necessary, it will be released and passed to the ZipOutputStream
- // and be deleted in the ZipOutputStream destructor
- auto_ptr < ZipEntry > pAutoTempEntry ( new ZipEntry );
- ZipEntry* pTempEntry = pAutoTempEntry.get();
+ aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
+ aPropSet[PKG_MNFST_MEDIATYPE].Value <<= rInfo.pStream->GetMediaType( );
+ aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
+ aPropSet[PKG_MNFST_VERSION].Value <<= ::rtl::OUString(); // no version is stored for streams currently
+ aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
+ aPropSet[PKG_MNFST_FULLPATH].Value <<= pTempEntry->sPath;
- // In case the entry we are reading is also the entry we are writing, we will
- // store the ZipEntry data in pTempEntry
- ZipPackageFolder::copyZipEntry ( *pTempEntry, pStream->aEntry );
- pTempEntry->sPath = rPath + rShortName;
- pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( pTempEntry->sPath, RTL_TEXTENCODING_UTF8 ).getLength() );
+ OSL_ENSURE( rInfo.pStream->GetStreamMode() != PACKAGE_STREAM_NOTSET, "Unacceptable ZipPackageStream mode!" );
- sal_Bool bToBeEncrypted = pStream->IsToBeEncrypted() && (bHaveEncryptionKey || pStream->HasOwnKey());
- sal_Bool bToBeCompressed = bToBeEncrypted ? sal_True : pStream->IsToBeCompressed();
+ sal_Bool bRawStream = sal_False;
+ if ( rInfo.pStream->GetStreamMode() == PACKAGE_STREAM_DETECT )
+ bRawStream = rInfo.pStream->ParsePackageRawStream();
+ else if ( rInfo.pStream->GetStreamMode() == PACKAGE_STREAM_RAW )
+ bRawStream = sal_True;
- aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
- aPropSet[PKG_MNFST_MEDIATYPE].Value <<= pStream->GetMediaType( );
- aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
- aPropSet[PKG_MNFST_VERSION].Value <<= ::rtl::OUString(); // no version is stored for streams currently
- aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
- aPropSet[PKG_MNFST_FULLPATH].Value <<= pTempEntry->sPath;
+ sal_Bool bTransportOwnEncrStreamAsRaw = sal_False;
+ // During the storing the original size of the stream can be changed
+ // TODO/LATER: get rid of this hack
+ sal_Int32 nOwnStreamOrigSize = bRawStream ? rInfo.pStream->GetMagicalHackSize() : rInfo.pStream->getSize();
+ sal_Bool bUseNonSeekableAccess = sal_False;
+ Reference < XInputStream > xStream;
+ if ( !rInfo.pStream->IsPackageMember() && !bRawStream && !bToBeEncrypted && bToBeCompressed )
+ {
+ // the stream is not a package member, not a raw stream,
+ // it should not be encrypted and it should be compressed,
+ // in this case nonseekable access can be used
- OSL_ENSURE( pStream->GetStreamMode() != PACKAGE_STREAM_NOTSET, "Unacceptable ZipPackageStream mode!" );
+ xStream = rInfo.pStream->GetOwnStreamNoWrap();
+ Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
- sal_Bool bRawStream = sal_False;
- if ( pStream->GetStreamMode() == PACKAGE_STREAM_DETECT )
- bRawStream = pStream->ParsePackageRawStream();
- else if ( pStream->GetStreamMode() == PACKAGE_STREAM_RAW )
- bRawStream = sal_True;
+ bUseNonSeekableAccess = ( xStream.is() && !xSeek.is() );
+ }
- sal_Bool bTransportOwnEncrStreamAsRaw = sal_False;
- // During the storing the original size of the stream can be changed
- // TODO/LATER: get rid of this hack
- sal_Int32 nOwnStreamOrigSize = bRawStream ? pStream->GetMagicalHackSize() : pStream->getSize();
+ if ( !bUseNonSeekableAccess )
+ {
+ xStream = rInfo.pStream->getRawData();
- sal_Bool bUseNonSeekableAccess = sal_False;
- Reference < XInputStream > xStream;
- if ( !pStream->IsPackageMember() && !bRawStream && !bToBeEncrypted && bToBeCompressed )
+ if ( !xStream.is() )
{
- // the stream is not a package member, not a raw stream,
- // it should not be encrypted and it should be compressed,
- // in this case nonseekable access can be used
-
- xStream = pStream->GetOwnStreamNoWrap();
- Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
-
- bUseNonSeekableAccess = ( xStream.is() && !xSeek.is() );
+ VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
+ bSuccess = false;
+ return bSuccess;
}
- if ( !bUseNonSeekableAccess )
+ Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
+ try
{
- xStream = pStream->getRawData();
-
- if ( !xStream.is() )
+ if ( xSeek.is() )
{
- VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
- bWritingFailed = sal_True;
- continue;
- }
+ // If the stream is a raw one, then we should be positioned
+ // at the beginning of the actual data
+ if ( !bToBeCompressed || bRawStream )
+ {
+ // The raw stream can neither be encrypted nor connected
+ OSL_ENSURE( !bRawStream || !bToBeCompressed && !bToBeEncrypted, "The stream is already encrypted!\n" );
+ xSeek->seek ( bRawStream ? rInfo.pStream->GetMagicalHackPos() : 0 );
+ ImplSetStoredData ( *pTempEntry, xStream );
- Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
- try
- {
- if ( xSeek.is() )
+ // TODO/LATER: Get rid of hacks related to switching of Flag Method and Size properties!
+ }
+ else if ( bToBeEncrypted )
{
- // If the stream is a raw one, then we should be positioned
- // at the beginning of the actual data
- if ( !bToBeCompressed || bRawStream )
- {
- // The raw stream can neither be encrypted nor connected
- OSL_ENSURE( !bRawStream || !bToBeCompressed && !bToBeEncrypted, "The stream is already encrypted!\n" );
- xSeek->seek ( bRawStream ? pStream->GetMagicalHackPos() : 0 );
- ImplSetStoredData ( *pTempEntry, xStream );
+ // this is the correct original size
+ pTempEntry->nSize = static_cast < sal_Int32 > ( xSeek->getLength() );
+ nOwnStreamOrigSize = pTempEntry->nSize;
+ }
- // TODO/LATER: Get rid of hacks related to switching of Flag Method and Size properties!
- }
- else if ( bToBeEncrypted )
+ xSeek->seek ( 0 );
+ }
+ else
+ {
+ // Okay, we don't have an xSeekable stream. This is possibly bad.
+ // check if it's one of our own streams, if it is then we know that
+ // each time we ask for it we'll get a new stream that will be
+ // at position zero...otherwise, assert and skip this stream...
+ if ( rInfo.pStream->IsPackageMember() )
+ {
+ // if the password has been changed than the stream should not be package member any more
+ if ( rInfo.pStream->IsEncrypted() && rInfo.pStream->IsToBeEncrypted() )
{
- // this is the correct original size
- pTempEntry->nSize = static_cast < sal_Int32 > ( xSeek->getLength() );
- nOwnStreamOrigSize = pTempEntry->nSize;
+ // Should be handled close to the raw stream handling
+ bTransportOwnEncrStreamAsRaw = sal_True;
+ pTempEntry->nMethod = STORED;
+
+ // TODO/LATER: get rid of this situation
+ // this size should be different from the one that will be stored in manifest.xml
+ // it is used in storing algorithms and after storing the correct size will be set
+ pTempEntry->nSize = pTempEntry->nCompressedSize;
}
-
- xSeek->seek ( 0 );
}
else
{
- // Okay, we don't have an xSeekable stream. This is possibly bad.
- // check if it's one of our own streams, if it is then we know that
- // each time we ask for it we'll get a new stream that will be
- // at position zero...otherwise, assert and skip this stream...
- if ( pStream->IsPackageMember() )
- {
- // if the password has been changed than the stream should not be package member any more
- if ( pStream->IsEncrypted() && pStream->IsToBeEncrypted() )
- {
- // Should be handled close to the raw stream handling
- bTransportOwnEncrStreamAsRaw = sal_True;
- pTempEntry->nMethod = STORED;
-
- // TODO/LATER: get rid of this situation
- // this size should be different from the one that will be stored in manifest.xml
- // it is used in storing algorithms and after storing the correct size will be set
- pTempEntry->nSize = pTempEntry->nCompressedSize;
- }
- }
- else
- {
- VOS_ENSURE( 0, "The package component requires that every stream either be FROM a package or it must support XSeekable!" );
- continue;
- }
+ VOS_ENSURE( 0, "The package component requires that every stream either be FROM a package or it must support XSeekable!" );
+ bSuccess = false;
+ return bSuccess;
}
}
- catch ( Exception& )
- {
- VOS_ENSURE( 0, "The stream provided to the package component has problems!" );
- bWritingFailed = sal_True;
- continue;
- }
+ }
+ catch ( Exception& )
+ {
+ VOS_ENSURE( 0, "The stream provided to the package component has problems!" );
+ bSuccess = false;
+ return bSuccess;
+ }
- if ( bToBeEncrypted || bRawStream || bTransportOwnEncrStreamAsRaw )
+ if ( bToBeEncrypted || bRawStream || bTransportOwnEncrStreamAsRaw )
+ {
+ if ( bToBeEncrypted && !bTransportOwnEncrStreamAsRaw )
{
- if ( bToBeEncrypted && !bTransportOwnEncrStreamAsRaw )
- {
- Sequence < sal_uInt8 > aSalt ( 16 ), aVector ( 8 );
- rtl_random_getBytes ( rRandomPool, aSalt.getArray(), 16 );
- rtl_random_getBytes ( rRandomPool, aVector.getArray(), 8 );
- sal_Int32 nIterationCount = 1024;
+ Sequence < sal_uInt8 > aSalt ( 16 ), aVector ( 8 );
+ rtl_random_getBytes ( rRandomPool, aSalt.getArray(), 16 );
+ rtl_random_getBytes ( rRandomPool, aVector.getArray(), 8 );
+ sal_Int32 nIterationCount = 1024;
- if ( !pStream->HasOwnKey() )
- pStream->setKey ( rEncryptionKey );
+ if ( !rInfo.pStream->HasOwnKey() )
+ rInfo.pStream->setKey ( rEncryptionKey );
- pStream->setInitialisationVector ( aVector );
- pStream->setSalt ( aSalt );
- pStream->setIterationCount ( nIterationCount );
- }
+ rInfo.pStream->setInitialisationVector ( aVector );
+ rInfo.pStream->setSalt ( aSalt );
+ rInfo.pStream->setIterationCount ( nIterationCount );
+ }
- // last property is digest, which is inserted later if we didn't have
- // a magic header
- aPropSet.realloc(PKG_SIZE_ENCR_MNFST);
+ // last property is digest, which is inserted later if we didn't have
+ // a magic header
+ aPropSet.realloc(PKG_SIZE_ENCR_MNFST);
- aPropSet[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty;
- aPropSet[PKG_MNFST_INIVECTOR].Value <<= pStream->getInitialisationVector();
- aPropSet[PKG_MNFST_SALT].Name = sSaltProperty;
- aPropSet[PKG_MNFST_SALT].Value <<= pStream->getSalt();
- aPropSet[PKG_MNFST_ITERATION].Name = sIterationCountProperty;
- aPropSet[PKG_MNFST_ITERATION].Value <<= pStream->getIterationCount ();
+ aPropSet[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty;
+ aPropSet[PKG_MNFST_INIVECTOR].Value <<= rInfo.pStream->getInitialisationVector();
+ aPropSet[PKG_MNFST_SALT].Name = sSaltProperty;
+ aPropSet[PKG_MNFST_SALT].Value <<= rInfo.pStream->getSalt();
+ aPropSet[PKG_MNFST_ITERATION].Name = sIterationCountProperty;
+ aPropSet[PKG_MNFST_ITERATION].Value <<= rInfo.pStream->getIterationCount ();
- // Need to store the uncompressed size in the manifest
- OSL_ENSURE( nOwnStreamOrigSize >= 0, "The stream size was not correctly initialized!\n" );
- aPropSet[PKG_MNFST_UCOMPSIZE].Name = sSizeProperty;
- aPropSet[PKG_MNFST_UCOMPSIZE].Value <<= nOwnStreamOrigSize;
+ // Need to store the uncompressed size in the manifest
+ OSL_ENSURE( nOwnStreamOrigSize >= 0, "The stream size was not correctly initialized!\n" );
+ aPropSet[PKG_MNFST_UCOMPSIZE].Name = sSizeProperty;
+ aPropSet[PKG_MNFST_UCOMPSIZE].Value <<= nOwnStreamOrigSize;
- if ( bRawStream || bTransportOwnEncrStreamAsRaw )
- {
- aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
- aPropSet[PKG_MNFST_DIGEST].Value <<= pStream->getDigest();
- }
+ if ( bRawStream || bTransportOwnEncrStreamAsRaw )
+ {
+ aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
+ aPropSet[PKG_MNFST_DIGEST].Value <<= rInfo.pStream->getDigest();
}
}
+ }
- // If the entry is already stored in the zip file in the format we
- // want for this write...copy it raw
- if ( !bUseNonSeekableAccess
- && ( bRawStream || bTransportOwnEncrStreamAsRaw
- || ( pStream->IsPackageMember() && !bToBeEncrypted
- && ( ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed )
- || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) )
+ // If the entry is already stored in the zip file in the format we
+ // want for this write...copy it raw
+ if ( !bUseNonSeekableAccess
+ && ( bRawStream || bTransportOwnEncrStreamAsRaw
+ || ( rInfo.pStream->IsPackageMember() && !bToBeEncrypted
+ && ( ( rInfo.pStream->aEntry.nMethod == DEFLATED && bToBeCompressed )
+ || ( rInfo.pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) )
+ {
+ // If it's a PackageMember, then it's an unbuffered stream and we need
+ // to get a new version of it as we can't seek backwards.
+ if ( rInfo.pStream->IsPackageMember() )
{
- // If it's a PackageMember, then it's an unbuffered stream and we need
- // to get a new version of it as we can't seek backwards.
- if ( pStream->IsPackageMember() )
+ xStream = rInfo.pStream->getRawData();
+ if ( !xStream.is() )
{
- xStream = pStream->getRawData();
- if ( !xStream.is() )
- {
- // Make sure that we actually _got_ a new one !
- VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
- continue;
- }
+ // Make sure that we actually _got_ a new one !
+ VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
+ bSuccess = false;
+ return bSuccess;
}
+ }
- try
- {
- if ( bRawStream )
- xStream->skipBytes( pStream->GetMagicalHackPos() );
-
- rZipOut.putNextEntry ( *pTempEntry, pStream->getEncryptionData(), sal_False );
- // the entry is provided to the ZipOutputStream that will delete it
- pAutoTempEntry.release();
+ try
+ {
+ if ( bRawStream )
+ xStream->skipBytes( rInfo.pStream->GetMagicalHackPos() );
- Sequence < sal_Int8 > aSeq ( n_ConstBufferSize );
- sal_Int32 nLength;
+ rZipOut.putNextEntry ( *pTempEntry, rInfo.pStream->getEncryptionData(), sal_False );
+ // the entry is provided to the ZipOutputStream that will delete it
+ pAutoTempEntry.release();
- do
- {
- nLength = xStream->readBytes( aSeq, n_ConstBufferSize );
- rZipOut.rawWrite(aSeq, 0, nLength);
- }
- while ( nLength == n_ConstBufferSize );
+ Sequence < sal_Int8 > aSeq ( n_ConstBufferSize );
+ sal_Int32 nLength;
- rZipOut.rawCloseEntry();
- }
- catch ( ZipException& )
- {
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
- }
- catch ( IOException& )
+ do
{
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
+ nLength = xStream->readBytes( aSeq, n_ConstBufferSize );
+ rZipOut.rawWrite(aSeq, 0, nLength);
}
+ while ( nLength == n_ConstBufferSize );
+
+ rZipOut.rawCloseEntry();
}
- else
+ catch ( ZipException& )
{
- // This stream is defenitly not a raw stream
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bSuccess = false;
+ }
+ catch ( IOException& )
+ {
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ // This stream is defenitly not a raw stream
- // If nonseekable access is used the stream should be at the beginning and
- // is useless after the storing. Thus if the storing fails the package should
- // be thrown away ( as actually it is done currently )!
- // To allow to reuse the package after the error, the optimization must be removed!
+ // If nonseekable access is used the stream should be at the beginning and
+ // is useless after the storing. Thus if the storing fails the package should
+ // be thrown away ( as actually it is done currently )!
+ // To allow to reuse the package after the error, the optimization must be removed!
- // If it's a PackageMember, then our previous reference held a 'raw' stream
- // so we need to re-get it, unencrypted, uncompressed and positioned at the
- // beginning of the stream
- if ( pStream->IsPackageMember() )
+ // If it's a PackageMember, then our previous reference held a 'raw' stream
+ // so we need to re-get it, unencrypted, uncompressed and positioned at the
+ // beginning of the stream
+ if ( rInfo.pStream->IsPackageMember() )
+ {
+ xStream = rInfo.pStream->getInputStream();
+ if ( !xStream.is() )
{
- xStream = pStream->getInputStream();
- if ( !xStream.is() )
- {
- // Make sure that we actually _got_ a new one !
- VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
- continue;
- }
+ // Make sure that we actually _got_ a new one !
+ VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
+ bSuccess = false;
+ return bSuccess;
}
+ }
+
+ if ( bToBeCompressed )
+ {
+ pTempEntry->nMethod = DEFLATED;
+ pTempEntry->nCrc = pTempEntry->nCompressedSize = pTempEntry->nSize = -1;
+ }
+
+ try
+ {
+ rZipOut.putNextEntry ( *pTempEntry, rInfo.pStream->getEncryptionData(), bToBeEncrypted);
+ // the entry is provided to the ZipOutputStream that will delete it
+ pAutoTempEntry.release();
- if ( bToBeCompressed )
+ sal_Int32 nLength;
+ Sequence < sal_Int8 > aSeq (n_ConstBufferSize);
+ do
{
- pTempEntry->nMethod = DEFLATED;
- pTempEntry->nCrc = pTempEntry->nCompressedSize = pTempEntry->nSize = -1;
+ nLength = xStream->readBytes(aSeq, n_ConstBufferSize);
+ rZipOut.write(aSeq, 0, nLength);
}
+ while ( nLength == n_ConstBufferSize );
- try
- {
- rZipOut.putNextEntry ( *pTempEntry, pStream->getEncryptionData(), bToBeEncrypted);
- // the entry is provided to the ZipOutputStream that will delete it
- pAutoTempEntry.release();
+ rZipOut.closeEntry();
+ }
+ catch ( ZipException& )
+ {
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bSuccess = false;
+ }
+ catch ( IOException& )
+ {
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bSuccess = false;
+ }
- sal_Int32 nLength;
- Sequence < sal_Int8 > aSeq (n_ConstBufferSize);
- do
- {
- nLength = xStream->readBytes(aSeq, n_ConstBufferSize);
- rZipOut.write(aSeq, 0, nLength);
- }
- while ( nLength == n_ConstBufferSize );
+ if ( bToBeEncrypted )
+ {
+ aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
+ aPropSet[PKG_MNFST_DIGEST].Value <<= rInfo.pStream->getDigest();
+ rInfo.pStream->SetIsEncrypted ( sal_True );
+ }
+ }
- rZipOut.closeEntry();
- }
- catch ( ZipException& )
- {
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
- }
- catch ( IOException& )
- {
- VOS_ENSURE( 0, "Error writing ZipOutputStream" );
- bWritingFailed = sal_True;
- }
+ if( bSuccess )
+ {
+ if ( !rInfo.pStream->IsPackageMember() )
+ {
+ rInfo.pStream->CloseOwnStreamIfAny();
+ rInfo.pStream->SetPackageMember ( sal_True );
+ }
- if ( bToBeEncrypted )
- {
- aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
- aPropSet[PKG_MNFST_DIGEST].Value <<= pStream->getDigest();
- pStream->SetIsEncrypted ( sal_True );
- }
+ if ( bRawStream )
+ {
+ // the raw stream was integrated and now behaves
+ // as usual encrypted stream
+ rInfo.pStream->SetToBeEncrypted( sal_True );
}
- if( !bWritingFailed )
+ // Remove hacky bit from entry flags
+ if ( pTempEntry->nFlag & ( 1 << 4 ) )
{
- if ( !pStream->IsPackageMember() )
- {
- pStream->CloseOwnStreamIfAny();
- pStream->SetPackageMember ( sal_True );
- }
+ pTempEntry->nFlag &= ~( 1 << 4 );
+ pTempEntry->nMethod = STORED;
+ }
- if ( bRawStream )
- {
- // the raw stream was integrated and now behaves
- // as usual encrypted stream
- pStream->SetToBeEncrypted( sal_True );
- }
+ // Then copy it back afterwards...
+ ZipPackageFolder::copyZipEntry ( rInfo.pStream->aEntry, *pTempEntry );
- // Remove hacky bit from entry flags
- if ( pTempEntry->nFlag & ( 1 << 4 ) )
- {
- pTempEntry->nFlag &= ~( 1 << 4 );
- pTempEntry->nMethod = STORED;
- }
+ // TODO/LATER: get rid of this hack ( the encrypted stream size property is changed during saving )
+ if ( rInfo.pStream->IsEncrypted() )
+ rInfo.pStream->setSize( nOwnStreamOrigSize );
- // Then copy it back afterwards...
- ZipPackageFolder::copyZipEntry ( pStream->aEntry, *pTempEntry );
+ rInfo.pStream->aEntry.nOffset *= -1;
+ }
+ }
- // TODO/LATER: get rid of this hack ( the encrypted stream size property is changed during saving )
- if ( pStream->IsEncrypted() )
- pStream->setSize( nOwnStreamOrigSize );
+ // folder can have a mediatype only in package format
+ if ( aPropSet.getLength()
+ && ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) ) )
+ rManList.push_back( aPropSet );
- pStream->aEntry.nOffset *= -1;
- }
+ return bSuccess;
+}
+
+void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool)
+ throw(RuntimeException)
+{
+ bool bWritingFailed = false;
+
+ if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != embed::StorageFormats::OFOPXML )
+ {
+ // it is an empty subfolder, use workaround to store it
+ ZipEntry* pTempEntry = new ZipEntry();
+ ZipPackageFolder::copyZipEntry ( *pTempEntry, aEntry );
+ pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( rPath, RTL_TEXTENCODING_UTF8 ).getLength() );
+ pTempEntry->nExtraLen = -1;
+ pTempEntry->sPath = rPath;
+
+ try
+ {
+ vos::ORef < EncryptionData > aEmptyEncr;
+ rZipOut.putNextEntry ( *pTempEntry, aEmptyEncr, sal_False );
+ rZipOut.rawCloseEntry();
+ }
+ catch ( ZipException& )
+ {
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bWritingFailed = true;
+ }
+ catch ( IOException& )
+ {
+ VOS_ENSURE( 0, "Error writing ZipOutputStream" );
+ bWritingFailed = true;
+ }
+ }
+
+ bool bMimeTypeStreamStored = false;
+ ::rtl::OUString aMimeTypeStreamName( RTL_CONSTASCII_USTRINGPARAM( "mimetype" ) );
+ if ( m_nFormat == embed::StorageFormats::ZIP && !rPath.getLength() )
+ {
+ // let the "mimtype" stream in root folder be stored as the first stream if it is zip format
+ ContentHash::iterator aIter = maContents.find ( aMimeTypeStreamName );
+ if ( aIter != maContents.end() && !(*aIter).second->bFolder )
+ {
+ bMimeTypeStreamStored = true;
+ bWritingFailed = !saveChild( (*aIter).first, *(*aIter).second, rPath, rManList, rZipOut, rEncryptionKey, rRandomPool );
}
+ }
+
+ for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end();
+ aCI != aEnd;
+ aCI++)
+ {
+ const OUString &rShortName = (*aCI).first;
+ const ContentInfo &rInfo = *(*aCI).second;
- // folder can have a mediatype only in package format
- if ( aPropSet.getLength()
- && ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) ) )
- rManList.push_back( aPropSet );
+ if ( !bMimeTypeStreamStored || !rShortName.equals( aMimeTypeStreamName ) )
+ bWritingFailed = !saveChild( rShortName, rInfo, rPath, rManList, rZipOut, rEncryptionKey, rRandomPool );
}
if( bWritingFailed )
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 49fa9e19d908..236d372eb1c0 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -75,6 +75,8 @@ my_components = \
component/sw/util/swd \
component/sw/util/vbaswobj \
component/toolkit/util/tk \
+ component/unoxml/source/rdf/unordf \
+ component/unoxml/source/service/unoxml \
component/xmloff/source/transform/xof \
component/xmloff/util/xo \
configmgr \
@@ -163,8 +165,6 @@ my_components = \
ucphier1 \
ucppkg1 \
ucptdoc1 \
- unordf \
- unoxml \
updatefeed \
updchk \
updchk.uno \
diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx
index 4353721ad0b0..903e059ac896 100644
--- a/registry/tools/checksingleton.cxx
+++ b/registry/tools/checksingleton.cxx
@@ -28,297 +28,150 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_registry.hxx"
-#include <stdio.h>
-#include <string.h>
-
#include "registry/registry.hxx"
#include "registry/reflread.hxx"
-#include <rtl/ustring.hxx>
-#include <rtl/alloc.h>
-#include <osl/process.h>
-#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
-
-#ifdef SAL_UNX
-#define SEPARATOR '/'
-#else
-#define SEPARATOR '\\'
-#endif
+#include "fileurl.hxx"
+#include "options.hxx"
-using namespace ::rtl;
-using namespace ::osl;
+#include "rtl/ustring.hxx"
+#include "osl/diagnose.h"
-sal_Bool isFileUrl(const OString& fileName)
-{
- if (fileName.indexOf("file://") == 0 )
- return sal_True;
- return sal_False;
-}
-
-OUString convertToFileUrl(const OString& fileName)
-{
- if ( isFileUrl(fileName) )
- {
- return OStringToOUString(fileName, osl_getThreadTextEncoding());
- }
+#include <stdio.h>
+#include <string.h>
- OUString uUrlFileName;
- OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
- if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
- {
- OUString uWorkingDir;
- if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
- {
- OSL_ASSERT(false);
- }
- if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- } else
- {
- if (FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- }
+#include <vector>
+#include <string>
- return uUrlFileName;
-}
+using namespace rtl;
+using namespace registry::tools;
#define U2S( s ) \
OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()
#define S2U( s ) \
OStringToOUString(s, RTL_TEXTENCODING_UTF8)
-struct LessString
-{
- sal_Bool operator()(const OUString& str1, const OUString& str2) const
- {
- return (str1 < str2);
- }
-};
-
-class Options
+class Options_Impl : public Options
{
public:
- Options()
- : m_bForceOutput(sal_False)
- {}
- ~Options()
+ explicit Options_Impl(char const * program)
+ : Options (program), m_bForceOutput(false)
{}
- sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False);
-
- OString prepareHelp();
- OString prepareVersion();
-
- const OString& getProgramName()
- { return m_program; }
- const OString& getIndexReg()
+ std::string const & getIndexReg() const
{ return m_indexRegName; }
- const OString& getTypeReg()
+ std::string const & getTypeReg() const
{ return m_typeRegName; }
- sal_Bool hasBase()
- { return m_base.getLength() > 0; }
- const OString& getBase()
+ bool hasBase() const
+ { return (m_base.getLength() > 0); }
+ const OString & getBase() const
{ return m_base; }
- sal_Bool forceOutput()
+ bool forceOutput() const
{ return m_bForceOutput; }
+
protected:
- OString m_program;
- OString m_indexRegName;
- OString m_typeRegName;
+ virtual void printUsage_Impl() const;
+ virtual bool initOptions_Impl (std::vector< std::string > & rArgs);
+
+ std::string m_indexRegName;
+ std::string m_typeRegName;
OString m_base;
- sal_Bool m_bForceOutput;
+ bool m_bForceOutput;
};
-sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
+// virtual
+void Options_Impl::printUsage_Impl() const
{
- sal_Bool bRet = sal_True;
- sal_uInt16 i=0;
+ std::string const & rProgName = getProgramName();
+ fprintf(stderr,
+ "Usage: %s -r<filename> -o<filename> [-options] | @<filename>\n", rProgName.c_str()
+ );
+ fprintf(stderr,
+ " -o<filename> = filename specifies the name of the new singleton index registry.\n"
+ " -r<filename> = filename specifies the name of the type registry.\n"
+ " @<filename> = filename specifies a command file.\n"
+ "Options:\n"
+ " -b<name> = name specifies the name of a start key. The types will be searched\n"
+ " under this key in the type registry.\n"
+ " -f = force the output of all found singletons.\n"
+ " -h|-? = print this help message and exit.\n"
+ );
+ fprintf(stderr,
+ "\n%s Version 1.0\n\n", rProgName.c_str()
+ );
+}
- if (!bCmdFile)
+// virtual
+bool Options_Impl::initOptions_Impl(std::vector< std::string > & rArgs)
+{
+ std::vector< std::string >::const_iterator first = rArgs.begin(), last = rArgs.end();
+ for (; first != last; ++first)
{
- bCmdFile = sal_True;
-
- m_program = av[0];
-
- if (ac < 2)
+ std::string option (*first);
+ if ((*first)[0] != '-')
{
- fprintf(stderr, "%s", prepareHelp().getStr());
- bRet = sal_False;
+ return badOption("invalid", option.c_str());
}
-
- i = 1;
- } else
- {
- i = 0;
- }
-
- char *s=NULL;
- for (; i < ac; i++)
- {
- if (av[i][0] == '-')
+ switch ((*first)[1])
{
- switch (av[i][1])
+ case 'r':
+ case 'R':
+ {
+ if (!((++first != last) && ((*first)[0] != '-')))
+ {
+ return badOption("invalid", option.c_str());
+ }
+ m_typeRegName = OString((*first).c_str(), (*first).size());
+ break;
+ }
+ case 'o':
+ case 'O':
{
- case 'r':
- case 'R':
- if (av[i][2] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
- m_typeRegName = OString(s);
- break;
- case 'o':
- case 'O':
- if (av[i][2] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
- m_indexRegName = OString(s);
- break;
- case 'b':
- case 'B':
- if (av[i][2] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
- m_base = OString(s);
- break;
- case 'f':
- case 'F':
- if (av[i][2] != '\0')
- {
- fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- }
- m_bForceOutput = sal_True;
- break;
- case 'h':
- case '?':
- if (av[i][2] != '\0')
- {
- fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- } else
- {
- fprintf(stdout, "%s", prepareHelp().getStr());
- exit(0);
- }
- break;
- default:
- fprintf(stderr, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
+ if (!((++first != last) && ((*first)[0] != '-')))
+ {
+ return badOption("invalid", option.c_str());
+ }
+ m_indexRegName = (*first);
+ break;
}
- } else
- {
- if (av[i][0] == '@')
+ case 'b':
+ case 'B':
{
- FILE* cmdFile = fopen(av[i]+1, "r");
- if( cmdFile == NULL )
- {
- fprintf(stderr, "%s", prepareHelp().getStr());
- bRet = sal_False;
- } else
+ if (!((++first != last) && ((*first)[0] != '-')))
{
- int rargc=0;
- char* rargv[512];
- char buffer[512];
-
- while ( fscanf(cmdFile, "%s", buffer) != EOF )
- {
- rargv[rargc]= strdup(buffer);
- rargc++;
- }
- fclose(cmdFile);
-
- bRet = initOptions(rargc, rargv, bCmdFile);
-
- for (long j=0; j < rargc; j++)
- {
- free(rargv[j]);
- }
+ return badOption("invalid", option.c_str());
+ }
+ m_base = OString((*first).c_str(), (*first).size());
+ break;
+ }
+ case 'f':
+ case 'F':
+ {
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", option.c_str());
}
- } else
+ m_bForceOutput = sal_True;
+ break;
+ }
+ case 'h':
+ case '?':
{
- fprintf(stderr, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", option.c_str());
+ }
+ return printUsage();
+ // break; // unreachable
}
+ default:
+ return badOption("unknown", option.c_str());
+ // break; // unreachable
}
}
-
- return bRet;
-}
-
-OString Options::prepareHelp()
-{
- OString help("\nusing: ");
- help += m_program + " -r<filename> -o<filename> [-options] | @<filename>\n";
- help += " -o<filename> = filename specifies the name of the new singleton index registry.\n";
- help += " -r<filename> = filename specifies the name of the type registry.\n";
- help += " @<filename> = filename specifies a command file.\n";
- help += "Options:\n";
- help += " -b<name> = name specifies the name of a start key. The types will be searched\n";
- help += " under this key in the type registry.\n";
- help += " -f = force the output of all found singletons.\n";
- help += " -h|-? = print this help message and exit.\n";
- help += prepareVersion();
-
- return help;
+ return true;
}
-OString Options::prepareVersion()
-{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 1.0\n\n";
- return version;
-}
-
-static Options options;
-
-static sal_Bool checkSingletons(RegistryKey& singletonKey, RegistryKey& typeKey)
+static sal_Bool checkSingletons(Options_Impl const & options, RegistryKey& singletonKey, RegistryKey& typeKey)
{
RegValueType valueType = RG_VALUETYPE_NOT_DEFINED;
sal_uInt32 size = 0;
@@ -326,24 +179,22 @@ static sal_Bool checkSingletons(RegistryKey& singletonKey, RegistryKey& typeKey)
sal_Bool bRet = sal_False;
RegError e = typeKey.getValueInfo(tmpName, &valueType, &size);
-
- if ( e != REG_VALUE_NOT_EXISTS && e != REG_INVALID_VALUE && valueType == RG_VALUETYPE_BINARY)
+ if ((e != REG_VALUE_NOT_EXISTS) && (e != REG_INVALID_VALUE) && (valueType == RG_VALUETYPE_BINARY))
{
- RegistryKey entryKey;
- RegValue value = rtl_allocateMemory(size);
-
- typeKey.getValue(tmpName, value);
-
- RegistryTypeReader reader((sal_uInt8*)value, size, sal_False);
+ std::vector< sal_uInt8 > value(size);
+ typeKey.getValue(tmpName, &value[0]); // @@@ broken api: write to buffer w/o buffer size.
+ RegistryTypeReader reader(&value[0], value.size(), sal_False);
if ( reader.isValid() && reader.getTypeClass() == RT_TYPE_SINGLETON )
{
- OUString singletonName = reader.getTypeName().replace('/', '.');
+ RegistryKey entryKey;
+ OUString singletonName = reader.getTypeName().replace('/', '.');
if ( singletonKey.createKey(singletonName, entryKey) )
{
fprintf(stderr, "%s: could not create SINGLETONS entry for \"%s\"\n",
- options.getProgramName().getStr(), U2S( singletonName ));
- } else
+ options.getProgramName().c_str(), U2S( singletonName ));
+ }
+ else
{
bRet = sal_True;
OUString value2 = reader.getSuperTypeName();
@@ -352,30 +203,26 @@ static sal_Bool checkSingletons(RegistryKey& singletonKey, RegistryKey& typeKey)
(RegValue)value2.getStr(), sizeof(sal_Unicode)* (value2.getLength()+1)) )
{
fprintf(stderr, "%s: could not create data entry for singleton \"%s\"\n",
- options.getProgramName().getStr(), U2S( singletonName ));
+ options.getProgramName().c_str(), U2S( singletonName ));
}
if ( options.forceOutput() )
{
fprintf(stderr, "%s: create SINGLETON entry for \"%s\" -> \"%s\"\n",
- options.getProgramName().getStr(), U2S( singletonName ), U2S(value2));
+ options.getProgramName().c_str(), U2S( singletonName ), U2S(value2));
}
}
}
-
- rtl_freeMemory(value);
}
RegistryKeyArray subKeys;
-
typeKey.openSubKeys(tmpName, subKeys);
sal_uInt32 length = subKeys.getLength();
- RegistryKey elementKey;
for (sal_uInt32 i = 0; i < length; i++)
{
- elementKey = subKeys.getElement(i);
- if ( checkSingletons(singletonKey, elementKey) )
+ RegistryKey elementKey = subKeys.getElement(i);
+ if ( checkSingletons(options, singletonKey, elementKey) )
{
bRet = sal_True;
}
@@ -389,69 +236,85 @@ int main( int argc, char * argv[] )
int _cdecl main( int argc, char * argv[] )
#endif
{
- if ( !options.initOptions(argc, argv) )
+ std::vector< std::string > args;
+ for (int i = 1; i < argc; i++)
{
- exit(1);
+ int result = Options::checkArgument(args, argv[i], strlen(argv[i]));
+ if (result != 0)
+ {
+ // failure.
+ return (result);
+ }
}
- OUString indexRegName( convertToFileUrl(options.getIndexReg()) );
- OUString typeRegName( convertToFileUrl(options.getTypeReg()) );
+ Options_Impl options(argv[0]);
+ if (!options.initOptions(args))
+ {
+ options.printUsage();
+ return (1);
+ }
+ OUString indexRegName( convertToFileUrl(options.getIndexReg().c_str(), options.getIndexReg().size()) );
Registry indexReg;
- Registry typeReg;
-
if ( indexReg.open(indexRegName, REG_READWRITE) )
{
if ( indexReg.create(indexRegName) )
{
fprintf(stderr, "%s: open registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getIndexReg().getStr());
- exit(2);
+ options.getProgramName().c_str(), options.getIndexReg().c_str());
+ return (2);
}
}
+
+ OUString typeRegName( convertToFileUrl(options.getTypeReg().c_str(), options.getTypeReg().size()) );
+ Registry typeReg;
if ( typeReg.open(typeRegName, REG_READONLY) )
{
fprintf(stderr, "%s: open registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getTypeReg().getStr());
- exit(3);
+ options.getProgramName().c_str(), options.getTypeReg().c_str());
+ return (3);
}
- RegistryKey indexRoot, typeRoot;
+ RegistryKey indexRoot;
if ( indexReg.openRootKey(indexRoot) )
{
fprintf(stderr, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getIndexReg().getStr());
- exit(4);
+ options.getProgramName().c_str(), options.getIndexReg().c_str());
+ return (4);
}
+
+ RegistryKey typeRoot;
if ( typeReg.openRootKey(typeRoot) )
{
fprintf(stderr, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getTypeReg().getStr());
- exit(5);
+ options.getProgramName().c_str(), options.getTypeReg().c_str());
+ return (5);
}
- RegistryKey singletonKey, typeKey;
+ RegistryKey typeKey;
if ( options.hasBase() )
{
if ( typeRoot.openKey(S2U(options.getBase()), typeKey) )
{
fprintf(stderr, "%s: open base key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getTypeReg().getStr());
- exit(6);
+ options.getProgramName().c_str(), options.getTypeReg().c_str());
+ return (6);
}
- } else
+ }
+ else
{
typeKey = typeRoot;
}
+ RegistryKey singletonKey;
if ( indexRoot.createKey(OUString::createFromAscii("SINGLETONS"), singletonKey) )
{
fprintf(stderr, "%s: open/create SINGLETONS key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getIndexReg().getStr());
- exit(7);
+ options.getProgramName().c_str(), options.getIndexReg().c_str());
+ return (7);
}
- sal_Bool bSingletonsExist = checkSingletons(singletonKey, typeKey);
+ sal_Bool bSingletonsExist = checkSingletons(options, singletonKey, typeKey);
indexRoot.releaseKey();
typeRoot.releaseKey();
@@ -460,24 +323,22 @@ int _cdecl main( int argc, char * argv[] )
if ( indexReg.close() )
{
fprintf(stderr, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getIndexReg().getStr());
- exit(9);
+ options.getProgramName().c_str(), options.getIndexReg().c_str());
+ return (9);
}
if ( !bSingletonsExist )
{
if ( indexReg.destroy(OUString()) )
{
fprintf(stderr, "%s: destroy registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getIndexReg().getStr());
- exit(10);
+ options.getProgramName().c_str(), options.getIndexReg().c_str());
+ return (10);
}
}
if ( typeReg.close() )
{
fprintf(stderr, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getTypeReg().getStr());
- exit(11);
+ options.getProgramName().c_str(), options.getTypeReg().c_str());
+ return (11);
}
}
-
-
diff --git a/registry/tools/fileurl.cxx b/registry/tools/fileurl.cxx
new file mode 100644
index 000000000000..e3561888c674
--- /dev/null
+++ b/registry/tools/fileurl.cxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "fileurl.hxx"
+
+#include "rtl/ustring.hxx"
+#include "osl/diagnose.h"
+#include "osl/file.hxx"
+#include "osl/process.h"
+#include "osl/thread.h"
+
+#include <string.h>
+
+#ifdef SAL_UNX
+#define SEPARATOR '/'
+#else
+#define SEPARATOR '\\'
+#endif
+
+using rtl::OUString;
+using osl::FileBase;
+
+namespace registry
+{
+namespace tools
+{
+
+OUString convertToFileUrl(char const * filename, size_t length)
+{
+ OUString const uFileName(filename, length, osl_getThreadTextEncoding());
+ if (strncmp(filename, "file://", 7) == 0)
+ {
+ // already a FileUrl.
+ return uFileName;
+ }
+
+ OUString uFileUrl;
+ if (length > 0)
+ {
+ if ((filename[0] == '.') || (filename[0] != SEPARATOR))
+ {
+ // relative path name.
+ OUString uWorkingDir;
+ if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uFileUrl) != FileBase::E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ }
+ else
+ {
+ // absolute path name.
+ if (FileBase::getFileURLFromSystemPath(uFileName, uFileUrl) != FileBase::E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ }
+ }
+ return uFileUrl;
+}
+
+} // namespace tools
+} // namespace registry
diff --git a/offapi/drafts/com/sun/star/form/IncompatibleTypesException.idl b/registry/tools/fileurl.hxx
index ec784aa7c2bb..bbaa218f32e6 100644
--- a/offapi/drafts/com/sun/star/form/IncompatibleTypesException.idl
+++ b/registry/tools/fileurl.hxx
@@ -24,34 +24,20 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef __drafts_com_sun_star_form_IncompatibleTypesException_idl__
-#define __drafts_com_sun_star_form_IncompatibleTypesException_idl__
-#ifndef __com_sun_star_uno_Exception_idl__
-#include <com/sun/star/uno/Exception.idl>
-#endif
+#ifndef INCLUDED_REGISTRY_TOOLS_FILEURL_HXX
+#define INCLUDED_REGISTRY_TOOLS_FILEURL_HXX
+#include "rtl/ustring.hxx"
-//=============================================================================
-
-module drafts { module com { module sun { module star { module form {
-
-//=============================================================================
-
-/** thrown to indicate that the types of an <type>XValueBinding</type> and
- an <type>XBindableValue</type> are incompatible
-
- @deprecated
- This exception is superseeded by <type scope="com::sun::star::form::binding">IncompatibleTypesException</type>
-*/
-exception IncompatibleTypesException: com::sun::star::uno::Exception
+namespace registry
+{
+namespace tools
{
-};
-
-//=============================================================================
-}; }; }; }; };
+rtl::OUString convertToFileUrl(char const * filename, size_t length);
-//=============================================================================
+} // namespace tools
+} // namespace registry
-#endif
+#endif /* INCLUDED_REGISTRY_TOOLS_FILEURL_HXX */
diff --git a/registry/tools/makefile.mk b/registry/tools/makefile.mk
index bb7d448b86e6..06ca753ff044 100644
--- a/registry/tools/makefile.mk
+++ b/registry/tools/makefile.mk
@@ -43,7 +43,7 @@ ENABLE_EXCEPTIONS := TRUE
CDEFS += -DDLL_VERSION=$(EMQ)"$(DLLPOSTFIX)$(EMQ)"
APP1TARGET= $(TARGET)
-APP1OBJS= $(OBJ)$/regmerge.obj
+APP1OBJS= $(OBJ)$/regmerge.obj $(OBJ)/fileurl.obj $(OBJ)/options.obj
APP1RPATH= UREBIN
APP1STDLIBS=\
@@ -51,7 +51,7 @@ APP1STDLIBS=\
$(REGLIB)
APP2TARGET= regview
-APP2OBJS= $(OBJ)$/regview.obj
+APP2OBJS= $(OBJ)$/regview.obj $(OBJ)/fileurl.obj
APP2RPATH= UREBIN
APP2STDLIBS=\
@@ -59,7 +59,7 @@ APP2STDLIBS=\
$(REGLIB)
APP3TARGET= regcompare
-APP3OBJS= $(OBJ)$/regcompare.obj
+APP3OBJS= $(OBJ)$/regcompare.obj $(OBJ)/fileurl.obj $(OBJ)/options.obj
APP3RPATH= SDK
APP3STDLIBS=\
@@ -68,13 +68,21 @@ APP3STDLIBS=\
$(REGLIB)
APP4TARGET= checksingleton
-APP4OBJS= $(OBJ)$/checksingleton.obj
+APP4OBJS= $(OBJ)$/checksingleton.obj $(OBJ)/fileurl.obj $(OBJ)/options.obj
APP4STDLIBS=\
$(SALLIB) \
$(SALHELPERLIB) \
$(REGLIB)
-OBJFILES = $(APP1OBJS) $(APP2OBJS) $(APP3OBJS) $(APP4OBJS)
+APP5TARGET= rdbedit
+APP5OBJS= $(OBJ)$/rdbedit.obj
+
+APP5STDLIBS=\
+ $(SALLIB) \
+ $(SALHELPERLIB) \
+ $(REGLIB)
+
+OBJFILES = $(APP1OBJS) $(APP2OBJS) $(APP3OBJS) $(APP4OBJS) $(APP5OBJS)
.INCLUDE : target.mk
diff --git a/registry/tools/options.cxx b/registry/tools/options.cxx
new file mode 100644
index 000000000000..d851825ebfb6
--- /dev/null
+++ b/registry/tools/options.cxx
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * 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 "options.hxx"
+
+#include "osl/diagnose.h"
+
+#include <stdio.h>
+#include <string.h>
+
+namespace registry
+{
+namespace tools
+{
+
+Options::Options (char const * program)
+ : m_program (program)
+{}
+
+Options::~Options()
+{}
+
+// static
+bool Options::checkArgument(std::vector< std::string> & rArgs, char const * arg, size_t len)
+{
+ bool result = ((arg != 0) && (len > 0));
+ OSL_PRECOND(result, "registry::tools::Options::checkArgument(): invalid arguments");
+ if (result)
+ {
+ OSL_TRACE("registry::tools:Options::checkArgument(): \"%s\"", arg);
+ switch (arg[0])
+ {
+ case '@':
+ if ((result = (len > 1)) == true)
+ {
+ // "@<cmdfile>"
+ result = Options::checkCommandFile(rArgs, &(arg[1]));
+ }
+ break;
+ case '-':
+ if ((result = (len > 1)) == true)
+ {
+ // "-<option>"
+ std::string option (&(arg[0]), 2);
+ rArgs.push_back(option);
+ if (len > 2)
+ {
+ // "-<option><param>"
+ std::string param(&(arg[2]), len - 2);
+ rArgs.push_back(param);
+ }
+ }
+ break;
+ default:
+ rArgs.push_back(std::string(arg, len));
+ break;
+ }
+ }
+ return (result);
+}
+
+// static
+bool Options::checkCommandFile(std::vector< std::string > & rArgs, char const * filename)
+{
+ FILE * fp = fopen(filename, "r");
+ if (fp == 0)
+ {
+ fprintf(stderr, "ERROR: Can't open command file \"%s\"\n", filename);
+ return (false);
+ }
+
+ std::string buffer;
+ buffer.reserve(256);
+
+ bool quoted = false;
+ int c = EOF;
+ while ((c = fgetc(fp)) != EOF)
+ {
+ switch(c)
+ {
+ case '\"':
+ quoted = !quoted;
+ break;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ if (!quoted)
+ {
+ if (!buffer.empty())
+ {
+ if (!checkArgument(rArgs, buffer.c_str(), buffer.size()))
+ {
+ // failure.
+ (void) fclose(fp);
+ return false;
+ }
+ buffer.clear();
+ }
+ break;
+ }
+ default:
+ // quoted white-space fall through
+ buffer.push_back(sal::static_int_cast<char>(c));
+ break;
+ }
+ }
+ return (fclose(fp) == 0);
+}
+
+bool Options::initOptions (std::vector< std::string > & rArgs)
+{
+ return initOptions_Impl (rArgs);
+}
+
+bool Options::badOption (char const * reason, char const * option) const
+{
+ (void) fprintf(stderr, "%s: %s option '%s'\n", m_program.c_str(), reason, option);
+ return printUsage();
+}
+
+bool Options::printUsage() const
+{
+ printUsage_Impl();
+ return false;
+}
+
+} // namespace tools
+} // namespace registry
diff --git a/registry/tools/options.hxx b/registry/tools/options.hxx
new file mode 100644
index 000000000000..8e4c97877e3b
--- /dev/null
+++ b/registry/tools/options.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * 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 INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX
+#define INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX
+
+#include <string>
+#include <vector>
+
+namespace registry
+{
+namespace tools
+{
+class Options
+{
+ std::string m_program;
+
+ Options (Options const &);
+ Options & operator= (Options const &);
+
+public:
+ explicit Options (char const * program);
+ virtual ~Options();
+
+ static bool checkArgument (std::vector< std::string > & rArgs, char const * arg, size_t len);
+
+ bool initOptions (std::vector< std::string > & rArgs);
+ bool badOption (char const * reason, char const * option) const;
+
+ std::string const & getProgramName() const { return m_program; }
+ bool printUsage() const;
+
+protected:
+ static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename);
+
+ virtual bool initOptions_Impl(std::vector< std::string > & rArgs) = 0;
+ virtual void printUsage_Impl() const = 0;
+};
+
+} // namespace tools
+} // namespace registry
+
+#endif /* INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX */
diff --git a/registry/tools/rdbedit.cxx b/registry/tools/rdbedit.cxx
new file mode 100644
index 000000000000..c2b3d6a3dcf3
--- /dev/null
+++ b/registry/tools/rdbedit.cxx
@@ -0,0 +1,318 @@
+/*************************************************************************
+ *
+ * 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_registry.hxx"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "registry/registry.hxx"
+#include "registry/reflread.hxx"
+#include <rtl/ustring.hxx>
+#include <rtl/alloc.h>
+#include <osl/process.h>
+#include <osl/diagnose.h>
+#include <osl/thread.h>
+#include <osl/file.hxx>
+
+#ifdef SAL_UNX
+#define SEPARATOR '/'
+#else
+#define SEPARATOR '\\'
+#endif
+
+using namespace ::rtl;
+using namespace ::osl;
+
+sal_Bool isFileUrl(const OString& fileName)
+{
+ if (fileName.indexOf("file://") == 0 )
+ return sal_True;
+ return sal_False;
+}
+
+OUString convertToFileUrl(const OString& fileName)
+{
+ if ( isFileUrl(fileName) )
+ {
+ return OStringToOUString(fileName, osl_getThreadTextEncoding());
+ }
+
+ OUString uUrlFileName;
+ OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
+ if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
+ {
+ OUString uWorkingDir;
+ if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName)
+ != FileBase::E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ } else
+ {
+ if (FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName)
+ != FileBase::E_None)
+ {
+ OSL_ASSERT(false);
+ }
+ }
+
+ return uUrlFileName;
+}
+
+#define U2S( s ) \
+ OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()
+#define S2U( s ) \
+ OStringToOUString(s, RTL_TEXTENCODING_UTF8)
+
+struct LessString
+{
+ sal_Bool operator()(const OUString& str1, const OUString& str2) const
+ {
+ return (str1 < str2);
+ }
+};
+
+enum Command {
+ DELETEKEY
+};
+
+class Options
+{
+public:
+ Options()
+ : m_bVerbose(false)
+ {}
+ ~Options()
+ {}
+
+ bool initOptions(int ac, char* av[]);
+
+ OString prepareHelp();
+ OString prepareVersion();
+
+ const OString& getProgramName()
+ { return m_program; }
+ const OString& getTypeReg()
+ { return m_typeRegName; }
+ const OString& getKeyName()
+ { return m_keyName; }
+ const Command getCommand()
+ { return m_command; }
+ bool verbose()
+ { return m_bVerbose; }
+protected:
+ OString m_program;
+ OString m_typeRegName;
+ OString m_keyName;
+ Command m_command;
+ bool m_bVerbose;
+};
+
+bool Options::initOptions(int ac, char* av[])
+{
+ bool bRet = true;
+ sal_uInt16 i=1;
+
+ if (ac < 2)
+ {
+ fprintf(stderr, "%s", prepareHelp().getStr());
+ bRet = sal_False;
+ }
+
+ m_program = av[0];
+ sal_Int32 index = -1;
+ if ((index=m_program.lastIndexOf(SEPARATOR)) > 0)
+ m_program = av[0]+index+1;
+
+ char *s=NULL;
+ for (; i < ac; i++)
+ {
+ if (av[i][0] == '-')
+ {
+ switch (av[i][1])
+ {
+ case 'r':
+ case 'R':
+ if (av[i][2] == '\0')
+ {
+ if (i < ac - 1 && av[i+1][0] != '-')
+ {
+ i++;
+ s = av[i];
+ } else
+ {
+ fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
+ bRet = sal_False;
+ break;
+ }
+ } else
+ {
+ s = av[i] + 2;
+ }
+ m_typeRegName = OString(s);
+ break;
+ case 'd':
+ case 'D':
+ if (av[i][2] == '\0')
+ {
+ if (i < ac - 1 && av[i+1][0] != '-')
+ {
+ i++;
+ s = av[i];
+ } else
+ {
+ fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
+ bRet = sal_False;
+ break;
+ }
+ } else
+ {
+ s = av[i] + 2;
+ }
+ m_keyName = OString(s);
+ break;
+ case 'v':
+ case 'V':
+ if (av[i][2] != '\0')
+ {
+ fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
+ bRet = sal_False;
+ }
+ m_bVerbose = true;
+ break;
+ case 'h':
+ case '?':
+ if (av[i][2] != '\0')
+ {
+ fprintf(stderr, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
+ bRet = false;
+ } else
+ {
+ fprintf(stdout, "%s", prepareHelp().getStr());
+ exit(0);
+ }
+ break;
+ default:
+ fprintf(stderr, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
+ bRet = false;
+ break;
+ }
+ } else
+ {
+ fprintf(stderr, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
+ bRet = false;
+ }
+ }
+
+ return bRet;
+}
+
+OString Options::prepareHelp()
+{
+ OString help("\nusing: ");
+ help += m_program + " -r<filename> <command>\n";
+ help += " -r<filename> = filename specifies the name of the type registry.\n";
+ help += "Commands:\n";
+ help += " -d <keyname> = delete the specified key from the registry. Keyname\n";
+ help += " specifies the name of the key that get deleted.\n";
+ help += " -v = verbose output.\n";
+ help += " -h|-? = print this help message and exit.\n";
+ help += prepareVersion();
+
+ return help;
+}
+
+OString Options::prepareVersion()
+{
+ OString version(m_program);
+ version += " Version 1.0\n\n";
+ return version;
+}
+
+static Options options;
+
+
+#if (defined UNX) || (defined OS2) || (defined __MINGW32__)
+int main( int argc, char * argv[] )
+#else
+int _cdecl main( int argc, char * argv[] )
+#endif
+{
+ if ( !options.initOptions(argc, argv) )
+ {
+ exit(1);
+ }
+
+ OUString typeRegName( convertToFileUrl(options.getTypeReg()) );
+
+ Registry typeReg;
+
+ if ( typeReg.open(typeRegName, REG_READWRITE) )
+ {
+ fprintf(stderr, "%s: open registry \"%s\" failed\n",
+ options.getProgramName().getStr(), options.getTypeReg().getStr());
+ exit(2);
+ }
+
+ RegistryKey typeRoot;
+ if ( typeReg.openRootKey(typeRoot) )
+ {
+ fprintf(stderr, "%s: open root key of registry \"%s\" failed\n",
+ options.getProgramName().getStr(), options.getTypeReg().getStr());
+ exit(3);
+ }
+
+ if ( options.getCommand() == DELETEKEY )
+ {
+ if ( typeRoot.deleteKey(S2U(options.getKeyName())) )
+ {
+ fprintf(stderr, "%s: delete key \"%s\" of registry \"%s\" failed\n",
+ options.getProgramName().getStr(), options.getKeyName().getStr(), options.getTypeReg().getStr());
+ exit(4);
+ } else {
+ if (options.verbose())
+ fprintf(stderr, "%s: delete key \"%s\" of registry \"%s\"\n",
+ options.getProgramName().getStr(), options.getKeyName().getStr(), options.getTypeReg().getStr());
+ }
+ }
+
+ typeRoot.releaseKey();
+ if ( typeReg.close() )
+ {
+ fprintf(stderr, "%s: closing registry \"%s\" failed\n",
+ options.getProgramName().getStr(), options.getTypeReg().getStr());
+ exit(5);
+ }
+}
+
+
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index 4e95d884de30..0eaa220ae2de 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -28,409 +28,266 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_registry.hxx"
-#include <stdio.h>
-#include <string.h>
-
-#include <set>
-#include <vector>
#include "registry/registry.hxx"
#include "registry/reader.hxx"
#include "registry/version.h"
+#include "fileurl.hxx"
+#include "options.hxx"
+
#include <rtl/ustring.hxx>
-#include <rtl/alloc.h>
-#include <osl/process.h>
#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
-#ifdef SAL_UNX
-#define SEPARATOR '/'
-#else
-#define SEPARATOR '\\'
-#endif
+#include <stdio.h>
+#include <string.h>
-using namespace ::rtl;
-using namespace ::osl;
+#include <set>
+#include <vector>
+#include <string>
-OUString shortName(const OUString& fullName)
-{
- return fullName.copy(fullName.lastIndexOf('/') + 1);
-}
+using namespace rtl;
+using namespace registry::tools;
-sal_Bool isFileUrl(const OString& fileName)
-{
- if (fileName.indexOf("file://") == 0 )
- return sal_True;
- return sal_False;
-}
+typedef std::set< rtl::OUString > StringSet;
-OUString convertToFileUrl(const OString& fileName)
+class Options_Impl : public Options
{
- if ( isFileUrl(fileName) )
- {
- return OStringToOUString(fileName, osl_getThreadTextEncoding());
- }
-
- OUString uUrlFileName;
- OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
- if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
- {
- OUString uWorkingDir;
- if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
- {
- OSL_ASSERT(false);
- }
- if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- } else
- {
- if (FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- }
+public:
+ explicit Options_Impl(char const * program)
+ : Options(program),
+ m_bFullCheck(false),
+ m_bForceOutput(false),
+ m_bUnoTypeCheck(false),
+ m_checkUnpublished(false)
+ {}
- return uUrlFileName;
-}
+ std::string const & getRegName1() const { return m_regName1; }
+ std::string const & getRegName2() const { return m_regName2; }
-#define U2S( s ) \
- OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()
-#define S2U( s ) \
- OStringToOUString(s, RTL_TEXTENCODING_UTF8)
+ bool isStartKeyValid() const { return (m_startKey.getLength() > 0); }
+ OUString const & getStartKey() const { return m_startKey; }
+ bool matchedWithExcludeKey( const OUString& keyName) const;
-struct LessString
-{
- sal_Bool operator()(const OUString& str1, const OUString& str2) const
- {
- return (str1 < str2);
- }
-};
+ bool fullCheck() const { return m_bFullCheck; }
+ bool forceOutput() const { return m_bForceOutput; }
+ bool unoTypeCheck() const { return m_bUnoTypeCheck; }
+ bool checkUnpublished() const { return m_checkUnpublished; }
-typedef ::std::set< OUString > StringSet;
+protected:
+ bool setRegName_Impl(char c, std::string const & param);
-class Options
-{
-public:
- Options()
- : m_bFullCheck(sal_False)
- , m_bForceOutput(sal_False)
- , m_bUnoTypeCheck(sal_False)
- , m_checkUnpublished(false)
- {}
- ~Options()
- {}
+ virtual void printUsage_Impl() const;
+ virtual bool initOptions_Impl (std::vector< std::string > & rArgs);
- sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False);
-
- OString prepareHelp();
- OString prepareVersion();
-
- const OString& getProgramName()
- { return m_program; }
- const OString& getRegName1()
- { return m_regName1; }
- const OString& getRegName2()
- { return m_regName2; }
- sal_Bool isStartKeyValid()
- { return (m_startKey.getLength() > 0); };
- const OString& getStartKey()
- { return m_startKey; }
- sal_Bool existsExcludeKeys()
- { return !m_excludeKeys.empty(); };
- StringSet& getExcludeKeys()
- { return m_excludeKeys; }
- sal_Bool matchedWithExcludeKey( const OUString& keyName);
- sal_Bool fullCheck()
- { return m_bFullCheck; }
- sal_Bool forceOutput()
- { return m_bForceOutput; }
- sal_Bool unoTypeCheck()
- { return m_bUnoTypeCheck; }
- bool checkUnpublished() const { return m_checkUnpublished; }
-protected:
- OString m_program;
- OString m_regName1;
- OString m_regName2;
- OString m_startKey;
+ std::string m_regName1;
+ std::string m_regName2;
+ OUString m_startKey;
StringSet m_excludeKeys;
- sal_Bool m_bFullCheck;
- sal_Bool m_bForceOutput;
- sal_Bool m_bUnoTypeCheck;
+ bool m_bFullCheck;
+ bool m_bForceOutput;
+ bool m_bUnoTypeCheck;
bool m_checkUnpublished;
};
-sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
-{
- sal_Bool bRet = sal_True;
- sal_uInt16 i=0;
+#define U2S( s ) OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()
- if (!bCmdFile)
- {
- bCmdFile = sal_True;
+inline rtl::OUString makeOUString (std::string const & s)
+{
+ return rtl::OUString(s.c_str(), s.size(), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS);
+}
- m_program = av[0];
+inline rtl::OUString shortName(rtl::OUString const & fullName)
+{
+ return fullName.copy(fullName.lastIndexOf('/') + 1);
+}
- if (ac < 2)
- {
- fprintf(stdout, "%s", prepareHelp().getStr());
- bRet = sal_False;
- }
+bool Options_Impl::setRegName_Impl(char c, std::string const & param)
+{
+ bool one = (c == '1'), two = (c == '2');
+ if (one)
+ m_regName1 = param;
+ if (two)
+ m_regName2 = param;
+ return (one || two);
+}
- i = 1;
- } else
- {
- i = 0;
- }
+//virtual
+void Options_Impl::printUsage_Impl() const
+{
+ std::string const & rProgName = getProgramName();
+ fprintf(stderr,
+ "Usage: %s -r1<filename> -r2<filename> [-options] | @<filename>\n", rProgName.c_str()
+ );
+ fprintf(stderr,
+ " -r1<filename> = filename specifies the name of the first registry.\n"
+ " -r2<filename> = filename specifies the name of the second registry.\n"
+ " @<filename> = filename specifies a command file.\n"
+ "Options:\n"
+ " -s<name> = name specifies the name of a start key. If no start key\n"
+ " |S<name> is specified the comparison starts with the root key.\n"
+ " -x<name> = name specifies the name of a key which won't be compared. All\n"
+ " |X<name> subkeys won't be compared also. This option can be used more than once.\n"
+ " -f|F = force the detailed output of any diffenrences. Default\n"
+ " is that only the number of differences is returned.\n"
+ " -c|C = make a complete check, that means any differences will be\n"
+ " detected. Default is only a compatibility check that means\n"
+ " only UNO typelibrary entries will be checked.\n"
+ " -t|T = make an UNO type compatiblity check. This means that registry 2\n"
+ " will be checked against registry 1. If a interface in r2 contains\n"
+ " more methods or the methods are in a different order as in r1, r2 is\n"
+ " incompatible to r1. But if a service in r2 supports more properties as\n"
+ " in r1 and the new properties are 'optional' it is compatible.\n"
+ " -u|U = additionally check types that are unpublished in registry 1.\n"
+ " -h|-? = print this help message and exit.\n"
+ );
+ fprintf(stderr,
+ "\n%s Version 1.0\n\n", rProgName.c_str()
+ );
+}
- char *s=NULL;
- for (; i < ac; i++)
+// virtual
+bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs)
+{
+ std::vector< std::string >::const_iterator first = rArgs.begin(), last = rArgs.end();
+ for (; first != last; ++first)
{
- if (av[i][0] == '-')
+ if ((*first)[0] != '-')
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ switch ((*first)[1])
{
- switch (av[i][1])
+ case 'r':
+ case 'R':
{
- case 'r':
- case 'R':
+ if (!((++first != last) && ((*first)[0] != '-')))
{
- sal_Bool bFirst = sal_True;
- if (av[i][2] == '2')
- {
- bFirst = sal_False;
- } else if (av[i][2] != '1')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- }
- if (av[i][3] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
+ return badOption("invalid", (*first).c_str());
+ }
- if ( bFirst )
- {
- m_regName1 = OString(s);
- } else
+ std::string option(*first), param;
+ if (option.size() == 1)
+ {
+ // "-r<n><space><param>"
+ if (!((++first != last) && ((*first)[0] != '-')))
{
- m_regName2 = OString(s);
+ return badOption("invalid", (*first).c_str());
}
+ param = (*first);
}
- break;
- case 's':
- case 'S':
- if (av[i][2] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
- m_startKey = OString(s);
- break;
- case 'x':
- case 'X':
- if (av[i][2] == '\0')
- {
- if (i < ac - 1 && av[i+1][0] != '-')
- {
- i++;
- s = av[i];
- } else
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
- }
- } else
- {
- s = av[i] + 2;
- }
- m_excludeKeys.insert(S2U(s));
- break;
- case 'c':
- case 'C':
- if (av[i][2] != '\0')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- }
- m_bFullCheck = sal_True;
- break;
- case 'f':
- case 'F':
- if (av[i][2] != '\0')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- }
- m_bForceOutput = sal_True;
- break;
- case 't':
- case 'T':
- if (av[i][2] != '\0')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- }
- m_bUnoTypeCheck = sal_True;
- break;
- case 'u':
- case 'U':
- if (av[i][2] != '\0')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- }
- m_checkUnpublished = true;
- break;
- case 'h':
- case '?':
- if (av[i][2] != '\0')
- {
- fprintf(stdout, "%s: invalid option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- } else
- {
- fprintf(stdout, "%s", prepareHelp().getStr());
- exit(0);
- }
- break;
- default:
- fprintf(stdout, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
- break;
+ else
+ {
+ // "-r<n><param>"
+ param = std::string(&(option[1]), option.size() - 1);
+ }
+ if (!setRegName_Impl(option[0], param))
+ {
+ return badOption("invalid", option.c_str());
+ }
+ break;
}
- } else
- {
- if (av[i][0] == '@')
+ case 's':
+ case 'S':
{
- FILE* cmdFile = fopen(av[i]+1, "r");
- if( cmdFile == NULL )
- {
- fprintf(stdout, "%s", prepareHelp().getStr());
- bRet = sal_False;
- } else
+ if (!((++first != last) && ((*first)[0] != '-')))
{
- int rargc=0;
- char* rargv[512];
- char buffer[512];
-
- while ( fscanf(cmdFile, "%s", buffer) != EOF )
- {
- rargv[rargc]= strdup(buffer);
- rargc++;
- }
- fclose(cmdFile);
-
- bRet = initOptions(rargc, rargv, bCmdFile);
-
- for (long j=0; j < rargc; j++)
- {
- free(rargv[j]);
- }
+ return badOption("invalid", (*first).c_str());
+ }
+ m_startKey = makeOUString(*first);
+ break;
+ }
+ case 'x':
+ case 'X':
+ {
+ if (!((++first != last) && ((*first)[0] != '-')))
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ m_excludeKeys.insert(makeOUString(*first));
+ break;
+ }
+ case 'f':
+ case 'F':
+ {
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ m_bForceOutput = sal_True;
+ break;
+ }
+ case 'c':
+ case 'C':
+ {
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ m_bFullCheck = sal_True;
+ break;
+ }
+ case 't':
+ case 'T':
+ {
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ m_bUnoTypeCheck = sal_True;
+ break;
+ }
+ case 'u':
+ case 'U':
+ {
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", (*first).c_str());
}
- } else
+ m_checkUnpublished = true;
+ break;
+ }
+ case 'h':
+ case '?':
{
- fprintf(stdout, "%s: unknown option '%s'\n", m_program.getStr(), av[i]);
- bRet = sal_False;
+ if ((*first).size() > 2)
+ {
+ return badOption("invalid", (*first).c_str());
+ }
+ return printUsage();
+ // break; // Unreachable
+ }
+ default:
+ {
+ return badOption("unknown", (*first).c_str());
+ // break; // Unreachable
}
}
}
- if ( bRet )
+ if ( m_regName1.size() == 0 )
{
- if ( m_regName1.getLength() == 0 )
- {
- fprintf(stdout, "%s: missing option '-r1'\n", m_program.getStr());
- bRet = sal_False;
- }
- if ( m_regName2.getLength() == 0 )
- {
- fprintf(stdout, "%s: missing option '-r2'\n", m_program.getStr());
- bRet = sal_False;
- }
+ return badOption("missing", "-r1");
}
-
- return bRet;
-}
-
-OString Options::prepareHelp()
-{
- OString help("\nusing: ");
- help += m_program + " -r1<filename> -r2<filename> [-options] | @<filename>\n";
- help += " -r1<filename> = filename specifies the name of the first registry.\n";
- help += " -r2<filename> = filename specifies the name of the second registry.\n";
- help += " @<filename> = filename specifies a command file.\n";
- help += "Options:\n";
- help += " -s<name> = name specifies the name of a start key. If no start key\n";
- help += " |S<name> is specified the comparison starts with the root key.\n";
- help += " -x<name> = name specifies the name of a key which won't be compared. All\n";
- help += " |X<name> subkeys won't be compared also. This option can be used more than once.\n";
- help += " -f|F = force the detailed output of any diffenrences. Default\n";
- help += " is that only the number of differences is returned.\n";
- help += " -c|C = make a complete check, that means any differences will be\n";
- help += " detected. Default is only a compatibility check that means\n";
- help += " only UNO typelibrary entries will be checked.\n";
- help += " -t|T = make an UNO type compatiblity check. This means that registry 2\n";
- help += " will be checked against registry 1. If a interface in r2 contains\n";
- help += " more methods or the methods are in a different order as in r1, r2 is\n";
- help += " incompatible to r1. But if a service in r2 supports more properties as\n";
- help += " in r1 and the new properties are 'optonal' it is compatible.\n";
- help += " -u|U = additionally check types that are unpublished in registry 1.\n";
- help += " -h|-? = print this help message and exit.\n";
- help += prepareVersion();
-
- return help;
-}
-
-OString Options::prepareVersion()
-{
- OString version("\nSun Microsystems (R) ");
- version += m_program + " Version 1.0\n\n";
- return version;
+ if ( m_regName2.size() == 0 )
+ {
+ return badOption("missing", "-r2");
+ }
+ return true;
}
-sal_Bool Options::matchedWithExcludeKey( const OUString& keyName)
+bool Options_Impl::matchedWithExcludeKey( const OUString& keyName) const
{
- if ( m_excludeKeys.empty() )
- return sal_False;
-
- StringSet::const_iterator iter = m_excludeKeys.begin();
- StringSet::const_iterator end = m_excludeKeys.end();
-
- while ( iter != end )
+ if (!m_excludeKeys.empty())
{
- if ( keyName.indexOf(*iter) == 0)
- return sal_True;
-
- ++iter;
+ StringSet::const_iterator first = m_excludeKeys.begin(), last = m_excludeKeys.end();
+ for (; first != last; ++first)
+ {
+ if (keyName.indexOf(*first) == 0)
+ return true;
+ }
}
-
- return sal_False;
+ return false;
}
-static Options options;
-
static char const * getTypeClass(RTTypeClass typeClass)
{
switch (typeClass)
@@ -550,6 +407,7 @@ static char const * getConstValueType(RTConstValue& constValue)
return "NONE";
}
}
+
static void printConstValue(RTConstValue& constValue)
{
switch (constValue.m_type)
@@ -602,9 +460,17 @@ static void printConstValue(RTConstValue& constValue)
}
}
-static sal_uInt32 checkConstValue(const OUString& keyName,
+static void dumpTypeClass(sal_Bool & rbDump, RTTypeClass typeClass, OUString const & keyName)
+{
+ if (rbDump)
+ fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
+ rbDump = sal_False;
+}
+
+static sal_uInt32 checkConstValue(Options_Impl const & options,
+ const OUString& keyName,
RTTypeClass typeClass,
- sal_Bool& bDump,
+ sal_Bool & bDump,
RTConstValue& constValue1,
RTConstValue& constValue2,
sal_uInt16 index1)
@@ -618,11 +484,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %s != Value2 = %s\n", index1,
constValue1.m_value.aBool ? "TRUE" : "FALSE",
constValue2.m_value.aBool ? "TRUE" : "FALSE");
@@ -635,11 +497,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %d != Value2 = %d\n", index1,
constValue1.m_value.aByte, constValue2.m_value.aByte);
}
@@ -651,11 +509,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %d != Value2 = %d\n", index1,
constValue1.m_value.aShort, constValue2.m_value.aShort);
}
@@ -667,11 +521,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %d != Value2 = %d\n", index1,
constValue1.m_value.aUShort, constValue2.m_value.aUShort);
}
@@ -683,11 +533,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %ld != Value2 = %ld\n", index1,
sal::static_int_cast< long >(constValue1.m_value.aLong),
sal::static_int_cast< long >(constValue2.m_value.aLong));
@@ -700,11 +546,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %lu != Value2 = %lu\n", index1,
sal::static_int_cast< unsigned long >(constValue1.m_value.aULong),
sal::static_int_cast< unsigned long >(constValue2.m_value.aULong));
@@ -717,11 +559,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(
stdout, " Field %d: Value1 = %s != Value2 = %s\n",
index1,
@@ -740,11 +578,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(
stdout, " Field %d: Value1 = %s != Value2 = %s\n",
index1,
@@ -769,11 +603,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %f != Value2 = %f\n", index1,
constValue1.m_value.aFloat, constValue2.m_value.aFloat);
}
@@ -785,11 +615,7 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Value1 = %f != Value2 = %f\n", index1,
constValue1.m_value.aDouble, constValue2.m_value.aDouble);
}
@@ -803,45 +629,37 @@ static sal_uInt32 checkConstValue(const OUString& keyName,
return 0;
}
-static sal_uInt32 checkField(const OUString& keyName,
+static sal_uInt32 checkField(Options_Impl const & options,
+ const OUString& keyName,
RTTypeClass typeClass,
- sal_Bool& bDump,
+ sal_Bool & bDump,
typereg::Reader& reader1,
typereg::Reader& reader2,
sal_uInt16 index1,
sal_uInt16 index2)
{
sal_uInt32 nError = 0;
- if ( reader1.getFieldName(index1) !=
- reader2.getFieldName(index2) )
+ if ( reader1.getFieldName(index1) != reader2.getFieldName(index2) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Name1 = %s != Name2 = %s\n", index1,
U2S(reader1.getFieldName(index1)), U2S(reader2.getFieldName(index2)));
}
nError++;
}
- if ( reader1.getFieldTypeName(index1) !=
- reader2.getFieldTypeName(index2) )
+ if ( reader1.getFieldTypeName(index1) != reader2.getFieldTypeName(index2) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Type1 = %s != Type2 = %s\n", index1,
U2S(reader1.getFieldTypeName(index1)), U2S(reader2.getFieldTypeName(index2)));
}
nError++;
- } else
+ }
+ else
{
RTConstValue constValue1 = reader1.getFieldValue(index1);
RTConstValue constValue2 = reader2.getFieldValue(index2);
@@ -849,11 +667,7 @@ static sal_uInt32 checkField(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Access1 = %s != Access2 = %s\n", index1,
getConstValueType(constValue1), getConstValueType(constValue2));
fprintf(stdout, " Field %d: Value1 = ", index1);
@@ -863,9 +677,10 @@ static sal_uInt32 checkField(const OUString& keyName,
fprintf(stdout, "\n;");
}
nError++;
- } else
+ }
+ else
{
- nError += checkConstValue(keyName, typeClass, bDump, constValue1, constValue2, index1);
+ nError += checkConstValue(options, keyName, typeClass, bDump, constValue1, constValue2, index1);
}
}
@@ -873,11 +688,7 @@ static sal_uInt32 checkField(const OUString& keyName,
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: FieldAccess1 = %s != FieldAccess2 = %s\n", index1,
getFieldAccess(reader1.getFieldFlags(index1)).getStr(),
getFieldAccess(reader1.getFieldFlags(index2)).getStr());
@@ -885,16 +696,11 @@ static sal_uInt32 checkField(const OUString& keyName,
nError++;
}
- if ( options.fullCheck() &&
- (reader1.getFieldDocumentation(index1) != reader2.getFieldDocumentation(index2)) )
+ if ( options.fullCheck() && (reader1.getFieldDocumentation(index1) != reader2.getFieldDocumentation(index2)) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Doku1 = %s\n Doku2 = %s\n", index1,
U2S(reader1.getFieldDocumentation(index1)), U2S(reader2.getFieldDocumentation(index2)));
}
@@ -935,24 +741,20 @@ static char const * getParamMode(RTParamMode paramMode)
}
}
-static sal_uInt32 checkMethod(const OUString& keyName,
+static sal_uInt32 checkMethod(Options_Impl const & options,
+ const OUString& keyName,
RTTypeClass typeClass,
- sal_Bool& bDump,
+ sal_Bool & bDump,
typereg::Reader& reader1,
typereg::Reader& reader2,
sal_uInt16 index)
{
sal_uInt32 nError = 0;
- if ( reader1.getMethodName(index) !=
- reader2.getMethodName(index) )
+ if ( reader1.getMethodName(index) != reader2.getMethodName(index) )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method1 %d: Name1 = %s != Name2 = %s\n", index,
U2S(reader1.getMethodName(index)),
U2S(reader2.getMethodName(index)));
@@ -960,16 +762,11 @@ static sal_uInt32 checkMethod(const OUString& keyName,
nError++;
}
- if ( reader1.getMethodReturnTypeName(index) !=
- reader2.getMethodReturnTypeName(index) )
+ if ( reader1.getMethodReturnTypeName(index) != reader2.getMethodReturnTypeName(index) )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method1 %d: ReturnType1 = %s != ReturnType2 = %s\n", index,
U2S(reader1.getMethodReturnTypeName(index)),
U2S(reader2.getMethodReturnTypeName(index)));
@@ -983,11 +780,7 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d : nParameters1 = %d != nParameters2 = %d\n", index, nParams1, nParams2);
}
nError++;
@@ -999,27 +792,18 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d, Parameter %d: Type1 = %s != Type2 = %s\n", index, i,
U2S(reader1.getMethodParameterTypeName(index, i)),
U2S(reader2.getMethodParameterTypeName(index, i)));
}
nError++;
}
- if ( options.fullCheck() &&
- (reader1.getMethodParameterName(index, i) != reader2.getMethodParameterName(index, i)) )
+ if ( options.fullCheck() && (reader1.getMethodParameterName(index, i) != reader2.getMethodParameterName(index, i)) )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d, Parameter %d: Name1 = %s != Name2 = %s\n", index, i,
U2S(reader1.getMethodParameterName(index, i)),
U2S(reader2.getMethodParameterName(index, i)));
@@ -1030,11 +814,7 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d, Parameter %d: Mode1 = %s != Mode2 = %s\n", index, i,
getParamMode(reader1.getMethodParameterFlags(index, i)),
getParamMode(reader2.getMethodParameterFlags(index, i)));
@@ -1044,20 +824,12 @@ static sal_uInt32 checkMethod(const OUString& keyName,
}
if ( i < nParams1 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Registry1: Method %d contains %d more parameters\n", index, nParams1 - i);
}
if ( i < nParams2 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Registry2: Method %d contains %d more parameters\n", index, nParams2 - i);
}
@@ -1067,11 +839,7 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " nExceptions1 = %d != nExceptions2 = %d\n", nExcep1, nExcep2);
}
nError++;
@@ -1082,11 +850,7 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d, Exception %d: Name1 = %s != Name2 = %s\n", index, i,
U2S(reader1.getMethodExceptionTypeName(index, i)),
U2S(reader2.getMethodExceptionTypeName(index, i)));
@@ -1096,20 +860,12 @@ static sal_uInt32 checkMethod(const OUString& keyName,
}
if ( i < nExcep1 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Registry1: Method %d contains %d more exceptions\n", index, nExcep1 - i);
}
if ( i < nExcep2 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Registry2: Method %d contains %d more exceptions\n", index, nExcep2 - i);
}
@@ -1117,11 +873,7 @@ static sal_uInt32 checkMethod(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d: Mode1 = %s != Mode2 = %s\n", index,
getMethodMode(reader1.getMethodFlags(index)),
getMethodMode(reader2.getMethodFlags(index)));
@@ -1129,16 +881,11 @@ static sal_uInt32 checkMethod(const OUString& keyName,
nError++;
}
- if ( options.fullCheck() &&
- (reader1.getMethodDocumentation(index) != reader2.getMethodDocumentation(index)) )
+ if ( options.fullCheck() && (reader1.getMethodDocumentation(index) != reader2.getMethodDocumentation(index)) )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Method %d: Doku1 = %s\n Doku2 = %s\n", index,
U2S(reader1.getMethodDocumentation(index)),
U2S(reader2.getMethodDocumentation(index)));
@@ -1165,73 +912,54 @@ static char const * getReferenceType(RTReferenceType refType)
}
}
-static sal_uInt32 checkReference(const OUString& keyName,
+static sal_uInt32 checkReference(Options_Impl const & options,
+ const OUString& keyName,
RTTypeClass typeClass,
- sal_Bool& bDump,
+ sal_Bool & bDump,
typereg::Reader& reader1,
typereg::Reader& reader2,
sal_uInt16 index1,
sal_uInt16 index2)
{
sal_uInt32 nError = 0;
- if ( reader1.getReferenceTypeName(index1) !=
- reader2.getReferenceTypeName(index2) )
+ if ( reader1.getReferenceTypeName(index1) != reader2.getReferenceTypeName(index2) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Reference %d: Name1 = %s != Name2 = %s\n", index1,
U2S(reader1.getReferenceTypeName(index1)),
U2S(reader2.getReferenceTypeName(index2)));
}
nError++;
}
- if ( reader1.getReferenceTypeName(index1) !=
- reader2.getReferenceTypeName(index2) )
+ if ( reader1.getReferenceTypeName(index1) != reader2.getReferenceTypeName(index2) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Reference %d: Type1 = %s != Type2 = %s\n", index1,
getReferenceType(reader1.getReferenceSort(index1)),
getReferenceType(reader2.getReferenceSort(index2)));
}
nError++;
}
- if ( options.fullCheck() &&
- (reader1.getReferenceDocumentation(index1) != reader2.getReferenceDocumentation(index2)) )
+ if ( options.fullCheck() && (reader1.getReferenceDocumentation(index1) != reader2.getReferenceDocumentation(index2)) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Reference %d: Doku1 = %s\n Doku2 = %s\n", index1,
U2S(reader1.getReferenceDocumentation(index1)),
U2S(reader2.getReferenceDocumentation(index2)));
}
nError++;
}
- if ( reader1.getReferenceFlags(index1) !=
- reader2.getReferenceFlags(index2) )
+ if ( reader1.getReferenceFlags(index1) != reader2.getReferenceFlags(index2) )
{
if ( options.forceOutput() && !options.unoTypeCheck() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Reference %d: Access1 = %s != Access2 = %s\n", index1,
getFieldAccess(reader1.getReferenceFlags(index1)).getStr(),
getFieldAccess(reader1.getReferenceFlags(index2)).getStr());
@@ -1241,9 +969,10 @@ static sal_uInt32 checkReference(const OUString& keyName,
return nError;
}
-static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
+static sal_uInt32 checkFieldsWithoutOrder(Options_Impl const & options,
+ const OUString& keyName,
RTTypeClass typeClass,
- sal_Bool& bDump,
+ sal_Bool & bDump,
typereg::Reader& reader1,
typereg::Reader& reader2)
{
@@ -1257,13 +986,9 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
- fprintf(stdout, " %s1 contains %d more properties as %s2\n",
- getTypeClass(typeClass), nFields1-nFields2, getTypeClass(typeClass));
+ dumpTypeClass (bDump, typeClass, keyName);
+ fprintf(stdout, " %s1 contains %d more properties as %s2\n",
+ getTypeClass(typeClass), nFields1-nFields2, getTypeClass(typeClass));
}
}
@@ -1274,7 +999,7 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
{
for (j=0; j < nFields2; j++)
{
- if (!checkField(keyName, typeClass, bDump, reader1, reader2, i, j))
+ if (!checkField(options, keyName, typeClass, bDump, reader1, reader2, i, j))
{
bFound = sal_True;
moreProps.insert(j);
@@ -1285,16 +1010,13 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
{
if (options.forceOutput())
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " incompatible change: Field %d ('%s') of r1 is not longer a property of this %s in r2\n",
i, U2S(shortName(reader1.getFieldName(i))), getTypeClass(typeClass));
}
nError++;
- } else
+ }
+ else
{
bFound = sal_False;
}
@@ -1310,12 +1032,10 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
- fprintf(stdout, " incompatible change: Field %d ('%s') of r2 is a new property compared to this %s in r1 and is not 'optional'\n",
+ dumpTypeClass (bDump, typeClass, keyName);
+ fprintf(stdout,
+ " incompatible change: Field %d ('%s') of r2 is a new property"
+ " compared to this %s in r1 and is not 'optional'\n",
j, U2S(shortName(reader2.getFieldName(j))), getTypeClass(typeClass));
}
nError++;
@@ -1327,8 +1047,11 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName,
return nError;
}
-static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, sal_uInt32 size1,
- typereg::Reader& reader2, sal_uInt32 size2)
+static sal_uInt32 checkBlob(
+ Options_Impl const & options,
+ const OUString& keyName,
+ typereg::Reader& reader1, sal_uInt32 size1,
+ typereg::Reader& reader2, sal_uInt32 size2)
{
sal_uInt32 nError = 0;
sal_Bool bDump = sal_True;
@@ -1343,28 +1066,27 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
sal::static_int_cast< unsigned long >(size2));
}
}
- if (reader1.isPublished()) {
- if (!reader2.isPublished()) {
- if (options.forceOutput()) {
- if (bDump) {
- fprintf(stdout, "?: %s\n", U2S(keyName));
- bDump = false;
- }
+ if (reader1.isPublished())
+ {
+ if (!reader2.isPublished())
+ {
+ if (options.forceOutput())
+ {
+ dumpTypeClass(bDump, /*"?"*/ reader1.getTypeClass(), keyName);
fprintf(stdout, " published in 1 but unpublished in 2\n");
}
++nError;
}
- } else if (!options.checkUnpublished()) {
+ }
+ else if (!options.checkUnpublished())
+ {
return nError;
}
if ( reader1.getTypeClass() != reader2.getTypeClass() )
{
if ( options.forceOutput() )
{
- if (bDump) {
- fprintf(stdout, "?: %s\n", U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, /*"?"*/ reader1.getTypeClass(), keyName);
fprintf(stdout, " TypeClass1 = %s != TypeClass2 = %s\n",
getTypeClass(reader1.getTypeClass()),
getTypeClass(reader2.getTypeClass()));
@@ -1373,16 +1095,11 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
}
RTTypeClass typeClass = reader1.getTypeClass();
-
if ( reader1.getTypeName() != reader2.getTypeName() )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " TypeName1 = %s != TypeName2 = %s\n",
U2S(reader1.getTypeName()), U2S(reader2.getTypeName()));
}
@@ -1392,28 +1109,23 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
typeClass == RT_TYPE_STRUCT ||
typeClass == RT_TYPE_EXCEPTION) )
{
- if (reader1.getSuperTypeCount() != reader2.getSuperTypeCount()) {
- if (bDump) {
- fprintf(
- stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = false;
- }
+ if (reader1.getSuperTypeCount() != reader2.getSuperTypeCount())
+ {
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(
stdout, " SuperTypeCount1 = %d != SuperTypeCount2 = %d\n",
static_cast< int >(reader1.getSuperTypeCount()),
static_cast< int >(reader2.getSuperTypeCount()));
++nError;
- } else {
- for (sal_Int16 i = 0; i < reader1.getSuperTypeCount(); ++i) {
+ } else
+ {
+ for (sal_Int16 i = 0; i < reader1.getSuperTypeCount(); ++i)
+ {
if (reader1.getSuperTypeName(i) != reader2.getSuperTypeName(i))
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " SuperTypeName1 = %s != SuperTypeName2 = %s\n",
U2S(reader1.getSuperTypeName(i)), U2S(reader2.getSuperTypeName(i)));
}
@@ -1422,6 +1134,7 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
}
}
}
+
sal_uInt16 nFields1 = (sal_uInt16)reader1.getFieldCount();
sal_uInt16 nFields2 = (sal_uInt16)reader2.getFieldCount();
sal_Bool bCheckNormal = sal_True;
@@ -1439,41 +1152,31 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " nFields1 = %d != nFields2 = %d\n", nFields1, nFields2);
}
nError++;
}
+
sal_uInt16 i;
for (i=0; i < nFields1 && i < nFields2; i++)
{
- nError += checkField(keyName, typeClass, bDump, reader1, reader2, i, i);
+ nError += checkField(options, keyName, typeClass, bDump, reader1, reader2, i, i);
}
if ( i < nFields1 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Registry1 contains %d more fields\n", nFields1 - i);
}
if ( i < nFields2 && options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Registry2 contains %d more fields\n", nFields2 - i);
}
- } else
+ }
+ else
{
- nError += checkFieldsWithoutOrder(keyName, typeClass, bDump, reader1, reader2);
+ nError += checkFieldsWithoutOrder(options, keyName, typeClass, bDump, reader1, reader2);
}
if ( typeClass == RT_TYPE_INTERFACE )
@@ -1484,19 +1187,16 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " nMethods1 = %d != nMethods2 = %d\n", nMethods1, nMethods2);
}
nError++;
}
+
sal_uInt16 i;
for (i=0; i < nMethods1 && i < nMethods2; i++)
{
- nError += checkMethod(keyName, typeClass, bDump, reader1, reader2, i);
+ nError += checkMethod(options, keyName, typeClass, bDump, reader1, reader2, i);
}
if ( i < nMethods1 && options.forceOutput() )
{
@@ -1520,11 +1220,7 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " service1 contains %d more references as service2\n",
nReference1-nReference2);
}
@@ -1537,7 +1233,7 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
for (j=0; j < nReference2; j++)
{
- if (!checkReference(keyName, typeClass, bDump, reader1, reader2, i, j))
+ if (!checkReference(options, keyName, typeClass, bDump, reader1, reader2, i, j))
{
bFound = sal_True;
moreReferences.insert(j);
@@ -1548,16 +1244,15 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if (options.forceOutput())
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
- fprintf(stdout, " incompatible change: Reference %d ('%s') in 'r1' is not longer a reference of this service in 'r2'\n",
+ dumpTypeClass(bDump, typeClass, keyName);
+ fprintf(stdout,
+ " incompatible change: Reference %d ('%s') in 'r1' is not longer a reference"
+ " of this service in 'r2'\n",
i, U2S(shortName(reader1.getReferenceTypeName(i))));
}
nError++;
- } else
+ }
+ else
{
bFound = sal_False;
}
@@ -1573,12 +1268,10 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
- fprintf(stdout, " incompatible change: Reference %d ('%s') of r2 is a new reference compared to this service in r1 and is not 'optional'\n",
+ dumpTypeClass(bDump, typeClass, keyName);
+ fprintf(stdout,
+ " incompatible change: Reference %d ('%s') of r2 is a new reference"
+ " compared to this service in r1 and is not 'optional'\n",
j, U2S(shortName(reader2.getReferenceTypeName(j))));
}
nError++;
@@ -1586,25 +1279,23 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
}
}
}
- } else
+ }
+ else
{
if ( nReference1 != nReference2 )
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " nReferences1 = %d != nReferences2 = %d\n", nReference1, nReference2);
}
nError++;
}
+
sal_uInt16 i;
for (i=0; i < nReference1 && i < nReference2; i++)
{
- nError += checkReference(keyName, typeClass, bDump, reader1, reader2, i, i);
+ nError += checkReference(options, keyName, typeClass, bDump, reader1, reader2, i, i);
}
if ( i < nReference1 && options.forceOutput() )
{
@@ -1621,38 +1312,19 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s
{
if ( options.forceOutput() )
{
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
+ dumpTypeClass(bDump, typeClass, keyName);
fprintf(stdout, " Doku1 = %s\n Doku2 = %s\n",
U2S(reader1.getDocumentation()), U2S(reader2.getDocumentation()));
}
nError++;
}
-/*
- if ( nError &&
- (!keyName.compareTo(OUString::createFromAscii("/UCR/drafts"), 11) ||
- !keyName.compareTo(OUString::createFromAscii("/drafts"), 7)) )
- {
- if ( options.forceOutput() )
- {
- if ( bDump )
- {
- fprintf(stdout, "%s: %s\n", getTypeClass(typeClass), U2S(keyName));
- bDump = sal_False;
- }
- fprintf(stdout, " Note: \"drafts\" type changed incompatible, no effect to the final API\n");
- }
- return 0;
- }
-*/
return nError;
}
-static sal_uInt32 checkValueDifference(RegistryKey& key1, RegValueType valueType1, sal_uInt32 size1,
- RegistryKey& key2, RegValueType valueType2, sal_uInt32 size2)
+static sal_uInt32 checkValueDifference(
+ Options_Impl const & options,
+ RegistryKey& key1, RegValueType valueType1, sal_uInt32 size1,
+ RegistryKey& key2, RegValueType valueType2, sal_uInt32 size2)
{
OUString tmpName;
sal_uInt32 nError = 0;
@@ -1737,39 +1409,31 @@ static sal_uInt32 checkValueDifference(RegistryKey& key1, RegValueType valueType
if ( bEqual)
{
- RegValue value1 = rtl_allocateMemory(size1);
- RegValue value2 = rtl_allocateMemory(size2);
+ std::vector< sal_uInt8 > value1(size1);
+ key1.getValue(tmpName, &value1[0]);
- key1.getValue(tmpName, value1);
- key2.getValue(tmpName, value2);
-
- bEqual = (rtl_compareMemory(value1, value2, size1) == 0 );
+ std::vector< sal_uInt8 > value2(size2);
+ key2.getValue(tmpName, &value2[0]);
+ bEqual = (rtl_compareMemory(&value1[0], &value2[0], value1.size()) == 0 );
if ( !bEqual && valueType1 == RG_VALUETYPE_BINARY && valueType2 == RG_VALUETYPE_BINARY )
{
- typereg::Reader reader1(
- value1, size1, false, TYPEREG_VERSION_1);
- typereg::Reader reader2(
- value2, size2, false, TYPEREG_VERSION_1);
-
+ typereg::Reader reader1(&value1[0], value1.size(), false, TYPEREG_VERSION_1);
+ typereg::Reader reader2(&value2[0], value2.size(), false, TYPEREG_VERSION_1);
if ( reader1.isValid() && reader2.isValid() )
{
- return checkBlob(key1.getName(), reader1, size1, reader2, size2);
+ return checkBlob(options, key1.getName(), reader1, size1, reader2, size2);
}
}
-
- rtl_freeMemory(value1);
- rtl_freeMemory(value2);
-
if ( bEqual )
{
return 0;
- } else
+ }
+ else
{
if ( options.forceOutput() )
{
- fprintf(stdout, "Difference: key values of key \"%s\" are different\n",
- U2S(key1.getName()));
+ fprintf(stdout, "Difference: key values of key \"%s\" are different\n", U2S(key1.getName()));
}
nError++;
}
@@ -1784,102 +1448,98 @@ static sal_uInt32 checkValueDifference(RegistryKey& key1, RegValueType valueType
fprintf(stdout, " Registry 1: key has no value\n");
break;
case RG_VALUETYPE_LONG:
- case RG_VALUETYPE_STRING:
- case RG_VALUETYPE_UNICODE:
- {
- RegValue value1 = rtl_allocateMemory(size1);
- key1.getValue(tmpName, value1);
-
- switch (valueType1)
{
- case RG_VALUETYPE_LONG:
+ std::vector< sal_uInt8 > value1(size1);
+ key1.getValue(tmpName, &value1[0]);
+
fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_LONG\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size1));
- fprintf(stdout, " Data = %p\n", value1);
- break;
- case RG_VALUETYPE_STRING:
+ fprintf(stdout, " Data = %p\n", &value1[0]);
+ }
+ break;
+ case RG_VALUETYPE_STRING:
+ {
+ std::vector< sal_uInt8 > value1(size1);
+ key1.getValue(tmpName, &value1[0]);
+
fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_STRING\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size1));
- fprintf(stdout, " Data = \"%s\"\n", (sal_Char*)value1);
- break;
- case RG_VALUETYPE_UNICODE:
- {
- OUString uStrValue((sal_Unicode*)value1);
+ fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(&value1[0]));
+ }
+ break;
+ case RG_VALUETYPE_UNICODE:
+ {
+ std::vector< sal_uInt8 > value1(size1);
+ key1.getValue(tmpName, &value1[0]);
+
+ OUString uStrValue(reinterpret_cast<sal_Unicode const*>(&value1[0]));
fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_UNICODE\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size1));
fprintf(stdout, " Data = \"%s\"\n", U2S(uStrValue));
- }
- break;
- default:
- OSL_ASSERT(false);
- break;
}
-
- rtl_freeMemory(value1);
- }
break;
case RG_VALUETYPE_BINARY:
fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_BINARY\n");
break;
case RG_VALUETYPE_LONGLIST:
{
- RegistryValueList<sal_Int32> valueList;
- key1.getLongListValue(tmpName, valueList);
- fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_LONGLIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size1));
- sal_uInt32 length = valueList.getLength();
- for (sal_uInt32 i=0; i<length; i++)
- {
+ RegistryValueList<sal_Int32> valueList;
+ key1.getLongListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_LONGLIST\n");
fprintf(
- stdout, " Data[%lu] = %ld\n",
- sal::static_int_cast< unsigned long >(i),
- sal::static_int_cast< long >(valueList.getElement(i)));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size1));
+ sal_uInt32 length = valueList.getLength();
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ fprintf(
+ stdout, " Data[%lu] = %ld\n",
+ sal::static_int_cast< unsigned long >(i),
+ sal::static_int_cast< long >(valueList.getElement(i)));
+ }
}
break;
case RG_VALUETYPE_STRINGLIST:
{
- RegistryValueList<sal_Char*> valueList;
- key1.getStringListValue(tmpName, valueList);
- fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_STRINGLIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size1));
- sal_uInt32 length = valueList.getLength();
- for (sal_uInt32 i=0; i<length; i++)
- {
+ RegistryValueList<sal_Char*> valueList;
+ key1.getStringListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_STRINGLIST\n");
fprintf(
- stdout, " Data[%lu] = \"%s\"\n",
- sal::static_int_cast< unsigned long >(i),
- valueList.getElement(i));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size1));
+ sal_uInt32 length = valueList.getLength();
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ fprintf(
+ stdout, " Data[%lu] = \"%s\"\n",
+ sal::static_int_cast< unsigned long >(i),
+ valueList.getElement(i));
+ }
}
break;
case RG_VALUETYPE_UNICODELIST:
{
- RegistryValueList<sal_Unicode*> valueList;
- key1.getUnicodeListValue(tmpName, valueList);
- fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_UNICODELIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size1));
- sal_uInt32 length = valueList.getLength();
- OUString uStrValue;
- for (sal_uInt32 i=0; i<length; i++)
- {
- uStrValue = OUString(valueList.getElement(i));
+ RegistryValueList<sal_Unicode*> valueList;
+ key1.getUnicodeListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 1: Value: Type = RG_VALUETYPE_UNICODELIST\n");
fprintf(
- stdout, " Data[%lu] = \"%s\"\n",
- sal::static_int_cast< unsigned long >(i), U2S(uStrValue));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size1));
+ sal_uInt32 length = valueList.getLength();
+ OUString uStrValue;
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ uStrValue = OUString(valueList.getElement(i));
+ fprintf(
+ stdout, " Data[%lu] = \"%s\"\n",
+ sal::static_int_cast< unsigned long >(i), U2S(uStrValue));
+ }
}
break;
}
@@ -1890,102 +1550,98 @@ static sal_uInt32 checkValueDifference(RegistryKey& key1, RegValueType valueType
fprintf(stdout, " Registry 2: key has no value\n");
break;
case RG_VALUETYPE_LONG:
- case RG_VALUETYPE_STRING:
- case RG_VALUETYPE_UNICODE:
- {
- RegValue value2 = rtl_allocateMemory(size2);
- key2.getValue(tmpName, value2);
-
- switch (valueType2)
{
- case RG_VALUETYPE_LONG:
+ std::vector< sal_uInt8 > value2(size2);
+ key2.getValue(tmpName, &value2[0]);
+
fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_LONG\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size2));
- fprintf(stdout, " Data = %p\n", value2);
- break;
- case RG_VALUETYPE_STRING:
+ fprintf(stdout, " Data = %p\n", &value2[0]);
+ }
+ break;
+ case RG_VALUETYPE_STRING:
+ {
+ std::vector< sal_uInt8 > value2(size2);
+ key2.getValue(tmpName, &value2[0]);
+
fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_STRING\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size2));
- fprintf(stdout, " Data = \"%s\"\n", (sal_Char*)value2);
- break;
- case RG_VALUETYPE_UNICODE:
- {
- OUString uStrValue((sal_Unicode*)value2);
+ fprintf(stdout, " Data = \"%s\"\n", reinterpret_cast<char const*>(&value2[0]));
+ }
+ break;
+ case RG_VALUETYPE_UNICODE:
+ {
+ std::vector< sal_uInt8 > value2(size2);
+ key2.getValue(tmpName, &value2[0]);
+
+ OUString uStrValue(reinterpret_cast<sal_Unicode const*>(&value2[0]));
fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_UNICODE\n");
fprintf(
stdout, " Size = %lu\n",
sal::static_int_cast< unsigned long >(size2));
fprintf(stdout, " Data = \"%s\"\n", U2S(uStrValue));
- }
- break;
- default:
- OSL_ASSERT(false);
- break;
}
-
- rtl_freeMemory(value2);
- }
break;
case RG_VALUETYPE_BINARY:
fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_BINARY\n");
break;
case RG_VALUETYPE_LONGLIST:
{
- RegistryValueList<sal_Int32> valueList;
- key2.getLongListValue(tmpName, valueList);
- fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_LONGLIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size2));
- sal_uInt32 length = valueList.getLength();
- for (sal_uInt32 i=0; i<length; i++)
- {
+ RegistryValueList<sal_Int32> valueList;
+ key2.getLongListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_LONGLIST\n");
fprintf(
- stdout, " Data[%lu] = %ld\n",
- sal::static_int_cast< unsigned long >(i),
- sal::static_int_cast< long >(valueList.getElement(i)));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size2));
+ sal_uInt32 length = valueList.getLength();
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ fprintf(
+ stdout, " Data[%lu] = %ld\n",
+ sal::static_int_cast< unsigned long >(i),
+ sal::static_int_cast< long >(valueList.getElement(i)));
+ }
}
break;
case RG_VALUETYPE_STRINGLIST:
{
- RegistryValueList<sal_Char*> valueList;
- key2.getStringListValue(tmpName, valueList);
- fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_STRINGLIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size2));
- sal_uInt32 length = valueList.getLength();
- for (sal_uInt32 i=0; i<length; i++)
- {
+ RegistryValueList<sal_Char*> valueList;
+ key2.getStringListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_STRINGLIST\n");
fprintf(
- stdout, " Data[%lu] = \"%s\"\n",
- sal::static_int_cast< unsigned long >(i),
- valueList.getElement(i));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size2));
+ sal_uInt32 length = valueList.getLength();
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ fprintf(
+ stdout, " Data[%lu] = \"%s\"\n",
+ sal::static_int_cast< unsigned long >(i),
+ valueList.getElement(i));
+ }
}
break;
case RG_VALUETYPE_UNICODELIST:
{
- RegistryValueList<sal_Unicode*> valueList;
- key2.getUnicodeListValue(tmpName, valueList);
- fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_UNICODELIST\n");
- fprintf(
- stdout, " Size = %lu\n",
- sal::static_int_cast< unsigned long >(size2));
- sal_uInt32 length = valueList.getLength();
- OUString uStrValue;
- for (sal_uInt32 i=0; i<length; i++)
- {
- uStrValue = OUString(valueList.getElement(i));
+ RegistryValueList<sal_Unicode*> valueList;
+ key2.getUnicodeListValue(tmpName, valueList);
+ fprintf(stdout, " Registry 2: Value: Type = RG_VALUETYPE_UNICODELIST\n");
fprintf(
- stdout, " Data[%lu] = \"%s\"\n",
- sal::static_int_cast< unsigned long >(i), U2S(uStrValue));
- }
+ stdout, " Size = %lu\n",
+ sal::static_int_cast< unsigned long >(size2));
+ sal_uInt32 length = valueList.getLength();
+ OUString uStrValue;
+ for (sal_uInt32 i=0; i<length; i++)
+ {
+ uStrValue = OUString(valueList.getElement(i));
+ fprintf(
+ stdout, " Data[%lu] = \"%s\"\n",
+ sal::static_int_cast< unsigned long >(i), U2S(uStrValue));
+ }
}
break;
}
@@ -1993,58 +1649,67 @@ static sal_uInt32 checkValueDifference(RegistryKey& key1, RegValueType valueType
return nError;
}
-static bool hasPublishedChildren(RegistryKey & key) {
+static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key)
+{
RegistryKeyNames subKeyNames;
key.getKeyNames(rtl::OUString(), subKeyNames);
- for (sal_uInt32 i = 0; i < subKeyNames.getLength(); ++i) {
+ for (sal_uInt32 i = 0; i < subKeyNames.getLength(); ++i)
+ {
rtl::OUString keyName(subKeyNames.getElement(i));
- if (!options.matchedWithExcludeKey(keyName)) {
+ if (!options.matchedWithExcludeKey(keyName))
+ {
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
RegistryKey subKey;
- if (!key.openKey(keyName, subKey)) {
- if (options.forceOutput()) {
+ if (!key.openKey(keyName, subKey))
+ {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("WARNING: could not open key \"%s\" in registry"
" \"%s\"\n"),
U2S(subKeyNames.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
}
- if (subKey.isValid()) {
+ if (subKey.isValid())
+ {
RegValueType type;
sal_uInt32 size;
- if (subKey.getValueInfo(rtl::OUString(), &type, &size)
- != REG_NO_ERROR)
+ if (subKey.getValueInfo(rtl::OUString(), &type, &size) != REG_NO_ERROR)
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("WARNING: could not read key \"%s\" in registry"
" \"%s\"\n"),
U2S(subKeyNames.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
- } else if (type == RG_VALUETYPE_BINARY) {
- char * value = new char[size];
+ }
+ else if (type == RG_VALUETYPE_BINARY)
+ {
bool published = false;
- if (subKey.getValue(rtl::OUString(), value) != REG_NO_ERROR)
+ std::vector< sal_uInt8 > value(size);
+ if (subKey.getValue(rtl::OUString(), &value[0]) != REG_NO_ERROR)
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("WARNING: could not read key \"%s\" in"
" registry \"%s\"\n"),
U2S(subKeyNames.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
- } else {
- published = typereg::Reader(
- value, size, false, TYPEREG_VERSION_1).
- isPublished();
}
- delete[] value;
- if (published) {
+ else
+ {
+ published = typereg::Reader(&value[0], value.size(), false, TYPEREG_VERSION_1).isPublished();
+ }
+ if (published)
+ {
return true;
}
}
@@ -2055,7 +1720,9 @@ static bool hasPublishedChildren(RegistryKey & key) {
}
static sal_uInt32 checkDifferences(
- RegistryKey& key, StringSet& keys, RegistryKeyNames& subKeyNames1,
+ Options_Impl const & options,
+ RegistryKey& key, StringSet& keys,
+ RegistryKeyNames& subKeyNames1,
RegistryKeyNames& subKeyNames2)
{
sal_uInt32 nError = 0;
@@ -2082,81 +1749,89 @@ static sal_uInt32 checkDifferences(
if ( options.forceOutput() )
{
fprintf(stdout, "EXISTENCE: key \"%s\" exists only in registry \"%s\"\n",
- U2S(subKeyNames1.getElement(i)), options.getRegName1().getStr());
+ U2S(subKeyNames1.getElement(i)), options.getRegName1().c_str());
}
nError++;
}
else
{
rtl::OUString keyName(subKeyNames1.getElement(i));
- if (!options.matchedWithExcludeKey(keyName)) {
+ if (!options.matchedWithExcludeKey(keyName))
+ {
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
RegistryKey subKey;
- if (key.openKey(keyName, subKey)) {
- if (options.forceOutput()) {
+ if (key.openKey(keyName, subKey))
+ {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("ERROR: could not open key \"%s\" in registry"
" \"%s\"\n"),
U2S(subKeyNames1.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
++nError;
}
- if (subKey.isValid()) {
+ if (subKey.isValid())
+ {
RegValueType type;
sal_uInt32 size;
- if (subKey.getValueInfo(rtl::OUString(), &type, &size)
- != REG_NO_ERROR)
+ if (subKey.getValueInfo(rtl::OUString(), &type, &size) != REG_NO_ERROR)
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("ERROR: could not read key \"%s\" in"
" registry \"%s\"\n"),
U2S(subKeyNames1.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
++nError;
- } else if (type == RG_VALUETYPE_BINARY) {
- char * value = new char[size];
- if (subKey.getValue(rtl::OUString(), value)
- != REG_NO_ERROR)
+ }
+ else if (type == RG_VALUETYPE_BINARY)
+ {
+ std::vector< sal_uInt8 > value(size);
+ if (subKey.getValue(rtl::OUString(), &value[0]) != REG_NO_ERROR)
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("ERROR: could not read key \"%s\" in"
" registry \"%s\"\n"),
U2S(subKeyNames1.getElement(i)),
- options.getRegName1().getStr());
+ options.getRegName1().c_str());
}
++nError;
- } else {
- typereg::Reader reader(
- value, size, false, TYPEREG_VERSION_1);
- if (reader.getTypeClass() == RT_TYPE_MODULE) {
- if (options.checkUnpublished()
- || hasPublishedChildren(subKey))
+ }
+ else
+ {
+ typereg::Reader reader(&value[0], value.size(), false, TYPEREG_VERSION_1);
+ if (reader.getTypeClass() == RT_TYPE_MODULE)
+ {
+ if (options.checkUnpublished() || hasPublishedChildren(options, subKey))
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("EXISTENCE: module \"%s\""
" %sexists only in registry"
" 1\n"),
- U2S(subKeyNames1.getElement(
- i)),
+ U2S(subKeyNames1.getElement(i)),
(options.checkUnpublished()
? ""
: "with published children "));
}
++nError;
}
- } else if (options.checkUnpublished()
- || reader.isPublished())
+ }
+ else if (options.checkUnpublished() || reader.isPublished())
{
- if (options.forceOutput()) {
+ if (options.forceOutput())
+ {
fprintf(
stdout,
("EXISTENCE: %spublished key \"%s\""
@@ -2167,7 +1842,6 @@ static sal_uInt32 checkDifferences(
++nError;
}
}
- delete[] value;
}
}
}
@@ -2192,7 +1866,7 @@ static sal_uInt32 checkDifferences(
if ( options.forceOutput() )
{
fprintf(stdout, "EXISTENCE: key \"%s\" exists only in registry \"%s\"\n",
- U2S(subKeyNames2.getElement(i)), options.getRegName2().getStr());
+ U2S(subKeyNames2.getElement(i)), options.getRegName2().c_str());
}
nError++;
}
@@ -2200,7 +1874,10 @@ static sal_uInt32 checkDifferences(
return nError;
}
-static sal_uInt32 compareKeys(RegistryKey& key1, RegistryKey& key2)
+static sal_uInt32 compareKeys(
+ Options_Impl const & options,
+ RegistryKey& key1,
+ RegistryKey& key2)
{
sal_uInt32 nError = 0;
@@ -2208,16 +1885,17 @@ static sal_uInt32 compareKeys(RegistryKey& key1, RegistryKey& key2)
RegValueType valueType2 = RG_VALUETYPE_NOT_DEFINED;
sal_uInt32 size1 = 0;
sal_uInt32 size2 = 0;
+
OUString tmpName;
RegError e1 = key1.getValueInfo(tmpName, &valueType1, &size1);
RegError e2 = key2.getValueInfo(tmpName, &valueType2, &size2);
-
- if ( e1 == e2 && e1 != REG_VALUE_NOT_EXISTS && e1 != REG_INVALID_VALUE )
+ if ( (e1 == e2) && (e1 != REG_VALUE_NOT_EXISTS) && (e1 != REG_INVALID_VALUE) )
{
- nError += checkValueDifference(key1, valueType1, size1, key2, valueType2, size2);
- } else
+ nError += checkValueDifference(options, key1, valueType1, size1, key2, valueType2, size2);
+ }
+ else
{
- if ( e1 != REG_INVALID_VALUE || e2 != REG_INVALID_VALUE )
+ if ( (e1 != REG_INVALID_VALUE) || (e2 != REG_INVALID_VALUE) )
{
if ( options.forceOutput() )
{
@@ -2234,16 +1912,14 @@ static sal_uInt32 compareKeys(RegistryKey& key1, RegistryKey& key2)
key2.getKeyNames(tmpName, subKeyNames2);
StringSet keys;
- nError += checkDifferences(key1, keys, subKeyNames1, subKeyNames2);
+ nError += checkDifferences(options, key1, keys, subKeyNames1, subKeyNames2);
StringSet::iterator iter = keys.begin();
StringSet::iterator end = keys.end();
- RegistryKey subKey1, subKey2;
- OUString keyName;
while ( iter != end )
{
- keyName = OUString(*iter);
+ OUString keyName(*iter);
if ( options.matchedWithExcludeKey(keyName) )
{
++iter;
@@ -2252,30 +1928,33 @@ static sal_uInt32 compareKeys(RegistryKey& key1, RegistryKey& key2)
sal_Int32 nPos = keyName.lastIndexOf( '/' );
keyName = keyName.copy( nPos != -1 ? nPos+1 : 0 );
+
+ RegistryKey subKey1;
if ( key1.openKey(keyName, subKey1) )
{
if ( options.forceOutput() )
{
fprintf(stdout, "ERROR: could not open key \"%s\" in registry \"%s\"\n",
- U2S(*iter), options.getRegName1().getStr());
+ U2S(*iter), options.getRegName1().c_str());
}
nError++;
}
+
+ RegistryKey subKey2;
if ( key2.openKey(keyName, subKey2) )
{
if ( options.forceOutput() )
{
fprintf(stdout, "ERROR: could not open key \"%s\" in registry \"%s\"\n",
- U2S(*iter), options.getRegName2().getStr());
+ U2S(*iter), options.getRegName2().c_str());
}
nError++;
}
+
if ( subKey1.isValid() && subKey2.isValid() )
{
- nError += compareKeys(subKey1, subKey2);
+ nError += compareKeys(options, subKey1, subKey2);
}
- subKey1.releaseKey();
- subKey2.releaseKey();
++iter;
}
@@ -2288,93 +1967,107 @@ int main( int argc, char * argv[] )
int _cdecl main( int argc, char * argv[] )
#endif
{
- if ( !options.initOptions(argc, argv) )
+ std::vector< std::string > args;
+
+ Options_Impl options(argv[0]);
+ for (int i = 1; i < argc; i++)
{
- exit(1);
+ if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ {
+ // failure.
+ options.printUsage();
+ return (1);
+ }
+ }
+ if (!options.initOptions(args))
+ {
+ return (1);
}
- OUString regName1( convertToFileUrl(options.getRegName1()) );
- OUString regName2( convertToFileUrl(options.getRegName2()) );
-
- Registry reg1;
- Registry reg2;
+ OUString regName1( convertToFileUrl(options.getRegName1().c_str(), options.getRegName1().size()) );
+ OUString regName2( convertToFileUrl(options.getRegName2().c_str(), options.getRegName2().size()) );
+ Registry reg1, reg2;
if ( reg1.open(regName1, REG_READONLY) )
{
fprintf(stdout, "%s: open registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName1().getStr());
- exit(2);
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return (2);
}
if ( reg2.open(regName2, REG_READONLY) )
{
fprintf(stdout, "%s: open registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName2().getStr());
- exit(3);
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return (3);
}
RegistryKey key1, key2;
if ( reg1.openRootKey(key1) )
{
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName1().getStr());
- exit(4);
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return (4);
}
if ( reg2.openRootKey(key2) )
{
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName2().getStr());
- exit(5);
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return (5);
}
+
if ( options.isStartKeyValid() )
{
- if ( options.matchedWithExcludeKey( S2U(options.getStartKey()) ) )
+ if ( options.matchedWithExcludeKey( options.getStartKey() ) )
{
fprintf(stdout, "%s: start key is equal to one of the exclude keys\n",
- options.getProgramName().getStr());
- exit(6);
+ options.getProgramName().c_str());
+ return (6);
}
RegistryKey sk1, sk2;
- if ( key1.openKey(S2U(options.getStartKey()), sk1) )
+ if ( key1.openKey(options.getStartKey(), sk1) )
{
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName1().getStr());
- exit(7);
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return (7);
}
- if ( key2.openKey(S2U(options.getStartKey()), sk2) )
+ if ( key2.openKey(options.getStartKey(), sk2) )
{
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName2().getStr());
- exit(8);
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return (8);
}
key1 = sk1;
key2 = sk2;
}
- sal_uInt32 nError = compareKeys(key1, key2);
+ sal_uInt32 nError = compareKeys(options, key1, key2);
if ( nError )
{
if ( options.unoTypeCheck() )
{
fprintf(stdout, "%s: registries are incompatible: %lu differences!\n",
- options.getProgramName().getStr(),
+ options.getProgramName().c_str(),
sal::static_int_cast< unsigned long >(nError));
- } else
+ }
+ else
{
fprintf(stdout, "%s: registries contain %lu differences!\n",
- options.getProgramName().getStr(),
+ options.getProgramName().c_str(),
sal::static_int_cast< unsigned long >(nError));
}
- } else
+ }
+ else
{
if ( options.unoTypeCheck() )
{
fprintf(stdout, "%s: registries are compatible!\n",
- options.getProgramName().getStr());
- } else
+ options.getProgramName().c_str());
+ }
+ else
{
fprintf(stdout, "%s: registries are equal!\n",
- options.getProgramName().getStr());
+ options.getProgramName().c_str());
}
}
@@ -2383,17 +2076,15 @@ int _cdecl main( int argc, char * argv[] )
if ( reg1.close() )
{
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName1().getStr());
- exit(9);
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return (9);
}
if ( reg2.close() )
{
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().getStr(), options.getRegName2().getStr());
- exit(10);
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return (10);
}
- return nError > 0 ? 11 : 0;
+ return ((nError > 0) ? 11 : 0);
}
-
-
diff --git a/registry/tools/regmerge.cxx b/registry/tools/regmerge.cxx
index 06786a9b993e..6ca47a18c795 100644
--- a/registry/tools/regmerge.cxx
+++ b/registry/tools/regmerge.cxx
@@ -28,70 +28,35 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_registry.hxx"
-#include <stdio.h>
-#include <string.h>
-
#include "registry/registry.hxx"
-#include <rtl/ustring.hxx>
-#include <rtl/alloc.h>
-#include <osl/process.h>
-#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
+#include "fileurl.hxx"
+#include "options.hxx"
-#ifdef SAL_UNX
-#define SEPARATOR '/'
-#else
-#define SEPARATOR '\\'
-#endif
+#include "rtl/ustring.hxx"
+#include "osl/diagnose.h"
-using namespace ::rtl;
-using namespace ::osl;
+#include <stdio.h>
+#include <string.h>
-sal_Bool isFileUrl(const OString& fileName)
-{
- if (fileName.indexOf("file://") == 0 )
- return sal_True;
- return sal_False;
-}
+using namespace rtl;
+using namespace registry::tools;
-OUString convertToFileUrl(const OString& fileName)
+class Options_Impl : public Options
{
- if ( isFileUrl(fileName) )
- {
- return OStringToOUString(fileName, osl_getThreadTextEncoding());
- }
-
- OUString uUrlFileName;
- OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
- if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
- {
- OUString uWorkingDir;
- if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
- {
- OSL_ASSERT(false);
- }
- if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- } else
- {
- if (FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- }
+ bool m_bVerbose;
- return uUrlFileName;
-}
+public:
+ explicit Options_Impl (char const * program)
+ : Options(program), m_bVerbose(false)
+ {}
+ bool isVerbose() const { return m_bVerbose; }
-int realargc;
-char* realargv[2048];
+protected:
+ virtual void printUsage_Impl() const;
+ virtual bool initOptions_Impl(std::vector< std::string > & rArgs);
+};
-static void dumpHelp()
+void Options_Impl::printUsage_Impl() const
{
fprintf(stderr, "using: regmerge [-v|--verbose] mergefile mergeKeyName regfile_1 ... regfile_n\n");
fprintf(stderr, " regmerge @regcmds\nOptions:\n");
@@ -103,180 +68,112 @@ static void dumpHelp()
fprintf(stderr, " regfile_1..n : specifies one or more registry files which are merged.\n");
}
-static bool checkCommandFile(char* cmdfile)
+bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs)
{
- FILE *commandfile;
- char option[256];
- bool bVerbose = false;
-
- commandfile = fopen(cmdfile+1, "r");
- if( commandfile == NULL )
- {
- fprintf(stderr, "ERROR: Can't open command file \"%s\"\n", cmdfile);
- } else
+ std::vector< std::string >::iterator first = rArgs.begin(), last = rArgs.end();
+ if ((first != last) && ((*first)[0] == '-'))
{
- while ( fscanf(commandfile, "%s", option) != EOF )
+ std::string option(*first);
+ if ((option.compare("-v") == 0) || (option.compare("--verbose") == 0))
{
- if (option[0]== '@')
- {
- bool bRet = checkCommandFile(option);
- // ensure that the option will not be overwritten
- if ( !bRet )
- bVerbose = bRet;
- } else {
- if (option[0]== '-') {
- if (strncmp(option, "-v", 2) == 0 ||
- strncmp(option, "--verbose", 9) == 0)
- {
- bVerbose = true;
- } else {
- fprintf(stderr, "ERROR: unknown option \"%s\"\n", option);
- dumpHelp();
- exit(-1);
- }
- }else
- {
- realargv[realargc]= strdup(option);
- realargc++;
- }
- }
- if (realargc == 2047)
- {
- fprintf(stderr, "ERROR: more than 2048 arguments.\n");
- break;
- }
+ m_bVerbose = true;
}
- fclose(commandfile);
- }
-
- return bVerbose;
-}
-
-static bool checkCommandArgs(int argc, char **argv)
-{
- bool bVerbose = false;
-
- realargc = 0;
-
- for (int i=0; i<argc; i++)
- {
- if (argv[i][0]== '@')
+ else if ((option.compare("-h") == 0) || (option.compare("-?") == 0))
{
- bool bRet = checkCommandFile(argv[i]);
- // ensure that the option will not be overwritten
- if ( !bRet )
- bVerbose = bRet;
- } else {
- if (argv[i][0]== '-') {
- if (strncmp(argv[i], "-v", 2) == 0 ||
- strncmp(argv[i], "--verbose", 9) == 0)
- {
- bVerbose = true;
- } else {
- fprintf(stderr, "ERROR: unknown option \"%s\"\n", argv[i]);
- dumpHelp();
- exit(-1);
- }
- } else
- {
- realargv[realargc]= strdup(argv[i]);
- realargc++;
- }
+ return printUsage();
}
+ else
+ {
+ return badOption("unknown", option.c_str());
+ }
+ (void) rArgs.erase(first);
}
-
- return bVerbose;
-}
-
-static void cleanCommandArgs()
-{
- for (int i=0; i<realargc; i++)
- {
- free(realargv[i]);
- }
+ return true;
}
-
-
#if (defined UNX) || (defined OS2)
int main( int argc, char * argv[] )
#else
int _cdecl main( int argc, char * argv[] )
#endif
{
- bool bVerbose = checkCommandArgs(argc, argv);
+ Options_Impl options(argv[0]);
- if (realargc < 4)
+ std::vector< std::string > args;
+ for (int i = 1; i < argc; i++)
{
- dumpHelp();
- cleanCommandArgs();
- exit(1);
+ if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ {
+ options.printUsage();
+ return (1);
+ }
+ }
+ if (!options.initOptions(args))
+ {
+ return (1);
+ }
+ if (args.size() < 3)
+ {
+ options.printUsage();
+ return (1);
}
-
- ::rtl::OUString regName( convertToFileUrl(realargv[1]) );
Registry reg;
+ OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) );
if (reg.open(regName, REG_READWRITE) != REG_NO_ERROR)
{
if (reg.create(regName) != REG_NO_ERROR)
{
- if (bVerbose)
- fprintf(stderr, "open registry \"%s\" failed\n", realargv[1]);
- cleanCommandArgs();
- exit(-1);
+ if (options.isVerbose())
+ fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str());
+ return (-1);
}
}
RegistryKey rootKey;
- if (reg.openRootKey(rootKey) == REG_NO_ERROR)
+ if (reg.openRootKey(rootKey) != REG_NO_ERROR)
{
- ::rtl::OUString mergeKeyName( ::rtl::OUString::createFromAscii(realargv[2]) );
- ::rtl::OUString targetRegName;
- for (int i = 3; i < realargc; i++)
+ if (options.isVerbose())
+ fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str());
+ return (-4);
+ }
+
+ OUString mergeKeyName( OUString::createFromAscii(args[1].c_str()) );
+ for (size_t i = 2; i < args.size(); i++)
+ {
+ OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) );
+ RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, sal_False, options.isVerbose());
+ if (_ret != REG_NO_ERROR)
{
- targetRegName = convertToFileUrl(realargv[i]);
- RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, sal_False, bVerbose);
- if (_ret != REG_NO_ERROR)
- {
- if (_ret == REG_MERGE_CONFLICT)
- {
- if (bVerbose)
- fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
- realargv[i], realargv[2], realargv[1]);
- } else
- {
- if (bVerbose)
- fprintf(stderr, "ERROR: merging registry \"%s\" under key \"%s\" in registry \"%s\" failed.\n",
- realargv[i], realargv[2], realargv[1]);
- exit(-2);
- }
- } else
+ if (_ret == REG_MERGE_CONFLICT)
{
- if (bVerbose)
+ if (options.isVerbose())
fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
- realargv[i], realargv[2], realargv[1]);
+ args[i].c_str(), args[1].c_str(), args[0].c_str());
+ }
+ else
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "ERROR: merging registry \"%s\" under key \"%s\" in registry \"%s\" failed.\n",
+ args[i].c_str(), args[1].c_str(), args[0].c_str());
+ return (-2);
}
}
-
- rootKey.releaseKey();
- } else
- {
- if (bVerbose)
- fprintf(stderr, "open root key of registry \"%s\" failed\n",
- realargv[1]);
- exit(-4);
+ else
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
+ args[i].c_str(), args[1].c_str(), args[0].c_str());
+ }
}
+ rootKey.releaseKey();
if (reg.close() != REG_NO_ERROR)
{
- if (bVerbose)
- fprintf(stderr, "closing registry \"%s\" failed\n", realargv[1]);
- cleanCommandArgs();
- exit(-5);
+ if (options.isVerbose())
+ fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str());
+ return (-5);
}
- cleanCommandArgs();
return(0);
}
-
-
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index 4e478e8985db..4c588449a1d8 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -28,65 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_registry.hxx"
-#include <stdio.h>
-
#include "registry/registry.h"
-#include <rtl/ustring.hxx>
-#include <rtl/alloc.h>
-#include <osl/process.h>
-#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
-
-#ifdef SAL_UNX
-#define SEPARATOR '/'
-#else
-#define SEPARATOR '\\'
-#endif
-
-using namespace ::rtl;
-using namespace ::osl;
-
-sal_Bool isFileUrl(const OString& fileName)
-{
- if (fileName.indexOf("file://") == 0 )
- return sal_True;
- return sal_False;
-}
+#include "fileurl.hxx"
-OUString convertToFileUrl(const OString& fileName)
-{
- if ( isFileUrl(fileName) )
- {
- return OStringToOUString(fileName, osl_getThreadTextEncoding());
- }
+#include "rtl/ustring.hxx"
- OUString uUrlFileName;
- OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
- if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
- {
- OUString uWorkingDir;
- if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None)
- {
- OSL_ASSERT(false);
- }
- if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- } else
- {
- if (FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName)
- != FileBase::E_None)
- {
- OSL_ASSERT(false);
- }
- }
-
- return uUrlFileName;
-}
+#include <stdio.h>
+#include <string.h>
+using rtl::OUString;
+using namespace registry::tools;
#if (defined UNX) || (defined OS2)
int main( int argc, char * argv[] )
@@ -103,7 +54,7 @@ int _cdecl main( int argc, char * argv[] )
exit(1);
}
- OUString regName( convertToFileUrl(argv[1]) );
+ OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
if (reg_openRegistry(regName.pData, &hReg, REG_READONLY))
{
fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
@@ -127,12 +78,14 @@ int _cdecl main( int argc, char * argv[] )
fprintf(stderr, "closing key \"%s\" of registry \"%s\" failed\n",
argv[2], argv[1]);
}
- } else
+ }
+ else
{
fprintf(stderr, "key \"%s\" not exists in registry \"%s\"\n",
argv[2], argv[1]);
}
- } else
+ }
+ else
{
if (reg_dumpRegistry(hRootKey))
{
@@ -144,7 +97,8 @@ int _cdecl main( int argc, char * argv[] )
{
fprintf(stderr, "closing root key of registry \"%s\" failed\n", argv[1]);
}
- } else
+ }
+ else
{
fprintf(stderr, "open root key of registry \"%s\" failed\n", argv[1]);
}
diff --git a/rhino/makefile.mk b/rhino/makefile.mk
index 008fb0caef2d..88aad4ff1ac8 100755
--- a/rhino/makefile.mk
+++ b/rhino/makefile.mk
@@ -46,7 +46,8 @@ ADDITIONAL_FILES= \
toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java
PATCH_FILES=rhino1_5R5.patch \
- rhino1_5R5-find_swing.patch
+ rhino1_5R5-find_swing.patch \
+ rhino1_5R5-updateToolTip.patch
.IF "$(JAVACISGCJ)"=="yes"
JAVA_HOME=
diff --git a/rhino/rhino1_5R5-updateToolTip.patch b/rhino/rhino1_5R5-updateToolTip.patch
new file mode 100644
index 000000000000..16857d35fca6
--- /dev/null
+++ b/rhino/rhino1_5R5-updateToolTip.patch
@@ -0,0 +1,23 @@
+--- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:09 2011
++++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:01 2011
+@@ -1045,9 +1045,18 @@
+ } );
+ }
+
++ // Fix taken from <ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip>
++ // toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java:
+ private void updateToolTip() {
+- // in case fileName is very long, try to set tool tip on frame
+- Component c = getComponent(1);
++ // Try to set tool tip on frame. On Mac OS X 10.5,
++ // the number of components is different, so try to be safe.
++ int n = getComponentCount() - 1;
++ if (n > 1) {
++ n = 1;
++ } else if (n < 0) {
++ return;
++ }
++ Component c = getComponent(n);
+ // this will work at least for Metal L&F
+ if (c != null && c instanceof JComponent) {
+ ((JComponent)c).setToolTipText(getUrl());
diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx
index f666058617f8..f554040c4ec9 100644
--- a/rsc/source/tools/rscchar.cxx
+++ b/rsc/source/tools/rscchar.cxx
@@ -55,13 +55,13 @@
*************************************************************************/
char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
{
- sal_Size nMaxUniCodeBuf = strlen( pStr ) + 1;
- char * pOrgStr = new char[ nMaxUniCodeBuf ];
- sal_uInt32 nOrgLen = 0;
-
+ sal_Size nMaxUniCodeBuf = strlen( pStr ) + 1;
if( nMaxUniCodeBuf * 6 > 0x0FFFFF )
RscExit( 10 );
+ char * pOrgStr = new char[ nMaxUniCodeBuf ];
+ sal_uInt32 nOrgLen = 0;
+
char cOld = '1';
while( cOld != 0 )
{
@@ -119,9 +119,8 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
}
if( nChar > 255 )
{
- rtl_freeMemory( pOrgStr );
-
// Wert zu gross, oder kein 3 Ziffern
+ delete [] pOrgStr;
return( NULL );
}
c = (char)nChar;
@@ -174,6 +173,7 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
&nSrcCvtBytes );
rtl_destroyTextToUnicodeConverter( hConv );
+ delete[] pOrgStr, pOrgStr = 0;
hConv = rtl_createUnicodeToTextConverter( RTL_TEXTENCODING_UTF8 );
// factor fo 6 is the maximum size of an UNICODE character as utf8
@@ -188,9 +188,7 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
&nSrcCvtBytes );
rtl_destroyTextToUnicodeConverter( hConv );
-
- delete[] pUniCode;
- delete[] pOrgStr;
+ delete[] pUniCode, pUniCode = 0;
return pUtf8;
};
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index cc0c041bc328..67f1d05660a8 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -215,7 +215,8 @@ FileHandle_Impl::Allocator::~Allocator()
void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * pnSize)
{
OSL_PRECOND((0 != ppBuffer) && (0 != pnSize), "FileHandle_Impl::Allocator::allocate(): contract violation");
- *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)), *pnSize = m_bufsiz;
+ if ((0 != ppBuffer) && (0 != pnSize))
+ *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)), *pnSize = m_bufsiz;
}
void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
{
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 452d3eb2db70..2ed57b01a2c4 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -334,10 +334,8 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto
rtl_uString* ustrSystemPath = NULL;
oslFileError osl_error = osl_File_E_INVAL;
- OSL_ASSERT(ustrFileURL);
- OSL_ASSERT(pItem);
-
- if (0 == ustrFileURL->length || NULL == pItem)
+ OSL_ASSERT((0 != ustrFileURL) && (0 != pItem));
+ if ((0 == ustrFileURL) || (0 == ustrFileURL->length) || (0 == pItem))
return osl_File_E_INVAL;
osl_error = osl_getSystemPathFromFileURL_Ex(ustrFileURL, &ustrSystemPath, sal_False);
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index 04fdd13e7c15..9dd3b08493b0 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -73,19 +73,21 @@
void SAL_CALL osl_systemPathRemoveSeparator(rtl_uString* pustrPath)
{
- OSL_PRECOND(pustrPath, "osl_systemPathRemoveSeparator: Invalid parameter");
-
- // maybe there are more than one separator at end
- // so we run in a loop
- while ((pustrPath->length > 1) && (FPH_CHAR_PATH_SEPARATOR == pustrPath->buffer[pustrPath->length - 1]))
+ OSL_PRECOND(0 != pustrPath, "osl_systemPathRemoveSeparator: Invalid parameter");
+ if (0 != pustrPath)
{
- pustrPath->length--;
- pustrPath->buffer[pustrPath->length] = (sal_Unicode)'\0';
- }
+ // maybe there are more than one separator at end
+ // so we run in a loop
+ while ((pustrPath->length > 1) && (FPH_CHAR_PATH_SEPARATOR == pustrPath->buffer[pustrPath->length - 1]))
+ {
+ pustrPath->length--;
+ pustrPath->buffer[pustrPath->length] = (sal_Unicode)'\0';
+ }
- OSL_POSTCOND((0 == pustrPath->length) || (1 == pustrPath->length) || \
- (pustrPath->length > 1 && pustrPath->buffer[pustrPath->length - 1] != FPH_CHAR_PATH_SEPARATOR), \
- "osl_systemPathRemoveSeparator: Post condition failed");
+ OSL_POSTCOND((0 == pustrPath->length) || (1 == pustrPath->length) || \
+ (pustrPath->length > 1 && pustrPath->buffer[pustrPath->length - 1] != FPH_CHAR_PATH_SEPARATOR), \
+ "osl_systemPathRemoveSeparator: Post condition failed");
+ }
}
/*******************************************
@@ -94,21 +96,22 @@
void SAL_CALL osl_systemPathEnsureSeparator(rtl_uString** ppustrPath)
{
- OSL_PRECOND(ppustrPath && (NULL != *ppustrPath), \
- "osl_systemPathEnsureSeparator: Invalid parameter");
-
- rtl::OUString path(*ppustrPath);
- sal_Int32 lp = path.getLength();
- sal_Int32 i = path.lastIndexOf(FPH_CHAR_PATH_SEPARATOR);
-
- if ((lp > 1 && i != (lp - 1)) || ((lp < 2) && i < 0))
- {
- path += FPH_PATH_SEPARATOR();
- rtl_uString_assign(ppustrPath, path.pData);
- }
-
- OSL_POSTCOND(path.lastIndexOf(FPH_CHAR_PATH_SEPARATOR) == (path.getLength() - 1), \
- "osl_systemPathEnsureSeparator: Post condition failed");
+ OSL_PRECOND((0 != ppustrPath) && (0 != *ppustrPath), "osl_systemPathEnsureSeparator: Invalid parameter");
+ if ((0 != ppustrPath) && (0 != *ppustrPath))
+ {
+ rtl::OUString path(*ppustrPath);
+ sal_Int32 lp = path.getLength();
+ sal_Int32 i = path.lastIndexOf(FPH_CHAR_PATH_SEPARATOR);
+
+ if ((lp > 1 && i != (lp - 1)) || ((lp < 2) && i < 0))
+ {
+ path += FPH_PATH_SEPARATOR();
+ rtl_uString_assign(ppustrPath, path.pData);
+ }
+
+ OSL_POSTCOND(path.lastIndexOf(FPH_CHAR_PATH_SEPARATOR) == (path.getLength() - 1), \
+ "osl_systemPathEnsureSeparator: Post condition failed");
+ }
}
/*******************************************
@@ -117,8 +120,8 @@
sal_Bool SAL_CALL osl_systemPathIsRelativePath(const rtl_uString* pustrPath)
{
- OSL_PRECOND(pustrPath, "osl_systemPathIsRelativePath: Invalid parameter");
- return ((0 == pustrPath->length) || (pustrPath->buffer[0] != FPH_CHAR_PATH_SEPARATOR));
+ OSL_PRECOND(0 != pustrPath, "osl_systemPathIsRelativePath: Invalid parameter");
+ return ((0 == pustrPath) || (0 == pustrPath->length) || (pustrPath->buffer[0] != FPH_CHAR_PATH_SEPARATOR));
}
/******************************************
@@ -177,21 +180,16 @@
sal_Bool SAL_CALL osl_systemPathIsHiddenFileOrDirectoryEntry(
const rtl_uString* pustrPath)
{
- OSL_PRECOND(pustrPath, "osl_systemPathIsHiddenFileOrDirectoryEntry: Invalid parameter");
-
- sal_Bool is_hidden = sal_False;
+ OSL_PRECOND(0 != pustrPath, "osl_systemPathIsHiddenFileOrDirectoryEntry: Invalid parameter");
+ if ((0 == pustrPath) || (0 == pustrPath->length))
+ return sal_False;
- if (pustrPath->length > 0)
- {
- rtl::OUString fdp;
-
- osl_systemPathGetFileNameOrLastDirectoryPart(pustrPath, &fdp.pData);
-
- is_hidden = ((fdp.pData->length > 0) && (fdp.pData->buffer[0] == FPH_CHAR_DOT) &&
- !osl_systemPathIsLocalOrParentDirectoryEntry(fdp.pData));
- }
+ rtl::OUString fdp;
+ osl_systemPathGetFileNameOrLastDirectoryPart(pustrPath, &fdp.pData);
- return is_hidden;
+ return ((fdp.pData->length > 0) &&
+ (fdp.pData->buffer[0] == FPH_CHAR_DOT) &&
+ !osl_systemPathIsLocalOrParentDirectoryEntry(fdp.pData));
}
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index 66c0d0f5c701..498778758ded 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -483,17 +483,20 @@ extern "C" int _imp_setProcessLocale( rtl_Locale * );
*********************************************/
oslProcessError SAL_CALL osl_getProcessLocale( rtl_Locale ** ppLocale )
{
+ oslProcessError result = osl_Process_E_Unknown;
OSL_PRECOND(ppLocale, "osl_getProcessLocale(): Invalid parameter.");
+ if (ppLocale)
+ {
+ pthread_mutex_lock(&(g_process_locale.m_mutex));
- pthread_mutex_lock(&(g_process_locale.m_mutex));
-
- if (g_process_locale.m_pLocale == 0)
- _imp_getProcessLocale (&(g_process_locale.m_pLocale));
- *ppLocale = g_process_locale.m_pLocale;
-
- pthread_mutex_unlock (&(g_process_locale.m_mutex));
+ if (g_process_locale.m_pLocale == 0)
+ _imp_getProcessLocale (&(g_process_locale.m_pLocale));
+ *ppLocale = g_process_locale.m_pLocale;
+ result = osl_Process_E_None;
- return (osl_Process_E_None);
+ pthread_mutex_unlock (&(g_process_locale.m_mutex));
+ }
+ return (result);
}
/**********************************************
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index c77a27543261..05d816c92755 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -514,7 +514,6 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
if ( pTmpProfile->m_bIsValid == sal_False )
{
- OSL_ASSERT(pProfile->m_bIsValid);
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
#ifdef TRACE_OSL_PROFILE
OSL_TRACE("Out osl_readProfileString [not valid]\n");
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index c8faf6c028f5..2f7b62a4bfa4 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -605,16 +605,16 @@ sal_Bool SAL_CALL osl_isEqualSocketAddr (
oslSocketAddr Addr1,
oslSocketAddr Addr2)
{
- struct sockaddr* pAddr1= &(Addr1->m_sockaddr);
- struct sockaddr* pAddr2= &(Addr2->m_sockaddr);
-
- OSL_ASSERT(pAddr1);
- OSL_ASSERT(pAddr2);
-
- if (pAddr1->sa_family == pAddr2->sa_family)
+ OSL_ASSERT((0 != Addr1) && (0 != Addr2));
+ if ((0 != Addr1) || (0 != Addr2))
{
- switch (pAddr1->sa_family)
- {
+ struct sockaddr* pAddr1= &(Addr1->m_sockaddr);
+ struct sockaddr* pAddr2= &(Addr2->m_sockaddr);
+
+ if (pAddr1->sa_family == pAddr2->sa_family)
+ {
+ switch (pAddr1->sa_family)
+ {
case AF_INET:
{
struct sockaddr_in* pInetAddr1= (struct sockaddr_in*)pAddr1;
@@ -623,16 +623,16 @@ sal_Bool SAL_CALL osl_isEqualSocketAddr (
if ((pInetAddr1->sin_family == pInetAddr2->sin_family) &&
(pInetAddr1->sin_addr.s_addr == pInetAddr2->sin_addr.s_addr) &&
(pInetAddr1->sin_port == pInetAddr2->sin_port))
- return (sal_True);
+ return (sal_True);
}
default:
{
- return (memcmp(pAddr1, Addr2, sizeof(struct sockaddr)) == 0);
+ return (memcmp(pAddr1, pAddr2, sizeof(struct sockaddr)) == 0);
}
- }
+ }
+ }
}
-
return (sal_False);
}
@@ -1173,7 +1173,6 @@ oslHostAddr SAL_CALL osl_createHostAddr (
rtl_string_release(strHostname);
}
-
return HostAddr;
}
@@ -1197,7 +1196,7 @@ oslHostAddr SAL_CALL osl_psz_createHostAddr (
pHostAddr= (oslHostAddr) malloc(sizeof(struct oslHostAddrImpl));
OSL_ASSERT(pHostAddr);
- if (pAddr == NULL)
+ if (pHostAddr == NULL)
{
free (cn);
return ((oslHostAddr)NULL);
@@ -2530,7 +2529,10 @@ sal_Bool __osl_socket_poll (
int timeout;
int result;
- OSL_ASSERT(pSocket);
+ OSL_ASSERT(0 != pSocket);
+ if (0 == pSocket)
+ return sal_False; /* EINVAL */
+
pSocket->m_nLastError = 0;
fds.fd = pSocket->m_Socket;
@@ -2573,7 +2575,10 @@ sal_Bool __osl_socket_poll (
struct timeval tv;
int result;
- OSL_ASSERT(pSocket);
+ OSL_ASSERT(0 != pSocket);
+ if (0 == pSocket)
+ return sal_False; /* EINVAL */
+
pSocket->m_nLastError = 0;
FD_ZERO(&fds);
diff --git a/sal/rtl/source/alloc.c b/sal/rtl/source/alloc.c
deleted file mode 100644
index 44b37c255004..000000000000
--- a/sal/rtl/source/alloc.c
+++ /dev/null
@@ -1,1541 +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.
- *
- ************************************************************************/
-
-#ifdef PROFILE
-#undef OSL_DEBUG_LEVEL
-#define OSL_DEBUG_LEVEL 0
-#endif /* PROFILE */
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <rtl/alloc.h>
-
-#ifndef INCLUDED_STDDEF_H
-#include <stddef.h>
-#define INCLUDED_STDDEF_H
-#endif
-
-#ifndef INCLUDED_STDLIB_H
-#include <stdlib.h>
-#define INCLUDED_STDLIB_H
-#endif
-
-#ifndef INCLUDED_STRING_H
-#include <string.h>
-#define INCLUDED_STRING_H
-#endif
-
-#ifndef FORCE_SYSALLOC
-
-/*===========================================================================
- *
- * rtl_memory (UNX) internals.
- *
- *=========================================================================*/
-#ifdef SAL_UNX
-
-#include <unistd.h>
-#include <pthread.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-
-typedef pthread_mutex_t mutex_type;
-
-#define RTL_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#define RTL_MUTEX_ACQUIRE(a) pthread_mutex_lock((a))
-#define RTL_MUTEX_RELEASE(a) pthread_mutex_unlock((a))
-
-#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX)
-static sal_Size __rtl_memory_vmpagesize (void)
-{
- /* xBSD */
- return (sal_Size)(getpagesize());
-}
-#elif defined(LINUX) || defined(SOLARIS)
-static sal_Size __rtl_memory_vmpagesize (void)
-{
- /* POSIX */
- return (sal_Size)(sysconf(_SC_PAGESIZE));
-}
-#else
-static sal_Size __rtl_memory_vmpagesize (void)
-{
- /* other */
- return (sal_Size)(0x2000);
-}
-#endif /* FREEBSD || NETBSD || MACOSX || LINUX || SOLARIS */
-
-#ifndef PROT_HEAP
-#define PROT_HEAP (PROT_READ | PROT_WRITE | PROT_EXEC)
-#endif
-
-/* #95880# building on Solaris 8 provides MAP_ANON, but it
- is not available on Solaris 7 */
-#if defined (SOLARIS)
-#ifdef MAP_ANON
-#undef MAP_ANON
-#endif
-#endif
-
-#ifndef MAP_ANON
-static void* __rtl_memory_vmalloc (sal_Size n)
-{
- /* SYSV */
- int fd = open("/dev/zero", O_RDWR);
- if (!(fd < 0))
- {
- void * p = mmap(NULL, n, PROT_HEAP, MAP_PRIVATE, fd, 0);
- close(fd);
- return ((p == MAP_FAILED) ? NULL : p);
- }
- return (NULL);
-}
-#else /* MAP_ANON */
-static void* __rtl_memory_vmalloc (sal_Size n)
-{
- /* xBSD */
- void * p = mmap(NULL, n, PROT_HEAP, MAP_PRIVATE | MAP_ANON, -1, 0);
- return ((p == MAP_FAILED) ? NULL : p);
-}
-#endif /* MAP_ANON */
-
-#define RTL_MEMORY_ALLOC(n) __rtl_memory_vmalloc((sal_Size)(n))
-#define RTL_MEMORY_FREE(p, n) munmap((void*)(p), (sal_Size)(n))
-
-#endif /* SAL_UNX */
-
-/*===========================================================================
- *
- * rtl_memory (W32) internals.
- *
- *=========================================================================*/
-#ifdef SAL_W32
-
-#define WIN32_LEAN_AND_MEAN
-#ifdef _MSC_VER
-#pragma warning(push,1) /* disable warnings within system headers */
-#endif
-#include <windows.h>
-#include <wchar.h>
-
-typedef CRITICAL_SECTION mutex_type;
-
-/* Static initializer (struct declared in WINNT.H). */
-#define RTL_MUTEX_INITIALIZER { NULL, -1, 0, NULL, NULL, 0 }
-
-/*
- * __rtl_mutex_init (dynamic initialization).
- *
- * Static initialization (with DebugInfo == NULL)
- * leads to Access Violation upon first contention.
- */
-static void __rtl_mutex_init (LPCRITICAL_SECTION lpCriticalSection)
-{
- static LONG g_spinlock = 0;
-
- while (InterlockedExchange (&g_spinlock, 1) == 1)
- {
- /* Already locked, spin */
- Sleep (0);
- }
- if (!(lpCriticalSection->DebugInfo))
- {
- /* Dynamic initialization */
- InitializeCriticalSection (lpCriticalSection);
- }
- InterlockedExchange (&g_spinlock, 0);
-}
-
-#define RTL_MUTEX_INIT(a) __rtl_mutex_init((LPCRITICAL_SECTION)(a))
-#define RTL_MUTEX_ACQUIRE(a) EnterCriticalSection((a))
-#define RTL_MUTEX_RELEASE(a) LeaveCriticalSection((a))
-
-static sal_Size __rtl_memory_vmpagesize (void)
-{
- SYSTEM_INFO info;
- GetSystemInfo (&info);
- return ((sal_Size)(info.dwPageSize));
-}
-
-#define RTL_MEMORY_ALLOC(n) \
-(void*)(VirtualAlloc (NULL, (SIZE_T)(n), MEM_COMMIT, PAGE_READWRITE))
-
-#define RTL_MEMORY_FREE(p, n) \
-(void)(VirtualFree ((LPVOID)(p), (SIZE_T)(0), MEM_RELEASE))
-
-#endif /* SAL_W32 */
-
-/*===========================================================================
- *
- * rtl_memory (OS2) internals.
- *
- *=========================================================================*/
-#ifdef SAL_OS2
-
-#define INCL_DOS
-#include <os2.h>
-
-typedef HMTX mutex_type;
-
-/* Static initializer */
-#define RTL_MUTEX_INITIALIZER -1
-
-/*
- * __rtl_mutex_init (dynamic initialization).
- *
- * Static initialization (with DebugInfo == NULL)
- * leads to Access Violation upon first contention.
- */
-static void __rtl_mutex_init (mutex_type* mutex)
-{
- APIRET rc = 0;
-
- rc = DosCreateMutexSem(NULL,mutex,0,0);
-
-}
-
-static int __rtl_mutex_destroy (mutex_type* mutex)
-{
- APIRET rc = 0;
-
-
- do {
- rc = DosCloseMutexSem(*mutex);
- if (rc == 301) DosReleaseMutexSem(*mutex);
- } while (rc == 301);
-
- *mutex = 0;
-
- /* Return the completion status: */
- return (0);
-}
-
-
-static int __rtl_mutex_acquire(mutex_type* mutex)
-{
- int ret = 0;
- int status = 0;
- APIRET rc = 0;
-
- // initialize static semaphores created with PTHREAD_MUTEX_INITIALIZER state.
- if (*mutex == -1)
- __rtl_mutex_init( mutex);
-
- rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
- if (rc)
- return(1);
-
- /* Return the completion status: */
- return (0);
-}
-
-static int __rtl_mutex_release(mutex_type* mutex)
-{
- int ret = 0;
- APIRET rc = 0;
- int status;
-
-
- // initialize static semaphores created with PTHREAD_MUTEX_INITIALIZER state.
- if (*mutex == -1)
- __rtl_mutex_init( mutex);
-
- rc = DosReleaseMutexSem(*mutex);
-
- /* Return the completion status: */
- return (0);
-}
-
-#define RTL_MUTEX_INIT(a) __rtl_mutex_init((mutex_type*)(a))
-#define RTL_MUTEX_ACQUIRE(a) __rtl_mutex_acquire((mutex_type*)(a))
-#define RTL_MUTEX_RELEASE(a) __rtl_mutex_release((mutex_type*)(a))
-
-static sal_Size __rtl_memory_vmpagesize (void)
-{
- return (sal_Size)(getpagesize());
-}
-
-#define RTL_MEMORY_ALLOC(n) (void*)(malloc(n))
-
-#define RTL_MEMORY_FREE(p, n) (void)(free(p))
-
-#endif /* SAL_OS2 */
-
-/*===========================================================================
- *
- * rtl_memory (global) internals.
- *
- *=========================================================================*/
-#define __L__ 32
-#define __P__ 24
-#define __N__ ((__L__) + (__P__))
-#define __M__ 0x10000
-
-static const sal_Size __T__ = (__M__) * 2 / 3;
-
-typedef struct __rtl_memory_desc_st memory_type;
-struct __rtl_memory_desc_st
-{
- sal_Size m_length;
- sal_Size m_offset;
- memory_type *m_flink;
- memory_type *m_blink;
-};
-
-static const int __C__ = 2 * sizeof(sal_Size);
-static const int __Q__ = 2 * sizeof(memory_type*);
-
-typedef struct __rtl_memory_stat_st memory_stat;
-struct __rtl_memory_stat_st
-{
- sal_uInt64 m_dequeue;
- sal_uInt64 m_enqueue;
- sal_Int32 m_delta_q;
-
- sal_uInt64 m_deqsize;
- sal_uInt64 m_enqsize;
- sal_Int32 m_delta_n;
-};
-
-#define RTL_MEMORY_ALIGN(n, m) (((n) + ((m) - 1)) & ~((m) - 1))
-#define RTL_MEMORY_SIZEOF(a) RTL_MEMORY_ALIGN(sizeof(a), sizeof(memory_type))
-
-struct __rtl_memory_global_st
-{
- sal_Size m_magic;
- sal_Size m_align;
-
- union {
- mutex_type m_lock;
- char m_data[RTL_MEMORY_SIZEOF(mutex_type)];
- } m_mutex;
-
- memory_type m_alloc_head;
- memory_type m_spare_head;
- memory_type m_queue_head[__N__];
-
-#if OSL_DEBUG_LEVEL > 0
- memory_stat m_queue_stat[__N__];
-#endif /* OSL_DEBUG_LEVEL */
-};
-
-static struct __rtl_memory_global_st g_memory =
-{
- 0, 0, { RTL_MUTEX_INITIALIZER },
- { 0, 0, NULL, NULL }, { 0, 0, NULL, NULL }, { { 0, 0, NULL, NULL } },
-#if OSL_DEBUG_LEVEL > 0
- { { 0, 0, 0, 0, 0, 0 } }
-#endif /* OSL_DEBUG_LEVEL */
-};
-
-void SAL_CALL ___rtl_memory_init (void);
-void SAL_CALL ___rtl_memory_fini (void);
-
-#define RTL_MEMORY_ENTER() \
-{ \
- if (!(g_memory.m_align)) ___rtl_memory_init(); \
- RTL_MUTEX_ACQUIRE(&(g_memory.m_mutex.m_lock)); \
-}
-
-#define RTL_MEMORY_LEAVE() \
-{ \
- RTL_MUTEX_RELEASE(&(g_memory.m_mutex.m_lock)); \
-}
-
-/*===========================================================================
- *
- * rtl_memory (queue) internals.
- *
- *=========================================================================*/
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static sal_Size queue (sal_Size n)
-{
- /* k = n div __C__ */
- register sal_Size k = n / __C__, m = __L__;
-
- OSL_PRECOND((__L__ == 32),
- "__rtl_memory_queue(): internal logic error");
- if (k > m)
- {
- /* k = k div __L__ = k div 32 */
- k >>= 5;
- while ((k >>= 1) > 0) m++;
- k = m;
- }
-
- OSL_POSTCOND((0 < k) && (k < __N__),
- "__rtl_memory_queue(): "
- "internal error: index out of bounds");
- return (k);
-}
-#else /* PRODUCT */
-#define queue(k, n) \
-{ \
- (k) = ((n) / __C__); \
- if ((k) > __L__) \
- { \
- register sal_Size m = __L__; \
- (k) >>= 5; \
- while (((k) >>= 1) > 0) m++; \
- (k) = m; \
- } \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-#define queue_start(entry) \
-{ \
- (entry)->m_flink = (entry); \
- (entry)->m_blink = (entry); \
-}
-
-#define queue_remove(entry) \
-{ \
- (entry)->m_blink->m_flink = (entry)->m_flink; \
- (entry)->m_flink->m_blink = (entry)->m_blink; \
- queue_start(entry); \
-}
-
-#define queue_insert_head(head, entry) \
-{ \
- (entry)->m_blink = (head); \
- (entry)->m_flink = (head)->m_flink; \
- (head)->m_flink = (entry); \
- (entry)->m_flink->m_blink = (entry); \
-}
-
-#define queue_insert_tail(head, entry) \
-{ \
- (entry)->m_flink = (head); \
- (entry)->m_blink = (head)->m_blink; \
- (head)->m_blink = (entry); \
- (entry)->m_blink->m_flink = (entry); \
-}
-
-/*===========================================================================
- *
- * rtl_memory (debug) internals.
- *
- *=========================================================================*/
-#if OSL_DEBUG_LEVEL > 0
-
-#define __dbg_memory_succ(entry, length) \
-(memory_type*)((char*)((entry)) + ((length) & ~0x1))
-
-#define __dbg_memory_pred(entry, offset) \
-(memory_type*)((char*)((entry)) - ((offset) & ~0x1))
-
-#define __dbg_memory_ensure(entry) (!((sal_Size)(entry) & 0x7))
-
-/*
- * __dbg_memory_dequeue.
- */
-static void __dbg_memory_dequeue (sal_Size n)
-{
- register sal_Size k = queue(n);
-
- g_memory.m_queue_stat[k].m_dequeue += 1;
- g_memory.m_queue_stat[k].m_delta_q += 1;
-
- g_memory.m_queue_stat[k].m_deqsize += n;
- g_memory.m_queue_stat[k].m_delta_n += n;
-}
-
-/*
- * __dbg_memory_enqueue.
- */
-static void __dbg_memory_enqueue (sal_Size n)
-{
- register sal_Size k = queue(n);
-
- g_memory.m_queue_stat[k].m_enqueue += 1;
- g_memory.m_queue_stat[k].m_delta_q -= 1;
-
- g_memory.m_queue_stat[k].m_enqsize += n;
- g_memory.m_queue_stat[k].m_delta_n -= n;
-}
-
-/*
- * __dbg_memory_insert.
- */
-static void __dbg_memory_insert (memory_type **ppMemory)
-{
- register memory_type * succ;
- succ = __dbg_memory_succ (*ppMemory, sizeof(memory_type));
-
- succ->m_length = (*ppMemory)->m_length - sizeof(memory_type);
- succ->m_offset = (*ppMemory)->m_offset;
-
- queue_insert_tail (&(g_memory.m_alloc_head), (*ppMemory));
- (*ppMemory) = succ;
-}
-
-/*
- * __dbg_memory_remove.
- */
-static void __dbg_memory_remove (memory_type **ppMemory)
-{
- (*ppMemory) = __dbg_memory_pred (*ppMemory, sizeof(memory_type));
- queue_remove (*ppMemory);
-}
-
-/*
- * __dbg_memory_verify_chain.
- */
-static int __dbg_memory_verify_chain (memory_type * x)
-{
- if (!__dbg_memory_ensure(x))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): invalid pointer alignment.");
- return (0);
- }
- if (!__dbg_memory_ensure(x->m_length & ~0x1))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): dynamic memory corruption");
- return (0);
- }
- if (!__dbg_memory_ensure(x->m_offset & ~0x1))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): dynamic memory corruption");
- return (0);
- }
- if (!(x->m_length & ~0x1))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): dynamic memory corruption");
- return (0);
- }
- return (1);
-}
-
-/*
- * __dbg_memory_verify_queue.
- */
-static int __dbg_memory_verify_queue (memory_type * x)
-{
- if (!__dbg_memory_ensure(x))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): invalid pointer alignment.");
- return (0);
- }
- if (!__dbg_memory_ensure(x->m_flink))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): free memory corruption");
- return (0);
- }
- if (!__dbg_memory_ensure(x->m_blink))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): free memory corruption");
- return (0);
- }
- if ((x == x->m_flink) || (x == x->m_blink))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): internal logic error");
- return (0);
- }
- return (1);
-}
-
-/*
- * __dbg_memory_verify_alloc.
- */
-static int __dbg_memory_verify_alloc (memory_type * x)
-{
- register memory_type *head, *entry;
- head = entry = &(g_memory.m_alloc_head);
-
- if (!__dbg_memory_ensure(x))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): invalid pointer alignment.");
- return (0);
- }
- while (!((entry = entry->m_flink) == head))
- {
- if ((entry < x) && (x < __dbg_memory_succ(entry, entry->m_length)))
- {
- head = entry = __dbg_memory_succ(entry, sizeof(memory_type));
- while (!((x == entry) || (entry->m_offset & 0x1)))
- {
- /* no match, not last */
- if (!__dbg_memory_verify_chain (entry))
- return (0);
- entry = __dbg_memory_succ(entry, entry->m_length);
- }
-
- /* match, or last */
- if (!__dbg_memory_verify_chain (entry))
- return (0);
- break;
- }
- }
- if (!(x == entry))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): memory not allocated.");
- return (0);
- }
- return (1);
-}
-
-/*
- * __dbg_memory_verify.
- */
-static int __dbg_memory_verify (memory_type * x, int debug)
-{
- /* dispatch upon 'debug' level */
- if (debug)
- {
- /* verify allocation */
- if (!__dbg_memory_verify_alloc (x))
- return (0);
- }
- else
- {
- /* verify 'chain' fields */
- if (!__dbg_memory_verify_chain (x))
- return (0);
- }
-
- /* verify 'used' bit */
- if (!(x->m_length & 0x1))
- {
- OSL_ENSURE(0, "__rtl_memory_verify(): memory not used.");
- return (0);
- }
- return (1);
-}
-
-#if OSL_DEBUG_LEVEL > 1
-/*
- * __dbg_memory_usage_update.
- */
-static sal_Size __dbg_memory_usage_update (memory_stat * stat, sal_Size length)
-{
- register sal_Size n = (length & ~0x1), k = queue(n);
-
- stat[k].m_dequeue += 1;
- stat[k].m_deqsize += n;
-
- if (!(length & 0x1))
- {
- /* not used */
- stat[k].m_enqueue += 1;
- stat[k].m_enqsize += n;
- return (n);
- }
- else
- {
- /* used */
- stat[k].m_delta_q += 1;
- stat[k].m_delta_n += n;
- return (0);
- }
-}
-
-/*
- * __dbg_memory_usage.
- */
-static void __dbg_memory_usage (memory_stat * total)
-{
- register memory_type *head, *entry, *memory;
- memory_stat stat[__N__];
-
- memset (stat, 0, __N__ * sizeof(memory_stat));
-
- head = entry = &(g_memory.m_alloc_head);
- while (!((entry = entry->m_flink) == head))
- {
- register sal_Size k = 0, n = entry->m_length - sizeof(memory_type);
-
- memory = __dbg_memory_succ(entry, sizeof(memory_type));
- while (!(memory->m_offset & 0x1))
- {
- /* not last */
- k += __dbg_memory_usage_update (stat, memory->m_length);
- memory = __dbg_memory_succ(memory, memory->m_length);
- }
-
- k += __dbg_memory_usage_update (stat, memory->m_length);
- OSL_TRACE("%x %10d %10d", (sal_Size)(entry), n, k);
- }
-
- if (total)
- {
- sal_Size i;
-
- memset (total, 0, sizeof(memory_stat));
- for (i = 0; i < __N__; i++)
- {
- total->m_dequeue += stat[i].m_dequeue;
- total->m_enqueue += stat[i].m_enqueue;
- total->m_delta_q += stat[i].m_delta_q;
-
- total->m_deqsize += stat[i].m_deqsize;
- total->m_enqsize += stat[i].m_enqsize;
- total->m_delta_n += stat[i].m_delta_n;
- }
- }
-}
-#endif /* OSL_DEBUG_LEVEL */
-
-#endif /* OSL_DEBUG_LEVEL */
-#if OSL_DEBUG_LEVEL > 0
-
-#define DBG_MEMORY_DEQUEUE(n) __dbg_memory_dequeue((sal_Size)(n) & ~0x1)
-#define DBG_MEMORY_ENQUEUE(n) __dbg_memory_enqueue((sal_Size)(n) & ~0x1)
-
-#define DBG_MEMORY_DEQFILL(entry, offset, length) \
- memset(((char*)(entry) + (offset)), 0x77777777, (length))
-#define DBG_MEMORY_ENQFILL(entry, offset, length) \
- memset(((char*)(entry) + (offset)), 0x33333333, (length))
-
-#define DBG_MEMORY_INSERT(entry) __dbg_memory_insert((entry))
-#define DBG_MEMORY_REMOVE(entry) __dbg_memory_remove((entry))
-
-#if OSL_DEBUG_LEVEL > 1
-#define DBG_MEMORY_VERIFY(entry) __dbg_memory_verify((entry), 1)
-#else /* OSL_DEBUG_LEVEL > 0 */
-#define DBG_MEMORY_VERIFY(entry) __dbg_memory_verify((entry), 0)
-#endif /* OSL_DEBUG_LEVEL */
-
-#define DBG_MEMORY_VERIFY_CHAIN(entry) __dbg_memory_verify_chain((entry))
-#define DBG_MEMORY_VERIFY_QUEUE(entry) __dbg_memory_verify_queue((entry))
-
-#else /* PRODUCT */
-
-#define DBG_MEMORY_DEQUEUE(n)
-#define DBG_MEMORY_ENQUEUE(n)
-
-#define DBG_MEMORY_DEQFILL(entry, offset, length)
-#define DBG_MEMORY_ENQFILL(entry, offset, length)
-
-#define DBG_MEMORY_INSERT(entry)
-#define DBG_MEMORY_REMOVE(entry)
-
-#define DBG_MEMORY_VERIFY(entry)
-#define DBG_MEMORY_VERIFY_CHAIN(entry)
-#define DBG_MEMORY_VERIFY_QUEUE(entry)
-
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*===========================================================================
- *
- * rtl_memory (manager) internals.
- *
- *=========================================================================*/
-#define queue_cast(entry, offset) \
-((memory_type*)((char*)(entry) + (ptrdiff_t)(offset)))
-
-#define __rtl_memory_used(entry) ((entry)->m_length & 0x1)
-#define __rtl_memory_last(entry) ((entry)->m_offset & 0x1)
-#define __rtl_memory_offset(entry) \
- ((ptrdiff_t)((entry)->m_offset & ~0x1))
-
-/*
- * ___rtl_memory_init.
- */
-void SAL_CALL ___rtl_memory_init (void)
-{
-#if defined(RTL_MUTEX_INIT)
- RTL_MUTEX_INIT (&(g_memory.m_mutex.m_lock));
-#endif /* RTL_MUTEX_INIT */
-
- RTL_MUTEX_ACQUIRE(&(g_memory.m_mutex.m_lock));
- if (!(g_memory.m_align))
- {
- sal_Size pagesize;
- int i;
-
- queue_start (&(g_memory.m_alloc_head));
- queue_start (&(g_memory.m_spare_head));
-
- for (i = 0; i < __N__; i++)
- queue_start (&(g_memory.m_queue_head[i]));
- for (i = 1; i <= __L__; i++)
- g_memory.m_queue_head[i].m_length = i * __C__;
- for (i = __L__ + 1; i < __N__; i++)
- g_memory.m_queue_head[i].m_length =
- 2 * g_memory.m_queue_head[i - 1].m_length;
-
- pagesize = __rtl_memory_vmpagesize();
- g_memory.m_align = RTL_MEMORY_ALIGN(__M__, pagesize);
- }
- RTL_MUTEX_RELEASE(&(g_memory.m_mutex.m_lock));
-}
-
-/*
- * ___rtl_memory_fini.
- */
-void SAL_CALL ___rtl_memory_fini (void)
-{
-#if OSL_DEBUG_LEVEL > 1
-
- memory_stat total;
-
- __dbg_memory_usage (&total);
- if (total.m_delta_n > 0)
- {
- OSL_TRACE("___rtl_memory_fini(): "
- "Leak: %10d (Alloc: %10d, Free: %10d)",
- total.m_delta_n,
- (sal_uInt32)(total.m_deqsize & 0xffffffff),
- (sal_uInt32)(total.m_enqsize & 0xffffffff));
- }
-
-#endif /* OSL_DEBUG_LEVEL */
-}
-
-/*
- * __rtl_memory_merge.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_merge (memory_type * prev, memory_type * next)
-{
- /* adjust length */
- prev->m_length += next->m_length;
- if (!__rtl_memory_last(next))
- {
- /* not last, adjust offset */
- register memory_type * succ = queue_cast(prev, prev->m_length);
- DBG_MEMORY_VERIFY_CHAIN (succ);
- succ->m_offset = prev->m_length | __rtl_memory_last(succ);
- }
-
- /* propagate 'last' bit */
- prev->m_offset |= __rtl_memory_last(next);
-}
-#else /* PRODUCT */
-#define __rtl_memory_merge(prev, next) \
-{ \
- (prev)->m_length += (next)->m_length; \
- if (!__rtl_memory_last((next))) \
- { \
- register memory_type * succ = queue_cast((prev), (prev)->m_length); \
- succ->m_offset = (prev)->m_length | __rtl_memory_last(succ); \
- } \
- (prev)->m_offset |= __rtl_memory_last((next)); \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*
- * __rtl_memory_split.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_split (memory_type * prev, memory_type * next)
-{
- /* adjust length */
- prev->m_length -= next->m_length;
- if (!__rtl_memory_last(prev))
- {
- /* not last, adjust offset */
- register memory_type * succ = queue_cast(next, next->m_length);
- DBG_MEMORY_VERIFY_CHAIN (succ);
- succ->m_offset = next->m_length | __rtl_memory_last(succ);
- }
-
- /* propagate 'last' bit */
- next->m_offset |= __rtl_memory_last(prev);
- prev->m_offset &= ~0x1;
-}
-#else /* PRODUCT */
-#define __rtl_memory_split(prev, next) \
-{ \
- (prev)->m_length -= (next)->m_length; \
- if (!__rtl_memory_last((prev))) \
- { \
- register memory_type * succ = queue_cast((next), (next)->m_length); \
- succ->m_offset = (next)->m_length | __rtl_memory_last(succ); \
- } \
-\
- (next)->m_offset |= __rtl_memory_last((prev)); \
- (prev)->m_offset &= ~0x1; \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*
- * __rtl_memory_insert.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_insert (memory_type * memory, sal_Size n)
-{
- /* obtain queue head */
- register memory_type *head;
-
- head = &(g_memory.m_queue_head[queue(n)]);
- DBG_MEMORY_VERIFY_CHAIN (head);
-
- /* insert at queue tail (first-in first-out) */
- queue_insert_tail (head, memory);
-}
-#else /* PRODUCT */
-#define __rtl_memory_insert(memory, n) \
-{ \
- register sal_Size h; \
-\
- queue(h, (n)); \
- queue_insert_tail (&(g_memory.m_queue_head[h]), (memory)); \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*
- * __rtl_memory_resize.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_resize (memory_type * memory, sal_Size n)
-{
- register sal_Size k = (memory->m_length - n);
-
- OSL_ENSURE(!(memory->m_length & 0x1),
- "__rtl_memory_resize(): "
- "internal logic error.");
-
- if ((k >= sizeof(memory_type)) && (n <= __T__))
- {
- /* split */
- register memory_type * remain = queue_cast(memory, n);
-
- remain->m_length = k; remain->m_offset = n;
- __rtl_memory_split (memory, remain);
-
- /* check postcond */
- if (!__rtl_memory_last(remain))
- {
- /* not last, verify used next entry */
- register memory_type *next;
-
- next = queue_cast(remain, remain->m_length);
- DBG_MEMORY_VERIFY_CHAIN (next);
-
- OSL_POSTCOND(__rtl_memory_used(next),
- "__rtl_memory_resize(): "
- "internal logic error.");
- }
-
- /* enqueue */
- __rtl_memory_insert (remain, k);
- DBG_MEMORY_VERIFY_QUEUE (remain);
- }
-
- DBG_MEMORY_DEQUEUE(memory->m_length);
-}
-#else /* PRODUCT */
-#define __rtl_memory_resize(memory, n) \
-{ \
- register sal_Size kn = ((memory)->m_length - (n)); \
- if ((kn >= sizeof(memory_type)) && (n <= __T__)) \
- { \
- register memory_type * remain = queue_cast((memory), (n)); \
-\
- remain->m_length = kn; remain->m_offset = (n); \
- __rtl_memory_split ((memory), remain); \
-\
- __rtl_memory_insert (remain, kn); \
- } \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*
- * __rtl_memory_dequeue.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_dequeue (memory_type **ppMemory, sal_Size n)
-{
- register memory_type *head, *entry;
- register sal_Size k, m = n;
-
- OSL_PRECOND(!*ppMemory, "__rtl_memory_dequeue(): internal logic error.");
- for (k = queue(m); k < __N__; k++)
- {
- /* first fit (equals best fit w/ ascending insert) */
- head = &(g_memory.m_queue_head[k]);
- for (entry = head->m_flink; entry != head; entry = entry->m_flink)
- {
- /* queue not empty */
- DBG_MEMORY_VERIFY_CHAIN (entry);
- if (entry->m_length >= m)
- {
- /* remove entry */
- DBG_MEMORY_VERIFY_QUEUE (entry);
- queue_remove (entry);
-
- /* assign result */
- *ppMemory = entry;
- goto dequeue_leave;
- }
- }
- }
-
- head = &(g_memory.m_spare_head);
- for (entry = head->m_flink; entry != head; entry = entry->m_flink)
- {
- /* queue not empty */
- DBG_MEMORY_VERIFY_CHAIN (entry);
- if (entry->m_length >= m)
- {
- /* remove entry */
- DBG_MEMORY_VERIFY_QUEUE (entry);
- queue_remove (entry);
-
- /* assign result */
- *ppMemory = entry;
- goto dequeue_leave;
- }
- }
-
-#if OSL_DEBUG_LEVEL > 0
- /* adjust for DBG_MEMORY_INSERT() overhead */
- m += sizeof(memory_type);
-#endif /* OSL_DEBUG_LEVEL */
-
- k = RTL_MEMORY_ALIGN((m > __M__) ? m : __M__, g_memory.m_align);
- if (!((entry = RTL_MEMORY_ALLOC(k)) == 0))
- {
- entry->m_length = k;
- entry->m_offset = 0x1; /* set 'last' bit */
-
- *ppMemory = entry;
- DBG_MEMORY_INSERT(ppMemory);
- }
-
-dequeue_leave:
- OSL_POSTCOND(*ppMemory, "__rtl_memory_dequeue(): out of memory.");
- if ((entry = *ppMemory) != 0)
- {
- /* adjust length */
- __rtl_memory_resize (entry, n);
-
- /* fill w/ 'uninitialized' pattern */
- DBG_MEMORY_DEQFILL (entry, __C__, entry->m_length - __C__);
- }
-#if OSL_DEBUG_LEVEL > 1
- if (!entry)
- {
- memory_stat total;
- __dbg_memory_usage (&total);
- }
-#endif /* OSL_DEBUG_LEVEL */
-}
-#else /* PRODUCT */
-#define __rtl_memory_dequeue(ppMemory, n, label) \
-{ \
- register memory_type *head, *entry; \
- register sal_Size h, m = (n); \
-\
- queue (h, m); \
- for (; h < __N__; h++) \
- { \
- head = &(g_memory.m_queue_head[h]); \
- for (entry = head->m_flink; entry != head; entry = entry->m_flink) \
- { \
- if (entry->m_length >= m) \
- { \
- queue_remove (entry); \
- goto label; \
- } \
- } \
- } \
-\
- head = &(g_memory.m_spare_head); \
- for (entry = head->m_flink; entry != head; entry = entry->m_flink) \
- { \
- if (entry->m_length >= m) \
- { \
- queue_remove (entry); \
- goto label; \
- } \
- } \
-\
- h = RTL_MEMORY_ALIGN((m > __M__) ? m : __M__, g_memory.m_align); \
- if (!((entry = RTL_MEMORY_ALLOC(h)) == 0)) \
- { \
- entry->m_length = h; \
- entry->m_offset = 0x1; \
- } \
-\
-label: \
- if (entry) \
- { \
- __rtl_memory_resize (entry, (n)); \
- *(ppMemory) = entry; \
- } \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-#define RTL_MEMORY_DEQUEUE(m, n, l) __rtl_memory_dequeue((m), (n))
-#else /* PRODUCT */
-#define RTL_MEMORY_DEQUEUE(m, n, l) __rtl_memory_dequeue(m, n, l)
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-/*
- * __rtl_memory_enqueue.
- */
-#if defined(PROFILE) || (OSL_DEBUG_LEVEL > 0)
-static void __rtl_memory_enqueue (memory_type **ppMemory)
-{
- register memory_type *head = *ppMemory;
-
- OSL_ENSURE(!__rtl_memory_used(head),
- "__rtl_memory_enqueue(): "
- "internal logic error.");
- DBG_MEMORY_ENQUEUE (head->m_length);
-
- /* fill w/ 'deinitialized' pattern */
- DBG_MEMORY_ENQFILL (head, __C__, head->m_length - __C__);
-
- /* try merge w/ next entry */
- if (!__rtl_memory_last(head))
- {
- /* not last, check next in chain */
- register memory_type * next;
-
- next = queue_cast(head, head->m_length);
- DBG_MEMORY_VERIFY_CHAIN (next);
-
- if (!__rtl_memory_used(next))
- {
- /* next not used */
- DBG_MEMORY_VERIFY_QUEUE (next);
- queue_remove (next);
-
- /* merge w/ next */
- __rtl_memory_merge (head, next);
- DBG_MEMORY_ENQFILL (next, 0, sizeof(memory_type));
- }
- }
-
- /* try merge w/ prev entry */
- if (__rtl_memory_offset(head) > 0)
- {
- /* not first, check prev in chain */
- register memory_type * prev;
-
- prev = queue_cast(head, -(__rtl_memory_offset(head)));
- DBG_MEMORY_VERIFY_CHAIN (prev);
-
- if (!__rtl_memory_used(prev))
- {
- /* prev not used */
- DBG_MEMORY_VERIFY_QUEUE (prev);
- queue_remove (prev);
-
- /* merge w/ prev */
- __rtl_memory_merge (prev, head);
- DBG_MEMORY_ENQFILL (head, 0, sizeof(memory_type));
- head = prev;
- }
- }
-
- if (!(head->m_offset == 0x1))
- {
- /* page still used, enqueue */
- __rtl_memory_insert (head, head->m_length);
- head = 0;
- }
- else if (head->m_length <= g_memory.m_align)
- {
- /* small page unused, check spare page */
- register memory_type * spare;
-
- spare = &(g_memory.m_spare_head);
- if (spare->m_flink == spare)
- {
- /* keep as spare page */
- queue_insert_tail (spare, head);
- head = 0;
- }
- }
- if ((*ppMemory = head) != 0)
- {
- /* page unused, remove */
- DBG_MEMORY_REMOVE(ppMemory);
- }
-}
-#else /* PRODUCT */
-#define __rtl_memory_enqueue(ppMemory) \
-{ \
- register memory_type *head = *(ppMemory); \
-\
- if (!__rtl_memory_last(head)) \
- { \
- register memory_type * next; \
- next = queue_cast(head, head->m_length); \
- if (!__rtl_memory_used(next)) \
- { \
- queue_remove (next); \
- __rtl_memory_merge (head, next); \
- } \
- } \
-\
- if (__rtl_memory_offset(head) > 0) \
- { \
- register memory_type * prev; \
- prev = queue_cast(head, -(__rtl_memory_offset(head))); \
- if (!__rtl_memory_used(prev)) \
- { \
- queue_remove (prev); \
- __rtl_memory_merge (prev, head); \
- head = prev; \
- } \
- } \
-\
- if (!(head->m_offset == 0x1)) \
- { \
- register memory_type * used = head; \
- __rtl_memory_insert (used, used->m_length); \
- head = 0; \
- } \
- else if (head->m_length <= g_memory.m_align) \
- { \
- register memory_type * spare; \
- spare = &(g_memory.m_spare_head); \
- if (spare->m_flink == spare) \
- { \
- queue_insert_tail (spare, head); \
- head = 0; \
- } \
- } \
-\
- *(ppMemory) = head; \
-}
-#endif /* OSL_DEBUG_LEVEL || PRODUCT */
-
-#define RTL_MEMORY_ENQUEUE(m) __rtl_memory_enqueue((m))
-
-#endif /* FORCE_SYSALLOC */
-
-/*===========================================================================
- *
- * rtl_memory (manager) implementation.
- *
- *=========================================================================*/
-/*
- * rtl_reallocateMemory.
- */
-#ifndef FORCE_SYSALLOC
-void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-{
- memory_type * memory;
- if (!(!p || !n))
- {
- /* reallocate */
- register sal_Size datlen;
-
- memory = queue_cast(p, -(__C__)); p = 0;
- n = RTL_MEMORY_ALIGN(n, __Q__) + __C__;
-
- RTL_MEMORY_ENTER();
- DBG_MEMORY_VERIFY(memory);
-
- /* clear 'used' bit */
- DBG_MEMORY_ENQUEUE (memory->m_length);
- memory->m_length &= ~0x1;
-
- /* amount of data to be moved or copied */
- datlen = ((memory->m_length < n) ? memory->m_length : n);
-
- /* try merge w/ next entry */
- if (!__rtl_memory_last(memory))
- {
- /* not last, check next in chain */
- register memory_type * next;
-
- next = queue_cast(memory, memory->m_length);
- DBG_MEMORY_VERIFY_CHAIN(next);
-
- if (!__rtl_memory_used(next))
- {
- /* next not used */
- DBG_MEMORY_VERIFY_QUEUE(next);
- queue_remove (next);
-
- /* merge w/ next */
- __rtl_memory_merge (memory, next);
- }
- }
-
- /* try merge w/ prev entry */
- if (__rtl_memory_offset(memory) > 0)
- {
- /* not first, check prev in chain */
- register memory_type * prev;
-
- prev = queue_cast(memory, -(__rtl_memory_offset(memory)));
- DBG_MEMORY_VERIFY_CHAIN (prev);
-
- if (!__rtl_memory_used(prev))
- {
- /* prev not used, try merge, move */
- if ((memory->m_length + prev->m_length) >= n)
- {
- /* prev does fit */
- DBG_MEMORY_VERIFY_QUEUE (prev);
- queue_remove (prev);
-
- /* merge w/ prev */
- __rtl_memory_merge (prev, memory);
-
- /* move to prev */
- memmove (
- queue_cast(prev, __C__),
- queue_cast(memory, __C__),
- datlen - __C__);
- memory = prev;
- }
- }
- }
-
- if (memory->m_length >= n)
- {
- /* adjust, set 'used' bit */
- __rtl_memory_resize (memory, n);
- memory->m_length |= 0x1;
-
- /* assign result */
- p = queue_cast(memory, __C__);
- }
- else
- {
- /* allocate */
- memory_type * result = 0;
-
- /* restore 'used' bit */
- DBG_MEMORY_DEQUEUE (memory->m_length);
- memory->m_length |= 0x80000000;
-
- RTL_MEMORY_DEQUEUE (&result, n, realloc_label_1);
- if (result)
- {
- /* set 'used' bit */
- result->m_length |= 0x1;
-
- /* copy */
- memcpy (
- queue_cast(result, __C__),
- queue_cast(memory, __C__),
- datlen - __C__);
-
- /* clear 'used' bit, enqueue */
- memory->m_length &= 0x7fffffff;
- RTL_MEMORY_ENQUEUE (&memory);
- if (memory)
- {
- /* free memory page */
- RTL_MEMORY_FREE(memory, memory->m_length);
- }
-
- /* assign result */
- p = queue_cast(result, __C__);
- }
- }
- RTL_MEMORY_LEAVE();
- }
- else if (!p)
- {
- /* allocate */
- memory = 0;
- n = RTL_MEMORY_ALIGN(n, __Q__) + __C__;
-
- RTL_MEMORY_ENTER();
- RTL_MEMORY_DEQUEUE (&memory, n, realloc_label_2);
- if (memory)
- {
- /* set 'used' bit */
- memory->m_length |= 0x1;
-
- /* assign result */
- p = queue_cast(memory, __C__);
- }
- RTL_MEMORY_LEAVE();
- }
- else if (!n)
- {
- /* free */
- memory = queue_cast(p, -(__C__)); p = 0;
-
- RTL_MEMORY_ENTER();
- DBG_MEMORY_VERIFY(memory);
-
- /* clear 'used' bit, enqueue */
- memory->m_length &= ~0x1;
-
- RTL_MEMORY_ENQUEUE (&memory);
- if (memory)
- {
- /* free memory page */
- RTL_MEMORY_FREE(memory, memory->m_length);
- }
- RTL_MEMORY_LEAVE();
- }
- return (p);
-}
-#else /* FORCE_SYSALLOC */
-void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-{
- return realloc(p, (sal_Size)(n));
-}
-#endif /* FORCE_SYSALLOC */
-
-/*
- * rtl_allocateMemory.
- */
-#ifndef FORCE_SYSALLOC
-void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
-{
- void * p = 0;
- if (n > 0)
- {
- memory_type * memory = 0;
- n = RTL_MEMORY_ALIGN(n, __Q__) + __C__;
-
- RTL_MEMORY_ENTER();
- RTL_MEMORY_DEQUEUE (&memory, n, alloc_label);
- if (memory)
- {
- /* set 'used' bit */
- memory->m_length |= 0x1;
-
- /* assign result */
- p = queue_cast(memory, __C__);
- }
- RTL_MEMORY_LEAVE();
- }
- return (p);
-}
-#else /* FORCE_SYSALLOC */
-void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
-{
- return malloc((sal_Size)(n));
-}
-#endif /* FORCE_SYSALLOC */
-
-/*
- * rtl_freeMemory.
- */
-#ifndef FORCE_SYSALLOC
-void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
-{
- if (p)
- {
- memory_type * memory = queue_cast(p, -(__C__));
-
- RTL_MEMORY_ENTER();
- DBG_MEMORY_VERIFY(memory);
-
- /* clear 'used' bit, enqueue */
- memory->m_length &= ~0x1;
-
- RTL_MEMORY_ENQUEUE (&memory);
- if (memory)
- {
- /* free memory page */
- RTL_MEMORY_FREE(memory, memory->m_length);
- }
- RTL_MEMORY_LEAVE();
- }
-}
-#else /* FORCE_SYSALLOC */
-void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
-{
- free(p);
-}
-#endif /* FORCE_SYSALLOC */
-
-/*
- * rtl_allocateZeroMemory.
- */
-#ifndef FORCE_SYSALLOC
-void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
-{
- void * p = 0;
- if (n > 0)
- {
- memory_type * memory = 0;
- n = RTL_MEMORY_ALIGN(n, __Q__) + __C__;
-
- RTL_MEMORY_ENTER();
- RTL_MEMORY_DEQUEUE (&memory, n, alloc_label); /* NYI: demand zero */
- if (memory)
- {
- /* zero, set 'used' bit */
- memset ((char*)memory + __C__, 0, memory->m_length - __C__);
- memory->m_length |= 0x1;
-
- /* assign result */
- p = queue_cast(memory, __C__);
- }
- RTL_MEMORY_LEAVE();
- }
- return (p);
-}
-#else /* FORCE_SYSALLOC */
-void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
-{
- return calloc((sal_Size)(n), 1);
-}
-#endif /* FORCE_SYSALLOC */
-
-/*
- * rtl_freeZeroMemory.
- */
-#ifndef FORCE_SYSALLOC
-void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-{
- (void) n; /* unused */
- if (p)
- {
- memory_type * memory = queue_cast(p, -(__C__));
-
- RTL_MEMORY_ENTER();
- DBG_MEMORY_VERIFY(memory);
-
- /* clear 'used' bit, zero, enqueue */
- memory->m_length &= ~0x1;
- memset ((char*)memory + __C__, 0, memory->m_length - __C__);
-
- RTL_MEMORY_ENQUEUE (&memory); /* NYI: demand zero */
- if (memory)
- {
- /* free memory page */
- RTL_MEMORY_FREE(memory, memory->m_length);
- }
- RTL_MEMORY_LEAVE();
- }
-}
-#else /* FORCE_SYSALLOC */
-void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-{
- if (p)
- {
- memset(p, 0, n);
- free(p);
- }
-}
-#endif /* FORCE_SYSALLOC */
-
-/*===========================================================================
- *
- * The End.
- *
- *=========================================================================*/
diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.c
index 1a74c7e36cae..6b57df355cad 100644
--- a/sal/rtl/source/alloc_arena.c
+++ b/sal/rtl/source/alloc_arena.c
@@ -28,22 +28,13 @@
#define _BSD_SOURCE /* sys/mman.h: MAP_ANON */
#include "alloc_arena.h"
-#ifndef INCLUDED_RTL_ARENA_IMPL_H
#include "alloc_impl.h"
-#endif
#include "internal/once.h"
#include "sal/macros.h"
#include "osl/diagnose.h"
-#ifndef INCLUDED_STRING_H
#include <string.h>
-#endif
-
-#ifndef INCLUDED_STDIO_H
#include <stdio.h>
-#endif
-
-#include "sal/types.h"
#ifdef OS2
#undef OSL_TRACE
@@ -967,6 +958,7 @@ try_alloc:
if (result != 0)
{
rtl_arena_type * arena = result;
+ VALGRIND_CREATE_MEMPOOL(arena, 0, 0);
rtl_arena_constructor (arena);
if (!source_arena)
@@ -989,6 +981,7 @@ try_alloc:
{
rtl_arena_deactivate (arena);
rtl_arena_destructor (arena);
+ VALGRIND_DESTROY_MEMPOOL(arena);
rtl_arena_free (gp_arena_arena, arena, size);
}
}
@@ -1014,6 +1007,7 @@ SAL_CALL rtl_arena_destroy (
{
rtl_arena_deactivate (arena);
rtl_arena_destructor (arena);
+ VALGRIND_DESTROY_MEMPOOL(arena);
rtl_arena_free (gp_arena_arena, arena, sizeof(rtl_arena_type));
}
}
@@ -1069,6 +1063,10 @@ SAL_CALL rtl_arena_alloc (
rtl_arena_hash_insert (arena, segment);
+ /* DEBUG ONLY: mark allocated, undefined */
+ OSL_DEBUG_ONLY(memset((void*)(segment->m_addr), 0x77777777, segment->m_size));
+ VALGRIND_MEMPOOL_ALLOC(arena, segment->m_addr, segment->m_size);
+
(*pSize) = segment->m_size;
addr = (void*)(segment->m_addr);
}
@@ -1112,6 +1110,11 @@ SAL_CALL rtl_arena_free (
{
rtl_arena_segment_type *next, *prev;
+ /* DEBUG ONLY: mark unallocated, undefined */
+ VALGRIND_MEMPOOL_FREE(arena, segment->m_addr);
+ /* OSL_DEBUG_ONLY() */ VALGRIND_MAKE_MEM_UNDEFINED(segment->m_addr, segment->m_size);
+ OSL_DEBUG_ONLY(memset((void*)(segment->m_addr), 0x33333333, segment->m_size));
+
/* coalesce w/ adjacent free segment(s) */
rtl_arena_segment_coalesce (arena, segment);
@@ -1303,6 +1306,7 @@ rtl_arena_once_init (void)
static rtl_arena_type g_machdep_arena;
OSL_ASSERT(gp_machdep_arena == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_machdep_arena, 0, 0);
rtl_arena_constructor (&g_machdep_arena);
gp_machdep_arena = rtl_arena_activate (
@@ -1319,6 +1323,7 @@ rtl_arena_once_init (void)
static rtl_arena_type g_default_arena;
OSL_ASSERT(gp_default_arena == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_default_arena, 0, 0);
rtl_arena_constructor (&g_default_arena);
gp_default_arena = rtl_arena_activate (
@@ -1337,6 +1342,7 @@ rtl_arena_once_init (void)
static rtl_arena_type g_arena_arena;
OSL_ASSERT(gp_arena_arena == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_arena_arena, 0, 0);
rtl_arena_constructor (&g_arena_arena);
gp_arena_arena = rtl_arena_activate (
@@ -1362,7 +1368,18 @@ rtl_arena_init (void)
/* ================================================================= */
-#if defined(__GNUC__)
+/*
+ Issue http://udk.openoffice.org/issues/show_bug.cgi?id=92388
+
+ Mac OS X does not seem to support "__cxa__atexit", thus leading
+ to the situation that "__attribute__((destructor))__" functions
+ (in particular "rtl_{memory|cache|arena}_fini") become called
+ _before_ global C++ object d'tors.
+
+ Delegated the call to "rtl_arena_fini()" into a dummy C++ object,
+ see alloc_fini.cxx .
+*/
+#if defined(__GNUC__) && !defined(MACOSX)
static void rtl_arena_fini (void) __attribute__((destructor));
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#pragma fini(rtl_arena_fini)
diff --git a/sal/rtl/source/alloc_cache.c b/sal/rtl/source/alloc_cache.c
index 4e2c030fb3a6..f4d34bfdb437 100644
--- a/sal/rtl/source/alloc_cache.c
+++ b/sal/rtl/source/alloc_cache.c
@@ -507,6 +507,10 @@ rtl_cache_slab_alloc (
addr = (void*)rtl_cache_hash_insert (cache, bufctl);
else
addr = bufctl;
+
+ /* DEBUG ONLY: mark allocated, undefined */
+ OSL_DEBUG_ONLY(memset(addr, 0x77777777, cache->m_type_size));
+ VALGRIND_MEMPOOL_ALLOC(cache, addr, cache->m_type_size);
}
RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock));
@@ -529,6 +533,11 @@ rtl_cache_slab_free (
RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock));
+ /* DEBUG ONLY: mark unallocated, undefined */
+ VALGRIND_MEMPOOL_FREE(cache, addr);
+ /* OSL_DEBUG_ONLY() */ VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size);
+ OSL_DEBUG_ONLY(memset(addr, 0x33333333, cache->m_type_size));
+
/* determine slab from addr */
if (cache->m_features & RTL_CACHE_FEATURE_HASH)
{
@@ -635,8 +644,13 @@ rtl_cache_magazine_clear (
void * obj = mag->m_objects[mag->m_mag_used - 1];
mag->m_objects[mag->m_mag_used - 1] = 0;
+ /* DEBUG ONLY: mark cached object allocated, undefined */
+ VALGRIND_MEMPOOL_ALLOC(cache, obj, cache->m_type_size);
if (cache->m_destructor != 0)
{
+ /* DEBUG ONLY: keep constructed object defined */
+ VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
+
/* destruct object */
(cache->m_destructor)(obj, cache->m_userarg);
}
@@ -965,11 +979,16 @@ rtl_cache_deactivate (
rtl_cache_type * cache
)
{
+ int active = 1;
+
/* remove from cache list */
RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock));
+ active = QUEUE_STARTED_NAMED(cache, cache_) == 0;
QUEUE_REMOVE_NAMED(cache, cache_);
RTL_MEMORY_LOCK_RELEASE(&(g_cache_list.m_lock));
+ OSL_PRECOND(active, "rtl_cache_deactivate(): orphaned cache.");
+
/* cleanup magazine layer */
if (cache->m_magazine_cache != 0)
{
@@ -1121,6 +1140,7 @@ try_alloc:
if (result != 0)
{
rtl_cache_type * cache = result;
+ VALGRIND_CREATE_MEMPOOL(cache, 0, 0);
(void) rtl_cache_constructor (cache);
if (!source)
@@ -1148,6 +1168,7 @@ try_alloc:
/* activation failed */
rtl_cache_deactivate (cache);
rtl_cache_destructor (cache);
+ VALGRIND_DESTROY_MEMPOOL(cache);
rtl_arena_free (gp_cache_arena, cache, size);
}
}
@@ -1172,6 +1193,7 @@ void SAL_CALL rtl_cache_destroy (
{
rtl_cache_deactivate (cache);
rtl_cache_destructor (cache);
+ VALGRIND_DESTROY_MEMPOOL(cache);
rtl_arena_free (gp_cache_arena, cache, sizeof(rtl_cache_type));
}
}
@@ -1201,6 +1223,14 @@ SAL_CALL rtl_cache_alloc (
if ((curr != 0) && (curr->m_mag_used > 0))
{
obj = curr->m_objects[--curr->m_mag_used];
+#if defined(HAVE_VALGRIND_MEMCHECK_H)
+ VALGRIND_MEMPOOL_ALLOC(cache, obj, cache->m_type_size);
+ if (cache->m_constructor != 0)
+ {
+ /* keep constructed object defined */
+ VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
+ }
+#endif /* HAVE_VALGRIND_MEMCHECK_H */
cache->m_cpu_stats.m_alloc += 1;
RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
@@ -1244,7 +1274,6 @@ SAL_CALL rtl_cache_alloc (
rtl_cache_slab_free (cache, obj), obj = 0;
}
}
-
return (obj);
}
@@ -1269,6 +1298,9 @@ SAL_CALL rtl_cache_free (
if ((curr != 0) && (curr->m_mag_used < curr->m_mag_size))
{
curr->m_objects[curr->m_mag_used++] = obj;
+#if defined(HAVE_VALGRIND_MEMCHECK_H)
+ VALGRIND_MEMPOOL_FREE(cache, obj);
+#endif /* HAVE_VALGRIND_MEMCHECK_H */
cache->m_cpu_stats.m_free += 1;
RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
@@ -1582,6 +1614,7 @@ rtl_cache_once_init (void)
static rtl_cache_type g_cache_magazine_cache;
OSL_ASSERT(gp_cache_magazine_cache == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_cache_magazine_cache, 0, 0);
(void) rtl_cache_constructor (&g_cache_magazine_cache);
gp_cache_magazine_cache = rtl_cache_activate (
@@ -1606,6 +1639,7 @@ rtl_cache_once_init (void)
static rtl_cache_type g_cache_slab_cache;
OSL_ASSERT(gp_cache_slab_cache == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_cache_slab_cache, 0, 0);
(void) rtl_cache_constructor (&g_cache_slab_cache);
gp_cache_slab_cache = rtl_cache_activate (
@@ -1627,6 +1661,7 @@ rtl_cache_once_init (void)
static rtl_cache_type g_cache_bufctl_cache;
OSL_ASSERT(gp_cache_bufctl_cache == 0);
+ VALGRIND_CREATE_MEMPOOL(&g_cache_bufctl_cache, 0, 0);
(void) rtl_cache_constructor (&g_cache_bufctl_cache);
gp_cache_bufctl_cache = rtl_cache_activate (
@@ -1657,7 +1692,18 @@ rtl_cache_init (void)
/* ================================================================= */
-#if defined(__GNUC__)
+/*
+ Issue http://udk.openoffice.org/issues/show_bug.cgi?id=92388
+
+ Mac OS X does not seem to support "__cxa__atexit", thus leading
+ to the situation that "__attribute__((destructor))__" functions
+ (in particular "rtl_{memory|cache|arena}_fini") become called
+ _before_ global C++ object d'tors.
+
+ Delegated the call to "rtl_cache_fini()" into a dummy C++ object,
+ see alloc_fini.cxx .
+*/
+#if defined(__GNUC__) && !defined(MACOSX)
static void rtl_cache_fini (void) __attribute__((destructor));
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#pragma fini(rtl_cache_fini)
@@ -1678,18 +1724,21 @@ rtl_cache_fini (void)
cache = gp_cache_bufctl_cache, gp_cache_bufctl_cache = 0;
rtl_cache_deactivate (cache);
rtl_cache_destructor (cache);
+ VALGRIND_DESTROY_MEMPOOL(cache);
}
if (gp_cache_slab_cache != 0)
{
cache = gp_cache_slab_cache, gp_cache_slab_cache = 0;
rtl_cache_deactivate (cache);
rtl_cache_destructor (cache);
+ VALGRIND_DESTROY_MEMPOOL(cache);
}
if (gp_cache_magazine_cache != 0)
{
cache = gp_cache_magazine_cache, gp_cache_magazine_cache = 0;
rtl_cache_deactivate (cache);
rtl_cache_destructor (cache);
+ VALGRIND_DESTROY_MEMPOOL(cache);
}
if (gp_cache_arena != 0)
{
diff --git a/sal/rtl/source/memory_fini.cxx b/sal/rtl/source/alloc_fini.cxx
index f88f09887595..cb04a525e75e 100755
--- a/sal/rtl/source/memory_fini.cxx
+++ b/sal/rtl/source/alloc_fini.cxx
@@ -25,30 +25,31 @@
*
************************************************************************/
-
/*
Issue http://udk.openoffice.org/issues/show_bug.cgi?id=92388
Mac OS X does not seem to support "__cxa__atexit", thus leading
to the situation that "__attribute__((destructor))__" functions
- (in particular "rtl_memory_fini") become called _before_ global
- C++ object d'tors.
+ (in particular "rtl_{memory|cache|arena}_fini") become called
+ _before_ global C++ object d'tors.
Using a C++ dummy object instead.
*/
-#include <stdio.h>
-
extern "C" void rtl_memory_fini (void);
+extern "C" void rtl_cache_fini (void);
+extern "C" void rtl_arena_fini (void);
-
-struct RTL_Memory_Fini {
- ~RTL_Memory_Fini() ;
+struct RTL_Alloc_Fini
+{
+ ~RTL_Alloc_Fini() ;
};
-RTL_Memory_Fini::~RTL_Memory_Fini() {
+RTL_Alloc_Fini::~RTL_Alloc_Fini()
+{
rtl_memory_fini();
+ rtl_cache_fini();
+ rtl_arena_fini();
}
-
-static RTL_Memory_Fini rtl_Memory_Fini;
+static RTL_Alloc_Fini g_RTL_Alloc_Fini;
diff --git a/sal/rtl/source/alloc_global.c b/sal/rtl/source/alloc_global.c
index 5137f868127d..5da66ca49d96 100644
--- a/sal/rtl/source/alloc_global.c
+++ b/sal/rtl/source/alloc_global.c
@@ -26,6 +26,7 @@
************************************************************************/
#include "rtl/alloc.h"
+#include "alloc_impl.h"
#ifndef INCLUDED_STRING_H
#include <string.h>
@@ -44,7 +45,6 @@
#include <stdio.h>
#define INCLUDED_STDIO_H
#endif
-#include "alloc_impl.h"
#include "internal/once.h"
#include "sal/macros.h"
#include "osl/diagnose.h"
@@ -151,11 +151,11 @@ rtl_memory_init (void)
Mac OS X does not seem to support "__cxa__atexit", thus leading
to the situation that "__attribute__((destructor))__" functions
- (in particular "rtl_memory_fini") become called _before_ global
- C++ object d'tors.
+ (in particular "rtl_{memory|cache|arena}_fini") become called
+ _before_ global C++ object d'tors.
- Delegated the call to "rtl_memory_fini" into a dummy C++ object,
- see memory_fini.cxx .
+ Delegated the call to "rtl_memory_fini()" into a dummy C++ object,
+ see alloc_fini.cxx .
*/
#if defined(__GNUC__) && !defined(MACOSX)
static void rtl_memory_fini (void) __attribute__((destructor));
diff --git a/sal/rtl/source/alloc_impl.h b/sal/rtl/source/alloc_impl.h
index d3d1924ddf91..a95b7c47465c 100644
--- a/sal/rtl/source/alloc_impl.h
+++ b/sal/rtl/source/alloc_impl.h
@@ -240,6 +240,30 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
#define RTL_CACHE_FLAG_QUANTUMCACHE (2 << 13) /* used as arena quantum cache */
+/** Valgrind support macros.
+ */
+#if !defined(HAVE_MEMCHECK_H) || (OSL_DEBUG_LEVEL == 0)
+#if !defined(NVALGRIND)
+#define NVALGRIND 1
+#endif /* ! NVALGRIND */
+#endif /* ! HAVE_MEMCHECK_H || (OSL_DEBUG_LEVEL == 0) */
+
+#if defined(NVALGRIND)
+#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
+#define VALGRIND_MAKE_MEM_DEFINED(addr, size)
+#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)
+#define VALGRIND_FREELIKE_BLOCK(addr, rzB)
+#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)
+#define VALGRIND_DESTROY_MEMPOOL(pool)
+#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
+#define VALGRIND_MEMPOOL_FREE(pool, addr)
+#elif defined(HAVE_MEMCHECK_H)
+#include <memcheck.h>
+#if !defined(FORCE_SYSALLOC)
+#define FORCE_SYSALLOC 1
+#endif /* !FORCE_SYSALLOC */
+#endif /* NVALGRIND || HAVE_MEMCHECK_H */
+
#ifdef __cplusplus
}
#endif
diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk
index 9968d8992be4..145aa50b8be0 100644
--- a/sal/rtl/source/makefile.mk
+++ b/sal/rtl/source/makefile.mk
@@ -46,6 +46,11 @@ TARGETTYPE=CUI
.INCLUDE : settings.mk
+.IF "$(VALGRIND_CFLAGS)" != ""
+CFLAGS += $(VALGRIND_CFLAGS)
+CDEFS += -DHAVE_MEMCHECK_H=1
+.ENDIF # VALGRIND_CFLAGS
+
.IF "$(ALLOC)" == "SYS_ALLOC" || "$(ALLOC)" == "TCMALLOC" || "$(ALLOC)" == "JEMALLOC"
CDEFS+= -DFORCE_SYSALLOC
.ENDIF
@@ -96,7 +101,7 @@ SLOFILES= \
$(SLO)$/alloc_arena.obj
.IF "$(OS)"=="MACOSX"
-SLOFILES+=$(SLO)$/memory_fini.obj
+SLOFILES+=$(SLO)$/alloc_fini.obj
.ENDIF
@@ -129,7 +134,7 @@ OBJFILES= \
$(OBJ)$/alloc_arena.obj
.IF "$(OS)"=="MACOSX"
-OBJFILES+=$(OBJ)$/memory_fini.obj
+OBJFILES+=$(OBJ)$/alloc_fini.obj
.ENDIF
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 534c2333bd9b..084ccb7ba977 100644..100755
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -704,7 +704,7 @@ void ScDocument::UpdateFontCharSet()
pItem = (SvxFontItem*)pPool->GetItem2(ATTR_FONT, i);
if ( pItem && ( pItem->GetCharSet() == eSrcSet ||
( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
- pItem->GetCharSet() = eSysSet;
+ pItem->SetCharSet(eSysSet);
}
if ( pDrawLayer )
@@ -716,7 +716,7 @@ void ScDocument::UpdateFontCharSet()
pItem = (SvxFontItem*)rDrawPool.GetItem2(EE_CHAR_FONTINFO, i);
if ( pItem && ( pItem->GetCharSet() == eSrcSet ||
( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
- pItem->GetCharSet() = eSysSet;
+ pItem->SetCharSet( eSysSet );
}
}
}
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 85447b6a8730..c1e261e3ba0a 100644..100755
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -387,7 +387,7 @@ sal_Bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVe
CharSet eSysSet = gsl_getSystemTextEncoding();
CharSet eSrcSet = rStream.GetStreamCharSet();
if( eSrcSet != eSysSet && aFont.GetCharSet() == eSrcSet )
- aFont.GetCharSet() = eSysSet;
+ aFont.SetCharSet(eSysSet);
aStacked.SetValue( aOrientation.IsStacked() );
aRotateAngle.SetValue( aOrientation.GetRotation( aRotateAngle.GetValue() ) );
diff --git a/scp2/source/ooo/scpaction_ooo.scp b/scp2/source/ooo/scpaction_ooo.scp
index d6f294f1da08..b95df7d7f3ac 100644
--- a/scp2/source/ooo/scpaction_ooo.scp
+++ b/scp2/source/ooo/scpaction_ooo.scp
@@ -347,15 +347,6 @@ ScpAction scp_Copy_Xpd_Help_Html_Uninstallationprologue_En_Us
Subdir = "installdata/html";
End
-#if defined LINUX || defined SOLARIS
-ScpAction scp_Copy_Update_Script
- Copy = "update";
- Name = "update";
- Styles = (SCPZIP_REPLACE);
- UnixRights = 775;
-End
-#endif
-
#ifdef MACOSX
ScpAction scp_Copy_Dmg_Background_Image
#if defined(BUILD_SPECIAL)
diff --git a/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java
new file mode 100644
index 000000000000..fffb78523798
--- /dev/null
+++ b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 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.
+*
+************************************************************************/
+
+package com.sun.star.script.framework.provider;
+
+import javax.swing.SwingUtilities;
+
+// On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call
+// SwingUtilities.invokeLater always on a fresh thread to avoid that problem
+// (also, the current thread must not wait for that fresh thread to terminate,
+// as that would cause a deadlock if this thread is the AppKit thread):
+public final class SwingInvocation {
+ public static void invoke(final Runnable doRun) {
+ new Thread("SwingInvocation") {
+ public void run() { SwingUtilities.invokeLater(doRun); }
+ }.start();
+ }
+
+ private SwingInvocation() {}
+}
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index 4fd5d85ac28d..167e9297e861 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -47,6 +47,7 @@ import java.util.HashMap;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.script.framework.provider.ScriptEditor;
+import com.sun.star.script.framework.provider.SwingInvocation;
import com.sun.star.script.framework.container.ScriptMetaData;
import com.sun.star.script.framework.provider.ClassLoaderFactory;
@@ -128,7 +129,9 @@ public class ScriptEditorForBeanShell
*/
public static ScriptEditorForBeanShell getEditor(URL url)
{
- return (ScriptEditorForBeanShell)BEING_EDITED.get(url);
+ synchronized (BEING_EDITED) {
+ return (ScriptEditorForBeanShell)BEING_EDITED.get(url);
+ }
}
/**
@@ -194,8 +197,7 @@ public class ScriptEditorForBeanShell
* @param context The context in which to execute the script
*
*/
- public void edit(XScriptContext context, ScriptMetaData entry) {
-
+ public void edit(final XScriptContext context, ScriptMetaData entry) {
if (entry != null ) {
try {
ClassLoader cl = null;
@@ -205,26 +207,30 @@ public class ScriptEditorForBeanShell
catch (Exception ignore) // TODO re-examine error handling
{
}
+ final ClassLoader theCl = cl;
String sUrl = entry.getParcelLocation();
if ( !sUrl.endsWith( "/" ) )
{
sUrl += "/";
}
sUrl += entry.getLanguageName();
- URL url = entry.getSourceURL();
-
- // check if there is already an editing session for this script
- if (BEING_EDITED.containsKey(url))
- {
- ScriptEditorForBeanShell editor =
- (ScriptEditorForBeanShell) BEING_EDITED.get(url);
-
- editor.frame.toFront();
- }
- else
- {
- new ScriptEditorForBeanShell(context, cl, url);
- }
+ final URL url = entry.getSourceURL();
+ SwingInvocation.invoke(
+ new Runnable() {
+ public void run() {
+ ScriptEditorForBeanShell editor;
+ synchronized (BEING_EDITED) {
+ editor = (ScriptEditorForBeanShell)
+ BEING_EDITED.get(url);
+ if (editor == null) {
+ editor = new ScriptEditorForBeanShell(
+ context, theCl, url);
+ BEING_EDITED.put(url, editor);
+ }
+ }
+ editor.frame.toFront();
+ }
+ });
}
catch (IOException ioe) {
showErrorMessage( "Error loading file: " + ioe.getMessage() );
@@ -269,8 +275,6 @@ public class ScriptEditorForBeanShell
this.model.setView(this.view);
initUI();
frame.show();
-
- BEING_EDITED.put(url, this);
}
private void showErrorMessage(String message) {
@@ -384,7 +388,7 @@ public class ScriptEditorForBeanShell
private void shutdown()
{
- if (BEING_EDITED.containsKey(scriptURL)) {
+ synchronized (BEING_EDITED) {
BEING_EDITED.remove(scriptURL);
}
}
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
index b9849d1e4e1d..0b62ece9cc9f 100644
--- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
+++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
@@ -36,6 +36,7 @@ import org.mozilla.javascript.tools.debugger.ScopeProvider;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.script.framework.container.ScriptMetaData;
import com.sun.star.script.framework.provider.ScriptEditor;
+import com.sun.star.script.framework.provider.SwingInvocation;
import com.sun.star.script.framework.log.LogUtils;
import java.io.InputStream;
@@ -45,7 +46,6 @@ import java.net.URL;
import java.util.Map;
import java.util.HashMap;
-import javax.swing.SwingUtilities;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -117,7 +117,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor
*/
public static ScriptEditorForJavaScript getEditor(URL url)
{
- return (ScriptEditorForJavaScript)BEING_EDITED.get(url);
+ synchronized (BEING_EDITED) {
+ return (ScriptEditorForJavaScript)BEING_EDITED.get(url);
+ }
}
/**
@@ -187,31 +189,25 @@ public class ScriptEditorForJavaScript implements ScriptEditor
sUrl += "/";
}
sUrl += entry.getLanguageName();
- URL url = entry.getSourceURL();
-
- // check if there is already an editing session for this script
- //if (BEING_EDITED.containsKey(url))
- if ( rhinoWindow != null )
- {
- ScriptEditorForJavaScript editor =
- (ScriptEditorForJavaScript) BEING_EDITED.get(url);
- if ( editor == null )
- {
- editor = new ScriptEditorForJavaScript( context, url );
- editor.edit( context, entry );
- }
- else
- {
- rhinoWindow.showScriptWindow( url );
- }
- }
- else
- {
- ScriptEditorForJavaScript editor =
- new ScriptEditorForJavaScript( context, url );
-
- }
- rhinoWindow.toFront();
+ final URL url = entry.getSourceURL();
+ SwingInvocation.invoke(
+ new Runnable() {
+ public void run() {
+ synchronized (BEING_EDITED) {
+ ScriptEditorForJavaScript editor =
+ (ScriptEditorForJavaScript) BEING_EDITED.get(
+ url);
+ if (editor == null) {
+ editor = new ScriptEditorForJavaScript(
+ context, url);
+ BEING_EDITED.put(url, editor);
+ }
+ }
+ assert rhinoWindow != null;
+ rhinoWindow.showScriptWindow(url);
+ rhinoWindow.toFront();
+ }
+ });
}
catch ( IOException e )
{
@@ -234,11 +230,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor
this.scriptURL = url;
- synchronized( ScriptEditorForJavaScript.class )
- {
- BEING_EDITED.put(url, this);
- }
-
}
/**
@@ -274,13 +265,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor
}
final Main sdb = new Main("Rhino JavaScript Debugger");
- swingInvoke(new Runnable() {
- public void run() {
- sdb.pack();
- sdb.setSize(640, 640);
- sdb.setVisible(true);
- }
- });
+ sdb.pack();
+ sdb.setSize(640, 640);
+ sdb.setVisible(true);
sdb.setExitAction(new Runnable() {
public void run() {
sdb.clearAllBreakpoints();
@@ -306,18 +293,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor
}
}
- private static void swingInvoke(Runnable f) {
- if (SwingUtilities.isEventDispatchThread()) {
- f.run();
- return;
- }
- try {
- SwingUtilities.invokeAndWait(f);
- } catch (Exception exc) {
- LogUtils.DEBUG( LogUtils.getTrace( exc ) );
- }
- }
-
private void shutdown()
{
// dereference Rhino Debugger window
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 52b9723bc178..a2abfd199fe9 100755
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1060,6 +1060,9 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
{
SvxNumberFormat aFrmt( pDefaultRule->GetLevel(i) );
aFrmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFrmt.SetPrefix(::rtl::OUString());
+ aFrmt.SetSuffix(::rtl::OUString());
aFrmt.SetStart(1);
aFrmt.SetBulletRelSize(45);
aFrmt.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 902c6f48a9a7..95c2833a2d12 100755..100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -141,8 +141,9 @@ BasicViewFactory::BasicViewFactory (
mpViewShellContainer(new ViewShellContainer()),
mpBase(NULL),
mpFrameView(NULL),
+ mpWindow(new WorkWindow(NULL,WB_STDWORK)),
mpViewCache(new ViewCache()),
- mxLocalPane(new Pane(Reference<XResourceId>(), new WorkWindow(NULL,WB_STDWORK)))
+ mxLocalPane(new Pane(Reference<XResourceId>(), mpWindow.get()))
{
(void)rxContext;
}
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.hxx b/sd/source/ui/framework/factories/BasicViewFactory.hxx
index 0cdb45ffc7c1..50edcc919899 100755
--- a/sd/source/ui/framework/factories/BasicViewFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.hxx
@@ -119,6 +119,7 @@ private:
FrameView* mpFrameView;
class ViewCache;
+ ::boost::shared_ptr<Window> mpWindow;
::boost::shared_ptr<ViewCache> mpViewCache;
css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx
index e910a8df7496..27d18fec51c1 100755
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -143,6 +143,10 @@ ModuleController::~ModuleController (void) throw()
void SAL_CALL ModuleController::disposing (void)
{
+ // Break the cyclic reference back to DrawController object
+ mpLoadedFactories.reset();
+ mpResourceToFactoryMap.reset();
+ mxController.clear();
}
diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx
index abe45670c100..c4efbbba1612 100755
--- a/sd/source/ui/func/fuhhconv.cxx
+++ b/sd/source/ui/func/fuhhconv.cxx
@@ -203,11 +203,11 @@ void FuHangulHanjaConversion::ConvertStyles( sal_Int16 nTargetLanguage, const Fo
{
// set new font attribute
SvxFontItem aFontItem( (SvxFontItem&) rSet.Get( EE_CHAR_FONTINFO_CJK ) );
- aFontItem.GetFamilyName() = pTargetFont->GetName();
- aFontItem.GetFamily() = pTargetFont->GetFamily();
- aFontItem.GetStyleName() = pTargetFont->GetStyleName();
- aFontItem.GetPitch() = pTargetFont->GetPitch();
- aFontItem.GetCharSet() = pTargetFont->GetCharSet();
+ aFontItem.SetFamilyName( pTargetFont->GetName());
+ aFontItem.SetFamily( pTargetFont->GetFamily());
+ aFontItem.SetStyleName( pTargetFont->GetStyleName());
+ aFontItem.SetPitch( pTargetFont->GetPitch());
+ aFontItem.SetCharSet( pTargetFont->GetCharSet());
rSet.Put( aFontItem );
}
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 991beade0f2f..7134358e80bc 100755
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -498,7 +498,7 @@ void PresenterTextView::Implementation::SetFontDescriptor (
mpEditEngineItemPool->SetPoolDefaultItem( aFontHeight);
SvxFontItem aSvxFontItem (EE_CHAR_FONTINFO);
- aSvxFontItem.GetFamilyName() = rFontDescriptor.Name;
+ aSvxFontItem.SetFamilyName( rFontDescriptor.Name );
mpEditEngineItemPool->SetPoolDefaultItem(aSvxFontItem);
mnTotalHeight = -1;
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 43d5928df349..390ade9c7a7e 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -372,7 +372,12 @@ bool SlideSorterController::Command (
{
bool bEventHasBeenHandled = false;
+ if (pWindow == NULL)
+ return false;
+
ViewShell* pViewShell = mrSlideSorter.GetViewShell();
+ if (pViewShell == NULL)
+ return false;
switch (rEvent.GetCommand())
{
diff --git a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
index 48882d0f2f9e..d1c5d2c0ff53 100644..100755
--- a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
@@ -31,9 +31,9 @@
#include "TaskPaneFocusManager.hxx"
#include <vcl/window.hxx>
-#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
+#include <rtl/instance.hxx>
#include <hash_map>
namespace {
@@ -70,16 +70,23 @@ class FocusManager::LinkMap
-FocusManager* FocusManager::spInstance = NULL;
-
-
FocusManager& FocusManager::Instance (void)
{
+ static FocusManager* spInstance = NULL;
+
if (spInstance == NULL)
{
- ::vos::OGuard aGuard (::Application::GetSolarMutex());
+ ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
if (spInstance == NULL)
- spInstance = new FocusManager ();
+ {
+ static FocusManager aInstance;
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ spInstance = &aInstance;
+ }
+ }
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
return *spInstance;
}
diff --git a/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx b/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
index b9b28154dc5b..0b5199a9a7cc 100644..100755
--- a/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
+++ b/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
@@ -103,7 +103,6 @@ public:
bool TransferFocus (::Window* pSource, const KeyCode& rCode);
private:
- static FocusManager* spInstance;
class LinkMap;
::std::auto_ptr<LinkMap> mpLinks;
diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
index 29018cb3a3ca..9b6e45c35194 100755
--- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
@@ -227,7 +227,7 @@ void CurrentMasterPagesSelector::Execute (SfxRequest& rRequest)
// i.e. is not used.
SdPage* pMasterPage = GetSelectedMasterPage();
if (pMasterPage != NULL
- && mrDocument.GetMasterPageUserCount(pMasterPage) > 0)
+ && mrDocument.GetMasterPageUserCount(pMasterPage) == 0)
{
// Removing the precious flag so that the following call to
// RemoveUnnessesaryMasterPages() will remove this master page.
diff --git a/sdext/source/pdfimport/config/description.xml b/sdext/source/pdfimport/config/description.xml
index 1fdd3b28aea1..93cdecfc5e4d 100644
--- a/sdext/source/pdfimport/config/description.xml
+++ b/sdext/source/pdfimport/config/description.xml
@@ -16,7 +16,7 @@
</simple-license>
</registration>
- <version value="1.0.4" />
+ <version value="1.0.5" />
<platform value="UPDATED_SUPPORTED_PLATFORM" />
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index e9d58cfdb3b2..d5fcf30a803c 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -718,6 +718,8 @@ uno::Reference< io::XStream > getAdditionalStream( const rtl::OUString&
rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd,
RTL_TEXTENCODING_ISO_8859_1 );
bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() );
+ // trash password string on heap
+ rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() );
}
if( ! bAuthenticated )
{
@@ -745,6 +747,8 @@ uno::Reference< io::XStream > getAdditionalStream( const rtl::OUString&
rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd,
RTL_TEXTENCODING_ISO_8859_1 );
bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() );
+ // trash password string on heap
+ rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() );
} while( bEntered && ! bAuthenticated );
}
diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx
index 4d19d9140a09..683c438bdf54 100644
--- a/sdext/source/pdfimport/inc/pdfparse.hxx
+++ b/sdext/source/pdfimport/inc/pdfparse.hxx
@@ -260,6 +260,8 @@ struct PDFFile : public PDFContainer
bool decrypt( const sal_uInt8* pInBuffer, sal_uInt32 nLen,
sal_uInt8* pOutBuffer,
unsigned int nObject, unsigned int nGeneration ) const;
+
+ rtl::OUString getDecryptionKey() const;
};
struct PDFObject : public PDFContainer
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index a2ff6b996ff2..e741d7499915 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -32,6 +32,7 @@
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
#include <rtl/alloc.h>
#include <rtl/digest.h>
#include <rtl/cipher.h>
@@ -59,6 +60,8 @@ struct EmitImplData
XRefTable m_aXRefTable;
// container of all indirect objects (usually a PDFFile*)
const PDFContainer* m_pObjectContainer;
+ unsigned int m_nDecryptObject;
+ unsigned int m_nDecryptGeneration;
// returns true if the xref table was updated
bool insertXref( unsigned int nObject, unsigned int nGeneration, unsigned int nOffset )
@@ -80,7 +83,9 @@ struct EmitImplData
}
EmitImplData( const PDFContainer* pTopContainer ) :
- m_pObjectContainer( pTopContainer )
+ m_pObjectContainer( pTopContainer ),
+ m_nDecryptObject( 0 ),
+ m_nDecryptGeneration( 0 )
{}
~EmitImplData() {}
bool decrypt( const sal_uInt8* pInBuffer, sal_uInt32 nLen, sal_uInt8* pOutBuffer,
@@ -89,6 +94,12 @@ struct EmitImplData
const PDFFile* pFile = dynamic_cast<const PDFFile*>(m_pObjectContainer);
return pFile ? pFile->decrypt( pInBuffer, nLen, pOutBuffer, nObject, nGeneration ) : false;
}
+
+ void setDecryptObject( unsigned int nObject, unsigned int nGeneration )
+ {
+ m_nDecryptObject = nObject;
+ m_nDecryptGeneration = nGeneration;
+ }
};
}
@@ -199,6 +210,46 @@ bool PDFString::emit( EmitContext& rWriteContext ) const
{
if( ! rWriteContext.write( " ", 1 ) )
return false;
+ EmitImplData* pEData = getEmitData( rWriteContext );
+ if( rWriteContext.m_bDecrypt && pEData && pEData->m_nDecryptObject )
+ {
+ OString aFiltered( getFilteredString() );
+ // decrypt inplace (evil since OString is supposed to be const
+ // however in this case we know that getFilteredString returned a singular string instance
+ pEData->decrypt( (sal_uInt8*)aFiltered.getStr(), aFiltered.getLength(),
+ (sal_uInt8*)aFiltered.getStr(),
+ pEData->m_nDecryptObject, pEData->m_nDecryptGeneration );
+ // check for string or hex string
+ const sal_Char* pStr = aFiltered.getStr();
+ if( aFiltered.getLength() > 1 &&
+ ( (pStr[0] == sal_Char(0xff) && pStr[1] == sal_Char(0xfe)) ||
+ (pStr[0] == sal_Char(0xfe) && pStr[1] == sal_Char(0xff)) ) )
+ {
+ static const char pHexTab[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ if( ! rWriteContext.write( "<", 1 ) )
+ return false;
+ for( sal_Int32 i = 0; i < aFiltered.getLength(); i++ )
+ {
+ if( ! rWriteContext.write( pHexTab + ((sal_uInt32(pStr[i]) >> 4) & 0x0f), 1 ) )
+ return false;
+ if( ! rWriteContext.write( pHexTab + (sal_uInt32(pStr[i]) & 0x0f), 1 ) )
+ return false;
+ }
+ if( ! rWriteContext.write( ">", 1 ) )
+ return false;
+ }
+ else
+ {
+ if( ! rWriteContext.write( "(", 1 ) )
+ return false;
+ if( ! rWriteContext.write( aFiltered.getStr(), aFiltered.getLength() ) )
+ return false;
+ if( ! rWriteContext.write( ")", 1 ) )
+ return false;
+ }
+ return true;
+ }
return rWriteContext.write( m_aString.getStr(), m_aString.getLength() );
}
@@ -418,6 +469,15 @@ bool PDFContainer::emitSubElements( EmitContext& rWriteContext ) const
int nEle = m_aSubElements.size();
for( int i = 0; i < nEle; i++ )
{
+ if( rWriteContext.m_bDecrypt )
+ {
+ const PDFName* pName = dynamic_cast<PDFName*>(m_aSubElements[i]);
+ if( pName && pName->m_aName.equals( rtl::OString("Encrypt") ) )
+ {
+ i++;
+ continue;
+ }
+ }
if( ! m_aSubElements[i]->emit( rWriteContext ) )
return false;
}
@@ -735,7 +795,7 @@ bool PDFObject::writeStream( EmitContext& rWriteContext, const PDFFile* pParsedF
{
char* pStream = NULL;
unsigned int nBytes = 0;
- if( getDeflatedStream( &pStream, &nBytes, pParsedFile, rWriteContext ) && nBytes )
+ if( getDeflatedStream( &pStream, &nBytes, pParsedFile, rWriteContext ) && nBytes && rWriteContext.m_bDeflate )
{
sal_uInt8* pOutBytes = NULL;
sal_uInt32 nOutBytes = 0;
@@ -767,17 +827,27 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
if( ! rWriteContext.write( aBuf.getStr(), aBuf.getLength() ) )
return false;
- if( rWriteContext.m_bDeflate && pEData )
+ if( pEData )
+ pEData->setDecryptObject( m_nNumber, m_nGeneration );
+ if( (rWriteContext.m_bDeflate || rWriteContext.m_bDecrypt) && pEData )
{
char* pStream = NULL;
unsigned int nBytes = 0;
- if( getDeflatedStream( &pStream, &nBytes, pEData->m_pObjectContainer, rWriteContext )
- && pStream && nBytes )
+ bool bDeflate = getDeflatedStream( &pStream, &nBytes, pEData->m_pObjectContainer, rWriteContext );
+ if( pStream && nBytes )
{
// unzip the stream
sal_uInt8* pOutBytes = NULL;
sal_uInt32 nOutBytes = 0;
- unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes );
+ if( bDeflate && rWriteContext.m_bDeflate )
+ unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes );
+ else
+ {
+ // nothing to deflate, but decryption has happened
+ pOutBytes = (sal_uInt8*)pStream;
+ nOutBytes = (sal_uInt32)nBytes;
+ }
+
if( nOutBytes )
{
// clone this object
@@ -785,8 +855,32 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
// set length in the dictionary to new stream length
PDFNumber* pNewLen = new PDFNumber( double(nOutBytes) );
pClone->m_pStream->m_pDict->insertValue( "Length", pNewLen );
- // delete flatedecode filter
- pClone->m_pStream->m_pDict->eraseValue( "Filter" );
+
+ if( bDeflate && rWriteContext.m_bDeflate )
+ {
+ // delete flatedecode filter
+ std::hash_map<OString,PDFEntry*,OStringHash>::const_iterator it =
+ pClone->m_pStream->m_pDict->m_aMap.find( "Filter" );
+ if( it != pClone->m_pStream->m_pDict->m_aMap.end() )
+ {
+ PDFName* pFilter = dynamic_cast<PDFName*>(it->second);
+ if( pFilter && pFilter->m_aName.equals( "FlateDecode" ) )
+ pClone->m_pStream->m_pDict->eraseValue( "Filter" );
+ else
+ {
+ PDFArray* pArray = dynamic_cast<PDFArray*>(it->second);
+ if( pArray && ! pArray->m_aSubElements.empty() )
+ {
+ pFilter = dynamic_cast<PDFName*>(pArray->m_aSubElements.front());
+ if( pFilter && pFilter->m_aName.equals( "FlateDecode" ) )
+ {
+ delete pFilter;
+ pArray->m_aSubElements.erase( pArray->m_aSubElements.begin() );
+ }
+ }
+ }
+ }
+ }
// write sub elements except stream
bool bRet = true;
@@ -805,17 +899,23 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
if( bRet )
bRet = rWriteContext.write( "\nendstream\nendobj\n", 18 );
rtl_freeMemory( pStream );
- rtl_freeMemory( pOutBytes );
+ if( pOutBytes != (sal_uInt8*)pStream )
+ rtl_freeMemory( pOutBytes );
+ if( pEData )
+ pEData->setDecryptObject( 0, 0 );
return bRet;
}
- rtl_freeMemory( pOutBytes );
+ if( pOutBytes != (sal_uInt8*)pStream )
+ rtl_freeMemory( pOutBytes );
}
rtl_freeMemory( pStream );
}
- if( ! emitSubElements( rWriteContext ) )
- return false;
- return rWriteContext.write( "\nendobj\n", 8 );
+ bool bRet = emitSubElements( rWriteContext ) &&
+ rWriteContext.write( "\nendobj\n", 8 );
+ if( pEData )
+ pEData->setDecryptObject( 0, 0 );
+ return bRet;
}
PDFEntry* PDFObject::clone() const
@@ -1178,6 +1278,23 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
return bValid;
}
+rtl::OUString PDFFile::getDecryptionKey() const
+{
+ rtl::OUStringBuffer aBuf( ENCRYPTION_KEY_LEN * 2 );
+ if( impl_getData()->m_bIsEncrypted )
+ {
+ for( sal_uInt32 i = 0; i < m_pData->m_nKeyLength; i++ )
+ {
+ static const sal_Unicode pHexTab[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ aBuf.append( pHexTab[(m_pData->m_aDecryptionKey[i] >> 4) & 0x0f] );
+ aBuf.append( pHexTab[(m_pData->m_aDecryptionKey[i] & 0x0f)] );
+ }
+
+ }
+ return aBuf.makeStringAndClear();
+}
+
PDFFileImplData* PDFFile::impl_getData() const
{
if( m_pData )
@@ -1304,13 +1421,13 @@ PDFFileImplData* PDFFile::impl_getData() const
if( pNum )
m_pData->m_nPEntry = static_cast<sal_uInt32>(static_cast<sal_Int32>(pNum->m_fValue));
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "p entry is %p\n", m_pData->m_nPEntry );
+ fprintf( stderr, "p entry is %p\n", (void*)m_pData->m_nPEntry );
#endif
}
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "Encryption dict: sec handler: %s, version = %d, revision = %d, key length = %d\n",
pFilter ? OUStringToOString( pFilter->getFilteredName(), RTL_TEXTENCODING_UTF8 ).getStr() : "<unknown>",
- (int)m_pData->m_nAlgoVersion, (int)m_pData->m_nStandardRevision, m_pData->m_nKeyLength );
+ (int)m_pData->m_nAlgoVersion, (int)m_pData->m_nStandardRevision, (int)m_pData->m_nKeyLength );
#endif
break;
}
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index b3ffa64427dd..0e54005c6bd0 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -572,7 +572,7 @@ PDFEntry* PDFReader::read( const char* pBuffer, unsigned int nLen )
aInfo.stop, pBuffer, aInfo.stop - pBuffer,
aInfo.hit ? "true" : "false",
aInfo.full ? "true" : "false",
- aInfo.length );
+ (int)aInfo.length );
#endif
}
catch( parser_error<const char*, const char*>& rError )
@@ -650,7 +650,7 @@ PDFEntry* PDFReader::read( const char* pFileName )
aInfo.stop - file_start,
aInfo.hit ? "true" : "false",
aInfo.full ? "true" : "false",
- aInfo.length );
+ (int)aInfo.length );
#endif
}
catch( parser_error< const char*, file_iterator<> >& rError )
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 5f1bb429ce8a..c68af3c37d86 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -212,7 +212,9 @@ void DrawXmlEmitter::visit( ParagraphElement& elem, const std::list< Element* >:
void DrawXmlEmitter::fillFrameProps( DrawElement& rElem,
PropertyMap& rProps,
- const EmitContext& rEmitContext )
+ const EmitContext& rEmitContext,
+ bool bWasTransformed
+ )
{
double rel_x = rElem.x, rel_y = rElem.y;
@@ -223,7 +225,7 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem,
const GraphicsContext& rGC =
rEmitContext.rProcessor.getGraphicsContext( rElem.GCId );
- if( rGC.Transformation.isIdentity() )
+ if( rGC.Transformation.isIdentity() || bWasTransformed )
{
rProps[ USTR( "svg:x" ) ] = convertPixelToUnitString( rel_x );
rProps[ USTR( "svg:y" ) ] = convertPixelToUnitString( rel_y );
@@ -350,7 +352,10 @@ void DrawXmlEmitter::visit( PolyPolyElement& elem, const std::list< Element* >::
}
PropertyMap aProps;
- fillFrameProps( elem, aProps, m_rEmitContext );
+ // PDFIProcessor transforms geometrical objects, not images and text
+ // so we need to tell fillFrameProps here that the transformation for
+ // a PolyPolyElement was already applied (aside form translation)
+ fillFrameProps( elem, aProps, m_rEmitContext, true );
rtl::OUStringBuffer aBuf( 64 );
aBuf.appendAscii( "0 0 " );
aBuf.append( convPx2mmPrec2(elem.w)*100.0 );
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.hxx b/sdext/source/pdfimport/tree/drawtreevisiting.hxx
index b499db1ca811..75ce72eeaf79 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.hxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.hxx
@@ -101,7 +101,9 @@ namespace pdfi
void fillFrameProps( DrawElement& rElem,
PropertyMap& rProps,
- const EmitContext& rEmitContext );
+ const EmitContext& rEmitContext,
+ bool bWasTransformed = false
+ );
public:
const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator();
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 51817ce5eacf..daa7cd42b61e 100755
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -158,6 +158,8 @@ class Parser
sal_Int32 m_nNextToken;
sal_Int32 m_nCharIndex;
+ const double minAreaThreshold;
+ const double minLineWidth;
::rtl::OString readNextToken();
void readInt32( sal_Int32& o_Value );
@@ -167,7 +169,7 @@ class Parser
double readDouble();
void readBinaryData( uno::Sequence<sal_Int8>& rBuf );
- uno::Reference<rendering::XPolyPolygon2D> readPath();
+ uno::Reference<rendering::XPolyPolygon2D> readPath( double* );
void readChar();
void readLineCap();
@@ -199,7 +201,9 @@ public:
m_aLine(),
m_aFontMap(101),
m_nNextToken(-1),
- m_nCharIndex(-1)
+ m_nCharIndex(-1),
+ minAreaThreshold( 300.0 ),
+ minLineWidth( 12 )
{}
void parseLine( const ::rtl::OString& rLine );
@@ -306,7 +310,7 @@ void Parser::readBinaryData( uno::Sequence<sal_Int8>& rBuf )
OSL_PRECOND(nRes==osl_File_E_None, "inconsistent data");
}
-uno::Reference<rendering::XPolyPolygon2D> Parser::readPath()
+uno::Reference<rendering::XPolyPolygon2D> Parser::readPath( double* pArea = NULL )
{
const rtl::OString aSubPathMarker( "subpath" );
@@ -366,6 +370,15 @@ uno::Reference<rendering::XPolyPolygon2D> Parser::readPath()
readNextToken();
}
+ if( pArea )
+ {
+ basegfx::B2DRange aRange( aResult.getB2DRange() );
+ if( aRange.getWidth() <= minLineWidth || aRange.getHeight() <= minLineWidth)
+ *pArea = 0.0;
+ else
+ *pArea = aRange.getWidth() * aRange.getHeight();
+ }
+
return static_cast<rendering::XLinePolyPolygon2D*>(
new basegfx::unotools::UnoPolyPolygon(aResult));
}
@@ -805,9 +818,25 @@ void Parser::parseLine( const ::rtl::OString& rLine )
case EOCLIPPATH:
m_pSink->intersectEoClip(readPath()); break;
case EOFILLPATH:
- m_pSink->eoFillPath(readPath()); break;
+ {
+ double area = 0.0;
+ uno::Reference<rendering::XPolyPolygon2D> path = readPath( &area );
+ m_pSink->eoFillPath(path);
+ // if area is smaller than required, add borders.
+ if(area < minAreaThreshold)
+ m_pSink->strokePath(path);
+ }
+ break;
case FILLPATH:
- m_pSink->fillPath(readPath()); break;
+ {
+ double area = 0.0;
+ uno::Reference<rendering::XPolyPolygon2D> path = readPath( &area );
+ m_pSink->fillPath(path);
+ // if area is smaller than required, add borders.
+ if(area < minAreaThreshold)
+ m_pSink->strokePath(path);
+ }
+ break;
case RESTORESTATE:
m_pSink->popState(); break;
case SAVESTATE:
@@ -913,6 +942,8 @@ static bool checkEncryption( const rtl::OUString&
rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd,
RTL_TEXTENCODING_ISO_8859_1 );
bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() );
+ // trash password string on heap
+ rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() );
}
if( bAuthenticated )
bSuccess = true;
@@ -927,12 +958,23 @@ static bool checkEncryption( const rtl::OUString&
rtl::OString aIsoPwd = rtl::OUStringToOString( io_rPwd,
RTL_TEXTENCODING_ISO_8859_1 );
bAuthenticated = pPDFFile->setupDecryptionData( aIsoPwd.getStr() );
+ // trash password string on heap
+ rtl_zeroMemory( (void*)aIsoPwd.getStr(), aIsoPwd.getLength() );
} while( bEntered && ! bAuthenticated );
}
OSL_TRACE( "password: %s\n", bAuthenticated ? "matches" : "does not match" );
bSuccess = bAuthenticated;
}
+ // trash password string on heap
+ rtl_zeroMemory( (void*)io_rPwd.getStr(), io_rPwd.getLength()*sizeof(sal_Unicode) );
+ if( bAuthenticated )
+ {
+ rtl::OUStringBuffer aBuf( 128 );
+ aBuf.appendAscii( "_OOO_pdfi_Credentials_" );
+ aBuf.append( pPDFFile->getDecryptionKey() );
+ io_rPwd = aBuf.makeStringAndClear();
+ }
}
else
bSuccess = true;
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 6011b6989576..e0c5763acac8 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -107,8 +107,8 @@ int main(int argc, char **argv)
#endif
// try to read a possible open password form stdin
- char aPwBuf[34];
- aPwBuf[33] = 0;
+ char aPwBuf[129];
+ aPwBuf[128] = 0;
if( ! fgets( aPwBuf, sizeof(aPwBuf)-1, stdin ) )
aPwBuf[0] = 0; // mark as empty
else
@@ -132,14 +132,14 @@ int main(int argc, char **argv)
// check for password string(s)
- GooString* pOwnerPasswordStr( ownerPassword[0] != '\001'
- ? new GooString(ownerPassword)
- : (GooString *)NULL );
- GooString* pUserPasswordStr( aPwBuf[0] != 0
+ GooString* pOwnerPasswordStr( aPwBuf[0] != 0
? new GooString( aPwBuf )
- : ( userPassword[0] != '\001'
- ? new GooString(userPassword)
- : (GooString *)NULL ) );
+ : (ownerPassword[0] != '\001'
+ ? new GooString(ownerPassword)
+ : (GooString *)NULL ) );
+ GooString* pUserPasswordStr( userPassword[0] != '\001'
+ ? new GooString(userPassword)
+ : (GooString *)NULL );
if( outputFile[0] != '\001' )
g_binary_out = fopen(outputFile,"wb");
@@ -188,7 +188,6 @@ int main(int argc, char **argv)
}
else
{
-
pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aDoc) );
// tell receiver early - needed for proper progress calculation
diff --git a/set_soenv.in b/set_soenv.in
index d23b62eb5288..265e4e5b7b4d 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -967,7 +967,7 @@ $XINC = PathFormat('@XINC@'); # X11 includes
# Mac OS X/Darwin only variables.
if ( $platform =~ m/darwin/ )
-{ $FRAMEWORKSHOME = $ds."System".$ds."Library".$ds."Frameworks";
+{ $FRAMEWORKSHOME = $ds."Developer".$ds."SDKs".$ds."MacOSX10.4u.sdk".$ds."System".$ds."Library".$ds."Frameworks";
if ( $XLIB eq "no_x_libraries" ) {
$GUIBASE = "aqua";
} else {
@@ -1497,6 +1497,7 @@ else
#
print "done\n";
$gb_REPOS = $SRC_ROOT;
+my $BUILD_TYPE = "@BUILD_TYPE@";
if ('@WITH_LANG@' ne "")
{
@@ -1611,6 +1612,7 @@ ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "TRUE", "e" );
ToFile( "PRODUCT", "@PRODUCT@", "e" );
ToFile( "PROFULLSWITCH", "@PROFULLSWITCH@", "e" );
ToFile( "PROEXT", $PROEXT, "e" );
+ToFile( "VALGRIND_CFLAGS", "@VALGRIND_CFLAGS@", "e" );
ToFile( "UNIXWRAPPERNAME", "@UNIXWRAPPERNAME@","e" );
ToFile( "BUILD_MOZAB", "@BUILD_MOZAB@", "e" );
ToFile( "PREBUILD_MOZAB", $PREBUILD_MOZAB, "e" );
diff --git a/unoxml/source/dom/makefile.mk b/sfx2/qa/cppunit/makefile.mk
index 32a35ebfd54b..b53a04ec43f9 100644
--- a/unoxml/source/dom/makefile.mk
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -25,10 +25,13 @@
#
#*************************************************************************
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=unoxml
-TARGET=domimpl
+PRJ=../..
+PRJNAME=sfx2
+TARGET=qa_cppunit
ENABLE_EXCEPTIONS=TRUE
@@ -36,39 +39,48 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
.ENDIF
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/attr.obj \
- $(SLO)$/cdatasection.obj \
- $(SLO)$/characterdata.obj \
- $(SLO)$/comment.obj \
- $(SLO)$/document.obj \
- $(SLO)$/documentbuilder.obj \
- $(SLO)$/documentfragment.obj \
- $(SLO)$/documenttype.obj \
- $(SLO)$/element.obj \
- $(SLO)$/entity.obj \
- $(SLO)$/entityreference.obj \
- $(SLO)$/node.obj \
- $(SLO)$/notation.obj \
- $(SLO)$/processinginstruction.obj \
- $(SLO)$/text.obj \
- $(SLO)$/domimplementation.obj \
- $(SLO)$/elementlist.obj \
- $(SLO)$/childlist.obj \
- $(SLO)$/notationsmap.obj \
- $(SLO)$/entitiesmap.obj \
- $(SLO)$/attributesmap.obj \
- $(SLO)$/saxbuilder.obj
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+DLLPRE = # no leading "lib" on .so files
+
+# --- Libs ---------------------------------------------------------
+
+SHL1OBJS= \
+ $(SLO)/test_metadatable.obj \
+
+
+SHL1STDLIBS= \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VCLLIB) \
+ $(SFXLIB) \
+
+
+SHL1TARGET= test_metadatable
+SHL1RPATH = NONE
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP= version.map
+
+# --- All object files ---------------------------------------------
+
+SLOFILES= \
+ $(SHL1OBJS) \
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
-
+.END
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..ea91ba4d1c44
--- /dev/null
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f18e903eb6e4..41b969fc1e59 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1142,7 +1142,6 @@ void SAL_CALL SfxDocumentMetaData::init(
m_isInitialized = false;
m_xDoc = i_xDoc;
- m_xDoc->normalize();
// select nodes for standard meta data stuff
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
@@ -1171,26 +1170,49 @@ void SAL_CALL SfxDocumentMetaData::init(
if (!m_xParent.is()) {
// all this create/append stuff may throw DOMException
try {
- css::uno::Reference<css::xml::dom::XElement> xRElem(
- i_xDoc->createElementNS(
+ css::uno::Reference<css::xml::dom::XElement> xRElem;
+ css::uno::Reference<css::xml::dom::XNode> xNode(
+ i_xDoc->getFirstChild());
+ while (xNode.is()) {
+ if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType())
+ {
+ if (xNode->getNamespaceURI().equalsAscii(s_nsODF) &&
+ xNode->getLocalName().equalsAscii("document-meta"))
+ {
+ xRElem.set(xNode, css::uno::UNO_QUERY_THROW);
+ break;
+ }
+ else
+ {
+ OSL_TRACE("SfxDocumentMetaData::init(): "
+ "deleting unexpected root element: %s",
+ ::rtl::OUStringToOString(xNode->getLocalName(),
+ RTL_TEXTENCODING_UTF8).getStr());
+ i_xDoc->removeChild(xNode);
+ xNode = i_xDoc->getFirstChild(); // start over
+ }
+ } else {
+ xNode = xNode->getNextSibling();
+ }
+ }
+ if (!xRElem.is()) {
+ xRElem = i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
- ::rtl::OUString::createFromAscii("office:document-meta")));
- css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
- css::uno::UNO_QUERY_THROW);
- // NB: the following is a _bad_idea_ with our DOM implementation
- // do _not_ create attributes with xmlns prefix!
-// xRElem->setAttribute(::rtl::OUString::createFromAscii("xmlns:office"),
-// ::rtl::OUString::createFromAscii(s_nsODF));
+ ::rtl::OUString::createFromAscii("office:document-meta"));
+ css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
+ css::uno::UNO_QUERY_THROW);
+ i_xDoc->appendChild(xRNode);
+ }
xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:version"),
::rtl::OUString::createFromAscii("1.0"));
- i_xDoc->appendChild(xRNode);
+ // does not exist, otherwise m_xParent would not be null
css::uno::Reference<css::xml::dom::XNode> xParent (
i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:meta")),
css::uno::UNO_QUERY_THROW);
- xRNode->appendChild(xParent);
+ xRElem->appendChild(xParent);
m_xParent = xParent;
} catch (css::xml::dom::DOMException & e) {
css::uno::Any a(e);
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 515149c5a2d3..b125efc87267 100644..100755
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -191,15 +191,19 @@ SfxPrinterController::~SfxPrinterController()
const Any& SfxPrinterController::getSelectionObject() const
{
+ const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
+ if( pVal )
+ {
+ sal_Bool bSel = sal_False;
+ pVal->Value >>= bSel;
+ return bSel ? maSelection : maCompleteSelection;
+ }
+
sal_Int32 nChoice = 0;
- sal_Bool bSel = sal_False;
- const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
+ pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
if( pVal )
pVal->Value >>= nChoice;
- pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
- if( pVal )
- pVal->Value >>= bSel;
- return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection;
+ return (nChoice > 1) ? maSelection : maCompleteSelection;
}
Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
@@ -307,6 +311,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
{
if ( mpObjectShell )
{
+ bool bCopyJobSetup = false;
mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
switch ( nState )
{
@@ -334,6 +339,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
rBind.Invalidate( SID_PRINTDOC );
rBind.Invalidate( SID_PRINTDOCDIRECT );
rBind.Invalidate( SID_SETUPPRINTER );
+ bCopyJobSetup = true;
break;
}
@@ -341,6 +347,22 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
break;
}
+ if( bCopyJobSetup && mpViewShell )
+ {
+ SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_False);
+ if( pDocPrt )
+ {
+ if( pDocPrt->GetName() == getPrinter()->GetName() )
+ pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ else
+ {
+ SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() );
+ pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+ }
+ }
+ }
+
if ( m_bNeedsChange )
mpObjectShell->EnableSetModified( m_bOrigStatus );
@@ -704,10 +726,18 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
}
}
}
- sal_Int32 nLen = aProps.getLength();
- aProps.realloc( nLen + 1 );
- aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
- aProps[nLen].Value = makeAny( bSelection );
+ // HACK: writer sets the SID_SELECTION item when printing directly and expects
+ // to get only the selection document in that case (see getSelectionObject)
+ // however it also reacts to the PrintContent property. We need this distinction here, too,
+ // else one of the combinations print / print direct and selection / all will not work.
+ // it would be better if writer handled this internally
+ if( nId == SID_PRINTDOCDIRECT )
+ {
+ sal_Int32 nLen = aProps.getLength();
+ aProps.realloc( nLen + 1 );
+ aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
+ aProps[nLen].Value = makeAny( bSelection );
+ }
ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );
diff --git a/slideshow/source/engine/animationnodes/basenode.hxx b/slideshow/source/engine/animationnodes/basenode.hxx
index 2bbd9d9b51e8..0ca893b5287a 100644
--- a/slideshow/source/engine/animationnodes/basenode.hxx
+++ b/slideshow/source/engine/animationnodes/basenode.hxx
@@ -89,7 +89,7 @@ class BaseContainerNode;
file-private accessor methods.
*/
class BaseNode : public AnimationNode,
- protected ::osl::DebugBase<BaseNode>,
+ public ::osl::DebugBase<BaseNode>,
private ::boost::noncopyable
{
public:
diff --git a/slideshow/source/engine/shapes/drawshape.hxx b/slideshow/source/engine/shapes/drawshape.hxx
index b3c985d3fddc..db9a052d8d6a 100644
--- a/slideshow/source/engine/shapes/drawshape.hxx
+++ b/slideshow/source/engine/shapes/drawshape.hxx
@@ -65,7 +65,7 @@ namespace slideshow
class DrawShape : public AttributableShape,
public DocTreeNodeSupplier,
public HyperlinkArea,
- protected ::osl::DebugBase<DrawShape>
+ public ::osl::DebugBase<DrawShape>
{
public:
/** Create a shape for the given XShape
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index 35daf49863d8..8d2af73817d2 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -491,9 +491,10 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
nWaitTime100thSeconds = 100 * 60 * 60 * 24;
}
- // There are animated GIFs with no WaitTime set. Take 1 sec, then.
+ // There are animated GIFs with no WaitTime set. Take 0.1 sec, the
+ // same duration that is used by the edit view.
if( nWaitTime100thSeconds == 0 )
- nWaitTime100thSeconds = 100;
+ nWaitTime100thSeconds = 10;
o_rFrames.push_back( MtfAnimationFrame( pMtf,
nWaitTime100thSeconds / 100.0 ) );
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 2534b495ca90..61f04d6044d7 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -94,7 +94,7 @@ namespace
class SlideImpl : public Slide,
public CursorManager,
public ViewEventHandler,
- protected ::osl::DebugBase<SlideImpl>
+ public ::osl::DebugBase<SlideImpl>
{
public:
SlideImpl( const uno::Reference<drawing::XDrawPage>& xDrawPage,
diff --git a/slideshow/source/engine/transitions/randomwipe.cxx b/slideshow/source/engine/transitions/randomwipe.cxx
index 22c51e38852e..d8ac4a3da687 100644
--- a/slideshow/source/engine/transitions/randomwipe.cxx
+++ b/slideshow/source/engine/transitions/randomwipe.cxx
@@ -68,13 +68,11 @@ RandomWipe::RandomWipe( sal_Int32 nElements, bool randomBars )
m_rect.transform( aTransform );
// mix up:
- for ( sal_Int32 i = (nElements / 2); i--; )
+ for (sal_Int32 nIndex=0; nIndex<nElements; ++nIndex)
{
- const sal_Int32 pos1 = getRandomOrdinal(nElements);
- const sal_Int32 pos2 = getRandomOrdinal(nElements);
- const ::basegfx::B2DPoint point( m_positions[ pos1 ] );
- m_positions[ pos1 ] = m_positions[ pos2 ];
- m_positions[ pos2 ] = point;
+ const sal_Int32 nOtherIndex (getRandomOrdinal(nElements));
+ OSL_ASSERT(nOtherIndex>=0 && nOtherIndex<nElements);
+ ::std::swap(m_positions[nIndex], m_positions[nOtherIndex]);
}
}
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index ad4df2173516..d7e4ecb781ff 100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -2032,6 +2032,10 @@ sub do_custom_job {
$error_code = run_job($job, $module_paths{$module}, $module_job);
};
};
+ if ($error_code && $ignore) {
+ push(@ignored_errors, $module_job);
+ $error_code = 0;
+ };
if ($error_code) {
$modules_with_errors{$dependencies_hash}++;
# $broken_build{$module_job} = $error_code;
@@ -2237,7 +2241,7 @@ sub retrieve_build_list {
my $old_fh = select(STDOUT);
# Try to get global depencies from solver's build.lst if such exists
- my $solver_inc_dir = "$ENV{SOLARVER}/$ENV{INPATH}";
+ my $solver_inc_dir = "$ENV{SOLARVER}/$ENV{OUTPATH}";
$solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT});
$solver_inc_dir .= '/inc';
$solver_inc_dir .= $ENV{UPDMINOREXT} if (defined $ENV{UPDMINOREXT});
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 8b828b85335f..119eb95e0b7c 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -1060,7 +1060,7 @@ sub set_revision_in_pkginfo
my $pkgversion = "SOLSPARCPKGVERSION";
if ( $installer::globals::issolarisx86build ) { $pkgversion = "SOLIAPKGVERSION"; }
- if (( $variables->{$pkgversion} ) && ( $variables->{$pkgversion} ne "" ))
+ if (( $variables->{$pkgversion} ) && ( $variables->{$pkgversion} ne "" ))
{
if ( $variables->{$pkgversion} ne "FINALVERSION" )
{
@@ -1085,7 +1085,15 @@ sub set_revision_in_pkginfo
$version = "$finalmajor.$finalminor.$finalmicro";
}
- my $versionstring = "$version,$variables->{$pkgversion}";
+ my $datestring = $variables->{$pkgversion};
+
+ # Allowing some packages to have another date of creation.
+ # They can be defined in product definition using a key like "SOLSPARCPKGVERSION_$packagename"
+
+ my $additionalkey = $pkgversion . "_" . $packagename;
+ if (( $variables->{$additionalkey} ) && ( $variables->{$additionalkey} ne "" )) { $datestring = $variables->{$additionalkey}; }
+
+ my $versionstring = "$version,$datestring";
for ( my $i = 0; $i <= $#{$file}; $i++ )
{
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index d76b81a55850..2e870ba48712 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -705,6 +705,7 @@ sub create_simple_package
if (( $onefile->{'Styles'} ) && ( $onefile->{'Styles'} =~ /\bBINARYTABLE_ONLY\b/ )) { next; }
if (( $installer::globals::patch ) && ( $onefile->{'Styles'} ) && ( ! ( $onefile->{'Styles'} =~ /\bPATCH\b/ ))) { next; }
+ if (( $installer::globals::patch ) && ( $installer::globals::packageformat eq "dmg" )) { push(@installer::globals::patchfilecollector, "$onefile->{'destination'}\n"); }
my $source = $onefile->{'sourcepath'};
my $destination = $onefile->{'destination'};
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
index c2579cd5b952..fbd8f87617d5 100644
--- a/solenv/config/sdev300.ini
+++ b/solenv/config/sdev300.ini
@@ -138,7 +138,6 @@ common
STLPORT4
UPDMINOREXT
WITH_FONTOOO
- WITH_LANG
}
restore
{
@@ -162,6 +161,7 @@ common
r_only
tmp SOL_TMP_DIR
verbose VERBOSE
+ with_lang
}
}
finish
@@ -608,6 +608,7 @@ unxlngi6
MKOUT %PERL% %SOLARENV%/bin/mkout.pl
PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11
FREETYPE_CFLAGS -I%SYSBASE%/usr/include/freetype2
+ VALGRIND_CFLAGS -I%SOLARVERSION%$/unxlngi6%PROEXT%$/inc%UPDMINOREXT%/valgrind
SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include -I%SYSBASE%/usr/include/X11 -I%SYSBASE%/include
SOLAREXTRALIB -L../lib -L%SYSBASE%/usr/X11R6/lib -L%SYSBASE%/usr/lib -L/usr/X11R6/lib -L%SOLAR_STLLIBPATH%
SOLAR_JAVA TRUE
@@ -891,6 +892,7 @@ unxlngx6
MKOUT %PERL% %SOLARENV%/bin/mkout.pl
PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11
FREETYPE_CFLAGS -I%SYSBASE%/usr/include/freetype2
+ VALGRIND_CFLAGS -I%SOLARVERSION%$/unxlngx6%PROEXT%$/inc%UPDMINOREXT%/valgrind
SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include -I%SYSBASE%/usr/include/X11 -I%SYSBASE%/include
SOLAREXTRALIB -L../lib64 -L%SYSBASE%/usr/lib64 -L%SOLAR_STLLIBPATH%
SOLAR_JAVA TRUE
@@ -1172,6 +1174,7 @@ unxmacxi
LIBRARY_PATH %SYSBASE%/usr/lib
MKOUT %PERL% %SOLARENV%/bin/mkout.pl
PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc
+ VALGRIND_CFLAGS -I%SOLARVERSION%$/unxmacxi%PROEXT%$/inc%UPDMINOREXT%/valgrind
SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include/c++/4.0.0 -I%SYSBASE%/usr/include/c++/4.0.0/i686-apple-darwin8 -I%SYSBASE%/usr/lib/gcc/i686-apple-darwin8/4.0.1/include -I%SYSBASE%/usr/include/python2.3 -I%SYSBASE%/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include -I%SYSBASE%/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon
SOLAREXTRALIB -L%SOLAR_STLLIBPATH%
SOLAR_JAVA TRUE
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 612b85bf3e20..8c55367fac84 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -239,7 +239,7 @@ $(call gb_LinkTarget_get_clean_target,%) :
$(call gb_LinkTarget_get_external_headers_target,$*) \
$(DLLTARGET) \
$(AUXTARGETS)) && \
- cat $${RESPONSEFILE} |xargs -n 200 rm -f && \
+ cat $${RESPONSEFILE} /dev/null | xargs -n 200 rm -f && \
rm -f $${RESPONSEFILE}
@@ -254,7 +254,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach object,$(5),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
$(foreach object,$(6),$(call gb_GenCxxObject_get_dep_target,$(object)))\
) && \
- cat $${RESPONSEFILE} |xargs -n 200 cat > $(1)) && \
+ cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
rm -f $${RESPONSEFILE}
endef
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index 2cbeca889001..757ae52c1b52 100755
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -30,7 +30,7 @@ COM := GCC
gb_MKTEMP := mktemp -t gbuild.XXXXXX
-gb_CC := cc
+gb_CC := gcc
gb_CXX := g++
gb_GCCP := gcc
gb_AR := ar
@@ -153,6 +153,12 @@ gb_COMPILERNOOPTFLAGS := -O0
gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+# convert parametters filesystem root to native notation
+# does some real work only on windows, make sure not to
+# break the dummy implementations on unx*
+define gb_Helper_convert_native
+$(1)
+endef
# CObject class
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index d6b84dc43e6d..b54cb8fb1b9d 100755
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -142,6 +142,13 @@ gb_COMPILERNOOPTFLAGS := -O0
gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+# convert parametters filesystem root to native notation
+# does some real work only on windows, make sure not to
+# break the dummy implementations on unx*
+define gb_Helper_convert_native
+$(1)
+endef
+
# CObject class
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index f953dfbee599..6f29a9745f0d 100755
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -126,6 +126,13 @@ gb_COMPILERNOOPTFLAGS :=
gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+# convert parametters filesystem root to native notation
+# does some real work only on windows, make sure not to
+# break the dummy implementations on unx*
+define gb_Helper_convert_native
+$(1)
+endef
+
# CObject class
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index a4137c077b09..5371ebf9d954 100755
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -30,7 +30,7 @@ COM := MSC
# set tmpdir to some mixed case path, suitable for native tools
gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
-gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) -t gbuild.XXXXXX
+gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
gb_CC := cl
gb_CXX := cl
@@ -222,6 +222,17 @@ R=$(gb_Helper_REPODIR_NATIVE) && $(subst $(REPODIR)/,$$R/,$(subst $(gb_Helper_RE
$(subst $(REPODIR)/,$$R/,$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(1)))))))))
endef
+# convert parametters filesystem root to native notation
+# does some real work only on windows, make sure not to
+# break the dummy implementations on unx*
+define gb_Helper_convert_native
+$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
+$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
+$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
+$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
+$(1)))))
+endef
+
# CObject class
@@ -402,11 +413,11 @@ $(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(dir $(1)) && \
rm -f $(1) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \
+ $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(PCHOBJS)" > $${RESPONSEFILE} && \
+ $(PCHOBJS))) && \
$(gb_LINK) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
diff --git a/solenv/gbuild/platform/winmingw.mk b/solenv/gbuild/platform/winmingw.mk
index b9eec5eaf417..e03f37a68d2b 100644
--- a/solenv/gbuild/platform/winmingw.mk
+++ b/solenv/gbuild/platform/winmingw.mk
@@ -28,7 +28,9 @@
GUI := WNT
COM := GCC
-gb_MKTEMP := mktemp -t gbuild.XXXXXX
+# set tmpdir to some mixed case path, suitable for native tools
+gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
+gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
gb_CC := $(CC)
gb_CXX := $(CXX)
@@ -189,6 +191,17 @@ R=$(gb_Helper_REPODIR_NATIVE) && $(subst $(REPODIR)/,$$R/,$(subst $(gb_Helper_RE
$(subst $(REPODIR)/,$$R/,$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(1)))))))))
endef
+# convert parametters filesystem root to native notation
+# does some real work only on windows, make sure not to
+# break the dummy implementations on unx*
+define gb_Helper_convert_native
+$(patsubst -I$(OUTDIR)%,-I$(gb_Helper_OUTDIR_NATIVE)%, \
+$(patsubst $(OUTDIR)%,$(gb_Helper_OUTDIR_NATIVE)%, \
+$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%, \
+$(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
+$(1)))))
+endef
+
# CObject class
ifeq ($(gb_FULLDEPS),$(true))
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 0a163f9e0128..a1cbad32a4e0 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m101(Build:9573)
-BUILD=9573
-LAST_MINOR=m101
+RSCREVISION=300m102(Build:9577)
+BUILD=9577
+LAST_MINOR=m102
SOURCEVERSION=DEV300
diff --git a/solenv/inc/unxlngppc.mk b/solenv/inc/unxlngppc.mk
index 408233539bf8..89b2501bf366 100644
--- a/solenv/inc/unxlngppc.mk
+++ b/solenv/inc/unxlngppc.mk
@@ -31,7 +31,4 @@ DEFAULTOPT=-Os
PICSWITCH:=-fPIC
.INCLUDE : unxlng.mk
CDEFS+=-DPOWERPC -DPPC
-CFLAGS+=-fsigned-char
-CFLAGSCC+=-fsigned-char
-CFLAGSCXX+=-fsigned-char
DLLPOSTFIX=lp
diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index a652e488d78f..a6406faed788 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -1,6 +1,7 @@
+#include "cpp.h"
+
#include <stdlib.h>
#include <string.h>
-#include "cpp.h"
#define NSTAK 32
#define SGN 0
@@ -711,11 +712,11 @@ struct value
}
else
{
- static char cvcon[]
- = "b\bf\fn\nr\rt\tv\v''\"\"??\\\\";
- size_t j;
+ static char cvcon[] = "b\bf\fn\nr\rt\tv\v''\"\"??\\\\";
+ static size_t cvlen = sizeof(cvcon) - 1;
- for (j = 0; j < sizeof(cvcon); j += 2)
+ size_t j;
+ for (j = 0; j < cvlen; j += 2)
{
if (*p == cvcon[j])
{
@@ -724,7 +725,7 @@ struct value
}
}
p += 1;
- if (j >= sizeof(cvcon))
+ if (j >= cvlen)
error(WARNING,
"Undefined escape in character constant");
}
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 2ff188ff2264..2236fd9db260 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -262,7 +262,7 @@ void
bigfsm[j][fp->state] = (short) nstate;
continue;
case C_ALPH:
- for (j = 0; j <= 256; j++)
+ for (j = 0; j < 256; j++)
#ifdef S390
if( isalpha( j ) || (j == '_') )
#else
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 0a10192528c1..36b841b29ca0 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -159,6 +159,7 @@ class EasyFat
public:
EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize );
~EasyFat() { delete[] pFat; delete[] pFree; }
+
sal_Int32 GetPageSize() { return nPageSize; }
sal_Int32 Count() { return nPages; }
sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; }
@@ -385,5 +386,3 @@ sal_uLong StgIo::ValidateFATs()
// DBG_ERROR("Validiere nicht (kein FileStorage)");
return FAT_OK;
}
-
-
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index f1145a029c29..7e4ac7bcbb00 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -600,7 +600,8 @@ oslInterlockedCount SAL_CALL MappedLockBytes::release()
void MappedLockBytes::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
OSL_PRECOND((ppPage != 0) && (pnSize != 0), "contract violation");
- *ppPage = 0, *pnSize = m_nPageSize;
+ if ((ppPage != 0) && (pnSize != 0))
+ *ppPage = 0, *pnSize = m_nPageSize;
}
void MappedLockBytes::deallocate_Impl (void * pPage)
diff --git a/store/source/lockbyte.hxx b/store/source/lockbyte.hxx
index ef34b8708f26..b2b6c905f9fd 100644
--- a/store/source/lockbyte.hxx
+++ b/store/source/lockbyte.hxx
@@ -26,7 +26,7 @@
************************************************************************/
#ifndef _STORE_LOCKBYTE_HXX_
-#define _STORE_LOCKBYTE_HXX_ "$Revision: 1.1.2.1 $"
+#define _STORE_LOCKBYTE_HXX_
#ifndef _SAL_TYPES_H_
#include "sal/types.h"
diff --git a/store/source/object.hxx b/store/source/object.hxx
index 1061b9c568a9..a3b5ab1c6e63 100644
--- a/store/source/object.hxx
+++ b/store/source/object.hxx
@@ -26,7 +26,7 @@
************************************************************************/
#ifndef _STORE_OBJECT_HXX_
-#define _STORE_OBJECT_HXX_ "$Revision: 1.1.2.1 $"
+#define _STORE_OBJECT_HXX_
#ifndef _SAL_TYPES_H_
#include "sal/types.h"
diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx
index 6eb005e453d8..690bff8d258e 100644
--- a/store/source/storbase.cxx
+++ b/store/source/storbase.cxx
@@ -158,7 +158,8 @@ PageData::Allocator_Impl::~Allocator_Impl()
void PageData::Allocator_Impl::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
OSL_PRECOND((ppPage != 0) && (pnSize != 0), "contract violation");
- *ppPage = rtl_cache_alloc(m_page_cache), *pnSize = m_page_size;
+ if ((ppPage != 0) && (pnSize != 0))
+ *ppPage = rtl_cache_alloc(m_page_cache), *pnSize = m_page_size;
}
void PageData::Allocator_Impl::deallocate_Impl (void * pPage)
diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx
index 66dd14bd81a6..2e3d79e71319 100644
--- a/store/source/stordir.hxx
+++ b/store/source/stordir.hxx
@@ -26,7 +26,7 @@
************************************************************************/
#ifndef _STORE_STORDIR_HXX_
-#define _STORE_STORDIR_HXX_ "$Revision: 1.1.2.2 $"
+#define _STORE_STORDIR_HXX_
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk
new file mode 100644
index 000000000000..625404682761
--- /dev/null
+++ b/svl/qa/complex/passwordcontainer/makefile.mk
@@ -0,0 +1,134 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = svl
+TARGET = qa_complex_passwordcontainer
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/passwordcontainer
+
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ PasswordContainerUnitTest.java
+
+
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ PasswordContainerTest.java\
+ Test01.java\
+ Test02.java\
+ Test03.java\
+ TestHelper.java\
+ MasterPasswdHandler.java
+
+
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
+
+
+#
+#
+#
+#
+# PRJ = ..$/..$/..
+# TARGET = PasswordContainerUnitTest
+# PRJNAME=svl
+# PACKAGE = complex$/passwordcontainer
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+#
+# JAVAFILES =\
+# PasswordContainerUnitTest.java\
+# PasswordContainerTest.java\
+# TestHelper.java\
+# Test01.java\
+# Test02.java\
+# Test03.java\
+# MasterPasswdHandler.java
+#
+# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -TestBase java_complex
+#
+# # test looks something like the.full.package.TestName
+# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .INCLUDE: target.mk
+#
+# RUN: run
+#
+# run:
+# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
+#
+#
diff --git a/svtools/qa/unoapi/makefile.mk b/svtools/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..e3afb77e637a
--- /dev/null
+++ b/svtools/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = svtools
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/svtools/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index e34ed061cd69..e4e4abdc96a2 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -683,6 +683,7 @@ SvViewDataEntry::~SvViewDataEntry()
SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
:m_bIsEmptyTextAllowed( true )
,m_bEntryMnemonicsEnabled( false )
+ ,m_bDoingQuickSelection( false )
,m_pLink( NULL )
,m_aMnemonicEngine( _rBox )
,m_aQuickSelectionEngine( _rBox )
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
index 8d7752ddd7df..8d7752ddd7df 100644..100755
--- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 4fbd1f3c288e..abc25d865d06 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -2803,7 +2803,7 @@ void SvxRuler::EvalModifier()
const RulerType eType = GetDragType();
nDragType = DRAG_OBJECT_SIZE_PROPORTIONAL;
if( RULER_TYPE_TAB == eType ||
- ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) &&
+ ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType || RULER_TYPE_MARGIN2 == eType) &&
pColumnItem ) )
PrepareProportional_Impl(eType);
break;
diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx
index 4f51e111c2c3..b10eac69bc54 100644..100755
--- a/svx/source/mnuctrls/fntctl.cxx
+++ b/svx/source/mnuctrls/fntctl.cxx
@@ -148,7 +148,7 @@ void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint )
IMPL_LINK_INLINE_START( SvxFontMenuControl, MenuSelect, FontNameMenu *, pMen )
{
SvxFontItem aItem( GetId() );
- aItem.GetFamilyName() = pMen->GetCurName();
+ aItem.SetFamilyName(pMen->GetCurName());
GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aItem, 0L );
return 0;
}
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index a951819104aa..82cd950bbbed 100644..100755
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -1258,9 +1258,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
case ITEM_XCOLOR: break;
case ITEM_COLOR: break;
case ITEM_FONT: {
- ((SvxFontItem*)pNewItem)->GetFamily()=FAMILY_DONTKNOW;
- ((SvxFontItem*)pNewItem)->GetFamilyName()=aNewText;
- ((SvxFontItem*)pNewItem)->GetStyleName().Erase();
+ ((SvxFontItem*)pNewItem)->SetFamily( FAMILY_DONTKNOW );
+ ((SvxFontItem*)pNewItem)->SetFamilyName(aNewText);
+ ((SvxFontItem*)pNewItem)->SetStyleName( String() );
} break;
case ITEM_FONTHEIGHT: {
sal_uIntPtr nHgt=0;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 5328e5f1a3d1..30628a10df86 100644..100755
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -836,11 +836,11 @@ void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFo
aOutTypeArr[ n ].nFntType, aOutTypeArr[ n ].nLanguage,
DEFAULTFONT_FLAGS_ONLYONE, 0 ));
SvxFontItem* pI = aItemArr[ n ];
- pI->GetFamily() = aFnt.GetFamily();
- pI->GetFamilyName() = aFnt.GetName();
- pI->GetStyleName().Erase();
- pI->GetPitch() = aFnt.GetPitch();
- pI->GetCharSet() = aFnt.GetCharSet();
+ pI->SetFamily( aFnt.GetFamily());
+ pI->SetFamilyName( aFnt.GetName());
+ pI->SetStyleName( String() );
+ pI->SetPitch( aFnt.GetPitch());
+ pI->SetCharSet( aFnt.GetCharSet() );
}
}
@@ -854,29 +854,29 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt
// get DEFAULTFONT_LATIN_TEXT and set at pool as dynamic default
Font aFont(OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItem.GetFamily() = aFont.GetFamily();
- aSvxFontItem.GetFamilyName() = aFont.GetName();
- aSvxFontItem.GetStyleName().Erase();
- aSvxFontItem.GetPitch() = aFont.GetPitch();
- aSvxFontItem.GetCharSet() = aFont.GetCharSet();
+ aSvxFontItem.SetFamily(aFont.GetFamily());
+ aSvxFontItem.SetFamilyName(aFont.GetName());
+ aSvxFontItem.SetStyleName(String());
+ aSvxFontItem.SetPitch( aFont.GetPitch());
+ aSvxFontItem.SetCharSet( aFont.GetCharSet() );
pItemPool->SetPoolDefaultItem(aSvxFontItem);
// get DEFAULTFONT_CJK_TEXT and set at pool as dynamic default
Font aFontCJK(OutputDevice::GetDefaultFont(DEFAULTFONT_CJK_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItemCJK.GetFamily() = aFontCJK.GetFamily();
- aSvxFontItemCJK.GetFamilyName() = aFontCJK.GetName();
- aSvxFontItemCJK.GetStyleName().Erase();
- aSvxFontItemCJK.GetPitch() = aFontCJK.GetPitch();
- aSvxFontItemCJK.GetCharSet() = aFontCJK.GetCharSet();
+ aSvxFontItemCJK.SetFamily( aFontCJK.GetFamily());
+ aSvxFontItemCJK.SetFamilyName(aFontCJK.GetName());
+ aSvxFontItemCJK.SetStyleName(String());
+ aSvxFontItemCJK.SetPitch( aFontCJK.GetPitch());
+ aSvxFontItemCJK.SetCharSet( aFontCJK.GetCharSet());
pItemPool->SetPoolDefaultItem(aSvxFontItemCJK);
// get DEFAULTFONT_CTL_TEXT and set at pool as dynamic default
Font aFontCTL(OutputDevice::GetDefaultFont(DEFAULTFONT_CTL_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0));
- aSvxFontItemCTL.GetFamily() = aFontCTL.GetFamily();
- aSvxFontItemCTL.GetFamilyName() = aFontCTL.GetName();
- aSvxFontItemCTL.GetStyleName().Erase();
- aSvxFontItemCTL.GetPitch() = aFontCTL.GetPitch();
- aSvxFontItemCTL.GetCharSet() = aFontCTL.GetCharSet();
+ aSvxFontItemCTL.SetFamily(aFontCTL.GetFamily());
+ aSvxFontItemCTL.SetFamilyName(aFontCTL.GetName());
+ aSvxFontItemCTL.SetStyleName(String());
+ aSvxFontItemCTL.SetPitch( aFontCTL.GetPitch() );
+ aSvxFontItemCTL.SetCharSet( aFontCTL.GetCharSet());
pItemPool->SetPoolDefaultItem(aSvxFontItemCTL);
// set dynamic FontHeight defaults
diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 4eb0dc405264..df81b22f712d 100755
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -27,6 +27,11 @@
$(eval $(call gb_JunitTest_JunitTest,sw_complex))
+$(eval $(call gb_JunitTest_set_defs,sw_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/sw/qa/complex/writer/testdocuments \
+))
+
$(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
sw/qa/complex/checkColor/CheckChangeColor \
sw/qa/complex/indeterminateState/CheckIndeterminateState \
@@ -52,6 +57,14 @@ $(eval $(call gb_JunitTest_add_jars,sw_complex,\
$(eval $(call gb_JunitTest_add_classes,sw_complex,\
complex.accessibility.AccessibleRelationSet \
complex.checkColor.CheckChangeColor \
+ complex.writer.CheckCrossReferences \
+ complex.writer.CheckFlies \
+ complex.writer.CheckIndexedPropertyValues \
+ complex.writer.CheckNamedPropertyValues \
+ complex.writer.TextPortionEnumerationTest \
))
+# currently fails (should run again in os146) (except on windows)
+# complex.writer.CheckBookmarks \
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index b486434d19df..922bf1cbf881 100755
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -74,17 +74,13 @@ namespace com { namespace sun { namespace star {
* <li>The pool item is cloned (because it is non-poolable); the clone
* points to the same metadatable entity, but the metadatable entity's
* reverse pointer is unchanged.</li>
- * <li>A new text hint is created, taking over the new pool item.
- * Unfortunately, this also makes the metadatable entity point at the
- * cloned pool item.</li>
- * <li>The text hint is inserted into the hints array of some text node.</li>
- * <li>The DoCopy() method must be called at the new pool item:
- * it will clone the metadatable entity (using RegisterAsCopyOf),
- * and fix the reverse pointer of the original to point at the
- * original pool item.
+ * <li>The DoCopy() method is called at the new pool item:
+ * it will clone the metadatable entity (using RegisterAsCopyOf).
* This is necessary, because first, a metadatable entity may
* only be inserted once into a document, and second, the copy may be
* inserted into a different document than the source document!</li>
+ * <li>A new text hint is created, taking over the new pool item.</li>
+ * <li>The text hint is inserted into the hints array of some text node.</li>
* </ol>
*/
@@ -99,7 +95,7 @@ class SwFmtMeta
: public SfxPoolItem
{
private:
- friend class SwTxtMeta; // needs SetTxtAttr
+ friend class SwTxtMeta; // needs SetTxtAttr, DoCopy
friend class ::sw::Meta; // needs m_pTxtAttr
::boost::shared_ptr< ::sw::Meta > m_pMeta;
@@ -108,6 +104,10 @@ private:
SwTxtMeta * GetTxtAttr() { return m_pTxtAttr; }
void SetTxtAttr(SwTxtMeta * const i_pTxtAttr);
+ /// this method <em>must</em> be called when the hint is actually copied
+ void DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode);
+
explicit SwFmtMeta( const sal_uInt16 i_nWhich );
public:
@@ -119,14 +119,11 @@ public:
// SfxPoolItem
virtual int operator==( const SfxPoolItem & ) const;
virtual SfxPoolItem * Clone( SfxItemPool *pPool = 0 ) const;
-// TYPEINFO();
/// notify clients registered at m_pMeta that this meta is being (re-)moved
void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
static SwFmtMeta * CreatePoolDefault( const sal_uInt16 i_nWhich );
::sw::Meta * GetMeta() { return m_pMeta.get(); }
- /// this method <em>must</em> be called when the hint is actually copied
- void DoCopy( SwFmtMeta & rOriginalMeta );
};
@@ -146,6 +143,7 @@ protected:
::com::sun::star::rdf::XMetadatable> m_wXMeta;
SwFmtMeta * m_pFmt;
+ SwTxtNode * m_pTxtNode;
SwTxtMeta * GetTxtAttr() const;
SwTxtNode * GetTxtNode() const; // returns 0 if not in document (undo)
@@ -153,7 +151,8 @@ protected:
SwFmtMeta * GetFmtMeta() const { return m_pFmt; }
void SetFmtMeta( SwFmtMeta * const i_pFmt ) { m_pFmt = i_pFmt; };
- void NotifyChangeTxtNode();
+ void NotifyChangeTxtNodeImpl();
+ void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
::com::sun::star::uno::WeakReference<
::com::sun::star::rdf::XMetadatable> const& GetXMeta() const
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index f24dce137463..d549368d90f2 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -33,7 +33,6 @@
#include "swtypes.hxx"
-//#include "numrule.hxx"
class SwTxtNode;
class SwRegHistory; // steht im RolBck.hxx
@@ -44,9 +43,16 @@ class SfxPoolItem;
class SfxItemSet;
class SwDoc;
+typedef enum {
+ COPY = true,
+ NEW = false,
+} CopyOrNew_t;
+
+// if COPY then pTxtNode must be given!
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, SfxPoolItem & rNew,
- xub_StrLen nStt, xub_StrLen nEnd );
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy = NEW, SwTxtNode *const pTxtNode = 0);
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, const SfxItemSet & rSet,
xub_StrLen nStt, xub_StrLen nEnd );
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 1f417052638d..f09494d3d454 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -228,6 +228,8 @@ namespace nsSetAttrMode
// functionality will be disabled)
/// force hint expand (only matters for hints with CH_TXTATR)
const SetAttrMode SETATTR_FORCEHINTEXPAND= 0x0080;
+ /// the inserted item is a copy -- intended for use in ndtxt.cxx
+ const SetAttrMode SETATTR_IS_COPY = 0x0100;
}
//Umrechnung Twip<-> 1/100 mm fuer UNO
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index f074a8696fdf..a8b4fbb2211f 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -34,6 +34,11 @@
class SwTxtNode; // fuer SwTxtFld
class SwCharFmt;
+namespace sw {
+ class MetaFieldManager;
+}
+
+
// ATT_CHARFMT *********************************************
class SwTxtCharFmt : public SwTxtAttrEnd
@@ -61,7 +66,7 @@ public:
class SwTxtAttrNesting : public SwTxtAttrEnd
{
-public:
+protected:
SwTxtAttrNesting( SfxPoolItem & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
virtual ~SwTxtAttrNesting();
@@ -70,16 +75,20 @@ public:
class SwTxtMeta : public SwTxtAttrNesting
{
private:
- SwTxtNode * m_pTxtNode;
-
-public:
SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
+
+public:
+ static SwTxtMeta * CreateTxtMeta(
+ ::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode *const i_pTargetTxtNode,
+ SwFmtMeta & i_rAttr,
+ xub_StrLen const i_nStart, xub_StrLen const i_nEnd,
+ bool const i_bIsCopy);
+
virtual ~SwTxtMeta();
void ChgTxtNode(SwTxtNode * const pNode);
- SwTxtNode * GetTxtNode() const { return m_pTxtNode; }
-
};
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index 75a5305041f0..d5deb2830eac 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -41,7 +41,7 @@ class SwTxtRefMark : public SwTxtAttrEnd
public:
SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual xub_StrLen * GetEnd(); // SwTxtAttr
inline const xub_StrLen * GetEnd() const { return m_pEnd; }
diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx
index efa88329c73b..311432d9287b 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -41,7 +41,8 @@ class SwTxtTOXMark : public SwTxtAttrEnd
xub_StrLen * m_pEnd; // 0 if SwTOXMark without AlternativeText
public:
- SwTxtTOXMark( SwTOXMark& rAttr, xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ SwTxtTOXMark( SwTOXMark& rAttr,
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual ~SwTxtTOXMark();
virtual xub_StrLen *GetEnd(); // SwTxtAttr
diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx
index d6ada94d5396..908c48aac4ac 100644
--- a/sw/inc/unotext.hxx
+++ b/sw/inc/unotext.hxx
@@ -291,6 +291,12 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ // XTextCopy
+ virtual void SAL_CALL copyText(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCopy >& xSource )
+ throw (::com::sun::star::uno::RuntimeException);
+
// XTextRangeCompare
sal_Int16 SAL_CALL compareRegionStarts(
const ::com::sun::star::uno::Reference<
@@ -334,12 +340,6 @@ public:
::com::sun::star::text::XTextContent>& xPredecessor)
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
-
- // XTextCopy
- virtual void SAL_CALL copyText(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextCopy >& xSource )
- throw (::com::sun::star::uno::RuntimeException);
};
#endif // SW_UNOTEXT_HXX
diff --git a/unoxml/qa/complex/unoxml/makefile.mk b/sw/qa/complex/accessibility/makefile.mk
index 136d23a9a232..06e7c6a70408 100644
--- a/unoxml/qa/complex/unoxml/makefile.mk
+++ b/sw/qa/complex/accessibility/makefile.mk
@@ -23,29 +23,22 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#***********************************************************************/
+#*************************************************************************
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
nothing .PHONY:
.ELSE
PRJ = ../../..
-PRJNAME = unoxml
-TARGET = qa_complex_unoxml
+PRJNAME = sw
+TARGET = qa_complex_accessibility
.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/unoxml
-JAVATESTFILES = \
- RDFRepositoryTest.java
-
-JAVAFILES = $(JAVATESTFILES) \
- TestDocument.java
-
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+PACKAGE = complex/accessibility
+JAVATESTFILES = AccessibleRelationSet.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
EXTRAJARFILES = $(OOO_JUNIT_JAR)
-
-# Sample how to debug
-# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
.END
.INCLUDE: settings.mk
@@ -55,5 +48,3 @@ EXTRAJARFILES = $(OOO_JUNIT_JAR)
ALLTAR : javatest
.END
-
-
diff --git a/unoxml/source/events/makefile.mk b/sw/qa/complex/checkColor/makefile.mk
index 2ec7489e1a8d..e5b368083ada 100644
--- a/unoxml/source/events/makefile.mk
+++ b/sw/qa/complex/checkColor/makefile.mk
@@ -25,32 +25,26 @@
#
#*************************************************************************
-PRJ=../..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=unoxml
-TARGET=eventsimpl
-ENABLE_EXCEPTIONS=TRUE
+PRJ = ../../..
+PRJNAME = sw
+TARGET = qa_complex_checkColor
-# --- Settings -----------------------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/checkColor
+JAVATESTFILES = CheckChangeColor.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES =\
- $(SLO)$/event.obj \
- $(SLO)$/eventdispatcher.obj \
- $(SLO)$/mutationevent.obj \
- $(SLO)$/uievent.obj \
- $(SLO)$/mouseevent.obj \
- $(SLO)$/testlistener.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+ALLTAR : javatest
+.END
diff --git a/sw/qa/complex/writer/TestDocument.java b/sw/qa/complex/writer/TestDocument.java
index 25a11338ae5c..088c9aede3d6 100644
--- a/sw/qa/complex/writer/TestDocument.java
+++ b/sw/qa/complex/writer/TestDocument.java
@@ -29,10 +29,11 @@ package complex.writer;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
+import org.openoffice.test.Argument;
final class TestDocument {
public static String getUrl(String name) {
- return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ return OfficeFileUrl.getAbsolute(new File(Argument.get("tdoc"), name));
}
private TestDocument() {}
diff --git a/sw/qa/unoapi/makefile.mk b/sw/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..f5102c2c9c84
--- /dev/null
+++ b/sw/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sw
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sw/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b7106ade751c..63aae63019d3 100644..100755
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -973,7 +973,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
{
// Cursor als Kopie vom akt. und in den Ring aufnehmen
// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
// wenn schon ausserhalb vom Bodytext, suche von der Position,
// ansonsten beginne mit der 1. GrundSection
@@ -1004,8 +1004,8 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
+ pSav.release();
- delete pSav;
if( !( FND_IN_SELALL & eFndRngs ))
{
// es sollte nur einer gesucht werden, also fuege in dazu
@@ -1031,7 +1031,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else if( FND_IN_SELALL & eFndRngs )
{
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ ::std::auto_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor
const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs )
? rNds.GetEndOfContent().StartOfSectionNode()
@@ -1058,10 +1058,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
- // es wurde ein- bis mehrmals gefunden. Das steht alles
- // im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf
- delete pSav;
-
+ pSav.release();
while( GetNext() != this )
delete GetNext();
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 98179bd1d8ea..d5e7354df745 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1312,6 +1312,17 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
+ // --> OD #i115719#
+ // <title> and <description> attributes are lost when calling <DelFrms()>.
+ // Thus, keep them and restore them after the calling <MakeFrms()>
+ const bool bIsSwFlyFrmFmtInstance( dynamic_cast<SwFlyFrmFmt*>(pOldFmt) != 0 );
+ const String sTitle( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjTitle()
+ : String() );
+ const String sDescription( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjDescription()
+ : String() );
+ // <--
pOldFmt->DelFrms();
pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
@@ -1449,6 +1460,13 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Nun nur noch die Flys erzeugen lassen. Das ueberlassen
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
+ // --> OD #i115719#
+ if ( bIsSwFlyFrmFmtInstance )
+ {
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjTitle( sTitle );
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjDescription( sDescription );
+ }
+ // <--
}
break;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 647acfe9d9a4..3d4a21584f9a 100644..100755
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -336,7 +336,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
READ( aFont, SvxFontItem , rVersions.nFontVersion)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , rVersions.nFontHeightVersion)
READ( aWeight, SvxWeightItem , rVersions.nWeightVersion)
@@ -424,7 +424,7 @@ sal_Bool SwBoxAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
READ( aFont, SvxFontItem , 0)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , 1)
READ( aWeight, SvxWeightItem , 2)
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index dad951e3848a..d018b0731e43 100644..100755
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -157,6 +157,10 @@ sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
SwPaM* pPam = &rCrsr;
if( pPam->GetPoint()->nContent.GetIndex() != nPos )
{
@@ -204,14 +208,26 @@ sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
pPam->SetMark();
pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
- xub_StrLen( nPos + rTxt.Len() ));
+ xub_StrLen( nPos + nSourceLength ));
pDoc->ReplaceRange( *pPam, rTxt, false );
pPam->Exchange();
pPam->DeleteMark();
}
}
else
- pDoc->Overwrite( *pPam, rTxt );
+ {
+ if( nSourceLength != rTxt.Len() )
+ {
+ pPam->SetMark();
+ pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
+ xub_StrLen( nPos + nSourceLength ));
+ pDoc->ReplaceRange( *pPam, rTxt, false );
+ pPam->Exchange();
+ pPam->DeleteMark();
+ }
+ else
+ pDoc->Overwrite( *pPam, rTxt );
+ }
// pDoc->SetRedlineMode_intern( eOld );
if( bUndoIdInitialized )
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 828adb14ff10..0f9113445646 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1542,6 +1542,9 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
aFmt.SetBulletFont( pBullFnt );
aFmt.SetBulletChar( cBullChar );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
aFmt.SetFirstLineOffset( lBullFirstLineOffset );
aFmt.SetAbsLSpace( nAbsPos );
if( !aFmt.GetCharFmt() )
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index d52d3a70f4b5..d90b57b13b50 100644..100755
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -68,6 +68,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd );
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt );
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& );
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index a83fe42c265d..9e482a63f4b3 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -84,7 +84,6 @@ sal_uInt16 SwLineInfo::NumberOfTabStops() const
/*************************************************************************
* SwTxtFormatter::NewTabPortion()
*************************************************************************/
-
SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) const
{
SwTabPortion *pTabPor = 0;
@@ -216,63 +215,74 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
cFill = 0;
eAdj = SVX_TAB_ADJUST_LEFT;
}
- // --> OD 2008-02-07 #newlistlevelattrs#
- long nForced = 0;
- if ( !bTabsRelativeToIndent )
+
+ // --> OD #i115705# - correction and refactoring:
+ // overrule determined next tab stop position in order to apply
+ // a tab stop at the left margin under the following conditions:
+ // - the new tab portion is inside the hanging indent
+ // - a tab stop at the left margin is allowed
+ // - the determined next tab stop is a default tab stop position OR
+ // the determined next tab stop is beyond the left margin
{
- if ( bRTL )
+ long nLeftMarginTabPos = 0;
{
- Point aPoint( Left(), 0 );
- pFrm->SwitchLTRtoRTL( aPoint );
- nForced = pFrm->Frm().Right() - aPoint.X();
+ if ( !bTabsRelativeToIndent )
+ {
+ if ( bRTL )
+ {
+ Point aPoint( Left(), 0 );
+ pFrm->SwitchLTRtoRTL( aPoint );
+ nLeftMarginTabPos = pFrm->Frm().Right() - aPoint.X();
+ }
+ else
+ {
+ nLeftMarginTabPos = Left() - pFrm->Frm().Left();
+ }
+ }
+ if( pCurr->HasForcedLeftMargin() )
+ {
+ SwLinePortion* pPor = pCurr->GetPortion();
+ while( pPor && !pPor->IsFlyPortion() )
+ {
+ pPor = pPor->GetPortion();
+ }
+ if ( pPor )
+ {
+ nLeftMarginTabPos += pPor->Width();
+ }
+ }
}
- else
+ const bool bNewTabPortionInsideHangingIndent =
+ bRTL ? nCurrentAbsPos > nTabLeft - nLeftMarginTabPos
+ : nCurrentAbsPos < nTabLeft + nLeftMarginTabPos;
+ if ( bNewTabPortionInsideHangingIndent )
{
- nForced = Left() - pFrm->Frm().Left();
+ // If the paragraph is not inside a list having a list tab stop following
+ // the list label or no further tab stop found in such a paragraph or
+ // the next tab stop position does not equal the list tab stop,
+ // a tab stop at the left margin can be applied. If this condition is
+ // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
+ const bool bTabAtLeftMarginAllowed =
+ ( !aLineInf.IsListTabStopIncluded() ||
+ !pTabStop ||
+ nNextPos != aLineInf.GetListTabStopPosition() ) ||
+ // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
+ pFrm->GetTxtNode()->getIDocumentSettingAccess()->
+ get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
+ if ( bTabAtLeftMarginAllowed )
+ {
+ if ( !pTabStop || eAdj == SVX_TAB_ADJUST_DEFAULT ||
+ ( nNextPos > nLeftMarginTabPos ) )
+ {
+ eAdj = SVX_TAB_ADJUST_DEFAULT;
+ cFill = 0;
+ nNextPos = nLeftMarginTabPos;
+ }
+ }
}
}
- if( pCurr->HasForcedLeftMargin() )
- {
- SwLinePortion* pPor = pCurr->GetPortion();
- while( pPor && !pPor->IsFlyPortion() )
- pPor = pPor->GetPortion();
- if( pPor )
- nForced += pPor->Width();
- }
-
// <--
- // --> OD 2009-04-03 #i100732#
- // correction of condition, when a tab stop at the left margin can
- // be applied:
- // If the paragraph is not inside a list having a list tab stop following
- // the list label or no further tab stop found in such a paragraph or
- // the next tab stop position does not equal the list tab stop,
- // a tab stop at the left margin can be applied. If this condition is
- // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
- const bool bTabAtLeftMargin =
- ( !aLineInf.IsListTabStopIncluded() ||
- !pTabStop ||
- nNextPos != aLineInf.GetListTabStopPosition() ) ||
- // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
- pFrm->GetTxtNode()->getIDocumentSettingAccess()->
- get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
- if ( bTabAtLeftMargin &&
- // <--
- ( ( bRTL && nCurrentAbsPos > nTabLeft - nForced ) ||
- ( !bRTL && nCurrentAbsPos < nTabLeft + nForced ) ) &&
- // --> OD 2009-07-21 #i103685#
- // adjust condition:
- // - back to pre OOo 3.0 condition, if tab stops are relative to indent
- // - further checks needed, if tab stops are not relative to indent
- ( nNextPos > 0 &&
- ( bTabsRelativeToIndent ||
- ( !pTabStop || nNextPos > nForced ) ) ) )
- // <--
- {
- eAdj = SVX_TAB_ADJUST_DEFAULT;
- cFill = 0;
- nNextPos = nForced;
- }
+
nNextPos += bRTL ? nLinePos - nTabLeft : nTabLeft - nLinePos;
ASSERT( nNextPos >= 0, "GetTabStop: Don't go back!" );
nNewTabPos = KSHORT(nNextPos);
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 979a810b018b..ba2c3fce60c6 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -77,7 +77,7 @@ SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const
// Attribut fuer Inhalts-/Positions-Referenzen im Text
SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx
index 8c64e4b2bd29..8b7e54813171 100644
--- a/sw/source/core/txtnode/atrtox.cxx
+++ b/sw/source/core/txtnode/atrtox.cxx
@@ -36,7 +36,7 @@
#include <ndtxt.hxx>
SwTxtTOXMark::SwTxtTOXMark( SwTOXMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 236a0bab3d72..bf4116cc91f9 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -613,6 +613,7 @@ SwFmtMeta::~SwFmtMeta()
{
if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
{
+ NotifyChangeTxtNode(0);
m_pMeta->SetFmtMeta(0);
}
}
@@ -633,16 +634,24 @@ SfxPoolItem * SwFmtMeta::Clone( SfxItemPool * /*pPool*/ ) const
void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr)
{
- ASSERT(!(m_pTxtAttr && i_pTxtAttr),
+ OSL_ENSURE(!(m_pTxtAttr && i_pTxtAttr),
"SwFmtMeta::SetTxtAttr: already has text attribute?");
- ASSERT( m_pTxtAttr || i_pTxtAttr ,
+ OSL_ENSURE( m_pTxtAttr || i_pTxtAttr ,
"SwFmtMeta::SetTxtAttr: no attribute to remove?");
m_pTxtAttr = i_pTxtAttr;
- ASSERT(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
// the sw::Meta must be able to find the current text attribute!
- if (i_pTxtAttr && m_pMeta)
+ if (m_pMeta)
{
- m_pMeta->SetFmtMeta(this);
+ if (i_pTxtAttr)
+ {
+ m_pMeta->SetFmtMeta(this);
+ }
+ else if (m_pMeta->GetFmtMeta() == this)
+ { // text attribute gone => de-register from text node!
+ NotifyChangeTxtNode(0);
+ m_pMeta->SetFmtMeta(0);
+ }
}
}
@@ -650,36 +659,22 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
{
// N.B.: do not reset m_pTxtAttr here: see call in nodes.cxx,
// where the hint is not deleted!
- ASSERT(m_pMeta, "NotifyRemoval: no meta ?");
- if (m_pMeta)
- {
- if (!pTxtNode)
- {
- SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
- &static_cast<SwModify&>(*m_pMeta) ); // cast to base class!
- m_pMeta->Modify(&aMsgHint, &aMsgHint);
- }
- else
- { // do not call Modify, that would call SwXMeta::Modify!
- m_pMeta->NotifyChangeTxtNode();
- }
+ OSL_ENSURE(m_pMeta, "SwFmtMeta::NotifyChangeTxtNode: no Meta?");
+ if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
+ { // do not call Modify, that would call SwXMeta::Modify!
+ m_pMeta->NotifyChangeTxtNode(pTxtNode);
}
}
-// UGLY: this really awful method fixes up an inconsistent state,
-// and if it is not called when copying, total chaos will undoubtedly ensue
-void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
+// this SwFmtMeta has been cloned and points at the same sw::Meta as the source
+// this method copies the sw::Meta
+void SwFmtMeta::DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode)
{
- ASSERT(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
if (m_pMeta)
{
const ::boost::shared_ptr< ::sw::Meta> pOriginal( m_pMeta );
- // UGLY: original sw::Meta now points at _this_ due to being already
- // inserted via MakeTxtAttr! so fix it up to point at the original item
- // (maybe would be better to tell MakeTxtAttr that it creates a copy?)
- pOriginal->SetFmtMeta(&rOriginalMeta);
- // force pOriginal to register in original text node!
- pOriginal->NotifyChangeTxtNode();
if (RES_TXTATR_META == Which())
{
m_pMeta.reset( new ::sw::Meta(this) );
@@ -688,14 +683,13 @@ void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
{
::sw::MetaField *const pMetaField(
static_cast< ::sw::MetaField* >(pOriginal.get()));
- SwDoc * const pTargetDoc( GetTxtAttr()->GetTxtNode()->GetDoc() );
- m_pMeta = pTargetDoc->GetMetaFieldManager().makeMetaField( this,
+ m_pMeta = i_rTargetDocManager.makeMetaField( this,
pMetaField->m_nNumberFormat, pMetaField->IsFixedLanguage() );
}
+ // Meta must have a text node before calling RegisterAsCopyOf
+ m_pMeta->NotifyChangeTxtNode(& i_rTargetTxtNode);
// this cannot be done in Clone: a Clone is not necessarily a copy!
m_pMeta->RegisterAsCopyOf(*pOriginal);
- // force copy Meta to register in target text node!
- m_pMeta->NotifyChangeTxtNode();
}
}
@@ -724,27 +718,36 @@ SwTxtMeta * Meta::GetTxtAttr() const
SwTxtNode * Meta::GetTxtNode() const
{
- SwTxtMeta * const pTxtAttr( GetTxtAttr() );
- return (pTxtAttr) ? pTxtAttr->GetTxtNode() : 0;
+ return m_pTxtNode;
}
-void Meta::NotifyChangeTxtNode()
+void Meta::NotifyChangeTxtNodeImpl()
{
- SwTxtNode * const pTxtNode( GetTxtNode() );
- if (pTxtNode && (GetRegisteredIn() != pTxtNode))
+ if (m_pTxtNode && (GetRegisteredIn() != m_pTxtNode))
{
- pTxtNode->Add(this);
+ m_pTxtNode->Add(this);
}
- else if (!pTxtNode && GetRegisteredIn())
+ else if (!m_pTxtNode && GetRegisteredIn())
{
const_cast<SwModify *>(GetRegisteredIn())->Remove(this);
}
}
+void Meta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
+{
+ m_pTxtNode = pTxtNode;
+ NotifyChangeTxtNodeImpl();
+ if (!pTxtNode) // text node gone? invalidate UNO object!
+ {
+ SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
+ &static_cast<SwModify&>(*this) ); // cast to base class!
+ this->Modify(&aMsgHint, &aMsgHint);
+ }
+}
+
// SwClient
void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
- NotifyChangeTxtNode();
SwModify::Modify(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
@@ -752,7 +755,7 @@ void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
}
-// sw::Metadatable
+// sfx2::Metadatable
::sfx2::IXmlIdRegistry& Meta::GetRegistry()
{
SwTxtNode * const pTxtNode( GetTxtNode() );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9a2767977d84..fa7b72271826 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1435,15 +1435,10 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
}
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- ASSERT(pNewHt, "copying META should not fail! cannot call DoCopy");
- ASSERT(pDest && (CH_TXTATR_INWORD ==
+ OSL_ENSURE(pNewHt, "copying Meta should not fail!");
+ OSL_ENSURE(pDest && (CH_TXTATR_INWORD ==
pDest->GetTxt().GetChar(*pNewHt->GetStart())),
"missing CH_TXTATR?");
- if (pNewHt)
- {
- SwFmtMeta & rMeta(static_cast<SwFmtMeta&>(pNewHt->GetAttr()));
- rMeta.DoCopy( const_cast<SwFmtMeta&>(pHt->GetMeta()) );
- }
break;
}
}
@@ -1484,7 +1479,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
{
// attribute in the area => copy
SwTxtAttr *const pNewHt = pDest->InsertItem(
- pHt->GetAttr(), nOldPos, nOldPos );
+ pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
if ( pNewHt )
{
lcl_CopyHint( nWhich, pHt, pNewHt,
@@ -1495,7 +1491,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
: 0 == pOtherDoc->GetRefMark(
pHt->GetRefMark().GetRefName() ) )
{
- pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos );
+ pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
}
}
}
@@ -1718,9 +1715,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( pDest == this )
{
- // die Daten kopieren
+ // copy the hint here, but insert it later
pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(),
- nAttrStt, nAttrEnd );
+ nAttrStt, nAttrEnd, COPY, pDest );
lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
@@ -1728,7 +1725,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
else
{
pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
- nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR );
+ nAttrEnd - nDeletedDummyChars,
+ nsSetAttrMode::SETATTR_NOTXTATRCHR
+ | nsSetAttrMode::SETATTR_IS_COPY);
if (pNewHt)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
@@ -2208,7 +2207,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
const bool bSuccess( pDest->InsertHint( pNewHt,
nsSetAttrMode::SETATTR_NOTXTATRCHR
- | nsSetAttrMode::SETATTR_DONTREPLACE ) );
+ | nsSetAttrMode::SETATTR_DONTREPLACE
+ | nsSetAttrMode::SETATTR_IS_COPY) );
if (bSuccess)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index d0be32e61953..4d0dd116e5cd 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -996,7 +996,8 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr )
// create new text attribute
SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEnd )
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy, SwTxtNode *const pTxtNode)
{
if ( isCHRATR(rAttr.Which()) )
{
@@ -1077,7 +1078,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
break;
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- pNew = new SwTxtMeta( static_cast<SwFmtMeta&>(rNew), nStt, nEnd );
+ pNew = SwTxtMeta::CreateTxtMeta( rDoc.GetMetaFieldManager(), pTxtNode,
+ static_cast<SwFmtMeta&>(rNew), nStt, nEnd, bIsCopy );
break;
default:
ASSERT(RES_TXTATR_AUTOFMT == rNew.Which(), "unknown attribute");
@@ -1211,7 +1213,8 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
ASSERT( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
"SwTxtNode::InsertItem should not be called with character attributes");
- SwTxtAttr* const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd );
+ SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd,
+ (nMode & nsSetAttrMode::SETATTR_IS_COPY) ? COPY : NEW, this );
if ( pNew )
{
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index f6dcfc520eae..90b5b984a8d1 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -308,10 +308,25 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
* class SwTxtMeta
*************************************************************************/
+SwTxtMeta *
+SwTxtMeta::CreateTxtMeta(
+ ::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode *const i_pTargetTxtNode,
+ SwFmtMeta & i_rAttr,
+ xub_StrLen const i_nStart, xub_StrLen const i_nEnd, bool const i_bIsCopy)
+{
+ if (COPY == i_bIsCopy)
+ { // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta
+ OSL_ENSURE(i_pTargetTxtNode, "cannot copy Meta without target node");
+ i_rAttr.DoCopy(i_rTargetDocManager, *i_pTargetTxtNode);
+ }
+ SwTxtMeta *const pTxtMeta(new SwTxtMeta(i_rAttr, i_nStart, i_nEnd));
+ return pTxtMeta;
+}
+
SwTxtMeta::SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd )
: SwTxtAttrNesting( i_rAttr, i_nStart, i_nEnd )
- , m_pTxtNode( 0 )
{
i_rAttr.SetTxtAttr( this );
SetHasDummyChar(true);
@@ -328,7 +343,6 @@ SwTxtMeta::~SwTxtMeta()
void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode)
{
- m_pTxtNode = pNode; // before Notify!
SwFmtMeta & rFmtMeta( static_cast<SwFmtMeta &>(GetAttr()) );
if (rFmtMeta.GetTxtAttr() == this)
{
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 4b99670b865c..b3d93e8eb0a7 100644..100755
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -966,11 +966,11 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
if (pFont)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 1bb59d0eee65..90d5dac1c315 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -886,7 +886,7 @@ bool SwXMeta::SetContentRange(
SwTxtMeta const * const pTxtAttr( pMeta->GetTxtAttr() );
if (pTxtAttr)
{
- rpNode = pTxtAttr->GetTxtNode();
+ rpNode = pMeta->GetTxtNode();
if (rpNode)
{
// rStart points at the first position _within_ the meta!
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 875d0e23235d..323eedffc9b0 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1857,32 +1857,6 @@ static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 )
return abs( nPos1 - nPos2 ) < COL_POS_FUZZY;
}
-void SwXText::copyText(
- const uno::Reference< text::XTextCopy >& xSource )
- throw ( uno::RuntimeException )
-{
- uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW );
- SwXText* pText = 0;
- pText = reinterpret_cast< SwXText* >(
- sal::static_int_cast< sal_IntPtr >( xTTunnel->getSomething( SwXText::getUnoTunnelId()) ));
-
- uno::Reference< text::XText > xText( xSource, uno::UNO_QUERY_THROW );
- uno::Reference< text::XTextCursor > xCursor = xText->createTextCursor( );
- xCursor->gotoEnd( sal_True );
-
- uno::Reference< lang::XUnoTunnel > xTunnel( xCursor, uno::UNO_QUERY_THROW );
-
- OTextCursorHelper* pCursor = 0;
- pCursor = reinterpret_cast< OTextCursorHelper* >(
- sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
- if ( pCursor )
- {
- SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
- SwPosition rPos( rNdIndex );
- m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM( ), rPos, false );
- }
-}
-
void SwXText::Impl::ConvertCell(
const bool bFirstCell,
const uno::Sequence< uno::Reference< text::XTextRange > > & rCell,
@@ -2387,6 +2361,35 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return xRet;
}
+
+void SAL_CALL
+SwXText::copyText(
+ const uno::Reference< text::XTextCopy >& xSource )
+throw (uno::RuntimeException)
+{
+ vos::OGuard g(Application::GetSolarMutex());
+
+ uno::Reference< text::XText > const xText(xSource, uno::UNO_QUERY_THROW);
+ uno::Reference< text::XTextCursor > const xCursor =
+ xText->createTextCursor();
+ xCursor->gotoEnd( sal_True );
+
+ uno::Reference< lang::XUnoTunnel > const xCursorTunnel(xCursor,
+ uno::UNO_QUERY_THROW);
+
+ OTextCursorHelper *const pCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xCursorTunnel);
+ if (!pCursor)
+ {
+ throw uno::RuntimeException();
+ }
+
+ SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
+ SwPosition rPos( rNdIndex );
+ m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM(), rPos, false );
+}
+
+
/******************************************************************
* SwXBodyText
******************************************************************/
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 357a7aff1e57..74d400a17796 100644..100755
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -118,6 +118,11 @@ RtfSdrExport& RtfExport::SdrExporter() const
return *m_pSdrExport;
}
+bool RtfExport::HackIsWW8OrHigher() const
+{
+ return true;
+}
+
bool RtfExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich )
{
// FIXME is this actually true for rtf? - this is copied from DOCX
@@ -480,6 +485,10 @@ void RtfExport::WritePageDescTable()
}
Strm() << '}' << sNewLine;
bOutPageDescs = sal_False;
+
+ // reset table infos, otherwise the depth of the cells will be incorrect,
+ // in case the page style (header or footer) had tables
+ mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
}
void RtfExport::ExportDocument_Impl()
@@ -1243,16 +1252,19 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_
class SwRTFWriter : public Writer
{
- public:
+ bool m_bOutOutlineOnly;
+ public:
SwRTFWriter( const String& rFilterName, const String& rBaseURL );
virtual ~SwRTFWriter();
virtual sal_uLong WriteStream();
};
-SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL )
{
OSL_TRACE("%s", OSL_THIS_FUNC);
SetBaseURL( rBaseURL );
+ // export outline nodes, only (send outline to clipboard/presentation)
+ m_bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
}
SwRTFWriter::~SwRTFWriter()
@@ -1262,6 +1274,7 @@ sal_uLong SwRTFWriter::WriteStream()
{
OSL_TRACE("%s", OSL_THIS_FUNC);
RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+ aExport.mbOutOutlineOnly = m_bOutOutlineOnly;
aExport.ExportDocument( true );
return 0;
}
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index e73cd9b822c5..a6f018cddb7e 100644..100755
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -82,7 +82,7 @@ public:
virtual RtfSdrExport& SdrExporter() const;
/// Hack, unfortunately necessary at some places for now.
- virtual bool HackIsWW8OrHigher() const { return false; }
+ virtual bool HackIsWW8OrHigher() const;
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 7f5e0eaae54e..7f6fe64a5eea 100644..100755
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -107,6 +107,7 @@
#include <ndgrf.hxx>
#include <ndole.hxx>
+
#include <cstdio>
using namespace ::com::sun::star;
@@ -575,7 +576,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos )
characters.
*/
if ( !m_rExport.HackIsWW8OrHigher() )
- aFont.GetCharSet() = GetCharSet();
+ aFont.SetCharSet( GetCharSet() );
if ( rParentFont != aFont )
m_rExport.AttrOutput().OutputItem( aFont );
@@ -1650,12 +1651,13 @@ xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode&
{
// Get the bookmarks for the normal run
xub_StrLen nNextPos = aAttrIter->WhereNext();
-
- GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
-
xub_StrLen nNextBookmark = nNextPos;
- NearestBookmark( nNextPos, nAktPos, false );
+ if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise
+ {
+ GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos );
+ NearestBookmark( nNextBookmark, nAktPos, false );
+ }
return std::min( nNextPos, nNextBookmark );
}
@@ -1663,9 +1665,9 @@ void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos
{
xub_StrLen nNextPos;
- // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+ // go to next attribute if no bookmark is found and if the next attribute position if at the current position
bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
- if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
+ if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() )
aAttrIter->NextPos();
}
@@ -2837,8 +2839,12 @@ void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode )
switch ( rNode.GetNodeType() )
{
case ND_TEXTNODE:
- OutputTextNode( *rNode.GetTxtNode() );
- break;
+ {
+ const SwTxtNode& rTextNode = *rNode.GetTxtNode();
+ if( !mbOutOutlineOnly || rTextNode.IsOutline() )
+ OutputTextNode( rTextNode );
+ }
+ break;
case ND_GRFNODE:
OutputGrfNode( *rNode.GetGrfNode() );
break;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c40ce759b3f2..3ec0aeea4d0c 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3389,6 +3389,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
pStyles( NULL ),
bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
mbExportModeRTF( false ),
+ mbOutOutlineOnly( false ),
pDoc( pDocument ),
pCurPam( pCurrentPam ),
pOrigPam( pOriginalPam )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 6350fb9f5512..129822af0640 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -554,6 +554,7 @@ public:
sal_uInt8 bSubstituteBullets : 1; // true: SubstituteBullet() gets called
bool mbExportModeRTF;
+ bool mbOutOutlineOnly; // export outline nodes, only (send outline to clipboard/presentation)
SwDoc *pDoc;
SwPaM *pCurPam, *pOrigPam;
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index fcaf4e07a293..0fe904e8a092 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -79,6 +79,8 @@
#include "docsh.hxx"
#include <cstdio>
+#include <stdio.h>
+
using namespace ::com::sun::star;
using namespace nsFieldFlags;
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c2e9c8789d55..8bd86b4bbe05 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2573,7 +2573,10 @@ void WW8TabDesc::CreateSwTable()
else
{
if (nPreferredWidth)
- nLeft = pIo->maSectionManager.GetTextAreaWidth() - nPreferredWidth - nOrgDxaLeft;
+ {
+ nLeft = pIo->maSectionManager.GetTextAreaWidth();
+ nLeft = nLeft - nPreferredWidth - nOrgDxaLeft;
+ }
else
nLeft = -GetMinLeft();
}
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 21c9a3b93c75..75251c8c1531 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -70,21 +70,22 @@ using ::com::sun::star::beans::XPropertySetInfo;
SwDoc* lcl_GetDocViaTunnel( Reference<XTextCursor> & rCursor )
{
Reference<XUnoTunnel> xTunnel( rCursor, UNO_QUERY);
- DBG_ASSERT( xTunnel.is(), "missing XUnoTunnel for Cursor" );
- OTextCursorHelper* pSwXCursor = reinterpret_cast< OTextCursorHelper * >(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(OTextCursorHelper::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pSwXCursor, "OTextCursorHelper missing" );
- return pSwXCursor->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextCursor");
+ OTextCursorHelper *const pXCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
+ OSL_ENSURE( pXCursor, "OTextCursorHelper missing" );
+ return (pXCursor) ? pXCursor->GetDoc() : 0;
}
SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange )
{
Reference<XUnoTunnel> xTunnel(rRange, UNO_QUERY);
- DBG_ASSERT(xTunnel.is(), "Can't tunnel XTextRange");
- SwXTextRange *pRange = reinterpret_cast< SwXTextRange *>(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextRange::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pRange, "SwXTextRange missing" );
- return pRange->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextRange");
+ SwXTextRange *const pXRange =
+ ::sw::UnoTunnelGetImplementation<SwXTextRange>(xTunnel);
+ // #i115174#: this may be a SvxUnoTextRange
+// OSL_ENSURE( pXRange, "SwXTextRange missing" );
+ return (pXRange) ? pXRange->GetDoc() : 0;
}
@@ -111,7 +112,7 @@ public:
void Set( SwNodeIndex& rIndex );
void SetAsNodeIndex( Reference<XTextRange> & rRange );
- void CopyPositionInto(SwPosition& rPos);
+ void CopyPositionInto(SwPosition& rPos, SwDoc & rDoc);
SwDoc* GetDoc();
sal_Bool IsValid();
@@ -154,6 +155,12 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
// XTextRange -> XTunnel -> SwXTextRange
SwDoc* pDoc = lcl_GetDocViaTunnel(rRange);
+ if (!pDoc)
+ {
+ OSL_TRACE("SetAsNodeIndex: no SwDoc");
+ return;
+ }
+
// SwXTextRange -> PaM
SwUnoInternalPaM aPaM(*pDoc);
#ifdef DBG_UTIL
@@ -166,14 +173,15 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
Set(aPaM.GetPoint()->nNode);
}
-void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos)
+void
+XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc)
{
DBG_ASSERT(IsValid(), "Can't get Position");
// create PAM from start cursor (if no node index is present)
if (NULL == pIndex)
{
- SwUnoInternalPaM aUnoPaM(*GetDoc());
+ SwUnoInternalPaM aUnoPaM(rDoc);
#ifdef DBG_UTIL
sal_Bool bSuccess =
#endif
@@ -479,6 +487,13 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection(
// get document from old cursor (via tunnel)
SwDoc* pDoc = lcl_GetDocViaTunnel(xOldCursor);
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::CreateRedlineTextSection: "
+ "no SwDoc => cannot create section.");
+ return 0;
+ }
+
// create text section for redline
SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool
(RES_POOLCOLL_STANDARD, false );
@@ -611,11 +626,18 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
// get the document (from one of the positions)
SwDoc* pDoc = pRedlineInfo->aAnchorStart.GetDoc();
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::InsertIntoDocument: "
+ "no SwDoc => cannot insert redline.");
+ return;
+ }
+
// now create the PaM for the redline
SwPaM aPaM(pDoc->GetNodes().GetEndOfContent());
- pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
aPaM.SetMark();
- pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
// collapse PaM if (start == end)
if (*aPaM.GetPoint() == *aPaM.GetMark())
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 012f08ff9684..2b3b4b345dbc 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -698,23 +698,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
switch( rEvHint.GetEventId() )
{
-/* MA 07. Mar. 96: UpdateInputFlds() nur noch bei Dokument neu.
- (Und bei Einfuegen Textbaust.)
- case SFX_EVENT_OPENDOC:
- // dann am aktuellen Dokument die Input-Fedler updaten
- if( pWrtSh )
- pWrtSh->UpdateInputFlds();
+ case SFX_EVENT_LOADFINISHED:
+ OSL_ASSERT(!pWrtSh);
+ // if it is a new document created from a template,
+ // update fixed fields
+ if (pDocSh->GetMedium())
+ {
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
+ pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ if (pTemplateItem && pTemplateItem->GetValue())
+ {
+ pDocSh->GetDoc()->SetFixFields(false, 0);
+ }
+ }
break;
-*/
case SFX_EVENT_CREATEDOC:
- // alle FIX-Date/Time Felder auf akt. setzen
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
sal_Bool bUpdateFields = sal_True;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = sal_False;
- pWrtSh->SetFixFields();
if(bUpdateFields)
{
pWrtSh->UpdateInputFlds();
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index f5e79b9da72f..4359ca16f9d9 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -209,7 +209,12 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
return;
// Weitergabe an die CORE
- const sal_Bool bReadonly = pCurrView->GetDocShell()->IsReadOnly();
+ sal_Bool bReadonly;
+ const SwDocShell* pDocSh = pCurrView->GetDocShell();
+ if (pDocSh)
+ bReadonly = pDocSh->IsReadOnly();
+ else //Use existing option if DocShell missing
+ bReadonly = pSh->GetViewOptions()->IsReadonly();
SwViewOption* pViewOpt;
if(!bViewOnly)
pViewOpt = new SwViewOption( *pPref );
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index e64ec62f6c3a..99ba59d9d852 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1321,7 +1321,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
aAtHorzPosFT.Enable( bEnable );
aAtHorzPosED.Enable( bEnable );
- bEnable = nV == text::VertOrientation::NONE && !bFormat;
+ bEnable = nV == text::VertOrientation::NONE;
if ( !bEnable )
{
aAtVertPosED.SetValue( 0, FUNIT_TWIP );
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index a21d8920c78d..98e40aa4f9aa 100644..100755
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -575,8 +575,8 @@ TabPage TP_TOX_ENTRY
};
Window WIN_TOKEN
{
- Pos = MAP_APPFONT ( 70, 16 ) ;
- Size = MAP_APPFONT ( 136, 12 ) ;
+ Pos = MAP_APPFONT ( 70, 15 ) ;
+ Size = MAP_APPFONT ( 136, 14 ) ;
ImageButton WIN_LEFT_SCROLL
{
HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_LEFT_SCROLL";
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 98280db3f63e..ae84d4b1872f 100644..100755
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -560,11 +560,11 @@ void SwHHCWrapper::ReplaceUnit(
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
- aFontItem.GetFamilyName() = pTargetFont->GetName();
- aFontItem.GetFamily() = pTargetFont->GetFamily();
- aFontItem.GetStyleName() = pTargetFont->GetStyleName();
- aFontItem.GetPitch() = pTargetFont->GetPitch();
- aFontItem.GetCharSet() = pTargetFont->GetCharSet();
+ aFontItem.SetFamilyName( pTargetFont->GetName());
+ aFontItem.SetFamily( pTargetFont->GetFamily());
+ aFontItem.SetStyleName( pTargetFont->GetStyleName());
+ aFontItem.SetPitch( pTargetFont->GetPitch());
+ aFontItem.SetCharSet( pTargetFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 6ed0e3050f26..d4c309cf2a2d 100644..100755
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -1161,10 +1161,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
bFontChanged = sal_True;
SvxFontItem aNewFontItem( aFont );
- aNewFontItem.GetFamilyName() = aNewFont.GetName();
- aNewFontItem.GetFamily() = aNewFont.GetFamily();
- aNewFontItem.GetPitch() = aNewFont.GetPitch();
- aNewFontItem.GetCharSet() = aNewFont.GetCharSet();
+ aNewFontItem.SetFamilyName( aNewFont.GetName());
+ aNewFontItem.SetFamily( aNewFont.GetFamily());
+ aNewFontItem.SetPitch( aNewFont.GetPitch());
+ aNewFontItem.SetCharSet( aNewFont.GetCharSet() );
SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 45eab49d553d..9fe0b570cc6f 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1111,12 +1111,18 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
if(!bModifyTable && !bProp )
{
-// Tabellenbreite bleibt, Differenz wird mit der/den
-// naechsten Zellen ausgeglichen
+// the table width is constant, the difference is balanced with the other columns
+ sal_uInt16 nLoopCount = 0;
while( nDiff )
{
if( ++nAktPos == nNoOfVisibleCols)
+ {
nAktPos = 0;
+ ++nLoopCount;
+ //#i101353# in small tables it might not be possible to balance column width
+ if( nLoopCount > 1 )
+ break;
+ }
if( nDiff < 0 )
{
SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 35f3c0e8e172..7b2409152372 100644..100755
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -4123,6 +4123,8 @@ SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewO
SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl()
{
m_rShell.ApplyViewOptions( m_aOldViewOptions );
+ //#i115062# invalidate meta character slot
+ m_rShell.GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
}
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 788fd4cce9cb..b895fd418170 100644..100755
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -421,8 +421,8 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
rSh.EnterStdMode();
rSh.GotoMark(pMark);
+ return sal_True;
}
- return sal_True;
}
// IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph
//
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index d88ecdf6be73..7ad513ed479e 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -809,8 +809,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
&aContentToolBox, SW_RES(NF_PAGE ));
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
- pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
+ pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+ pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+
bPageCtrlsVisible = sal_True;
// Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT);
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 2d0bcc433be1..465277890a28 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1307,6 +1307,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// <--
aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt);
}
@@ -1370,6 +1373,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
aFmt.SetBulletChar( numfunc::GetBulletChar(nLvl) );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
// --> OD 2009-08-26 #i95907#
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index c3bef67c8c12..2426a20c595f 100644..100755
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 4b482e373d3f..ba12b6c0274a 100644..100755
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -143,8 +143,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 69b65cfd3e59..bb58c81f7d81 100644..100755
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 69b65cfd3e59..bb58c81f7d81 100644..100755
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index fb10ca615b50..3243d6b1646b 100644..100755
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -198,8 +198,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index ae0df22748fe..3a31ab392010 100644..100755
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -196,8 +196,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk
index ac32cdbe453b..ce5b0b70b636 100644
--- a/sysui/desktop/icons/makefile.mk
+++ b/sysui/desktop/icons/makefile.mk
@@ -127,69 +127,6 @@ all: \
$(MISC)$/ooo11-math-doc.ico \
$(MISC)$/ooo11-writer-doc.ico \
$(MISC)$/ooo11-writer-tem.ico \
- $(MISC)$/so8-base-app.ico \
- $(MISC)$/so8-base-doc.ico \
- $(MISC)$/so8-calc-app.ico \
- $(MISC)$/so8-calc-doc.ico \
- $(MISC)$/so8-calc-tem.ico \
- $(MISC)$/so8-chart-doc.ico \
- $(MISC)$/so8-configuration.ico \
- $(MISC)$/so8-draw-app.ico \
- $(MISC)$/so8-draw-doc.ico \
- $(MISC)$/so8-draw-tem.ico \
- $(MISC)$/so8-empty-doc.ico \
- $(MISC)$/so8-empty-tem.ico \
- $(MISC)$/so8-image-doc.ico \
- $(MISC)$/so8-impress-app.ico \
- $(MISC)$/so8-impress-doc.ico \
- $(MISC)$/so8-impress-tem.ico \
- $(MISC)$/so8-macro-doc.ico \
- $(MISC)$/so8-main-app.ico \
- $(MISC)$/so8-master-doc.ico \
- $(MISC)$/so8-math-app.ico \
- $(MISC)$/so8-math-doc.ico \
- $(MISC)$/so8-open.ico \
- $(MISC)$/so8-printer.ico \
- $(MISC)$/so8-web-doc.ico \
- $(MISC)$/so8-writer-app.ico \
- $(MISC)$/so8-writer-doc.ico \
- $(MISC)$/so8-writer-tem.ico \
- $(MISC)$/so9_empty_tem.ico \
- $(MISC)$/so9_math_app.ico \
- $(MISC)$/so9_global_doc.ico \
- $(MISC)$/so9_main_app.ico \
- $(MISC)$/so9_empty_doc.ico \
- $(MISC)$/so9_math_doc.ico \
- $(MISC)$/so9_base_app.ico \
- $(MISC)$/so9_html_doc.ico \
- $(MISC)$/so9_impress_doc.ico \
- $(MISC)$/so9_draw_tem.ico \
- $(MISC)$/so9_writer_tem.ico \
- $(MISC)$/so9_impress_app.ico \
- $(MISC)$/so9_calc_tem.ico \
- $(MISC)$/so9_base_doc.ico \
- $(MISC)$/so9_macro_doc.ico \
- $(MISC)$/so9_calc_doc.ico \
- $(MISC)$/so9_draw_doc.ico \
- $(MISC)$/so9_writer_doc.ico \
- $(MISC)$/so9_calc_app.ico \
- $(MISC)$/so9_impress_tem.ico \
- $(MISC)$/so9_chart_doc.ico \
- $(MISC)$/so9_writer_app.ico \
- $(MISC)$/so9_draw_app.ico \
- $(MISC)$/so9_open.ico \
- $(MISC)$/so7-base-doc.ico \
- $(MISC)$/so7-calc-doc.ico \
- $(MISC)$/so7-calc-tem.ico \
- $(MISC)$/so7-chart-doc.ico \
- $(MISC)$/so7-draw-doc.ico \
- $(MISC)$/so7-draw-tem.ico \
- $(MISC)$/so7-impress-doc.ico \
- $(MISC)$/so7-impress-tem.ico \
- $(MISC)$/so7-master-doc.ico \
- $(MISC)$/so7-math-doc.ico \
- $(MISC)$/so7-writer-doc.ico \
- $(MISC)$/so7-writer-tem.ico \
$(MISC)$/oxt-extension.ico
$(MISC)$/%.ico: %.ico
diff --git a/sysui/desktop/icons/so7-base-doc.ico b/sysui/desktop/icons/so7-base-doc.ico
deleted file mode 100755
index e4beab7270e1..000000000000
--- a/sysui/desktop/icons/so7-base-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-doc.ico b/sysui/desktop/icons/so7-calc-doc.ico
deleted file mode 100755
index 8b34fc606c5d..000000000000
--- a/sysui/desktop/icons/so7-calc-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-calc-tem.ico b/sysui/desktop/icons/so7-calc-tem.ico
deleted file mode 100755
index d074a214a90b..000000000000
--- a/sysui/desktop/icons/so7-calc-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-chart-doc.ico b/sysui/desktop/icons/so7-chart-doc.ico
deleted file mode 100755
index bdc613fb30e2..000000000000
--- a/sysui/desktop/icons/so7-chart-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-doc.ico b/sysui/desktop/icons/so7-draw-doc.ico
deleted file mode 100755
index c2881862053a..000000000000
--- a/sysui/desktop/icons/so7-draw-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-draw-tem.ico b/sysui/desktop/icons/so7-draw-tem.ico
deleted file mode 100755
index 8d713d0f470e..000000000000
--- a/sysui/desktop/icons/so7-draw-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-doc.ico b/sysui/desktop/icons/so7-impress-doc.ico
deleted file mode 100755
index a8f9518e624b..000000000000
--- a/sysui/desktop/icons/so7-impress-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-impress-tem.ico b/sysui/desktop/icons/so7-impress-tem.ico
deleted file mode 100755
index ac140b269242..000000000000
--- a/sysui/desktop/icons/so7-impress-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-master-doc.ico b/sysui/desktop/icons/so7-master-doc.ico
deleted file mode 100755
index 1c3068715990..000000000000
--- a/sysui/desktop/icons/so7-master-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-math-doc.ico b/sysui/desktop/icons/so7-math-doc.ico
deleted file mode 100755
index d1cd9bd4c6bd..000000000000
--- a/sysui/desktop/icons/so7-math-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-doc.ico b/sysui/desktop/icons/so7-writer-doc.ico
deleted file mode 100755
index b8eb3df20564..000000000000
--- a/sysui/desktop/icons/so7-writer-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so7-writer-tem.ico b/sysui/desktop/icons/so7-writer-tem.ico
deleted file mode 100755
index 318cce4bc9a7..000000000000
--- a/sysui/desktop/icons/so7-writer-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-app.ico b/sysui/desktop/icons/so8-base-app.ico
deleted file mode 100755
index 4a22d3529614..000000000000
--- a/sysui/desktop/icons/so8-base-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-base-doc.ico b/sysui/desktop/icons/so8-base-doc.ico
deleted file mode 100755
index bcddbf957630..000000000000
--- a/sysui/desktop/icons/so8-base-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-app.ico b/sysui/desktop/icons/so8-calc-app.ico
deleted file mode 100755
index a28cab56157b..000000000000
--- a/sysui/desktop/icons/so8-calc-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-doc.ico b/sysui/desktop/icons/so8-calc-doc.ico
deleted file mode 100755
index 5f293dd82c30..000000000000
--- a/sysui/desktop/icons/so8-calc-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-calc-tem.ico b/sysui/desktop/icons/so8-calc-tem.ico
deleted file mode 100755
index 98bf90678573..000000000000
--- a/sysui/desktop/icons/so8-calc-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-chart-doc.ico b/sysui/desktop/icons/so8-chart-doc.ico
deleted file mode 100755
index 01ff8365434b..000000000000
--- a/sysui/desktop/icons/so8-chart-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-configuration.ico b/sysui/desktop/icons/so8-configuration.ico
deleted file mode 100755
index 57f3b6701b30..000000000000
--- a/sysui/desktop/icons/so8-configuration.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-app.ico b/sysui/desktop/icons/so8-draw-app.ico
deleted file mode 100755
index 6003ccb3d7c3..000000000000
--- a/sysui/desktop/icons/so8-draw-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-doc.ico b/sysui/desktop/icons/so8-draw-doc.ico
deleted file mode 100755
index f4f169bd6fb5..000000000000
--- a/sysui/desktop/icons/so8-draw-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-draw-tem.ico b/sysui/desktop/icons/so8-draw-tem.ico
deleted file mode 100755
index d3f63c38dbe0..000000000000
--- a/sysui/desktop/icons/so8-draw-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-doc.ico b/sysui/desktop/icons/so8-empty-doc.ico
deleted file mode 100755
index b71d2b939ca7..000000000000
--- a/sysui/desktop/icons/so8-empty-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-empty-tem.ico b/sysui/desktop/icons/so8-empty-tem.ico
deleted file mode 100755
index 9368b0a81aef..000000000000
--- a/sysui/desktop/icons/so8-empty-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-image-doc.ico b/sysui/desktop/icons/so8-image-doc.ico
deleted file mode 100755
index 11b4f0f6c718..000000000000
--- a/sysui/desktop/icons/so8-image-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-app.ico b/sysui/desktop/icons/so8-impress-app.ico
deleted file mode 100755
index 8fae43dab26d..000000000000
--- a/sysui/desktop/icons/so8-impress-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-doc.ico b/sysui/desktop/icons/so8-impress-doc.ico
deleted file mode 100755
index 9a91f89f2900..000000000000
--- a/sysui/desktop/icons/so8-impress-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-impress-tem.ico b/sysui/desktop/icons/so8-impress-tem.ico
deleted file mode 100755
index f84f813f992c..000000000000
--- a/sysui/desktop/icons/so8-impress-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-macro-doc.ico b/sysui/desktop/icons/so8-macro-doc.ico
deleted file mode 100755
index f3742e1274e7..000000000000
--- a/sysui/desktop/icons/so8-macro-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-main-app.ico b/sysui/desktop/icons/so8-main-app.ico
deleted file mode 100755
index aa044ad9c702..000000000000
--- a/sysui/desktop/icons/so8-main-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-master-doc.ico b/sysui/desktop/icons/so8-master-doc.ico
deleted file mode 100755
index 27a1d2f61c49..000000000000
--- a/sysui/desktop/icons/so8-master-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-app.ico b/sysui/desktop/icons/so8-math-app.ico
deleted file mode 100755
index 956c259c756a..000000000000
--- a/sysui/desktop/icons/so8-math-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-math-doc.ico b/sysui/desktop/icons/so8-math-doc.ico
deleted file mode 100755
index e7b88449999f..000000000000
--- a/sysui/desktop/icons/so8-math-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-open.ico b/sysui/desktop/icons/so8-open.ico
deleted file mode 100755
index b77a741b338f..000000000000
--- a/sysui/desktop/icons/so8-open.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-printer.ico b/sysui/desktop/icons/so8-printer.ico
deleted file mode 100755
index 25e61f8de5d5..000000000000
--- a/sysui/desktop/icons/so8-printer.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-web-doc.ico b/sysui/desktop/icons/so8-web-doc.ico
deleted file mode 100755
index 12eeb63cffb2..000000000000
--- a/sysui/desktop/icons/so8-web-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-app.ico b/sysui/desktop/icons/so8-writer-app.ico
deleted file mode 100755
index 15f7f92d4b45..000000000000
--- a/sysui/desktop/icons/so8-writer-app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-doc.ico b/sysui/desktop/icons/so8-writer-doc.ico
deleted file mode 100755
index da774be1d3ac..000000000000
--- a/sysui/desktop/icons/so8-writer-doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so8-writer-tem.ico b/sysui/desktop/icons/so8-writer-tem.ico
deleted file mode 100755
index 1bdb86c8090f..000000000000
--- a/sysui/desktop/icons/so8-writer-tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_app.ico b/sysui/desktop/icons/so9_base_app.ico
deleted file mode 100755
index aa7036eb90fc..000000000000
--- a/sysui/desktop/icons/so9_base_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_doc.ico b/sysui/desktop/icons/so9_base_doc.ico
deleted file mode 100755
index 8cc1d4433c2c..000000000000
--- a/sysui/desktop/icons/so9_base_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_app.ico b/sysui/desktop/icons/so9_calc_app.ico
deleted file mode 100755
index d7182cad0943..000000000000
--- a/sysui/desktop/icons/so9_calc_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_doc.ico b/sysui/desktop/icons/so9_calc_doc.ico
deleted file mode 100755
index 2b9e514cb97b..000000000000
--- a/sysui/desktop/icons/so9_calc_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_tem.ico b/sysui/desktop/icons/so9_calc_tem.ico
deleted file mode 100755
index 17f4823c4374..000000000000
--- a/sysui/desktop/icons/so9_calc_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_chart_doc.ico b/sysui/desktop/icons/so9_chart_doc.ico
deleted file mode 100755
index b116c81903b3..000000000000
--- a/sysui/desktop/icons/so9_chart_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_app.ico b/sysui/desktop/icons/so9_draw_app.ico
deleted file mode 100755
index a8b3c3270fc0..000000000000
--- a/sysui/desktop/icons/so9_draw_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_doc.ico b/sysui/desktop/icons/so9_draw_doc.ico
deleted file mode 100755
index 51f95046709a..000000000000
--- a/sysui/desktop/icons/so9_draw_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_tem.ico b/sysui/desktop/icons/so9_draw_tem.ico
deleted file mode 100755
index e4b341175bff..000000000000
--- a/sysui/desktop/icons/so9_draw_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_doc.ico b/sysui/desktop/icons/so9_empty_doc.ico
deleted file mode 100755
index a3970775e3ed..000000000000
--- a/sysui/desktop/icons/so9_empty_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_empty_tem.ico b/sysui/desktop/icons/so9_empty_tem.ico
deleted file mode 100755
index 1b0088b80277..000000000000
--- a/sysui/desktop/icons/so9_empty_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_global_doc.ico b/sysui/desktop/icons/so9_global_doc.ico
deleted file mode 100755
index ea4ccb383956..000000000000
--- a/sysui/desktop/icons/so9_global_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_html_doc.ico b/sysui/desktop/icons/so9_html_doc.ico
deleted file mode 100755
index 4e5b8bc99c07..000000000000
--- a/sysui/desktop/icons/so9_html_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_app.ico b/sysui/desktop/icons/so9_impress_app.ico
deleted file mode 100755
index cf10331c5ff9..000000000000
--- a/sysui/desktop/icons/so9_impress_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_doc.ico b/sysui/desktop/icons/so9_impress_doc.ico
deleted file mode 100755
index 5258a8b6aa4c..000000000000
--- a/sysui/desktop/icons/so9_impress_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_tem.ico b/sysui/desktop/icons/so9_impress_tem.ico
deleted file mode 100755
index dcdbddb3b654..000000000000
--- a/sysui/desktop/icons/so9_impress_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_macro_doc.ico b/sysui/desktop/icons/so9_macro_doc.ico
deleted file mode 100755
index cd004015e63f..000000000000
--- a/sysui/desktop/icons/so9_macro_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_main_app.ico b/sysui/desktop/icons/so9_main_app.ico
deleted file mode 100755
index 90f193d80dd9..000000000000
--- a/sysui/desktop/icons/so9_main_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_app.ico b/sysui/desktop/icons/so9_math_app.ico
deleted file mode 100755
index 11fbbf9a494a..000000000000
--- a/sysui/desktop/icons/so9_math_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_doc.ico b/sysui/desktop/icons/so9_math_doc.ico
deleted file mode 100755
index 622ae939d23a..000000000000
--- a/sysui/desktop/icons/so9_math_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico
deleted file mode 100755
index 90f193d80dd9..000000000000
--- a/sysui/desktop/icons/so9_open.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_app.ico b/sysui/desktop/icons/so9_writer_app.ico
deleted file mode 100755
index 10c964dba966..000000000000
--- a/sysui/desktop/icons/so9_writer_app.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_doc.ico b/sysui/desktop/icons/so9_writer_doc.ico
deleted file mode 100755
index b0cf11a993c9..000000000000
--- a/sysui/desktop/icons/so9_writer_doc.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_tem.ico b/sysui/desktop/icons/so9_writer_tem.ico
deleted file mode 100755
index 2e62a1934646..000000000000
--- a/sysui/desktop/icons/so9_writer_tem.ico
+++ /dev/null
Binary files differ
diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst
index b5f26eb936b9..097cae97ed29 100644
--- a/sysui/prj/build.lst
+++ b/sysui/prj/build.lst
@@ -1,6 +1,6 @@
su sysui : L10N:l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL
-su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
-su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
+#su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
+#su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
su sysui\desktop\icons nmake - w su_iconsw NULL
su sysui\desktop\os2 nmake - p su_iconsw NULL
su sysui\desktop\macosx nmake - u su_dtmacosx su_dtshare.u NULL
@@ -16,4 +16,4 @@ su sysui\desktop\debian nmake - u su_dtdebian su_dtshare.u
su sysui\desktop\slackware nmake - u su_dtslackware su_dtshare.u NULL
su sysui\desktop\solaris nmake - u su_dtsolaris su_dtshare.u NULL
su sysui\desktop\util nmake - u su_desktop su_dtredhat.u su_dtsuse.u su_dtmdk.u su_dtfreedesktop.u su_dtdebian.u su_dtslackware.u NULL
-su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_win32_quickstart_so.w su_iconsw.w NULL
+su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_iconsw.w NULL
diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst
index c6019cea9a43..918ee8bcbc8f 100644
--- a/sysui/prj/d.lst
+++ b/sysui/prj/d.lst
@@ -15,10 +15,6 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg
..\%__SRC%\bin\pkg\*.tar.gz %_DEST%\bin%_EXT%\desktop-integration\pkg\*.tar.gz
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe
-..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe
-..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe
-..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe
..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico
diff --git a/testautomation/chart2/optional/includes/ch2_lvl1a.inc b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
index 6da6e29ac72d..e012dd0253c8 100755
--- a/testautomation/chart2/optional/includes/ch2_lvl1a.inc
+++ b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
@@ -84,6 +84,7 @@ testcase tPlotOptions
printlog "Close and reopen data series dialog - checkbox should be still activated"
TabDataSeriesOptions.Ok
+ sleep (1)
Kontext "DocumentChart"
FormatSelection
printlog "Select tab page Options"
diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc
index 23b3e02a7ae8..714d708fc4ee 100644
--- a/testautomation/global/tools/includes/optional/t_ole.inc
+++ b/testautomation/global/tools/includes/optional/t_ole.inc
@@ -126,6 +126,8 @@ end function
'*******************************************************************************
function GetOleDefaultNames()
+ dim sAllOle as string
+ dim j as integer
const CFN = "global::tools::includes::optional::t_ole.inc::GetOleDefaultNames(): "
if ( GVERBOSE ) then printlog( CFN & "Retrieving OLE names" )
@@ -138,6 +140,24 @@ function GetOleDefaultNames()
gOLEDraw = hGetOleObjectName( "Draw" )
gOLEMath = hGetOleObjectName( "Math" )
+ ' There is no programatical way to retrieve the word for 'further objects'
+ ' Only way to get it language independent is to retrieve all other words and take the last other entry that lasts
+ ' Only available on windows platform
+ if ( gPlatgroup = "w95" ) then
+ sAllOle = gOLEWriter & gOLECalc & gOLEChart & gOLEImpress & gOLEDraw & gOLEMath
+ Call hNewDocument
+ InsertObjectOLEObject
+ Kontext "OLEObjektEinfuegen"
+ NeuErstellen.Check
+ WaitSlot()
+ for j=1 to ObjektTyp.GetItemCount
+ ObjektTyp.Select j
+ if 0 = instr (sAllOle, ObjektTyp.GetSelText ) then
+ gOleOthers = ObjektTyp.GetSelText
+ endif
+ next j
+ OLEObjektEinfuegen.cancel
+ hCloseDocument
+ endif
end function
-'*******************************************************************************
diff --git a/testautomation/graphics/optional/includes/global/g_stylist.inc b/testautomation/graphics/optional/includes/global/g_stylist.inc
index 71d05f7d704c..0c03e0738abe 100644
--- a/testautomation/graphics/optional/includes/global/g_stylist.inc
+++ b/testautomation/graphics/optional/includes/global/g_stylist.inc
@@ -486,6 +486,8 @@ testcase tFormatStylistTemplateNew
endcase 'tFormatStylistTemplateNew
'--------------------------------------------------------
testcase tiFormatStylist
+warnlog "#i116803# - Crash when closing stylist with closer"
+goto endsub
Dim Num1 as integer ' graphics : first line indent ; the one with 0,6cm in the summary
Dim Num2 as integer ' presentations : background ; just one tabpage pops up: Area
@@ -530,6 +532,8 @@ testcase tiFormatStylist
end if
sleep 1
+
+
FormatStylist
Kontext "Gestalter"
printlog "opening graphics styles"
@@ -559,7 +563,7 @@ testcase tiFormatStylist
sleep 1
printlog "presentation styles"
Praesentationsvorlagen.Click
-
+ printlog "Select number 2"
Vorlagenliste.Select Num2
sleep 1
printlog "opening context menu"
@@ -681,6 +685,10 @@ testcase tiFormatStylist
TabOptionenNumerierung.Cancel
sleep 1
endif
+
+
+
+
kontext "DocumentImpress"
printlog "Closing Stylist"
if lcase(gPlatform) = "osx" then
diff --git a/testautomation/graphics/optional/includes/impress/i_us2_present.inc b/testautomation/graphics/optional/includes/impress/i_us2_present.inc
index 1db9740b577a..9ec6ceffeba4 100644
--- a/testautomation/graphics/optional/includes/impress/i_us2_present.inc
+++ b/testautomation/graphics/optional/includes/impress/i_us2_present.inc
@@ -172,8 +172,11 @@ testcase i_us2_pres1
SlidesControl.TypeKeys "<DOWN>"
kontext "DocumentImpress"
printlog "Insert three lines with text, all with different formatting."
+ sleep (1)
call hTextrahmenErstellen ("First line with text",20,50,70,50)
+ sleep (1)
call hTextrahmenErstellen ("Second line with text",20,60,70,60)
+ sleep (1)
call hTextrahmenErstellen ("Third line with text",20,70,70,70)
printlog "Go down to the third slide."
kontext "Slides"
diff --git a/testautomation/graphics/required/includes/global/id_004.inc b/testautomation/graphics/required/includes/global/id_004.inc
index c06f88c682b8..f04a3ba5ec8f 100644
--- a/testautomation/graphics/required/includes/global/id_004.inc
+++ b/testautomation/graphics/required/includes/global/id_004.inc
@@ -45,8 +45,6 @@ sub id_004
call tiInsertGraphic
call tiInsertObjectSound
call tiInsertObjectVideo
- call tiInsertObjectSound
- call tiInsertObjectVideo
call tiInsertChart
call tiInsertObjectOLEObjects
call tiInsertSpreadsheet
diff --git a/testautomation/writer/optional/includes/clipboard/clipbrd_func.inc b/testautomation/writer/optional/includes/clipboard/clipbrd_func.inc
index 0c9f976b187b..c30bfd52d351 100644
--- a/testautomation/writer/optional/includes/clipboard/clipbrd_func.inc
+++ b/testautomation/writer/optional/includes/clipboard/clipbrd_func.inc
@@ -55,13 +55,8 @@ function wPasteAvailableClipboardFormats(TheNumber as integer, CheckWhat as Stri
printlog "- Paste as: " + ClipboardFormat
Select Case CheckWhat
Case "ctext", "DRAW"
- if lcase(gPlatform) = "sol" and lcase(ClipboardFormat) = "bitmap" then
- QAErrorlog "#i49505#Paste drawing object as bitmap crashes office"
- goto s_next_item
- else
- InhaltEinfuegen.Ok
- Sleep 3
- end if
+ InhaltEinfuegen.Ok
+ Sleep 3
Case else
InhaltEinfuegen.Ok
Sleep 3
diff --git a/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc b/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
index 729659dfc54d..4965250e7c9f 100644
--- a/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
+++ b/testautomation/writer/optional/includes/contextmenu/w_contextmenu1.inc
@@ -177,8 +177,6 @@ endcase
testcase tPickGraphic
- Warnlog "#i115132#Missing .uno Slots in context menus"
- goto endsub
printlog "Open context menu on not focussed graphic"
Call hNewDocument
Printlog " Set zoom to 100%"
@@ -267,9 +265,6 @@ endcase
testcase tHyperlinkEdit
- Warnlog "#i115132#Missing .uno Slots in context menus"
- goto endsub
-
printlog "Context menu on hyperlinks"
printlog " Open a new text document"
CALL hNewDocument
@@ -392,9 +387,6 @@ endcase
testcase tPickDrawingObjects
- Warnlog "#i115132#Missing .uno Slots in context menus"
- goto endsub
-
printlog "Context menu on drawing objects"
printlog " Open a new text document"
Call hNewDocument
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
index 659bb2a4ddb7..9537eb2ae948 100644
--- a/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
@@ -221,7 +221,7 @@ testcase tPositionAndSize_2
Sleep 1
fPositionAndSize("TabPositionAndSizeWriter")
- if Horizontalby.Gettext <> sPositionX then Warnlog "#i40845# X-Position is wrong: Not -> "+sPositionX+" but -> "+Horizontalby.Gettext
+ if Horizontalby.Gettext <> sPositionX then Warnlog "X-Position is wrong: Not -> "+sPositionX+" but -> "+Horizontalby.Gettext
if Verticalby.Gettext <> sPositionY then Warnlog "Y-Position is wrong: Not -> "+sPositionY+" but -> "+Verticalby.Gettext
TabPositionAndSizeWriter.Cancel
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
index 08ebbfed45d4..17babc991f7e 100644
--- a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
@@ -300,7 +300,7 @@ testcase tGroup_6
PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)"
Call gMouseClick(41,40)
Call fPositionAndSize("TabPositionAndSizeWriter")
- if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
+ if Horizontalby.Gettext <> sPositionX1 then Warnlog "Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext
TabPositionAndSizeWriter.Cancel
@@ -371,7 +371,7 @@ testcase tGroup_7
PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)."
Call gMouseClick(40,40)
Call fPositionAndSize("TabPositionAndSizeWriter")
- if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
+ if Horizontalby.Gettext <> sPositionX1 then Warnlog "Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext
TabPositionAndSizeWriter.Cancel
diff --git a/testautomation/writer/optional/includes/fields/w_fields2.inc b/testautomation/writer/optional/includes/fields/w_fields2.inc
index 168fed204ebe..4ac611f39aa6 100644
--- a/testautomation/writer/optional/includes/fields/w_fields2.inc
+++ b/testautomation/writer/optional/includes/fields/w_fields2.inc
@@ -955,7 +955,7 @@ testcase tDocumentTemplate
if GetClipboard <> sResult(i-1) then
select case i-1
case 0
- QAErrorlog "#i70342#Field 'Templates->Category' is empty"
+ Warnlog "Field 'Templates->Category' is empty"
case else
Warnlog " - Should get " & sResult(i-1) & " but get " & GetClipboard
end select
diff --git a/testautomation/writer/optional/includes/fields/w_fields3.inc b/testautomation/writer/optional/includes/fields/w_fields3.inc
index 64261c7e1ac6..c2fe3d5d27f6 100644
--- a/testautomation/writer/optional/includes/fields/w_fields3.inc
+++ b/testautomation/writer/optional/includes/fields/w_fields3.inc
@@ -278,7 +278,7 @@ testcase tInsertReferenceChapter
Call wTypeKeys "<Shift Home>"
if fGetFieldContent( ) <> "2" then
- Warnlog "#i40625# Should get 2 , but get " & fGetFieldContent()
+ Warnlog "Should get 2 , but get " & fGetFieldContent()
end if
'/// Close the document
@@ -776,7 +776,7 @@ testcase tInsertBookmarkChapter
Call wTypeKeys "<Shift Home>"
if fGetFieldContent( ) <> "2" then
- Warnlog "#i40625# Should get 2 , but get " & fGetFieldContent()
+ Warnlog "Should get 2 , but get " & fGetFieldContent()
end if
'/// Close the document
diff --git a/testautomation/writer/optional/includes/fields/w_fields4.inc b/testautomation/writer/optional/includes/fields/w_fields4.inc
index 315c6b0f96d3..459e91da7912 100644
--- a/testautomation/writer/optional/includes/fields/w_fields4.inc
+++ b/testautomation/writer/optional/includes/fields/w_fields4.inc
@@ -261,7 +261,7 @@ endcase
'-----------------------------------------------------------------
testcase tDocInformationUserDefined
- QAErrorLog "#i112077#Tabpage 'Custom properties' has no declaration"
+ Warnlog "#i95523#Tabpage 'Custom properties' has no declaration"
goto endsub
Dim sTestFile as String
Dim sVarResult() as String
diff --git a/testautomation/writer/optional/includes/fields/w_fields5.inc b/testautomation/writer/optional/includes/fields/w_fields5.inc
index 75f94e8a3351..6ff7f2c1701d 100644
--- a/testautomation/writer/optional/includes/fields/w_fields5.inc
+++ b/testautomation/writer/optional/includes/fields/w_fields5.inc
@@ -182,7 +182,7 @@ testcase tVariablesSetValueToNumber
for i = 0 to j
Call wTypeKeys "<Shift Right>"
if fGetFieldContent() <> sResult(i) then
- QaErrorLog i & "#i94596# - Should get " & sResult(i) & " but get " & fGetFieldContent()
+ Warnlog i & "Should get " & sResult(i) & " but get " & fGetFieldContent()
end if
Call wTypeKeys "<Down><Home>"
next i
@@ -194,8 +194,6 @@ endcase
'-----------------------------------------------------------------
testcase tVariablesSetFormats
- qaerrorlog "#i94596# - tVariablesSetFormats outcommented due to bug."
- goto endsub
Dim sName as String
Dim sValue as String
diff --git a/testautomation/writer/optional/includes/formatcharacter/w_format_character1.inc b/testautomation/writer/optional/includes/formatcharacter/w_format_character1.inc
index df216304ea2e..9cfd50567a78 100644
--- a/testautomation/writer/optional/includes/formatcharacter/w_format_character1.inc
+++ b/testautomation/writer/optional/includes/formatcharacter/w_format_character1.inc
@@ -225,7 +225,7 @@ testcase tFormatCharacter3
Kontext
active.SetPage TabHyperlinkZeichen
kontext "TabHyperlinkZeichen"
- if URLName.GetText <> "http://www.mikeportnoy.com/" then Warnlog "##i105855##Wrong URL : " + URLName.GetText
+ if URLName.GetText <> "http://www.mikeportnoy.com/" then Warnlog "#i105855#Wrong URL : " + URLName.GetText
SetClipboard UrlName.Gettext
if NameText.GetText <> "A hyperlink with testtool" then Warnlog "#i105855#Wrong Linkname : " + NameText.GetText
if TargetFrame.GetSelIndex <> 2 then Warnlog "#i105855#Wrong Target selected : " + TargetFrame.GetSelText
diff --git a/testautomation/writer/optional/includes/formatpage/w_formatpage1.inc b/testautomation/writer/optional/includes/formatpage/w_formatpage1.inc
index a7393d50f6df..ef6280b51cfd 100644
--- a/testautomation/writer/optional/includes/formatpage/w_formatpage1.inc
+++ b/testautomation/writer/optional/includes/formatpage/w_formatpage1.inc
@@ -753,7 +753,7 @@ testcase tFormatPage_13
if Not Navigator.Exists then ViewNavigator
Kontext "NavigatorWriter"
Sleep 1
- if Seitennummer.GetText <> sPage2 then Warnlog "#i40333# 2nd pic isn't in page 3 !"
+ if Seitennummer.GetText <> sPage2 then Warnlog "2nd pic isn't in page 3 !"
fCloseNavigator
Wait 500
@@ -810,7 +810,7 @@ testcase tFormatPage_14
if Not Navigator.Exists then ViewNavigator
Kontext "NavigatorWriter"
Sleep 1
- if Seitennummer.GetText <> sPage2 then Warnlog "#i40333# 2nd pic isn't in page 4 !"
+ if Seitennummer.GetText <> sPage2 then Warnlog "2nd pic isn't in page 4 !"
fCloseNavigator
Wait 500
diff --git a/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph1.inc b/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph1.inc
index 7c31482e37af..686c246d0400 100644
--- a/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph1.inc
+++ b/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph1.inc
@@ -939,7 +939,7 @@ testcase tParagraphIndent13
if Not Navigator.Exists then ViewNavigator
Kontext "NavigatorWriter"
Sleep 1
- if Seitennummer.GetText <> "8" then Warnlog "#i73903#The 8th line should be in 8th page !"
+ if Seitennummer.GetText <> "8" then Warnlog "The 8th line should be in 8th page !"
fCloseNavigator
'/// check if the pic moves
@@ -1008,7 +1008,7 @@ testcase tParagraphIndent14
if Not Navigator.Exists then ViewNavigator
Kontext "NavigatorWriter"
Sleep 1
- if Seitennummer.GetText <> "8" then Warnlog "#i73903#The 8th line should be in 8th page !"
+ if Seitennummer.GetText <> "8" then Warnlog "The 8th line should be in 8th page !"
fCloseNavigator
'/// check if the pic moves
diff --git a/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph2.inc b/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph2.inc
index d204f8f2e02c..7d34b25d886a 100644
--- a/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph2.inc
+++ b/testautomation/writer/optional/includes/formatparagraph/w_formatparagraph2.inc
@@ -197,7 +197,7 @@ testcase tParagraphAlignment4
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX1) > 0.02 then
if gPlatGroup = "unx" then
- QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
+ Warnlog "Different font-sizes under Linux/Unix compared with windows."
else
Warnlog "Alignment Justified doesn't work -1 !"
end if
@@ -210,7 +210,7 @@ testcase tParagraphAlignment4
Call fPositionAndSize("TabPositionAndSizeWriter")
if Horizontalby.Gettext <> sPositionX2 then
if gPlatGroup = "unx" then
- QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
+ Warnlog "Different font-sizes under Linux/Unix compared with windows."
else
warnlog "Alignment Justified doesn't work -2 !"
end if
@@ -310,7 +310,7 @@ testcase tParagraphAlignment6
Call fPositionAndSize("TabPositionAndSizeWriter")
if Horizontalby.Gettext <> sPositionX1 then
if gPlatGroup = "unx" then
- QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
+ Warnlog "Different font-sizes under Linux/Unix compared with windows."
else
warnlog "Alignment Justified doesn't work -1 !"
end if
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc
index 4e670f290f13..1def138817b4 100644
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc
@@ -653,7 +653,7 @@ testcase tInsertGraphic_10
Call wTypeKeys ( "<Shift F4>" )
sleep(1)
if fFormatGraphic("TabZusaetze") = false then
- Warnlog "#i46300#linked JPEG pictures will disappear when doc is modified."
+ Warnlog "#linked JPEG pictures will disappear when doc is modified."
kontext "TabZusatze"
if ( TabZusaetze.exists() ) then TabZusaetze.close()
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
index 1a3624487ffb..2a161b2200d1 100644
--- a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
@@ -903,7 +903,7 @@ testcase tInsertGraphic_29
fFormatGraphic("TabUmlauf")
Sleep 1
- if Parallel.IsChecked <> TRUE then QaErrorLog "#i94558# - Graphic wrapping situation is wrong !"
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
if ErsterAbsatz.IsChecked <> TRUE then Warnlog "first paragraph configuration is wrong !"
TabUmlauf.Cancel
@@ -960,7 +960,7 @@ testcase tInsertGraphic_30
fFormatGraphic("TabUmlauf")
Sleep 1
- if Parallel.IsChecked <> TRUE then QaErrorLog "#i94558# - Graphic wrapping situation is wrong !"
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
TabUmlauf.Cancel
PrintLog " 3. Optimal Page Wrap:"
@@ -1013,7 +1013,7 @@ testcase tInsertGraphic_30
fFormatGraphic("TabUmlauf")
Sleep 1
- if Parallel.IsChecked <> TRUE then QaErrorLog "#i94558# - Graphic wrapping situation is wrong !"
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
if ErsterAbsatz.IsChecked <> TRUE then Warnlog "first paragraph configuration is wrong !"
TabUmlauf.Cancel
diff --git a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
index 33768d6ffc38..2598c2b5f912 100644
--- a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
+++ b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
@@ -80,7 +80,7 @@ testcase tExportAllReadableFormatsIntoODF
if GetExtention ( sExportFile ) = "psw" then
QAErrorlog "#i102221#Pocket Word filter puts General I/O Error"
elseif LCase( sExceptionFile ) = "swdos.txt" then
- QAErrorlog "#i114062#General I/O error loading StarWriter DOS file"
+ Warnlog "General I/O error loading StarWriter DOS file"
else
Call hFileOpenLocally( ImportFileList(i) )
printlog "- done"
diff --git a/testautomation/writer/optional/includes/navigator/w_navigator.inc b/testautomation/writer/optional/includes/navigator/w_navigator.inc
index e164bce470be..1750b4de3950 100644
--- a/testautomation/writer/optional/includes/navigator/w_navigator.inc
+++ b/testautomation/writer/optional/includes/navigator/w_navigator.inc
@@ -80,13 +80,13 @@ testcase tViewNavigator1
try
Navigator.Size (300, 400)
catch
- Warnlog "Sizen Navigator doesn't work.. see #i32449"
+ Warnlog "Sizen Navigator doesn't work"
endcatch
Sleep 1
try
Navigator.Size (xSize%, ySize%)
catch
- Printlog "Sizen Navigator doesn't work.. see #i32449"
+ Printlog "Sizen Navigator doesn't work"
endcatch
Sleep 1
@@ -176,12 +176,12 @@ testcase tViewNavigator2
try
DocumentWriter.FadeOut
catch
- Warnlog "#i35096#Unable to Fade out Navigator!"
+ Warnlog "Unable to Fade out Navigator!"
endcatch
try
DocumentWriter.FadeIn
catch
- Warnlog "#i35096#Unable to Fade out Navigator!"
+ Warnlog "Unable to Fade out Navigator!"
endcatch
Kontext "Navigator"
@@ -231,7 +231,7 @@ testcase tViewNavigator3
Navigation.TearOff
NavigationTearOff = true
catch
- Warnlog "Unable to tear off Navigation Toolbar! (#i32092)"
+ Warnlog "Unable to tear off Navigation Toolbar!"
endcatch
if NavigationTearOff = true then
Sleep 1
diff --git a/testautomation/writer/optional/includes/number/w_205_.inc b/testautomation/writer/optional/includes/number/w_205_.inc
index ade7afe66ad2..2d9c844ff922 100644
--- a/testautomation/writer/optional/includes/number/w_205_.inc
+++ b/testautomation/writer/optional/includes/number/w_205_.inc
@@ -274,35 +274,35 @@ testcase tFormatNumberingPosition
Active.SetPage TabPositionNumerierung
Kontext "TabPositionNumerierung"
Level.Select 1
-' if Alignment.GetSelIndex <> 2 then Warnlog "#i38904#Level 1: Wrong alignment: Should = 2 Ist = "+ Alignment.GetSelIndex
+' if Alignment.GetSelIndex <> 2 then Warnlog "Level 1: Wrong alignment: Should = 2 Ist = "+ Alignment.GetSelIndex
if V1 <> AlignedAt.GetText then Warnlog "Level 1: Wrong Text <-> Rand: Should = "+ V1+ " Is = "+ AlignedAt.GetText
if V2 <> IndentAt.GetText then Warnlog "Level 1: Wrong indent: Should = "+ V2+ " Is = "+ IndentAt.GetText
Level.Select 3
' if Not Relativ.IsChecked then Warnlog "Relativ is checked in Level 3!"
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 3: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 3: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V3 <> AlignedAt.GetText then Warnlog "Level 3: Wrong Text <-> Spacing to text: Should = "+ V3+ " Is = "+ AlignedAt.GetText
' if V4 <> AbstandTextNumerierung.GetText then Warnlog "Level 3: Wrong indent: Should = "+ V4+ " Is = "+ AbstandTextNumerierung.GetText
Level.Select 4
' if Not Relativ.IsChecked then Warnlog "Relativ is checked in Level 4!"
- if Alignment.GetSelIndex <> 1 then Warnlog "#i38904#Level 4: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 1 then Warnlog "Level 4: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
if V5 <> AlignedAt.GetText then Warnlog "Level 4: Wrong Text <-> Spacing to text: Should = "+ V5+ " Is = "+ AlignedAt.GetText
' if V6 <> AbstandTextNumerierung.GetText then Warnlog "Level 4: Wrong indent: Should = "+ V6+ " Is = "+ AbstandTextNumerierung.GetText
if V7 <> IndentAt.GetText then Warnlog "Level 4: Wrong indent: Should = "+ V7+ " Is = "+ IndentAt.GetText
Level.Select 6
' if Not Relativ.IsChecked then Warnlog "Relativ is checked in Level 6!"
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 6: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 6: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V8 <> AlignedAt.GetText then Warnlog "Level 6: Wrong Text <-> Spacing to text: Should = "+ V8+ " Is = "+ AlignedAt.GetText
' if V9 <> AbstandTextNumerierung.GetText then Warnlog "Level 6: Wrong indent: Should = "+ V9+ " Is = "+ AbstandTextNumerierung.GetText
if V10 <> IndentAt.GetText then Warnlog "Level 6: Wrong indent: Should = "+ V10+ " Is = "+ IndentAt.GetText
Level.Select 9
' if Not Relativ.IsChecked then Warnlog "Relativ is checked in Level 9!"
- if Alignment.GetSelIndex <> 1 then Warnlog "#i38904#Level 9: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 1 then Warnlog "Level 9: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
if V11 <> AlignedAt.GetText then Warnlog "Level 9: Wrong Text <-> Spacing to text: Should = "+ V11+ " Is = "+ AlignedAt.GetText
' if V12 <> AbstandTextNumerierung.GetText then Warnlog "Level 9: Wrong indent: Should = "+ V12+ " Is = "+ AbstandTextNumerierung.GetText
if V13 <> IndentAt.GetText then Warnlog "Level 9: Wrong indent: Should = "+ V13+ " Is = "+ IndentAt.GetText
Level.Select 10
' if Not Relativ.IsChecked then Warnlog "Relativ is checked in Level 10!"
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 10: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 10: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V14 <> AlignedAt.GetText then Warnlog "Level 10: Wrong Text <-> Spacing to text: Should = "+ V14+ " Is = "+ AlignedAt.GetText
' if V15 <> AbstandTextNumerierung.GetText then Warnlog "Level 10: Wrong indent: Should = "+ V15+ " Is = "+ AbstandTextNumerierung.GetText
if V16 <> IndentAt.GetText then Warnlog "Level 10: Wrong indent: Should = "+ V16+ " Is = "+ IndentAt.GetText
@@ -324,35 +324,35 @@ testcase tFormatNumberingPosition
Kontext "TabPositionNumerierung"
Level.Select 1
- if Alignment.GetSelIndex <> 2 then Warnlog "#i38904#Level 1: Wrong alignment: Should = 2 Ist = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 2 then Warnlog "Level 1: Wrong alignment: Should = 2 Ist = "+ Alignment.GetSelIndex
if V1 <> AlignedAt.GetText then Warnlog "Level 1: Wrong Text <-> Rand: Should = "+ V1+ " Is = "+ AlignedAt.GetText
if V2 <> IndentAt.GetText then Warnlog "Level 1: Wrong indent: Should = "+ V2+ " Is = "+ IndentAt.GetText
Level.Select 3
' if Not Relativ.IsChecked then Relativ.Check
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 3: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 3: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V3 <> AlignedAt.GetText then Warnlog "Level 3: Wrong Text <-> Spacing to text: Should = "+ V3+ " Is = "+ AlignedAt.GetText
' if V4 <> AbstandTextNumerierung.GetText then Warnlog "Level 3: Wrong indent: Should = "+ V4+ " Is = "+ AbstandTextNumerierung.GetText
Level.Select 4
' if Not Relativ.IsChecked then Relativ.Check
- if Alignment.GetSelIndex <> 1 then Warnlog "#i38904#Level 4: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 1 then Warnlog "Level 4: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
if V5 <> AlignedAt.GetText then Warnlog "Level 4: Wrong Text <-> Spacing to text: Should = "+ V5+ " Is = "+ AlignedAt.GetText
' if V6 <> AbstandTextNumerierung.GetText then Warnlog "Level 4: Wrong indent: Should = "+ V6+ " Is = "+ AbstandTextNumerierung.GetText
if V7 <> IndentAt.GetText then Warnlog "Level 4: Wrong indent: Should = "+ V7+ " Is = "+ IndentAt.GetText
Level.Select 6
' if Not Relativ.IsChecked then Relativ.Check
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 6: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 6: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V8 <> AlignedAt.GetText then Warnlog "Level 6: Wrong Text <-> Spacing to text: Should = "+ V8+ " Is = "+ AlignedAt.GetText
' if V9 <> AbstandTextNumerierung.GetText then Warnlog "Level 6: Wrong indent: Should = "+ V9+ " Is = "+ AbstandTextNumerierung.GetText
if V10 <> IndentAt.GetText then Warnlog "Level 6: Wrong indent: Should = "+ V10+ " Is = "+ IndentAt.GetText
Level.Select 9
' if Not Relativ.IsChecked then Relativ.Check
- if Alignment.GetSelIndex <> 1 then Warnlog "#i38904#Level 9: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 1 then Warnlog "Level 9: Wrong alignment: Should = 1 Is = "+ Alignment.GetSelIndex
if V11 <> AlignedAt.GetText then Warnlog "Level 9: Wrong Text <-> Spacing to text: Should = "+ V11+ " Is = "+ AlignedAt.GetText
' if V12 <> AbstandTextNumerierung.GetText then Warnlog "Level 9: Wrong indent: Should = "+ V12+ " Is = "+ AbstandTextNumerierung.GetText
if V13 <> IndentAt.GetText then Warnlog "Level 9: Wrong indent: Should = "+ V13+ " Is = "+ IndentAt.GetText
Level.Select 10
' if Not Relativ.IsChecked then Relativ.Check
- if Alignment.GetSelIndex <> 3 then Warnlog "#i38904#Level 10: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
+ if Alignment.GetSelIndex <> 3 then Warnlog "Level 10: Wrong alignment: Should = 3 Is = "+ Alignment.GetSelIndex
if V14 <> AlignedAt.GetText then Warnlog "Level 10: Wrong Text <-> Spacing to text: Should = "+ V14+ " Is = "+ AlignedAt.GetText
' if V15 <> AbstandTextNumerierung.GetText then Warnlog "Level 10: Wrong indent: Should = "+ V15+ " Is = "+ AbstandTextNumerierung.GetText
if V16 <> IndentAt.GetText then Warnlog "Level 10: Wrong indent: Should = "+ V16+ " Is = "+ IndentAt.GetText
diff --git a/testautomation/writer/optional/includes/number/w_205a_.inc b/testautomation/writer/optional/includes/number/w_205a_.inc
index 385d2a5501f4..0d285395734d 100644
--- a/testautomation/writer/optional/includes/number/w_205a_.inc
+++ b/testautomation/writer/optional/includes/number/w_205a_.inc
@@ -866,7 +866,7 @@ testcase tToolsFootnoteEndnote
if Davor.GetText <> "Hihi " then Warnlog "Endnote: 'Before' is wrong. Not 'Hihi ' but " + Davor.GetText
if Dahinter.GetText <> " HaHa" then Warnlog "Endnote: Text after is wrong. Not ' HaHa' but " + Dahinter.GetText
if Absatz.GetSelIndex <> 3 then Warnlog "Endnote: Wrong entry selected in paragraph. Not 3 but " + Absatz.GetSelIndex
- if Seite.GetSelIndex <> 2 then Warnlog "#i40579#Endnote: Wrong Page entry selected. Not 2 but " + Seite.GetSelIndex
+ if Seite.GetSelIndex <> 2 then Warnlog "Endnote: Wrong Page entry selected. Not 2 but " + Seite.GetSelIndex
if ZeichenvorlageTextbereich.GetSelIndex <> 4 then Warnlog "Endnote: Text area has been changed!"
if ZeichenvorlageEndnotenbereich.GetSelIndex <> 5 then Warnlog "Endnote: Endnote area has been changed!"
TabEndnoten.Cancel
diff --git a/testautomation/writer/optional/includes/option/wh_o_2.inc b/testautomation/writer/optional/includes/option/wh_o_2.inc
index ff58ce4e4f09..841af13dafec 100644
--- a/testautomation/writer/optional/includes/option/wh_o_2.inc
+++ b/testautomation/writer/optional/includes/option/wh_o_2.inc
@@ -114,7 +114,7 @@ testcase tToolsOptionsHTMLPrint
ToolsOptions
Call hToolsOptions ( "HTML" , "PRINT" )
- if ( bCheckboxStatus(1) = Grafiken.IsChecked ) Then WarnLog "#i108219#'Graphics' state changed"
+ if ( bCheckboxStatus(1) = Grafiken.IsChecked ) Then WarnLog "'Graphics' state changed"
if ( bCheckboxStatus(2) = Kontrollfelder.IsChecked ) Then WarnLog "'Controls' state changed"
if ( bCheckboxStatus(3) = Hintergrund.IsChecked ) Then WarnLog "'Background' state changed"
if ( bCheckboxStatus(4) = SchwarzDrucken.IsChecked ) Then WarnLog "'Print black' state changed"
diff --git a/testautomation/writer/optional/includes/redlining/w_redlining1.inc b/testautomation/writer/optional/includes/redlining/w_redlining1.inc
index b08faaf6d8d8..f84205c34021 100644
--- a/testautomation/writer/optional/includes/redlining/w_redlining1.inc
+++ b/testautomation/writer/optional/includes/redlining/w_redlining1.inc
@@ -1149,7 +1149,7 @@ testcase tRedlining_16
try
EditCopy
catch
- Warnlog "#i41424# Bullets cannot be removed by Del key"
+ Warnlog "Bullets cannot be removed by Del key"
Call wTypeKeys "<Down><End>"
Call wTypeKeys "<Shift Left>"
EditCopy
@@ -1199,7 +1199,7 @@ testcase tRedlining_16
try
EditCopy
catch
- Warnlog "#i41424# Bullets cannot be removed by Del key"
+ Warnlog "Bullets cannot be removed by Del key"
Call wTypeKeys "<Down><End>"
Call wTypeKeys "<Shift Left>"
EditCopy
diff --git a/testautomation/writer/optional/includes/redlining/w_redlining2.inc b/testautomation/writer/optional/includes/redlining/w_redlining2.inc
index 4b442a8b3464..f3930b8db721 100644
--- a/testautomation/writer/optional/includes/redlining/w_redlining2.inc
+++ b/testautomation/writer/optional/includes/redlining/w_redlining2.inc
@@ -440,7 +440,7 @@ testcase tAcceptReject_6
try
AutoListe.Select 2
catch
- QAErrorlog "#i99937#Change of author (User name) disregarded when changed during Office session"
+ Warnlog "Change of author (User name) disregarded when changed during Office session"
Redlining.Close
Call hCloseDocument
goto endsub
diff --git a/testautomation/writer/optional/includes/regression/issuezilla/w_issuezilla_regression.inc b/testautomation/writer/optional/includes/regression/issuezilla/w_issuezilla_regression.inc
index dd3b304ad151..05e31e19c95c 100644
--- a/testautomation/writer/optional/includes/regression/issuezilla/w_issuezilla_regression.inc
+++ b/testautomation/writer/optional/includes/regression/issuezilla/w_issuezilla_regression.inc
@@ -123,7 +123,7 @@ testcase i64991
Kontext
Active.Setpage TabSeite
Kontext "TabSeite"
- if Not Quer.IsChecked then Warnlog "#i64991#Setting a printer make the page styles to be lost"
+ if Not Quer.IsChecked then Warnlog "Setting a printer make the page styles to be lost"
TabSeite.Cancel
Call wTypeKeys ("<Down>")
@@ -134,7 +134,7 @@ testcase i64991
Kontext
Active.Setpage TabSeite
Kontext "TabSeite"
- if Not Hoch.IsChecked then Warnlog "#i64991#Setting a printer make the page styles to be lost"
+ if Not Hoch.IsChecked then Warnlog "Setting a printer make the page styles to be lost"
TabSeite.Cancel
end if
diff --git a/testautomation/writer/optional/includes/section/w_section_2.inc b/testautomation/writer/optional/includes/section/w_section_2.inc
index 1d79405dfd82..92aa69bff1d5 100644
--- a/testautomation/writer/optional/includes/section/w_section_2.inc
+++ b/testautomation/writer/optional/includes/section/w_section_2.inc
@@ -1038,7 +1038,7 @@ testcase tDisplaySection_9
end if
if GetClipBoardtext <> shouldbe then
- qaerrorlog "#i85766# - Copied text not correctly exported through the clipboard" ' "Problem with section"
+ Warnlog "Copied text not correctly exported through the clipboard" ' "Problem with section"
end if
Case 3
Call wTypeKeys "<Shift End>"
diff --git a/testautomation/writer/optional/includes/shortcut/w_shortcuts.inc b/testautomation/writer/optional/includes/shortcut/w_shortcuts.inc
index 22d64c36ed43..da1b7dd1704c 100644
--- a/testautomation/writer/optional/includes/shortcut/w_shortcuts.inc
+++ b/testautomation/writer/optional/includes/shortcut/w_shortcuts.inc
@@ -805,7 +805,7 @@ testcase tShortcutPasteUnformattedText
printlog "- shortcut did work"
else
if gPlatgroup = "osx" then
- Warnlog "#103102#It is not possible to customize the keyboard combination cmd+option on MAC OSX."
+ Warnlog "It is not possible to customize the keyboard combination cmd+option on MAC OSX."
Call hCloseDocument
goto endsub
else
diff --git a/testautomation/writer/optional/includes/spellcheck/w_spellcheck.inc b/testautomation/writer/optional/includes/spellcheck/w_spellcheck.inc
index a6dd6c18b997..df7e2c5dba34 100644
--- a/testautomation/writer/optional/includes/spellcheck/w_spellcheck.inc
+++ b/testautomation/writer/optional/includes/spellcheck/w_spellcheck.inc
@@ -69,7 +69,7 @@ testcase tToolsSpellcheckWithShortcut
case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
- case 50 : Call wTypeKeys ("To je test Ärkvana<Home>")
+ case 50 : Call wTypeKeys ("To je test Ä?rkvana<Home>")
case 07 : Printlog "- No Spellcheck in Russian!"
goto endsub
case 48 : Printlog "- No Spellcheck in Polish!"
@@ -108,7 +108,7 @@ testcase tToolsSpellcheckWithShortcut
printlog "OK, Spellchecker comes up"
Spellcheck.Close 'closing spellchecker
else
- Warnlog "#i35000#Spellchecker does not come up with shortcut 'F7'"
+ Warnlog "Spellchecker does not come up with shortcut 'F7'"
end if
end if
Call hCloseDocument
@@ -169,7 +169,7 @@ testcase tToolsSpellcheckCorrect
select case iSprache
case 01 : FFText = "This is a text without any error.<Return>"
case 03 : FFText = "Escreva os seus dados de utilizador correctamente e tome nota deles (guardar / imprimir).<Return>"
- case 07 : FFText = "принÑтый ГоÑударÑтвенной Думой в первом чтении 16 ноÑÐ±Ñ€Ñ 1999 года.<Return>"
+ case 07 : FFText = "принÑ?тый ГоÑ?ударÑ?твенной Думой в первом чтении 16 ноÑ?брÑ? 1999 года.<Return>"
case 31 : FFText = "Dit werk is beschermd door de Auteurswet.<Return>"
case 33 : FFText = "Il nous faut donc un de temps pour examiner avec soin tous les dossiers.<Return>"
case 34 : FFText = "Este archivo contiene información importante sobre el programa.<Return>"
@@ -235,9 +235,9 @@ testcase tToolsSpellcheck1Mistake
case 03 : sErrorSampleText = "Escrive os seus dados de utilizador correctamente e tome nota deles."
sWordToBeChecked = "Escrive"
sLanguageName = "Português"
- case 07 : sErrorSampleText = "Ð’Ð¾ÐµÐ½Ð½Ð°Ñ Ñ‚ÐµÑ…Ð½Ð¸Ñ‡ÐµÑкого ÑaтрудничеÑтва, проблему задолженноÑти и вопроÑÑ‹ региональных ÑвÑзей."
- sWordToBeChecked = "ÑaтрудничеÑтва"
- sLanguageName = "РуÑÑкий"
+ case 07 : sErrorSampleText = "ВоеннаÑ? техничеÑ?кого Ñ?aтрудничеÑ?тва, проблему задолженноÑ?ти и вопроÑ?Ñ‹ региональных Ñ?вÑ?зей."
+ sWordToBeChecked = "Ñ?aтрудничеÑ?тва"
+ sLanguageName = "РуÑ?Ñ?кий"
case 31 : sErrorSampleText = "Wijek danken u voor uw interesse in het samenwerken met Sun Microsystems."
sWordToBeChecked = "Wijek"
sLanguageName = "Nederlands (NL)"
@@ -267,7 +267,7 @@ testcase tToolsSpellcheck1Mistake
sLanguageName = "Deutsch (Deutschland)"
case 50 : sErrorSampleText = "Tuki je nekaj narobe."
sWordToBeChecked = "Tuki"
- sLanguageName = "SlovenÅ¡Äina"
+ sLanguageName = "SlovenÅ¡Ä?ina"
case 55 : sErrorSampleText = "Esta poderia ser a respista para suas preces?"
sWordToBeChecked = "respista"
sLanguageName = "Português (Brasil)"
@@ -406,7 +406,7 @@ testcase tToolsSpellcheckForward
case 46 : sDummy = "handbroken" : sWordToBeAdded = "viktikt"
case 48 : sDummy = "znajdujacej" : sWordToBeAdded = "usuniete"
case 49 : sDummy = "reichtt" : sWordToBeAdded = "viierter"
- case 50 : sDummy = "Paglejmo" : sWordToBeAdded = "Ätrto"
+ case 50 : sDummy = "Paglejmo" : sWordToBeAdded = "Ä?trto"
case 55 : sDummy = "horat" : sWordToBeAdded = "dpa"
end select
@@ -568,7 +568,7 @@ testcase tToolsSpellcheckOnlyOneWord
select case iSprache
case 01 : sWordToBeChecked = "excetionally" ' this word is wrong
- case 07 : sWordToBeChecked = "КaнÑтитуции"
+ case 07 : sWordToBeChecked = "КaнÑ?титуции"
case 03 : sWordToBeChecked = "semstre" ' this word is wrong
case 31 : sWordToBeChecked = "lidstartesn" ' this word is wrong
case 33 : sWordToBeChecked = "heues" ' this word is wrong
@@ -675,7 +675,7 @@ testcase tToolsSpellcheckOnlyOneWord
try
EditCopy
if GetClipboardtext = sWordToBeChecked then
- Warnlog "#i40498#Spellchecker does not commit changes correctly (" & GetClipboardtext & " found )"
+ Warnlog "Spellchecker does not commit changes correctly (" & GetClipboardtext & " found )"
Call hCloseDocument
goto endsub
end if
@@ -697,7 +697,7 @@ testcase tToolsSpellcheckOnlyOneWord
if Active.Exists then
if Active.GetRT = 304 then
Active.Ok
- Warnlog "#i40480#Spellchecker finishes though wrong words in documents"
+ Warnlog "Spellchecker finishes though wrong words in documents"
end if
end if
catch
diff --git a/testautomation/writer/optional/includes/stylist/w_stylist.inc b/testautomation/writer/optional/includes/stylist/w_stylist.inc
index 65f156412f83..6fb093ef89a5 100644
--- a/testautomation/writer/optional/includes/stylist/w_stylist.inc
+++ b/testautomation/writer/optional/includes/stylist/w_stylist.inc
@@ -112,13 +112,13 @@ testcase tFormatStylist1
try
Stylist.Size 300, 400
catch
- Warnlog "Sizen Stylist doesn't work.. see #i32449"
+ Warnlog "Sizen Stylist doesn't work"
endcatch
Sleep 1
try
Stylist.Size xSize%, ySize%
catch
- Warnlog "Sizen Stylist doesn't work.. see #i32449"
+ Warnlog "Sizen Stylist doesn't work"
endcatch
Sleep 1
@@ -498,7 +498,7 @@ testcase tFormatStylist6
Kontext
Active.Setpage TabHyperlinkZeichen
Kontext "TabHyperlinkZeichen"
- if URLName.GetText <> "http://www.mikeportnoy.com/" then Warnlog "#i41171#TabHyperlink: URL is wrong " + URLName.Gettext
+ if URLName.GetText <> "http://www.mikeportnoy.com/" then Warnlog "TabHyperlink: URL is wrong " + URLName.Gettext
TabHyperlinkZeichen.OK
end if
@@ -635,7 +635,7 @@ testcase tAssigningStyles1
printlog "More..."
Select Case iSprache
Case 01 : sStyles = Array("Clear formatting", "Default", "Heading 1", "Heading 2", "Heading 3", "Text body", "More...")
- Case 07 : sStyles = Array("Отменить форматирование", "Базовый", "Заголовок 1", "Заголовок 2", "Заголовок 3", "ОÑновной текÑÑ‚", "Дополнительно...")
+ Case 07 : sStyles = Array("Отменить форматирование", "Базовый", "Заголовок 1", "Заголовок 2", "Заголовок 3", "ОÑ?новной текÑ?Ñ‚", "Дополнительно...")
Case 31 : sStyles = Array("Opmaak wissen", "Kop 1", "Kop 2", "Kop 3", "Standaard", "Tekstblok", "Meer...")
Case 33 : sStyles = Array("Effacer le formatage", "Corps de texte", "Par défaut", "Titre 1", "Titre 2", "Titre 3", "Autres...")
Case 34 : sStyles = Array("Borrar formato", "Cuerpo de texto", "Encabezado 1", "Encabezado 2", "Encabezado 3", "Predeterminado", "Más...")
@@ -645,10 +645,10 @@ testcase tAssigningStyles1
Case 48 : sStyles = Array("Wyczyść formatowanie", "Domyślnie", "Nagłówek 1", "Nagłówek 2", "Nagłówek 3", "Treść tekstu", "Więcej...")
Case 49 : sStyles = Array("Formatierung löschen", "Standard", "Textkörper", "Überschrift 1", "Überschrift 2", "Überschrift 3", "Weitere...")
Case 55 : sStyles = Array("Limpar formatação", "Corpo do texto", "Padrão", "Título 1", "Título 2", "Título 3", "Mais...")
- Case 81 : sStyles = Array("書å¼è¨­å®šã®è§£é™¤", "本文", "標準", "見出㗠1", "見出㗠2", "見出㗠3", "詳細...")
- Case 82 : sStyles = Array("ì„œì‹ ì§€ìš°ê¸°", "기본값", "제목 1", "제목 2", "제목 3", "í…스트 본문", "ìžì„¸ížˆ...")
- Case 86 : sStyles = Array("清除格å¼", "默认", "标题 1", "标题 2", "标题 3", "正文", "更多(~M)...")
- Case 88 : sStyles = Array("清除格å¼", "內文", "標題 1", "標題 2", "標題 3", "é è¨­", "更多...")
+ Case 81 : sStyles = Array("書�設定�解除", "本文", "標準", "見出� 1", "見出� 2", "見出� 3", "詳細...")
+ Case 82 : sStyles = Array("서� 지우기", "기본값", "제목 1", "제목 2", "제목 3", "�스트 본문", "�세히...")
+ Case 86 : sStyles = Array("清除格�", "默认", "标题 1", "标题 2", "标题 3", "正文", "更多(~M)...")
+ Case 88 : sStyles = Array("清除格�", "內文", "標題 1", "標題 2", "標題 3", "�設", "更多...")
Case 90 : sStyles = Array("Biçimlendirmeyi temizle", "Başlık 1", "Başlık 2", "Başlık 3", "Metin gövdesi", "Varsayılan", "Diğer...")
Case else : Warnlog "Current language not supported. Please add styles to list!"
Kontext "Textobjectbar"
diff --git a/testautomation/writer/optional/includes/textframes/w_textframes2.inc b/testautomation/writer/optional/includes/textframes/w_textframes2.inc
index 466b0c99ab15..c4cc19006f36 100644
--- a/testautomation/writer/optional/includes/textframes/w_textframes2.inc
+++ b/testautomation/writer/optional/includes/textframes/w_textframes2.inc
@@ -178,7 +178,7 @@ testcase tTextframes_19
Kontext "Active"
if Active.Exists then
- Warnlog "#i40348# The frame should move by keyboard!"
+ Warnlog "The frame should move by keyboard!"
Active.Ok
end if
@@ -188,7 +188,7 @@ testcase tTextframes_19
Wait 500
if GetClipboardText <> sTestText then Warnlog "Something wrong in the test . Clipboard:" +GetClipboardText
catch
- Warnlog "#i40348#"
+ Warnlog "The frame should move by keyboard!"
endcatch
Call hCloseDocument
diff --git a/testautomation/writer/required/includes/w_001_.inc b/testautomation/writer/required/includes/w_001_.inc
index 1fc2001e78bb..c798b26b47a1 100644
--- a/testautomation/writer/required/includes/w_001_.inc
+++ b/testautomation/writer/required/includes/w_001_.inc
@@ -941,7 +941,7 @@ testcase tFileSaveWithPassword
if ( gPlatgroup = "unx" ) then
QAErrorlog "#i73968#Opening a password protected file looses focus after loading"
else
- Warnlog "#i36015#Checkbox 'Save with password' is not checked in file-dialog !"
+ Warnlog "Checkbox 'Save with password' is not checked in file-dialog !"
Passwort.Check
end if
SpeichernDlg.Cancel
diff --git a/testautomation/writer/required/includes/w_001a_.inc b/testautomation/writer/required/includes/w_001a_.inc
index b33751752512..cb9739cd00dd 100644
--- a/testautomation/writer/required/includes/w_001a_.inc
+++ b/testautomation/writer/required/includes/w_001a_.inc
@@ -89,7 +89,7 @@ testcase tFileProperties
Call DialogTest (TabDokumentinfo)
- QAErrorlog "#i95523# - FileProperties - Tabpage 'User Defined' has changed. - Adaption of testcases needed."
+ Warnlog "#i95523# - FileProperties - Tabpage 'User Defined' has changed. - Adaption of testcases needed."
' printlog " Switch to Tabpage 'User defined'"
' Kontext
' active.SetPage TabBenutzer
diff --git a/testautomation/writer/required/includes/w_001b_.inc b/testautomation/writer/required/includes/w_001b_.inc
index 4d8e6883891a..65f4794dcefe 100644
--- a/testautomation/writer/required/includes/w_001b_.inc
+++ b/testautomation/writer/required/includes/w_001b_.inc
@@ -134,7 +134,7 @@ testcase tFileSendOutlineToPresentation
try
FileSendOutlineToPresentation
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
+ Warnlog "Unable to execute 'File -> Send -> Outline to Presentation'"
Call hCloseDocument
goto endsub
endcatch
@@ -182,7 +182,7 @@ testcase tFileSendOutlineToClipboard
try
FileSendOutlineToClipboard
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
+ Warnlog "Unable to execute 'File -> Send -> Outline to Clipboard'"
Call hCloseDocument
goto endsub
endcatch
@@ -233,7 +233,7 @@ testcase tFileSendCreateAutoabstract
try
FileSendCreateAutoabstract
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
+ Warnlog "Unable to execute 'File -> Send -> Create Autoabstract'"
Call hCloseDocument
goto endsub
endcatch
@@ -284,7 +284,7 @@ testcase tFileSendAutoabstractToPresentation
try
FileSendAutoabstractToPresentation
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
+ Warnlog "Unable to execute 'File -> Send -> Autoabstract to Presentation'"
Call hCloseDocument
goto endsub
endcatch
@@ -666,7 +666,7 @@ testcase tMasterDocFileSendOutlineToPresentation
try
FileSendOutlineToPresentation
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
+ Warnlog "Unable to execute 'File -> Send -> Outline to Presentation'"
Call hCloseDocument
goto endsub
endcatch
@@ -705,7 +705,7 @@ testcase tMasterDocFileSendOutlineToClipboard
try
FileSendOutlineToClipboard
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
+ Warnlog "Unable to execute 'File -> Send -> Outline to Clipboard'"
Call hCloseDocument
goto endsub
endcatch
@@ -749,7 +749,7 @@ testcase tMasterDocFileSendCreateAutoabstract
try
FileSendCreateAutoabstract
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
+ Warnlog "Unable to execute 'File -> Send -> Create Autoabstract'"
Call hCloseDocument
goto endsub
endcatch
@@ -799,7 +799,7 @@ testcase tMasterDocFileSendAutoabstractToPresentation
try
FileSendAutoabstractToPresentation
catch
- Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
+ Warnlog "Unable to execute 'File -> Send -> Autoabstract to Presentation'"
Call hCloseDocument
goto endsub
endcatch
diff --git a/testautomation/writer/required/includes/w_002_.inc b/testautomation/writer/required/includes/w_002_.inc
index 20ddaf92a6b9..e19b37514c99 100644
--- a/testautomation/writer/required/includes/w_002_.inc
+++ b/testautomation/writer/required/includes/w_002_.inc
@@ -565,7 +565,7 @@ testcase tViewNavigator
PrintLog "Tear Off Toolbox from Navigator"
Toolbox.TearOff Navigation
catch
- Warnlog "Unable to tear off Toolbox (#i32092)"
+ Warnlog "Unable to tear off Toolbox"
ToolboxOk = False
endcatch
@@ -1300,7 +1300,7 @@ testcase tEditImageMap
printlog( "Check for <Imagemap changed> messagebox (should not appear)" )
kontext "Active"
if ( Active.exists( 1 ) ) then
- qaerrorlog( "#i109605# - <imagemap changed> message displayed." )
+ Warnlog( "<imagemap changed> message displayed." )
printlog( Active.getText )
Active.no()
else
diff --git a/testautomation/writer/required/includes/w_004_.inc b/testautomation/writer/required/includes/w_004_.inc
index ea1972cbafb7..8a536b715335 100644
--- a/testautomation/writer/required/includes/w_004_.inc
+++ b/testautomation/writer/required/includes/w_004_.inc
@@ -636,7 +636,6 @@ testcase tInsertIndexesIndex
Kontext "TabVerzeichnisseVerzeichnis"
For i= 1 to VerzeichnisTyp.GetItemCount
Sleep 1
- if i = 2 then printlog "Alphabetical index see bug #i33671 (ok in m54)"
VerzeichnisTyp.Select i
printlog "- " + VerzeichnisTyp.GetSelText
Call DialogTest (TabVerzeichnisseVerzeichnis)
@@ -934,7 +933,7 @@ testcase tInsertFrame
Call DialogTest (TabHintergrund, 2)
Sleep 1
catch
- Warnlog "Maybe missing combobox! (#i29517)"
+ Warnlog "Maybe missing combobox!"
endcatch
if gApplication <> "HTML" then
diff --git a/testautomation/writer/required/includes/w_004b_.inc b/testautomation/writer/required/includes/w_004b_.inc
index 3769ee9ee1ae..3252e30fd450 100644
--- a/testautomation/writer/required/includes/w_004b_.inc
+++ b/testautomation/writer/required/includes/w_004b_.inc
@@ -202,18 +202,6 @@ testcase tInsertAllGraphicsFromFile
Call hNewDocument
for iCurrentFile = 1 to 25
-
- ' MODIFY and ENABLE this SAMPLE snippet to exclude one fileformat from testing
- ' if ( iCurrentFile = 7 ) AND (gtPlatform="x86") then
- ' qaErrorLog("#<issue-id># crash on <platform> on loading <image-file>")
- ' goto skipformat
- ' endif
- ' Note: Can be locale dependent!
- if (iCurrentFile = 4) AND (gPlatform="osx") then
- qaerrorlog("#i100253# crash on MacOS X on loading ball.eps")
- goto skipformat
- endif
-
Kontext "GrafikEinfuegenDlg"
if ( not GrafikEinfuegenDlg.exists() ) then
InsertGraphicsFromFile
diff --git a/testautomation/writer/required/includes/w_005b_.inc b/testautomation/writer/required/includes/w_005b_.inc
index 707af57a1b6a..89e04a29e87f 100644
--- a/testautomation/writer/required/includes/w_005b_.inc
+++ b/testautomation/writer/required/includes/w_005b_.inc
@@ -1192,7 +1192,7 @@ testcase tFormatStyleEdit
Kontext "Drawbar"
Drawbar.Close
else
- Warnlog "#i33132#Toolbar 'Drawbar' is not opened!"
+ Warnlog "Toolbar 'Drawbar' is not opened!"
end if
printlog " Close active document"
Call hCloseDocument
diff --git a/testautomation/writer/required/includes/w_007_.inc b/testautomation/writer/required/includes/w_007_.inc
index 64eae48786c5..86fd50a3f3c4 100644
--- a/testautomation/writer/required/includes/w_007_.inc
+++ b/testautomation/writer/required/includes/w_007_.inc
@@ -1069,7 +1069,7 @@ testcase tToolsChineseTranslation
if ChineseTranslation.Exists then
Call DialogTest ( ChineseTranslation )
else
- Warnlog "#i41364#Tools-> Language -> Chinese Translation does not work!"
+ Warnlog "Tools-> Language -> Chinese Translation does not work!"
Call hCloseDocument
goto endsub
end if
diff --git a/testautomation/writer/required/includes/w_010_.inc b/testautomation/writer/required/includes/w_010_.inc
index 5e2a596fbfd9..7f717166e4f9 100644
--- a/testautomation/writer/required/includes/w_010_.inc
+++ b/testautomation/writer/required/includes/w_010_.inc
@@ -358,7 +358,7 @@ testcase tNumLevelUpDown
if Hochstufen.IsEnabled then
Hochstufen.Click
else
- if i = 1 then Warnlog "Level up is disabled! (#i28550)"
+ if i = 1 then Warnlog "Level up is disabled!"
end if
sleep (2)
next i
@@ -394,7 +394,7 @@ testcase tNumSubpointsUpDown
if HinunterstufenMitUnterpunkten.IsEnabled then
HinunterstufenMitUnterpunkten.Click
else
- if i = 1 then Warnlog "Move up with subpoints is disabled! (#i28550)"
+ if i = 1 then Warnlog "Move up with subpoints is disabled!"
end if
Sleep (1)
@@ -767,7 +767,7 @@ testcase tUpLevelUpDown
if Hochstufen.IsEnabled then
Hochstufen.Click
else
- if i = 1 then Warnlog "Level up is disabled ! (#i28550)"
+ if i = 1 then Warnlog "Level up is disabled !"
end if
sleep (2)
next i
@@ -825,7 +825,7 @@ testcase tUpSubpointsUpDown
if HochstufenMitUnterpunkten.IsEnabled then
HochstufenMitUnterpunkten.Click
else
- if i = 1 then Warnlog "Move with Subpoints up is disabled! (#i28550)"
+ if i = 1 then Warnlog "Move with Subpoints up is disabled!"
end if
Sleep 1
next i
diff --git a/testautomation/writer/required/includes/w_011_.inc b/testautomation/writer/required/includes/w_011_.inc
index bc2fc42cf6b7..9cd7bbc9f393 100644
--- a/testautomation/writer/required/includes/w_011_.inc
+++ b/testautomation/writer/required/includes/w_011_.inc
@@ -333,7 +333,7 @@ testcase tZOEditPoints
try
Points.Click
catch
- Warnlog "#i56594#Shortcut selecting objects doesn't work"
+ Warnlog "Shortcut selecting objects doesn't work"
Printlog "Close active document"
Call hCloseDocument
goto endsub
@@ -372,7 +372,7 @@ testcase tZOLine
Linie.Click
printlog "In Toolbox click 'Line'"
catch
- Warnlog "#i56594#Shortcut selecting objects doesn't work"
+ Warnlog "Shortcut selecting objects doesn't work"
Call hCloseDocument
goto endsub
endcatch
@@ -425,7 +425,7 @@ testcase tZOArea
printlog "In toolbox click 'Area'"
Flaeche.Click
catch
- Warnlog "#i56594#Shortcut selecting objects doesn't work"
+ Warnlog "Shortcut selecting objects doesn't work"
Call hCloseDocument
goto endsub
endcatch
diff --git a/testautomation/writer/required/includes/w_020_.inc b/testautomation/writer/required/includes/w_020_.inc
index 9235d1b83d7b..3eee667be02d 100644
--- a/testautomation/writer/required/includes/w_020_.inc
+++ b/testautomation/writer/required/includes/w_020_.inc
@@ -387,7 +387,7 @@ testcase t_TB_Form
Kontext "FormControls"
if NOT ControlProperties.IsEnabled then
if gPlatform = "osx" then
- warnlog "#i82427#-Mac OS X (Aqua): Drawing function does not draw anything"
+ warnlog "Mac OS X (Aqua): Drawing function does not draw anything"
else
warnlog "Control properties button disabled!"
end if
@@ -848,7 +848,7 @@ testcase tHtmlDoc_TB_Form
Kontext "FormControls"
if NOT ControlProperties.IsEnabled then
if gPlatform = "osx" then
- warnlog "#i82427#-Mac OS X (Aqua): Drawing function does not draw anything"
+ warnlog "Mac OS X (Aqua): Drawing function does not draw anything"
else
warnlog "Control properties button disabled!"
end if
diff --git a/testautomation/writer/tools/includes/w_tool1.inc b/testautomation/writer/tools/includes/w_tool1.inc
index a39fa5773102..17f5432edff3 100644
--- a/testautomation/writer/tools/includes/w_tool1.inc
+++ b/testautomation/writer/tools/includes/w_tool1.inc
@@ -345,7 +345,7 @@ sub sMenufunktionen(Fuer_Was as string)
Sleep 1
if i >= 20 then
if gPlatform = "osx" then
- Warnlog "#i82427#-Mac OS X (Aqua): Drawing function does not draw anything"
+ Warnlog "Mac OS X (Aqua): Drawing function does not draw anything"
else
Warnlog "Button (" + i + ")" + Fuer_Was + " is disabled "
end if
@@ -363,7 +363,7 @@ sub sMenufunktionen(Fuer_Was as string)
printlog Fuer_Was
else
if gPlatform = "osx" then
- Warnlog "#i82427#-Mac OS X (Aqua): Drawing function does not draw anything"
+ Warnlog "Mac OS X (Aqua): Drawing function does not draw anything"
else
Warnlog " - Controlfieldproperties "+ Fuer_Was +" from Menu not available!"
end if
diff --git a/testautomation/writer/tools/includes/w_tool2.inc b/testautomation/writer/tools/includes/w_tool2.inc
index 1378e751fd78..c067977ec8c7 100755
--- a/testautomation/writer/tools/includes/w_tool2.inc
+++ b/testautomation/writer/tools/includes/w_tool2.inc
@@ -400,7 +400,7 @@ end function
sub wChangeDefaultView()
- ' #i107038: This code forces the writer to display one page only which is
+ ' #This code forces the writer to display one page only which is
' zoomed to pagewidth, filling the entire - previously maximized - window.
' This is required because the VCL Testtool might eventually draw objects
' outside the document window depending on display size
diff --git a/testautomation/writer/tools/includes/w_tool6.inc b/testautomation/writer/tools/includes/w_tool6.inc
index 9bc7ed688d9b..6bac06fb9ff5 100644
--- a/testautomation/writer/tools/includes/w_tool6.inc
+++ b/testautomation/writer/tools/includes/w_tool6.inc
@@ -294,7 +294,7 @@ sub ZeilenHoeheTesten ( Wert as Double )
FormatRowHeight
Kontext "ZellenHoehe"
zWert = ZahlAusSpinnfield ( Hoehe.GetText )
- if (LiberalMeasurement (Wert, zWert) <> TRUE) then QAErrorlog "#i94556# - Die Zeilenhöhe ist nicht "+ Wert + " sondern "+ zWert + "."
+ if (LiberalMeasurement (Wert, zWert) <> TRUE) then QAErrorlog "Die Zeilenhöhe ist nicht "+ Wert + " sondern "+ zWert + "."
ZellenHoehe.OK
end sub
diff --git a/testautomation/writer/tools/includes/w_tools_undo.inc b/testautomation/writer/tools/includes/w_tools_undo.inc
index 8040b34dc841..8a22015779df 100644
--- a/testautomation/writer/tools/includes/w_tools_undo.inc
+++ b/testautomation/writer/tools/includes/w_tools_undo.inc
@@ -78,7 +78,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: vTypeString = "Replace"
Case 34: vTypeString = "Reemplazar"
- Case 86: vTypeString = "替æ¢"
+ Case 86: vTypeString = "替�"
Case else: QAErrorlog "Please adapt tests for current language! (" & CurrentUndoString(0) & ")"
end select
' Delete
@@ -96,7 +96,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Replace: 14 occurrences of 'and'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Reemplazar: 6 ocurrencias de 'and'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
end select
@@ -105,7 +105,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Sort text" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Ordenar texto" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "排åºæ–‡å­—" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "排�文字" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
' Convert text -> table
@@ -113,7 +113,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Convert text -> table" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Convertir texto en tabla" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "文字转æ¢æˆè¡¨æ ¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "文字转��表格" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -124,7 +124,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "New Paragraph" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Párrafo nuevo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "新建段è½" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "新建段�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -132,7 +132,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete paragraph" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar Párrafo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "删除 段è½" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "删除 段�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
end select
@@ -142,7 +142,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Paste clipboard" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Pegar del portapapeles" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "粘贴剪贴æ¿" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "粘贴剪贴�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -152,7 +152,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Accept change: Insert 'This is a test'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Aplicar cambio: Insertar 'This is a test'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "接å—修改:æ’å…¥ 'This is a test'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "接�修改:�入 'This is a test'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -160,19 +160,19 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Reject change: Insert 'This is a test'" then
elseif UndoStringFromUndoList = "Reject change: $1" then
- QaErrorlog "#i94489# - Bug with Undo - Reject."
+ QaErrorlog "#i97506# - Bug with Undo - Reject."
else
Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
end if
Case 34: if UndoStringFromUndoList = "Rechazar cambio: $1" then
- QaErrorlog "#i94489# - Bug with Undo - Reject."
+ QaErrorlog "#i97506# - Bug with Undo - Reject."
else
- Warnlog "Tell script-writer issue i94489 seems to be fixed, or that a string has to be set to: " & UndoStringFromUndoList
+ Warnlog "Tell script-writer issue i97506 seems to be fixed, or that a string has to be set to: " & UndoStringFromUndoList
end if
- Case 86: if UndoStringFromUndoList = "æ‹’ç»ä¿®æ”¹ï¼š$1" then
- QaErrorlog "#i94489# - Bug with Undo - Reject."
+ Case 86: if UndoStringFromUndoList = "拒�修改:$1" then
+ QaErrorlog "#i97506# - Bug with Undo - Reject."
else
- Warnlog "Tell script-writer issue i94489 seems to be fixed, or that a string has to be set to: " & UndoStringFromUndoList
+ Warnlog "Tell script-writer issue i97506 seems to be fixed, or that a string has to be set to: " & UndoStringFromUndoList
end if
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -181,7 +181,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Typing: 1 line break(s)" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Escritura: 1 salto(s) de línea" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "键入: 1 æ¢è¡Œç¬¦" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "键入: 1 �行符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -189,7 +189,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete 1 line break(s)" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar 1 salto(s) de línea" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "删除 1 æ¢è¡Œç¬¦" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "删除 1 �行符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -197,7 +197,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert column break" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar salto de columna" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入分æ ç¬¦" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入分�符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -205,7 +205,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete paragraph" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar Párrafo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "删除 段è½" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "删除 段�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -213,7 +213,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert page break" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar salto de página" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入分页符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入分页符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -221,7 +221,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete paragraph" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar Párrafo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "删除 段è½" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "删除 段�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -229,7 +229,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert field" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar campo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 字段" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 字段" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -237,7 +237,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Field changed" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Cambio modificado" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "字段已ç»è¢«ä¿®æ”¹" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "字段已�被修改" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -253,7 +253,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert special character" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar carácter especial" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 特殊字符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 特殊字符" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -269,7 +269,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Apply Styles: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Aplicar estilos: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "应用样å¼: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "应用样�: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -277,7 +277,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Change style: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Cambiar estilo: AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "修改样å¼ï¼šAUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "修改样�:AUndoHistory" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -285,7 +285,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Promote/demote outline" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Aumentar/Disminuir nivel" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "å‡çº§/é™çº§å¤–框" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�级/�级外框" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -293,7 +293,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Promote/demote outline" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Aumentar/Disminuir nivel" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "å‡çº§/é™çº§å¤–框" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�级/�级外框" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -301,7 +301,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert section" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar área" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入区域" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入区域" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -325,7 +325,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert Hyperlink" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar hiperenlace" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入超链接" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入超链接" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -333,7 +333,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "insert URL button" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar botón URL" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ URL 按钮" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 URL 按钮" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -348,7 +348,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert footnote" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar nota al pie" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入脚注" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入脚注" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -372,7 +372,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert caption: 'This capt...aracters'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar título: 'This capt...aracters'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入标题: 'This capt...aracters'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入标题: 'This capt...aracters'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -380,7 +380,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert AutoText" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar AutoTexto" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -388,7 +388,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert bookmark: I'm a bookmark" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar marcador: I'm a bookmark" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入书签: I'm a bookmark" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入书签: I'm a bookmark" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -396,7 +396,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Rename bookmark: 'I'm a bookmark' -> 'a book'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList & " -> #i33498"
Case 34: if UndoStringFromUndoList <> "marcador renombrado: 'I'm a bookmark' -> 'a book'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList & " -> #i33498"
- Case 86: if UndoStringFromUndoList <> "é‡å‘½å书签: 'I'm a bookmark' -> 'a book'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList & " -> #i33498"
+ Case 86: if UndoStringFromUndoList <> "é‡?命å??书签: 'I'm a bookmark' -> 'a book'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList & " -> #i33498"
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -412,7 +412,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert comment" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar nota" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 批注" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 批注" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -428,7 +428,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert script" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar secuencia de comandos" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 脚本" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 脚本" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -444,7 +444,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert index entry" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar entrada de índice" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入索引æ¡ç›®" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入索引�目" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -460,7 +460,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert bibliography entry" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar entrada de bibliografía" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 文献目录æ¡ç›®" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 文献目录�目" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -468,7 +468,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete bibliography entry" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar entrada de bibliografía" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "删除 文献目录æ¡ç›®" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "删除 文献目录�目" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -476,7 +476,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert frame" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar marco" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 框架" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 框架" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -484,7 +484,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Rename frame: 'MyFrame' -> 'MyRenamedFrame'" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if InStr(UndoStringFromUndoList, "renombrado") then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 框架" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 框架" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -500,7 +500,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert table: 'Table1'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar tabla: 'Tabla1'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入表格: '表格1'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入表格: '表格1'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -508,7 +508,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert Row" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar fila" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入行" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入行" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -516,7 +516,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert Column" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar columna" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入列" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入列" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -540,7 +540,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Format cell" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Formatear celda" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ ¼å¼åŒ–å•å…ƒæ ¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "格�化�元格" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -556,7 +556,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Merge table" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "unir tablas" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "åˆå¹¶è¡¨æ ¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�并表格" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -564,7 +564,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Convert text -> table" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Convertir texto en tabla" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "文字转æ¢æˆè¡¨æ ¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "文字转��表格" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -572,7 +572,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Sort table" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Ordenar tabla" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "排åºè¡¨æ ¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "排�表格" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -596,7 +596,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert horizontal ruler" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar regla horizontal" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入水平标尺" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入水平标尺" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -610,7 +610,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
else
Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
end if
- Case 86: if (UndoStringFromUndoList = "æ’å…¥ 图形") OR (UndoStringFromUndoList = "æ’å…¥ 图片") then
+ Case 86: if (UndoStringFromUndoList = "�入 图形") OR (UndoStringFromUndoList = "�入 图片") then
else
Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
end if
@@ -629,7 +629,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Replace graphics" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Reemplazar imagen" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "替æ¢å›¾å½¢" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "替�图形" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -637,7 +637,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert OLE-object" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar Objeto OLE" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ OLE 对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 OLE 对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -653,7 +653,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert OLE-object" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar Objeto OLE" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ OLE 对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 OLE 对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -669,7 +669,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert file" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar archivo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入文件" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入文件" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -677,7 +677,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Asian Phonetic Guides Setting" then QaErrorLog "#i94534# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Aplicar símbolos fonéticos" then QaErrorLog "#i94534# - Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "加上拼音或注音符å·" then QaErrorLog "#i94534# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "加上拼音或注音符�" then QaErrorLog "#i94534# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -693,7 +693,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "AutoFormat" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Formateado automático" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "自动格å¼" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "自动格�" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -713,8 +713,8 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
end if
end if
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 有 3 个角的折线" then
- if UndoStringFromUndoList = "æ’å…¥ 有 %2 个角的折线" then
+ Case 86: if UndoStringFromUndoList <> "�入 有 3 个角的折线" then
+ if UndoStringFromUndoList = "�入 有 %2 个角的折线" then
QaErrorlog "#i94530# - Bug with Undo-History for Polygon-Line-tool. " + UndoStringFromUndoList
else
Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
@@ -727,7 +727,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Group draw objects" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Agrupar objetos de dibujo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "组åˆç»˜å›¾å¯¹è±¡" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "组�绘图对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -735,7 +735,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Ungroup drawing objects" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Resolver objeto de grupo" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "å–消组åˆç»˜å›¾å¯¹è±¡" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�消组�绘图对象" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -743,7 +743,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Rename 2 Rectangles" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "组åˆç»˜å›¾å¯¹è±¡" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "组�绘图对象" then QaErrorLog "#i94486# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -757,15 +757,15 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Case "Autocheck/Spellcheck"
Select Case iSprache
- Case 01: if UndoStringFromUndoList <> "Replace: 'Testp' -> 'Test'" then QaErrorLog "#i94489# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 01: if UndoStringFromUndoList <> "Replace: 'Testp' -> 'Test'" then QaErrorLog "#i97506# - Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList = "Sobrescribir: $1" then
elseif InStr(UndoStringFromUndoList, "'Testp'") then
- QaErrorLog "#i94489# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ QaErrorLog "#i97506# - Wrong text in Undo-List: " & UndoStringFromUndoList
end if
Case 86: if UndoStringFromUndoList = "覆盖: $1" then
- QaErrorLog "#i94489# - Wrong text in Undo-List: " & UndoStringFromUndoList
+ QaErrorLog "#i97506# - Wrong text in Undo-List: " & UndoStringFromUndoList
elseif InStr(UndoStringFromUndoList, "'Testp'") then
- QaErrorlog "#i94489# - Bug fixed: " & UndoStringFromUndoList
+ QaErrorlog "#i97506# - Bug fixed: " & UndoStringFromUndoList
end if
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -774,7 +774,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Insert Control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Insertar Campo de control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’å…¥ 控制" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入 控制" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -790,7 +790,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Resize Control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Modificar el tamaño de Campo de control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ›´æ”¹å¤§å° æŽ§åˆ¶" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "更改大� 控制" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -798,7 +798,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Replace Control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Reemplazar campo de control" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "替æ¢æŽ§åˆ¶" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "替�控制" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt test for this language: " & UndoStringFromUndoList
end select
@@ -835,7 +835,7 @@ sub CheckUndoStringInUndoList(vType as integer, optional vShould as string)
Select Case iSprache
Case 01: if UndoStringFromUndoList <> "Delete ' ###'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case 34: if UndoStringFromUndoList <> "Eliminar 'g'" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
- Case 86: if UndoStringFromUndoList <> "æ’入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
+ Case 86: if UndoStringFromUndoList <> "�入自动图文集" then Warnlog "Wrong text in Undo-List: " & UndoStringFromUndoList
Case else: QAErrorlog "Please adapt tests for current language! (" & CurrentUndoString(0) & ")"
end select
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 8b25bc3b4e9a..158b742bbb4d 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -110,7 +110,7 @@ bool checkEmpty(rtl::OUString const & string, char const * message) {
}
//==================================================================================================
-class TestBridgeImpl : protected osl::DebugBase<TestBridgeImpl>,
+class TestBridgeImpl : public osl::DebugBase<TestBridgeImpl>,
public WeakImplHelper2< XMain, XServiceInfo >
{
Reference< XComponentContext > m_xContext;
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index d4d06cb39a3f..1bc86ba68dc6 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -124,7 +124,7 @@ static void assign( TestData & rData,
//==================================================================================================
class Test_Impl :
- protected osl::DebugBase<Test_Impl>,
+ public osl::DebugBase<Test_Impl>,
public WeakImplHelper3< XBridgeTest2, XServiceInfo , XRecursiveCall >
{
TestData _aData, _aStructData;
@@ -474,7 +474,7 @@ public:
};
//Dummy class for XComponent implementation
-class Dummy : protected osl::DebugBase<Dummy>,
+class Dummy : public osl::DebugBase<Dummy>,
public WeakComponentImplHelperBase
{
public:
diff --git a/testtools/source/cliversioning/version_libs/version_3_3.dll b/testtools/source/cliversioning/version_libs/version_3_3.dll
new file mode 100755
index 000000000000..a63a43632040
--- /dev/null
+++ b/testtools/source/cliversioning/version_libs/version_3_3.dll
Binary files differ
diff --git a/toolkit/qa/unoapi/makefile.mk b/toolkit/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..9517601c3917
--- /dev/null
+++ b/toolkit/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = toolkit
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/toolkit/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/tools/inc/tools/mempool.hxx b/tools/inc/tools/mempool.hxx
index 4c6c68ab0dd9..74df068908f7 100644
--- a/tools/inc/tools/mempool.hxx
+++ b/tools/inc/tools/mempool.hxx
@@ -28,7 +28,7 @@
#define _SVMEMPOOL_HXX
#include "tools/toolsdllapi.h"
-#include <tools/solar.h>
+#include "tools/solar.h"
// ----------------
// - FixedMemPool -
@@ -39,9 +39,11 @@ struct FixedMemPool_Impl;
class TOOLS_DLLPUBLIC FixedMemPool
{
FixedMemPool_Impl * m_pImpl;
+ char const * m_pTypeName;
public:
- FixedMemPool( sal_uInt16 nTypeSize,
+ FixedMemPool( char const * pTypeName,
+ sal_uInt16 nTypeSize,
sal_uInt16 nInitSize = 512,
sal_uInt16 nGrowSize = 256 );
~FixedMemPool();
@@ -97,8 +99,11 @@ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool )
+#define IMPL_FIXEDMEMPOOL_STRING(x) IMPL_FIXEDMEMPOOL_MAKESTRING(x)
+#define IMPL_FIXEDMEMPOOL_MAKESTRING(x) #x
+
#define IMPL_FIXEDMEMPOOL_NEWDEL( Class, InitSize, GrowSize) \
- FixedMemPool Class::aPool( sizeof( Class ), (InitSize), (GrowSize) );
+ FixedMemPool Class::aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) );
#define DECL_FIXEDMEMPOOL_NEWDEL_DLL( Class ) \
private: \
@@ -108,13 +113,13 @@ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
DECL_FIXEDMEMPOOL_DEL_DECL();
#define IMPL_FIXEDMEMPOOL_NEWDEL_DLL( Class, InitSize, GrowSize) \
- FixedMemPool Class::aPool( sizeof( Class ), (InitSize), (GrowSize) ); \
+ FixedMemPool Class::aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) ); \
DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
-#define INIT_FIXEDMEMPOOL_NEWDEL_DLL( class, aPool, InitSize, GrowSize ) \
- aPool( sizeof( class ), InitSize, GrowSize )
+#define INIT_FIXEDMEMPOOL_NEWDEL_DLL( Class, aPool, InitSize, GrowSize ) \
+ aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) )
#endif // _SVMEMPOOL_HXX
diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx
index 27054a3b79db..e8be417b15a2 100755
--- a/tools/source/memtools/mempool.cxx
+++ b/tools/source/memtools/mempool.cxx
@@ -28,7 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#include <tools/mempool.hxx>
+#include "tools/mempool.hxx"
+#include "osl/diagnose.h"
#include "rtl/alloc.h"
#ifndef INCLUDED_STDIO_H
@@ -42,11 +43,13 @@
*************************************************************************/
FixedMemPool::FixedMemPool (
- sal_uInt16 _nTypeSize, sal_uInt16, sal_uInt16)
+ char const * pTypeName, sal_uInt16 nTypeSize, sal_uInt16, sal_uInt16)
+ : m_pTypeName (pTypeName)
{
char name[RTL_CACHE_NAME_LENGTH + 1];
- snprintf (name, sizeof(name), "FixedMemPool_%d", (int)_nTypeSize);
- m_pImpl = (FixedMemPool_Impl*)rtl_cache_create (name, _nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0);
+ snprintf (name, sizeof(name), "FixedMemPool_%d", (int)nTypeSize);
+ m_pImpl = (FixedMemPool_Impl*)rtl_cache_create (name, nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0);
+ OSL_TRACE("FixedMemPool::ctor(\"%s\"): %p", m_pTypeName, m_pImpl);
}
/*************************************************************************
@@ -57,7 +60,8 @@ FixedMemPool::FixedMemPool (
FixedMemPool::~FixedMemPool()
{
- rtl_cache_destroy ((rtl_cache_type*)(m_pImpl));
+ OSL_TRACE("FixedMemPool::dtor(\"%s\"): %p", m_pTypeName, m_pImpl);
+ rtl_cache_destroy ((rtl_cache_type*)(m_pImpl)), m_pImpl = 0;
}
/*************************************************************************
diff --git a/tools/workben/makefile.mk b/tools/workben/makefile.mk
new file mode 100644
index 000000000000..d97156c7f66c
--- /dev/null
+++ b/tools/workben/makefile.mk
@@ -0,0 +1,68 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..
+PRJNAME = tools
+TARGET = workben
+LIBTARGET = NO
+TARGETTYPE = CUI
+ENABLE_EXCEPTIONS=TRUE
+
+.INCLUDE: settings.mk
+
+OBJFILES = \
+ $(OBJ)$/solar.obj \
+ $(OBJ)$/urltest.obj \
+ $(OBJ)$/inetmimetest.obj \
+ $(OBJ)$/mempooltest.obj
+
+APP1TARGET = solar
+APP1OBJS = $(OBJ)$/solar.obj
+.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+APP1STDLIBS = $(TOOLSLIB)
+.ELSE
+APP1LIBS = $(LB)$/itools.lib
+.ENDIF
+
+APP2TARGET = urltest
+APP2OBJS = $(OBJ)$/urltest.obj
+.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+APP2STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
+.ELSE
+APP2STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
+.ENDIF
+
+APP3TARGET = inetmimetest
+APP3OBJS = $(OBJ)$/inetmimetest.obj
+APP3STDLIBS = $(SALLIB) $(TOOLSLIB)
+
+APP4TARGET = mempooltest
+APP4OBJS = $(OBJ)$/mempooltest.obj
+APP4STDLIBS = $(TOOLSLIB)
+APP4RPATH = UREBIN
+
+.INCLUDE: target.mk
diff --git a/tools/workben/mempooltest.cxx b/tools/workben/mempooltest.cxx
new file mode 100644
index 000000000000..bf00343bc9d6
--- /dev/null
+++ b/tools/workben/mempooltest.cxx
@@ -0,0 +1,18 @@
+#include "tools/mempool.hxx"
+
+struct MempoolTest
+{
+ int m_int;
+
+ DECL_FIXEDMEMPOOL_NEWDEL(MempoolTest);
+};
+
+IMPL_FIXEDMEMPOOL_NEWDEL(MempoolTest, 0, 0);
+
+int main()
+{
+ MempoolTest * p = new MempoolTest();
+ if (p != 0)
+ delete p;
+ return 1;
+}
diff --git a/udkapi/com/sun/star/container/XStringKeyMap.idl b/udkapi/com/sun/star/container/XStringKeyMap.idl
index cf2b87d49b49..49848e2da791 100644
--- a/udkapi/com/sun/star/container/XStringKeyMap.idl
+++ b/udkapi/com/sun/star/container/XStringKeyMap.idl
@@ -56,7 +56,7 @@ module com { module sun { module star { module container {
/** maps strings to anys.
- @since OOo 2.3.0
+ @since OOo 2.3
*/
interface XStringKeyMap
diff --git a/udkapi/com/sun/star/io/XAsyncOutputMonitor.idl b/udkapi/com/sun/star/io/XAsyncOutputMonitor.idl
index aa5a0ba1802c..1aa25e82f253 100644
--- a/udkapi/com/sun/star/io/XAsyncOutputMonitor.idl
+++ b/udkapi/com/sun/star/io/XAsyncOutputMonitor.idl
@@ -59,7 +59,7 @@ module com { module sun { module star { module io {
should be called after the series of calls to
<member scope="com::sun::star::io">XOutputStream::writeBytes</member>.</p>
- @since OOo2.0.0
+ @since OOo 2.0
*/
interface XAsyncOutputMonitor {
/**
diff --git a/udkapi/com/sun/star/java/InvalidJavaSettingsException.idl b/udkapi/com/sun/star/java/InvalidJavaSettingsException.idl
index 588ac4933b05..66fa96465b10 100755
--- a/udkapi/com/sun/star/java/InvalidJavaSettingsException.idl
+++ b/udkapi/com/sun/star/java/InvalidJavaSettingsException.idl
@@ -41,7 +41,7 @@ module com { module sun { module star { module java {
by distributors to determine what versions are supported. If this
file is modified, then the current settings are regarded as invalid.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception InvalidJavaSettingsException: JavaInitializationException
{
diff --git a/udkapi/com/sun/star/java/JavaNotFoundException.idl b/udkapi/com/sun/star/java/JavaNotFoundException.idl
index 3f8a994decc1..5dbc369a9f6d 100644
--- a/udkapi/com/sun/star/java/JavaNotFoundException.idl
+++ b/udkapi/com/sun/star/java/JavaNotFoundException.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module java {
/** indicates that no suitable JRE was found.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception JavaNotFoundException: JavaInitializationException
{
diff --git a/udkapi/com/sun/star/java/RestartRequiredException.idl b/udkapi/com/sun/star/java/RestartRequiredException.idl
index a41b7de14b6a..c07271e424a1 100755
--- a/udkapi/com/sun/star/java/RestartRequiredException.idl
+++ b/udkapi/com/sun/star/java/RestartRequiredException.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module java {
/** indicates that the office must be restarted before a JRE can be used.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
exception RestartRequiredException: JavaInitializationException
{
diff --git a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
index 96b8957683ff..a19dd7f528fd 100644
--- a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
+++ b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
@@ -41,7 +41,7 @@ interface XCompoundTypeDescription;
<p>This type supersedes <type>XInterfaceAttributeTypeDescription</type>,
which does not support extended attributes.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XInterfaceAttributeTypeDescription2:
XInterfaceAttributeTypeDescription
diff --git a/udkapi/com/sun/star/reflection/XInterfaceTypeDescription2.idl b/udkapi/com/sun/star/reflection/XInterfaceTypeDescription2.idl
index 31ab93e4ecac..18be75166617 100644
--- a/udkapi/com/sun/star/reflection/XInterfaceTypeDescription2.idl
+++ b/udkapi/com/sun/star/reflection/XInterfaceTypeDescription2.idl
@@ -39,7 +39,7 @@ interface XTypeDescription;
<p>This type supersedes <type>XInterfaceTypeDescription</type>, which only
supported single inheritance.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XInterfaceTypeDescription2: XInterfaceTypeDescription {
/** Returns a sequence of all directly inherited (mandatory) base interface
diff --git a/udkapi/com/sun/star/reflection/XParameter.idl b/udkapi/com/sun/star/reflection/XParameter.idl
index d7b8aaa16cbb..ca827fe08d8f 100644
--- a/udkapi/com/sun/star/reflection/XParameter.idl
+++ b/udkapi/com/sun/star/reflection/XParameter.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module reflection {
<p>This type supersedes <type>XMethodParameter</type>, which only supports
parameters of interface methods (which cannot have rest parameters).</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XParameter: XMethodParameter {
/**
diff --git a/udkapi/com/sun/star/reflection/XPublished.idl b/udkapi/com/sun/star/reflection/XPublished.idl
index afb7cefa8a9a..4b3bc090dcfd 100644
--- a/udkapi/com/sun/star/reflection/XPublished.idl
+++ b/udkapi/com/sun/star/reflection/XPublished.idl
@@ -96,7 +96,7 @@ module com { module sun { module star { module reflection {
supported.</li>
</ul>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XPublished {
/**
diff --git a/udkapi/com/sun/star/reflection/XServiceConstructorDescription.idl b/udkapi/com/sun/star/reflection/XServiceConstructorDescription.idl
index 2f8f05ba82cc..4a45e69b20f0 100644
--- a/udkapi/com/sun/star/reflection/XServiceConstructorDescription.idl
+++ b/udkapi/com/sun/star/reflection/XServiceConstructorDescription.idl
@@ -38,7 +38,7 @@ interface XParameter;
/**
Reflects a service constructor.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XServiceConstructorDescription {
/**
diff --git a/udkapi/com/sun/star/reflection/XServiceTypeDescription2.idl b/udkapi/com/sun/star/reflection/XServiceTypeDescription2.idl
index 2536a2d2fe16..988bd5f66c18 100644
--- a/udkapi/com/sun/star/reflection/XServiceTypeDescription2.idl
+++ b/udkapi/com/sun/star/reflection/XServiceTypeDescription2.idl
@@ -41,7 +41,7 @@ interface XTypeDescription;
<p>This type supersedes <type>XServiceTypeDescription</type>, which only
supports obsolete, accumulation-based services.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XServiceTypeDescription2: XServiceTypeDescription {
/**
diff --git a/udkapi/com/sun/star/reflection/XSingletonTypeDescription2.idl b/udkapi/com/sun/star/reflection/XSingletonTypeDescription2.idl
index c4b42d786b00..b7083a6a8abf 100644
--- a/udkapi/com/sun/star/reflection/XSingletonTypeDescription2.idl
+++ b/udkapi/com/sun/star/reflection/XSingletonTypeDescription2.idl
@@ -40,7 +40,7 @@ interface XTypeDescription;
<p>This type supersedes <type>XSingletonTypeDescription</type>, which only
supports obsolete, service-based singletons.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XSingletonTypeDescription2: XSingletonTypeDescription {
/**
diff --git a/udkapi/com/sun/star/reflection/XStructTypeDescription.idl b/udkapi/com/sun/star/reflection/XStructTypeDescription.idl
index 69063323874c..6635492179c9 100644
--- a/udkapi/com/sun/star/reflection/XStructTypeDescription.idl
+++ b/udkapi/com/sun/star/reflection/XStructTypeDescription.idl
@@ -66,7 +66,7 @@ interface XTypeDescription;
sequence.</li>
</ul>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
interface XStructTypeDescription: XCompoundTypeDescription {
/**
diff --git a/udkapi/com/sun/star/script/BasicErrorException.idl b/udkapi/com/sun/star/script/BasicErrorException.idl
index 63a91b8e6373..7b627a993700 100644
--- a/udkapi/com/sun/star/script/BasicErrorException.idl
+++ b/udkapi/com/sun/star/script/BasicErrorException.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module script {
/** is thrown in order to transport an error to Basic.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published exception BasicErrorException: com::sun::star::uno::Exception
{
diff --git a/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl b/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
index 3ed909101441..ba649a09551f 100644
--- a/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
+++ b/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
@@ -35,7 +35,7 @@ published interface XExternalUriReferenceTranslator;
/**
translates between external and internal URI references.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service ExternalUriReferenceTranslator:
XExternalUriReferenceTranslator;
diff --git a/udkapi/com/sun/star/uri/RelativeUriExcessParentSegments.idl b/udkapi/com/sun/star/uri/RelativeUriExcessParentSegments.idl
index 6d65648b7950..00b30462b60a 100644
--- a/udkapi/com/sun/star/uri/RelativeUriExcessParentSegments.idl
+++ b/udkapi/com/sun/star/uri/RelativeUriExcessParentSegments.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module uri {
@see com::sun::star::uri::XUriReferenceFactory::makeAbsolute
for a method that uses this enumeration.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published enum RelativeUriExcessParentSegments {
/**
diff --git a/udkapi/com/sun/star/uri/UriReferenceFactory.idl b/udkapi/com/sun/star/uri/UriReferenceFactory.idl
index 678258d75ce0..c01d9eadac12 100644
--- a/udkapi/com/sun/star/uri/UriReferenceFactory.idl
+++ b/udkapi/com/sun/star/uri/UriReferenceFactory.idl
@@ -68,7 +68,7 @@ published interface XUriReferenceFactory;
service does not support
<type scope="com::sun::star::uri">XUriSchemeParser</type>.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service UriReferenceFactory: XUriReferenceFactory;
diff --git a/udkapi/com/sun/star/uri/UriSchemeParser_vndDOTsunDOTstarDOTscript.idl b/udkapi/com/sun/star/uri/UriSchemeParser_vndDOTsunDOTstarDOTscript.idl
index 50da8154e43a..c071ce6addac 100644
--- a/udkapi/com/sun/star/uri/UriSchemeParser_vndDOTsunDOTstarDOTscript.idl
+++ b/udkapi/com/sun/star/uri/UriSchemeParser_vndDOTsunDOTstarDOTscript.idl
@@ -48,7 +48,7 @@ published interface XUriSchemeParser;
Rather, it should be used indirectly through the
<type scope="com::sun::star::uri">UriReferenceFactory</type> service.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service UriSchemeParser_vndDOTsunDOTstarDOTscript: XUriSchemeParser
{};
diff --git a/udkapi/com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.idl b/udkapi/com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.idl
index f652851cf280..9edd29a6c702 100644
--- a/udkapi/com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.idl
+++ b/udkapi/com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.idl
@@ -35,7 +35,7 @@ published interface XVndSunStarPkgUrlReferenceFactory;
/**
creates &ldquo;vnd.sun.star.pkg&rdquo; URL references.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published service VndSunStarPkgUrlReferenceFactory:
XVndSunStarPkgUrlReferenceFactory;
diff --git a/udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl b/udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl
index 3dc6b8bfca77..d97c677ebd36 100644
--- a/udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl
+++ b/udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl
@@ -54,7 +54,7 @@ module com { module sun { module star { module uri {
references (that do not include a scheme) are left unmodified by the
translation process.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XExternalUriReferenceTranslator {
/**
diff --git a/udkapi/com/sun/star/uri/XUriReference.idl b/udkapi/com/sun/star/uri/XUriReference.idl
index 79ad88f47a1c..eccd19164248 100644
--- a/udkapi/com/sun/star/uri/XUriReference.idl
+++ b/udkapi/com/sun/star/uri/XUriReference.idl
@@ -47,7 +47,7 @@ module com { module sun { module star { module uri {
<type scope="com::sun::star::uri">XUriReference</type> and additional,
scheme-specific interfaces.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XUriReference: com::sun::star::uno::XInterface {
/**
diff --git a/udkapi/com/sun/star/uri/XUriReferenceFactory.idl b/udkapi/com/sun/star/uri/XUriReferenceFactory.idl
index bd62235b985d..a7bc1514f98c 100644
--- a/udkapi/com/sun/star/uri/XUriReferenceFactory.idl
+++ b/udkapi/com/sun/star/uri/XUriReferenceFactory.idl
@@ -40,7 +40,7 @@ module com { module sun { module star { module uri {
<p>See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC&nbsp;2396</a> for a
description of URI references and related terms.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XUriReferenceFactory: com::sun::star::uno::XInterface {
/**
diff --git a/udkapi/com/sun/star/uri/XUriSchemeParser.idl b/udkapi/com/sun/star/uri/XUriSchemeParser.idl
index 61a8173d9ab4..a267b38b4329 100644
--- a/udkapi/com/sun/star/uri/XUriSchemeParser.idl
+++ b/udkapi/com/sun/star/uri/XUriSchemeParser.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module uri {
<p>See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC&nbsp;2396</a> for a
description of URIs and related terms.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XUriSchemeParser: com::sun::star::uno::XInterface {
/**
diff --git a/udkapi/com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.idl b/udkapi/com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.idl
index e6db55f9905b..179253b8de78 100644
--- a/udkapi/com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.idl
+++ b/udkapi/com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.idl
@@ -37,7 +37,7 @@ published interface XUriReference;
/**
creates &ldquo;vnd.sun.star.pkg&rdquo; URL references.
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XVndSunStarPkgUrlReferenceFactory {
/**
diff --git a/udkapi/com/sun/star/uri/XVndSunStarScriptUrl.idl b/udkapi/com/sun/star/uri/XVndSunStarScriptUrl.idl
index 753ed90b1cef..ceae7926f04d 100644
--- a/udkapi/com/sun/star/uri/XVndSunStarScriptUrl.idl
+++ b/udkapi/com/sun/star/uri/XVndSunStarScriptUrl.idl
@@ -61,7 +61,7 @@ module com { module sun { module star { module uri {
without considering case folding or normalization. There may be multiple
parameters with equal keys.</p>
- @since OOo 2.0.0
+ @since OOo 2.0
*/
published interface XVndSunStarScriptUrl: com::sun::star::uno::XInterface {
/**
diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
index 50cb6ed1f34c..82063747288e 100644
--- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx
+++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
@@ -114,8 +114,7 @@ static const char usageText[] =
" command names, where the commands are a ',' separated list\n"
" of unique commands. This option is only valid for add-ons.\n"
" -V, --version print version number and exit\n"
-" -h, --help print this help and exit\n\n"
-" Sun Microsystems (R) ";
+" -h, --help print this help and exit\n\n";
void printUsageAndExit(const char* programname, const char* version)
{
diff --git a/unoil/climaker/version.txt b/unoil/climaker/version.txt
index 2678d1bc035b..f59c2f9482b4 100644..100755
--- a/unoil/climaker/version.txt
+++ b/unoil/climaker/version.txt
@@ -25,8 +25,8 @@
#
#*************************************************************************
-CLI_OOOTYPES_NEW_VERSION=1.0.7.0
-CLI_OOOTYPES_OLD_VERSION=1.0.0.0-1.0.6.0
-CLI_OOOTYPES_POLICY_VERSION=7.0.0.0
+CLI_OOOTYPES_NEW_VERSION=1.0.8.0
+CLI_OOOTYPES_OLD_VERSION=1.0.0.0-1.0.7.0
+CLI_OOOTYPES_POLICY_VERSION=8.0.0.0
CLI_OOOTYPES_POLICY_ASSEMBLY=policy.1.0.cli_oootypes
diff --git a/unoil/util/makefile.mk b/unoil/util/makefile.mk
index f5d8125b81f8..c2bd22ef2733 100644
--- a/unoil/util/makefile.mk
+++ b/unoil/util/makefile.mk
@@ -35,7 +35,7 @@ TARGET = unoil
MAXLINELENGTH = 100000
-JARCLASSDIRS = com drafts
+JARCLASSDIRS = com
JARTARGET = $(TARGET).jar
JARCOMPRESS = TRUE
diff --git a/unoxml/JunitTest_unordf_complex.mk b/unoxml/JunitTest_unordf_complex.mk
new file mode 100644
index 000000000000..7637eef13a82
--- /dev/null
+++ b/unoxml/JunitTest_unordf_complex.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,unordf_complex))
+
+$(eval $(call gb_JunitTest_set_defs,unordf_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/unoxml/qa/complex/unoxml/testdocuments \
+))
+
+$(eval $(call gb_JunitTest_add_jars,unordf_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,unordf_complex,\
+ unoxml/qa/complex/unoxml/RDFRepositoryTest \
+ unoxml/qa/complex/unoxml/TestDocument \
+))
+
+$(eval $(call gb_JunitTest_add_classes,unordf_complex,\
+ complex.unoxml.RDFRepositoryTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/JunitTest_unoxml_complex.mk b/unoxml/JunitTest_unoxml_complex.mk
new file mode 100644
index 000000000000..09eaa32e7bbe
--- /dev/null
+++ b/unoxml/JunitTest_unoxml_complex.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,unoxml_complex))
+
+$(eval $(call gb_JunitTest_set_defs,unoxml_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/unoxml/qa/complex/unoxml/testdocuments \
+))
+
+$(eval $(call gb_JunitTest_add_jars,unoxml_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,unoxml_complex,\
+ unoxml/qa/complex/unoxml/DOMTest \
+ unoxml/qa/complex/unoxml/TestDocument \
+))
+
+$(eval $(call gb_JunitTest_add_classes,unoxml_complex,\
+ complex.unoxml.DOMTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/Library_unordf.mk b/unoxml/Library_unordf.mk
new file mode 100644
index 000000000000..79123c6a359c
--- /dev/null
+++ b/unoxml/Library_unordf.mk
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,unordf))
+
+$(eval $(call gb_Library_set_componentfile,unordf,unoxml/source/rdf/unordf))
+
+$(eval $(call gb_Library_set_include,unordf,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,unordf,\
+ $$(DEFS) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,unordf,\
+ cppuhelper \
+ cppu \
+ sal \
+ stl \
+ rdf \
+ xslt \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,unordf,\
+ unoxml/source/rdf/CBlankNode \
+ unoxml/source/rdf/CURI \
+ unoxml/source/rdf/CLiteral \
+ unoxml/source/rdf/librdf_repository \
+ unoxml/source/rdf/librdf_services \
+))
+
+ifeq ($(SYSTEM_REDLAND),YES)
+$(eval $(call gb_Library_set_cxxflags,unordf,\
+ $$(CXXFLAGS) \
+ -DSYSTEM_REDLAND $$(REDLAND_CFLAGS) \
+))
+endif
+
+ifeq ($(SYSTEM_LIBXSLT),YES)
+$(eval $(call gb_Library_set_cxxflags,unordf,\
+ $$(CXXFLAGS) \
+ $$(LIBXSLT_CFLAGS) \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
+
diff --git a/unoxml/Library_unoxml.mk b/unoxml/Library_unoxml.mk
new file mode 100644
index 000000000000..517c8a8462c0
--- /dev/null
+++ b/unoxml/Library_unoxml.mk
@@ -0,0 +1,96 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,unoxml))
+
+$(eval $(call gb_Library_set_componentfile,unoxml,unoxml/source/service/unoxml))
+
+$(eval $(call gb_Library_set_include,unoxml,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,unoxml,\
+ $$(DEFS) \
+))
+
+$(eval $(call gb_Library_add_linked_libs,unoxml,\
+ ucbhelper \
+ sax \
+ comphelper \
+ cppuhelper \
+ cppu \
+ sal \
+ stl \
+ xml2 \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,unoxml,\
+ unoxml/source/dom/node \
+ unoxml/source/dom/document \
+ unoxml/source/dom/element \
+ unoxml/source/dom/attr \
+ unoxml/source/dom/cdatasection \
+ unoxml/source/dom/characterdata \
+ unoxml/source/dom/comment \
+ unoxml/source/dom/documentbuilder \
+ unoxml/source/dom/documentfragment \
+ unoxml/source/dom/documenttype \
+ unoxml/source/dom/entity \
+ unoxml/source/dom/entityreference \
+ unoxml/source/dom/notation \
+ unoxml/source/dom/processinginstruction \
+ unoxml/source/dom/text \
+ unoxml/source/dom/domimplementation \
+ unoxml/source/dom/elementlist \
+ unoxml/source/dom/childlist \
+ unoxml/source/dom/notationsmap \
+ unoxml/source/dom/entitiesmap \
+ unoxml/source/dom/attributesmap \
+ unoxml/source/dom/saxbuilder \
+ unoxml/source/xpath/xpathobject \
+ unoxml/source/xpath/nodelist \
+ unoxml/source/xpath/xpathapi \
+ unoxml/source/events/event \
+ unoxml/source/events/eventdispatcher \
+ unoxml/source/events/mutationevent \
+ unoxml/source/events/uievent \
+ unoxml/source/events/mouseevent \
+ unoxml/source/events/testlistener \
+ unoxml/source/service/services \
+))
+
+ifeq ($(SYSTEM_LIBXML),YES)
+$(eval $(call gb_Library_set_cxxflags,unoxml,\
+ $$(CXXFLAGS) \
+ -DSYSTEM_LIBXML $$(LIBXML_CFLAGS) \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
+
diff --git a/offapi/drafts/com/sun/star/form/makefile.mk b/unoxml/Makefile
index c5f68e0fe2b5..c898975e5277 100644
--- a/offapi/drafts/com/sun/star/form/makefile.mk
+++ b/unoxml/Makefile
@@ -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,28 +25,14 @@
#
#*************************************************************************
-PRJ=..$/..$/..$/..$/..
-
-PRJNAME=offapi
-
-TARGET=dcssform
-PACKAGE=drafts$/com$/sun$/star$/form
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# ------------------------------------------------------------------------
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
-IDLFILES=\
- IncompatibleTypesException.idl \
- ListEntryEvent.idl \
- XBindableValue.idl \
- XValueBinding.idl \
- XListEntrySink.idl \
- XListEntrySource.idl \
- XListEntryListener.idl \
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
-# ------------------------------------------------------------------
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
-.INCLUDE : target.mk
-.INCLUDE : $(PRJ)$/util$/target.pmk
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/Module_unoxml.mk b/unoxml/Module_unoxml.mk
new file mode 100644
index 000000000000..5050d0701f3f
--- /dev/null
+++ b/unoxml/Module_unoxml.mk
@@ -0,0 +1,40 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Module_Module,unoxml))
+
+$(eval $(call gb_Module_add_targets,unoxml,\
+ Library_unoxml \
+ Library_unordf \
+))
+
+$(eval $(call gb_Module_add_subsequentcheck_targets,unoxml,\
+ JunitTest_unoxml_complex \
+ JunitTest_unordf_complex \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/unoxml/prj/build.lst b/unoxml/prj/build.lst
index 4da29cb9d669..02f0482d76f8 100644
--- a/unoxml/prj/build.lst
+++ b/unoxml/prj/build.lst
@@ -1,8 +1,2 @@
-ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland tools NULL
-ux unoxml\source\dom nmake - all ux_dom NULL
-ux unoxml\source\xpath nmake - all ux_xpath ux_dom NULL
-ux unoxml\source\events nmake - all ux_events ux_dom NULL
-ux unoxml\source\service nmake - all ux_service ux_dom ux_xpath ux_events NULL
-ux unoxml\source\rdf nmake - all ux_librdf NULL
-
-ux unoxml\qa\complex\unoxml nmake - all ux_complex ux_librdf NULL
+ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland sax comphelper ucbhelper NULL
+ux unoxml\prj nmake - all ux_prj NULL
diff --git a/unoxml/prj/d.lst b/unoxml/prj/d.lst
index 4fcedbdba7a2..e69de29bb2d1 100644
--- a/unoxml/prj/d.lst
+++ b/unoxml/prj/d.lst
@@ -1,5 +0,0 @@
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
-..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
-..\%__SRC%\misc\unordf.component %_DEST%\xml%_EXT%\unordf.component
-..\%__SRC%\misc\unoxml.component %_DEST%\xml%_EXT%\unoxml.component
diff --git a/unoxml/source/xpath/makefile.mk b/unoxml/prj/makefile.mk
index 7b1ccdae742b..5ebed8a45c4a 100644
--- a/unoxml/source/xpath/makefile.mk
+++ b/unoxml/prj/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -25,28 +25,16 @@
#
#*************************************************************************
-PRJ=../..
-
-PRJNAME=unoxml
-TARGET=xpathimpl
-ENABLE_EXCEPTIONS=TRUE
+PRJ=..
+TARGET=prj
-# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
.ENDIF
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xpathobject.obj \
- $(SLO)$/nodelist.obj \
- $(SLO)$/xpathapi.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET)
diff --git a/unoxml/qa/complex/unoxml/DOMTest.java b/unoxml/qa/complex/unoxml/DOMTest.java
new file mode 100644
index 000000000000..e7efad8ab5a7
--- /dev/null
+++ b/unoxml/qa/complex/unoxml/DOMTest.java
@@ -0,0 +1,2986 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+package complex.unoxml;
+
+import lib.TestParameters;
+import helper.StreamSimulator;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.io.XInputStream;
+import com.sun.star.xml.dom.*;
+import static com.sun.star.xml.dom.DOMExceptionType.*;
+import static com.sun.star.xml.dom.NodeType.*;
+import com.sun.star.xml.dom.events.*;
+import com.sun.star.xml.xpath.*;
+import static com.sun.star.xml.xpath.XPathObjectType.*;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ * Test for com.sun.star.xml.dom.*, com.sun.star.xml.xpath.*
+ */
+public class DOMTest
+{
+ private static final OfficeConnection connection = new OfficeConnection();
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ XComponentContext m_xContext;
+ XMultiServiceFactory m_xMSF;
+ TestParameters m_params;
+
+ @Before public void before() throws Exception
+ {
+ final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ connection.getComponentContext().getServiceManager());
+ assertNotNull("could not create MultiServiceFactory.", xMSF);
+ m_params = new TestParameters();
+ m_params.put("ServiceFactory", xMSF);
+ XPropertySet xPropertySet =
+ UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ m_xContext = UnoRuntime.queryInterface(XComponentContext.class,
+ xPropertySet.getPropertyValue("DefaultContext"));
+ assertNotNull("could not get component context.", m_xContext);
+ m_xMSF = xMSF;
+ }
+
+ @Test public void testXSAXDocumentBuilder() throws Exception
+ {
+ XSAXDocumentBuilder xSAXBuilder =
+ UnoRuntime.queryInterface(XSAXDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.SAXDocumentBuilder"));
+ //FIXME TODO
+ }
+
+ @Test public void testXDocumentBuilder() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+
+ XDOMImplementation xDomImpl = xBuilder.getDOMImplementation();
+//FIXME fails assertNotNull("getDOMImplementation", xDomImpl);
+
+ xBuilder.isNamespaceAware();
+ xBuilder.isValidating();
+
+ {
+ XDocument xDoc = xBuilder.newDocument();
+ assertNotNull("newDocument", xDoc);
+ }
+
+ try {
+ xBuilder.parse(null);
+ fail("XDocumentBuilder.parse(null)");
+ } catch (Exception e) { /* expected */ }
+ {
+ XInputStream xIn = new StreamSimulator(
+ TestDocument.getUrl("example.rdf"), true, m_params);
+ XDocument xDoc = xBuilder.parse(xIn);
+ assertNotNull("XDocumentBuilder.parse", xDoc);
+ }
+ try {
+ xBuilder.parseURI("");
+ fail("XDocumentBuilder.parseURI(\"\")");
+ } catch (Exception e) { /* expected */ }
+ {
+ XDocument xDoc =
+ xBuilder.parseURI(TestDocument.getUrl("example.rdf"));
+ assertNotNull("XDocumentBuilder.parseURI", xDoc);
+ }
+
+ xBuilder.setEntityResolver(null);
+ /* FIXME TODO
+ XEntityResolver xER;
+ xBuilder.setEntityResolver(xER);
+ */
+
+ xBuilder.setErrorHandler(null);
+ /* FIXME TODO
+ XErrorHandler xEH;
+ xBuilder.setErrorHandler(xEH);
+ */
+ }
+
+ @Test public void testXDocument() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ /* FIXME
+ try {
+ xDoc.createAttribute("&");
+ fail("XDocument.createAttribute");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createAttribute",
+ INVALID_CHARACTER_ERR == e.Code);
+ }*/
+ {
+ XAttr xAttr = xDoc.createAttribute("foo");
+ assertNotNull("XDocument.createAttribute", xAttr);
+ assertEquals("XDocument.createAttribute",
+ "foo", xAttr.getNodeName());
+ }
+
+ String ns = "http://example.com/";
+ /* FIXME
+ try {
+ xDoc.createAttributeNS(ns, "&");
+ fail("XDocument.createAttributeNS");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createAttributeNS",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ {
+ XAttr xAttr = xDoc.createAttributeNS(ns, "e:foo");
+ assertNotNull("XDocument.createAttributeNS", xAttr);
+ assertEquals("XDocument.createAttributeNS", "foo",
+ xAttr.getNodeName());
+ }
+
+ XCDATASection xCDS = xDoc.createCDATASection("foo");
+ assertNotNull("XDocument.createCDATASection", xCDS);
+
+ XComment xComment = xDoc.createComment("foo");
+ assertNotNull("XDocument.createComment", xComment);
+
+ XDocumentFragment xDF = xDoc.createDocumentFragment();
+ assertNotNull("XDocument.createDocumentFragment", xDF);
+
+ /* FIXME
+ try {
+ xDoc.createElement("&");
+ fail("XDocument.createElement(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createElement(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement(\"foo\")", xElemFoo);
+ assertEquals("XDocument.createElement(\"foo\")",
+ "foo", xElemFoo.getNodeName());
+
+ /* FIXME
+ try {
+ xDoc.createElementNS(ns, "&");
+ fail("XDocument.createElementNS(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XDocument.createElementNS(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+ XElement xElemFooNs = xDoc.createElementNS(ns, "foo");
+ assertNotNull("XDocument.createElementNS(\"foo\")", xElemFooNs);
+ assertEquals("XDocument.createElementNS(\"foo\")",
+ "foo", xElemFooNs.getNodeName());
+
+ XEntityReference xER = xDoc.createEntityReference("foo");
+ assertNotNull("XDocument.createEntityReference", xER);
+
+ XProcessingInstruction xPI =
+ xDoc.createProcessingInstruction("foo", "bar");
+ assertNotNull("XDocument.createProcessingInstruction", xPI);
+
+ XText xText = xDoc.createTextNode("foo");
+ assertNotNull("XDocument.createTextNode", xText);
+
+ XDocumentType xDT = xDoc.getDoctype();
+ assertNull("XDocument.getDoctype", xDT);
+
+ {
+ XElement xDE = xDoc.getDocumentElement();
+ assertNull("XDocument.getDocumentElement", xDE);
+ }
+ {
+ XElement xById = xDoc.getElementById("foo");
+ assertNull("XDocument.getDocumentElement", xById);
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagName("foo");
+ assertNotNull("XDocument.getElementsByTagName", xNodeList);
+ assertTrue("XDocument.getElementsByTagName",
+ 0 == xNodeList.getLength());
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagNameNS(ns, "foo");
+ assertNotNull("XDocument.getElementsByTagNameNS", xNodeList);
+ assertTrue("XDocument.getElementsByTagNameNS",
+ 0 == xNodeList.getLength());
+ }
+
+ XDOMImplementation xDOMImpl = xDoc.getImplementation();
+ assertNotNull("XDocument.getImplementation", xDOMImpl);
+
+ {
+ XNode xRet = xElemFooNs.appendChild(xElemFoo);
+ assertEquals("XElement.appendChild(xElemFoo)", xElemFoo, xRet);
+ }
+ {
+ XNode xRet = xDoc.appendChild(xElemFooNs);
+ assertTrue("XDocument.appendChild(xElemFooNs)",
+ xElemFooNs.equals(xRet));
+ }
+
+ XElement xDE = xDoc.getDocumentElement();
+ assertNotNull("XDocument.getDocumentElement", xDE);
+ assertEquals("XDocument.getDocumentElement", xElemFooNs, xDE);
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagName("foo");
+ assertNotNull("XDocument.getElementsByTagName", xNodeList);
+ assertTrue("XDocument.getElementsByTagName",
+ 2 == xNodeList.getLength());
+ assertEquals("XDocument.getElementsByTagNameNS",
+ xElemFooNs, xNodeList.item(0));
+ assertEquals("XDocument.getElementsByTagName",
+ xElemFoo, xNodeList.item(1));
+ }
+
+ {
+ XNodeList xNodeList = xDoc.getElementsByTagNameNS(ns, "foo");
+ assertNotNull("XDocument.getElementsByTagNameNS", xNodeList);
+ assertTrue("XDocument.getElementsByTagNameNS",
+ 1 == xNodeList.getLength());
+ assertEquals("XDocument.getElementsByTagNameNS",
+ xElemFooNs, xNodeList.item(0));
+ }
+
+ xElemFoo.setAttributeNS("http://www.w3.org/XML/1998/namespace",
+ "xml:id", "bar");
+
+ XElement xById = xDoc.getElementById("bar");
+ assertNotNull("XDocument.getDocumentElement", xById);
+ assertEquals("XDocument.getDocumentElement", xElemFoo, xById);
+
+ try {
+ xDoc.importNode(null, false);
+ fail("XDocument.importNode(null)");
+ } catch (Exception e) { /* expected */ }
+ {
+ XNode xImported = xDoc.importNode(xElemFoo, false);
+ assertNotNull("XDocument.importNode()", xImported);
+ assertEquals("XDocument.importNode()", xElemFoo, xImported);
+ }
+ {
+ MockAttr xMockAttrBar = new MockAttr("bar", "blah");
+ MockAttr xMockAttrBaz = new MockAttr("baz", "quux");
+ MockElement xMockElemFoo = new MockElement("foo",
+ new MockAttr[] { xMockAttrBar, xMockAttrBaz });
+ MockElement xMockElemBar = new MockElement("bar",
+ new MockAttr[] { });
+ MockElement xMockElemRoot =
+ new MockElement("root", new MockAttr[] { });
+ MockDoc xMockDoc = new MockDoc();
+ xMockDoc.init(new MockNode[] { xMockElemRoot });
+ xMockElemRoot.init(xMockDoc, xMockDoc, null, null,
+ new MockNode[] { xMockElemFoo, xMockElemBar });
+ xMockElemFoo.init(xMockDoc, xMockElemRoot, null, xMockElemBar,
+ new MockNode[] { });
+ xMockElemBar.init(xMockDoc, xMockElemRoot, xMockElemFoo, null,
+ new MockNode[] { });
+
+ {
+ XNode xImported = xDoc.importNode(xMockElemRoot, false);
+ assertNotNull("XDocument.importNode(false)", xImported);
+ XElement xE =
+ UnoRuntime.queryInterface(XElement.class, xImported);
+ assertNotNull("XDocument.importNode(false)", xE);
+ assertEquals("XDocument.importNode(false)",
+ "root", xE.getLocalName());
+ assertFalse("XDocument.importNode(false)", xE.hasAttributes());
+ assertFalse("XDocument.importNode(false)", xE.hasChildNodes());
+ }
+
+ {
+ XNode xImported = xDoc.importNode(xMockElemRoot, true);
+ assertNotNull("XDocument.importNode(true)", xImported);
+ XElement xImpRoot =
+ UnoRuntime.queryInterface(XElement.class, xImported);
+ assertNotNull("XDocument.importNode(true)", xImpRoot);
+ assertEquals("XDocument.importNode(true)",
+ "root", xImpRoot.getLocalName());
+ assertFalse("XDocument.importNode(true)",
+ xImpRoot.hasAttributes());
+ assertTrue("XDocument.importNode(true)",
+ xImpRoot.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "root", xImpRoot.getNodeName());
+
+ XNode xImpFooN = xImpRoot.getFirstChild();
+ assertNotNull("XDocument.importNode(true)", xImpFooN);
+ XElement xImpFoo =
+ UnoRuntime.queryInterface(XElement.class, xImpFooN);
+ assertNotNull("XDocument.importNode(true)", xImpFoo);
+ assertTrue("XDocument.importNode(true)",
+ xImpFoo.hasAttributes());
+ assertFalse("XDocument.importNode(true)",
+ xImpFoo.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "foo", xImpFoo.getNodeName());
+ assertEquals("XDocument.importNode(true)",
+ "blah", xImpFoo.getAttribute("bar"));
+ assertEquals("XDocument.importNode(true)",
+ "quux", xImpFoo.getAttribute("baz"));
+ XNode xImpBarN = xImpFooN.getNextSibling();
+ assertNotNull("XDocument.importNode(true)", xImpBarN);
+ XElement xImpBar =
+ UnoRuntime.queryInterface(XElement.class, xImpBarN);
+ assertNotNull("XDocument.importNode(true)", xImpBar);
+ assertFalse("XDocument.importNode(true)",
+ xImpBar.hasAttributes());
+ assertFalse("XDocument.importNode(true)",
+ xImpBar.hasChildNodes());
+ assertEquals("XDocument.importNode(true)",
+ "bar", xImpBar.getNodeName());
+ assertNull("XDocument.importNode(true)",
+ xImpBar.getNextSibling());
+ }
+ }
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xDocCloneN = xDoc.cloneNode(false);
+ assertNotNull("XDocument.cloneNode(false)", xDocCloneN);
+ XDocument xDocClone =
+ UnoRuntime.queryInterface(XDocument.class, xDocCloneN);
+ assertNotNull("XDocument.cloneNode(false)", xDocClone);
+ assertFalse("XDocument.cloneNode(false)",
+ xDocClone.hasChildNodes());
+ assertNull("XDocument.cloneNode(false)", xDocClone.getFirstChild());
+ assertNull("XDocument.cloneNode(false)",
+ xDocClone.getDocumentElement());
+ }
+ {
+ XNode xDocCloneN = xDoc.cloneNode(true);
+ assertNotNull("XDocument.cloneNode(true)", xDocCloneN);
+ XDocument xDocClone =
+ UnoRuntime.queryInterface(XDocument.class, xDocCloneN);
+ assertNotNull("XDocument.cloneNode(true)", xDocClone);
+ assertTrue("XDocument.cloneNode(true)", xDocClone.hasChildNodes());
+ assertNotNull("XDocument.cloneNode(true)",
+ xDocClone.getFirstChild());
+ XElement xE = xDocClone.getDocumentElement();
+ assertNotNull("XDocument.cloneNode(true)", xE);
+ assertFalse("XDocument.cloneNode(true)", xElemFooNs.equals(xE));
+ assertEquals("XDocument.cloneNode(true)", "foo", xE.getLocalName());
+ assertEquals("XDocument.cloneNode(true)", ns, xE.getNamespaceURI());
+ }
+
+ assertNull("XDocument.getAttributes()", xDoc.getAttributes());
+
+ {
+ XNodeList xChildren = xDoc.getChildNodes();
+ assertTrue("XDocument.getChildNodes()", 1 == xChildren.getLength());
+ assertEquals("XDocument.getChildNodes()",
+ xElemFooNs, xChildren.item(0));
+
+ XNode xFirst = xDoc.getFirstChild();
+ assertEquals("XDocument.getFirstChild()", xElemFooNs, xFirst);
+ XNode xLast = xDoc.getLastChild();
+ assertEquals("XDocument.getLastChild()", xElemFooNs, xLast);
+ }
+
+ assertEquals("XDocument.getLocalName()", "", xDoc.getLocalName());
+
+ assertEquals("XDocument.getNamespaceURI()", "", xDoc.getNamespaceURI());
+
+ assertNull("XDocument.getNextSibling()", xDoc.getNextSibling());
+
+ assertEquals("XDocument.getNodeName()",
+ "#document", xDoc.getNodeName());
+
+ assertTrue("XDocument.getNodeType()",
+ DOCUMENT_NODE == xDoc.getNodeType());
+
+ assertEquals("XDocument.getNodeValue()", "", xDoc.getNodeValue());
+
+ assertEquals("XDocument.getOwnerDocument()",
+ xDoc, xDoc.getOwnerDocument());
+
+ assertNull("XDocument.getParentNode()", xDoc.getParentNode());
+
+ assertEquals("XDocument.getPrefix()", "", xDoc.getPrefix());
+
+ assertNull("XDocument.getPreviousSibling()", xDoc.getPreviousSibling());
+
+ assertFalse("XDocument.hasAttributes()", xDoc.hasAttributes());
+
+ assertTrue("XDocument.hasChildNodes()", xDoc.hasChildNodes());
+
+ assertFalse("XDocument.isSupported()",
+ xDoc.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xDoc.normalize();
+
+ try {
+ xDoc.setNodeValue("42");
+ fail("XDocument.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDoc.setPrefix("foo");
+ fail("XDocument.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDoc.appendChild(null);
+ fail("XDocument.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+
+ try {
+ xDoc.insertBefore(null, xText);
+ fail("XDocument.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.insertBefore(xText, null);
+ fail("XDocument.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.insertBefore(xText, xText);
+ fail("XDocument.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XDocument.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xDoc.insertBefore(xComment, xElemFooNs);
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xRet, xElemFooNs); // why does this return the old node?
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xComment, xDoc.getFirstChild());
+ assertEquals("XDocument.insertBefore(xComment, xElemFooNs)",
+ xDoc, xComment.getParentNode());
+ assertEquals("XDocument.insertBefore(xCommnet, xElemFooNs)",
+ xElemFooNs, xDoc.getLastChild());
+ }
+
+ try {
+ xDoc.replaceChild(null, xText);
+ fail("XDocument.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.replaceChild(xText, null);
+ fail("XDocument.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.replaceChild(xElemFoo, xElemFoo); // not child
+ fail("XDocument.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XDocument.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xDoc.replaceChild(xElemFooNs, xElemFooNs); // child
+ assertFalse("XDocument.replaceChild(xElemFooNs, xElemFooNs)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XDocument.replaceChild(xElemFooNs, xElemFooNs)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xDoc.replaceChild(xPI, xComment);
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xReplaced, xComment);
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xPI, xDoc.getFirstChild());
+ assertEquals("XDocument.replaceChild(xPI, xComment)",
+ xElemFooNs, xDoc.getLastChild());
+
+ try {
+ xDoc.removeChild(null);
+ fail("XDocument.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDoc.removeChild(xElemFoo);
+ fail("XDocument.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XDocument.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xDoc.removeChild(xPI);
+ assertEquals("XDocument.removeChild(xPI)", xRemoved, xPI);
+ assertTrue("XDocument.removeChild(xPI)", xDoc.hasChildNodes());
+ assertEquals("XDocument.removeChild(xPI)",
+ xElemFooNs, xDoc.getFirstChild());
+ assertEquals("XDocument.removeChild(xPI)",
+ xElemFooNs, xDoc.getLastChild());
+ }
+
+ @Test public void testXDocumentFragment() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XDocumentFragment xDF = xDoc.createDocumentFragment();
+ assertNotNull("XDocument.createDocumentFragment", xDF);
+
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement", xElemFoo);
+
+ xDF.appendChild(xElemFoo);
+
+ // XNode ////////////////////////////////////////////////////
+
+ XText xText = xDoc.createTextNode("foo");
+ XComment xComment = xDoc.createComment("foo");
+
+ {
+ XNode xDFCloneN = xDF.cloneNode(false);
+ assertNotNull("XDocumentFragment.cloneNode(false)", xDFCloneN);
+ XDocumentFragment xDFClone =
+ UnoRuntime.queryInterface(XDocumentFragment.class, xDFCloneN);
+ assertNotNull("XDocumentFragment.cloneNode(false)", xDFClone);
+ assertFalse("XDocumentFragment.cloneNode(false)",
+ xDFClone.hasChildNodes());
+ assertNull("XDocumentFragment.cloneNode(false)",
+ xDFClone.getFirstChild());
+ }
+ {
+ XNode xDFCloneN = xDF.cloneNode(true);
+ assertNotNull("XDocumentFragment.cloneNode(true)", xDFCloneN);
+ XDocumentFragment xDFClone =
+ UnoRuntime.queryInterface(XDocumentFragment.class, xDFCloneN);
+ assertNotNull("XDocumentFragment.cloneNode(true)", xDFClone);
+ assertTrue("XDocumentFragment.cloneNode(true)",
+ xDFClone.hasChildNodes());
+ XNode xChild = xDFClone.getFirstChild();
+ assertNotNull("XDocumentFragment.cloneNode(true)", xChild);
+ XElement xE = UnoRuntime.queryInterface(XElement.class, xChild);
+ assertFalse("XDocumentFragment.cloneNode(true)",
+ xElemFoo.equals(xE));
+ assertEquals("XDocumentFragment.cloneNode(true)",
+ "foo", xE.getLocalName());
+ }
+
+ assertNull("XDocumentFragment.getAttributes()", xDF.getAttributes());
+
+ {
+ XNodeList xChildren = xDF.getChildNodes();
+ assertTrue("XDocumentFragment.getChildNodes()",
+ 1 == xChildren.getLength());
+ assertEquals("XDocumentFragment.getChildNodes()",
+ xElemFoo, xChildren.item(0));
+
+ XNode xFirst = xDF.getFirstChild();
+ assertEquals("XDocumentFragment.getFirstChild()",
+ xElemFoo, xFirst);
+ XNode xLast = xDF.getLastChild();
+ assertEquals("XDocumentFragment.getLastChild()", xElemFoo, xLast);
+ }
+
+ assertEquals("XDocumentFragment.getLocalName()",
+ "", xDF.getLocalName());
+
+ assertEquals("XDocumentFragment.getNamespaceURI()",
+ "", xDF.getNamespaceURI());
+
+ assertNull("XDocumentFragment.getNextSibling()", xDF.getNextSibling());
+
+ assertEquals("XDocumentFragment.getNodeName()",
+ "#document-fragment", xDF.getNodeName());
+
+ assertTrue("XDocumentFragment.getNodeType()",
+ DOCUMENT_FRAGMENT_NODE == xDF.getNodeType());
+
+ assertEquals("XDocumentFragment.getNodeValue()",
+ "", xDF.getNodeValue());
+
+ assertEquals("XDocumentFragment.getOwnerDocument()",
+ xDoc, xDF.getOwnerDocument());
+
+ assertNull("XDocumentFragment.getParentNode()", xDF.getParentNode());
+
+ assertEquals("XDocumentFragment.getPrefix()", "", xDF.getPrefix());
+
+ assertNull("XDocumentFragment.getPreviousSibling()",
+ xDF.getPreviousSibling());
+
+ assertFalse("XDocumentFragment.hasAttributes()", xDF.hasAttributes());
+
+ assertTrue("XDocumentFragment.hasChildNodes()", xDF.hasChildNodes());
+
+ assertFalse("XDocumentFragment.isSupported()",
+ xDF.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xDF.normalize();
+
+ try {
+ xDF.setNodeValue("42");
+ fail("XDocumentFragment.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDF.setPrefix("foo");
+ fail("XDocumentFragment.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xDF.appendChild(null);
+ fail("XDocumentFragment.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+
+ try {
+ xDF.insertBefore(null, xText);
+ fail("XDocumentFragment.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.insertBefore(xText, null);
+ fail("XDocumentFragment.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.insertBefore(xText, xText);
+ fail("XDocumentFragment.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xDF.insertBefore(xComment, xElemFoo);
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xRet, xElemFoo); // why does this return the old node?
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xComment, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.insertBefore(xComment, xElemFoo)",
+ xDF, xComment.getParentNode());
+ assertEquals("XDocumentFragment.insertBefore(xCommnet, xElemFoo)",
+ xElemFoo, xDF.getLastChild());
+ }
+
+ try {
+ xDF.replaceChild(null, xText);
+ fail("XDocumentFragment.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.replaceChild(xText, null);
+ fail("XDocumentFragment.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.replaceChild(xElemFoo, xElemFoo); // not child
+ fail("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xDF.replaceChild(xElemFoo, xElemFoo); // child
+ assertFalse("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xDF.replaceChild(xText, xComment);
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xReplaced, xComment);
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xText, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.replaceChild(xText, xComment)",
+ xElemFoo, xDF.getLastChild());
+
+ try {
+ xDF.removeChild(null);
+ fail("XDocumentFragment.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xDF.removeChild(xComment);
+ fail("XDocumentFragment.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XDocumentFragment.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xDF.removeChild(xText);
+ assertEquals("XDocumentFragment.removeChild(xText)", xRemoved, xText);
+ assertTrue("XDocumentFragment.removeChild(xText)", xDF.hasChildNodes());
+ assertEquals("XDocumentFragment.removeChild(xText)",
+ xElemFoo, xDF.getFirstChild());
+ assertEquals("XDocumentFragment.removeChild(xText)",
+ xElemFoo, xDF.getLastChild());
+ }
+
+ @Test public void testXElement() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ String ns = "http://example.com/";
+
+ XElement xElemFoo = xDoc.createElement("foo");
+ assertNotNull("XDocument.createElement(\"foo\")", xElemFoo);
+
+ XElement xElemFooNs = xDoc.createElementNS(ns, "e:foo");
+ assertNotNull("XDocument.createElementNs(\"foo\")", xElemFooNs);
+
+ assertEquals("XElement.getTagName", "foo", xElemFoo.getTagName());
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagName("bar");
+ assertNotNull("XElement.getElementsByTagName", xNodeList);
+ assertTrue("XElement.getElementsByTagName",
+ 0 == xNodeList.getLength());
+ }
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagNameNS(ns, "bar");
+ assertNotNull("XElement.getElementsByTagNameNS", xNodeList);
+ assertTrue("XElement.getElementsByTagNameNS",
+ 0 == xNodeList.getLength());
+ }
+
+ xElemFoo.appendChild(xElemFooNs);
+
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagName("foo");
+ assertNotNull("XElement.getElementsByTagName", xNodeList);
+ assertTrue("XElement.getElementsByTagName",
+ 2 == xNodeList.getLength());
+ assertEquals("XElement.getElementsByTagName",
+ xElemFoo, xNodeList.item(0));
+ assertEquals("XElement.getElementsByTagName",
+ xElemFooNs, xNodeList.item(1));
+ }
+ {
+ XNodeList xNodeList = xElemFoo.getElementsByTagNameNS(ns, "foo");
+ assertNotNull("XElement.getElementsByTagNameNS", xNodeList);
+ assertTrue("XElement.getElementsByTagNameNS",
+ 1 == xNodeList.getLength());
+ assertEquals("XElement.getElementsByTagNameNS",
+ xElemFooNs, xNodeList.item(0));
+ }
+
+ {
+ String ret = xElemFoo.getAttribute("foo");
+ assertEquals("XElement.getAttribute", "", ret);
+ }
+ {
+ String ret = xElemFoo.getAttributeNS(ns, "foo");
+ assertEquals("XElement.getAttributeNS", "", ret);
+ }
+ {
+ XNode xAttr = xElemFoo.getAttributeNode("foo");
+ assertNull("XElement.getAttributeNode", xAttr);
+ }
+ {
+ XNode xAttr = xElemFoo.getAttributeNodeNS(ns, "foo");
+ assertNull("XElement.getAttributeNodeNS", xAttr);
+ }
+ assertFalse("XElement.hasAttribute", xElemFoo.hasAttribute("foo"));
+ assertFalse("XElement.hasAttributeNS",
+ xElemFoo.hasAttributeNS(ns, "foo"));
+
+ // surprisingly this does not throw?
+ xElemFoo.removeAttribute("foo");
+ xElemFoo.removeAttributeNS(ns, "foo");
+
+ XAttr xAttr = xDoc.createAttribute("foo");
+ XAttr xAttrNs = xDoc.createAttributeNS(ns, "foo");
+
+ try {
+ xElemFoo.removeAttributeNode(null);
+ fail("XElement.removeAttributeNode(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xElemFoo.removeAttributeNode(xAttr);
+ fail("XElement.removeAttributeNode(xAttr)");
+ } catch (DOMException e) {
+ assertTrue("XElement.removeAttributeNode(xAttr)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ /* FIXME
+ try {
+ xElemFoo.setAttribute("&", "foo");
+ fail("XElement.setAttribute(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XElement.setAttribute(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ try {
+ xElemFoo.setAttributeNS(ns, "&", "foo");
+ fail("XElement.setAttributeNS(\"&\")");
+ } catch (DOMException e) {
+ assertTrue("XElement.setAttributeNS(\"&\")",
+ INVALID_CHARACTER_ERR == e.Code);
+ }
+ */
+
+ XAttr xAttrSet = xElemFoo.setAttributeNode(xAttr);
+ assertEquals("XElement.setAttributeNode(xAttr)",
+ xAttrSet, xElemFoo.getAttributeNode("foo"));
+ assertEquals("XElement.setAttributeNode(xAttr)",
+ xElemFoo, xAttrSet.getOwnerElement());
+ try {
+ xElemFooNs.setAttributeNode(xAttrSet);
+ fail("XElement.setAttributeNode(xAttrSet)");
+ } catch (DOMException e) {
+ assertTrue("XElement.setAttributeNode(xAttrSet)",
+ INUSE_ATTRIBUTE_ERR == e.Code);
+ }
+
+ XAttr xAttrNsSet = xElemFooNs.setAttributeNodeNS(xAttrNs);
+ assertEquals("XElement.setAttributeNodeNS(xAttr)",
+ xAttrNsSet, xElemFooNs.getAttributeNodeNS(ns, "foo"));
+ assertEquals("XElement.setAttributeNodeNS(xAttrNs)",
+ xElemFooNs, xAttrNsSet.getOwnerElement());
+ try {
+ xElemFooNs.setAttributeNodeNS(xAttrNsSet);
+ fail("XElement.setAttributeNodeNS(xAttrNsSet)");
+ } catch (DOMException e) {
+ assertTrue("XElement.setAttributeNodeNS(xAttrNsSet)",
+ INUSE_ATTRIBUTE_ERR == e.Code);
+ }
+
+ XAttr xAttrRemoved = xElemFoo.removeAttributeNode(xAttrSet);
+ assertNotNull("XElement.removeAttributeNode(xAttrSet)", xAttrRemoved);
+ assertEquals("XElement.removeAttributeNode(xAttrSet)",
+ "foo", xAttrRemoved.getName());
+ assertNull("XElement.removeAttributeNode(xAttrSet)",
+ xAttrRemoved.getOwnerElement());
+
+ XAttr xAttrNsRemoved = xElemFooNs.removeAttributeNode(xAttrNsSet);
+ assertNotNull("XElement.removeAttributeNode(xAttrNsSet)",
+ xAttrNsRemoved);
+ assertEquals("XElement.removeAttributeNode(xAttrNsSet)",
+ "foo", xAttrNsRemoved.getName());
+ assertNull("XElement.removeAttributeNode(xAttrNsSet)",
+ xAttrNsRemoved.getOwnerElement());
+
+
+ xElemFoo.setAttribute("foo", "bar");
+ assertEquals("XElement.setAttribute()",
+ "bar", xElemFoo.getAttribute("foo"));
+
+ xElemFooNs.setAttributeNS(ns, "foo", "bar");
+ assertEquals("XElement.setAttributeNS()",
+ "bar", xElemFooNs.getAttributeNS(ns, "foo"));
+
+ xElemFoo.removeAttribute("foo");
+ assertNull("XElement.removeAttribute",
+ xElemFoo.getAttributeNode("foo"));
+
+ xElemFooNs.removeAttributeNS(ns, "foo");
+ assertNull("XElement.removeAttributeNS",
+ xElemFooNs.getAttributeNodeNS(ns, "foo"));
+
+ // XNode ////////////////////////////////////////////////////
+
+ XText xText = xDoc.createTextNode("foo");
+ XComment xComment = xDoc.createComment("foo");
+
+ {
+ XNamedNodeMap xAttrMap = xElemFoo.getAttributes();
+ assertNotNull("XElement.getAttributes", xAttrMap);
+ assertTrue("XElement.getAttributes", 0 == xAttrMap.getLength());
+ assertFalse("XElement.hasAttributes()", xElemFoo.hasAttributes());
+ }
+
+ xElemFooNs.setAttribute("foo", "bar");
+ xElemFoo.setAttributeNS(ns, "foo", "bar");
+
+ {
+ XNamedNodeMap xAttrMap = xElemFoo.getAttributes();
+ assertNotNull("XElement.getAttributes", xAttrMap);
+ assertTrue("XElement.getAttributes", 1 == xAttrMap.getLength());
+ XNode xAttr_ = xAttrMap.getNamedItemNS(ns, "foo");
+ assertNotNull("XElement.getAttributes", xAttr_);
+ }
+ {
+ XNamedNodeMap xAttrMap = xElemFooNs.getAttributes();
+ assertNotNull("XElement.getAttributes", xAttrMap);
+ assertTrue("XElement.getAttributes", 1 == xAttrMap.getLength());
+ XNode xAttr_ = xAttrMap.getNamedItem("foo");
+ assertNotNull("XElement.getAttributes", xAttr_);
+ }
+
+ {
+ XNode xElemFooCloneN = xElemFoo.cloneNode(false);
+ assertNotNull("XElement.cloneNode(false)", xElemFooCloneN);
+ XElement xElemFooClone =
+ UnoRuntime.queryInterface(XElement.class, xElemFooCloneN);
+ assertNotNull("XElement.cloneNode(false)", xElemFooClone);
+ assertFalse("XElement.cloneNode(false)",
+ xElemFooClone.hasChildNodes());
+ assertNull("XElement.cloneNode(false)",
+ xElemFooClone.getFirstChild());
+ }
+ {
+ XNode xElemFooCloneN = xElemFoo.cloneNode(true);
+ assertNotNull("XElement.cloneNode(true)", xElemFooCloneN);
+ XElement xElemFooClone =
+ UnoRuntime.queryInterface(XElement.class, xElemFooCloneN);
+ assertNotNull("XElement.cloneNode(true)", xElemFooClone);
+ assertTrue("XElement.cloneNode(true)",
+ xElemFooClone.hasChildNodes());
+ assertTrue("XElement.cloneNode(true)",
+ xElemFooClone.hasAttributeNS(ns, "foo"));
+ XNode xChild = xElemFooClone.getFirstChild();
+ assertNotNull("XElement.cloneNode(true)", xChild);
+ XElement xElemFooNsClone =
+ UnoRuntime.queryInterface(XElement.class, xChild);
+ assertNotNull("XElement.cloneNode(true)", xElemFooNsClone);
+ assertEquals("XElement.cloneNode(true)", "foo",
+ xElemFooNsClone.getLocalName());
+ assertEquals("XElement.cloneNode(true)", ns,
+ xElemFooNsClone.getNamespaceURI());
+ assertTrue("XElement.cloneNode(true)",
+ xElemFooNsClone.hasAttribute("foo"));
+ }
+
+ {
+ XNodeList xChildren = xElemFoo.getChildNodes();
+ assertTrue("XElement.getChildNodes()", 1 == xChildren.getLength());
+ assertEquals("XElement.getChildNodes()",
+ xElemFooNs, xChildren.item(0));
+
+ XNode xFirst = xElemFoo.getFirstChild();
+ assertEquals("XDocument.getFirstChild()", xElemFooNs, xFirst);
+ XNode xLast = xElemFoo.getLastChild();
+ assertEquals("XDocument.getLastChild()", xElemFooNs, xLast);
+ }
+
+ assertEquals("XElement.getLocalName()", "foo", xElemFoo.getLocalName());
+ assertEquals("XElement.getLocalName()", "foo",
+ xElemFooNs.getLocalName());
+
+ assertEquals("XElement.getNamespaceURI()", "",
+ xElemFoo.getNamespaceURI());
+ assertEquals("XElement.getNamespaceURI()", ns,
+ xElemFooNs.getNamespaceURI());
+
+ assertNull("XElement.getNextSibling()", xElemFoo.getNextSibling());
+
+ assertEquals("XElement.getNodeName()", "foo", xElemFoo.getNodeName());
+ assertEquals("XElement.getNodeName()", "foo",
+ xElemFooNs.getNodeName());
+
+ assertTrue("XElement.getNodeType()",
+ ELEMENT_NODE == xElemFoo.getNodeType());
+
+ assertEquals("XElement.getNodeValue()", "", xElemFoo.getNodeValue());
+
+ assertEquals("XElement.getOwnerDocument()",
+ xDoc, xElemFoo.getOwnerDocument());
+
+ assertNull("XElement.getParentNode()", xElemFoo.getParentNode());
+ assertEquals("XElement.getParentNode()",
+ xElemFoo, xElemFooNs.getParentNode());
+
+ assertEquals("XElement.getPrefix()", "", xElemFoo.getPrefix());
+ assertEquals("XElement.getPrefix()", "e", xElemFooNs.getPrefix());
+
+ assertNull("XElement.getPreviousSibling()",
+ xElemFoo.getPreviousSibling());
+
+ assertTrue("XElement.hasAttributes()", xElemFoo.hasAttributes());
+
+ assertTrue("XElement.hasChildNodes()", xElemFoo.hasChildNodes());
+ assertFalse("XElement.hasChildNodes()", xElemFooNs.hasChildNodes());
+
+ assertFalse("XElement.isSupported()",
+ xElemFoo.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xElemFoo.normalize();
+
+ try {
+ xElemFoo.setNodeValue("42");
+ fail("XElement.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XElement.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ xElemFooNs.setPrefix("f");
+ assertEquals("XElement.getPrefix()", "f", xElemFooNs.getPrefix());
+
+ try {
+ xElemFoo.appendChild(null);
+ fail("XElement.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xElemFoo.insertBefore(null, xText);
+ fail("XElemFoo.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xElemFoo.insertBefore(xText, null);
+ fail("XElemFoo.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xElemFoo.insertBefore(xText, xText);
+ fail("XElement.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XDocument.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xElemFoo.insertBefore(xText, xElemFooNs);
+ assertEquals("XElement.insertBefore(xText, xElemFooNs)",
+ xRet, xElemFooNs); // why does this return the old node?
+ assertEquals("XElement.insertBefore(xText, xElemFooNs)",
+ xText, xElemFoo.getFirstChild());
+ assertEquals("XElement.insertBefore(xText, xElemFooNs)",
+ xElemFoo, xText.getParentNode());
+ assertEquals("XElement.insertBefore(xText, xElemFooNs)",
+ xElemFooNs, xElemFoo.getLastChild());
+ }
+
+ try {
+ xElemFoo.replaceChild(null, xText);
+ fail("XElement.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xElemFoo.replaceChild(xText, null);
+ fail("XElement.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xElemFoo.replaceChild(xElemFoo, xElemFoo); // not child
+ fail("XElement.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XElement.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xElemFoo.replaceChild(xElemFooNs, xElemFooNs); // child
+ assertFalse("XElement.replaceChild(xElemFooNs, xElemFooNs)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XElement.replaceChild(xElemFooNs, xElemFooNs)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xElemFoo.replaceChild(xComment, xText);
+ assertEquals("XElement.replaceChild(xComment, xText)",
+ xReplaced, xText);
+ assertEquals("XElement.replaceChild(xComment, xText)",
+ xComment, xElemFoo.getFirstChild());
+ assertEquals("XElement.replaceChild(xComment, xText)",
+ xElemFooNs, xElemFoo.getLastChild());
+
+ try {
+ xElemFoo.removeChild(null);
+ fail("XElement.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xElemFoo.removeChild(xElemFoo);
+ fail("XElement.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XElement.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xElemFoo.removeChild(xComment);
+ assertEquals("XElement.removeChild(xComment)", xRemoved, xComment);
+ assertTrue("XElement.removeChild(xComment)", xElemFoo.hasChildNodes());
+ assertEquals("XElement.removeChild(xComment)",
+ xElemFooNs, xElemFoo.getFirstChild());
+ assertEquals("XElement.removeChild(xComment)",
+ xElemFooNs, xElemFoo.getLastChild());
+ }
+
+ @Test public void testXAttr() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ String ns = "http://example.com/";
+
+ XAttr xAttr = xDoc.createAttribute("foo");
+ assertNotNull("XDocument.createAttribute", xAttr);
+
+ XAttr xAttrNs = xDoc.createAttributeNS(ns, "e:foo");
+ assertNotNull("XDocument.createAttribute", xAttr);
+
+ assertTrue("XAttr.getSpecified", xAttr.getSpecified());
+
+ assertEquals("XAttr.getName()", "foo", xAttr.getName());
+
+ assertNull("XAttr.getOwnerElement()", xAttr.getOwnerElement());
+
+ XElement xElemFoo = xDoc.createElement("foo");
+ XNode xInserted = xElemFoo.appendChild(xAttr);
+ XAttr xAttrIns =
+ UnoRuntime.queryInterface(XAttr.class, xInserted);
+ assertNotNull(xAttrIns);
+ assertEquals("XAttr.getOwnerElement()",
+ xElemFoo, xAttrIns.getOwnerElement());
+
+ assertEquals("XAttr.getValue()", "", xAttr.getValue());
+
+ xAttr.setValue("bar");
+ assertEquals("XAttr.setValue()", "bar", xAttr.getValue());
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xAttrCloneN = xAttr.cloneNode(false);
+ assertNotNull("XAttr.cloneNode(false)", xAttrCloneN);
+ XAttr xAttrClone =
+ UnoRuntime.queryInterface(XAttr.class, xAttrCloneN);
+ assertNotNull("XAttr.cloneNode(false)", xAttrClone);
+ // actually the children are copied even if bDeep=false
+ // does that make sense for attributes?
+ /*
+ assertFalse("XAttr.cloneNode(false)", xAttrClone.hasChildNodes());
+ assertNull("XAttr.cloneNode(false)", xAttrClone.getFirstChild());
+ */
+ assertTrue("XAttr.cloneNode(true)", xAttrClone.hasChildNodes());
+ XNode xChild = xAttrClone.getFirstChild();
+ assertNotNull("XAttr.cloneNode(true)", xChild);
+ XText xText = UnoRuntime.queryInterface(XText.class, xChild);
+ assertNotNull("XAttr.cloneNode(true)", xText);
+ assertEquals("XAttr.cloneNode(true)", "bar", xText.getNodeValue());
+ }
+ {
+ XNode xAttrCloneN = xAttr.cloneNode(true);
+ assertNotNull("XAttr.cloneNode(true)", xAttrCloneN);
+ XAttr xAttrClone =
+ UnoRuntime.queryInterface(XAttr.class, xAttrCloneN);
+ assertNotNull("XAttr.cloneNode(true)", xAttrClone);
+ assertTrue("XAttr.cloneNode(true)", xAttrClone.hasChildNodes());
+ XNode xChild = xAttrClone.getFirstChild();
+ assertNotNull("XAttr.cloneNode(true)", xChild);
+ XText xText = UnoRuntime.queryInterface(XText.class, xChild);
+ assertNotNull("XAttr.cloneNode(true)", xText);
+ assertEquals("XAttr.cloneNode(true)", "bar", xText.getNodeValue());
+ }
+
+ assertNull("XAttr.getAttributes()", xAttr.getAttributes());
+
+ {
+ XNodeList xChildren = xAttr.getChildNodes();
+ assertTrue("XAttr.getChildNodes()", 1 == xChildren.getLength());
+ XNode xChild = xChildren.item(0);
+ assertNotNull("XAttr.getChildNodes()", xChild);
+ XText xText = UnoRuntime.queryInterface(XText.class, xChild);
+ assertNotNull("XAttr.getChildNodes()", xText);
+
+ XNode xFirst = xAttr.getFirstChild();
+ assertEquals("XAttr.getFirstChild()", xText, xFirst);
+ XNode xLast = xAttr.getLastChild();
+ assertEquals("XAttr.getLastChild()", xText, xLast);
+ }
+
+ assertEquals("XAttr.getLocalName()", "foo", xAttr.getLocalName());
+ assertEquals("XAttr.getLocalName()", "foo", xAttrNs.getLocalName());
+
+ assertEquals("XAttr.getNamespaceURI()", "", xAttr.getNamespaceURI());
+ assertEquals("XAttr.getNamespaceURI()", ns, xAttrNs.getNamespaceURI());
+
+ assertNull("XAttr.getNextSibling()", xAttr.getNextSibling());
+
+ assertEquals("XAttr.getNodeName()", "foo", xAttr.getNodeName());
+ assertEquals("XAttr.getNodeName()", "foo", xAttrNs.getNodeName());
+
+ assertTrue("XAttr.getNodeType()",
+ ATTRIBUTE_NODE == xAttr.getNodeType());
+
+ assertEquals("XAttr.getNodeValue()", "bar", xAttr.getNodeValue());
+ assertEquals("XAttr.getNodeValue()", "", xAttrNs.getNodeValue());
+
+ assertEquals("XAttr.getOwnerDocument()",
+ xDoc, xDoc.getOwnerDocument());
+
+ assertNull("XAttr.getParentNode()", xAttr.getParentNode());
+
+ assertEquals("XAttr.getPrefix()", "", xAttr.getPrefix());
+ assertEquals("XAttr.getPrefix()", "e", xAttrNs.getPrefix());
+
+ assertNull("XAttr.getPreviousSibling()", xAttr.getPreviousSibling());
+
+ assertFalse("XAttr.hasAttributes()", xAttr.hasAttributes());
+
+ assertTrue("XAttr.hasChildNodes()", xAttr.hasChildNodes());
+
+ assertFalse("XAttr.isSupported()",
+ xAttr.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xAttr.normalize();
+
+ xAttr.setNodeValue("42");
+ assertEquals("XAttr.setNodeValue()", "42", xAttr.getNodeValue());
+
+ xAttrNs.setPrefix("f");
+ assertEquals("XAttr.setPrefix()", "f", xAttrNs.getPrefix());
+
+ XText xText = xDoc.createTextNode("baz");
+ XText xTextNew = xDoc.createTextNode("quux");
+
+ try {
+ xAttr.appendChild(null);
+ fail("XAttr.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xAttr.insertBefore(null, xText);
+ fail("XAttr.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xAttr.insertBefore(xText, null);
+ fail("XAttr.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xAttr.insertBefore(xText, xText);
+ fail("XAttr.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XAttr.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xChild = xAttr.getFirstChild();
+ assertNotNull(xChild);
+
+ {
+ XNode xRet = xAttr.insertBefore(xText, xChild);
+ assertEquals("XAttr.insertBefore(xText, xChild)",
+ xRet, xChild); // why does this return the old node?
+ assertEquals("XAttr.insertBefore(xText, xChild)",
+ xText, xAttr.getFirstChild());
+ assertEquals("XAttr.insertBefore(xText, xChild)",
+ xAttr, xText.getParentNode());
+ assertEquals("XAttr.insertBefore(xText, xChild)",
+ xChild, xAttr.getLastChild());
+ }
+
+ try {
+ xAttr.replaceChild(null, xText);
+ fail("XAttr.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xAttr.replaceChild(xText, null);
+ fail("XAttr.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xAttr.replaceChild(xAttrNs, xAttrNs); // not child
+ fail("XAttr.replaceChild(xAttrNs, xAttrNs)");
+ } catch (DOMException e) {
+ assertTrue("XAttr.replaceChild(xAttrNs, xAttrNs)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xAttr.replaceChild(xChild, xChild); // child
+ assertFalse("XAttr.replaceChild(xChild, xChild)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XAttr.replaceChild(xChild, xChild)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xAttr.replaceChild(xTextNew, xChild);
+ assertEquals("XAttr.replaceChild(xTextNew, xChild)", xChild, xReplaced);
+ assertEquals("XAttr.replaceChild(xTextNew, xChild)",
+ xText, xAttr.getFirstChild());
+ assertEquals("XAttr.replaceChild(xTextNew, xChild)",
+ xTextNew, xAttr.getLastChild());
+
+ try {
+ xAttr.removeChild(null);
+ fail("XAttr.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xAttr.removeChild(xAttrNs);
+ fail("XAttr.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XAttr.removeChild()", HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xAttr.removeChild(xTextNew);
+ assertEquals("XAttr.removeChild(xText)", xRemoved, xTextNew);
+ assertTrue("XAttr.removeChild(xText)", xAttr.hasChildNodes());
+ assertEquals("XAttr.removeChild(xText)",
+ xText, xAttr.getFirstChild());
+ assertEquals("XAttr.removeChild(xText)",
+ xText, xAttr.getLastChild());
+ }
+
+ @Test public void testXText() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XText xText = xDoc.createTextNode("foobar");
+ assertNotNull(xText);
+
+ assertEquals("XText.getData", "foobar", xText.getData());
+ assertEquals("XText.getLength", 6, xText.getLength());
+
+ /* FIXME
+ try {
+ xText.splitText(9999);
+ fail("XText.splitText(9999)");
+ } catch (DOMException e) {
+ assertTrue("XText.splitText(9999)", INDEX_SIZE_ERR == e.Code);
+ }
+
+ {
+ XText xTextBar = xText.splitText(2);
+ assertNotNull("XText.splitText", xTextBar);
+ assertEquals("XText.splitText", "foo", xText.getData());
+ assertEquals("XText.splitText", "bar", xTextBar.getData());
+ }
+ */
+ xText.setData("foo");
+
+ xText.appendData("baz");
+ assertEquals("XText.appendData", "foobaz", xText.getData());
+
+ try {
+ xText.deleteData(999,999);
+ fail("XText.deleteData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XText.deleteData(999,999)", INDEX_SIZE_ERR == e.Code);
+ }
+ xText.deleteData(0, 3);
+ assertEquals("XText.deleteData", "baz", xText.getData());
+
+ try {
+ xText.insertData(999,"blah");
+ fail("XText.insertData(999,\"blah\")");
+ } catch (DOMException e) {
+ assertTrue("XText.insertData(999,\"blah\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xText.insertData(1, "arb");
+ assertEquals("XText.insertData", "barbaz", xText.getData());
+
+ try {
+ xText.replaceData(999,999,"x");
+ fail("XText.replaceData(999,999,\"x\")");
+ } catch (DOMException e) {
+ assertTrue("XText.replaceData(999,999,\"x\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xText.replaceData(3, 3, "foo");
+ assertEquals("XText.replaceData", "barfoo", xText.getData());
+
+ xText.setData("quux");
+ assertEquals("XText.setData", "quux", xText.getData());
+
+ try {
+ xText.subStringData(999,999);
+ fail("XText.subStringData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XText.subStringData(999,999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ assertEquals("XText.subStringData", "x", xText.subStringData(3, 1));
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xTextCloneN = xText.cloneNode(false);
+ assertNotNull("XText.cloneNode(false)", xTextCloneN);
+ XText xTextClone =
+ UnoRuntime.queryInterface(XText.class, xTextCloneN);
+ assertNotNull("XText.cloneNode(false)", xTextClone);
+ assertFalse("XText.cloneNode(false)",
+ xTextClone.hasChildNodes());
+ }
+ {
+ XNode xTextCloneN = xText.cloneNode(true);
+ assertNotNull("XText.cloneNode(true)", xTextCloneN);
+ XText xTextClone =
+ UnoRuntime.queryInterface(XText.class, xTextCloneN);
+ assertNotNull("XText.cloneNode(true)", xTextClone);
+ assertFalse("XText.cloneNode(true)", xTextClone.hasChildNodes());
+ }
+
+ assertNull("XText.getAttributes()", xText.getAttributes());
+
+ {
+ XNodeList xChildren = xText.getChildNodes();
+ assertTrue("XText.getChildNodes()", 0 == xChildren.getLength());
+ }
+
+ assertEquals("XText.getLocalName()", "", xText.getLocalName());
+
+ assertEquals("XText.getNamespaceURI()", "", xText.getNamespaceURI());
+
+ assertNull("XText.getNextSibling()", xText.getNextSibling());
+
+ assertEquals("XText.getNodeName()", "#text", xText.getNodeName());
+
+ assertTrue("XText.getNodeType()",
+ TEXT_NODE == xText.getNodeType());
+
+ assertEquals("XText.getNodeValue()", "quux", xText.getNodeValue());
+
+ assertEquals("XText.getOwnerDocument()",
+ xDoc, xText.getOwnerDocument());
+
+ assertNull("XText.getParentNode()", xText.getParentNode());
+
+ assertEquals("XText.getPrefix()", "", xText.getPrefix());
+
+ assertNull("XText.getPreviousSibling()", xText.getPreviousSibling());
+
+ assertFalse("XText.hasAttributes()", xText.hasAttributes());
+
+ assertFalse("XText.hasChildNodes()", xText.hasChildNodes());
+
+ assertFalse("XText.isSupported()",
+ xText.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xText.normalize();
+
+ xText.setNodeValue("42");
+ assertEquals("XText.setNodeValue()", "42", xText.getNodeValue());
+
+ try {
+ xText.setPrefix("foo");
+ fail("XText.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XText.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ XText xText2 = xDoc.createTextNode("foobar");
+ XText xText3 = xDoc.createTextNode("foobar");
+
+ try {
+ xText.appendChild(null);
+ fail("XText.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xText.appendChild(xText2);
+ fail("XText.appendChild(xText2)");
+ } catch (DOMException e) {
+ assertTrue("XText.appendChild(xText2)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ try {
+ xText.insertBefore(xText2, xText3);
+ fail("XText.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xText.replaceChild(xText2, xText3);
+ fail("XText.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xText.removeChild(null);
+ fail("XText.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xText.removeChild(xText2);
+ fail("XText.removeChild");
+ } catch (DOMException e) {
+ assertTrue("XText.removeChild", HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ }
+
+ @Test public void testXCDataSection() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XCDATASection xCDS = xDoc.createCDATASection("foobar");
+ assertNotNull(xCDS);
+
+ assertEquals("XCDATASection.getData", "foobar", xCDS.getData());
+ assertEquals("XCDATASection.getLength", 6, xCDS.getLength());
+
+ /* FIXME
+ try {
+ xCDS.splitText(9999);
+ fail("XCDATASection.splitText(9999)");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.splitText(9999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+
+ {
+ XCDATASection xCDSBar = xCDS.splitText(2);
+ assertNotNull("XCDATASection.splitText", xCDSBar);
+ assertEquals("XCDATASection.splitText", "foo", xCDS.getData());
+ assertEquals("XCDATASection.splitText", "bar", xCDSBar.getData());
+ }
+ */
+ xCDS.setData("foo");
+
+ xCDS.appendData("baz");
+ assertEquals("XCDATASection.appendData", "foobaz", xCDS.getData());
+
+ try {
+ xCDS.deleteData(999,999);
+ fail("XCDATASection.deleteData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.deleteData(999,999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xCDS.deleteData(0, 3);
+ assertEquals("XCDATASection.deleteData", "baz", xCDS.getData());
+
+ try {
+ xCDS.insertData(999,"blah");
+ fail("XCDATASection.insertData(999,\"blah\")");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.insertData(999,\"blah\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xCDS.insertData(1, "arb");
+ assertEquals("XCDATASection.insertData", "barbaz", xCDS.getData());
+
+ try {
+ xCDS.replaceData(999,999,"x");
+ fail("XCDATASection.replaceData(999,999,\"x\")");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.replaceData(999,999,\"x\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xCDS.replaceData(3, 3, "foo");
+ assertEquals("XCDATASection.replaceData", "barfoo", xCDS.getData());
+
+ xCDS.setData("quux");
+ assertEquals("XCDATASection.setData", "quux", xCDS.getData());
+
+ try {
+ xCDS.subStringData(999,999);
+ fail("XCDATASection.subStringData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.subStringData(999,999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ assertEquals("XCDATASection.subStringData", "x",
+ xCDS.subStringData(3, 1));
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xCDSCloneN = xCDS.cloneNode(false);
+ assertNotNull("XCDATASection.cloneNode(false)", xCDSCloneN);
+ XCDATASection xCDSClone =
+ UnoRuntime.queryInterface(XCDATASection.class, xCDSCloneN);
+ assertNotNull("XCDATASection.cloneNode(false)", xCDSClone);
+ assertFalse("XCDATASection.cloneNode(false)",
+ xCDSClone.hasChildNodes());
+ }
+ {
+ XNode xCDSCloneN = xCDS.cloneNode(true);
+ assertNotNull("XCDATASection.cloneNode(true)", xCDSCloneN);
+ XCDATASection xCDSClone =
+ UnoRuntime.queryInterface(XCDATASection.class, xCDSCloneN);
+ assertNotNull("XCDATASection.cloneNode(true)", xCDSClone);
+ assertFalse("XCDATASection.cloneNode(true)",
+ xCDSClone.hasChildNodes());
+ }
+
+ assertNull("XCDATASection.getAttributes()", xCDS.getAttributes());
+
+ {
+ XNodeList xChildren = xCDS.getChildNodes();
+ assertTrue("XCDATASection.getChildNodes()",
+ 0 == xChildren.getLength());
+ }
+
+ assertEquals("XCDATASection.getLocalName()", "", xCDS.getLocalName());
+
+ assertEquals("XCDATASection.getNamespaceURI()", "",
+ xCDS.getNamespaceURI());
+
+ assertNull("XCDATASection.getNextSibling()", xCDS.getNextSibling());
+
+ assertEquals("XCDATASection.getNodeName()", "#cdata-section",
+ xCDS.getNodeName());
+
+ assertTrue("XCDATASection.getNodeType()",
+ CDATA_SECTION_NODE == xCDS.getNodeType());
+
+ assertEquals("XCDATASection.getNodeValue()", "quux",
+ xCDS.getNodeValue());
+
+ assertEquals("XCDATASection.getOwnerDocument()",
+ xDoc, xCDS.getOwnerDocument());
+
+ assertNull("XCDATASection.getParentNode()", xCDS.getParentNode());
+
+ assertEquals("XCDATASection.getPrefix()", "", xCDS.getPrefix());
+
+ assertNull("XCDATASection.getPreviousSibling()",
+ xCDS.getPreviousSibling());
+
+ assertFalse("XCDATASection.hasAttributes()", xCDS.hasAttributes());
+
+ assertFalse("XCDATASection.hasChildNodes()", xCDS.hasChildNodes());
+
+ assertFalse("XCDATASection.isSupported()",
+ xCDS.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xCDS.normalize();
+
+ xCDS.setNodeValue("42");
+ assertEquals("XCDATASection.setNodeValue()", "42", xCDS.getNodeValue());
+
+ try {
+ xCDS.setPrefix("foo");
+ fail("XCDATASection.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ XCDATASection xCDS2 = xDoc.createCDATASection("foobar");
+ XCDATASection xCDS3 = xDoc.createCDATASection("foobar");
+
+ try {
+ xCDS.appendChild(null);
+ fail("XCDATASection.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xCDS.appendChild(xCDS2);
+ fail("XCDATASection.appendChild(xCDS2)");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.appendChild(xCDS2)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ try {
+ xCDS.insertBefore(xCDS2, xCDS3);
+ fail("XCDATASection.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xCDS.replaceChild(xCDS2, xCDS3);
+ fail("XCDATASection.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xCDS.removeChild(null);
+ fail("XCDATASection.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xCDS.removeChild(xCDS2);
+ fail("XCDATASection.removeChild");
+ } catch (DOMException e) {
+ assertTrue("XCDATASection.removeChild",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ }
+
+ @Test public void testXComment() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XComment xComment = xDoc.createComment("foo");
+ assertNotNull(xComment);
+
+ assertEquals("XComment.getData", "foo", xComment.getData());
+ assertEquals("XComment.getLength", 3, xComment.getLength());
+
+ xComment.appendData("baz");
+ assertEquals("XComment.appendData", "foobaz", xComment.getData());
+
+ try {
+ xComment.deleteData(999,999);
+ fail("XComment.deleteData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XComment.deleteData(999,999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xComment.deleteData(0, 3);
+ assertEquals("XComment.deleteData", "baz", xComment.getData());
+
+ try {
+ xComment.insertData(999,"blah");
+ fail("XComment.insertData(999,\"blah\")");
+ } catch (DOMException e) {
+ assertTrue("XComment.insertData(999,\"blah\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xComment.insertData(1, "arb");
+ assertEquals("XComment.insertData", "barbaz", xComment.getData());
+
+ try {
+ xComment.replaceData(999,999,"x");
+ fail("XComment.replaceData(999,999,\"x\")");
+ } catch (DOMException e) {
+ assertTrue("XComment.replaceData(999,999,\"x\")",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ xComment.replaceData(3, 3, "foo");
+ assertEquals("XComment.replaceData", "barfoo", xComment.getData());
+
+ xComment.setData("quux");
+ assertEquals("XComment.setData", "quux", xComment.getData());
+
+ try {
+ xComment.subStringData(999,999);
+ fail("XComment.subStringData(999,999)");
+ } catch (DOMException e) {
+ assertTrue("XComment.subStringData(999,999)",
+ INDEX_SIZE_ERR == e.Code);
+ }
+ assertEquals("XComment.subStringData", "x",
+ xComment.subStringData(3, 1));
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xCommentCloneN = xComment.cloneNode(false);
+ assertNotNull("XComment.cloneNode(false)", xCommentCloneN);
+ XComment xCommentClone =
+ UnoRuntime.queryInterface(XComment.class, xCommentCloneN);
+ assertNotNull("XComment.cloneNode(false)", xCommentClone);
+ assertFalse("XComment.cloneNode(false)",
+ xCommentClone.hasChildNodes());
+ }
+ {
+ XNode xCommentCloneN = xComment.cloneNode(true);
+ assertNotNull("XComment.cloneNode(true)", xCommentCloneN);
+ XComment xCommentClone =
+ UnoRuntime.queryInterface(XComment.class, xCommentCloneN);
+ assertNotNull("XComment.cloneNode(true)", xCommentClone);
+ assertFalse("XComment.cloneNode(true)",
+ xCommentClone.hasChildNodes());
+ }
+
+ assertNull("XComment.getAttributes()", xComment.getAttributes());
+
+ {
+ XNodeList xChildren = xComment.getChildNodes();
+ assertTrue("XComment.getChildNodes()", 0 == xChildren.getLength());
+ }
+
+ assertEquals("XComment.getLocalName()", "", xComment.getLocalName());
+
+ assertEquals("XComment.getNamespaceURI()", "",
+ xComment.getNamespaceURI());
+
+ assertNull("XComment.getNextSibling()", xComment.getNextSibling());
+
+ assertEquals("XComment.getNodeName()", "#comment",
+ xComment.getNodeName());
+
+ assertTrue("XComment.getNodeType()",
+ COMMENT_NODE == xComment.getNodeType());
+
+ assertEquals("XComment.getNodeValue()", "quux",
+ xComment.getNodeValue());
+
+ assertEquals("XComment.getOwnerDocument()",
+ xDoc, xComment.getOwnerDocument());
+
+ assertNull("XComment.getParentNode()", xComment.getParentNode());
+
+ assertEquals("XComment.getPrefix()", "", xComment.getPrefix());
+
+ assertNull("XComment.getPreviousSibling()",
+ xComment.getPreviousSibling());
+
+ assertFalse("XComment.hasAttributes()", xComment.hasAttributes());
+
+ assertFalse("XComment.hasChildNodes()", xComment.hasChildNodes());
+
+ assertFalse("XComment.isSupported()",
+ xComment.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xComment.normalize();
+
+ xComment.setNodeValue("42");
+ assertEquals("XComment.setNodeValue()", "42", xComment.getNodeValue());
+
+ try {
+ xComment.setPrefix("foo");
+ fail("XComment.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XComment.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ XComment xComment2 = xDoc.createComment("foobar");
+ XComment xComment3 = xDoc.createComment("foobar");
+
+ try {
+ xComment.appendChild(null);
+ fail("XComment.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xComment.appendChild(xComment2);
+ fail("XComment.appendChild(xComment2)");
+ } catch (DOMException e) {
+ assertTrue("XComment.appendChild(xComment2)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ try {
+ xComment.insertBefore(xComment2, xComment3);
+ fail("XComment.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xComment.replaceChild(xComment2, xComment3);
+ fail("XComment.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xComment.removeChild(null);
+ fail("XComment.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xComment.removeChild(xComment2);
+ fail("XComment.removeChild");
+ } catch (DOMException e) {
+ assertTrue("XComment.removeChild", HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ }
+
+ @Test public void testXEntityReference() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XEntityReference xER = xDoc.createEntityReference("foobar");
+ assertNotNull(xER);
+
+ XEntityReference xERChild = xDoc.createEntityReference("baz");
+ assertNotNull(xERChild);
+
+ xER.appendChild(xERChild);
+
+ // XNode ////////////////////////////////////////////////////
+
+ XText xText = xDoc.createTextNode("foo");
+ XComment xComment = xDoc.createComment("foo");
+
+ {
+ XNode xERCloneN = xER.cloneNode(false);
+ assertNotNull("XEntityReference.cloneNode(false)", xERCloneN);
+ XEntityReference xERClone =
+ UnoRuntime.queryInterface(XEntityReference.class, xERCloneN);
+ assertNotNull("XEntityReference.cloneNode(false)", xERClone);
+ assertFalse("XEntityReference.cloneNode(false)",
+ xERClone.hasChildNodes());
+ assertNull("XEntityReference.cloneNode(false)",
+ xERClone.getFirstChild());
+ }
+ {
+ XNode xERCloneN = xER.cloneNode(true);
+ assertNotNull("XEntityReference.cloneNode(true)", xERCloneN);
+ XEntityReference xERClone =
+ UnoRuntime.queryInterface(XEntityReference.class, xERCloneN);
+ assertNotNull("XEntityReference.cloneNode(true)", xERClone);
+ /* FIXME this is actually in libxml2: children are not copied
+ assertTrue("XEntityReference.cloneNode(true)",
+ xERClone.hasChildNodes());
+ XNode xChild = xERClone.getFirstChild();
+ assertNotNull("XEntityReference.cloneNode(true)", xChild);
+ XEntityReference xChildER =
+ UnoRuntime.queryInterface(XEntityReference.class, xChild);
+ assertNotNull("XEntityReference.cloneNode(true)", xChildER);
+ assertFalse("XEntityReference.cloneNode(true)",
+ xChildER.equals(xERChild));
+ assertEquals("XEntityReference.cloneNode(true)",
+ "baz", xChildER.getLocalName());
+ */
+ }
+
+ assertNull("XEntityReference.getAttributes()", xER.getAttributes());
+
+ {
+ XNodeList xChildren = xER.getChildNodes();
+ assertTrue("XEntityReference.getChildNodes()",
+ 1 == xChildren.getLength());
+ assertEquals("XEntityReference.getChildNodes()",
+ xERChild, xChildren.item(0));
+
+ XNode xFirst = xER.getFirstChild();
+ assertEquals("XEntityReference.getFirstChild()",
+ xERChild, xFirst);
+ XNode xLast = xER.getLastChild();
+ assertEquals("XEntityReference.getLastChild()", xERChild, xLast);
+ }
+
+ assertEquals("XEntityReference.getLocalName()", "", xER.getLocalName());
+
+ assertEquals("XEntityReference.getNamespaceURI()", "",
+ xER.getNamespaceURI());
+
+ assertNull("XEntityReference.getNextSibling()", xER.getNextSibling());
+
+ assertEquals("XEntityReference.getNodeName()",
+ "foobar", xER.getNodeName());
+
+ assertTrue("XEntityReference.getNodeType()",
+ ENTITY_REFERENCE_NODE == xER.getNodeType());
+
+ assertEquals("XEntityReference.getNodeValue()", "", xER.getNodeValue());
+
+ assertEquals("XEntityReference.getOwnerDocument()",
+ xDoc, xER.getOwnerDocument());
+
+ assertNull("XEntityReference.getParentNode()", xER.getParentNode());
+
+ assertEquals("XEntityReference.getPrefix()", "", xER.getPrefix());
+
+ assertNull("XEntityReference.getPreviousSibling()",
+ xER.getPreviousSibling());
+
+ assertFalse("XEntityReference.hasAttributes()", xER.hasAttributes());
+
+ assertTrue("XEntityReference.hasChildNodes()", xER.hasChildNodes());
+
+ assertFalse("XEntityReference.isSupported()",
+ xER.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xER.normalize();
+
+ try {
+ xER.setNodeValue("42");
+ fail("XEntityReference.setNodeValue()");
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.setNodeValue()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xER.setPrefix("foo");
+ fail("XEntityReference.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ try {
+ xER.appendChild(null);
+ fail("XEntityReference.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xER.insertBefore(null, xText);
+ fail("XEntityReference.insertBefore(null,)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xER.insertBefore(xText, null);
+ fail("XEntityReference.insertBefore(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xER.insertBefore(xText, xText);
+ fail("XEntityReference.insertBefore(x, x)");
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.insertBefore(x, x)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ {
+ XNode xRet = xER.insertBefore(xComment, xERChild);
+ assertEquals("XEntityReference.insertBefore(xComment, xERChild)",
+ xRet, xERChild); // why does this return the old node?
+ assertEquals("XEntityReference.insertBefore(xComment, xERChild)",
+ xComment, xER.getFirstChild());
+ assertEquals("XEntityReference.insertBefore(xComment, xERChild)",
+ xER, xComment.getParentNode());
+ assertEquals("XEntityReference.insertBefore(xCommnet, xERChild)",
+ xERChild, xER.getLastChild());
+ }
+
+ try {
+ xER.replaceChild(null, xText);
+ fail("XEntityReference.replaceChild(null, )");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xER.replaceChild(xText, null);
+ fail("XEntityReference.replaceChild(, null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xER.replaceChild(xText, xText); // not child
+ fail("XEntityReference.replaceChild(xElemFoo, xElemFoo)");
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.replaceChild(xElemFoo, xElemFoo)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ try {
+ xER.replaceChild(xERChild, xERChild); // child
+ assertFalse("XEntityReference.replaceChild(xERChild, xERChild)",
+ false);
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.replaceChild(xERChild, xERChild)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ XNode xReplaced = xER.replaceChild(xText, xComment);
+ assertEquals("XEntityReference.replaceChild(xText, xComment)",
+ xReplaced, xComment);
+ assertEquals("XEntityReference.replaceChild(xText, xComment)",
+ xText, xER.getFirstChild());
+ assertEquals("XEntityReference.replaceChild(xText, xComment)",
+ xERChild, xER.getLastChild());
+
+ try {
+ xER.removeChild(null);
+ fail("XEntityReference.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xER.removeChild(xER);
+ fail("XEntityReference.removeChild()");
+ } catch (DOMException e) {
+ assertTrue("XEntityReference.removeChild()",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ XNode xRemoved = xER.removeChild(xText);
+ assertEquals("XEntityReference.removeChild(xText)", xRemoved, xText);
+ assertTrue("XEntityReference.removeChild(xText)", xER.hasChildNodes());
+ assertEquals("XEntityReference.removeChild(xText)",
+ xERChild, xER.getFirstChild());
+ assertEquals("XEntityReference.removeChild(xText)",
+ xERChild, xER.getLastChild());
+ }
+
+ @Test public void testXProcessingInstruction() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XProcessingInstruction xPI =
+ xDoc.createProcessingInstruction("foo", "bar");
+ assertNotNull(xPI);
+
+ assertEquals("XProcessingInstruction.getTarget",
+ "foo", xPI.getTarget());
+
+ assertEquals("XProcessingInstruction.getData", "bar", xPI.getData());
+
+ xPI.setData("baz");
+ assertEquals("XProcessingInstruction.setData", "baz", xPI.getData());
+
+ // XNode ////////////////////////////////////////////////////
+
+ {
+ XNode xPICloneN = xPI.cloneNode(false);
+ assertNotNull("XProcessingInstruction.cloneNode(false)", xPICloneN);
+ XProcessingInstruction xPIClone = UnoRuntime.queryInterface(
+ XProcessingInstruction.class, xPICloneN);
+ assertNotNull("XProcessingInstruction.cloneNode(false)", xPIClone);
+ assertFalse("XProcessingInstruction.cloneNode(false)",
+ xPIClone.hasChildNodes());
+ }
+ {
+ XNode xPICloneN = xPI.cloneNode(true);
+ assertNotNull("XProcessingInstruction.cloneNode(true)", xPICloneN);
+ XProcessingInstruction xPIClone = UnoRuntime.queryInterface(
+ XProcessingInstruction.class, xPICloneN);
+ assertNotNull("XProcessingInstruction.cloneNode(true)", xPIClone);
+ assertFalse("XProcessingInstruction.cloneNode(true)",
+ xPIClone.hasChildNodes());
+ }
+
+ assertNull("XProcessingInstruction.getAttributes()",
+ xPI.getAttributes());
+
+ {
+ XNodeList xChildren = xPI.getChildNodes();
+ assertTrue("XProcessingInstruction.getChildNodes()",
+ 0 == xChildren.getLength());
+ }
+
+ assertEquals("XProcessingInstruction.getLocalName()",
+ "", xPI.getLocalName());
+
+ assertEquals("XProcessingInstruction.getNamespaceURI()",
+ "", xPI.getNamespaceURI());
+
+ assertNull("XProcessingInstruction.getNextSibling()",
+ xPI.getNextSibling());
+
+ assertEquals("XProcessingInstruction.getNodeName()",
+ "foo", xPI.getNodeName());
+
+ assertTrue("XProcessingInstruction.getNodeType()",
+ PROCESSING_INSTRUCTION_NODE == xPI.getNodeType());
+
+ assertEquals("XProcessingInstruction.getNodeValue()",
+ "baz", xPI.getNodeValue());
+
+ assertEquals("XProcessingInstruction.getOwnerDocument()",
+ xDoc, xPI.getOwnerDocument());
+
+ assertNull("XProcessingInstruction.getParentNode()",
+ xPI.getParentNode());
+
+ assertEquals("XProcessingInstruction.getPrefix()", "", xPI.getPrefix());
+
+ assertNull("XProcessingInstruction.getPreviousSibling()",
+ xPI.getPreviousSibling());
+
+ assertFalse("XProcessingInstruction.hasAttributes()",
+ xPI.hasAttributes());
+
+ assertFalse("XProcessingInstruction.hasChildNodes()",
+ xPI.hasChildNodes());
+
+ assertFalse("XProcessingInstruction.isSupported()",
+ xPI.isSupported("frobnication", "v99.33.0.0.0.1"));
+
+ xPI.normalize();
+
+ xPI.setNodeValue("42");
+ assertEquals("XProcessingInstruction.setNodeValue()",
+ "42", xPI.getNodeValue());
+
+ try {
+ xPI.setPrefix("foo");
+ fail("XProcessingInstruction.setPrefix()");
+ } catch (DOMException e) {
+ assertTrue("XProcessingInstruction.setPrefix()",
+ NO_MODIFICATION_ALLOWED_ERR == e.Code);
+ }
+
+ XText xText2 = xDoc.createTextNode("foobar");
+ XText xText3 = xDoc.createTextNode("foobar");
+
+ try {
+ xPI.appendChild(null);
+ fail("XProcessingInstruction.appendChild(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xPI.appendChild(xText2);
+ fail("XProcessingInstruction.appendChild(xText2)");
+ } catch (DOMException e) {
+ assertTrue("XProcessingInstruction.appendChild(xText2)",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+
+ try {
+ xPI.insertBefore(xText2, xText3);
+ fail("XProcessingInstruction.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xPI.replaceChild(xText2, xText3);
+ fail("XProcessingInstruction.insertBefore");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xPI.removeChild(null);
+ fail("XProcessingInstruction.removeChild(null)");
+ } catch (Exception e) { /* expected */ }
+
+ try {
+ xPI.removeChild(xText2);
+ fail("XProcessingInstruction.removeChild");
+ } catch (DOMException e) {
+ assertTrue("XProcessingInstruction.removeChild",
+ HIERARCHY_REQUEST_ERR == e.Code);
+ }
+ }
+
+ /*
+ @Test public void testXEntity() throws Exception
+ {
+ XEntity xEntity = FIXME how to get at this shy creature?
+ }
+ */
+
+ /*
+ @Test public void testXNotation() throws Exception
+ {
+ XNotation xNotation = FIXME how to create?
+ }
+ */
+
+ /*
+ @Test public void testXDocumentType() throws Exception
+ {
+ XDocumentType xDT = FIXME how to create?
+ }
+ */
+
+ @Test public void testXNodeList_ChildList() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XElement xRoot = xDoc.createElement("root");
+ XElement xFoo = xDoc.createElement("foo");
+ XElement xBar = xDoc.createElement("bar");
+ XElement xBaz = xDoc.createElement("baz");
+
+ xDoc.appendChild(xRoot);
+
+ XNodeList xChildList = xRoot.getChildNodes();
+ assertNotNull(xChildList);
+ assertSame("ChildList.getLength()", 0, xChildList.getLength());
+
+ try {
+ xChildList.item(4);
+ } catch (Exception e) { /* expected */ }
+
+ xRoot.appendChild(xFoo);
+ assertSame("ChildList.getLength()", 1, xChildList.getLength());
+ assertEquals("ChildList.item", xFoo, xChildList.item(0));
+
+ xRoot.appendChild(xBar);
+ assertSame("ChildList.getLength()", 2, xChildList.getLength());
+ assertEquals("ChildList.item", xFoo, xChildList.item(0));
+ assertEquals("ChildList.item", xBar, xChildList.item(1));
+
+ xRoot.appendChild(xBaz);
+ assertSame("ChildList.getLength()", 3, xChildList.getLength());
+ assertEquals("ChildList.item", xFoo, xChildList.item(0));
+ assertEquals("ChildList.item", xBar, xChildList.item(1));
+ assertEquals("ChildList.item", xBaz, xChildList.item(2));
+
+ xRoot.removeChild(xBar);
+ assertSame("ChildList.getLength()", 2, xChildList.getLength());
+ assertEquals("ChildList.item", xFoo, xChildList.item(0));
+ assertEquals("ChildList.item", xBaz, xChildList.item(1));
+ }
+
+ @Test public void testXNodeList_ElementList() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ XElement xRoot = xDoc.createElement("root");
+ XElement xBar = xDoc.createElement("bar");
+ XElement xFoo1 = xDoc.createElement("foo");
+ XElement xFoo2 = xDoc.createElement("foo");
+ XElement xFoo3 = xDoc.createElement("foo");
+
+ xDoc.appendChild(xRoot);
+
+ XNodeList xElementList = xRoot.getElementsByTagName("foo");
+ assertNotNull(xElementList);
+ assertSame("ElementList.getLength()", 0, xElementList.getLength());
+
+ try {
+ xElementList.item(4);
+ } catch (Exception e) { /* expected */ }
+
+ xRoot.appendChild(xFoo1);
+ assertSame("ElementList.getLength()", 1, xElementList.getLength());
+ assertEquals("ElementList.item", xFoo1, xElementList.item(0));
+
+ xFoo1.appendChild(xBar);
+ assertSame("ElementList.getLength()", 1, xElementList.getLength());
+ assertEquals("ElementList.item", xFoo1, xElementList.item(0));
+
+ xRoot.appendChild(xFoo3);
+ assertSame("ElementList.getLength()", 2, xElementList.getLength());
+ assertEquals("ElementList.item", xFoo1, xElementList.item(0));
+ assertEquals("ElementList.item", xFoo3, xElementList.item(1));
+
+ xBar.appendChild(xFoo2);
+ assertSame("ElementList.getLength()", 3, xElementList.getLength());
+ assertEquals("ElementList.item", xFoo1, xElementList.item(0));
+ assertEquals("ElementList.item", xFoo2, xElementList.item(1));
+ assertEquals("ElementList.item", xFoo3, xElementList.item(2));
+
+ xRoot.removeChild(xFoo1);
+ assertSame("ElementList.getLength()", 1, xElementList.getLength());
+ assertEquals("ElementList.item", xFoo3, xElementList.item(0));
+ }
+
+ @Test public void testXNamedNodeMap_AttributesMap() throws Exception
+ {
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+ XDocument xDoc = xBuilder.newDocument();
+
+ String ns = "http://example.com/";
+
+ XElement xElem = xDoc.createElement("foo");
+
+ XNamedNodeMap xAttributes = xElem.getAttributes();
+ assertNotNull(xAttributes);
+ assertSame("AttributesMap.getLength()", 0, xAttributes.getLength());
+
+ try {
+ xAttributes.item(4);
+ } catch (Exception e) { /* expected */ }
+
+ xElem.setAttribute("bar", "42");
+ XAttr xAttrBar = xElem.getAttributeNode("bar");
+ assertSame("AttributesMap.getLength()", 1, xAttributes.getLength());
+ assertEquals("AttributesMap.item", xAttrBar, xAttributes.item(0));
+ assertEquals("AttributesMap.getNamedItem",
+ xAttrBar, xAttributes.getNamedItem("bar"));
+
+ xElem.setAttributeNS(ns, "n:bar", "43");
+ XAttr xAttrBarNs = xElem.getAttributeNodeNS(ns, "bar");
+ assertSame("AttributesMap.getLength()", 2, xAttributes.getLength());
+ assertEquals("AttributesMap.item", xAttrBar, xAttributes.item(0));
+ assertEquals("AttributesMap.item", xAttrBarNs, xAttributes.item(1));
+ assertEquals("AttributesMap.getNamedItem",
+ xAttrBar, xAttributes.getNamedItem("bar"));
+ assertEquals("AttributesMap.getNamedItemNS",
+ xAttrBarNs, xAttributes.getNamedItemNS(ns, "bar"));
+
+ XNode xAttrBarNsRem = xAttributes.removeNamedItemNS(ns, "bar");
+ assertSame("AttributesMap.getLength()", 1, xAttributes.getLength());
+ assertEquals("AttributesMap.removeNamedItemNS",
+ xAttrBar, xAttributes.item(0));
+ assertEquals("AttributesMap.removeNamedItemNS",
+ xAttrBar, xAttributes.getNamedItem("bar"));
+ assertNull("AttributesMap.removeNamedItemNS",
+ xAttrBarNsRem.getParentNode());
+
+ XNode xAttrBarRem = xAttributes.removeNamedItem("bar");
+ assertSame("AttributesMap.getLength()", 0, xAttributes.getLength());
+ assertNull("AttributesMap.removeNamedItem",
+ xAttrBarRem.getParentNode());
+
+ XNode xAttrBarSetN = xAttributes.setNamedItem(xAttrBarRem);
+ assertNotNull("AttributesMap.setNamedItem", xAttrBarSetN);
+ XAttr xAttrBarSet =
+ UnoRuntime.queryInterface(XAttr.class, xAttrBarSetN);
+ assertNotNull("AttributesMap.setNamedItem", xAttrBarSet);
+ assertEquals("AttributesMap.setNamedItem",
+ xAttrBarSet, xAttributes.getNamedItem("bar"));
+
+ XNode xAttrBarNsSetN = xAttributes.setNamedItemNS(xAttrBarNsRem);
+ assertNotNull("AttributesMap.setNamedItemNS", xAttrBarNsSetN);
+ XAttr xAttrBarNsSet =
+ UnoRuntime.queryInterface(XAttr.class, xAttrBarNsSetN);
+ assertNotNull("AttributesMap.setNamedItemNS", xAttrBarNsSet);
+ assertEquals("AttributesMap.setNamedItemNS",
+ xAttrBarNsSet, xAttributes.getNamedItemNS(ns, "bar"));
+ assertSame("AttributesMap.getLength()", 2, xAttributes.getLength());
+ }
+
+ /*
+ @Test public void testXNamedNodeMap_EntitiesMap() throws Exception
+ {
+ XNamedNodeMap xEntities = FIXME
+ }
+ */
+
+ /*
+ @Test public void testXNamedNodeMap_NotationsMap() throws Exception
+ {
+ XNamedNodeMap xNotations = FIXME
+ }
+ */
+
+ @Test public void testXXPathAPI() throws Exception
+ {
+ XXPathAPI xXPathAPI =
+ UnoRuntime.queryInterface(XXPathAPI.class,
+ m_xMSF.createInstance("com.sun.star.xml.xpath.XPathAPI"));
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+
+ String ns = "http://example.com/";
+
+ XDocument xDoc = xBuilder.newDocument();
+
+ XElement xRoot = xDoc.createElement("root");
+
+ XElement xFoo1 = xDoc.createElement("foo");
+ XElement xFoo2 = xDoc.createElement("foo");
+ XElement xFooNs = xDoc.createElementNS(ns, "ns:foo");
+ XElement xBar = xDoc.createElement("bar");
+
+ xDoc.appendChild(xRoot);
+ xRoot.appendChild(xFoo1);
+ xFoo1.appendChild(xBar);
+ xBar.appendChild(xFoo2);
+ xRoot.appendChild(xFooNs);
+
+ try {
+ xXPathAPI.eval(xRoot, "~/-$+&#_");
+ fail("XXPathAPI.eval");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.evalNS(xRoot, "~/-$+&#_", xRoot);
+ fail("XXPathAPI.evalNS");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.selectNodeList(xRoot, "~/-$+&#_");
+ fail("XXPathAPI.selectNodeList");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.selectNodeListNS(xRoot, "~/-$+&#_", xRoot);
+ fail("XXPathAPI.selectNodeListNS");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.selectSingleNode(xRoot, "~/-$+&#_");
+ fail("XXPathAPI.selectSingleNode");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.selectSingleNodeNS(xRoot, "~/-$+&#_", xRoot);
+ fail("XXPathAPI.selectSingleNodeNS");
+ } catch (XPathException e) { /* expected */ }
+ try {
+ xXPathAPI.eval(null, "child::foo");
+ fail("XXPathAPI.eval(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xXPathAPI.evalNS(null, "child::foo", xRoot);
+ fail("XXPathAPI.evalNS(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xXPathAPI.selectNodeList(null, "child::foo");
+ fail("XXPathAPI.selectNodeList(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xXPathAPI.selectNodeListNS(null, "child::foo", xRoot);
+ fail("XXPathAPI.selectNodeListNS(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xXPathAPI.selectSingleNode(null, "child::foo");
+ fail("XXPathAPI.selectSingleNode(null)");
+ } catch (Exception e) { /* expected */ }
+ try {
+ xXPathAPI.selectSingleNodeNS(null, "child::foo", xRoot);
+ fail("XXPathAPI.selectSingleNodeNS(null)");
+ } catch (Exception e) { /* expected */ }
+
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "count(child::foo)");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathAPI.eval",
+ XPATH_NUMBER, xResult.getObjectType());
+ assertEquals("XXPathAPI.eval", 1, xResult.getLong());
+ }
+ {
+ XXPathObject xResult =
+ xXPathAPI.evalNS(xRoot, "count(//ns:foo)", xFooNs);
+ assertNotNull("XXPathAPI.evalNS", xResult);
+ assertEquals("XXPathAPI.evalNS",
+ XPATH_NUMBER, xResult.getObjectType());
+ assertEquals("XXPathAPI.evalNS", 1, xResult.getLong());
+ }
+ {
+ XNodeList xResult = xXPathAPI.selectNodeList(xRoot, "child::foo");
+ assertNotNull("XXPathAPI.selectNodeList", xResult);
+ assertEquals("XXPathAPI.selectNodeList", 1, xResult.getLength());
+ assertEquals("XXPathAPI.selectNodeList", xFoo1, xResult.item(0));
+ }
+ {
+ XNodeList xResult =
+ xXPathAPI.selectNodeListNS(xRoot, ".//ns:foo", xFooNs);
+ assertNotNull("XXPathAPI.selectNodeListNS", xResult);
+ assertEquals("XXPathAPI.selectNodeListNS", 1, xResult.getLength());
+ assertEquals("XXPathAPI.selectNodeListNS", xFooNs, xResult.item(0));
+ }
+ {
+ XNode xResult = xXPathAPI.selectSingleNode(xBar, "child::foo");
+ assertNotNull("XXPathAPI.selectSingleNode", xResult);
+ assertEquals("XXPathAPI.selectSingleNode", xFoo2, xResult);
+ }
+ {
+ XNode xResult =
+ xXPathAPI.selectSingleNodeNS(xFoo2, "//ns:foo", xFooNs);
+ assertNotNull("XXPathAPI.selectSingleNodeNS", xResult);
+ assertEquals("XXPathAPI.selectSingleNodeNS", xFooNs, xResult);
+ }
+
+ try {
+ XNode xResult = xXPathAPI.selectSingleNode(xDoc, "//pre:foo");
+ fail("XXPathAPI.selectSingleNode");
+ } catch (XPathException e) { /* expected */ }
+ xXPathAPI.registerNS("pre", ns);
+ {
+ XNode xResult = xXPathAPI.selectSingleNode(xDoc, "//pre:foo");
+ assertNotNull("XXPathAPI.registerNS", xResult);
+ assertEquals("XXPathAPI.registerNS", xFooNs, xResult);
+ }
+
+ xXPathAPI.unregisterNS("pre", ns);
+ try {
+ XNode xResult = xXPathAPI.selectSingleNode(xDoc, "//pre:foo");
+ fail("XXPathAPI.unregisterNS");
+ } catch (XPathException e) { /* expected */ }
+
+ /* FIXME
+ registerExtension("");
+ registerExtensionInstance(xExtension);
+ */
+ }
+
+ @Test public void testXXPathObject() throws Exception
+ {
+ XXPathAPI xXPathAPI =
+ UnoRuntime.queryInterface(XXPathAPI.class,
+ m_xMSF.createInstance("com.sun.star.xml.xpath.XPathAPI"));
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+
+ String ns = "http://example.com/";
+
+ XDocument xDoc = xBuilder.newDocument();
+
+ XElement xRoot = xDoc.createElement("root");
+
+ XElement xFoo1 = xDoc.createElement("foo");
+ XElement xFoo2 = xDoc.createElement("foo");
+ XElement xFooNs = xDoc.createElementNS(ns, "ns:foo");
+ XElement xBar = xDoc.createElement("bar");
+
+ xDoc.appendChild(xRoot);
+ xRoot.appendChild(xFoo1);
+ xFoo1.appendChild(xBar);
+ xBar.appendChild(xFoo2);
+ xRoot.appendChild(xFooNs);
+
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "count(//foo)");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_NUMBER, xResult.getObjectType());
+ assertEquals("XXPathObject.getByte", 2, xResult.getByte());
+ assertEquals("XXPathObject.getShort", 2, xResult.getShort());
+ assertEquals("XXPathObject.getLong", 2, xResult.getLong());
+ assertEquals("XXPathObject.getHyper", 2, xResult.getHyper());
+ assertEquals("XXPathObject.getFloat", 2.0, xResult.getFloat(), 0.0);
+ assertEquals("XXPathObject.getDouble",
+ 2.0, xResult.getDouble(), 0.0);
+ assertEquals("XXPathObject.getString", "2", xResult.getString());
+ }
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "count(//foo) = 2");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_BOOLEAN, xResult.getObjectType());
+ assertEquals("XXPathObject.getBoolean", true, xResult.getBoolean());
+ assertEquals("XXPathObject.getString", "true", xResult.getString());
+ }
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "count(//foo) = 2");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_BOOLEAN, xResult.getObjectType());
+ assertEquals("XXPathObject.getBoolean", true, xResult.getBoolean());
+ assertEquals("XXPathObject.getString", "true", xResult.getString());
+ }
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "local-name(foo)");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_STRING, xResult.getObjectType());
+ assertEquals("XXPathObject.getString", "foo", xResult.getString());
+ }
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "//foo");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_NODESET, xResult.getObjectType());
+ assertNotNull("XXPathObject.getNodeList", xResult.getNodeList());
+ }
+ }
+
+ @Test public void testXNodeList_NodeList() throws Exception
+ {
+ XXPathAPI xXPathAPI =
+ UnoRuntime.queryInterface(XXPathAPI.class,
+ m_xMSF.createInstance("com.sun.star.xml.xpath.XPathAPI"));
+ XDocumentBuilder xBuilder =
+ UnoRuntime.queryInterface(XDocumentBuilder.class,
+ m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
+
+ String ns = "http://example.com/";
+
+ XDocument xDoc = xBuilder.newDocument();
+
+ XElement xRoot = xDoc.createElement("root");
+
+ XElement xFoo1 = xDoc.createElement("foo");
+ XElement xFoo2 = xDoc.createElement("foo");
+ XElement xFooNs = xDoc.createElementNS(ns, "ns:foo");
+ XElement xBar = xDoc.createElement("bar");
+
+ xDoc.appendChild(xRoot);
+ xRoot.appendChild(xFoo1);
+ xFoo1.appendChild(xBar);
+ xBar.appendChild(xFoo2);
+ xRoot.appendChild(xFooNs);
+
+ {
+ XXPathObject xResult = xXPathAPI.eval(xRoot, "//foo");
+ assertNotNull("XXPathAPI.eval", xResult);
+ assertEquals("XXPathObject.getObjectType",
+ XPATH_NODESET, xResult.getObjectType());
+ XNodeList xNodeList = xResult.getNodeList();
+ assertNotNull("XXPathObject.getNodeList", xNodeList);
+ assertEquals("NodeList.getLength", 2, xNodeList.getLength());
+ assertEquals("NodeList.item", xFoo1, xNodeList.item(0));
+ assertEquals("NodeList.item", xFoo2, xNodeList.item(1));
+ }
+ }
+
+
+ // just for importNode...
+ abstract class MockNode implements XNode
+ {
+ MockDoc m_document;
+ MockNode m_parent;
+ MockNode m_prev;
+ MockNode m_next;
+ MockNode[] m_children;
+ String m_localname;
+
+// MockNode() { ; }
+ void init(MockDoc doc, MockNode parent, MockNode prev, MockNode next,
+ MockNode[] children)
+ {
+ m_document = doc;
+ m_parent = parent; m_prev = prev; m_next = next;
+ m_children = children;
+ }
+
+ public XNode appendChild(XNode c) throws DOMException {
+ fail("MockNode.appendChild called?");
+ return null;
+ }
+ public XNode cloneNode(boolean b) {
+ fail("MockNode.cloneNode called?");
+ return null;
+ }
+ public XNamedNodeMap getAttributes() {
+ fail("MockNode.getAttributes not implemented");
+ return null;
+ }
+ public XNodeList getChildNodes() {
+ fail("MockNode.getChildList not implemented");
+ return null;
+ }
+ public XNode getFirstChild() {
+ return (m_children.length != 0) ? m_children[0] : null;
+ }
+ public XNode getLastChild() {
+ return (m_children.length != 0)
+ ? m_children[m_children.length-1] : null;
+ }
+ public String getLocalName() { return m_localname; }
+ public String getNamespaceURI() { return ""; }
+ public XNode getNextSibling() { return m_next; }
+ public String getNodeName() { return m_localname; }
+// NodeType getNodeType() { return m_type; }
+ public String getNodeValue() throws DOMException { return ""; }
+ public XDocument getOwnerDocument() { return m_document; }
+ public XNode getParentNode() { return m_parent; }
+ public String getPrefix() { return ""; }
+ public XNode getPreviousSibling() { return m_prev; }
+ public boolean hasAttributes() { return false; }
+ public boolean hasChildNodes() { return m_children.length != 0; }
+ public XNode insertBefore(XNode c, XNode r) throws DOMException {
+ fail("MockNode.insertBefore called?");
+ return null;
+ }
+ public boolean isSupported(String a, String b) { return false; }
+ public void normalize() {
+ fail("MockNode.normalize called?");
+ }
+ public XNode removeChild(XNode c) throws DOMException {
+ fail("MockNode.removeChild called?");
+ return null;
+ }
+ public XNode replaceChild(XNode c, XNode o) throws DOMException {
+ fail("MockNode.replaceChild called?");
+ return null;
+ }
+ public void setNodeValue(String v) throws DOMException {
+ fail("MockNode.setNodeValue called?");
+ }
+ public void setPrefix(String p) throws DOMException {
+ fail("MockNode.setPrefix called?");
+ }
+ }
+ class MockDoc extends MockNode implements XDocument
+ {
+// MockDoc() { }
+ void init(MockNode[] children) {
+ super.init(this, null, null, null, children);
+ }
+
+ public NodeType getNodeType() { return DOCUMENT_NODE; }
+
+ public XAttr createAttribute(String n) throws DOMException {
+ fail("MockNode.createAttribute called?");
+ return null;
+ }
+ public XAttr createAttributeNS(String n, String q) throws DOMException {
+ fail("MockNode.createAttributeNS called?");
+ return null;
+ }
+ public XCDATASection createCDATASection(String s) throws DOMException {
+ fail("MockNode.createCDATASection called?");
+ return null;
+ }
+ public XComment createComment(String s) {
+ fail("MockNode.createCDATASection called?");
+ return null;
+ }
+ public XDocumentFragment createDocumentFragment() {
+ fail("MockNode.createDocumentFragment called?");
+ return null;
+ }
+ public XElement createElement(String n) {
+ fail("MockNode.createElement called?");
+ return null;
+ }
+ public XElement createElementNS(String n, String q) {
+ fail("MockNode.createElementNS called?");
+ return null;
+ }
+ public XEntityReference createEntityReference(String n)
+ throws DOMException {
+ fail("MockNode.createEntityReference called?");
+ return null;
+ }
+ public XProcessingInstruction createProcessingInstruction(String t,
+ String d) throws DOMException {
+ fail("MockNode.createEntityReference called?");
+ return null;
+ }
+ public XText createTextNode(String d) {
+ fail("MockNode.createTextNode called?");
+ return null;
+ }
+ public XDocumentType getDoctype() {
+ fail("MockNode.getDoctype called?");
+ return null;
+ }
+ public XElement getDocumentElement() {
+ fail("MockNode.getDocumentElement called?");
+ return null;
+ }
+ public XElement getElementById(String id) {
+ fail("MockNode.getElementById called?");
+ return null;
+ }
+ public XNodeList getElementsByTagName(String n) {
+ fail("MockNode.getElementsByTagName called?");
+ return null;
+ }
+ public XNodeList getElementsByTagNameNS(String n, String q) {
+ fail("MockNode.getElementsByTagNameNS called?");
+ return null;
+ }
+ public XDOMImplementation getImplementation() {
+ fail("MockNode.getImplementation called?");
+ return null;
+ }
+ public XNode importNode(XNode i, boolean b) throws DOMException {
+ fail("MockNode.importNode called?");
+ return null;
+ }
+ }
+ class MockNodeMap implements XNamedNodeMap
+ {
+ MockAttr[] m_attributes;
+
+ MockNodeMap(MockAttr[] attrs) { m_attributes = attrs; }
+
+ public int getLength() { return m_attributes.length; }
+ public XNode getNamedItem(String name) {
+ fail("MockNodeMap.getNamedItem not implemented");
+ return null;
+ }
+ public XNode getNamedItemNS(String n, String l) {
+ fail("MockNodeMap.getNamedItemNS not implemented");
+ return null;
+ }
+ public XNode item(int index) {
+ return m_attributes[index];
+ }
+ public XNode removeNamedItem(String n) throws DOMException {
+ fail("MockNodeMap.removeNamedItem called?");
+ return null;
+ }
+ public XNode removeNamedItemNS(String n, String l) throws DOMException {
+ fail("MockNodeMap.removeNamedItemNS called?");
+ return null;
+ }
+ public XNode setNamedItem(XNode n) throws DOMException {
+ fail("MockNodeMap.setNamedItem called?");
+ return null;
+ }
+ public XNode setNamedItemNS(XNode n) throws DOMException {
+ fail("MockNodeMap.setNamedItemNS called?");
+ return null;
+ }
+ }
+ class MockElement extends MockNode implements XElement
+ {
+ MockAttr[] m_attributes;
+
+ MockElement(String name, MockAttr[] attrs) {
+ m_localname = name; m_attributes = attrs;
+ }
+
+ public NodeType getNodeType() { return ELEMENT_NODE; }
+ public XNamedNodeMap getAttributes() {
+ return new MockNodeMap(m_attributes);
+ }
+ public boolean hasAttributes() { return m_attributes.length != 0; }
+
+ public String getAttribute(String n) {
+ fail("MockNode.getAttribute not implemented");
+ return null;
+ }
+ public XAttr getAttributeNode(String n) {
+ fail("MockNode.getAttributeNode not implemented");
+ return null;
+ }
+ public XAttr getAttributeNodeNS(String n, String l) {
+ fail("MockNode.getAttributeNodeNS not implemented");
+ return null;
+ }
+ public String getAttributeNS(String n, String q) {
+ fail("MockNode.getAttributeNS not implemented");
+ return null;
+ }
+ public XNodeList getElementsByTagName(String n) {
+ fail("MockNode.getElementsByTagName called?");
+ return null;
+ }
+ public XNodeList getElementsByTagNameNS(String n, String l) {
+ fail("MockNode.getElementsByTagNameNS called?");
+ return null;
+ }
+ public String getTagName() {
+ return getLocalName();
+ }
+ public boolean hasAttribute(String n) {
+ fail("MockNode.hasAttribute not implemented");
+ return false;
+ }
+ public boolean hasAttributeNS(String n, String l) {
+ fail("MockNode.hasAttributeNS not implemented");
+ return false;
+ }
+ public void removeAttribute(String n) throws DOMException {
+ fail("MockNode.removeAttribute called?");
+ }
+ public XAttr removeAttributeNode(XAttr o) throws DOMException {
+ fail("MockNode.removeAttributeNode called?");
+ return null;
+ }
+ public void removeAttributeNS(String n, String l) throws DOMException {
+ fail("MockNode.removeAttributeNS called?");
+ }
+ public void setAttribute(String n, String v) throws DOMException {
+ fail("MockNode.setAttribute called?");
+ }
+ public XAttr setAttributeNode(XAttr n) throws DOMException {
+ fail("MockNode.setAttributeNode called?");
+ return null;
+ }
+ public XAttr setAttributeNodeNS(XAttr n) throws DOMException {
+ fail("MockNode.setAttributeNodeNS called?");
+ return null;
+ }
+ public void setAttributeNS(String n, String q, String v)
+ throws DOMException {
+ fail("MockNode.setAttributeNS called?");
+ }
+ }
+ class MockAttr extends MockNode implements XAttr
+ {
+ String m_value;
+
+ MockAttr(String name, String value) {
+ m_localname = name; m_value = value;
+ }
+
+ public NodeType getNodeType() { return ATTRIBUTE_NODE; }
+
+ public String getName() { return m_localname; }
+ public XElement getOwnerElement() { return (XElement) m_parent; }
+ public boolean getSpecified() { return true; }
+ public String getValue() { return m_value; }
+ public void setValue(String v) {
+ fail("MockNode.setValue called?");
+ }
+ }
+}
+
diff --git a/unoxml/qa/complex/unoxml/TestDocument.java b/unoxml/qa/complex/unoxml/TestDocument.java
index bce9510e4d94..d64431f21741 100644
--- a/unoxml/qa/complex/unoxml/TestDocument.java
+++ b/unoxml/qa/complex/unoxml/TestDocument.java
@@ -29,10 +29,11 @@ package complex.unoxml;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
+import org.openoffice.test.Argument;
final class TestDocument {
public static String getUrl(String name) {
- return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ return OfficeFileUrl.getAbsolute(new File(Argument.get("tdoc"), name));
}
private TestDocument() {}
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index a1773a7db99f..8851c3ada86b 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -25,18 +25,60 @@
*
************************************************************************/
-#include "attr.hxx"
-#include "element.hxx"
-#include <com/sun/star/xml/dom/DOMException.hdl>
+#include <attr.hxx>
+
#include <string.h>
+#include <boost/shared_ptr.hpp>
+
+#include <com/sun/star/xml/dom/DOMException.hdl>
+#include <com/sun/star/xml/dom/events/XMutationEvent.hpp>
+
+#include <document.hxx>
+
+
namespace DOM
{
- CAttr::CAttr(const xmlAttrPtr pAttr)
+ CAttr::CAttr(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlAttrPtr const pAttr)
+ : CAttr_Base(rDocument, rMutex,
+ NodeType_ATTRIBUTE_NODE, reinterpret_cast<xmlNodePtr>(pAttr))
+ , m_aAttrPtr(pAttr)
+ {
+ }
+
+ xmlNsPtr CAttr::GetNamespace(xmlNodePtr const pNode)
+ {
+ if (!m_pNamespace.get()) {
+ return 0;
+ }
+ xmlChar const*const pUri(reinterpret_cast<xmlChar const*>(
+ m_pNamespace->first.getStr()));
+ xmlChar const*const pPrefix(reinterpret_cast<xmlChar const*>(
+ m_pNamespace->second.getStr()));
+ xmlNsPtr pNs = xmlSearchNs(pNode->doc, pNode, pPrefix);
+ if (pNs && (0 != xmlStrcmp(pNs->href, pUri))) {
+ return pNs;
+ }
+ pNs = xmlNewNs(pNode, pUri, pPrefix);
+ if (pNs) {
+ return pNs;
+ }
+ pNs = xmlSearchNsByHref(pNode->doc, pNode, pUri);
+ // if (!pNs) hmm... now what? throw?
+ if (!pNs) { OSL_TRACE("CAtttr: cannot create namespace"); }
+ return pNs;
+ }
+
+ bool CAttr::IsChildTypeAllowed(NodeType const nodeType)
{
- m_aAttrPtr = pAttr;
- m_aNodeType = NodeType_ATTRIBUTE_NODE;
- init_node((xmlNodePtr)pAttr);
+ switch (nodeType) {
+ case NodeType_TEXT_NODE:
+ case NodeType_ENTITY_REFERENCE_NODE:
+ return true;
+ default:
+ return false;
+ }
}
OUString SAL_CALL CAttr::getNodeName()
@@ -61,11 +103,13 @@ namespace DOM
*/
OUString SAL_CALL CAttr::getName() throw (RuntimeException)
{
- OUString aName;
- if (m_aAttrPtr != NULL)
- {
- aName = OUString((char*)m_aAttrPtr->name, strlen((char*)m_aAttrPtr->name), RTL_TEXTENCODING_UTF8);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ return ::rtl::OUString();
}
+ OUString const aName((char*)m_aAttrPtr->name,
+ strlen((char*)m_aAttrPtr->name), RTL_TEXTENCODING_UTF8);
return aName;
}
@@ -76,12 +120,19 @@ namespace DOM
Reference< XElement > SAL_CALL CAttr::getOwnerElement()
throw (RuntimeException)
{
- Reference< XElement > aElement;
- if (m_aAttrPtr != NULL && m_aAttrPtr->parent != NULL)
- {
- aElement = Reference< XElement >(static_cast< CElement* >(CNode::get(m_aAttrPtr->parent)));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ return 0;
+ }
+ if (0 == m_aAttrPtr->parent) {
+ return 0;
}
- return aElement;
+ Reference< XElement > const xRet(
+ static_cast< XNode* >(GetOwnerDocument().GetCNode(
+ m_aAttrPtr->parent).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
/**
@@ -91,8 +142,9 @@ namespace DOM
sal_Bool SAL_CALL CAttr::getSpecified()
throw (RuntimeException)
{
- // XXX what is this supposed do exactly?
- return sal_False;
+ // FIXME if this DOM implemenatation supported DTDs it would need
+ // to check that this attribute is not default or something
+ return sal_True;
}
/**
@@ -101,13 +153,19 @@ namespace DOM
OUString SAL_CALL CAttr::getValue()
throw (RuntimeException)
{
- OUString aName;
- if (m_aAttrPtr != NULL && m_aAttrPtr->children != NULL)
- {
- aName = OUString((char*)m_aAttrPtr->children->content, strlen((char*)m_aAttrPtr->children->content),
- RTL_TEXTENCODING_UTF8);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ return ::rtl::OUString();
}
- return aName;
+ if (0 == m_aAttrPtr->children) {
+ return ::rtl::OUString();
+ }
+ char const*const pContent((m_aAttrPtr->children)
+ ? reinterpret_cast<char const*>(m_aAttrPtr->children->content)
+ : "");
+ OUString const ret(pContent, strlen(pContent), RTL_TEXTENCODING_UTF8);
+ return ret;
}
/**
@@ -116,6 +174,12 @@ namespace DOM
void SAL_CALL CAttr::setValue(const OUString& value)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
+ if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ return;
+ }
+
// remember old value (for mutation event)
OUString sOldValue = getValue();
@@ -125,8 +189,11 @@ namespace DOM
// this does not work if the attribute was created anew
// xmlNodePtr pNode = m_aAttrPtr->parent;
// xmlSetProp(pNode, m_aAttrPtr->name, xValue);
- xmlChar *buffer = xmlEncodeEntitiesReentrant(m_aAttrPtr->doc, xValue);
- m_aAttrPtr->children = xmlStringGetNodeList(m_aAttrPtr->doc, buffer);
+ ::boost::shared_ptr<xmlChar const> const buffer(
+ xmlEncodeEntitiesReentrant(m_aAttrPtr->doc, xValue), xmlFree);
+ xmlFreeNodeList(m_aAttrPtr->children);
+ m_aAttrPtr->children =
+ xmlStringGetNodeList(m_aAttrPtr->doc, buffer.get());
xmlNodePtr tmp = m_aAttrPtr->children;
while (tmp != NULL) {
tmp->parent = (xmlNodePtr) m_aNodePtr;
@@ -145,9 +212,60 @@ namespace DOM
sEventName, sal_True, sal_False,
Reference<XNode>( static_cast<XAttr*>( this ) ),
sOldValue, value, getName(), AttrChangeType_MODIFICATION );
+
+ guard.clear(); // release mutex before calling event handlers
+
dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
dispatchSubtreeModified();
- xmlFree(buffer);
}
+ void SAL_CALL CAttr::setPrefix(const OUString& prefix)
+ throw (RuntimeException, DOMException)
+ {
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (!m_aNodePtr) { return; }
+
+ if (m_pNamespace.get()) {
+ OSL_ASSERT(!m_aNodePtr->parent);
+ m_pNamespace->second =
+ OUStringToOString(prefix, RTL_TEXTENCODING_UTF8);
+ } else {
+ CNode::setPrefix(prefix);
+ }
+ }
+
+ OUString SAL_CALL CAttr::getPrefix()
+ throw (RuntimeException)
+ {
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (!m_aNodePtr) { return ::rtl::OUString(); }
+
+ if (m_pNamespace.get()) {
+ OSL_ASSERT(!m_aNodePtr->parent);
+ OUString const ret(::rtl::OStringToOUString(
+ m_pNamespace->second, RTL_TEXTENCODING_UTF8));
+ return ret;
+ } else {
+ return CNode::getPrefix();
+ }
+ }
+
+ OUString SAL_CALL CAttr::getNamespaceURI()
+ throw (RuntimeException)
+ {
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (!m_aNodePtr) { return ::rtl::OUString(); }
+
+ if (m_pNamespace.get()) {
+ OSL_ASSERT(!m_aNodePtr->parent);
+ OUString const ret(::rtl::OStringToOUString(
+ m_pNamespace->first, RTL_TEXTENCODING_UTF8));
+ return ret;
+ } else {
+ return CNode::getNamespaceURI();
+ }
+ }
}
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx
index b79927b46037..824f042a2b85 100644
--- a/unoxml/source/dom/attr.hxx
+++ b/unoxml/source/dom/attr.hxx
@@ -25,16 +25,20 @@
*
************************************************************************/
-#ifndef _ATTR_HXX
-#define _ATTR_HXX
+#ifndef DOM_ATTR_HXX
+#define DOM_ATTR_HXX
+
+#include <memory>
+
+#include <libxml/tree.h>
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XAttr.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -42,17 +46,30 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CAttr : public cppu::ImplInheritanceHelper1< CNode, XAttr >
+ typedef ::std::pair< ::rtl::OString, ::rtl::OString > stringpair_t;
+
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XAttr > CAttr_Base;
+
+ class CAttr
+ : public CAttr_Base
{
- friend class CNode;
- friend class CElement;
+ private:
+ friend class CDocument;
+
private:
xmlAttrPtr m_aAttrPtr;
+ ::std::auto_ptr< stringpair_t > m_pNamespace;
protected:
- CAttr(const xmlAttrPtr aAttrPtr);
+ CAttr(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlAttrPtr const pAttr);
public:
+ /// return the libxml namespace corresponding to m_pNamespace on pNode
+ xmlNsPtr GetNamespace(xmlNodePtr const pNode);
+
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
+
/**
Returns the name of this attribute.
*/
@@ -122,10 +139,7 @@ namespace DOM
return CNode::getLastChild();
}
virtual OUString SAL_CALL getNamespaceURI()
- throw (RuntimeException)
- {
- return CNode::getNamespaceURI();
- }
+ throw (RuntimeException);
virtual Reference< XNode > SAL_CALL getNextSibling()
throw (RuntimeException)
{
@@ -147,10 +161,7 @@ namespace DOM
return CNode::getParentNode();
}
virtual OUString SAL_CALL getPrefix()
- throw (RuntimeException)
- {
- return CNode::getPrefix();
- }
+ throw (RuntimeException);
virtual Reference< XNode > SAL_CALL getPreviousSibling()
throw (RuntimeException)
{
@@ -199,10 +210,7 @@ namespace DOM
return setValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException, DOMException)
- {
- return CNode::setPrefix(prefix);
- }
+ throw (RuntimeException, DOMException);
};
}
diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx
index c411365cf1b0..3cec81767d9e 100644
--- a/unoxml/source/dom/attributesmap.cxx
+++ b/unoxml/source/dom/attributesmap.cxx
@@ -25,13 +25,20 @@
*
************************************************************************/
-#include "attributesmap.hxx"
+#include <attributesmap.hxx>
+
#include <string.h>
+#include <element.hxx>
+#include <document.hxx>
+
+
namespace DOM
{
- CAttributesMap::CAttributesMap(const CElement* aElement)
- : m_pElement(aElement)
+ CAttributesMap::CAttributesMap(::rtl::Reference<CElement> const& pElement,
+ ::osl::Mutex & rMutex)
+ : m_pElement(pElement)
+ , m_rMutex(rMutex)
{
}
@@ -40,8 +47,10 @@ namespace DOM
*/
sal_Int32 SAL_CALL CAttributesMap::getLength() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
sal_Int32 count = 0;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
+ xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL)
{
xmlAttrPtr cur = pNode->properties;
@@ -52,16 +61,18 @@ namespace DOM
}
}
return count;
-
}
/**
Retrieves a node specified by local name
*/
- Reference< XNode > SAL_CALL CAttributesMap::getNamedItem(const OUString& name) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::getNamedItem(OUString const& name) throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
Reference< XNode > aNode;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
+ xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL)
{
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
@@ -71,7 +82,9 @@ namespace DOM
{
if( strcmp((char*)xName, (char*)cur->name) == 0)
{
- aNode = Reference< XNode >(static_cast<CNode*>(CNode::get((xmlNodePtr)cur)));
+ aNode = Reference< XNode >(
+ m_pElement->GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(cur)).get() );
break;
}
cur = cur->next;
@@ -83,24 +96,32 @@ namespace DOM
/**
Retrieves a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CAttributesMap::getNamedItemNS(const OUString& namespaceURI,const OUString& localName) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::getNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
Reference< XNode > aNode;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
+ xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL)
{
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar* xName = (xmlChar*)o1.getStr();
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
- xmlChar* xNs = (xmlChar*)o1.getStr();
- xmlNsPtr pNs = xmlSearchNs(pNode->doc, pNode, xNs);
+ xmlChar const*const xNs =
+ reinterpret_cast<xmlChar const*>(o2.getStr());
+ xmlNsPtr const pNs = xmlSearchNsByHref(pNode->doc, pNode, xNs);
xmlAttrPtr cur = pNode->properties;
while (cur != NULL && pNs != NULL)
{
if( strcmp((char*)xName, (char*)cur->name) == 0 &&
cur->ns == pNs)
{
- aNode = Reference< XNode >(static_cast< CNode* >(CNode::get((xmlNodePtr)cur)));
+ aNode = Reference< XNode >(
+ m_pElement->GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(cur)).get() );
break;
}
cur = cur->next;
@@ -112,10 +133,13 @@ namespace DOM
/**
Returns the indexth item in the map.
*/
- Reference< XNode > SAL_CALL CAttributesMap::item(sal_Int32 index) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::item(sal_Int32 index) throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
Reference< XNode > aNode;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
+ xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL)
{
xmlAttrPtr cur = pNode->properties;
@@ -124,7 +148,9 @@ namespace DOM
{
if (count == index)
{
- aNode = Reference< XNode >(static_cast< CNode* >(CNode::get((xmlNodePtr)cur)));
+ aNode = Reference< XNode >(
+ m_pElement->GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(cur)).get() );
break;
}
count++;
@@ -132,80 +158,87 @@ namespace DOM
}
}
return aNode;
-
}
/**
Removes a node specified by name.
*/
- Reference< XNode > SAL_CALL CAttributesMap::removeNamedItem(const OUString& name) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::removeNamedItem(OUString const& name)
+ throw (RuntimeException)
{
- Reference< XNode > aNode;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
- if (pNode != NULL)
- {
- OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
- xmlChar* xName = (xmlChar*)o1.getStr();
- xmlAttrPtr cur = pNode->properties;
- while (cur != NULL)
- {
- if( strcmp((char*)xName, (char*)cur->name) == 0)
- {
- aNode = Reference< XNode >(static_cast< CNode* >(CNode::get((xmlNodePtr)cur)));
- xmlUnlinkNode((xmlNodePtr)cur);
- break;
- }
- cur = cur->next;
- }
+ // no MutexGuard needed: m_pElement is const
+ Reference< XAttr > const xAttr(m_pElement->getAttributeNode(name));
+ if (!xAttr.is()) {
+ throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "CAttributesMap::removeNamedItem: no such attribute")),
+ static_cast<OWeakObject*>(this),
+ DOMExceptionType_NOT_FOUND_ERR);
}
- return aNode;
+ Reference< XNode > const xRet(
+ m_pElement->removeAttributeNode(xAttr), UNO_QUERY);
+ return xRet;
}
/**
// Removes a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CAttributesMap::removeNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::removeNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException)
{
- Reference< XNode > aNode;
- xmlNodePtr pNode = m_pElement->m_aNodePtr;
- if (pNode != NULL)
- {
- OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
- xmlChar* xName = (xmlChar*)o1.getStr();
- OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
- xmlChar* xNs = (xmlChar*)o1.getStr();
- xmlNsPtr pNs = xmlSearchNs(pNode->doc, pNode, xNs);
- xmlAttrPtr cur = pNode->properties;
- while (cur != NULL && pNs != NULL)
- {
- if( strcmp((char*)xName, (char*)cur->name) == 0 &&
- cur->ns == pNs)
- {
- aNode = Reference< XNode >(static_cast< CNode* >(CNode::get((xmlNodePtr)cur)));
- xmlUnlinkNode((xmlNodePtr)cur);
- break;
- }
- cur = cur->next;
- }
+ // no MutexGuard needed: m_pElement is const
+ Reference< XAttr > const xAttr(
+ m_pElement->getAttributeNodeNS(namespaceURI, localName));
+ if (!xAttr.is()) {
+ throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "CAttributesMap::removeNamedItemNS: no such attribute")),
+ static_cast<OWeakObject*>(this),
+ DOMExceptionType_NOT_FOUND_ERR);
}
- return aNode;
+ Reference< XNode > const xRet(
+ m_pElement->removeAttributeNode(xAttr), UNO_QUERY);
+ return xRet;
}
/**
// Adds a node using its nodeName attribute.
*/
- Reference< XNode > SAL_CALL CAttributesMap::setNamedItem(const Reference< XNode >& arg) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::setNamedItem(Reference< XNode > const& xNode)
+ throw (RuntimeException)
{
- return arg;
- // return Reference< XNode >();
+ Reference< XAttr > const xAttr(xNode, UNO_QUERY);
+ if (!xNode.is()) {
+ throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "CAttributesMap::setNamedItem: XAttr argument expected")),
+ static_cast<OWeakObject*>(this),
+ DOMExceptionType_HIERARCHY_REQUEST_ERR);
+ }
+ // no MutexGuard needed: m_pElement is const
+ Reference< XNode > const xRet(
+ m_pElement->setAttributeNode(xAttr), UNO_QUERY);
+ return xRet;
}
/**
Adds a node using its namespaceURI and localName.
*/
- Reference< XNode > SAL_CALL CAttributesMap::setNamedItemNS(const Reference< XNode >& arg) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CAttributesMap::setNamedItemNS(Reference< XNode > const& xNode)
+ throw (RuntimeException)
{
- return arg;
- // return Reference< XNode >();
+ Reference< XAttr > const xAttr(xNode, UNO_QUERY);
+ if (!xNode.is()) {
+ throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "CAttributesMap::setNamedItemNS: XAttr argument expected")),
+ static_cast<OWeakObject*>(this),
+ DOMExceptionType_HIERARCHY_REQUEST_ERR);
+ }
+ // no MutexGuard needed: m_pElement is const
+ Reference< XNode > const xRet(
+ m_pElement->setAttributeNodeNS(xAttr), UNO_QUERY);
+ return xRet;
}
}
diff --git a/unoxml/source/dom/attributesmap.hxx b/unoxml/source/dom/attributesmap.hxx
index d19b517251a0..b987349c9194 100644
--- a/unoxml/source/dom/attributesmap.hxx
+++ b/unoxml/source/dom/attributesmap.hxx
@@ -25,19 +25,18 @@
*
************************************************************************/
-#ifndef _ATTRIBUTESMAP_HXX
-#define _ATTRIBUTESMAP_HXX
+#ifndef DOM_ATTRIBUTESMAP_HXX
+#define DOM_ATTRIBUTESMAP_HXX
-#include <map>
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
-#include "node.hxx"
-#include "element.hxx"
-#include "attr.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -45,12 +44,18 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CAttributesMap : public cppu::WeakImplHelper1< XNamedNodeMap >
+ class CElement;
+
+ class CAttributesMap
+ : public cppu::WeakImplHelper1< XNamedNodeMap >
{
private:
- const CElement* m_pElement;
+ ::rtl::Reference<CElement> const m_pElement;
+ ::osl::Mutex & m_rMutex;
+
public:
- CAttributesMap(const CElement* aDocType);
+ CAttributesMap(::rtl::Reference<CElement> const& pElement,
+ ::osl::Mutex & rMutex);
/**
The number of nodes in this map.
@@ -60,37 +65,49 @@ namespace DOM
/**
Retrieves a node specified by local name
*/
- virtual Reference< XNode > SAL_CALL getNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL getNamedItem(OUString const& name)
+ throw (RuntimeException);
/**
Retrieves a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL getNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL getNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
Returns the indexth item in the map.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL item(sal_Int32 index)
+ throw (RuntimeException);
/**
Removes a node specified by name.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ removeNamedItem(OUString const& name)
+ throw (RuntimeException);
/**
// Removes a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL removeNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
// Adds a node using its nodeName attribute.
*/
- virtual Reference< XNode > SAL_CALL setNamedItem(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItem(Reference< XNode > const& arg)
+ throw (RuntimeException);
/**
Adds a node using its namespaceURI and localName.
*/
- virtual Reference< XNode > SAL_CALL setNamedItemNS(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItemNS(Reference< XNode > const& arg)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx
index 7c775484770c..6f8035a793b3 100644
--- a/unoxml/source/dom/cdatasection.cxx
+++ b/unoxml/source/dom/cdatasection.cxx
@@ -25,20 +25,22 @@
*
************************************************************************/
-#include "cdatasection.hxx"
+#include <cdatasection.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
namespace DOM
{
- CCDATASection::CCDATASection(const xmlNodePtr aNodePtr)
+ CCDATASection::CCDATASection(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CCDATASection_Base(rDocument, rMutex,
+ NodeType_CDATA_SECTION_NODE, pNode)
{
- m_aNodeType = NodeType_CDATA_SECTION_NODE;
- init_text(aNodePtr);
}
- void SAL_CALL CCDATASection::saxify(
- const Reference< XDocumentHandler >& i_xHandler) {
+ void CCDATASection::saxify(const Reference< XDocumentHandler >& i_xHandler)
+ {
if (!i_xHandler.is()) throw RuntimeException();
Reference< XExtendedDocumentHandler > xExtended(i_xHandler, UNO_QUERY);
if (xExtended.is()) {
diff --git a/unoxml/source/dom/cdatasection.hxx b/unoxml/source/dom/cdatasection.hxx
index 400b2a6a02d3..d809ef7e7f76 100644
--- a/unoxml/source/dom/cdatasection.hxx
+++ b/unoxml/source/dom/cdatasection.hxx
@@ -25,14 +25,14 @@
*
************************************************************************/
-#ifndef _CDATASECTION_HXX
-#define _CDATASECTION_HXX
+#ifndef DOM_CDATASECTION_HXX
+#define DOM_CDATASECTION_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XCDATASection.hpp>
-#include "text.hxx"
+#include <text.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -40,16 +40,21 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CCDATASection : public cppu::ImplInheritanceHelper1< CText, XCDATASection >
+ typedef ::cppu::ImplInheritanceHelper1< CText, XCDATASection >
+ CCDATASection_Base;
+
+ class CCDATASection
+ : public CCDATASection_Base
{
- friend class CNode;
+ friend class CDocument;
+
protected:
- CCDATASection(const xmlNodePtr aNodePtr);
+ CCDATASection(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
virtual Reference< XText > SAL_CALL splitText(sal_Int32 offset)
throw (RuntimeException)
@@ -215,7 +220,7 @@ namespace DOM
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
throw (RuntimeException, DOMException)
{
- return CNode::setNodeValue(nodeValue);
+ return CText::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
throw (RuntimeException, DOMException)
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx
index 8a8407678272..6cd3d9f2c1d5 100644
--- a/unoxml/source/dom/characterdata.cxx
+++ b/unoxml/source/dom/characterdata.cxx
@@ -25,18 +25,29 @@
*
************************************************************************/
+#include <characterdata.hxx>
+
+#include <string.h>
+
+#include <boost/shared_ptr.hpp>
+
#include <com/sun/star/xml/dom/events/XDocumentEvent.hpp>
-#include "characterdata.hxx"
+
#include "../events/mutationevent.hxx"
-#include <string.h>
+
namespace DOM
{
- CCharacterData::CCharacterData()
- {}
+ CCharacterData::CCharacterData(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode)
+ : CCharacterData_Base(rDocument, rMutex, reNodeType, rpNode)
+ {
+ }
- void CCharacterData::_dispatchEvent(const OUString& prevValue, const OUString& newValue)
+ void CCharacterData::dispatchEvent_Impl(
+ OUString const& prevValue, OUString const& newValue)
{
Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
Reference< XMutationEvent > event(docevent->createEvent(
@@ -49,23 +60,22 @@ namespace DOM
dispatchSubtreeModified();
}
- void CCharacterData::init_characterdata(const xmlNodePtr aNodePtr)
- {
- init_node(aNodePtr);
- }
-
/**
Append the string to the end of the character data of the node.
*/
void SAL_CALL CCharacterData::appendData(const OUString& arg)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
if (m_aNodePtr != NULL)
{
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
xmlNodeAddContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(arg, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
- _dispatchEvent(oldValue, newValue);
+
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent_Impl(oldValue, newValue);
}
}
@@ -75,10 +85,14 @@ namespace DOM
void SAL_CALL CCharacterData::deleteData(sal_Int32 offset, sal_Int32 count)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
if (m_aNodePtr != NULL)
{
// get current data
- OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
+ ::boost::shared_ptr<xmlChar const> const pContent(
+ xmlNodeGetContent(m_aNodePtr), xmlFree);
+ OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
if (offset > tmp.getLength() || offset < 0 || count < 0) {
DOMException e;
@@ -93,8 +107,9 @@ namespace DOM
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
- _dispatchEvent(oldValue, newValue);
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent_Impl(oldValue, newValue);
}
}
@@ -104,6 +119,8 @@ namespace DOM
*/
OUString SAL_CALL CCharacterData::getData() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aData;
if (m_aNodePtr != NULL)
{
@@ -120,8 +137,10 @@ namespace DOM
The number of 16-bit units that are available through data and the
substringData method below.
*/
- sal_Int32 CCharacterData::getLength() throw (RuntimeException)
+ sal_Int32 SAL_CALL CCharacterData::getLength() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
sal_Int32 length = 0;
if (m_aNodePtr != NULL)
{
@@ -137,10 +156,14 @@ namespace DOM
void SAL_CALL CCharacterData::insertData(sal_Int32 offset, const OUString& arg)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
if (m_aNodePtr != NULL)
{
// get current data
- OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
+ ::boost::shared_ptr<xmlChar const> const pContent(
+ xmlNodeGetContent(m_aNodePtr), xmlFree);
+ OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
if (offset > tmp.getLength() || offset < 0) {
DOMException e;
@@ -154,8 +177,9 @@ namespace DOM
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
- _dispatchEvent(oldValue, newValue);
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent_Impl(oldValue, newValue);
}
}
@@ -167,10 +191,14 @@ namespace DOM
void SAL_CALL CCharacterData::replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
if (m_aNodePtr != NULL)
{
// get current data
- OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
+ ::boost::shared_ptr<xmlChar const> const pContent(
+ xmlNodeGetContent(m_aNodePtr), xmlFree);
+ OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
if (offset > tmp.getLength() || offset < 0 || count < 0){
DOMException e;
@@ -186,7 +214,9 @@ namespace DOM
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
- _dispatchEvent(oldValue, newValue);
+
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent_Impl(oldValue, newValue);
}
}
@@ -196,13 +226,16 @@ namespace DOM
void SAL_CALL CCharacterData::setData(const OUString& data)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
if (m_aNodePtr != NULL)
{
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
- _dispatchEvent(oldValue, newValue);
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent_Impl(oldValue, newValue);
}
}
@@ -212,11 +245,15 @@ namespace DOM
OUString SAL_CALL CCharacterData::subStringData(sal_Int32 offset, sal_Int32 count)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aStr;
if (m_aNodePtr != NULL)
{
// get current data
- OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
+ ::boost::shared_ptr<xmlChar const> const pContent(
+ xmlNodeGetContent(m_aNodePtr), xmlFree);
+ OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
if (offset > tmp.getLength() || offset < 0 || count < 0) {
DOMException e;
diff --git a/unoxml/source/dom/characterdata.hxx b/unoxml/source/dom/characterdata.hxx
index 4ff1da570f7c..9639108f1e85 100644
--- a/unoxml/source/dom/characterdata.hxx
+++ b/unoxml/source/dom/characterdata.hxx
@@ -25,19 +25,21 @@
*
************************************************************************/
-#ifndef _CHARACTERDATA_HXX
-#define _CHARACTERDATA_HXX
+#ifndef DOM_CHARACTERDATA_HXX
+#define DOM_CHARACTERDATA_HXX
+
+#include <libxml/tree.h>
#include <sal/types.h>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XCharacterData.hpp>
-#include <com/sun/star/xml/dom/XElement.hpp>
-#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
-#include <libxml/tree.h>
-#include "node.hxx"
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -45,14 +47,19 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CCharacterData : public cppu::ImplInheritanceHelper1< CNode, XCharacterData >
- {
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XCharacterData >
+ CCharacterData_Base;
+ class CCharacterData
+ : public CCharacterData_Base
+ {
protected:
- CCharacterData();
- void init_characterdata(const xmlNodePtr aNodePtr);
- void _dispatchEvent(const OUString& prevValue, const OUString& newValue);
+ CCharacterData(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
+
+ void dispatchEvent_Impl(
+ OUString const& prevValue, OUString const& newValue);
public:
/**
diff --git a/unoxml/source/dom/childlist.cxx b/unoxml/source/dom/childlist.cxx
index aaa6e157225d..3c80c664204e 100644
--- a/unoxml/source/dom/childlist.cxx
+++ b/unoxml/source/dom/childlist.cxx
@@ -25,11 +25,20 @@
*
************************************************************************/
-#include "childlist.hxx"
+#include <childlist.hxx>
+
+#include <libxml/tree.h>
+
+#include <node.hxx>
+#include <document.hxx>
+
+
namespace DOM
{
- CChildList::CChildList(const CNode* base)
- : m_pNode(base->m_aNodePtr)
+ CChildList::CChildList(::rtl::Reference<CNode> const& pBase,
+ ::osl::Mutex & rMutex)
+ : m_pNode(pBase)
+ , m_rMutex(rMutex)
{
}
@@ -38,10 +47,15 @@ namespace DOM
*/
sal_Int32 SAL_CALL CChildList::getLength() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
sal_Int32 length = 0;
if (m_pNode != NULL)
{
- xmlNodePtr cur = m_pNode->children;
+ xmlNodePtr cur = m_pNode->GetNodePtr();
+ if (0 != cur) {
+ cur = cur->children;
+ }
while (cur != NULL)
{
length++;
@@ -54,19 +68,26 @@ namespace DOM
/**
Returns the indexth item in the collection.
*/
- Reference< XNode > SAL_CALL CChildList::item(sal_Int32 index) throw (RuntimeException)
+ Reference< XNode > SAL_CALL CChildList::item(sal_Int32 index)
+ throw (RuntimeException)
{
- Reference< XNode >aNode;
+ ::osl::MutexGuard const g(m_rMutex);
+
if (m_pNode != NULL)
{
- xmlNodePtr cur = m_pNode->children;
+ xmlNodePtr cur = m_pNode->GetNodePtr();
+ if (0 != cur) {
+ cur = cur->children;
+ }
while (cur != NULL)
{
- if (index-- == 0)
- aNode = Reference< XNode >(CNode::get(cur));
+ if (index-- == 0) {
+ return Reference< XNode >(
+ m_pNode->GetOwnerDocument().GetCNode(cur).get());
+ }
cur = cur->next;
}
}
- return aNode;
+ return 0;
}
}
diff --git a/unoxml/source/dom/childlist.hxx b/unoxml/source/dom/childlist.hxx
index 89b73ff2e113..f23617e49806 100644
--- a/unoxml/source/dom/childlist.hxx
+++ b/unoxml/source/dom/childlist.hxx
@@ -25,18 +25,18 @@
*
************************************************************************/
-#ifndef _CHILDLIST_HXX
-#define _CHILDLIST_HXX
+#ifndef DOM_CHILDLIST_HXX
+#define DOM_CHILDLIST_HXX
-#include <map>
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
-#include "node.hxx"
-#include "libxml/tree.h"
+
+#include <cppuhelper/implbase1.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -44,12 +44,19 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CChildList : public cppu::WeakImplHelper1< XNodeList >
+ class CNode;
+
+ class CChildList
+ : public cppu::WeakImplHelper1< XNodeList >
{
private:
- const xmlNodePtr m_pNode;
+ ::rtl::Reference<CNode> const m_pNode;
+ ::osl::Mutex & m_rMutex;
+
public:
- CChildList(const CNode* base);
+ CChildList(::rtl::Reference<CNode> const& pBase,
+ ::osl::Mutex & rMutex);
+
/**
The number of nodes in the list.
*/
@@ -57,7 +64,8 @@ namespace DOM
/**
Returns the indexth item in the collection.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL item(sal_Int32 index)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx
index f0f14a2d944a..d1ea6d83e3e9 100644
--- a/unoxml/source/dom/comment.cxx
+++ b/unoxml/source/dom/comment.cxx
@@ -25,19 +25,20 @@
*
************************************************************************/
-#include "comment.hxx"
+#include <comment.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
namespace DOM
{
- CComment::CComment(const xmlNodePtr aNodePtr)
+ CComment::CComment(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CComment_Base(rDocument, rMutex, NodeType_COMMENT_NODE, pNode)
{
- m_aNodeType = NodeType_COMMENT_NODE;
- init_node(aNodePtr);
}
- void SAL_CALL CComment::saxify(
+ void CComment::saxify(
const Reference< XDocumentHandler >& i_xHandler) {
if (!i_xHandler.is()) throw RuntimeException();
Reference< XExtendedDocumentHandler > xExtended(i_xHandler, UNO_QUERY);
diff --git a/unoxml/source/dom/comment.hxx b/unoxml/source/dom/comment.hxx
index 196c7460399e..0aed0cf6a09b 100644
--- a/unoxml/source/dom/comment.hxx
+++ b/unoxml/source/dom/comment.hxx
@@ -25,13 +25,14 @@
*
************************************************************************/
-#ifndef _COMMENT_HXX
-#define _COMMENT_HXX
+#ifndef DOM_COMMENT_HXX
+#define DOM_COMMENT_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XComment.hpp>
-#include "characterdata.hxx"
+
+#include <characterdata.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -39,16 +40,22 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CComment : public cppu::ImplInheritanceHelper1< CCharacterData, XComment >
+ typedef ::cppu::ImplInheritanceHelper1< CCharacterData, XComment >
+ CComment_Base;
+
+ class CComment
+ : public CComment_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
protected:
- CComment(const xmlNodePtr aNodePtr);
+ CComment(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
// --- delegations for XCharacterData
virtual void SAL_CALL appendData(const OUString& arg)
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index fcd43832adf0..14d72555157a 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -40,11 +40,14 @@
#include "documenttype.hxx"
#include "elementlist.hxx"
#include "domimplementation.hxx"
+#include <entity.hxx>
+#include <notation.hxx>
#include "../events/event.hxx"
#include "../events/mutationevent.hxx"
#include "../events/uievent.hxx"
#include "../events/mouseevent.hxx"
+#include "../events/eventdispatcher.hxx"
#include <string.h>
@@ -53,52 +56,287 @@
namespace DOM
{
+ static xmlNodePtr lcl_getDocumentType(xmlDocPtr const i_pDocument)
+ {
+ // find the doc type
+ xmlNodePtr cur = i_pDocument->children;
+ while (cur != NULL)
+ {
+ if ((cur->type == XML_DOCUMENT_TYPE_NODE) ||
+ (cur->type == XML_DTD_NODE)) {
+ return cur;
+ }
+ }
+ return 0;
+ }
+
+ /// get the pointer to the root element node of the document
+ static xmlNodePtr lcl_getDocumentRootPtr(xmlDocPtr const i_pDocument)
+ {
+ // find the document element
+ xmlNodePtr cur = i_pDocument->children;
+ while (cur != NULL)
+ {
+ if (cur->type == XML_ELEMENT_NODE)
+ break;
+ cur = cur->next;
+ }
+ return cur;
+ }
+
+ CDocument::CDocument(xmlDocPtr const pDoc)
+ : CDocument_Base(*this, m_Mutex,
+ NodeType_DOCUMENT_NODE, reinterpret_cast<xmlNodePtr>(pDoc))
+ , m_aDocPtr(pDoc)
+ , m_streamListeners()
+ , m_pEventDispatcher(new events::CEventDispatcher())
+ {
+ }
+
+ ::rtl::Reference<CDocument> CDocument::CreateCDocument(xmlDocPtr const pDoc)
+ {
+ ::rtl::Reference<CDocument> const xDoc(new CDocument(pDoc));
+ // add the doc itself to its nodemap!
+ xDoc->m_NodeMap.insert(
+ nodemap_t::value_type(reinterpret_cast<xmlNodePtr>(pDoc),
+ ::std::make_pair(
+ WeakReference<XNode>(static_cast<XDocument*>(xDoc.get())),
+ xDoc.get())));
+ return xDoc;
+ }
+
CDocument::~CDocument()
{
+ ::osl::MutexGuard const g(m_Mutex);
+#ifdef DBG_UTIL
+ // node map must be empty now, otherwise CDocument must not die!
+ for (nodemap_t::iterator i = m_NodeMap.begin();
+ i != m_NodeMap.end(); ++i)
+ {
+ Reference<XNode> const xNode(i->second.first);
+ OSL_ENSURE(!xNode.is(),
+ "CDocument::~CDocument(): ERROR: live node in document node map!");
+ }
+#endif
xmlFreeDoc(m_aDocPtr);
}
- CDocument::CDocument(xmlDocPtr aDocPtr):
- m_aDocPtr(aDocPtr),
- m_streamListeners()
+
+ events::CEventDispatcher & CDocument::GetEventDispatcher()
{
- // init node base
- m_aNodeType = NodeType_DOCUMENT_NODE;
- init_node((xmlNodePtr)m_aDocPtr);
+ return *m_pEventDispatcher;
}
- void SAL_CALL CDocument::saxify(
- const Reference< XDocumentHandler >& i_xHandler) {
+ ::rtl::Reference< CElement > CDocument::GetDocumentElement()
+ {
+ xmlNodePtr const pNode = lcl_getDocumentRootPtr(m_aDocPtr);
+ ::rtl::Reference< CElement > const xRet(
+ dynamic_cast<CElement*>(GetCNode(pNode).get()));
+ return xRet;
+ }
+
+ void
+ CDocument::RemoveCNode(xmlNodePtr const pNode, CNode const*const pCNode)
+ {
+ nodemap_t::iterator const i = m_NodeMap.find(pNode);
+ if (i != m_NodeMap.end()) {
+ // #i113681# consider this scenario:
+ // T1 calls ~CNode
+ // T2 calls getCNode: lookup will find i->second->first invalid
+ // so a new CNode is created and inserted
+ // T1 calls removeCNode: i->second->second now points to a
+ // different CNode instance!
+ //
+ // check that the CNode is the right one
+ CNode *const pCurrent = i->second.second;
+ if (pCurrent == pCNode) {
+ m_NodeMap.erase(i);
+ }
+ }
+ }
+
+ /** NB: this is the CNode factory.
+ it is the only place where CNodes may be instantiated.
+ all CNodes must be registered at the m_NodeMap.
+ */
+ ::rtl::Reference<CNode>
+ CDocument::GetCNode(xmlNodePtr const pNode, bool const bCreate)
+ {
+ if (0 == pNode) {
+ return 0;
+ }
+ //check whether there is already an instance for this node
+ nodemap_t::const_iterator const i = m_NodeMap.find(pNode);
+ if (i != m_NodeMap.end()) {
+ // #i113681# check that the CNode is still alive
+ uno::Reference<XNode> const xNode(i->second.first);
+ if (xNode.is())
+ {
+ ::rtl::Reference<CNode> ret(i->second.second);
+ OSL_ASSERT(ret.is());
+ return ret;
+ }
+ }
+
+ if (!bCreate) { return 0; }
+
+ // there is not yet an instance wrapping this node,
+ // create it and store it in the map
+
+ ::rtl::Reference<CNode> pCNode;
+ switch (pNode->type)
+ {
+ case XML_ELEMENT_NODE:
+ // m_aNodeType = NodeType::ELEMENT_NODE;
+ pCNode = static_cast< CNode* >(
+ new CElement(*this, m_Mutex, pNode));
+ break;
+ case XML_TEXT_NODE:
+ // m_aNodeType = NodeType::TEXT_NODE;
+ pCNode = static_cast< CNode* >(
+ new CText(*this, m_Mutex, pNode));
+ break;
+ case XML_CDATA_SECTION_NODE:
+ // m_aNodeType = NodeType::CDATA_SECTION_NODE;
+ pCNode = static_cast< CNode* >(
+ new CCDATASection(*this, m_Mutex, pNode));
+ break;
+ case XML_ENTITY_REF_NODE:
+ // m_aNodeType = NodeType::ENTITY_REFERENCE_NODE;
+ pCNode = static_cast< CNode* >(
+ new CEntityReference(*this, m_Mutex, pNode));
+ break;
+ case XML_ENTITY_NODE:
+ // m_aNodeType = NodeType::ENTITY_NODE;
+ pCNode = static_cast< CNode* >(new CEntity(*this, m_Mutex,
+ reinterpret_cast<xmlEntityPtr>(pNode)));
+ break;
+ case XML_PI_NODE:
+ // m_aNodeType = NodeType::PROCESSING_INSTRUCTION_NODE;
+ pCNode = static_cast< CNode* >(
+ new CProcessingInstruction(*this, m_Mutex, pNode));
+ break;
+ case XML_COMMENT_NODE:
+ // m_aNodeType = NodeType::COMMENT_NODE;
+ pCNode = static_cast< CNode* >(
+ new CComment(*this, m_Mutex, pNode));
+ break;
+ case XML_DOCUMENT_NODE:
+ // m_aNodeType = NodeType::DOCUMENT_NODE;
+ OSL_ENSURE(false, "CDocument::GetCNode is not supposed to"
+ " create a CDocument!!!");
+ pCNode = static_cast< CNode* >(new CDocument(
+ reinterpret_cast<xmlDocPtr>(pNode)));
+ break;
+ case XML_DOCUMENT_TYPE_NODE:
+ case XML_DTD_NODE:
+ // m_aNodeType = NodeType::DOCUMENT_TYPE_NODE;
+ pCNode = static_cast< CNode* >(new CDocumentType(*this, m_Mutex,
+ reinterpret_cast<xmlDtdPtr>(pNode)));
+ break;
+ case XML_DOCUMENT_FRAG_NODE:
+ // m_aNodeType = NodeType::DOCUMENT_FRAGMENT_NODE;
+ pCNode = static_cast< CNode* >(
+ new CDocumentFragment(*this, m_Mutex, pNode));
+ break;
+ case XML_NOTATION_NODE:
+ // m_aNodeType = NodeType::NOTATION_NODE;
+ pCNode = static_cast< CNode* >(new CNotation(*this, m_Mutex,
+ reinterpret_cast<xmlNotationPtr>(pNode)));
+ break;
+ case XML_ATTRIBUTE_NODE:
+ // m_aNodeType = NodeType::ATTRIBUTE_NODE;
+ pCNode = static_cast< CNode* >(new CAttr(*this, m_Mutex,
+ reinterpret_cast<xmlAttrPtr>(pNode)));
+ break;
+ // unsupported node types
+ case XML_HTML_DOCUMENT_NODE:
+ case XML_ELEMENT_DECL:
+ case XML_ATTRIBUTE_DECL:
+ case XML_ENTITY_DECL:
+ case XML_NAMESPACE_DECL:
+ default:
+ break;
+ }
+
+ if (pCNode != 0) {
+ bool const bInserted = m_NodeMap.insert(
+ nodemap_t::value_type(pNode,
+ ::std::make_pair(WeakReference<XNode>(pCNode.get()),
+ pCNode.get()))
+ ).second;
+ OSL_ASSERT(bInserted);
+ if (!bInserted) {
+ // if insertion failed, delete new instance and return null
+ return 0;
+ }
+ }
+
+ OSL_ENSURE(pCNode.is(), "no node produced during CDocument::GetCNode!");
+ return pCNode;
+ }
+
+
+ CDocument & CDocument::GetOwnerDocument()
+ {
+ return *this;
+ }
+
+ void CDocument::saxify(const Reference< XDocumentHandler >& i_xHandler)
+ {
i_xHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) {
- CNode * pNode = CNode::get(pChild);
+ ::rtl::Reference<CNode> const pNode = GetCNode(pChild);
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
pNode->saxify(i_xHandler);
}
i_xHandler->endDocument();
}
- void SAL_CALL CDocument::fastSaxify( Context& rContext ) {
+ void CDocument::fastSaxify( Context& rContext )
+ {
rContext.mxDocHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) {
- CNode * pNode = CNode::get(pChild);
+ ::rtl::Reference<CNode> const pNode = GetCNode(pChild);
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
pNode->fastSaxify(rContext);
}
rContext.mxDocHandler->endDocument();
}
+ bool CDocument::IsChildTypeAllowed(NodeType const nodeType)
+ {
+ switch (nodeType) {
+ case NodeType_PROCESSING_INSTRUCTION_NODE:
+ case NodeType_COMMENT_NODE:
+ return true;
+ case NodeType_ELEMENT_NODE:
+ // there may be only one!
+ return 0 == lcl_getDocumentRootPtr(m_aDocPtr);
+ case NodeType_DOCUMENT_TYPE_NODE:
+ // there may be only one!
+ return 0 == lcl_getDocumentType(m_aDocPtr);
+ default:
+ return false;
+ }
+ }
+
+
void SAL_CALL CDocument::addListener(const Reference< XStreamListener >& aListener )
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
m_streamListeners.insert(aListener);
}
void SAL_CALL CDocument::removeListener(const Reference< XStreamListener >& aListener )
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
m_streamListeners.erase(aListener);
}
@@ -134,30 +372,42 @@ namespace DOM
void SAL_CALL CDocument::start()
throw (RuntimeException)
{
- if (! m_rOutputStream.is()) return;
+ listenerlist_t streamListeners;
+ {
+ ::osl::MutexGuard const g(m_Mutex);
+
+ if (! m_rOutputStream.is()) { throw RuntimeException(); }
+ streamListeners = m_streamListeners;
+ }
- // notify listners about start
- listenerlist_t::const_iterator iter1 = m_streamListeners.begin();
- while (iter1 != m_streamListeners.end()) {
+ // notify listeners about start
+ listenerlist_t::const_iterator iter1 = streamListeners.begin();
+ while (iter1 != streamListeners.end()) {
Reference< XStreamListener > aListener = *iter1;
aListener->started();
iter1++;
}
- // setup libxml IO and write data to output stream
- IOContext ioctx = {m_rOutputStream, false};
- xmlOutputBufferPtr pOut = xmlOutputBufferCreateIO(
- writeCallback, closeCallback, &ioctx, NULL);
- xmlSaveFileTo(pOut, m_aNodePtr->doc, NULL);
+ {
+ ::osl::MutexGuard const g(m_Mutex);
+
+ // check again! could have been reset...
+ if (! m_rOutputStream.is()) { throw RuntimeException(); }
+
+ // setup libxml IO and write data to output stream
+ IOContext ioctx = {m_rOutputStream, false};
+ xmlOutputBufferPtr pOut = xmlOutputBufferCreateIO(
+ writeCallback, closeCallback, &ioctx, NULL);
+ xmlSaveFileTo(pOut, m_aNodePtr->doc, NULL);
+ }
// call listeners
- listenerlist_t::const_iterator iter2 = m_streamListeners.begin();
- while (iter2 != m_streamListeners.end()) {
+ listenerlist_t::const_iterator iter2 = streamListeners.begin();
+ while (iter2 != streamListeners.end()) {
Reference< XStreamListener > aListener = *iter2;
aListener->closed();
iter2++;
}
-
}
void SAL_CALL CDocument::terminate()
@@ -169,11 +419,15 @@ namespace DOM
void SAL_CALL CDocument::setOutputStream( const Reference< XOutputStream >& aStream )
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
m_rOutputStream = aStream;
}
Reference< XOutputStream > SAL_CALL CDocument::getOutputStream() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
return m_rOutputStream;
}
@@ -181,10 +435,16 @@ namespace DOM
Reference< XAttr > SAL_CALL CDocument::createAttribute(const OUString& name)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
- return Reference< XAttr >(static_cast< CAttr* >(
- CNode::get((xmlNodePtr)xmlNewDocProp(m_aDocPtr, xName, NULL))));
+ xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr, xName, NULL);
+ ::rtl::Reference< CAttr > const pCAttr(
+ dynamic_cast< CAttr* >(GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr)).get()));
+ pCAttr->m_bUnlinked = true;
+ return pCAttr.get();
};
// Creates an attribute of the given qualified name and namespace URI.
@@ -192,73 +452,96 @@ namespace DOM
const OUString& ns, const OUString& qname)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
// libxml does not allow a NS definition to be attached to an
// attribute node - which is a good thing, since namespaces are
// only defined as parts of element nodes
- // thus, we create a temporary element node which carries the ns definition
- // and is removed/merged as soon as the attribute gets append to it's
- // actual parent
+ // thus the namespace data is stored in CAttr::m_pNamespace
sal_Int32 i = qname.indexOf(':');
OString oPrefix, oName, oUri;
- xmlChar *xPrefix, *xName, *xUri;
if (i != -1)
{
oPrefix = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
- xPrefix = (xmlChar*)oPrefix.getStr();
oName = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
}
else
{
- xPrefix = (xmlChar*)"";
oName = OUStringToOString(qname, RTL_TEXTENCODING_UTF8);
}
- xName = (xmlChar*)oName.getStr();
oUri = OUStringToOString(ns, RTL_TEXTENCODING_UTF8);
- xUri = (xmlChar*)oUri.getStr();
+ xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr,
+ reinterpret_cast<xmlChar const*>(oName.getStr()), 0);
+ ::rtl::Reference< CAttr > const pCAttr(
+ dynamic_cast< CAttr* >(GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr)).get()));
+ if (!pCAttr.is()) { throw RuntimeException(); }
+ // store the namespace data!
+ pCAttr->m_pNamespace.reset( new stringpair_t(oUri, oPrefix) );
+ pCAttr->m_bUnlinked = true;
- // create the carrier node
- xmlNodePtr pNode = xmlNewDocNode(m_aDocPtr, NULL, (xmlChar*)"__private", NULL);
- xmlNsPtr pNs = xmlNewNs(pNode, xUri, xPrefix);
- xmlAttrPtr pAttr = xmlNewNsProp(pNode, pNs, xName, NULL);
- return Reference< XAttr >(static_cast< CAttr* >(CNode::get((xmlNodePtr)pAttr)));
+ return pCAttr.get();
};
// Creates a CDATASection node whose value is the specified string.
Reference< XCDATASection > SAL_CALL CDocument::createCDATASection(const OUString& data)
throw (RuntimeException)
{
- xmlChar *xData = (xmlChar*)OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr();
- xmlNodePtr pText = xmlNewCDataBlock(m_aDocPtr, xData, strlen((char*)xData));
- return Reference< XCDATASection >(static_cast< CCDATASection* >(CNode::get(pText)));
+ ::osl::MutexGuard const g(m_Mutex);
+
+ OString const oData(
+ ::rtl::OUStringToOString(data, RTL_TEXTENCODING_UTF8));
+ xmlChar const*const pData =
+ reinterpret_cast<xmlChar const*>(oData.getStr());
+ xmlNodePtr const pText =
+ xmlNewCDataBlock(m_aDocPtr, pData, strlen(oData.getStr()));
+ Reference< XCDATASection > const xRet(
+ static_cast< XNode* >(GetCNode(pText).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// Creates a Comment node given the specified string.
Reference< XComment > SAL_CALL CDocument::createComment(const OUString& data)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
xmlChar *xData = (xmlChar*)o1.getStr();
xmlNodePtr pComment = xmlNewDocComment(m_aDocPtr, xData);
- return Reference< XComment >(static_cast< CComment* >(CNode::get(pComment)));
+ Reference< XComment > const xRet(
+ static_cast< XNode* >(GetCNode(pComment).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
//Creates an empty DocumentFragment object.
Reference< XDocumentFragment > SAL_CALL CDocument::createDocumentFragment()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
xmlNodePtr pFrag = xmlNewDocFragment(m_aDocPtr);
- return Reference< XDocumentFragment >(static_cast< CDocumentFragment* >(CNode::get(pFrag)));
+ Reference< XDocumentFragment > const xRet(
+ static_cast< XNode* >(GetCNode(pFrag).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// Creates an element of the type specified.
Reference< XElement > SAL_CALL CDocument::createElement(const OUString& tagName)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
- xmlNodePtr aNodePtr = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
- return Reference< XElement >(static_cast< CElement* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
+ Reference< XElement > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// Creates an element of the given qualified name and namespace URI.
@@ -266,6 +549,8 @@ namespace DOM
const OUString& ns, const OUString& qname)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
sal_Int32 i = qname.indexOf(':');
if (ns.getLength() == 0) throw RuntimeException();
xmlChar *xPrefix;
@@ -287,20 +572,28 @@ namespace DOM
// xmlNsPtr aNsPtr = xmlNewReconciledNs?
// xmlNsPtr aNsPtr = xmlNewGlobalNs?
- xmlNodePtr aNodePtr = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
- xmlNsPtr pNs = xmlNewNs(aNodePtr, xUri, xPrefix);
- xmlSetNs(aNodePtr, pNs);
- return Reference< XElement >(static_cast< CElement* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
+ xmlNsPtr const pNs = xmlNewNs(pNode, xUri, xPrefix);
+ xmlSetNs(pNode, pNs);
+ Reference< XElement > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
//Creates an EntityReference object.
Reference< XEntityReference > SAL_CALL CDocument::createEntityReference(const OUString& name)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
- xmlNodePtr aNodePtr = xmlNewReference(m_aDocPtr, xName);
- return Reference< XEntityReference >(static_cast< CEntityReference* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pNode = xmlNewReference(m_aDocPtr, xName);
+ Reference< XEntityReference > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// Creates a ProcessingInstruction node given the specified name and
@@ -309,23 +602,33 @@ namespace DOM
const OUString& target, const OUString& data)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(target, RTL_TEXTENCODING_UTF8);
xmlChar *xTarget = (xmlChar*)o1.getStr();
OString o2 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
xmlChar *xData = (xmlChar*)o2.getStr();
- xmlNodePtr aNodePtr = xmlNewPI(xTarget, xData);
- aNodePtr->doc = m_aDocPtr;
- return Reference< XProcessingInstruction >(static_cast< CProcessingInstruction* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pNode = xmlNewDocPI(m_aDocPtr, xTarget, xData);
+ pNode->doc = m_aDocPtr;
+ Reference< XProcessingInstruction > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// Creates a Text node given the specified string.
Reference< XText > SAL_CALL CDocument::createTextNode(const OUString& data)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
OString o1 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
xmlChar *xData = (xmlChar*)o1.getStr();
- xmlNodePtr aNodePtr = xmlNewDocText(m_aDocPtr, xData);
- return Reference< XText >(static_cast< CText* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pNode = xmlNewDocText(m_aDocPtr, xData);
+ Reference< XText > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
// The Document Type Declaration (see DocumentType) associated with this
@@ -333,27 +636,13 @@ namespace DOM
Reference< XDocumentType > SAL_CALL CDocument::getDoctype()
throw (RuntimeException)
{
- // find the doc type
- xmlNodePtr cur = m_aDocPtr->children;
- while (cur != NULL)
- {
- if (cur->type == XML_DOCUMENT_TYPE_NODE || cur->type == XML_DTD_NODE)
- break;
- }
- return Reference< XDocumentType >(static_cast< CDocumentType* >(CNode::get(cur)));
- }
+ ::osl::MutexGuard const g(m_Mutex);
- /// get the pointer to the root element node of the document
- static xmlNodePtr SAL_CALL _getDocumentRootPtr(xmlDocPtr i_pDocument) {
- // find the document element
- xmlNodePtr cur = i_pDocument->children;
- while (cur != NULL)
- {
- if (cur->type == XML_ELEMENT_NODE)
- break;
- cur = cur->next;
- }
- return cur;
+ xmlNodePtr const pDocType(lcl_getDocumentType(m_aDocPtr));
+ Reference< XDocumentType > const xRet(
+ static_cast< XNode* >(GetCNode(pDocType).get()),
+ UNO_QUERY);
+ return xRet;
}
// This is a convenience attribute that allows direct access to the child
@@ -361,13 +650,19 @@ namespace DOM
Reference< XElement > SAL_CALL CDocument::getDocumentElement()
throw (RuntimeException)
{
- xmlNodePtr cur = _getDocumentRootPtr(m_aDocPtr);
- return Reference< XElement >(static_cast< CElement* >(CNode::get(cur)));
+ ::osl::MutexGuard const g(m_Mutex);
+
+ xmlNodePtr const pNode = lcl_getDocumentRootPtr(m_aDocPtr);
+ if (!pNode) { return 0; }
+ Reference< XElement > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY);
+ return xRet;
}
- static xmlNodePtr _search_element_by_id(const xmlNodePtr cur, const xmlChar* id)
+ static xmlNodePtr
+ lcl_search_element_by_id(const xmlNodePtr cur, const xmlChar* id)
{
-
if (cur == NULL)
return NULL;
// look in current node
@@ -384,175 +679,195 @@ namespace DOM
}
}
// look in children
- xmlNodePtr result = _search_element_by_id(cur->children, id);
+ xmlNodePtr result = lcl_search_element_by_id(cur->children, id);
if (result != NULL)
return result;
- result = _search_element_by_id(cur->next, id);
+ result = lcl_search_element_by_id(cur->next, id);
return result;
}
// Returns the Element whose ID is given by elementId.
- Reference< XElement > SAL_CALL CDocument::getElementById(const OUString& elementId)
+ Reference< XElement > SAL_CALL
+ CDocument::getElementById(const OUString& elementId)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
// search the tree for an element with the given ID
OString o1 = OUStringToOString(elementId, RTL_TEXTENCODING_UTF8);
xmlChar *xId = (xmlChar*)o1.getStr();
- xmlNodePtr pStart = CNode::getNodePtr(getDocumentElement().get());
- xmlNodePtr aNodePtr = _search_element_by_id(pStart, xId);
- return Reference< XElement >(static_cast< CElement* >(CNode::get(aNodePtr)));
+ xmlNodePtr const pStart = lcl_getDocumentRootPtr(m_aDocPtr);
+ if (!pStart) { return 0; }
+ xmlNodePtr const pNode = lcl_search_element_by_id(pStart, xId);
+ Reference< XElement > const xRet(
+ static_cast< XNode* >(GetCNode(pNode).get()),
+ UNO_QUERY);
+ return xRet;
}
- Reference< XNodeList > SAL_CALL CDocument::getElementsByTagName(const OUString& tagname)
+ Reference< XNodeList > SAL_CALL
+ CDocument::getElementsByTagName(OUString const& rTagname)
throw (RuntimeException)
{
- // build a list
- return Reference< XNodeList >(
- new CElementList(static_cast< CElement* >(
- this->getDocumentElement().get()), tagname));
+ ::osl::MutexGuard const g(m_Mutex);
+
+ Reference< XNodeList > const xRet(
+ new CElementList(this->GetDocumentElement(), m_Mutex, rTagname));
+ return xRet;
}
Reference< XNodeList > SAL_CALL CDocument::getElementsByTagNameNS(
- const OUString& namespaceURI, const OUString& localName)
+ OUString const& rNamespaceURI, OUString const& rLocalName)
throw (RuntimeException)
{
- return Reference< XNodeList >(
- new CElementList(static_cast< CElement* >(
- this->getDocumentElement().get()), namespaceURI, localName));
+ ::osl::MutexGuard const g(m_Mutex);
+
+ Reference< XNodeList > const xRet(
+ new CElementList(this->GetDocumentElement(), m_Mutex,
+ rLocalName, &rNamespaceURI));
+ return xRet;
}
Reference< XDOMImplementation > SAL_CALL CDocument::getImplementation()
throw (RuntimeException)
{
- // XXX
+ // does not need mutex currently
return Reference< XDOMImplementation >(CDOMImplementation::get());
}
- // helper function to recall import for siblings
- static Reference< XNode > _import_siblings (
- const Reference< XNode > aNode, const Reference< XNode> parent, CDocument* pTarget)
+ // helper function to recursively import siblings
+ static void lcl_ImportSiblings(
+ Reference< XDocument > const& xTargetDocument,
+ Reference< XNode > const& xTargetParent,
+ Reference< XNode > const& xChild)
{
- Reference< XNode > sibling = aNode;
- Reference< XNode > tmp;
- Reference< XNode > firstImported;
- while (sibling.is())
+ Reference< XNode > xSibling = xChild;
+ while (xSibling.is())
{
- tmp = pTarget->importNode(sibling, sal_True);
- parent->appendChild(tmp);
- if (!firstImported.is())
- firstImported = tmp;
- sibling = sibling->getNextSibling();
+ Reference< XNode > const xTmp(
+ xTargetDocument->importNode(xSibling, sal_True));
+ xTargetParent->appendChild(xTmp);
+ xSibling = xSibling->getNextSibling();
}
- return firstImported;
}
- Reference< XNode > SAL_CALL CDocument::importNode(
- const Reference< XNode >& importedNode, sal_Bool deep)
- throw (RuntimeException, DOMException)
+ static Reference< XNode >
+ lcl_ImportNode( Reference< XDocument > const& xDocument,
+ Reference< XNode > const& xImportedNode, sal_Bool deep)
{
- // this node could be from another memory model
- // only use uno interfaces to access is!!!
-
- // allready in doc?
- if ( importedNode->getOwnerDocument() ==
- Reference< XDocument>(static_cast< CDocument* >(CNode::get((xmlNodePtr)m_aDocPtr))))
- return importedNode;
-
- Reference< XNode > aNode;
- NodeType aNodeType = importedNode->getNodeType();
+ Reference< XNode > xNode;
+ NodeType aNodeType = xImportedNode->getNodeType();
switch (aNodeType)
{
case NodeType_ATTRIBUTE_NODE:
{
- Reference< XAttr > attr(importedNode, UNO_QUERY);
- Reference< XAttr > newAttr = createAttribute(attr->getName());
- newAttr->setValue(attr->getValue());
- aNode.set(newAttr, UNO_QUERY);
+ Reference< XAttr > const xAttr(xImportedNode, UNO_QUERY_THROW);
+ Reference< XAttr > const xNew =
+ xDocument->createAttribute(xAttr->getName());
+ xNew->setValue(xAttr->getValue());
+ xNode.set(xNew, UNO_QUERY);
break;
}
case NodeType_CDATA_SECTION_NODE:
{
- Reference< XCDATASection > cdata(importedNode, UNO_QUERY);
- Reference< XCDATASection > newCdata = createCDATASection(cdata->getData());
- aNode.set(newCdata, UNO_QUERY);
+ Reference< XCDATASection > const xCData(xImportedNode,
+ UNO_QUERY_THROW);
+ Reference< XCDATASection > const xNewCData =
+ xDocument->createCDATASection(xCData->getData());
+ xNode.set(xNewCData, UNO_QUERY);
break;
}
case NodeType_COMMENT_NODE:
{
- Reference< XComment > comment(importedNode, UNO_QUERY);
- Reference< XComment > newComment = createComment(comment->getData());
- aNode.set(newComment, UNO_QUERY);
+ Reference< XComment > const xComment(xImportedNode,
+ UNO_QUERY_THROW);
+ Reference< XComment > const xNewComment =
+ xDocument->createComment(xComment->getData());
+ xNode.set(xNewComment, UNO_QUERY);
break;
}
case NodeType_DOCUMENT_FRAGMENT_NODE:
{
- Reference< XDocumentFragment > frag(importedNode, UNO_QUERY);
- Reference< XDocumentFragment > newFrag = createDocumentFragment();
- aNode.set(newFrag, UNO_QUERY);
+ Reference< XDocumentFragment > const xFrag(xImportedNode,
+ UNO_QUERY_THROW);
+ Reference< XDocumentFragment > const xNewFrag =
+ xDocument->createDocumentFragment();
+ xNode.set(xNewFrag, UNO_QUERY);
break;
}
case NodeType_ELEMENT_NODE:
{
- Reference< XElement > element(importedNode, UNO_QUERY);
- OUString aNsUri = importedNode->getNamespaceURI();
- OUString aNsPrefix = importedNode->getPrefix();
- OUString aQName = element->getTagName();
- Reference< XElement > newElement;
+ Reference< XElement > const xElement(xImportedNode,
+ UNO_QUERY_THROW);
+ OUString const aNsUri = xImportedNode->getNamespaceURI();
+ OUString const aNsPrefix = xImportedNode->getPrefix();
+ OUString aQName = xElement->getTagName();
+ Reference< XElement > xNewElement;
if (aNsUri.getLength() > 0)
{
-
- if (aNsPrefix.getLength() > 0)
- aQName = aNsPrefix + OUString::createFromAscii(":") + aQName;
- newElement = createElementNS(aNsUri, aQName);
+ if (aNsPrefix.getLength() > 0) {
+ aQName = aNsPrefix + OUString::createFromAscii(":")
+ + aQName;
+ }
+ xNewElement = xDocument->createElementNS(aNsUri, aQName);
+ } else {
+ xNewElement = xDocument->createElement(aQName);
}
- else
- newElement = createElement(aQName);
// get attributes
- if (element->hasAttributes())
+ if (xElement->hasAttributes())
{
- Reference< XNamedNodeMap > attribs = element->getAttributes();
- Reference< XAttr > curAttr;
+ Reference< XNamedNodeMap > attribs = xElement->getAttributes();
for (sal_Int32 i = 0; i < attribs->getLength(); i++)
{
- curAttr = Reference< XAttr >(attribs->item(i), UNO_QUERY);
- OUString aAttrUri = curAttr->getNamespaceURI();
- OUString aAttrPrefix = curAttr->getPrefix();
+ Reference< XAttr > const curAttr(attribs->item(i),
+ UNO_QUERY_THROW);
+ OUString const aAttrUri = curAttr->getNamespaceURI();
+ OUString const aAttrPrefix = curAttr->getPrefix();
OUString aAttrName = curAttr->getName();
+ OUString const sValue = curAttr->getValue();
if (aAttrUri.getLength() > 0)
{
- if (aAttrPrefix.getLength() > 0)
- aAttrName = aAttrPrefix + OUString::createFromAscii(":") + aAttrName;
- newElement->setAttributeNS(aAttrUri, aAttrName, curAttr->getValue());
+ if (aAttrPrefix.getLength() > 0) {
+ aAttrName = aAttrPrefix +
+ OUString::createFromAscii(":") + aAttrName;
+ }
+ xNewElement->setAttributeNS(
+ aAttrUri, aAttrName, sValue);
+ } else {
+ xNewElement->setAttribute(aAttrName, sValue);
}
- else
- newElement->setAttribute(aAttrName, curAttr->getValue());
}
}
- aNode.set(newElement, UNO_QUERY);
+ xNode.set(xNewElement, UNO_QUERY);
break;
}
case NodeType_ENTITY_REFERENCE_NODE:
{
- Reference< XEntityReference > ref(importedNode, UNO_QUERY);
- Reference< XEntityReference > newRef(createEntityReference(ref->getNodeName()));
- aNode.set(newRef, UNO_QUERY);
+ Reference< XEntityReference > const xRef(xImportedNode,
+ UNO_QUERY_THROW);
+ Reference< XEntityReference > const xNewRef(
+ xDocument->createEntityReference(xRef->getNodeName()));
+ xNode.set(xNewRef, UNO_QUERY);
break;
}
case NodeType_PROCESSING_INSTRUCTION_NODE:
{
- Reference< XProcessingInstruction > pi(importedNode, UNO_QUERY);
- Reference< XProcessingInstruction > newPi(
- createProcessingInstruction(pi->getTarget(), pi->getData()));
- aNode.set(newPi, UNO_QUERY);
+ Reference< XProcessingInstruction > const xPi(xImportedNode,
+ UNO_QUERY_THROW);
+ Reference< XProcessingInstruction > const xNewPi(
+ xDocument->createProcessingInstruction(
+ xPi->getTarget(), xPi->getData()));
+ xNode.set(xNewPi, UNO_QUERY);
break;
}
case NodeType_TEXT_NODE:
{
- Reference< XText > text(importedNode, UNO_QUERY);
- Reference< XText > newText(createTextNode(text->getData()));
- aNode.set(newText, UNO_QUERY);
+ Reference< XText > const xText(xImportedNode, UNO_QUERY_THROW);
+ Reference< XText > const xNewText(
+ xDocument->createTextNode(xText->getData()));
+ xNode.set(xNewText, UNO_QUERY);
break;
}
case NodeType_ENTITY_NODE:
@@ -567,10 +882,10 @@ namespace DOM
if (deep)
{
// get children and import them
- Reference< XNode > child = importedNode->getFirstChild();
- if (child.is())
+ Reference< XNode > const xChild = xImportedNode->getFirstChild();
+ if (xChild.is())
{
- _import_siblings(child, aNode, this);
+ lcl_ImportSiblings(xDocument, xNode, xChild);
}
}
@@ -585,30 +900,86 @@ namespace DOM
* Cancelable: No
* Context Info: None
*/
- if (aNode.is())
+ if (xNode.is())
{
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMNodeInsertedIntoDocument")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMNodeInsertedIntoDocument")
+ Reference< XDocumentEvent > const xDocevent(xDocument, UNO_QUERY);
+ Reference< XMutationEvent > const event(xDocevent->createEvent(
+ OUString::createFromAscii("DOMNodeInsertedIntoDocument")),
+ UNO_QUERY_THROW);
+ event->initMutationEvent(
+ OUString::createFromAscii("DOMNodeInsertedIntoDocument")
, sal_True, sal_False, Reference< XNode >(),
OUString(), OUString(), OUString(), (AttrChangeType)0 );
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ Reference< XEventTarget > const xDocET(xDocument, UNO_QUERY);
+ xDocET->dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
}
- return aNode;
+ return xNode;
}
+
+ Reference< XNode > SAL_CALL CDocument::importNode(
+ Reference< XNode > const& xImportedNode, sal_Bool deep)
+ throw (RuntimeException, DOMException)
+ {
+ if (!xImportedNode.is()) { throw RuntimeException(); }
+
+ // NB: this whole operation inherently accesses 2 distinct documents.
+ // The imported node could even be from a different DOM implementation,
+ // so this implementation cannot make any assumptions about the
+ // locking strategy of the imported node.
+ // So the import takes no lock on this document;
+ // it only calls UNO methods on this document that temporarily
+ // lock the document, and UNO methods on the imported node that
+ // may temporarily lock the other document.
+ // As a consequence, the import is not atomic with regard to
+ // concurrent modifications of either document, but it should not
+ // deadlock.
+ // To ensure that no members are accessed, the implementation is in
+ // static non-member functions.
+
+ Reference< XDocument > const xDocument(this);
+ // already in doc?
+ if (xImportedNode->getOwnerDocument() == xDocument) {
+ return xImportedNode;
+ }
+
+ Reference< XNode > const xNode(
+ lcl_ImportNode(xDocument, xImportedNode, deep) );
+ return xNode;
+ }
+
+
OUString SAL_CALL CDocument::getNodeName()throw (RuntimeException)
{
+ // does not need mutex currently
return OUString::createFromAscii("#document");
}
+
OUString SAL_CALL CDocument::getNodeValue() throw (RuntimeException)
{
+ // does not need mutex currently
return OUString();
}
+ Reference< XNode > SAL_CALL CDocument::cloneNode(sal_Bool bDeep)
+ throw (RuntimeException)
+ {
+ ::osl::MutexGuard const g(m_rMutex);
+
+ OSL_ASSERT(0 != m_aNodePtr);
+ if (0 == m_aNodePtr) {
+ return 0;
+ }
+ xmlDocPtr const pClone(xmlCopyDoc(m_aDocPtr, (bDeep) ? 1 : 0));
+ if (0 == pClone) { return 0; }
+ Reference< XNode > const xRet(
+ static_cast<CNode*>(CDocument::CreateCDocument(pClone).get()));
+ return xRet;
+ }
+
Reference< XEvent > SAL_CALL CDocument::createEvent(const OUString& aType) throw (RuntimeException)
{
+ // does not need mutex currently
events::CEvent *pEvent = 0;
if (
aType.compareToAscii("DOMSubtreeModified") == 0||
@@ -650,8 +1021,10 @@ namespace DOM
const Sequence< beans::StringPair >& i_rNamespaces)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
// add new namespaces to root node
- xmlNodePtr pRoot = _getDocumentRootPtr(m_aDocPtr);
+ xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
if (0 != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq;
@@ -665,7 +1038,7 @@ namespace DOM
reinterpret_cast<const xmlChar*>(prefix.getStr()));
}
// eliminate duplicate namespace declarations
- _nscleanup(pRoot->children, pRoot);
+ nscleanup(pRoot->children, pRoot);
}
saxify(i_xHandler);
}
@@ -677,8 +1050,10 @@ namespace DOM
const Sequence< beans::Pair< rtl::OUString, sal_Int32 > >& i_rRegisterNamespaces )
throw (SAXException, RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
// add new namespaces to root node
- xmlNodePtr pRoot = _getDocumentRootPtr(m_aDocPtr);
+ xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
if (0 != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq;
@@ -692,7 +1067,7 @@ namespace DOM
reinterpret_cast<const xmlChar*>(prefix.getStr()));
}
// eliminate duplicate namespace declarations
- _nscleanup(pRoot->children, pRoot);
+ nscleanup(pRoot->children, pRoot);
}
Context aContext(i_xHandler,
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx
index 3fe593ff2b24..c85a85fba9a6 100644
--- a/unoxml/source/dom/document.hxx
+++ b/unoxml/source/dom/document.hxx
@@ -25,15 +25,19 @@
*
************************************************************************/
-#ifndef _DOCUMENT_HXX
-#define _DOCUMENT_HXX
+#ifndef DOM_DOCUMENT_HXX
+#define DOM_DOCUMENT_HXX
-#include <list>
#include <set>
+#include <memory>
+
+#include <libxml/tree.h>
+
#include <sal/types.h>
+
#include <cppuhelper/implbase6.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XAttr.hpp>
@@ -52,13 +56,11 @@
#include "node.hxx"
-#include <libxml/tree.h>
using namespace std;
using ::rtl::OUString;
using namespace com::sun::star;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::sax;
using namespace com::sun::star::io;
using namespace com::sun::star::xml::dom;
@@ -66,32 +68,70 @@ using namespace com::sun::star::xml::dom::events;
namespace DOM
{
+ namespace events {
+ class CEventDispatcher;
+ }
+
+ class CElement;
- class CDocument : public cppu::ImplInheritanceHelper6<
- CNode, XDocument, XDocumentEvent,
- XActiveDataControl, XActiveDataSource, XSAXSerializable, XFastSAXSerializable>
+ typedef ::cppu::ImplInheritanceHelper6<
+ CNode, XDocument, XDocumentEvent,
+ XActiveDataControl, XActiveDataSource,
+ XSAXSerializable, XFastSAXSerializable>
+ CDocument_Base;
+
+ class CDocument
+ : public CDocument_Base
{
- friend class CNode;
- typedef set< Reference< XStreamListener > > listenerlist_t;
- private:
- xmlDocPtr m_aDocPtr;
+ private:
+ /// this Mutex is used for synchronization of all UNO wrapper
+ /// objects that belong to this document
+ ::osl::Mutex m_Mutex;
+ /// the libxml document: freed in destructor
+ /// => all UNO wrapper objects must keep the CDocument alive
+ xmlDocPtr const m_aDocPtr;
// datacontrol/source state
+ typedef set< Reference< XStreamListener > > listenerlist_t;
listenerlist_t m_streamListeners;
Reference< XOutputStream > m_rOutputStream;
- protected:
- CDocument(xmlDocPtr aDocPtr);
+ typedef std::map< const xmlNodePtr,
+ ::std::pair< WeakReference<XNode>, CNode* > > nodemap_t;
+ nodemap_t m_NodeMap;
+
+ ::std::auto_ptr<events::CEventDispatcher> const m_pEventDispatcher;
+
+ CDocument(xmlDocPtr const pDocPtr);
+
public:
+ /// factory: only way to create instance!
+ static ::rtl::Reference<CDocument>
+ CreateCDocument(xmlDocPtr const pDoc);
virtual ~CDocument();
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ // needed by CXPathAPI
+ ::osl::Mutex & GetMutex() { return m_Mutex; }
+
+ events::CEventDispatcher & GetEventDispatcher();
+ ::rtl::Reference< CElement > GetDocumentElement();
+
+ /// get UNO wrapper instance for a libxml node
+ ::rtl::Reference<CNode> GetCNode(
+ xmlNodePtr const pNode, bool const bCreate = true);
+ /// remove a UNO wrapper instance
+ void RemoveCNode(xmlNodePtr const pNode, CNode const*const pCNode);
+
+ virtual CDocument & GetOwnerDocument();
- virtual void SAL_CALL fastSaxify( Context& rContext );
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
+
+ virtual void fastSaxify( Context& rContext );
+
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
/**
Creates an Attr of the given name.
@@ -224,17 +264,14 @@ namespace DOM
throw (RuntimeException);
virtual OUString SAL_CALL getNodeValue()
throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
+ throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
throw (RuntimeException, DOMException)
{
return CNode::appendChild(newChild);
}
- virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
- throw (RuntimeException)
- {
- return CNode::cloneNode(deep);
- }
virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
throw (RuntimeException)
{
@@ -307,7 +344,7 @@ namespace DOM
}
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (DOMException)
+ throw (RuntimeException, DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 484c04b7f23b..695ccb670e4c 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -25,9 +25,16 @@
*
************************************************************************/
-#include "documentbuilder.hxx"
-#include "node.hxx"
-#include "document.hxx"
+#include <documentbuilder.hxx>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <libxml/xmlerror.h>
+#include <libxml/tree.h>
+
+#include <boost/shared_ptr.hpp>
#include <rtl/alloc.h>
#include <rtl/memory.h>
@@ -35,17 +42,15 @@
#include <cppuhelper/implbase1.hxx>
-#include <libxml/xmlerror.h>
-
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
+#include <node.hxx>
+#include <document.hxx>
using ::rtl::OUStringBuffer;
@@ -58,21 +63,6 @@ using ::com::sun::star::task::XInteractionHandler;
namespace DOM
{
- extern "C" {
- //char *strdup(const char *s);
- /*
- static char* strdupfunc(const char* s)
- {
- sal_Int32 len = 0;
- while (s[len] != '\0') len++;
- char *newStr = (char*)rtl_allocateMemory(len+1);
- if (newStr != NULL)
- rtl_copyMemory(newStr, s, len+1);
- return newStr;
- }
- */
- }
-
class CDefaultEntityResolver : public cppu::WeakImplHelper1< XEntityResolver >
{
@@ -101,9 +91,10 @@ namespace DOM
};
- CDocumentBuilder::CDocumentBuilder(const Reference< XMultiServiceFactory >& xFactory)
- : m_aFactory(xFactory)
- , m_aEntityResolver(Reference< XEntityResolver > (new CDefaultEntityResolver()))
+ CDocumentBuilder::CDocumentBuilder(
+ Reference< XMultiServiceFactory > const& xFactory)
+ : m_xFactory(xFactory)
+ , m_xEntityResolver(new CDefaultEntityResolver())
{
// init libxml. libxml will protect itself against multiple
// initializations so there is no problem here if this gets
@@ -113,7 +104,6 @@ namespace DOM
Reference< XInterface > CDocumentBuilder::_getInstance(const Reference< XMultiServiceFactory >& rSMgr)
{
- // XXX
return static_cast< XDocumentBuilder* >(new CDocumentBuilder(rSMgr));
}
@@ -182,9 +172,13 @@ namespace DOM
Reference< XDocument > SAL_CALL CDocumentBuilder::newDocument()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
// create a new document
xmlDocPtr pDocument = xmlNewDoc((const xmlChar*)"1.0");
- return Reference< XDocument >(static_cast< CDocument* >(CNode::get((xmlNodePtr)pDocument)));
+ Reference< XDocument > const xRet(
+ CDocument::CreateCDocument(pDocument).get());
+ return xRet;
}
static OUString make_error_message(xmlParserCtxtPtr ctxt)
@@ -287,11 +281,13 @@ namespace DOM
return pInput;
}
+#if 0
static xmlParserInputPtr external_entity_loader(const char *URL, const char * /*ID*/, xmlParserCtxtPtr ctxt)
{
// just call our resolver function using the URL as systemId
return resolve_func(ctxt, 0, (const xmlChar*)URL);
}
+#endif
// default warning handler triggers assertion
static void warning_func(void * ctx, const char * /*msg*/, ...)
@@ -315,7 +311,6 @@ namespace DOM
void throwEx(xmlParserCtxtPtr ctxt) {
OUString msg = make_error_message(ctxt);
- xmlFreeParserCtxt(ctxt);
com::sun::star::xml::sax::SAXParseException saxex;
saxex.Message = msg;
saxex.LineNumber = static_cast<sal_Int32>(ctxt->lastError.line);
@@ -326,6 +321,11 @@ namespace DOM
Reference< XDocument > SAL_CALL CDocumentBuilder::parse(const Reference< XInputStream >& is)
throw (RuntimeException, SAXParseException, IOException)
{
+ if (!is.is()) {
+ throw RuntimeException();
+ }
+
+ ::osl::MutexGuard const g(m_Mutex);
// encoding...
/*
@@ -333,14 +333,15 @@ namespace DOM
xmlCharEncoding enc = xmlParseCharEncoding(encstr);
*/
- xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
+ ::boost::shared_ptr<xmlParserCtxt> const pContext(
+ xmlNewParserCtxt(), xmlFreeParserCtxt);
// register error functions to prevent errors being printed
// on the console
- ctxt->_private = this;
- ctxt->sax->error = error_func;
- ctxt->sax->warning = warning_func;
- ctxt->sax->resolveEntity = resolve_func;
+ pContext->_private = this;
+ pContext->sax->error = error_func;
+ pContext->sax->warning = warning_func;
+ pContext->sax->resolveEntity = resolve_func;
// IO context struct
context_t c;
@@ -349,81 +350,63 @@ namespace DOM
// we did not open the stream, thus we do not close it.
c.close = false;
c.freeOnClose = false;
- xmlDocPtr pDoc = xmlCtxtReadIO(ctxt, xmlIO_read_func, xmlIO_close_func, &c,
- 0, 0, 0);
+ xmlDocPtr const pDoc = xmlCtxtReadIO(pContext.get(),
+ xmlIO_read_func, xmlIO_close_func, &c, 0, 0, 0);
if (pDoc == 0) {
- throwEx(ctxt);
+ throwEx(pContext.get());
}
- xmlFreeParserCtxt(ctxt);
- return Reference< XDocument >(static_cast< CDocument* >(CNode::get((xmlNodePtr)pDoc)));
- }
-
- Reference< XDocument > SAL_CALL CDocumentBuilder::parseSource(const InputSource& is)
- throw (RuntimeException, SAXParseException, IOException)
- {
- // if there is an encoding specified in the input source, use it
- xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
- if (is.sEncoding.getLength() > 0) {
- OString oEncstr = OUStringToOString(is.sEncoding, RTL_TEXTENCODING_UTF8);
- char *encstr = (char*) oEncstr.getStr();
- enc = xmlParseCharEncoding(encstr);
- }
-
- // set up parser context
- xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
- // register error functions to prevent errors being printed
- // on the console
- ctxt->_private = this;
- ctxt->sax->error = error_func;
- ctxt->sax->warning = warning_func;
-
- // setup entity resolver binding(s)
- ctxt->sax->resolveEntity = resolve_func;
- xmlSetExternalEntityLoader(external_entity_loader);
-
- // if an input stream is provided, use it
-
- // use the systemID
-
- return Reference< XDocument >();
+ Reference< XDocument > const xRet(
+ CDocument::CreateCDocument(pDoc).get());
+ return xRet;
}
Reference< XDocument > SAL_CALL CDocumentBuilder::parseURI(const OUString& sUri)
throw (RuntimeException, SAXParseException, IOException)
{
- xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
- ctxt->_private = this;
- ctxt->sax->error = error_func;
- ctxt->sax->warning = warning_func;
- ctxt->sax->resolveEntity = resolve_func;
+ ::osl::MutexGuard const g(m_Mutex);
+
+ ::boost::shared_ptr<xmlParserCtxt> const pContext(
+ xmlNewParserCtxt(), xmlFreeParserCtxt);
+ pContext->_private = this;
+ pContext->sax->error = error_func;
+ pContext->sax->warning = warning_func;
+ pContext->sax->resolveEntity = resolve_func;
// xmlSetExternalEntityLoader(external_entity_loader);
OString oUri = OUStringToOString(sUri, RTL_TEXTENCODING_UTF8);
char *uri = (char*) oUri.getStr();
- xmlDocPtr pDoc = xmlCtxtReadFile(ctxt, uri, 0, 0);
+ xmlDocPtr pDoc = xmlCtxtReadFile(pContext.get(), uri, 0, 0);
if (pDoc == 0) {
- throwEx(ctxt);
+ throwEx(pContext.get());
}
- xmlFreeParserCtxt(ctxt);
- return Reference< XDocument >(static_cast< CDocument* >(CNode::get((xmlNodePtr)pDoc)));
+ Reference< XDocument > const xRet(
+ CDocument::CreateCDocument(pDoc).get());
+ return xRet;
}
- void SAL_CALL CDocumentBuilder::setEntityResolver(const Reference< XEntityResolver >& er)
+ void SAL_CALL
+ CDocumentBuilder::setEntityResolver(Reference< XEntityResolver > const& xER)
throw (RuntimeException)
{
- m_aEntityResolver = er;
+ ::osl::MutexGuard const g(m_Mutex);
+
+ m_xEntityResolver = xER;
}
Reference< XEntityResolver > SAL_CALL CDocumentBuilder::getEntityResolver()
throw (RuntimeException)
{
- return m_aEntityResolver;
- }
+ ::osl::MutexGuard const g(m_Mutex);
+ return m_xEntityResolver;
+ }
- void SAL_CALL CDocumentBuilder::setErrorHandler(const Reference< XErrorHandler >& eh)
+ void SAL_CALL
+ CDocumentBuilder::setErrorHandler(Reference< XErrorHandler > const& xEH)
throw (RuntimeException)
{
- m_aErrorHandler = eh;
+ ::osl::MutexGuard const g(m_Mutex);
+
+ m_xErrorHandler = xEH;
}
}
diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx
index 7f5a2079a051..ea1bfcc603e8 100644
--- a/unoxml/source/dom/documentbuilder.hxx
+++ b/unoxml/source/dom/documentbuilder.hxx
@@ -25,16 +25,17 @@
*
************************************************************************/
-#ifndef _DOCUMENTBUILDER_HXX
-#define _DOCUMENTBUILDER_HXX
+#ifndef DOM_DOCUMENTBUILDER_HXX
+#define DOM_DOCUMENTBUILDER_HXX
#include <sal/types.h>
+
#include <cppuhelper/implbase2.hxx>
+
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
@@ -44,10 +45,8 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include "libxml/tree.h"
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -58,28 +57,41 @@ using namespace com::sun::star::io;
namespace DOM
{
- class CDocumentBuilder
- : public ::cppu::WeakImplHelper2< XDocumentBuilder, XServiceInfo >
+ typedef ::cppu::WeakImplHelper2
+ < XDocumentBuilder
+ , ::com::sun::star::lang::XServiceInfo
+ > CDocumentBuilder_Base;
+
+ class CDocumentBuilder
+ : public CDocumentBuilder_Base
{
private:
- Reference< XMultiServiceFactory > m_aFactory;
- Reference< XEntityResolver > m_aEntityResolver;
- Reference< XErrorHandler > m_aErrorHandler;
+ ::osl::Mutex m_Mutex;
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > const
+ m_xFactory;
+ Reference< XEntityResolver > m_xEntityResolver;
+ Reference< XErrorHandler > m_xErrorHandler;
public:
// ctor
- CDocumentBuilder(const Reference< XMultiServiceFactory >& xFactory);
+ CDocumentBuilder(
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > const&
+ xFactory);
// call for factory
- static Reference< XInterface > getInstance(const Reference < XMultiServiceFactory >& xFactory);
+ static Reference< XInterface > getInstance(
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > const&
+ xFactory);
// static helpers for service info and component management
static const char* aImplementationName;
static const char* aSupportedServiceNames[];
static OUString _getImplementationName();
static Sequence< OUString > _getSupportedServiceNames();
- static Reference< XInterface > _getInstance(const Reference< XMultiServiceFactory >& rSMgr);
+ static Reference< XInterface > _getInstance(
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > const&
+ rSMgr);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName()
@@ -130,10 +142,6 @@ namespace DOM
virtual Reference< XDocument > SAL_CALL parseURI(const OUString& uri)
throw (RuntimeException, SAXParseException, IOException);
- virtual Reference< XDocument > SAL_CALL parseSource(const InputSource& is)
- throw (RuntimeException, SAXParseException, IOException);
-
-
/**
Specify the EntityResolver to be used to resolve entities present
in the XML document to be parsed.
diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx
index a3f5ac40b5aa..683938e7f1e4 100644
--- a/unoxml/source/dom/documentfragment.cxx
+++ b/unoxml/source/dom/documentfragment.cxx
@@ -25,15 +25,33 @@
*
************************************************************************/
-#include "documentfragment.hxx"
+#include <documentfragment.hxx>
namespace DOM
{
- CDocumentFragment::CDocumentFragment(const xmlNodePtr aNodePtr)
+ CDocumentFragment::CDocumentFragment(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CDocumentFragment_Base(rDocument, rMutex,
+ NodeType_DOCUMENT_FRAGMENT_NODE, pNode)
{
- m_aNodeType = NodeType_DOCUMENT_FRAGMENT_NODE;
- init_node(aNodePtr);
}
+
+ bool CDocumentFragment::IsChildTypeAllowed(NodeType const nodeType)
+ {
+ switch (nodeType) {
+ case NodeType_ELEMENT_NODE:
+ case NodeType_PROCESSING_INSTRUCTION_NODE:
+ case NodeType_COMMENT_NODE:
+ case NodeType_TEXT_NODE:
+ case NodeType_CDATA_SECTION_NODE:
+ case NodeType_ENTITY_REFERENCE_NODE:
+ return true;
+ default:
+ return false;
+ }
+ }
+
OUString SAL_CALL CDocumentFragment::getNodeName()throw (RuntimeException)
{
return OUString::createFromAscii("#document-fragment");
diff --git a/unoxml/source/dom/documentfragment.hxx b/unoxml/source/dom/documentfragment.hxx
index 7649f6368c9a..6236d5ca453a 100644
--- a/unoxml/source/dom/documentfragment.hxx
+++ b/unoxml/source/dom/documentfragment.hxx
@@ -25,14 +25,14 @@
*
************************************************************************/
-#ifndef _DOCUMENTFRAGMENT_HXX
-#define _DOCUMENTFRAGMENT_HXX
+#ifndef DOM_DOCUMENTFRAGMENT_HXX
+#define DOM_DOCUMENTFRAGMENT_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentFragment.hpp>
-#include "node.hxx"
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -40,13 +40,23 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CDocumentFragment : public cppu::ImplInheritanceHelper1< CNode, XDocumentFragment >
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XDocumentFragment >
+ CDocumentFragment_Base;
+
+ class CDocumentFragment
+ : public CDocumentFragment_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
protected:
- CDocumentFragment(const xmlNodePtr aNodePtr);
+ CDocumentFragment(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
+
// ---- resolve uno inheritance problems...
// overrides for XNode base
virtual OUString SAL_CALL getNodeName()
diff --git a/unoxml/source/dom/documenttype.cxx b/unoxml/source/dom/documenttype.cxx
index bc5004dfd23c..f105e804ec9f 100644
--- a/unoxml/source/dom/documenttype.cxx
+++ b/unoxml/source/dom/documenttype.cxx
@@ -25,20 +25,24 @@
*
************************************************************************/
-#include "documenttype.hxx"
-#include "entitiesmap.hxx"
-#include "notationsmap.hxx"
+#include <documenttype.hxx>
#include <string.h>
+#include <entitiesmap.hxx>
+#include <notationsmap.hxx>
+
+
namespace DOM
{
- CDocumentType::CDocumentType(const xmlDtdPtr aDtdPtr)
+ CDocumentType::CDocumentType(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlDtdPtr const pDtd)
+ : CDocumentType_Base(rDocument, rMutex,
+ NodeType_DOCUMENT_TYPE_NODE, reinterpret_cast<xmlNodePtr>(pDtd))
+ , m_aDtdPtr(pDtd)
{
- m_aNodeType = NodeType_DOCUMENT_TYPE_NODE;
- m_aDtdPtr = aDtdPtr;
- init_node((xmlNodePtr)aDtdPtr);
}
/**
@@ -47,10 +51,12 @@ namespace DOM
*/
Reference< XNamedNodeMap > SAL_CALL CDocumentType::getEntities() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
Reference< XNamedNodeMap > aMap;
if (m_aDtdPtr != NULL)
{
- aMap = Reference< XNamedNodeMap >(new CEntitiesMap(this));
+ aMap.set(new CEntitiesMap(this, m_rMutex));
}
return aMap;
}
@@ -60,7 +66,8 @@ namespace DOM
*/
OUString SAL_CALL CDocumentType::getInternalSubset() throw (RuntimeException)
{
- // XXX
+ OSL_ENSURE(false,
+ "CDocumentType::getInternalSubset: not implemented (#i113683#)");
return OUString();
}
@@ -70,6 +77,8 @@ namespace DOM
*/
OUString SAL_CALL CDocumentType::getName() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aName;
if (m_aDtdPtr != NULL)
{
@@ -83,10 +92,12 @@ namespace DOM
*/
Reference< XNamedNodeMap > SAL_CALL CDocumentType::getNotations() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
Reference< XNamedNodeMap > aMap;
if (m_aDtdPtr != NULL)
{
- aMap.set(new CNotationsMap(this));
+ aMap.set(new CNotationsMap(this, m_rMutex));
}
return aMap;
}
@@ -96,6 +107,8 @@ namespace DOM
*/
OUString SAL_CALL CDocumentType::getPublicId() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aId;
if (m_aDtdPtr != NULL)
{
@@ -109,6 +122,8 @@ namespace DOM
*/
OUString SAL_CALL CDocumentType::getSystemId() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aId;
if (m_aDtdPtr != NULL)
{
@@ -116,10 +131,12 @@ namespace DOM
}
return aId;
}
+
OUString SAL_CALL CDocumentType::getNodeName()throw (RuntimeException)
{
return getName();
}
+
OUString SAL_CALL CDocumentType::getNodeValue() throw (RuntimeException)
{
return OUString();
diff --git a/unoxml/source/dom/documenttype.hxx b/unoxml/source/dom/documenttype.hxx
index 4ea6d0c89219..ca276bb384e8 100644
--- a/unoxml/source/dom/documenttype.hxx
+++ b/unoxml/source/dom/documenttype.hxx
@@ -25,19 +25,20 @@
*
************************************************************************/
-#ifndef _DOCUMENTTYPE_HXX
-#define _DOCUMENTTYPE_HXX
+#ifndef DOM_DOCUMENTTYPE_HXX
+#define DOM_DOCUMENTTYPE_HXX
+
+#include <libxml/tree.h>
#include <sal/types.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentType.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
-#include "node.hxx"
+#include <node.hxx>
-#include <libxml/tree.h>
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -45,14 +46,21 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CDocumentType : public cppu::ImplInheritanceHelper1< CNode, XDocumentType >
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XDocumentType >
+ CDocumentType_Base;
+
+ class CDocumentType
+ : public CDocumentType_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
private:
xmlDtdPtr m_aDtdPtr;
protected:
- CDocumentType(const xmlDtdPtr aDtdPtr);
+ CDocumentType(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlDtdPtr const pDtd);
public:
/**
diff --git a/unoxml/source/dom/domimplementation.cxx b/unoxml/source/dom/domimplementation.cxx
index 5d80147e7fb6..6f4cc692cba8 100644
--- a/unoxml/source/dom/domimplementation.cxx
+++ b/unoxml/source/dom/domimplementation.cxx
@@ -25,28 +25,41 @@
*
************************************************************************/
-#include "domimplementation.hxx"
+#include <domimplementation.hxx>
+
+#include <rtl/instance.hxx>
+
namespace DOM
{
- CDOMImplementation* CDOMImplementation::aDOMImplementation = new CDOMImplementation();
+ // why the heck is this thing static?
+ // perhaps it would be helpful to know what the implementation should
+ // do to answer this question...
+ namespace {
+ struct DOMImplementation
+ : public ::rtl::Static<CDOMImplementation, DOMImplementation> {};
+ }
+
CDOMImplementation* CDOMImplementation::get()
{
- return CDOMImplementation::aDOMImplementation;
+ return & DOMImplementation::get();
}
+ // there is just 1 static instance, so these must not delete it!
+ void SAL_CALL CDOMImplementation::acquire() throw () { }
+ void SAL_CALL CDOMImplementation::release() throw () { }
+
/**
Creates a DOM Document object of the specified type with its document element.
*/
Reference <XDocument > SAL_CALL CDOMImplementation::createDocument(
- const OUString& namespaceURI,
- const OUString& qualifiedName,
- const Reference< XDocumentType >& doctype)
+ OUString const& /*rNamespaceURI*/,
+ OUString const& /*rQualifiedName*/,
+ Reference< XDocumentType > const& /*xDoctype*/)
throw (RuntimeException)
{
- OUString aNamespaceURI = namespaceURI;
- OUString aQName = qualifiedName;
- Reference< XDocumentType > aType = doctype;
+ OSL_ENSURE(false,
+ "CDOMImplementation::createDocument: not implemented (#i113683#)");
return Reference<XDocument>();
}
@@ -54,22 +67,24 @@ namespace DOM
Creates an empty DocumentType node.
*/
Reference< XDocumentType > SAL_CALL CDOMImplementation::createDocumentType(
- const OUString& qualifiedName, const OUString& publicId, const OUString& systemId)
+ OUString const& /*rQualifiedName*/,
+ OUString const& /*rPublicId*/, OUString const& /*rSystemId*/)
throw (RuntimeException)
{
- OUString qName = qualifiedName;
- OUString aPublicId = publicId;
- OUString aSystemId = systemId;
+ OSL_ENSURE(false, "CDOMImplementation::createDocumentType: "
+ "not implemented (#i113683#)");
return Reference<XDocumentType>();
}
+
/**
Test if the DOM implementation implements a specific feature.
*/
- sal_Bool SAL_CALL CDOMImplementation::hasFeature(const OUString& feature, const OUString& ver)
+ sal_Bool SAL_CALL
+ CDOMImplementation::hasFeature(OUString const& /*feature*/, OUString const& /*ver*/)
throw (RuntimeException)
{
- OUString aFeature = feature;
- OUString aVersion = ver;
+ OSL_ENSURE(false,
+ "CDOMImplementation::hasFeature: not implemented (#i113683#)");
return sal_False;
}
}
diff --git a/unoxml/source/dom/domimplementation.hxx b/unoxml/source/dom/domimplementation.hxx
index e0282fa8e3f4..53895287e59c 100644
--- a/unoxml/source/dom/domimplementation.hxx
+++ b/unoxml/source/dom/domimplementation.hxx
@@ -25,18 +25,18 @@
*
************************************************************************/
-#ifndef _DOMIMPLEMENTATION_HXX
-#define _DOMIMPLEMENTATION_HXX
+#ifndef DOM_DOMIMPLEMENTATION_HXX
+#define DOM_DOMIMPLEMENTATION_HXX
-#include <map>
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/xml/dom/XDocumentType.hpp>
#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
-#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -44,13 +44,17 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CDOMImplementation : public cppu::WeakImplHelper1< XDOMImplementation >
+ class CDOMImplementation
+ : public cppu::WeakImplHelper1< XDOMImplementation >
{
public:
- static CDOMImplementation* aDOMImplementation;
static CDOMImplementation* get();
+ // there is just 1 static instance, so these must not delete it!
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
/**
Creates a DOM Document object of the specified type with its document element.
*/
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index 7de79e39e3e4..c034ca1257d2 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -25,30 +25,38 @@
*
************************************************************************/
-#include "node.hxx"
-#include "element.hxx"
-#include "attr.hxx"
-#include "elementlist.hxx"
-#include "attributesmap.hxx"
-#include "../events/mutationevent.hxx"
+#include <element.hxx>
+
+#include <string.h>
+
+#include <boost/shared_ptr.hpp>
+
+#include <rtl/ustrbuf.hxx>
-#include "comphelper/attributelist.hxx"
#include <com/sun/star/xml/sax/FastToken.hdl>
-#include <string.h>
+#include <comphelper/attributelist.hxx>
+
+#include <node.hxx>
+#include <attr.hxx>
+#include <elementlist.hxx>
+#include <attributesmap.hxx>
+#include <document.hxx>
+
+#include "../events/mutationevent.hxx"
namespace DOM
{
- CElement::CElement(const xmlNodePtr aNodePtr)
+ CElement::CElement(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CElement_Base(rDocument, rMutex, NodeType_ELEMENT_NODE, pNode)
{
- m_aNodeType = NodeType_ELEMENT_NODE;
- init_node(aNodePtr);
}
- void SAL_CALL CElement::saxify(
- const Reference< XDocumentHandler >& i_xHandler) {
+ void CElement::saxify(const Reference< XDocumentHandler >& i_xHandler)
+ {
if (!i_xHandler.is()) throw RuntimeException();
comphelper::AttributeList *pAttrs =
new comphelper::AttributeList();
@@ -71,7 +79,8 @@ namespace DOM
// add attributes
for (xmlAttrPtr pAttr = m_aNodePtr->properties;
pAttr != 0; pAttr = pAttr->next) {
- CNode * pNode = CNode::get(reinterpret_cast<xmlNodePtr>(pAttr));
+ ::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr));
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
OUString prefix = pNode->getPrefix();
OUString name = (prefix.getLength() == 0)
@@ -89,14 +98,16 @@ namespace DOM
// recurse
for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) {
- CNode * pNode = CNode::get(pChild);
+ ::rtl::Reference<CNode> const pNode(
+ GetOwnerDocument().GetCNode(pChild));
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
pNode->saxify(i_xHandler);
}
i_xHandler->endElement(name);
}
- void SAL_CALL CElement::fastSaxify( Context& i_rContext ) {
+ void CElement::fastSaxify( Context& i_rContext )
+ {
if (!i_rContext.mxDocHandler.is()) throw RuntimeException();
pushContext(i_rContext);
addNamespaces(i_rContext,m_aNodePtr);
@@ -105,7 +116,8 @@ namespace DOM
i_rContext.mxAttribList->clear();
for (xmlAttrPtr pAttr = m_aNodePtr->properties;
pAttr != 0; pAttr = pAttr->next) {
- CNode * pNode = CNode::get(reinterpret_cast<xmlNodePtr>(pAttr));
+ ::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr));
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
const xmlChar* xName = pAttr->name;
@@ -168,7 +180,8 @@ namespace DOM
// recurse
for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) {
- CNode * pNode = CNode::get(pChild);
+ ::rtl::Reference<CNode> const pNode(
+ GetOwnerDocument().GetCNode(pChild));
OSL_ENSURE(pNode != 0, "CNode::get returned 0");
pNode->fastSaxify(i_rContext);
}
@@ -195,85 +208,135 @@ namespace DOM
popContext(i_rContext);
}
+ bool CElement::IsChildTypeAllowed(NodeType const nodeType)
+ {
+ switch (nodeType) {
+ case NodeType_ELEMENT_NODE:
+ case NodeType_TEXT_NODE:
+ case NodeType_COMMENT_NODE:
+ case NodeType_PROCESSING_INSTRUCTION_NODE:
+ case NodeType_CDATA_SECTION_NODE:
+ case NodeType_ENTITY_REFERENCE_NODE:
+ return true;
+ case NodeType_ATTRIBUTE_NODE:
+ /* this is not relly allowed by the DOM spec, but this
+ implementation has evidently supported it (by special case
+ handling, so the attribute does not actually become a child)
+ so allow it for backward compatiblity */
+ return true;
+ default:
+ return false;
+ }
+ }
+
+
/**
Retrieves an attribute value by name.
return empty string if attribute is not set
*/
- OUString CElement::getAttribute(const OUString& name)
+ OUString SAL_CALL CElement::getAttribute(OUString const& name)
throw (RuntimeException)
{
- OUString aValue;
- // search properties
- if (m_aNodePtr != NULL)
- {
- OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
- xmlChar *xValue = xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr());
- if (xValue != NULL) {
- aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8);
- }
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
}
- return aValue;
+ // search properties
+ OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
+ ::boost::shared_ptr<xmlChar const> const pValue(
+ xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr()), xmlFree);
+ OUString const ret( (pValue)
+ ? OUString(reinterpret_cast<sal_Char const*>(pValue.get()),
+ strlen(reinterpret_cast<char const*>(pValue.get())),
+ RTL_TEXTENCODING_UTF8)
+ : OUString() );
+ return ret;
}
/**
Retrieves an attribute node by name.
*/
- Reference< XAttr > CElement::getAttributeNode(const OUString& name)
+ Reference< XAttr > SAL_CALL CElement::getAttributeNode(OUString const& name)
throw (RuntimeException)
{
- Reference< XAttr > aAttr;
- if (m_aNodePtr != NULL)
- {
- OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
- xmlChar *xName = (xmlChar*)o1.getStr();
- xmlAttrPtr pAttr = xmlHasProp(m_aNodePtr, xName);
- aAttr = Reference< XAttr >(static_cast< CAttr* >(CNode::get((xmlNodePtr)pAttr)));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aAttr;
+ OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pName =
+ reinterpret_cast<xmlChar const*>(o1.getStr());
+ xmlAttrPtr const pAttr = xmlHasProp(m_aNodePtr, pName);
+ if (0 == pAttr) {
+ return 0;
+ }
+ Reference< XAttr > const xRet(
+ static_cast< XNode* >(GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr)).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
/**
Retrieves an Attr node by local name and namespace URI.
*/
- Reference< XAttr > CElement::getAttributeNodeNS(
+ Reference< XAttr > SAL_CALL CElement::getAttributeNodeNS(
const OUString& namespaceURI, const OUString& localName)
throw (RuntimeException)
{
- Reference< XAttr > aAttr;
- if (m_aNodePtr != NULL)
- {
- OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
- xmlChar *xName = (xmlChar*)o1.getStr();
- OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
- xmlChar *xNS = (xmlChar*)o2.getStr();
- xmlAttrPtr pAttr = xmlHasNsProp(m_aNodePtr, xName, xNS);
- aAttr = Reference< XAttr >(static_cast< CAttr* >(CNode::get((xmlNodePtr)pAttr)));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aAttr;
+ OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pName =
+ reinterpret_cast<xmlChar const*>(o1.getStr());
+ OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pNS =
+ reinterpret_cast<xmlChar const*>(o2.getStr());
+ xmlAttrPtr const pAttr = xmlHasNsProp(m_aNodePtr, pName, pNS);
+ if (0 == pAttr) {
+ return 0;
+ }
+ Reference< XAttr > const xRet(
+ static_cast< XNode* >(GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr)).get()),
+ UNO_QUERY_THROW);
+ return xRet;
}
/**
Retrieves an attribute value by local name and namespace URI.
return empty string if attribute is not set
*/
- OUString CElement::getAttributeNS(const OUString& namespaceURI, const OUString& localName)
+ OUString SAL_CALL
+ CElement::getAttributeNS(
+ OUString const& namespaceURI, OUString const& localName)
throw (RuntimeException)
{
- OUString aValue;
- // search properties
- if (m_aNodePtr != NULL)
- {
- OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
- xmlChar *xName = (xmlChar*)o1.getStr();
- OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
- xmlChar *xNS = (xmlChar*)o2.getStr();
- xmlChar *xValue = (xmlChar*)xmlGetNsProp(m_aNodePtr, xName, xNS);
- if (xValue != NULL) {
- aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8);
- xmlFree(xValue);
- }
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
+ }
+ OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pName =
+ reinterpret_cast<xmlChar const*>(o1.getStr());
+ OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pNS =
+ reinterpret_cast<xmlChar const*>(o2.getStr());
+ ::boost::shared_ptr<xmlChar const> const pValue(
+ xmlGetNsProp(m_aNodePtr, pName, pNS), xmlFree);
+ if (0 == pValue) {
+ return ::rtl::OUString();
}
- return aValue;
+ OUString const ret(reinterpret_cast<sal_Char const*>(pValue.get()),
+ strlen(reinterpret_cast<char const*>(pValue.get())),
+ RTL_TEXTENCODING_UTF8);
+ return ret;
}
/**
@@ -281,11 +344,15 @@ namespace DOM
in the order in which they are
encountered in a preorder traversal of this Element tree.
*/
- Reference< XNodeList > CElement::getElementsByTagName(const OUString& name)
+ Reference< XNodeList > SAL_CALL
+ CElement::getElementsByTagName(OUString const& rLocalName)
throw (RuntimeException)
{
- Reference< XNodeList > aList = Reference< XNodeList >(new CElementList(this, name));
- return aList;
+ ::osl::MutexGuard const g(m_rMutex);
+
+ Reference< XNodeList > const xList(
+ new CElementList(this, m_rMutex, rLocalName));
+ return xList;
}
/**
@@ -293,26 +360,32 @@ namespace DOM
name and namespace URI in the order in which they are encountered in
a preorder traversal of this Element tree.
*/
- Reference< XNodeList > CElement::getElementsByTagNameNS(const OUString& namespaceURI,
- const OUString& localName)
+ Reference< XNodeList > SAL_CALL
+ CElement::getElementsByTagNameNS(
+ OUString const& rNamespaceURI, OUString const& rLocalName)
throw (RuntimeException)
{
- Reference< XNodeList > aList = Reference< XNodeList >(new CElementList(this, localName, namespaceURI));
- return aList;
+ ::osl::MutexGuard const g(m_rMutex);
+
+ Reference< XNodeList > const xList(
+ new CElementList(this, m_rMutex, rLocalName, &rNamespaceURI));
+ return xList;
}
/**
The name of the element.
*/
- OUString CElement::getTagName()
+ OUString SAL_CALL CElement::getTagName()
throw (RuntimeException)
{
- OUString aName;
- if (m_aNodePtr != NULL)
- {
- aName = OUString((sal_Char*)m_aNodePtr->name, strlen((char*)m_aNodePtr->name), RTL_TEXTENCODING_UTF8);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
}
- return aName;
+ OUString const ret((sal_Char*)m_aNodePtr->name,
+ strlen((char*)m_aNodePtr->name), RTL_TEXTENCODING_UTF8);
+ return ret;
}
@@ -320,9 +393,11 @@ namespace DOM
Returns true when an attribute with a given name is specified on this
element or has a default value, false otherwise.
*/
- sal_Bool CElement::hasAttribute(const OUString& name)
+ sal_Bool SAL_CALL CElement::hasAttribute(OUString const& name)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
return (m_aNodePtr != NULL && xmlHasProp(m_aNodePtr, xName) != NULL);
@@ -332,9 +407,12 @@ namespace DOM
Returns true when an attribute with a given local name and namespace
URI is specified on this element or has a default value, false otherwise.
*/
- sal_Bool CElement::hasAttributeNS(const OUString& namespaceURI, const OUString& localName)
+ sal_Bool SAL_CALL CElement::hasAttributeNS(
+ OUString const& namespaceURI, OUString const& localName)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
@@ -345,196 +423,253 @@ namespace DOM
/**
Removes an attribute by name.
*/
- void CElement::removeAttribute(const OUString& name)
+ void SAL_CALL CElement::removeAttribute(OUString const& name)
throw (RuntimeException, DOMException)
{
- xmlChar *xName = (xmlChar*)OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr();
- if (m_aNodePtr != NULL) {
- xmlUnsetProp(m_aNodePtr, xName);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return;
+ }
+ OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
+ xmlChar const*const pName =
+ reinterpret_cast<xmlChar const*>(o1.getStr());
+ xmlAttrPtr const pAttr = xmlHasProp(m_aNodePtr, pName);
+ if (0 == xmlUnsetProp(m_aNodePtr, pName)) {
+ ::rtl::Reference<CNode> const pCNode(GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr), false));
+ if (pCNode.is()) {
+ pCNode->invalidate(); // freed by xmlUnsetProp
+ }
}
}
/**
Removes an attribute by local name and namespace URI.
*/
- void CElement::removeAttributeNS(const OUString& namespaceURI, const OUString& localName)
+ void SAL_CALL CElement::removeAttributeNS(
+ OUString const& namespaceURI, OUString const& localName)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return;
+ }
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
- xmlChar *xName = (xmlChar*)o1.getStr();
+ xmlChar const*const pName =
+ reinterpret_cast<xmlChar const*>(o1.getStr());
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
- xmlChar *xURI = (xmlChar*)o2.getStr();
- if (m_aNodePtr != NULL) {
- // XXX
- xmlNsPtr pNs = xmlSearchNsByHref(m_aNodePtr->doc, m_aNodePtr, xURI);
- xmlUnsetNsProp(m_aNodePtr, pNs, xName);
+ xmlChar const*const pURI =
+ reinterpret_cast<xmlChar const*>(o2.getStr());
+ xmlNsPtr const pNs =
+ xmlSearchNsByHref(m_aNodePtr->doc, m_aNodePtr, pURI);
+ xmlAttrPtr const pAttr = xmlHasNsProp(m_aNodePtr, pName, pURI);
+ if (0 == xmlUnsetNsProp(m_aNodePtr, pNs, pName)) {
+ ::rtl::Reference<CNode> const pCNode(GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(pAttr), false));
+ if (pCNode.is()) {
+ pCNode->invalidate(); // freed by xmlUnsetNsProp
+ }
}
}
/**
Removes the specified attribute node.
*/
- Reference< XAttr > CElement::removeAttributeNode(const Reference< XAttr >& oldAttr)
+ Reference< XAttr > SAL_CALL
+ CElement::removeAttributeNode(Reference< XAttr > const& oldAttr)
throw (RuntimeException, DOMException)
{
- Reference< XAttr > aAttr;
- if(m_aNodePtr != NULL)
- {
- xmlAttrPtr pAttr = (xmlAttrPtr) CNode::getNodePtr(oldAttr.get());
+ ::osl::MutexGuard const g(m_rMutex);
- if (pAttr->parent != m_aNodePtr)
- {
- DOMException e;
- e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
- throw e;
- }
- if (pAttr->doc != m_aNodePtr->doc)
- {
- DOMException e;
- e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
- throw e;
- }
+ if (0 == m_aNodePtr) {
+ return 0;
+ }
- if (oldAttr->getNamespaceURI().getLength() > 0)
- aAttr = oldAttr->getOwnerDocument()->createAttributeNS(
- oldAttr->getNamespaceURI(), oldAttr->getName());
- else
- aAttr = oldAttr->getOwnerDocument()->createAttribute(oldAttr->getName());
- aAttr->setValue(oldAttr->getValue());
- xmlRemoveProp(pAttr);
+ ::rtl::Reference<CNode> const pCNode(
+ CNode::GetImplementation(Reference<XNode>(oldAttr.get())));
+ if (!pCNode.is()) { throw RuntimeException(); }
+ xmlNodePtr const pNode = pCNode->GetNodePtr();
+ xmlAttrPtr const pAttr = (xmlAttrPtr) pNode;
+ if (!pAttr) { throw RuntimeException(); }
+
+ if (pAttr->parent != m_aNodePtr)
+ {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ if (pAttr->doc != m_aNodePtr->doc)
+ {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
+
+ Reference< XAttr > aAttr;
+ if (oldAttr->getNamespaceURI().getLength() > 0) {
+ ::rtl::OUStringBuffer qname(oldAttr->getPrefix());
+ if (0 != qname.getLength()) {
+ qname.append(sal_Unicode(':'));
+ }
+ qname.append(oldAttr->getName());
+ aAttr = GetOwnerDocument().createAttributeNS(
+ oldAttr->getNamespaceURI(), qname.makeStringAndClear());
+ } else {
+ aAttr = GetOwnerDocument().createAttribute(oldAttr->getName());
}
+ aAttr->setValue(oldAttr->getValue());
+ xmlRemoveProp(pAttr);
+ pCNode->invalidate(); // freed by xmlRemoveProp
+
return aAttr;
}
/**
Adds a new attribute node.
*/
- Reference< XAttr > CElement::_setAttributeNode(const Reference< XAttr >& newAttr, sal_Bool bNS)
- throw (RuntimeException)
+ Reference< XAttr >
+ CElement::setAttributeNode_Impl_Lock(
+ Reference< XAttr > const& xNewAttr, bool const bNS)
{
- Reference< XAttr > aAttr;
- if (m_aNodePtr != NULL)
- {
- // check whether the attrib belongs to this document
- Reference< XDocument > newDoc(newAttr->getOwnerDocument(), UNO_QUERY);
- Reference< XDocument > oldDoc(CNode::getOwnerDocument(), UNO_QUERY);
- if (newDoc != oldDoc) {
- throw RuntimeException();
- }
-
- // get the implementation
- xmlAttrPtr pAttr = (xmlAttrPtr) CNode::getNodePtr(newAttr.get());
-
- // check whether the attribute is not in use by another element
- xmlNsPtr pNs = NULL;
- if (pAttr->parent != NULL)
- if(strcmp((char*)pAttr->parent->name, "__private") == 0
- && pNs && pAttr->ns != NULL)
- {
- pNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, pAttr->ns->prefix);
- if (pNs == NULL || strcmp((char*)pNs->href, (char*)pAttr->ns->href) !=0 )
- pNs = xmlNewNs(m_aNodePtr, pAttr->ns->href, pAttr->ns->href);
- else
- throw RuntimeException();
- }
+ if (xNewAttr->getOwnerDocument() != getOwnerDocument()) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
- xmlAttrPtr res = NULL;
+ ::osl::ClearableMutexGuard guard(m_rMutex);
- if (bNS)
- res = xmlNewNsProp(m_aNodePtr, pNs, pAttr->name, pAttr->children->content);
- else
- res = xmlNewProp(m_aNodePtr, pAttr->name, pAttr->children->content);
+ if (0 == m_aNodePtr) {
+ throw RuntimeException();
+ }
- // free carrier node ...
- if(pAttr->parent != NULL && strcmp((char*)pAttr->parent->name, "__private")== 0)
- xmlFreeNode(pAttr->parent);
- // ... remove the old attr from the node cache
- CNode::remove((xmlNodePtr)pAttr);
+ // get the implementation
+ CAttr *const pCAttr = dynamic_cast<CAttr*>(
+ CNode::GetImplementation(xNewAttr));
+ if (!pCAttr) { throw RuntimeException(); }
+ xmlAttrPtr const pAttr =
+ reinterpret_cast<xmlAttrPtr>(pCAttr->GetNodePtr());
+ if (!pAttr) { throw RuntimeException(); }
- // get the new attr node
- aAttr = Reference< XAttr >(static_cast< CAttr* >(CNode::get((xmlNodePtr)res)));
+ // check whether the attribute is not in use by another element
+ if (pAttr->parent) {
+ DOMException e;
+ e.Code = DOMExceptionType_INUSE_ATTRIBUTE_ERR;
+ throw e;
}
- if (aAttr.is())
- {
- // attribute adition event
- // dispatch DOMAttrModified event
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"),
- sal_True, sal_False, Reference< XNode >(aAttr, UNO_QUERY),
- OUString(), aAttr->getValue(), aAttr->getName(), AttrChangeType_ADDITION);
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
- dispatchSubtreeModified();
+ xmlAttrPtr res = NULL;
+ xmlChar const*const pContent(
+ (pAttr->children) ? pAttr->children->content : 0);
+
+ if (bNS) {
+ xmlNsPtr const pNs( pCAttr->GetNamespace(m_aNodePtr) );
+ res = xmlNewNsProp(m_aNodePtr, pNs, pAttr->name, pContent);
+ } else {
+ res = xmlNewProp(m_aNodePtr, pAttr->name, pContent);
}
- return aAttr;
+
+ // get the new attr node
+ Reference< XAttr > const xAttr(
+ static_cast< XNode* >(GetOwnerDocument().GetCNode(
+ reinterpret_cast<xmlNodePtr>(res)).get()),
+ UNO_QUERY_THROW);
+
+ // attribute adition event
+ // dispatch DOMAttrModified event
+ Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
+ Reference< XMutationEvent > event(docevent->createEvent(
+ OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
+ event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"),
+ sal_True, sal_False, Reference< XNode >(xAttr, UNO_QUERY),
+ OUString(), xAttr->getValue(), xAttr->getName(),
+ AttrChangeType_ADDITION);
+
+ guard.clear(); // release mutex before calling event handlers
+
+ dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ dispatchSubtreeModified();
+
+ return xAttr;
}
- Reference< XAttr > CElement::setAttributeNode(const Reference< XAttr >& newAttr)
+ Reference< XAttr >
+ CElement::setAttributeNode(const Reference< XAttr >& newAttr)
throw (RuntimeException, DOMException)
{
- return _setAttributeNode(newAttr, sal_False);
+ return setAttributeNode_Impl_Lock(newAttr, false);
}
/**
Adds a new attribute.
*/
- Reference< XAttr > CElement::setAttributeNodeNS(const Reference< XAttr >& newAttr)
+ Reference< XAttr >
+ CElement::setAttributeNodeNS(const Reference< XAttr >& newAttr)
throw (RuntimeException, DOMException)
{
- return _setAttributeNode(newAttr, sal_True);
+ return setAttributeNode_Impl_Lock(newAttr, true);
}
/**
Adds a new attribute.
*/
- void CElement::setAttribute(const OUString& name, const OUString& value)
+ void SAL_CALL
+ CElement::setAttribute(OUString const& name, OUString const& value)
throw (RuntimeException, DOMException)
{
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
OString o2 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
xmlChar *xValue = (xmlChar*)o2.getStr();
- if (m_aNodePtr != NULL)
- {
- OUString oldValue;
- AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
- xmlChar *xOld = xmlGetProp(m_aNodePtr, xName);
- if (xOld == NULL)
- {
- aChangeType = AttrChangeType_ADDITION;
- xmlNewProp(m_aNodePtr, xName, xValue);
- }
- else
- {
- oldValue = OUString((char*)xOld, strlen((char*)xOld), RTL_TEXTENCODING_UTF8);
- xmlSetProp(m_aNodePtr, xName, xValue);
- }
-
- // dispatch DOMAttrModified event
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"),
- sal_True, sal_False, Reference< XNode >(getAttributeNode(name), UNO_QUERY),
- oldValue, value, name, aChangeType);
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
- dispatchSubtreeModified();
+ if (0 == m_aNodePtr) {
+ throw RuntimeException();
}
+ OUString oldValue;
+ AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
+ ::boost::shared_ptr<xmlChar const> const pOld(
+ xmlGetProp(m_aNodePtr, xName), xmlFree);
+ if (pOld == NULL) {
+ aChangeType = AttrChangeType_ADDITION;
+ xmlNewProp(m_aNodePtr, xName, xValue);
+ } else {
+ oldValue = OUString(reinterpret_cast<sal_Char const*>(pOld.get()),
+ strlen(reinterpret_cast<char const*>(pOld.get())),
+ RTL_TEXTENCODING_UTF8);
+ xmlSetProp(m_aNodePtr, xName, xValue);
+ }
+
+ // dispatch DOMAttrModified event
+ Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
+ Reference< XMutationEvent > event(docevent->createEvent(
+ OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
+ event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"),
+ sal_True, sal_False,
+ Reference< XNode >(getAttributeNode(name), UNO_QUERY),
+ oldValue, value, name, aChangeType);
+
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ dispatchSubtreeModified();
}
/**
Adds a new attribute.
*/
- void CElement::setAttributeNS(
- const OUString& namespaceURI, const OUString& qualifiedName, const OUString& value)
+ void SAL_CALL
+ CElement::setAttributeNS(OUString const& namespaceURI,
+ OUString const& qualifiedName, OUString const& value)
throw (RuntimeException, DOMException)
{
if (namespaceURI.getLength() == 0) throw RuntimeException();
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
OString o1, o2, o3, o4, o5;
xmlChar *xPrefix = NULL;
xmlChar *xLName = NULL;
@@ -559,63 +694,72 @@ namespace DOM
o5 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
xmlChar *xURI= (xmlChar*)o4.getStr();
xmlChar *xValue = (xmlChar*)o5.getStr();
- if (m_aNodePtr != NULL)
- {
- //find the right namespace
- xmlNsPtr pNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, xPrefix);
- // if no namespace found, create a new one
- if (pNs == NULL)
- pNs = xmlNewNs(m_aNodePtr, xURI, xPrefix);
- if (strcmp((char*)pNs->href, (char*)xURI) == 0)
- {
- // found namespace matches
-
- OUString oldValue;
- AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
- xmlChar *xOld = xmlGetNsProp(m_aNodePtr, xLName, pNs->href);
- if (xOld == NULL)
- {
- aChangeType = AttrChangeType_ADDITION;
- xmlNewNsProp(m_aNodePtr, pNs, xLName, xValue);
- }
- else
- {
- oldValue = OUString((char *)xOld, strlen((char *)xOld), RTL_TEXTENCODING_UTF8);
- xmlSetNsProp(m_aNodePtr, pNs, xLName, xValue);
- }
- // dispatch DOMAttrModified event
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False,
- Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY),
- oldValue, value, qualifiedName, aChangeType);
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
- dispatchSubtreeModified();
-
- } else {
- // ambigious ns prefix
- throw RuntimeException();
- }
+ if (0 == m_aNodePtr) {
+ throw RuntimeException();
+ }
+ //find the right namespace
+ xmlNsPtr pNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, xPrefix);
+ // if no namespace found, create a new one
+ if (pNs == NULL) {
+ pNs = xmlNewNs(m_aNodePtr, xURI, xPrefix);
}
+
+ if (strcmp((char*)pNs->href, (char*)xURI) != 0) {
+ // ambiguous ns prefix
+ throw RuntimeException();
+ }
+
+ // found namespace matches
+
+ OUString oldValue;
+ AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
+ ::boost::shared_ptr<xmlChar const> const pOld(
+ xmlGetNsProp(m_aNodePtr, xLName, pNs->href), xmlFree);
+ if (pOld == NULL) {
+ aChangeType = AttrChangeType_ADDITION;
+ xmlNewNsProp(m_aNodePtr, pNs, xLName, xValue);
+ } else {
+ oldValue = OUString(reinterpret_cast<sal_Char const*>(pOld.get()),
+ strlen(reinterpret_cast<char const*>(pOld.get())),
+ RTL_TEXTENCODING_UTF8);
+ xmlSetNsProp(m_aNodePtr, pNs, xLName, xValue);
+ }
+ // dispatch DOMAttrModified event
+ Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
+ Reference< XMutationEvent > event(docevent->createEvent(
+ OUString::createFromAscii("DOMAttrModified")), UNO_QUERY);
+ event->initMutationEvent(
+ OUString::createFromAscii("DOMAttrModified"),
+ sal_True, sal_False,
+ Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY),
+ oldValue, value, qualifiedName, aChangeType);
+
+ guard.clear(); // release mutex before calling event handlers
+ dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ dispatchSubtreeModified();
}
- Reference< XNamedNodeMap > SAL_CALL CElement::getAttributes()throw (RuntimeException)
+ Reference< XNamedNodeMap > SAL_CALL
+ CElement::getAttributes() throw (RuntimeException)
{
- Reference< XNamedNodeMap > aMap;
- if (hasAttributes()) {
- aMap = Reference< XNamedNodeMap >(new CAttributesMap(this));
- }
- return aMap;
+ ::osl::MutexGuard const g(m_rMutex);
+
+ Reference< XNamedNodeMap > const xMap(
+ new CAttributesMap(this, m_rMutex));
+ return xMap;
}
+
OUString SAL_CALL CElement::getNodeName()throw (RuntimeException)
{
return getLocalName();
}
+
OUString SAL_CALL CElement::getLocalName()throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aName;
if (m_aNodePtr != NULL)
{
@@ -624,26 +768,31 @@ namespace DOM
}
return aName;
}
+
OUString SAL_CALL CElement::getNodeValue() throw (RuntimeException)
{
return OUString();
}
- void SAL_CALL CElement::setElementName(const OUString& aName) throw (RuntimeException, DOMException)
+ void SAL_CALL CElement::setElementName(const OUString& aName)
+ throw (RuntimeException, DOMException)
{
- if (aName.getLength() > 0 && aName.indexOf(OUString::createFromAscii(":")) < 0)
- {
- OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
- xmlChar *xName = (xmlChar*)oName.getStr();
- // xmlFree((void*)m_aNodePtr->name);
- m_aNodePtr->name = xmlStrdup(xName);
- }
- else
+ if ((aName.getLength() <= 0) ||
+ (0 <= aName.indexOf(OUString::createFromAscii(":"))))
{
DOMException e;
e.Code = DOMExceptionType_INVALID_CHARACTER_ERR;
throw e;
}
+
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ throw RuntimeException();
+ }
+ OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
+ xmlChar *xName = (xmlChar*)oName.getStr();
+ xmlNodeSetName(m_aNodePtr, xName);
}
}
diff --git a/unoxml/source/dom/element.hxx b/unoxml/source/dom/element.hxx
index d0df7102f12f..58891ed0d21c 100644
--- a/unoxml/source/dom/element.hxx
+++ b/unoxml/source/dom/element.hxx
@@ -25,16 +25,19 @@
*
************************************************************************/
-#ifndef _ELEMENT_HXX
-#define _ELEMENT_HXX
+#ifndef DOM_ELEMENT_HXX
+#define DOM_ELEMENT_HXX
+
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
#include <com/sun/star/xml/dom/NodeType.hpp>
-#include <libxml/tree.h>
-#include "node.hxx"
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -42,22 +45,28 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CElement : public cppu::ImplInheritanceHelper1<CNode, XElement >
+ typedef ::cppu::ImplInheritanceHelper1<CNode, XElement > CElement_Base;
+
+ class CElement
+ : public CElement_Base
{
- friend class CNode;
private:
- Reference< XAttr > _setAttributeNode(const Reference< XAttr >& newAttr, sal_Bool bNS)
- throw (RuntimeException);
+ friend class CDocument;
+
+ Reference< XAttr > setAttributeNode_Impl_Lock(
+ Reference< XAttr > const& xNewAttr, bool const bNS);
protected:
- CElement(const xmlNodePtr aNodePtr);
+ CElement(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
+
+ virtual void fastSaxify( Context& i_rContext );
- virtual void SAL_CALL fastSaxify( Context& i_rContext );
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
/**
Retrieves an attribute value by name.
diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx
index 8db7b2d3bcb4..92285cca8ce0 100644
--- a/unoxml/source/dom/elementlist.cxx
+++ b/unoxml/source/dom/elementlist.cxx
@@ -29,45 +29,45 @@
#include <string.h>
+#include <element.hxx>
+#include <document.hxx>
+
+
namespace DOM
{
- CElementList::CElementList(const CElement* aElement, const OUString& aName)
- : m_pElement(aElement)
- , m_aName(aName)
- , xURI(0)
- , m_bRebuild(sal_True)
+ static xmlChar* lcl_initXmlString(::rtl::OUString const& rString)
{
- OString o1 = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
- xName = new xmlChar[o1.getLength()];
- strcpy((char*)xName, o1.getStr());
- registerListener(aElement);
+ ::rtl::OString const os =
+ ::rtl::OUStringToOString(rString, RTL_TEXTENCODING_UTF8);
+ xmlChar *const pRet = new xmlChar[os.getLength() + 1];
+ strcpy(reinterpret_cast<char*>(pRet), os.getStr());
+ return pRet;
}
- CElementList::CElementList(const CElement* aElement, const OUString& aName, const OUString& aURI)
- : m_pElement(aElement)
- , m_aName(aName)
- , m_aURI(aURI)
- , m_bRebuild(sal_True)
+ CElementList::CElementList(::rtl::Reference<CElement> const& pElement,
+ ::osl::Mutex & rMutex,
+ OUString const& rName, OUString const*const pURI)
+ : m_pElement(pElement)
+ , m_rMutex(rMutex)
+ , m_pName(lcl_initXmlString(rName))
+ , m_pURI((pURI) ? lcl_initXmlString(*pURI) : 0)
+ , m_bRebuild(true)
{
- OString o1 = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
- xName = new xmlChar[o1.getLength()];
- strcpy((char*)xName, o1.getStr());
- OString o2 = OUStringToOString(aURI, RTL_TEXTENCODING_UTF8);
- xURI = new xmlChar[o2.getLength()];
- strcpy((char*)xURI, o2.getStr());
- registerListener(aElement);
+ if (m_pElement.is()) {
+ registerListener(*m_pElement);
+ }
}
- void CElementList::registerListener(const CElement* pElement)
+ void CElementList::registerListener(CElement & rElement)
{
try {
- // get the XNode
- Reference< XNode > xNode(CNode::get(static_cast<const CNode*>(pElement)->m_aNodePtr));
- Reference< XEventTarget > xTarget(xNode, UNO_QUERY_THROW);
+ Reference< XEventTarget > const xTarget(
+ static_cast<XElement*>(& rElement), UNO_QUERY_THROW);
OUString aType = OUString::createFromAscii("DOMSubtreeModified");
sal_Bool capture = sal_False;
- xTarget->addEventListener(aType, Reference< XEventListener >(this), capture);
+ xTarget->addEventListener(aType,
+ Reference< XEventListener >(this), capture);
} catch (Exception &e){
OString aMsg("Exception caught while registering NodeList as listener:\n");
aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
@@ -84,19 +84,24 @@ namespace DOM
return;
} else {
m_nodevector.erase(m_nodevector.begin(), m_nodevector.end());
- m_bRebuild = sal_False; // don't rebuild until tree is mutated
+ m_bRebuild = false; // don't rebuild until tree is mutated
}
}
while (pNode != NULL )
{
- if (pNode->type == XML_ELEMENT_NODE && strcmp((char*)pNode->name, (char*)xName)==0)
+ if (pNode->type == XML_ELEMENT_NODE &&
+ (strcmp((char*)pNode->name, (char*)m_pName.get()) == 0))
{
- if (xURI == NULL)
+ if (!m_pURI) {
m_nodevector.push_back(pNode);
- else
- if (pNode->ns != NULL && strcmp((char*)pNode->ns->href, (char*)xURI) == 0)
+ } else {
+ if (pNode->ns != NULL && (0 ==
+ strcmp((char*)pNode->ns->href, (char*)m_pURI.get())))
+ {
m_nodevector.push_back(pNode);
+ }
+ }
}
if (pNode->children != NULL) buildlist(pNode->children, sal_False);
@@ -110,24 +115,41 @@ namespace DOM
*/
sal_Int32 SAL_CALL CElementList::getLength() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (!m_pElement.is()) { return 0; }
+
// this has to be 'live'
- buildlist(static_cast<const CNode*>(m_pElement)->m_aNodePtr);
+ buildlist(m_pElement->GetNodePtr());
return m_nodevector.size();
}
/**
Returns the indexth item in the collection.
*/
- Reference< XNode > SAL_CALL CElementList::item(sal_Int32 index) throw (RuntimeException)
+ Reference< XNode > SAL_CALL CElementList::item(sal_Int32 index)
+ throw (RuntimeException)
{
if (index < 0) throw RuntimeException();
- buildlist(static_cast<const CNode*>(m_pElement)->m_aNodePtr);
- return Reference< XNode >(CNode::get(m_nodevector[index]));
+
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (!m_pElement.is()) { return 0; }
+
+ buildlist(m_pElement->GetNodePtr());
+ if (m_nodevector.size() <= static_cast<size_t>(index)) {
+ throw RuntimeException();
+ }
+ Reference< XNode > const xRet(
+ m_pElement->GetOwnerDocument().GetCNode(m_nodevector[index]).get());
+ return xRet;
}
// tree mutations can change the list
- void SAL_CALL CElementList::handleEvent(const Reference< XEvent >& evt) throw (RuntimeException)
+ void SAL_CALL CElementList::handleEvent(Reference< XEvent > const&)
+ throw (RuntimeException)
{
- Reference< XEvent > aEvent = evt;
- m_bRebuild = sal_True;
+ ::osl::MutexGuard const g(m_rMutex);
+
+ m_bRebuild = true;
}
}
diff --git a/unoxml/source/dom/elementlist.hxx b/unoxml/source/dom/elementlist.hxx
index 0ebfd2722eea..95b9960e700f 100644
--- a/unoxml/source/dom/elementlist.hxx
+++ b/unoxml/source/dom/elementlist.hxx
@@ -25,22 +25,27 @@
*
************************************************************************/
-#ifndef _ELEMENTLIST_HXX
-#define _ELEMENTLIST_HXX
+#ifndef DOM_ELEMENTLIST_HXX
+#define DOM_ELEMENTLIST_HXX
#include <vector>
+
+#include <boost/scoped_array.hpp>
+
+#include <libxml/tree.h>
+
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/events/XEvent.hpp>
#include <com/sun/star/xml/dom/events/XEventListener.hpp>
-#include "element.hxx"
-#include "document.hxx"
-#include "libxml/tree.h"
+
+#include <cppuhelper/implbase2.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -49,26 +54,30 @@ using namespace com::sun::star::xml::dom::events;
namespace DOM
{
- typedef std::vector< xmlNodePtr > nodevector;
+ class CElement;
+
+ typedef std::vector< xmlNodePtr > nodevector_t;
- class CElementList : public cppu::WeakImplHelper2< XNodeList, com::sun::star::xml::dom::events::XEventListener >
+ class CElementList
+ : public cppu::WeakImplHelper2< XNodeList,
+ com::sun::star::xml::dom::events::XEventListener >
{
private:
- const CElement* m_pElement;
- const OUString m_aName;
- const OUString m_aURI;
- xmlChar *xName;
- xmlChar *xURI;
- sal_Bool m_bRebuild;
- nodevector m_nodevector;
-
+ ::rtl::Reference<CElement> const m_pElement;
+ ::osl::Mutex & m_rMutex;
+ ::boost::scoped_array<xmlChar> const m_pName;
+ ::boost::scoped_array<xmlChar> const m_pURI;
+ bool m_bRebuild;
+ nodevector_t m_nodevector;
void buildlist(xmlNodePtr pNode, sal_Bool start=sal_True);
- void registerListener(const CElement* pElement);
+ void registerListener(CElement & rElement);
public:
- CElementList(const CElement* aDoc, const OUString& aName);
- CElementList(const CElement* aDoc, const OUString& aName, const OUString& aURI);
+ CElementList(::rtl::Reference<CElement> const& pElement,
+ ::osl::Mutex & rMutex,
+ OUString const& rName, OUString const*const pURI = 0);
+
/**
The number of nodes in the list.
*/
@@ -76,10 +85,12 @@ namespace DOM
/**
Returns the indexth item in the collection.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL item(sal_Int32 index)
+ throw (RuntimeException);
// XEventListener
- virtual void SAL_CALL handleEvent(const Reference< XEvent >& evt) throw (RuntimeException);
+ virtual void SAL_CALL handleEvent(const Reference< XEvent >& evt)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/dom/entitiesmap.cxx b/unoxml/source/dom/entitiesmap.cxx
index 98db3d2c7395..aab2f5551332 100644
--- a/unoxml/source/dom/entitiesmap.cxx
+++ b/unoxml/source/dom/entitiesmap.cxx
@@ -25,12 +25,17 @@
*
************************************************************************/
-#include "entitiesmap.hxx"
+#include <entitiesmap.hxx>
+
+#include <documenttype.hxx>
+
namespace DOM
{
- CEntitiesMap::CEntitiesMap(const CDocumentType* aDocType)
- : m_pDocType(aDocType)
+ CEntitiesMap::CEntitiesMap(::rtl::Reference<CDocumentType> const& pDocType,
+ ::osl::Mutex & rMutex)
+ : m_pDocType(pDocType)
+ , m_rMutex(rMutex)
{
}
@@ -39,62 +44,91 @@ namespace DOM
*/
sal_Int32 SAL_CALL CEntitiesMap::getLength() throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::getLength: not implemented (#i113683#)");
return 0;
}
/**
Retrieves a node specified by local name
*/
- Reference< XNode > SAL_CALL CEntitiesMap::getNamedItem(const OUString& /*name*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::getNamedItem(OUString const& /*name*/) throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::getNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Retrieves a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::getNamedItemNS(const OUString& /*namespaceURI*/,const OUString& /*localName*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::getNamedItemNS(
+ OUString const& /*namespaceURI*/, OUString const& /*localName*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::getNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Returns the indexth item in the map.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::item(sal_Int32 /*index*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::item(sal_Int32 /*index*/) throw (RuntimeException)
{
+ OSL_ENSURE(false, "CEntitiesMap::item: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Removes a node specified by name.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::removeNamedItem(const OUString& /*name*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::removeNamedItem(OUString const& /*name*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::removeNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
// Removes a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::removeNamedItemNS(const OUString& /*namespaceURI*/, const OUString& /*localName*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::removeNamedItemNS(
+ OUString const& /*namespaceURI*/, OUString const& /*localName*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::removeNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
// Adds a node using its nodeName attribute.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::setNamedItem(const Reference< XNode >& /*arg*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::setNamedItem(Reference< XNode > const& /*arg*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::setNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Adds a node using its namespaceURI and localName.
*/
- Reference< XNode > SAL_CALL CEntitiesMap::setNamedItemNS(const Reference< XNode >& /*arg*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CEntitiesMap::setNamedItemNS(Reference< XNode > const& /*arg*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CEntitiesMap::setNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
}
diff --git a/unoxml/source/dom/entitiesmap.hxx b/unoxml/source/dom/entitiesmap.hxx
index 8480f1e0eecd..468e897639db 100644
--- a/unoxml/source/dom/entitiesmap.hxx
+++ b/unoxml/source/dom/entitiesmap.hxx
@@ -25,32 +25,37 @@
*
************************************************************************/
-#ifndef _ENTITIESMAP_HXX
-#define _ENTITIESMAP_HXX
+#ifndef DOM_ENTITIESMAP_HXX
+#define DOM_ENTITIESMAP_HXX
-#include <map>
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
-#include "document.hxx"
-#include "documenttype.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CEntitiesMap : public cppu::WeakImplHelper1< XNamedNodeMap >
+ class CDocumentType;
+
+ class CEntitiesMap
+ : public cppu::WeakImplHelper1< XNamedNodeMap >
{
private:
- const CDocumentType* m_pDocType;
+ ::rtl::Reference<CDocumentType> const m_pDocType;
+ ::osl::Mutex & m_rMutex;
+
public:
- CEntitiesMap(const CDocumentType* aDocType);
+ CEntitiesMap(::rtl::Reference<CDocumentType> const& pDocType,
+ ::osl::Mutex & rMutex);
/**
The number of nodes in this map.
@@ -60,37 +65,48 @@ namespace DOM
/**
Retrieves a node specified by local name
*/
- virtual Reference< XNode > SAL_CALL getNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ getNamedItem(const OUString& name) throw (RuntimeException);
/**
Retrieves a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL getNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL getNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
Returns the indexth item in the map.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ item(sal_Int32 index) throw (RuntimeException);
/**
Removes a node specified by name.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ removeNamedItem(OUString const& name) throw (RuntimeException);
/**
// Removes a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL removeNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
// Adds a node using its nodeName attribute.
*/
- virtual Reference< XNode > SAL_CALL setNamedItem(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItem(Reference< XNode > const& arg)
+ throw (RuntimeException);
/**
Adds a node using its namespaceURI and localName.
*/
- virtual Reference< XNode > SAL_CALL setNamedItemNS(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItemNS(Reference< XNode > const& arg)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/dom/entity.cxx b/unoxml/source/dom/entity.cxx
index de711ae62d8d..3fb1790ab621 100644
--- a/unoxml/source/dom/entity.cxx
+++ b/unoxml/source/dom/entity.cxx
@@ -25,18 +25,35 @@
*
************************************************************************/
-#include "entity.hxx"
+#include <entity.hxx>
#include <string.h>
+
namespace DOM
{
- CEntity::CEntity(const xmlEntityPtr aEntityPtr)
+ CEntity::CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlEntityPtr const pEntity)
+ : CEntity_Base(rDocument, rMutex,
+ NodeType_ENTITY_NODE, reinterpret_cast<xmlNodePtr>(pEntity))
+ , m_aEntityPtr(pEntity)
+ {
+ }
+
+ bool CEntity::IsChildTypeAllowed(NodeType const nodeType)
{
- m_aNodeType = NodeType_ENTITY_NODE;
- m_aEntityPtr = aEntityPtr;
- init_node((xmlNodePtr)aEntityPtr);
+ switch (nodeType) {
+ case NodeType_ELEMENT_NODE:
+ case NodeType_PROCESSING_INSTRUCTION_NODE:
+ case NodeType_COMMENT_NODE:
+ case NodeType_TEXT_NODE:
+ case NodeType_CDATA_SECTION_NODE:
+ case NodeType_ENTITY_REFERENCE_NODE:
+ return true;
+ default:
+ return false;
+ }
}
/**
@@ -44,7 +61,8 @@ namespace DOM
*/
OUString SAL_CALL CEntity::getNotationName() throw (RuntimeException)
{
- // XXX
+ OSL_ENSURE(false,
+ "CEntity::getNotationName: not implemented (#i113683#)");
return OUString();
}
@@ -53,6 +71,8 @@ namespace DOM
*/
OUString SAL_CALL CEntity::getPublicId() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aID;
if(m_aEntityPtr != NULL)
{
@@ -66,6 +86,8 @@ namespace DOM
*/
OUString SAL_CALL CEntity::getSystemId() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aID;
if(m_aEntityPtr != NULL)
{
@@ -75,6 +97,8 @@ namespace DOM
}
OUString SAL_CALL CEntity::getNodeName()throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aName;
if (m_aNodePtr != NULL)
{
diff --git a/unoxml/source/dom/entity.hxx b/unoxml/source/dom/entity.hxx
index 0343a13dda16..671ad8af91cf 100644
--- a/unoxml/source/dom/entity.hxx
+++ b/unoxml/source/dom/entity.hxx
@@ -25,16 +25,19 @@
*
************************************************************************/
-#ifndef _ENTITY_HXX
-#define _ENTITY_HXX
+#ifndef DOM_ENTITY_HXX
+#define DOM_ENTITY_HXX
+
+#include <libxml/tree.h>
+#include <libxml/entities.h>
#include <sal/types.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XEntity.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
-#include <libxml/entities.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -42,16 +45,23 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CEntity : public cppu::ImplInheritanceHelper1< CNode, XEntity >
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XEntity > CEntity_Base;
+
+ class CEntity
+ : public CEntity_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
private:
xmlEntityPtr m_aEntityPtr;
protected:
- CEntity(const xmlEntityPtr aEntityPtr);
+ CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlEntityPtr const pEntity);
public:
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
/**
For unparsed entities, the name of the notation for the entity.
diff --git a/unoxml/source/dom/entityreference.cxx b/unoxml/source/dom/entityreference.cxx
index 6cdce0c8ed3d..0dda6bc3f495 100644
--- a/unoxml/source/dom/entityreference.cxx
+++ b/unoxml/source/dom/entityreference.cxx
@@ -25,18 +25,39 @@
*
************************************************************************/
-#include "entityreference.hxx"
+#include <entityreference.hxx>
+
#include <string.h>
namespace DOM
{
- CEntityReference::CEntityReference(const xmlNodePtr aNodePtr)
+ CEntityReference::CEntityReference(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CEntityReference_Base(rDocument, rMutex,
+ NodeType_ENTITY_REFERENCE_NODE, pNode)
+ {
+ }
+
+ bool CEntityReference::IsChildTypeAllowed(NodeType const nodeType)
{
- m_aNodeType = NodeType_ENTITY_REFERENCE_NODE;
- init_node(aNodePtr);
+ switch (nodeType) {
+ case NodeType_ELEMENT_NODE:
+ case NodeType_PROCESSING_INSTRUCTION_NODE:
+ case NodeType_COMMENT_NODE:
+ case NodeType_TEXT_NODE:
+ case NodeType_CDATA_SECTION_NODE:
+ case NodeType_ENTITY_REFERENCE_NODE:
+ return true;
+ default:
+ return false;
+ }
}
+
OUString SAL_CALL CEntityReference::getNodeName()throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aName;
if (m_aNodePtr != NULL)
{
@@ -45,6 +66,7 @@ namespace DOM
}
return aName;
}
+
OUString SAL_CALL CEntityReference::getNodeValue() throw (RuntimeException)
{
return OUString();
diff --git a/unoxml/source/dom/entityreference.hxx b/unoxml/source/dom/entityreference.hxx
index 1ab8217bc628..d4e349076453 100644
--- a/unoxml/source/dom/entityreference.hxx
+++ b/unoxml/source/dom/entityreference.hxx
@@ -25,13 +25,16 @@
*
************************************************************************/
-#ifndef _ENTITYREFERENCE_HXX
-#define _ENTITYREFERENCE_HXX
+#ifndef DOM_ENTITYREFERENCE_HXX
+#define DOM_ENTITYREFERENCE_HXX
+
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XEntityReference.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -39,13 +42,23 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CEntityReference : public cppu::ImplInheritanceHelper1< CNode, XEntityReference >
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XEntityReference >
+ CEntityReference_Base;
+
+ class CEntityReference
+ : public CEntityReference_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
protected:
- CEntityReference(const xmlNodePtr aNodePtr);
+ CEntityReference(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
+
// ---- resolve uno inheritance problems...
// overrides for XNode base
virtual OUString SAL_CALL getNodeName()
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index d4b317b425b3..fb95fa6ade02 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -25,35 +25,47 @@
*
************************************************************************/
+#include <node.hxx>
+
#include <stdio.h>
#include <string.h>
-#include "node.hxx"
-#include "element.hxx"
-#include "text.hxx"
-#include "cdatasection.hxx"
-#include "entityreference.hxx"
-#include "entity.hxx"
-#include "processinginstruction.hxx"
-#include "comment.hxx"
-#include "document.hxx"
-#include "documenttype.hxx"
-#include "documentfragment.hxx"
-#include "notation.hxx"
-#include "childlist.hxx"
-#include "attr.hxx"
+
+#include <libxml/xmlstring.h>
+
+#include <algorithm>
+
+#include <boost/bind.hpp>
+
+#include <rtl/uuid.h>
+#include <rtl/instance.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/xml/sax/FastToken.hpp>
-#include "rtl/instance.hxx"
-#include "osl/mutex.hxx"
+
+#include <document.hxx>
+#include <attr.hxx>
+#include <childlist.hxx>
+
#include "../events/eventdispatcher.hxx"
#include "../events/mutationevent.hxx"
-#include <boost/bind.hpp>
-#include <algorithm>
+
+
+using namespace ::com::sun::star;
+
namespace {
-//see CNode::remove
- struct NodeMutex: public ::rtl::Static<osl::Mutex, NodeMutex> {};
+ struct UnoTunnelId
+ : public ::rtl::StaticWithInit< Sequence<sal_Int8>, UnoTunnelId >
+ {
+ Sequence<sal_Int8> operator() ()
+ {
+ Sequence<sal_Int8> ret(16);
+ rtl_createUuid(
+ reinterpret_cast<sal_uInt8*>(ret.getArray()), 0, sal_True);
+ return ret;
+ }
+ };
}
namespace DOM
@@ -133,160 +145,64 @@ namespace DOM
}
- nodemap_t CNode::theNodeMap;
-
- void CNode::remove(const xmlNodePtr aNode)
+ CNode::CNode(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode)
+ : m_bUnlinked(false)
+ , m_aNodeType(reNodeType)
+ , m_aNodePtr(rpNode)
+ // keep containing document alive
+ // (but not if this is a document; that would create a leak!)
+ , m_xDocument( (m_aNodePtr->type != XML_DOCUMENT_NODE)
+ ? &const_cast<CDocument&>(rDocument) : 0 )
+ , m_rMutex(const_cast< ::osl::Mutex & >(rMutex))
{
- //Using the guard here protects against races when at the same time
- //CNode::get() is called. This fix helps in many cases but is still
- //incorrect. remove is called from ~CNode. That is, while the object
- //is being destructed it can still be obtained by calling CNode::get().
- //Another bug currently prevents the correct destruction of CNodes. So
- //the destructor is rarely called.
- //
- //Doing this right would probably mean to store WeakReferences in the
- //map and also guard oder functions. To keep the risk at a minimum
- //we keep this imperfect fix for the upcoming release and fix it later
- //properly (http://qa.openoffice.org/issues/show_bug.cgi?id=113682)
- ::osl::MutexGuard guard(NodeMutex::get());
- nodemap_t::iterator i = CNode::theNodeMap.find(aNode);
- if (i != CNode::theNodeMap.end())
- {
- // CNode *pNode = i->second;
- CNode::theNodeMap.erase(i);
- }
+ OSL_ASSERT(m_aNodePtr);
}
-
- CNode* CNode::get(const xmlNodePtr aNode, sal_Bool bCreate)
+ void CNode::invalidate()
{
- CNode* pNode = 0;
- if (aNode == NULL)
- return 0;
- //see CNode::remove
- ::osl::MutexGuard guard(NodeMutex::get());
- //check whether there is already an instance for this node
- nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode);
- if (i != CNode::theNodeMap.end())
- {
- pNode = i->second;
- } else
- {
-
- // there is not yet an instance wrapping this node,
- // create it and store it in the map
- if (!bCreate) return NULL;
-
- switch (aNode->type)
- {
- case XML_ELEMENT_NODE:
- // m_aNodeType = NodeType::ELEMENT_NODE;
- pNode = static_cast< CNode* >(new CElement(aNode));
- break;
- case XML_TEXT_NODE:
- // m_aNodeType = NodeType::TEXT_NODE;
- pNode = static_cast< CNode* >(new CText(aNode));
- break;
- case XML_CDATA_SECTION_NODE:
- // m_aNodeType = NodeType::CDATA_SECTION_NODE;
- pNode = static_cast< CNode* >(new CCDATASection(aNode));
- break;
- case XML_ENTITY_REF_NODE:
- // m_aNodeType = NodeType::ENTITY_REFERENCE_NODE;
- pNode = static_cast< CNode* >(new CEntityReference(aNode));
- break;
- case XML_ENTITY_NODE:
- // m_aNodeType = NodeType::ENTITY_NODE;
- pNode = static_cast< CNode* >(new CEntity((xmlEntityPtr)aNode));
- break;
- case XML_PI_NODE:
- // m_aNodeType = NodeType::PROCESSING_INSTRUCTION_NODE;
- pNode = static_cast< CNode* >(new CProcessingInstruction(aNode));
- break;
- case XML_COMMENT_NODE:
- // m_aNodeType = NodeType::COMMENT_NODE;
- pNode = static_cast< CNode* >(new CComment(aNode));
- break;
- case XML_DOCUMENT_NODE:
- // m_aNodeType = NodeType::DOCUMENT_NODE;
- pNode = static_cast< CNode* >(new CDocument((xmlDocPtr)aNode));
- break;
- case XML_DOCUMENT_TYPE_NODE:
- case XML_DTD_NODE:
- // m_aNodeType = NodeType::DOCUMENT_TYPE_NODE;
- pNode = static_cast< CNode* >(new CDocumentType((xmlDtdPtr)aNode));
- break;
- case XML_DOCUMENT_FRAG_NODE:
- // m_aNodeType = NodeType::DOCUMENT_FRAGMENT_NODE;
- pNode = static_cast< CNode* >(new CDocumentFragment(aNode));
- break;
- case XML_NOTATION_NODE:
- // m_aNodeType = NodeType::NOTATION_NODE;
- pNode = static_cast< CNode* >(new CNotation((xmlNotationPtr)aNode));
- break;
- case XML_ATTRIBUTE_NODE:
- // m_aNodeType = NodeType::NOTATION_NODE;
- pNode = static_cast< CNode* >(new CAttr((xmlAttrPtr)aNode));
- break;
- // unsupported node types
- case XML_HTML_DOCUMENT_NODE:
- case XML_ELEMENT_DECL:
- case XML_ATTRIBUTE_DECL:
- case XML_ENTITY_DECL:
- case XML_NAMESPACE_DECL:
- default:
- pNode = 0;
- break;
- }
-
- if ( pNode != 0 )
- {
- if(!CNode::theNodeMap.insert(nodemap_t::value_type(aNode, pNode)).second)
- {
- // if insertion failed, delete the new instance and return null
- delete pNode;
- pNode = 0;
- }
- }
+ //remove from list if this wrapper goes away
+ if (m_aNodePtr != 0 && m_xDocument.is()) {
+ m_xDocument->RemoveCNode(m_aNodePtr, this);
+ }
+ // #i113663#: unlinked nodes will not be freed by xmlFreeDoc
+ if (m_bUnlinked) {
+ xmlFreeNode(m_aNodePtr);
}
- OSL_ENSURE(pNode, "no node produced during CNode::get!");
- return pNode;
+ m_aNodePtr = 0;
}
- xmlNodePtr CNode::getNodePtr(const Reference< XNode >& aNode)
+ CNode::~CNode()
{
- try {
- CNode* pNode=dynamic_cast<CNode*>(aNode.get());
- if( pNode )
- return pNode->m_aNodePtr;
- }
- catch(...) {}
- return 0;
+ // if this is the document itself, the mutex is already freed!
+ if (NodeType_DOCUMENT_NODE == m_aNodeType) {
+ invalidate();
+ } else {
+ ::osl::MutexGuard const g(m_rMutex);
+ invalidate(); // other nodes are still alive so must lock mutex
+ }
}
- CNode::CNode()
- : m_aNodePtr(0)
+ CNode *
+ CNode::GetImplementation(uno::Reference<uno::XInterface> const& xNode)
{
+ uno::Reference<lang::XUnoTunnel> const xUnoTunnel(xNode, UNO_QUERY);
+ if (!xUnoTunnel.is()) { return 0; }
+ CNode *const pCNode( reinterpret_cast< CNode* >(
+ ::sal::static_int_cast< sal_IntPtr >(
+ xUnoTunnel->getSomething(UnoTunnelId::get()))));
+ return pCNode;
}
- void CNode::init_node(const xmlNodePtr aNode)
+ CDocument & CNode::GetOwnerDocument()
{
- m_aNodePtr = aNode;
-
- // keep containing document alive
- // (if we are not that document ourselves)
- if (m_aNodePtr->type != XML_DOCUMENT_NODE)
- m_rDocument = getOwnerDocument();
+ OSL_ASSERT(m_xDocument.is());
+ return *m_xDocument; // needs overriding in CDocument!
}
- CNode::~CNode()
- {
- //remove from list if this wrapper goes away
- if (m_aNodePtr != 0)
- CNode::remove(m_aNodePtr);
- }
- static void _nsexchange(const xmlNodePtr aNode, xmlNsPtr oldNs, xmlNsPtr newNs)
+ static void lcl_nsexchange(
+ xmlNodePtr const aNode, xmlNsPtr const oldNs, xmlNsPtr const newNs)
{
// recursively exchange any references to oldNs with references to newNs
xmlNodePtr cur = aNode;
@@ -303,13 +219,13 @@ namespace DOM
curAttr->ns = newNs;
curAttr = curAttr->next;
}
- _nsexchange(cur->children, oldNs, newNs);
+ lcl_nsexchange(cur->children, oldNs, newNs);
}
cur = cur->next;
}
}
- /*static*/ void _nscleanup(const xmlNodePtr aNode, const xmlNodePtr aParent)
+ /*static*/ void nscleanup(const xmlNodePtr aNode, const xmlNodePtr aParent)
{
xmlNodePtr cur = aNode;
@@ -331,7 +247,7 @@ namespace DOM
while (cur != NULL)
{
- _nscleanup(cur->children, cur);
+ nscleanup(cur->children, cur);
if (cur->ns != NULL)
{
xmlNsPtr ns = xmlSearchNs(cur->doc, aParent, cur->ns->prefix);
@@ -346,7 +262,7 @@ namespace DOM
{
// reconnect ns pointers in sub-tree to newly found ns before
// removing redundant nsdecl to prevent dangling pointers.
- _nsexchange(cur, curDef, ns);
+ lcl_nsexchange(cur, curDef, ns);
*refp = curDef->next;
xmlFreeNs(curDef);
curDef = *refp;
@@ -361,184 +277,187 @@ namespace DOM
}
}
- void SAL_CALL CNode::saxify(
- const Reference< XDocumentHandler >& i_xHandler) {
+ void CNode::saxify(const Reference< XDocumentHandler >& i_xHandler)
+ {
if (!i_xHandler.is()) throw RuntimeException();
// default: do nothing
}
- void SAL_CALL CNode::fastSaxify(Context& io_rContext) {
+ void CNode::fastSaxify(Context& io_rContext)
+ {
if (!io_rContext.mxDocHandler.is()) throw RuntimeException();
// default: do nothing
}
+ bool CNode::IsChildTypeAllowed(NodeType const /*nodeType*/)
+ {
+ // default: no children allowed
+ return false;
+ }
+
/**
Adds the node newChild to the end of the list of children of this node.
*/
- Reference< XNode > CNode::appendChild(const Reference< XNode >& newChild)
+ Reference< XNode > SAL_CALL CNode::appendChild(
+ Reference< XNode > const& xNewChild)
throw (RuntimeException, DOMException)
{
- Reference< XNode> aNode;
- if (m_aNodePtr != NULL) {
- xmlNodePtr cur = CNode::getNodePtr(newChild.get());
+ ::osl::ClearableMutexGuard guard(m_rMutex);
- // error checks:
- // from other document
- if (cur->doc != m_aNodePtr->doc) {
- DOMException e;
- e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
- throw e;
- }
- // same node
- if (cur == m_aNodePtr) {
- DOMException e;
- e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
- throw e;
- }
- // already has parant and is not attribute
- if (cur->parent != NULL && cur->type != XML_ATTRIBUTE_NODE) {
- DOMException e;
- e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
- throw e;
- }
+ if (0 == m_aNodePtr) { return 0; }
- // check whether this is an attribute node so we remove it's
- // carrier node if it has one
- xmlNodePtr res = NULL;
- if (cur->type == XML_ATTRIBUTE_NODE)
- {
- if (cur->parent != NULL)
- {
- if (m_aNodePtr->type != XML_ELEMENT_NODE ||
- strcmp((char*)cur->parent->name, "__private") != 0)
- {
- DOMException e;
- e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
- throw e;
- }
-
- xmlNsPtr pAttrNs = cur->ns;
- xmlNsPtr pParentNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, pAttrNs->prefix);
- if (pParentNs == NULL || strcmp((char*)pParentNs->href, (char*)pAttrNs->href) != 0)
- pParentNs = xmlNewNs(m_aNodePtr, pAttrNs->href, pAttrNs->prefix);
+ CNode *const pNewChild(CNode::GetImplementation(xNewChild));
+ if (!pNewChild) { throw RuntimeException(); }
+ xmlNodePtr const cur = pNewChild->GetNodePtr();
+ if (!cur) { throw RuntimeException(); }
- if (cur->children != NULL)
- res = (xmlNodePtr)xmlNewNsProp(m_aNodePtr, pParentNs, cur->name, cur->children->content);
- else
- res = (xmlNodePtr)xmlNewProp(m_aNodePtr, cur->name, (xmlChar*) "");
+ // error checks:
+ // from other document
+ if (cur->doc != m_aNodePtr->doc) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
+ // same node
+ if (cur == m_aNodePtr) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ if (cur->parent != NULL) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ if (!IsChildTypeAllowed(pNewChild->m_aNodeType)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
- xmlFreeNode(cur->parent);
- cur->parent = NULL;
- }
- else
- {
- if (cur->children != NULL)
- res = (xmlNodePtr)xmlNewProp(m_aNodePtr, cur->name, cur->children->content);
- else
- res = (xmlNodePtr)xmlNewProp(m_aNodePtr, cur->name, (xmlChar*) "");
- }
- }
- else
- {
- res = xmlAddChild(m_aNodePtr, cur);
+ // check whether this is an attribute node; it needs special handling
+ xmlNodePtr res = NULL;
+ if (cur->type == XML_ATTRIBUTE_NODE)
+ {
+ xmlChar const*const pChildren((cur->children)
+ ? cur->children->content
+ : reinterpret_cast<xmlChar const*>(""));
+ CAttr *const pCAttr(dynamic_cast<CAttr *>(pNewChild));
+ if (!pCAttr) { throw RuntimeException(); }
+ xmlNsPtr const pNs( pCAttr->GetNamespace(m_aNodePtr) );
+ if (pNs) {
+ res = reinterpret_cast<xmlNodePtr>(
+ xmlNewNsProp(m_aNodePtr, pNs, cur->name, pChildren));
+ } else {
+ res = reinterpret_cast<xmlNodePtr>(
+ xmlNewProp(m_aNodePtr, cur->name, pChildren));
}
+ }
+ else
+ {
+ res = xmlAddChild(m_aNodePtr, cur);
- // libxml can do optimizations, when appending nodes.
+ // libxml can do optimization when appending nodes.
// if res != cur, something was optimized and the newchild-wrapper
// should be updated
- if (cur != res)
- CNode::remove(cur);
+ if (res && (cur != res)) {
+ pNewChild->invalidate(); // cur has been freed
+ }
+ }
+
+ if (!res) { return 0; }
- // use custom ns cleanup instaead of
- // xmlReconciliateNs(m_aNodePtr->doc, m_aNodePtr);
+ // use custom ns cleanup instead of
+ // xmlReconciliateNs(m_aNodePtr->doc, m_aNodePtr);
// because that will not remove unneeded ns decls
- _nscleanup(res, m_aNodePtr);
+ nscleanup(res, m_aNodePtr);
- aNode = Reference< XNode>(CNode::get(res));
- }
- //XXX check for errors
+ ::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(res);
+
+ if (!pNode.is()) { return 0; }
// dispatch DOMNodeInserted event, target is the new node
// this node is the related node
// does bubble
- if (aNode.is())
- {
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMNodeInserted")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMNodeInserted")
- , sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)),
- OUString(), OUString(), OUString(), (AttrChangeType)0 );
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ pNode->m_bUnlinked = false; // will be deleted by xmlFreeDoc
+ Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
+ Reference< XMutationEvent > event(docevent->createEvent(
+ OUString::createFromAscii("DOMNodeInserted")), UNO_QUERY);
+ event->initMutationEvent(OUString::createFromAscii("DOMNodeInserted")
+ , sal_True, sal_False,
+ this,
+ OUString(), OUString(), OUString(), (AttrChangeType)0 );
- // dispatch subtree modified for this node
- dispatchSubtreeModified();
- }
- return aNode;
+ // the following dispatch functions use only UNO interfaces
+ // and call event listeners, so release mutex to prevent deadlocks.
+ guard.clear();
+
+ dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ // dispatch subtree modified for this node
+ dispatchSubtreeModified();
+
+ return pNode.get();
}
/**
Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes.
*/
- Reference< XNode > CNode::cloneNode(sal_Bool bDeep)
+ Reference< XNode > SAL_CALL CNode::cloneNode(sal_Bool bDeep)
throw (RuntimeException)
{
- Reference< XNode> aNode;
- if (m_aNodePtr != NULL)
- {
- aNode = Reference< XNode>(CNode::get(
- xmlCopyNode (m_aNodePtr, static_cast< int >(bDeep))
- ));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- //XXX check for errors
- return aNode;
+ ::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
+ xmlCopyNode(m_aNodePtr, (bDeep) ? 1 : 0));
+ if (!pNode.is()) { return 0; }
+ pNode->m_bUnlinked = true; // not linked yet
+ return pNode.get();
}
/**
A NamedNodeMap containing the attributes of this node (if it is an Element)
or null otherwise.
*/
- Reference< XNamedNodeMap > CNode::getAttributes()
+ Reference< XNamedNodeMap > SAL_CALL CNode::getAttributes()
throw (RuntimeException)
{
- // return empty reference
- // only element node may override this impl
+ // return empty reference; only element node may override this impl
return Reference< XNamedNodeMap>();
-
- // get all children that are attributes
- /* --> CElement
- Reference< NamedNodeMap > aNodeMap(new AttributeNamedNodeMap(m_aNodePtr), UNO_QUERY);
- return aNodeMap;
- */
}
/**
A NodeList that contains all children of this node.
*/
- Reference< XNodeList > CNode::getChildNodes()
+ Reference< XNodeList > SAL_CALL CNode::getChildNodes()
throw (RuntimeException)
{
- Reference< XNodeList > aNodeList;
- if (m_aNodePtr != NULL)
- {
- aNodeList = Reference< XNodeList >(new CChildList(CNode::get(m_aNodePtr)));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- // XXX check for errors?
- return aNodeList;
+ Reference< XNodeList > const xNodeList(new CChildList(this, m_rMutex));
+ return xNodeList;
}
/**
The first child of this node.
*/
- Reference< XNode > CNode::getFirstChild()
+ Reference< XNode > SAL_CALL CNode::getFirstChild()
throw (RuntimeException)
{
- Reference< XNode > aNode;
- if (m_aNodePtr != NULL) {
- aNode = Reference< XNode >(CNode::get(m_aNodePtr->children));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aNode;
+ Reference< XNode > const xNode(
+ GetOwnerDocument().GetCNode(m_aNodePtr->children).get());
+ return xNode;
}
/**
@@ -547,11 +466,14 @@ namespace DOM
Reference< XNode > SAL_CALL CNode::getLastChild()
throw (RuntimeException)
{
- Reference< XNode > aNode;
- if (m_aNodePtr != NULL) {
- aNode = Reference< XNode >(CNode::get(xmlGetLastChild(m_aNodePtr)));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aNode;
+ Reference< XNode > const xNode(
+ GetOwnerDocument().GetCNode(xmlGetLastChild(m_aNodePtr)).get());
+ return xNode;
}
/**
@@ -560,17 +482,8 @@ namespace DOM
OUString SAL_CALL CNode::getLocalName()
throw (RuntimeException)
{
- OUString aName;
- /*
- --> Element / Attribute
- if(m_aNodePtr != NULL && (m_aNodeType == NodeType::ATTRIBUTE_NODE
- || m_aNodeType == NodeType::ELEMENT_NODE))
- {
- aName = OUString(m_aNodePtr->name, RTL_TEXTENCODING_UTF8);
- }
- //XXX error checking
- */
- return aName;
+ // see CElement/CAttr
+ return ::rtl::OUString();
}
@@ -580,6 +493,8 @@ namespace DOM
OUString SAL_CALL CNode::getNamespaceURI()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aURI;
if (m_aNodePtr != NULL &&
(m_aNodePtr->type == XML_ELEMENT_NODE || m_aNodePtr->type == XML_ATTRIBUTE_NODE) &&
@@ -597,12 +512,14 @@ namespace DOM
Reference< XNode > SAL_CALL CNode::getNextSibling()
throw (RuntimeException)
{
- Reference< XNode > aNode;
- if(m_aNodePtr != NULL)
- {
- aNode = Reference< XNode >(CNode::get(m_aNodePtr->next));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aNode;
+ Reference< XNode > const xNode(
+ GetOwnerDocument().GetCNode(m_aNodePtr->next).get());
+ return xNode;
}
/**
@@ -639,6 +556,8 @@ namespace DOM
NodeType SAL_CALL CNode::getNodeType()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return m_aNodeType;
}
@@ -658,14 +577,13 @@ namespace DOM
Reference< XDocument > SAL_CALL CNode::getOwnerDocument()
throw (RuntimeException)
{
- Reference<XDocument> aDoc;
- if (m_aNodePtr != NULL)
- {
- aDoc = Reference< XDocument >(static_cast< CDocument* >(
- CNode::get((xmlNodePtr)m_aNodePtr->doc)));
- }
- return aDoc;
+ ::osl::MutexGuard const g(m_rMutex);
+ if (0 == m_aNodePtr) {
+ return 0;
+ }
+ Reference< XDocument > const xDoc(& GetOwnerDocument());
+ return xDoc;
}
/**
@@ -674,12 +592,14 @@ namespace DOM
Reference< XNode > SAL_CALL CNode::getParentNode()
throw (RuntimeException)
{
- Reference<XNode> aNode;
- if (m_aNodePtr != NULL)
- {
- aNode = Reference< XNode >(CNode::get(m_aNodePtr->parent));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aNode;
+ Reference< XNode > const xNode(
+ GetOwnerDocument().GetCNode(m_aNodePtr->parent).get());
+ return xNode;
}
/**
@@ -688,6 +608,8 @@ namespace DOM
OUString SAL_CALL CNode::getPrefix()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aPrefix;
if (m_aNodePtr != NULL &&
(m_aNodePtr->type == XML_ELEMENT_NODE || m_aNodePtr->type == XML_ATTRIBUTE_NODE) &&
@@ -707,12 +629,14 @@ namespace DOM
Reference< XNode > SAL_CALL CNode::getPreviousSibling()
throw (RuntimeException)
{
- Reference< XNode > aNode;
- if (m_aNodePtr != NULL)
- {
- aNode = Reference< XNode >(CNode::get(m_aNodePtr->prev));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return 0;
}
- return aNode;
+ Reference< XNode > const xNode(
+ GetOwnerDocument().GetCNode(m_aNodePtr->prev).get());
+ return xNode;
}
/**
@@ -721,6 +645,8 @@ namespace DOM
sal_Bool SAL_CALL CNode::hasAttributes()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (m_aNodePtr != NULL && m_aNodePtr->properties != NULL);
}
@@ -730,6 +656,8 @@ namespace DOM
sal_Bool SAL_CALL CNode::hasChildNodes()
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (m_aNodePtr != NULL && m_aNodePtr->children != NULL);
}
@@ -740,6 +668,7 @@ namespace DOM
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
throw (RuntimeException, DOMException)
{
+ if (!newChild.is() || !refChild.is()) { throw RuntimeException(); }
if (newChild->getOwnerDocument() != getOwnerDocument()) {
DOMException e;
@@ -752,11 +681,42 @@ namespace DOM
throw e;
}
- xmlNodePtr pRefChild = CNode::getNodePtr(refChild.get());
- xmlNodePtr pNewChild = CNode::getNodePtr(newChild.get());
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
+ CNode *const pNewNode(CNode::GetImplementation(newChild));
+ CNode *const pRefNode(CNode::GetImplementation(refChild));
+ if (!pNewNode || !pRefNode) { throw RuntimeException(); }
+ xmlNodePtr const pNewChild(pNewNode->GetNodePtr());
+ xmlNodePtr const pRefChild(pRefNode->GetNodePtr());
+ if (!pNewChild || !pRefChild) { throw RuntimeException(); }
+
+ if (pNewChild == m_aNodePtr) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ // already has parent
+ if (pNewChild->parent != NULL)
+ {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ if (!IsChildTypeAllowed(pNewNode->m_aNodeType)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+
+ // attributes are unordered anyway, so just do appendChild
+ if (XML_ATTRIBUTE_NODE == pNewChild->type) {
+ guard.clear();
+ return appendChild(newChild);
+ }
+
xmlNodePtr cur = m_aNodePtr->children;
- //search cild before which to insert
+ //search child before which to insert
while (cur != NULL)
{
if (cur == pRefChild) {
@@ -764,8 +724,16 @@ namespace DOM
pNewChild->next = cur;
pNewChild->prev = cur->prev;
cur->prev = pNewChild;
- if( pNewChild->prev != NULL)
+ if (pNewChild->prev != NULL) {
pNewChild->prev->next = pNewChild;
+ }
+ pNewChild->parent = cur->parent;
+ if (pNewChild->parent->children == cur) {
+ pNewChild->parent->children = pNewChild;
+ }
+ // do not update parent->last here!
+ pNewNode->m_bUnlinked = false; // will be deleted by xmlFreeDoc
+ break;
}
cur = cur->next;
}
@@ -779,7 +747,7 @@ namespace DOM
sal_Bool SAL_CALL CNode::isSupported(const OUString& /*feature*/, const OUString& /*ver*/)
throw (RuntimeException)
{
- // XXX
+ OSL_ENSURE(false, "CNode::isSupported: not implemented (#i113683#)");
return sal_False;
}
@@ -794,58 +762,54 @@ namespace DOM
throw (RuntimeException)
{
//XXX combine adjacent text nodes and remove empty ones
+ OSL_ENSURE(false, "CNode::normalize: not implemented (#i113683#)");
}
/**
Removes the child node indicated by oldChild from the list of children,
and returns it.
*/
- Reference< XNode > SAL_CALL CNode::removeChild(const Reference< XNode >& oldChild)
+ Reference< XNode > SAL_CALL
+ CNode::removeChild(const Reference< XNode >& xOldChild)
throw (RuntimeException, DOMException)
{
+ if (!xOldChild.is()) {
+ throw RuntimeException();
+ }
- if (oldChild->getParentNode() != Reference< XNode >(this)) {
+ if (xOldChild->getOwnerDocument() != getOwnerDocument()) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
+ if (xOldChild->getParentNode() != Reference< XNode >(this)) {
DOMException e;
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
throw e;
}
- Reference<XNode> xReturn( oldChild );
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
+ if (!m_aNodePtr) { throw RuntimeException(); }
- xmlNodePtr old = CNode::getNodePtr(oldChild);
+ Reference<XNode> xReturn( xOldChild );
+
+ ::rtl::Reference<CNode> const pOld(CNode::GetImplementation(xOldChild));
+ if (!pOld.is()) { throw RuntimeException(); }
+ xmlNodePtr const old = pOld->GetNodePtr();
+ if (!old) { throw RuntimeException(); }
if( old->type == XML_ATTRIBUTE_NODE )
{
- xmlAttrPtr pAttr = (xmlAttrPtr) old;
+ xmlAttrPtr pAttr = reinterpret_cast<xmlAttrPtr>(old);
xmlRemoveProp( pAttr );
+ pOld->invalidate(); // freed by xmlRemoveProp
xReturn.clear();
}
else
{
-
- // update .last
- if (m_aNodePtr->last == old)
- m_aNodePtr->last = old->prev;
-
- xmlNodePtr cur = m_aNodePtr->children;
- //find old node in child list
- while (cur != NULL)
- {
- if(cur == old)
- {
- // unlink node from list
- if (cur->prev != NULL)
- cur->prev->next = cur->next;
- if (cur->next != NULL)
- cur->next->prev = cur->prev;
- if (cur->parent != NULL && cur->parent->children == cur)
- cur->parent->children = cur->next;
- cur->prev = NULL;
- cur->next = NULL;
- cur->parent = NULL;
- }
- cur = cur->next;
- }
+ xmlUnlinkNode(old);
+ pOld->m_bUnlinked = true;
}
/*DOMNodeRemoved
@@ -856,19 +820,23 @@ namespace DOM
* Cancelable: No
* Context Info: relatedNode holds the parent node
*/
- if (oldChild.is())
- {
- Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
- Reference< XMutationEvent > event(docevent->createEvent(
- OUString::createFromAscii("DOMNodeRemoved")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMNodeRemoved"), sal_True,
- sal_False, Reference< XNode >(CNode::get(m_aNodePtr)),
- OUString(), OUString(), OUString(), (AttrChangeType)0 );
- dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
+ Reference< XMutationEvent > event(docevent->createEvent(
+ OUString::createFromAscii("DOMNodeRemoved")), UNO_QUERY);
+ event->initMutationEvent(OUString::createFromAscii("DOMNodeRemoved"),
+ sal_True,
+ sal_False,
+ this,
+ OUString(), OUString(), OUString(), (AttrChangeType)0 );
+
+ // the following dispatch functions use only UNO interfaces
+ // and call event listeners, so release mutex to prevent deadlocks.
+ guard.clear();
+
+ dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
+ // subtree modified for this node
+ dispatchSubtreeModified();
- // subtree modofied for this node
- dispatchSubtreeModified();
- }
return xReturn;
}
@@ -877,23 +845,56 @@ namespace DOM
and returns the oldChild node.
*/
Reference< XNode > SAL_CALL CNode::replaceChild(
- const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
+ Reference< XNode > const& xNewChild,
+ Reference< XNode > const& xOldChild)
throw (RuntimeException, DOMException)
{
- // XXX check node types
+ if (!xOldChild.is() || !xNewChild.is()) {
+ throw RuntimeException();
+ }
- if (oldChild->getParentNode() != Reference< XNode >(this)) {
+ if (xNewChild->getOwnerDocument() != getOwnerDocument()) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
+ if (xOldChild->getParentNode() != Reference< XNode >(this)) {
DOMException e;
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
throw e;
}
+ ::osl::ClearableMutexGuard guard(m_rMutex);
+
/*
Reference< XNode > aNode = removeChild(oldChild);
appendChild(newChild);
*/
- xmlNodePtr pOld = CNode::getNodePtr(oldChild);
- xmlNodePtr pNew = CNode::getNodePtr(newChild);
+ ::rtl::Reference<CNode> const pOldNode(
+ CNode::GetImplementation(xOldChild));
+ ::rtl::Reference<CNode> const pNewNode(
+ CNode::GetImplementation(xNewChild));
+ if (!pOldNode.is() || !pNewNode.is()) { throw RuntimeException(); }
+ xmlNodePtr const pOld = pOldNode->GetNodePtr();
+ xmlNodePtr const pNew = pNewNode->GetNodePtr();
+ if (!pOld || !pNew) { throw RuntimeException(); }
+
+ if (pNew == m_aNodePtr) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ // already has parent
+ if (pNew->parent != NULL) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+ if (!IsChildTypeAllowed(pNewNode->m_aNodeType)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
if( pOld->type == XML_ATTRIBUTE_NODE )
{
@@ -907,7 +908,8 @@ namespace DOM
xmlAttrPtr pAttr = (xmlAttrPtr)pOld;
xmlRemoveProp( pAttr );
- appendChild( newChild );
+ pOldNode->invalidate(); // freed by xmlRemoveProp
+ appendChild(xNewChild);
}
else
{
@@ -933,24 +935,30 @@ namespace DOM
pOld->next = NULL;
pOld->prev = NULL;
pOld->parent = NULL;
+ pOldNode->m_bUnlinked = true;
+ pNewNode->m_bUnlinked = false; // will be deleted by xmlFreeDoc
}
cur = cur->next;
}
}
+ guard.clear(); // release for calling event handlers
dispatchSubtreeModified();
- return oldChild;
+ return xOldChild;
}
void CNode::dispatchSubtreeModified()
{
+ // only uses UNO interfaces => needs no mutex
+
// dispatch DOMSubtreeModified
// target is _this_ node
Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY);
Reference< XMutationEvent > event(docevent->createEvent(
OUString::createFromAscii("DOMSubtreeModified")), UNO_QUERY);
- event->initMutationEvent(OUString::createFromAscii("DOMSubtreeModified"), sal_True,
+ event->initMutationEvent(
+ OUString::createFromAscii("DOMSubtreeModified"), sal_True,
sal_False, Reference< XNode >(),
OUString(), OUString(), OUString(), (AttrChangeType)0 );
dispatchEvent(Reference< XEvent >(event, UNO_QUERY));
@@ -959,7 +967,7 @@ namespace DOM
/**
The value of this node, depending on its type; see the table above.
*/
- void SAL_CALL CNode::setNodeValue(const OUString& /*nodeValue*/)
+ void SAL_CALL CNode::setNodeValue(const OUString& /*nodeValue*/)
throw (RuntimeException, DOMException)
{
// use specific node implememntation
@@ -975,13 +983,22 @@ namespace DOM
void SAL_CALL CNode::setPrefix(const OUString& prefix)
throw (RuntimeException, DOMException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if ((0 == m_aNodePtr) ||
+ ((m_aNodePtr->type != XML_ELEMENT_NODE) &&
+ (m_aNodePtr->type != XML_ATTRIBUTE_NODE)))
+ {
+ DOMException e;
+ e.Code = DOMExceptionType_NO_MODIFICATION_ALLOWED_ERR;
+ throw e;
+ }
OString o1 = OUStringToOString(prefix, RTL_TEXTENCODING_UTF8);
xmlChar *pBuf = (xmlChar*)o1.getStr();
- // XXX copy buf?
- // XXX free old string? (leak?)
if (m_aNodePtr != NULL && m_aNodePtr->ns != NULL)
{
- m_aNodePtr->ns->prefix = pBuf;
+ xmlFree(const_cast<xmlChar *>(m_aNodePtr->ns->prefix));
+ m_aNodePtr->ns->prefix = xmlStrdup(pBuf);
}
}
@@ -992,7 +1009,11 @@ namespace DOM
sal_Bool useCapture)
throw (RuntimeException)
{
- events::CEventDispatcher::addListener(m_aNodePtr, eventType, listener, useCapture);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ CDocument & rDocument(GetOwnerDocument());
+ events::CEventDispatcher & rDispatcher(rDocument.GetEventDispatcher());
+ rDispatcher.addListener(m_aNodePtr, eventType, listener, useCapture);
}
void SAL_CALL CNode::removeEventListener(const OUString& eventType,
@@ -1000,20 +1021,43 @@ namespace DOM
sal_Bool useCapture)
throw (RuntimeException)
{
- events::CEventDispatcher::removeListener(m_aNodePtr, eventType, listener, useCapture);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ CDocument & rDocument(GetOwnerDocument());
+ events::CEventDispatcher & rDispatcher(rDocument.GetEventDispatcher());
+ rDispatcher.removeListener(m_aNodePtr, eventType, listener, useCapture);
}
sal_Bool SAL_CALL CNode::dispatchEvent(const Reference< XEvent >& evt)
throw(RuntimeException, EventException)
{
- events::CEventDispatcher::dispatchEvent(m_aNodePtr, evt);
+ CDocument * pDocument;
+ events::CEventDispatcher * pDispatcher;
+ xmlNodePtr pNode;
+ {
+ ::osl::MutexGuard const g(m_rMutex);
+
+ pDocument = & GetOwnerDocument();
+ pDispatcher = & pDocument->GetEventDispatcher();
+ pNode = m_aNodePtr;
+ }
+ // this calls event listeners, do not call with locked mutex
+ pDispatcher->dispatchEvent(*pDocument, m_rMutex, pNode, this, evt);
return sal_True;
}
- ::sal_Int64 SAL_CALL CNode::getSomething(const Sequence< ::sal_Int8 >& /*aIdentifier*/)
+ ::sal_Int64 SAL_CALL
+ CNode::getSomething(Sequence< ::sal_Int8 > const& rId)
throw (RuntimeException)
{
- return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(m_aNodePtr));
+ if ((rId.getLength() == 16) &&
+ (0 == rtl_compareMemory(UnoTunnelId::get().getConstArray(),
+ rId.getConstArray(), 16)))
+ {
+ return ::sal::static_int_cast< sal_Int64 >(
+ reinterpret_cast< sal_IntPtr >(this) );
+ }
+ return 0;
}
}
diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx
index a4397e7053fd..6d9c4afcfafb 100644
--- a/unoxml/source/dom/node.hxx
+++ b/unoxml/source/dom/node.hxx
@@ -25,37 +25,35 @@
*
************************************************************************/
-#ifndef _NODE_HXX
-#define _NODE_HXX
+#ifndef DOM_NODE_HXX
+#define DOM_NODE_HXX
+#include <hash_map>
+
+#include <libxml/tree.h>
+
+#include <sal/types.h>
#include <rtl/ref.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
-#include <sal/types.h>
-#include <sax/fastattribs.hxx>
-#include <cppuhelper/implbase1.hxx>
+
#include <cppuhelper/implbase3.hxx>
+
+#include <sax/fastattribs.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
#include <com/sun/star/xml/dom/NodeType.hpp>
-#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/xml/dom/events/XEventTarget.hpp>
-#include <com/sun/star/xml/dom/events/XDocumentEvent.hpp>
#include <com/sun/star/xml/dom/events/XEvent.hpp>
-#include <com/sun/star/xml/dom/events/XMutationEvent.hpp>
-#include <com/sun/star/xml/dom/events/XUIEvent.hpp>
-#include <com/sun/star/xml/dom/events/XMouseEvent.hpp>
#include <com/sun/star/xml/dom/DOMException.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
-#include <libxml/tree.h>
-#include <map>
-#include <hash_map>
using ::rtl::OUString;
using ::rtl::OString;
@@ -64,9 +62,9 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::xml::sax;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::dom::events;
-
using com::sun::star::lang::XUnoTunnel;
+
namespace DOM
{
struct Context
@@ -113,31 +111,29 @@ namespace DOM
/// add namespaces on this node to context
void addNamespaces(Context& io_rContext, xmlNodePtr pNode);
- class CNode;
- typedef std::map< const xmlNodePtr, CNode* > nodemap_t;
-
+ class CDocument;
class CNode : public cppu::WeakImplHelper3< XNode, XUnoTunnel, XEventTarget >
{
friend class CDocument;
friend class CElement;
friend class CAttributesMap;
- friend class CChildList;
- friend class CElementList;
- friend class CEntitiesMap;
- friend class CNotationsMap;
+
private:
- static nodemap_t theNodeMap;
+ bool m_bUnlinked; /// node has been removed from document
protected:
- NodeType m_aNodeType;
+ NodeType const m_aNodeType;
+ /// libxml node; NB: not const, because invalidate may reset it to 0!
xmlNodePtr m_aNodePtr;
- Reference< XDocument > m_rDocument;
+ ::rtl::Reference< CDocument > const m_xDocument;
+ ::osl::Mutex & m_rMutex;
// for initialization by classes derived through ImplInheritanceHelper
- CNode();
- void init_node(const xmlNodePtr aNode);
+ CNode(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
+ void invalidate();
void dispatchSubtreeModified();
@@ -145,29 +141,29 @@ namespace DOM
virtual ~CNode();
- // get a representaion for a libxml node
- static CNode* get(const xmlNodePtr aNode, sal_Bool bCreate = sal_True);
- // remove a wrapper instance
- static void remove(const xmlNodePtr aNode);
+ static CNode * GetImplementation(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface> const& xNode);
- // get the libxml node implementation
- static xmlNodePtr getNodePtr(const Reference< XNode >& aNode);
+ xmlNodePtr GetNodePtr() { return m_aNodePtr; }
- //static Sequence< sal_Int8 >
+ virtual CDocument & GetOwnerDocument();
// recursively create SAX events
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
// recursively create SAX events
- virtual void SAL_CALL fastSaxify( Context& io_rContext );
+ virtual void fastSaxify( Context& io_rContext );
+
+ // constrains child relationship between nodes based on type
+ virtual bool IsChildTypeAllowed(NodeType const nodeType);
// ---- DOM interfaces
/**
Adds the node newChild to the end of the list of children of this node.
*/
- virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
+ virtual Reference< XNode > SAL_CALL
+ appendChild(Reference< XNode > const& xNewChild)
throw (RuntimeException, DOMException);
/**
@@ -178,8 +174,8 @@ namespace DOM
throw (RuntimeException);
/**
- A NamedNodeMap containing the attributes of this node (if it is an Element)
- or null otherwise.
+ A NamedNodeMap containing the attributes of this node
+ (if it is an Element) or null otherwise.
*/
virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
throw (RuntimeException);
@@ -343,12 +339,13 @@ namespace DOM
throw(RuntimeException, EventException);
// --- XUnoTunnel
- virtual ::sal_Int64 SAL_CALL getSomething(const Sequence< ::sal_Int8 >& aIdentifier)
+ virtual ::sal_Int64 SAL_CALL
+ getSomething(Sequence< ::sal_Int8 > const& rId)
throw (RuntimeException);
};
/// eliminate redundant namespace declarations
- void _nscleanup(const xmlNodePtr aNode, const xmlNodePtr aParent);
+ void nscleanup(const xmlNodePtr aNode, const xmlNodePtr aParent);
}
#endif
diff --git a/unoxml/source/dom/notation.cxx b/unoxml/source/dom/notation.cxx
index 9781b6877eef..5988d1a9761f 100644
--- a/unoxml/source/dom/notation.cxx
+++ b/unoxml/source/dom/notation.cxx
@@ -25,21 +25,24 @@
*
************************************************************************/
-#include "notation.hxx"
+#include <notation.hxx>
+
#include <string.h>
namespace DOM
{
- CNotation::CNotation(const xmlNotationPtr aNotationPtr)
+ CNotation::CNotation(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNotationPtr const pNotation)
+ : CNotation_Base(rDocument, rMutex,
+ NodeType_NOTATION_NODE, reinterpret_cast<xmlNodePtr>(pNotation))
+ , m_aNotationPtr(pNotation)
{
- m_aNodeType = NodeType_NOTATION_NODE;
- m_aNotationPtr = aNotationPtr;
- init_node((xmlNodePtr)aNotationPtr);
}
OUString SAL_CALL CNotation::getPublicId() throw (RuntimeException)
{
- // XXX
+ OSL_ENSURE(false,
+ "CNotation::getPublicId: not implemented (#i113683#)");
return OUString();
}
@@ -48,13 +51,16 @@ namespace DOM
*/
OUString SAL_CALL CNotation::getSystemId() throw (RuntimeException)
{
- // XXX
+ OSL_ENSURE(false,
+ "CNotation::getSystemId: not implemented (#i113683#)");
return OUString();
}
OUString SAL_CALL CNotation::getNodeName()throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
OUString aName;
if (m_aNodePtr != NULL)
{
@@ -63,6 +69,7 @@ namespace DOM
}
return aName;
}
+
OUString SAL_CALL CNotation::getNodeValue() throw (RuntimeException)
{
return OUString();
diff --git a/unoxml/source/dom/notation.hxx b/unoxml/source/dom/notation.hxx
index a8fdf7994fc4..c98e81b353a3 100644
--- a/unoxml/source/dom/notation.hxx
+++ b/unoxml/source/dom/notation.hxx
@@ -25,14 +25,16 @@
*
************************************************************************/
-#ifndef _NOTATION_HXX
-#define _NOTATION_HXX
+#ifndef DOM_NOTATION_HXX
+#define DOM_NOTATION_HXX
+
+#include <libxml/tree.h>
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNotation.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -40,14 +42,20 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CNotation : public cppu::ImplInheritanceHelper1< CNode, XNotation >
+ typedef cppu::ImplInheritanceHelper1< CNode, XNotation > CNotation_Base;
+
+ class CNotation
+ : public CNotation_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
+
private:
xmlNotationPtr m_aNotationPtr;
protected:
- CNotation(const xmlNotationPtr);
+ CNotation(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNotationPtr const pNotation);
/**
The public identifier of this notation.
diff --git a/unoxml/source/dom/notationsmap.cxx b/unoxml/source/dom/notationsmap.cxx
index 477d40277374..a37fed98cc04 100644
--- a/unoxml/source/dom/notationsmap.cxx
+++ b/unoxml/source/dom/notationsmap.cxx
@@ -25,12 +25,18 @@
*
************************************************************************/
-#include "notationsmap.hxx"
+#include <notationsmap.hxx>
+
+#include <documenttype.hxx>
+
namespace DOM
{
- CNotationsMap::CNotationsMap(const CDocumentType* aDocType)
- : m_pDocType(aDocType)
+ CNotationsMap::CNotationsMap(
+ ::rtl::Reference<CDocumentType> const& pDocType,
+ ::osl::Mutex & rMutex)
+ : m_pDocType(pDocType)
+ , m_rMutex(rMutex)
{
}
@@ -39,63 +45,92 @@ namespace DOM
*/
sal_Int32 SAL_CALL CNotationsMap::getLength() throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::getLength: not implemented (#i113683#)");
return 0;
}
/**
Retrieves a node specified by local name
*/
- Reference< XNode > SAL_CALL CNotationsMap::getNamedItem(const OUString& /* name */) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::getNamedItem(OUString const& /*name*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::getNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Retrieves a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CNotationsMap::getNamedItemNS(const OUString& /*namespaceURI*/, const OUString& /*localName*/)
-throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::getNamedItemNS(
+ OUString const& /*namespaceURI*/, OUString const& /*localName*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::getNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Returns the indexth item in the map.
*/
- Reference< XNode > SAL_CALL CNotationsMap::item(sal_Int32 /*index*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::item(sal_Int32 /*index*/) throw (RuntimeException)
{
+ OSL_ENSURE(false, "CNotationsMap::item: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Removes a node specified by name.
*/
- Reference< XNode > SAL_CALL CNotationsMap::removeNamedItem(const OUString& /*name*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::removeNamedItem(OUString const& /*name*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::removeNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
// Removes a node specified by local name and namespace URI.
*/
- Reference< XNode > SAL_CALL CNotationsMap::removeNamedItemNS(const OUString& /*namespaceURI*/, const OUString& /*localName*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::removeNamedItemNS(
+ OUString const& /*namespaceURI*/, OUString const& /*localName*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::removeNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
// Adds a node using its nodeName attribute.
*/
- Reference< XNode > SAL_CALL CNotationsMap::setNamedItem(const Reference< XNode >& /*arg*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::setNamedItem(Reference< XNode > const& /*arg*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::setNamedItem: not implemented (#i113683#)");
return Reference< XNode >();
}
/**
Adds a node using its namespaceURI and localName.
*/
- Reference< XNode > SAL_CALL CNotationsMap::setNamedItemNS(const Reference< XNode >& /*arg*/) throw (RuntimeException)
+ Reference< XNode > SAL_CALL
+ CNotationsMap::setNamedItemNS(Reference< XNode > const& /*arg*/)
+ throw (RuntimeException)
{
+ OSL_ENSURE(false,
+ "CNotationsMap::setNamedItemNS: not implemented (#i113683#)");
return Reference< XNode >();
}
}
diff --git a/unoxml/source/dom/notationsmap.hxx b/unoxml/source/dom/notationsmap.hxx
index 9c950c64de4c..42648311374b 100644
--- a/unoxml/source/dom/notationsmap.hxx
+++ b/unoxml/source/dom/notationsmap.hxx
@@ -25,18 +25,18 @@
*
************************************************************************/
-#ifndef _NOTATIONSMAP_HXX
-#define _NOTATIONSMAP_HXX
+#ifndef DOM_NOTATIONSMAP_HXX
+#define DOM_NOTATIONSMAP_HXX
-#include <map>
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
-#include "document.hxx"
-#include "documenttype.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -44,13 +44,18 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CNotationsMap : public cppu::WeakImplHelper1< XNamedNodeMap >
+ class CDocumentType;
+
+ class CNotationsMap
+ : public cppu::WeakImplHelper1< XNamedNodeMap >
{
private:
- const CDocumentType* m_pDocType;
+ ::rtl::Reference<CDocumentType> const m_pDocType;
+ ::osl::Mutex & m_rMutex;
public:
- CNotationsMap(const CDocumentType* aDocType);
+ CNotationsMap(::rtl::Reference<CDocumentType> const& pDocType,
+ ::osl::Mutex & rMutex);
/**
The number of nodes in this map.
@@ -60,37 +65,48 @@ namespace DOM
/**
Retrieves a node specified by local name
*/
- virtual Reference< XNode > SAL_CALL getNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ getNamedItem(OUString const& name) throw (RuntimeException);
/**
Retrieves a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL getNamedItemNS(const OUString& namespaceURI,const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL getNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
Returns the indexth item in the map.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ item(sal_Int32 index) throw (RuntimeException);
/**
Removes a node specified by name.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItem(const OUString& name) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ removeNamedItem(OUString const& name) throw (RuntimeException);
/**
// Removes a node specified by local name and namespace URI.
*/
- virtual Reference< XNode > SAL_CALL removeNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL removeNamedItemNS(
+ OUString const& namespaceURI, OUString const& localName)
+ throw (RuntimeException);
/**
// Adds a node using its nodeName attribute.
*/
- virtual Reference< XNode > SAL_CALL setNamedItem(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItem(Reference< XNode > const& arg)
+ throw (RuntimeException);
/**
Adds a node using its namespaceURI and localName.
*/
- virtual Reference< XNode > SAL_CALL setNamedItemNS(const Reference< XNode >& arg) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL
+ setNamedItemNS(Reference< XNode > const& arg)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/dom/processinginstruction.cxx b/unoxml/source/dom/processinginstruction.cxx
index 37e52086cbd8..b604a3284032 100644
--- a/unoxml/source/dom/processinginstruction.cxx
+++ b/unoxml/source/dom/processinginstruction.cxx
@@ -25,19 +25,24 @@
*
************************************************************************/
-#include "processinginstruction.hxx"
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <processinginstruction.hxx>
+
#include <string.h>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
+
namespace DOM
{
- CProcessingInstruction::CProcessingInstruction(const xmlNodePtr aNodePtr)
+ CProcessingInstruction::CProcessingInstruction(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CProcessingInstruction_Base(rDocument, rMutex,
+ NodeType_PROCESSING_INSTRUCTION_NODE, pNode)
{
- m_aNodeType = NodeType_PROCESSING_INSTRUCTION_NODE;
- init_node(aNodePtr);
}
- void SAL_CALL CProcessingInstruction::saxify(
+ void CProcessingInstruction::saxify(
const Reference< XDocumentHandler >& i_xHandler) {
if (!i_xHandler.is()) throw RuntimeException();
Reference< XExtendedDocumentHandler > xExtended(i_xHandler, UNO_QUERY);
@@ -49,44 +54,90 @@ namespace DOM
/**
The content of this processing instruction.
*/
- OUString SAL_CALL CProcessingInstruction::getData() throw (RuntimeException)
+ OUString SAL_CALL
+ CProcessingInstruction::getData() throw (RuntimeException)
{
- // XXX
- return OUString();
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
+ }
+
+ char const*const pContent(
+ reinterpret_cast<char const*>(m_aNodePtr->content));
+ if (0 == pContent) {
+ return ::rtl::OUString();
+ }
+ OUString const ret(pContent, strlen(pContent), RTL_TEXTENCODING_UTF8);
+ return ret;
}
/**
The target of this processing instruction.
*/
- OUString SAL_CALL CProcessingInstruction::getTarget() throw (RuntimeException)
+ OUString SAL_CALL
+ CProcessingInstruction::getTarget() throw (RuntimeException)
{
- // XXX
- return OUString();
- }
+ ::osl::MutexGuard const g(m_rMutex);
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
+ }
+
+ char const*const pName(
+ reinterpret_cast<char const*>(m_aNodePtr->name));
+ if (0 == pName) {
+ return ::rtl::OUString();
+ }
+ OUString const ret(pName, strlen(pName), RTL_TEXTENCODING_UTF8);
+ return ret;
+ }
/**
The content of this processing instruction.
*/
- void SAL_CALL CProcessingInstruction::setData(const OUString& /*data*/) throw (RuntimeException, DOMException)
+ void SAL_CALL CProcessingInstruction::setData(OUString const& rData)
+ throw (RuntimeException, DOMException)
{
- // XXX
- }
+ ::osl::MutexGuard const g(m_rMutex);
+ if (0 == m_aNodePtr) {
+ throw RuntimeException();
+ }
+
+ OString const data(
+ ::rtl::OUStringToOString(rData, RTL_TEXTENCODING_UTF8));
+ xmlChar const*const pData(
+ reinterpret_cast<xmlChar const*>(data.getStr()) );
+ xmlFree(m_aNodePtr->content);
+ m_aNodePtr->content = xmlStrdup(pData);
+ }
- OUString SAL_CALL CProcessingInstruction::getNodeName()throw (RuntimeException)
+ OUString SAL_CALL
+ CProcessingInstruction::getNodeName() throw (RuntimeException)
{
- OUString aName;
- if (m_aNodePtr != NULL)
- {
- const xmlChar* xName = m_aNodePtr->name;
- aName = OUString((sal_Char*)xName, strlen((char*)xName), RTL_TEXTENCODING_UTF8);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_aNodePtr) {
+ return ::rtl::OUString();
}
- return aName;
+
+ sal_Char const*const pName =
+ reinterpret_cast<sal_Char const*>(m_aNodePtr->name);
+ OUString const ret(pName, strlen(pName), RTL_TEXTENCODING_UTF8);
+ return ret;
}
- OUString SAL_CALL CProcessingInstruction::getNodeValue() throw (RuntimeException)
+ OUString SAL_CALL CProcessingInstruction::getNodeValue()
+ throw (RuntimeException)
{
return getData();
}
+
+ void SAL_CALL
+ CProcessingInstruction::setNodeValue(OUString const& rNodeValue)
+ throw (RuntimeException, DOMException)
+ {
+ return setData(rNodeValue);
+ }
}
diff --git a/unoxml/source/dom/processinginstruction.hxx b/unoxml/source/dom/processinginstruction.hxx
index b794d31e159d..4bf8d52f3c41 100644
--- a/unoxml/source/dom/processinginstruction.hxx
+++ b/unoxml/source/dom/processinginstruction.hxx
@@ -25,14 +25,16 @@
*
************************************************************************/
-#ifndef _PROCESSINGINSTRUCTION_HXX
-#define _PROCESSINGINSTRUCTION_HXX
+#ifndef DOM_PROCESSINGINSTRUCTION_HXX
+#define DOM_PROCESSINGINSTRUCTION_HXX
+
+#include <libxml/tree.h>
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XProcessingInstruction.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -40,17 +42,23 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CProcessingInstruction : public cppu::ImplInheritanceHelper1< CNode, XProcessingInstruction >
+ typedef ::cppu::ImplInheritanceHelper1< CNode, XProcessingInstruction >
+ CProcessingInstruction_Base;
+
+ class CProcessingInstruction
+ : public CProcessingInstruction_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
protected:
- CProcessingInstruction(const xmlNodePtr aNodePtr);
+ CProcessingInstruction(
+ CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
/**
The content of this processing instruction.
@@ -73,6 +81,9 @@ namespace DOM
throw (RuntimeException);
virtual OUString SAL_CALL getNodeValue()
throw (RuntimeException);
+ virtual void SAL_CALL setNodeValue(OUString const& rNodeValue)
+ throw (RuntimeException, DOMException);
+
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
throw (RuntimeException, DOMException)
@@ -181,11 +192,6 @@ namespace DOM
{
return CNode::replaceChild(newChild, oldChild);
}
- virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException, DOMException)
- {
- return CNode::setNodeValue(nodeValue);
- }
virtual void SAL_CALL setPrefix(const OUString& prefix)
throw (RuntimeException, DOMException)
{
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index e968eee3e2f6..524e4353e2a2 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -28,11 +28,10 @@
#pragma warning(disable : 4701)
#endif
-#include "node.hxx"
#include "saxbuilder.hxx"
+
#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
-#include <libxml/tree.h>
-#include <com/sun/star/uno/Sequence.h>
+
namespace DOM
{
@@ -93,12 +92,16 @@ namespace DOM
SAXDocumentBuilderState SAL_CALL CSAXDocumentBuilder::getState()
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
return m_aState;
}
void SAL_CALL CSAXDocumentBuilder::reset()
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
m_aDocument = Reference< XDocument >();
m_aFragment = Reference< XDocumentFragment >();
while (!m_aNodeStack.empty()) m_aNodeStack.pop();
@@ -109,6 +112,8 @@ namespace DOM
Reference< XDocument > SAL_CALL CSAXDocumentBuilder::getDocument()
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
if (m_aState != SAXDocumentBuilderState_DOCUMENT_FINISHED)
throw RuntimeException();
@@ -118,6 +123,8 @@ namespace DOM
Reference< XDocumentFragment > SAL_CALL CSAXDocumentBuilder::getDocumentFragment()
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
if (m_aState != SAXDocumentBuilderState_FRAGMENT_FINISHED)
throw RuntimeException();
return m_aFragment;
@@ -126,6 +133,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::startDocumentFragment(const Reference< XDocument >& ownerDoc)
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// start a new document fragment and push it onto the stack
// we have to be in a clean state to do this
if (!m_aState == SAXDocumentBuilderState_READY)
@@ -141,6 +150,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endDocumentFragment()
throw (RuntimeException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// there should only be the document left on the node stack
if (m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
throw RuntimeException();
@@ -156,6 +167,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::startDocument() throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
// start a new document and push it onto the stack
// we have to be in a clean state to do this
@@ -172,6 +184,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endDocument() throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// there should only be the document left on the node stack
if (!m_aState == SAXDocumentBuilderState_BUILDING_DOCUMENT)
throw SAXException();
@@ -186,6 +200,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::startElement(const OUString& aName, const Reference< XAttributeList>& attribs)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
{
@@ -241,7 +257,8 @@ namespace DOM
if ( result != aNSMap.end())
{
// found a URI for prefix
- aElement = m_aDocument->createElementNS( result->second, aName); // qualified name
+ // qualified name
+ aElement = m_aDocument->createElementNS( result->second, aName);
}
else
{
@@ -286,6 +303,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endElement(const OUString& aName)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// pop the current element from the stack
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -313,6 +332,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::characters(const OUString& aChars)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// append text node to the current top element
if (m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -325,6 +346,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::ignorableWhitespace(const OUString& )
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// ignore ignorable whitespace
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -334,6 +357,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::processingInstruction(const OUString& aTarget, const OUString& aData)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// append PI node to the current top
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -347,6 +372,8 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::setDocumentLocator(const Reference< XLocator >& aLocator)
throw (RuntimeException, SAXException)
{
+ ::osl::MutexGuard g(m_Mutex);
+
// set the document locator...
m_aLocator = aLocator;
}
diff --git a/unoxml/source/dom/saxbuilder.hxx b/unoxml/source/dom/saxbuilder.hxx
index c243877aae2b..cd280c9f7129 100644
--- a/unoxml/source/dom/saxbuilder.hxx
+++ b/unoxml/source/dom/saxbuilder.hxx
@@ -25,13 +25,14 @@
*
************************************************************************/
-#ifndef _SAXBUILDER_HXX
-#define _SAXBUILDER_HXX
+#ifndef DOM_SAXBUILDER_HXX
+#define DOM_SAXBUILDER_HXX
#include <stack>
#include <map>
#include <sal/types.h>
+#include <osl/mutex.hxx>
#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
@@ -49,8 +50,6 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include "libxml/tree.h"
-
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
@@ -73,6 +72,7 @@ namespace DOM
{
private:
+ ::osl::Mutex m_Mutex;
const Reference< XMultiServiceFactory > m_aServiceManager;
SAXDocumentBuilderState m_aState;
diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx
index d60fcf234ebf..5d07aa86a6d4 100644
--- a/unoxml/source/dom/text.cxx
+++ b/unoxml/source/dom/text.cxx
@@ -25,40 +25,32 @@
*
************************************************************************/
-#include "text.hxx"
-namespace DOM
-{
- CText::CText(const xmlNodePtr aNodePtr)
- {
- m_aNodeType = NodeType_TEXT_NODE;
- init_characterdata(aNodePtr);
- }
+#include <text.hxx>
- void SAL_CALL CText::saxify(
- const Reference< XDocumentHandler >& i_xHandler) {
- if (!i_xHandler.is()) throw RuntimeException();
- i_xHandler->characters(getData());
- }
- void CText::init_text(const xmlNodePtr aNodePtr)
+namespace DOM
+{
+ CText::CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode)
+ : CText_Base(rDocument, rMutex, reNodeType, rpNode)
{
- init_characterdata(aNodePtr);
}
- Reference< XText > SAL_CALL CText::splitText(sal_Int32 /*offset*/)
- throw (RuntimeException)
+ CText::CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode)
+ : CText_Base(rDocument, rMutex, NodeType_TEXT_NODE, pNode)
{
- return Reference< XText >(this);
}
- OUString SAL_CALL CText::getNodeName()throw (RuntimeException)
- {
- return OUString::createFromAscii("#text");
+ void CText::saxify(
+ const Reference< XDocumentHandler >& i_xHandler) {
+ if (!i_xHandler.is()) throw RuntimeException();
+ i_xHandler->characters(getData());
}
- void SAL_CALL CText::fastSaxify( Context& io_rContext )
+ void CText::fastSaxify( Context& io_rContext )
{
- if( io_rContext.mxCurrentHandler.is() )
+ if (io_rContext.mxCurrentHandler.is())
{
try
{
@@ -69,4 +61,15 @@ namespace DOM
}
}
+ OUString SAL_CALL CText::getNodeName() throw (RuntimeException)
+ {
+ return OUString::createFromAscii("#text");
+ }
+
+ Reference< XText > SAL_CALL CText::splitText(sal_Int32 /*offset*/)
+ throw (RuntimeException)
+ {
+ OSL_ENSURE(false, "CText::splitText: not implemented (#i113683#)");
+ return Reference< XText >(this);
+ }
}
diff --git a/unoxml/source/dom/text.hxx b/unoxml/source/dom/text.hxx
index a99f4ff2aa5d..c58a4e14255e 100644
--- a/unoxml/source/dom/text.hxx
+++ b/unoxml/source/dom/text.hxx
@@ -25,41 +25,47 @@
*
************************************************************************/
-#ifndef _TEXT_HXX
-#define _TEXT_HXX
+#ifndef DOM_TEXT_HXX
+#define DOM_TEXT_HXX
+
+#include <libxml/tree.h>
#include <sal/types.h>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XText.hpp>
-#include <com/sun/star/xml/dom/XCharacterData.hpp>
-#include <libxml/tree.h>
-#include "characterdata.hxx"
+
+#include <characterdata.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
namespace DOM
{
- class CText : public cppu::ImplInheritanceHelper1< CCharacterData, XText >
+ typedef ::cppu::ImplInheritanceHelper1< CCharacterData, XText > CText_Base;
+
+ class CText
+ : public CText_Base
{
- friend class CNode;
+ private:
+ friend class CDocument;
protected:
- CText(){}
- CText(const xmlNodePtr aNodePtr);
- void init_text(const xmlNodePtr aNodePtr);
+ CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
+ CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
+ xmlNodePtr const pNode);
public:
- virtual void SAL_CALL saxify(
- const Reference< XDocumentHandler >& i_xHandler);
+ virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
- virtual void SAL_CALL fastSaxify( Context& io_rContext );
+ virtual void fastSaxify( Context& io_rContext );
// Breaks this node into two nodes at the specified offset, keeping
// both in the tree as siblings.
diff --git a/unoxml/source/events/event.cxx b/unoxml/source/events/event.cxx
index 1d41bbba9911..87201d7eece7 100644
--- a/unoxml/source/events/event.cxx
+++ b/unoxml/source/events/event.cxx
@@ -1,59 +1,108 @@
-#include "event.hxx"
+/*************************************************************************
+ *
+ * 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 <event.hxx>
namespace DOM { namespace events
{
+ CEvent::CEvent()
+ : m_canceled(sal_False)
+ , m_phase(PhaseType_CAPTURING_PHASE)
+ , m_bubbles(sal_False)
+ , m_cancelable(sal_True)
+ {
+ }
+
CEvent::~CEvent()
{
}
OUString SAL_CALL CEvent::getType() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_eventType;
}
- Reference< XEventTarget > SAL_CALL CEvent::getTarget() throw (RuntimeException)
+ Reference< XEventTarget > SAL_CALL
+ CEvent::getTarget() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_target;
}
- Reference< XEventTarget > SAL_CALL CEvent::getCurrentTarget() throw (RuntimeException)
+ Reference< XEventTarget > SAL_CALL
+ CEvent::getCurrentTarget() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_currentTarget;
}
PhaseType SAL_CALL CEvent::getEventPhase() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_phase;
}
sal_Bool SAL_CALL CEvent::getBubbles() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_bubbles;
}
sal_Bool SAL_CALL CEvent::getCancelable() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_cancelable;
}
- com::sun::star::util::Time SAL_CALL CEvent::getTimeStamp() throw (RuntimeException)
+ com::sun::star::util::Time SAL_CALL
+ CEvent::getTimeStamp() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_time;
}
void SAL_CALL CEvent::stopPropagation() throw (RuntimeException)
{
- if (m_cancelable) m_canceled = sal_True;
+ ::osl::MutexGuard const g(m_Mutex);
+ if (m_cancelable) { m_canceled = sal_True; }
}
void SAL_CALL CEvent::preventDefault() throw (RuntimeException)
{
}
- void SAL_CALL CEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
+ void SAL_CALL
+ CEvent::initEvent(OUString const& eventTypeArg, sal_Bool canBubbleArg,
sal_Bool cancelableArg) throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
m_eventType = eventTypeArg;
m_bubbles = canBubbleArg;
m_cancelable = cancelableArg;
diff --git a/unoxml/source/events/event.hxx b/unoxml/source/events/event.hxx
index 3620d84374dc..0336be16412f 100644
--- a/unoxml/source/events/event.hxx
+++ b/unoxml/source/events/event.hxx
@@ -1,19 +1,44 @@
-#ifndef __EVENT_HXX
-#define __EVENT_HXX
+/*************************************************************************
+ *
+ * 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 EVENT_EVENT_HXX
+#define EVENT_EVENT_HXX
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/xml/dom/events/XEvent.hpp>
#include <com/sun/star/xml/dom/events/XEventTarget.hpp>
#include <com/sun/star/util/Time.hpp>
+#include <cppuhelper/implbase1.hxx>
+
#include "../dom/node.hxx"
-#include <libxml/tree.h>
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
@@ -25,23 +50,13 @@ namespace DOM {namespace events
class CEvent : public cppu::WeakImplHelper1< XEvent >
{
friend class CEventDispatcher;
-friend class CNode;
-friend class CDocument;
-friend class CElement;
-friend class CText;
-friend class CCharacterData;
-friend class CAttr;
-
-
-private:
- sal_Bool m_canceled;
protected:
+ ::osl::Mutex m_Mutex;
+ sal_Bool m_canceled;
OUString m_eventType;
Reference< XEventTarget > m_target;
Reference< XEventTarget > m_currentTarget;
- //xmlNodePtr m_target;
- //xmlNodePtr m_currentTarget;
PhaseType m_phase;
sal_Bool m_bubbles;
sal_Bool m_cancelable;
@@ -49,7 +64,7 @@ protected:
public:
- CEvent() : m_canceled(sal_False){}
+ explicit CEvent();
virtual ~CEvent();
virtual OUString SAL_CALL getType() throw (RuntimeException);
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index 4b1c1548bf38..4b4cac807538 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -1,19 +1,46 @@
-#include "eventdispatcher.hxx"
-#include "event.hxx"
-#include "mutationevent.hxx"
-#include "uievent.hxx"
-#include "mouseevent.hxx"
-#include "../dom/node.hxx"
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
-namespace DOM { namespace events {
+#include <eventdispatcher.hxx>
+
+#include <event.hxx>
+#include <mutationevent.hxx>
+#include <uievent.hxx>
+#include <mouseevent.hxx>
- TypeListenerMap CEventDispatcher::captureListeners;
- TypeListenerMap CEventDispatcher::targetListeners;
+#include "../dom/document.hxx"
+
+
+namespace DOM { namespace events {
void CEventDispatcher::addListener(xmlNodePtr pNode, OUString aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
{
- TypeListenerMap* pTMap = &targetListeners;
- if (bCapture) pTMap = &captureListeners;
+ TypeListenerMap *const pTMap = (bCapture)
+ ? (& m_CaptureListeners) : (& m_TargetListeners);
// get the multimap for the specified type
ListenerMap *pMap = 0;
@@ -31,8 +58,8 @@ namespace DOM { namespace events {
void CEventDispatcher::removeListener(xmlNodePtr pNode, OUString aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
{
- TypeListenerMap *pTMap = &targetListeners;
- if (bCapture) pTMap = &captureListeners;
+ TypeListenerMap *const pTMap = (bCapture)
+ ? (& m_CaptureListeners) : (& m_TargetListeners);
// get the multimap for the specified type
TypeListenerMap::const_iterator tIter = pTMap->find(aType);
@@ -55,14 +82,14 @@ namespace DOM { namespace events {
}
}
- void CEventDispatcher::callListeners(xmlNodePtr pNode, OUString aType, const Reference< XEvent >& xEvent, sal_Bool bCapture)
+ void CEventDispatcher::callListeners(
+ TypeListenerMap const& rTMap,
+ xmlNodePtr const pNode,
+ OUString aType, Reference< XEvent > const& xEvent)
{
- TypeListenerMap *pTMap = &targetListeners;
- if (bCapture) pTMap = &captureListeners;
-
// get the multimap for the specified type
- TypeListenerMap::const_iterator tIter = pTMap->find(aType);
- if (tIter != pTMap->end()) {
+ TypeListenerMap::const_iterator tIter = rTMap.find(aType);
+ if (tIter != rTMap.end()) {
ListenerMap *pMap = tIter->second;
ListenerMap::const_iterator iter = pMap->lower_bound(pNode);
ListenerMap::const_iterator ibound = pMap->upper_bound(pNode);
@@ -74,12 +101,14 @@ namespace DOM { namespace events {
}
}
- sal_Bool CEventDispatcher::dispatchEvent(xmlNodePtr aNodePtr, const Reference< XEvent >& aEvent)
+ bool CEventDispatcher::dispatchEvent(
+ DOM::CDocument & rDocument, ::osl::Mutex & rMutex,
+ xmlNodePtr const pNode, Reference<XNode> const& xNode,
+ Reference< XEvent > const& i_xEvent) const
{
CEvent *pEvent = 0; // pointer to internal event representation
- Reference< XEvent > xEvent; // reference to the event being dispatched;
- OUString aType = aEvent->getType();
+ OUString const aType = i_xEvent->getType();
if (aType.compareToAscii("DOMSubtreeModified") == 0||
aType.compareToAscii("DOMNodeInserted") == 0||
aType.compareToAscii("DOMNodeRemoved") == 0||
@@ -88,7 +117,8 @@ namespace DOM { namespace events {
aType.compareToAscii("DOMAttrModified") == 0||
aType.compareToAscii("DOMCharacterDataModified") == 0)
{
- Reference< XMutationEvent > aMEvent(aEvent, UNO_QUERY);
+ Reference< XMutationEvent > const aMEvent(i_xEvent,
+ UNO_QUERY_THROW);
// dispatch a mutation event
// we need to clone the event in order to have complete control
// over the implementation
@@ -104,7 +134,7 @@ namespace DOM { namespace events {
aType.compareToAscii("DOMFocusOut") == 0||
aType.compareToAscii("DOMActivate") == 0)
{
- Reference< XUIEvent > aUIEvent(aEvent, UNO_QUERY);
+ Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW);
CUIEvent* pUIEvent = new CUIEvent;
pUIEvent->initUIEvent(aType,
aUIEvent->getBubbles(), aUIEvent->getCancelable(),
@@ -118,7 +148,8 @@ namespace DOM { namespace events {
aType.compareToAscii("mousemove") == 0||
aType.compareToAscii("mouseout") == 0)
{
- Reference< XMouseEvent > aMouseEvent(aEvent, UNO_QUERY);
+ Reference< XMouseEvent > const aMouseEvent(i_xEvent,
+ UNO_QUERY_THROW);
CMouseEvent *pMouseEvent = new CMouseEvent;
pMouseEvent->initMouseEvent(aType,
aMouseEvent->getBubbles(), aMouseEvent->getCancelable(),
@@ -134,23 +165,35 @@ namespace DOM { namespace events {
{
pEvent = new CEvent;
pEvent->initEvent(
- aType, aEvent->getBubbles(), aEvent->getCancelable());
+ aType, i_xEvent->getBubbles(), i_xEvent->getCancelable());
}
- pEvent->m_target = Reference< XEventTarget >(DOM::CNode::get(aNodePtr));
- pEvent->m_currentTarget = aEvent->getCurrentTarget();
- pEvent->m_time = aEvent->getTimeStamp();
+ pEvent->m_target.set(xNode, UNO_QUERY_THROW);
+ pEvent->m_currentTarget = i_xEvent->getCurrentTarget();
+ pEvent->m_time = i_xEvent->getTimeStamp();
// create the reference to the provate event implementation
// that will be dispatched to the listeners
- xEvent = Reference< XEvent >(pEvent);
+ Reference< XEvent > const xEvent(pEvent);
// build the path from target node to the root
- NodeVector captureVector;
- xmlNodePtr cur = DOM::CNode::getNodePtr(Reference< XNode >(xEvent->getTarget(), UNO_QUERY_THROW));
- while (cur != NULL)
+ typedef std::vector< ::std::pair<Reference<XEventTarget>, xmlNodePtr> >
+ NodeVector_t;
+ NodeVector_t captureVector;
+ TypeListenerMap captureListeners;
+ TypeListenerMap targetListeners;
{
- captureVector.push_back(cur);
- cur = cur->parent;
+ ::osl::MutexGuard g(rMutex);
+
+ xmlNodePtr cur = pNode;
+ while (cur != NULL)
+ {
+ Reference< XEventTarget > const xRef(
+ rDocument.GetCNode(cur).get());
+ captureVector.push_back(::std::make_pair(xRef, cur));
+ cur = cur->parent;
+ }
+ captureListeners = m_CaptureListeners;
+ targetListeners = m_TargetListeners;
}
// the caputre vector now holds the node path from target to root
@@ -158,36 +201,38 @@ namespace DOM { namespace events {
// to target. after that, any target listeners have to be called
// then bubbeling phase listeners are called in target to root
// order
- NodeVector::const_iterator inode;
-
// start at the root
- inode = captureVector.end();
- inode--;
- if (inode != captureVector.end())
+ NodeVector_t::const_reverse_iterator rinode =
+ const_cast<NodeVector_t const&>(captureVector).rbegin();
+ if (rinode != const_cast<NodeVector_t const&>(captureVector).rend())
{
// capturing phase:
pEvent->m_phase = PhaseType_CAPTURING_PHASE;
- while (inode != captureVector.begin())
+ while (rinode !=
+ const_cast<NodeVector_t const&>(captureVector).rend())
{
- //pEvent->m_currentTarget = *inode;
- pEvent->m_currentTarget = Reference< XEventTarget >(DOM::CNode::get(*inode));
- callListeners(*inode, aType, xEvent, sal_True);
+ pEvent->m_currentTarget = rinode->first;
+ callListeners(captureListeners, rinode->second, aType, xEvent);
if (pEvent->m_canceled) return sal_True;
- inode--;
+ rinode++;
}
+ NodeVector_t::const_iterator inode = captureVector.begin();
+
// target phase
pEvent->m_phase = PhaseType_AT_TARGET;
- callListeners(*inode, aType, xEvent, sal_False);
+ pEvent->m_currentTarget = inode->first;
+ callListeners(targetListeners, inode->second, aType, xEvent);
if (pEvent->m_canceled) return sal_True;
// bubbeling phase
inode++;
- if (aEvent->getBubbles()) {
+ if (i_xEvent->getBubbles()) {
pEvent->m_phase = PhaseType_BUBBLING_PHASE;
while (inode != captureVector.end())
{
- pEvent->m_currentTarget = Reference< XEventTarget >(DOM::CNode::get(*inode));
- callListeners(*inode, aType, xEvent, sal_False);
+ pEvent->m_currentTarget = inode->first;
+ callListeners(targetListeners,
+ inode->second, aType, xEvent);
if (pEvent->m_canceled) return sal_True;
inode++;
}
diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx
index 2af5884842f6..62cb2d38b3f5 100644
--- a/unoxml/source/events/eventdispatcher.hxx
+++ b/unoxml/source/events/eventdispatcher.hxx
@@ -1,51 +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 EVENT_EVENT_DISPATCHER_HXX
+#define EVENT_EVENT_DISPATCHER_HXX
-//#include <multimap>
#include <map>
#include <vector>
+#include <libxml/tree.h>
+
+#include <rtl/ustring.hxx>
+
#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/events/EventType.hpp>
#include <com/sun/star/xml/dom/events/PhaseType.hpp>
#include <com/sun/star/xml/dom/events/XEvent.hpp>
-#include "event.hxx"
+
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::dom::events;
-namespace DOM { namespace events
-{
+namespace DOM {
+
+class CDocument;
+
+namespace events {
-typedef std::vector< xmlNodePtr > NodeVector;
typedef std::multimap< xmlNodePtr, Reference< com::sun::star::xml::dom::events::XEventListener> > ListenerMap;
-typedef std::map<OUString, ListenerMap*> TypeListenerMap;
+typedef std::map< ::rtl::OUString, ListenerMap*> TypeListenerMap;
typedef std::vector<ListenerMap::value_type> ListenerPairVector;
class CEventDispatcher
{
private:
- static TypeListenerMap captureListeners;
- static TypeListenerMap targetListeners;
+ TypeListenerMap m_CaptureListeners;
+ TypeListenerMap m_TargetListeners;
public:
- static sal_Bool dispatchEvent(xmlNodePtr aNode, const Reference< XEvent >& aEvent);
-
- static void addListener(
+ void addListener(
xmlNodePtr pNode,
- OUString aType,
+ ::rtl::OUString aType,
const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
sal_Bool bCapture);
- static void removeListener(
+ void removeListener(
xmlNodePtr pNode,
- OUString aType,
+ ::rtl::OUString aType,
const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
sal_Bool bCapture);
static void callListeners(
- xmlNodePtr pNode,
- OUString aType,
- const Reference< XEvent >& xEvent,
- sal_Bool bCapture);
+ TypeListenerMap const& rTMap,
+ xmlNodePtr const pNode,
+ ::rtl::OUString aType,
+ const Reference< XEvent >& xEvent);
+
+ bool dispatchEvent(
+ DOM::CDocument & rDocument,
+ ::osl::Mutex & rMutex,
+ xmlNodePtr const pNode,
+ Reference<XNode> const& xNode,
+ Reference< XEvent > const& xEvent) const;
};
+
}}
+
+#endif
+
diff --git a/unoxml/source/events/mouseevent.cxx b/unoxml/source/events/mouseevent.cxx
index 362a1149ba72..02d1ea619c84 100644
--- a/unoxml/source/events/mouseevent.cxx
+++ b/unoxml/source/events/mouseevent.cxx
@@ -1,46 +1,96 @@
-#include "mouseevent.hxx"
+/*************************************************************************
+ *
+ * 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 <mouseevent.hxx>
namespace DOM { namespace events
{
+ CMouseEvent::CMouseEvent()
+ : CMouseEvent_Base()
+ , m_screenX(0)
+ , m_screenY(0)
+ , m_clientX(0)
+ , m_clientY(0)
+ , m_ctrlKey(sal_False)
+ , m_shiftKey(sal_False)
+ , m_altKey(sal_False)
+ , m_metaKey(sal_False)
+ , m_button(0)
+ {
+ }
sal_Int32 SAL_CALL CMouseEvent::getScreenX() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_screenX;
}
sal_Int32 SAL_CALL CMouseEvent::getScreenY() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_screenY;
}
sal_Int32 SAL_CALL CMouseEvent::getClientX() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_clientX;
}
sal_Int32 SAL_CALL CMouseEvent::getClientY() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_clientY;
}
sal_Bool SAL_CALL CMouseEvent::getCtrlKey() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_ctrlKey;
}
sal_Bool SAL_CALL CMouseEvent::getShiftKey() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_shiftKey;
}
sal_Bool SAL_CALL CMouseEvent::getAltKey() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_altKey;
}
sal_Bool SAL_CALL CMouseEvent::getMetaKey() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_metaKey;
}
sal_Int16 SAL_CALL CMouseEvent::getButton() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_button;
}
Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget() throw(RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_relatedTarget;
}
@@ -62,6 +112,8 @@ namespace DOM { namespace events
const Reference< XEventTarget >& /*relatedTargetArg*/)
throw(RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
m_screenX = screenXArg;
m_screenY = screenYArg;
diff --git a/unoxml/source/events/mouseevent.hxx b/unoxml/source/events/mouseevent.hxx
index d70f1c1ac605..0bbcbf7698b7 100644
--- a/unoxml/source/events/mouseevent.hxx
+++ b/unoxml/source/events/mouseevent.hxx
@@ -1,27 +1,51 @@
-#ifndef __MOUSEEVENT_HXX
-#define __MOUSEEVENT_HXX
+/*************************************************************************
+ *
+ * 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 EVENT_MOUSEEVENT_HXX
+#define EVENT_MOUSEEVENT_HXX
-#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/xml/dom/events/EventType.hpp>
#include <com/sun/star/xml/dom/events/PhaseType.hpp>
-#include <com/sun/star/xml/dom/events/AttrChangeType.hpp>
-#include <com/sun/star/xml/dom/events/XEvent.hpp>
-#include <com/sun/star/xml/dom/events/XUIEvent.hpp>
#include <com/sun/star/xml/dom/events/XMouseEvent.hpp>
-#include "event.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
#include "uievent.hxx"
+
using ::rtl::OUString;
namespace DOM { namespace events {
-class CMouseEvent : public cppu::ImplInheritanceHelper1< CUIEvent, XMouseEvent >
+typedef ::cppu::ImplInheritanceHelper1< CUIEvent, XMouseEvent >
+ CMouseEvent_Base;
+
+class CMouseEvent
+ : public CMouseEvent_Base
{
- friend class CEventDispatcher;
protected:
sal_Int32 m_screenX;
sal_Int32 m_screenY;
@@ -35,6 +59,7 @@ protected:
Reference< XEventTarget > m_relatedTarget;
public:
+ explicit CMouseEvent();
virtual sal_Int32 SAL_CALL getScreenX() throw (RuntimeException);
virtual sal_Int32 SAL_CALL getScreenY() throw (RuntimeException);
diff --git a/unoxml/source/events/mutationevent.cxx b/unoxml/source/events/mutationevent.cxx
index bc06cb2af61a..201fbe9e07da 100644
--- a/unoxml/source/events/mutationevent.cxx
+++ b/unoxml/source/events/mutationevent.cxx
@@ -1,33 +1,71 @@
-#include "mutationevent.hxx"
+/*************************************************************************
+ *
+ * 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 <mutationevent.hxx>
namespace DOM { namespace events
{
+ CMutationEvent::CMutationEvent()
+ : CMutationEvent_Base()
+ , m_attrChangeType(AttrChangeType_MODIFICATION)
+ {
+ }
+
CMutationEvent::~CMutationEvent()
{
}
Reference< XNode > SAL_CALL CMutationEvent::getRelatedNode() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_relatedNode;
}
OUString SAL_CALL CMutationEvent::getPrevValue() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_prevValue;
}
OUString SAL_CALL CMutationEvent::getNewValue() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_newValue;
}
OUString SAL_CALL CMutationEvent::getAttrName() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_attrName;
}
AttrChangeType SAL_CALL CMutationEvent::getAttrChange() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_attrChangeType;
}
@@ -37,7 +75,9 @@ namespace DOM { namespace events
const OUString& newValueArg, const OUString& attrNameArg,
AttrChangeType attrChangeArg) throw (RuntimeException)
{
- initEvent(typeArg, canBubbleArg, cancelableArg);
+ ::osl::MutexGuard const g(m_Mutex);
+
+ CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
m_relatedNode = relatedNodeArg;
m_prevValue = prevValueArg;
m_newValue = newValueArg;
diff --git a/unoxml/source/events/mutationevent.hxx b/unoxml/source/events/mutationevent.hxx
index e28613ad5df9..20b8dbf4523a 100644
--- a/unoxml/source/events/mutationevent.hxx
+++ b/unoxml/source/events/mutationevent.hxx
@@ -1,25 +1,56 @@
-#ifndef __MUTATIONEVENT_HXX
-#define __MUTATIONEVENT_HXX
+/*************************************************************************
+ *
+ * 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 EVENT_MUTATIONEVENT_HXX
+#define EVENT_MUTATIONEVENT_HXX
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/xml/dom/events/EventType.hpp>
+
#include <com/sun/star/xml/dom/events/PhaseType.hpp>
#include <com/sun/star/xml/dom/events/AttrChangeType.hpp>
-#include <com/sun/star/xml/dom/events/XEvent.hpp>
#include <com/sun/star/xml/dom/events/XMutationEvent.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
#include "event.hxx"
+
using ::rtl::OUString;
namespace DOM { namespace events {
-class CMutationEvent : public cppu::ImplInheritanceHelper1< CEvent, XMutationEvent >
+typedef ::cppu::ImplInheritanceHelper1< CEvent, XMutationEvent >
+ CMutationEvent_Base;
+
+class CMutationEvent
+ : public CMutationEvent_Base
{
- friend class CEventDispatcher;
protected:
Reference< XNode > m_relatedNode;
OUString m_prevValue;
@@ -28,6 +59,7 @@ protected:
AttrChangeType m_attrChangeType;
public:
+ explicit CMutationEvent();
virtual ~CMutationEvent();
diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx
index 64806c84017d..a493aefb55f8 100644
--- a/unoxml/source/events/testlistener.cxx
+++ b/unoxml/source/events/testlistener.cxx
@@ -33,6 +33,10 @@
#define U2S(s) OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::lang::IllegalArgumentException;
+
+
namespace DOM { namespace events
{
diff --git a/unoxml/source/events/testlistener.hxx b/unoxml/source/events/testlistener.hxx
index b6d6abdc700f..1d96edefca34 100644
--- a/unoxml/source/events/testlistener.hxx
+++ b/unoxml/source/events/testlistener.hxx
@@ -25,47 +25,46 @@
*
************************************************************************/
-#ifndef _TESTLISTENER_HXX
-#define _TESTLISTENER_HXX
-
-#include <map>
+#ifndef EVENT_TESTLISTENER_HXX
+#define EVENT_TESTLISTENER_HXX
#include <sal/types.h>
-#include <cppuhelper/implbase3.hxx>
+
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/xml/dom/events/XEventTarget.hpp>
#include <com/sun/star/xml/dom/events/XEventListener.hpp>
#include <com/sun/star/xml/dom/events/XEvent.hpp>
-#include <com/sun/star/xml/dom/events/EventType.hpp>
-#include <com/sun/star/xml/dom/events/XMutationEvent.hpp>
-#include "libxml/tree.h"
+#include <cppuhelper/implbase3.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::dom::events;
namespace DOM { namespace events
{
+ typedef ::cppu::WeakImplHelper3
+ < ::com::sun::star::xml::dom::events::XEventListener
+ , ::com::sun::star::lang::XInitialization
+ , ::com::sun::star::lang::XServiceInfo
+ > CTestListener_Base;
+
class CTestListener
- : public ::cppu::WeakImplHelper3< com::sun::star::xml::dom::events::XEventListener, XInitialization, XServiceInfo >
+ : public CTestListener_Base
{
private:
- Reference< XMultiServiceFactory > m_factory;
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > m_factory;
Reference <XEventTarget> m_target;
OUString m_type;
sal_Bool m_capture;
@@ -78,9 +77,13 @@ namespace DOM { namespace events
static const char* aSupportedServiceNames[];
static OUString _getImplementationName();
static Sequence< OUString > _getSupportedServiceNames();
- static Reference< XInterface > _getInstance(const Reference< XMultiServiceFactory >& rSMgr);
+ static Reference< XInterface > _getInstance(
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ rSMgr);
- CTestListener(const Reference< XMultiServiceFactory >& rSMgr)
+ CTestListener(
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ rSMgr)
: m_factory(rSMgr){};
virtual ~CTestListener();
diff --git a/unoxml/source/events/uievent.cxx b/unoxml/source/events/uievent.cxx
index 29d2e10e57dc..68e5dbbc6862 100644
--- a/unoxml/source/events/uievent.cxx
+++ b/unoxml/source/events/uievent.cxx
@@ -1,16 +1,50 @@
-#include "event.hxx"
-#include "uievent.hxx"
+/*************************************************************************
+ *
+ * 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 <uievent.hxx>
namespace DOM { namespace events
{
+ CUIEvent::CUIEvent()
+ : CUIEvent_Base()
+ , m_detail(0)
+ {
+ }
- Reference< XAbstractView > SAL_CALL CUIEvent::getView() throw(RuntimeException)
+ Reference< XAbstractView > SAL_CALL
+ CUIEvent::getView() throw(RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_view;
}
sal_Int32 SAL_CALL CUIEvent::getDetail() throw(RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
return m_detail;
}
@@ -20,7 +54,9 @@ namespace DOM { namespace events
const Reference< XAbstractView >& viewArg,
sal_Int32 detailArg) throw(RuntimeException)
{
- initEvent(typeArg, canBubbleArg, cancelableArg);
+ ::osl::MutexGuard const g(m_Mutex);
+
+ CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
m_view = viewArg;
m_detail = detailArg;
}
diff --git a/unoxml/source/events/uievent.hxx b/unoxml/source/events/uievent.hxx
index f7c5806e48e0..2f1c6f28dc3d 100644
--- a/unoxml/source/events/uievent.hxx
+++ b/unoxml/source/events/uievent.hxx
@@ -1,32 +1,61 @@
-#ifndef __UIEVENT_HXX
-#define __UIEVENT_HXX
+/*************************************************************************
+ *
+ * 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 EVENT_UIEVENT_HXX
+#define EVENT_UIEVENT_HXX
#include <sal/types.h>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/xml/dom/events/EventType.hpp>
+
#include <com/sun/star/xml/dom/events/PhaseType.hpp>
-#include <com/sun/star/xml/dom/events/AttrChangeType.hpp>
-#include <com/sun/star/xml/dom/events/XEvent.hpp>
#include <com/sun/star/xml/dom/events/XUIEvent.hpp>
#include <com/sun/star/xml/dom/views/XAbstractView.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
#include "event.hxx"
+
using ::rtl::OUString;
using namespace com::sun::star::xml::dom::views;
namespace DOM { namespace events {
-class CUIEvent : public cppu::ImplInheritanceHelper1< CEvent, XUIEvent >
+typedef ::cppu::ImplInheritanceHelper1< CEvent, XUIEvent > CUIEvent_Base;
+
+class CUIEvent
+ : public CUIEvent_Base
{
- friend class CEventDispatcher;
protected:
sal_Int32 m_detail;
Reference< XAbstractView > m_view;
public:
+ explicit CUIEvent();
+
virtual Reference< XAbstractView > SAL_CALL getView() throw(RuntimeException);
virtual sal_Int32 SAL_CALL getDetail() throw(RuntimeException);
virtual void SAL_CALL initUIEvent(const OUString& typeArg,
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index 83de4df8050f..948c84cf3dab 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -1069,8 +1069,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"librdf_Repository::exportGraph: "
"librdf_model_context_as_stream failed"), *this);
}
-// const char *format("rdfxml");
- const char *format("rdfxml-abbrev");
+ const char *format("rdfxml");
+ // #i116443#: abbrev breaks when certain URIs are used as data types
+// const char *format("rdfxml-abbrev");
const boost::shared_ptr<librdf_serializer> pSerializer(
librdf_new_serializer(m_pWorld.get(), format, NULL, NULL),
safe_librdf_free_serializer);
diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx
index 08e776d214fe..4c614eef433b 100644
--- a/unoxml/source/rdf/librdf_services.cxx
+++ b/unoxml/source/rdf/librdf_services.cxx
@@ -38,7 +38,7 @@ using namespace ::com::sun::star;
extern "C"
{
-void SAL_CALL
+SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(const sal_Char **o_ppEnvironmentTypeName,
uno_Environment ** /* ppEnvironment */)
{
@@ -65,7 +65,8 @@ static ::cppu::ImplementationEntry const entries[] = {
{ 0, 0, 0, 0, 0, 0 }
};
-extern "C" void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL
+component_getFactory(
const char * implName, void * serviceManager, void * registryKey)
{
return ::cppu::component_getFactoryHelper(
diff --git a/unoxml/source/rdf/makefile.mk b/unoxml/source/rdf/makefile.mk
deleted file mode 100644
index 1dbcffb8b6ac..000000000000
--- a/unoxml/source/rdf/makefile.mk
+++ /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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=unoxml
-TARGET=unordf
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_REDLAND)" == "YES"
-CFLAGS+=-DSYSTEM_REDLAND $(REDLAND_CFLAGS)
-.ENDIF
-
-.IF "$(SYSTEM_LIBXSLT)" == "YES"
-CFLAGS+= $(LIBXSLT_CFLAGS)
-.ELSE
-LIBXSLTINCDIR=external$/libxslt
-CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR)
-.ENDIF
-
-# --- Files --------------------------------------------------------
-.IF "$(L10N_framework)"==""
-
-SLOFILES = \
- $(SLO)$/CBlankNode.obj \
- $(SLO)$/CURI.obj \
- $(SLO)$/CLiteral.obj \
- $(SLO)$/librdf_repository.obj \
- $(SLO)$/librdf_services.obj
-
-
-SHL1DEPN= makefile.mk
-SHL1OBJS= $(SLOFILES)
-
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1IMPLIB= i$(TARGET)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
-
-SHL1STDLIBS= \
- $(REDLANDLIB) \
- $(XSLTLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB) \
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-ALLTAR : $(MISC)/unordf.component
-
-$(MISC)/unordf.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- unordf.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt unordf.component
diff --git a/unoxml/source/service/makefile.mk b/unoxml/source/service/makefile.mk
deleted file mode 100644
index 5fbe62f67ec4..000000000000
--- a/unoxml/source/service/makefile.mk
+++ /dev/null
@@ -1,86 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=unoxml
-TARGET=unoxml
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.IF "$(SYSTEM_LIBXML)" == "YES"
-CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/services.obj
-
-
-SHL1DEPN= makefile.mk
-SHL1OBJS= $(SLOFILES)
-
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1IMPLIB= i$(TARGET)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
-
-SHL1LIBS= \
- $(SLB)$/domimpl.lib \
- $(SLB)$/xpathimpl.lib \
- $(SLB)$/eventsimpl.lib
-
-SHL1STDLIBS= \
- $(UCBHELPERLIB) \
- $(LIBXML2LIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SAXLIB) \
- $(SALLIB)\
- $(EXPATASCII3RDLIB)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-ALLTAR : $(MISC)/unoxml.component
-
-$(MISC)/unoxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- unoxml.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt unoxml.component
diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx
index 6b1a2f6f0979..c50faf3e8522 100644
--- a/unoxml/source/service/services.cxx
+++ b/unoxml/source/service/services.cxx
@@ -54,13 +54,13 @@ using namespace ::com::sun::star::registry;
extern "C"
{
-void SAL_CALL
+SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment */)
{
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-void* SAL_CALL
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL
component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
{
void* pReturn = NULL ;
diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx
index dd44d8bfcc06..05add3ca44bc 100644
--- a/unoxml/source/xpath/nodelist.cxx
+++ b/unoxml/source/xpath/nodelist.cxx
@@ -25,13 +25,19 @@
*
************************************************************************/
-#include "nodelist.hxx"
-#include "../dom/node.hxx"
+#include <nodelist.hxx>
+
+#include "../dom/document.hxx"
namespace XPath
{
- CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& rxpathObj)
- : m_pNodeSet(0)
+ CNodeList::CNodeList(
+ ::rtl::Reference<DOM::CDocument> const& pDocument,
+ ::osl::Mutex & rMutex,
+ boost::shared_ptr<xmlXPathObject> const& rxpathObj)
+ : m_pDocument(pDocument)
+ , m_rMutex(rMutex)
+ , m_pNodeSet(0)
{
if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET)
{
@@ -45,6 +51,8 @@ namespace XPath
*/
sal_Int32 SAL_CALL CNodeList::getLength() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
sal_Int32 value = 0;
if (m_pNodeSet != NULL)
value = xmlXPathNodeSetGetLength(m_pNodeSet);
@@ -54,12 +62,17 @@ namespace XPath
/**
Returns the indexth item in the collection.
*/
- Reference< XNode > SAL_CALL CNodeList::item(sal_Int32 index) throw (RuntimeException)
+ Reference< XNode > SAL_CALL CNodeList::item(sal_Int32 index)
+ throw (RuntimeException)
{
- Reference< XNode > aNode;
- if (m_pNodeSet != NULL)
- aNode = Reference< XNode >(DOM::CNode::get(xmlXPathNodeSetItem(m_pNodeSet, index)));
- return aNode;
+ ::osl::MutexGuard const g(m_rMutex);
+
+ if (0 == m_pNodeSet) {
+ return 0;
+ }
+ xmlNodePtr const pNode = xmlXPathNodeSetItem(m_pNodeSet, index);
+ Reference< XNode > const xNode(m_pDocument->GetCNode(pNode).get());
+ return xNode;
}
}
diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx
index 68f419f10174..fd6b428af27e 100644
--- a/unoxml/source/xpath/nodelist.hxx
+++ b/unoxml/source/xpath/nodelist.hxx
@@ -25,38 +25,52 @@
*
************************************************************************/
-#ifndef _NODELIST_HXX
-#define _NODELIST_HXX
+#ifndef XPATH_NODELIST_HXX
+#define XPATH_NODELIST_HXX
-#include <vector>
#include <sal/types.h>
+#include <rtl/ref.hxx>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/xpath/XXPathObject.hpp>
+
#include "libxml/tree.h"
#include "libxml/xpath.h"
+
#include <boost/shared_ptr.hpp>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::xpath;
+namespace DOM {
+ class CDocument;
+}
+
namespace XPath
{
class CNodeList : public cppu::WeakImplHelper1< XNodeList >
{
private:
+ /// #i115995# keep document alive
+ ::rtl::Reference< DOM::CDocument > const m_pDocument;
+ ::osl::Mutex & m_rMutex;
+ /// retain the result set in case the CXPathObject is released
boost::shared_ptr<xmlXPathObject> m_pXPathObj;
xmlNodeSetPtr m_pNodeSet;
public:
- CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj);
+ CNodeList(
+ ::rtl::Reference<DOM::CDocument> const& pDocument,
+ ::osl::Mutex & rMutex,
+ boost::shared_ptr<xmlXPathObject> const& rxpathObj);
/**
The number of nodes in the list.
*/
@@ -64,7 +78,8 @@ namespace XPath
/**
Returns the indexth item in the collection.
*/
- virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
+ virtual Reference< XNode > SAL_CALL item(sal_Int32 index)
+ throw (RuntimeException);
};
}
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index f40082e25e9b..00d13be6348c 100644
--- a/unoxml/source/xpath/xpathapi.cxx
+++ b/unoxml/source/xpath/xpathapi.cxx
@@ -25,19 +25,26 @@
*
************************************************************************/
-#include "xpathapi.hxx"
-#include "nodelist.hxx"
-#include "xpathobject.hxx"
-#include "../dom/node.hxx"
+#include <xpathapi.hxx>
-#include <rtl/ustrbuf.hxx>
+#include <stdarg.h>
+#include <string.h>
+#include <libxml/tree.h>
#include <libxml/xmlerror.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
-#include <stdarg.h>
-#include <string.h>
+#include <rtl/ustrbuf.hxx>
+
+#include <nodelist.hxx>
+#include <xpathobject.hxx>
+
+#include "../dom/node.hxx"
+#include "../dom/document.hxx"
+
+
+using ::com::sun::star::lang::XMultiServiceFactory;
namespace XPath
@@ -105,6 +112,8 @@ namespace XPath
const OUString& aURI)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
m_nsmap.insert(nsmap_t::value_type(aPrefix, aURI));
}
@@ -113,13 +122,16 @@ namespace XPath
const OUString& aURI)
throw (RuntimeException)
{
- if ((m_nsmap.find(aPrefix))->second.equals(aURI))
+ ::osl::MutexGuard const g(m_Mutex);
+
+ if ((m_nsmap.find(aPrefix))->second.equals(aURI)) {
m_nsmap.erase(aPrefix);
+ }
}
// register all namespaces stored in the namespace list for this object
// with the current xpath evaluation context
- static void _registerNamespaces(
+ static void lcl_registerNamespaces(
xmlXPathContextPtr ctx,
const nsmap_t& nsmap)
{
@@ -137,13 +149,16 @@ namespace XPath
}
}
- // get all ns decls on a node (and parent nodes, if any) and register them
- static void _collectNamespaces(
- CXPathAPI* pAPI,
- const Reference< XNode >& namespaceNode)
+ // get all ns decls on a node (and parent nodes, if any)
+ static void lcl_collectNamespaces(
+ nsmap_t & rNamespaces, Reference< XNode > const& xNamespaceNode)
{
- // get namespace decls from node...
- xmlNodePtr pNode = DOM::CNode::getNodePtr(namespaceNode);
+ DOM::CNode *const pCNode(DOM::CNode::GetImplementation(xNamespaceNode));
+ if (!pCNode) { throw RuntimeException(); }
+
+ ::osl::MutexGuard const g(pCNode->GetOwnerDocument().GetMutex());
+
+ xmlNodePtr pNode = pCNode->GetNodePtr();
while (pNode != 0) {
xmlNsPtr curDef = pNode->nsDef;
while (curDef != 0) {
@@ -151,16 +166,32 @@ namespace XPath
OUString aURI((sal_Char*)xHref, strlen((char*)xHref), RTL_TEXTENCODING_UTF8);
const xmlChar* xPre = curDef->prefix;
OUString aPrefix((sal_Char*)xPre, strlen((char*)xPre), RTL_TEXTENCODING_UTF8);
- pAPI->registerNS(aPrefix, aURI);
+ // we could already have this prefix from a child node
+ if (rNamespaces.find(aPrefix) == rNamespaces.end())
+ {
+ rNamespaces.insert(::std::make_pair(aPrefix, aURI));
+ }
curDef = curDef->next;
}
pNode = pNode->parent;
}
}
+ static void lcl_collectRegisterNamespaces(
+ CXPathAPI & rAPI, Reference< XNode > const& xNamespaceNode)
+ {
+ nsmap_t namespaces;
+ lcl_collectNamespaces(namespaces, xNamespaceNode);
+ for (nsmap_t::const_iterator iter = namespaces.begin();
+ iter != namespaces.end(); ++iter)
+ {
+ rAPI.registerNS(iter->first, iter->second);
+ }
+ }
+
// register function and variable lookup functions with the current
// xpath evaluation context
- static void _registerExtensions(
+ static void lcl_registerExtensions(
xmlXPathContextPtr ctx,
const extensions_t& extensions)
{
@@ -209,7 +240,7 @@ namespace XPath
const Reference< XNode >& namespaceNode)
throw (RuntimeException, XPathException)
{
- _collectNamespaces(this, namespaceNode);
+ lcl_collectRegisterNamespaces(*this, namespaceNode);
return selectNodeList(contextNode, expr);
}
@@ -236,7 +267,7 @@ namespace XPath
const Reference< XNode >& namespaceNode )
throw (RuntimeException, XPathException)
{
- _collectNamespaces(this, namespaceNode);
+ lcl_collectRegisterNamespaces(*this, namespaceNode);
return selectSingleNode(contextNode, expr);
}
@@ -307,15 +338,34 @@ namespace XPath
* the context Node
*/
Reference< XXPathObject > SAL_CALL CXPathAPI::eval(
- const Reference< XNode >& contextNode,
+ Reference< XNode > const& xContextNode,
const OUString& expr)
throw (RuntimeException, XPathException)
{
- xmlXPathContextPtr xpathCtx;
- xmlXPathObjectPtr xpathObj;
+ if (!xContextNode.is()) { throw RuntimeException(); }
+
+ nsmap_t nsmap;
+ extensions_t extensions;
+
+ {
+ ::osl::MutexGuard const g(m_Mutex);
+ nsmap = m_nsmap;
+ extensions = m_extensions;
+ }
// get the node and document
- xmlNodePtr pNode = DOM::CNode::getNodePtr(contextNode);
+ ::rtl::Reference<DOM::CDocument> const pCDoc(
+ dynamic_cast<DOM::CDocument*>( DOM::CNode::GetImplementation(
+ xContextNode->getOwnerDocument())));
+ if (!pCDoc.is()) { throw RuntimeException(); }
+
+ DOM::CNode *const pCNode = DOM::CNode::GetImplementation(xContextNode);
+ if (!pCNode) { throw RuntimeException(); }
+
+ ::osl::MutexGuard const g(pCDoc->GetMutex()); // lock the document!
+
+ xmlNodePtr const pNode = pCNode->GetNodePtr();
+ if (!pNode) { throw RuntimeException(); }
xmlDocPtr pDoc = pNode->doc;
/* NB: workaround for #i87252#:
@@ -330,8 +380,9 @@ namespace XPath
}
/* Create xpath evaluation context */
- xpathCtx = xmlXPathNewContext(pDoc);
- if (xpathCtx == NULL) throw XPathException();
+ ::boost::shared_ptr<xmlXPathContext> const xpathCtx(
+ xmlXPathNewContext(pDoc), xmlXPathFreeContext);
+ if (xpathCtx == NULL) { throw XPathException(); }
// set context node
xpathCtx->node = pNode;
@@ -340,20 +391,21 @@ namespace XPath
xmlSetGenericErrorFunc(NULL, generic_error_func);
// register namespaces and extension
- _registerNamespaces(xpathCtx, m_nsmap);
- _registerExtensions(xpathCtx, m_extensions);
+ lcl_registerNamespaces(xpathCtx.get(), nsmap);
+ lcl_registerExtensions(xpathCtx.get(), extensions);
/* run the query */
OString o1 = OUStringToOString(expr, RTL_TEXTENCODING_UTF8);
xmlChar *xStr = (xmlChar*)o1.getStr();
- if ((xpathObj = xmlXPathEval(xStr, xpathCtx)) == NULL) {
+ ::boost::shared_ptr<xmlXPathObject> const xpathObj(
+ xmlXPathEval(xStr, xpathCtx.get()), xmlXPathFreeObject);
+ if (0 == xpathObj) {
// OSL_ENSURE(xpathCtx->lastError == NULL, xpathCtx->lastError->message);
- xmlXPathFreeContext(xpathCtx);
throw XPathException();
}
- xmlXPathFreeContext(xpathCtx);
- Reference< XXPathObject > aObj(new CXPathObject(xpathObj, contextNode));
- return aObj;
+ Reference<XXPathObject> const xObj(
+ new CXPathObject(pCDoc, pCDoc->GetMutex(), xpathObj));
+ return xObj;
}
/**
@@ -365,7 +417,7 @@ namespace XPath
const Reference< XNode >& namespaceNode)
throw (RuntimeException, XPathException)
{
- _collectNamespaces(this, namespaceNode);
+ lcl_collectRegisterNamespaces(*this, namespaceNode);
return eval(contextNode, expr);
}
@@ -378,9 +430,12 @@ namespace XPath
const OUString& aName)
throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_Mutex);
+
// get extension from service manager
- Reference< XXPathExtension > aExtension(m_aFactory->createInstance(aName), UNO_QUERY_THROW);
- m_extensions.push_back( aExtension );
+ Reference< XXPathExtension > const xExtension(
+ m_aFactory->createInstance(aName), UNO_QUERY_THROW);
+ m_extensions.push_back(xExtension);
}
/**
@@ -388,13 +443,13 @@ namespace XPath
* XPathAPI instance
*/
void SAL_CALL CXPathAPI::registerExtensionInstance(
- const Reference< XXPathExtension>& aExtension)
+ Reference< XXPathExtension> const& xExtension)
throw (RuntimeException)
{
- if (aExtension.is()) {
- m_extensions.push_back( aExtension );
- } else {
+ if (!xExtension.is()) {
throw RuntimeException();
}
+ ::osl::MutexGuard const g(m_Mutex);
+ m_extensions.push_back( xExtension );
}
}
diff --git a/unoxml/source/xpath/xpathapi.hxx b/unoxml/source/xpath/xpathapi.hxx
index 048fafaae8e9..a64eff7444c7 100644
--- a/unoxml/source/xpath/xpathapi.hxx
+++ b/unoxml/source/xpath/xpathapi.hxx
@@ -25,14 +25,16 @@
*
************************************************************************/
-#ifndef _XPATHAPI_HXX
-#define _XPATHAPI_HXX
+#ifndef XPATH_XPATHAPI_HXX
+#define XPATH_XPATHAPI_HXX
#include <map>
#include <vector>
#include <sal/types.h>
+
#include <cppuhelper/implbase2.hxx>
+
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
@@ -50,11 +52,9 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include "libxml/tree.h"
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::xpath;
@@ -63,28 +63,40 @@ namespace XPath
typedef std::map<OUString, OUString> nsmap_t;
typedef std::vector< Reference<XXPathExtension> > extensions_t;
+ typedef ::cppu::WeakImplHelper2
+ < XXPathAPI
+ , ::com::sun::star::lang::XServiceInfo
+ > CXPathAPI_Base;
+
class CXPathAPI
- : public ::cppu::WeakImplHelper2< XXPathAPI, XServiceInfo >
+ : public CXPathAPI_Base
{
private:
+ ::osl::Mutex m_Mutex;
nsmap_t m_nsmap;
- const Reference< XMultiServiceFactory > m_aFactory;
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory > m_aFactory;
extensions_t m_extensions;
public:
// ctor
- CXPathAPI(const Reference< XMultiServiceFactory >& rSMgr);
+ CXPathAPI(
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ rSMgr);
// call for factory
- static Reference< XInterface > getInstance(const Reference < XMultiServiceFactory >& xFactory);
+ static Reference< XInterface > getInstance(
+ const Reference < ::com::sun::star::lang::XMultiServiceFactory >&
+ xFactory);
// static helpers for service info and component management
static const char* aImplementationName;
static const char* aSupportedServiceNames[];
static OUString _getImplementationName();
static Sequence< OUString > _getSupportedServiceNames();
- static Reference< XInterface > _getInstance(const Reference< XMultiServiceFactory >& rSMgr);
+ static Reference< XInterface > _getInstance(
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ rSMgr);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName()
diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx
index 757de0c5aac4..36fdf1ba933e 100644
--- a/unoxml/source/xpath/xpathobject.cxx
+++ b/unoxml/source/xpath/xpathobject.cxx
@@ -25,67 +25,75 @@
*
************************************************************************/
+#include <xpathobject.hxx>
+
#include <string.h>
-#include "xpathobject.hxx"
-#include "nodelist.hxx"
+
+#include "../dom/document.hxx"
+#include <nodelist.hxx>
+
namespace XPath
{
- CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode)
- : m_pXPathObj(xpathObj, xmlXPathFreeObject), m_xContextNode(contextNode)
+ static XPathObjectType lcl_GetType(xmlXPathObjectPtr const pXPathObj)
{
- switch (m_pXPathObj->type)
+ switch (pXPathObj->type)
{
- case XPATH_UNDEFINED:
- m_xPathObjectType = XPathObjectType_XPATH_UNDEFINED;
- break;
- case XPATH_NODESET:
- m_xPathObjectType = XPathObjectType_XPATH_NODESET;
- break;
- case XPATH_BOOLEAN:
- m_xPathObjectType = XPathObjectType_XPATH_BOOLEAN;
- break;
- case XPATH_NUMBER:
- m_xPathObjectType = XPathObjectType_XPATH_NUMBER;
- break;
- case XPATH_STRING:
- m_xPathObjectType = XPathObjectType_XPATH_STRING;
- break;
- case XPATH_POINT:
- m_xPathObjectType = XPathObjectType_XPATH_POINT;
- break;
- case XPATH_RANGE:
- m_xPathObjectType = XPathObjectType_XPATH_RANGE;
- break;
- case XPATH_LOCATIONSET:
- m_xPathObjectType = XPathObjectType_XPATH_LOCATIONSET;
- break;
- case XPATH_USERS:
- m_xPathObjectType = XPathObjectType_XPATH_USERS;
- break;
- case XPATH_XSLT_TREE:
- m_xPathObjectType = XPathObjectType_XPATH_XSLT_TREE;
- break;
- default:
- m_xPathObjectType = XPathObjectType_XPATH_UNDEFINED;
- break;
+ case XPATH_UNDEFINED:
+ return XPathObjectType_XPATH_UNDEFINED;
+ case XPATH_NODESET:
+ return XPathObjectType_XPATH_NODESET;
+ case XPATH_BOOLEAN:
+ return XPathObjectType_XPATH_BOOLEAN;
+ case XPATH_NUMBER:
+ return XPathObjectType_XPATH_NUMBER;
+ case XPATH_STRING:
+ return XPathObjectType_XPATH_STRING;
+ case XPATH_POINT:
+ return XPathObjectType_XPATH_POINT;
+ case XPATH_RANGE:
+ return XPathObjectType_XPATH_RANGE;
+ case XPATH_LOCATIONSET:
+ return XPathObjectType_XPATH_LOCATIONSET;
+ case XPATH_USERS:
+ return XPathObjectType_XPATH_USERS;
+ case XPATH_XSLT_TREE:
+ return XPathObjectType_XPATH_XSLT_TREE;
+ default:
+ return XPathObjectType_XPATH_UNDEFINED;
}
}
+ CXPathObject::CXPathObject(
+ ::rtl::Reference<DOM::CDocument> const& pDocument,
+ ::osl::Mutex & rMutex,
+ ::boost::shared_ptr<xmlXPathObject> const& pXPathObj)
+ : m_pDocument(pDocument)
+ , m_rMutex(rMutex)
+ , m_pXPathObj(pXPathObj)
+ , m_XPathObjectType(lcl_GetType(pXPathObj.get()))
+ {
+ }
+
/**
get object type
*/
XPathObjectType CXPathObject::getObjectType() throw (RuntimeException)
{
- return m_xPathObjectType;
+ return m_XPathObjectType;
}
/**
get the nodes from a nodelist type object
*/
- Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException)
+ Reference< XNodeList > SAL_CALL
+ CXPathObject::getNodeList() throw (RuntimeException)
{
- return Reference< XNodeList >(new CNodeList(m_pXPathObj));
+ ::osl::MutexGuard const g(m_rMutex);
+
+ Reference< XNodeList > const xRet(
+ new CNodeList(m_pDocument, m_rMutex, m_pXPathObj));
+ return xRet;
}
/**
@@ -93,6 +101,8 @@ namespace XPath
*/
sal_Bool SAL_CALL CXPathObject::getBoolean() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (sal_Bool) xmlXPathCastToBoolean(m_pXPathObj.get());
}
@@ -101,6 +111,8 @@ namespace XPath
*/
sal_Int8 SAL_CALL CXPathObject::getByte() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (sal_Int8) xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -109,6 +121,8 @@ namespace XPath
*/
sal_Int16 SAL_CALL CXPathObject::getShort() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (sal_Int16) xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -117,6 +131,8 @@ namespace XPath
*/
sal_Int32 SAL_CALL CXPathObject::getLong() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (sal_Int32) xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -125,6 +141,8 @@ namespace XPath
*/
sal_Int64 SAL_CALL CXPathObject::getHyper() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (sal_Int64) xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -133,6 +151,8 @@ namespace XPath
*/
float SAL_CALL CXPathObject::getFloat() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return (float) xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -141,6 +161,8 @@ namespace XPath
*/
double SAL_CALL CXPathObject::getDouble() throw (RuntimeException)
{
+ ::osl::MutexGuard const g(m_rMutex);
+
return xmlXPathCastToNumber(m_pXPathObj.get());
}
@@ -149,8 +171,12 @@ namespace XPath
*/
OUString SAL_CALL CXPathObject::getString() throw (RuntimeException)
{
- const sal_Char* x1 = (sal_Char*) xmlXPathCastToString(m_pXPathObj.get());
- return OUString(x1, strlen(x1), RTL_TEXTENCODING_UTF8);
+ ::osl::MutexGuard const g(m_rMutex);
+
+ ::boost::shared_ptr<xmlChar const> str(
+ xmlXPathCastToString(m_pXPathObj.get()), xmlFree);
+ sal_Char const*const pS(reinterpret_cast<sal_Char const*>(str.get()));
+ return OUString(pS, strlen(pS), RTL_TEXTENCODING_UTF8);
}
}
diff --git a/unoxml/source/xpath/xpathobject.hxx b/unoxml/source/xpath/xpathobject.hxx
index 348fae8e21e6..f15aed9ded95 100644
--- a/unoxml/source/xpath/xpathobject.hxx
+++ b/unoxml/source/xpath/xpathobject.hxx
@@ -25,38 +25,48 @@
*
************************************************************************/
-#ifndef _XPATHOBJECT_HXX
-#define _XPATHOBJECT_HXX
+#ifndef XPATH_XPATHOBJECT_HXX
+#define XPATH_XPATHOBJECT_HXX
+
+#include <boost/shared_ptr.hpp>
+
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
-#include <map>
#include <sal/types.h>
+#include <rtl/ref.hxx>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/xpath/XXPathObject.hpp>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <boost/shared_ptr.hpp>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::xml::dom;
using namespace com::sun::star::xml::xpath;
+
+namespace DOM {
+ class CDocument;
+}
+
namespace XPath
{
class CXPathObject : public cppu::WeakImplHelper1< XXPathObject >
{
private:
- boost::shared_ptr<xmlXPathObject> m_pXPathObj;
- const Reference< XNode > m_xContextNode;
- XPathObjectType m_xPathObjectType;
+ ::rtl::Reference< DOM::CDocument > const m_pDocument;
+ ::osl::Mutex & m_rMutex;
+ boost::shared_ptr<xmlXPathObject> const m_pXPathObj;
+ XPathObjectType const m_XPathObjectType;
public:
- CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode);
+ CXPathObject( ::rtl::Reference<DOM::CDocument> const& pDocument,
+ ::osl::Mutex & rMutex,
+ ::boost::shared_ptr<xmlXPathObject> const& pXPathObj);
/**
get object type
@@ -66,7 +76,8 @@ namespace XPath
/**
get the nodes from a nodelist type object
*/
- virtual Reference< XNodeList > SAL_CALL getNodeList() throw (RuntimeException);
+ virtual Reference< XNodeList > SAL_CALL getNodeList()
+ throw (RuntimeException);
/**
get value of a boolean object
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 5e93839719b5..a41e5cf656ba 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -85,6 +85,7 @@
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
+-(AquaSalFrame*)getSalFrame;
-(BOOL)acceptsFirstResponder;
-(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
-(BOOL)isOpaque;
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx
index 01a58b171b02..103b6dc47d44 100644
--- a/vcl/aqua/source/dtrans/DropTarget.cxx
+++ b/vcl/aqua/source/dtrans/DropTarget.cxx
@@ -50,6 +50,8 @@
#include <Carbon/Carbon.h>
#include <postmac.h>
+#include <salframe.h>
+#include <salframeview.h>
using namespace rtl;
using namespace cppu;
@@ -60,6 +62,7 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
+using namespace com::sun::star;
using namespace comphelper;
OUString dropTarget_getImplementationName()
@@ -149,6 +152,8 @@ namespace /* private */
DropTarget::DropTarget() :
WeakComponentImplHelper5<XInitialization, XDropTarget, XDropTargetDragContext, XDropTargetDropContext, XServiceInfo>(m_aMutex),
+ mView(nil),
+ mpFrame(NULL),
mDropTargetHelper(nil),
mbActive(false),
mDragSourceSupportedActions(DNDConstants::ACTION_NONE),
@@ -161,8 +166,9 @@ DropTarget::DropTarget() :
DropTarget::~DropTarget()
{
- [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
- [mDropTargetHelper release];
+ if( AquaSalFrame::isAlive( mpFrame ) )
+ [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
+ [mDropTargetHelper release];
}
@@ -243,7 +249,7 @@ NSDragOperation DropTarget::draggingEntered(id sender)
NSPasteboard* dragPboard = [sender draggingPasteboard];
mXCurrentDragClipboard = new AquaClipboard(dragPboard, false);
- Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
+ uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
DragSource::g_XTransferable : mXCurrentDragClipboard->getContents();
DropTargetDragEnterEvent dtdee(static_cast<OWeakObject*>(this),
@@ -333,7 +339,7 @@ BOOL DropTarget::performDragOperation(id sender)
if (mSelectedDropAction != DNDConstants::ACTION_NONE)
{
- Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
+ uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
if (!DragSource::g_XTransferable.is())
{
@@ -370,7 +376,7 @@ BOOL DropTarget::performDragOperation(id sender)
{
mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE;
- mXCurrentDragClipboard = Reference<XClipboard>();
+ mXCurrentDragClipboard = uno::Reference<XClipboard>();
SetThemeCursor(kThemeArrowCursor);
}
@@ -396,6 +402,7 @@ BOOL DropTarget::performDragOperation(id sender)
sal_uInt64 tmp = 0;
pNSView >>= tmp;
mView = (id)tmp;
+ mpFrame = [(SalFrameView*)mView getSalFrame];
mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this];
@@ -415,14 +422,14 @@ BOOL DropTarget::performDragOperation(id sender)
}
- void SAL_CALL DropTarget::addDropTargetListener(const Reference<XDropTargetListener>& dtl)
+ void SAL_CALL DropTarget::addDropTargetListener(const uno::Reference<XDropTargetListener>& dtl)
throw(RuntimeException)
{
rBHelper.addListener(::getCppuType(&dtl), dtl);
}
- void SAL_CALL DropTarget::removeDropTargetListener(const Reference<XDropTargetListener>& dtl)
+ void SAL_CALL DropTarget::removeDropTargetListener(const uno::Reference<XDropTargetListener>& dtl)
throw(RuntimeException)
{
rBHelper.removeListener(::getCppuType(&dtl), dtl);
@@ -486,7 +493,7 @@ BOOL DropTarget::performDragOperation(id sender)
{
// Reset the internal transferable used as shortcut in case this is
// an internal D&D operation
- DragSource::g_XTransferable = Reference<XTransferable>();
+ DragSource::g_XTransferable = uno::Reference<XTransferable>();
DragSource::g_DropSuccessSet = true;
DragSource::g_DropSuccess = success;
}
@@ -494,13 +501,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_drop( const DropTargetDropEvent& dte)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->drop( dte); }
catch(RuntimeException&) {}
@@ -511,13 +518,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragEnter(const DropTargetDragEnterEvent& e)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dragEnter( e); }
catch (RuntimeException&) {}
@@ -528,14 +535,14 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragExit(const DropTargetEvent& dte)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dragExit( dte); }
catch (RuntimeException&) {}
@@ -546,13 +553,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragOver(const DropTargetDragEvent& dtde)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer );
while( iter.hasMoreElements())
{
- Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dragOver( dtde); }
catch (RuntimeException&) {}
@@ -563,13 +570,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dropActionChanged(const DropTargetDragEvent& dtde)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dropActionChanged( dtde); }
catch (RuntimeException&) {}
diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx
index 231df7fd5157..77e2a08c5de7 100644
--- a/vcl/aqua/source/dtrans/DropTarget.hxx
+++ b/vcl/aqua/source/dtrans/DropTarget.hxx
@@ -51,6 +51,7 @@
#include <postmac.h>
class DropTarget;
+class AquaSalFrame;
/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
@@ -159,6 +160,7 @@ private:
com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboard > mXCurrentDragClipboard;
DataFlavorMapperPtr_t mDataFlavorMapper;
id mView;
+ AquaSalFrame* mpFrame;
DropTargetHelper* mDropTargetHelper;
bool mbActive;
sal_Int8 mDragSourceSupportedActions;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 783d203c76fd..ba8751307c70 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -398,6 +398,11 @@ static AquaSalFrame* getMouseContainerFrame()
return self;
}
+-(AquaSalFrame*)getSalFrame
+{
+ return mpFrame;
+}
+
-(void)resetCursorRects
{
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx
index 14fd58296b0d..c143e49002fa 100644
--- a/vcl/inc/vcl/cursor.hxx
+++ b/vcl/inc/vcl/cursor.hxx
@@ -64,15 +64,13 @@ private:
sal_Bool mbVisible; // Ist Cursor sichtbar
unsigned char mnDirection; // indicates direction
-//#if 0 // _SOLAR__PRIVATE
public:
SAL_DLLPRIVATE void ImplDraw();
SAL_DLLPRIVATE void ImplRestore();
DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* );
- SAL_DLLPRIVATE void ImplShow( sal_Bool bDrawDirect = sal_True );
- SAL_DLLPRIVATE void ImplHide();
+ SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true, bool bRestore = false );
+ SAL_DLLPRIVATE bool ImplHide();
SAL_DLLPRIVATE void ImplNew();
-//#endif
public:
Cursor();
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 670d6dad0ada..793d12a0e93e 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2069,8 +2069,6 @@ void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
mnTop = nTop;
Scroll( 0, nDiff );
Update();
- maFocusRect.Top() += nDiff;
- maFocusRect.Bottom() += nDiff;
if( HasFocus() )
ImplShowFocusRect();
maScrollHdl.Call( this );
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index ff3c9a20ef06..8321e56443f3 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -299,13 +299,16 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
// Zur Zeit haben wir noch kein neues FileFormat
// if ( rIStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
- sal_uInt16 nLen;
- sal_uInt16 nSystem;
sal_Size nFirstPos = rIStream.Tell();
+
+ sal_uInt16 nLen = 0;
rIStream >> nLen;
if ( !nLen )
return rIStream;
+
+ sal_uInt16 nSystem = 0;
rIStream >> nSystem;
+
char* pTempBuf = new char[nLen];
rIStream.Read( pTempBuf, nLen - sizeof( nLen ) - sizeof( nSystem ) );
if ( nLen >= sizeof(ImplOldJobSetupData)+4 )
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 34276fafdfe5..c917ea8aa718 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -344,15 +344,19 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
if( ! pController->getPrinter() )
{
rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() );
+ bool bSetJobSetup = true;
if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() )
{
// get printer name from configuration
SettingsConfigItem* pItem = SettingsConfigItem::get();
aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) );
+ bSetJobSetup = false;
}
boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) );
+ if( bSetJobSetup )
+ pPrinter->SetJobSetup( i_rInitSetup );
pController->setPrinter( pPrinter );
}
@@ -399,17 +403,25 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
{
if( nContent == 0 )
{
- sal_Int32 nPages = i_pController->getPageCount();
- if( nPages > 0 )
+ // do not overwrite PageRange if it is already set
+ beans::PropertyValue* pRangeVal = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) );
+ rtl::OUString aRange;
+ if( pRangeVal )
+ pRangeVal->Value >>= aRange;
+ if( aRange.getLength() == 0 )
{
- rtl::OUStringBuffer aBuf( 32 );
- aBuf.appendAscii( "1" );
- if( nPages > 1 )
+ sal_Int32 nPages = i_pController->getPageCount();
+ if( nPages > 0 )
{
- aBuf.appendAscii( "-" );
- aBuf.append( nPages );
+ rtl::OUStringBuffer aBuf( 32 );
+ aBuf.appendAscii( "1" );
+ if( nPages > 1 )
+ {
+ aBuf.appendAscii( "-" );
+ aBuf.append( nPages );
+ }
+ i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) );
}
- i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) );
}
}
}
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 3be6fad02366..c59978077412 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -171,7 +171,7 @@ void Cursor::ImplRestore()
// -----------------------------------------------------------------------
-void Cursor::ImplShow( sal_Bool bDrawDirect )
+void Cursor::ImplShow( bool bDrawDirect, bool bRestore )
{
if ( mbVisible )
{
@@ -199,10 +199,10 @@ void Cursor::ImplShow( sal_Bool bDrawDirect )
mpData->mpWindow = pWindow;
mpData->mnStyle = mnStyle;
- if ( bDrawDirect )
+ if ( bDrawDirect || bRestore )
ImplDraw();
- if ( !mpWindow )
+ if ( !mpWindow && ! ( ! bDrawDirect && mpData->maTimer.IsActive()) )
{
mpData->maTimer.SetTimeout( pWindow->GetSettings().GetStyleSettings().GetCursorBlinkTime() );
if ( mpData->maTimer.GetTimeout() != STYLE_CURSOR_NOBLINKTIME )
@@ -216,16 +216,16 @@ void Cursor::ImplShow( sal_Bool bDrawDirect )
// -----------------------------------------------------------------------
-void Cursor::ImplHide()
+bool Cursor::ImplHide()
{
+ bool bWasCurVisible = false;
if ( mpData && mpData->mpWindow )
{
+ bWasCurVisible = mpData->mbCurVisible;
if ( mpData->mbCurVisible )
ImplRestore();
-
- mpData->maTimer.Stop();
- mpData->mpWindow = NULL;
}
+ return bWasCurVisible;
}
// -----------------------------------------------------------------------
@@ -329,6 +329,12 @@ void Cursor::Hide()
{
mbVisible = sal_False;
ImplHide();
+
+ if( mpData )
+ {
+ mpData->maTimer.Stop();
+ mpData->mpWindow = NULL;
+ }
}
}
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 5569759a3fff..98e93e748737 100644..100755
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1061,6 +1061,13 @@ void PrintDialog::readFromSettings()
}
}
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
+
+ // persistent window state
+ rtl::OUString aWinState( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ) ) );
+ if( aWinState.getLength() )
+ SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) );
+
if( maOptionsPage.maToFileBox.IsChecked() )
{
maPController->resetPrinterOptions( true );
@@ -1083,6 +1090,10 @@ void PrintDialog::storeToSettings()
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ),
maTabCtrl.GetPageText( maTabCtrl.GetCurPageId() ) );
+ pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ),
+ rtl::OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 )
+ );
pItem->Commit();
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6ddb10c92cd7..96e787928772 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2405,8 +2405,9 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
mpWindowImpl->mnPaintFlags = 0;
if ( !mpWindowImpl->maInvalidateRegion.IsEmpty() )
{
+ bool bRestoreCursor = false;
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplHide();
+ bRestoreCursor = mpWindowImpl->mpCursor->ImplHide();
mbInitClipRegion = sal_True;
mpWindowImpl->mbInPaint = sal_True;
@@ -2453,7 +2454,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
mbInitClipRegion = sal_True;
mpWindowImpl->mpPaintRegion = NULL;
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( sal_False );
+ mpWindowImpl->mpCursor->ImplShow( false, bRestoreCursor );
}
}
else
@@ -3042,7 +3043,7 @@ void Window::ImplScroll( const Rectangle& rRect,
Update();
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( sal_False );
+ mpWindowImpl->mpCursor->ImplShow( false );
}
// -----------------------------------------------------------------------
diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index 99871edadae3..dcf1db32068e 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -51,4 +51,4 @@ void KDEData::initNWF()
void KDEData::deInitNWF()
{
-} \ No newline at end of file
+}
diff --git a/vcl/unx/kde4/KDEData.hxx b/vcl/unx/kde4/KDEData.hxx
index 7cf5836c9688..6daa0c81a4fb 100644
--- a/vcl/unx/kde4/KDEData.hxx
+++ b/vcl/unx/kde4/KDEData.hxx
@@ -39,4 +39,4 @@ class KDEData : public X11SalData
virtual void Init();
virtual void initNWF();
virtual void deInitNWF();
-}; \ No newline at end of file
+};
diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
index d67399528a7c..41fa9fedde3f 100644
--- a/vcl/unx/kde4/KDESalDisplay.cxx
+++ b/vcl/unx/kde4/KDESalDisplay.cxx
@@ -42,4 +42,4 @@ SalKDEDisplay::~SalKDEDisplay()
doDestruct();
// prevent SalDisplay from closing KApplication's display
pDisp_ = NULL;
-} \ No newline at end of file
+}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 0c8f04f9fe41..abd1dc993f9e 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -56,12 +56,12 @@
#include <stdio.h>
#endif
-KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nState ) :
X11SalFrame( pParent, nState )
{
}
-void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
{
@@ -86,12 +86,14 @@ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey )
return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() );
}
+#if 0
/** Helper function to read color from KConfig configuration repository.
*/
static Color readColor( KConfigGroup *pGroup, const char *pKey )
{
return toColor( pGroup->readEntry( pKey, QColor(Qt::white) ) );
}
+#endif
/** Helper function to add information to Font from QFont.
@@ -179,7 +181,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
StyleSettings style( rSettings.GetStyleSettings() );
- BOOL bSetTitleFont = false;
+ bool bSetTitleFont = false;
// General settings
QPalette pal = kapp->palette();
@@ -272,9 +274,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = style.GetLightColor();
style.
- SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ SetCheckedColor( Color( (sal_uInt8)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
) );
}
@@ -402,4 +404,4 @@ SalGraphics* KDESalFrame::GetGraphics()
}
return NULL;
-} \ No newline at end of file
+}
diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx
index 643be72c27f3..6ea6f6ef283e 100644
--- a/vcl/unx/kde4/KDESalFrame.hxx
+++ b/vcl/unx/kde4/KDESalFrame.hxx
@@ -47,12 +47,12 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, ULONG nStyle );
+ KDESalFrame( SalFrame* pParent, sal_uLong nStyle );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Show( BOOL bVisible, BOOL bNoActivate );
-}; \ No newline at end of file
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate );
+};
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 5a5cd11c52d9..9b37bf5e8e2a 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -100,7 +100,7 @@ KDESalGraphics::~KDESalGraphics()
delete m_image;
}
-BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
+sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
{
if (type == CTRL_PUSHBUTTON) return true;
@@ -154,9 +154,9 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
return false;
}
-BOOL KDESalGraphics::hitTestNativeControl( ControlType, ControlPart,
+sal_Bool KDESalGraphics::hitTestNativeControl( ControlType, ControlPart,
const Rectangle&, const Point&,
- BOOL& )
+ sal_Bool& )
{
return FALSE;
}
@@ -232,7 +232,7 @@ namespace
}
}
-BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
+sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& value,
const OUString& )
@@ -243,7 +243,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
return false;
}
- BOOL returnVal = true;
+ sal_Bool returnVal = true;
QRect widgetRect = region2QRect(rControlRegion);
if( type == CTRL_SPINBOX && part == PART_ALL_BUTTONS )
@@ -562,8 +562,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{
if( pTempClipRegion )
{
- if( pClipRegion_ )
- XIntersectRegion( pTempClipRegion, pClipRegion_, pTempClipRegion );
+ if( mpClipRegion )
+ XIntersectRegion( pTempClipRegion, mpClipRegion, pTempClipRegion );
XSetRegion( GetXDisplay(), gc, pTempClipRegion );
}
QPixmap pixmap = QPixmap::fromImage(*m_image, Qt::ColorOnly | Qt::OrderedDither | Qt::OrderedAlphaDither);
@@ -574,8 +574,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
if( pTempClipRegion )
{
- if( pClipRegion_ )
- XSetRegion( GetXDisplay(), gc, pClipRegion_ );
+ if( mpClipRegion )
+ XSetRegion( GetXDisplay(), gc, mpClipRegion );
else
XSetClipMask( GetXDisplay(), gc, None );
}
@@ -589,7 +589,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
return returnVal;
}
-BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
+sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
const Rectangle& controlRegion, ControlState controlState,
const ImplControlValue& val,
const OUString&,
@@ -769,7 +769,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
if( part == PART_BORDER )
{
int nFrameWidth = getFrameWidth();
- USHORT nStyle = val.getNumericVal();
+ sal_uInt16 nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
{
// in this case the question is: how thick would a frame be
diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx
index 0bce1700f1fc..92b9a6b676a0 100644
--- a/vcl/unx/kde4/KDESalGraphics.hxx
+++ b/vcl/unx/kde4/KDESalGraphics.hxx
@@ -50,16 +50,16 @@ class KDESalGraphics : public X11SalGraphics
@param part Specification of the widget's part if it consists of more than one.
@return true if the platform supports native drawing of the widget type defined by part.
*/
- virtual BOOL IsNativeControlSupported( ControlType type, ControlPart part );
+ virtual sal_Bool IsNativeControlSupported( ControlType type, ControlPart part );
/** Test whether the position is in the native widget.
If the return value is TRUE, bIsInside contains information whether
aPos was or was not inside the native widget specified by the
type/part combination.
*/
- virtual BOOL hitTestNativeControl( ControlType type, ControlPart part,
+ virtual sal_Bool hitTestNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, const Point& aPos,
- BOOL& rIsInside );
+ sal_Bool& rIsInside );
/** Draw the requested control described by part/nControlState.
@param rControlRegion
@@ -71,7 +71,7 @@ class KDESalGraphics : public X11SalGraphics
@param aCaption
A caption or title string (like button text etc.)
*/
- virtual BOOL drawNativeControl( ControlType type, ControlPart part,
+ virtual sal_Bool drawNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption );
@@ -84,7 +84,7 @@ class KDESalGraphics : public X11SalGraphics
@param aValue An optional value (tristate/numerical/string)
@param aCaption A caption or title string (like button text etc.)
*/
- virtual BOOL drawNativeControlText( ControlType, ControlPart,
+ virtual sal_Bool drawNativeControlText( ControlType, ControlPart,
const Rectangle&, ControlState,
const ImplControlValue&,
const rtl::OUString& ) { return false; }
@@ -105,9 +105,9 @@ class KDESalGraphics : public X11SalGraphics
@param aCaption
A caption or title string (like button text etc.)
*/
- virtual BOOL getNativeControlRegion( ControlType type, ControlPart part,
+ virtual sal_Bool getNativeControlRegion( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
-}; \ No newline at end of file
+};
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index 01c4723bd530..c8d0858279f3 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -29,7 +29,7 @@
#include "KDESalFrame.hxx"
-SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
+SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState )
{
return new KDESalFrame( pParent, nState );
-} \ No newline at end of file
+}
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index 7d050fe6819e..91907e586b0c 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -37,5 +37,5 @@ class KDESalInstance : public X11SalInstance
public:
KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
-}; \ No newline at end of file
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+};
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 6a2793b8abe3..3fb2bcaf487d 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -102,7 +102,7 @@ void KDEXLib::Init()
//kAboutData->setProgramIconName("OpenOffice");
m_nFakeCmdLineArgs = 1;
- USHORT nIdx;
+ int nIdx;
vos::OExtCommandLine aCommandLine;
int nParams = aCommandLine.getCommandArgCount();
rtl::OString aDisplay;
diff --git a/vcl/unx/kde4/VCLKDEApplication.cxx b/vcl/unx/kde4/VCLKDEApplication.cxx
index 2cfb071e96ae..5e3a85256313 100644
--- a/vcl/unx/kde4/VCLKDEApplication.cxx
+++ b/vcl/unx/kde4/VCLKDEApplication.cxx
@@ -49,4 +49,4 @@ bool VCLKDEApplication::x11EventFilter(XEvent* event)
}
return false;
-} \ No newline at end of file
+}
diff --git a/vcl/unx/kde4/VCLKDEApplication.hxx b/vcl/unx/kde4/VCLKDEApplication.hxx
index 2edfddd69a9c..7cbbe38b61df 100644
--- a/vcl/unx/kde4/VCLKDEApplication.hxx
+++ b/vcl/unx/kde4/VCLKDEApplication.hxx
@@ -50,4 +50,4 @@ class VCLKDEApplication : public KApplication
virtual bool x11EventFilter(XEvent* event);
SalKDEDisplay* disp;
-}; \ No newline at end of file
+};
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 62bdb4403c1f..73d93d42dd03 100755
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -541,7 +541,9 @@ void ImplSalInitGraphics( WinSalGraphics* pData )
void ImplSalDeInitGraphics( WinSalGraphics* pData )
{
- // Default Objekte selektieren
+ // clear clip region
+ SelectClipRgn( pData->mhDC, 0 );
+ // select default objects
if ( pData->mhDefPen )
SelectPen( pData->mhDC, pData->mhDefPen );
if ( pData->mhDefBrush )
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 50e0447d4a9d..32b4d322bba2 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -117,8 +117,8 @@ sal_Char __READONLY_DATA sXML_1_2[] = "1.2";
const sal_Char *sOpenOfficeOrgProject ="OpenOffice.org_project";
-const sal_Char s_grddl_xsl[] =
- "http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl";
+// #i115030#: the XSLT is not finished, and not available via HTTP
+const sal_Char s_grddl_xsl[] = "http://FIXME";
#define LOGFILE_AUTHOR "mb93740"
@@ -1315,7 +1315,7 @@ void SvXMLExport::SetBodyAttributes()
}
static void
-lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
+lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 /*nExportMode*/)
{
// check version >= 1.2
switch (rExport.getDefaultVersion()) {
@@ -1324,11 +1324,14 @@ lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
default: break;
}
+ // #i115030#: disabled
+#if 0
if (EXPORT_SETTINGS != nExportMode) // meta, content, styles
{
rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
OUString::createFromAscii(s_grddl_xsl) );
}
+#endif
}
sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index d4e880f09b52..59849df1a20e 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -298,15 +298,25 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
sTmp.append( nLevel + 1 );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() );
// #i110694#: no style-name on list-level-style-image
- if ((sTextStyleName.getLength() > 0) && (NumberingType::BITMAP != eType))
+ // #i116149#: neither prefix/suffix
+ if (NumberingType::BITMAP != eType)
{
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- GetExport().EncodeStyleName( sTextStyleName ) );
+ if (sTextStyleName.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
+ GetExport().EncodeStyleName( sTextStyleName ) );
+ }
+ if (sPrefix.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX,
+ sPrefix );
+ }
+ if (sSuffix.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX,
+ sSuffix );
+ }
}
- if( sPrefix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sPrefix );
- if( sSuffix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sSuffix );
enum XMLTokenEnum eElem = XML_LIST_LEVEL_STYLE_NUMBER;
if( NumberingType::CHAR_SPECIAL == eType )
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 0d45fdc289d0..1417f239082a 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -501,6 +501,22 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties(
nCount++;
}
+ if (bBullet && sSuffix.getLength())
+ {
+ sal_uInt16 const nVersion(GetImport().getGeneratorVersion());
+ sal_Int32 nUPD;
+ sal_Int32 nBuildId;
+ if (GetImport().getBuildIds(nUPD, nBuildId)
+ && ( (SvXMLImport::OOo_1x == nVersion)
+ || (SvXMLImport::OOo_2x == nVersion)
+ || (310 == nUPD) || (320 == nUPD) || (330 == nUPD)
+ || ((300 == nUPD) && (nBuildId <= 9573))))
+ {
+ // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars
+ sSuffix = ::rtl::OUString(); // clear it
+ }
+ }
+
Sequence<beans::PropertyValue> aPropSeq( nCount );
if( nCount > 0 )
{
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index dcef23ba5734..eab3c77efc7f 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -221,6 +221,9 @@ void XMLAutoTextEventExport::addNamespaces()
GetAttrList().AddAttribute(
GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_OOO ),
GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_OOO ) );
+ GetAttrList().AddAttribute(
+ GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_XLINK ),
+ GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_XLINK ) );
}
void XMLAutoTextEventExport::exportEvents()
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 3a26fe37c794..9c3d50d6f9ed 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -1039,7 +1039,8 @@ sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML(
{
rValue >>= rStrExpValue;
- return sal_True;
+ // #i114107# attribute of type "character": export only if length is 1
+ return (1 == rStrExpValue.getLength()) ? sal_True : sal_False;
}
XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx b/xmloff/source/transform/PropertyActionsOOo.cxx
index bc91561de206..e0b9259787eb 100644
--- a/xmloff/source/transform/PropertyActionsOOo.cxx
+++ b/xmloff/source/transform/PropertyActionsOOo.cxx
@@ -649,6 +649,8 @@ XMLTransformerActionInit aTextPropertyOOoAttrActionTable[] =
NO_PARAMS }, /* #i113645# */
{ XML_NAMESPACE_STYLE, XML_TEXT_OVERLINE_COLOR, XML_ATACTION_REMOVE,
NO_PARAMS }, /* #i113645# */
+ { XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_ATACTION_REMOVE,
+ NO_PARAMS }, /* #i116555# */
{ XML_NAMESPACE_OFFICE, XML_TOKEN_INVALID, XML_ATACTION_EOT, NO_PARAMS }
};
diff --git a/xpdf/makefile.mk b/xpdf/makefile.mk
index c3dea0f006d5..191eefd50e2b 100644
--- a/xpdf/makefile.mk
+++ b/xpdf/makefile.mk
@@ -48,7 +48,7 @@ dummy:
TARFILE_NAME=xpdf-3.02
TARFILE_MD5=599dc4cc65a07ee868cf92a667a913d2
-PATCH_FILES=$(TARFILE_NAME).patch
+PATCH_FILES=$(TARFILE_NAME).patch xpdf-3.02-ooopwd.patch
CONFIGURE_DIR=
BUILD_DIR=$(CONFIGURE_DIR)
diff --git a/xpdf/xpdf-3.02-ooopwd.patch b/xpdf/xpdf-3.02-ooopwd.patch
new file mode 100644
index 000000000000..f773585b3f91
--- /dev/null
+++ b/xpdf/xpdf-3.02-ooopwd.patch
@@ -0,0 +1,101 @@
+--- misc/xpdf-3.02/xpdf/SecurityHandler.cc 2007-02-27 23:05:52.000000000 +0100
++++ misc/build/xpdf-3.02/xpdf/SecurityHandler.cc 2011-02-03 16:41:49.000000000 +0100
+@@ -40,7 +40,7 @@
+
+ encryptDictA->dictLookup("Filter", &filterObj);
+ if (filterObj.isName("Standard")) {
+- secHdlr = new StandardSecurityHandler(docA, encryptDictA);
++ secHdlr = new OOoImportSecurityhandler(docA, encryptDictA);
+ } else if (filterObj.isName()) {
+ #ifdef ENABLE_PLUGINS
+ if ((xsh = globalParams->getSecurityHandler(filterObj.getName()))) {
+@@ -310,6 +310,60 @@
+ return gTrue;
+ }
+
++//------------------------------------------------------------------------
++// OOoImportSecurityhandler
++//------------------------------------------------------------------------
++
++OOoImportSecurityhandler::~OOoImportSecurityhandler()
++{
++}
++
++inline Guchar toNum( Guchar digit )
++{
++ return (digit >= '0') && digit <= '9'
++ ? digit - '0'
++ : (digit >= 'A' && digit <= 'F')
++ ? digit - 'A' + 10
++ : (digit >= 'a' && digit <= 'f')
++ ? digit - 'a' + 10
++ : Guchar(0xff);
++}
++
++GBool OOoImportSecurityhandler::authorize(void* authData)
++{
++ if( !ok )
++ return gFalse;
++ if( authData )
++ {
++ GString* ownerPassword = ((StandardAuthData *)authData)->ownerPassword;
++ if( ownerPassword )
++ {
++ const char* pStr = ownerPassword->getCString();
++ if( strncmp( pStr, "_OOO_pdfi_Credentials_", 22 ) == 0 )
++ {
++ // a hex encoded byte sequence should follow until end of string
++ // the length must match fileKeyLength
++ // if this is the case we can assume that the password checked out
++ // and the file key is valid
++ // max len is 16 (the size of the fileKey array)
++ pStr += 22;
++ size_t i = 0;
++ while( pStr[0] && pStr[1] && i < sizeof( fileKey ) )
++ {
++ fileKey[i++] = (toNum( *pStr++ ) << 4)
++ | (toNum( *pStr++ ));
++ }
++ if( i == size_t(fileKeyLength) )
++ {
++ ownerPasswordOk = gTrue;
++ return gTrue;
++ }
++ }
++ }
++ }
++ return StandardSecurityHandler::authorize( authData );
++}
++
+ #ifdef ENABLE_PLUGINS
+
+ //------------------------------------------------------------------------
+--- misc/xpdf-3.02/xpdf/SecurityHandler.h 2007-02-27 23:05:52.000000000 +0100
++++ misc/build/xpdf-3.02/xpdf/SecurityHandler.h 2011-02-03 16:26:17.000000000 +0100
+@@ -103,7 +103,7 @@
+ virtual int getEncVersion() { return encVersion; }
+ virtual CryptAlgorithm getEncAlgorithm() { return encAlgorithm; }
+
+-private:
++protected:
+
+ int permFlags;
+ GBool ownerPasswordOk;
+@@ -119,6 +119,17 @@
+ GBool ok;
+ };
+
++class OOoImportSecurityhandler : public StandardSecurityHandler
++{
++public:
++ OOoImportSecurityhandler( PDFDoc* docA, Object* encryptDictA )
++ : StandardSecurityHandler( docA, encryptDictA )
++ {}
++ virtual ~OOoImportSecurityhandler();
++
++ virtual GBool authorize(void* authData);
++};
++
+ #ifdef ENABLE_PLUGINS
+ //------------------------------------------------------------------------
+ // ExternalSecurityHandler