[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source

Noel Power noel.power at suse.com
Wed Jun 5 02:51:05 PDT 2013


 sc/source/filter/oox/numberformatsbuffer.cxx |    6 +++++-
 sc/source/filter/oox/stylesbuffer.cxx        |    5 -----
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit bb171c931b632826d9096b71e81ab4eb0bbb555a
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 30 16:12:20 2013 +0100

    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)

diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index 4baa33e..d512e3e 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 57158ca..feaae93 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 );
 }
 


More information about the Libreoffice-commits mailing list