[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 10 23:59:25 PST 2012


 sc/source/filter/oox/worksheethelper.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 08ca08d2f46c6119550024ce02bc42c271a3644b
Author: Noel Power <noel.power at suse.com>
Date:   Fri Nov 9 16:58:00 2012 +0000

    fix for fdo#55875 numbers as text converted strangely
    
    old code used to use XCell->setString, new code uses rDoc.SetString which by default tries to detect number formats. The ScColumn::SetString that eventually
    gets called seems to do lots of additional checks ( and apparently even if
    an ScSetStringParam instance with mbDetectNumberFormat ( false ) was passed
    it seems that it will still try to detect decimal number formats. With that
    in mind I restore and un-unoified version of what XCell->setString used do
    
    Change-Id: Ifaef74c78b198f492a390a3d5dc1721622a01ea4
    Reviewed-on: https://gerrit.libreoffice.org/1020
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 96c84f9..771f32f 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1564,7 +1564,14 @@ void WorksheetHelper::putString( const CellAddress& rAddress, const OUString& rT
 {
     ScAddress aAddress;
     ScUnoConversion::FillScAddress( aAddress, rAddress );
-    getScDocument().SetString( aAddress.Col(), aAddress.Row(), aAddress.Tab(), rText );
+    ScBaseCell* pNewCell = NULL;
+    ScDocument& rDoc = getScDocument();
+    if ( !rText.isEmpty() )
+        pNewCell = ScBaseCell::CreateTextCell( rText, &rDoc );
+    if ( pNewCell )
+        rDoc.PutCell( aAddress, pNewCell );
+    else
+        rDoc.SetString( aAddress.Col(), aAddress.Row(), aAddress.Tab(), rText );
 }
 
 void WorksheetHelper::putRichString( const CellAddress& rAddress, const RichString& rString, const Font* pFirstPortionFont ) const


More information about the Libreoffice-commits mailing list