summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/token.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-14 16:57:52 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-15 15:45:10 +0000
commit1f87e2e837b4e35b909bf68ccdd3cefd84253940 (patch)
tree1da1e58474a8bff4a8ccf4210fd9ccc6ac389bac /sc/source/core/tool/token.cxx
parentccb606beb5b516dc1308b4a8343f941f22acb1e6 (diff)
fdo#76294: Properly intern string literals in formula on xls import.
(cherry picked from commit b09426b83c12b0cd27cd909602251cb076ffa4ba) (cherry picked from commit 625c595fc30d2e6153735dc2ed2359ff4f8a1e3a) (cherry picked from commit 6bb7fa8df523d3ae7b9945009fb1034f28cb0a0a) Conflicts: formula/source/core/api/token.cxx include/formula/tokenarray.hxx sc/source/filter/excel/excform.cxx sc/source/filter/excel/excform8.cxx sc/source/filter/excel/frmbase.cxx sc/source/filter/inc/XclImpChangeTrack.hxx sc/source/filter/inc/lotform.hxx sc/source/filter/inc/qproform.hxx sc/source/filter/lotus/lotform.cxx sc/source/filter/lotus/lotimpop.cxx sc/source/filter/lotus/op.cxx reportdesign/source/ui/inc/Formula.hxx Change-Id: Icf962a4363887f323da6d2bdf935a027df3319fa Reviewed-on: https://gerrit.libreoffice.org/9008 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/core/tool/token.cxx')
-rw-r--r--sc/source/core/tool/token.cxx29
1 files changed, 14 insertions, 15 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ce6a6443a855..320c42eabbc2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1187,27 +1187,26 @@ bool ScHybridCellToken::operator==( const FormulaToken& r ) const
-//////////////////////////////////////////////////////////////////////////
-
-bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken,formula::ExternalReferenceHelper* _pRef)
+bool ScTokenArray::AddFormulaToken(
+ const css::sheet::FormulaToken& rToken, svl::SharedStringPool& rSPool, formula::ExternalReferenceHelper* pExtRef)
{
- bool bError = FormulaTokenArray::AddFormulaToken(_aToken,_pRef);
+ bool bError = FormulaTokenArray::AddFormulaToken(rToken, rSPool, pExtRef);
if ( bError )
{
bError = false;
- const OpCode eOpCode = static_cast<OpCode>(_aToken.OpCode); //! assuming equal values for the moment
+ const OpCode eOpCode = static_cast<OpCode>(rToken.OpCode); //! assuming equal values for the moment
- const uno::TypeClass eClass = _aToken.Data.getValueTypeClass();
+ const uno::TypeClass eClass = rToken.Data.getValueTypeClass();
switch ( eClass )
{
case uno::TypeClass_STRUCT:
{
- uno::Type aType = _aToken.Data.getValueType();
+ uno::Type aType = rToken.Data.getValueType();
if ( aType.equals( cppu::UnoType<sheet::SingleReference>::get() ) )
{
ScSingleRefData aSingleRef;
sheet::SingleReference aApiRef;
- _aToken.Data >>= aApiRef;
+ rToken.Data >>= aApiRef;
lcl_SingleRefToCalc( aSingleRef, aApiRef );
if ( eOpCode == ocPush )
AddSingleReference( aSingleRef );
@@ -1220,7 +1219,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{
ScComplexRefData aComplRef;
sheet::ComplexReference aApiRef;
- _aToken.Data >>= aApiRef;
+ rToken.Data >>= aApiRef;
lcl_SingleRefToCalc( aComplRef.Ref1, aApiRef.Reference1 );
lcl_SingleRefToCalc( aComplRef.Ref2, aApiRef.Reference2 );
@@ -1232,7 +1231,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
else if ( aType.equals( cppu::UnoType<sheet::NameToken>::get() ) )
{
sheet::NameToken aTokenData;
- _aToken.Data >>= aTokenData;
+ rToken.Data >>= aTokenData;
if ( eOpCode == ocName )
AddRangeName(aTokenData.Index, aTokenData.Global);
else if (eOpCode == ocDBArea)
@@ -1243,7 +1242,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
else if ( aType.equals( cppu::UnoType<sheet::ExternalReference>::get() ) )
{
sheet::ExternalReference aApiExtRef;
- if( (eOpCode == ocPush) && (_aToken.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
+ if( (eOpCode == ocPush) && (rToken.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
{
sal_uInt16 nFileId = static_cast< sal_uInt16 >( aApiExtRef.Index );
sheet::SingleReference aApiSRef;
@@ -1253,7 +1252,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{
// try to resolve cache index to sheet name
size_t nCacheId = static_cast< size_t >( aApiSRef.Sheet );
- OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
+ OUString aTabName = pExtRef->getCacheTableName( nFileId, nCacheId );
if( !aTabName.isEmpty() )
{
ScSingleRefData aSingleRef;
@@ -1268,7 +1267,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{
// try to resolve cache index to sheet name.
size_t nCacheId = static_cast< size_t >( aApiCRef.Reference1.Sheet );
- OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
+ OUString aTabName = pExtRef->getCacheTableName( nFileId, nCacheId );
if( !aTabName.isEmpty() )
{
ScComplexRefData aComplRef;
@@ -1304,12 +1303,12 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{
if ( eOpCode != ocPush )
bError = true; // not an inline array
- else if (!_aToken.Data.getValueType().equals( getCppuType(
+ else if (!rToken.Data.getValueType().equals( getCppuType(
(uno::Sequence< uno::Sequence< uno::Any > > *)0)))
bError = true; // unexpected sequence type
else
{
- ScMatrixRef xMat = ScSequenceToMatrix::CreateMixedMatrix( _aToken.Data);
+ ScMatrixRef xMat = ScSequenceToMatrix::CreateMixedMatrix( rToken.Data);
if (xMat)
AddMatrix( xMat);
else