[Libreoffice-commits] core.git: sc/inc sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Wed Jul 31 14:23:13 PDT 2013
sc/inc/compiler.hxx | 60 +++++----------------------------------
sc/source/core/tool/compiler.cxx | 52 +++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 52 deletions(-)
New commits:
commit eaa64ac2edbd07638e76545ec954d89b46df9dad
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Jul 31 17:24:40 2013 -0400
Avoid having these fat inline methods.
They tend to cause linkage problem on Windows.
Change-Id: I98fff8c5e45987670629e6eeacec7ecadf71ff48
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 46606d8..6cb4301 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -443,66 +443,22 @@ public:
/** If the character is allowed as first character in sheet names or
references, includes '$' and '?'. */
- static inline bool IsCharWordChar( String const & rStr,
- xub_StrLen nPos,
- const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
- {
- sal_Unicode c = rStr.GetChar( nPos );
- sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
- if (c < 128)
- {
- return pConventions[eConv] ? (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD :
- false; // no convention => assume invalid
- }
- else
- return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
- }
+ static bool IsCharWordChar(
+ String const & rStr, xub_StrLen nPos,
+ const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO );
/** If the character is allowed in sheet names, thus may be part of a
reference, includes '$' and '?' and such. */
- static inline bool IsWordChar( String const & rStr,
- xub_StrLen nPos,
- const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
- {
- sal_Unicode c = rStr.GetChar( nPos );
- sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
- if (c < 128)
- {
- return pConventions[eConv] ? (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD :
- false; // convention not known => assume invalid
- }
- else
- return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
- }
+ static bool IsWordChar(
+ String const & rStr, xub_StrLen nPos,
+ const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO );
/** If the character is allowed as tested by nFlags (SC_COMPILER_C_...
bits) for all known address conventions. If more than one bit is given
in nFlags, all bits must match. If bTestLetterNumeric is false and
char>=128, no LetterNumeric test is done and false is returned. */
- static inline bool IsCharFlagAllConventions( String const & rStr,
- xub_StrLen nPos,
- sal_uLong nFlags,
- bool bTestLetterNumeric = true )
- {
- sal_Unicode c = rStr.GetChar( nPos );
- sal_Unicode cLast = nPos > 0 ? rStr.GetChar( nPos-1 ) : 0;
- if (c < 128)
- {
- for ( int nConv = formula::FormulaGrammar::CONV_UNSPECIFIED;
- ++nConv < formula::FormulaGrammar::CONV_LAST; )
- {
- if (pConventions[nConv] &&
- ((pConventions[nConv]->getCharTableFlags(c, cLast) & nFlags) != nFlags))
- return false;
- // convention not known => assume valid
- }
- return true;
- }
- else if (bTestLetterNumeric)
- return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
- else
- return false;
- }
+ static bool IsCharFlagAllConventions(
+ String const & rStr, xub_StrLen nPos, sal_uLong nFlags, bool bTestLetterNumeric = true );
private:
// FormulaCompiler
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4d140ba..6391690 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4137,6 +4137,58 @@ void ScCompiler::MoveRelWrap( ScTokenArray& rArr, ScDocument* pDoc, const ScAddr
}
}
+bool ScCompiler::IsCharWordChar(
+ String const & rStr, xub_StrLen nPos, const formula::FormulaGrammar::AddressConvention eConv )
+{
+ sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
+ if (c < 128)
+ {
+ return pConventions[eConv] ? (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD :
+ false; // no convention => assume invalid
+ }
+ else
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+}
+
+bool ScCompiler::IsWordChar(
+ String const & rStr, xub_StrLen nPos,
+ const formula::FormulaGrammar::AddressConvention eConv )
+{
+ sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
+ if (c < 128)
+ {
+ return pConventions[eConv] ? (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD :
+ false; // convention not known => assume invalid
+ }
+ else
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+}
+
+bool ScCompiler::IsCharFlagAllConventions(
+ String const & rStr, xub_StrLen nPos, sal_uLong nFlags, bool bTestLetterNumeric )
+{
+ sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar( nPos-1 ) : 0;
+ if (c < 128)
+ {
+ for ( int nConv = formula::FormulaGrammar::CONV_UNSPECIFIED;
+ ++nConv < formula::FormulaGrammar::CONV_LAST; )
+ {
+ if (pConventions[nConv] &&
+ ((pConventions[nConv]->getCharTableFlags(c, cLast) & nFlags) != nFlags))
+ return false;
+ // convention not known => assume valid
+ }
+ return true;
+ }
+ else if (bTestLetterNumeric)
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+ else
+ return false;
+}
+
void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP)
{
FormulaToken* t = pTokenP;
More information about the Libreoffice-commits
mailing list