diff options
author | Eike Rathke <erack@redhat.com> | 2013-05-16 20:49:26 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-05-17 00:28:55 +0200 |
commit | 93ceaadd6e40c458385471445e644f82815d9249 (patch) | |
tree | 6ed94ab6fed2afa97914cb4b53416c92f3b19300 /sc | |
parent | 38b06c661559e6eca60e2c4a4a3637b8293307b2 (diff) |
no number format mumbo-jumbo needed on empty format string
For every cell with CSS class attribute we tried to obtain the number format
from the number formatter and if not found tried to create it, even for empty
strings (no mso-number-format attribute present) which are never number
formats. Skip that.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 0a6a89cca1f2..110a7cb57fd9 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -2238,16 +2238,19 @@ void ScHTMLTable::DataOn( const ImportInfo& rInfo ) OUString aProp("mso-number-format"); const ScHTMLStyles& rStyles = mpParser->GetStyles(); const OUString& rVal = rStyles.getPropertyValue(aElem, aClass, aProp); - OUString aNumFmt = decodeNumberFormat(rVal); - - nNumberFormat = GetFormatTable()->GetEntryKey(aNumFmt); - if (nNumberFormat == NUMBERFORMAT_ENTRY_NOT_FOUND) + if (!rVal.isEmpty()) { - sal_Int32 nErrPos = 0; - short nDummy; - bool bValidFmt = GetFormatTable()->PutEntry(aNumFmt, nErrPos, nDummy, nNumberFormat); - if (!bValidFmt) - nNumberFormat = NUMBERFORMAT_ENTRY_NOT_FOUND; + OUString aNumFmt = decodeNumberFormat(rVal); + + nNumberFormat = GetFormatTable()->GetEntryKey(aNumFmt); + if (nNumberFormat == NUMBERFORMAT_ENTRY_NOT_FOUND) + { + sal_Int32 nErrPos = 0; + short nDummy; + bool bValidFmt = GetFormatTable()->PutEntry(aNumFmt, nErrPos, nDummy, nNumberFormat); + if (!bValidFmt) + nNumberFormat = NUMBERFORMAT_ENTRY_NOT_FOUND; + } } } break; |