summaryrefslogtreecommitdiff
path: root/formula/source
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
commitde19474011d199d247b2da9d12f12104133a6f26 (patch)
treed146936375b082768d6cd4a18fac27f0ce6e8c1a /formula/source
parent01fcebb5790e99aabf968d48d5915dbe736c3cb3 (diff)
parent4fba42e5f98fcc0fa9addf41a793c1d7f11602c8 (diff)
dr78: rebase to DEV300_m101
Diffstat (limited to 'formula/source')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx178
-rw-r--r--formula/source/core/api/token.cxx156
-rw-r--r--formula/source/ui/dlg/ControlHelper.hxx6
-rw-r--r--formula/source/ui/dlg/FormulaHelper.cxx52
-rw-r--r--formula/source/ui/dlg/formula.cxx265
-rw-r--r--formula/source/ui/dlg/funcpage.cxx26
-rw-r--r--formula/source/ui/dlg/funcpage.hxx14
-rw-r--r--formula/source/ui/dlg/funcutl.cxx38
-rw-r--r--formula/source/ui/dlg/parawin.cxx114
-rw-r--r--formula/source/ui/dlg/parawin.hxx72
-rw-r--r--formula/source/ui/dlg/structpg.cxx24
-rw-r--r--formula/source/ui/dlg/structpg.hxx10
-rw-r--r--formula/source/ui/inc/ModuleHelper.hxx2
13 files changed, 481 insertions, 476 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 2010679907d2..81378bf8ae0c 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -132,7 +132,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
return NUMBERFORMAT_NUMBER;
}
-inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, USHORT nOpCode )
+inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, sal_uInt16 nOpCode )
{
sheet::FormulaOpCodeMapEntry aEntry;
aEntry.Token.OpCode = nOpCode;
@@ -140,15 +140,15 @@ inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >
rVec.push_back( aEntry);
}
-void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, USHORT nOpCodeBeg, USHORT nOpCodeEnd )
+void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, sal_uInt16 nOpCodeBeg, sal_uInt16 nOpCodeEnd )
{
- for (USHORT nOpCode = nOpCodeBeg; nOpCode < nOpCodeEnd; ++nOpCode)
+ for (sal_uInt16 nOpCode = nOpCodeBeg; nOpCode < nOpCodeEnd; ++nOpCode)
lclPushOpCodeMapEntry( rVec, pTable, nOpCode );
}
-void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, const USHORT* pnOpCodes, size_t nCount )
+void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, const sal_uInt16* pnOpCodes, size_t nCount )
{
- for (const USHORT* pnEnd = pnOpCodes + nCount; pnOpCodes < pnEnd; ++pnOpCodes)
+ for (const sal_uInt16* pnEnd = pnOpCodes + nCount; pnOpCodes < pnEnd; ++pnOpCodes)
lclPushOpCodeMapEntry( rVec, pTable, *pnOpCodes );
}
@@ -156,11 +156,11 @@ class OpCodeList : public Resource // temp object for resource
{
public:
- OpCodeList( USHORT, FormulaCompiler::NonConstOpCodeMapPtr );
+ OpCodeList( sal_uInt16, FormulaCompiler::NonConstOpCodeMapPtr );
private:
- bool getOpCodeString( String& rStr, USHORT nOp );
- void putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp );
+ bool getOpCodeString( String& rStr, sal_uInt16 nOp );
+ void putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, sal_uInt16 nOp );
private:
enum SeparatorType
@@ -171,11 +171,11 @@ private:
SeparatorType meSepType;
};
-OpCodeList::OpCodeList( USHORT nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap ) :
+OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap ) :
Resource( ResId(nRID,*ResourceManager::getResManager()) )
,meSepType(SEMICOLON_BASE)
{
- for (USHORT i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i)
+ for (sal_uInt16 i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i)
{
String aOpStr;
if ( getOpCodeString(aOpStr, i) )
@@ -187,7 +187,7 @@ OpCodeList::OpCodeList( USHORT nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap
FreeResource();
}
-bool OpCodeList::getOpCodeString( String& rStr, USHORT nOp )
+bool OpCodeList::getOpCodeString( String& rStr, sal_uInt16 nOp )
{
switch (nOp)
{
@@ -238,7 +238,7 @@ bool OpCodeList::getOpCodeString( String& rStr, USHORT nOp )
return false;
}
-void OpCodeList::putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp )
+void OpCodeList::putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, sal_uInt16 nOp )
{
ResId aRes(nOp,*ResourceManager::getResManager());
aRes.SetRT(RSC_STRING);
@@ -301,7 +301,7 @@ uno::Sequence< sheet::FormulaToken > FormulaCompiler::OpCodeMap::createSequenceO
// interest.
}
if (!aIntName.getLength())
- aIntName = _rCompiler.FindAddInFunction(*pName, !isEnglish()); // bLocalFirst=FALSE for english
+ aIntName = _rCompiler.FindAddInFunction(*pName, !isEnglish()); // bLocalFirst=sal_False for english
if (!aIntName.getLength())
pToken->OpCode = getOpCodeUnknown();
else
@@ -380,7 +380,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
// Anything else but SPECIAL.
if ((nGroups & FormulaMapGroup::SEPARATORS) != 0)
{
- static const USHORT aOpCodes[] = {
+ static const sal_uInt16 aOpCodes[] = {
SC_OPCODE_OPEN,
SC_OPCODE_CLOSE,
SC_OPCODE_SEP,
@@ -389,7 +389,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
}
if ((nGroups & FormulaMapGroup::ARRAY_SEPARATORS) != 0)
{
- static const USHORT aOpCodes[] = {
+ static const sal_uInt16 aOpCodes[] = {
SC_OPCODE_ARRAY_OPEN,
SC_OPCODE_ARRAY_CLOSE,
SC_OPCODE_ARRAY_ROW_SEP,
@@ -406,7 +406,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) == 0)
lclPushOpCodeMapEntry( aVec, mpTable, ocAdd );
// regular unary operators
- for (USHORT nOp = SC_OPCODE_START_UN_OP; nOp < SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp)
+ for (sal_uInt16 nOp = SC_OPCODE_START_UN_OP; nOp < SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp)
{
switch (nOp)
{
@@ -422,7 +422,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
}
if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) != 0)
{
- for (USHORT nOp = SC_OPCODE_START_BIN_OP; nOp < SC_OPCODE_STOP_BIN_OP && nOp < mnSymbols; ++nOp)
+ for (sal_uInt16 nOp = SC_OPCODE_START_BIN_OP; nOp < SC_OPCODE_STOP_BIN_OP && nOp < mnSymbols; ++nOp)
{
switch (nOp)
{
@@ -440,10 +440,10 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
{
// Function names are not consecutive, skip the gaps between
// functions with no parameter, functions with 1 parameter
- lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_NO_PAR, ::std::min< USHORT >( SC_OPCODE_STOP_NO_PAR, mnSymbols ) );
- lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_1_PAR, ::std::min< USHORT >( SC_OPCODE_STOP_1_PAR, mnSymbols ) );
+ lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_NO_PAR, ::std::min< sal_uInt16 >( SC_OPCODE_STOP_NO_PAR, mnSymbols ) );
+ lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_1_PAR, ::std::min< sal_uInt16 >( SC_OPCODE_STOP_1_PAR, mnSymbols ) );
// Additional functions not within range of functions.
- static const USHORT aOpCodes[] = {
+ static const sal_uInt16 aOpCodes[] = {
SC_OPCODE_IF,
SC_OPCODE_CHOSE,
SC_OPCODE_AND,
@@ -453,7 +453,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
};
lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, sizeof(aOpCodes)/sizeof(aOpCodes[0]) );
// functions with 2 or more parameters.
- for (USHORT nOp = SC_OPCODE_START_2_PAR; nOp < SC_OPCODE_STOP_2_PAR && nOp < mnSymbols; ++nOp)
+ for (sal_uInt16 nOp = SC_OPCODE_START_2_PAR; nOp < SC_OPCODE_STOP_2_PAR && nOp < mnSymbols; ++nOp)
{
switch (nOp)
{
@@ -490,8 +490,8 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eOp )
{
- DBG_ASSERT( 0 < eOp && USHORT(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
- if (0 < eOp && USHORT(eOp) < mnSymbols)
+ DBG_ASSERT( 0 < eOp && sal_uInt16(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
+ if (0 < eOp && sal_uInt16(eOp) < mnSymbols)
{
DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) || (eOp == ocCurrency),
ByteString( "OpCodeMap::putOpCode: reusing OpCode ").
@@ -513,10 +513,10 @@ FormulaCompiler::FormulaCompiler(FormulaTokenArray& _rArr)
nRecursion(0),
nNumFmt( NUMBERFORMAT_UNDEFINED ),
meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ),
- bAutoCorrect( FALSE ),
- bCorrected( FALSE ),
- bCompileForFAP( FALSE ),
- bIgnoreErrors( FALSE )
+ bAutoCorrect( sal_False ),
+ bCorrected( sal_False ),
+ bCompileForFAP( sal_False ),
+ bIgnoreErrors( sal_False )
{
DBG_CTOR(FormulaCompiler,NULL);
@@ -529,10 +529,10 @@ FormulaCompiler::FormulaCompiler()
nRecursion(0),
nNumFmt( NUMBERFORMAT_UNDEFINED ),
meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ),
- bAutoCorrect( FALSE ),
- bCorrected( FALSE ),
- bCompileForFAP( FALSE ),
- bIgnoreErrors( FALSE )
+ bAutoCorrect( sal_False ),
+ bCorrected( sal_False ),
+ bCompileForFAP( sal_False ),
+ bIgnoreErrors( sal_False )
{
DBG_CTOR(FormulaCompiler,NULL);
@@ -575,7 +575,7 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa
}
// -----------------------------------------------------------------------------
-String FormulaCompiler::FindAddInFunction( const String& /*rUpperName*/, BOOL /*bLocalFirst*/ ) const
+String FormulaCompiler::FindAddInFunction( const String& /*rUpperName*/, sal_Bool /*bLocalFirst*/ ) const
{
return String();
}
@@ -681,7 +681,7 @@ void FormulaCompiler::InitSymbolsODFF() const
mxSymbolsODFF = s_sSymbol;
}
// -----------------------------------------------------------------------------
-void FormulaCompiler::loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const
+void FormulaCompiler::loadSymbols(sal_uInt16 _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const
{
if ( !_xMap.get() )
{
@@ -721,7 +721,7 @@ OpCode FormulaCompiler::GetEnglishOpCode( const String& rName ) const
}
// Remove quotes, escaped quotes are unescaped.
-BOOL FormulaCompiler::DeQuote( String& rStr )
+sal_Bool FormulaCompiler::DeQuote( String& rStr )
{
xub_StrLen nLen = rStr.Len();
if ( nLen > 1 && rStr.GetChar(0) == '\'' && rStr.GetChar( nLen-1 ) == '\'' )
@@ -734,16 +734,16 @@ BOOL FormulaCompiler::DeQuote( String& rStr )
rStr.Erase( nPos, 1 );
++nPos;
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
void FormulaCompiler::fillAddInToken(::std::vector< sheet::FormulaOpCodeMapEntry >& /*_rVec*/,bool /*_bIsEnglish*/) const
{
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::IsMatrixFunction(OpCode _eOpCode)
+sal_Bool FormulaCompiler::IsMatrixFunction(OpCode _eOpCode)
{
switch ( _eOpCode )
{
@@ -757,13 +757,13 @@ BOOL FormulaCompiler::IsMatrixFunction(OpCode _eOpCode)
case ocMatMult :
case ocMatInv :
case ocMatrixUnit :
- return TRUE;
+ return sal_True;
default:
{
// added to avoid warnings
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
@@ -781,7 +781,7 @@ sal_Int32 FormulaCompiler::OpCodeMap::getOpCodeUnknown()
return kOpCodeUnknown;
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::GetToken()
+sal_Bool FormulaCompiler::GetToken()
{
static const short nRecursionMax = 42;
FormulaCompilerRecursionGuard aRecursionGuard( nRecursion );
@@ -789,16 +789,16 @@ BOOL FormulaCompiler::GetToken()
{
SetError( errStackOverflow );
pToken = new FormulaByteToken( ocStop );
- return FALSE;
+ return sal_False;
}
if ( bAutoCorrect && !pStack )
{ // #61426# don't merge stacked subroutine code into entered formula
aCorrectedFormula += aCorrectedSymbol;
aCorrectedSymbol.Erase();
}
- BOOL bStop = FALSE;
+ sal_Bool bStop = sal_False;
if( pArr->GetCodeError() && !bIgnoreErrors )
- bStop = TRUE;
+ bStop = sal_True;
else
{
short nWasColRowName;
@@ -813,11 +813,11 @@ BOOL FormulaCompiler::GetToken()
if ( nWasColRowName )
nWasColRowName++;
if ( bAutoCorrect && !pStack )
- CreateStringFromToken( aCorrectedFormula, pToken, FALSE );
+ CreateStringFromToken( aCorrectedFormula, pToken, sal_False );
pToken = pArr->Next();
}
if ( bAutoCorrect && !pStack && pToken )
- CreateStringFromToken( aCorrectedSymbol, pToken, FALSE );
+ CreateStringFromToken( aCorrectedSymbol, pToken, sal_False );
if( !pToken )
{
if( pStack )
@@ -826,7 +826,7 @@ BOOL FormulaCompiler::GetToken()
return GetToken();
}
else
- bStop = TRUE;
+ bStop = sal_True;
}
else
{
@@ -840,10 +840,10 @@ BOOL FormulaCompiler::GetToken()
if( bStop )
{
pToken = new FormulaByteToken( ocStop );
- return FALSE;
+ return sal_False;
}
if( pToken->GetOpCode() == ocSubTotal )
- glSubTotal = TRUE;
+ glSubTotal = sal_True;
else if ( pToken->GetOpCode() == ocExternalRef )
{
return HandleExternalReference(*pToken);
@@ -868,7 +868,7 @@ BOOL FormulaCompiler::GetToken()
{
pArr->nRefs++;
}
- return TRUE;
+ return sal_True;
}
//---------------------------------------------------------------------------
// RPN creation by recursion
@@ -900,7 +900,7 @@ void FormulaCompiler::Factor()
if ( bAutoCorrect && !pStack )
{ // assume multiplication
aCorrectedFormula += mxSymbols->getSymbol(ocMul);
- bCorrected = TRUE;
+ bCorrected = sal_True;
NextToken();
eOp = Expression();
if( eOp != ocClose )
@@ -970,7 +970,7 @@ void FormulaCompiler::Factor()
pArr->SetRecalcModeOnRefMove();
break;
case ocHyperLink :
- pArr->SetHyperLink(TRUE);
+ pArr->SetHyperLink(sal_True);
break;
default:
; // nothing
@@ -1047,7 +1047,7 @@ void FormulaCompiler::Factor()
}
else
SetError(errPairExpected);
- BYTE nSepCount = 0;
+ sal_uInt8 nSepCount = 0;
if( !bNoParam )
{
nSepCount++;
@@ -1135,7 +1135,7 @@ void FormulaCompiler::Factor()
if ( bAutoCorrect && !pStack )
{
aCorrectedSymbol.Erase();
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
}
else if ( eOp == ocExternalRef )
@@ -1154,7 +1154,7 @@ void FormulaCompiler::Factor()
if ( nLen )
aCorrectedFormula.Erase( nLen - 1 );
aCorrectedSymbol.Erase();
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
}
}
@@ -1343,7 +1343,7 @@ OpCode FormulaCompiler::Expression()
return pToken->GetOpCode();
}
// -----------------------------------------------------------------------------
-void FormulaCompiler::SetError(USHORT /*nError*/)
+void FormulaCompiler::SetError(sal_uInt16 /*nError*/)
{
}
// -----------------------------------------------------------------------------
@@ -1374,10 +1374,10 @@ bool FormulaCompiler::MergeRangeReference(FormulaToken * * const pCode1, Formula
return true;
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::CompileTokenArray()
+sal_Bool FormulaCompiler::CompileTokenArray()
{
- glSubTotal = FALSE;
- bCorrected = FALSE;
+ glSubTotal = sal_False;
+ bCorrected = sal_False;
if( !pArr->GetCodeError() || bIgnoreErrors )
{
if ( bAutoCorrect )
@@ -1390,7 +1390,7 @@ BOOL FormulaCompiler::CompileTokenArray()
pStack = NULL;
FormulaToken* pData[ MAXCODE ];
pCode = pData;
- BOOL bWasForced = pArr->IsRecalcModeForced();
+ sal_Bool bWasForced = pArr->IsRecalcModeForced();
if ( bWasForced )
{
if ( bAutoCorrect )
@@ -1406,7 +1406,7 @@ BOOL FormulaCompiler::CompileTokenArray()
if (eOp != ocStop)
SetError( errOperatorExpected);
- USHORT nErrorBeforePop = pArr->GetCodeError();
+ sal_uInt16 nErrorBeforePop = pArr->GetCodeError();
while( pStack )
PopTokenArray();
@@ -1424,7 +1424,7 @@ BOOL FormulaCompiler::CompileTokenArray()
if( pArr->GetCodeError() && !bIgnoreErrors )
{
pArr->DelRPN();
- pArr->SetHyperLink(FALSE);
+ pArr->SetHyperLink(sal_False);
}
if ( bWasForced )
@@ -1486,7 +1486,7 @@ void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer )
rBuffer.append(sal_Unicode('='));
FormulaToken* t = pArr->First();
while( t )
- t = CreateStringFromToken( rBuffer, t, TRUE );
+ t = CreateStringFromToken( rBuffer, t, sal_True );
if (pSaveArr != pArr)
{
@@ -1495,7 +1495,7 @@ void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer )
}
}
// -----------------------------------------------------------------------------
-FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaToken* pTokenP,BOOL bAllowArrAdvance )
+FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaToken* pTokenP,sal_Bool bAllowArrAdvance )
{
rtl::OUStringBuffer aBuffer;
FormulaToken* p = CreateStringFromToken( aBuffer, pTokenP, bAllowArrAdvance );
@@ -1503,10 +1503,10 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaT
return p;
}
-FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP,BOOL bAllowArrAdvance )
+FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP,sal_Bool bAllowArrAdvance )
{
- BOOL bNext = TRUE;
- BOOL bSpaces = FALSE;
+ sal_Bool bNext = sal_True;
+ sal_Bool bSpaces = sal_False;
FormulaToken* t = pTokenP;
OpCode eOp = t->GetOpCode();
if( eOp >= ocAnd && eOp <= ocOr )
@@ -1516,7 +1516,7 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff
t = pArr->Next();
else
t = pArr->PeekNext();
- bNext = FALSE;
+ bNext = sal_False;
bSpaces = ( !t || t->GetOpCode() != ocOpen );
}
if( bSpaces )
@@ -1540,8 +1540,8 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff
else
{
// most times it's just one blank
- BYTE n = t->GetByte();
- for ( BYTE j=0; j<n; ++j )
+ sal_uInt8 n = t->GetByte();
+ for ( sal_uInt8 j=0; j<n; ++j )
{
rBuffer.append(sal_Unicode(' '));
}
@@ -1549,7 +1549,7 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff
}
else if( eOp >= ocInternalBegin && eOp <= ocInternalEnd )
rBuffer.appendAscii( pInternal[ eOp - ocInternalBegin ] );
- else if( (USHORT) eOp < mxSymbols->getSymbolCount()) // Keyword:
+ else if( (sal_uInt16) eOp < mxSymbols->getSymbolCount()) // Keyword:
rBuffer.append(mxSymbols->getSymbol(eOp));
else
{
@@ -1637,7 +1637,7 @@ void FormulaCompiler::AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal )
{
::rtl::math::doubleToUStringBuffer( rBuffer, fVal,
rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', TRUE );
+ rtl_math_DecimalPlaces_Max, '.', sal_True );
}
else
{
@@ -1646,7 +1646,7 @@ void FormulaCompiler::AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal )
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max,
aSysLocale.GetLocaleDataPtr()->getNumDecimalSep().GetChar(0),
- TRUE );
+ sal_True );
}
}
// -----------------------------------------------------------------------------
@@ -1655,9 +1655,9 @@ void FormulaCompiler::AppendBoolean( rtl::OUStringBuffer& rBuffer, bool bVal )
rBuffer.append( mxSymbols->getSymbol(static_cast<OpCode>(bVal ? ocTrue : ocFalse)) );
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::IsImportingXML() const
+sal_Bool FormulaCompiler::IsImportingXML() const
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & rStr )
@@ -1708,7 +1708,7 @@ OpCode FormulaCompiler::NextToken()
if ( eOp == eLastOp || eLastOp == ocOpen )
{ // throw away duplicated operator
aCorrectedSymbol.Erase();
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
else
{
@@ -1725,7 +1725,7 @@ OpCode FormulaCompiler::NextToken()
aCorrectedFormula.SetChar( nPos,
mxSymbols->getSymbol(ocGreater).GetChar(0) );
aCorrectedSymbol = c;
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
break;
case ocLess:
@@ -1734,14 +1734,14 @@ OpCode FormulaCompiler::NextToken()
aCorrectedFormula.SetChar( nPos,
mxSymbols->getSymbol(ocLess).GetChar(0) );
aCorrectedSymbol = c;
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
else if ( c == mxSymbols->getSymbol(ocGreater).GetChar(0) )
{ // <> instead of ><
aCorrectedFormula.SetChar( nPos,
mxSymbols->getSymbol(ocLess).GetChar(0) );
aCorrectedSymbol = c;
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
break;
case ocMul:
@@ -1750,7 +1750,7 @@ OpCode FormulaCompiler::NextToken()
aCorrectedFormula.SetChar( nPos,
mxSymbols->getSymbol(ocMul).GetChar(0) );
aCorrectedSymbol = c;
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
break;
case ocDiv:
@@ -1759,7 +1759,7 @@ OpCode FormulaCompiler::NextToken()
aCorrectedFormula.SetChar( nPos,
mxSymbols->getSymbol(ocDiv).GetChar(0) );
aCorrectedSymbol = c;
- bCorrected = TRUE;
+ bCorrected = sal_True;
}
break;
default:
@@ -1796,24 +1796,24 @@ void FormulaCompiler::PutCode( FormulaTokenRef& p )
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::HandleExternalReference(const FormulaToken& /*_aToken*/)
+sal_Bool FormulaCompiler::HandleExternalReference(const FormulaToken& /*_aToken*/)
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::HandleRange()
+sal_Bool FormulaCompiler::HandleRange()
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::HandleSingleRef()
+sal_Bool FormulaCompiler::HandleSingleRef()
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL FormulaCompiler::HandleDbData()
+sal_Bool FormulaCompiler::HandleDbData()
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
void FormulaCompiler::CreateStringFromSingleRef(rtl::OUStringBuffer& /*rBuffer*/,FormulaToken* /*pTokenP*/)
@@ -1839,7 +1839,7 @@ void FormulaCompiler::CreateStringFromExternal(rtl::OUStringBuffer& /*rBuffer*/,
void FormulaCompiler::LocalizeString( String& /*rName*/ )
{
}
-void FormulaCompiler::PushTokenArray( FormulaTokenArray* pa, BOOL bTemp )
+void FormulaCompiler::PushTokenArray( FormulaTokenArray* pa, sal_Bool bTemp )
{
if ( bAutoCorrect && !pStack )
{ // #61426# don't merge stacked subroutine code into entered formula
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index f10ecf4eb022..3942712da6a4 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -62,19 +62,19 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ImpTokenIterator, 32, 16 )
// Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2)
// Need a lot of FormulaDoubleToken
-const USHORT nMemPoolDoubleToken = (0x3000 - 64) / sizeof(FormulaDoubleToken);
+const sal_uInt16 nMemPoolDoubleToken = (0x3000 - 64) / sizeof(FormulaDoubleToken);
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken, nMemPoolDoubleToken, nMemPoolDoubleToken )
// Need a lot of FormulaByteToken
-const USHORT nMemPoolByteToken = (0x3000 - 64) / sizeof(FormulaByteToken);
+const sal_uInt16 nMemPoolByteToken = (0x3000 - 64) / sizeof(FormulaByteToken);
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken, nMemPoolByteToken, nMemPoolByteToken )
// Need several FormulaStringToken
-const USHORT nMemPoolStringToken = (0x1000 - 64) / sizeof(FormulaStringToken);
+const sal_uInt16 nMemPoolStringToken = (0x1000 - 64) / sizeof(FormulaStringToken);
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken, nMemPoolStringToken, nMemPoolStringToken )
// --- helpers --------------------------------------------------------------
-inline BOOL lcl_IsReference( OpCode eOp, StackVar eType )
+inline sal_Bool lcl_IsReference( OpCode eOp, StackVar eType )
{
return
(eOp == ocPush && (eType == svSingleRef || eType == svDoubleRef))
@@ -89,12 +89,12 @@ FormulaToken::~FormulaToken()
{
}
-BOOL FormulaToken::Is3DRef() const
+sal_Bool FormulaToken::Is3DRef() const
{
- return FALSE;
+ return sal_False;
}
-BOOL FormulaToken::IsFunction() const
+sal_Bool FormulaToken::IsFunction() const
{
// OpCode eOp = GetOpCode();
return (eOp != ocPush && eOp != ocBad && eOp != ocColRowName &&
@@ -113,14 +113,14 @@ BOOL FormulaToken::IsFunction() const
}
-BYTE FormulaToken::GetParamCount() const
+sal_uInt8 FormulaToken::GetParamCount() const
{
// OpCode eOp = GetOpCode();
if ( eOp < SC_OPCODE_STOP_DIV && eOp != ocExternal && eOp != ocMacro &&
eOp != ocIf && eOp != ocChose && eOp != ocPercentSign )
return 0; // parameters and specials
// ocIf and ocChose not for FAP, have cByte then
-//2do: BOOL parameter whether FAP or not?
+//2do: sal_Bool parameter whether FAP or not?
else if ( GetByte() )
return GetByte(); // all functions, also ocExternal and ocMacro
else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_BIN_OP)
@@ -140,12 +140,12 @@ BYTE FormulaToken::GetParamCount() const
}
-BOOL FormulaToken::IsMatrixFunction() const
+sal_Bool FormulaToken::IsMatrixFunction() const
{
return formula::FormulaCompiler::IsMatrixFunction(GetOpCode());
}
-BOOL FormulaToken::operator==( const FormulaToken& rToken ) const
+sal_Bool FormulaToken::operator==( const FormulaToken& rToken ) const
{
// don't compare reference count!
return eType == rToken.eType && GetOpCode() == rToken.GetOpCode();
@@ -154,13 +154,13 @@ BOOL FormulaToken::operator==( const FormulaToken& rToken ) const
// --- virtual dummy methods -------------------------------------------------
-BYTE FormulaToken::GetByte() const
+sal_uInt8 FormulaToken::GetByte() const
{
// ok to be called for any derived class
return 0;
}
-void FormulaToken::SetByte( BYTE )
+void FormulaToken::SetByte( sal_uInt8 )
{
DBG_ERRORFILE( "FormulaToken::SetByte: virtual dummy called" );
}
@@ -196,13 +196,13 @@ const String& FormulaToken::GetString() const
return aDummyString;
}
-USHORT FormulaToken::GetIndex() const
+sal_uInt16 FormulaToken::GetIndex() const
{
DBG_ERRORFILE( "FormulaToken::GetIndex: virtual dummy called" );
return 0;
}
-void FormulaToken::SetIndex( USHORT )
+void FormulaToken::SetIndex( sal_uInt16 )
{
DBG_ERRORFILE( "FormulaToken::SetIndex: virtual dummy called" );
}
@@ -227,17 +227,17 @@ FormulaToken* FormulaToken::GetFAPOrigToken() const
return NULL;
}
-USHORT FormulaToken::GetError() const
+sal_uInt16 FormulaToken::GetError() const
{
DBG_ERRORFILE( "FormulaToken::GetError: virtual dummy called" );
return 0;
}
-void FormulaToken::SetError( USHORT )
+void FormulaToken::SetError( sal_uInt16 )
{
DBG_ERRORFILE( "FormulaToken::SetError: virtual dummy called" );
}
-BOOL FormulaToken::TextEqual( const FormulaToken& rToken ) const
+sal_Bool FormulaToken::TextEqual( const FormulaToken& rToken ) const
{
return *this == rToken;
}
@@ -246,11 +246,11 @@ BOOL FormulaToken::TextEqual( const FormulaToken& rToken ) const
// --------------------------------------------------------------------------
-BYTE FormulaByteToken::GetByte() const { return nByte; }
-void FormulaByteToken::SetByte( BYTE n ) { nByte = n; }
+sal_uInt8 FormulaByteToken::GetByte() const { return nByte; }
+void FormulaByteToken::SetByte( sal_uInt8 n ) { nByte = n; }
bool FormulaByteToken::HasForceArray() const { return bHasForceArray; }
void FormulaByteToken::SetForceArray( bool b ) { bHasForceArray = b; }
-BOOL FormulaByteToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaByteToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
bHasForceArray == r.HasForceArray();
@@ -258,12 +258,12 @@ BOOL FormulaByteToken::operator==( const FormulaToken& r ) const
FormulaToken* FormulaFAPToken::GetFAPOrigToken() const { return pOrigToken; }
-BOOL FormulaFAPToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaFAPToken::operator==( const FormulaToken& r ) const
{
return FormulaByteToken::operator==( r ) && pOrigToken == r.GetFAPOrigToken();
}
short* FormulaJumpToken::GetJump() const { return pJump; }
-BOOL FormulaJumpToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaJumpToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && pJump[0] == r.GetJump()[0] &&
memcmp( pJump+1, r.GetJump()+1, pJump[0] * sizeof(short) ) == 0;
@@ -298,9 +298,9 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter
// long is svIndex, used for name / database area, or "byte" for spaces
sal_Int32 nValue = _aToken.Data.get<sal_Int32>();
if ( eOpCode == ocName || eOpCode == ocDBArea )
- AddToken( formula::FormulaIndexToken( eOpCode, static_cast<USHORT>(nValue) ) );
+ AddToken( formula::FormulaIndexToken( eOpCode, static_cast<sal_uInt16>(nValue) ) );
else if ( eOpCode == ocSpaces )
- AddToken( formula::FormulaByteToken( ocSpaces, static_cast<BYTE>(nValue) ) );
+ AddToken( formula::FormulaByteToken( ocSpaces, static_cast<sal_uInt8>(nValue) ) );
else
bError = true;
}
@@ -493,7 +493,7 @@ void FormulaTokenArray::DelRPN()
if( nRPN )
{
FormulaToken** p = pRPN;
- for( USHORT i = 0; i < nRPN; i++ )
+ for( sal_uInt16 i = 0; i < nRPN; i++ )
{
(*p++)->DecRef();
}
@@ -503,7 +503,7 @@ void FormulaTokenArray::DelRPN()
nRPN = nIndex = 0;
}
-FormulaToken* FormulaTokenArray::PeekPrev( USHORT & nIdx )
+FormulaToken* FormulaTokenArray::PeekPrev( sal_uInt16 & nIdx )
{
if (0 < nIdx && nIdx <= nLen)
return pCode[--nIdx];
@@ -522,7 +522,7 @@ FormulaToken* FormulaTokenArray::PeekNextNoSpaces()
{
if( pCode && nIndex < nLen )
{
- USHORT j = nIndex;
+ sal_uInt16 j = nIndex;
while ( pCode[j]->GetOpCode() == ocSpaces && j < nLen )
j++;
if ( j < nLen )
@@ -538,7 +538,7 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces()
{
if( pCode && nIndex > 1 )
{
- USHORT j = nIndex - 2;
+ sal_uInt16 j = nIndex - 2;
while ( pCode[j]->GetOpCode() == ocSpaces && j > 0 )
j--;
if ( j > 0 || pCode[j]->GetOpCode() != ocSpaces )
@@ -550,34 +550,34 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces()
return NULL;
}
-BOOL FormulaTokenArray::HasOpCode( OpCode eOp ) const
+sal_Bool FormulaTokenArray::HasOpCode( OpCode eOp ) const
{
- for ( USHORT j=0; j < nLen; j++ )
+ for ( sal_uInt16 j=0; j < nLen; j++ )
{
if ( pCode[j]->GetOpCode() == eOp )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL FormulaTokenArray::HasOpCodeRPN( OpCode eOp ) const
+sal_Bool FormulaTokenArray::HasOpCodeRPN( OpCode eOp ) const
{
- for ( USHORT j=0; j < nRPN; j++ )
+ for ( sal_uInt16 j=0; j < nRPN; j++ )
{
if ( pRPN[j]->GetOpCode() == eOp )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL FormulaTokenArray::HasNameOrColRowName() const
+sal_Bool FormulaTokenArray::HasNameOrColRowName() const
{
- for ( USHORT j=0; j < nLen; j++ )
+ for ( sal_uInt16 j=0; j < nLen; j++ )
{
if( pCode[j]->GetType() == svIndex || pCode[j]->GetOpCode() == ocColRowName )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
////////////////////////////////////////////////////////////////////////////
@@ -586,7 +586,7 @@ FormulaTokenArray::FormulaTokenArray()
{
pCode = NULL; pRPN = NULL;
nError = nLen = nIndex = nRPN = nRefs = 0;
- bHyperLink = FALSE;
+ bHyperLink = sal_False;
ClearRecalcMode();
}
@@ -616,14 +616,14 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
{
pp = pCode = new FormulaToken*[ nLen ];
memcpy( pp, r.pCode, nLen * sizeof( FormulaToken* ) );
- for( USHORT i = 0; i < nLen; i++ )
+ for( sal_uInt16 i = 0; i < nLen; i++ )
(*pp++)->IncRef();
}
if( nRPN )
{
pp = pRPN = new FormulaToken*[ nRPN ];
memcpy( pp, r.pRPN, nRPN * sizeof( FormulaToken* ) );
- for( USHORT i = 0; i < nRPN; i++ )
+ for( sal_uInt16 i = 0; i < nRPN; i++ )
(*pp++)->IncRef();
}
}
@@ -649,7 +649,7 @@ FormulaTokenArray* FormulaTokenArray::Clone() const
{
pp = p->pCode = new FormulaToken*[ nLen ];
memcpy( pp, pCode, nLen * sizeof( FormulaToken* ) );
- for( USHORT i = 0; i < nLen; i++, pp++ )
+ for( sal_uInt16 i = 0; i < nLen; i++, pp++ )
{
*pp = (*pp)->Clone();
(*pp)->IncRef();
@@ -659,14 +659,14 @@ FormulaTokenArray* FormulaTokenArray::Clone() const
{
pp = p->pRPN = new FormulaToken*[ nRPN ];
memcpy( pp, pRPN, nRPN * sizeof( FormulaToken* ) );
- for( USHORT i = 0; i < nRPN; i++, pp++ )
+ for( sal_uInt16 i = 0; i < nRPN; i++, pp++ )
{
FormulaToken* t = *pp;
if( t->GetRef() > 1 )
{
FormulaToken** p2 = pCode;
- USHORT nIdx = 0xFFFF;
- for( USHORT j = 0; j < nLen; j++, p2++ )
+ sal_uInt16 nIdx = 0xFFFF;
+ for( sal_uInt16 j = 0; j < nLen; j++, p2++ )
{
if( *p2 == t )
{
@@ -692,7 +692,7 @@ void FormulaTokenArray::Clear()
if( pCode )
{
FormulaToken** p = pCode;
- for( USHORT i = 0; i < nLen; i++ )
+ for( sal_uInt16 i = 0; i < nLen; i++ )
{
(*p++)->DecRef();
}
@@ -700,7 +700,7 @@ void FormulaTokenArray::Clear()
}
pCode = NULL; pRPN = NULL;
nError = nLen = nIndex = nRPN = nRefs = 0;
- bHyperLink = FALSE;
+ bHyperLink = sal_False;
ClearRecalcMode();
}
@@ -758,7 +758,7 @@ FormulaToken* FormulaTokenArray::AddDouble( double fVal )
return Add( new FormulaDoubleToken( fVal ) );
}
-FormulaToken* FormulaTokenArray::AddName( USHORT n )
+FormulaToken* FormulaTokenArray::AddName( sal_uInt16 n )
{
return Add( new FormulaIndexToken( ocName, n ) );
}
@@ -802,7 +802,7 @@ void FormulaTokenArray::AddRecalcMode( ScRecalcMode nBits )
}
-BOOL FormulaTokenArray::HasMatrixDoubleRefOps()
+sal_Bool FormulaTokenArray::HasMatrixDoubleRefOps()
{
if ( pRPN && nRPN )
{
@@ -811,11 +811,11 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps()
FormulaToken** pStack = new FormulaToken* [nRPN];
FormulaToken* pResult = new FormulaDoubleToken( 0.0 );
short sp = 0;
- for ( USHORT j = 0; j < nRPN; j++ )
+ for ( sal_uInt16 j = 0; j < nRPN; j++ )
{
FormulaToken* t = pRPN[j];
OpCode eOp = t->GetOpCode();
- BYTE nParams = t->GetParamCount();
+ sal_uInt8 nParams = t->GetParamCount();
switch ( eOp )
{
case ocAdd :
@@ -832,13 +832,13 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps()
case ocLessEqual :
case ocGreaterEqual :
{
- for ( BYTE k = nParams; k; k-- )
+ for ( sal_uInt8 k = nParams; k; k-- )
{
if ( sp >= k && pStack[sp-k]->GetType() == svDoubleRef )
{
pResult->Delete();
delete [] pStack;
- return TRUE;
+ return sal_True;
}
}
}
@@ -870,7 +870,7 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps()
delete [] pStack;
}
- return FALSE;
+ return sal_False;
}
@@ -932,21 +932,21 @@ void FormulaMissingContext::AddMoreArgs( FormulaTokenArray *pNewArr, const Missi
if (mnCurArg == 2)
{
pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE()
+ pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=sal_True()
}
break;
case ocPoissonDist:
if (mnCurArg == 1)
{
pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=TRUE()
+ pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=sal_True()
}
break;
case ocNormDist:
if ( mnCurArg == 2 )
{
pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE()
+ pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=sal_True()
}
break;
case ocLogNormDist:
@@ -1086,7 +1086,7 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissingToPof( const MissingConvent
FormulaMissingContext aCtx[ nAlloc ];
int aOpCodeAddressStack[ nAlloc ]; // use of ADDRESS() function
const int nOmitAddressArg = 3; // ADDRESS() 4th parameter A1/R1C1
- USHORT nTokens = GetLen() + 1;
+ sal_uInt16 nTokens = GetLen() + 1;
FormulaMissingContext* pCtx = (nAlloc < nTokens ? new FormulaMissingContext[nTokens] : &aCtx[0]);
int* pOcas = (nAlloc < nTokens ? new int[nTokens] : &aOpCodeAddressStack[0]);
// Never go below 0, never use 0, mpFunc always NULL.
@@ -1168,7 +1168,7 @@ bool FormulaTokenArray::MayReferenceFollow()
if ( pCode && nLen > 0 )
{
// ignore trailing spaces
- USHORT i = nLen - 1;
+ sal_uInt16 i = nLen - 1;
while ( i > 0 && pCode[i]->GetOpCode() == SC_OPCODE_SPACES )
{
--i;
@@ -1209,7 +1209,7 @@ FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp )
}
break;
default:
- pRet = new FormulaByteToken( eOp, 0, FALSE );
+ pRet = new FormulaByteToken( eOp, 0, sal_False );
break;
}
return AddToken( *pRet );
@@ -1297,7 +1297,7 @@ void FormulaTokenIterator::Jump( short nStart, short nNext, short nStop )
bool FormulaTokenIterator::IsEndOfPath() const
{
- USHORT nTest = pCur->nPC + 1;
+ sal_uInt16 nTest = pCur->nPC + 1;
if( nTest < pCur->pArr->nRPN && nTest < pCur->nStop )
{
const FormulaToken* t = pCur->pArr->pRPN[ nTest ];
@@ -1313,44 +1313,44 @@ bool FormulaTokenIterator::IsEndOfPath() const
double FormulaDoubleToken::GetDouble() const { return fDouble; }
double & FormulaDoubleToken::GetDoubleAsReference() { return fDouble; }
-BOOL FormulaDoubleToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaDoubleToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && fDouble == r.GetDouble();
}
const String& FormulaStringToken::GetString() const { return aString; }
-BOOL FormulaStringToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaStringToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && aString == r.GetString();
}
const String& FormulaStringOpToken::GetString() const { return aString; }
-BOOL FormulaStringOpToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaStringOpToken::operator==( const FormulaToken& r ) const
{
return FormulaByteToken::operator==( r ) && aString == r.GetString();
}
-USHORT FormulaIndexToken::GetIndex() const { return nIndex; }
-void FormulaIndexToken::SetIndex( USHORT n ) { nIndex = n; }
-BOOL FormulaIndexToken::operator==( const FormulaToken& r ) const
+sal_uInt16 FormulaIndexToken::GetIndex() const { return nIndex; }
+void FormulaIndexToken::SetIndex( sal_uInt16 n ) { nIndex = n; }
+sal_Bool FormulaIndexToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nIndex == r.GetIndex();
}
const String& FormulaExternalToken::GetExternal() const { return aExternal; }
-BYTE FormulaExternalToken::GetByte() const { return nByte; }
-void FormulaExternalToken::SetByte( BYTE n ) { nByte = n; }
-BOOL FormulaExternalToken::operator==( const FormulaToken& r ) const
+sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; }
+void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; }
+sal_Bool FormulaExternalToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
aExternal == r.GetExternal();
}
-USHORT FormulaErrorToken::GetError() const { return nError; }
-void FormulaErrorToken::SetError( USHORT nErr ) { nError = nErr; }
-BOOL FormulaErrorToken::operator==( const FormulaToken& r ) const
+sal_uInt16 FormulaErrorToken::GetError() const { return nError; }
+void FormulaErrorToken::SetError( sal_uInt16 nErr ) { nError = nErr; }
+sal_Bool FormulaErrorToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) &&
nError == static_cast< const FormulaErrorToken & >(r).GetError();
@@ -1361,13 +1361,13 @@ const String& FormulaMissingToken::GetString() const
static String aDummyString;
return aDummyString;
}
-BOOL FormulaMissingToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaMissingToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r );
}
-BOOL FormulaUnknownToken::operator==( const FormulaToken& r ) const
+sal_Bool FormulaUnknownToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r );
}
diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx
index 28523a24eb92..51edbd91a097 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -58,7 +58,7 @@ private:
MultiLineEdit* pMEdit;
Link aSelChangedLink;
Selection aOldSel;
- BOOL bMouseFlag;
+ sal_Bool bMouseFlag;
DECL_LINK( ChangedHdl, EditBox* );
protected:
@@ -93,7 +93,7 @@ public:
ArgEdit( Window* pParent, const ResId& rResId );
void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
- ScrollBar& rArgSlider, USHORT nArgCount );
+ ScrollBar& rArgSlider, sal_uInt16 nArgCount );
protected:
virtual void KeyInput( const KeyEvent& rKEvt );
@@ -102,7 +102,7 @@ private:
ArgEdit* pEdPrev;
ArgEdit* pEdNext;
ScrollBar* pSlider;
- USHORT nArgs;
+ sal_uInt16 nArgs;
};
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index 1d71b40919eb..88c43f0daee0 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -47,7 +47,7 @@ namespace formula
virtual ::rtl::OUString getDescription() const { return ::rtl::OUString(); }
virtual xub_StrLen getSuppressedArgumentCount() const { return 0; }
virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& ) const { return ::rtl::OUString(); }
- virtual void fillVisibleArgumentMapping(::std::vector<USHORT>& ) const {}
+ virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& ) const {}
virtual void initArgumentInfo() const {}
virtual ::rtl::OUString getSignature() const { return ::rtl::OUString(); }
virtual rtl::OString getHelpId() const { return ""; }
@@ -74,14 +74,14 @@ FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager)
{
m_pCharClass = m_pSysLocale->GetCharClassPtr();
}
-BOOL FormulaHelper::GetNextFunc( const String& rFormula,
- BOOL bBack,
+sal_Bool FormulaHelper::GetNextFunc( const String& rFormula,
+ sal_Bool bBack,
xub_StrLen& rFStart, // Ein- und Ausgabe
xub_StrLen* pFEnd, // = NULL
const IFunctionDescription** ppFDesc, // = NULL
::std::vector< ::rtl::OUString>* pArgs ) const // = NULL
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
xub_StrLen nOldStart = rFStart;
String aFname;
@@ -114,7 +114,7 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula,
}
if ( *ppFDesc && pArgs )
{
- GetArgStrings( *pArgs,rFormula, rFStart, static_cast<USHORT>((*ppFDesc)->getParameterCount() ));
+ GetArgStrings( *pArgs,rFormula, rFStart, static_cast<sal_uInt16>((*ppFDesc)->getParameterCount() ));
}
else
{
@@ -133,13 +133,13 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula,
void FormulaHelper::FillArgStrings( const String& rFormula,
xub_StrLen nFuncPos,
- USHORT nArgs,
+ sal_uInt16 nArgs,
::std::vector< ::rtl::OUString >& _rArgs ) const
{
xub_StrLen nStart = 0;
xub_StrLen nEnd = 0;
- USHORT i;
- BOOL bLast = FALSE;
+ sal_uInt16 i;
+ sal_Bool bLast = sal_False;
for ( i=0; i<nArgs && !bLast; i++ )
{
@@ -152,7 +152,7 @@ void FormulaHelper::FillArgStrings( const String& rFormula,
if ( nEnd != nStart )
_rArgs.push_back(rFormula.Copy( nStart, nEnd-1-nStart ));
else
- _rArgs.push_back(String()), bLast = TRUE;
+ _rArgs.push_back(String()), bLast = sal_True;
}
else
{
@@ -174,7 +174,7 @@ void FormulaHelper::FillArgStrings( const String& rFormula,
void FormulaHelper::GetArgStrings( ::std::vector< ::rtl::OUString >& _rArgs
,const String& rFormula,
xub_StrLen nFuncPos,
- USHORT nArgs ) const
+ sal_uInt16 nArgs ) const
{
if (nArgs)
{
@@ -184,10 +184,10 @@ void FormulaHelper::GetArgStrings( ::std::vector< ::rtl::OUString >& _rArgs
//------------------------------------------------------------------------
-inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_StrLen nPos )
+inline sal_Bool IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_StrLen nPos )
{
if( _pCharClass->isLetterNumeric( rStr, nPos ) )
- return TRUE;
+ return sal_True;
else
{ // In internationalized versions function names may contain a dot
// and in every version also an underscore... ;-)
@@ -199,7 +199,7 @@ inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_
xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula,
xub_StrLen nStart,
- BOOL bBack,
+ sal_Bool bBack,
String* pFuncName ) const
{
xub_StrLen nStrLen = rFormula.Len();
@@ -210,11 +210,11 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula,
xub_StrLen nFStart = FUNC_NOTFOUND;
xub_StrLen nParPos = nStart;
- BOOL bRepeat, bFound;
+ sal_Bool bRepeat, bFound;
do
{
- bFound = FALSE;
- bRepeat = FALSE;
+ bFound = sal_False;
+ bRepeat = sal_False;
if ( bBack )
{
@@ -228,7 +228,7 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula,
if (nParPos > 0)
nParPos--;
}
- else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == FALSE )
+ else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == sal_False )
nParPos--;
}
}
@@ -243,7 +243,7 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula,
nParPos++;
nParPos++;
}
- else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == FALSE )
+ else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == sal_False )
nParPos++;
}
}
@@ -268,13 +268,13 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula,
}
else // Klammern ohne Funktion -> weitersuchen
{
- bRepeat = TRUE;
+ bRepeat = sal_True;
if ( !bBack )
nParPos++;
else if (nParPos > 0)
nParPos--;
else
- bRepeat = FALSE;
+ bRepeat = sal_False;
}
}
else // keine Klammern gefunden
@@ -300,7 +300,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart
short nParCount = 0;
bool bInArray = false;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
while ( !bFound && (nStart < nStrLen) )
{
@@ -318,10 +318,10 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart
{
nParCount--;
if ( nParCount == 0 )
- bFound = TRUE;
+ bFound = sal_True;
else if ( nParCount < 0 )
{
- bFound = TRUE;
+ bFound = sal_True;
nStart--; // einen zu weit gelesen
}
}
@@ -337,7 +337,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart
{
if ( !bInArray && nParCount == 0 )
{
- bFound = TRUE;
+ bFound = sal_True;
nStart--; // einen zu weit gelesen
}
}
@@ -349,7 +349,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart
//------------------------------------------------------------------
-xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, USHORT nArg ) const
+xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, sal_uInt16 nArg ) const
{
xub_StrLen nStrLen = rStr.Len();
@@ -358,7 +358,7 @@ xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, US
short nParCount = 0;
bool bInArray = false;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
while ( !bFound && (nStart < nStrLen) )
{
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 0a971e94e5b6..d782f0ee8dcd 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -99,9 +99,9 @@ namespace formula
::std::pair<RefButton*,RefEdit*>
RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton );
- void RefInputDoneAfter( BOOL bForced );
- BOOL CalcValue( const String& rStrExp, String& rStrResult );
- BOOL CalcStruct( const String& rStrExp);
+ void RefInputDoneAfter( sal_Bool bForced );
+ sal_Bool CalcValue( const String& rStrExp, String& rStrResult );
+ sal_Bool CalcStruct( const String& rStrExp);
void UpdateValues();
void DeleteArgs();
xub_StrLen GetFunctionPos(xub_StrLen nPos);
@@ -111,32 +111,32 @@ namespace formula
void fillTree(IStructHelper* _pTree);
void UpdateTokenArray( const String& rStrExp);
String RepairFormula(const String& aFormula);
- void FillDialog(BOOL nFlag=TRUE);
- void EditNextFunc( BOOL bForward, xub_StrLen nFStart=NOT_FOUND );
+ void FillDialog(sal_Bool nFlag=sal_True);
+ void EditNextFunc( sal_Bool bForward, xub_StrLen nFStart=NOT_FOUND );
void EditThisFunc(xub_StrLen nFStart);
void EditFuncParas(xub_StrLen nEditPos);
- void UpdateArgInput( USHORT nOffset, USHORT nInput );
+ void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 nInput );
void Update();
void Update(const String& _sExp);
- void SaveArg( USHORT nEd );
+ void SaveArg( sal_uInt16 nEd );
void UpdateSelection();
- void DoEnter( BOOL bOk );
+ void DoEnter( sal_Bool bOk );
void UpdateFunctionDesc();
void ResizeArgArr( const IFunctionDescription* pNewFunc );
void FillListboxes();
- void FillControls(BOOL &rbNext, BOOL &rbPrev);
+ void FillControls(sal_Bool &rbNext, sal_Bool &rbPrev);
- FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate);
+ FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
void SetMeText(const String& _sText);
- BOOL CheckMatrix(String& aFormula /*IN/OUT*/);
+ sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
void SetEdSelection();
- BOOL UpdateParaWin(Selection& _rSelection);
+ sal_Bool UpdateParaWin(Selection& _rSelection);
void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr);
void SetData(xub_StrLen nFStart,xub_StrLen nNextFStart,xub_StrLen nNextFEnd,xub_StrLen& PrivStart,xub_StrLen& PrivEnd);
@@ -214,9 +214,9 @@ namespace formula
FuncPage* pFuncPage;
StructPage* pStructPage;
String aOldFormula;
- BOOL bStructUpdate;
+ sal_Bool bStructUpdate;
MultiLineEdit* pMEdit;
- BOOL bUserMatrixFlag;
+ sal_Bool bUserMatrixFlag;
Timer aTimer;
const String aTitle1;
@@ -231,15 +231,15 @@ namespace formula
rtl::OString aOldHelp;
rtl::OString aOldUnique;
rtl::OString aActivWinId;
- BOOL bIsShutDown;
+ sal_Bool bIsShutDown;
Font aFntBold;
Font aFntLight;
- USHORT nEdFocus;
+ sal_uInt16 nEdFocus;
// Selection theCurSel;
- BOOL bEditFlag;
+ sal_Bool bEditFlag;
const IFunctionDescription* pFuncDesc;
xub_StrLen nArgs;
::std::vector< ::rtl::OUString > m_aArguments;
@@ -292,7 +292,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
//
pTheRefEdit (NULL),
pMEdit (NULL),
- bUserMatrixFlag (FALSE),
+ bUserMatrixFlag (sal_False),
//
aTitle1 ( ModuleRes( STR_TITLE1 ) ), // lokale Resource
aTitle2 ( ModuleRes( STR_TITLE2 ) ), // lokale Resource
@@ -300,7 +300,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
aTxtOk ( aBtnEnd.GetText() ),
m_aFormulaHelper(_pFunctionMgr),
//
- bIsShutDown (FALSE),
+ bIsShutDown (sal_False),
nEdFocus (0),
pFuncDesc (NULL),
nArgs (0)
@@ -313,11 +313,16 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
aRefBtn.Hide();
pMEdit = aMEFormula.GetEdit();
+ //IAccessibility2 Implementation 2009-----
+ aMEFormula.SetAccessibleName(aFtFormula.GetText());
+ if (pMEdit)
+ pMEdit->SetAccessibleName(aFtFormula.GetText());
+ //-----IAccessibility2 Implementation 2009
m_aEditHelpId = pMEdit->GetHelpId();
pMEdit->SetUniqueId( m_aEditHelpId );
- bEditFlag=FALSE;
- bStructUpdate=TRUE;
+ bEditFlag=sal_False;
+ bStructUpdate=sal_True;
Point aPos=aGEdit.GetPosPixel();
pParaWin->SetPosPixel(aPos);
pParaWin->SetArgModifiedHdl(LINK( this, FormulaDlg_Impl, ModifyHdl ) );
@@ -356,7 +361,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
aMEFormula.SetSelChangedHdl( LINK( this, FormulaDlg_Impl, FormulaCursorHdl ) );
aFntLight = aFtFormula.GetFont();
- aFntLight.SetTransparent( TRUE );
+ aFntLight.SetTransparent( sal_True );
aFntBold = aFntLight;
aFntBold.SetWeight( WEIGHT_BOLD );
@@ -375,7 +380,7 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
aTimer.SetTimeoutHdl(Link());
aTimer.Stop();
} // if(aTimer.IsActive())
- bIsShutDown=TRUE;// Setzen, damit PreNotify keinen GetFocus speichert.
+ bIsShutDown=sal_True;// Setzen, damit PreNotify keinen GetFocus speichert.
FormEditData* pData = m_pHelper->getFormEditData();
if (pData) // wird nicht ueber Close zerstoert;
{
@@ -383,9 +388,9 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
pData->SetSelection(pMEdit->GetSelection());
if(aTabCtrl.GetCurPageId()==TP_FUNCTION)
- pData->SetMode( (USHORT) FORMULA_FORMDLG_FORMULA );
+ pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_FORMULA );
else
- pData->SetMode( (USHORT) FORMULA_FORMDLG_EDIT );
+ pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_EDIT );
pData->SetUndoStr(pMEdit->GetText());
pData->SetMatrixFlag(aBtnMatrix.IsChecked());
}
@@ -401,7 +406,7 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
// -----------------------------------------------------------------------------
void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt )
{
- USHORT nSwitch=rNEvt.GetType();
+ sal_uInt16 nSwitch=rNEvt.GetType();
if(nSwitch==EVENT_GETFOCUS && !bIsShutDown)
{
Window* pWin=rNEvt.GetWindow();
@@ -485,7 +490,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
xub_StrLen nFuncPos=STRING_NOTFOUND; //@ Testweise
xub_StrLen nPrevFuncPos=1;
short nBracketCount=0;
- BOOL bFlag=FALSE;
+ sal_Bool bFlag=sal_False;
String aFormString = pMEdit->GetText();
m_aFormulaHelper.GetCharClass()->toUpper( aFormString );
@@ -543,12 +548,12 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
if ( eOp == m_aSeparatorsOpCodes[TOKEN_OPEN].OpCode )
{
nBracketCount++;
- bFlag=TRUE;
+ bFlag=sal_True;
}
else if ( eOp == m_aSeparatorsOpCodes[TOKEN_CLOSE].OpCode )
{
nBracketCount--;
- bFlag=FALSE;
+ bFlag=sal_False;
nFuncPos=nPrevFuncPos;
}
bool bIsFunction = ::std::find_if(m_aFunctionOpCodes.getConstArray(),m_pFunctionOpCodesEnd,::std::bind2nd(OpCodeCompare(),boost::cref(eOp))) != m_pFunctionOpCodesEnd;
@@ -588,9 +593,9 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
return nFuncPos;
}
// -----------------------------------------------------------------------------
-BOOL FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult )
+sal_Bool FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult )
{
- BOOL bResult = TRUE;
+ sal_Bool bResult = sal_True;
if ( rStrExp.Len() > 0 )
{
@@ -601,7 +606,7 @@ BOOL FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult )
bResult = m_pHelper->calculateValue(rStrExp,rStrResult);
}
else
- bResult = FALSE;
+ bResult = sal_False;
}
return bResult;
@@ -625,9 +630,9 @@ void FormulaDlg_Impl::UpdateValues()
CalcStruct(pMEdit->GetText());
}
-BOOL FormulaDlg_Impl::CalcStruct( const String& rStrExp)
+sal_Bool FormulaDlg_Impl::CalcStruct( const String& rStrExp)
{
- BOOL bResult = TRUE;
+ sal_Bool bResult = sal_True;
xub_StrLen nLength=rStrExp.Len();
if ( rStrExp.Len() > 0 && aOldFormula!=rStrExp && bStructUpdate)
@@ -658,7 +663,7 @@ BOOL FormulaDlg_Impl::CalcStruct( const String& rStrExp)
UpdateTokenArray(rStrExp);
}
else
- bResult = FALSE;
+ bResult = sal_False;
}
return bResult;
}
@@ -766,13 +771,13 @@ void FormulaDlg_Impl::UpdateTokenArray( const String& rStrExp)
} // if ( pTokens && nLen == m_aTokenList.getLength() )
FormulaCompiler aCompiler(*m_pTokenArray.get());
- aCompiler.SetCompileForFAP(TRUE); // #i101512# special handling is needed
+ aCompiler.SetCompileForFAP(sal_True); // #i101512# special handling is needed
aCompiler.CompileTokenArray();
}
-void FormulaDlg_Impl::FillDialog(BOOL nFlag)
+void FormulaDlg_Impl::FillDialog(sal_Bool nFlag)
{
- BOOL bNext=TRUE, bPrev=TRUE;
+ sal_Bool bNext=sal_True, bPrev=sal_True;
if(nFlag)
FillControls(bNext, bPrev);
FillListboxes();
@@ -803,9 +808,9 @@ void FormulaDlg_Impl::FillListboxes()
if ( pFuncDesc && pFuncDesc->getCategory() )
{
if( pFuncPage->GetCategory() != pFuncDesc->getCategory()->getNumber() + 1 )
- pFuncPage->SetCategory(static_cast<USHORT>(pFuncDesc->getCategory()->getNumber() + 1));
+ pFuncPage->SetCategory(static_cast<sal_uInt16>(pFuncDesc->getCategory()->getNumber() + 1));
- USHORT nPos=pFuncPage->GetFuncPos(pFuncDesc);
+ sal_uInt16 nPos=pFuncPage->GetFuncPos(pFuncDesc);
pFuncPage->SetFunction(nPos);
}
@@ -819,7 +824,7 @@ void FormulaDlg_Impl::FillListboxes()
// ResizeArgArr jetzt schon in UpdateFunctionDesc
- m_pHelper->setDispatcherLock( TRUE);// Modal-Modus einschalten
+ m_pHelper->setDispatcherLock( sal_True);// Modal-Modus einschalten
aNewTitle = aTitle1;
@@ -828,7 +833,7 @@ void FormulaDlg_Impl::FillListboxes()
m_pParent->SetUniqueId( aOldUnique );
}
// -----------------------------------------------------------------------------
-void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev)
+void FormulaDlg_Impl::FillControls(sal_Bool &rbNext, sal_Bool &rbPrev)
{
// Umschalten zwischen den "Seiten"
FormEditData* pData = m_pHelper->getFormEditData();
@@ -846,9 +851,9 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev)
aFormula.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " )" ));
DeleteArgs();
const IFunctionDescription* pOldFuncDesc = pFuncDesc;
- BOOL bTestFlag = FALSE;
+ sal_Bool bTestFlag = sal_False;
- if ( m_aFormulaHelper.GetNextFunc( aFormula, FALSE,
+ if ( m_aFormulaHelper.GetNextFunc( aFormula, sal_False,
nNextFStart, &nNextFEnd, &pFuncDesc, &m_aArguments ) )
{
bTestFlag = (pOldFuncDesc != pFuncDesc);
@@ -883,26 +888,26 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev)
pMEdit->SetSelection( Selection(PrivStart, PrivEnd));
nArgs = pFuncDesc->getSuppressedArgumentCount();
- USHORT nOffset = pData->GetOffset();
+ sal_uInt16 nOffset = pData->GetOffset();
nEdFocus = pData->GetEdFocus();
// Verkettung der Edit's fuer Focus-Kontrolle
if(bTestFlag)
pParaWin->SetArgumentOffset(nOffset);
- USHORT nActiv=0;
+ sal_uInt16 nActiv=0;
xub_StrLen nArgPos= m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 );
xub_StrLen nEditPos=(xub_StrLen) pMEdit->GetSelection().Min();
- BOOL bFlag=FALSE;
+ sal_Bool bFlag=sal_False;
- for(USHORT i=0;i<nArgs;i++)
+ for(sal_uInt16 i=0;i<nArgs;i++)
{
sal_Int32 nLength = m_aArguments[i].getLength()+1;
pParaWin->SetArgument(i,m_aArguments[i]);
if(nArgPos<=nEditPos && nEditPos<nArgPos+nLength)
{
nActiv=i;
- bFlag=TRUE;
+ bFlag=sal_True;
}
nArgPos = sal::static_int_cast<xub_StrLen>( nArgPos + nLength );
}
@@ -924,10 +929,10 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev)
// Test, ob vorne/hinten noch mehr Funktionen sind
xub_StrLen nTempStart = m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 );
- rbNext = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nTempStart );
+ rbNext = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nTempStart );
nTempStart=(xub_StrLen)pMEdit->GetSelection().Min();
pData->SetFStart(nTempStart);
- rbPrev = m_aFormulaHelper.GetNextFunc( aFormula, TRUE, nTempStart );
+ rbPrev = m_aFormulaHelper.GetNextFunc( aFormula, sal_True, nTempStart );
}
// -----------------------------------------------------------------------------
@@ -945,7 +950,7 @@ void FormulaDlg_Impl::ClearAllParas()
aFtEditName.Hide();
pParaWin->Hide();
- aBtnForward.Enable(TRUE); //@new
+ aBtnForward.Enable(sal_True); //@new
aFtHeadLine.Show();
aFtFuncName.Show();
aFtFuncDesc.Show();
@@ -976,7 +981,7 @@ String FormulaDlg_Impl::RepairFormula(const String& aFormula)
return aResult;
}
-void FormulaDlg_Impl::DoEnter(BOOL bOk)
+void FormulaDlg_Impl::DoEnter(sal_Bool bOk)
{
// Eingabe ins Dokument uebernehmen oder abbrechen
if ( bOk)
@@ -1003,11 +1008,11 @@ IMPL_LINK( FormulaDlg_Impl, BtnHdl, PushButton*, pBtn )
{
if ( pBtn == &aBtnCancel )
{
- DoEnter(FALSE); // schliesst den Dialog
+ DoEnter(sal_False); // schliesst den Dialog
}
else if ( pBtn == &aBtnEnd )
{
- DoEnter(TRUE); // schliesst den Dialog
+ DoEnter(sal_True); // schliesst den Dialog
}
else if ( pBtn == &aBtnForward )
{
@@ -1015,19 +1020,19 @@ IMPL_LINK( FormulaDlg_Impl, BtnHdl, PushButton*, pBtn )
const IFunctionDescription* pDesc =pFuncPage->GetFuncDesc( pFuncPage->GetFunction() );
if(pDesc==pFuncDesc || !pFuncPage->IsVisible())
- EditNextFunc( TRUE );
+ EditNextFunc( sal_True );
else
{
DblClkHdl(pFuncPage); //new
- aBtnForward.Enable(FALSE); //new
+ aBtnForward.Enable(sal_False); //new
}
- //@EditNextFunc( TRUE );
+ //@EditNextFunc( sal_True );
}
else if ( pBtn == &aBtnBackward )
{
- bEditFlag=FALSE;
- aBtnForward.Enable(TRUE);
- EditNextFunc( FALSE );
+ bEditFlag=sal_False;
+ aBtnForward.Enable(sal_True);
+ EditNextFunc( sal_False );
aMEFormula.Invalidate();
aMEFormula.Update();
}
@@ -1061,11 +1066,11 @@ void FormulaDlg_Impl::UpdateFunctionDesc()
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData)
return;
- USHORT nCat = pFuncPage->GetCategory();
+ sal_uInt16 nCat = pFuncPage->GetCategory();
if ( nCat == LISTBOX_ENTRY_NOTFOUND )
nCat = 0;
pData->SetCatSel( nCat );
- USHORT nFunc = pFuncPage->GetFunction();
+ sal_uInt16 nFunc = pFuncPage->GetFunction();
if ( nFunc == LISTBOX_ENTRY_NOTFOUND )
nFunc = 0;
pData->SetFuncSel( nFunc );
@@ -1104,7 +1109,7 @@ void FormulaDlg_Impl::UpdateFunctionDesc()
IMPL_LINK( FormulaDlg_Impl, DblClkHdl, FuncPage*, EMPTYARG )
{
- USHORT nFunc = pFuncPage->GetFunction();
+ sal_uInt16 nFunc = pFuncPage->GetFunction();
// ex-UpdateLRUList
const IFunctionDescription* pDesc = pFuncPage->GetFuncDesc(nFunc);
@@ -1130,7 +1135,7 @@ IMPL_LINK( FormulaDlg_Impl, DblClkHdl, FuncPage*, EMPTYARG )
}
pParaWin->SetEdFocus(0);
- aBtnForward.Enable(FALSE); //@New
+ aBtnForward.Enable(sal_False); //@New
return 0;
}
@@ -1184,11 +1189,11 @@ void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart)
xub_StrLen nNextFStart = nFStart;
xub_StrLen nNextFEnd = 0;
- BOOL bFound;
+ sal_Bool bFound;
- //@bFound = m_pHelper->getNextFunction( aFormula, FALSE, nNextFStart, &nNextFEnd, &pFuncDesc );
+ //@bFound = m_pHelper->getNextFunction( aFormula, sal_False, nNextFStart, &nNextFEnd, &pFuncDesc );
- bFound = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd);
+ bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd);
if ( bFound )
{
xub_StrLen PrivStart, PrivEnd;
@@ -1201,7 +1206,7 @@ void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart)
}
}
-void FormulaDlg_Impl::EditNextFunc( BOOL bForward, xub_StrLen nFStart )
+void FormulaDlg_Impl::EditNextFunc( sal_Bool bForward, xub_StrLen nFStart )
{
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData)
@@ -1221,18 +1226,18 @@ void FormulaDlg_Impl::EditNextFunc( BOOL bForward, xub_StrLen nFStart )
xub_StrLen nNextFStart = 0;
xub_StrLen nNextFEnd = 0;
- BOOL bFound;
+ sal_Bool bFound;
if ( bForward )
{
nNextFStart = m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 );
- //@bFound = m_pHelper->getNextFunction( aFormula, FALSE, nNextFStart, &nNextFEnd, &pFuncDesc );
- bFound = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd);
+ //@bFound = m_pHelper->getNextFunction( aFormula, sal_False, nNextFStart, &nNextFEnd, &pFuncDesc );
+ bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd);
}
else
{
nNextFStart = nFStart;
- //@bFound = m_pHelper->getNextFunction( aFormula, TRUE, nNextFStart, &nNextFEnd, &pFuncDesc );
- bFound = m_aFormulaHelper.GetNextFunc( aFormula, TRUE, nNextFStart, &nNextFEnd);
+ //@bFound = m_pHelper->getNextFunction( aFormula, sal_True, nNextFStart, &nNextFEnd, &pFuncDesc );
+ bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_True, nNextFStart, &nNextFEnd);
}
if ( bFound )
@@ -1261,18 +1266,18 @@ void FormulaDlg_Impl::EditFuncParas(xub_StrLen nEditPos)
m_aFormulaHelper.GetArgStrings(m_aArguments,aFormula, nFStart, nArgs );
// m_aArguments = ScFormulaUtil::GetArgStrings( aFormula, nFStart, nArgs );
- USHORT nActiv=pParaWin->GetSliderPos();
- BOOL bFlag=FALSE;
+ sal_uInt16 nActiv=pParaWin->GetSliderPos();
+ sal_Bool bFlag=sal_False;
::std::vector< ::rtl::OUString >::iterator aIter = m_aArguments.begin();
::std::vector< ::rtl::OUString >::iterator aEnd = m_aArguments.end();
- for(USHORT i=0;aIter != aEnd;i++,++aIter)
+ for(sal_uInt16 i=0;aIter != aEnd;i++,++aIter)
{
sal_Int32 nLength=(*aIter).getLength();
pParaWin->SetArgument(i,(*aIter));
if(nArgPos<=nEditPos && nEditPos<nArgPos+nLength)
{
nActiv=i;
- bFlag=TRUE;
+ bFlag=sal_True;
}
nArgPos+=nLength+1;
}
@@ -1288,11 +1293,11 @@ void FormulaDlg_Impl::EditFuncParas(xub_StrLen nEditPos)
}
-void FormulaDlg_Impl::SaveArg( USHORT nEd )
+void FormulaDlg_Impl::SaveArg( sal_uInt16 nEd )
{
if (nEd<nArgs)
{
- USHORT i;
+ sal_uInt16 i;
for(i=0;i<=nEd;i++)
{
if ( m_aArguments[i].getLength() == 0 )
@@ -1301,7 +1306,7 @@ void FormulaDlg_Impl::SaveArg( USHORT nEd )
if(pParaWin->GetArgument(nEd).Len()!=0)
m_aArguments[nEd] = pParaWin->GetArgument(nEd);
- USHORT nClearPos=nEd+1;
+ sal_uInt16 nClearPos=nEd+1;
for(i=nEd+1;i<nArgs;i++)
{
if(pParaWin->GetArgument(i).Len()!=0)
@@ -1321,14 +1326,14 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr )
{
if(pPtr==pParaWin)
{
- aBtnForward.Enable(TRUE); //@ Damit eine neue Fkt eingegeben werden kann.
+ aBtnForward.Enable(sal_True); //@ Damit eine neue Fkt eingegeben werden kann.
aTabCtrl.SetCurPageId(TP_FUNCTION);
String aUndoStr = m_pHelper->getCurrentFormula(); // bevor unten ein ";" eingefuegt wird
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData) return 0;
- USHORT nArgNo = pParaWin->GetActiveLine();
+ sal_uInt16 nArgNo = pParaWin->GetActiveLine();
nEdFocus=nArgNo;
SaveArg(nArgNo);
@@ -1341,12 +1346,12 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr )
pData->SetEdFocus( nEdFocus );
pData->SaveValues();
- pData->SetMode( (USHORT) FORMULA_FORMDLG_FORMULA );
+ pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_FORMULA );
pData->SetFStart( n1 );
pData->SetUndoStr( aUndoStr );
ClearAllParas();
- FillDialog(FALSE);
+ FillDialog(sal_False);
pFuncPage->SetFocus(); //Da Parawin nicht mehr sichtbar
}
return 0;
@@ -1371,7 +1376,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG )
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData) return 0;
- bEditFlag=TRUE;
+ bEditFlag=sal_True;
String aInputFormula=m_pHelper->getCurrentFormula();
String aString=pMEdit->GetText();
@@ -1418,7 +1423,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG )
if(nPos<aSel.Min()-1)
{
xub_StrLen nPos1=aString.Search('(',nPos);
- EditNextFunc( FALSE, nPos1);
+ EditNextFunc( sal_False, nPos1);
}
else
{
@@ -1426,7 +1431,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG )
}
m_pHelper->setSelection((xub_StrLen)aSel.Min(),(xub_StrLen)aSel.Max());
- bEditFlag=FALSE;
+ bEditFlag=sal_False;
return 0;
}
@@ -1436,7 +1441,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG )
if (!pData) return 0;
xub_StrLen nFStart = pData->GetFStart();
- bEditFlag=TRUE;
+ bEditFlag=sal_True;
String aInputFormula=m_pHelper->getCurrentFormula();
String aString=pMEdit->GetText();
@@ -1479,7 +1484,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG )
}
if(nCount==0)
{
- nFStart=m_aFormulaHelper.GetFunctionStart(aString,n,TRUE);
+ nFStart=m_aFormulaHelper.GetFunctionStart(aString,n,sal_True);
EditThisFunc(nFStart);
}
else
@@ -1495,7 +1500,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG )
}
m_pHelper->setSelection((xub_StrLen)aSel.Min(),(xub_StrLen)aSel.Max());
- bEditFlag=FALSE;
+ bEditFlag=sal_False;
return 0;
}
@@ -1514,16 +1519,16 @@ void FormulaDlg_Impl::UpdateSelection()
String aFormula=pMEdit->GetText();
sal_Int32 nArgPos=m_aFormulaHelper.GetArgStart( aFormula,PrivStart,0);
- USHORT nPos=pParaWin->GetActiveLine();
+ sal_uInt16 nPos=pParaWin->GetActiveLine();
- for(USHORT i=0;i<nPos;i++)
+ for(sal_uInt16 i=0;i<nPos;i++)
{
nArgPos += (m_aArguments[i].getLength() + 1);
}
sal_Int32 nLength= m_aArguments[nPos].getLength();
Selection aSel(nArgPos,nArgPos+nLength);
- m_pHelper->setSelection((USHORT)nArgPos,(USHORT)(nArgPos+nLength));
+ m_pHelper->setSelection((sal_uInt16)nArgPos,(sal_uInt16)(nArgPos+nLength));
pMEdit->SetSelection(aSel);
aMEFormula.UpdateOldSel();
}
@@ -1569,7 +1574,7 @@ void FormulaDlg_Impl::RefInputStartAfter( RefEdit* /*pEdit*/, RefButton* /*pButt
m_pParent->SetText( MnemonicGenerator::EraseAllMnemonicChars( aStr ) );
}
}
-void FormulaDlg_Impl::RefInputDoneAfter( BOOL bForced )
+void FormulaDlg_Impl::RefInputDoneAfter( sal_Bool bForced )
{
aRefBtn.SetStartImage();
if( bForced || !aRefBtn.IsVisible() )
@@ -1584,7 +1589,7 @@ void FormulaDlg_Impl::RefInputDoneAfter( BOOL bForced )
if( pTheRefButton )
pTheRefButton->SetStartImage();
- USHORT nPrivActiv = pParaWin->GetActiveLine();
+ sal_uInt16 nPrivActiv = pParaWin->GetActiveLine();
pParaWin->SetArgument( nPrivActiv, aEdRef.GetText() );
ModifyHdl( pParaWin );
pTheRefEdit = NULL;
@@ -1617,7 +1622,7 @@ void FormulaDlg_Impl::Update(const String& _sExp)
{
CalcStruct(_sExp);
FillDialog();
- //aBtnForward.Enable(TRUE); //@New
+ //aBtnForward.Enable(sal_True); //@New
FuncSelHdl(NULL);
}
void FormulaDlg_Impl::SetMeText(const String& _sText)
@@ -1627,7 +1632,7 @@ void FormulaDlg_Impl::SetMeText(const String& _sText)
pMEdit->SetSelection( pData->GetSelection());
aMEFormula.UpdateOldSel();
}
-FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate)
+FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate)
{
FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA;
if(!bEditFlag)
@@ -1646,11 +1651,11 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivSt
} // if ( _bUpdate )
return eMode;
}
-BOOL FormulaDlg_Impl::CheckMatrix(String& aFormula)
+sal_Bool FormulaDlg_Impl::CheckMatrix(String& aFormula)
{
pMEdit->GrabFocus();
xub_StrLen nLen = aFormula.Len();
- BOOL bMatrix = nLen > 3 // Matrix-Formel ?
+ sal_Bool bMatrix = nLen > 3 // Matrix-Formel ?
&& aFormula.GetChar(0) == '{'
&& aFormula.GetChar(1) == '='
&& aFormula.GetChar(nLen-1) == '}';
@@ -1667,8 +1672,8 @@ BOOL FormulaDlg_Impl::CheckMatrix(String& aFormula)
}
IMPL_LINK( FormulaDlg_Impl, StructSelHdl, StructPage*, pStruP )
{
- bStructUpdate=FALSE;
- if(pStructPage->IsVisible()) aBtnForward.Enable(FALSE); //@New
+ bStructUpdate=sal_False;
+ if(pStructPage->IsVisible()) aBtnForward.Enable(sal_False); //@New
if(pStructPage==pStruP)
{
@@ -1705,20 +1710,20 @@ IMPL_LINK( FormulaDlg_Impl, StructSelHdl, StructPage*, pStruP )
//}
}
- bStructUpdate=TRUE;
+ bStructUpdate=sal_True;
return 0;
}
IMPL_LINK( FormulaDlg_Impl, MatrixHdl, CheckBox *, EMPTYARG )
{
- bUserMatrixFlag=TRUE;
+ bUserMatrixFlag=sal_True;
return 0;
}
IMPL_LINK( FormulaDlg_Impl, FuncSelHdl, FuncPage*, EMPTYARG )
{
- USHORT nCat = pFuncPage->GetCategory();
+ sal_uInt16 nCat = pFuncPage->GetCategory();
if ( nCat == LISTBOX_ENTRY_NOTFOUND ) nCat = 0;
- USHORT nFunc = pFuncPage->GetFunction();
+ sal_uInt16 nFunc = pFuncPage->GetFunction();
if ( nFunc == LISTBOX_ENTRY_NOTFOUND ) nFunc = 0;
if ( (pFuncPage->GetFunctionEntryCount() > 0)
@@ -1726,7 +1731,7 @@ IMPL_LINK( FormulaDlg_Impl, FuncSelHdl, FuncPage*, EMPTYARG )
{
const IFunctionDescription* pDesc =pFuncPage->GetFuncDesc( pFuncPage->GetFunction() );
- if(pDesc!=pFuncDesc) aBtnForward.Enable(TRUE); //new
+ if(pDesc!=pFuncDesc) aBtnForward.Enable(sal_True); //new
if (pDesc)
{
@@ -1757,7 +1762,7 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection,const String& _
//-------------------------------------
// Manuelles Update der Ergebnisfelder:
//-------------------------------------
- USHORT nPrivActiv = pParaWin->GetActiveLine();
+ sal_uInt16 nPrivActiv = pParaWin->GetActiveLine();
pParaWin->SetArgument(nPrivActiv,aEdRef.GetText());
pParaWin->UpdateParas();
@@ -1765,11 +1770,11 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection,const String& _
if( pEd != NULL )
pEd->SetSelection( theSel );
- pParaWin->SetRefMode(FALSE);
+ pParaWin->SetRefMode(sal_False);
}
-BOOL FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
+sal_Bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
{
- pParaWin->SetRefMode(TRUE);
+ pParaWin->SetRefMode(sal_True);
String aStrEd;
Edit* pEd = GetCurrRefEdit();
@@ -1810,9 +1815,9 @@ rtl::OString FormulaDlg_Impl::FindFocusWin(Window *pWin)
}
else
{
- USHORT nCount=pWin->GetChildCount();
+ sal_uInt16 nCount=pWin->GetChildCount();
- for(USHORT i=0;i<nCount;i++)
+ for(sal_uInt16 i=0;i<nCount;i++)
{
Window* pChild=pWin->GetChild(i);
aUniqueId=FindFocusWin(pChild);
@@ -1873,7 +1878,7 @@ void FormulaModalDialog::SetMeText(const String& _sText)
}
// -----------------------------------------------------------------------------
-FormulaDlgMode FormulaModalDialog::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate)
+FormulaDlgMode FormulaModalDialog::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate)
{
return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate);
}
@@ -1883,7 +1888,7 @@ void FormulaModalDialog::CheckMatrix()
m_pImpl->aBtnMatrix.Check();
}
// -----------------------------------------------------------------------------
-BOOL FormulaModalDialog::CheckMatrix(String& aFormula)
+sal_Bool FormulaModalDialog::CheckMatrix(String& aFormula)
{
return m_pImpl->CheckMatrix(aFormula);
}
@@ -1903,11 +1908,11 @@ const FormulaHelper& FormulaModalDialog::GetFormulaHelper() const
return m_pImpl->GetFormulaHelper();
}
// -----------------------------------------------------------------------------
-BOOL FormulaModalDialog::isUserMatrix() const
+sal_Bool FormulaModalDialog::isUserMatrix() const
{
return m_pImpl->bUserMatrixFlag;
}
-void FormulaModalDialog::DoEnter(BOOL _bOk)
+void FormulaModalDialog::DoEnter(sal_Bool _bOk)
{
m_pImpl->DoEnter(_bOk);
}
@@ -1919,7 +1924,7 @@ void FormulaModalDialog::RefInputStartAfter( RefEdit* pEdit, RefButton* pButton
{
m_pImpl->RefInputStartAfter( pEdit, pButton );
}
-void FormulaModalDialog::RefInputDoneAfter( BOOL bForced )
+void FormulaModalDialog::RefInputDoneAfter( sal_Bool bForced )
{
m_pImpl->RefInputDoneAfter( bForced );
}
@@ -1937,9 +1942,9 @@ void FormulaModalDialog::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId)
}
else
{
- USHORT nCount=pWin->GetChildCount();
+ sal_uInt16 nCount=pWin->GetChildCount();
- for(USHORT i=0;i<nCount;i++)
+ for(sal_uInt16 i=0;i<nCount;i++)
{
Window* pChild=pWin->GetChild(i);
SetFocusWin(pChild,nUniqueId);
@@ -1975,7 +1980,7 @@ void FormulaModalDialog::UpdateParaWin(const Selection& _rSelection,const String
{
m_pImpl->UpdateParaWin(_rSelection,_sRefStr);
}
-BOOL FormulaModalDialog::UpdateParaWin(Selection& _rSelection)
+sal_Bool FormulaModalDialog::UpdateParaWin(Selection& _rSelection)
{
return m_pImpl->UpdateParaWin(_rSelection);
}
@@ -2029,7 +2034,7 @@ void FormulaDlg::SetMeText(const String& _sText)
}
// -----------------------------------------------------------------------------
-FormulaDlgMode FormulaDlg::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate)
+FormulaDlgMode FormulaDlg::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate)
{
return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate);
}
@@ -2039,7 +2044,7 @@ void FormulaDlg::CheckMatrix()
m_pImpl->aBtnMatrix.Check();
}
// -----------------------------------------------------------------------------
-BOOL FormulaDlg::CheckMatrix(String& aFormula)
+sal_Bool FormulaDlg::CheckMatrix(String& aFormula)
{
return m_pImpl->CheckMatrix(aFormula);
}
@@ -2058,11 +2063,11 @@ void FormulaDlg::Update()
}
// -----------------------------------------------------------------------------
-BOOL FormulaDlg::isUserMatrix() const
+sal_Bool FormulaDlg::isUserMatrix() const
{
return m_pImpl->bUserMatrixFlag;
}
-void FormulaDlg::DoEnter(BOOL _bOk)
+void FormulaDlg::DoEnter(sal_Bool _bOk)
{
m_pImpl->DoEnter(_bOk);
}
@@ -2074,7 +2079,7 @@ void FormulaDlg::RefInputStartAfter( RefEdit* pEdit, RefButton* pButton )
{
m_pImpl->RefInputStartAfter( pEdit, pButton );
}
-void FormulaDlg::RefInputDoneAfter( BOOL bForced )
+void FormulaDlg::RefInputDoneAfter( sal_Bool bForced )
{
m_pImpl->RefInputDoneAfter( bForced );
}
@@ -2092,9 +2097,9 @@ void FormulaDlg::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId)
}
else
{
- USHORT nCount=pWin->GetChildCount();
+ sal_uInt16 nCount=pWin->GetChildCount();
- for(USHORT i=0;i<nCount;i++)
+ for(sal_uInt16 i=0;i<nCount;i++)
{
Window* pChild=pWin->GetChild(i);
SetFocusWin(pChild,nUniqueId);
@@ -2129,7 +2134,7 @@ void FormulaDlg::UpdateParaWin(const Selection& _rSelection,const String& _sRefS
{
m_pImpl->UpdateParaWin(_rSelection,_sRefStr);
}
-BOOL FormulaDlg::UpdateParaWin(Selection& _rSelection)
+sal_Bool FormulaDlg::UpdateParaWin(Selection& _rSelection)
{
return m_pImpl->UpdateParaWin(_rSelection);
}
@@ -2180,7 +2185,7 @@ void FormEditData::Reset()
nFuncSel = 0;
nOffset = 0;
nEdFocus = 0;
- bMatrix =FALSE;
+ bMatrix =sal_False;
aUniqueId=rtl::OString();
aSelection.Min()=0;
aSelection.Max()=0;
diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx
index 1f8b64c7b4ba..6c2d0c757e9a 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -69,7 +69,7 @@ long FormulaListBox::PreNotify( NotifyEvent& rNEvt )
long nResult=ListBox::PreNotify(rNEvt);
- USHORT nSwitch=aNotifyEvt.GetType();
+ sal_uInt16 nSwitch=aNotifyEvt.GetType();
if(nSwitch==EVENT_KEYINPUT)
{
KeyInput(*aNotifyEvt.GetKeyEvent());
@@ -81,7 +81,7 @@ long FormulaListBox::PreNotify( NotifyEvent& rNEvt )
//============================================================================
-inline USHORT Lb2Cat( USHORT nLbPos )
+inline sal_uInt16 Lb2Cat( sal_uInt16 nLbPos )
{
// Kategorie 0 == LRU, sonst Categories == LbPos-1
if ( nLbPos > 0 )
@@ -134,15 +134,15 @@ void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory)
void FuncPage::UpdateFunctionList()
{
- USHORT nSelPos = aLbCategory.GetSelectEntryPos();
+ sal_uInt16 nSelPos = aLbCategory.GetSelectEntryPos();
const IFunctionCategory* pCategory = static_cast<const IFunctionCategory*>(aLbCategory.GetEntryData(nSelPos));
- USHORT nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
+ sal_uInt16 nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
? Lb2Cat( nSelPos ) : 0;
(void)nCategory;
aLbFunction.Clear();
- aLbFunction.SetUpdateMode( FALSE );
+ aLbFunction.SetUpdateMode( sal_False );
//------------------------------------------------------
if ( nSelPos > 0 )
@@ -177,7 +177,7 @@ void FuncPage::UpdateFunctionList()
}
//------------------------------------------------------
- aLbFunction.SetUpdateMode( TRUE );
+ aLbFunction.SetUpdateMode( sal_True );
aLbFunction.SelectEntryPos(0);
if(IsVisible()) SelHdl(&aLbFunction);
@@ -210,16 +210,16 @@ IMPL_LINK( FuncPage, DblClkHdl, ListBox*, EMPTYARG )
return 0;
}
-void FuncPage::SetCategory(USHORT nCat)
+void FuncPage::SetCategory(sal_uInt16 nCat)
{
aLbCategory.SelectEntryPos(nCat);
UpdateFunctionList();
}
-USHORT FuncPage::GetFuncPos(const IFunctionDescription* _pDesc)
+sal_uInt16 FuncPage::GetFuncPos(const IFunctionDescription* _pDesc)
{
return aLbFunction.GetEntryPos(_pDesc);
}
-void FuncPage::SetFunction(USHORT nFunc)
+void FuncPage::SetFunction(sal_uInt16 nFunc)
{
aLbFunction.SelectEntryPos(nFunc);
}
@@ -229,17 +229,17 @@ void FuncPage::SetFocus()
aLbFunction.GrabFocus();
}
-USHORT FuncPage::GetCategory()
+sal_uInt16 FuncPage::GetCategory()
{
return aLbCategory.GetSelectEntryPos();
}
-USHORT FuncPage::GetFunction()
+sal_uInt16 FuncPage::GetFunction()
{
return aLbFunction.GetSelectEntryPos();
}
-USHORT FuncPage::GetFunctionEntryCount()
+sal_uInt16 FuncPage::GetFunctionEntryCount()
{
return aLbFunction.GetSelectEntryCount();
}
@@ -248,7 +248,7 @@ String FuncPage::GetSelFunctionName() const
{
return aLbFunction.GetSelectEntry();
}
-const IFunctionDescription* FuncPage::GetFuncDesc( USHORT nPos ) const
+const IFunctionDescription* FuncPage::GetFuncDesc( sal_uInt16 nPos ) const
{
// nicht schoen, aber hoffentlich selten
return (const IFunctionDescription*) aLbFunction.GetEntryData(nPos);
diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx
index 225114ff00aa..cce9a76f324c 100644
--- a/formula/source/ui/dlg/funcpage.hxx
+++ b/formula/source/ui/dlg/funcpage.hxx
@@ -99,15 +99,15 @@ public:
FuncPage( Window* pParent,const IFunctionManager* _pFunctionManager);
- void SetCategory(USHORT nCat);
- void SetFunction(USHORT nFunc);
+ void SetCategory(sal_uInt16 nCat);
+ void SetFunction(sal_uInt16 nFunc);
void SetFocus();
- USHORT GetCategory();
- USHORT GetFunction();
- USHORT GetFunctionEntryCount();
+ sal_uInt16 GetCategory();
+ sal_uInt16 GetFunction();
+ sal_uInt16 GetFunctionEntryCount();
- USHORT GetFuncPos(const IFunctionDescription* _pDesc);
- const IFunctionDescription* GetFuncDesc( USHORT nPos ) const;
+ sal_uInt16 GetFuncPos(const IFunctionDescription* _pDesc);
+ const IFunctionDescription* GetFuncDesc( sal_uInt16 nPos ) const;
String GetSelFunctionName() const;
void SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index c4e28b3da8f1..b1427f067c9d 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -49,7 +49,7 @@ namespace formula
ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId )
{
Font aFnt( GetFont() );
- aFnt.SetTransparent( TRUE );
+ aFnt.SetTransparent( sal_True );
aFnt.SetWeight( WEIGHT_LIGHT );
if ( pParent->IsBackground() )
{
@@ -110,7 +110,7 @@ ArgEdit::ArgEdit( Window* pParent, const ResId& rResId )
//----------------------------------------------------------------------------
void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
- ScrollBar& rArgSlider, USHORT nArgCount )
+ ScrollBar& rArgSlider, sal_uInt16 nArgCount )
{
pEdPrev = pPrevEdit;
pEdNext = pNextEdit;
@@ -125,8 +125,8 @@ void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aCode = rKEvt.GetKeyCode();
- BOOL bUp = (aCode.GetCode() == KEY_UP);
- BOOL bDown = (aCode.GetCode() == KEY_DOWN);
+ sal_Bool bUp = (aCode.GetCode() == KEY_UP);
+ sal_Bool bDown = (aCode.GetCode() == KEY_DOWN);
ArgEdit* pEd = NULL;
if ( pSlider
@@ -136,8 +136,8 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt )
if ( nArgs > 1 )
{
long nThumb = pSlider->GetThumbPos();
- BOOL bDoScroll = FALSE;
- BOOL bChangeFocus = FALSE;
+ sal_Bool bDoScroll = sal_False;
+ sal_Bool bChangeFocus = sal_False;
if ( bDown )
{
@@ -151,13 +151,13 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt )
else
{
pEd = pEdNext;
- bChangeFocus = TRUE;
+ bChangeFocus = sal_True;
}
}
else if ( pEdNext )
{
pEd = pEdNext;
- bChangeFocus = TRUE;
+ bChangeFocus = sal_True;
}
}
else // if ( bUp )
@@ -172,13 +172,13 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt )
else
{
pEd = pEdPrev;
- bChangeFocus = TRUE;
+ bChangeFocus = sal_True;
}
}
else if ( pEdPrev )
{
pEd = pEdPrev;
- bChangeFocus = TRUE;
+ bChangeFocus = sal_True;
}
}
@@ -743,7 +743,7 @@ EditBox::EditBox( Window* pParent,WinBits nWinStyle)
#************************************************************************/
EditBox::EditBox( Window* pParent, const ResId& rResId )
:Control(pParent,rResId),
- bMouseFlag(FALSE)
+ bMouseFlag(sal_False)
{
WinBits nStyle=GetStyle();
SetStyle( nStyle| WB_DIALOGCONTROL);
@@ -849,15 +849,15 @@ void EditBox::GetFocus()
#************************************************************************/
long EditBox::PreNotify( NotifyEvent& rNEvt )
{
- long nResult=TRUE;
+ long nResult=sal_True;
if(pMEdit==NULL) return nResult;
- USHORT nSwitch=rNEvt.GetType();
+ sal_uInt16 nSwitch=rNEvt.GetType();
if(nSwitch==EVENT_KEYINPUT)// || nSwitch==EVENT_KEYUP)
{
const KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode();
- USHORT nKey=aKeyCode.GetCode();
+ sal_uInt16 nKey=aKeyCode.GetCode();
if( (nKey==KEY_RETURN && !aKeyCode.IsShift()) || nKey==KEY_TAB )
{
nResult=GetParent()->Notify(rNEvt);
@@ -875,7 +875,7 @@ long EditBox::PreNotify( NotifyEvent& rNEvt )
if(nSwitch==EVENT_MOUSEBUTTONDOWN || nSwitch==EVENT_MOUSEBUTTONUP)
{
- bMouseFlag=TRUE;
+ bMouseFlag=sal_True;
Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ) );
}
}
@@ -930,7 +930,7 @@ void EditBox::UpdateOldSel()
RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent, const ResId& rResId ) :
Edit( _pParent, rResId ),
pAnyRefDlg( pParent ),
- bSilentFocus( FALSE )
+ bSilentFocus( sal_False )
{
aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) );
aTimer.SetTimeout( SC_ENABLE_TIME );
@@ -939,7 +939,7 @@ RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent, const ResI
RefEdit::RefEdit( Window* pParent, const ResId& rResId ) :
Edit( pParent, rResId ),
pAnyRefDlg( NULL ),
- bSilentFocus( FALSE )
+ bSilentFocus( sal_False )
{
}
@@ -967,9 +967,9 @@ void RefEdit::StartUpdateData()
void RefEdit::SilentGrabFocus()
{
- bSilentFocus = TRUE;
+ bSilentFocus = sal_True;
GrabFocus();
- bSilentFocus = FALSE;
+ bSilentFocus = sal_False;
}
void RefEdit::SetRefDialog( IControlReferenceHandler* pDlg )
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index 5e656aea0967..3a21a99b0da7 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -56,30 +56,30 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos):
aFtArgName ( this, ModuleRes( FT_PARNAME ) ),
aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ),
+ aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
aFtArg1 ( this, ModuleRes( FT_ARG1 ) ),
- aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
- aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
- aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
+ aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
+ aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
- aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ),
- aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
- aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
-
- aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
+ aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
aEdArg2 ( this, ModuleRes( ED_ARG2 ) ),
- aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
- aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
-
- aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ),
+
+ aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
+ aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
+ aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ),
+
+ aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
+ aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
+ aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ),
aSlider ( this, ModuleRes( WND_SLIDER ) ),
m_sOptional ( ModuleRes( STR_OPTIONAL ) ),
m_sRequired ( ModuleRes( STR_REQUIRED ) ),
- bRefMode (FALSE)
+ bRefMode (sal_False)
{
Image aFxHC( ModuleRes( IMG_FX_H ) );
FreeResource();
@@ -106,13 +106,13 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos):
ClearAll();
}
-void ParaWin::UpdateArgDesc( USHORT nArg )
+void ParaWin::UpdateArgDesc( sal_uInt16 nArg )
{
if (nArg==NOT_FOUND) return;
if ( nArgs > 4 )
- nArg = sal::static_int_cast<USHORT>( nArg + GetSliderPos() );
- //@ nArg += (USHORT)aSlider.GetThumbPos();
+ nArg = sal::static_int_cast<sal_uInt16>( nArg + GetSliderPos() );
+ //@ nArg += (sal_uInt16)aSlider.GetThumbPos();
if ( (nArgs > 0) && (nArg<nArgs) )
{
@@ -124,7 +124,7 @@ void ParaWin::UpdateArgDesc( USHORT nArg )
if ( nArgs < VAR_ARGS )
{
- USHORT nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg;
+ sal_uInt16 nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg;
aArgDesc = pFuncDesc->getParameterDescription(nRealArg);
aArgName = pFuncDesc->getParameterName(nRealArg);
aArgName += ' ';
@@ -132,9 +132,9 @@ void ParaWin::UpdateArgDesc( USHORT nArg )
}
else
{
- USHORT nFix = nArgs - VAR_ARGS;
- USHORT nPos = ( nArg < nFix ? nArg : nFix );
- USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
+ sal_uInt16 nFix = nArgs - VAR_ARGS;
+ sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix );
+ sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ?
aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
aArgDesc = pFuncDesc->getParameterDescription(nRealArg);
aArgName = pFuncDesc->getParameterName(nRealArg);
@@ -150,14 +150,14 @@ void ParaWin::UpdateArgDesc( USHORT nArg )
}
}
-void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i )
+void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i )
{
- USHORT nArg = nOffset + i;
+ sal_uInt16 nArg = nOffset + i;
if ( nArgs < VAR_ARGS)
{
if(nArg<nArgs)
{
- USHORT nRealArg = aVisibleArgMapping[nArg];
+ sal_uInt16 nRealArg = aVisibleArgMapping[nArg];
SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg))
? aFntLight : aFntBold );
SetArgName (i,pFuncDesc->getParameterName(nRealArg));
@@ -165,9 +165,9 @@ void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i )
}
else
{
- USHORT nFix = nArgs - VAR_ARGS;
- USHORT nPos = ( nArg < nFix ? nArg : nFix );
- USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
+ sal_uInt16 nFix = nArgs - VAR_ARGS;
+ sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix );
+ sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ?
aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
SetArgNameFont( i,
(nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ?
@@ -197,12 +197,12 @@ ParaWin::~ParaWin()
aBtnFx4.SetGetFocusHdl( aEmptyLink );
}
-USHORT ParaWin::GetActiveLine()
+sal_uInt16 ParaWin::GetActiveLine()
{
return nActiveLine;
}
-void ParaWin::SetActiveLine(USHORT no)
+void ParaWin::SetActiveLine(sal_uInt16 no)
{
if(no<nArgs)
{
@@ -212,10 +212,10 @@ void ParaWin::SetActiveLine(USHORT no)
if(nNewEdPos<0 || nNewEdPos>3)
{
nOffset+=nNewEdPos;
- SetSliderPos((USHORT) nOffset);
+ SetSliderPos((sal_uInt16) nOffset);
nOffset=GetSliderPos();
}
- nEdFocus=no-(USHORT)nOffset;
+ nEdFocus=no-(sal_uInt16)nOffset;
UpdateArgDesc( nEdFocus );
}
}
@@ -233,7 +233,7 @@ RefEdit* ParaWin::GetActiveEdit()
}
-String ParaWin::GetArgument(USHORT no)
+String ParaWin::GetArgument(sal_uInt16 no)
{
String aStr;
if(no<aParaArray.size())
@@ -256,7 +256,7 @@ String ParaWin::GetActiveArgName()
}
-void ParaWin::SetArgument(USHORT no, const String& aString)
+void ParaWin::SetArgument(sal_uInt16 no, const String& aString)
{
if(no<aParaArray.size())
{
@@ -334,32 +334,32 @@ void ParaWin::SetEditDesc(const String& aText)
aFtEditDesc.SetText(aText);
}
-void ParaWin::SetArgName(USHORT no,const String& aText)
+void ParaWin::SetArgName(sal_uInt16 no,const String& aText)
{
aArgInput[no].SetArgName(aText);
}
-void ParaWin::SetArgNameFont(USHORT no,const Font& aFont)
+void ParaWin::SetArgNameFont(sal_uInt16 no,const Font& aFont)
{
aArgInput[no].SetArgNameFont(aFont);
}
-void ParaWin::SetArgVal(USHORT no,const String& aText)
+void ParaWin::SetArgVal(sal_uInt16 no,const String& aText)
{
aArgInput[no].SetArgVal(aText);
}
-void ParaWin::HideParaLine(USHORT no)
+void ParaWin::HideParaLine(sal_uInt16 no)
{
aArgInput[no].Hide();
}
-void ParaWin::ShowParaLine(USHORT no)
+void ParaWin::ShowParaLine(sal_uInt16 no)
{
aArgInput[no].Show();
}
-void ParaWin::SetEdFocus(USHORT no)
+void ParaWin::SetEdFocus(sal_uInt16 no)
{
UpdateArgDesc(no);
if(no<4 && no<aParaArray.size())
@@ -367,7 +367,7 @@ void ParaWin::SetEdFocus(USHORT no)
}
-void ParaWin::InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx,
+void ParaWin::InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
ArgEdit& rEdArg, RefButton& rRefBtn)
{
@@ -390,7 +390,7 @@ void ParaWin::ClearAll()
SetArgumentOffset(0);
}
-void ParaWin::SetArgumentOffset(USHORT nOffset)
+void ParaWin::SetArgumentOffset(sal_uInt16 nOffset)
{
DelParaArray();
aSlider.SetThumbPos(0);
@@ -430,8 +430,8 @@ void ParaWin::SetArgumentOffset(USHORT nOffset)
void ParaWin::UpdateParas()
{
- USHORT i;
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 i;
+ sal_uInt16 nOffset = GetSliderPos();
if ( nArgs > 0 )
{
@@ -446,19 +446,19 @@ void ParaWin::UpdateParas()
}
-USHORT ParaWin::GetSliderPos()
+sal_uInt16 ParaWin::GetSliderPos()
{
- return (USHORT) aSlider.GetThumbPos();
+ return (sal_uInt16) aSlider.GetThumbPos();
}
-void ParaWin::SetSliderPos(USHORT nSliderPos)
+void ParaWin::SetSliderPos(sal_uInt16 nSliderPos)
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
if(aSlider.IsVisible() && nOffset!=nSliderPos)
{
aSlider.SetThumbPos(nSliderPos);
- for ( USHORT i=0; i<4; i++ )
+ for ( sal_uInt16 i=0; i<4; i++ )
{
UpdateArgInput( nSliderPos, i );
}
@@ -467,9 +467,9 @@ void ParaWin::SetSliderPos(USHORT nSliderPos)
void ParaWin::SliderMoved()
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
- for ( USHORT i=0; i<4; i++ )
+ for ( sal_uInt16 i=0; i<4; i++ )
{
UpdateArgInput( nOffset, i );
}
@@ -496,9 +496,9 @@ void ParaWin::FxClick()
IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr )
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
+ for ( sal_uInt16 nPos=0; nPos<5;nPos++)
{
if(pPtr == &aArgInput[nPos])
{
@@ -518,9 +518,9 @@ IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr )
IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr )
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
+ for ( sal_uInt16 nPos=0; nPos<5;nPos++)
{
if(pPtr == &aArgInput[nPos])
{
@@ -542,9 +542,9 @@ IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr )
IMPL_LINK( ParaWin, GetEdFocusHdl, ArgInput*, pPtr )
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
+ for ( sal_uInt16 nPos=0; nPos<5;nPos++)
{
if(pPtr == &aArgInput[nPos])
{
@@ -574,9 +574,9 @@ IMPL_LINK( ParaWin, ScrollHdl, ScrollBar*, EMPTYARG )
IMPL_LINK( ParaWin, ModifyHdl, ArgInput*, pPtr )
{
- USHORT nOffset = GetSliderPos();
+ sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
+ for ( sal_uInt16 nPos=0; nPos<5;nPos++)
{
if(pPtr == &aArgInput[nPos])
{
diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx
index bfaebccdca09..55c2bd7204b8 100644
--- a/formula/source/ui/dlg/parawin.hxx
+++ b/formula/source/ui/dlg/parawin.hxx
@@ -57,10 +57,10 @@ private:
Link aFxLink;
Link aArgModifiedLink;
- ::std::vector<USHORT> aVisibleArgMapping;
+ ::std::vector<sal_uInt16> aVisibleArgMapping;
const IFunctionDescription* pFuncDesc;
IControlReferenceHandler* pMyParent;
- USHORT nArgs; // unsuppressed arguments
+ sal_uInt16 nArgs; // unsuppressed arguments
Font aFntBold;
Font aFntLight;
@@ -68,33 +68,33 @@ private:
FixedText aFtArgName;
FixedInfo aFtArgDesc;
+ ImageButton aBtnFx1;
FixedText aFtArg1;
- FixedText aFtArg2;
- FixedText aFtArg3;
- FixedText aFtArg4;
+ ArgEdit aEdArg1;
+ RefButton aRefBtn1;
- ImageButton aBtnFx1;
ImageButton aBtnFx2;
- ImageButton aBtnFx3;
- ImageButton aBtnFx4;
-
- ArgEdit aEdArg1;
+ FixedText aFtArg2;
ArgEdit aEdArg2;
+ RefButton aRefBtn2;
+
+ ImageButton aBtnFx3;
+ FixedText aFtArg3;
ArgEdit aEdArg3;
- ArgEdit aEdArg4;
+ RefButton aRefBtn3;
- RefButton aRefBtn1;
- RefButton aRefBtn2;
- RefButton aRefBtn3;
- RefButton aRefBtn4;
+ ImageButton aBtnFx4;
+ FixedText aFtArg4;
+ ArgEdit aEdArg4;
+ RefButton aRefBtn4;
ScrollBar aSlider;
String m_sOptional;
String m_sRequired;
- BOOL bRefMode;
+ sal_Bool bRefMode;
- USHORT nEdFocus;
- USHORT nActiveLine;
+ sal_uInt16 nEdFocus;
+ sal_uInt16 nActiveLine;
ArgInput aArgInput[4];
String aDefaultString;
@@ -113,7 +113,7 @@ protected:
virtual void ArgumentModified();
virtual void FxClick();
- void InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx,
+ void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
ArgEdit& rEdArg, RefButton& rRefBtn);
void DelParaArray();
@@ -121,40 +121,40 @@ protected:
void SetArgumentText(const String& aText);
- void SetArgName (USHORT no,const String &aArg);
- void SetArgNameFont (USHORT no,const Font&);
- void SetArgVal (USHORT no,const String &aArg);
+ void SetArgName (sal_uInt16 no,const String &aArg);
+ void SetArgNameFont (sal_uInt16 no,const Font&);
+ void SetArgVal (sal_uInt16 no,const String &aArg);
- void HideParaLine(USHORT no);
- void ShowParaLine(USHORT no);
- void UpdateArgDesc( USHORT nArg );
- void UpdateArgInput( USHORT nOffset, USHORT i );
+ void HideParaLine(sal_uInt16 no);
+ void ShowParaLine(sal_uInt16 no);
+ void UpdateArgDesc( sal_uInt16 nArg );
+ void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
public:
ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos);
~ParaWin();
void SetFunctionDesc(const IFunctionDescription* pFDesc);
- void SetArgumentOffset(USHORT nOffset);
+ void SetArgumentOffset(sal_uInt16 nOffset);
void SetEditDesc(const String& aText);
void UpdateParas();
void ClearAll();
- BOOL IsRefMode() {return bRefMode;}
- void SetRefMode(BOOL bFlag) {bRefMode=bFlag;}
+ sal_Bool IsRefMode() {return bRefMode;}
+ void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;}
- USHORT GetActiveLine();
- void SetActiveLine(USHORT no);
+ sal_uInt16 GetActiveLine();
+ void SetActiveLine(sal_uInt16 no);
RefEdit* GetActiveEdit();
String GetActiveArgName();
- String GetArgument(USHORT no);
- void SetArgument(USHORT no, const String& aString);
+ String GetArgument(sal_uInt16 no);
+ void SetArgument(sal_uInt16 no, const String& aString);
void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
- void SetEdFocus(USHORT nEditLine); //Sichtbare Editzeilen
- USHORT GetSliderPos();
- void SetSliderPos(USHORT nSliderPos);
+ void SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen
+ sal_uInt16 GetSliderPos();
+ void SetSliderPos(sal_uInt16 nSliderPos);
void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
const Link& GetScrollHdl() const { return aScrollLink; }
diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx
index 3f86b4ba21eb..89d012d7ba88 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ -49,7 +49,7 @@ namespace formula
StructListBox::StructListBox(Window* pParent, const ResId& rResId ):
SvTreeListBox(pParent,rResId )
{
- bActiveFlag=FALSE;
+ bActiveFlag=sal_False;
Font aFont( GetFont() );
Size aSize = aFont.GetSize();
@@ -61,9 +61,9 @@ StructListBox::StructListBox(Window* pParent, const ResId& rResId ):
SvLBoxEntry* StructListBox::InsertStaticEntry(
const XubString& rText,
const Image& rEntryImg, const Image& rEntryImgHC,
- SvLBoxEntry* pParent, ULONG nPos, IFormulaToken* pToken )
+ SvLBoxEntry* pParent, sal_uLong nPos, IFormulaToken* pToken )
{
- SvLBoxEntry* pEntry = InsertEntry( rText, rEntryImg, rEntryImg, pParent, FALSE, nPos, pToken );
+ SvLBoxEntry* pEntry = InsertEntry( rText, rEntryImg, rEntryImg, pParent, sal_False, nPos, pToken );
SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) );
DBG_ASSERT( pBmpItem, "StructListBox::InsertStaticEntry - missing item" );
pBmpItem->SetBitmap1( rEntryImgHC, BMP_COLOR_HIGHCONTRAST );
@@ -71,31 +71,31 @@ SvLBoxEntry* StructListBox::InsertStaticEntry(
return pEntry;
}
-void StructListBox::SetActiveFlag(BOOL bFlag)
+void StructListBox::SetActiveFlag(sal_Bool bFlag)
{
bActiveFlag=bFlag;
}
-BOOL StructListBox::GetActiveFlag()
+sal_Bool StructListBox::GetActiveFlag()
{
return bActiveFlag;
}
void StructListBox::MouseButtonDown( const MouseEvent& rMEvt )
{
- bActiveFlag=TRUE;
+ bActiveFlag=sal_True;
SvTreeListBox::MouseButtonDown(rMEvt);
}
void StructListBox::GetFocus()
{
- bActiveFlag=TRUE;
+ bActiveFlag=sal_True;
SvTreeListBox::GetFocus();
}
void StructListBox::LoseFocus()
{
- bActiveFlag=FALSE;
+ bActiveFlag=sal_False;
SvTreeListBox::LoseFocus();
}
@@ -128,20 +128,20 @@ StructPage::StructPage(Window* pParent):
void StructPage::ClearStruct()
{
- aTlbStruct.SetActiveFlag(FALSE);
+ aTlbStruct.SetActiveFlag(sal_False);
aTlbStruct.Clear();
}
SvLBoxEntry* StructPage::InsertEntry( const XubString& rText, SvLBoxEntry* pParent,
- USHORT nFlag,ULONG nPos,IFormulaToken* pIFormulaToken)
+ sal_uInt16 nFlag,sal_uLong nPos,IFormulaToken* pIFormulaToken)
{
- aTlbStruct.SetActiveFlag( FALSE );
+ aTlbStruct.SetActiveFlag( sal_False );
SvLBoxEntry* pEntry = NULL;
switch( nFlag )
{
case STRUCT_FOLDER:
- pEntry = aTlbStruct.InsertEntry( rText, pParent, FALSE, nPos, pIFormulaToken );
+ pEntry = aTlbStruct.InsertEntry( rText, pParent, sal_False, nPos, pIFormulaToken );
break;
case STRUCT_END:
pEntry = aTlbStruct.InsertStaticEntry( rText, maImgEnd, maImgEndHC, pParent, nPos, pIFormulaToken );
diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx
index 8e5dff4e6ed9..a060790d08ad 100644
--- a/formula/source/ui/dlg/structpg.hxx
+++ b/formula/source/ui/dlg/structpg.hxx
@@ -49,7 +49,7 @@ class StructListBox : public SvTreeListBox
{
private:
- BOOL bActiveFlag;
+ sal_Bool bActiveFlag;
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -64,11 +64,11 @@ public:
const Image& rEntryImg,
const Image& rEntryImgHC,
SvLBoxEntry* pParent = NULL,
- ULONG nPos = LIST_APPEND,
+ sal_uLong nPos = LIST_APPEND,
IFormulaToken* pToken = NULL );
- void SetActiveFlag(BOOL bFlag=TRUE);
- BOOL GetActiveFlag();
+ void SetActiveFlag(sal_Bool bFlag=sal_True);
+ sal_Bool GetActiveFlag();
void GetFocus();
void LoseFocus();
};
@@ -105,7 +105,7 @@ public:
void ClearStruct();
virtual SvLBoxEntry* InsertEntry(const XubString& rText, SvLBoxEntry* pParent,
- USHORT nFlag,ULONG nPos=0,IFormulaToken* pScToken=NULL);
+ sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL);
virtual String GetEntryText(SvLBoxEntry* pEntry) const;
virtual SvLBoxEntry* GetParent(SvLBoxEntry* pEntry) const;
diff --git a/formula/source/ui/inc/ModuleHelper.hxx b/formula/source/ui/inc/ModuleHelper.hxx
index 23079b1e6705..c508bd8b6658 100644
--- a/formula/source/ui/inc/ModuleHelper.hxx
+++ b/formula/source/ui/inc/ModuleHelper.hxx
@@ -88,7 +88,7 @@ namespace formula
class FORMULA_DLLPUBLIC ModuleRes : public ::ResId
{
public:
- ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { }
+ ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { }
};
//.........................................................................
} // namespace formula