summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-14 16:57:52 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-14 17:00:40 -0400
commitb09426b83c12b0cd27cd909602251cb076ffa4ba (patch)
tree1accd4e5214b123084c0bb9e2a3dd639b52232bf
parent2da75ceaca3907694b4021d3d63a63375ce37ac6 (diff)
fdo#76294: Properly intern string literals in formula on xls import.
Change-Id: Ib3a442cbb68c23294762561f2911101a087a795e
-rw-r--r--formula/source/core/api/token.cxx7
-rw-r--r--include/formula/tokenarray.hxx8
-rw-r--r--sc/source/core/data/conditio.cxx13
-rw-r--r--sc/source/core/data/validat.cxx6
-rw-r--r--sc/source/core/tool/formulagroup.cxx5
-rw-r--r--sc/source/filter/excel/excform.cxx4
-rw-r--r--sc/source/filter/excel/excform8.cxx2
-rw-r--r--sc/source/filter/excel/frmbase.cxx11
-rw-r--r--sc/source/filter/excel/tokstack.cxx11
-rw-r--r--sc/source/filter/excel/xicontent.cxx2
-rw-r--r--sc/source/filter/excel/xlformula.cxx6
-rw-r--r--sc/source/filter/inc/XclImpChangeTrack.hxx12
-rw-r--r--sc/source/filter/inc/excform.hxx4
-rw-r--r--sc/source/filter/inc/formel.hxx12
-rw-r--r--sc/source/filter/inc/lotform.hxx3
-rw-r--r--sc/source/filter/inc/qproform.hxx6
-rw-r--r--sc/source/filter/inc/tokstack.hxx14
-rw-r--r--sc/source/filter/inc/xlformula.hxx9
-rw-r--r--sc/source/filter/lotus/lotform.cxx4
-rw-r--r--sc/source/filter/lotus/lotimpop.cxx2
-rw-r--r--sc/source/filter/lotus/op.cxx6
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx4
-rw-r--r--sc/source/filter/qpro/qpro.cxx11
-rw-r--r--sc/source/filter/qpro/qproform.cxx4
-rw-r--r--sc/source/filter/xcl97/XclImpChangeTrack.cxx5
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx4
26 files changed, 114 insertions, 61 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index da98d0e5da4d..ecfb02aa52bb 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -801,7 +801,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
}
}
-FormulaToken* FormulaTokenArray::AddString( const OUString& rStr )
+FormulaToken* FormulaTokenArray::AddString( const svl::SharedString& rStr )
{
return Add( new FormulaStringToken( rStr ) );
}
@@ -1369,7 +1369,10 @@ bool FormulaDoubleToken::operator==( const FormulaToken& r ) const
}
FormulaStringToken::FormulaStringToken( const svl::SharedString& r ) :
- FormulaToken( svString ), maString( r ) {}
+ FormulaToken( svString ), maString( r )
+{
+}
+
FormulaStringToken::FormulaStringToken( const FormulaStringToken& r ) :
FormulaToken( r ), maString( r.maString ) {}
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 7370e43e373a..fba33e86b3d8 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -27,6 +27,12 @@
#include <boost/unordered_set.hpp>
+namespace svl {
+
+class SharedString;
+
+}
+
namespace formula
{
@@ -212,7 +218,7 @@ public:
virtual void CheckToken( const FormulaToken& t );
FormulaToken* AddToken( const FormulaToken& );
- FormulaToken* AddString( const OUString& rStr );
+ FormulaToken* AddString( const svl::SharedString& rStr );
FormulaToken* AddDouble( double fVal );
FormulaToken* AddExternal( const sal_Unicode* pStr );
/** Xcl import may play dirty tricks with OpCode!=ocExternal.
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 7bb2f4596ec7..8ad386a47fcc 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -40,7 +40,8 @@
#include "editutil.hxx"
#include "tokenarray.hxx"
#include "refupdatecontext.hxx"
-#include "svl/sharedstring.hxx"
+#include <svl/sharedstring.hxx>
+#include <svl/sharedstringpool.hxx>
using namespace formula;
@@ -1306,7 +1307,10 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const
{
pRet = new ScTokenArray();
if (bIsStr1)
- pRet->AddString( aStrVal1 );
+ {
+ svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
+ pRet->AddString(rSPool.intern(aStrVal1));
+ }
else
pRet->AddDouble( nVal1 );
}
@@ -1319,7 +1323,10 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const
{
pRet = new ScTokenArray();
if (bIsStr2)
- pRet->AddString( aStrVal2 );
+ {
+ svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
+ pRet->AddString(rSPool.intern(aStrVal2));
+ }
else
pRet->AddDouble( nVal2 );
}
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 2ad85815e84b..6ac7b1e1b886 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -714,6 +714,7 @@ bool ScValidationData::GetSelectionFromFormula(
}
bool bHaveEmpty = false;
+ svl::SharedStringPool& rSPool = pDocument->GetSharedStringPool();
/* XL artificially limits things to a single col or row in the UI but does
* not list the constraint in MOOXml. If a defined name or INDIRECT
@@ -749,7 +750,7 @@ bool ScValidationData::GetSelectionFromFormula(
pEntry = new ScTypedStrData( aValStr, 0.0, ScTypedStrData::Standard);
if (!rCell.isEmpty() && rMatch < 0)
- aCondTokArr.AddString( aValStr );
+ aCondTokArr.AddString(rSPool.intern(aValStr));
}
else
{
@@ -871,6 +872,7 @@ bool ScValidationData::IsListValid( ScRefCellValue& rCell, const ScAddress& rPos
// *** try if formula is a string list ***
+ svl::SharedStringPool& rSPool = GetDocument()->GetSharedStringPool();
sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
ScStringTokenIterator aIt( *pTokArr );
for (rtl_uString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next())
@@ -886,7 +888,7 @@ bool ScValidationData::IsListValid( ScRefCellValue& rCell, const ScAddress& rPos
if (GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue))
aCondTokArr.AddDouble( fValue );
else
- aCondTokArr.AddString(aStr);
+ aCondTokArr.AddString(rSPool.intern(aStr));
bIsValid = IsEqualToTokenArray(rCell, rPos, aCondTokArr);
}
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 289563aaa333..bd67fae8f127 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -367,8 +367,11 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
}
if (pStr)
+ {
// This is a string cell.
- aCode2.AddString(OUString(pStr));
+ svl::SharedStringPool& rPool = rDoc.GetSharedStringPool();
+ aCode2.AddString(rPool.intern(OUString(pStr)));
+ }
else if (rtl::math::isNan(fVal))
// Value of NaN represents an empty cell.
aCode2.AddToken(ScEmptyCellToken(false, false));
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index a25dc74ff481..e2e5545bc8ec 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -181,8 +181,8 @@ void ImportExcel::Formula(
}
-ExcelToSc::ExcelToSc( const XclImpRoot& rRoot ) :
- ExcelConverterBase( 512 ),
+ExcelToSc::ExcelToSc( XclImpRoot& rRoot ) :
+ ExcelConverterBase(rRoot.GetDocImport().getDoc().GetSharedStringPool(), 512),
XclImpRoot( rRoot ),
maFuncProv( rRoot ),
meBiff( rRoot.GetBiff() )
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index e0b1b77d49e0..83671ab0a575 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -79,7 +79,7 @@ ExcelToSc8::ExternalTabInfo::ExternalTabInfo() :
{
}
-ExcelToSc8::ExcelToSc8( const XclImpRoot& rRoot ) :
+ExcelToSc8::ExcelToSc8( XclImpRoot& rRoot ) :
ExcelToSc( rRoot ),
rLinkMan( rRoot.GetLinkManager() )
{
diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx
index 5210f71ebdfc..d2179e0fe1d2 100644
--- a/sc/source/filter/excel/frmbase.cxx
+++ b/sc/source/filter/excel/frmbase.cxx
@@ -167,7 +167,8 @@ const ScRange* _ScRangeListTabs::Next ()
return &(*maItrCur);
}
-ConverterBase::ConverterBase( sal_uInt16 nNewBuffer ) :
+ConverterBase::ConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer ) :
+ aPool(rSPool),
aEingPos( 0, 0, 0 ),
eStatus( ConvOK ),
nBufferSize( nNewBuffer )
@@ -189,8 +190,8 @@ void ConverterBase::Reset()
}
-ExcelConverterBase::ExcelConverterBase( sal_uInt16 nNewBuffer ) :
- ConverterBase( nNewBuffer )
+ExcelConverterBase::ExcelConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer ) :
+ ConverterBase(rSPool, nNewBuffer)
{
}
@@ -211,8 +212,8 @@ void ExcelConverterBase::Reset()
}
-LotusConverterBase::LotusConverterBase( SvStream &rStr, sal_uInt16 nNewBuffer ) :
- ConverterBase( nNewBuffer ),
+LotusConverterBase::LotusConverterBase( SvStream &rStr, svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffers ) :
+ ConverterBase(rSPool, nNewBuffers),
aIn( rStr ),
nBytesLeft( 0 )
{
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index 843158385e8a..9522e3bfaeb4 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -17,14 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <string.h>
-#include "compiler.hxx"
#include "tokstack.hxx"
+#include "compiler.hxx"
#include "global.hxx"
#include "scmatrix.hxx"
+#include <svl/sharedstringpool.hxx>
+
#include <stdio.h>
+#include <string.h>
const sal_uInt16 TokenPool::nScTokenOff = 8192;
@@ -51,7 +53,8 @@ TokenStack::~TokenStack()
// -> Unterscheidung von anderen Token
-TokenPool::TokenPool( void )
+TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
+ mrStringPool(rSPool)
{
sal_uInt16 nLauf = nScTokenOff;
@@ -392,7 +395,7 @@ bool TokenPool::GetElement( const sal_uInt16 nId )
sal_uInt16 n = pElement[ nId ];
OUString* p = ( n < nP_Str )? ppP_Str[ n ] : NULL;
if (p)
- pScToken->AddString( *p );
+ pScToken->AddString(mrStringPool.intern(*p));
else
bRet = false;
}
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 76a8a2e88ae5..221ac467a8a6 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -853,7 +853,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm )
// process string list of a list validity (convert to list of string tokens)
if( xTokArr1.get() && (eValMode == SC_VALID_LIST) && ::get_flag( nFlags, EXC_DV_STRINGLIST ) )
- XclTokenArrayHelper::ConvertStringToList( *xTokArr1, '\n', true );
+ XclTokenArrayHelper::ConvertStringToList(*xTokArr1, rDoc.GetSharedStringPool(), '\n', true);
maDVItems.push_back(
new DVItem(aScRanges, ScValidationData(eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart)));
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 822c379ae3a0..449ebb7d4031 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -28,6 +28,7 @@
#include "xlroot.hxx"
#include <comphelper/string.hxx>
+#include <svl/sharedstringpool.hxx>
using namespace ::formula;
@@ -854,7 +855,8 @@ bool XclTokenArrayHelper::GetStringList( OUString& rStringList, const ScTokenArr
return bRet;
}
-void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unicode cStringSep, bool bTrimLeadingSpaces )
+void XclTokenArrayHelper::ConvertStringToList(
+ ScTokenArray& rScTokArr, svl::SharedStringPool& rSPool, sal_Unicode cStringSep, bool bTrimLeadingSpaces )
{
OUString aString;
if( GetString( aString, rScTokArr ) )
@@ -869,7 +871,7 @@ void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unic
aToken = comphelper::string::stripStart(aToken, ' ');
if( nToken > 0 )
rScTokArr.AddOpCode( ocSep );
- rScTokArr.AddString( aToken );
+ rScTokArr.AddString(rSPool.intern(aToken));
}
}
}
diff --git a/sc/source/filter/inc/XclImpChangeTrack.hxx b/sc/source/filter/inc/XclImpChangeTrack.hxx
index e9ecb98d8c0b..e43baa0dd945 100644
--- a/sc/source/filter/inc/XclImpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclImpChangeTrack.hxx
@@ -159,20 +159,10 @@ private:
virtual bool Read3DTabReference( sal_uInt16 nIxti, SCTAB& rFirstTab, SCTAB& rLastTab, ExternalTabInfo& rExtInfo ) SAL_OVERRIDE;
public:
- inline XclImpChTrFmlConverter(
- const XclImpRoot& rRoot,
- XclImpChangeTrack& rXclChTr );
+ XclImpChTrFmlConverter( XclImpRoot& rRoot, XclImpChangeTrack& rXclChTr );
virtual ~XclImpChTrFmlConverter();
};
-inline XclImpChTrFmlConverter::XclImpChTrFmlConverter(
- const XclImpRoot& rRoot,
- XclImpChangeTrack& rXclChTr ) :
- ExcelToSc8( rRoot ),
- rChangeTrack( rXclChTr )
-{
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx
index 87cb42dd1f20..f99691408c5a 100644
--- a/sc/source/filter/inc/excform.hxx
+++ b/sc/source/filter/inc/excform.hxx
@@ -49,7 +49,7 @@ protected:
void ExcRelToScRel( sal_uInt16 nRow, sal_uInt8 nCol, ScSingleRefData&, const bool bName );
public:
- ExcelToSc( const XclImpRoot& rRoot );
+ ExcelToSc( XclImpRoot& rRoot );
virtual ~ExcelToSc();
virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen,
bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) SAL_OVERRIDE;
@@ -124,7 +124,7 @@ private:
bool HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtName, ExternalTabInfo& rExtInfo);
public:
- ExcelToSc8( const XclImpRoot& rRoot );
+ ExcelToSc8( XclImpRoot& rRoot );
virtual ~ExcelToSc8();
virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) SAL_OVERRIDE;
diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx
index 101575e92027..dad3b49299cf 100644
--- a/sc/source/filter/inc/formel.hxx
+++ b/sc/source/filter/inc/formel.hxx
@@ -29,6 +29,12 @@
#include <boost/ptr_container/ptr_map.hpp>
#include <vector>
+namespace svl {
+
+class SharedStringPool;
+
+}
+
class XclImpStream;
class ScTokenArray;
struct ScSingleRefData;
@@ -82,7 +88,7 @@ protected:
sal_Char* pBuffer; // universal buffer
sal_uInt16 nBufferSize; // ...and its size
- ConverterBase( sal_uInt16 nNewBuffer );
+ ConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
virtual ~ConverterBase();
void Reset();
@@ -91,7 +97,7 @@ protected:
class ExcelConverterBase : public ConverterBase
{
protected:
- ExcelConverterBase( sal_uInt16 nNewBuffer );
+ ExcelConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
virtual ~ExcelConverterBase();
public:
@@ -118,7 +124,7 @@ protected:
inline void Read( double& fDouble );
inline void Read( sal_uInt32& nUINT32 );
- LotusConverterBase( SvStream& rStr, sal_uInt16 nNewBuffer );
+ LotusConverterBase( SvStream& rStr, svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
virtual ~LotusConverterBase();
public:
diff --git a/sc/source/filter/inc/lotform.hxx b/sc/source/filter/inc/lotform.hxx
index a5c4c9d37110..2a8bf7b75609 100644
--- a/sc/source/filter/inc/lotform.hxx
+++ b/sc/source/filter/inc/lotform.hxx
@@ -86,7 +86,8 @@ private:
void NegToken( TokenId& rParam );
// ACHTUNG: wie ~, nur wird '-(<rParam>)' gebildet
public:
- LotusToSc( SvStream& aStr, rtl_TextEncoding eSrc, bool b );
+ LotusToSc( SvStream& aStr, svl::SharedStringPool& rSPool, rtl_TextEncoding eSrc, bool b );
+
virtual ConvErr Convert( const ScTokenArray*& rpErg, sal_Int32& nRest,
const FORMULA_TYPE eFT = FT_CellFormula ) SAL_OVERRIDE;
diff --git a/sc/source/filter/inc/qproform.hxx b/sc/source/filter/inc/qproform.hxx
index edb0802b3412..131d49c95a95 100644
--- a/sc/source/filter/inc/qproform.hxx
+++ b/sc/source/filter/inc/qproform.hxx
@@ -54,15 +54,15 @@ enum FUNC_TYPE
class QProToSc : public ConverterBase
{
- private:
+private:
TokenId mnAddToken;
TokenId mnSubToken;
TokenId mn0Token;
SvStream& maIn;
- public:
+public:
static const size_t nBufSize = 256;
- QProToSc( SvStream &aStr, const ScAddress& rRefPos );
+ QProToSc( SvStream &aStr, svl::SharedStringPool& rSPool, const ScAddress& rRefPos );
virtual ~QProToSc(){ };
ConvErr Convert( const ScTokenArray*& pArray, sal_uInt16 nLen,
const FORMULA_TYPE eFT = FT_CellFormula );
diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx
index d1de203d1d50..39fe0edc6c9f 100644
--- a/sc/source/filter/inc/tokstack.hxx
+++ b/sc/source/filter/inc/tokstack.hxx
@@ -26,6 +26,12 @@
#include <vector>
+namespace svl {
+
+class SharedStringPool;
+
+}
+
typedef OpCode DefTokenId;
// in PRODUCT version: ambiguity between OpCode (being sal_uInt16) and UINT16
// Unfortunately a typedef is just a dumb alias and not a real type ...
@@ -76,7 +82,9 @@ class TokenPool
{
// !ACHTUNG!: externe Id-Basis ist 1, interne 0!
// Ausgabe Id = 0 -> Fehlerfall
- private:
+private:
+ svl::SharedStringPool& mrStringPool;
+
OUString** ppP_Str; // Pool fuer Strings
sal_uInt16 nP_Str; // ...mit Groesse
sal_uInt16 nP_StrAkt; // ...und Schreibmarke
@@ -182,8 +190,8 @@ class TokenPool
bool GrowMatrix( void );
bool GetElement( const sal_uInt16 nId );
bool GetElementRek( const sal_uInt16 nId );
- public:
- TokenPool( void );
+public:
+ TokenPool( svl::SharedStringPool& rSPool );
~TokenPool();
inline TokenPool& operator <<( const TokenId nId );
inline TokenPool& operator <<( const DefTokenId eId );
diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx
index 16c19b0a42c8..5df58471e3fc 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -26,6 +26,12 @@
#include "ftools.hxx"
#include <boost/shared_ptr.hpp>
+namespace svl {
+
+class SharedStringPool;
+
+}
+
// Constants ==================================================================
const size_t EXC_TOKARR_MAXLEN = 4096; /// Maximum size of a token array.
@@ -520,7 +526,8 @@ public:
@param rScTokArr (in/out-parameter) The token array to modify.
@param cStringSep The separator in the source string.
@param bTrimLeadingSpaces true = remove leading spaces from each token. */
- static void ConvertStringToList( ScTokenArray& rScTokArr, sal_Unicode cStringSep, bool bTrimLeadingSpaces );
+ static void ConvertStringToList(
+ ScTokenArray& rScTokArr, svl::SharedStringPool& rSPool, sal_Unicode cStringSep, bool bTrimLeadingSpaces );
// multiple operations ----------------------------------------------------
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index cc64b2e82cba..6cd07c838397 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -326,8 +326,8 @@ void LotusToSc::Reset( const ScAddress& rEingPos )
}
-LotusToSc::LotusToSc( SvStream &rStream, rtl_TextEncoding e, bool b ) :
- LotusConverterBase( rStream, 128 )
+LotusToSc::LotusToSc( SvStream &rStream, svl::SharedStringPool& rSPool, rtl_TextEncoding e, bool b ) :
+ LotusConverterBase(rStream, rSPool, 128)
{
eSrcChar = e;
bWK3 = false;
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 7b1ab08854d7..0a31e33a681d 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -67,7 +67,7 @@ static osl::Mutex aLotImpSemaphore;
ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, rtl_TextEncoding eQ )
: ImportTyp(pDoc, eQ)
, pIn(&aStream)
- , aConv(*pIn, eQ, false)
+ , aConv(*pIn, pDoc->GetSharedStringPool(), eQ, false)
, nTab(0)
, nExtTab(0)
{
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index baa9bcfc6a94..105892a30f8c 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -156,7 +156,8 @@ void OP_Formula( SvStream& r, sal_uInt16 /*n*/ )
sal_Int32 nBytesLeft = nFormulaSize;
ScAddress aAddress( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab );
- LotusToSc aConv( r, pLotusRoot->eCharsetQ, false );
+ svl::SharedStringPool& rSPool = pLotusRoot->pDoc->GetSharedStringPool();
+ LotusToSc aConv(r, rSPool, pLotusRoot->eCharsetQ, false);
aConv.Reset( aAddress );
aConv.Convert( pErg, nBytesLeft );
@@ -388,7 +389,8 @@ void OP_Formula123( SvStream& r, sal_uInt16 n )
sal_Int32 nBytesLeft = (n > 12) ? n - 12 : 0;
ScAddress aAddress( nCol, nRow, nTab );
- LotusToSc aConv( r, pLotusRoot->eCharsetQ, true );
+ svl::SharedStringPool& rSPool = pLotusRoot->pDoc->GetSharedStringPool();
+ LotusToSc aConv(r, rSPool, pLotusRoot->eCharsetQ, true);
aConv.Reset( aAddress );
aConv.Convert( pErg, nBytesLeft );
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 50c5b33b802e..c2cb13b17674 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/table/XCellRange.hpp>
#include <rtl/ustrbuf.hxx>
#include <svl/intitem.hxx>
+#include <svl/sharedstringpool.hxx>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
@@ -791,7 +792,8 @@ void CondFormatRule::finalizeImport()
{
ScDocument& rDoc = getScDocument();
ScTokenArray aTokenArray;
- aTokenArray.AddString(maModel.maText);
+ svl::SharedStringPool& rSPool = rDoc.GetSharedStringPool();
+ aTokenArray.AddString(rSPool.intern(maModel.maText));
OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
mpFormat->AddEntry(pNewEntry);
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 254a8db7aed4..73dbed891bd8 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -100,13 +100,16 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
}
break;
- case 0x0010:{ // Formula cell
+ case 0x0010:
+ {
+ // Formula cell
double nValue;
sal_uInt16 nState, nLen;
mpStream->ReadUChar( nCol ).ReadUChar( nDummy ).ReadUInt16( nRow ).ReadUInt16( nStyle ).ReadDouble( nValue ).ReadUInt16( nState ).ReadUInt16( nLen );
ScAddress aAddr( nCol, nRow, nTab );
const ScTokenArray *pArray;
- QProToSc aConv( *mpStream, aAddr );
+
+ QProToSc aConv(*mpStream, pDoc->GetSharedStringPool(), aAddr);
if (ConvOK != aConv.Convert( pArray, nLen ))
eRet = eERR_FORMAT;
else
@@ -118,8 +121,8 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
pDoc->EnsureTable(nTab);
pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pFormula);
}
- }
- break;
+ }
+ break;
}
}
return eRet;
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index a53060bb9b08..5665e99e70a9 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -65,8 +65,8 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
rSRD.SetFlag3D(true);
}
-QProToSc::QProToSc( SvStream& rStream, const ScAddress& rRefPos ) :
- ConverterBase( 128 ),
+QProToSc::QProToSc( SvStream& rStream, svl::SharedStringPool& rSPool, const ScAddress& rRefPos ) :
+ ConverterBase(rSPool, 128),
maIn( rStream )
{
aEingPos = rRefPos;
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index 6dd47bc1c8d1..9d0d95d71d50 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -500,6 +500,11 @@ void XclImpChangeTrack::Apply()
// class XclImpChTrFmlConverter
+XclImpChTrFmlConverter::XclImpChTrFmlConverter(
+ XclImpRoot& rRoot, XclImpChangeTrack& rXclChTr ) :
+ ExcelToSc8( rRoot ),
+ rChangeTrack( rXclChTr ) {}
+
XclImpChTrFmlConverter::~XclImpChTrFmlConverter()
{
}
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 45e15db08e7c..94ab2c2f3af3 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -20,6 +20,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <sfx2/app.hxx>
#include <svl/itemprop.hxx>
+#include <svl/sharedstringpool.hxx>
#include "scitems.hxx"
#include "funcuno.hxx"
@@ -526,6 +527,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
long nArgCount = aArguments.getLength();
const uno::Any* pArgArr = aArguments.getConstArray();
+ svl::SharedStringPool& rSPool = pDoc->GetSharedStringPool();
aTokenArr.AddOpCode(ocOpen);
for (long nPos=0; nPos<nArgCount; nPos++)
{
@@ -555,7 +557,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
{
OUString aUStr;
rArg >>= aUStr;
- aTokenArr.AddString( aUStr );
+ aTokenArr.AddString(rSPool.intern(aUStr));
}
else if ( aType.equals( getCppuType( (uno::Sequence< uno::Sequence<sal_Int16> > *)0 ) ) )
{