diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-06 18:25:56 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-05-09 14:48:28 +0200 |
commit | 9de4b4a8d2796769ca03215a4490d820932faf82 (patch) | |
tree | bccc0a0060a8e15ce2175afd13690c04e2de25eb /sc | |
parent | 58a2c51b211f1567ae1ecdbe8863553a9028ae86 (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>
Diffstat (limited to 'sc')
-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 |