diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-06 18:25:56 -0400 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-05-07 03:50:01 +0000 |
commit | bc74773e8c5d62f4fe932366f1fae5bebbd19f65 (patch) | |
tree | 8a26c8938b52e53680b1971ebc31379b3b42546d | |
parent | 043dc226967d28a7ccbc2a39df232ea92a25bc66 (diff) |
fdo#77990: Intern strings for hybrid strings during import.
Change-Id: I269497cac645e486ac08bb2b011df1b5b23dc021
(cherry picked from commit 1899bd0c3b8a16ede2de0125e762b23ba013d81f)
Reviewed-on: https://gerrit.libreoffice.org/9264
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/inc/formulacell.hxx | 2 | ||||
-rw-r--r-- | sc/inc/formularesult.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/formularesult.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 7 |
6 files changed, 11 insertions, 7 deletions
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index ff84ae4fb593..326c4b8e9f11 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -339,7 +339,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 3708c8a7efe2..139124485968 100644 --- a/sc/inc/formularesult.hxx +++ b/sc/inc/formularesult.hxx @@ -196,7 +196,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 9eccadb76a25..3f3b18b9bc8c 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2075,7 +2075,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 35d58188b721..0237253e7325 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -554,7 +554,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 cd1ad9171a8f..ec4b0df93cc0 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> @@ -288,7 +289,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 e40a527b7195..41e61110707d 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> @@ -1021,7 +1022,8 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const { if( !IsPossibleErrorString() ) { - pFCell->SetHybridString( *maStringValue ); + ScDocument* pDoc = rXMLImport.GetDocument(); + pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(*maStringValue)); pFCell->ResetDirty(); } } @@ -1062,7 +1064,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 |