[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue May 6 20:50:31 PDT 2014


 sc/inc/formulacell.hxx                |    2 +-
 sc/inc/formularesult.hxx              |    2 +-
 sc/source/core/data/formulacell.cxx   |    2 +-
 sc/source/core/tool/formularesult.cxx |    2 +-
 sc/source/filter/orcus/interface.cxx  |    3 ++-
 sc/source/filter/xml/xmlcelli.cxx     |    7 +++++--
 6 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit bc74773e8c5d62f4fe932366f1fae5bebbd19f65
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 6 18:25:56 2014 -0400

    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 at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index ff84ae4..326c4b8 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 3708c8a..1391244 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 9eccadb..3f3b18b 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 35d5818..0237253 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 cd1ad91..ec4b0df 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 e40a527..41e6111 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


More information about the Libreoffice-commits mailing list