summaryrefslogtreecommitdiff
path: root/formula/source/core/api/token.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'formula/source/core/api/token.cxx')
-rw-r--r--formula/source/core/api/token.cxx44
1 files changed, 24 insertions, 20 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index ccc740633c..8d9a5f8a6a 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_formula.hxx"
-
-
-// INCLUDE ---------------------------------------------------------------
-
#if STLPORT_VERSION<321
#include <stddef.h>
#else
@@ -47,9 +44,6 @@
#include "formula/tokenarray.hxx"
#include "formula/FormulaCompiler.hxx"
#include <formula/compiler.hrc>
-//#include "rechead.hxx"
-//#include "parclass.hxx"
-//#include "jumpmatrix.hxx"
#define MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */
namespace formula
@@ -145,6 +139,18 @@ BOOL FormulaToken::IsMatrixFunction() const
return formula::FormulaCompiler::IsMatrixFunction(GetOpCode());
}
+bool FormulaToken::IsExternalRef() const
+{
+ switch (eType)
+ {
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
+ case svExternalName:
+ return true;
+ }
+ return false;
+}
+
BOOL FormulaToken::operator==( const FormulaToken& rToken ) const
{
// don't compare reference count!
@@ -550,6 +556,16 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces()
return NULL;
}
+bool FormulaTokenArray::HasExternalRef() const
+{
+ for ( USHORT j=0; j < nLen; j++ )
+ {
+ if (pCode[j]->IsExternalRef())
+ return true;
+ }
+ return false;
+}
+
BOOL FormulaTokenArray::HasOpCode( OpCode eOp ) const
{
for ( USHORT j=0; j < nLen; j++ )
@@ -877,19 +893,6 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps()
// --- POF (plain old formula) rewrite of a token array ---------------------
-#if 0
-// static function can't be compiled if not used (warning)
-//#if OSL_DEBUG_LEVEL > 0
-static void DumpTokArr( FormulaTokenArray *pCode )
-{
- fprintf (stderr, "TokenArr: ");
- for ( FormulaToken *pCur = pCode->First(); pCur; pCur = pCode->Next() )
- fprintf( stderr, "t%d,o%d ",
- pCur->GetType(), pCur->GetOpCode() );
- fprintf (stderr, "\n");
-}
-#endif
-
inline bool MissingConvention::isRewriteNeeded( OpCode eOp ) const
{
switch (eOp)
@@ -1376,3 +1379,4 @@ BOOL FormulaUnknownToken::operator==( const FormulaToken& r ) const
} // formula
// -----------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */