summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-05-30 16:12:20 +0100
committerNoel Power <noel.power@suse.com>2013-06-05 10:49:56 +0100
commitbb171c931b632826d9096b71e81ab4eb0bbb555a (patch)
tree1d0d3ea857df692028adac0c9389f3800ab2151c /sc
parent655072821385f9e0edd2e5b65699e1a8ab4ca805 (diff)
bnc#821795 eat stray backslashes, in ooxml num format they don't escape
the '\' char in the number format isn't an escape character but rather an indicator that the next character should be displayed. Change-Id: Id2ae2fcfe5f195d2b85c2933c12d2d4443bb4dd8 (cherry picked from commit 78775f1ad9b3f394896179898db984e139d5b5cc)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/numberformatsbuffer.cxx6
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx5
2 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index 4baa33ee8ff3..d512e3eea095 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -1904,7 +1904,11 @@ NumberFormat::NumberFormat( const WorkbookHelper& rHelper ) :
void NumberFormat::setFormatCode( const OUString& rFmtCode )
{
- maModel.maFmtCode = rFmtCode;
+ // especiall for a fraction code '\ ?/?' is passed to us in xml, the '\' is not
+ // an escape character but merely should be telling the formatter to display the next
+ // char in the format ( afaics it does that anyhow )
+
+ maModel.maFmtCode = rFmtCode.replaceAll("\\", "");
}
void NumberFormat::setFormatCode( const Locale& rLocale, const sal_Char* pcFmtCode )
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 57158ca6e6c7..feaae93d44a5 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -2545,11 +2545,6 @@ void Dxf::importNumFmt( const AttributeList& rAttribs )
// import has already taken place )
sal_Int32 nNumFmtId = getStyles().nextFreeNumFmtId();
OUString aFmtCode = rAttribs.getXString( XML_formatCode, OUString() );
- // we might need to do this generally for format codes,
- // specifically for a fraction code '\ ?/?' is passed to us in xml, the '\' is not
- // an escape character but merely should be telling the formatter to display the next
- // char in the format ( afaics it does that anyhow )
- aFmtCode = aFmtCode.replaceAll("\\", "");
mxNumFmt = getStyles().createNumFmt( nNumFmtId, aFmtCode );
}