summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox/unitconverter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/oox/unitconverter.cxx')
-rw-r--r--sc/source/filter/oox/unitconverter.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index aca0d5155e54..55f2f4512289 100644
--- a/sc/source/filter/oox/unitconverter.cxx
+++ b/sc/source/filter/oox/unitconverter.cxx
@@ -218,6 +218,20 @@ sal_uInt8 UnitConverter::calcBiffErrorCode( const OUString& rErrorCode ) const
return (aIt == maOoxErrCodes.end()) ? BIFF_ERR_NA : aIt->second;
}
+const OUString& UnitConverter::calcErrorString( sal_uInt8 nErrorCode ) const
+{
+ OoxErrorCodeMap::const_iterator iFail( maOoxErrCodes.end());
+ for (OoxErrorCodeMap::const_iterator aIt( maOoxErrCodes.begin()); aIt != maOoxErrCodes.end(); ++aIt)
+ {
+ if (aIt->second == nErrorCode)
+ return aIt->first;
+ if (aIt->second == BIFF_ERR_NA)
+ iFail = aIt;
+ }
+ assert(iFail != maOoxErrCodes.end()); // BIFF_ERR_NA really should be in the map..
+ return iFail->first;
+}
+
void UnitConverter::addErrorCode( sal_uInt8 nErrorCode, const OUString& rErrorCode )
{
maOoxErrCodes[ rErrorCode ] = nErrorCode;