diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-02-15 14:04:40 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-02-15 14:04:40 +0100 |
commit | b118e8602aa34e14191fd7149b804f7ae77ad796 (patch) | |
tree | 6b9650411580e7c16c5bbf27e187227a6c1bd7ec /xmloff | |
parent | b9f58416bb6e0e5800d00122bf952bfb0bc36253 (diff) | |
parent | cd0d6a5a6775f197fdb7e78b54c8133074a7a236 (diff) |
chart51: merge with DEV300_m100
Diffstat (limited to 'xmloff')
187 files changed, 2535 insertions, 2559 deletions
diff --git a/xmloff/util/makefile.pmk b/xmloff/JunitTest_xmloff_unoapi.mk index faf070e2d5bc..8ac3a5aedfd3 100644..100755 --- a/xmloff/util/makefile.pmk +++ b/xmloff/JunitTest_xmloff_unoapi.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -25,6 +25,29 @@ # #************************************************************************* -# Reduction of exported symbols: -CDEFS += -DXMLOFF_DLLIMPLEMENTATION -VISIBILITY_HIDDEN=TRUE +$(eval $(call gb_JunitTest_JunitTest,xmloff_unoapi)) + +$(eval $(call gb_JunitTest_set_defs,xmloff_unoapi,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.sce=$(SRCDIR)/xmloff/qa/unoapi/xmloff.sce \ + -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/xmloff/qa/unoapi/knownissues.xcl \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/xmloff/qa/unoapi/testdocuments \ +)) + +$(eval $(call gb_JunitTest_add_jars,xmloff_unoapi,\ + $(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,xmloff_unoapi,\ + xmloff/qa/unoapi/Test \ +)) + +$(eval $(call gb_JunitTest_add_classes,xmloff_unoapi,\ + org.openoffice.xmloff.qa.unoapi.Test \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 2e335b4175c4..9576341f0ffb 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2009 by Sun Microsystems, Inc. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,12 +14,12 @@ # # 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 +# 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 +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # @@ -36,12 +36,10 @@ $(eval $(call gb_Library_add_precompiled_header,xo,$(SRCDIR)/xmloff/inc/pch/prec $(eval $(call gb_Library_set_include,xo,\ $$(SOLARINC) \ -I. \ - -I$(WORKDIR)/inc/ \ -I$(SRCDIR)/xmloff/inc \ -I$(SRCDIR)/xmloff/source/inc \ -I$(SRCDIR)/xmloff/inc/pch \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc \ )) $(eval $(call gb_Library_set_defs,xo,\ @@ -61,12 +59,14 @@ $(eval $(call gb_Library_add_linked_libs,xo,\ tl \ utl \ vos3 \ + $(gb_STDLIBS) \ )) $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/chart/ColorPropertySet \ xmloff/source/chart/PropertyMaps \ xmloff/source/chart/SchXMLAutoStylePoolP \ + xmloff/source/chart/SchXMLAxisContext \ xmloff/source/chart/SchXMLCalculationSettingsContext \ xmloff/source/chart/SchXMLChartContext \ xmloff/source/chart/SchXMLExport \ @@ -380,22 +380,4 @@ $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/xforms/xformsimport \ )) -ifeq ($(OS),LINUX) -$(eval $(call gb_Library_add_linked_libs,xo,\ - dl \ - icuuc \ - m \ - pthread \ -)) -endif - -ifeq ($(OS),WNT) -$(eval $(call gb_Library_add_linked_libs,xo,\ - kernel32 \ - msvcrt \ - oldnames \ - user32 \ - uwinapi \ -)) -endif # vim: set noet ts=4 sw=4: diff --git a/xmloff/Library_xof.mk b/xmloff/Library_xof.mk index 6880eb1a1fd9..455daadaf6e3 100644 --- a/xmloff/Library_xof.mk +++ b/xmloff/Library_xof.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2009 by Sun Microsystems, Inc. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,12 +14,12 @@ # # 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 +# 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 +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # @@ -33,9 +33,7 @@ $(eval $(call gb_Library_set_include,xof,\ -I$(SRCDIR)/xmloff/inc/pch \ -I$(SRCDIR)/xmloff/inc \ -I$(SRCDIR)/xmloff/source/inc \ - -I$(WORKDIR)/inc/ \ $$(INCLUDE) \ - -I$(OUTDIR)/inc \ -I$(OUTDIR)/inc/offuh \ )) @@ -47,6 +45,7 @@ $(eval $(call gb_Library_add_linked_libs,xof,\ salhelper \ stl \ xo \ + $(gb_STDLIBS) \ )) $(eval $(call gb_Library_add_exception_objects,xof,\ @@ -91,22 +90,4 @@ $(eval $(call gb_Library_add_exception_objects,xof,\ xmloff/source/transform/XMLFilterRegistration \ )) -ifeq ($(OS),LINUX) -$(eval $(call gb_Library_add_linked_libs,xof,\ - icuuc \ - dl \ - m \ - pthread \ -)) -endif - -ifeq ($(OS),WNT) -$(eval $(call gb_Library_add_linked_libs,xof,\ - kernel32 \ - msvcrt \ - oldnames \ - user32 \ - uwinapi \ -)) -endif # vim: set noet ts=4 sw=4: diff --git a/xmloff/Module_xmloff.mk b/xmloff/Module_xmloff.mk index eacc83068dad..74a1aa3aaa1e 100644 --- a/xmloff/Module_xmloff.mk +++ b/xmloff/Module_xmloff.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2009 by Sun Microsystems, Inc. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,12 +14,12 @@ # # 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 +# 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 +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # @@ -34,6 +34,10 @@ $(eval $(call gb_Module_add_targets,xmloff,\ Package_inc \ )) +$(eval $(call gb_Module_add_subsequentcheck_targets,xmloff,\ + JunitTest_xmloff_unoapi \ +)) + #todo: map file #todo: xmlkywd.lib - built, but never used?! diff --git a/xmloff/Package_dtd.mk b/xmloff/Package_dtd.mk index fbfbe4a1400d..7f2d5a4e0f1d 100644 --- a/xmloff/Package_dtd.mk +++ b/xmloff/Package_dtd.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2009 by Sun Microsystems, Inc. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,12 +14,12 @@ # # 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 +# 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 +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # diff --git a/xmloff/Package_inc.mk b/xmloff/Package_inc.mk index ca2d0abe62e2..4e11c2b4b5d9 100644 --- a/xmloff/Package_inc.mk +++ b/xmloff/Package_inc.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2009 by Sun Microsystems, Inc. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,12 +14,12 @@ # # 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 +# 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 +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # diff --git a/xmloff/inc/DomBuilderContext.hxx b/xmloff/inc/DomBuilderContext.hxx index ff01097288b6..219b1d1d6870 100644 --- a/xmloff/inc/DomBuilderContext.hxx +++ b/xmloff/inc/DomBuilderContext.hxx @@ -66,12 +66,12 @@ public: /** default constructor: create new DOM tree */ DomBuilderContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName ); /** constructor: create DOM subtree under the given node */ DomBuilderContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>& ); @@ -94,7 +94,7 @@ public: // virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx index 7168b2b811a8..936217fb8dc5 100644 --- a/xmloff/inc/SchXMLImport.hxx +++ b/xmloff/inc/SchXMLImport.hxx @@ -90,13 +90,6 @@ enum SchXMLSeriesElemTokenMap XML_TOK_SERIES_ERROR_INDICATOR }; -enum SchXMLAxisElemTokenMap -{ - XML_TOK_AXIS_TITLE, - XML_TOK_AXIS_CATEGORIES, - XML_TOK_AXIS_GRID -}; - // ---------------------------------------- enum SchXMLChartAttrMap @@ -134,13 +127,6 @@ enum SchXMLPlotAreaAttrTokenMap XML_TOK_PA_LIGHTING_MODE }; -enum SchXMLAxisAttrTokenMap -{ - XML_TOK_AXIS_DIMENSION, - XML_TOK_AXIS_NAME, - XML_TOK_AXIS_STYLE_NAME -}; - enum SchXMLLegendAttrMap { XML_TOK_LEGEND_POSITION, diff --git a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx index 505d4105fe10..c7858a96938e 100644 --- a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx +++ b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx @@ -52,14 +52,14 @@ public: // #100592# const ::rtl::OUString& GetFilterCLSID() const { return sCLSID; } - XMLEmbeddedObjectImportContext( SvXMLImport& rImport, USHORT nPrfx, + XMLEmbeddedObjectImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual ~XMLEmbeddedObjectImportContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx index d8d6d873d034..3a919dca7c31 100644 --- a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx +++ b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx @@ -92,7 +92,7 @@ public: /// for footnotes, also parse begin and end notices virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> & xAttrList ); diff --git a/xmloff/inc/XMLImageMapContext.hxx b/xmloff/inc/XMLImageMapContext.hxx index 562b78eb9710..fbb9a2a65099 100644 --- a/xmloff/inc/XMLImageMapContext.hxx +++ b/xmloff/inc/XMLImageMapContext.hxx @@ -65,7 +65,7 @@ public: virtual ~XMLImageMapContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/XMLNumberStylesImport.hxx b/xmloff/inc/XMLNumberStylesImport.hxx index bd946ca336c0..60c0ab0dda2d 100644 --- a/xmloff/inc/XMLNumberStylesImport.hxx +++ b/xmloff/inc/XMLNumberStylesImport.hxx @@ -69,7 +69,7 @@ public: virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); sal_Int32 GetDrawKey() const { return mnKey; } diff --git a/xmloff/inc/XMLShapePropertySetContext.hxx b/xmloff/inc/XMLShapePropertySetContext.hxx index a70035f56385..84d11060cd27 100644 --- a/xmloff/inc/XMLShapePropertySetContext.hxx +++ b/xmloff/inc/XMLShapePropertySetContext.hxx @@ -52,7 +52,7 @@ public: virtual void EndElement(); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, diff --git a/xmloff/inc/XMLStringBufferImportContext.hxx b/xmloff/inc/XMLStringBufferImportContext.hxx index c21c4316674d..6a43702f4e7e 100644 --- a/xmloff/inc/XMLStringBufferImportContext.hxx +++ b/xmloff/inc/XMLStringBufferImportContext.hxx @@ -57,7 +57,7 @@ public: virtual ~XMLStringBufferImportContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/animationimport.hxx b/xmloff/inc/animationimport.hxx index 9b4732e719b1..de7e4cfcc1fd 100644 --- a/xmloff/inc/animationimport.hxx +++ b/xmloff/inc/animationimport.hxx @@ -60,7 +60,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); static void postProcessRootNode( SvXMLImport& rImport, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPageProps ); diff --git a/xmloff/inc/animimp.hxx b/xmloff/inc/animimp.hxx index dd250407c84d..7e795e6021f8 100644 --- a/xmloff/inc/animimp.hxx +++ b/xmloff/inc/animimp.hxx @@ -49,7 +49,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual ~XMLAnimationsContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index b1eac43e0c81..22519c378f59 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -1383,7 +1383,7 @@ protected: ::com::sun::star::beans::XPropertySet> & xPropertySet); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -1479,7 +1479,7 @@ public: const ::rtl::OUString& sLocalName); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/xmloff/DocumentSettingsContext.hxx b/xmloff/inc/xmloff/DocumentSettingsContext.hxx index 249d5c39ba36..62eaedb0e89f 100644 --- a/xmloff/inc/xmloff/DocumentSettingsContext.hxx +++ b/xmloff/inc/xmloff/DocumentSettingsContext.hxx @@ -43,12 +43,12 @@ class XMLOFF_DLLPUBLIC XMLDocumentSettingsContext : public SvXMLImportContext ::std::auto_ptr< XMLDocumentSettingsContext_Data > m_pData; public: - XMLDocumentSettingsContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLDocumentSettingsContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual ~XMLDocumentSettingsContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx index 03fa8c8e16c0..a618d363137f 100644 --- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx +++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx @@ -80,11 +80,9 @@ private: SvXMLTokenMap* mpChartElemTokenMap; SvXMLTokenMap* mpPlotAreaElemTokenMap; SvXMLTokenMap* mpSeriesElemTokenMap; - SvXMLTokenMap* mpAxisElemTokenMap; SvXMLTokenMap* mpChartAttrTokenMap; SvXMLTokenMap* mpPlotAreaAttrTokenMap; - SvXMLTokenMap* mpAxisAttrTokenMap; SvXMLTokenMap* mpLegendAttrTokenMap; SvXMLTokenMap* mpAutoStyleAttrTokenMap; SvXMLTokenMap* mpCellAttrTokenMap; @@ -123,11 +121,9 @@ public: const SvXMLTokenMap& GetChartElemTokenMap(); const SvXMLTokenMap& GetPlotAreaElemTokenMap(); const SvXMLTokenMap& GetSeriesElemTokenMap(); - const SvXMLTokenMap& GetAxisElemTokenMap(); const SvXMLTokenMap& GetChartAttrTokenMap(); const SvXMLTokenMap& GetPlotAreaAttrTokenMap(); - const SvXMLTokenMap& GetAxisAttrTokenMap(); const SvXMLTokenMap& GetLegendAttrTokenMap(); const SvXMLTokenMap& GetAutoStyleAttrTokenMap(); const SvXMLTokenMap& GetCellAttrTokenMap(); @@ -136,9 +132,9 @@ public: static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; } - /** @param bPushLastChartType If </FALSE>, in case a new chart type has to + /** @param bPushLastChartType If </sal_False>, in case a new chart type has to be added (because it does not exist yet), it is appended at the - end of the chart-type container. When </TRUE>, a new chart type + end of the chart-type container. When </sal_True>, a new chart type is added at one position before the last one, i.e. the formerly last chart type is pushed back, so that it remains the last one. diff --git a/xmloff/inc/xmloff/VisAreaContext.hxx b/xmloff/inc/xmloff/VisAreaContext.hxx index 3aa7cabd4a22..80a0e8c75659 100644 --- a/xmloff/inc/xmloff/VisAreaContext.hxx +++ b/xmloff/inc/xmloff/VisAreaContext.hxx @@ -41,19 +41,19 @@ class XMLVisAreaContext : public SvXMLImportContext { public: // read all attributes and set the values in rRect - XMLVisAreaContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLVisAreaContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, Rectangle& rRect, const MapUnit aMapUnit); - XMLVisAreaContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLVisAreaContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, ::com::sun::star::awt::Rectangle& rRect, const sal_Int16 nMeasureUnit); virtual ~XMLVisAreaContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/inc/xmloff/XMLBase64ImportContext.hxx b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx index b2e5a4d1913b..e938edcebea8 100644 --- a/xmloff/inc/xmloff/XMLBase64ImportContext.hxx +++ b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx @@ -45,7 +45,7 @@ class XMLOFF_DLLPUBLIC XMLBase64ImportContext : public SvXMLImportContext public: TYPEINFO(); - XMLBase64ImportContext( SvXMLImport& rImport, USHORT nPrfx, + XMLBase64ImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, diff --git a/xmloff/inc/xmloff/formlayerexport.hxx b/xmloff/inc/xmloff/formlayerexport.hxx index c9325139474f..476b2f9d8272 100644 --- a/xmloff/inc/xmloff/formlayerexport.hxx +++ b/xmloff/inc/xmloff/formlayerexport.hxx @@ -165,9 +165,6 @@ namespace xmloff */ bool documentContainsXForms() const; - /// retrieves the property mapper for control styles - ::vos::ORef< SvXMLExportPropertyMapper > getStylePropertyMapper(); - /** exports the controls number styles */ void exportControlNumberStyles(); diff --git a/xmloff/inc/xmloff/formlayerimport.hxx b/xmloff/inc/xmloff/formlayerimport.hxx index 36a2a87a7ad3..37aa8e440444 100644 --- a/xmloff/inc/xmloff/formlayerimport.hxx +++ b/xmloff/inc/xmloff/formlayerimport.hxx @@ -62,11 +62,6 @@ namespace xmloff OFormLayerXMLImport(SvXMLImport& _rImporter); ~OFormLayerXMLImport(); - /** retrieves the property mapper form form related auto styles. - */ - ::vos::ORef< SvXMLImportPropertyMapper > - getStylePropertyMapper() const; - /** start importing the forms of the given page <p>starting the import of a new page (by using this method) invalidates the current page position diff --git a/xmloff/inc/xmloff/formsimp.hxx b/xmloff/inc/xmloff/formsimp.hxx index 86e62015294f..c2bbdc97a98f 100644 --- a/xmloff/inc/xmloff/formsimp.hxx +++ b/xmloff/inc/xmloff/formsimp.hxx @@ -41,7 +41,7 @@ public: XMLFormsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName); virtual ~XMLFormsContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/inc/xmloff/i18nmap.hxx b/xmloff/inc/xmloff/i18nmap.hxx index 643b1d3a88f6..331c8bc5a758 100644 --- a/xmloff/inc/xmloff/i18nmap.hxx +++ b/xmloff/inc/xmloff/i18nmap.hxx @@ -46,7 +46,7 @@ class XMLOFF_DLLPUBLIC SvI18NMap { SvI18NMap_Impl *pImpl; - SAL_DLLPRIVATE SvI18NMapEntry_Impl *_Find( USHORT nKind, + SAL_DLLPRIVATE SvI18NMapEntry_Impl *_Find( sal_uInt16 nKind, const ::rtl::OUString& rName ) const; public: @@ -55,12 +55,12 @@ public: ~SvI18NMap(); // Add a name mapping - void Add( USHORT nKind, const ::rtl::OUString& rName, + void Add( sal_uInt16 nKind, const ::rtl::OUString& rName, const ::rtl::OUString& rNewName ); // Return a mapped name. If the name could not be found, return the // original name. - const ::rtl::OUString& Get( USHORT nKind, + const ::rtl::OUString& Get( sal_uInt16 nKind, const ::rtl::OUString& rName ) const; }; diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx index f51f46a95e4d..4e97c24e720f 100644 --- a/xmloff/inc/xmloff/shapeimport.hxx +++ b/xmloff/inc/xmloff/shapeimport.hxx @@ -189,8 +189,8 @@ class SdXML3DLightContext: public SvXMLImportContext // local parameters which need to be read Color maDiffuseColor; ::basegfx::B3DVector maDirection; - BOOL mbEnabled; - BOOL mbSpecular; + sal_Bool mbEnabled; + sal_Bool mbSpecular; public: SdXML3DLightContext( @@ -202,8 +202,8 @@ public: const Color& GetDiffuseColor() { return maDiffuseColor; } const ::basegfx::B3DVector& GetDirection() { return maDirection; } - BOOL GetEnabled() { return mbEnabled; } - BOOL GetSpecular() { return mbSpecular; } + sal_Bool GetEnabled() { return mbEnabled; } + sal_Bool GetSpecular() { return mbSpecular; } }; ////////////////////////////////////////////////////////////////////////////// @@ -220,7 +220,7 @@ protected: // local parameters which need to be read com::sun::star::drawing::HomogenMatrix mxHomMat; - BOOL mbSetTransform; + sal_Bool mbSetTransform; com::sun::star::drawing::ProjectionMode mxPrjMode; sal_Int32 mnDistance; @@ -228,14 +228,14 @@ protected: sal_Int32 mnShadowSlant; com::sun::star::drawing::ShadeMode mxShadeMode; Color maAmbientColor; - BOOL mbLightingMode; + sal_Bool mbLightingMode; ::basegfx::B3DVector maVRP; ::basegfx::B3DVector maVPN; ::basegfx::B3DVector maVUP; - BOOL mbVRPUsed; - BOOL mbVPNUsed; - BOOL mbVUPUsed; + sal_Bool mbVRPUsed; + sal_Bool mbVPNUsed; + sal_Bool mbVUPUsed; public: SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ); @@ -261,7 +261,7 @@ protected: rtl::OUString msHyperlink; public: - SvXMLShapeContext( SvXMLImport& rImp, USHORT nPrfx, + SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {} TYPEINFO(); @@ -336,7 +336,7 @@ public: com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xFrameAttrList); SvXMLImportContext* CreateFrameChildContext( - SvXMLImportContext *pThisContext, USHORT nPrefix, const rtl::OUString& rLocalName, + SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); SvXMLShapeContext* Create3DSceneChildContext( diff --git a/xmloff/inc/xmloff/table/XMLTableImport.hxx b/xmloff/inc/xmloff/table/XMLTableImport.hxx index 412bfd05e848..42d3cb52b479 100644 --- a/xmloff/inc/xmloff/table/XMLTableImport.hxx +++ b/xmloff/inc/xmloff/table/XMLTableImport.hxx @@ -54,10 +54,10 @@ public: XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef ); virtual ~XMLTableImport(); - SvXMLImportContext* CreateTableContext( USHORT nPrfx, const ::rtl::OUString& rLName, + SvXMLImportContext* CreateTableContext( sal_uInt16 nPrfx, const ::rtl::OUString& rLName, ::com::sun::star::uno::Reference< ::com::sun::star::table::XColumnRowRange >& xColumnRowRange ); - SvXMLStyleContext* CreateTableTemplateContext( USHORT nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + SvXMLStyleContext* CreateTableTemplateContext( sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); rtl::Reference< SvXMLImportPropertyMapper > GetCellImportPropertySetMapper() const { return mxCellImportPropertySetMapper; } rtl::Reference< SvXMLImportPropertyMapper > GetRowImportPropertySetMapper() const { return mxRowImportPropertySetMapper; } diff --git a/xmloff/inc/xmloff/xformsimport.hxx b/xmloff/inc/xmloff/xformsimport.hxx index 8784ea55b58e..2626c07927d5 100644 --- a/xmloff/inc/xmloff/xformsimport.hxx +++ b/xmloff/inc/xmloff/xformsimport.hxx @@ -30,7 +30,7 @@ #include "sal/config.h" #include "xmloff/dllapi.h" -#include <tools/solar.h> // for USHORT +#include <tools/solar.h> // for sal_uInt16 #include <com/sun/star/uno/Reference.hxx> class SvXMLImport; @@ -51,7 +51,7 @@ namespace com { namespace sun { namespace star { /** create import context for xforms:model element. */ XMLOFF_DLLPUBLIC SvXMLImportContext* createXFormsModelContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName ); /** perform the actual binding of an XForms-binding with the suitable control diff --git a/xmloff/inc/xmloff/xmlcnimp.hxx b/xmloff/inc/xmloff/xmlcnimp.hxx index b3c27581690e..51d3cf3c8ff4 100644 --- a/xmloff/inc/xmloff/xmlcnimp.hxx +++ b/xmloff/inc/xmloff/xmlcnimp.hxx @@ -58,10 +58,10 @@ public: int operator ==( const SvXMLAttrContainerData& rCmp ) const; - BOOL AddAttr( const ::rtl::OUString& rLName, const rtl::OUString& rValue ); - BOOL AddAttr( const ::rtl::OUString& rPrefix, const rtl::OUString& rNamespace, + sal_Bool AddAttr( const ::rtl::OUString& rLName, const rtl::OUString& rValue ); + sal_Bool AddAttr( const ::rtl::OUString& rPrefix, const rtl::OUString& rNamespace, const ::rtl::OUString& rLName, const rtl::OUString& rValue ); - BOOL AddAttr( const ::rtl::OUString& rPrefix, + sal_Bool AddAttr( const ::rtl::OUString& rPrefix, const ::rtl::OUString& rLName, const ::rtl::OUString& rValue ); @@ -76,12 +76,12 @@ public: inline const ::rtl::OUString& GetNamespace( sal_uInt16 i ) const; inline const ::rtl::OUString& GetPrefix( sal_uInt16 i ) const; - BOOL SetAt( sal_uInt16 i, + sal_Bool SetAt( sal_uInt16 i, const ::rtl::OUString& rLName, const rtl::OUString& rValue ); - BOOL SetAt( sal_uInt16 i, + sal_Bool SetAt( sal_uInt16 i, const ::rtl::OUString& rPrefix, const rtl::OUString& rNamespace, const ::rtl::OUString& rLName, const rtl::OUString& rValue ); - BOOL SetAt( sal_uInt16 i, + sal_Bool SetAt( sal_uInt16 i, const ::rtl::OUString& rPrefix, const ::rtl::OUString& rLName, const ::rtl::OUString& rValue ); diff --git a/xmloff/inc/xmloff/xmlcnitm.hxx b/xmloff/inc/xmloff/xmlcnitm.hxx index 772ba1dd0fc4..9c0010d5df5b 100644 --- a/xmloff/inc/xmloff/xmlcnitm.hxx +++ b/xmloff/inc/xmloff/xmlcnitm.hxx @@ -61,8 +61,8 @@ public: virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem *Clone( SfxItemPool * = 0) const { return new SvXMLAttrContainerItem( *this ); } diff --git a/xmloff/inc/xmloff/xmlictxt.hxx b/xmloff/inc/xmloff/xmlictxt.hxx index bb8d58cf791c..9288645a0ad1 100644 --- a/xmloff/inc/xmloff/xmlictxt.hxx +++ b/xmloff/inc/xmloff/xmlictxt.hxx @@ -46,7 +46,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase SvXMLImport& mrImport; - USHORT mnPrefix; + sal_uInt16 mnPrefix; ::rtl::OUString maLocalName; SvXMLNamespaceMap *mpRewindMap; @@ -63,14 +63,14 @@ protected: public: TYPEINFO(); - USHORT GetPrefix() const { return mnPrefix; } + sal_uInt16 GetPrefix() const { return mnPrefix; } const ::rtl::OUString& GetLocalName() const { return maLocalName; } // A contexts constructor does anything that is required if an element // starts. Namespace processing has been done already. // Note that virtual methods cannot be used inside constructors. Use // StartElement instead if this is required. - SvXMLImportContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName ); // A contexts destructor does anything that is required if an element @@ -81,7 +81,7 @@ public: // Create a childs element context. By default, the import's // CreateContext method is called to create a new default context. - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx index 6343c4ee37dc..efdd1d3f024f 100644 --- a/xmloff/inc/xmloff/xmlmetai.hxx +++ b/xmloff/inc/xmloff/xmlmetai.hxx @@ -50,7 +50,7 @@ private: ::com::sun::star::xml::sax::XDocumentHandler> mxDocBuilder; public: - SvXMLMetaDocumentContext(SvXMLImport& rImport, USHORT nPrfx, + SvXMLMetaDocumentContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties>& xDocProps, @@ -59,7 +59,7 @@ public: virtual ~SvXMLMetaDocumentContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx index 8463037fa6d3..537e789cfea2 100644 --- a/xmloff/inc/xmloff/xmlnumfi.hxx +++ b/xmloff/inc/xmloff/xmlnumfi.hxx @@ -99,7 +99,7 @@ public: ~SvXMLNumFmtHelper(); SvXMLStyleContext* CreateChildContext( SvXMLImport& rImport, - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles); @@ -116,12 +116,12 @@ public: class SvXMLNumFmtDefaults { public: - static sal_Bool IsSystemLongDay( const SvtSysLocale& rSysLoc, BOOL bLong ); - static sal_Bool IsSystemLongMonth( const SvtSysLocale& rSysLoc, BOOL bLong ); - static sal_Bool IsSystemTextualMonth( const SvtSysLocale& rSysLoc, BOOL bLong ); - static sal_Bool IsSystemLongYear( const SvtSysLocale& rSysLoc, BOOL bLong ); - static sal_Bool IsSystemLongEra( const SvtSysLocale& rSysLoc, BOOL bLong ); - static sal_Bool IsSystemLongDayOfWeek( const SvtSysLocale& rSysLoc, BOOL bLong ); + static sal_Bool IsSystemLongDay( const SvtSysLocale& rSysLoc, sal_Bool bLong ); + static sal_Bool IsSystemLongMonth( const SvtSysLocale& rSysLoc, sal_Bool bLong ); + static sal_Bool IsSystemTextualMonth( const SvtSysLocale& rSysLoc, sal_Bool bLong ); + static sal_Bool IsSystemLongYear( const SvtSysLocale& rSysLoc, sal_Bool bLong ); + static sal_Bool IsSystemLongEra( const SvtSysLocale& rSysLoc, sal_Bool bLong ); + static sal_Bool IsSystemLongDayOfWeek( const SvtSysLocale& rSysLoc, sal_Bool bLong ); // return value is NfIndexTableOffset static sal_uInt16 GetDefaultDateFormat( SvXMLDateElementAttributes eDOW, @@ -177,13 +177,13 @@ class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext SAL_DLLPRIVATE sal_Int32 PrivateGetKey(); public: - SvXMLNumFormatContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFormatContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumImpData* pNewData, sal_uInt16 nNewType, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles ); - SvXMLNumFormatContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFormatContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, @@ -191,7 +191,7 @@ public: SvXMLStylesContext& rStyles ); virtual ~SvXMLNumFormatContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/inc/xmloff/xmlprcon.hxx b/xmloff/inc/xmloff/xmlprcon.hxx index 33ae4986e4d2..04da34bd4254 100644 --- a/xmloff/inc/xmloff/xmlprcon.hxx +++ b/xmloff/inc/xmloff/xmlprcon.hxx @@ -49,7 +49,7 @@ protected: public: SvXMLPropertySetContext( - SvXMLImport& rImport, USHORT nPrfx, + SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, sal_uInt32 nFamily, @@ -59,14 +59,14 @@ public: virtual ~SvXMLPropertySetContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); // This method is called from this instance implementation of // CreateChildContext if the element matches an entry in the // SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT_ITEM_IMPORT - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, diff --git a/xmloff/inc/xmloff/xmlstyle.hxx b/xmloff/inc/xmloff/xmlstyle.hxx index c26912c72870..9361e11eb8b4 100644 --- a/xmloff/inc/xmloff/xmlstyle.hxx +++ b/xmloff/inc/xmloff/xmlstyle.hxx @@ -127,10 +127,10 @@ public: sal_uInt16 GetFamily() const { return mnFamily; } - BOOL IsValid() const { return mbValid; } + sal_Bool IsValid() const { return mbValid; } void SetValid( sal_Bool b ) { mbValid = b; } - BOOL IsNew() const { return mbNew; } + sal_Bool IsNew() const { return mbNew; } void SetNew( sal_Bool b ) { mbNew = b; } // This method is called for every default style @@ -158,7 +158,7 @@ public: and Finish() will not be called. The default return value is false */ - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; class XMLOFF_DLLPUBLIC SvXMLStylesContext : public SvXMLImportContext @@ -243,7 +243,7 @@ public: const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily, const ::rtl::OUString& rName, - BOOL bCreateIndex=sal_False ) const; + sal_Bool bCreateIndex=sal_False ) const; virtual sal_uInt16 GetFamily( const ::rtl::OUString& rFamily ) const; virtual UniReference < SvXMLImportPropertyMapper > GetImportPropertyMapper( sal_uInt16 nFamily ) const; diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 291c99c7be21..ecadbbdc196f 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3113,6 +3113,14 @@ namespace xmloff { namespace token { XML_OUTSIDE_MINIMUM,//#i114142# XML_OUTSIDE_MAXIMUM,//#i114142# + XML_AXIS_TYPE, //#i25706# + XML_DATE_SCALE, + XML_BASE_TIME_UNIT, + XML_MAJOR_INTERVAL_VALUE, + XML_MINOR_INTERVAL_VALUE, + XML_MAJOR_INTERVAL_UNIT, + XML_MINOR_INTERVAL_UNIT, + XML_MIN_VALUE, XML_MAX_VALUE, diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx index 580a20b76a5c..ea8200d83a27 100644 --- a/xmloff/inc/xmloff/xmluconv.hxx +++ b/xmloff/inc/xmloff/xmluconv.hxx @@ -223,7 +223,7 @@ public: this method will either use the given default or return false if not default is set */ static sal_Bool convertEnum( ::rtl::OUStringBuffer& rBuffer, - USHORT nValue, + sal_uInt16 nValue, const SvXMLEnumStringMapEntry *pMap, sal_Char* pDefault = NULL ); @@ -258,18 +258,18 @@ public: /** convert double number to string (using ::rtl::math) and DO convert to export MapUnit */ void convertDouble(::rtl::OUStringBuffer& rBuffer, - double fNumber, BOOL bWriteUnits) const; + double fNumber, sal_Bool bWriteUnits) const; /** convert double number to string (using ::rtl::math) and DO convert from eSrcUnit to export MapUnit */ static void convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, BOOL bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); + double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); /** convert double number to string (using ::rtl::math) without unit conversion */ static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); /** convert string to double number (using ::rtl::math) and DO convert. */ - sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, BOOL bLookForUnits) const; + sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const; /** convert string to double number (using ::rtl::math) and DO convert from SrcUnit to DstUnit. */ diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst index d075f1fc6fcb..e522f8b79714 100644 --- a/xmloff/prj/build.lst +++ b/xmloff/prj/build.lst @@ -1,5 +1,2 @@ xo xmloff : LIBXSLT:libxslt offapi svl vos NULL -zxo xmloff\prj nmake - all xo_prj NULL - -xo xmloff\qa\unoapi nmake - all xo_qa_unoapi NULL - +xo xmloff\prj nmake - all xo_prj NULL diff --git a/xmloff/prj/makefile.mk b/xmloff/prj/makefile.mk index c73a3d944bbf..e312a7ccab65 100644 --- a/xmloff/prj/makefile.mk +++ b/xmloff/prj/makefile.mk @@ -37,4 +37,4 @@ VERBOSEFLAG := -s .ENDIF all: - cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog diff --git a/xmloff/qa/unoapi/Test.java b/xmloff/qa/unoapi/Test.java index d66144f108e7..833c2d770c9f 100644 --- a/xmloff/qa/unoapi/Test.java +++ b/xmloff/qa/unoapi/Test.java @@ -27,6 +27,7 @@ package org.openoffice.xmloff.qa.unoapi; import org.openoffice.Runner; import org.openoffice.test.OfficeConnection; +import org.openoffice.test.Argument; import static org.junit.Assert.*; public final class Test { @@ -43,8 +44,8 @@ public final class Test { @org.junit.Test public void test() { assertTrue( Runner.run( - "-sce", "xmloff.sce", "-xcl", "knownissues.xcl", "-tdoc", - "testdocuments", "-cs", connection.getDescription())); + "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"), "-tdoc", + Argument.get("tdoc"), "-cs", connection.getDescription())); } private final OfficeConnection connection = new OfficeConnection(); diff --git a/xmloff/qa/unoapi/makefile.mk b/xmloff/qa/unoapi/makefile.mk deleted file mode 100644 index 3cbbc5f2a797..000000000000 --- a/xmloff/qa/unoapi/makefile.mk +++ /dev/null @@ -1,48 +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. -#***********************************************************************/ - -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - -PRJ = ../.. -PRJNAME = xmloff -TARGET = qa_unoapi - -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = org/openoffice/xmloff/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/xmloff/source/chart/MultiPropertySetHandler.hxx b/xmloff/source/chart/MultiPropertySetHandler.hxx index a0ccf8a1c92b..a908c69711fd 100644 --- a/xmloff/source/chart/MultiPropertySetHandler.hxx +++ b/xmloff/source/chart/MultiPropertySetHandler.hxx @@ -159,9 +159,9 @@ public: (i.e. for an UnknownPropertyExcption) or if the interface is not supported it uses the XPropertySet interface. @return If none of the two interfaces is supported or using them both - fails then FALSE is returned. Else True is returned. + fails then sal_False is returned. Else True is returned. */ - inline BOOL GetProperties (void); + inline sal_Bool GetProperties (void); private: /** @descr Try to use the XMultiPropertySet interface to get the property @@ -170,7 +170,7 @@ private: containing the properties names. @return True if values could be derived. */ - inline BOOL MultiGet (const ::com::sun::star::uno::Sequence< + inline sal_Bool MultiGet (const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rNameList); /** @descr Try to use the XPropertySet interface to get the property @@ -179,7 +179,7 @@ private: containing the properties names. @return True if values could be derived. */ - inline BOOL SingleGet (const ::com::sun::star::uno::Sequence< + inline sal_Bool SingleGet (const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rNameList); /** @descr STL map that maps from property names to polymorphic instances of @@ -222,7 +222,7 @@ template<class T> void MultiPropertySetHandler::Add (const ::rtl::OUString & sN -BOOL MultiPropertySetHandler::GetProperties (void) +sal_Bool MultiPropertySetHandler::GetProperties (void) { ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison>::iterator I; ::com::sun::star::uno::Sequence< ::rtl::OUString> aNameList (aPropertyList.size()); @@ -231,14 +231,14 @@ BOOL MultiPropertySetHandler::GetProperties (void) aNameList[i++] = I->second->msName; if ( ! MultiGet(aNameList)) if ( ! SingleGet(aNameList)) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL MultiPropertySetHandler::MultiGet (const ::com::sun::star::uno::Sequence< +sal_Bool MultiPropertySetHandler::MultiGet (const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rNameList) { ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet> xMultiSet ( @@ -255,18 +255,18 @@ BOOL MultiPropertySetHandler::MultiGet (const ::com::sun::star::uno::Sequen } catch (::com::sun::star::beans::UnknownPropertyException e) { - return FALSE; + return sal_False; } else - return FALSE; + return sal_False; - return TRUE; + return sal_True; } -BOOL MultiPropertySetHandler::SingleGet (const ::com::sun::star::uno::Sequence< +sal_Bool MultiPropertySetHandler::SingleGet (const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rNameList) { ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xSingleSet ( @@ -281,12 +281,12 @@ BOOL MultiPropertySetHandler::SingleGet (const ::com::sun::star::uno::Sequen } catch (::com::sun::star::beans::UnknownPropertyException e) { - return FALSE; + return sal_False; } else - return FALSE; + return sal_False; - return TRUE; + return sal_True; } diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx new file mode 100755 index 000000000000..f9828fa04931 --- /dev/null +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -0,0 +1,1053 @@ +/************************************************************************* + * + * 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_xmloff.hxx" + +#include "SchXMLAxisContext.hxx" +#include "SchXMLChartContext.hxx" +#include "SchXMLTools.hxx" +#include <xmloff/xmlnmspe.hxx> +#include <xmloff/xmlement.hxx> +#include <xmloff/xmlstyle.hxx> +#include <xmloff/prstylei.hxx> +#include <xmloff/nmspmap.hxx> +#include <xmloff/xmluconv.hxx> + +#include <tools/debug.hxx> + +#include <com/sun/star/chart/ChartAxisLabelPosition.hpp> +#include <com/sun/star/chart/ChartAxisMarkPosition.hpp> +#include <com/sun/star/chart/ChartAxisPosition.hpp> +#include <com/sun/star/chart/ChartAxisType.hpp> +#include <com/sun/star/chart/TimeIncrement.hpp> +#include <com/sun/star/chart/TimeInterval.hpp> +#include <com/sun/star/chart/TimeUnit.hpp> +#include <com/sun/star/chart/XAxis.hpp> +#include <com/sun/star/chart/XAxisSupplier.hpp> +#include <com/sun/star/chart2/AxisType.hpp> +#include <com/sun/star/chart2/XChartDocument.hpp> +#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> + +#include <com/sun/star/drawing/LineStyle.hpp> + +using namespace ::xmloff::token; +using namespace com::sun::star; + +using rtl::OUString; +using com::sun::star::uno::Reference; + +//---------------------------------------- +//---------------------------------------- + +static SvXMLEnumMapEntry aXMLAxisDimensionMap[] = +{ + { XML_X, SCH_XML_AXIS_X }, + { XML_Y, SCH_XML_AXIS_Y }, + { XML_Z, SCH_XML_AXIS_Z }, + { XML_TOKEN_INVALID, 0 } +}; + +static SvXMLEnumMapEntry aXMLAxisTypeMap[] = +{ + { XML_AUTO, ::com::sun::star::chart::ChartAxisType::AUTOMATIC }, + { XML_TEXT, ::com::sun::star::chart::ChartAxisType::CATEGORY }, + { XML_DATE, ::com::sun::star::chart::ChartAxisType::DATE }, + { XML_TOKEN_INVALID, 0 } +}; + +//---------------------------------------- +//---------------------------------------- + +class SchXMLCategoriesContext : public SvXMLImportContext +{ +private: + SchXMLImportHelper& m_rImportHelper; + OUString& mrAddress; + +public: + SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper, + SvXMLImport& rImport, + sal_uInt16 nPrefix, + const OUString& rLocalName, + OUString& rAddress ); + virtual ~SchXMLCategoriesContext(); + virtual void StartElement( const Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); +}; + +//---------------------------------------- +//---------------------------------------- + + +class DateScaleContext : public SvXMLImportContext +{ +public: + DateScaleContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, + sal_uInt16 nPrefix, const OUString& rLocalName, + const Reference< beans::XPropertySet > xAxisProps ); + + virtual ~DateScaleContext(); + virtual void StartElement( const Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + +private: + SchXMLImportHelper& m_rImportHelper; + Reference< beans::XPropertySet > m_xAxisProps; +}; + + +//---------------------------------------- +//---------------------------------------- + +SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper, + SvXMLImport& rImport, const OUString& rLocalName, + Reference< chart::XDiagram > xDiagram, + std::vector< SchXMLAxis >& rAxes, + OUString & rCategoriesAddress, + bool bAddMissingXAxisForNetCharts, + bool bAdaptWrongPercentScaleValues, + bool bAdaptXAxisOrientationForOld2DBarCharts, + bool& rbAxisPositionAttributeImported ) : + SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), + m_rImportHelper( rImpHelper ), + m_xDiagram( xDiagram ), + m_rAxes( rAxes ), + m_rCategoriesAddress( rCategoriesAddress ), + m_nAxisType(chart::ChartAxisType::AUTOMATIC), + m_bAxisTypeImported(false), + m_bDateScaleImported(false), + m_bAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ), + m_bAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ), + m_bAdaptXAxisOrientationForOld2DBarCharts( bAdaptXAxisOrientationForOld2DBarCharts ), + m_rbAxisPositionAttributeImported( rbAxisPositionAttributeImported ) +{ +} + +SchXMLAxisContext::~SchXMLAxisContext() +{} + +Reference< chart::XAxis > lcl_getChartAxis( SchXMLAxis aCurrentAxis, const Reference< chart::XDiagram > xDiagram ) +{ + Reference< chart::XAxis > xAxis; + Reference< chart::XAxisSupplier > xAxisSuppl( xDiagram, uno::UNO_QUERY ); + if( !xAxisSuppl.is() ) + return xAxis; + if( aCurrentAxis.nAxisIndex == 0 ) + xAxis = xAxisSuppl->getAxis(aCurrentAxis.eDimension); + else + xAxis = xAxisSuppl->getSecondaryAxis(aCurrentAxis.eDimension); + return xAxis; +} + +/* returns a shape for the current axis's title. The property + "Has...AxisTitle" is set to "True" to get the shape + */ +Reference< drawing::XShape > SchXMLAxisContext::getTitleShape() +{ + Reference< drawing::XShape > xResult; + Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY ); + Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) ); + if( !xDiaProp.is() || !xAxis.is() ) + return xResult; + + rtl::OUString aPropName; + switch( m_aCurrentAxis.eDimension ) + { + case SCH_XML_AXIS_X: + if( m_aCurrentAxis.nAxisIndex == 0 ) + aPropName = OUString::createFromAscii( "HasXAxisTitle" ); + else + aPropName = OUString::createFromAscii( "HasSecondaryXAxisTitle" ); + break; + case SCH_XML_AXIS_Y: + if( m_aCurrentAxis.nAxisIndex == 0 ) + aPropName = OUString::createFromAscii( "HasYAxisTitle" ); + else + aPropName = OUString::createFromAscii( "HasSecondaryYAxisTitle" ); + break; + case SCH_XML_AXIS_Z: + aPropName = OUString::createFromAscii( "HasZAxisTitle" ); + break; + case SCH_XML_AXIS_UNDEF: + DBG_ERROR( "Invalid axis" ); + break; + } + xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); + xResult = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xResult; +} + +void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor ) +{ + Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY ); + Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) ); + if( !xDiaProp.is() || !xAxis.is() ) + return; + + rtl::OUString aPropName; + switch( m_aCurrentAxis.eDimension ) + { + case SCH_XML_AXIS_X: + if( bIsMajor ) + aPropName = OUString::createFromAscii("HasXAxisGrid"); + else + aPropName = OUString::createFromAscii("HasXAxisHelpGrid"); + break; + case SCH_XML_AXIS_Y: + if( bIsMajor ) + aPropName = OUString::createFromAscii("HasYAxisGrid"); + else + aPropName = OUString::createFromAscii("HasYAxisHelpGrid"); + break; + case SCH_XML_AXIS_Z: + if( bIsMajor ) + aPropName = OUString::createFromAscii("HasZAxisGrid"); + else + aPropName = OUString::createFromAscii("HasZAxisHelpGrid"); + break; + case SCH_XML_AXIS_UNDEF: + DBG_ERROR( "Invalid axis" ); + break; + } + xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); + + Reference< beans::XPropertySet > xGridProp; + if( bIsMajor ) + xGridProp = xAxis->getMajorGrid(); + else + xGridProp = xAxis->getMinorGrid(); + + // set properties + if( xGridProp.is()) + { + // the line color is black as default, in the model it is a light gray + xGridProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), + uno::makeAny( COL_BLACK )); + if( sAutoStyleName.getLength()) + { + const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext(); + if( pStylesCtxt ) + { + const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( + m_rImportHelper.GetChartFamilyID(), sAutoStyleName ); + + if( pStyle && pStyle->ISA( XMLPropStyleContext )) + (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp ); + } + } + } +} + +namespace +{ +enum AxisAttributeTokens +{ + XML_TOK_AXIS_DIMENSION, + XML_TOK_AXIS_NAME, + XML_TOK_AXIS_STYLE_NAME, + XML_TOK_AXIS_TYPE, + XML_TOK_AXIS_TYPE_EXT +}; + +SvXMLTokenMapEntry aAxisAttributeTokenMap[] = +{ + { XML_NAMESPACE_CHART, XML_DIMENSION, XML_TOK_AXIS_DIMENSION }, + { XML_NAMESPACE_CHART, XML_NAME, XML_TOK_AXIS_NAME }, + { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_AXIS_STYLE_NAME }, + { XML_NAMESPACE_CHART, XML_AXIS_TYPE, XML_TOK_AXIS_TYPE }, + { XML_NAMESPACE_CHART_EXT, XML_AXIS_TYPE, XML_TOK_AXIS_TYPE_EXT }, + XML_TOKEN_MAP_END +}; + +class AxisAttributeTokenMap : public SvXMLTokenMap +{ +public: + AxisAttributeTokenMap(): SvXMLTokenMap( aAxisAttributeTokenMap ) {} + virtual ~AxisAttributeTokenMap() {} +}; + +//a AxisAttributeTokenMap Singleton +struct theAxisAttributeTokenMap : public rtl::Static< AxisAttributeTokenMap, theAxisAttributeTokenMap > {}; +} + +void SchXMLAxisContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList ) +{ + // parse attributes + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + SchXMLImport& rImport = ( SchXMLImport& )GetImport(); + const SvXMLTokenMap& rAttrTokenMap = theAxisAttributeTokenMap::get(); + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + OUString sAttrName = xAttrList->getNameByIndex( i ); + OUString aLocalName; + OUString aValue = xAttrList->getValueByIndex( i ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + + switch( rAttrTokenMap.Get( nPrefix, aLocalName )) + { + case XML_TOK_AXIS_DIMENSION: + { + sal_uInt16 nEnumVal; + if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisDimensionMap )) + m_aCurrentAxis.eDimension = ( SchXMLAxisDimension )nEnumVal; + } + break; + case XML_TOK_AXIS_NAME: + m_aCurrentAxis.aName = aValue; + break; + case XML_TOK_AXIS_TYPE: + case XML_TOK_AXIS_TYPE_EXT: + sal_uInt16 nEnumVal; + if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisTypeMap )) + { + m_nAxisType = nEnumVal; + m_bAxisTypeImported = true; + } + break; + case XML_TOK_AXIS_STYLE_NAME: + m_aAutoStyleName = aValue; + break; + } + } + + // check for number of axes with same dimension + m_aCurrentAxis.nAxisIndex = 0; + sal_Int32 nNumOfAxes = m_rAxes.size(); + for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ ) + { + if( m_rAxes[ nCurrent ].eDimension == m_aCurrentAxis.eDimension ) + m_aCurrentAxis.nAxisIndex++; + } + CreateAxis(); +} +namespace +{ + +Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChartModel, + sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) +{ + Reference< chart2::XAxis > xAxis; + + try + { + Reference< chart2::XChartDocument > xChart2Document( xChartModel, uno::UNO_QUERY ); + if( xChart2Document.is() ) + { + Reference< chart2::XDiagram > xDiagram( xChart2Document->getFirstDiagram()); + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); + uno::Sequence< Reference< chart2::XCoordinateSystem > > + aCooSysSeq( xCooSysCnt->getCoordinateSystems()); + sal_Int32 nCooSysIndex = 0; + if( nCooSysIndex < aCooSysSeq.getLength() ) + { + Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] ); + if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() ) + { + const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); + if( nAxisIndex <= nMaxAxisIndex ) + xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); + } + } + } + } + catch( uno::Exception & ) + { + DBG_ERROR( "Couldn't get axis" ); + } + + return xAxis; +} + +bool lcl_divideBy100( uno::Any& rDoubleAny ) +{ + bool bChanged = false; + double fValue=0.0; + if( (rDoubleAny>>=fValue) && (fValue!=0.0) ) + { + fValue/=100.0; + rDoubleAny = uno::makeAny(fValue); + bChanged = true; + } + return bChanged; +} + +bool lcl_AdaptWrongPercentScaleValues(chart2::ScaleData& rScaleData) +{ + bool bChanged = lcl_divideBy100( rScaleData.Minimum ); + bChanged = lcl_divideBy100( rScaleData.Maximum ) || bChanged; + bChanged = lcl_divideBy100( rScaleData.Origin ) || bChanged; + bChanged = lcl_divideBy100( rScaleData.IncrementData.Distance ) || bChanged; + return bChanged; +} + +}//end anonymous namespace + +void SchXMLAxisContext::CreateAxis() +{ + m_rAxes.push_back( m_aCurrentAxis ); + + Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY ); + if( !xDiaProp.is() ) + return; + rtl::OUString aPropName; + switch( m_aCurrentAxis.eDimension ) + { + case SCH_XML_AXIS_X: + if( m_aCurrentAxis.nAxisIndex == 0 ) + aPropName = OUString::createFromAscii("HasXAxis"); + else + aPropName = OUString::createFromAscii("HasSecondaryXAxis"); + break; + case SCH_XML_AXIS_Y: + if( m_aCurrentAxis.nAxisIndex == 0 ) + aPropName = OUString::createFromAscii("HasYAxis"); + else + aPropName = OUString::createFromAscii("HasSecondaryYAxis"); + break; + case SCH_XML_AXIS_Z: + if( m_aCurrentAxis.nAxisIndex == 0 ) + aPropName = OUString::createFromAscii("HasXAxis"); + else + aPropName = OUString::createFromAscii("HasSecondaryXAxis"); + break; + case SCH_XML_AXIS_UNDEF: + DBG_ERROR( "Invalid axis" ); + break; + } + try + { + xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); + } + catch( beans::UnknownPropertyException & ) + { + DBG_ERROR( "Couldn't turn on axis" ); + } + if( m_aCurrentAxis.eDimension==SCH_XML_AXIS_Z ) + { + bool bSettingZAxisSuccedded = false; + try + { + xDiaProp->getPropertyValue( aPropName ) >>= bSettingZAxisSuccedded; + } + catch( beans::UnknownPropertyException & ) + { + DBG_ERROR( "Couldn't turn on z axis" ); + } + if( !bSettingZAxisSuccedded ) + return; + } + + + m_xAxisProps = Reference<beans::XPropertySet>( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ), uno::UNO_QUERY ); + + if( m_bAddMissingXAxisForNetCharts && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y && m_aCurrentAxis.nAxisIndex==0 ) + { + try + { + xDiaProp->setPropertyValue( OUString::createFromAscii( "HasXAxis" ), uno::makeAny(sal_True) ); + } + catch( beans::UnknownPropertyException & ) + { + DBG_ERROR( "Couldn't turn on x axis" ); + } + } + + // set properties + if( m_xAxisProps.is()) + { + uno::Any aTrueBool( uno::makeAny( sal_True )); + uno::Any aFalseBool( uno::makeAny( sal_False )); + + // #i109879# the line color is black as default, in the model it is a light gray + m_xAxisProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), + uno::makeAny( COL_BLACK )); + + m_xAxisProps->setPropertyValue( OUString::createFromAscii( "DisplayLabels" ), aFalseBool ); + + // #88077# AutoOrigin 'on' is default + m_xAxisProps->setPropertyValue( OUString::createFromAscii( "AutoOrigin" ), aTrueBool ); + + if( m_bAxisTypeImported ) + m_xAxisProps->setPropertyValue( OUString::createFromAscii( "AxisType" ), uno::makeAny(m_nAxisType) ); + + if( m_aAutoStyleName.getLength()) + { + const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext(); + if( pStylesCtxt ) + { + const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( + m_rImportHelper.GetChartFamilyID(), m_aAutoStyleName ); + + if( pStyle && pStyle->ISA( XMLPropStyleContext )) + { + // note: SvXMLStyleContext::FillPropertySet is not const + XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle )); + if( pPropStyleContext ) + pPropStyleContext->FillPropertySet( m_xAxisProps ); + + if( m_bAdaptWrongPercentScaleValues && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y ) + { + //set scale data of added x axis back to default + Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), + m_aCurrentAxis.eDimension, m_aCurrentAxis.nAxisIndex ) ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData( xAxis->getScaleData()); + if( lcl_AdaptWrongPercentScaleValues(aScaleData) ) + xAxis->setScaleData( aScaleData ); + } + } + + if( m_bAddMissingXAxisForNetCharts ) + { + //copy style from y axis to added x axis: + + Reference< chart::XAxisSupplier > xAxisSuppl( xDiaProp, uno::UNO_QUERY ); + if( xAxisSuppl.is() ) + { + Reference< beans::XPropertySet > xXAxisProp( xAxisSuppl->getAxis(0), uno::UNO_QUERY ); + (( XMLPropStyleContext* )pStyle )->FillPropertySet( xXAxisProp ); + } + + //set scale data of added x axis back to default + Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), + 0 /*nDimensionIndex*/, 0 /*nAxisIndex*/ ) ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData; + aScaleData.AxisType = chart2::AxisType::CATEGORY; + aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL; + xAxis->setScaleData( aScaleData ); + } + + //set line style of added x axis to invisible + Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY ); + if( xNewAxisProp.is() ) + { + xNewAxisProp->setPropertyValue( OUString::createFromAscii("LineStyle") + , uno::makeAny(drawing::LineStyle_NONE)); + } + } + + if( m_bAdaptXAxisOrientationForOld2DBarCharts && m_aCurrentAxis.eDimension == SCH_XML_AXIS_X ) + { + bool bIs3DChart = false; + if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart ) + && !bIs3DChart ) + { + Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY ); + if( xChart2Document.is() ) + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChart2Document->getFirstDiagram(), uno::UNO_QUERY ); + if( xCooSysCnt.is() ) + { + uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); + if( aCooSysSeq.getLength() ) + { + bool bSwapXandYAxis = false; + Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); + Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); + if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis ) + && bSwapXandYAxis ) + { + Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, m_aCurrentAxis.nAxisIndex ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData = xAxis->getScaleData(); + aScaleData.Orientation = chart2::AxisOrientation_REVERSE; + xAxis->setScaleData( aScaleData ); + } + } + } + } + } + } + } + + m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext( + OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue(); + } + } + } + } +} + +void SchXMLAxisContext::SetAxisTitle() +{ + if( !m_aCurrentAxis.aTitle.getLength() ) + return; + + Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) ); + if( !xAxis.is() ) + return; + + Reference< beans::XPropertySet > xTitleProp( xAxis->getAxisTitle() ); + if( xTitleProp.is() ) + { + try + { + xTitleProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), uno::makeAny(m_aCurrentAxis.aTitle) ); + } + catch( beans::UnknownPropertyException & ) + { + DBG_ERROR( "Property String for Title not available" ); + } + } +} + +//----------------------------------------------------------------------- +namespace +{ +enum AxisChildTokens +{ + XML_TOK_AXIS_TITLE, + XML_TOK_AXIS_CATEGORIES, + XML_TOK_AXIS_GRID, + XML_TOK_AXIS_DATE_SCALE, + XML_TOK_AXIS_DATE_SCALE_EXT +}; + +SvXMLTokenMapEntry aAxisChildTokenMap[] = +{ + { XML_NAMESPACE_CHART, XML_TITLE, XML_TOK_AXIS_TITLE }, + { XML_NAMESPACE_CHART, XML_CATEGORIES, XML_TOK_AXIS_CATEGORIES }, + { XML_NAMESPACE_CHART, XML_GRID, XML_TOK_AXIS_GRID }, + { XML_NAMESPACE_CHART, XML_DATE_SCALE, XML_TOK_AXIS_DATE_SCALE }, + { XML_NAMESPACE_CHART_EXT, XML_DATE_SCALE, XML_TOK_AXIS_DATE_SCALE_EXT }, + XML_TOKEN_MAP_END +}; + +class AxisChildTokenMap : public SvXMLTokenMap +{ +public: + AxisChildTokenMap(): SvXMLTokenMap( aAxisChildTokenMap ) {} + virtual ~AxisChildTokenMap() {} +}; + +//a AxisChildTokenMap Singleton +struct theAxisChildTokenMap : public rtl::Static< AxisChildTokenMap, theAxisChildTokenMap > {}; +} + +SvXMLImportContext* SchXMLAxisContext::CreateChildContext( + sal_uInt16 p_nPrefix, + const OUString& rLocalName, + const Reference< xml::sax::XAttributeList >& xAttrList ) +{ + SvXMLImportContext* pContext = 0; + const SvXMLTokenMap& rTokenMap = theAxisChildTokenMap::get(); + + switch( rTokenMap.Get( p_nPrefix, rLocalName )) + { + case XML_TOK_AXIS_TITLE: + { + Reference< drawing::XShape > xTitleShape = getTitleShape(); + pContext = new SchXMLTitleContext( m_rImportHelper, GetImport(), rLocalName, + m_aCurrentAxis.aTitle, + xTitleShape ); + } + break; + + case XML_TOK_AXIS_CATEGORIES: + pContext = new SchXMLCategoriesContext( m_rImportHelper, GetImport(), + p_nPrefix, rLocalName, + m_rCategoriesAddress ); + m_aCurrentAxis.bHasCategories = true; + break; + + case XML_TOK_AXIS_DATE_SCALE: + case XML_TOK_AXIS_DATE_SCALE_EXT: + pContext = new DateScaleContext( m_rImportHelper, GetImport(), + p_nPrefix, rLocalName, m_xAxisProps ); + m_bDateScaleImported = true; + break; + + case XML_TOK_AXIS_GRID: + { + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + bool bIsMajor = true; // default value for class is "major" + OUString sAutoStyleName; + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + OUString sAttrName = xAttrList->getNameByIndex( i ); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + + if( nPrefix == XML_NAMESPACE_CHART ) + { + if( IsXMLToken( aLocalName, XML_CLASS ) ) + { + if( IsXMLToken( xAttrList->getValueByIndex( i ), XML_MINOR ) ) + bIsMajor = false; + } + else if( IsXMLToken( aLocalName, XML_STYLE_NAME ) ) + sAutoStyleName = xAttrList->getValueByIndex( i ); + } + } + + CreateGrid( sAutoStyleName, bIsMajor ); + + // don't create a context => use default context. grid elements are empty + pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName ); + } + break; + + default: + pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName ); + break; + } + + return pContext; +} + +void SchXMLAxisContext::EndElement() +{ + if( !m_bDateScaleImported && m_nAxisType==chart::ChartAxisType::AUTOMATIC ) + { + Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), m_aCurrentAxis.eDimension, m_aCurrentAxis.nAxisIndex ) ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData( xAxis->getScaleData()); + aScaleData.AutoDateAxis = false;//different default for older documents + xAxis->setScaleData( aScaleData ); + } + } + + SetAxisTitle(); +} + +// ======================================== + +namespace +{ + +Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem > xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) +{ + Reference< chart2::XAxis > xAxis; + try + { + xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); + } + catch( uno::Exception & ) + { + } + return xAxis; +} + +} // anonymous namespace + +void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDocument >& xNewDoc, + const OUString& rChartTypeServiceName, + const OUString& rODFVersionOfFile, + bool bAxisPositionAttributeImported ) +{ + if( ( !rODFVersionOfFile.getLength() || rODFVersionOfFile.equalsAscii("1.0") + || rODFVersionOfFile.equalsAscii("1.1") + || ( rODFVersionOfFile.equalsAscii("1.2") && !bAxisPositionAttributeImported ) ) ) + { + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); + uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); + if( aCooSysSeq.getLength() ) + { + Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); + if( xCooSys.is() ) + { + Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 ); + Reference< chart2::XAxis > xMainYAxis = lcl_getAxis( xCooSys, 1, 0 ); + //Reference< chart2::XAxis > xMajorZAxis = lcl_getAxis( xCooSys, 2, 0 ); + Reference< chart2::XAxis > xSecondaryXAxis = lcl_getAxis( xCooSys, 0, 1 ); + Reference< chart2::XAxis > xSecondaryYAxis = lcl_getAxis( xCooSys, 1, 1 ); + + Reference< beans::XPropertySet > xMainXAxisProp( xMainXAxis, uno::UNO_QUERY ); + Reference< beans::XPropertySet > xMainYAxisProp( xMainYAxis, uno::UNO_QUERY ); + Reference< beans::XPropertySet > xSecondaryXAxisProp( xSecondaryXAxis, uno::UNO_QUERY ); + Reference< beans::XPropertySet > xSecondaryYAxisProp( xSecondaryYAxis, uno::UNO_QUERY ); + + if( xMainXAxisProp.is() && xMainYAxisProp.is() ) + { + chart2::ScaleData aMainXScale = xMainXAxis->getScaleData(); + if( 0 == rChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) ) + { + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); + double fCrossoverValue = 0.0; + aMainXScale.Origin >>= fCrossoverValue; + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverValue") + , uno::makeAny( fCrossoverValue ) ); + + if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) + { + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); + if( xSecondaryYAxisProp.is() ) + xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); + } + else + { + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); + if( xSecondaryYAxisProp.is() ) + xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); + } + } + else + { + if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) + { + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); + if( xSecondaryYAxisProp.is() ) + xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); + } + else + { + xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); + if( xSecondaryYAxisProp.is() ) + xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); + } + } + + chart2::ScaleData aMainYScale = xMainYAxis->getScaleData(); + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); + double fCrossoverValue = 0.0; + aMainYScale.Origin >>= fCrossoverValue; + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverValue") + , uno::makeAny( fCrossoverValue ) ); + + if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE ) + { + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); + if( xSecondaryXAxisProp.is() ) + xSecondaryXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); + } + else + { + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); + xMainXAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); + if( xSecondaryXAxisProp.is() ) + xSecondaryXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition") + , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); + } + } + } + } + } + catch( uno::Exception & ) + { + } + } +} + +// ======================================== + +SchXMLCategoriesContext::SchXMLCategoriesContext( + SchXMLImportHelper& rImpHelper, + SvXMLImport& rImport, + sal_uInt16 nPrefix, + const OUString& rLocalName, + OUString& rAddress ) : + SvXMLImportContext( rImport, nPrefix, rLocalName ), + m_rImportHelper( rImpHelper ), + mrAddress( rAddress ) +{ +} + +SchXMLCategoriesContext::~SchXMLCategoriesContext() +{ +} + +void SchXMLCategoriesContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList ) +{ + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + OUString sAttrName = xAttrList->getNameByIndex( i ); + OUString aLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + + if( nPrefix == XML_NAMESPACE_TABLE && + IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) ) + { + Reference< chart2::XChartDocument > xNewDoc( GetImport().GetModel(), uno::UNO_QUERY ); + mrAddress = xAttrList->getValueByIndex( i ); + } + } +} + +// ======================================== + +DateScaleContext::DateScaleContext( + SchXMLImportHelper& rImpHelper, + SvXMLImport& rImport, + sal_uInt16 nPrefix, + const OUString& rLocalName, + const Reference< beans::XPropertySet > xAxisProps ) : + SvXMLImportContext( rImport, nPrefix, rLocalName ), + m_rImportHelper( rImpHelper ), + m_xAxisProps( xAxisProps ) +{ +} + +DateScaleContext::~DateScaleContext() +{ +} + +namespace +{ +enum DateScaleAttributeTokens +{ + XML_TOK_DATESCALE_BASE_TIME_UNIT, + XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE, + XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT, + XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE, + XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT +}; + +SvXMLTokenMapEntry aDateScaleAttributeTokenMap[] = +{ + { XML_NAMESPACE_CHART, XML_BASE_TIME_UNIT, XML_TOK_DATESCALE_BASE_TIME_UNIT }, + { XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_VALUE, XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE }, + { XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT }, + { XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_VALUE, XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE }, + { XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT }, + XML_TOKEN_MAP_END +}; + +class DateScaleAttributeTokenMap : public SvXMLTokenMap +{ +public: + DateScaleAttributeTokenMap(): SvXMLTokenMap( aDateScaleAttributeTokenMap ) {} + virtual ~DateScaleAttributeTokenMap() {} +}; + +struct theDateScaleAttributeTokenMap : public rtl::Static< DateScaleAttributeTokenMap, theDateScaleAttributeTokenMap > {}; + +sal_Int32 lcl_getTimeUnit( const OUString& rValue ) +{ + sal_Int32 nTimeUnit = ::com::sun::star::chart::TimeUnit::DAY; + if( IsXMLToken( rValue, XML_DAYS ) ) + nTimeUnit = ::com::sun::star::chart::TimeUnit::DAY; + else if( IsXMLToken( rValue, XML_MONTHS ) ) + nTimeUnit = ::com::sun::star::chart::TimeUnit::MONTH; + else if( IsXMLToken( rValue, XML_YEARS ) ) + nTimeUnit = ::com::sun::star::chart::TimeUnit::YEAR; + return nTimeUnit; +} + +} + +void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList ) +{ + if( !m_xAxisProps.is() ) + return; + + // parse attributes + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + const SvXMLTokenMap& rAttrTokenMap = theDateScaleAttributeTokenMap::get(); + + bool bSetNewIncrement=false; + chart::TimeIncrement aIncrement; + m_xAxisProps->getPropertyValue( OUString::createFromAscii( "TimeIncrement" )) >>= aIncrement; + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + OUString sAttrName = xAttrList->getNameByIndex( i ); + OUString aLocalName; + OUString aValue = xAttrList->getValueByIndex( i ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + + switch( rAttrTokenMap.Get( nPrefix, aLocalName )) + { + case XML_TOK_DATESCALE_BASE_TIME_UNIT: + { + aIncrement.TimeResolution = uno::makeAny( lcl_getTimeUnit(aValue) ); + bSetNewIncrement = true; + } + break; + case XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE: + { + chart::TimeInterval aInterval(1,0); + aIncrement.MajorTimeInterval >>= aInterval; + SvXMLUnitConverter::convertNumber( aInterval.Number, aValue ); + aIncrement.MajorTimeInterval = uno::makeAny(aInterval); + bSetNewIncrement = true; + } + break; + case XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT: + { + chart::TimeInterval aInterval(1,0); + aIncrement.MajorTimeInterval >>= aInterval; + aInterval.TimeUnit = lcl_getTimeUnit(aValue); + aIncrement.MajorTimeInterval = uno::makeAny(aInterval); + bSetNewIncrement = true; + } + break; + case XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE: + { + chart::TimeInterval aInterval(1,0); + aIncrement.MinorTimeInterval >>= aInterval; + SvXMLUnitConverter::convertNumber( aInterval.Number, aValue ); + aIncrement.MinorTimeInterval = uno::makeAny(aInterval); + bSetNewIncrement = true; + } + break; + case XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT: + { + chart::TimeInterval aInterval(1,0); + aIncrement.MinorTimeInterval >>= aInterval; + aInterval.TimeUnit = lcl_getTimeUnit(aValue); + aIncrement.MinorTimeInterval = uno::makeAny(aInterval); + bSetNewIncrement = true; + } + break; + } + } + + if( bSetNewIncrement ) + m_xAxisProps->setPropertyValue( OUString::createFromAscii( "TimeIncrement" ), uno::makeAny( aIncrement ) ); +} + +// ======================================== diff --git a/xmloff/source/chart/SchXMLAxisContext.hxx b/xmloff/source/chart/SchXMLAxisContext.hxx new file mode 100755 index 000000000000..2689c6adff6d --- /dev/null +++ b/xmloff/source/chart/SchXMLAxisContext.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * 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 _SCH_XMLAXISCONTEXT_HXX_ +#define _SCH_XMLAXISCONTEXT_HXX_ + +#include "SchXMLImport.hxx" +#include "transporttypes.hxx" + +// ---------------------------------------- + +class SchXMLAxisContext : public SvXMLImportContext +{ +public: + SchXMLAxisContext( SchXMLImportHelper& rImpHelper, + SvXMLImport& rImport, const rtl::OUString& rLocalName, + ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram, + std::vector< SchXMLAxis >& aAxes, + ::rtl::OUString& rCategoriesAddress, + bool bAddMissingXAxisForNetCharts, + bool bAdaptWrongPercentScaleValues, + bool bAdaptXAxisOrientationForOld2DBarCharts, + bool& rbAxisPositionAttributeImported ); + virtual ~SchXMLAxisContext(); + + virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + virtual void EndElement(); + virtual SvXMLImportContext* CreateChildContext( + sal_uInt16 nPrefix, + const rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + + static void CorrectAxisPositions( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xNewDoc, + const ::rtl::OUString& rChartTypeServiceName, + const ::rtl::OUString& rODFVersionOfFile, + bool bAxisPositionAttributeImported ); + +private: + SchXMLImportHelper& m_rImportHelper; + ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > m_xDiagram; + SchXMLAxis m_aCurrentAxis; + std::vector< SchXMLAxis >& m_rAxes; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAxisProps; + rtl::OUString m_aAutoStyleName; + rtl::OUString& m_rCategoriesAddress; + sal_Int32 m_nAxisType;//::com::sun::star::chart::ChartAxisType + bool m_bAxisTypeImported; + bool m_bDateScaleImported; + bool m_bAddMissingXAxisForNetCharts; //to correct errors from older versions + bool m_bAdaptWrongPercentScaleValues; //to correct errors from older versions + bool m_bAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions + bool& m_rbAxisPositionAttributeImported; + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape(); + void CreateGrid( ::rtl::OUString sAutoStyleName, bool bIsMajor ); + void CreateAxis(); + void SetAxisTitle(); +}; + +#endif // _SCH_XMLAXISCONTEXT_HXX_ diff --git a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx index ff3a9a08379b..78c1ac42430f 100755 --- a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx +++ b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx @@ -68,7 +68,7 @@ SchXMLCalculationSettingsContext::SchXMLCalculationSettingsContext( SvXMLImport& } } } -SvXMLImportContext* SchXMLCalculationSettingsContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext* SchXMLCalculationSettingsContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) { diff --git a/xmloff/source/chart/SchXMLCalculationSettingsContext.hxx b/xmloff/source/chart/SchXMLCalculationSettingsContext.hxx index 9fe2db8a30a4..423d6fdfd11a 100755 --- a/xmloff/source/chart/SchXMLCalculationSettingsContext.hxx +++ b/xmloff/source/chart/SchXMLCalculationSettingsContext.hxx @@ -40,7 +40,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 9df601407199..6b42b2e629df 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -63,7 +63,6 @@ #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> -#include <com/sun/star/chart2/XChartTypeTemplate.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> @@ -78,48 +77,6 @@ using namespace ::SchXMLTools; namespace { -uno::Reference< chart2::XChartTypeTemplate > lcl_getTemplate( const uno::Reference< chart2::XChartDocument > & xDoc ) -{ - uno::Reference< chart2::XChartTypeTemplate > xResult; - try - { - if( !xDoc.is()) - return xResult; - uno::Reference< lang::XMultiServiceFactory > xChartTypeManager( xDoc->getChartTypeManager(), uno::UNO_QUERY ); - if( !xChartTypeManager.is()) - return xResult; - uno::Reference< chart2::XDiagram > xDiagram( xDoc->getFirstDiagram()); - if( !xDiagram.is()) - return xResult; - - uno::Sequence< ::rtl::OUString > aServiceNames( xChartTypeManager->getAvailableServiceNames()); - const sal_Int32 nLength = aServiceNames.getLength(); - - for( sal_Int32 i = 0; i < nLength; ++i ) - { - try - { - uno::Reference< chart2::XChartTypeTemplate > xTempl( - xChartTypeManager->createInstance( aServiceNames[ i ] ), uno::UNO_QUERY_THROW ); - - if( xTempl->matchesTemplate( xDiagram, sal_True )) - { - xResult.set( xTempl ); - break; - } - } - catch( uno::Exception & ) - { - DBG_ERROR( "Exception during determination of chart type template" ); - } - } - } - catch( uno::Exception & ) - { - DBG_ERROR( "Exception during import lcl_getTemplate" ); - } - return xResult; -} void lcl_setRoleAtLabeledSequence( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq, @@ -332,7 +289,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { @@ -685,10 +642,6 @@ void lcl_ApplyDataFromRectangularRangeToDiagram( if( !xNewDia.is() || !xDataProvider.is() ) return; - uno::Reference< chart2::XChartTypeTemplate > xTemplate( lcl_getTemplate( xNewDoc )); - if(!xTemplate.is()) - return; - sal_Bool bFirstCellAsLabel = (eDataRowSource==chart::ChartDataRowSource_COLUMNS)? bRowHasLabels : bColHasLabels; sal_Bool bHasCateories = @@ -754,13 +707,17 @@ void lcl_ApplyDataFromRectangularRangeToDiagram( uno::Reference< chart2::data::XDataSource > xDataSource( xDataProvider->createDataSource( aArgs )); - aArgs.realloc( aArgs.getLength() + 1 ); - aArgs[ aArgs.getLength() - 1 ] = beans::PropertyValue( + aArgs.realloc( aArgs.getLength() + 2 ); + aArgs[ aArgs.getLength() - 2 ] = beans::PropertyValue( ::rtl::OUString::createFromAscii("HasCategories"), -1, uno::makeAny( bHasCateories ), beans::PropertyState_DIRECT_VALUE ); + aArgs[ aArgs.getLength() - 1 ] = beans::PropertyValue( + ::rtl::OUString::createFromAscii("UseCategoriesAsX"), + -1, uno::makeAny( sal_False ),//categories in ODF files are not to be used as x values (independent from what is offered in our ui) + beans::PropertyState_DIRECT_VALUE ); - xTemplate->changeDiagramData( xNewDia, xDataSource, aArgs ); + xNewDia->setDiagramData( xDataSource, aArgs ); } void SchXMLChartContext::EndElement() @@ -810,8 +767,7 @@ void SchXMLChartContext::EndElement() // cleanup: remove empty chart type groups lcl_removeEmptyChartTypeGroups( xNewDoc ); - // set stack mode before a potential template detection (in case we have a - // rectangular range) + // set stack mode before a potential chart type detection (in case we have a rectangular range) uno::Reference< chart::XDiagram > xDiagram( xDoc->getDiagram() ); uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY ); if( xDiaProp.is()) @@ -890,8 +846,7 @@ void SchXMLChartContext::EndElement() { //apply data from rectangular range - // create datasource from data provider with rectangular range - // parameters and change the diagram via template mechanism + // create datasource from data provider with rectangular range parameters and change the diagram setDiagramData try { if( bOlderThan2_3 && xDiaProp.is() )//for older charts the hidden cells were removed by calc on the fly @@ -1076,7 +1031,7 @@ void SchXMLChartContext::MergeSeriesForStockChart() } SvXMLImportContext* SchXMLChartContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { @@ -1255,7 +1210,7 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_SVG ) { @@ -1300,7 +1255,7 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut } SvXMLImportContext* SchXMLTitleContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -1363,7 +1318,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { @@ -1375,7 +1330,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu { try { - USHORT nEnumVal; + sal_uInt16 nEnumVal; if( GetImport().GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLLegendAlignmentMap )) { uno::Any aAny; diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx index 0f1fb0b4ab83..41f84f783a67 100644 --- a/xmloff/source/chart/SchXMLChartContext.hxx +++ b/xmloff/source/chart/SchXMLChartContext.hxx @@ -100,7 +100,7 @@ public: com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -166,7 +166,7 @@ public: virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); }; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index a269d7263e76..dbbedc09f751 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -64,20 +64,24 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XRefreshable.hpp> +#include <com/sun/star/chart/XAxis.hpp> +#include <com/sun/star/chart/XAxisSupplier.hpp> #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart/ChartLegendPosition.hpp> -#include <com/sun/star/chart/XTwoAxisXSupplier.hpp> -#include <com/sun/star/chart/XTwoAxisYSupplier.hpp> -#include <com/sun/star/chart/XAxisZSupplier.hpp> -#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartAxisAssign.hpp> +#include <com/sun/star/chart/ChartAxisType.hpp> +#include <com/sun/star/chart/TimeIncrement.hpp> +#include <com/sun/star/chart/TimeInterval.hpp> +#include <com/sun/star/chart/TimeUnit.hpp> #include <com/sun/star/chart/ChartSeriesAddress.hpp> #include <com/sun/star/chart/X3DDisplay.hpp> #include <com/sun/star/chart/XStatisticDisplay.hpp> #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp> #include <com/sun/star/chart/XDiagramPositioning.hpp> +#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp> +#include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> @@ -201,6 +205,13 @@ public: void exportAxes( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > & xDiagram, const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, sal_Bool bExportContent ); + void exportAxis( enum XMLTokenEnum eDimension, enum XMLTokenEnum eAxisName, + const Reference< beans::XPropertySet > xAxisProps, const Reference< chart2::XAxis >& xChart2Axis, + const OUString& rCategoriesRanges, + bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, bool bExportContent ); + void exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent ); + void exportDateScale( const Reference< beans::XPropertySet > xAxisProps ); + void exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent ); void exportSeries( const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, @@ -690,6 +701,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque } typedef vector< OUString > tStringVector; +typedef vector< double > tDoubleVector; typedef vector< vector< OUString > > t2DStringVector; typedef vector< vector< double > > t2DNumberContainer; @@ -704,8 +716,8 @@ struct lcl_TableData tStringVector aRowDescriptions; tStringVector aRowDescriptions_Ranges; - Sequence< Sequence< OUString > > aComplexColumnDescriptions;//outer index is columns - inner index is level - Sequence< Sequence< OUString > > aComplexRowDescriptions;//outer index is rows - inner index is level + Sequence< Sequence< uno::Any > > aComplexColumnDescriptions;//outer index is columns - inner index is level + Sequence< Sequence< uno::Any > > aComplexRowDescriptions;//outer index is rows - inner index is level ::std::vector< sal_Int32 > aHiddenColumns; }; @@ -772,7 +784,7 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName( lcl_TableData lcl_getDataForLocalTable( const SchXMLExportHelper_Impl::tDataSequenceCont & aSequencesToExport, - const Reference< chart::XComplexDescriptionAccess >& xComplexDescriptionAccess, + const Reference< chart2::XAnyDescriptionAccess >& xAnyDescriptionAccess, const OUString& rCategoriesRange, bool bSeriesFromColumns, const Reference< chart2::data::XRangeXMLConversion > & xRangeConversion ) @@ -782,23 +794,22 @@ lcl_TableData lcl_getDataForLocalTable( try { Sequence< OUString > aSimpleCategories; - if( xComplexDescriptionAccess.is() ) + if( xAnyDescriptionAccess.is() ) { //categories if( bSeriesFromColumns ) { - aSimpleCategories = xComplexDescriptionAccess->getRowDescriptions(); - aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions(); + aSimpleCategories = xAnyDescriptionAccess->getRowDescriptions(); + aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions(); } else { - aSimpleCategories = xComplexDescriptionAccess->getColumnDescriptions(); - aResult.aComplexColumnDescriptions = xComplexDescriptionAccess->getComplexColumnDescriptions(); + aSimpleCategories = xAnyDescriptionAccess->getColumnDescriptions(); + aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions(); } } //series values and series labels - SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size(); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin()); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end()); @@ -1588,7 +1599,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& delete pElChart; } -void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExport& rExport ) +void lcl_exportComplexLabel( const Sequence< uno::Any >& rComplexLabel, SvXMLExport& rExport ) { sal_Int32 nLength = rComplexLabel.getLength(); if( nLength<=1 ) @@ -1597,7 +1608,12 @@ void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExp for(sal_Int32 nN=0; nN<nLength; nN++) { SvXMLElementExport aListItem( rExport, XML_NAMESPACE_TEXT, XML_LIST_ITEM, sal_True, sal_True ); - SchXMLTools::exportText( rExport, rComplexLabel[nN], false /*bConvertTabsLFs*/ ); + OUString aString; + if( !(rComplexLabel[nN]>>=aString) ) + { + //todo? + } + SchXMLTools::exportText( rExport, aString, false /*bConvertTabsLFs*/ ); } } @@ -1606,6 +1622,21 @@ void SchXMLExportHelper_Impl::exportTable() // table element // ------------- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, msTableName ); + + try + { + bool bProtected = false; + Reference< beans::XPropertySet > xProps( mrExport.GetModel(), uno::UNO_QUERY_THROW ); + if ( ( xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ) ) >>= bProtected ) && + bProtected ) + { + mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE ); + } + } + catch ( uno::Exception& ) + { + } + SvXMLElementExport aTable( mrExport, XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True ); bool bHasOwnData = false; @@ -1617,17 +1648,17 @@ void SchXMLExportHelper_Impl::exportTable() xRangeConversion.set( xNewDoc->getDataProvider(), uno::UNO_QUERY ); } - Reference< chart::XComplexDescriptionAccess > xComplexDescriptionAccess; + Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess; { Reference< chart::XChartDocument > xChartDoc( mrExport.GetModel(), uno::UNO_QUERY ); if( xChartDoc.is() ) - xComplexDescriptionAccess = Reference< chart::XComplexDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY ); + xAnyDescriptionAccess = Reference< chart2::XAnyDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY ); } if( bHasOwnData ) lcl_ReorderInternalSequencesAccordingToTheirRangeName( m_aDataSequencesToExport ); lcl_TableData aData( lcl_getDataForLocalTable( m_aDataSequencesToExport - , xComplexDescriptionAccess, maCategoriesRange + , xAnyDescriptionAccess, maCategoriesRange , mbRowSourceColumns, xRangeConversion )); tStringVector::const_iterator aDataRangeIter( aData.aDataRangeRepresentations.begin()); @@ -1688,17 +1719,40 @@ void SchXMLExportHelper_Impl::exportTable() //export column descriptions tStringVector::const_iterator aColumnDescriptions_RangeIter( aData.aColumnDescriptions_Ranges.begin()); const tStringVector::const_iterator aColumnDescriptions_RangeEnd( aData.aColumnDescriptions_Ranges.end()); - const Sequence< Sequence< OUString > >& rComplexColumnDescriptions = aData.aComplexColumnDescriptions; + const Sequence< Sequence< uno::Any > >& rComplexColumnDescriptions = aData.aComplexColumnDescriptions; sal_Int32 nComplexCount = rComplexColumnDescriptions.getLength(); sal_Int32 nC = 0; - for( tStringVector::const_iterator aIt( aData.aColumnDescriptions.begin()); - aIt != aData.aColumnDescriptions.end(); ++aIt ) + for( tStringVector::const_iterator aIt( aData.aColumnDescriptions.begin()) + ; (aIt != aData.aColumnDescriptions.end()) + ; aIt++, nC++ ) { - mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); + bool bExportString = true; + if( nC < nComplexCount ) + { + const Sequence< uno::Any >& rComplexLabel = rComplexColumnDescriptions[nC]; + if( rComplexLabel.getLength()>0 ) + { + double fValue=0.0; + if( rComplexLabel[0] >>=fValue ) + { + bExportString = false; + + SvXMLUnitConverter::convertDouble( msStringBuffer, fValue ); + msString = msStringBuffer.makeStringAndClear(); + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); + } + } + } + if( bExportString ) + { + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); + } + SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); exportText( *aIt ); if( nC < nComplexCount ) - lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport ); + lcl_exportComplexLabel( rComplexColumnDescriptions[nC], mrExport ); if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd ) { // remind the original range to allow a correct re-association when copying via clipboard @@ -1714,25 +1768,47 @@ void SchXMLExportHelper_Impl::exportTable() { SvXMLElementExport aRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROWS, sal_True, sal_True ); tStringVector::const_iterator aRowDescriptionsIter( aData.aRowDescriptions.begin()); - const Sequence< Sequence< OUString > >& rComplexRowDescriptions = aData.aComplexRowDescriptions; + const Sequence< Sequence< uno::Any > >& rComplexRowDescriptions = aData.aComplexRowDescriptions; sal_Int32 nComplexCount = rComplexRowDescriptions.getLength(); sal_Int32 nC = 0; - for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin()); - aRowIt != aData.aDataInRows.end(); ++aRowIt ) + for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin()) + ; aRowIt != aData.aDataInRows.end() + ; aRowIt++, nC++, aRowDescriptionsIter++ ) { SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True ); //export row descriptions { - mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); + bool bExportString = true; + if( nC < nComplexCount ) + { + const Sequence< uno::Any >& rComplexLabel = rComplexRowDescriptions[nC]; + if( rComplexLabel.getLength()>0 ) + { + double fValue=0.0; + if( rComplexLabel[0] >>=fValue ) + { + bExportString = false; + + SvXMLUnitConverter::convertDouble( msStringBuffer, fValue ); + msString = msStringBuffer.makeStringAndClear(); + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); + } + } + } + if( bExportString ) + { + mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); + } + SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); if( aRowDescriptionsIter != aData.aRowDescriptions.end()) { exportText( *aRowDescriptionsIter ); - ++aRowDescriptionsIter; if( nC < nComplexCount ) - lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport ); + lcl_exportComplexLabel( rComplexRowDescriptions[nC], mrExport ); if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) { // remind the original range to allow a correct re-association when copying via clipboard @@ -1768,6 +1844,57 @@ void SchXMLExportHelper_Impl::exportTable() OSL_ASSERT( bHasOwnData || (aRowDescriptions_RangeIter == aRowDescriptions_RangeEnd) ); } +namespace +{ + +Reference< chart2::XCoordinateSystem > lcl_getCooSys( const Reference< chart2::XDiagram > & xNewDiagram ) +{ + Reference< chart2::XCoordinateSystem > xCooSys; + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDiagram, uno::UNO_QUERY ); + if(xCooSysCnt.is()) + { + Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); + if(aCooSysSeq.getLength()>0) + xCooSys = aCooSysSeq[0]; + } + return xCooSys; +} + +Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem >& xCooSys, + enum XMLTokenEnum eDimension, bool bPrimary=true ) +{ + Reference< chart2::XAxis > xNewAxis; + try + { + if( xCooSys.is() ) + { + sal_Int32 nDimensionIndex=0; + switch( eDimension ) + { + case XML_X: + nDimensionIndex=0; + break; + case XML_Y: + nDimensionIndex=1; + break; + case XML_Z: + nDimensionIndex=2; + break; + default: + break; + } + + xNewAxis = xCooSys->getAxisByDimension( nDimensionIndex, bPrimary ? 0 : 1 ); + } + } + catch( const uno::Exception & ) + { + } + return xNewAxis; +} + +} + void SchXMLExportHelper_Impl::exportPlotArea( Reference< chart::XDiagram > xDiagram, Reference< chart2::XDiagram > xNewDiagram, @@ -1783,8 +1910,6 @@ void SchXMLExportHelper_Impl::exportPlotArea( Reference< beans::XPropertySet > xPropSet; std::vector< XMLPropertyState > aPropertyStates; - OUString aASName; - sal_Bool bHasTwoYAxes = sal_False; sal_Bool bIs3DChart = sal_False; drawing::HomogenMatrix aTransMatrix; @@ -1892,16 +2017,6 @@ void SchXMLExportHelper_Impl::exportPlotArea( if( xPropSet.is()) { Any aAny; - try - { - aAny = xPropSet->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxis" ))); - aAny >>= bHasTwoYAxes; - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property HasSecondaryYAxis not found in Diagram" ); - } // 3d attributes try @@ -1952,7 +2067,8 @@ void SchXMLExportHelper_Impl::exportPlotArea( // series elements // --------------- - exportSeries( xNewDiagram, rPageSize, bExportContent, bHasTwoYAxes ); + Reference< chart2::XAxis > xSecondYAxis = lcl_getAxis( lcl_getCooSys( xNewDiagram ), XML_Y, false ); + exportSeries( xNewDiagram, rPageSize, bExportContent, xSecondYAxis.is() ); // stock-chart elements OUString sChartType ( xDiagram->getDiagramType()); @@ -2114,6 +2230,222 @@ void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< char SvXMLElementExport aCoordinateRegion( mrExport, XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, sal_True, sal_True );//#i100778# todo: change to chart namespace in future - dependent on fileformat } +namespace +{ + XMLTokenEnum lcl_getTimeUnitToken( sal_Int32 nTimeUnit ) + { + XMLTokenEnum eToken = XML_DAYS; + switch( nTimeUnit ) + { + case ::com::sun::star::chart::TimeUnit::YEAR: + eToken = XML_YEARS; + break; + case ::com::sun::star::chart::TimeUnit::MONTH: + eToken = XML_MONTHS; + break; + default://days + break; + } + return eToken; + } +} + +void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XPropertySet > xAxisProps ) +{ + if( !xAxisProps.is() ) + return; + + chart::TimeIncrement aIncrement; + if( (xAxisProps->getPropertyValue( OUString::createFromAscii( "TimeIncrement" )) >>= aIncrement) ) + { + sal_Int32 nTimeResolution = ::com::sun::star::chart::TimeUnit::DAY; + if( aIncrement.TimeResolution >>= nTimeResolution ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_BASE_TIME_UNIT, lcl_getTimeUnitToken( nTimeResolution ) ); + + OUStringBuffer aValue; + chart::TimeInterval aInterval; + if( aIncrement.MajorTimeInterval >>= aInterval ) + { + SvXMLUnitConverter::convertNumber( aValue, aInterval.Number ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_VALUE, aValue.makeStringAndClear() ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); + } + if( aIncrement.MinorTimeInterval >>= aInterval ) + { + SvXMLUnitConverter::convertNumber( aValue, aInterval.Number ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_VALUE, aValue.makeStringAndClear() ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); + } + + SvXMLElementExport aDateScale( mrExport, XML_NAMESPACE_CHART_EXT, XML_DATE_SCALE, sal_True, sal_True );//#i25706#todo: change namespace for next ODF version + } +} + +void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent ) +{ + if( !xTitleProps.is() ) + return; + std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xTitleProps ); + if( bExportContent ) + { + OUString aText; + Any aAny( xTitleProps->getPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); + aAny >>= aText; + + Reference< drawing::XShape > xShape( xTitleProps, uno::UNO_QUERY ); + if( xShape.is()) + addPosition( xShape ); + + AddAutoStyleAttribute( aPropertyStates ); + SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); + + // paragraph containing title + exportText( aText ); + } + else + { + CollectAutoStyle( aPropertyStates ); + } + aPropertyStates.clear(); +} + +void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent ) +{ + if( !xGridProperties.is() ) + return; + std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xGridProperties ); + if( bExportContent ) + { + AddAutoStyleAttribute( aPropertyStates ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, bMajor ? XML_MAJOR : XML_MINOR ); + SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); + } + else + { + CollectAutoStyle( aPropertyStates ); + } + aPropertyStates.clear(); +} + +namespace +{ + +//returns true if a date scale needs to be exported +bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExport& rExport) +{ + bool bExportDateScale = false; + if( !xChart2Axis.is() ) + return bExportDateScale; + + const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST ) //#i25706#todo: change version for next ODF version + return bExportDateScale; + + chart2::ScaleData aScale( xChart2Axis->getScaleData() ); + //#i25706#todo: change namespace for next ODF version + sal_uInt16 nNameSpace = XML_NAMESPACE_CHART_EXT; + + switch(aScale.AxisType) + { + case chart2::AxisType::CATEGORY: + if( aScale.AutoDateAxis ) + { + rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_AUTO ); + bExportDateScale = true; + } + else + rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_TEXT ); + break; + case chart2::AxisType::DATE: + rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_DATE ); + bExportDateScale = true; + break; + default: //AUTOMATIC + rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_AUTO ); + break; + } + + return bExportDateScale; +} + +} + +void SchXMLExportHelper_Impl::exportAxis( + enum XMLTokenEnum eDimension, + enum XMLTokenEnum eAxisName, + const Reference< beans::XPropertySet > xAxisProps, + const Reference< chart2::XAxis >& xChart2Axis, + const OUString& rCategoriesRange, + bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, + bool bExportContent ) +{ + static const OUString sNumFormat( OUString::createFromAscii( "NumberFormat" )); + std::vector< XMLPropertyState > aPropertyStates; + SvXMLElementExport* pAxis = NULL; + + // get property states for autostyles + if( xAxisProps.is() && mxExpPropMapper.is() ) + { + lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport ); + aPropertyStates = mxExpPropMapper->Filter( xAxisProps ); + } + + bool bExportDateScale = false; + if( bExportContent ) + { + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, eDimension ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, eAxisName ); + AddAutoStyleAttribute( aPropertyStates ); // write style name + if( rCategoriesRange.getLength() ) + bExportDateScale = lcl_exportAxisType( xChart2Axis, mrExport ); + + // open axis element + pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); + } + else + { + CollectAutoStyle( aPropertyStates ); + } + aPropertyStates.clear(); + + //date scale + if( bExportDateScale ) + exportDateScale( xAxisProps ); + + Reference< beans::XPropertySet > xTitleProps; + Reference< beans::XPropertySet > xMajorGridProps; + Reference< beans::XPropertySet > xMinorGridProps; + Reference< chart::XAxis > xAxis( xAxisProps, uno::UNO_QUERY ); + if( xAxis.is() ) + { + xTitleProps = bHasTitle ? xAxis->getAxisTitle() : 0; + xMajorGridProps = bHasMajorGrid ? xAxis->getMajorGrid() : 0; + xMinorGridProps = bHasMinorGrid ? xAxis->getMinorGrid() : 0; + } + + // axis-title + exportAxisTitle( xTitleProps , bExportContent ); + + // categories if we have a categories chart + if( bExportContent && rCategoriesRange.getLength() ) + { + mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, rCategoriesRange ); + SvXMLElementExport aCategories( mrExport, XML_NAMESPACE_CHART, XML_CATEGORIES, sal_True, sal_True ); + } + + // grid + exportGrid( xMajorGridProps, true, bExportContent ); + exportGrid( xMinorGridProps, false, bExportContent ); + + if( pAxis ) + { + //close axis element + delete pAxis; + pAxis = NULL; + } +} + void SchXMLExportHelper_Impl::exportAxes( const Reference< chart::XDiagram > & xDiagram, const Reference< chart2::XDiagram > & xNewDiagram, @@ -2123,13 +2455,6 @@ void SchXMLExportHelper_Impl::exportAxes( if( ! xDiagram.is()) return; - // variables for autostyles - const OUString sNumFormat( OUString::createFromAscii( "NumberFormat" )); - Reference< beans::XPropertySet > xPropSet; - std::vector< XMLPropertyState > aPropertyStates; - - OUString aASName; - // get some properties from document first sal_Bool bHasXAxis = sal_False, bHasYAxis = sal_False, @@ -2147,46 +2472,20 @@ void SchXMLExportHelper_Impl::exportAxes( bHasYAxisMinorGrid = sal_False, bHasZAxisMajorGrid = sal_False, bHasZAxisMinorGrid = sal_False; - sal_Bool bIs3DChart = sal_False; // get multiple properties using XMultiPropertySet MultiPropertySetHandler aDiagramProperties (xDiagram); - // Check for supported services and then the properties provided by this service. - Reference<lang::XServiceInfo> xServiceInfo (xDiagram, uno::UNO_QUERY); - if (xServiceInfo.is()) - { - if (xServiceInfo->supportsService( - OUString::createFromAscii ("com.sun.star.chart.ChartAxisXSupplier"))) - { - aDiagramProperties.Add ( - OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")), bHasXAxis); - } - if (xServiceInfo->supportsService( - OUString::createFromAscii ("com.sun.star.chart.ChartAxisYSupplier"))) - { - aDiagramProperties.Add ( - OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")), bHasYAxis); - } - if (xServiceInfo->supportsService( - OUString::createFromAscii ("com.sun.star.chart.ChartAxisZSupplier"))) - { - aDiagramProperties.Add ( - OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxis")), bHasZAxis); - } - if (xServiceInfo->supportsService( - OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisXSupplier"))) - { - aDiagramProperties.Add ( - OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")), bHasSecondaryXAxis); - } - if (xServiceInfo->supportsService( - OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisYSupplier"))) - { - aDiagramProperties.Add ( - OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")), bHasSecondaryYAxis); - } - } + aDiagramProperties.Add ( + OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")), bHasXAxis); + aDiagramProperties.Add ( + OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")), bHasYAxis); + aDiagramProperties.Add ( + OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxis")), bHasZAxis); + aDiagramProperties.Add ( + OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")), bHasSecondaryXAxis); + aDiagramProperties.Add ( + OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")), bHasSecondaryYAxis); aDiagramProperties.Add ( OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisTitle")), bHasXAxisTitle); @@ -2213,506 +2512,139 @@ void SchXMLExportHelper_Impl::exportAxes( aDiagramProperties.Add ( OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisHelpGrid")), bHasZAxisMinorGrid); - aDiagramProperties.Add( - OUString (RTL_CONSTASCII_USTRINGPARAM ("Dim3D")), bIs3DChart); - if ( ! aDiagramProperties.GetProperties ()) { DBG_WARNING ("Required properties not found in Chart diagram"); } - SvXMLElementExport* pAxis = NULL; + Reference< chart2::XCoordinateSystem > xCooSys( lcl_getCooSys(xNewDiagram) ); + + // write an axis element also if the axis itself is not visible, but a grid or a title + + OUString aCategoriesRange; + Reference< chart::XAxisSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY ); // x axis // ------- - - // write axis element also if the axis itself is not visible, but a grid or - // title - Reference< chart::XAxisXSupplier > xAxisXSupp( xDiagram, uno::UNO_QUERY ); - if( xAxisXSupp.is()) + Reference< ::com::sun::star::chart2::XAxis > xNewAxis = lcl_getAxis( xCooSys, XML_X ); + if( xNewAxis.is() ) { - bool bHasAxisProperties = false; - // get property states for autostyles - if( mxExpPropMapper.is()) + Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(0) : 0, uno::UNO_QUERY ); + if( mbHasCategoryLabels && bExportContent ) { - xPropSet = xAxisXSupp->getXAxis(); - if( xPropSet.is()) - { - bHasAxisProperties = true; - lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport ); - aPropertyStates = mxExpPropMapper->Filter( xPropSet ); - } - } - - if( bHasXAxis || - bHasXAxisTitle || bHasXAxisMajorGrid || bHasXAxisMinorGrid || - mbHasCategoryLabels || bHasAxisProperties ) - { - if( bExportContent ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_X ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_X ); - - // write style name - AddAutoStyleAttribute( aPropertyStates ); - - // element - pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); - } - else // autostyles - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - - // axis-title - if( bHasXAxisTitle ) + Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) ); + if( xCategories.is() ) { - Reference< beans::XPropertySet > xTitleProp( xAxisXSupp->getXAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) + Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() ); + if( xValues.is() ) { - aPropertyStates = mxExpPropMapper->Filter( xTitleProp ); - if( bExportContent ) - { - OUString aText; - Any aAny( xTitleProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); - aAny >>= aText; - - Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); - - AddAutoStyleAttribute( aPropertyStates ); - SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); - - // paragraph containing title - exportText( aText ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); + Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY ); + maCategoriesRange = xValues->getSourceRangeRepresentation(); + aCategoriesRange = lcl_ConvertRange( maCategoriesRange, xNewDoc ); } } - - // categories if we have a categories chart - if( bExportContent && - mbHasCategoryLabels ) - { - OUString aCategoriesRange; - // fill msString with cell-range-address of categories - // export own table references - if( xNewDiagram.is()) - { - Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) ); - if( xCategories.is() ) - { - Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() ); - if( xValues.is()) - { - Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY ); - maCategoriesRange = xValues->getSourceRangeRepresentation(); - aCategoriesRange = lcl_ConvertRange( maCategoriesRange, xNewDoc ); - } - } - } - - if( aCategoriesRange.getLength()) - mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, aCategoriesRange ); - SvXMLElementExport aCategories( mrExport, XML_NAMESPACE_CHART, XML_CATEGORIES, sal_True, sal_True ); - } - - // grid - Reference< beans::XPropertySet > xMajorGrid( xAxisXSupp->getXMainGrid(), uno::UNO_QUERY ); - if( bHasXAxisMajorGrid && xMajorGrid.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xMajorGrid ); - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - Reference< beans::XPropertySet > xMinorGrid( xAxisXSupp->getXHelpGrid(), uno::UNO_QUERY ); - if( bHasXAxisMinorGrid && xMinorGrid.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xMinorGrid ); - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - if( pAxis ) - { - delete pAxis; - pAxis = NULL; - } } + exportAxis( XML_X, XML_PRIMARY_X, xAxisProps, xNewAxis, aCategoriesRange, bHasXAxisTitle, bHasXAxisMajorGrid, bHasXAxisMinorGrid, bExportContent ); + aCategoriesRange = OUString(); } // secondary x axis - if( bHasSecondaryXAxis || bHasSecondaryXAxisTitle ) + // ------- + Reference< chart::XSecondAxisTitleSupplier > xSecondTitleSupp( xDiagram, uno::UNO_QUERY ); + xNewAxis = lcl_getAxis( xCooSys, XML_X, false ); + if( xNewAxis.is() ) { - Reference< chart::XTwoAxisXSupplier > xAxisTwoXSupp( xDiagram, uno::UNO_QUERY ); - if( xAxisTwoXSupp.is()) - { - // get property states for autostyles - if( mxExpPropMapper.is()) - { - xPropSet = xAxisTwoXSupp->getSecondaryXAxis(); - lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport ); - if( xPropSet.is()) - aPropertyStates = mxExpPropMapper->Filter( xPropSet ); - } - if( bExportContent ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_X ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_X ); - AddAutoStyleAttribute( aPropertyStates ); - pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); - } - else // autostyles - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - - if( bHasSecondaryXAxisTitle ) - { - Reference< chart::XSecondAxisTitleSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY ); - Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getSecondXAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xTitleProp ); - if( bExportContent ) - { - OUString aText; - Any aAny( xTitleProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); - aAny >>= aText; - - Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); - - AddAutoStyleAttribute( aPropertyStates ); - SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); - - exportText( aText ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - } - - if( pAxis ) - { - delete pAxis; - pAxis = NULL; - } - } + Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getSecondaryAxis(0) : 0, uno::UNO_QUERY ); + exportAxis( XML_X, XML_SECONDARY_X, xAxisProps, xNewAxis, aCategoriesRange, bHasSecondaryXAxisTitle, false, false, bExportContent ); } // y axis // ------- - - // write axis element also if the axis itself is not visible, but a grid or - // title - Reference< chart::XAxisYSupplier > xAxisYSupp( xDiagram, uno::UNO_QUERY ); - if( xAxisYSupp.is()) + xNewAxis = lcl_getAxis( xCooSys, XML_Y ); + if( xNewAxis.is() ) { - bool bHasAxisProperties = false; - // get property states for autostyles - if( mxExpPropMapper.is()) - { - xPropSet = xAxisYSupp->getYAxis(); - if( xPropSet.is()) - { - bHasAxisProperties = true; - lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport ); - aPropertyStates = mxExpPropMapper->Filter( xPropSet ); - } - } - - if( bHasYAxis || - bHasYAxisTitle || bHasYAxisMajorGrid || bHasYAxisMinorGrid || bHasAxisProperties ) - { - if( bExportContent ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Y ); - AddAutoStyleAttribute( aPropertyStates ); - pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - - // axis-title - if( bHasYAxisTitle ) - { - Reference< beans::XPropertySet > xTitleProp( xAxisYSupp->getYAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xTitleProp ); - if( bExportContent ) - { - OUString aText; - Any aAny( xTitleProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); - aAny >>= aText; - - Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); - - AddAutoStyleAttribute( aPropertyStates ); - SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); - - // paragraph containing title - exportText( aText ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - } - - // grid - Reference< beans::XPropertySet > xMajorGrid( xAxisYSupp->getYMainGrid(), uno::UNO_QUERY ); - if( bHasYAxisMajorGrid && xMajorGrid.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xMajorGrid ); - - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - // minor grid - Reference< beans::XPropertySet > xMinorGrid( xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY ); - if( bHasYAxisMinorGrid && xMinorGrid.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xMinorGrid ); - - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - if( pAxis ) - { - delete pAxis; - pAxis = NULL; - } - } + Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(1) : 0, uno::UNO_QUERY ); + exportAxis( XML_Y, XML_PRIMARY_Y, xAxisProps, xNewAxis, aCategoriesRange, bHasYAxisTitle, bHasYAxisMajorGrid, bHasYAxisMinorGrid, bExportContent ); } - if( bHasSecondaryYAxis || bHasSecondaryYAxisTitle ) + // secondary y axis + // ------- + xNewAxis = lcl_getAxis( xCooSys, XML_Y, false ); + if( xNewAxis.is() ) { - Reference< chart::XTwoAxisYSupplier > xAxisTwoYSupp( xDiagram, uno::UNO_QUERY ); - if( xAxisTwoYSupp.is()) - { - // get property states for autostyles - if( mxExpPropMapper.is()) - { - xPropSet = xAxisTwoYSupp->getSecondaryYAxis(); - lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport ); - if( xPropSet.is()) - aPropertyStates = mxExpPropMapper->Filter( xPropSet ); - } - if( bExportContent ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_Y ); - AddAutoStyleAttribute( aPropertyStates ); - pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); - } - else // autostyles - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - if( bHasSecondaryYAxisTitle ) - { - Reference< chart::XSecondAxisTitleSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY ); - Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getSecondYAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xTitleProp ); - if( bExportContent ) - { - OUString aText; - Any aAny( xTitleProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); - aAny >>= aText; - - Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); - - AddAutoStyleAttribute( aPropertyStates ); - SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); - - exportText( aText ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - } - - if( pAxis ) - { - delete pAxis; - pAxis = NULL; - } - } + Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getSecondaryAxis(1) : 0, uno::UNO_QUERY ); + exportAxis( XML_Y, XML_SECONDARY_Y, xAxisProps, xNewAxis, aCategoriesRange, bHasSecondaryYAxisTitle, false, false, bExportContent ); } // z axis // ------- + xNewAxis = lcl_getAxis( xCooSys, XML_Z ); + if( xNewAxis.is() ) + { + Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(2) : 0, uno::UNO_QUERY ); + exportAxis( XML_Z, XML_PRIMARY_Z, xAxisProps, xNewAxis, aCategoriesRange, bHasZAxisTitle, bHasZAxisMajorGrid, bHasZAxisMinorGrid, bExportContent ); + } +} - if( bHasZAxis && - bIs3DChart ) +namespace +{ + bool lcl_hasNoValuesButText( const uno::Reference< chart2::data::XDataSequence >& xDataSequence ) { - Reference< chart::XAxisZSupplier > xAxisZSupp( xDiagram, uno::UNO_QUERY ); - if( xAxisZSupp.is()) - { - // get property states for autostyles - if( mxExpPropMapper.is()) - { - xPropSet = xAxisZSupp->getZAxis(); - lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport ); - if( xPropSet.is()) - aPropertyStates = mxExpPropMapper->Filter( xPropSet ); - } - if( bExportContent ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Z ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Z ); + if( !xDataSequence.is() ) + return false;//have no data - AddAutoStyleAttribute( aPropertyStates ); - pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True ); - } - else + Sequence< uno::Any > aData; + Reference< chart2::data::XNumericalDataSequence > xNumericalDataSequence( xDataSequence, uno::UNO_QUERY ); + if( xNumericalDataSequence.is() ) + { + Sequence< double > aDoubles( xNumericalDataSequence->getNumericalData() ); + sal_Int32 nCount = aDoubles.getLength(); + for( sal_Int32 i = 0; i < nCount; ++i ) { - CollectAutoStyle( aPropertyStates ); + if( !::rtl::math::isNan( aDoubles[i] ) ) + return false;//have double value } - aPropertyStates.clear(); - - // axis-title - if( bHasZAxisTitle ) + } + else + { + aData = xDataSequence->getData(); + double fDouble = 0.0; + sal_Int32 nCount = aData.getLength(); + for( sal_Int32 i = 0; i < nCount; ++i ) { - Reference< beans::XPropertySet > xTitleProp( xAxisZSupp->getZAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xTitleProp ); - if( bExportContent ) - { - OUString aText; - Any aAny( xTitleProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )))); - aAny >>= aText; - - Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); - - AddAutoStyleAttribute( aPropertyStates ); - SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True ); - - // paragraph containing title - exportText( aText ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } + if( (aData[i] >>= fDouble) && !::rtl::math::isNan( fDouble ) ) + return false;//have double value } - // grid - Reference< beans::XPropertySet > xMajorGrid( xAxisZSupp->getZMainGrid(), uno::UNO_QUERY ); - if( bHasZAxisMajorGrid && xMajorGrid.is()) - { - aPropertyStates = mxExpPropMapper->Filter( xMajorGrid ); + } + //no values found - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); - } - // minor grid - Reference< beans::XPropertySet > xMinorGrid( xAxisZSupp->getZHelpGrid(), uno::UNO_QUERY ); - if( bHasZAxisMinorGrid && xMinorGrid.is()) + Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY ); + if( xTextualDataSequence.is() ) + { + uno::Sequence< rtl::OUString > aStrings( xTextualDataSequence->getTextualData() ); + sal_Int32 nCount = aStrings.getLength(); + for( sal_Int32 i = 0; i < nCount; ++i ) { - aPropertyStates = mxExpPropMapper->Filter( xMinorGrid ); - - if( bExportContent ) - { - AddAutoStyleAttribute( aPropertyStates ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR ); - SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True ); - } - else - { - CollectAutoStyle( aPropertyStates ); - } - aPropertyStates.clear(); + if( aStrings[i].getLength() ) + return true;//have text } } - if( pAxis ) + else { - delete pAxis; - pAxis = NULL; + if( !aData.getLength() ) + aData = xDataSequence->getData(); + uno::Any aAny; + OUString aString; + sal_Int32 nCount = aData.getLength(); + for( sal_Int32 i = 0; i < nCount; ++i ) + { + if( (aData[i]>>=aString) && aString.getLength() ) + return true;//have text + } } + //no doubles and no texts + return false; } } @@ -2957,6 +2889,17 @@ void SchXMLExportHelper_Impl::exportSeries( if( lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport ) ) m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xValues )); } + else if( nSeriesIdx==0 ) + { + //might be that the categories are used as x-values (e.g. for date axis) -> export them accordingly + Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) ); + if( xCategories.is() ) + { + Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() ); + if( !lcl_hasNoValuesButText( xValues ) ) + lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport ); + } + } } if( xYValuesForBubbleChart.is() ) m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xYValuesForBubbleChart )); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 338b9c23a004..a033dcb60e7d 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -143,11 +143,9 @@ SchXMLImportHelper::SchXMLImportHelper() : mpChartElemTokenMap( 0 ), mpPlotAreaElemTokenMap( 0 ), mpSeriesElemTokenMap( 0 ), - mpAxisElemTokenMap( 0 ), mpChartAttrTokenMap( 0 ), mpPlotAreaAttrTokenMap( 0 ), - mpAxisAttrTokenMap( 0 ), mpLegendAttrTokenMap( 0 ), mpAutoStyleAttrTokenMap( 0 ), mpCellAttrTokenMap( 0 ), @@ -169,15 +167,11 @@ SchXMLImportHelper::~SchXMLImportHelper() delete mpPlotAreaElemTokenMap; if( mpSeriesElemTokenMap ) delete mpSeriesElemTokenMap; - if( mpAxisElemTokenMap ) - delete mpAxisElemTokenMap; if( mpChartAttrTokenMap ) delete mpChartAttrTokenMap; if( mpPlotAreaAttrTokenMap ) delete mpPlotAreaAttrTokenMap; - if( mpAxisAttrTokenMap ) - delete mpAxisAttrTokenMap; if( mpLegendAttrTokenMap ) delete mpLegendAttrTokenMap; if( mpAutoStyleAttrTokenMap ) @@ -320,24 +314,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetSeriesElemTokenMap() return *mpSeriesElemTokenMap; } -const SvXMLTokenMap& SchXMLImportHelper::GetAxisElemTokenMap() -{ - if( ! mpAxisElemTokenMap ) - { - static __FAR_DATA SvXMLTokenMapEntry aAxisElemTokenMap[] = -{ - { XML_NAMESPACE_CHART, XML_TITLE, XML_TOK_AXIS_TITLE }, - { XML_NAMESPACE_CHART, XML_CATEGORIES, XML_TOK_AXIS_CATEGORIES }, - { XML_NAMESPACE_CHART, XML_GRID, XML_TOK_AXIS_GRID }, - XML_TOKEN_MAP_END -}; - - mpAxisElemTokenMap = new SvXMLTokenMap( aAxisElemTokenMap ); - } // if( ! mpAxisElemTokenMap ) - - return *mpAxisElemTokenMap; -} - // ---------------------------------------- const SvXMLTokenMap& SchXMLImportHelper::GetChartAttrTokenMap() @@ -395,24 +371,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaAttrTokenMap() return *mpPlotAreaAttrTokenMap; } -const SvXMLTokenMap& SchXMLImportHelper::GetAxisAttrTokenMap() -{ - if( ! mpAxisAttrTokenMap ) - { - static __FAR_DATA SvXMLTokenMapEntry aAxisAttrTokenMap[] = -{ - { XML_NAMESPACE_CHART, XML_DIMENSION, XML_TOK_AXIS_DIMENSION }, - { XML_NAMESPACE_CHART, XML_NAME, XML_TOK_AXIS_NAME }, - { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_AXIS_STYLE_NAME }, - XML_TOKEN_MAP_END -}; - - mpAxisAttrTokenMap = new SvXMLTokenMap( aAxisAttrTokenMap ); - } // if( ! mpAxisAttrTokenMap ) - - return *mpAxisAttrTokenMap; -} - const SvXMLTokenMap& SchXMLImportHelper::GetLegendAttrTokenMap() { if( ! mpLegendAttrTokenMap ) @@ -717,7 +675,7 @@ SchXMLImport::~SchXMLImport() throw () // create the main context (subcontexts are created // by the one created here) -SvXMLImportContext *SchXMLImport::CreateContext( USHORT nPrefix, const OUString& rLocalName, +SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList >& xAttrList ) { SvXMLImportContext* pContext = 0; diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx index bcd201153b7f..7835f0cbe4d3 100644 --- a/xmloff/source/chart/SchXMLParagraphContext.cxx +++ b/xmloff/source/chart/SchXMLParagraphContext.cxx @@ -66,7 +66,7 @@ void SchXMLParagraphContext::StartElement( const uno::Reference< xml::sax::XAttr { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if (IsXMLToken(aLocalName, XML_ID)) { @@ -93,7 +93,7 @@ void SchXMLParagraphContext::EndElement() } SvXMLImportContext* SchXMLParagraphContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { diff --git a/xmloff/source/chart/SchXMLParagraphContext.hxx b/xmloff/source/chart/SchXMLParagraphContext.hxx index a40c305d5d2c..fc6cccf97c43 100644 --- a/xmloff/source/chart/SchXMLParagraphContext.hxx +++ b/xmloff/source/chart/SchXMLParagraphContext.hxx @@ -54,7 +54,7 @@ public: virtual void EndElement(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index ef1544b4a280..8b559d6279a8 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -30,6 +30,7 @@ #include "SchXMLPlotAreaContext.hxx" #include "SchXMLImport.hxx" +#include "SchXMLAxisContext.hxx" #include "SchXMLSeries2Context.hxx" #include "SchXMLTools.hxx" #include <tools/debug.hxx> @@ -39,7 +40,6 @@ #include <comphelper/processfactory.hxx> #include "xmloff/xmlnmspe.hxx" -#include <xmloff/xmltoken.hxx> #include <xmloff/xmlement.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> @@ -51,29 +51,18 @@ #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Size.hpp> -#include <com/sun/star/chart/ChartAxisLabelPosition.hpp> -#include <com/sun/star/chart/ChartAxisMarkPosition.hpp> -#include <com/sun/star/chart/ChartAxisPosition.hpp> -#include <com/sun/star/chart/XTwoAxisXSupplier.hpp> -#include <com/sun/star/chart/XTwoAxisYSupplier.hpp> -#include <com/sun/star/chart/XAxisZSupplier.hpp> -#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/X3DDisplay.hpp> #include <com/sun/star/chart/XStatisticDisplay.hpp> #include <com/sun/star/chart/XDiagramPositioning.hpp> -#include <com/sun/star/chart2/XChartDocument.hpp> -#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> -#include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/drawing/CameraGeometry.hpp> #include <com/sun/star/drawing/FillStyle.hpp> -#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/util/XStringMapping.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> @@ -84,14 +73,6 @@ using namespace ::xmloff::token; using ::rtl::OUString; using com::sun::star::uno::Reference; -static __FAR_DATA SvXMLEnumMapEntry aXMLAxisClassMap[] = -{ - { XML_X, SCH_XML_AXIS_X }, - { XML_Y, SCH_XML_AXIS_Y }, - { XML_Z, SCH_XML_AXIS_Z }, - { XML_TOKEN_INVALID, 0 } -}; - namespace { @@ -115,19 +96,6 @@ OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const uno::Reference< return aResult; } -Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem > xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) -{ - Reference< chart2::XAxis > xAxis; - try - { - xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); - } - catch( uno::Exception & ) - { - } - return xAxis; -} - } // anonymous namespace SchXML3DSceneAttributesHelper::SchXML3DSceneAttributesHelper( SvXMLImport& rImporter ) @@ -239,47 +207,33 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( { try { - if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisXSupplier" ))) - { - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasXAxis" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasXAxisGrid" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasXAxisDescription" ), aFalseBool ); - } - if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisXSupplier" ))) - { - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryXAxisDescription" ), aFalseBool ); - } + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasXAxis" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasXAxisGrid" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasXAxisDescription" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasSecondaryXAxisDescription" ), aFalseBool ); + + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasYAxis" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasYAxisGrid" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasYAxisDescription" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasSecondaryYAxisDescription" ), aFalseBool ); + + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasZAxis" ), aFalseBool ); + xProp->setPropertyValue( + rtl::OUString::createFromAscii( "HasZAxisDescription" ), aFalseBool ); - if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisYSupplier" ))) - { - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasYAxis" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasYAxisGrid" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasYAxisDescription" ), aFalseBool ); - } - if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisYSupplier" ))) - { - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryYAxisDescription" ), aFalseBool ); - } - - if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisZSupplier" ))) - { - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasZAxis" ), aFalseBool ); - xProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasZAxisDescription" ), aFalseBool ); - } uno::Any aAny; chart::ChartDataRowSource eSource = chart::ChartDataRowSource_COLUMNS; aAny <<= eSource; @@ -307,7 +261,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { @@ -511,7 +465,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri } SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { @@ -623,7 +577,7 @@ void SchXMLPlotAreaContext::EndElement() ::std::vector< SchXMLAxis >::const_iterator aIt( ::std::find_if( maAxes.begin(), maAxes.end(), lcl_AxisHasCategories())); if( aIt != maAxes.end()) - nDimension = static_cast< sal_Int32 >( (*aIt).eClass ); + nDimension = static_cast< sal_Int32 >( (*aIt).eDimension ); SchXMLTools::CreateCategories( xDataProvider, mxNewDoc, mrCategoriesAddress, 0 /* nCooSysIndex */, @@ -708,875 +662,7 @@ void SchXMLPlotAreaContext::EndElement() } } - CorrectAxisPositions(); -} - -void SchXMLPlotAreaContext::CorrectAxisPositions() -{ - ::rtl::OUString aODFVersionOfFile( GetImport().GetODFVersion() ); - - if( ( !aODFVersionOfFile.getLength() || aODFVersionOfFile.equalsAscii("1.0") - || aODFVersionOfFile.equalsAscii("1.1") - || ( aODFVersionOfFile.equalsAscii("1.2") && !m_bAxisPositionAttributeImported ) ) ) - { - uno::Reference< chart2::XChartDocument > xNewDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ); - - try - { - Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); - uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); - if( aCooSysSeq.getLength() ) - { - Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); - if( xCooSys.is() ) - { - Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 ); - Reference< chart2::XAxis > xMainYAxis = lcl_getAxis( xCooSys, 1, 0 ); - //Reference< chart2::XAxis > xMajorZAxis = lcl_getAxis( xCooSys, 2, 0 ); - Reference< chart2::XAxis > xSecondaryXAxis = lcl_getAxis( xCooSys, 0, 1 ); - Reference< chart2::XAxis > xSecondaryYAxis = lcl_getAxis( xCooSys, 1, 1 ); - - uno::Reference< beans::XPropertySet > xMainXAxisProp( xMainXAxis, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xMainYAxisProp( xMainYAxis, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xSecondaryXAxisProp( xSecondaryXAxis, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xSecondaryYAxisProp( xSecondaryYAxis, uno::UNO_QUERY ); - - if( xMainXAxisProp.is() && xMainYAxisProp.is() ) - { - chart2::ScaleData aMainXScale = xMainXAxis->getScaleData(); - if( 0 == maChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) ) - { - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); - double fCrossoverValue = 0.0; - aMainXScale.Origin >>= fCrossoverValue; - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverValue") - , uno::makeAny( fCrossoverValue ) ); - - if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) - { - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); - if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); - } - else - { - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); - if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); - } - } - else - { - if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) - { - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); - if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); - } - else - { - xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); - if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); - } - } - - chart2::ScaleData aMainYScale = xMainYAxis->getScaleData(); - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); - double fCrossoverValue = 0.0; - aMainYScale.Origin >>= fCrossoverValue; - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverValue") - , uno::makeAny( fCrossoverValue ) ); - - if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE ) - { - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); - if( xSecondaryXAxisProp.is() ) - xSecondaryXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); - } - else - { - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); - xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); - if( xSecondaryXAxisProp.is() ) - xSecondaryXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition") - , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); - } - } - } - } - } - catch( uno::Exception & ) - { - } - } -} - -// ======================================== - -SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const rtl::OUString& rLocalName, - uno::Reference< chart::XDiagram > xDiagram, - std::vector< SchXMLAxis >& aAxes, - ::rtl::OUString & rCategoriesAddress, - bool bAddMissingXAxisForNetCharts, - bool bAdaptWrongPercentScaleValues, - bool bAdaptXAxisOrientationForOld2DBarCharts, - bool& rbAxisPositionAttributeImported ) : - SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), - mrImportHelper( rImpHelper ), - mxDiagram( xDiagram ), - maAxes( aAxes ), - mrCategoriesAddress( rCategoriesAddress ), - mbAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ), - mbAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ), - mbAdaptXAxisOrientationForOld2DBarCharts( bAdaptXAxisOrientationForOld2DBarCharts ), - m_rbAxisPositionAttributeImported( rbAxisPositionAttributeImported ) -{ -} - -SchXMLAxisContext::~SchXMLAxisContext() -{} - -/* returns a shape for the current axis's title. The property - "Has...AxisTitle" is set to "True" to get the shape - */ -uno::Reference< drawing::XShape > SchXMLAxisContext::getTitleShape() -{ - uno::Reference< drawing::XShape > xResult; - uno::Any aTrueBool; - aTrueBool <<= (sal_Bool)(sal_True); - uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY ); - - switch( maCurrentAxis.eClass ) - { - case SCH_XML_AXIS_X: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasXAxisTitle" ), aTrueBool ); - xResult = uno::Reference< drawing::XShape >( xSuppl->getXAxisTitle(), uno::UNO_QUERY ); - } - } - else - { - uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() ) - { - if( xDiaProp.is() ) - xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasSecondaryXAxisTitle" ), aTrueBool ); - xResult = uno::Reference< drawing::XShape >( xSuppl->getSecondXAxisTitle(), uno::UNO_QUERY ); - } - } - break; - case SCH_XML_AXIS_Y: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasYAxisTitle" ), aTrueBool ); - xResult = uno::Reference< drawing::XShape >( xSuppl->getYAxisTitle(), uno::UNO_QUERY ); - } - } - else - { - uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() ) - { - if( xDiaProp.is() ) - xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasSecondaryYAxisTitle" ), aTrueBool ); - xResult = uno::Reference< drawing::XShape >( xSuppl->getSecondYAxisTitle(), uno::UNO_QUERY ); - } - } - break; - case SCH_XML_AXIS_Z: - { - uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasZAxisTitle" ), aTrueBool ); - xResult = uno::Reference< drawing::XShape >( xSuppl->getZAxisTitle(), uno::UNO_QUERY ); - } - break; - } - case SCH_XML_AXIS_UNDEF: - DBG_ERROR( "Invalid axis" ); - break; - } - - return xResult; -} - -void SchXMLAxisContext::CreateGrid( ::rtl::OUString sAutoStyleName, - sal_Bool bIsMajor ) -{ - uno::Reference< chart::XDiagram > xDia = mrImportHelper.GetChartDocument()->getDiagram(); - uno::Reference< beans::XPropertySet > xGridProp; - ::rtl::OUString sPropertyName; - DBG_ASSERT( xDia.is(), "diagram object is invalid!" ); - - uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY ); - uno::Any aTrueBool( uno::makeAny( true )); - - switch( maCurrentAxis.eClass ) - { - case SCH_XML_AXIS_X: - { - uno::Reference< chart::XAxisXSupplier > xSuppl( xDia, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( bIsMajor ) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasXAxisGrid"), aTrueBool ); - xGridProp = xSuppl->getXMainGrid(); - } - else - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasXAxisHelpGrid"), aTrueBool ); - xGridProp = xSuppl->getXHelpGrid(); - } - } - } - break; - case SCH_XML_AXIS_Y: - { - uno::Reference< chart::XAxisYSupplier > xSuppl( xDia, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( bIsMajor ) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasYAxisGrid"), aTrueBool ); - xGridProp = xSuppl->getYMainGrid(); - } - else - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasYAxisHelpGrid"), aTrueBool ); - xGridProp = xSuppl->getYHelpGrid(); - } - } - } - break; - case SCH_XML_AXIS_Z: - { - uno::Reference< chart::XAxisZSupplier > xSuppl( xDia, uno::UNO_QUERY ); - if( xSuppl.is()) - { - if( bIsMajor ) - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasZAxisGrid"), aTrueBool ); - xGridProp = xSuppl->getZMainGrid(); - } - else - { - if( xDiaProp.is()) - xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasZAxisHelpGrid"), aTrueBool ); - xGridProp = xSuppl->getZHelpGrid(); - } - } - } - break; - case SCH_XML_AXIS_UNDEF: - DBG_ERROR( "Invalid axis" ); - break; - } - - // set properties - if( xGridProp.is()) - { - // the line color is black as default, in the model it is a light gray - xGridProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), - uno::makeAny( COL_BLACK )); - if( sAutoStyleName.getLength()) - { - const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext(); - if( pStylesCtxt ) - { - const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( - mrImportHelper.GetChartFamilyID(), sAutoStyleName ); - - if( pStyle && pStyle->ISA( XMLPropStyleContext )) - (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp ); - } - } - } -} - -void SchXMLAxisContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) -{ - // parse attributes - sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; - SchXMLImport& rImport = ( SchXMLImport& )GetImport(); - const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetAxisAttrTokenMap(); - - for( sal_Int16 i = 0; i < nAttrCount; i++ ) - { - rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); - rtl::OUString aLocalName; - rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); - - switch( rAttrTokenMap.Get( nPrefix, aLocalName )) - { - case XML_TOK_AXIS_DIMENSION: - { - USHORT nEnumVal; - if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisClassMap )) - maCurrentAxis.eClass = ( SchXMLAxisClass )nEnumVal; - } - break; - case XML_TOK_AXIS_NAME: - maCurrentAxis.aName = aValue; - break; - case XML_TOK_AXIS_STYLE_NAME: - msAutoStyleName = aValue; - break; - } - } - - // check for number of axes with same category - maCurrentAxis.nIndexInCategory = 0; - sal_Int32 nNumOfAxes = maAxes.size(); - for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ ) - { - if( maAxes[ nCurrent ].eClass == maCurrentAxis.eClass ) - maCurrentAxis.nIndexInCategory++; - } - CreateAxis(); -} -namespace -{ - -uno::Reference< chart2::XAxis > lcl_getAxis( const uno::Reference< frame::XModel >& xChartModel, - sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) -{ - uno::Reference< chart2::XAxis > xAxis; - - try - { - uno::Reference< chart2::XChartDocument > xChart2Document( xChartModel, uno::UNO_QUERY ); - if( xChart2Document.is() ) - { - uno::Reference< chart2::XDiagram > xDiagram( xChart2Document->getFirstDiagram()); - uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > - aCooSysSeq( xCooSysCnt->getCoordinateSystems()); - sal_Int32 nCooSysIndex = 0; - if( nCooSysIndex < aCooSysSeq.getLength() ) - { - uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] ); - if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() ) - { - const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); - if( nAxisIndex <= nMaxAxisIndex ) - xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); - } - } - } - } - catch( uno::Exception & ) - { - DBG_ERROR( "Couldn't get axis" ); - } - - return xAxis; -} - -bool lcl_divideBy100( uno::Any& rDoubleAny ) -{ - bool bChanged = false; - double fValue=0.0; - if( (rDoubleAny>>=fValue) && (fValue!=0.0) ) - { - fValue/=100.0; - rDoubleAny = uno::makeAny(fValue); - bChanged = true; - } - return bChanged; -} - -bool lcl_AdaptWrongPercentScaleValues(chart2::ScaleData& rScaleData) -{ - bool bChanged = lcl_divideBy100( rScaleData.Minimum ); - bChanged = lcl_divideBy100( rScaleData.Maximum ) || bChanged; - bChanged = lcl_divideBy100( rScaleData.Origin ) || bChanged; - bChanged = lcl_divideBy100( rScaleData.IncrementData.Distance ) || bChanged; - return bChanged; -} - -}//end anonymous namespace - -void SchXMLAxisContext::CreateAxis() -{ - // add new Axis to list - maAxes.push_back( maCurrentAxis ); - - // set axis at chart - uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xProp; - uno::Any aTrueBool; - aTrueBool <<= (sal_Bool)(sal_True); - uno::Any aFalseBool; - aFalseBool <<= (sal_Bool)(sal_False); - uno::Reference< frame::XModel > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ); - - switch( maCurrentAxis.eClass ) - { - case SCH_XML_AXIS_X: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - try - { - xDiaProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasXAxis" ), aTrueBool ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on x axis" ); - } - uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - xProp = xSuppl->getXAxis(); - } - else - { - try - { - xDiaProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aTrueBool ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on second x axis" ); - } - uno::Reference< chart::XTwoAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - xProp = xSuppl->getSecondaryXAxis(); - } - break; - - case SCH_XML_AXIS_Y: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - try - { - xDiaProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasYAxis" ), aTrueBool ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on y axis" ); - } - uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - xProp = xSuppl->getYAxis(); - - - if( mbAddMissingXAxisForNetCharts ) - { - if( xDiaProp.is() ) - { - try - { - xDiaProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasXAxis" ), uno::makeAny(sal_True) ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on x axis" ); - } - } - } - } - else - { - try - { - xDiaProp->setPropertyValue( - rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aTrueBool ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on second y axis" ); - } - uno::Reference< chart::XTwoAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - xProp = xSuppl->getSecondaryYAxis(); - } - break; - - case SCH_XML_AXIS_Z: - { - bool bSettingZAxisSuccedded = false; - try - { - rtl::OUString sHasZAxis( rtl::OUString::createFromAscii( "HasZAxis" ) ); - xDiaProp->setPropertyValue( sHasZAxis, aTrueBool ); - xDiaProp->getPropertyValue( sHasZAxis ) >>= bSettingZAxisSuccedded; - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Couldn't turn on z axis" ); - } - if( bSettingZAxisSuccedded ) - { - uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is()) - xProp = xSuppl->getZAxis(); - } - } - break; - case SCH_XML_AXIS_UNDEF: - // nothing - break; - } - - // set properties - if( xProp.is()) - { - // #i109879# the line color is black as default, in the model it is a light gray - xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), - uno::makeAny( COL_BLACK )); - - xProp->setPropertyValue( rtl::OUString::createFromAscii( "DisplayLabels" ), aFalseBool ); - - // #88077# AutoOrigin 'on' is default - xProp->setPropertyValue( rtl::OUString::createFromAscii( "AutoOrigin" ), aTrueBool ); - - if( msAutoStyleName.getLength()) - { - const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext(); - if( pStylesCtxt ) - { - const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( - mrImportHelper.GetChartFamilyID(), msAutoStyleName ); - - if( pStyle && pStyle->ISA( XMLPropStyleContext )) - { - // note: SvXMLStyleContext::FillPropertySet is not const - XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle )); - if( pPropStyleContext ) - pPropStyleContext->FillPropertySet( xProp ); - - if( mbAdaptWrongPercentScaleValues && maCurrentAxis.eClass==SCH_XML_AXIS_Y ) - { - //set scale data of added x axis back to default - uno::Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), - 1 /*nDimensionIndex*/, maCurrentAxis.nIndexInCategory /*nAxisIndex*/ ) ); - if( xAxis.is() ) - { - chart2::ScaleData aScaleData( xAxis->getScaleData()); - if( lcl_AdaptWrongPercentScaleValues(aScaleData) ) - xAxis->setScaleData( aScaleData ); - } - } - - if( mbAddMissingXAxisForNetCharts ) - { - //copy style from y axis to added x axis: - - uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() ) - { - uno::Reference< beans::XPropertySet > xXAxisProp( xSuppl->getXAxis() ); - (( XMLPropStyleContext* )pStyle )->FillPropertySet( xXAxisProp ); - } - - //set scale data of added x axis back to default - uno::Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), - 0 /*nDimensionIndex*/, 0 /*nAxisIndex*/ ) ); - if( xAxis.is() ) - { - chart2::ScaleData aScaleData; - aScaleData.AxisType = chart2::AxisType::CATEGORY; - aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL; - xAxis->setScaleData( aScaleData ); - } - - //set line style of added x axis to invisible - uno::Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY ); - if( xNewAxisProp.is() ) - { - xNewAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LineStyle") - , uno::makeAny(drawing::LineStyle_NONE)); - } - } - - if( mbAdaptXAxisOrientationForOld2DBarCharts && maCurrentAxis.eClass == SCH_XML_AXIS_X ) - { - bool bIs3DChart = false; - if( xDiaProp.is() && ( xDiaProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart ) - && !bIs3DChart ) - { - uno::Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY ); - if( xChart2Document.is() ) - { - uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChart2Document->getFirstDiagram(), uno::UNO_QUERY ); - if( xCooSysCnt.is() ) - { - uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); - if( aCooSysSeq.getLength() ) - { - bool bSwapXandYAxis = false; - uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); - uno::Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); - if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis ) - && bSwapXandYAxis ) - { - uno::Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, maCurrentAxis.nIndexInCategory ); - if( xAxis.is() ) - { - chart2::ScaleData aScaleData = xAxis->getScaleData(); - aScaleData.Orientation = chart2::AxisOrientation_REVERSE; - xAxis->setScaleData( aScaleData ); - } - } - } - } - } - } - } - - m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue(); - } - } - } - } -} - -void SchXMLAxisContext::SetAxisTitle() -{ - // add new Axis to list - maAxes.push_back( maCurrentAxis ); - - // set axis at chart - sal_Bool bHasTitle = ( maCurrentAxis.aTitle.getLength() > 0 ); - uno::Reference< frame::XModel > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ); - - switch( maCurrentAxis.eClass ) - { - case SCH_XML_AXIS_X: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() && - bHasTitle ) - { - uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getXAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - try - { - uno::Any aAny; - aAny <<= maCurrentAxis.aTitle; - xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property String for Title not available" ); - } - } - } - } - else - { - uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() && - bHasTitle ) - { - uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getSecondXAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - try - { - uno::Any aAny; - aAny <<= maCurrentAxis.aTitle; - xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property String for Title not available" ); - } - } - } - } - break; - - case SCH_XML_AXIS_Y: - if( maCurrentAxis.nIndexInCategory == 0 ) - { - uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() && - bHasTitle ) - { - uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getYAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - try - { - uno::Any aAny; - aAny <<= maCurrentAxis.aTitle; - xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property String for Title not available" ); - } - } - } - } - else - { - uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() && - bHasTitle ) - { - uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getSecondYAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - try - { - uno::Any aAny; - aAny <<= maCurrentAxis.aTitle; - xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property String for Title not available" ); - } - } - } - } - break; - - case SCH_XML_AXIS_Z: - { - uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY ); - if( xSuppl.is() && - bHasTitle ) - { - uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getZAxisTitle(), uno::UNO_QUERY ); - if( xTitleProp.is()) - { - try - { - uno::Any aAny; - aAny <<= maCurrentAxis.aTitle; - xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny ); - } - catch( beans::UnknownPropertyException & ) - { - DBG_ERROR( "Property String for Title not available" ); - } - } - } - } - break; - case SCH_XML_AXIS_UNDEF: - // nothing - break; - } -} - -SvXMLImportContext* SchXMLAxisContext::CreateChildContext( - USHORT p_nPrefix, - const rtl::OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList >& xAttrList ) -{ - SvXMLImportContext* pContext = 0; - const SvXMLTokenMap& rTokenMap = mrImportHelper.GetAxisElemTokenMap(); - - switch( rTokenMap.Get( p_nPrefix, rLocalName )) - { - case XML_TOK_AXIS_TITLE: - { - uno::Reference< drawing::XShape > xTitleShape = getTitleShape(); - pContext = new SchXMLTitleContext( mrImportHelper, GetImport(), rLocalName, - maCurrentAxis.aTitle, - xTitleShape ); - } - break; - - case XML_TOK_AXIS_CATEGORIES: - pContext = new SchXMLCategoriesContext( mrImportHelper, GetImport(), - p_nPrefix, rLocalName, - mrCategoriesAddress ); - maCurrentAxis.bHasCategories = true; - break; - - case XML_TOK_AXIS_GRID: - { - sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; - sal_Bool bIsMajor = sal_True; // default value for class is "major" - rtl::OUString sAutoStyleName; - - for( sal_Int16 i = 0; i < nAttrCount; i++ ) - { - rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); - rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); - - if( nPrefix == XML_NAMESPACE_CHART ) - { - if( IsXMLToken( aLocalName, XML_CLASS ) ) - { - if( IsXMLToken( xAttrList->getValueByIndex( i ), XML_MINOR ) ) - bIsMajor = sal_False; - } - else if( IsXMLToken( aLocalName, XML_STYLE_NAME ) ) - sAutoStyleName = xAttrList->getValueByIndex( i ); - } - } - - CreateGrid( sAutoStyleName, bIsMajor ); - - // don't create a context => use default context. grid elements are empty - pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName ); - } - break; - - default: - pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName ); - break; - } - - return pContext; -} - -void SchXMLAxisContext::EndElement() -{ - SetAxisTitle(); + SchXMLAxisContext::CorrectAxisPositions( uno::Reference< chart2::XChartDocument >( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ), maChartTypeServiceName, GetImport().GetODFVersion(), m_bAxisPositionAttributeImported ); } // ======================================== @@ -1612,7 +698,7 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART ) { @@ -1636,44 +722,6 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr // ======================================== -SchXMLCategoriesContext::SchXMLCategoriesContext( - SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, - sal_uInt16 nPrefix, - const rtl::OUString& rLocalName, - rtl::OUString& rAddress ) : - SvXMLImportContext( rImport, nPrefix, rLocalName ), - mrImportHelper( rImpHelper ), - mrAddress( rAddress ) -{ -} - -SchXMLCategoriesContext::~SchXMLCategoriesContext() -{ -} - -void SchXMLCategoriesContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) -{ - sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; - - for( sal_Int16 i = 0; i < nAttrCount; i++ ) - { - rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); - rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); - - if( nPrefix == XML_NAMESPACE_TABLE && - IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) ) - { - uno::Reference< chart2::XChartDocument > xNewDoc( GetImport().GetModel(), uno::UNO_QUERY ); - mrAddress = xAttrList->getValueByIndex( i ); - // lcl_ConvertRange( xAttrList->getValueByIndex( i ), xNewDoc ); - } - } -} - -// ======================================== - SchXMLPositonAttributesHelper::SchXMLPositonAttributesHelper( SvXMLImport& rImporter ) : m_rImport( rImporter ) , m_aPosition(0,0) @@ -1795,7 +843,7 @@ void SchXMLCoordinateRegionContext::StartElement( const uno::Reference< xml::sax rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); m_rPositioning.readPositioningAttribute( nPrefix, aLocalName, aValue ); } } @@ -1831,7 +879,7 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART && IsXMLToken( aLocalName, XML_STYLE_NAME ) ) @@ -1894,7 +942,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART && IsXMLToken( aLocalName, XML_STYLE_NAME ) ) @@ -1971,7 +1019,7 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART ) { @@ -2004,7 +1052,7 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax } SvXMLImportContext* SchXMLStatisticsObjectContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { @@ -2064,7 +1112,7 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index 1f0de466dcb1..0437d5cabbc3 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -126,13 +126,11 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - void CorrectAxisPositions(); - private: SchXMLImportHelper& mrImportHelper; ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram; @@ -166,47 +164,6 @@ private: ::com::sun::star::awt::Size maChartSize; }; -// ---------------------------------------- - -class SchXMLAxisContext : public SvXMLImportContext -{ -private: - SchXMLImportHelper& mrImportHelper; - ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram; - SchXMLAxis maCurrentAxis; - std::vector< SchXMLAxis >& maAxes; - rtl::OUString msAutoStyleName; - rtl::OUString& mrCategoriesAddress; - bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions - bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions - bool mbAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions - bool& m_rbAxisPositionAttributeImported; - - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape(); - void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor ); - void CreateAxis(); - void SetAxisTitle(); - -public: - SchXMLAxisContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const rtl::OUString& rLocalName, - ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram, - std::vector< SchXMLAxis >& aAxes, - ::rtl::OUString& rCategoriesAddress, - bool bAddMissingXAxisForNetCharts, - bool bAdaptWrongPercentScaleValues, - bool bAdaptXAxisOrientationForOld2DBarCharts, - bool& rbAxisPositionAttributeImported ); - virtual ~SchXMLAxisContext(); - - virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); - virtual void EndElement(); - virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, - const rtl::OUString& rLocalName, - const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); -}; - //---------------------------------------- class SchXMLDataPointContext : public SvXMLImportContext @@ -233,24 +190,6 @@ public: // ---------------------------------------- -class SchXMLCategoriesContext : public SvXMLImportContext -{ -private: - SchXMLImportHelper& mrImportHelper; - rtl::OUString& mrAddress; - -public: - SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, - sal_uInt16 nPrefix, - const rtl::OUString& rLocalName, - rtl::OUString& rAddress ); - virtual ~SchXMLCategoriesContext(); - virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); -}; - -// ---------------------------------------- - class SchXMLCoordinateRegionContext : public SvXMLImportContext { public: @@ -348,7 +287,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index b3b322568ea6..d106398a0fcd 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -117,7 +117,7 @@ void SchXMLDomain2Context::StartElement( const uno::Reference< xml::sax::XAttrib { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_TABLE && IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) ) @@ -318,7 +318,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; rtl::OUString aValue = xAttrList->getValueByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { @@ -336,7 +336,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ ) { if( aValue.equals( mrAxes[ nCurrent ].aName ) && - mrAxes[ nCurrent ].eClass == SCH_XML_AXIS_Y ) + mrAxes[ nCurrent ].eDimension == SCH_XML_AXIS_Y ) { mpAttachedAxis = &( mrAxes[ nCurrent ] ); } @@ -364,7 +364,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib if( mpAttachedAxis ) { - if( mpAttachedAxis->nIndexInCategory > 0 ) + if( mpAttachedAxis->nAxisIndex > 0 ) { // secondary axis => property has to be set (primary is default) mnAttachedAxis = 2; @@ -635,7 +635,7 @@ void SchXMLSeries2Context::EndElement() } SvXMLImportContext* SchXMLSeries2Context::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { diff --git a/xmloff/source/chart/SchXMLSeries2Context.hxx b/xmloff/source/chart/SchXMLSeries2Context.hxx index faa42b2809ac..80deb2c705bc 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.hxx +++ b/xmloff/source/chart/SchXMLSeries2Context.hxx @@ -96,7 +96,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index cc01a7d1c050..5e9751d73ded 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -42,11 +42,11 @@ #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> #include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XInternalDataProvider.hpp> -#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/ChartSeriesAddress.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> @@ -327,7 +327,7 @@ SchXMLTableContext::~SchXMLTableContext() } SvXMLImportContext *SchXMLTableContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -374,13 +374,20 @@ void SchXMLTableContext::StartElement( const uno::Reference< xml::sax::XAttribut { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); - - if( nPrefix == XML_NAMESPACE_TABLE && - IsXMLToken( aLocalName, XML_NAME ) ) + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + if ( nPrefix == XML_NAMESPACE_TABLE ) { - mrTable.aTableNameOfFile = xAttrList->getValueByIndex( i ); - break; // we only need this attribute + if ( IsXMLToken( aLocalName, XML_NAME ) ) + { + mrTable.aTableNameOfFile = xAttrList->getValueByIndex( i ); + } + else if ( IsXMLToken( aLocalName, XML_PROTECTED ) ) + { + if ( IsXMLToken( xAttrList->getValueByIndex( i ), XML_TRUE ) ) + { + mrTable.bProtected = true; + } + } } } } @@ -517,7 +524,7 @@ SchXMLTableColumnsContext::~SchXMLTableColumnsContext() } SvXMLImportContext* SchXMLTableColumnsContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -560,7 +567,7 @@ void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAt { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_TABLE && IsXMLToken( aLocalName, XML_NUMBER_COLUMNS_REPEATED ) ) @@ -622,7 +629,7 @@ SchXMLTableRowsContext::~SchXMLTableRowsContext() } SvXMLImportContext* SchXMLTableRowsContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -668,7 +675,7 @@ SchXMLTableRowContext::~SchXMLTableRowContext() } SvXMLImportContext* SchXMLTableRowContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -704,13 +711,13 @@ private: public: SchXMLRangeSomewhereContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, ::rtl::OUString& rRangeString ); virtual ~SchXMLRangeSomewhereContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); @@ -754,7 +761,7 @@ void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttr for( sal_Int16 i = 0; i < nAttrCount; i++ ) { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { @@ -794,7 +801,7 @@ void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttr } SvXMLImportContext* SchXMLTableCellContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -839,15 +846,25 @@ void SchXMLTableCellContext::EndElement() // ======================================== -void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< OUString >& rComplexLabel ) +void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< uno::Any >& rComplexLabel ) { if( rCell.eType == SCH_CELL_TYPE_STRING ) { rComplexLabel.realloc(1); - rComplexLabel[0] = rCell.aString; + rComplexLabel[0] = uno::makeAny( rCell.aString ); } else if( rCell.pComplexString && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING ) - rComplexLabel = *rCell.pComplexString; + { + sal_Int32 nCount = rCell.pComplexString->getLength(); + rComplexLabel.realloc( nCount ); + for( sal_Int32 nN=0; nN<nCount; nN++) + rComplexLabel[nN] = uno::makeAny((*rCell.pComplexString)[nN]); + } + else if( rCell.eType == SCH_CELL_TYPE_FLOAT ) + { + rComplexLabel.realloc(1); + rComplexLabel[0] = uno::makeAny( rCell.fValue ); + } } void SchXMLTableHelper::applyTableToInternalDataProvider( @@ -878,8 +895,8 @@ void SchXMLTableHelper::applyTableToInternalDataProvider( } Sequence< Sequence< double > > aDataInRows( nNumRows ); - Sequence< Sequence< OUString > > aComplexRowDescriptions( nNumRows ); - Sequence< Sequence< OUString > > aComplexColumnDescriptions( nNumColumns ); + Sequence< Sequence< uno::Any > > aComplexRowDescriptions( nNumRows ); + Sequence< Sequence< uno::Any > > aComplexColumnDescriptions( nNumColumns ); for( sal_Int32 i=0; i<nNumRows; ++i ) aDataInRows[i].realloc( nNumColumns ); @@ -919,15 +936,28 @@ void SchXMLTableHelper::applyTableToInternalDataProvider( } //apply the collected data to the chart - Reference< chart::XComplexDescriptionAccess > xDataAccess( xDataProv, uno::UNO_QUERY ); + Reference< chart2::XAnyDescriptionAccess > xDataAccess( xDataProv, uno::UNO_QUERY ); if( !xDataAccess.is() ) return; xDataAccess->setData( aDataInRows ); if( rTable.bHasHeaderColumn ) - xDataAccess->setComplexRowDescriptions( aComplexRowDescriptions ); + xDataAccess->setAnyRowDescriptions( aComplexRowDescriptions ); if( rTable.bHasHeaderRow ) - xDataAccess->setComplexColumnDescriptions( aComplexColumnDescriptions ); + xDataAccess->setAnyColumnDescriptions( aComplexColumnDescriptions ); + + if ( rTable.bProtected ) + { + try + { + Reference< beans::XPropertySet > xProps( xChartDoc, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ), uno::makeAny( sal_True ) ); + xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableComplexChartTypes" ) ), uno::makeAny( sal_True ) ); + } + catch ( uno::Exception& ) + { + } + } } void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( @@ -1189,7 +1219,7 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( //--------------------------------------------------------------------------------------------------- SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, OUString& rRangeString ) : SvXMLImportContext( rImport, nPrefix, rLocalName ), @@ -1202,7 +1232,7 @@ SchXMLRangeSomewhereContext::~SchXMLRangeSomewhereContext() } SvXMLImportContext* SchXMLRangeSomewhereContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { diff --git a/xmloff/source/chart/SchXMLTableContext.hxx b/xmloff/source/chart/SchXMLTableContext.hxx index 717628b18de0..14315fa8daeb 100644 --- a/xmloff/source/chart/SchXMLTableContext.hxx +++ b/xmloff/source/chart/SchXMLTableContext.hxx @@ -69,7 +69,7 @@ public: virtual ~SchXMLTableContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -132,7 +132,7 @@ public: virtual ~SchXMLTableColumnsContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); }; @@ -172,7 +172,7 @@ public: virtual ~SchXMLTableRowsContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); }; @@ -193,7 +193,7 @@ public: virtual ~SchXMLTableRowContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); }; @@ -219,7 +219,7 @@ public: virtual ~SchXMLTableCellContext(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/chart/SchXMLTextListContext.cxx b/xmloff/source/chart/SchXMLTextListContext.cxx index 5a4dd73f03e6..7a9007aa3527 100755 --- a/xmloff/source/chart/SchXMLTextListContext.cxx +++ b/xmloff/source/chart/SchXMLTextListContext.cxx @@ -52,7 +52,7 @@ public: virtual void EndElement(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -81,7 +81,7 @@ void SchXMLListItemContext::EndElement() } SvXMLImportContext* SchXMLListItemContext::CreateChildContext( - USHORT nPrefix, const OUString& rLocalName, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { SvXMLImportContext* pContext = 0; @@ -121,7 +121,7 @@ void SchXMLTextListContext::EndElement() } SvXMLImportContext* SchXMLTextListContext::CreateChildContext( - USHORT nPrefix, const OUString& rLocalName, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { SvXMLImportContext* pContext = 0; diff --git a/xmloff/source/chart/SchXMLTextListContext.hxx b/xmloff/source/chart/SchXMLTextListContext.hxx index 736331d10e71..4d260d05cd69 100755 --- a/xmloff/source/chart/SchXMLTextListContext.hxx +++ b/xmloff/source/chart/SchXMLTextListContext.hxx @@ -46,7 +46,7 @@ public: virtual void EndElement(); virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 674a8ba3accb..a0be5f4ec6a8 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -182,7 +182,7 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] = SchXMLChartTypeEnum GetChartTypeEnum( const OUString& rClassName ) { - USHORT nEnumVal = XML_CHART_CLASS_UNKNOWN; + sal_uInt16 nEnumVal = XML_CHART_CLASS_UNKNOWN; if( !SvXMLUnitConverter::convertEnum( nEnumVal, rClassName, aXMLChartClassMap ) ) nEnumVal = XML_CHART_CLASS_UNKNOWN; diff --git a/xmloff/source/chart/XMLLabelSeparatorContext.hxx b/xmloff/source/chart/XMLLabelSeparatorContext.hxx index 2678ca0ca7aa..2a60dca21599 100644 --- a/xmloff/source/chart/XMLLabelSeparatorContext.hxx +++ b/xmloff/source/chart/XMLLabelSeparatorContext.hxx @@ -42,7 +42,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); diff --git a/xmloff/source/chart/XMLSymbolImageContext.hxx b/xmloff/source/chart/XMLSymbolImageContext.hxx index 419d2b61ed6d..233d36a44368 100644 --- a/xmloff/source/chart/XMLSymbolImageContext.hxx +++ b/xmloff/source/chart/XMLSymbolImageContext.hxx @@ -46,7 +46,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx index 8ac78f9eb0b5..18dcfa293a3c 100644 --- a/xmloff/source/chart/contexts.cxx +++ b/xmloff/source/chart/contexts.cxx @@ -85,7 +85,7 @@ SvXMLImportContext *SchXMLBodyContext_Impl::CreateChildContext( SchXMLDocContext::SchXMLDocContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLName ) : SvXMLImportContext( rImport, nPrefix, rLName ), mrImportHelper( rImpHelper ) @@ -150,7 +150,7 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext( SchXMLFlatDocContext_Impl::SchXMLFlatDocContext_Impl( SchXMLImportHelper& i_rImpHelper, SchXMLImport& i_rImport, - USHORT i_nPrefix, const ::rtl::OUString & i_rLName, + sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName, const uno::Reference<document::XDocumentProperties>& i_xDocProps, const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) : SvXMLImportContext(i_rImport, i_nPrefix, i_rLName), @@ -164,7 +164,7 @@ SchXMLFlatDocContext_Impl::~SchXMLFlatDocContext_Impl() { } SvXMLImportContext *SchXMLFlatDocContext_Impl::CreateChildContext( - USHORT i_nPrefix, const ::rtl::OUString& i_rLocalName, + sal_uInt16 i_nPrefix, const ::rtl::OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList) { // behave like meta base class iff we encounter office:meta @@ -183,7 +183,7 @@ SvXMLImportContext *SchXMLFlatDocContext_Impl::CreateChildContext( SchXMLBodyContext::SchXMLBodyContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLName ) : SvXMLImportContext( rImport, nPrefix, rLName ), mrImportHelper( rImpHelper ) diff --git a/xmloff/source/chart/contexts.hxx b/xmloff/source/chart/contexts.hxx index 1fb23147a34b..e3ec8b512793 100644 --- a/xmloff/source/chart/contexts.hxx +++ b/xmloff/source/chart/contexts.hxx @@ -77,14 +77,14 @@ public: SchXMLFlatDocContext_Impl( SchXMLImportHelper& i_rImpHelper, SchXMLImport& i_rImport, - USHORT i_nPrefix, const ::rtl::OUString & i_rLName, + sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName, const com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties>& i_xDocProps, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& i_xDocBuilder); virtual ~SchXMLFlatDocContext_Impl(); virtual SvXMLImportContext *CreateChildContext( - USHORT i_nPrefix, const ::rtl::OUString& i_rLocalName, + sal_uInt16 i_nPrefix, const ::rtl::OUString& i_rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& i_xAttrList); }; diff --git a/xmloff/source/chart/makefile.mk b/xmloff/source/chart/makefile.mk new file mode 100644 index 000000000000..2f61a3d6f0e5 --- /dev/null +++ b/xmloff/source/chart/makefile.mk @@ -0,0 +1,71 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ = ..$/.. +PRJNAME = xmloff +TARGET = chart +AUTOSEG = true +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +# --- Files -------------------------------------------------------- + +SLOFILES = $(SLO)$/ColorPropertySet.obj \ + $(SLO)$/SchXMLTools.obj \ + $(SLO)$/SchXMLExport.obj \ + $(SLO)$/SchXMLImport.obj \ + $(SLO)$/contexts.obj \ + $(SLO)$/SchXMLTableContext.obj \ + $(SLO)$/SchXMLChartContext.obj \ + $(SLO)$/SchXMLPlotAreaContext.obj \ + $(SLO)$/SchXMLAxisContext.obj \ + $(SLO)$/SchXMLParagraphContext.obj \ + $(SLO)$/SchXMLTextListContext.obj \ + $(SLO)$/SchXMLSeriesHelper.obj \ + $(SLO)$/SchXMLSeries2Context.obj \ + $(SLO)$/PropertyMaps.obj \ + $(SLO)$/XMLChartStyleContext.obj \ + $(SLO)$/XMLErrorIndicatorPropertyHdl.obj \ + $(SLO)$/XMLErrorBarStylePropertyHdl.obj \ + $(SLO)$/SchXMLAutoStylePoolP.obj \ + $(SLO)$/XMLChartPropertyContext.obj \ + $(SLO)$/XMLSymbolImageContext.obj \ + $(SLO)$/XMLLabelSeparatorContext.obj \ + $(SLO)$/XMLTextOrientationHdl.obj \ + $(SLO)$/XMLSymbolTypePropertyHdl.obj \ + $(SLO)$/XMLAxisPositionPropertyHdl.obj \ + $(SLO)$/SchXMLCalculationSettingsContext.obj \ + $(SLO)$/transporttypes.obj + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk + diff --git a/xmloff/source/chart/transporttypes.hxx b/xmloff/source/chart/transporttypes.hxx index 27c8850e2b81..30f70d882ed0 100644 --- a/xmloff/source/chart/transporttypes.hxx +++ b/xmloff/source/chart/transporttypes.hxx @@ -87,12 +87,15 @@ struct SchXMLTable ::std::vector< sal_Int32 > aHiddenColumns; + bool bProtected; + SchXMLTable() : nRowIndex( -1 ), nColumnIndex( -1 ), nMaxColumnIndex( -1 ), nNumberOfColsEstimate( 0 ), bHasHeaderRow( false ), - bHasHeaderColumn( false ) + bHasHeaderColumn( false ), + bProtected( false ) {} }; @@ -132,7 +135,7 @@ struct SchNumericCellRangeAddress // ---------------------------------------- -enum SchXMLAxisClass +enum SchXMLAxisDimension { SCH_XML_AXIS_X = 0, SCH_XML_AXIS_Y, @@ -142,13 +145,13 @@ enum SchXMLAxisClass struct SchXMLAxis { - enum SchXMLAxisClass eClass; - sal_Int8 nIndexInCategory; + enum SchXMLAxisDimension eDimension; + sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis rtl::OUString aName; rtl::OUString aTitle; bool bHasCategories; - SchXMLAxis() : eClass( SCH_XML_AXIS_UNDEF ), nIndexInCategory( 0 ), bHasCategories( false ) {} + SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {} }; // ---------------------------------------- diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index 0c90a23ae519..e83cb732e523 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -172,7 +172,7 @@ protected: com::sun::star::uno::Any& mrAny; XMLConfigBaseContext* mpBaseContext; public: - XMLConfigBaseContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLConfigBaseContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, com::sun::star::uno::Any& rAny, XMLConfigBaseContext* pBaseContext); virtual ~XMLConfigBaseContext(); @@ -192,7 +192,7 @@ class XMLConfigItemContext : public SvXMLImportContext XMLConfigBaseContext* mpBaseContext; public: - XMLConfigItemContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLConfigItemContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Any& rAny, @@ -200,7 +200,7 @@ public: XMLConfigBaseContext* pBaseContext); virtual ~XMLConfigItemContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -216,14 +216,14 @@ public: class XMLConfigItemSetContext : public XMLConfigBaseContext { public: - XMLConfigItemSetContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLConfigItemSetContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Any& rAny, XMLConfigBaseContext* pBaseContext); virtual ~XMLConfigItemSetContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -236,14 +236,14 @@ public: class XMLConfigItemMapNamedContext : public XMLConfigBaseContext { public: - XMLConfigItemMapNamedContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + XMLConfigItemMapNamedContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Any& rAny, XMLConfigBaseContext* pBaseContext); virtual ~XMLConfigItemMapNamedContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -259,7 +259,7 @@ private: rtl::OUString maConfigItemName; public: - XMLConfigItemMapIndexedContext(SvXMLImport& rImport, USHORT nPrfx, + XMLConfigItemMapIndexedContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, @@ -268,7 +268,7 @@ public: XMLConfigBaseContext* pBaseContext); virtual ~XMLConfigItemMapIndexedContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -278,7 +278,7 @@ public: //============================================================================= -SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, USHORT p_nPrefix, +SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, sal_uInt16 p_nPrefix, const rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, beans::PropertyValue& rProp, XMLConfigBaseContext* pBaseContext) @@ -291,7 +291,7 @@ SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, USHORT p_nPrefix { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( + sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); rtl::OUString sValue = xAttrList->getValueByIndex( i ); @@ -352,7 +352,7 @@ struct XMLDocumentSettingsContext_Data //============================================================================= -XMLDocumentSettingsContext::XMLDocumentSettingsContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, +XMLDocumentSettingsContext::XMLDocumentSettingsContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) : SvXMLImportContext( rImport, nPrfx, rLName ) , m_pData( new XMLDocumentSettingsContext_Data ) @@ -364,7 +364,7 @@ XMLDocumentSettingsContext::~XMLDocumentSettingsContext() { } -SvXMLImportContext *XMLDocumentSettingsContext::CreateChildContext( USHORT p_nPrefix, +SvXMLImportContext *XMLDocumentSettingsContext::CreateChildContext( sal_uInt16 p_nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) @@ -377,7 +377,7 @@ SvXMLImportContext *XMLDocumentSettingsContext::CreateChildContext( USHORT p_nPr { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); rtl::OUString sValue = xAttrList->getValueByIndex( i ); @@ -505,7 +505,7 @@ void XMLDocumentSettingsContext::EndElement() //============================================================================= -XMLConfigBaseContext::XMLConfigBaseContext(SvXMLImport& rImport, USHORT nPrfx, +XMLConfigBaseContext::XMLConfigBaseContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, com::sun::star::uno::Any& rTempAny, XMLConfigBaseContext* pTempBaseContext) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -523,7 +523,7 @@ XMLConfigBaseContext::~XMLConfigBaseContext() //============================================================================= -XMLConfigItemSetContext::XMLConfigItemSetContext(SvXMLImport& rImport, USHORT nPrfx, +XMLConfigItemSetContext::XMLConfigItemSetContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>&, @@ -538,7 +538,7 @@ XMLConfigItemSetContext::~XMLConfigItemSetContext() { } -SvXMLImportContext *XMLConfigItemSetContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLConfigItemSetContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) @@ -555,7 +555,7 @@ void XMLConfigItemSetContext::EndElement() //============================================================================= -XMLConfigItemContext::XMLConfigItemContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, +XMLConfigItemContext::XMLConfigItemContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Any& rTempAny, @@ -571,7 +571,7 @@ XMLConfigItemContext::XMLConfigItemContext(SvXMLImport& rImport, USHORT nPrfx, c { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); rtl::OUString sValue = xAttrList->getValueByIndex( i ); @@ -587,7 +587,7 @@ XMLConfigItemContext::~XMLConfigItemContext() { } -SvXMLImportContext *XMLConfigItemContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLConfigItemContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& ) @@ -757,7 +757,7 @@ void XMLConfigItemContext::ManipulateConfigItem() //============================================================================= -XMLConfigItemMapNamedContext::XMLConfigItemMapNamedContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, +XMLConfigItemMapNamedContext::XMLConfigItemMapNamedContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>&, com::sun::star::uno::Any& rAny, @@ -770,7 +770,7 @@ XMLConfigItemMapNamedContext::~XMLConfigItemMapNamedContext() { } -SvXMLImportContext *XMLConfigItemMapNamedContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLConfigItemMapNamedContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) @@ -792,7 +792,7 @@ void XMLConfigItemMapNamedContext::EndElement() //============================================================================= -XMLConfigItemMapIndexedContext::XMLConfigItemMapIndexedContext(SvXMLImport& rImport, USHORT nPrfx, +XMLConfigItemMapIndexedContext::XMLConfigItemMapIndexedContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>&, @@ -808,7 +808,7 @@ XMLConfigItemMapIndexedContext::~XMLConfigItemMapIndexedContext() { } -SvXMLImportContext *XMLConfigItemMapIndexedContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLConfigItemMapIndexedContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx index 317818c6562f..5a6e6ed80329 100644 --- a/xmloff/source/core/DomBuilderContext.cxx +++ b/xmloff/source/core/DomBuilderContext.cxx @@ -68,13 +68,13 @@ using rtl::OUString; // helper functions; implemented below Reference<XNode> lcl_createDomInstance(); Reference<XNode> lcl_createElement( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString rLocalName, Reference<XNode> xParent); DomBuilderContext::DomBuilderContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName ) : SvXMLImportContext( rImport, nPrefix, rLocalName ), mxNode( lcl_createElement( rImport, nPrefix, rLocalName, @@ -86,7 +86,7 @@ DomBuilderContext::DomBuilderContext( SvXMLImport& rImport, } DomBuilderContext::DomBuilderContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, Reference<XNode>& xParent ) : SvXMLImportContext( rImport, nPrefix, rLocalName ), @@ -114,7 +114,7 @@ Reference<XNode> DomBuilderContext::getNode() SvXMLImportContext* DomBuilderContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& ) { @@ -214,7 +214,7 @@ Reference<XNode> lcl_createDomInstance() } Reference<XNode> lcl_createElement( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString rLocalName, Reference<XNode> xParent) { diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index cdfa84e68ac1..1a134f02bcfe 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -45,7 +45,7 @@ TYPEINIT1( XMLBase64ImportContext, SvXMLImportContext ); XMLBase64ImportContext::XMLBase64ImportContext( - SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, + SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >&, const Reference< XOutputStream >& rOut ) : SvXMLImportContext( rImport, nPrfx, rLName ), diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index e7b3a8b48d19..83eeb8afb534 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -92,14 +92,14 @@ class XMLEmbeddedObjectImportContext_Impl : public SvXMLImportContext public: TYPEINFO(); - XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport, USHORT nPrfx, + XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rHandler ); virtual ~XMLEmbeddedObjectImportContext_Impl(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -113,7 +113,7 @@ public: TYPEINIT1( XMLEmbeddedObjectImportContext_Impl, SvXMLImportContext ); XMLEmbeddedObjectImportContext_Impl::XMLEmbeddedObjectImportContext_Impl( - SvXMLImport& rImport, USHORT nPrfx, + SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XDocumentHandler >& rHandler ) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -126,7 +126,7 @@ XMLEmbeddedObjectImportContext_Impl::~XMLEmbeddedObjectImportContext_Impl() } SvXMLImportContext *XMLEmbeddedObjectImportContext_Impl::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& ) { @@ -196,7 +196,7 @@ sal_Bool XMLEmbeddedObjectImportContext::SetComponent( } XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext( - SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, + SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ) { @@ -286,7 +286,7 @@ XMLEmbeddedObjectImportContext::~XMLEmbeddedObjectImportContext() } SvXMLImportContext *XMLEmbeddedObjectImportContext::CreateChildContext( - USHORT nPrefix, const OUString& rLocalName, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& ) { if( xHandler.is() ) diff --git a/xmloff/source/core/i18nmap.cxx b/xmloff/source/core/i18nmap.cxx index b17a27e03693..e6dc7930e673 100644 --- a/xmloff/source/core/i18nmap.cxx +++ b/xmloff/source/core/i18nmap.cxx @@ -36,7 +36,7 @@ using namespace rtl; class SvI18NMapEntry_Impl { - USHORT nKind; + sal_uInt16 nKind; OUString aName; OUString aNewName; @@ -44,25 +44,25 @@ public: const OUString& GetNewName() const { return aNewName; } - SvI18NMapEntry_Impl( USHORT nKnd, const OUString& rName, + SvI18NMapEntry_Impl( sal_uInt16 nKnd, const OUString& rName, const OUString& rNewName ) : nKind( nKnd ), aName( rName ), aNewName( rNewName ) {} - SvI18NMapEntry_Impl( USHORT nKnd, const OUString& rName ) : + SvI18NMapEntry_Impl( sal_uInt16 nKnd, const OUString& rName ) : nKind( nKnd ), aName( rName ) {} - BOOL operator==( const SvI18NMapEntry_Impl& r ) const + sal_Bool operator==( const SvI18NMapEntry_Impl& r ) const { return nKind == r.nKind && aName == r.aName; } - BOOL operator<( const SvI18NMapEntry_Impl& r ) const + sal_Bool operator<( const SvI18NMapEntry_Impl& r ) const { return nKind < r.nKind || ( nKind == r.nKind && @@ -76,13 +76,13 @@ SV_IMPL_OP_PTRARR_SORT( SvI18NMap_Impl, SvI18NMapEntry_ImplPtr ) // --------------------------------------------------------------------- -SvI18NMapEntry_Impl *SvI18NMap::_Find( USHORT nKind, +SvI18NMapEntry_Impl *SvI18NMap::_Find( sal_uInt16 nKind, const OUString& rName ) const { SvI18NMapEntry_Impl *pRet = 0; SvI18NMapEntry_Impl aTst( nKind, rName ); - USHORT nPos; + sal_uInt16 nPos; if( pImpl->Seek_Entry( &aTst, &nPos ) ) { pRet = (*pImpl)[nPos]; @@ -102,7 +102,7 @@ SvI18NMap::~SvI18NMap() delete pImpl; } -void SvI18NMap::Add( USHORT nKind, const OUString& rName, +void SvI18NMap::Add( sal_uInt16 nKind, const OUString& rName, const OUString& rNewName ) { SvI18NMapEntry_Impl *pEntry = _Find( nKind, rName ); @@ -114,7 +114,7 @@ void SvI18NMap::Add( USHORT nKind, const OUString& rName, } } -const OUString& SvI18NMap::Get( USHORT nKind, const OUString& rName ) const +const OUString& SvI18NMap::Get( sal_uInt16 nKind, const OUString& rName ) const { SvI18NMapEntry_Impl *pEntry = _Find( nKind, rName ); if( pEntry ) diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index 22e145bc5180..994db71763ae 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -470,7 +470,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( const OUString& rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace, - USHORT /*nIdxGuess*/ ) const + sal_uInt16 /*nIdxGuess*/ ) const { return _GetKeyByAttrName ( rAttrName, pPrefix, pLocalName, pNamespace ); } diff --git a/xmloff/source/core/xmlcnitm.cxx b/xmloff/source/core/xmlcnitm.cxx index 53ed405fa454..e1bd55ff040b 100644 --- a/xmloff/source/core/xmlcnitm.cxx +++ b/xmloff/source/core/xmlcnitm.cxx @@ -51,8 +51,8 @@ SvXMLAttrContainerData::SvXMLAttrContainerData( pLNames( new SvXMLAttrContainerData_Impl ), pValues( new SvXMLAttrContainerData_Impl ) { - USHORT nCount = rImpl.pLNames->Count(); - for( USHORT i=0; i<nCount; i++ ) + sal_uInt16 nCount = rImpl.pLNames->Count(); + for( sal_uInt16 i=0; i<nCount; i++ ) { aPrefixPoss.Insert( rImpl.aPrefixPoss[i], i ); pLNames->Insert( new OUString( *(*rImpl.pLNames)[i] ), i ); @@ -75,12 +75,12 @@ SvXMLAttrContainerData::~SvXMLAttrContainerData() int SvXMLAttrContainerData::operator ==( const SvXMLAttrContainerData& rCmp ) const { - BOOL bRet = pLNames->Count() == rCmp.pLNames->Count() && + sal_Bool bRet = pLNames->Count() == rCmp.pLNames->Count() && aNamespaceMap == rCmp.aNamespaceMap; if( bRet ) { - USHORT nCount = pLNames->Count(); - USHORT i; + sal_uInt16 nCount = pLNames->Count(); + sal_uInt16 i; for( i=0; bRet && i < nCount; i++ ) bRet = aPrefixPoss[i] == rCmp.aPrefixPoss[i]; @@ -95,95 +95,95 @@ int SvXMLAttrContainerData::operator ==( return (int)bRet; } -BOOL SvXMLAttrContainerData::AddAttr( const OUString& rLName, +sal_Bool SvXMLAttrContainerData::AddAttr( const OUString& rLName, const OUString& rValue ) { aPrefixPoss.Insert( USHRT_MAX, aPrefixPoss.Count() ); pLNames->Insert( new OUString(rLName), pLNames->Count() ); pValues->Insert( new OUString(rValue), pValues->Count() ); - return TRUE; + return sal_True; } -BOOL SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, +sal_Bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, const OUString& rNamespace, const OUString& rLName, const OUString& rValue ) { - USHORT nPos = aNamespaceMap.Add( rPrefix, rNamespace ); + sal_uInt16 nPos = aNamespaceMap.Add( rPrefix, rNamespace ); aPrefixPoss.Insert( nPos, aPrefixPoss.Count() ); pLNames->Insert( new OUString(rLName), pLNames->Count() ); pValues->Insert( new OUString(rValue), pValues->Count() ); - return TRUE; + return sal_True; } -BOOL SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, +sal_Bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, const OUString& rLName, const OUString& rValue ) { - USHORT nPos = aNamespaceMap.GetIndexByPrefix( rPrefix ); + sal_uInt16 nPos = aNamespaceMap.GetIndexByPrefix( rPrefix ); if( USHRT_MAX == nPos ) - return FALSE; + return sal_False; aPrefixPoss.Insert( nPos, aPrefixPoss.Count() ); pLNames->Insert( new OUString(rLName), pLNames->Count() ); pValues->Insert( new OUString(rValue), pValues->Count() ); - return TRUE; + return sal_True; } -BOOL SvXMLAttrContainerData::SetAt( USHORT i, +sal_Bool SvXMLAttrContainerData::SetAt( sal_uInt16 i, const rtl::OUString& rLName, const rtl::OUString& rValue ) { if( i >= GetAttrCount() ) - return FALSE; + return sal_False; *(*pLNames)[i] = rLName; *(*pValues)[i] = rValue; aPrefixPoss[i] = USHRT_MAX; - return TRUE; + return sal_True; } -BOOL SvXMLAttrContainerData::SetAt( USHORT i, +sal_Bool SvXMLAttrContainerData::SetAt( sal_uInt16 i, const rtl::OUString& rPrefix, const rtl::OUString& rNamespace, const rtl::OUString& rLName, const rtl::OUString& rValue ) { if( i >= GetAttrCount() ) - return FALSE; + return sal_False; - USHORT nPos = aNamespaceMap.Add( rPrefix, rNamespace ); + sal_uInt16 nPos = aNamespaceMap.Add( rPrefix, rNamespace ); if( USHRT_MAX == nPos ) - return FALSE; + return sal_False; *(*pLNames)[i] = rLName; *(*pValues)[i] = rValue; aPrefixPoss[i] = nPos; - return TRUE; + return sal_True; } -BOOL SvXMLAttrContainerData::SetAt( USHORT i, +sal_Bool SvXMLAttrContainerData::SetAt( sal_uInt16 i, const rtl::OUString& rPrefix, const rtl::OUString& rLName, const rtl::OUString& rValue ) { if( i >= GetAttrCount() ) - return FALSE; + return sal_False; - USHORT nPos = aNamespaceMap.GetIndexByPrefix( rPrefix ); + sal_uInt16 nPos = aNamespaceMap.GetIndexByPrefix( rPrefix ); if( USHRT_MAX == nPos ) - return FALSE; + return sal_False; *(*pLNames)[i] = rLName; *(*pValues)[i] = rValue; aPrefixPoss[i] = nPos; - return TRUE; + return sal_True; } -void SvXMLAttrContainerData::Remove( USHORT i ) +void SvXMLAttrContainerData::Remove( sal_uInt16 i ) { if( i < GetAttrCount() ) { diff --git a/xmloff/source/core/xmlehelp.cxx b/xmloff/source/core/xmlehelp.cxx index 2a2b1c2257b8..866595cd2047 100644 --- a/xmloff/source/core/xmlehelp.cxx +++ b/xmloff/source/core/xmlehelp.cxx @@ -167,7 +167,7 @@ void SvXMLExportHelper::AddLength( sal_Int32 nValue, MapUnit eValueUnit, sal_Int32 nLongVal = 0; - BOOL bOutLongVal = TRUE; + sal_Bool bOutLongVal = sal_True; if( nValue > SAL_MAX_INT32 / nMul ) { // A big int is required for calculation @@ -197,7 +197,7 @@ void SvXMLExportHelper::AddLength( sal_Int32 nValue, MapUnit eValueUnit, rOut.append( (sal_Int32)((nBigVal / nBigFac) % nBig10 ) ); } } - bOutLongVal = FALSE; + bOutLongVal = sal_False; } } else diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index ebe98e9c0f69..659381b03cd2 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; DBG_NAME(SvXMLImportContext) TYPEINIT0( SvXMLImportContext ); -SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, USHORT nPrfx, +SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLName ) : mrImport( rImp ), mnPrefix( nPrfx ), @@ -62,7 +62,7 @@ SvXMLImportContext::~SvXMLImportContext() DBG_DTOR(SvXMLImportContext,NULL); } -SvXMLImportContext *SvXMLImportContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SvXMLImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index f75eec83dbd3..ff16d453cae9 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -228,7 +228,7 @@ typedef SvXMLImportContext *SvXMLImportContextPtr; SV_DECL_PTRARR( SvXMLImportContexts_Impl, SvXMLImportContextPtr, 20, 5 ) SV_IMPL_PTRARR( SvXMLImportContexts_Impl, SvXMLImportContextPtr ) -SvXMLImportContext *SvXMLImport::CreateContext( USHORT nPrefix, +SvXMLImportContext *SvXMLImport::CreateContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& ) { @@ -655,8 +655,8 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, // Process namespace attributes. This must happen before creating the // context, because namespace decaration apply to the element name itself. - INT16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - for( INT16 i=0; i < nAttrCount; i++ ) + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + for( sal_Int16 i=0; i < nAttrCount; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); if ( rAttrName.equalsAscii("office:version") ) @@ -711,13 +711,13 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, // Get element's namespace and local name. OUString aLocalName; - USHORT nPrefix = + sal_uInt16 nPrefix = mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName ); // If there are contexts already, call a CreateChildContext at the topmost // context. Otherwise, create a default context. SvXMLImportContext *pContext; - USHORT nCount = mpContexts->Count(); + sal_uInt16 nCount = mpContexts->Count(); if( nCount > 0 ) { pContext = (*mpContexts)[nCount - 1]->CreateChildContext( nPrefix, @@ -775,7 +775,7 @@ rName ) throw(xml::sax::SAXException, uno::RuntimeException) { - USHORT nCount = mpContexts->Count(); + sal_uInt16 nCount = mpContexts->Count(); DBG_ASSERT( nCount, "SvXMLImport::endElement: no context left" ); if( nCount > 0 ) { @@ -786,7 +786,7 @@ rName #ifdef DBG_UTIL // Non product only: check if endElement call matches startELement call. OUString aLocalName; - USHORT nPrefix = + sal_uInt16 nPrefix = mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName ); DBG_ASSERT( pContext->GetPrefix() == nPrefix, "SvXMLImport::endElement: popped context has wrong prefix" ); @@ -816,7 +816,7 @@ rName void SAL_CALL SvXMLImport::characters( const OUString& rChars ) throw(xml::sax::SAXException, uno::RuntimeException) { - USHORT nCount = mpContexts->Count(); + sal_uInt16 nCount = mpContexts->Count(); if( nCount > 0 ) { (*mpContexts)[nCount - 1]->Characters( rChars ); diff --git a/xmloff/source/core/xmltkmap.cxx b/xmloff/source/core/xmltkmap.cxx index 3d0bc0936e44..807c3c060d14 100644 --- a/xmloff/source/core/xmltkmap.cxx +++ b/xmloff/source/core/xmltkmap.cxx @@ -59,13 +59,13 @@ public: nToken( rEntry.nToken ) {} - BOOL operator==( const SvXMLTokenMapEntry_Impl& r ) const + sal_Bool operator==( const SvXMLTokenMapEntry_Impl& r ) const { return nPrefixKey == r.nPrefixKey && sLocalName == r.sLocalName; } - BOOL operator<( const SvXMLTokenMapEntry_Impl& r ) const + sal_Bool operator<( const SvXMLTokenMapEntry_Impl& r ) const { return nPrefixKey < r.nPrefixKey || ( nPrefixKey == r.nPrefixKey && diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 6cfacbd93905..824d28a51a5c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3113,6 +3113,14 @@ namespace xmloff { namespace token { TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ), TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ), + TOKEN( "axis-type", XML_AXIS_TYPE ), //#i25706# + TOKEN( "date-scale", XML_DATE_SCALE ), + TOKEN( "base-time-unit", XML_BASE_TIME_UNIT ), + TOKEN( "major-interval-value", XML_MAJOR_INTERVAL_VALUE ), + TOKEN( "minor-interval-value", XML_MINOR_INTERVAL_VALUE ), + TOKEN( "major-interval-unit", XML_MAJOR_INTERVAL_UNIT ), + TOKEN( "minor-interval-unit", XML_MINOR_INTERVAL_UNIT ), + TOKEN( "min-value", XML_MIN_VALUE ), TOKEN( "max-value", XML_MAX_VALUE ), diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 5e91a8575b0a..c9b5d0d3e9a3 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -609,15 +609,15 @@ sal_Bool SvXMLUnitConverter::convertColor( Color& rColor, return sal_False; rColor.SetRed( - sal::static_int_cast< UINT8 >( + sal::static_int_cast< sal_uInt8 >( lcl_gethex( rValue[1] ) * 16 + lcl_gethex( rValue[2] ) ) ); rColor.SetGreen( - sal::static_int_cast< UINT8 >( + sal::static_int_cast< sal_uInt8 >( lcl_gethex( rValue[3] ) * 16 + lcl_gethex( rValue[4] ) ) ); rColor.SetBlue( - sal::static_int_cast< UINT8 >( + sal::static_int_cast< sal_uInt8 >( lcl_gethex( rValue[5] ) * 16 + lcl_gethex( rValue[6] ) ) ); return sal_True; @@ -711,7 +711,7 @@ sal_Bool SvXMLUnitConverter::convertNumber64( sal_Int64& rValue, /** convert double number to string (using ::rtl::math) */ void SvXMLUnitConverter::convertDouble(::rtl::OUStringBuffer& rBuffer, - double fNumber, BOOL bWriteUnits) const + double fNumber, sal_Bool bWriteUnits) const { SvXMLUnitConverter::convertDouble(rBuffer, fNumber, bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit); @@ -719,7 +719,7 @@ void SvXMLUnitConverter::convertDouble(::rtl::OUStringBuffer& rBuffer, /** convert double number to string (using ::rtl::math) */ void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, BOOL bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit) + double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit) { if(MAP_RELATIVE == eCoreUnit) { @@ -748,7 +748,7 @@ void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, double f /** convert string to double number (using ::rtl::math) */ sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, - const ::rtl::OUString& rString, BOOL bLookForUnits) const + const ::rtl::OUString& rString, sal_Bool bLookForUnits) const { if(bLookForUnits) { @@ -1113,7 +1113,7 @@ void SvXMLUnitConverter::convertDateTime( ::rtl::OUStringBuffer& rBuffer, } rBuffer.append( sal_Int32( aDate.GetYear())); rBuffer.append( sal_Unicode('-')); - USHORT nTemp = aDate.GetMonth(); + sal_uInt16 nTemp = aDate.GetMonth(); if (nTemp < 10) rBuffer.append( sal_Unicode('0')); rBuffer.append( sal_Int32( nTemp)); @@ -2095,7 +2095,7 @@ bool SvXMLUnitConverter::convertTimeDuration( const rtl::OUString& rString, Time else { if ( c == sal_Unicode('T') ) // "T" starts time part - bTimePart = TRUE; + bTimePart = sal_True; else if ( c == sal_Unicode('D') ) { nDays = nTemp; diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index b550477ac30c..b36c7776d905 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -160,7 +160,7 @@ public: void EndElement(); SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> & xAttrList ); @@ -258,7 +258,7 @@ void XMLImageMapObjectContext::EndElement() } SvXMLImportContext* XMLImageMapObjectContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { @@ -682,7 +682,7 @@ XMLImageMapContext::~XMLImageMapContext() } SvXMLImportContext *XMLImageMapContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 9ad048c758ac..a387ace22a95 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -519,7 +519,7 @@ public: SvXMLImportContext* pSlaveContext ); virtual ~SdXMLNumberFormatMemberImportContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -573,7 +573,7 @@ SdXMLNumberFormatMemberImportContext::~SdXMLNumberFormatMemberImportContext() { } -SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) { @@ -737,7 +737,7 @@ void SdXMLNumberFormatImportContext::EndElement() } } -SvXMLImportContext * SdXMLNumberFormatImportContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContext * SdXMLNumberFormatImportContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLNumberFormatMemberImportContext( GetImport(), nPrefix, rLocalName, xAttrList, this, SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) ); } diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index f4dfb71a2de4..8aa853ce22af 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -602,12 +602,12 @@ void AnimationsExporterImpl::exportTransitionNode() sTmp.append( sal_Unicode('s')); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); if( nSubtype != TransitionSubType::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); } @@ -805,28 +805,28 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod nTemp = xNode->getFill(); if( nTemp != AnimationFill::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_Fill) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Fill) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILL, sTmp.makeStringAndClear() ); } nTemp = xNode->getFillDefault(); if( nTemp != AnimationFill::INHERIT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_FillDefault) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_FillDefault) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILLDEFAULT, sTmp.makeStringAndClear() ); } nTemp = xNode->getRestart(); if( nTemp != AnimationRestart::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_Restart) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Restart) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTART, sTmp.makeStringAndClear() ); } nTemp = xNode->getRestartDefault(); if( nTemp != AnimationRestart::INHERIT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_RestartDefault) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_RestartDefault) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, sTmp.makeStringAndClear() ); } @@ -884,7 +884,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod { if( aTemp >>= nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_Endsync) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_Endsync) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() ); } } @@ -903,7 +903,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod { if( (pValue->Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nContainerNodeType, getAnimationsEnumMap(Animations_EnumMap_EffectNodeType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nContainerNodeType, getAnimationsEnumMap(Animations_EnumMap_EffectNodeType) ); mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, sTmp.makeStringAndClear() ); } } @@ -927,7 +927,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod sal_Int16 nEffectPresetClass = sal_Int16(); if( pValue->Value >>= nEffectPresetClass ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nEffectPresetClass, getAnimationsEnumMap(Animations_EnumMap_EffectPresetClass) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nEffectPresetClass, getAnimationsEnumMap(Animations_EnumMap_EffectPresetClass) ); mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, sTmp.makeStringAndClear() ); } } @@ -1026,14 +1026,14 @@ void AnimationsExporterImpl::exportContainer( const Reference< XTimeContainer >& sal_Int16 nTemp = xIter->getSubItem(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() ); } nTemp = xIter->getIterateType(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_IterateType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_IterateType) ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, sTmp.makeStringAndClear() ); } @@ -1105,7 +1105,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat nTemp = xAnimate->getSubItem(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_SubItem) ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() ); } @@ -1211,7 +1211,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) || ((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_CalcMode) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_CalcMode) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_CALCMODE, sTmp.makeStringAndClear() ); } @@ -1222,7 +1222,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat nTemp = xAnimate->getAdditive(); if( nTemp != AnimationAdditiveMode::REPLACE ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_AdditiveMode) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_AdditiveMode) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ADDITIVE, sTmp.makeStringAndClear() ); } } @@ -1301,7 +1301,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW ); nTemp = xTransform->getTransformType(); - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTemp, getAnimationsEnumMap(Animations_EnumMap_TransformType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, getAnimationsEnumMap(Animations_EnumMap_TransformType) ); mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_TYPE, sTmp.makeStringAndClear() ); } break; @@ -1312,13 +1312,13 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat eElementToken = XML_TRANSITIONFILTER; sal_Int16 nTransition = xTransitionFilter->getTransition(); - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, getAnimationsEnumMap(Animations_EnumMap_TransitionType) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); sal_Int16 nSubtype = xTransitionFilter->getSubtype(); if( nSubtype != TransitionSubType::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, getAnimationsEnumMap(Animations_EnumMap_TransitionSubType) ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); } @@ -1396,7 +1396,7 @@ void AnimationsExporterImpl::exportCommand( const Reference< XCommand >& xComman } sal_Int16 nCommand = xCommand->getCommand(); - SvXMLUnitConverter::convertEnum( sTmp, (USHORT)nCommand, getAnimationsEnumMap(Animations_EnumMap_Command) ); + SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nCommand, getAnimationsEnumMap(Animations_EnumMap_Command) ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, sTmp.makeStringAndClear() ); // todo virtual ::com::sun::star::uno::Any SAL_CALL getParameter() throw (::com::sun::star::uno::RuntimeException) = 0; @@ -1626,7 +1626,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa sTmp.append( (sal_Unicode)'.' ); } - SvXMLUnitConverter::convertEnum( sTmp2, (USHORT)pEvent->Trigger, getAnimationsEnumMap(Animations_EnumMap_EventTrigger) ); + SvXMLUnitConverter::convertEnum( sTmp2, (sal_uInt16)pEvent->Trigger, getAnimationsEnumMap(Animations_EnumMap_EventTrigger) ); sTmp.append( sTmp2.makeStringAndClear() ); } diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 0920ef4f0992..1b425786f5c0 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -1294,7 +1294,7 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< : } } -SvXMLImportContext * AnimationNodeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, +SvXMLImportContext * AnimationNodeContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { if( mxNode.is()) @@ -1311,7 +1311,7 @@ public: AnimationsImport( const Reference< XMultiServiceFactory > & rSMgr ); ~AnimationsImport() throw (); - SvXMLImportContext* CreateContext(USHORT nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList); + SvXMLImportContext* CreateContext(sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList); // XInterface virtual Any SAL_CALL queryInterface( const Type& aType ) throw (RuntimeException); @@ -1380,7 +1380,7 @@ void SAL_CALL AnimationsImport::release() throw () SvXMLImport::release(); } -SvXMLImportContext *AnimationsImport::CreateContext(USHORT nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList) +SvXMLImportContext *AnimationsImport::CreateContext(sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList) { SvXMLImportContext* pContext = 0; diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index c3dbd86fbe41..07f93545a352 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -412,7 +412,7 @@ public: virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); }; @@ -531,13 +531,13 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s case XML_NAMESPACE_PRESENTATION: if( IsXMLToken( aLocalName, XML_EFFECT ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) ) meEffect = (XMLEffect)eEnum; } else if( IsXMLToken(aLocalName, XML_DIRECTION ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) ) meDirection = (XMLEffectDirection)eEnum; } @@ -549,7 +549,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s } else if( IsXMLToken( aLocalName, XML_SPEED ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) ) meSpeed = (AnimationSpeed)eEnum; } @@ -566,7 +566,7 @@ XMLAnimationsEffectContext::~XMLAnimationsEffectContext() { } -SvXMLImportContext * XMLAnimationsEffectContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContext * XMLAnimationsEffectContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { return new XMLAnimationsSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this ); } @@ -687,7 +687,7 @@ XMLAnimationsContext::~XMLAnimationsContext() delete mpImpl; } -SvXMLImportContext * XMLAnimationsContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, +SvXMLImportContext * XMLAnimationsContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { return new XMLAnimationsEffectContext( GetImport(), nPrefix, rLocalName, xAttrList, mpImpl ); diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index 3f8fb3bb88be..f8f127f4e0c9 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -96,7 +96,7 @@ public: SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape ); virtual ~SdXMLEventContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ); + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ); virtual void EndElement(); sal_Bool mbValid; @@ -218,19 +218,19 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons case XML_NAMESPACE_PRESENTATION: if( IsXMLToken( aAttrLocalName, XML_ACTION ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_EventActions_EnumMap ) ) meClickAction = (ClickAction)eEnum; } if( IsXMLToken( aAttrLocalName, XML_EFFECT ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) ) meEffect = (XMLEffect)eEnum; } else if( IsXMLToken( aAttrLocalName, XML_DIRECTION ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) ) meDirection = (XMLEffectDirection)eEnum; } @@ -242,7 +242,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons } else if( IsXMLToken( aAttrLocalName, XML_SPEED ) ) { - USHORT eEnum; + sal_uInt16 eEnum; if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) ) meSpeed = (AnimationSpeed)eEnum; } @@ -319,7 +319,7 @@ SdXMLEventContext::~SdXMLEventContext() { } -SvXMLImportContext * SdXMLEventContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContext * SdXMLEventContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this ); } @@ -568,7 +568,7 @@ SdXMLEventsContext::~SdXMLEventsContext() { } -SvXMLImportContext * SdXMLEventsContext::CreateChildContext( USHORT nPrfx, const ::rtl::OUString& rLocalName, +SvXMLImportContext * SdXMLEventsContext::CreateChildContext( sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLEventContext( GetImport(), nPrfx, rLocalName, xAttrList, mxShape ); diff --git a/xmloff/source/draw/eventimp.hxx b/xmloff/source/draw/eventimp.hxx index 75441fb7657a..bac04f2bea01 100644 --- a/xmloff/source/draw/eventimp.hxx +++ b/xmloff/source/draw/eventimp.hxx @@ -49,7 +49,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rxShape ); virtual ~SdXMLEventsContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx index 26113c1ce156..6770a11958d8 100644 --- a/xmloff/source/draw/layerimp.cxx +++ b/xmloff/source/draw/layerimp.cxx @@ -65,7 +65,7 @@ public: SdXMLLayerContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XNameAccess >& xLayerManager ); virtual ~SdXMLLayerContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); virtual void EndElement(); private: @@ -105,7 +105,7 @@ SdXMLLayerContext::~SdXMLLayerContext() { } -SvXMLImportContext * SdXMLLayerContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const Reference< XAttributeList >& ) +SvXMLImportContext * SdXMLLayerContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference< XAttributeList >& ) { if( (XML_NAMESPACE_SVG == nPrefix) && IsXMLToken(rLocalName, XML_TITLE) ) { @@ -173,7 +173,7 @@ SdXMLLayerSetContext::~SdXMLLayerSetContext() { } -SvXMLImportContext * SdXMLLayerSetContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, +SvXMLImportContext * SdXMLLayerSetContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLLayerContext( GetImport(), nPrefix, rLocalName, xAttrList, mxLayerManager ); diff --git a/xmloff/source/draw/layerimp.hxx b/xmloff/source/draw/layerimp.hxx index 9933bb8660ae..9e5eaea5199c 100644 --- a/xmloff/source/draw/layerimp.hxx +++ b/xmloff/source/draw/layerimp.hxx @@ -50,7 +50,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLLayerSetContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index b2dae2f23274..22a6ef13c72f 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -958,7 +958,7 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy case XML_SD_TYPE_BACKFACE_CULLING: { // #87922# DoubleSided -> BackfaceCulling - // This BOOL needs to be flipped, DoubleSided TRUE -> NO Backface culling + // This sal_Bool needs to be flipped, DoubleSided sal_True -> NO Backface culling // and vice versa. pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_DISABLED), GetXMLToken(XML_ENABLED) ); break; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 10692cda1d54..5accd0d2ba64 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -119,7 +119,7 @@ class ImpXMLEXPPageMasterInfo public: ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const Reference<XDrawPage>& xPage); - BOOL operator==(const ImpXMLEXPPageMasterInfo& rInfo) const; + sal_Bool operator==(const ImpXMLEXPPageMasterInfo& rInfo) const; void SetName(const OUString& rStr); const OUString& GetName() const { return msName; } @@ -189,7 +189,7 @@ ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo( } } -BOOL ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const +sal_Bool ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const { return ((mnBorderBottom == rInfo.mnBorderBottom) && (mnBorderLeft == rInfo.mnBorderLeft) @@ -224,7 +224,7 @@ class ImpXMLAutoLayoutInfo public: ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf); - BOOL operator==(const ImpXMLAutoLayoutInfo& rInfo) const; + sal_Bool operator==(const ImpXMLAutoLayoutInfo& rInfo) const; sal_uInt16 GetLayoutType() const { return mnType; } sal_Int32 GetGapX() const { return mnGapX; } @@ -236,19 +236,19 @@ public: const Rectangle& GetTitleRectangle() const { return maTitleRect; } const Rectangle& GetPresRectangle() const { return maPresRect; } - static BOOL IsCreateNecessary(sal_uInt16 nTyp); + static sal_Bool IsCreateNecessary(sal_uInt16 nTyp); }; -BOOL ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp) +sal_Bool ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp) { if(nTyp == 5 /* AUTOLAYOUT_ORG */ || nTyp == 20 /* AUTOLAYOUT_NONE */ || nTyp >= IMP_AUTOLAYOUT_INFO_MAX) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const +sal_Bool ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const { return ((mnType == rInfo.mnType && mpPageMasterInfo == rInfo.mpPageMasterInfo)); @@ -428,8 +428,8 @@ SdXMLExport::SdXMLExport( mpPropertySetMapper(0L), mpPresPagePropsMapper(0L), mbIsDraw(bIsDraw), - mbFamilyGraphicUsed(FALSE), - mbFamilyPresentationUsed(FALSE), + mbFamilyGraphicUsed(sal_False), + mbFamilyPresentationUsed(sal_False), msZIndex( GetXMLToken(XML_ZINDEX) ), msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ), @@ -824,7 +824,7 @@ void SdXMLExport::ImpWriteObjGraphicStyleInfos() aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef ); // write graphic family styles - aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID); + aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef, sal_False, XML_STYLE_FAMILY_SD_GRAPHICS_ID); } } catch( lang::ServiceNotRegisteredException& ) @@ -867,10 +867,10 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() } } -BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName) +sal_Bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName) { rName = OUString(); - BOOL bRetval(FALSE); + sal_Bool bRetval(sal_False); Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY); if(xPropSet.is()) @@ -903,7 +903,7 @@ BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUStr // create entry and look for existance ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo); - BOOL bDidExist(FALSE); + sal_Bool bDidExist(sal_False); for(sal_uInt32 nCnt = 0L; !bDidExist && nCnt < mpAutoLayoutInfoList->Count(); nCnt++) { @@ -911,7 +911,7 @@ BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUStr { delete pNew; pNew = mpAutoLayoutInfoList->GetObject(nCnt); - bDidExist = TRUE; + bDidExist = sal_True; } } @@ -926,7 +926,7 @@ BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUStr } rName = pNew->GetLayoutName(); - bRetval = TRUE; + bRetval = sal_True; } } } @@ -1859,7 +1859,7 @@ void SdXMLExport::ImpWritePresentationStyles() aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-")); aStEx.exportStyleFamily(xNamed->getName(), OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)), - aMapperRef, FALSE, + aMapperRef, sal_False, XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix); } } @@ -2272,7 +2272,7 @@ void SdXMLExport::exportPresentationSettings() ////////////////////////////////////////////////////////////////////////////// -void SdXMLExport::_ExportStyles(BOOL bUsed) +void SdXMLExport::_ExportStyles(sal_Bool bUsed) { GetPropertySetMapper()->SetAutoStyles( sal_False ); diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx index aa792d43faf6..0e6bfc5bcd20 100644 --- a/xmloff/source/draw/sdxmlexp_impl.hxx +++ b/xmloff/source/draw/sdxmlexp_impl.hxx @@ -149,7 +149,7 @@ class SdXMLExport : public SvXMLExport const rtl::OUString msEndShape; const rtl::OUString msPageLayoutNames; - virtual void _ExportStyles(BOOL bUsed); + virtual void _ExportStyles(sal_Bool bUsed); virtual void _ExportAutoStyles(); virtual void _ExportMasterStyles(); virtual void _ExportContent(); @@ -169,7 +169,7 @@ class SdXMLExport : public SvXMLExport void ImpWritePresentationStyles(); ::rtl::OUString ImpCreatePresPageStyleName( com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage, bool bExportBackground = true ); - BOOL ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, rtl::OUString& rName); + sal_Bool ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, rtl::OUString& rName); void ImpWriteAutoLayoutInfos(); void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect); void ImpWriteHeaderFooterDecls(); @@ -207,13 +207,13 @@ public: XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; } XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; } - BOOL IsDraw() const { return mbIsDraw; } - BOOL IsImpress() const { return !mbIsDraw; } + sal_Bool IsDraw() const { return mbIsDraw; } + sal_Bool IsImpress() const { return !mbIsDraw; } - BOOL IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; } - void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = TRUE; } - BOOL IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; } - void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = TRUE; } + sal_Bool IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; } + void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = sal_True; } + sal_Bool IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; } + void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = sal_True; } virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ); virtual void exportDataStyles(); diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 4b2e2141c8d0..578b3eefc719 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -130,14 +130,14 @@ protected: public: SdXMLDocContext_Impl( SdXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLDocContext_Impl(); TYPEINFO(); - virtual SvXMLImportContext *CreateChildContext(USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList); }; @@ -146,7 +146,7 @@ public: SdXMLDocContext_Impl::SdXMLDocContext_Impl( SdXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference<xml::sax::XAttributeList>&) : SvXMLImportContext(rImport, nPrfx, rLName) @@ -164,7 +164,7 @@ TYPEINIT1( SdXMLDocContext_Impl, SvXMLImportContext ); ////////////////////////////////////////////////////////////////////////////// SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { @@ -254,7 +254,7 @@ class SdXMLFlatDocContext_Impl { public: SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport, - USHORT i_nPrefix, const OUString & i_rLName, + sal_uInt16 i_nPrefix, const OUString & i_rLName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList, const uno::Reference<document::XDocumentProperties>& i_xDocProps, const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder); @@ -262,12 +262,12 @@ public: virtual ~SdXMLFlatDocContext_Impl(); virtual SvXMLImportContext *CreateChildContext( - USHORT i_nPrefix, const OUString& i_rLocalName, + sal_uInt16 i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList); }; SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport, - USHORT i_nPrefix, const OUString & i_rLName, + sal_uInt16 i_nPrefix, const OUString & i_rLName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList, const uno::Reference<document::XDocumentProperties>& i_xDocProps, const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) : @@ -281,7 +281,7 @@ SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport, SdXMLFlatDocContext_Impl::~SdXMLFlatDocContext_Impl() { } SvXMLImportContext *SdXMLFlatDocContext_Impl::CreateChildContext( - USHORT i_nPrefix, const OUString& i_rLocalName, + sal_uInt16 i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList) { // behave like meta base class iff we encounter office:meta @@ -725,7 +725,7 @@ const SvXMLTokenMap& SdXMLImport::GetPresentationPlaceholderAttrTokenMap() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext *SdXMLImport::CreateContext(USHORT nPrefix, +SvXMLImportContext *SdXMLImport::CreateContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { @@ -805,7 +805,7 @@ SvXMLStylesContext *SdXMLImport::CreateStylesContext(const OUString& rLocalName, return GetShapeImport()->GetStylesContext(); GetShapeImport()->SetStylesContext(new SdXMLStylesContext( - *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, FALSE)); + *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, sal_False)); return GetShapeImport()->GetStylesContext(); } @@ -819,7 +819,7 @@ SvXMLStylesContext *SdXMLImport::CreateAutoStylesContext(const OUString& rLocalN return GetShapeImport()->GetAutoStylesContext(); GetShapeImport()->SetAutoStylesContext(new SdXMLStylesContext( - *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, TRUE)); + *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, sal_True)); return GetShapeImport()->GetAutoStylesContext(); } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index e7c6f2ff6af3..a8f09f2d99bd 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -80,7 +80,7 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, maShapesInfos(), maCurrentShapesIter(maShapesInfos.end()), mbExportLayer( sal_False ), - // #88546# init to FALSE + // #88546# init to sal_False mbHandleProgressBar( sal_False ), msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ), msPrintable( RTL_CONSTASCII_USTRINGPARAM("Printable") ), @@ -1276,7 +1276,7 @@ void XMLShapeExport::ExportGraphicDefaults() aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper ); // write graphic family styles - aStEx.exportStyleFamily("graphics", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID); + aStEx.exportStyleFamily("graphics", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper, sal_False, XML_STYLE_FAMILY_SD_GRAPHICS_ID); } } catch( lang::ServiceNotRegisteredException& ) diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 1295da204db9..7c6268571a9c 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -182,7 +182,7 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr); // decide if transformation is neccessary - BOOL bTransformationIsNeccessary(fTRShear != 0.0 || fTRRotate != 0.0); + sal_Bool bTransformationIsNeccessary(fTRShear != 0.0 || fTRRotate != 0.0); if(bTransformationIsNeccessary) { @@ -678,8 +678,8 @@ void XMLShapeExport::ImpExportTextBoxShape( uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); // presentation attribute (if presentation) - sal_Bool bIsPresShape(FALSE); - sal_Bool bIsEmptyPresObj(FALSE); + sal_Bool bIsPresShape(sal_False); + sal_Bool bIsEmptyPresObj(sal_False); OUString aStr; switch(eShapeType) @@ -687,49 +687,49 @@ void XMLShapeExport::ImpExportTextBoxShape( case XmlShapeTypePresSubtitleShape: { aStr = GetXMLToken(XML_PRESENTATION_SUBTITLE); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresTitleTextShape: { aStr = GetXMLToken(XML_PRESENTATION_TITLE); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresOutlinerShape: { aStr = GetXMLToken(XML_PRESENTATION_OUTLINE); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresNotesShape: { aStr = GetXMLToken(XML_PRESENTATION_NOTES); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresHeaderShape: { aStr = GetXMLToken(XML_HEADER); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresFooterShape: { aStr = GetXMLToken(XML_FOOTER); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresSlideNumberShape: { aStr = GetXMLToken(XML_PAGE_NUMBER); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } case XmlShapeTypePresDateTimeShape: { aStr = GetXMLToken(XML_DATE_TIME); - bIsPresShape = TRUE; + bIsPresShape = sal_True; break; } default: @@ -926,7 +926,7 @@ void XMLShapeExport::ImpExportEllipseShape( awt::Size aSize = xShape->getSize(); sal_Int32 nRx((aSize.Width + 1) / 2); sal_Int32 nRy((aSize.Height + 1) / 2); - BOOL bCircle(nRx == nRy); + sal_Bool bCircle(nRx == nRy); // Transformation ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); @@ -945,7 +945,7 @@ void XMLShapeExport::ImpExportEllipseShape( const double dEndAngle = nEndAngle / 100.0; // export circle kind - SvXMLUnitConverter::convertEnum( sStringBuffer, (USHORT)eKind, aXML_CircleKind_EnumMap ); + SvXMLUnitConverter::convertEnum( sStringBuffer, (sal_uInt16)eKind, aXML_CircleKind_EnumMap ); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_KIND, sStringBuffer.makeStringAndClear() ); // export start angle @@ -991,9 +991,9 @@ void XMLShapeExport::ImpExportPolygonShape( const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) { - BOOL bClosed(eShapeType == XmlShapeTypeDrawPolyPolygonShape + sal_Bool bClosed(eShapeType == XmlShapeTypeDrawPolyPolygonShape || eShapeType == XmlShapeTypeDrawClosedBezierShape); - BOOL bBezier(eShapeType == XmlShapeTypeDrawClosedBezierShape + sal_Bool bBezier(eShapeType == XmlShapeTypeDrawClosedBezierShape || eShapeType == XmlShapeTypeDrawOpenBezierShape); // get matrix diff --git a/xmloff/source/draw/shapeexport3.cxx b/xmloff/source/draw/shapeexport3.cxx index d5c06d7a8ead..36ab9c499fe5 100644 --- a/xmloff/source/draw/shapeexport3.cxx +++ b/xmloff/source/draw/shapeexport3.cxx @@ -212,7 +212,7 @@ void XMLShapeExport::ImpExport3DShape( double fXMax = 0; double fYMin = 0; double fYMax = 0; - BOOL bInit(FALSE); + sal_Bool bInit(sal_False); sal_Int32 nOuterSequenceCount(xPolyPolygon3D.SequenceX.getLength()); drawing::DoubleSequence* pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray(); drawing::DoubleSequence* pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray(); @@ -247,7 +247,7 @@ void XMLShapeExport::ImpExport3DShape( { fXMin = fXMax = fX; fYMin = fYMax = fY; - bInit = TRUE; + bInit = sal_True; } } @@ -288,7 +288,7 @@ void XMLShapeExport::ImpExport3DShape( // calculate closed flag awt::Point* pFirst = aPoly.getArray(); awt::Point* pLast = pFirst + (nInnerSequenceCount - 1); - BOOL bClosed = (pFirst->X == pLast->X && pFirst->Y == pLast->Y); + sal_Bool bClosed = (pFirst->X == pLast->X && pFirst->Y == pLast->Y); aSvgDElement.AddPolygon(&aPoly, 0L, aMinPoint, aMaxSize, bClosed); diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 45411162a183..2c4018075f6b 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -159,7 +159,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( mpImpl = new XMLShapeImportHelperImpl(); mpImpl->mpSortContext = 0; - // #88546# init to FALSE + // #88546# init to sal_False mpImpl->mbHandleProgressBar = sal_False; mpSdPropHdlFactory = new XMLSdPropHdlFactory( rModel, rImporter ); @@ -183,12 +183,6 @@ XMLShapeImportHelper::XMLShapeImportHelper( mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImporter)); mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter)); -/* - // chain form attributes - const UniReference< SvXMLImportPropertyMapper> xFormMapper( rImporter.GetFormImport()->getStylePropertyMapper().getBodyPtr() ); - mpPropertySetMapper->ChainImportMapper(xFormMapper); -*/ - // construct PresPagePropsMapper xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory); mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); @@ -715,7 +709,7 @@ const SvXMLTokenMap& XMLShapeImportHelper::GetGraphicObjectShapeAttrTokenMap() SvXMLShapeContext* XMLShapeImportHelper::Create3DSceneChildContext( SvXMLImport& rImport, - USHORT p_nPrefix, + sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) @@ -795,7 +789,7 @@ void XMLShapeImportHelper::SetAutoStylesContext(SvXMLStylesContext* pNew) SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( SvXMLImport& rImport, - USHORT p_nPrefix, + sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, @@ -844,7 +838,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( { // draw:polygon or draw:polyline inside group context pContext = new SdXMLPolygonShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, - rTokenMap.Get(p_nPrefix, rLocalName) == XML_TOK_GROUP_POLYGON ? TRUE : FALSE, bTemporaryShape ); + rTokenMap.Get(p_nPrefix, rLocalName) == XML_TOK_GROUP_POLYGON ? sal_True : sal_False, bTemporaryShape ); break; } case XML_TOK_GROUP_PATH: @@ -928,7 +922,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( // This method is called from SdXMLFrameContext to create children of drawe:frame SvXMLShapeContext* XMLShapeImportHelper::CreateFrameChildContext( SvXMLImport& rImport, - USHORT p_nPrefix, + sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& rAttrList, uno::Reference< drawing::XShapes >& rShapes, @@ -1016,7 +1010,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateFrameChildContext( SvXMLImportContext *XMLShapeImportHelper::CreateFrameChildContext( SvXMLImportContext *pThisContext, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/viewcontext.cxx b/xmloff/source/draw/viewcontext.cxx index 43f12382d420..764b03e7a132 100644 --- a/xmloff/source/draw/viewcontext.cxx +++ b/xmloff/source/draw/viewcontext.cxx @@ -42,7 +42,7 @@ using ::xmloff::token::XML_EMBEDDED_VISIBLE_AREA; //------------------------------------------------------------------ -SdXMLViewSettingsContext::SdXMLViewSettingsContext( SdXMLImport& rImport, USHORT nPrfx, const OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) : +SdXMLViewSettingsContext::SdXMLViewSettingsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) : SvXMLImportContext( rImport, nPrfx, rLName ) { } @@ -51,7 +51,7 @@ SdXMLViewSettingsContext::~SdXMLViewSettingsContext() { } -SvXMLImportContext *SdXMLViewSettingsContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SdXMLViewSettingsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) diff --git a/xmloff/source/draw/viewcontext.hxx b/xmloff/source/draw/viewcontext.hxx index 56e6be33bf81..3506f969fa7c 100644 --- a/xmloff/source/draw/viewcontext.hxx +++ b/xmloff/source/draw/viewcontext.hxx @@ -39,12 +39,12 @@ class SdXMLViewSettingsContext : public SvXMLImportContext ::com::sun::star::awt::Rectangle maVisArea; public: - SdXMLViewSettingsContext( SdXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, + SdXMLViewSettingsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLViewSettingsContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx index 230e083385fb..041220be536f 100644 --- a/xmloff/source/draw/ximp3dobject.cxx +++ b/xmloff/source/draw/ximp3dobject.cxx @@ -60,7 +60,7 @@ SdXML3DObjectContext::SdXML3DObjectContext( uno::Reference< drawing::XShapes >& rShapes, sal_Bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), - mbSetTransform( FALSE ) + mbSetTransform( sal_False ) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for(sal_Int16 i=0; i < nAttrCount; i++) @@ -145,14 +145,14 @@ void SdXML3DObjectContext::SetStyle() if(maDrawStyleName.getLength() && mxShape.is()) { const SvXMLStyleContext* pStyle = 0L; - sal_Bool bAutoStyle(FALSE); + sal_Bool bAutoStyle(sal_False); if(GetImport().GetShapeImport()->GetAutoStylesContext()) pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName); if(pStyle) - bAutoStyle = TRUE; + bAutoStyle = sal_True; if(!pStyle && GetImport().GetShapeImport()->GetStylesContext()) pStyle = GetImport().GetShapeImport()->GetStylesContext()-> @@ -198,8 +198,8 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maMinEdge(-2500.0, -2500.0, -2500.0), maMaxEdge(2500.0, 2500.0, 2500.0), - mbMinEdgeUsed(FALSE), - mbMaxEdgeUsed(FALSE) + mbMinEdgeUsed(sal_False), + mbMaxEdgeUsed(sal_False) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for(sal_Int16 i=0; i < nAttrCount; i++) @@ -220,7 +220,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( if(aNewVec != maMinEdge) { maMinEdge = aNewVec; - mbMinEdgeUsed = TRUE; + mbMinEdgeUsed = sal_True; } break; } @@ -232,7 +232,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( if(aNewVec != maMaxEdge) { maMaxEdge = aNewVec; - mbMaxEdgeUsed = TRUE; + mbMaxEdgeUsed = sal_True; } break; } @@ -309,8 +309,8 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maCenter(0.0, 0.0, 0.0), maSize(5000.0, 5000.0, 5000.0), - mbCenterUsed(FALSE), - mbSizeUsed(FALSE) + mbCenterUsed(sal_False), + mbSizeUsed(sal_False) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for(sal_Int16 i=0; i < nAttrCount; i++) @@ -331,7 +331,7 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( if(aNewVec != maCenter) { maCenter = aNewVec; - mbCenterUsed = TRUE; + mbCenterUsed = sal_True; } break; } @@ -343,7 +343,7 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( if(aNewVec != maSize) { maSize = aNewVec; - mbSizeUsed = TRUE; + mbSizeUsed = sal_True; } break; } diff --git a/xmloff/source/draw/ximp3dobject.hxx b/xmloff/source/draw/ximp3dobject.hxx index b81309d33530..ee453d42b0df 100644 --- a/xmloff/source/draw/ximp3dobject.hxx +++ b/xmloff/source/draw/ximp3dobject.hxx @@ -47,7 +47,7 @@ protected: // the shape group this object should be created inside com::sun::star::drawing::HomogenMatrix mxHomMat; - BOOL mbSetTransform; + sal_Bool mbSetTransform; /* void SetStyle(); @@ -75,8 +75,8 @@ class SdXML3DCubeObjectShapeContext : public SdXML3DObjectContext { ::basegfx::B3DVector maMinEdge; ::basegfx::B3DVector maMaxEdge; - BOOL mbMinEdgeUsed; - BOOL mbMaxEdgeUsed; + sal_Bool mbMinEdgeUsed; + sal_Bool mbMaxEdgeUsed; public: TYPEINFO(); @@ -99,8 +99,8 @@ class SdXML3DSphereObjectShapeContext : public SdXML3DObjectContext { ::basegfx::B3DVector maCenter; ::basegfx::B3DVector maSize; - BOOL mbCenterUsed; - BOOL mbSizeUsed; + sal_Bool mbCenterUsed; + sal_Bool mbSizeUsed; public: TYPEINFO(); diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index dd041daddec8..37d60c761deb 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -54,8 +54,8 @@ SdXML3DLightContext::SdXML3DLightContext( : SvXMLImportContext( rImport, nPrfx, rLName), maDiffuseColor(0x00000000), maDirection(0.0, 0.0, 1.0), - mbEnabled(FALSE), - mbSpecular(FALSE) + mbEnabled(sal_False), + mbSpecular(sal_False) { // read attributes for the 3DScene sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -103,7 +103,7 @@ TYPEINIT1( SdXML3DSceneShapeContext, SdXMLShapeContext ); SdXML3DSceneShapeContext::SdXML3DSceneShapeContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, @@ -180,7 +180,7 @@ void SdXML3DSceneShapeContext::EndElement() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { @@ -224,20 +224,20 @@ SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( USHORT nPrefix SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ) : mrImport( rImporter ), - mbSetTransform( FALSE ), + mbSetTransform( sal_False ), mxPrjMode(drawing::ProjectionMode_PERSPECTIVE), mnDistance(1000), mnFocalLength(1000), mnShadowSlant(0), mxShadeMode(drawing::ShadeMode_SMOOTH), maAmbientColor(0x00666666), - mbLightingMode(FALSE), + mbLightingMode(sal_False), maVRP(0.0, 0.0, 1.0), maVPN(0.0, 0.0, 1.0), maVUP(0.0, 1.0, 0.0), - mbVRPUsed(FALSE), - mbVPNUsed(FALSE), - mbVUPUsed(FALSE) + mbVRPUsed(sal_False), + mbVPNUsed(sal_False), + mbVUPUsed(sal_False) { } @@ -283,7 +283,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co if(aNewVec != maVRP) { maVRP = aNewVec; - mbVRPUsed = TRUE; + mbVRPUsed = sal_True; } return; } @@ -295,7 +295,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co if(aNewVec != maVPN) { maVPN = aNewVec; - mbVPNUsed = TRUE; + mbVPNUsed = sal_True; } return; } @@ -307,7 +307,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co if(aNewVec != maVUP) { maVUP = aNewVec; - mbVUPUsed = TRUE; + mbVUPUsed = sal_True; } return; } diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx index f0ab566a68a7..de5703102f81 100644 --- a/xmloff/source/draw/ximp3dscene.hxx +++ b/xmloff/source/draw/ximp3dscene.hxx @@ -57,7 +57,7 @@ public: SdXML3DSceneShapeContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, @@ -68,7 +68,7 @@ public: virtual void EndElement(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& GetLocalShapesContext() const diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index af5fef0ff9dc..dbd0eeaac601 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -56,7 +56,7 @@ using namespace ::com::sun::star; ////////////////////////////////////////////////////////////////////////////// SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, - USHORT nPrfx, const OUString& rLocalName, + sal_uInt16 nPrfx, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) : SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ) @@ -71,7 +71,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, { OUString sAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; - USHORT nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); OUString sValue = xAttrList->getValueByIndex( i ); const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetDrawPageAttrTokenMap(); @@ -166,7 +166,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, if(xDrawPage.is() && xMasterPages.is()) { - sal_Bool bDone(FALSE); + sal_Bool bDone(sal_False); OUString sDisplayName( rImport.GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, maMasterPageName ) ); @@ -186,7 +186,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, sMasterPageName.equals(sDisplayName)) { xDrawPage->setMasterPage(xMasterPage); - bDone = TRUE; + bDone = sal_True; } } } @@ -231,7 +231,7 @@ SdXMLDrawPageContext::~SdXMLDrawPageContext() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { @@ -304,7 +304,7 @@ void SdXMLDrawPageContext::EndElement() ////////////////////////////////////////////////////////////////////////////// SdXMLBodyContext::SdXMLBodyContext( SdXMLImport& rImport, - USHORT nPrfx, const OUString& rLocalName ) + sal_uInt16 nPrfx, const OUString& rLocalName ) : SvXMLImportContext( rImport, nPrfx, rLocalName ) { } @@ -318,7 +318,7 @@ SdXMLBodyContext::~SdXMLBodyContext() ////////////////////////////////////////////////////////////////////////////// SvXMLImportContext *SdXMLBodyContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx index de58459f2438..ac5ea1a53fa1 100644 --- a/xmloff/source/draw/ximpbody.hxx +++ b/xmloff/source/draw/ximpbody.hxx @@ -45,14 +45,14 @@ class SdXMLDrawPageContext : public SdXMLGenericPageContext bool mbHadSMILNodes; public: - SdXMLDrawPageContext( SdXMLImport& rImport, USHORT nPrfx, + SdXMLDrawPageContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); virtual ~SdXMLDrawPageContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void EndElement(); @@ -67,11 +67,11 @@ class SdXMLBodyContext : public SvXMLImportContext SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); } public: - SdXMLBodyContext( SdXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName ); + SdXMLBodyContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName ); virtual ~SdXMLBodyContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 424593d830ac..c0808153cc47 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -149,7 +149,7 @@ void GetEnum( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, const SvXMLEnumMapEntry& rMap ) { - USHORT eKind; + sal_uInt16 eKind; if( SvXMLUnitConverter::convertEnum( eKind, rValue, &rMap ) ) { sal_Int16 nEnum = (sal_Int16)eKind; @@ -1286,7 +1286,7 @@ void XMLEnhancedCustomShapeContext::EndElement() SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maHandles, EASGet( EAS_Handles ) ); } -SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( USHORT nPrefix,const rtl::OUString& rLocalName, +SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix,const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList> & xAttrList ) { EnhancedCustomShapeTokenEnum aTokenEnum = EASGet( rLocalName ); diff --git a/xmloff/source/draw/ximpcustomshape.hxx b/xmloff/source/draw/ximpcustomshape.hxx index 8cb742838151..76ed03c19f3b 100644 --- a/xmloff/source/draw/ximpcustomshape.hxx +++ b/xmloff/source/draw/ximpcustomshape.hxx @@ -70,7 +70,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - SvXMLImportContext *CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> & xAttrList ); }; diff --git a/xmloff/source/draw/ximpgrp.cxx b/xmloff/source/draw/ximpgrp.cxx index 115c3b8b778c..18a75f3bfe83 100644 --- a/xmloff/source/draw/ximpgrp.cxx +++ b/xmloff/source/draw/ximpgrp.cxx @@ -46,7 +46,7 @@ TYPEINIT1( SdXMLGroupShapeContext, SvXMLImportContext ); SdXMLGroupShapeContext::SdXMLGroupShapeContext( SvXMLImport& rImport, - USHORT nPrfx, const OUString& rLocalName, + sal_uInt16 nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, sal_Bool bTemporaryShape) @@ -62,7 +62,7 @@ SdXMLGroupShapeContext::~SdXMLGroupShapeContext() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximpgrp.hxx b/xmloff/source/draw/ximpgrp.hxx index 1b4d0f043816..901b0c432d11 100644 --- a/xmloff/source/draw/ximpgrp.hxx +++ b/xmloff/source/draw/ximpgrp.hxx @@ -50,14 +50,14 @@ protected: public: TYPEINFO(); - SdXMLGroupShapeContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName, + SdXMLGroupShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, sal_Bool bTemporaryShape); virtual ~SdXMLGroupShapeContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual void EndElement(); diff --git a/xmloff/source/draw/ximplink.cxx b/xmloff/source/draw/ximplink.cxx index ae657d0c32cd..89d5349bab64 100644 --- a/xmloff/source/draw/ximplink.cxx +++ b/xmloff/source/draw/ximplink.cxx @@ -41,7 +41,7 @@ using namespace ::xmloff::token; TYPEINIT1( SdXMLShapeLinkContext, SvXMLImportContext ); -SdXMLShapeLinkContext::SdXMLShapeLinkContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) +SdXMLShapeLinkContext::SdXMLShapeLinkContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) : SvXMLShapeContext( rImport, nPrfx, rLocalName, false ) , mxParent( rShapes ) { @@ -51,7 +51,7 @@ SdXMLShapeLinkContext::SdXMLShapeLinkContext( SvXMLImport& rImport, USHORT nPrfx { OUString sAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; - USHORT nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( (nPrefix == XML_NAMESPACE_XLINK) && IsXMLToken( aLocalName, XML_HREF ) ) { msHyperlink = xAttrList->getValueByIndex( i ); @@ -68,7 +68,7 @@ SdXMLShapeLinkContext::~SdXMLShapeLinkContext() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext* SdXMLShapeLinkContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext* SdXMLShapeLinkContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximplink.hxx b/xmloff/source/draw/ximplink.hxx index 473ad0ce712a..edcb6cbf811c 100644 --- a/xmloff/source/draw/ximplink.hxx +++ b/xmloff/source/draw/ximplink.hxx @@ -50,13 +50,13 @@ class SdXMLShapeLinkContext : public SvXMLShapeContext public: TYPEINFO(); - SdXMLShapeLinkContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName, + SdXMLShapeLinkContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); virtual ~SdXMLShapeLinkContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual void EndElement(); diff --git a/xmloff/source/draw/ximpnote.cxx b/xmloff/source/draw/ximpnote.cxx index 43469ddf0f91..7330ab85a0e4 100644 --- a/xmloff/source/draw/ximpnote.cxx +++ b/xmloff/source/draw/ximpnote.cxx @@ -38,7 +38,7 @@ using namespace ::com::sun::star; ////////////////////////////////////////////////////////////////////////////// SdXMLNotesContext::SdXMLNotesContext( SdXMLImport& rImport, - USHORT nPrfx, const OUString& rLocalName, + sal_uInt16 nPrfx, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) : SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ) @@ -111,7 +111,7 @@ SdXMLNotesContext::~SdXMLNotesContext() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext *SdXMLNotesContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SdXMLNotesContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximpnote.hxx b/xmloff/source/draw/ximpnote.hxx index ca5f01acdd83..5217b9a7dc34 100644 --- a/xmloff/source/draw/ximpnote.hxx +++ b/xmloff/source/draw/ximpnote.hxx @@ -42,14 +42,14 @@ private: rtl::OUString msPageMasterName; public: - SdXMLNotesContext( SdXMLImport& rImport, USHORT nPrfx, + SdXMLNotesContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); virtual ~SdXMLNotesContext(); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void EndElement(); }; diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 29aa839c2b9e..663ad84165e8 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -74,9 +74,9 @@ class DrawAnnotationContext : public SvXMLImportContext { public: - DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ); + DrawAnnotationContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void EndElement(); private: @@ -87,7 +87,7 @@ private: OUStringBuffer maDateBuffer; }; -DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ) +DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ) : SvXMLImportContext( rImport, nPrfx, rLocalName ) , mxAnnotation( xAnnotationAccess->createAndInsertAnnotation() ) { @@ -141,7 +141,7 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx } } -SvXMLImportContext * DrawAnnotationContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * DrawAnnotationContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { SvXMLImportContext * pContext = NULL; @@ -214,7 +214,7 @@ TYPEINIT1( SdXMLGenericPageContext, SvXMLImportContext ); SdXMLGenericPageContext::SdXMLGenericPageContext( SvXMLImport& rImport, - USHORT nPrfx, const OUString& rLocalName, + sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< xml::sax::XAttributeList>& xAttrList, Reference< drawing::XShapes >& rShapes) : SvXMLImportContext( rImport, nPrfx, rLocalName ) @@ -227,7 +227,7 @@ SdXMLGenericPageContext::SdXMLGenericPageContext( { OUString sAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; - USHORT nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if( (nPrefix == XML_NAMESPACE_DRAW) && IsXMLToken( aLocalName, XML_NAV_ORDER ) ) { msNavOrder = xAttrList->getValueByIndex( i ); @@ -254,7 +254,7 @@ void SdXMLGenericPageContext::StartElement( const Reference< ::com::sun::star::x ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx index 8a3bff26f968..29495748b6be 100644 --- a/xmloff/source/draw/ximppage.hxx +++ b/xmloff/source/draw/ximppage.hxx @@ -75,14 +75,14 @@ protected: public: TYPEINFO(); - SdXMLGenericPageContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName, + SdXMLGenericPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); virtual ~SdXMLGenericPageContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void EndElement(); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 34590cbd95de..552c731230af 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -161,9 +161,9 @@ SdXMLShapeContext::SdXMLShapeContext( , mxAttrList(xAttrList) , mbListContextPushed( false ) , mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID) -, mbIsPlaceholder(FALSE) +, mbIsPlaceholder(sal_False) , mbClearDefaultAttributes( true ) -, mbIsUserTransformed(FALSE) +, mbIsUserTransformed(sal_False) , mnZOrder(-1) , maSize(1, 1) , maPosition(0, 0) @@ -180,7 +180,7 @@ SdXMLShapeContext::~SdXMLShapeContext() ////////////////////////////////////////////////////////////////////////////// -SvXMLImportContext *SdXMLShapeContext::CreateChildContext( USHORT p_nPrefix, +SvXMLImportContext *SdXMLShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { @@ -312,7 +312,7 @@ void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttribute } else if( IsXMLToken( aLocalName, XML_ALIGN ) ) { - USHORT eKind; + sal_uInt16 eKind; if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueAlignment_EnumMap ) ) { aGluePoint.PositionAlignment = (drawing::Alignment)eKind; @@ -321,7 +321,7 @@ void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttribute } else if( IsXMLToken( aLocalName, XML_ESCAPE_DIRECTION ) ) { - USHORT eKind; + sal_uInt16 eKind; if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueEscapeDirection_EnumMap ) ) { aGluePoint.Escape = (drawing::EscapeDirection)eKind; @@ -613,13 +613,13 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) break; const SvXMLStyleContext* pStyle = 0L; - sal_Bool bAutoStyle(FALSE); + sal_Bool bAutoStyle(sal_False); if(GetImport().GetShapeImport()->GetAutoStylesContext()) pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName); if(pStyle) - bAutoStyle = TRUE; + bAutoStyle = sal_True; if(!pStyle && GetImport().GetShapeImport()->GetStylesContext()) pStyle = GetImport().GetShapeImport()->GetStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName); @@ -1187,7 +1187,7 @@ void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl { if( IsXMLToken( rLocalName, XML_KIND ) ) { - USHORT eKind; + sal_uInt16 eKind; if( SvXMLUnitConverter::convertEnum( eKind, rValue, aXML_CircleKind_EnumMap ) ) { meKind = eKind; @@ -1355,7 +1355,7 @@ SdXMLPathShapeContext::SdXMLPathShapeContext( uno::Reference< drawing::XShapes >& rShapes, sal_Bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), - mbClosed( TRUE ) + mbClosed( sal_True ) { } @@ -1576,7 +1576,7 @@ void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAtt // XmlShapeTypePresTitleTextShape pService = "com.sun.star.presentation.TitleTextShape"; } - bIsPresShape = TRUE; + bIsPresShape = sal_True; } } @@ -1740,7 +1740,7 @@ SdXMLConnectorShapeContext::SdXMLConnectorShapeContext( : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maStart(0,0), maEnd(1,1), - mnType( (USHORT)drawing::ConnectorType_STANDARD ), + mnType( (sal_uInt16)drawing::ConnectorType_STANDARD ), mnStartGlueId(-1), mnEndGlueId(-1), mnDelta1(0), @@ -2139,7 +2139,7 @@ void SdXMLPageShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib { if(bIsPresentation && !IsXMLToken( maPresentationClass, XML_PRESENTATION_PAGE ) ) { - bIsPresentation = FALSE; + bIsPresentation = sal_False; } if(bIsPresentation) @@ -2423,7 +2423,7 @@ void SdXMLGraphicObjectShapeContext::EndElement() ////////////////////////////////////////////////////////////////////////////// SvXMLImportContext* SdXMLGraphicObjectShapeContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { SvXMLImportContext* pContext = NULL; @@ -2560,7 +2560,7 @@ void SdXMLChartShapeContext::Characters( const ::rtl::OUString& rChars ) mpChartContext->Characters( rChars ); } -SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, +SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { if( mpChartContext ) @@ -2724,7 +2724,7 @@ void SdXMLObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl: } SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { // #100592# @@ -2890,7 +2890,7 @@ void SdXMLAppletShapeContext::EndElement() SdXMLShapeContext::EndElement(); } -SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( USHORT p_nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { if( p_nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) ) { @@ -3162,7 +3162,7 @@ void SdXMLPluginShapeContext::EndElement() SdXMLShapeContext::EndElement(); } -SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( USHORT p_nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { if( p_nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) ) { @@ -3326,7 +3326,7 @@ SdXMLFrameShapeContext::~SdXMLFrameShapeContext() { } -SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { @@ -3595,7 +3595,7 @@ void SdXMLCustomShapeContext::EndElement() ////////////////////////////////////////////////////////////////////////////// SvXMLImportContext* SdXMLCustomShapeContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { SvXMLImportContext* pContext = NULL; @@ -3761,7 +3761,7 @@ void SdXMLTableShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl:: SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue ); } -SvXMLImportContext* SdXMLTableShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContext* SdXMLTableShapeContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { if( mxTableImportContext.Is() && (nPrefix == XML_NAMESPACE_TABLE) ) return mxTableImportContext->CreateChildContext(nPrefix, rLocalName, xAttrList); diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index bf15534fc260..2284beb6ce0e 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -116,7 +116,7 @@ public: virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -180,7 +180,7 @@ class SdXMLEllipseShapeContext : public SdXMLShapeContext sal_Int32 mnRX; sal_Int32 mnRY; - USHORT meKind; + sal_uInt16 meKind; sal_Int32 mnStartAngle; sal_Int32 mnEndAngle; public: @@ -299,7 +299,7 @@ private: ::com::sun::star::awt::Point maStart; ::com::sun::star::awt::Point maEnd; - USHORT mnType; + sal_uInt16 mnType; rtl::OUString maStartShapeId; sal_Int32 mnStartGlueId; @@ -419,7 +419,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -446,7 +446,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); virtual void Characters( const ::rtl::OUString& rChars ); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; @@ -476,7 +476,7 @@ public: virtual void EndElement(); // #100592# - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -509,7 +509,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -541,7 +541,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -594,7 +594,7 @@ public: sal_Bool bTemporaryShape); virtual ~SdXMLFrameShapeContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -626,7 +626,7 @@ public: virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list @@ -650,7 +650,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); // this is called from the parent group for each unparsed attribute in the attribute list virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx index c81aebf41b6a..b18ff7d5c837 100644 --- a/xmloff/source/draw/ximpshow.cxx +++ b/xmloff/source/draw/ximpshow.cxx @@ -210,7 +210,7 @@ SdXMLShowsContext::~SdXMLShowsContext() delete mpImpl; } -SvXMLImportContext * SdXMLShowsContext::CreateChildContext( USHORT p_nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContext * SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { if( mpImpl && p_nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SHOW ) ) { diff --git a/xmloff/source/draw/ximpshow.hxx b/xmloff/source/draw/ximpshow.hxx index 399900711c46..121deff67cfd 100644 --- a/xmloff/source/draw/ximpshow.hxx +++ b/xmloff/source/draw/ximpshow.hxx @@ -49,7 +49,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLShowsContext(); - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); }; diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 0102ee24844a..2de7fc88c838 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -83,7 +83,7 @@ public: virtual ~SdXMLDrawingPagePropertySetContext(); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, @@ -1663,9 +1663,9 @@ SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext( SvXMLImport& rImport } } -BOOL SdXMLHeaderFooterDeclContext::IsTransient() const +sal_Bool SdXMLHeaderFooterDeclContext::IsTransient() const { - return TRUE; + return sal_True; } void SdXMLHeaderFooterDeclContext::EndElement() diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index df7e3358368f..f3311e3b4708 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -287,7 +287,7 @@ public: const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; virtual void EndElement(); virtual void Characters( const ::rtl::OUString& rChars ); diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index c010b666e552..d917ea31b8c7 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1342,7 +1342,7 @@ namespace xmloff // we don't want say form url targets to be resolved // using ResolveGraphicObjectURL if ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) ) - sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE ); + sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, sal_False ); else sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue ); return OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue ); @@ -1518,7 +1518,7 @@ namespace xmloff } } - // additionally, we need to set the "RichText" property of our element to TRUE + // additionally, we need to set the "RichText" property of our element to sal_True // (the presence of the text:p is used as indicator for the value of the RichText property) sal_Bool bHasRichTextProperty = sal_False; if ( m_xInfo.is() ) diff --git a/xmloff/source/forms/formlayerexport.cxx b/xmloff/source/forms/formlayerexport.cxx index 50245fad1d2a..517c499595ca 100644 --- a/xmloff/source/forms/formlayerexport.cxx +++ b/xmloff/source/forms/formlayerexport.cxx @@ -93,12 +93,6 @@ namespace xmloff } //--------------------------------------------------------------------- - ::vos::ORef< SvXMLExportPropertyMapper > OFormLayerXMLExport::getStylePropertyMapper() - { - return m_pImpl->getStylePropertyMapper(); - } - - //--------------------------------------------------------------------- void OFormLayerXMLExport::initialize() { m_pImpl->clear(); diff --git a/xmloff/source/forms/formlayerimport.cxx b/xmloff/source/forms/formlayerimport.cxx index a31b6397f51f..17a0a3bc9bb3 100644 --- a/xmloff/source/forms/formlayerimport.cxx +++ b/xmloff/source/forms/formlayerimport.cxx @@ -60,12 +60,6 @@ namespace xmloff } //--------------------------------------------------------------------- - ::vos::ORef< SvXMLImportPropertyMapper > OFormLayerXMLImport::getStylePropertyMapper() const - { - return m_pImpl->getStylePropertyMapper(); - } - - //--------------------------------------------------------------------- void OFormLayerXMLImport::setAutoStyleContext(SvXMLStylesContext* _pNewContext) { m_pImpl->setAutoStyleContext(_pNewContext); diff --git a/xmloff/source/forms/formsimp.cxx b/xmloff/source/forms/formsimp.cxx index bc0baaba551e..3028cd507890 100644 --- a/xmloff/source/forms/formsimp.cxx +++ b/xmloff/source/forms/formsimp.cxx @@ -51,7 +51,7 @@ XMLFormsContext::~XMLFormsContext() { } -SvXMLImportContext * XMLFormsContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, +SvXMLImportContext * XMLFormsContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) { return GetImport().GetFormImport()->createContext( nPrefix, rLocalName, xAttrList ); diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index cf5155f6a9a1..4a4bc4e7f942 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -237,11 +237,6 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) TabulatorCycle_RECORDS, OEnumMapper::getEnumMap(OEnumMapper::epTabCyle), &::getCppuType( static_cast<TabulatorCycle*>(NULL) )); - // initialize our style map - m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory(); - ::vos::ORef< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper(getControlStylePropertyMap(), m_xPropertyHandlerFactory.getBodyPtr()); - m_xImportMapper = new SvXMLImportPropertyMapper(xStylePropertiesMapper.getBodyPtr(), _rImporter); - // 'initialize' m_aCurrentPageIds = m_aControlIds.end(); } @@ -416,12 +411,6 @@ void OFormLayerXMLImport_Impl::registerControlReferences(const Reference< XPrope } //--------------------------------------------------------------------- -::vos::ORef< SvXMLImportPropertyMapper > OFormLayerXMLImport_Impl::getStylePropertyMapper() const -{ - return m_xImportMapper; -} - -//--------------------------------------------------------------------- void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPage) { m_xCurrentPageFormsSupp.clear(); diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx index bd88a67975fd..9bbc4c53d9df 100644 --- a/xmloff/source/forms/layerimport.hxx +++ b/xmloff/source/forms/layerimport.hxx @@ -92,10 +92,6 @@ namespace xmloff SvXMLStylesContext* m_pAutoStyles; protected: - // style handling - ::vos::ORef< XMLPropertyHandlerFactory > m_xPropertyHandlerFactory; - ::vos::ORef< SvXMLImportPropertyMapper > m_xImportMapper; - DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, MapString2PropertySet ); DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >, MapString2PropertySet, ODrawPageCompare, MapDrawPage2Map); @@ -168,10 +164,6 @@ namespace xmloff OFormLayerXMLImport_Impl(SvXMLImport& _rImporter); virtual ~OFormLayerXMLImport_Impl(); - /** retrieves the property mapper form form related auto styles. - */ - ::vos::ORef< SvXMLImportPropertyMapper > getStylePropertyMapper() const; - /** start importing the forms of the given page */ void startPage( diff --git a/xmloff/source/forms/officeforms.cxx b/xmloff/source/forms/officeforms.cxx index 0de7b04b70d3..fcb6a79de597 100644 --- a/xmloff/source/forms/officeforms.cxx +++ b/xmloff/source/forms/officeforms.cxx @@ -65,7 +65,7 @@ namespace xmloff } //------------------------------------------------------------------------- - SvXMLImportContext* OFormsRootImport::CreateChildContext( USHORT _nPrefix, const ::rtl::OUString& _rLocalName, + SvXMLImportContext* OFormsRootImport::CreateChildContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, const Reference< sax::XAttributeList>& xAttrList ) { return GetImport().GetFormImport()->createContext( _nPrefix, _rLocalName, xAttrList ); diff --git a/xmloff/source/forms/officeforms.hxx b/xmloff/source/forms/officeforms.hxx index 2ca90197adb5..f58e33d73080 100644 --- a/xmloff/source/forms/officeforms.hxx +++ b/xmloff/source/forms/officeforms.hxx @@ -54,7 +54,7 @@ namespace xmloff virtual ~OFormsRootImport(); // SvXMLImportContext overriabled - virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList ); virtual void EndElement(); diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 83b9625279b9..e2ba207e5cd6 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -58,7 +58,7 @@ private: ::com::sun::star::xml::sax::XDocumentHandler> mxDocBuilder; public: - XMLDocumentBuilderContext(SvXMLImport& rImport, USHORT nPrfx, + XMLDocumentBuilderContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, @@ -67,7 +67,7 @@ public: virtual ~XMLDocumentBuilderContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -81,7 +81,7 @@ public: }; XMLDocumentBuilderContext::XMLDocumentBuilderContext(SvXMLImport& rImport, - USHORT nPrfx, const ::rtl::OUString& rLName, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>&, const uno::Reference<xml::sax::XDocumentHandler>& rDocBuilder) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -94,7 +94,7 @@ XMLDocumentBuilderContext::~XMLDocumentBuilderContext() } SvXMLImportContext * -XMLDocumentBuilderContext::CreateChildContext( USHORT nPrefix, +XMLDocumentBuilderContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& rAttrs) { @@ -125,7 +125,7 @@ void XMLDocumentBuilderContext::EndElement() //=========================================================================== SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<document::XDocumentProperties>& xDocProps, const uno::Reference<xml::sax::XDocumentHandler>& xDocBuilder) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -142,7 +142,7 @@ SvXMLMetaDocumentContext::~SvXMLMetaDocumentContext() } SvXMLImportContext *SvXMLMetaDocumentContext::CreateChildContext( - USHORT nPrefix, const rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& rAttrs) { if ( (XML_NAMESPACE_OFFICE == nPrefix) && diff --git a/xmloff/source/script/xmlbasici.cxx b/xmloff/source/script/xmlbasici.cxx index c0d01a7b0264..8897dd7134b5 100644 --- a/xmloff/source/script/xmlbasici.cxx +++ b/xmloff/source/script/xmlbasici.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star::uno; // XMLBasicImportContext // ============================================================================= -XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, +XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const Reference< frame::XModel >& rxModel ) :SvXMLImportContext( rImport, nPrfx, rLName ) ,m_xModel( rxModel ) @@ -73,7 +73,7 @@ XMLBasicImportContext::~XMLBasicImportContext() // ----------------------------------------------------------------------------- SvXMLImportContext* XMLBasicImportContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference< xml::sax::XAttributeList >& ) { SvXMLImportContext* pContext = 0; @@ -140,7 +140,7 @@ void XMLBasicImportContext::Characters( const ::rtl::OUString& rChars ) // XMLBasicImportChildContext // ============================================================================= -XMLBasicImportChildContext::XMLBasicImportChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, +XMLBasicImportChildContext::XMLBasicImportChildContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const Reference< xml::sax::XDocumentHandler >& rxHandler ) :SvXMLImportContext( rImport, nPrfx, rLName ) ,m_xHandler( rxHandler ) @@ -156,7 +156,7 @@ XMLBasicImportChildContext::~XMLBasicImportChildContext() // ----------------------------------------------------------------------------- SvXMLImportContext* XMLBasicImportChildContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference< xml::sax::XAttributeList >& ) { return new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName, m_xHandler ); diff --git a/xmloff/source/script/xmlbasici.hxx b/xmloff/source/script/xmlbasici.hxx index b6f6e68d6ffd..11bfef201b08 100644 --- a/xmloff/source/script/xmlbasici.hxx +++ b/xmloff/source/script/xmlbasici.hxx @@ -44,12 +44,12 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; public: - XMLBasicImportContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, + XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel ); virtual ~XMLBasicImportContext(); - virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rxAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rxAttrList ); @@ -70,12 +70,12 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; public: - XMLBasicImportChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, + XMLBasicImportChildContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rxHandler ); virtual ~XMLBasicImportChildContext(); - virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/script/xmlscripti.cxx b/xmloff/source/script/xmlscripti.cxx index d64c872d3638..d498922afa15 100644 --- a/xmloff/source/script/xmlscripti.cxx +++ b/xmloff/source/script/xmlscripti.cxx @@ -61,12 +61,12 @@ private: ::rtl::OUString m_aLanguage; public: - XMLScriptChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, + XMLScriptChildContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& rxModel, const ::rtl::OUString& rLanguage ); virtual ~XMLScriptChildContext(); - virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, + virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void EndElement(); @@ -74,7 +74,7 @@ public: // ----------------------------------------------------------------------------- -XMLScriptChildContext::XMLScriptChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, +XMLScriptChildContext::XMLScriptChildContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const Reference< frame::XModel >& rxModel, const ::rtl::OUString& rLanguage ) :SvXMLImportContext( rImport, nPrfx, rLName ) ,m_xModel( rxModel ) @@ -92,7 +92,7 @@ XMLScriptChildContext::~XMLScriptChildContext() // ----------------------------------------------------------------------------- SvXMLImportContext* XMLScriptChildContext::CreateChildContext( - USHORT nPrefix, const ::rtl::OUString& rLocalName, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference< xml::sax::XAttributeList >& xAttrList ) { SvXMLImportContext* pContext = NULL; diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx index 72b399be47a8..0c01ba9e6db9 100644 --- a/xmloff/source/style/EnumPropertyHdl.cxx +++ b/xmloff/source/style/EnumPropertyHdl.cxx @@ -52,7 +52,7 @@ XMLEnumPropertyHdl::~XMLEnumPropertyHdl() sal_Bool XMLEnumPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - USHORT nValue = 0; + sal_uInt16 nValue = 0; if( SvXMLUnitConverter::convertEnum( nValue, rStrImpValue, mpEnumMap ) ) { diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx index 4ddd5ef64a82..7038f1b74495 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -90,7 +90,7 @@ void XMLGradientStyleContext::EndElement() {} } -BOOL XMLGradientStyleContext::IsTransient() const +sal_Bool XMLGradientStyleContext::IsTransient() const { return sal_True; } @@ -136,7 +136,7 @@ void XMLHatchStyleContext::EndElement() {} } -BOOL XMLHatchStyleContext::IsTransient() const +sal_Bool XMLHatchStyleContext::IsTransient() const { return sal_True; } @@ -216,7 +216,7 @@ void XMLBitmapStyleContext::EndElement() {} } -BOOL XMLBitmapStyleContext::IsTransient() const +sal_Bool XMLBitmapStyleContext::IsTransient() const { return sal_True; } @@ -263,7 +263,7 @@ void XMLTransGradientStyleContext::EndElement() {} } -BOOL XMLTransGradientStyleContext::IsTransient() const +sal_Bool XMLTransGradientStyleContext::IsTransient() const { return sal_True; } @@ -309,7 +309,7 @@ void XMLMarkerStyleContext::EndElement() {} } -BOOL XMLMarkerStyleContext::IsTransient() const +sal_Bool XMLMarkerStyleContext::IsTransient() const { return sal_True; } @@ -355,7 +355,7 @@ void XMLDashStyleContext::EndElement() {} } -BOOL XMLDashStyleContext::IsTransient() const +sal_Bool XMLDashStyleContext::IsTransient() const { return sal_True; } diff --git a/xmloff/source/style/FillStyleContext.hxx b/xmloff/source/style/FillStyleContext.hxx index 52346781d0a6..32d448cbb0b1 100644 --- a/xmloff/source/style/FillStyleContext.hxx +++ b/xmloff/source/style/FillStyleContext.hxx @@ -50,7 +50,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; ////////////////////////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; ////////////////////////////////////////////////////////////////////////////// @@ -98,7 +98,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; ////////////////////////////////////////////////////////////////////////////// @@ -119,7 +119,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; ////////////////////////////////////////////////////////////////////////////// @@ -140,7 +140,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; ////////////////////////////////////////////////////////////////////////////// @@ -161,7 +161,7 @@ public: virtual void EndElement(); - virtual BOOL IsTransient() const; + virtual sal_Bool IsTransient() const; }; #endif // _XMLOFF_FILLSTYLECONTEXTS_HXX_ diff --git a/xmloff/source/style/PageHeaderFooterContext.cxx b/xmloff/source/style/PageHeaderFooterContext.cxx index 9c6aa14c80ff..b8939b4cf889 100644 --- a/xmloff/source/style/PageHeaderFooterContext.cxx +++ b/xmloff/source/style/PageHeaderFooterContext.cxx @@ -47,7 +47,7 @@ using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES; //------------------------------------------------------------------ PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>&, @@ -68,7 +68,7 @@ PageHeaderFooterContext::~PageHeaderFooterContext() { } -SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) diff --git a/xmloff/source/style/PageHeaderFooterContext.hxx b/xmloff/source/style/PageHeaderFooterContext.hxx index 50dcebd1ccd8..e5b437f2ce21 100644 --- a/xmloff/source/style/PageHeaderFooterContext.hxx +++ b/xmloff/source/style/PageHeaderFooterContext.hxx @@ -39,7 +39,7 @@ class PageHeaderFooterContext : public SvXMLImportContext public: - PageHeaderFooterContext( SvXMLImport& rImport, USHORT nPrfx, + PageHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, @@ -50,7 +50,7 @@ public: virtual ~PageHeaderFooterContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/source/style/PagePropertySetContext.hxx b/xmloff/source/style/PagePropertySetContext.hxx index eda42b5dcff8..3bb0f2e84d04 100644 --- a/xmloff/source/style/PagePropertySetContext.hxx +++ b/xmloff/source/style/PagePropertySetContext.hxx @@ -55,7 +55,7 @@ public: virtual ~PagePropertySetContext(); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 58c99ef7abbd..073315761076 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -169,7 +169,7 @@ sal_Bool XMLTransGradientStyleImport::importXML( sal_Int32 aStartTransparency; SvXMLUnitConverter::convertPercent( aStartTransparency, rStrValue ); - UINT8 n = sal::static_int_cast< UINT8 >( + sal_uInt8 n = sal::static_int_cast< sal_uInt8 >( ( (100 - aStartTransparency) * 255 ) / 100 ); Color aColor( n, n, n ); @@ -181,7 +181,7 @@ sal_Bool XMLTransGradientStyleImport::importXML( sal_Int32 aEndTransparency; SvXMLUnitConverter::convertPercent( aEndTransparency, rStrValue ); - UINT8 n = sal::static_int_cast< UINT8 >( + sal_uInt8 n = sal::static_int_cast< sal_uInt8 >( ( (100 - aEndTransparency) * 255 ) / 100 ); Color aColor( n, n, n ); diff --git a/xmloff/source/style/VisAreaContext.cxx b/xmloff/source/style/VisAreaContext.cxx index cc4722d10216..795d9905243e 100644 --- a/xmloff/source/style/VisAreaContext.cxx +++ b/xmloff/source/style/VisAreaContext.cxx @@ -46,7 +46,7 @@ using namespace ::xmloff::token; //------------------------------------------------------------------ XMLVisAreaContext::XMLVisAreaContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, Rectangle& rRect, const MapUnit aMapUnit ) : @@ -62,7 +62,7 @@ XMLVisAreaContext::XMLVisAreaContext( SvXMLImport& rImport, } XMLVisAreaContext::XMLVisAreaContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, ::com::sun::star::awt::Rectangle& rRect, const sal_Int16 nMeasureUnit ) : @@ -88,7 +88,7 @@ void XMLVisAreaContext::process( const uno::Reference< xml::sax::XAttributeList> { rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); rtl::OUString aLocalName; - USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); rtl::OUString sValue = xAttrList->getValueByIndex( i ); @@ -118,7 +118,7 @@ void XMLVisAreaContext::process( const uno::Reference< xml::sax::XAttributeList> } } -SvXMLImportContext *XMLVisAreaContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLVisAreaContext::CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& ) diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index f9e5e298460d..0337ff32136f 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -172,7 +172,7 @@ OUString XMLFontAutoStylePool::Add( OUString sPoolName; XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily, nPitch, eEnc ); - ULONG nPos; + sal_uLong nPos; if( pPool->Seek_Entry( &aTmp, &nPos ) ) { sPoolName = pPool->GetObject( nPos )->GetName(); @@ -226,7 +226,7 @@ OUString XMLFontAutoStylePool::Add( OUString sName; XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily, nPitch, eEnc ); - ULONG nPos; + sal_uLong nPos; if( pPool->Seek_Entry( &aTmp, &nPos ) ) { sName = pPool->GetObject( nPos )->GetName(); diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 1a70696583d2..bb27a1378eab 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -79,7 +79,7 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV float fSize = 0; if( rValue >>= fSize ) { - SvXMLUnitConverter::convertDouble( aOut, (double)fSize, TRUE, MAP_POINT, MAP_POINT ); + SvXMLUnitConverter::convertDouble( aOut, (double)fSize, sal_True, MAP_POINT, MAP_POINT ); aOut.append( sal_Unicode('p')); aOut.append( sal_Unicode('t')); } diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index c91a7edcfc03..d7e6bd7d1725 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -291,7 +291,7 @@ XMLFontPitchPropHdl::~XMLFontPitchPropHdl() sal_Bool XMLFontPitchPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - USHORT eNewPitch; + sal_uInt16 eNewPitch; sal_Bool bRet = SvXMLUnitConverter::convertEnum( eNewPitch, rStrImpValue, aFontPitchMapping ); if( bRet ) rValue <<= (sal_Int16)eNewPitch; diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 63860130e1a5..38d4f8698761 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -67,7 +67,7 @@ SvXMLAutoStylePoolP_Impl::SvXMLAutoStylePoolP_Impl( SvXMLExport& rExp) SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl() { for (;;) { - XMLFamilyData_Impl* pData = maFamilyList.Remove( ULONG(0) ); + XMLFamilyData_Impl* pData = maFamilyList.Remove( sal_uLong(0) ); if (pData == NULL) { break; } @@ -88,7 +88,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( sal_Bool bAsFamily ) { // store family in a list if not already stored - ULONG nPos; + sal_uLong nPos; sal_uInt16 nExportFlags = GetExport().getExportFlags(); sal_Bool bStylesOnly = (nExportFlags & EXPORT_STYLES) != 0 && (nExportFlags & EXPORT_CONTENT) == 0; @@ -116,7 +116,7 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& { SvXMLAutoStylePoolNamesP_Impl *pNames = 0; - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl aTmp( nFamily ); if( maFamilyList.Seek_Entry( &aTmp, &nPos ) ) pNames = maFamilyList.GetObject( nPos )->mpNameList; @@ -187,7 +187,7 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily, bool bDontSeek ) { sal_Bool bRet(sal_False); - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl *pFamily = 0; XMLFamilyData_Impl aTemporary( nFamily ); @@ -237,7 +237,7 @@ sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFa { // get family and parent the same way as in Add() sal_Bool bRet(sal_False); - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl *pFamily = 0; XMLFamilyData_Impl aTemporary( nFamily ); @@ -276,7 +276,7 @@ sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFa OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily, const OUString& rParent ) { - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl *pFamily = 0; XMLFamilyData_Impl aTmp( nFamily ); @@ -308,7 +308,7 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, { OUString sName; - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl aTemporary( nFamily ); XMLFamilyData_Impl *pFamily = 0; if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) ) @@ -335,7 +335,7 @@ OUString SvXMLAutoStylePoolP_Impl::FindAndRemoveCached( sal_Int32 nFamily ) cons { OUString sName; - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl aTmp( nFamily ); XMLFamilyData_Impl *pFamily = 0; if( maFamilyList.Seek_Entry( &aTmp, &nPos ) ) @@ -377,7 +377,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( sal_uInt32 nCount = 0; // Get list of parents for current family (nFamily) - ULONG nPos; + sal_uLong nPos; XMLFamilyData_Impl aTmp( nFamily ); XMLFamilyData_Impl *pFamily = 0; if( maFamilyList.Seek_Entry( &aTmp, &nPos ) ) diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 99bf9ce1476e..ad26398f911c 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -477,7 +477,7 @@ void XMLStyleExport::exportStyleFamily( { if( !bUsed || xStyle->isInUse() ) { - BOOL bExported = exportStyle( xStyle, rXMLFamily, rPropMapper, + sal_Bool bExported = exportStyle( xStyle, rXMLFamily, rPropMapper, xStyles,pPrefix ); if( bUsed && bFirstStyle && bExported ) { diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx index 1765f3885cb1..e9eda292723b 100644 --- a/xmloff/source/style/weighhdl.cxx +++ b/xmloff/source/style/weighhdl.cxx @@ -51,7 +51,7 @@ using namespace ::xmloff::token; struct FontWeightMapper { float fWeight; - USHORT nValue; + sal_uInt16 nValue; }; FontWeightMapper const aFontWeightMap[] = diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 1757e48560b9..79b2974706e5 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -134,7 +134,7 @@ void SvXMLImportPropertyMapper::importXML( sal_Int32 nStartIdx, sal_Int32 nEndIdx ) const { - INT16 nAttr = xAttrList->getLength(); + sal_Int16 nAttr = xAttrList->getLength(); Reference< XNameContainer > xAttrContainer; @@ -142,11 +142,11 @@ void SvXMLImportPropertyMapper::importXML( nStartIdx = 0; if( -1 == nEndIdx ) nEndIdx = maPropMapper->GetEntryCount(); - for( INT16 i=0; i < nAttr; i++ ) + for( sal_Int16 i=0; i < nAttr; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName, aPrefix, aNamespace; - USHORT nPrefix = rNamespaceMap.GetKeyByAttrName( rAttrName, &aPrefix, + sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rAttrName, &aPrefix, &aLocalName, &aNamespace ); if( XML_NAMESPACE_XMLNS == nPrefix ) @@ -354,7 +354,7 @@ void SvXMLImportPropertyMapper::importXML( } /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */ -BOOL SvXMLImportPropertyMapper::handleSpecialItem( +sal_Bool SvXMLImportPropertyMapper::handleSpecialItem( XMLPropertyState& rProperty, vector< XMLPropertyState >& rProperties, const OUString& rValue, @@ -366,7 +366,7 @@ BOOL SvXMLImportPropertyMapper::handleSpecialItem( return mxNextMapper->handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap ); else - return FALSE; + return sal_False; } void SvXMLImportPropertyMapper::FillPropertySequence( diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 448547f44717..d4e880f09b52 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -113,9 +113,9 @@ void SvxXMLNumRuleExport::exportLevelStyles( const uno::Reference< ::com::sun::s } } -void SvxXMLNumRuleExport::exportLevelStyle( INT32 nLevel, +void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, const uno::Sequence<beans::PropertyValue>& rProps, - BOOL bOutline ) + sal_Bool bOutline ) { sal_Int16 eType = NumberingType::CHAR_SPECIAL; diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 7562bfa3a9e3..9b22f1a39e29 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -810,7 +810,7 @@ xub_StrLen lcl_FindSymbol( const String& sUpperStr, const String& sCurString ) sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, const ::com::sun::star::lang::Locale& rLocale ) { - // returns TRUE if currency element was written + // returns sal_True if currency element was written sal_Bool bRet = sal_False; @@ -847,7 +847,7 @@ sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, else AddToTextElement_Impl( rString ); // simple text - return bRet; // TRUE: currency element written + return bRet; // sal_True: currency element written } //------------------------------------------------------------------------- @@ -889,7 +889,7 @@ sal_Bool lcl_IsInEmbedded( const SvXMLEmbeddedTextEntryArr& rEmbeddedEntries, sa return sal_False; // not found } -BOOL lcl_IsDefaultDateFormat( const SvNumberformat& rFormat, sal_Bool bSystemDate, NfIndexTableOffset eBuiltIn ) +sal_Bool lcl_IsDefaultDateFormat( const SvNumberformat& rFormat, sal_Bool bSystemDate, NfIndexTableOffset eBuiltIn ) { // make an extra loop to collect date elements, to check if it is a default format // before adding the automatic-order attribute @@ -950,7 +950,7 @@ BOOL lcl_IsDefaultDateFormat( const SvNumberformat& rFormat, sal_Bool bSystemDat } if ( bDateNoDefault ) - return FALSE; // additional elements + return sal_False; // additional elements else { NfIndexTableOffset eFound = (NfIndexTableOffset) SvXMLNumFmtDefaults::GetDefaultDateFormat( @@ -1059,7 +1059,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt // automatic ordering for currency and date formats // only used for some built-in formats - BOOL bAutoOrder = ( eBuiltIn == NF_CURRENCY_1000INT || eBuiltIn == NF_CURRENCY_1000DEC2 || + sal_Bool bAutoOrder = ( eBuiltIn == NF_CURRENCY_1000INT || eBuiltIn == NF_CURRENCY_1000DEC2 || eBuiltIn == NF_CURRENCY_1000INT_RED || eBuiltIn == NF_CURRENCY_1000DEC2_RED || eBuiltIn == NF_CURRENCY_1000DEC2_DASHED || eBuiltIn == NF_DATE_SYSTEM_SHORT || eBuiltIn == NF_DATE_SYSTEM_LONG || @@ -1072,16 +1072,16 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt // format source (for date and time formats) // only used for some built-in formats - BOOL bSystemDate = ( eBuiltIn == NF_DATE_SYSTEM_SHORT || + sal_Bool bSystemDate = ( eBuiltIn == NF_DATE_SYSTEM_SHORT || eBuiltIn == NF_DATE_SYSTEM_LONG || eBuiltIn == NF_DATETIME_SYSTEM_SHORT_HHMM ); - BOOL bLongSysDate = ( eBuiltIn == NF_DATE_SYSTEM_LONG ); + sal_Bool bLongSysDate = ( eBuiltIn == NF_DATE_SYSTEM_LONG ); // check if the format definition matches the key if ( bAutoOrder && ( nFmtType == NUMBERFORMAT_DATE || nFmtType == NUMBERFORMAT_DATETIME ) && !lcl_IsDefaultDateFormat( rFormat, bSystemDate, eBuiltIn ) ) { - bAutoOrder = bSystemDate = bLongSysDate = FALSE; // don't write automatic-order attribute then + bAutoOrder = bSystemDate = bLongSysDate = sal_False; // don't write automatic-order attribute then } if ( bAutoOrder && @@ -1196,7 +1196,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt if ( bExpFound && pElemStr ) nExpDigits += pElemStr->Len(); else if ( !bDecDashes && pElemStr && pElemStr->GetChar(0) == '-' ) - bDecDashes = TRUE; + bDecDashes = sal_True; else if ( !bVarDecimals && !bInInteger && pElemStr && pElemStr->GetChar(0) == '#' ) { // If the decimal digits string starts with a '#', variable @@ -1219,7 +1219,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt bInInteger = sal_False; break; case NF_SYMBOLTYPE_CURRENCY: - bCurrFound = TRUE; + bCurrFound = sal_True; break; case NF_SYMBOLTYPE_CURREXT: if (pElemStr) diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 7ba79b221e79..492210236be6 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -83,8 +83,8 @@ struct SvXMLEmbeddedElement nFormatPos(nFP), aText(rT) {} // comparison operators for PTRARR sorting - sorted by position - BOOL operator ==( const SvXMLEmbeddedElement& r ) const { return nFormatPos == r.nFormatPos; } - BOOL operator < ( const SvXMLEmbeddedElement& r ) const { return nFormatPos < r.nFormatPos; } + sal_Bool operator ==( const SvXMLEmbeddedElement& r ) const { return nFormatPos == r.nFormatPos; } + sal_Bool operator < ( const SvXMLEmbeddedElement& r ) const { return nFormatPos < r.nFormatPos; } }; typedef SvXMLEmbeddedElement* SvXMLEmbeddedElementPtr; @@ -159,14 +159,14 @@ class SvXMLNumFmtElementContext : public SvXMLImportContext rtl::OUString sCalendar; public: - SvXMLNumFmtElementContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFmtElementContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual ~SvXMLNumFmtElementContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -184,14 +184,14 @@ class SvXMLNumFmtEmbeddedTextContext : public SvXMLImportContext sal_Int32 nTextPosition; public: - SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFmtElementContext& rParentContext, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual ~SvXMLNumFmtEmbeddedTextContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -207,14 +207,14 @@ class SvXMLNumFmtMapContext : public SvXMLImportContext rtl::OUString sName; public: - SvXMLNumFmtMapContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFmtMapContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual ~SvXMLNumFmtMapContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -230,14 +230,14 @@ class SvXMLNumFmtPropContext : public SvXMLImportContext sal_Bool bColSet; public: - SvXMLNumFmtPropContext( SvXMLImport& rImport, USHORT nPrfx, + SvXMLNumFmtPropContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); virtual ~SvXMLNumFmtPropContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); @@ -422,8 +422,8 @@ SvXMLNumImpData::~SvXMLNumImpData() sal_uInt32 SvXMLNumImpData::GetKeyForName( const rtl::OUString& rName ) { - USHORT nCount = aNameEntries.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = aNameEntries.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { const SvXMLNumFmtEntry* pObj = aNameEntries[i]; if ( pObj->aName == rName ) @@ -439,8 +439,8 @@ void SvXMLNumImpData::AddKey( sal_uInt32 nKey, const rtl::OUString& rName, sal_B // if there is already an entry for this key without the bRemoveAfterUse flag, // clear the flag for this entry, too - USHORT nCount = aNameEntries.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = aNameEntries.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { SvXMLNumFmtEntry* pObj = aNameEntries[i]; if ( pObj->nKey == nKey && !pObj->bRemoveAfterUse ) @@ -462,8 +462,8 @@ void SvXMLNumImpData::AddKey( sal_uInt32 nKey, const rtl::OUString& rName, sal_B void SvXMLNumImpData::SetUsed( sal_uInt32 nKey ) { - USHORT nCount = aNameEntries.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = aNameEntries.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { SvXMLNumFmtEntry* pObj = aNameEntries[i]; if ( pObj->nKey == nKey ) @@ -486,8 +486,8 @@ void SvXMLNumImpData::RemoveVolatileFormats() if ( !pFormatter ) return; - USHORT nCount = aNameEntries.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = aNameEntries.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { const SvXMLNumFmtEntry* pObj = aNameEntries[i]; if ( pObj->bRemoveAfterUse ) @@ -635,7 +635,7 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang ) // SvXMLNumFmtMapContext::SvXMLNumFmtMapContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -663,7 +663,7 @@ SvXMLNumFmtMapContext::~SvXMLNumFmtMapContext() } SvXMLImportContext* SvXMLNumFmtMapContext::CreateChildContext( - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) { // no elements supported - use default context @@ -686,7 +686,7 @@ void SvXMLNumFmtMapContext::EndElement() // SvXMLNumFmtPropContext::SvXMLNumFmtPropContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -710,7 +710,7 @@ SvXMLNumFmtPropContext::~SvXMLNumFmtPropContext() } SvXMLImportContext* SvXMLNumFmtPropContext::CreateChildContext( - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) { // no elements supported - use default context @@ -734,7 +734,7 @@ void SvXMLNumFmtPropContext::EndElement() // SvXMLNumFmtEmbeddedTextContext::SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFmtElementContext& rParentContext, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), @@ -763,7 +763,7 @@ SvXMLNumFmtEmbeddedTextContext::~SvXMLNumFmtEmbeddedTextContext() } SvXMLImportContext* SvXMLNumFmtEmbeddedTextContext::CreateChildContext( - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& ) { // no elements supported - use default context @@ -938,15 +938,15 @@ void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNumFormat // SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), rParent( rParentContext ), nType( nNewType ), nElementLang( LANGUAGE_SYSTEM ), - bLong( FALSE ), - bTextual( FALSE ) + bLong( sal_False ), + bTextual( sal_False ) { OUString sLanguage, sCountry; sal_Int32 nAttrVal; @@ -1034,7 +1034,7 @@ SvXMLNumFmtElementContext::~SvXMLNumFmtElementContext() } SvXMLImportContext* SvXMLNumFmtElementContext::CreateChildContext( - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { // only number:number supports number:embedded-text child element @@ -1063,8 +1063,8 @@ void SvXMLNumFmtElementContext::AddEmbeddedElement( sal_Int32 nFormatPos, const // there's already an element at this position - append text to existing element delete pObj; - USHORT nElementCount = aNumInfo.aEmbeddedElements.Count(); - for (USHORT i=0; i<nElementCount; i++) + sal_uInt16 nElementCount = aNumInfo.aEmbeddedElements.Count(); + for (sal_uInt16 i=0; i<nElementCount; i++) { pObj = aNumInfo.aEmbeddedElements[i]; if ( pObj->nFormatPos == nFormatPos ) @@ -1266,7 +1266,7 @@ void SvXMLNumFmtElementContext::EndElement() //------------------------------------------------------------------------- -sal_Bool SvXMLNumFmtDefaults::IsSystemLongDay( const SvtSysLocale&, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemLongDay( const SvtSysLocale&, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data #if 0 @@ -1276,7 +1276,7 @@ sal_Bool SvXMLNumFmtDefaults::IsSystemLongDay( const SvtSysLocale&, BOOL bLong ) #endif } -sal_Bool SvXMLNumFmtDefaults::IsSystemLongMonth( const SvtSysLocale&, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemLongMonth( const SvtSysLocale&, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data #if 0 @@ -1292,7 +1292,7 @@ sal_Bool SvXMLNumFmtDefaults::IsSystemLongMonth( const SvtSysLocale&, BOOL bLong #endif } -sal_Bool SvXMLNumFmtDefaults::IsSystemTextualMonth( const SvtSysLocale&, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemTextualMonth( const SvtSysLocale&, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data #if 0 @@ -1308,7 +1308,7 @@ sal_Bool SvXMLNumFmtDefaults::IsSystemTextualMonth( const SvtSysLocale&, BOOL bL #endif } -sal_Bool SvXMLNumFmtDefaults::IsSystemLongYear( const SvtSysLocale&, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemLongYear( const SvtSysLocale&, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data #if 0 @@ -1318,13 +1318,13 @@ sal_Bool SvXMLNumFmtDefaults::IsSystemLongYear( const SvtSysLocale&, BOOL bLong #endif } -sal_Bool SvXMLNumFmtDefaults::IsSystemLongEra( const SvtSysLocale& rSysLoc, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemLongEra( const SvtSysLocale& rSysLoc, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data return IsSystemLongYear( rSysLoc, bLong ); // no separate setting } -sal_Bool SvXMLNumFmtDefaults::IsSystemLongDayOfWeek( const SvtSysLocale&, BOOL bLong ) +sal_Bool SvXMLNumFmtDefaults::IsSystemLongDayOfWeek( const SvtSysLocale&, sal_Bool bLong ) { // TODO: merge system information and defaults into i18n locale data #if 0 @@ -1367,7 +1367,7 @@ sal_uInt16 SvXMLNumFmtDefaults::GetDefaultDateFormat( SvXMLDateElementAttributes // SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, SvXMLNumImpData* pNewData, sal_uInt16 nNewType, const uno::Reference<xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles ) : @@ -1378,15 +1378,15 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, nType( nNewType ), nKey(-1), nFormatLang( LANGUAGE_SYSTEM ), - bAutoOrder( FALSE ), - bFromSystem( FALSE ), - bTruncate( TRUE ), - bAutoDec( FALSE ), - bAutoInt( FALSE ), - bHasExtraText( FALSE ), - bHasLongDoW( FALSE ), - bHasEra( FALSE ), - bHasDateTime( FALSE ), + bAutoOrder( sal_False ), + bFromSystem( sal_False ), + bTruncate( sal_True ), + bAutoDec( sal_False ), + bAutoInt( sal_False ), + bHasExtraText( sal_False ), + bHasLongDoW( sal_False ), + bHasEra( sal_False ), + bHasDateTime( sal_False ), bRemoveAfterUse( sal_False ), eDateDOW( XML_DEA_NONE ), eDateDay( XML_DEA_NONE ), @@ -1490,7 +1490,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, } SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, const sal_Int32 nTempKey, SvXMLStylesContext& rStyles ) : @@ -1501,15 +1501,15 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, nType( 0 ), nKey(nTempKey), nFormatLang( LANGUAGE_SYSTEM ), - bAutoOrder( FALSE ), - bFromSystem( FALSE ), - bTruncate( TRUE ), - bAutoDec( FALSE ), - bAutoInt( FALSE ), - bHasExtraText( FALSE ), - bHasLongDoW( FALSE ), - bHasEra( FALSE ), - bHasDateTime( FALSE ), + bAutoOrder( sal_False ), + bFromSystem( sal_False ), + bTruncate( sal_True ), + bAutoDec( sal_False ), + bAutoInt( sal_False ), + bHasExtraText( sal_False ), + bHasLongDoW( sal_False ), + bHasEra( sal_False ), + bHasDateTime( sal_False ), bRemoveAfterUse( sal_False ), eDateDOW( XML_DEA_NONE ), eDateDay( XML_DEA_NONE ), @@ -1528,7 +1528,7 @@ SvXMLNumFormatContext::~SvXMLNumFormatContext() } SvXMLImportContext* SvXMLNumFormatContext::CreateChildContext( - USHORT nPrfx, const rtl::OUString& rLName, + sal_uInt16 nPrfx, const rtl::OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { SvXMLImportContext* pContext = NULL; @@ -1919,7 +1919,7 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) nGenPrec = 0; // generate format without decimals... sal_Bool bGrouping = rInfo.bGrouping; - USHORT nEmbeddedCount = rInfo.aEmbeddedElements.Count(); + sal_uInt16 nEmbeddedCount = rInfo.aEmbeddedElements.Count(); if ( nEmbeddedCount ) bGrouping = sal_False; // grouping and embedded characters can't be used together @@ -1962,7 +1962,7 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) } // aEmbeddedElements is sorted with ascending positions - loop is from right to left - for (USHORT nElement = 0; nElement < nEmbeddedCount; nElement++) + for (sal_uInt16 nElement = 0; nElement < nEmbeddedCount; nElement++) { const SvXMLEmbeddedElement* pObj = rInfo.aEmbeddedElements[nElement]; sal_Int32 nFormatPos = pObj->nFormatPos; @@ -2298,7 +2298,7 @@ void SvXMLNumFormatContext::AddColor( const Color& rColor ) for ( sal_uInt16 i=0; i<XML_NUMF_COLORCOUNT; i++ ) if ( rColor == aNumFmtStdColors[i] ) { - aColName = OUString( pFormatter->GetKeyword( nFormatLang, sal::static_int_cast< USHORT >(NF_KEY_FIRSTCOLOR + i) ) ); + aColName = OUString( pFormatter->GetKeyword( nFormatLang, sal::static_int_cast< sal_uInt16 >(NF_KEY_FIRSTCOLOR + i) ) ); break; } @@ -2379,7 +2379,7 @@ SvXMLNumFmtHelper::~SvXMLNumFmtHelper() } SvXMLStyleContext* SvXMLNumFmtHelper::CreateChildContext( SvXMLImport& rImport, - USHORT nPrefix, const OUString& rLocalName, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles ) { diff --git a/xmloff/source/style/xmlprcon.cxx b/xmloff/source/style/xmlprcon.cxx index 1a906e991f5d..b87148958ddf 100644 --- a/xmloff/source/style/xmlprcon.cxx +++ b/xmloff/source/style/xmlprcon.cxx @@ -39,7 +39,7 @@ using namespace ::com::sun::star; using namespace ::std; SvXMLPropertySetContext::SvXMLPropertySetContext( - SvXMLImport& rImp, USHORT nPrfx, + SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList >& xAttrList, sal_uInt32 nFam, @@ -64,7 +64,7 @@ SvXMLPropertySetContext::~SvXMLPropertySetContext() } SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { @@ -92,7 +92,7 @@ SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT */ SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >&, ::std::vector< XMLPropertyState > &, diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index c6f89c650e54..cce7d30577f3 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -216,7 +216,7 @@ void SvXMLStyleContext::Finish( sal_Bool /*bOverwrite*/ ) { } -BOOL SvXMLStyleContext::IsTransient() const +sal_Bool SvXMLStyleContext::IsTransient() const { return sal_False; } @@ -366,7 +366,7 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( #endif ((SvXMLStylesContext_Impl *)this)->pIndices = new SvXMLStyleIndices_Impl( - sal::static_int_cast< USHORT >(aStyles.Count()), 5 ); + sal::static_int_cast< sal_uInt16 >(aStyles.Count()), 5 ); for( sal_uInt32 i=0; i < aStyles.Count(); i++ ) { SvXMLStyleIndex_Impl* pStyleIndex = new SvXMLStyleIndex_Impl( aStyles.GetObject(i)); @@ -384,7 +384,7 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( if( pIndices ) { SvXMLStyleIndex_Impl aIndex( nFamily, rName ); - ULONG nPos = 0; + sal_uLong nPos = 0; if( pIndices->Seek_Entry( &aIndex, &nPos ) ) pStyle = pIndices->GetObject( nPos )->GetStyle(); } diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 6a31d7a7cc35..d0550814d8dc 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -495,7 +495,7 @@ void XMLTableExport::exportTableStyles() XMLStyleExport aStEx(mrExport, OUString(), mrExport.GetAutoStylePool().get()); // write graphic family styles - aStEx.exportStyleFamily("cell", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME)), mxCellExportPropertySetMapper.get(), TRUE, XML_STYLE_FAMILY_TABLE_CELL); + aStEx.exportStyleFamily("cell", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME)), mxCellExportPropertySetMapper.get(), sal_True, XML_STYLE_FAMILY_TABLE_CELL); exportTableTemplates(); } diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 0695d8643bfa..da24e582389f 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -80,9 +80,9 @@ struct ColumnInfo class XMLProxyContext : public SvXMLImportContext { public: - XMLProxyContext( SvXMLImport& rImport, const SvXMLImportContextRef& xParent, USHORT nPrfx, const OUString& rLName ); + XMLProxyContext( SvXMLImport& rImport, const SvXMLImportContextRef& xParent, sal_uInt16 nPrfx, const OUString& rLName ); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); private: SvXMLImportContextRef mxParent; @@ -108,10 +108,10 @@ typedef std::vector< boost::shared_ptr< MergeInfo > > MergeInfoVector; class XMLTableImportContext : public SvXMLImportContext { public: - XMLTableImportContext( const rtl::Reference< XMLTableImport >& xThis, USHORT nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ); + XMLTableImportContext( const rtl::Reference< XMLTableImport >& xThis, sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ); virtual ~XMLTableImportContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); virtual void StartElement( const Reference< XAttributeList >& xAttrList ); @@ -119,9 +119,9 @@ public: void InitColumns(); - SvXMLImportContext * ImportColumn( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); - SvXMLImportContext * ImportRow( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); - SvXMLImportContext * ImportCell( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + SvXMLImportContext * ImportColumn( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + SvXMLImportContext * ImportRow( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + SvXMLImportContext * ImportCell( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); OUString GetDefaultCellStyleName() const; @@ -148,12 +148,12 @@ public: XMLCellImportContext( SvXMLImport& rImport, const Reference< XMergeableCell >& xCell, const OUString& sDefaultCellStyleName, - USHORT nPrfx, const OUString& rLName, + sal_uInt16 nPrfx, const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual ~XMLCellImportContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); virtual void EndElement(); @@ -174,9 +174,9 @@ public: class XMLTableTemplateContext : public SvXMLStyleContext { public: - XMLTableTemplateContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ); + XMLTableTemplateContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ); virtual void StartElement( const Reference< XAttributeList >& xAttrList ); @@ -191,7 +191,7 @@ private: // class XMLProxyContext // -------------------------------------------------------------------- -XMLProxyContext::XMLProxyContext( SvXMLImport& rImport, const SvXMLImportContextRef& xParent, USHORT nPrfx, const OUString& rLName ) +XMLProxyContext::XMLProxyContext( SvXMLImport& rImport, const SvXMLImportContextRef& xParent, sal_uInt16 nPrfx, const OUString& rLName ) : SvXMLImportContext( rImport, nPrfx, rLName ) , mxParent( xParent ) { @@ -199,7 +199,7 @@ XMLProxyContext::XMLProxyContext( SvXMLImport& rImport, const SvXMLImportContext // -------------------------------------------------------------------- -SvXMLImportContext * XMLProxyContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLProxyContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { if( mxParent.Is() ) return mxParent->CreateChildContext( nPrefix, rLocalName, xAttrList ); @@ -233,7 +233,7 @@ XMLTableImport::~XMLTableImport() // -------------------------------------------------------------------- -SvXMLImportContext* XMLTableImport::CreateTableContext( USHORT nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ) +SvXMLImportContext* XMLTableImport::CreateTableContext( sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ) { rtl::Reference< XMLTableImport > xThis( this ); return new XMLTableImportContext( xThis, nPrfx, rLName, xColumnRowRange ); @@ -241,7 +241,7 @@ SvXMLImportContext* XMLTableImport::CreateTableContext( USHORT nPrfx, const OUSt // -------------------------------------------------------------------- -SvXMLStyleContext* XMLTableImport::CreateTableTemplateContext( USHORT nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) +SvXMLStyleContext* XMLTableImport::CreateTableTemplateContext( sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) { return new XMLTableTemplateContext( mrImport, nPrfx, rLName, xAttrList ); } @@ -314,7 +314,7 @@ void XMLTableImport::finishStyles() // -------------------------------------------------------------------- -XMLTableImportContext::XMLTableImportContext( const rtl::Reference< XMLTableImport >& xImporter, USHORT nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ) +XMLTableImportContext::XMLTableImportContext( const rtl::Reference< XMLTableImport >& xImporter, sal_uInt16 nPrfx, const OUString& rLName, Reference< XColumnRowRange >& xColumnRowRange ) : SvXMLImportContext( xImporter->mrImport, nPrfx, rLName ) , mxTableImporter( xImporter ) , mxTable( xColumnRowRange, UNO_QUERY ) @@ -333,7 +333,7 @@ XMLTableImportContext::~XMLTableImportContext() // -------------------------------------------------------------------- -SvXMLImportContext * XMLTableImportContext::ImportColumn( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLTableImportContext::ImportColumn( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { if( mxColumns.is() && (mnCurrentRow == -1) ) try { @@ -434,7 +434,7 @@ void XMLTableImportContext::InitColumns() // -------------------------------------------------------------------- -SvXMLImportContext * XMLTableImportContext::ImportRow( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLTableImportContext::ImportRow( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { if( mxRows.is() ) { @@ -516,7 +516,7 @@ SvXMLImportContext * XMLTableImportContext::ImportRow( USHORT nPrefix, const OUS // -------------------------------------------------------------------- -SvXMLImportContext * XMLTableImportContext::ImportCell( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLTableImportContext::ImportCell( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { mnCurrentColumn++; if( mxColumns.is() ) try @@ -551,7 +551,7 @@ SvXMLImportContext * XMLTableImportContext::ImportCell( USHORT nPrefix, const OU // -------------------------------------------------------------------- -SvXMLImportContext *XMLTableImportContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext *XMLTableImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { if( nPrefix == XML_NAMESPACE_TABLE ) { @@ -619,7 +619,7 @@ OUString XMLTableImportContext::GetDefaultCellStyleName() const // XMLCellImportContext // -------------------------------------------------------------------- -XMLCellImportContext::XMLCellImportContext( SvXMLImport& rImport, const Reference< XMergeableCell >& xCell, const OUString& sDefaultCellStyleName, USHORT nPrfx, const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) +XMLCellImportContext::XMLCellImportContext( SvXMLImport& rImport, const Reference< XMergeableCell >& xCell, const OUString& sDefaultCellStyleName, sal_uInt16 nPrfx, const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ) , mxCell( xCell ) , mbListContextPushed( false ) @@ -697,7 +697,7 @@ XMLCellImportContext::~XMLCellImportContext() // -------------------------------------------------------------------- -SvXMLImportContext * XMLCellImportContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLCellImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { // create text cursor on demand if( !mxCursor.is() ) @@ -763,7 +763,7 @@ void XMLCellImportContext::EndElement() // class XMLTableTemplateContext // -------------------------------------------------------------------- -XMLTableTemplateContext::XMLTableTemplateContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) +XMLTableTemplateContext::XMLTableTemplateContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_TABLE_TEMPLATE_ID, sal_False ) { } @@ -776,7 +776,7 @@ void XMLTableTemplateContext::StartElement( const Reference< XAttributeList >& x for(sal_Int16 i=0; i < nAttrCount; i++) { OUString sAttrName; - USHORT nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( xAttrList->getNameByIndex( i ), &sAttrName ); + sal_uInt16 nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( xAttrList->getNameByIndex( i ), &sAttrName ); if( (nAttrPrefix == XML_NAMESPACE_TEXT ) && IsXMLToken( sAttrName, XML_STYLE_NAME ) ) { msTemplateStyleName = xAttrList->getValueByIndex( i ); @@ -796,7 +796,7 @@ void XMLTableTemplateContext::EndElement() // -------------------------------------------------------------------- -SvXMLImportContext * XMLTableTemplateContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContext * XMLTableTemplateContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { if( nPrefix == XML_NAMESPACE_TABLE ) { @@ -810,7 +810,7 @@ SvXMLImportContext * XMLTableTemplateContext::CreateChildContext( USHORT nPrefix for(sal_Int16 i=0; i < nAttrCount; i++) { OUString sAttrName; - USHORT nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( xAttrList->getNameByIndex( i ), &sAttrName ); + sal_uInt16 nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( xAttrList->getNameByIndex( i ), &sAttrName ); if( (nAttrPrefix == XML_NAMESPACE_TEXT) && IsXMLToken( sAttrName, XML_STYLE_NAME ) ) { maTableTemplate[pElements->msStyleName] = xAttrList->getValueByIndex( i ); diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx index 6d14bd5ddc26..ed8e414bcb44 100644 --- a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx +++ b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx @@ -54,7 +54,7 @@ TYPEINIT1(XMLAutoTextContainerEventImport, SvXMLImportContext); XMLAutoTextContainerEventImport::XMLAutoTextContainerEventImport( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const OUString& rLName, const Reference<XNameReplace> & rEvnts ) : SvXMLImportContext(rImport, nPrfx, rLName), @@ -67,7 +67,7 @@ XMLAutoTextContainerEventImport::~XMLAutoTextContainerEventImport() } SvXMLImportContext* XMLAutoTextContainerEventImport::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & ) { diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx index 9d2aa2daa465..6dc762ffc960 100644 --- a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx +++ b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx @@ -55,7 +55,7 @@ public: XMLAutoTextContainerEventImport( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > & rEvents ); @@ -66,7 +66,7 @@ public: protected: virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> & xAttrList ); diff --git a/xmloff/source/text/XMLChangeInfoContext.cxx b/xmloff/source/text/XMLChangeInfoContext.cxx index 506ead5789a4..39fcb9cdc2d0 100644 --- a/xmloff/source/text/XMLChangeInfoContext.cxx +++ b/xmloff/source/text/XMLChangeInfoContext.cxx @@ -69,7 +69,7 @@ void XMLChangeInfoContext::StartElement(const Reference<XAttributeList> &) } SvXMLImportContext* XMLChangeInfoContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList >& xAttrList ) { diff --git a/xmloff/source/text/XMLChangeInfoContext.hxx b/xmloff/source/text/XMLChangeInfoContext.hxx index a2aeed545a48..6bb4ff3dec8d 100644 --- a/xmloff/source/text/XMLChangeInfoContext.hxx +++ b/xmloff/source/text/XMLChangeInfoContext.hxx @@ -75,7 +75,7 @@ public: ::com::sun::star::xml::sax::XAttributeList> & xAttrList); virtual SvXMLImportContext *CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 9f0658dc84da..9fa2cc660e03 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -303,7 +303,7 @@ void XMLFootnoteConfigurationImportContext::StartElement( } SvXMLImportContext *XMLFootnoteConfigurationImportContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { diff --git a/xmloff/source/text/XMLStringBufferImportContext.cxx b/xmloff/source/text/XMLStringBufferImportContext.cxx index 2d9df7ef1ef1..cd63a9b48a82 100644 --- a/xmloff/source/text/XMLStringBufferImportContext.cxx +++ b/xmloff/source/text/XMLStringBufferImportContext.cxx @@ -57,7 +57,7 @@ XMLStringBufferImportContext::~XMLStringBufferImportContext() } SvXMLImportContext *XMLStringBufferImportContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> &) { diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index 4422241d822f..6bf7ba3ecdba 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -186,7 +186,7 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) : XMLTextListAutoStylePool::~XMLTextListAutoStylePool() { // The XMLTextListAutoStylePoolEntry_Impl object in the pool need delete explicitly in dtor. - ULONG nCount = pPool->Count(); + sal_uLong nCount = pPool->Count(); while ( nCount-- ) delete pPool->Remove(nCount); delete pPool; @@ -211,7 +211,7 @@ sal_Bool XMLTextListAutoStylePool::HasName( const OUString& rName ) const sal_uInt32 XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl* pEntry ) const { - ULONG nPos; + sal_uLong nPos; if( !pEntry->IsNamed() && mxNumRuleCompare.is() ) { const sal_uInt32 nCount = pPool->Count(); diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 4ac42d4abebd..e9db515955c1 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -354,7 +354,7 @@ void XMLTextMarkImportContext::EndElement() } } -SvXMLImportContext *XMLTextMarkImportContext::CreateChildContext( USHORT nPrefix, +SvXMLImportContext *XMLTextMarkImportContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& ) { diff --git a/xmloff/source/text/XMLTextMarkImportContext.hxx b/xmloff/source/text/XMLTextMarkImportContext.hxx index c2c6a701ef8b..cfd7a43284bf 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.hxx +++ b/xmloff/source/text/XMLTextMarkImportContext.hxx @@ -101,7 +101,7 @@ protected: ::com::sun::star::xml::sax::XAttributeList> & xAttrList); virtual void EndElement(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/text/XMLTextPropertySetContext.hxx b/xmloff/source/text/XMLTextPropertySetContext.hxx index a1b3888b9ed6..bbbf79dc46d4 100644 --- a/xmloff/source/text/XMLTextPropertySetContext.hxx +++ b/xmloff/source/text/XMLTextPropertySetContext.hxx @@ -51,7 +51,7 @@ public: virtual ~XMLTextPropertySetContext(); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx index 46aac523b55a..85d342ba5693 100644 --- a/xmloff/source/text/XMLTextShapeStyleContext.cxx +++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx @@ -70,7 +70,7 @@ public: virtual ~XMLTextShapePropertySetContext_Impl(); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 3a4d6e6b7749..c269ad97455f 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -209,7 +209,7 @@ const sal_Char sAPI_is_fixed_language[] = "IsFixedLanguage"; const sal_Char sAPI_is_visible[] = "IsVisible"; const sal_Char sAPI_TextRange[] = "TextRange"; -const sal_Char sAPI_true[] = "TRUE"; +const sal_Char sAPI_true[] = "sal_True"; TYPEINIT1( XMLTextFieldImportContext, SvXMLImportContext); @@ -3661,7 +3661,7 @@ void XMLAnnotationImportContext::ProcessAttribute( } SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList >& xAttrList ) { @@ -3969,7 +3969,7 @@ bool lcl_ProcessLabel( const SvXMLImport& rImport, } SvXMLImportContext* XMLDropDownFieldImportContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList ) { diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 64a8b37a3539..a2cc3cbc4bfd 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -965,7 +965,7 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster( // rename field // currently: no family in use! Use 0. OUString sName = rImportHelper.GetRenameMap().Get( - sal::static_int_cast< USHORT >(eVarType), sVarName); + sal::static_int_cast< sal_uInt16 >(eVarType), sVarName); // get text fields supplier and field masters Reference<XTextFieldsSupplier> xTextFieldsSupp(rImport.GetModel(), @@ -1017,7 +1017,7 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster( sNew = aBuf.makeStringAndClear(); rImportHelper.GetRenameMap().Add( - sal::static_int_cast< USHORT >(eVarType), sName, sNew); + sal::static_int_cast< sal_uInt16 >(eVarType), sName, sNew); // call FindFieldMaster recursively to create new master return FindFieldMaster(xMaster, rImport, rImportHelper, @@ -1042,7 +1042,7 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster( sNew = aBuf.makeStringAndClear(); rImportHelper.GetRenameMap().Add( - sal::static_int_cast< USHORT >(eVarType), sName, sNew); + sal::static_int_cast< sal_uInt16 >(eVarType), sName, sNew); // call FindFieldMaster recursively to create new master return FindFieldMaster(xMaster, rImport, rImportHelper, diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx index f2122ec3e0da..24488b7694be 100644 --- a/xmloff/source/transform/EventOASISTContext.cxx +++ b/xmloff/source/transform/EventOASISTContext.cxx @@ -154,7 +154,7 @@ bool ParseURLAsString( sal_Int32 params = rAttrValue.indexOf( '?' ); if ( rAttrValue.indexOf( SCHEME ) != 0 || params < 0 ) { - return FALSE; + return sal_False; } sal_Int32 start = SCHEME.getLength(); @@ -188,9 +188,9 @@ bool ParseURLAsString( if ( aLanguage.equalsIgnoreAsciiCaseAscii( "basic" ) ) { - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } bool ParseURL( @@ -236,11 +236,11 @@ bool ParseURL( { *pLocation = GetXMLToken( XML_APPLICATION ); } - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } else { diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index eef93b17e7fd..61bb73120da6 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -89,7 +89,7 @@ bool lcl_ConvertAttr( OUString & rOutAttribute, sal_Int32 nParam ) // ----------------------------------------------------------------------------- -XMLTransformerContext *XMLTransformerBase::CreateContext( USHORT nPrefix, +XMLTransformerContext *XMLTransformerBase::CreateContext( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rQName ) { XMLTransformerActions::key_type aKey( nPrefix, rLocalName ); diff --git a/xmloff/source/xforms/SchemaContext.cxx b/xmloff/source/xforms/SchemaContext.cxx index 8e4c6d9de48e..14f12bc5df69 100644 --- a/xmloff/source/xforms/SchemaContext.cxx +++ b/xmloff/source/xforms/SchemaContext.cxx @@ -69,7 +69,7 @@ static SvXMLTokenMapEntry aChildren[] = SchemaContext::SchemaContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XDataTypeRepository>& rRepository ) : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aChildren ), diff --git a/xmloff/source/xforms/SchemaContext.hxx b/xmloff/source/xforms/SchemaContext.hxx index 75999d52f1dd..e3a0be34c29f 100644 --- a/xmloff/source/xforms/SchemaContext.hxx +++ b/xmloff/source/xforms/SchemaContext.hxx @@ -58,7 +58,7 @@ class SchemaContext : public TokenContext public: SchemaContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& rRepository ); virtual ~SchemaContext(); diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx index 0c975b347bfc..0663aa2531f4 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.cxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx @@ -93,7 +93,7 @@ static SvXMLTokenMapEntry aChildren[] = SchemaRestrictionContext::SchemaRestrictionContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, Reference<com::sun::star::xforms::XDataTypeRepository>& rRepository, const OUString& sTypeName ) : diff --git a/xmloff/source/xforms/SchemaRestrictionContext.hxx b/xmloff/source/xforms/SchemaRestrictionContext.hxx index 9e43fdc43df0..c08251aadbbe 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.hxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.hxx @@ -61,7 +61,7 @@ class SchemaRestrictionContext : public TokenContext public: SchemaRestrictionContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& rRepository, const ::rtl::OUString& sTypeName ); diff --git a/xmloff/source/xforms/SchemaSimpleTypeContext.cxx b/xmloff/source/xforms/SchemaSimpleTypeContext.cxx index bd327fd61ddd..821dd768fbf9 100644 --- a/xmloff/source/xforms/SchemaSimpleTypeContext.cxx +++ b/xmloff/source/xforms/SchemaSimpleTypeContext.cxx @@ -69,7 +69,7 @@ static SvXMLTokenMapEntry aChildren[] = SchemaSimpleTypeContext::SchemaSimpleTypeContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XDataTypeRepository>& rRepository ) : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aChildren ), diff --git a/xmloff/source/xforms/SchemaSimpleTypeContext.hxx b/xmloff/source/xforms/SchemaSimpleTypeContext.hxx index e2bbcfc87b27..cf4221f7168c 100644 --- a/xmloff/source/xforms/SchemaSimpleTypeContext.hxx +++ b/xmloff/source/xforms/SchemaSimpleTypeContext.hxx @@ -59,7 +59,7 @@ class SchemaSimpleTypeContext : public TokenContext public: SchemaSimpleTypeContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& rRepository ); diff --git a/xmloff/source/xforms/TokenContext.cxx b/xmloff/source/xforms/TokenContext.cxx index 74c1e01d3433..d1310effeeb8 100644 --- a/xmloff/source/xforms/TokenContext.cxx +++ b/xmloff/source/xforms/TokenContext.cxx @@ -47,7 +47,7 @@ struct SvXMLTokenMapEntry aEmptyMap[1] = TokenContext::TokenContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const SvXMLTokenMapEntry* pAttributes, const SvXMLTokenMapEntry* pChildren ) @@ -100,7 +100,7 @@ void TokenContext::StartElement( } SvXMLImportContext* TokenContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList ) { diff --git a/xmloff/source/xforms/TokenContext.hxx b/xmloff/source/xforms/TokenContext.hxx index 4c726e24fbb5..7200eb0891a1 100644 --- a/xmloff/source/xforms/TokenContext.hxx +++ b/xmloff/source/xforms/TokenContext.hxx @@ -61,7 +61,7 @@ protected: public: TokenContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const SvXMLTokenMapEntry* pAttributes = NULL, const SvXMLTokenMapEntry* pChildren = NULL ); @@ -84,7 +84,7 @@ public: * CreateChildCotnenxt may want to call the parent method for * handling of defaults. */ virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx index 51de4f2007fc..67bbf8f70b84 100644 --- a/xmloff/source/xforms/XFormsBindContext.cxx +++ b/xmloff/source/xforms/XFormsBindContext.cxx @@ -77,7 +77,7 @@ void lcl_fillNamespaceContainer( const SvXMLNamespaceMap&, XFormsBindContext::XFormsBindContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XPropertySet>& xModel ) : TokenContext( rImport, nPrefix, rLocalName, aAttributeMap, aEmptyMap ), diff --git a/xmloff/source/xforms/XFormsBindContext.hxx b/xmloff/source/xforms/XFormsBindContext.hxx index 43eb09d1c48b..af2d7a440e3a 100644 --- a/xmloff/source/xforms/XFormsBindContext.hxx +++ b/xmloff/source/xforms/XFormsBindContext.hxx @@ -60,7 +60,7 @@ class XFormsBindContext : public TokenContext public: XFormsBindContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xModel ); virtual ~XFormsBindContext(); diff --git a/xmloff/source/xforms/XFormsInstanceContext.cxx b/xmloff/source/xforms/XFormsInstanceContext.cxx index ce0573461081..06cabce7267f 100644 --- a/xmloff/source/xforms/XFormsInstanceContext.cxx +++ b/xmloff/source/xforms/XFormsInstanceContext.cxx @@ -72,7 +72,7 @@ static SvXMLTokenMapEntry aAttributes[] = XFormsInstanceContext::XFormsInstanceContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, Reference<XPropertySet> xModel ) : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aEmptyMap ), @@ -86,7 +86,7 @@ XFormsInstanceContext::~XFormsInstanceContext() } SvXMLImportContext* XFormsInstanceContext::CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& ) { diff --git a/xmloff/source/xforms/XFormsInstanceContext.hxx b/xmloff/source/xforms/XFormsInstanceContext.hxx index 924195e0fe11..2772aef7fd2f 100644 --- a/xmloff/source/xforms/XFormsInstanceContext.hxx +++ b/xmloff/source/xforms/XFormsInstanceContext.hxx @@ -63,7 +63,7 @@ class XFormsInstanceContext : public TokenContext public: XFormsInstanceContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xModel ); virtual ~XFormsInstanceContext(); @@ -77,7 +77,7 @@ public: // virtual SvXMLImportContext* CreateChildContext( - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList >& xAttrList ); diff --git a/xmloff/source/xforms/XFormsModelContext.cxx b/xmloff/source/xforms/XFormsModelContext.cxx index 2bc3e13aaf62..074cbd7ddb8d 100644 --- a/xmloff/source/xforms/XFormsModelContext.cxx +++ b/xmloff/source/xforms/XFormsModelContext.cxx @@ -78,7 +78,7 @@ static SvXMLTokenMapEntry aChildren[] = XFormsModelContext::XFormsModelContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName ) : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aChildren ), mxModel( lcl_createXFormsModel() ) diff --git a/xmloff/source/xforms/XFormsModelContext.hxx b/xmloff/source/xforms/XFormsModelContext.hxx index 037c527606dd..5731b606f1bb 100644 --- a/xmloff/source/xforms/XFormsModelContext.hxx +++ b/xmloff/source/xforms/XFormsModelContext.hxx @@ -57,7 +57,7 @@ class XFormsModelContext : public TokenContext public: XFormsModelContext( SvXMLImport& rImport, - USHORT nPrfx, + sal_uInt16 nPrfx, const ::rtl::OUString& rLName ); virtual ~XFormsModelContext(); diff --git a/xmloff/source/xforms/XFormsSubmissionContext.cxx b/xmloff/source/xforms/XFormsSubmissionContext.cxx index 9f0bfa55bca3..7835cf5dc0a7 100644 --- a/xmloff/source/xforms/XFormsSubmissionContext.cxx +++ b/xmloff/source/xforms/XFormsSubmissionContext.cxx @@ -83,7 +83,7 @@ void lcl_fillNamespaceContainer( const SvXMLNamespaceMap&, XFormsSubmissionContext::XFormsSubmissionContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XPropertySet>& xModel ) : TokenContext( rImport, nPrefix, rLocalName, aAttributeMap, aEmptyMap ), diff --git a/xmloff/source/xforms/XFormsSubmissionContext.hxx b/xmloff/source/xforms/XFormsSubmissionContext.hxx index be337217caad..00cd2849603b 100644 --- a/xmloff/source/xforms/XFormsSubmissionContext.hxx +++ b/xmloff/source/xforms/XFormsSubmissionContext.hxx @@ -58,7 +58,7 @@ class XFormsSubmissionContext : public TokenContext public: XFormsSubmissionContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xModel ); virtual ~XFormsSubmissionContext(); diff --git a/xmloff/source/xforms/xformsimport.cxx b/xmloff/source/xforms/xformsimport.cxx index 750444c62165..84908444498e 100644 --- a/xmloff/source/xforms/xformsimport.cxx +++ b/xmloff/source/xforms/xformsimport.cxx @@ -68,7 +68,7 @@ using rtl::OUString; SvXMLImportContext* createXFormsModelContext( SvXMLImport& rImport, - USHORT nPrefix, + sal_uInt16 nPrefix, const rtl::OUString& rLocalName ) { return new XFormsModelContext( rImport, nPrefix, rLocalName ); |