summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-11-09 16:58:00 +0000
committerNoel Power <noel.power@suse.com>2012-11-09 17:07:30 +0000
commitf39238693096fe0001f8d526f22b920fc0be185b (patch)
treec3775a78a97b93a4402d21708a61d578b142924e
parent136d8962d7a29b833a24b0461958b47fc4d23d18 (diff)
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
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 32da418570c6..3fec8889bc03 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1543,7 +1543,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