diff options
author | Sascha Ballach <sab@openoffice.org> | 2000-10-23 14:34:14 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2000-10-23 14:34:14 +0000 |
commit | 549d16549e2062314de3c41b4f61d4ab029b1429 (patch) | |
tree | 77fa99f419828fa0c839b595712a5e5480624c6a /xmloff | |
parent | 2c50e2fb22f44d36c2ac2804d1d42826e2ccf6fe (diff) |
catch exception added
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/numehelp.cxx | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index d2f5c93527bf..f917379c0779 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: numehelp.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: sab $ $Date: 2000-09-25 14:44:26 $ + * last change: $Author: sab $ $Date: 2000-10-23 15:29:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,9 @@ #ifndef _TOOLS_SOLMATH_HXX #include <tools/solmath.hxx> #endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif #ifndef _RTL_USTRBUF_HXX_ #include <rtl/ustrbuf.hxx> #endif @@ -106,29 +109,36 @@ sal_Bool XMLNumberFormatAttributesExportHelper::GetCurrencySymbol(const sal_Int3 uno::Reference <util::XNumberFormats> xNumberFormats = xNumberFormatsSupplier->getNumberFormats(); if (xNumberFormats.is()) { - uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat); - uno::Any aCurrencySymbol = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYSYMBOL))); - uno::Any aCurrencyExtension = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYEXTENSION))); - if ( aCurrencySymbol >>= sCurrencySymbol) + try { - rtl::OUString sCurrencyExtension; - if ( aCurrencyExtension >>= sCurrencyExtension) + uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat); + uno::Any aCurrencySymbol = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYSYMBOL))); + uno::Any aCurrencyExtension = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYEXTENSION))); + if ( aCurrencySymbol >>= sCurrencySymbol) { - if ( sCurrencyExtension.getLength() != 0 ) + rtl::OUString sCurrencyExtension; + if ( aCurrencyExtension >>= sCurrencyExtension) { - International IntTest((sCurrencyExtension.toInt32(16) * -1)); - sCurrencySymbol = rtl::OUString(IntTest.GetCurrBankSymbol()); - return sal_True; + if ( sCurrencyExtension.getLength() != 0 ) + { + International IntTest((sCurrencyExtension.toInt32(16) * -1)); + sCurrencySymbol = rtl::OUString(IntTest.GetCurrBankSymbol()); + return sal_True; + } + else + { + if ( sCurrencySymbol.getLength() == 1 && sCurrencySymbol.toChar() == NfCurrencyEntry::GetEuroSymbol() ) + sCurrencySymbol = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUR")); + return sal_True; + } } else - { - if ( sCurrencySymbol.getLength() == 1 && sCurrencySymbol.toChar() == NfCurrencyEntry::GetEuroSymbol() ) - sCurrencySymbol = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUR")); return sal_True; - } } - else - return sal_True; + } + catch ( uno::Exception& ) + { + DBG_ERROR("Numberformat not found"); } } } @@ -144,14 +154,21 @@ sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNu uno::Reference <util::XNumberFormats> xNumberFormats = xNumberFormatsSupplier->getNumberFormats(); if (xNumberFormats.is()) { - uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat); - uno::Any aIsStandardFormat = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STANDARDFORMAT))); - aIsStandardFormat >>= bIsStandard; - uno::Any aNumberFormat = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_TYPE))); - sal_Int16 nNumberFormat; - if ( aNumberFormat >>= nNumberFormat ) + try + { + uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat); + uno::Any aIsStandardFormat = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STANDARDFORMAT))); + aIsStandardFormat >>= bIsStandard; + uno::Any aNumberFormat = xNumberPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_TYPE))); + sal_Int16 nNumberFormat; + if ( aNumberFormat >>= nNumberFormat ) + { + return nNumberFormat; + } + } + catch ( uno::Exception& ) { - return nNumberFormat; + DBG_ERROR("Numberformat not found"); } } } |