diff options
Diffstat (limited to 'formula/source/ui/dlg/FormulaHelper.cxx')
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 927d882345dc..7da397f8f1e5 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ namespace formula { - namespace + namespace { //============================================================================ class OEmptyFunctionDescription : public IFunctionDescription @@ -59,12 +59,12 @@ namespace formula }; } //=================================================================== -// class FormulaHelper - static Method +// class FormulaHelper - static Method //=================================================================== #define FUNC_NOTFOUND 0xffff -FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager) +FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager) :m_pSysLocale(new SvtSysLocale) ,m_pFunctionManager(_pFunctionManager) ,open(_pFunctionManager->getSingleToken(IFunctionManager::eOk)) @@ -75,16 +75,16 @@ FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager) { m_pCharClass = m_pSysLocale->GetCharClassPtr(); } -BOOL FormulaHelper::GetNextFunc( const String& rFormula, - BOOL bBack, - xub_StrLen& rFStart, // Input and output - xub_StrLen* pFEnd, // = NULL - const IFunctionDescription** ppFDesc, // = NULL - ::std::vector< ::rtl::OUString>* pArgs ) const // = NULL +BOOL FormulaHelper::GetNextFunc( const String& rFormula, + BOOL bBack, + xub_StrLen& rFStart, // Input and output + xub_StrLen* pFEnd, // = NULL + const IFunctionDescription** ppFDesc, // = NULL + ::std::vector< ::rtl::OUString>* pArgs ) const // = NULL { - BOOL bFound = FALSE; - xub_StrLen nOldStart = rFStart; - String aFname; + BOOL bFound = FALSE; + xub_StrLen nOldStart = rFStart; + String aFname; rFStart = GetFunctionStart( rFormula, rFStart, bBack, ppFDesc ? &aFname : NULL ); bFound = ( rFStart != FUNC_NOTFOUND ); @@ -132,15 +132,15 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula, //------------------------------------------------------------------------ -void FormulaHelper::FillArgStrings( const String& rFormula, - xub_StrLen nFuncPos, - USHORT nArgs, +void FormulaHelper::FillArgStrings( const String& rFormula, + xub_StrLen nFuncPos, + USHORT nArgs, ::std::vector< ::rtl::OUString >& _rArgs ) const { - xub_StrLen nStart = 0; - xub_StrLen nEnd = 0; - USHORT i; - BOOL bLast = FALSE; + xub_StrLen nStart = 0; + xub_StrLen nEnd = 0; + USHORT i; + BOOL bLast = FALSE; for ( i=0; i<nArgs && !bLast; i++ ) { @@ -190,7 +190,7 @@ inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_ if( _pCharClass->isLetterNumeric( rStr, nPos ) ) return TRUE; else - { // In internationalized versions function names may contain a dot + { // In internationalized versions function names may contain a dot // and in every version also an underscore... ;-) sal_Unicode c = rStr.GetChar(nPos); return c == '.' || c == '_'; @@ -198,18 +198,18 @@ inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_ } -xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, - xub_StrLen nStart, - BOOL bBack, - String* pFuncName ) const +xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, + xub_StrLen nStart, + BOOL bBack, + String* pFuncName ) const { xub_StrLen nStrLen = rFormula.Len(); if ( nStrLen < nStart ) return nStart; - xub_StrLen nFStart = FUNC_NOTFOUND; - xub_StrLen nParPos = nStart; + xub_StrLen nFStart = FUNC_NOTFOUND; + xub_StrLen nParPos = nStart; BOOL bRepeat, bFound; do @@ -263,11 +263,11 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, { if ( IsFormulaText( m_pCharClass,rFormula, nFStart ) ) { - // Function found + // Function found if ( pFuncName ) *pFuncName = rFormula.Copy( nFStart, nParPos-nFStart ); } - else // Brackets without function -> keep searching + else // Brackets without function -> keep searching { bRepeat = TRUE; if ( !bBack ) @@ -278,7 +278,7 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, bRepeat = FALSE; } } - else // No brackets found + else // No brackets found { nFStart = FUNC_NOTFOUND; if ( pFuncName ) @@ -292,16 +292,16 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, //------------------------------------------------------------------------ -xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart ) const +xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart ) const { xub_StrLen nStrLen = rStr.Len(); if ( nStrLen < nStart ) return nStart; - short nParCount = 0; + short nParCount = 0; bool bInArray = false; - BOOL bFound = FALSE; + BOOL bFound = FALSE; while ( !bFound && (nStart < nStrLen) ) { @@ -323,7 +323,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart else if ( nParCount < 0 ) { bFound = TRUE; - nStart--; // read one too far + nStart--; // read one too far } } else if ( c == arrayOpen ) @@ -339,7 +339,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart if ( !bInArray && nParCount == 0 ) { bFound = TRUE; - nStart--; // read one too far + nStart--; // read one too far } } nStart++; // Set behind found position @@ -357,9 +357,9 @@ xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, US if ( nStrLen < nStart ) return nStart; - short nParCount = 0; + short nParCount = 0; bool bInArray = false; - BOOL bFound = FALSE; + BOOL bFound = FALSE; while ( !bFound && (nStart < nStrLen) ) { |