diff options
author | Sascha Ballach <sab@openoffice.org> | 2001-05-23 10:36:01 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2001-05-23 10:36:01 +0000 |
commit | 8eabbb763324d7976e82624636b89c314444fca9 (patch) | |
tree | e4e8463197cff966b9186e85a8bf27483945617d | |
parent | acee6d0a37a2d751550ffd1a16a128b6706825ca (diff) |
#79771#; make it possible to use the optimations on import too
-rw-r--r-- | xmloff/inc/numehelp.hxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/numehelp.cxx | 28 |
2 files changed, 23 insertions, 14 deletions
diff --git a/xmloff/inc/numehelp.hxx b/xmloff/inc/numehelp.hxx index 54d38cf46615..2a3b0c3a711d 100644 --- a/xmloff/inc/numehelp.hxx +++ b/xmloff/inc/numehelp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: numehelp.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2001-05-18 09:42:15 $ + * last change: $Author: sab $ $Date: 2001-05-23 11:35:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,12 +107,13 @@ typedef std::set<XMLNumberFormat, LessNumberFormat> XMLNumberFormatSet; class XMLNumberFormatAttributesExportHelper { ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNumberFormatsSupplier; + SvXMLExport* pExport; rtl::OUString sEmpty; - SvXMLExport& rXMLExport; XMLNumberFormatSet aNumberFormats; public : - XMLNumberFormatAttributesExportHelper(SvXMLExport& rXMLExport); + XMLNumberFormatAttributesExportHelper(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier); ~XMLNumberFormatAttributesExportHelper(); + SetExport(SvXMLExport* pExport) { this->pExport = pExport; } sal_Int16 GetCellType(const sal_Int32 nNumberFormat, rtl::OUString& sCurrency, sal_Bool& bIsStandard); void SetNumberFormatAttributes(const sal_Int32 nNumberFormat, diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index 47c2ac43558f..b6173256390b 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: numehelp.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: sab $ $Date: 2001-05-18 09:43:27 $ + * last change: $Author: sab $ $Date: 2001-05-23 11:36:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -105,9 +105,9 @@ using namespace xmloff::token; #define XML_STANDARDFORMAT "StandardFormat" XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper( - SvXMLExport& rTempExport) - : rXMLExport(rTempExport), - xNumberFormatsSupplier(rTempExport.GetNumberFormatsSupplier()), + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xTempNumberFormatsSupplier) + : pExport(NULL), + xNumberFormatsSupplier(xTempNumberFormatsSupplier), aNumberFormats() { } @@ -141,17 +141,25 @@ sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNu void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes( const sal_Int32 nNumberFormat, const double& rValue, sal_uInt16 nNamespace, sal_Bool bExportValue) { - sal_Bool bIsStandard; - rtl::OUString sCurrency; - sal_Int16 nTypeKey = GetCellType(nNumberFormat, sCurrency, bIsStandard); - WriteAttributes(rXMLExport, nTypeKey, rValue, sCurrency, nNamespace, bExportValue); + if (pExport) + { + sal_Bool bIsStandard; + rtl::OUString sCurrency; + sal_Int16 nTypeKey = GetCellType(nNumberFormat, sCurrency, bIsStandard); + WriteAttributes(*pExport, nTypeKey, rValue, sCurrency, nNamespace, bExportValue); + } + else + DBG_ERROR("no SvXMLExport given"); } void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes( const rtl::OUString& rValue, const rtl::OUString& rCharacters, sal_uInt16 nNamespace, sal_Bool bExportValue, sal_Bool bExportTypeAttribute) { - SetNumberFormatAttributes(rXMLExport, rValue, rCharacters, nNamespace, bExportValue, bExportTypeAttribute); + if (pExport) + SetNumberFormatAttributes(*pExport, rValue, rCharacters, nNamespace, bExportValue, bExportTypeAttribute); + else + DBG_ERROR("no SvXMLExport given"); } void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExport, |