summaryrefslogtreecommitdiffstats
path: root/sc/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-13 11:01:13 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-13 11:01:13 +0000
commit1c08c265487d696b92979c8890470efe0cbfa95c (patch)
tree013b8931ec94271db465014cb9b263378a6e14db /sc/source
parent#i10000# Correct typo: it's 'oox', not 'ocx'. (diff)
downloadcore-1c08c265487d696b92979c8890470efe0cbfa95c.tar.gz
core-1c08c265487d696b92979c8890470efe0cbfa95c.zip
#i10000#: fix merge conflicts (CWS frmdlg)
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/cell2.cxx2
-rw-r--r--sc/source/core/tool/address.cxx20
-rw-r--r--sc/source/core/tool/compiler.cxx39
-rw-r--r--sc/source/core/tool/interpr4.cxx8
-rw-r--r--sc/source/core/tool/rangenam.cxx6
-rw-r--r--sc/source/core/tool/token.cxx55
-rw-r--r--sc/source/filter/excel/makefile.mk1
-rw-r--r--sc/source/filter/excel/xecontent.cxx3
-rw-r--r--sc/source/filter/excel/xeformula.cxx10
-rw-r--r--sc/source/filter/excel/xelink.cxx25
-rw-r--r--sc/source/filter/excel/xename.cxx3
-rw-r--r--sc/source/filter/excel/xestream.cxx12
-rw-r--r--sc/source/filter/excel/xetable.cxx2
-rw-r--r--sc/source/filter/excel/xeview.cxx8
-rw-r--r--sc/source/filter/excel/xilink.cxx4
-rw-r--r--sc/source/filter/excel/xlformula.cxx2
-rw-r--r--sc/source/filter/inc/xetable.hxx2
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx1
-rw-r--r--sc/source/filter/xml/xmlbodyi.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx1
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx4
-rw-r--r--sc/source/filter/xml/xmlstyli.hxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx42
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx33
-rw-r--r--sc/source/ui/docshell/impex.cxx2
-rw-r--r--sc/source/ui/inc/inputhdl.hxx2
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx7
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx31
-rw-r--r--sc/source/ui/view/tabcont.cxx1
29 files changed, 169 insertions, 161 deletions
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 6989730e883f..9a3d8698942b 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -764,7 +764,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
}
pCode->Reset();
- for ( ScToken* t = pCode->GetNextReferenceOrName(); t; t = pCode->GetNextReferenceOrName() )
+ for ( formula::FormulaToken* t = pCode->GetNextReferenceOrName(); t; t = pCode->GetNextReferenceOrName() )
{
StackVar sv = t->GetType();
if (sv == svExternalSingleRef || sv == svExternalDoubleRef || sv == svExternalName)
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 9bf31053940f..1eb81b689ae7 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1105,11 +1105,11 @@ lcl_ScAddress_Parse ( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAddr,
}
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
{
ScRange r = rAddr;
USHORT nFlags = lcl_ScRange_Parse_XL_A1( r, p, pDoc, true, pExtInfo,
- (rDetails.eConv == ScAddress::CONV_XL_OOX ? pExternalLinks : NULL) );
+ (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : NULL) );
rAddr = r.aStart;
return nFlags;
}
@@ -1296,9 +1296,9 @@ USHORT ScRange::Parse( const String& r, ScDocument* pDoc,
return lcl_ScRange_Parse_OOo( *this, r, pDoc, pExtInfo );
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
return lcl_ScRange_Parse_XL_A1( *this, r.GetBuffer(), pDoc, false, pExtInfo,
- (rDetails.eConv == ScAddress::CONV_XL_OOX ? pExternalLinks : NULL) );
+ (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : NULL) );
case formula::FormulaGrammar::CONV_XL_R1C1:
return lcl_ScRange_Parse_XL_R1C1( *this, r.GetBuffer(), pDoc, rDetails, false, pExtInfo );
@@ -1341,7 +1341,7 @@ USHORT ScRange::ParseCols( const String& rStr, ScDocument* pDoc,
default :
case formula::FormulaGrammar::CONV_OOO: // No full col refs in OOO yet, assume XL notation
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
if (NULL != (p = lcl_a1_get_col( p, &aStart, &ignored ) ) )
{
if( p[0] == ':')
@@ -1400,7 +1400,7 @@ USHORT ScRange::ParseRows( const String& rStr, ScDocument* pDoc,
default :
case formula::FormulaGrammar::CONV_OOO: // No full row refs in OOO yet, assume XL notation
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
if (NULL != (p = lcl_a1_get_row( p, &aStart, &ignored ) ) )
{
if( p[0] == ':')
@@ -1582,7 +1582,7 @@ void ScAddress::Format( String& r, USHORT nFlags, ScDocument* pDoc,
case formula::FormulaGrammar::CONV_XL_A1:
case formula::FormulaGrammar::CONV_XL_R1C1:
- case CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
if (aDocName.Len() > 0)
{
r += '[';
@@ -1600,7 +1600,7 @@ void ScAddress::Format( String& r, USHORT nFlags, ScDocument* pDoc,
default :
case formula::FormulaGrammar::CONV_OOO:
case formula::FormulaGrammar::CONV_XL_A1:
- case CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
if( nFlags & SCA_VALID_COL )
lcl_a1_append_c ( r, nCol, nFlags & SCA_COL_ABSOLUTE );
if( nFlags & SCA_VALID_ROW )
@@ -1718,7 +1718,7 @@ void ScRange::Format( String& r, USHORT nFlags, ScDocument* pDoc,
break;
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
lcl_ScRange_Format_XL_Header( r, *this, nFlags, pDoc, rDetails );
if( aStart.Col() == 0 && aEnd.Col() >= MAXCOL )
{
@@ -1827,7 +1827,7 @@ String ScAddress::GetColRowString( bool bAbsolute,
default :
case formula::FormulaGrammar::CONV_OOO:
case formula::FormulaGrammar::CONV_XL_A1:
- case ScAddress::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_XL_OOX:
if (bAbsolute)
aString.Append( '$' );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 1846fc21708f..ac895bbb34d8 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -425,7 +425,7 @@ void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap )
void ScCompiler::SetGrammarAndRefConvention(
- const ScGrammar::Grammar eNewGrammar, const ScGrammar::Grammar eOldGrammar )
+ const FormulaGrammar::Grammar eNewGrammar, const FormulaGrammar::Grammar eOldGrammar )
{
meGrammar = eNewGrammar; //! SetRefConvention needs the new grammar set!
FormulaGrammar::AddressConvention eConv = FormulaGrammar::extractRefConvention( meGrammar);
@@ -483,7 +483,7 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
/* " */ t[34] = SC_COMPILER_C_CHAR_STRING | SC_COMPILER_C_STRING_SEP;
/* # */ t[35] = SC_COMPILER_C_WORD_SEP;
/* $ */ t[36] = SC_COMPILER_C_CHAR_WORD | SC_COMPILER_C_WORD | SC_COMPILER_C_CHAR_IDENT | SC_COMPILER_C_IDENT;
- if (ScAddress::CONV_ODF == meConv)
+ if (FormulaGrammar::CONV_ODF == meConv)
/* $ */ t[36] |= SC_COMPILER_C_ODF_NAME_MARKER;
/* % */ t[37] = SC_COMPILER_C_VALUE;
/* & */ t[38] = SC_COMPILER_C_CHAR | SC_COMPILER_C_WORD_SEP | SC_COMPILER_C_VALUE_SEP;
@@ -579,7 +579,7 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
/* [ */ t[91] |= SC_COMPILER_C_IDENT;
/* ] */ t[93] |= SC_COMPILER_C_IDENT;
}
- if( ScAddress::CONV_XL_OOX == meConv )
+ if( FormulaGrammar::CONV_XL_OOX == meConv )
{
/* [ */ t[91] |= SC_COMPILER_C_CHAR_IDENT;
/* ] */ t[93] |= SC_COMPILER_C_IDENT;
@@ -1390,7 +1390,7 @@ struct ConventionXL
struct ConventionXL_A1 : public Convention_A1, public ConventionXL
{
ConventionXL_A1() : Convention_A1( FormulaGrammar::CONV_XL_A1 ) { }
- ConventionXL_A1( ScAddress::Convention eConv ) : Convention_A1( eConv ) { }
+ ConventionXL_A1( FormulaGrammar::AddressConvention eConv ) : Convention_A1( eConv ) { }
void makeSingleCellStr( ::rtl::OUStringBuffer& rBuf, const ScSingleRefData& rRef ) const
{
@@ -1557,7 +1557,7 @@ const ScCompiler::Convention * const ScCompiler::pConvXL_A1 = &ConvXL_A1;
struct ConventionXL_OOX : public ConventionXL_A1
{
- ConventionXL_OOX() : ConventionXL_A1( ScAddress::CONV_XL_OOX ) { }
+ ConventionXL_OOX() : ConventionXL_A1( FormulaGrammar::CONV_XL_OOX ) { }
};
static const ConventionXL_OOX ConvXL_OOX;
@@ -1831,7 +1831,7 @@ void ScCompiler::CheckTabQuotes( String& rString,
case FormulaGrammar::CONV_OOO :
case FormulaGrammar::CONV_XL_A1 :
case FormulaGrammar::CONV_XL_R1C1 :
- case ScAddress::CONV_XL_OOX :
+ case FormulaGrammar::CONV_XL_OOX :
if( bNeedsQuote )
{
static const String one_quote = static_cast<sal_Unicode>( '\'' );
@@ -1867,7 +1867,7 @@ void ScCompiler::SetRefConvention( FormulaGrammar::AddressConvention eConv )
case FormulaGrammar::CONV_ODF : SetRefConvention( pConvOOO_A1_ODF ); break;
case FormulaGrammar::CONV_XL_A1 : SetRefConvention( pConvXL_A1 ); break;
case FormulaGrammar::CONV_XL_R1C1 : SetRefConvention( pConvXL_R1C1 ); break;
- case ScAddress::CONV_XL_OOX : SetRefConvention( pConvXL_OOX ); break;
+ case FormulaGrammar::CONV_XL_OOX : SetRefConvention( pConvXL_OOX ); break;
}
}
@@ -3777,7 +3777,7 @@ BOOL ScCompiler::HandleRange()
BOOL bAddPair = !(bBorder1 && bBorder2);
if ( bAddPair )
{
- pNew = new ScTokenArray;
+ pNew = new ScTokenArray();
pNew->AddOpCode( ocClose );
PushTokenArray( pNew, TRUE );
pNew->Reset();
@@ -3792,7 +3792,7 @@ BOOL ScCompiler::HandleRange()
pNew->Reset();
if ( bAddPair )
{
- pNew = new ScTokenArray;
+ pNew = new ScTokenArray();
pNew->AddOpCode( ocOpen );
PushTokenArray( pNew, TRUE );
pNew->Reset();
@@ -3812,7 +3812,7 @@ BOOL ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
{
case svExternalSingleRef:
case svExternalDoubleRef:
- pArr->nRefs++;
+ pArr->IncrementRefs();
break;
case svExternalName:
{
@@ -3845,7 +3845,7 @@ BOOL ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
return GetToken();
}
default:
- DBG_ERRROR("Wrong type for external reference!");
+ DBG_ERROR("Wrong type for external reference!");
return FALSE;
}
return TRUE;
@@ -4802,7 +4802,6 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab,
void ScCompiler::CreateStringFromExternal(rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP)
{
FormulaToken* t = pTokenP;
- OpCode eOp = t->GetOpCode();
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
switch (t->GetType())
{
@@ -4815,11 +4814,11 @@ void ScCompiler::CreateStringFromExternal(rtl::OUStringBuffer& rBuffer, FormulaT
break;
case svExternalSingleRef:
pConv->makeExternalRefStr(
- rBuffer, *this, t->GetIndex(), t->GetString(), t->GetSingleRef(), pRefMgr);
+ rBuffer, *this, t->GetIndex(), t->GetString(), static_cast<ScToken*>(t)->GetSingleRef(), pRefMgr);
break;
case svExternalDoubleRef:
pConv->makeExternalRefStr(
- rBuffer, *this, t->GetIndex(), t->GetString(), t->GetDoubleRef(), pRefMgr);
+ rBuffer, *this, t->GetIndex(), t->GetString(), static_cast<ScToken*>(t)->GetDoubleRef(), pRefMgr);
break;
default:
// warning, not error, otherwise we may end up with a never
@@ -4913,12 +4912,6 @@ void ScCompiler::CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken
rtl::OUStringBuffer aBuffer;
switch ( eOp )
{
- case ocName:
- {
- String aStr( rStr );
- aStr.SearchAndReplaceAll( '"', String( RTL_CONSTASCII_USTRINGPARAM( "\"\"")));
- }
- break;
case ocDBArea:
{
ScDBData* pDBData = pDoc->GetDBCollection()->FindIndex(_pTokenP->GetIndex());
@@ -5160,7 +5153,7 @@ BOOL ScCompiler::HandleSingleRef()
SetError(errNoRef);
else if ( !bCompileForFAP )
{
- ScTokenArray* pNew = new ScTokenArray;
+ ScTokenArray* pNew = new ScTokenArray();
if ( bSingle )
{
ScSingleRefData aRefData;
@@ -5174,7 +5167,7 @@ BOOL ScCompiler::HandleSingleRef()
}
else
{
- ScScComplexRefData aRefData;
+ ScComplexRefData aRefData;
aRefData.InitRange( aRange );
if ( bColName )
{
@@ -5220,7 +5213,7 @@ BOOL ScCompiler::HandleDbData()
(SCROW&) aRefData.Ref2.nRow);
aRefData.Ref2.nTab = aRefData.Ref1.nTab;
aRefData.CalcRelFromAbs( aPos );
- ScTokenArray* pNew = new ScTokenArray;
+ ScTokenArray* pNew = new ScTokenArray();
pNew->AddDoubleReference( aRefData );
PushTokenArray( pNew, TRUE );
pNew->Reset();
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c19ff07fa83e..2722925fc56d 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2905,7 +2905,7 @@ void ScInterpreter::ScDBArea()
void ScInterpreter::ScColRowNameAuto()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::ScColRowNameAuto" );
- ScComplexRefData aRefData( pCur->GetDoubleRef() );
+ ScComplexRefData aRefData( static_cast<const ScToken*>(pCur)->GetDoubleRef() );
aRefData.CalcAbsIfRel( aPos );
if ( aRefData.Valid() )
{
@@ -2995,7 +2995,7 @@ void ScInterpreter::ScExternalRef()
{
case svExternalSingleRef:
{
- ScSingleRefData aData(pCur->GetSingleRef());
+ ScSingleRefData aData(static_cast<const ScToken*>(pCur)->GetSingleRef());
if (aData.IsTabRel())
{
DBG_ERROR("ScCompiler::GetToken: external single reference must have an absolute table reference!");
@@ -3023,7 +3023,7 @@ void ScInterpreter::ScExternalRef()
//break; // unreachable, prevent compiler warning
case svExternalDoubleRef:
{
- ScComplexRefData aData(pCur->GetDoubleRef());
+ ScComplexRefData aData(static_cast<const ScToken*>(pCur)->GetDoubleRef());
if (aData.Ref1.IsTabRel() || aData.Ref2.IsTabRel())
{
DBG_ERROR("ScCompiler::GetToken: external double reference must have an absolute table reference!");
@@ -3039,7 +3039,7 @@ void ScInterpreter::ScExternalRef()
if (!xNew)
break;
- ScToken* p = xNew->First();
+ ScToken* p = static_cast<ScToken*>(xNew->First());
if (p->GetType() != svMatrix)
break;
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 66100a01b566..704c3255486e 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -106,7 +106,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
// Copy ctor default-constructs pCode if it was NULL, so it's initialized here, too,
// to ensure same behavior if unnecessary copying is left out.
- pCode = new ScTokenArray;
+ pCode = new ScTokenArray();
}
}
@@ -152,7 +152,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
const ScAddress& rTarget ) :
aName ( rName ),
aUpperName ( ScGlobal::pCharClass->upper( rName ) ),
- pCode ( new ScTokenArray ),
+ pCode ( new ScTokenArray() ),
aPos ( rTarget ),
eType ( RT_NAME ),
pDoc ( pDok ),
@@ -174,7 +174,7 @@ ScRangeData::ScRangeData(const ScRangeData& rScRangeData) :
ScDataObject(),
aName (rScRangeData.aName),
aUpperName (rScRangeData.aUpperName),
- pCode (rScRangeData.pCode ? rScRangeData.pCode->Clone() : new ScTokenArray), // echte Kopie erzeugen (nicht copy-ctor)
+ pCode (rScRangeData.pCode ? rScRangeData.pCode->Clone() : new ScTokenArray()), // echte Kopie erzeugen (nicht copy-ctor)
aPos (rScRangeData.aPos),
eType (rScRangeData.eType),
pDoc (rScRangeData.pDoc),
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index cb2f84f2ec4c..977aacbd231f 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -54,10 +54,13 @@
#include "parclass.hxx"
#include "jumpmatrix.hxx"
#include "rangeseq.hxx"
+#include "externalrefmgr.hxx"
+#include "document.hxx"
using ::std::vector;
#include <com/sun/star/sheet/ComplexReference.hpp>
+#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/ReferenceFlags.hpp>
using namespace formula;
@@ -85,6 +88,27 @@ namespace
rRef.SetFlag3D( ( rAPI.Flags & sheet::ReferenceFlags::SHEET_3D ) != 0 );
rRef.SetRelName( ( rAPI.Flags & sheet::ReferenceFlags::RELATIVE_NAME ) != 0 );
}
+
+ void lcl_ExternalRefToCalc( ScSingleRefData& rRef, const sheet::SingleReference& rAPI )
+ {
+ rRef.InitFlags();
+
+ rRef.nCol = static_cast<SCsCOL>(rAPI.Column);
+ rRef.nRow = static_cast<SCsROW>(rAPI.Row);
+ rRef.nTab = 0;
+ rRef.nRelCol = static_cast<SCsCOL>(rAPI.RelativeColumn);
+ rRef.nRelRow = static_cast<SCsROW>(rAPI.RelativeRow);
+ rRef.nRelTab = 0;
+
+ rRef.SetColRel( ( rAPI.Flags & sheet::ReferenceFlags::COLUMN_RELATIVE ) != 0 );
+ rRef.SetRowRel( ( rAPI.Flags & sheet::ReferenceFlags::ROW_RELATIVE ) != 0 );
+ rRef.SetTabRel( false ); // sheet index must be absolute for external refs
+ rRef.SetColDeleted( ( rAPI.Flags & sheet::ReferenceFlags::COLUMN_DELETED ) != 0 );
+ rRef.SetRowDeleted( ( rAPI.Flags & sheet::ReferenceFlags::ROW_DELETED ) != 0 );
+ rRef.SetTabDeleted( false ); // sheet must not be deleted for external refs
+ rRef.SetFlag3D( ( rAPI.Flags & sheet::ReferenceFlags::SHEET_3D ) != 0 );
+ rRef.SetRelName( false );
+ }
//
} // namespace
//
@@ -859,9 +883,9 @@ ScSingleRefData& ScExternalSingleRefToken::GetSingleRef()
return maSingleRef;
}
-BOOL ScExternalSingleRefToken::operator ==( const ScToken& r ) const
+BOOL ScExternalSingleRefToken::operator ==( const FormulaToken& r ) const
{
- if (!ScToken::operator==(r))
+ if (!FormulaToken::operator==(r))
return false;
if (mnFileId != r.GetIndex())
@@ -870,7 +894,7 @@ BOOL ScExternalSingleRefToken::operator ==( const ScToken& r ) const
if (maTabName != r.GetString())
return false;
- return maSingleRef == r.GetSingleRef();
+ return maSingleRef == static_cast<const ScToken&>(r).GetSingleRef();
}
// ============================================================================
@@ -935,7 +959,7 @@ ScComplexRefData& ScExternalDoubleRefToken::GetDoubleRef()
return maDoubleRef;
}
-BOOL ScExternalDoubleRefToken::operator ==( const ScToken& r ) const
+BOOL ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const
{
if (!ScToken::operator==(r))
return false;
@@ -946,7 +970,7 @@ BOOL ScExternalDoubleRefToken::operator ==( const ScToken& r ) const
if (maTabName != r.GetString())
return false;
- return maDoubleRef == r.GetDoubleRef();
+ return maDoubleRef == static_cast<const ScToken&>(r).GetDoubleRef();
}
// ============================================================================
@@ -977,9 +1001,9 @@ const String& ScExternalNameToken::GetString() const
return maName;
}
-BOOL ScExternalNameToken::operator==( const ScToken& r ) const
+BOOL ScExternalNameToken::operator==( const FormulaToken& r ) const
{
- if ( !ScToken::operator==(r) )
+ if ( !FormulaToken::operator==(r) )
return false;
if (mnFileId != r.GetIndex())
@@ -1107,9 +1131,9 @@ BOOL ScHybridCellToken::operator==( const FormulaToken& r ) const
//////////////////////////////////////////////////////////////////////////
-bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken)
+bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken,formula::ExternalReferenceHelper* _pRef)
{
- bool bError = FormulaTokenArray::AddFormulaToken(_aToken);
+ bool bError = FormulaTokenArray::AddFormulaToken(_aToken,_pRef);
if ( bError )
{
bError = false;
@@ -1150,7 +1174,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) && (rAPI.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
+ if( (eOpCode == ocPush) && (_aToken.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
{
sal_uInt16 nFileId = static_cast< sal_uInt16 >( aApiExtRef.Index );
sheet::SingleReference aApiSRef;
@@ -1160,7 +1184,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 );
- String aTabName = rDoc.GetExternalRefManager()->getCacheTableName( nFileId, nCacheId );
+ String aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
if( aTabName.Len() > 0 )
{
ScSingleRefData aSingleRef;
@@ -1175,7 +1199,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 );
- String aTabName = rDoc.GetExternalRefManager()->getCacheTableName( nFileId, nCacheId );
+ String aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
if( aTabName.Len() > 0 )
{
ScComplexRefData aComplRef;
@@ -1292,7 +1316,7 @@ ScTokenArray& ScTokenArray::operator=( const ScTokenArray& rArr )
ScTokenArray* ScTokenArray::Clone() const
{
- ScTokenArray* p = new ScTokenArray;
+ ScTokenArray* p = new ScTokenArray();
p->nLen = nLen;
p->nRPN = nRPN;
p->nRefs = nRefs;
@@ -1576,7 +1600,7 @@ FormulaToken* ScTokenArray::AddMatrixSingleReference( const ScSingleRefData& rRe
return Add( new ScSingleRefToken( rRef, ocMatRef ) );
}
-FormulaToken* ScTokenArray::AddDoubleReference( const ScScComplexRefData& rRef )
+FormulaToken* ScTokenArray::AddDoubleReference( const ScComplexRefData& rRef )
{
return Add( new ScDoubleRefToken( rRef ) );
}
@@ -1701,7 +1725,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend,
break;
case svDoubleRef :
{
- ScScComplexRefData& rRef = static_cast<ScToken*>(p)->GetDoubleRef();
+ ScComplexRefData& rRef = static_cast<ScToken*>(p)->GetDoubleRef();
rRef.CalcAbsIfRel( rPos );
switch ( eDir )
{
@@ -1779,7 +1803,6 @@ void ScTokenArray::ReadjustRelative3DReferences( const ScAddress& rOldPos,
ScSingleRefData& rRef1 = static_cast<ScToken*>(pCode[j])->GetSingleRef();
rRef1.CalcAbsIfRel( rOldPos );
rRef1.CalcRelFromAbs( rNewPos );
- }
}
break;
default:
diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk
index c7bd6dbef677..8fc7e696a38e 100644
--- a/sc/source/filter/excel/makefile.mk
+++ b/sc/source/filter/excel/makefile.mk
@@ -132,6 +132,7 @@ EXCEPTIONSFILES = \
$(SLO)$/xepage.obj \
$(SLO)$/xepivot.obj \
$(SLO)$/xechart.obj \
+ $(SLO)$/xestream.obj \
$(SLO)$/xestring.obj \
$(SLO)$/xestyle.obj \
$(SLO)$/xetable.obj \
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index f0e721d33ef2..1d09082ede82 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -41,6 +41,7 @@
#include <sfx2/objsh.hxx>
#include <tools/urlobj.hxx>
#include <svtools/itemset.hxx>
+#include <formula/grammar.hxx>
#include "scitems.hxx"
#include <svx/eeitem.hxx>
#include <svx/flditem.hxx>
@@ -826,7 +827,7 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat
for( USHORT nIndex = 0, nCount = rCondFormat.Count(); nIndex < nCount; ++nIndex )
if( const ScCondFormatEntry* pEntry = rCondFormat.GetEntry( nIndex ) )
maCFList.AppendNewRecord( new XclExpCF( GetRoot(), *pEntry ) );
- aScRanges.Format( msSeqRef, SCA_VALID, NULL, ScAddress::CONV_XL_A1 );
+ aScRanges.Format( msSeqRef, SCA_VALID, NULL, formula::FormulaGrammar::CONV_XL_A1 );
}
}
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 410badbc63f4..d8fdae92c3aa 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1306,7 +1306,7 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpTokenData& rTokData, s
AppendErrorToken(EXC_ERR_REF, rTokData.mnSpaces);
break;
}
- ScSingleRefData aRef(rTokData.mpScToken->GetSingleRef());
+ ScSingleRefData aRef(static_cast<const ScToken*>(rTokData.mpScToken)->GetSingleRef());
aRef.CalcAbsIfRel(*mpScBasePos);
const String& rTabName = rTokData.mpScToken->GetString();
ScExternalRefCache::TokenRef p = pRefMgr->getSingleRefToken(nFileId, rTabName, ScAddress(aRef.nCol, aRef.nRow, aRef.nTab), NULL, NULL);
@@ -1342,7 +1342,7 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpTokenData& rTokData, s
AppendErrorToken(XclTools::GetXclErrorCode(errNoRef), rTokData.mnSpaces);
break;
}
- ScComplexRefData aRef(rTokData.mpScToken->GetDoubleRef());
+ ScComplexRefData aRef(static_cast<const ScToken*>(rTokData.mpScToken)->GetDoubleRef());
aRef.CalcAbsIfRel(*mpScBasePos);
const String& rTabName = rTokData.mpScToken->GetString();
const ScSingleRefData& r1 = aRef.Ref1;
@@ -1386,19 +1386,19 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpTokenData& rTokData, s
// Go through all these tokens to store the external cell/range
// references for CRN records.
- for (ScToken* p = pArray->First(); p; p = pArray->Next())
+ for (formula::FormulaToken* p = pArray->First(); p; p = pArray->Next())
{
if (p->GetOpCode() == ocExternalRef)
{
if (p->GetType() == svExternalSingleRef)
{
- ScSingleRefData aData(p->GetSingleRef());
+ ScSingleRefData aData(static_cast<ScToken*>(p)->GetSingleRef());
aData.CalcAbsIfRel(*mpScBasePos);
mpLinkMgr->StoreCell(nFileId, p->GetString(), aData);
}
else if (p->GetType() == svExternalDoubleRef)
{
- ScComplexRefData aData(p->GetDoubleRef());
+ ScComplexRefData aData(static_cast<ScToken*>(p)->GetDoubleRef());
aData.CalcAbsIfRel(*mpScBasePos);
mpLinkMgr->StoreCellRange(nFileId, p->GetString(), aData);
}
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index fdcb2f1559bb..3fc04d7edd1a 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -46,6 +46,7 @@
using ::std::auto_ptr;
using ::std::find_if;
using ::std::vector;
+using namespace formula;
// ============================================================================
// *** Helper classes ***
@@ -251,8 +252,8 @@ public:
/** Stores all cells in the given range in the CRN list. */
void StoreCellRange( const XclExpRoot& rRoot, const ScRange& rRange );
- void StoreCell( const XclExpRoot& rRoot, const ScAddress& rCell, const ScToken& rToken );
- void StoreCellRange( const XclExpRoot& rRoot, const ScRange& rRange, const ScToken& rToken );
+ void StoreCell( const XclExpRoot& rRoot, const ScAddress& rCell, const formula::FormulaToken& rToken );
+ void StoreCellRange( const XclExpRoot& rRoot, const ScRange& rRange, const formula::FormulaToken& rToken );
/** Writes the XCT and all CRN records. */
virtual void Save( XclExpStream& rStrm );
@@ -355,8 +356,8 @@ public:
/** Stores all cells in the given range in the CRN list of the specified SUPBOOK sheet. */
void StoreCellRange( const ScRange& rRange, sal_uInt16 nSBTab );
- void StoreCell( sal_uInt16 nSBTab, const ScAddress& rCell, const ScToken& rToken );
- void StoreCellRange( sal_uInt16 nSBTab, const ScRange& rRange, const ScToken& rToken );
+ void StoreCell( sal_uInt16 nSBTab, const ScAddress& rCell, const formula::FormulaToken& rToken );
+ void StoreCellRange( sal_uInt16 nSBTab, const ScRange& rRange, const formula::FormulaToken& rToken );
sal_uInt16 GetTabIndex( const String& rTabName ) const;
sal_uInt16 GetTabCount() const;
@@ -1013,7 +1014,7 @@ void XclExpExtName::WriteAddData( XclExpStream& rStrm )
if (mpArray->GetLen() != 1)
break;
- const ScToken* p = mpArray->First();
+ const ScToken* p = static_cast<const ScToken*>(mpArray->First());
if (p->GetOpCode() != ocExternalRef)
break;
@@ -1283,7 +1284,7 @@ void XclExpXct::StoreCellRange( const XclExpRoot& rRoot, const ScRange& rRange )
maUsedCells.SetMultiMarkArea( rRange );
}
-void XclExpXct::StoreCell( const XclExpRoot& /*rRoot*/, const ScAddress& rCell, const ScToken& rToken )
+void XclExpXct::StoreCell( const XclExpRoot& /*rRoot*/, const ScAddress& rCell, const formula::FormulaToken& rToken )
{
switch (rToken.GetType())
{
@@ -1313,7 +1314,7 @@ void XclExpXct::StoreCell( const XclExpRoot& /*rRoot*/, const ScAddress& rCell,
}
}
-void XclExpXct::StoreCellRange( const XclExpRoot& /*rRoot*/, const ScRange& rRange, const ScToken& rToken )
+void XclExpXct::StoreCellRange( const XclExpRoot& /*rRoot*/, const ScRange& rRange, const formula::FormulaToken& rToken )
{
if (rToken.GetType() != svMatrix)
return;
@@ -1322,7 +1323,7 @@ void XclExpXct::StoreCellRange( const XclExpRoot& /*rRoot*/, const ScRange& rRan
// multi-table range is not supported here.
return;
- const ScMatrix* pMtx = rToken.GetMatrix();
+ const ScMatrix* pMtx = static_cast<const ScToken*>(&rToken)->GetMatrix();
if (!pMtx)
return;
@@ -1520,7 +1521,7 @@ void XclExpSupbook::StoreCellRange( const ScRange& rRange, sal_uInt16 nSBTab )
xXct->StoreCellRange( GetRoot(), rRange );
}
-void XclExpSupbook::StoreCell( sal_uInt16 nSBTab, const ScAddress& rCell, const ScToken& rToken )
+void XclExpSupbook::StoreCell( sal_uInt16 nSBTab, const ScAddress& rCell, const formula::FormulaToken& rToken )
{
XclExpXctRef xXct = maXctList.GetRecord(nSBTab);
if (!xXct.is())
@@ -1529,7 +1530,7 @@ void XclExpSupbook::StoreCell( sal_uInt16 nSBTab, const ScAddress& rCell, const
xXct->StoreCell(GetRoot(), rCell, rToken);
}
-void XclExpSupbook::StoreCellRange( sal_uInt16 nSBTab, const ScRange& rRange, const ScToken& rToken )
+void XclExpSupbook::StoreCellRange( sal_uInt16 nSBTab, const ScRange& rRange, const formula::FormulaToken& rToken )
{
if (rRange.aStart.Tab() != rRange.aEnd.Tab())
// multi-table range is not allowed!
@@ -1788,7 +1789,7 @@ void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const String& rTab
SCTAB nTabCount = rRange.aEnd.Tab() - rRange.aStart.Tab() + 1;
// If this is a multi-table range, get token for each table.
- vector<ScToken*> aMatrixList;
+ vector<FormulaToken*> aMatrixList;
aMatrixList.reserve(nTabCount);
// This is a new'ed instance, so we must manage its life cycle here.
@@ -1796,7 +1797,7 @@ void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const String& rTab
if (!pArray.get())
return;
- for (ScToken* p = pArray->First(); p; p = pArray->Next())
+ for (FormulaToken* p = pArray->First(); p; p = pArray->Next())
{
if (p->GetType() == svMatrix)
aMatrixList.push_back(p);
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index d52b657ec5b3..b4de1126959d 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -45,6 +45,7 @@
#include "excrecds.hxx"
#include <oox/core/tokens.hxx>
+#include <formula/grammar.hxx>
using ::rtl::OString;
@@ -564,7 +565,7 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( const ScRangeData& rRangeData )
xName->SetTokenArray( xTokArr );
String sSymbol;
- rRangeData.GetSymbol( sSymbol, ScGrammar::GRAM_NATIVE_XL_A1 );
+ rRangeData.GetSymbol( sSymbol, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
xName->SetSymbol( sSymbol );
/* Try to replace by existing built-in name - complete token array is
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index b9ab0916ce12..5f3fb35d86da 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -49,6 +49,7 @@
#include "compiler.hxx"
#include <oox/core/tokens.hxx>
+#include <formula/grammar.hxx>
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::io::XOutputStream;
@@ -62,7 +63,7 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::rtl::OString;
using ::rtl::OUString;
using ::utl::OStreamWrapper;
-
+using namespace formula;
// ============================================================================
XclExpStream::XclExpStream( SvStream& rOutStrm, const XclExpRoot& rRoot, sal_uInt16 nMaxRecSize ) :
@@ -388,7 +389,7 @@ rtl::OString XclXmlUtils::ToOString( const String& s )
rtl::OString XclXmlUtils::ToOString( const ScAddress& rAddress )
{
String sAddress;
- rAddress.Format( sAddress, SCA_VALID, NULL, ScAddress::Details( ScAddress::CONV_XL_A1 ) );
+ rAddress.Format( sAddress, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
return ToOString( sAddress );
}
@@ -401,14 +402,14 @@ rtl::OString XclXmlUtils::ToOString( const ScfUInt16Vec& rBuffer )
rtl::OString XclXmlUtils::ToOString( const ScRange& rRange )
{
String sRange;
- rRange.Format( sRange, SCA_VALID, NULL, ScAddress::Details( ScAddress::CONV_XL_A1 ) );
+ rRange.Format( sRange, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
return ToOString( sRange );
}
rtl::OString XclXmlUtils::ToOString( const ScRangeList& rRangeList )
{
String s;
- rRangeList.Format( s, SCA_VALID, NULL, ScAddress::CONV_XL_A1, ' ' );
+ rRangeList.Format( s, SCA_VALID, NULL, FormulaGrammar::CONV_XL_A1, ' ' );
return ToOString( s );
}
@@ -477,7 +478,8 @@ OUString XclXmlUtils::ToOUString( const String& s )
rtl::OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray )
{
- ScCompiler aCompiler( &rDocument, rAddress, *pTokenArray, ScGrammar::GRAM_NATIVE_XL_A1 );
+ ScCompiler aCompiler( &rDocument, rAddress, *pTokenArray);
+ aCompiler.SetGrammar(FormulaGrammar::GRAM_NATIVE_XL_A1);
String s;
aCompiler.CreateStringFromTokenArray( s );
return ToOUString( s );
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index b01c094f22ec..3a82b9f3afc6 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2557,7 +2557,7 @@ XclExpRecordRef XclExpCellTable::CreateRecord( sal_uInt16 nRecId ) const
XclExpRecordRef xRec;
switch( nRecId )
{
- case EXC_ID3_DIMENSIONS: xRec.reset( new XclExpDelegatingRecord( maRowBfr.GetDimensions() ) ); break;
+ case EXC_ID3_DIMENSIONS: xRec.reset( new XclExpDelegatingRecord( const_cast<XclExpRowBuffer*>(&maRowBfr)->GetDimensions() ) ); break;
case EXC_ID2_DEFROWHEIGHT: xRec = mxDefrowheight; break;
case EXC_ID_GUTS: xRec = mxGuts; break;
case EXC_ID_NOTE: xRec = mxNoteList; break;
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 387414223a20..649bc0de32e6 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -187,10 +187,10 @@ static const char* lcl_GetActivePane( sal_uInt8 nActivePane )
{
switch( nActivePane )
{
- case EXC_PANE_TOPLEFT: return "topLeft"; break;
- case EXC_PANE_TOPRIGHT: return "topRight"; break;
- case EXC_PANE_BOTTOMLEFT: return "bottomLeft"; break;
- case EXC_PANE_BOTTOMRIGHT: return "bottomRight"; break;
+ case EXC_PANE_TOPLEFT: return "topLeft"; //break;
+ case EXC_PANE_TOPRIGHT: return "topRight"; //break;
+ case EXC_PANE_BOTTOMLEFT: return "bottomLeft"; //break;
+ case EXC_PANE_BOTTOMRIGHT: return "bottomRight"; //break;
}
return "**error: lcl_GetActivePane";
}
diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
index 07b4c8fa4ace..c51dd5cf24e3 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -416,7 +416,7 @@ void XclImpSupbookTab::LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheT
case EXC_CACHEDVAL_DOUBLE:
{
double f = p->GetValue();
- ScExternalRefCache::TokenRef pToken(new ScDoubleToken(f));
+ ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(f));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
}
break;
@@ -427,7 +427,7 @@ void XclImpSupbookTab::LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheT
case EXC_CACHEDVAL_STRING:
{
const String& rStr = p->GetString();
- ScExternalRefCache::TokenRef pToken(new ScStringToken(rStr));
+ ScExternalRefCache::TokenRef pToken(new formula::FormulaStringToken(rStr));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
}
break;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index ef14839f9bda..2e15a39e68dd 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -30,12 +30,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include "xestream.hxx"
#include "xlformula.hxx"
#include "compiler.hxx"
#include "rangenam.hxx"
#include "xlroot.hxx"
#include "xistream.hxx"
-#include "xestream.hxx"
#include "token.hxx"
#include "tokenarray.hxx"
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 024a9e808e8f..7be4f406ee23 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -1060,7 +1060,7 @@ public:
@param nRecId The record identifier that specifies which record is
returned. Possible values are: EXC_ID_DEFROWHEIGHT, EXC_ID_NOTE,
EXC_ID_MERGEDCELLS, EXC_ID_HLINK, EXC_ID_DVAL. */
- XclExpRecordRef CreateRecord( sal_uInt16 nRecId );
+ XclExpRecordRef CreateRecord( sal_uInt16 nRecId ) const;
/** Saves the entire cell table. */
virtual void Save( XclExpStream& rStrm );
virtual void SaveXml( XclExpXmlStream& rStrm );
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 3b6530c14167..d1320a8c737f 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
+using rtl::OUString;
using namespace com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx
index 7c80014dcaf9..fd9562a9b1fb 100644
--- a/sc/source/filter/xml/xmlbodyi.cxx
+++ b/sc/source/filter/xml/xmlbodyi.cxx
@@ -1,4 +1,3 @@
-<<<<<<< .working
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,6 +62,7 @@
#include <sal/types.h>
#include <tools/debug.hxx>
+using rtl::OUString;
using namespace com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 4e006963421b..4547d2f50f1a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -152,6 +152,7 @@
#define SC_SHOW_CHANGES_BY_RANGES_LIST 12
using namespace rtl;
+using namespace formula;
using namespace com::sun::star;
using namespace xmloff::token;
using ::std::vector;
diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx
index 5149c0ced7ec..16378b3bea61 100644
--- a/sc/source/filter/xml/xmlexternaltabi.cxx
+++ b/sc/source/filter/xml/xmlexternaltabi.cxx
@@ -318,9 +318,9 @@ void ScXMLExternalRefCellContext::EndElement()
ScExternalRefCache::TokenRef aToken;
if (mbIsNumeric)
- aToken.reset(new ScDoubleToken(mfCellValue));
+ aToken.reset(new formula::FormulaDoubleToken(mfCellValue));
else
- aToken.reset(new ScStringToken(maCellString));
+ aToken.reset(new formula::FormulaStringToken(maCellString));
sal_uInt32 nNumFmt = mnNumberFormat >= 0 ? static_cast<sal_uInt32>(mnNumberFormat) : 0;
mrExternalRefInfo.mpCacheTable->setCell(
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index 18a42e3185ea..4d80f5710ac9 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -154,7 +154,7 @@ public:
void AddProperty(sal_Int16 nContextID, const com::sun::star::uno::Any& aValue);
XMLPropertyState* FindProperty(const sal_Int16 nContextID);
- sal_Int32 GetNumberFormat() { return nNumberFormat; }
+ sal_Int32 GetNumberFormat();// { return nNumberFormat; }
private:
using XMLPropStyleContext::SetStyle;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 8d1cd4179516..c78785e6336f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -63,6 +63,7 @@
#include <vcl/help.hxx>
#include <vcl/cursor.hxx>
#include <tools/urlobj.hxx>
+#include <formula/formulahelper.hxx>
#include "inputwin.hxx"
#include "tabvwsh.hxx"
@@ -95,6 +96,8 @@
// max. Ranges im RangeFinder
#define RANGEFIND_MAX 32
+using namespace formula;
+
// STATIC DATA -----------------------------------------------------------
BOOL ScInputHandler::bOptLoaded = FALSE; // App-Optionen ausgewertet
@@ -663,7 +666,7 @@ void ScInputHandler::GetFormulaData()
const ScFuncDesc* pDesc = pFuncList->GetFunction( i );
if ( pDesc->pFuncName )
{
- pDesc->InitArgumentInfo();
+ pDesc->initArgumentInfo();
String aEntry = pDesc->GetSignature();
TypedStrData* pData = new TypedStrData( aEntry, 0.0, SC_STRTYPE_FUNCTIONS );
if (!pFormulaDataPara->Insert(pData))
@@ -715,10 +718,11 @@ void ScInputHandler::ShowTipCursor()
xub_StrLen nNextFStart = 0;
xub_StrLen nNextFEnd = 0;
xub_StrLen nArgPos = 0;
- const ScFuncDesc* ppFDesc;
- String** pppArgs;
+ const IFunctionDescription* ppFDesc;
+ ::std::vector< ::rtl::OUString> aArgs;
USHORT nArgs;
BOOL bFound = FALSE;
+ FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
while( !bFound )
{
@@ -729,13 +733,13 @@ void ScInputHandler::ShowTipCursor()
sal_Unicode c = aSelText.GetChar( nLeftParentPos-1 );
if( !(c >= 'A' && c<= 'Z' || c>= 'a' && c<= 'z' ) )
continue;
- nNextFStart = ScFormulaUtil::GetFunctionStart( aSelText, nLeftParentPos, TRUE);
- if( ScFormulaUtil::GetNextFunc( aSelText, FALSE, nNextFStart, &nNextFEnd, &ppFDesc, &pppArgs ) )
+ nNextFStart = aHelper.GetFunctionStart( aSelText, nLeftParentPos, TRUE);
+ if( aHelper.GetNextFunc( aSelText, FALSE, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
{
- if( ppFDesc->pFuncName )
+ if( ppFDesc->getFunctionName().getLength() )
{
- nArgPos = ScFormulaUtil::GetArgStart( aSelText, nNextFStart, 0 );
- nArgs = ppFDesc->nArgCount;
+ nArgPos = aHelper.GetArgStart( aSelText, nNextFStart, 0 );
+ nArgs = ppFDesc->getParameterCount();
USHORT nActive = 0;
USHORT nCount = 0;
@@ -746,11 +750,11 @@ void ScInputHandler::ShowTipCursor()
BOOL bFlag = FALSE;
String aNew;
USHORT nParAutoPos = SCPOS_INVALID;
- if( pFormulaDataPara->FindText( *(ppFDesc->pFuncName), aNew, nParAutoPos, FALSE ) )
+ if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, FALSE ) )
{
for( USHORT i=0; i < nArgs; i++ )
{
- xub_StrLen nLength=(pppArgs[i])->Len();
+ xub_StrLen nLength=aArgs[i].getLength();
if( nArgPos <= aSelText.Len()-1 )
{
nActive = i+1;
@@ -940,8 +944,8 @@ void ScInputHandler::UseFormulaData()
xub_StrLen nNextFStart = 0;
xub_StrLen nNextFEnd = 0;
xub_StrLen nArgPos = 0;
- const ScFuncDesc* ppFDesc;
- String** pppArgs;
+ const IFunctionDescription* ppFDesc;
+ ::std::vector< ::rtl::OUString> aArgs;
USHORT nArgs;
BOOL bFound = FALSE;
@@ -956,6 +960,7 @@ void ScInputHandler::UseFormulaData()
aAutoSearch = aText;
}
}
+ FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
while( !bFound )
{
@@ -967,13 +972,12 @@ void ScInputHandler::UseFormulaData()
sal_Unicode c = aFormula.GetChar( nLeftParentPos-1 );
if( !(c >= 'A' && c<= 'Z' || c>= 'a' && c<= 'z' ) )
continue;
- nNextFStart = ScFormulaUtil::GetFunctionStart( aFormula, nLeftParentPos, TRUE);
- if( ScFormulaUtil::GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd, &ppFDesc, &pppArgs ) )
+ nNextFStart = aHelper.GetFunctionStart( aFormula, nLeftParentPos, TRUE);
+ if( aHelper.GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
{
- if( ppFDesc->pFuncName )
{
- nArgPos = ScFormulaUtil::GetArgStart( aFormula, nNextFStart, 0 );
- nArgs = ppFDesc->nArgCount;
+ nArgPos = aHelper.GetArgStart( aFormula, nNextFStart, 0 );
+ nArgs = ppFDesc->getParameterCount();
USHORT nActive = 0;
USHORT nCount = 0;
@@ -984,11 +988,11 @@ void ScInputHandler::UseFormulaData()
BOOL bFlag = FALSE;
String aNew;
USHORT nParAutoPos = SCPOS_INVALID;
- if( pFormulaDataPara->FindText( *(ppFDesc->pFuncName), aNew, nParAutoPos, FALSE ) )
+ if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, FALSE ) )
{
for( USHORT i=0; i < nArgs; i++ )
{
- xub_StrLen nLength=(pppArgs[i])->Len();
+ xub_StrLen nLength=aArgs[i].getLength();
if( nArgPos <= aFormula.Len()-1 )
{
nActive = i+1;
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index ca8204203f18..e211cbd24b70 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -77,6 +77,7 @@ using ::std::find_if;
using ::std::distance;
using ::std::pair;
using ::std::list;
+using namespace formula;
#define SRCDOC_LIFE_SPAN 6000 // 1 minute (in 100th of a sec)
#define SRCDOC_SCAN_INTERVAL 1000*5 // every 5 seconds (in msec)
@@ -372,7 +373,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(sal_uInt1
{
for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
{
- ScToken* pToken = pTab->getCell(nCol, nRow).get();
+ FormulaToken* pToken = pTab->getCell(nCol, nRow).get();
if (!pToken)
return TokenArrayRef();
@@ -502,9 +503,9 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
TokenRef pToken;
const ScMatrixRef& pMat = itrData->mpRangeData;
if (pMat->IsValue(nC, nR))
- pToken.reset(new ScDoubleToken(pMat->GetDouble(nC, nR)));
+ pToken.reset(new formula::FormulaDoubleToken(pMat->GetDouble(nC, nR)));
else if (pMat->IsString(nC, nR))
- pToken.reset(new ScStringToken(pMat->GetString(nC, nR)));
+ pToken.reset(new formula::FormulaStringToken(pMat->GetString(nC, nR)));
else
pToken.reset(new ScEmptyCellToken(false, false));
@@ -799,7 +800,7 @@ IMPL_LINK( ScExternalRefLink, ExternalRefEndEditHdl, ::sfx2::SvBaseLink*, EMPTYA
// ============================================================================
-static ScToken* lcl_convertToToken(ScBaseCell* pCell)
+static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
{
if (!pCell || pCell->HasEmptyData())
{
@@ -813,20 +814,20 @@ static ScToken* lcl_convertToToken(ScBaseCell* pCell)
{
String aStr;
static_cast<ScEditCell*>(pCell)->GetString(aStr);
- return new ScStringToken(aStr);
+ return new formula::FormulaStringToken(aStr);
}
//break;
case CELLTYPE_STRING:
{
String aStr;
static_cast<ScStringCell*>(pCell)->GetString(aStr);
- return new ScStringToken(aStr);
+ return new formula::FormulaStringToken(aStr);
}
//break;
case CELLTYPE_VALUE:
{
double fVal = static_cast<ScValueCell*>(pCell)->GetValue();
- return new ScDoubleToken(fVal);
+ return new formula::FormulaDoubleToken(fVal);
}
//break;
case CELLTYPE_FORMULA:
@@ -834,17 +835,17 @@ static ScToken* lcl_convertToToken(ScBaseCell* pCell)
ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
USHORT nError = pFCell->GetErrCode();
if (nError)
- return new ScErrorToken( nError);
+ return new FormulaErrorToken( nError);
else if (pFCell->IsValue())
{
double fVal = pFCell->GetValue();
- return new ScDoubleToken(fVal);
+ return new formula::FormulaDoubleToken(fVal);
}
else
{
String aStr;
pFCell->GetString(aStr);
- return new ScStringToken(aStr);
+ return new formula::FormulaStringToken(aStr);
}
}
//break;
@@ -1314,7 +1315,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
if (!pTok.get())
{
// Generate an error for unresolvable cells.
- pTok.reset( new ScErrorToken( errNoValue));
+ pTok.reset( new FormulaErrorToken( errNoValue));
}
// Now, insert the token into cache table.
@@ -1409,27 +1410,27 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_u
ScExternalRefCache::TokenArrayRef pNew(new ScTokenArray);
ScTokenArray* pCode = pRangeData->GetCode();
- for (ScToken* pToken = pCode->First(); pToken; pToken = pCode->Next())
+ for (FormulaToken* pToken = pCode->First(); pToken; pToken = pCode->Next())
{
bool bTokenAdded = false;
switch (pToken->GetType())
{
case svSingleRef:
{
- const ScSingleRefData& rRef = pToken->GetSingleRef();
+ const ScSingleRefData& rRef = static_cast<ScToken*>(pToken)->GetSingleRef();
String aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
- ScExternalSingleRefToken aNewToken(nFileId, aTabName, pToken->GetSingleRef());
+ ScExternalSingleRefToken aNewToken(nFileId, aTabName, static_cast<ScToken*>(pToken)->GetSingleRef());
pNew->AddToken(aNewToken);
bTokenAdded = true;
}
break;
case svDoubleRef:
{
- const ScSingleRefData& rRef = pToken->GetSingleRef();
+ const ScSingleRefData& rRef = static_cast<ScToken*>(pToken)->GetSingleRef();
String aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
- ScExternalDoubleRefToken aNewToken(nFileId, aTabName, pToken->GetDoubleRef());
+ ScExternalDoubleRefToken aNewToken(nFileId, aTabName, static_cast<ScToken*>(pToken)->GetDoubleRef());
pNew->AddToken(aNewToken);
bTokenAdded = true;
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 10f39e7d8676..281bc54946b4 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1888,7 +1888,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const CharSet ) RETURN_ERROR
};
-extern "C" { static void SAL_CALL thisModule() {} };
+extern "C" { static void SAL_CALL thisModule() {} }
typedef ScFormatFilterPlugin * (*FilterFn)(void);
ScFormatFilterPlugin &ScFormatFilter::Get()
{
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index b812fde11dc3..4c1c8bd06eb8 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -69,7 +69,7 @@ private:
TypedScStrCollection* pColumnData;
TypedScStrCollection* pFormulaData;
- TypedStrCollection* pFormulaDataPara;
+ TypedScStrCollection* pFormulaDataPara;
ULONG nTipVisible;
ULONG nTipVisibleSec;
String aManualTip;
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index a8f0cdf347e5..d4573d408397 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -54,6 +54,7 @@
#include <climits>
using namespace com::sun::star;
+using namespace formula;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -1516,9 +1517,9 @@ void SAL_CALL ScExternalSheetCacheObj::setCellValue(sal_Int32 nCol, sal_Int32 nR
double fVal = 0.0;
OUString aVal;
if (rValue >>= fVal)
- pToken.reset(new ScDoubleToken(fVal));
+ pToken.reset(new FormulaDoubleToken(fVal));
else if (rValue >>= aVal)
- pToken.reset(new ScStringToken(aVal));
+ pToken.reset(new FormulaStringToken(aVal));
else
// unidentified value type.
return;
@@ -1533,7 +1534,7 @@ Any SAL_CALL ScExternalSheetCacheObj::getCellValue(sal_Int32 nCol, sal_Int32 nRo
if (nRow < 0 || nCol < 0)
throw IllegalArgumentException();
- ScToken* pToken = mpTable->getCell(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)).get();
+ FormulaToken* pToken = mpTable->getCell(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)).get();
if (!pToken)
throw IllegalArgumentException();
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 03499ffddcbc..d2ce4615fc65 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -262,16 +262,16 @@ uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const rtl::OUString& aPr
ScUnoGuard aGuard;
uno::Any aRet;
String aString(aPropertyName);
- } // if ( aString.EqualsAscii( SC_UNO_REFERENCEPOS ) )
- else if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) )
- {
- aRet <<= mbCompileFAP;
if ( aString.EqualsAscii( SC_UNO_REFERENCEPOS ) )
{
table::CellAddress aAddress;
ScUnoConversion::FillApiAddress( aAddress, maRefPos );
aRet <<= aAddress;
}
+ else if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) )
+ {
+ aRet <<= mbCompileFAP;
+ }
else if ( aString.EqualsAscii( SC_UNO_COMPILEENGLISH ) )
{
aRet <<= mbEnglish;
@@ -301,27 +301,6 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScFormulaParserObj )
//------------------------------------------------------------------------
-void lcl_ExternalRefToCalc( ScSingleRefData& rRef, const sheet::SingleReference& rAPI )
-{
- rRef.InitFlags();
-
- rRef.nCol = static_cast<SCsCOL>(rAPI.Column);
- rRef.nRow = static_cast<SCsROW>(rAPI.Row);
- rRef.nTab = 0;
- rRef.nRelCol = static_cast<SCsCOL>(rAPI.RelativeColumn);
- rRef.nRelRow = static_cast<SCsROW>(rAPI.RelativeRow);
- rRef.nRelTab = 0;
-
- rRef.SetColRel( ( rAPI.Flags & sheet::ReferenceFlags::COLUMN_RELATIVE ) != 0 );
- rRef.SetRowRel( ( rAPI.Flags & sheet::ReferenceFlags::ROW_RELATIVE ) != 0 );
- rRef.SetTabRel( false ); // sheet index must be absolute for external refs
- rRef.SetColDeleted( ( rAPI.Flags & sheet::ReferenceFlags::COLUMN_DELETED ) != 0 );
- rRef.SetRowDeleted( ( rAPI.Flags & sheet::ReferenceFlags::ROW_DELETED ) != 0 );
- rRef.SetTabDeleted( false ); // sheet must not be deleted for external refs
- rRef.SetFlag3D( ( rAPI.Flags & sheet::ReferenceFlags::SHEET_3D ) != 0 );
- rRef.SetRelName( false );
-}
-
void lcl_ExternalRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef )
{
rAPI.Column = rRef.nCol;
@@ -366,7 +345,7 @@ void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rR
bool ScTokenConversion::ConvertToTokenArray( ScDocument& rDoc,
ScTokenArray& rTokenArray, const uno::Sequence<sheet::FormulaToken>& rSequence )
{
- return rTokenArray.Fill(rSequence);
+ return rTokenArray.Fill(rSequence,rDoc.GetExternalRefManager());
}
// static
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 91a9fde56c40..d37d9fa3e2dc 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -314,7 +314,6 @@ void ScTabControl::UpdateStatus()
}
}
}
- }
}
SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );