summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-06 18:25:56 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-06 18:50:08 -0400
commit1899bd0c3b8a16ede2de0125e762b23ba013d81f (patch)
tree936c877e41bba07325d3ea6d89e7172a3382cca0 /sc
parent639d33af28d5ed4c2223cfb7b1422478942e6e52 (diff)
fdo#77990: Intern strings for hybrid strings during import.
Change-Id: I269497cac645e486ac08bb2b011df1b5b23dc021
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/formulacell.hxx2
-rw-r--r--sc/inc/formularesult.hxx2
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/tool/formularesult.cxx2
-rw-r--r--sc/source/filter/orcus/interface.cxx3
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx7
6 files changed, 11 insertions, 7 deletions
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 91a3625f478c..11c5cb1ecf3c 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -338,7 +338,7 @@ public:
If for whatever reason you have to use both, SetHybridDouble() and
SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
for performance reasons.*/
- void SetHybridString( const OUString& r );
+ void SetHybridString( const svl::SharedString& r );
/** For import only: set a temporary formula string to be compiled later.
If for whatever reason you have to use both, SetHybridDouble() and
SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 78d7ae54b7f0..68a08e52d797 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -195,7 +195,7 @@ public:
/** Should only be used by import filters, best in the order
SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only
SetHybridFormula() for formula string to be compiled later. */
- SC_DLLPUBLIC void SetHybridString( const OUString & rStr );
+ SC_DLLPUBLIC void SetHybridString( const svl::SharedString & rStr );
/** Should only be used by import filters, best in the order
SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index a233fe5c3529..2c21e4a0c780 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2084,7 +2084,7 @@ void ScFormulaCell::SetHybridDouble( double n )
aResult.SetHybridDouble( n);
}
-void ScFormulaCell::SetHybridString( const OUString& r )
+void ScFormulaCell::SetHybridString( const svl::SharedString& r )
{
aResult.SetHybridString( r);
}
diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx
index 66ee0a98fc7c..658eb97821e5 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -518,7 +518,7 @@ void ScFormulaResult::SetHybridDouble( double f )
}
}
-void ScFormulaResult::SetHybridString( const OUString & rStr )
+void ScFormulaResult::SetHybridString( const svl::SharedString& rStr )
{
// Obtain values before changing anything.
double f = GetDouble();
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 8bd650ef64cd..6c0562728af7 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -20,6 +20,7 @@
#include "formula/token.hxx"
#include "tools/datetime.hxx"
+#include <svl/sharedstringpool.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
@@ -305,7 +306,7 @@ void ScOrcusSheet::set_formula_result(os::row_t row, os::col_t col, const char*
return;
}
OUString aResult( p, n, RTL_TEXTENCODING_UTF8);
- pCell->SetHybridString(aResult);
+ pCell->SetHybridString(mrDoc.getDoc().GetSharedStringPool().intern(aResult));
}
void ScOrcusSheet::set_shared_formula(
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index c61657eef737..364833ff8a1d 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -86,6 +86,7 @@
#include "editeng/langitem.hxx"
#include <svx/unoapi.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/sharedstringpool.hxx>
#include <svtools/miscopt.hxx>
#include <sax/tools/converter.hxx>
@@ -1025,7 +1026,8 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
{
if( !IsPossibleErrorString() )
{
- pFCell->SetHybridString( *maStringValue );
+ ScDocument* pDoc = rXMLImport.GetDocument();
+ pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(*maStringValue));
pFCell->ResetDirty();
}
}
@@ -1066,7 +1068,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
{
if (bDoIncrement && !IsPossibleErrorString())
{
- pFCell->SetHybridString( aCellString );
+ ScDocument* pDoc = rXMLImport.GetDocument();
+ pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(aCellString));
pFCell->ResetDirty();
}
else