summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/compiler.cxx
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2013-09-05 17:39:16 +0200
committerThomas Arnhold <thomas@arnhold.org>2013-09-10 17:31:15 +0000
commitd2ddff7b355fac5ba7ec93f866ea52f462dbc6fe (patch)
tree69e7f3983c9ed1ed7af7a1af762dd2d2809d3e6a /sc/source/core/tool/compiler.cxx
parent7dc7d77cd0b142ea3fde93368334d1e4909d94da (diff)
fdo#62475 removed pointless comments
Conflicts: sc/source/core/tool/interpr1.cxx sc/source/core/tool/interpr4.cxx sc/source/core/tool/token.cxx Change-Id: I507d747b6c087d089203f7bce6be836da28fc537 Reviewed-on: https://gerrit.libreoffice.org/5824 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'sc/source/core/tool/compiler.cxx')
-rw-r--r--sc/source/core/tool/compiler.cxx67
1 files changed, 10 insertions, 57 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index a510f4b6a047..a6b3e196cd77 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -69,7 +69,6 @@ using namespace formula;
using namespace ::com::sun::star;
using ::std::vector;
-
CharClass* ScCompiler::pCharClassEnglish = NULL;
const ScCompiler::Convention* ScCompiler::pConventions[ ] = { NULL, NULL, NULL, NULL, NULL, NULL };
@@ -91,10 +90,6 @@ static const sal_Char* pInternal[ 1 ] = { "TTT" };
using namespace ::com::sun::star::i18n;
-/////////////////////////////////////////////////////////////////////////
-
-
-
class ScCompilerRecursionGuard
{
private:
@@ -105,7 +100,6 @@ public:
~ScCompilerRecursionGuard() { --rRecursion; }
};
-
void ScCompiler::fillFromAddInMap( NonConstOpCodeMapPtr xMap,FormulaGrammar::Grammar _eGrammar ) const
{
size_t nSymbolOffset;
@@ -208,7 +202,6 @@ void ScCompiler::InitCharClassEnglish()
::comphelper::getProcessComponentContext(), LanguageTag( aLocale));
}
-
void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar )
{
OSL_ENSURE( eGrammar != FormulaGrammar::GRAM_UNSPECIFIED, "ScCompiler::SetGrammar: don't pass FormulaGrammar::GRAM_UNSPECIFIED");
@@ -265,7 +258,6 @@ void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap )
}
}
-
void ScCompiler::SetGrammarAndRefConvention(
const FormulaGrammar::Grammar eNewGrammar, const FormulaGrammar::Grammar eOldGrammar )
{
@@ -287,9 +279,6 @@ String ScCompiler::FindAddInFunction( const String& rUpperName, bool bLocalFirst
return ScGlobal::GetAddInCollection()->FindFunction(rUpperName, bLocalFirst); // bLocalFirst=false for english
}
-
-//-----------------------------------------------------------------------------
-
ScCompiler::Convention::~Convention()
{
delete [] mpCharTable;
@@ -419,8 +408,6 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
}
}
-//-----------------------------------------------------------------------------
-
static bool lcl_isValidQuotedText( const String& rFormula, xub_StrLen nSrcPos, ParseResult& rRes )
{
// Tokens that start at ' can have anything in them until a final '
@@ -728,8 +715,6 @@ void Convention_A1::MakeRowStr( OUStringBuffer& rBuffer, SCROW nRow )
rBuffer.append(sal_Int32(nRow + 1));
}
-//-----------------------------------------------------------------------------
-
struct ConventionOOO_A1 : public Convention_A1
{
ConventionOOO_A1() : Convention_A1 (FormulaGrammar::CONV_OOO) { }
@@ -760,7 +745,6 @@ struct ConventionOOO_A1 : public Convention_A1
return aString;
}
-
void MakeOneRefStrImpl(
OUStringBuffer& rBuffer, const ScCompiler& rComp,
const ScSingleRefData& rRef, const ScAddress& rAbsRef,
@@ -801,7 +785,6 @@ struct ConventionOOO_A1 : public Convention_A1
MakeRowStr(rBuffer, rAbsRef.Row());
}
-
void MakeRefStrImpl( OUStringBuffer& rBuffer,
const ScCompiler& rComp,
const ScComplexRefData& rRef,
@@ -1009,12 +992,9 @@ struct ConventionOOO_A1 : public Convention_A1
}
};
-
static const ConventionOOO_A1 ConvOOO_A1;
const ScCompiler::Convention * const ScCompiler::pConvOOO_A1 = &ConvOOO_A1;
-//-----------------------------------------------------------------------------
-
struct ConventionOOO_A1_ODF : public ConventionOOO_A1
{
ConventionOOO_A1_ODF() : ConventionOOO_A1 (FormulaGrammar::CONV_ODF) { }
@@ -1049,8 +1029,6 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1
static const ConventionOOO_A1_ODF ConvOOO_A1_ODF;
const ScCompiler::Convention * const ScCompiler::pConvOOO_A1_ODF = &ConvOOO_A1_ODF;
-//-----------------------------------------------------------------------------
-
struct ConventionXL
{
static bool GetDocAndTab( const ScCompiler& rComp,
@@ -1424,7 +1402,6 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
static const ConventionXL_A1 ConvXL_A1;
const ScCompiler::Convention * const ScCompiler::pConvXL_A1 = &ConvXL_A1;
-
struct ConventionXL_OOX : public ConventionXL_A1
{
ConventionXL_OOX() : ConventionXL_A1( FormulaGrammar::CONV_XL_OOX ) { }
@@ -1433,9 +1410,6 @@ struct ConventionXL_OOX : public ConventionXL_A1
static const ConventionXL_OOX ConvXL_OOX;
const ScCompiler::Convention * const ScCompiler::pConvXL_OOX = &ConvXL_OOX;
-
-//-----------------------------------------------------------------------------
-
static void
r1c1_add_col( OUStringBuffer &rBuf, const ScSingleRefData& rRef, const ScAddress& rAbsRef )
{
@@ -1660,7 +1634,6 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
static const ConventionXL_R1C1 ConvXL_R1C1;
const ScCompiler::Convention * const ScCompiler::pConvXL_R1C1 = &ConvXL_R1C1;
-//-----------------------------------------------------------------------------
ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,ScTokenArray& rArr)
: FormulaCompiler(rArr),
pDoc( pDocument ),
@@ -1735,7 +1708,6 @@ void ScCompiler::CheckTabQuotes( String& rString,
}
}
-
xub_StrLen ScCompiler::GetDocTabPos( const String& rString )
{
if (rString.GetChar(0) != '\'')
@@ -1747,8 +1719,6 @@ xub_StrLen ScCompiler::GetDocTabPos( const String& rString )
return nPos;
}
-//---------------------------------------------------------------------------
-
void ScCompiler::SetRefConvention( FormulaGrammar::AddressConvention eConv )
{
switch ( eConv ) {
@@ -1777,7 +1747,6 @@ void ScCompiler::SetError(sal_uInt16 nError)
pArr->SetCodeError( nError);
}
-
static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pSrc, xub_StrLen nMax )
{
const sal_Unicode* const pStop = pDst + nMax;
@@ -1789,15 +1758,13 @@ static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pS
return pDst;
}
-
-//---------------------------------------------------------------------------
// NextSymbol
-//---------------------------------------------------------------------------
+
// Zerlegt die Formel in einzelne Symbole fuer die weitere
// Verarbeitung (Turing-Maschine).
-//---------------------------------------------------------------------------
+
// Ausgangs Zustand = GetChar
-//---------------+-------------------+-----------------------+---------------
+
// Alter Zustand | gelesenes Zeichen | Aktion | Neuer Zustand
//---------------+-------------------+-----------------------+---------------
// GetChar | ;()+-*/^=& | Symbol=Zeichen | Stop
@@ -1816,7 +1783,7 @@ static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pS
// | $_:. | |
// | Buchstabe,Ziffer | Symbol=Symbol+Zeichen | GetWord
// | Sonst | Fehler | Stop
-//---------------|-------------------+-----------------------+---------------
+//---------------+-------------------+-----------------------+---------------
// GetValue | ;()*/^=<>& | |
// | Leerzeichen | Dec(CharPos) | Stop
// | Ziffer E+-%,. | Symbol=Symbol+Zeichen | GetValue
@@ -2413,9 +2380,7 @@ Label_MaskStateMachine:
return nSpaces;
}
-//---------------------------------------------------------------------------
// Convert symbol to token
-//---------------------------------------------------------------------------
bool ScCompiler::IsOpCode( const String& rName, bool bInArray )
{
@@ -2610,7 +2575,6 @@ bool ScCompiler::IsString()
return false;
}
-
bool ScCompiler::IsPredetectedReference( const String& rName )
{
// Speedup documents with lots of broken references, e.g. sheet deleted.
@@ -2668,7 +2632,6 @@ bool ScCompiler::IsPredetectedReference( const String& rName )
return false;
}
-
bool ScCompiler::IsDoubleReference( const String& rName )
{
ScRange aRange( aPos, aPos );
@@ -2711,7 +2674,6 @@ bool ScCompiler::IsDoubleReference( const String& rName )
return ( nFlags & SCA_VALID ) != 0;
}
-
bool ScCompiler::IsSingleReference( const String& rName )
{
ScAddress aAddr( aPos );
@@ -2758,7 +2720,6 @@ bool ScCompiler::IsSingleReference( const String& rName )
return ( nFlags & SCA_VALID ) != 0;
}
-
bool ScCompiler::IsReference( const String& rName )
{
// Has to be called before IsValue
@@ -3255,7 +3216,6 @@ bool ScCompiler::IsBoolean( const String& rName )
return false;
}
-
bool ScCompiler::IsErrorConstant( const String& rName ) const
{
sal_uInt16 nError = GetErrorConstant( rName);
@@ -3270,8 +3230,6 @@ bool ScCompiler::IsErrorConstant( const String& rName ) const
return false;
}
-//---------------------------------------------------------------------------
-
void ScCompiler::AutoCorrectParsedSymbol()
{
xub_StrLen nPos = aCorrectedSymbol.Len();
@@ -3918,7 +3876,6 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
return pNew;
}
-
ScTokenArray* ScCompiler::CompileString( const OUString& rFormula, const OUString& rFormulaNmsp )
{
OSL_ENSURE( (GetGrammar() == FormulaGrammar::GRAM_EXTERNAL) || rFormulaNmsp.isEmpty(),
@@ -3946,7 +3903,6 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula, const OUStrin
return CompileString( rFormula );
}
-
ScRangeData* ScCompiler::GetRangeData( const FormulaToken& rToken ) const
{
ScRangeData* pRangeData = NULL;
@@ -3964,7 +3920,6 @@ ScRangeData* ScCompiler::GetRangeData( const FormulaToken& rToken ) const
return pRangeData;
}
-
bool ScCompiler::HandleRange()
{
const ScRangeData* pRangeData = GetRangeData( *mpToken);
@@ -4018,7 +3973,7 @@ bool ScCompiler::HandleRange()
SetError(errNoName);
return true;
}
-// -----------------------------------------------------------------------------
+
bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
{
// Handle external range names.
@@ -4251,12 +4206,12 @@ void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken*
else
pConv->MakeRefStr( rBuffer, *this, aRef, true );
}
-// -----------------------------------------------------------------------------
+
void ScCompiler::CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
{
pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), false );
}
-// -----------------------------------------------------------------------------
+
void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
{
const OpCode eOp = _pTokenP->GetOpCode();
@@ -4285,14 +4240,13 @@ void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pT
else
rBuffer.append(ScGlobal::GetRscString(STR_NO_NAME_REF));
}
-// -----------------------------------------------------------------------------
+
void ScCompiler::LocalizeString( String& rName )
{
OUString aName(rName);
ScGlobal::GetAddInCollection()->LocalizeString( aName );
rName = aName;
}
-// -----------------------------------------------------------------------------
// Put quotes around string if non-alphanumeric characters are contained,
// quote characters contained within are escaped by '\\'.
@@ -4348,7 +4302,7 @@ void ScCompiler::fillAddInToken(::std::vector< ::com::sun::star::sheet::FormulaO
}
// FIXME: what about those old non-UNO AddIns?
}
-// -----------------------------------------------------------------------------
+
bool ScCompiler::HandleSingleRef()
{
ScSingleRefData& rRef = static_cast<ScToken*>(mpToken.get())->GetSingleRef();
@@ -4562,7 +4516,7 @@ bool ScCompiler::HandleSingleRef()
SetError(errNoName);
return true;
}
-// -----------------------------------------------------------------------------
+
bool ScCompiler::HandleDbData()
{
ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex(mpToken->GetIndex());
@@ -4585,7 +4539,6 @@ bool ScCompiler::HandleDbData()
return true;
}
-// -----------------------------------------------------------------------------
FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef )
{
return ScToken::ExtendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef );