diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 16:55:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 20:21:13 -0500 |
commit | 12343c15568dcc2c9209d8ca41fda2263122448f (patch) | |
tree | 3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /sc/source/core | |
parent | 99745dbcbb25b61437914c9782475d0b67a4b0bd (diff) | |
parent | ce6308e4fad2281241bf4ca78280eba29f744d43 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/core')
123 files changed, 6878 insertions, 6814 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index aaf279429900..5327df0afd10 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -97,7 +97,7 @@ ScAttrArray::~ScAttrArray() void ScAttrArray::TestData() const { - USHORT nErr = 0; + sal_uInt16 nErr = 0; if (pData) { SCSIZE nPos; @@ -124,7 +124,7 @@ void ScAttrArray::TestData() const //------------------------------------------------------------------------ -void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc ) +void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc ) { if (pData) { @@ -137,7 +137,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc ) { // ensure that attributing changes text width of cell pOldPattern = pData[i].pPattern; - BOOL bNumFormatChanged; + sal_Bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, pPattern->GetItemSet(), pOldPattern->GetItemSet() ) ) { @@ -158,7 +158,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc ) delete[] pData; if (pDocument->IsStreamValid(nTab)) - pDocument->SetStreamValid(nTab, FALSE); + pDocument->SetStreamValid(nTab, false); if (bAlloc) { @@ -180,9 +180,9 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, BOOL bAlloc ) } -BOOL ScAttrArray::Concat(SCSIZE nPos) +sal_Bool ScAttrArray::Concat(SCSIZE nPos) { - BOOL bRet = FALSE; + sal_Bool bRet = false; if (pData && (nPos < nCount)) { if (nPos > 0) @@ -196,7 +196,7 @@ BOOL ScAttrArray::Concat(SCSIZE nPos) pData[nCount - 1].nRow = 0; nCount--; nPos--; - bRet = TRUE; + bRet = sal_True; } } if (nPos + 1 < nCount) @@ -209,7 +209,7 @@ BOOL ScAttrArray::Concat(SCSIZE nPos) pData[nCount - 1].pPattern = NULL; pData[nCount - 1].nRow = 0; nCount--; - bRet = TRUE; + bRet = sal_True; } } } @@ -218,11 +218,11 @@ BOOL ScAttrArray::Concat(SCSIZE nPos) //------------------------------------------------------------------------ -BOOL ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const +sal_Bool ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const { long nHi = static_cast<long>(nCount) - 1; long i = 0; - BOOL bFound = (nCount == 1); + sal_Bool bFound = (nCount == 1); if (pData) { long nLo = 0; @@ -242,11 +242,11 @@ BOOL ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const if (nStartRow >= (long) nRow) nHi = --i; else - bFound = TRUE; + bFound = sal_True; } } else - bFound = FALSE; + bFound = false; if (bFound) nIndex=(SCSIZE)i; @@ -284,7 +284,7 @@ const ScPatternAttr* ScAttrArray::GetPatternRange( SCROW& rStartRow, //------------------------------------------------------------------------ -void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, BOOL bPutToPool ) +void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, sal_Bool bPutToPool ) { SetPatternArea( nRow, nRow, pPattern, bPutToPool ); } @@ -313,7 +313,7 @@ void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow, } void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern, - BOOL bPutToPool, ScEditDataArray* pDataArray ) + sal_Bool bPutToPool, ScEditDataArray* pDataArray ) { if (ValidRow(nStartRow) && ValidRow(nEndRow)) { @@ -363,7 +363,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern const SfxItemSet& rNewSet = pPattern->GetItemSet(); const SfxItemSet& rOldSet = pData[nx].pPattern->GetItemSet(); - BOOL bNumFormatChanged; + sal_Bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rNewSet, rOldSet ) ) { @@ -385,8 +385,8 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern // continue modifying data array SCSIZE nInsert; // insert position (MAXROWCOUNT := no insert) - BOOL bCombined = FALSE; - BOOL bSplit = FALSE; + sal_Bool bCombined = false; + sal_Bool bSplit = false; if ( nStartRow > 0 ) { nInsert = MAXROWCOUNT; @@ -396,7 +396,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern { // may be a split or a simple insert or just a shrink, // row adjustment is done further down if ( pData[ni].nRow > nEndRow ) - bSplit = TRUE; + bSplit = sal_True; ni++; nInsert = ni; } @@ -407,7 +407,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern { // combine pData[ni-1].nRow = nEndRow; nInsert = MAXROWCOUNT; - bCombined = TRUE; + bCombined = sal_True; } } else @@ -431,7 +431,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern pData[ni-1].nRow = nStartRow - 1; // shrink } nInsert = MAXROWCOUNT; - bCombined = TRUE; + bCombined = sal_True; } else if ( ni > 0 && ni == nInsert ) pData[ni-1].nRow = nStartRow - 1; // shrink @@ -490,7 +490,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern } if (pDocument->IsStreamValid(nTab)) - pDocument->SetStreamValid(nTab, FALSE); + pDocument->SetStreamValid(nTab, false); } } @@ -534,7 +534,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* { if (nY1 < nStartRow) nY1=nStartRow; if (nY2 > nEndRow) nY2=nEndRow; - SetPatternArea( nY1, nY2, pNewPattern, TRUE ); + SetPatternArea( nY1, nY2, pNewPattern, sal_True ); Search( nStart, nPos ); } else @@ -544,7 +544,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* const SfxItemSet& rNewSet = pNewPattern->GetItemSet(); const SfxItemSet& rOldSet = pOldPattern->GetItemSet(); - BOOL bNumFormatChanged; + sal_Bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rNewSet, rOldSet ) ) { @@ -566,7 +566,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* while ((nStart <= nEndRow) && (nPos < nCount)); if (pDocument->IsStreamValid(nTab)) - pDocument->SetStreamValid(nTab, FALSE); + pDocument->SetStreamValid(nTab, false); } #ifdef DBG_UTIL @@ -592,7 +592,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* } void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, - const SvxBorderLine* pLine, BOOL bColorOnly ) + const SvxBorderLine* pLine, sal_Bool bColorOnly ) { if ( bColorOnly && !pLine ) return; @@ -612,11 +612,11 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pOldPattern = pData[nPos].pPattern; const SfxItemSet& rOldSet = pOldPattern->GetItemSet(); const SfxPoolItem* pBoxItem = 0; - SfxItemState eState = rOldSet.GetItemState( ATTR_BORDER, TRUE, &pBoxItem ); + SfxItemState eState = rOldSet.GetItemState( ATTR_BORDER, sal_True, &pBoxItem ); const SfxPoolItem* pTLBRItem = 0; - SfxItemState eTLBRState = rOldSet.GetItemState( ATTR_BORDER_TLBR, TRUE, &pTLBRItem ); + SfxItemState eTLBRState = rOldSet.GetItemState( ATTR_BORDER_TLBR, sal_True, &pTLBRItem ); const SfxPoolItem* pBLTRItem = 0; - SfxItemState eBLTRState = rOldSet.GetItemState( ATTR_BORDER_BLTR, TRUE, &pBLTRItem ); + SfxItemState eBLTRState = rOldSet.GetItemState( ATTR_BORDER_BLTR, sal_True, &pBLTRItem ); if ( (SFX_ITEM_SET == eState) || (SFX_ITEM_SET == eTLBRState) || (SFX_ITEM_SET == eBLTRState) ) { @@ -687,7 +687,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, { if (nY1 < nStartRow) nY1=nStartRow; if (nY2 > nEndRow) nY2=nEndRow; - SetPatternArea( nY1, nY2, pNewPattern, TRUE ); + SetPatternArea( nY1, nY2, pNewPattern, sal_True ); Search( nStart, nPos ); } else @@ -743,7 +743,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac do { const ScPatternAttr* pOldPattern = pData[nPos].pPattern; - const ScPatternAttr* pNewPattern = (const ScPatternAttr*) &pCache->ApplyTo( *pOldPattern, TRUE ); + const ScPatternAttr* pNewPattern = (const ScPatternAttr*) &pCache->ApplyTo( *pOldPattern, sal_True ); ScDocumentPool::CheckRef( *pOldPattern ); ScDocumentPool::CheckRef( *pNewPattern ); if (pNewPattern != pOldPattern) @@ -766,7 +766,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac const SfxItemSet& rNewSet = pNewPattern->GetItemSet(); const SfxItemSet& rOldSet = pOldPattern->GetItemSet(); - BOOL bNumFormatChanged; + sal_Bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rNewSet, rOldSet ) ) { @@ -802,7 +802,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac while (nStart <= nEndRow); if (pDocument->IsStreamValid(nTab)) - pDocument->SetStreamValid(nTab, FALSE); + pDocument->SetStreamValid(nTab, false); } #ifdef DBG_UTIL @@ -830,14 +830,14 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource ) { const SfxPoolItem* pNewItem; const SfxPoolItem* pOldItem; - for (USHORT nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++) + for (sal_uInt16 nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++) { // pMergeSet has no parent - SfxItemState eOldState = rMergeSet.GetItemState( nId, FALSE, &pOldItem ); + SfxItemState eOldState = rMergeSet.GetItemState( nId, false, &pOldItem ); if ( eOldState == SFX_ITEM_DEFAULT ) { - SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem ); + SfxItemState eNewState = rSource.GetItemState( nId, sal_True, &pNewItem ); if ( eNewState == SFX_ITEM_SET ) { if ( *pNewItem != rMergeSet.GetPool()->GetDefaultItem(nId) ) @@ -846,7 +846,7 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource ) } else if ( eOldState == SFX_ITEM_SET ) // Item gesetzt { - SfxItemState eNewState = rSource.GetItemState( nId, TRUE, &pNewItem ); + SfxItemState eNewState = rSource.GetItemState( nId, sal_True, &pNewItem ); if ( eNewState == SFX_ITEM_SET ) { if ( pNewItem != pOldItem ) // beide gepuhlt @@ -864,7 +864,7 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource ) void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, - ScMergePatternState& rState, BOOL bDeep ) const + ScMergePatternState& rState, sal_Bool bDeep ) const { if (ValidRow(nStartRow) && ValidRow(nEndRow)) { @@ -889,7 +889,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, if (bDeep) lcl_MergeDeep( *rState.pItemSet, rThisSet ); else - rState.pItemSet->MergeValues( rThisSet, FALSE ); + rState.pItemSet->MergeValues( rThisSet, false ); } else { @@ -913,41 +913,41 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, // assemble border -BOOL lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, - BYTE& rModified, const SvxBorderLine*& rpNew ) +sal_Bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, + sal_uInt8& rModified, const SvxBorderLine*& rpNew ) { if (rModified == SC_LINE_DONTCARE) - return FALSE; // don't go again + return false; // don't go again if (rModified == SC_LINE_EMPTY) { rModified = SC_LINE_SET; rpNew = pNewLine; - return TRUE; // initial value + return true; // initial value } if (pOldLine == pNewLine) { rpNew = pOldLine; - return FALSE; + return false; } if (pOldLine && pNewLine) if (*pOldLine == *pNewLine) { rpNew = pOldLine; - return FALSE; + return false; } rModified = SC_LINE_DONTCARE; rpNew = NULL; - return TRUE; // another line -> don't care + return true; // another line -> don't care } void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, ScLineFlags& rFlags, const ScPatternAttr* pPattern, - BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom ) + sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom ) { // right/bottom border set when connected together const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE); @@ -1011,19 +1011,19 @@ void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, ScLineFlags& rFlags, - SCROW nStartRow, SCROW nEndRow, BOOL bLeft, SCCOL nDistRight ) const + SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) const { const ScPatternAttr* pPattern; if (nStartRow == nEndRow) { pPattern = GetPattern( nStartRow ); - lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, TRUE, 0 ); + lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_True, 0 ); } else { pPattern = GetPattern( nStartRow ); - lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, TRUE, + lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_True, nEndRow-nStartRow ); SCSIZE nStartIndex; @@ -1033,13 +1033,13 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLine for (SCSIZE i=nStartIndex; i<=nEndIndex; i++) { pPattern = (ScPatternAttr*) pData[i].pPattern; - lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, FALSE, + lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false, nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) ); // nDistBottom here always > 0 } pPattern = GetPattern( nEndRow ); - lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, FALSE, 0 ); + lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false, 0 ); } } @@ -1049,10 +1049,10 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLine // ApplyFrame - on an entry into the array -BOOL ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, +sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, const SvxBoxInfoItem* pBoxInfoItem, SCROW nStartRow, SCROW nEndRow, - BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom ) + sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom ) { DBG_ASSERT( pBoxItem && pBoxInfoItem, "Linienattribute fehlen!" ); @@ -1085,27 +1085,27 @@ BOOL ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, if (aNewFrame == *pOldFrame) { // nothing to do - return FALSE; + return false; } else { SfxItemPoolCache aCache( pDocument->GetPool(), &aNewFrame ); ApplyCacheArea( nStartRow, nEndRow, &aCache ); - return TRUE; + return true; } } void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner, - SCROW nStartRow, SCROW nEndRow, BOOL bLeft, SCCOL nDistRight ) + SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) { if (nStartRow == nEndRow) - ApplyFrame( pLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight, TRUE, 0 ); + ApplyFrame( pLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight, sal_True, 0 ); else { ApplyFrame( pLineOuter, pLineInner, nStartRow, nStartRow, bLeft, nDistRight, - TRUE, nEndRow-nStartRow ); + sal_True, nEndRow-nStartRow ); if ( nEndRow > nStartRow+1 ) // inner part available? { @@ -1118,8 +1118,8 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf for (SCSIZE i=nStartIndex; i<=nEndIndex;) { nTmpEnd = Min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) ); - BOOL bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd, - bLeft, nDistRight, FALSE, nEndRow-nTmpEnd ); + sal_Bool bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd, + bLeft, nDistRight, false, nEndRow-nTmpEnd ); nTmpStart = nTmpEnd+1; if (bChanged) { @@ -1131,7 +1131,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf } } - ApplyFrame( pLineOuter, pLineInner, nEndRow, nEndRow, bLeft, nDistRight, FALSE, 0 ); + ApplyFrame( pLineOuter, pLineInner, nEndRow, nEndRow, bLeft, nDistRight, false, 0 ); } } @@ -1142,8 +1142,8 @@ long lcl_LineSize( const SvxBorderLine& rLine ) // double line -> half line spacing + (per min. 20) long nTotal = 0; - USHORT nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() ); - USHORT nDist = rLine.GetDistance(); + sal_uInt16 nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() ); + sal_uInt16 nDist = rLine.GetDistance(); if (nDist) { DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(), @@ -1160,14 +1160,14 @@ long lcl_LineSize( const SvxBorderLine& rLine ) return nTotal; } -BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, - BOOL bLeft, BOOL bRight ) const +sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, + sal_Bool bLeft, sal_Bool bRight ) const { SCSIZE nStartIndex; SCSIZE nEndIndex; Search( nRow1, nStartIndex ); Search( nRow2, nEndIndex ); - BOOL bFound = FALSE; + sal_Bool bFound = false; const SvxBoxItem* pItem = 0; const SvxBorderLine* pLine = 0; @@ -1182,7 +1182,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, nCmp = lcl_LineSize(*pLine); if ( nCmp > rSizes.Top() ) rSizes.Top() = nCmp; - bFound = TRUE; + bFound = sal_True; } // down @@ -1195,7 +1195,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, nCmp = lcl_LineSize(*pLine); if ( nCmp > rSizes.Bottom() ) rSizes.Bottom() = nCmp; - bFound = TRUE; + bFound = sal_True; } if ( bLeft || bRight ) @@ -1211,7 +1211,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, nCmp = lcl_LineSize(*pLine); if ( nCmp > rSizes.Left() ) rSizes.Left() = nCmp; - bFound = TRUE; + bFound = sal_True; } } @@ -1223,7 +1223,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, nCmp = lcl_LineSize(*pLine); if ( nCmp > rSizes.Right() ) rSizes.Right() = nCmp; - bFound = TRUE; + bFound = sal_True; } } } @@ -1233,7 +1233,7 @@ BOOL ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, // Test if field contains specific attribute -bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const +bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const { SCSIZE nStartIndex; SCSIZE nEndIndex; @@ -1296,7 +1296,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const (const SfxInt32Item*) &pPattern->GetItem( ATTR_ROTATE_VALUE ); // 90 or 270 degrees is former SvxOrientationItem - only look for other values // (see ScPatternAttr::GetCellOrientation) - INT32 nAngle = pRotate->GetValue(); + sal_Int32 nAngle = pRotate->GetValue(); if ( nAngle != 0 && nAngle != 9000 && nAngle != 27000 ) bFound = true; } @@ -1347,9 +1347,9 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, USHORT nMask ) const } // Area around any given summaries expand and adapt any MergeFlag (bRefresh) -BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, +sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, - BOOL bRefresh, BOOL bAttrs ) + sal_Bool bRefresh, sal_Bool bAttrs ) { const ScPatternAttr* pPattern; const ScMergeAttr* pItem; @@ -1357,7 +1357,7 @@ BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nEndIndex; Search( nStartRow, nStartIndex ); Search( nEndRow, nEndIndex ); - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCSIZE i=nStartIndex; i<=nEndIndex; i++) { @@ -1374,7 +1374,7 @@ BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, rPaintCol = nMergeEndCol; if (nMergeEndRow > rPaintRow && nMergeEndRow <= MAXROW) rPaintRow = nMergeEndRow; - bFound = TRUE; + bFound = sal_True; if (bAttrs) { @@ -1412,9 +1412,9 @@ BOOL ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, } -BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) +sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) { - BOOL bFound = FALSE; + sal_Bool bFound = false; const ScPatternAttr* pPattern; const ScMergeAttr* pItem; SCSIZE nIndex; @@ -1476,12 +1476,12 @@ BOOL ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow) { - SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), TRUE ); + SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), sal_True ); } void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, - const ScPatternAttr* pWantedPattern, BOOL bDefault ) + const ScPatternAttr* pWantedPattern, sal_Bool bDefault ) { const ScPatternAttr* pOldPattern; const ScMergeFlagAttr* pItem; @@ -1489,7 +1489,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, SCSIZE nIndex; SCROW nRow; SCROW nThisRow; - BOOL bFirstUse = TRUE; + sal_Bool bFirstUse = sal_True; Search( nStartRow, nIndex ); nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0; @@ -1512,7 +1512,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, ScPatternAttr* pNewPattern = new ScPatternAttr( *pWantedPattern ); SfxItemSet* pSet = &pNewPattern->GetItemSet(); pSet->Put( *pItem ); - SetPatternArea( nThisRow, nAttrRow, pNewPattern, TRUE ); + SetPatternArea( nThisRow, nAttrRow, pNewPattern, sal_True ); delete pNewPattern; } else @@ -1520,7 +1520,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, if ( !bDefault ) { if (bFirstUse) - bFirstUse = FALSE; + bFirstUse = false; else // it's in the pool pDocument->GetPool()->Put( *pWantedPattern ); @@ -1537,15 +1537,15 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, } -BOOL ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) +sal_Bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ) { const ScPatternAttr* pOldPattern; - INT16 nOldValue; + sal_Int16 nOldValue; SCSIZE nIndex; SCROW nRow; SCROW nThisRow; - BOOL bChanged = FALSE; + sal_Bool bChanged = false; Search( nStartRow, nIndex ); nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0; @@ -1561,9 +1561,9 @@ BOOL ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) ); - SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE ); + SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); Search( nThisRow, nIndex ); // data changed - bChanged = TRUE; + bChanged = true; } ++nIndex; @@ -1574,15 +1574,15 @@ BOOL ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) } -BOOL ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) +sal_Bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ) { const ScPatternAttr* pOldPattern; - INT16 nOldValue; + sal_Int16 nOldValue; SCSIZE nIndex; SCROW nRow; SCROW nThisRow; - BOOL bChanged = FALSE; + sal_Bool bChanged = false; Search( nStartRow, nIndex ); nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0; @@ -1598,9 +1598,9 @@ BOOL ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) ); - SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE ); + SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); Search( nThisRow, nIndex ); // data changed - bChanged = TRUE; + bChanged = true; } ++nIndex; @@ -1611,7 +1611,7 @@ BOOL ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, INT16 nFlags ) } -void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const USHORT* pWhich ) +void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich ) { const ScPatternAttr* pOldPattern; @@ -1633,7 +1633,7 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const USHORT* pWhi nRow = pData[nIndex].nRow; SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); - SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE ); + SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); Search( nThisRow, nIndex ); // data changed } @@ -1643,7 +1643,7 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const USHORT* pWhi } -void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, BOOL bIncrement ) +void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, sal_Bool bIncrement ) { SCSIZE nIndex; Search( nStartRow, nIndex ); @@ -1656,10 +1656,10 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, BOOL bIncrement const SfxItemSet& rOldSet = pOldPattern->GetItemSet(); const SfxPoolItem* pItem; - BOOL bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, FALSE, &pItem ) != SFX_ITEM_SET + sal_Bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem ) != SFX_ITEM_SET || ((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_LEFT ); - USHORT nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue(); - USHORT nNewValue = nOldValue; + sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue(); + sal_uInt16 nNewValue = nOldValue; if ( bIncrement ) { if ( nNewValue < SC_MAX_INDENT ) @@ -1688,7 +1688,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, BOOL bIncrement if ( bNeedJust ) aNewPattern.GetItemSet().Put( SvxHorJustifyItem( SVX_HOR_JUSTIFY_LEFT, ATTR_HOR_JUSTIFY ) ); - SetPatternArea( nThisStart, nAttrRow, &aNewPattern, TRUE ); + SetPatternArea( nThisStart, nAttrRow, &aNewPattern, sal_True ); nThisStart = nThisEnd + 1; Search( nThisStart, nIndex ); // data changed @@ -1702,7 +1702,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, BOOL bIncrement } -SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const +SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, sal_Bool bUp ) const { long nRet = nRow; if (VALIDROW(nRow)) @@ -1768,10 +1768,10 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo } -BOOL ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle, - BOOL bGatherAllStyles ) const +sal_Bool ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle, + sal_Bool bGatherAllStyles ) const { - BOOL bIsUsed = FALSE; + sal_Bool bIsUsed = false; SCSIZE nPos = 0; while ( nPos < nCount ) @@ -1783,8 +1783,8 @@ BOOL ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle, if ( pStyle == &rStyle ) { if ( !bGatherAllStyles ) - return TRUE; - bIsUsed = TRUE; + return sal_True; + bIsUsed = sal_True; } } nPos++; @@ -1794,25 +1794,25 @@ BOOL ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle, } -BOOL ScAttrArray::IsEmpty() const +sal_Bool ScAttrArray::IsEmpty() const { if (nCount == 1) { if ( pData[0].pPattern != pDocument->GetDefPattern() ) - return FALSE; + return false; else - return TRUE; + return sal_True; } else - return FALSE; + return false; } -BOOL ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const +sal_Bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const { DBG_ASSERT( nCount, "nCount == 0" ); - BOOL bFound = FALSE; + sal_Bool bFound = false; SCSIZE nStart = 0; // Skip first entry if more than 1 row. @@ -1829,7 +1829,7 @@ BOOL ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const if ( pData[nStart].pPattern->IsVisible() ) { rFirstRow = nStart ? ( pData[nStart-1].nRow + 1 ) : 0; - bFound = TRUE; + bFound = sal_True; } else ++nStart; @@ -1843,7 +1843,7 @@ BOOL ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const const SCROW SC_VISATTR_STOP = 84; -BOOL ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const +sal_Bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const { // #i30830# changed behavior: // ignore all attributes starting with the first run of SC_VISATTR_STOP equal rows @@ -1852,10 +1852,10 @@ BOOL ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const if ( nLastData == MAXROW ) { rLastRow = MAXROW; // can't look for attributes below MAXROW - return TRUE; + return sal_True; } - BOOL bFound = FALSE; + sal_Bool bFound = false; // loop backwards from the end instead of using Search, assuming that // there usually aren't many attributes below the last cell @@ -1876,12 +1876,12 @@ BOOL ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow; if ( nAttrSize >= SC_VISATTR_STOP ) { - bFound = FALSE; // ignore this range and below + bFound = false; // ignore this range and below } else if ( !bFound && pData[nEndPos].pPattern->IsVisible() ) { rLastRow = pData[nEndPos].nRow; - bFound = TRUE; + bFound = sal_True; } nPos = nStartPos; // look further from the top of the range @@ -1891,16 +1891,16 @@ BOOL ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const } -BOOL ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const +sal_Bool ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const { SCSIZE nIndex; Search( nStartRow, nIndex ); SCROW nThisStart = nStartRow; - BOOL bFound = FALSE; + sal_Bool bFound = false; while ( nIndex < nCount && nThisStart <= nEndRow && !bFound ) { if ( pData[nIndex].pPattern->IsVisible() ) - bFound = TRUE; + bFound = sal_True; nThisStart = pData[nIndex].nRow + 1; ++nIndex; @@ -1910,10 +1910,10 @@ BOOL ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const } -BOOL ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther, +sal_Bool ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const { - BOOL bEqual = TRUE; + sal_Bool bEqual = sal_True; SCSIZE nThisPos = 0; SCSIZE nOtherPos = 0; if ( nStartRow > 0 ) @@ -1947,11 +1947,11 @@ BOOL ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther, } -BOOL ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const +sal_Bool ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const { // summarised with IsVisibleEqual - BOOL bEqual = TRUE; + sal_Bool bEqual = sal_True; SCSIZE nThisPos = 0; SCSIZE nOtherPos = 0; if ( nStartRow > 0 ) @@ -1984,12 +1984,12 @@ BOOL ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW } -BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const +sal_Bool ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const { // Horizontal aggregate are not allowed to be moved out; if whole summary, // here is not recognized - BOOL bTest = TRUE; + sal_Bool bTest = sal_True; if (!IsEmpty()) { SCSIZE nIndex = 0; @@ -2001,7 +2001,7 @@ BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const if ( ((const ScMergeFlagAttr&)pData[nIndex].pPattern-> GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped() ) { - bTest = FALSE; // may not be pushed out + bTest = false; // may not be pushed out break; } if ( pData[nIndex].nRow >= nEndRow ) // end of range @@ -2012,7 +2012,7 @@ BOOL ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const } -BOOL ScAttrArray::TestInsertRow( SCSIZE nSize ) const +sal_Bool ScAttrArray::TestInsertRow( SCSIZE nSize ) const { // if 1st row pushed out is vertically overlapped, summary would be broken @@ -2026,10 +2026,10 @@ BOOL ScAttrArray::TestInsertRow( SCSIZE nSize ) const if ( ((const ScMergeFlagAttr&)pData[nFirstLost].pPattern-> GetItem(ATTR_MERGE_FLAG)).IsVerOverlapped() ) - return FALSE; + return false; } - return TRUE; + return sal_True; } @@ -2044,7 +2044,7 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize ) // set ScMergeAttr may not be extended (so behind delete again) - BOOL bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged(); + sal_Bool bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged(); SCSIZE nRemove = 0; SCSIZE i; @@ -2086,7 +2086,7 @@ void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize ) { if (pData) { - BOOL bFirst=TRUE; + sal_Bool bFirst=sal_True; SCSIZE nStartIndex = 0; SCSIZE nEndIndex = 0; SCSIZE i; @@ -2097,7 +2097,7 @@ void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize ) if (bFirst) { nStartIndex = i; - bFirst = FALSE; + bFirst = false; } nEndIndex = i; } @@ -2179,14 +2179,14 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow) ScPatternAttr aNewPattern(*pOldPattern); SfxItemSet& rSet = aNewPattern.GetItemSet(); - for (USHORT nId = ATTR_PATTERN_START; nId <= ATTR_PATTERN_END; nId++) + for (sal_uInt16 nId = ATTR_PATTERN_START; nId <= ATTR_PATTERN_END; nId++) if (nId != ATTR_MERGE && nId != ATTR_MERGE_FLAG) rSet.ClearItem(nId); if ( aNewPattern == *pDefPattern ) - SetPatternArea( nThisRow, nAttrRow, pDefPattern, FALSE ); + SetPatternArea( nThisRow, nAttrRow, pDefPattern, false ); else - SetPatternArea( nThisRow, nAttrRow, &aNewPattern, TRUE ); + SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True ); Search( nThisRow, nIndex ); // data changed } @@ -2204,11 +2204,11 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray SCROW nStart = nStartRow; for (SCSIZE i = 0; i < nCount; i++) { - if ((pData[i].nRow >= nStartRow) && ((i==0) ? TRUE : pData[i-1].nRow < nEndRow)) + if ((pData[i].nRow >= nStartRow) && ((i==0) ? sal_True : pData[i-1].nRow < nEndRow)) { // copy (bPutToPool=TRUE) rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ), - pData[i].pPattern, TRUE ); + pData[i].pPattern, sal_True ); } nStart = Max( (SCROW)nStart, (SCROW)(pData[i].nRow + 1) ); } @@ -2219,7 +2219,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray // copy between documents (Clipboard) void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray, - INT16 nStripFlags ) + sal_Int16 nStripFlags ) { nStartRow -= nDy; // Source nEndRow -= nDy; @@ -2229,7 +2229,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra ScDocumentPool* pSourceDocPool = pDocument->GetPool(); ScDocumentPool* pDestDocPool = rAttrArray.pDocument->GetPool(); - BOOL bSamePool = (pSourceDocPool==pDestDocPool); + sal_Bool bSamePool = (pSourceDocPool==pDestDocPool); for (SCSIZE i = 0; (i < nCount) && (nDestStart <= nDestEnd); i++) { @@ -2248,7 +2248,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra else if ( nStripFlags ) { ScPatternAttr* pTmpPattern = new ScPatternAttr( *pOldPattern ); - INT16 nNewFlags = 0; + sal_Int16 nNewFlags = 0; if ( nStripFlags != SC_MF_ALL ) nNewFlags = ((const ScMergeFlagAttr&)pTmpPattern->GetItem(ATTR_MERGE_FLAG)). GetValue() & ~nStripFlags; @@ -2302,7 +2302,7 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr ScDocumentPool* pSourceDocPool = pDocument->GetPool(); ScDocumentPool* pDestDocPool = rAttrArray.pDocument->GetPool(); - BOOL bSamePool = (pSourceDocPool==pDestDocPool); + sal_Bool bSamePool = (pSourceDocPool==pDestDocPool); for (SCSIZE i = 0; (i < nCount) && (nDestStart <= nDestEnd); i++) { @@ -2317,7 +2317,7 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr pNewPattern = pOldPattern->PutInPool( rAttrArray.pDocument, pDocument ); rAttrArray.SetPatternAreaSafe(nDestStart, - Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, FALSE); + Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, false); } // when pasting from clipboard and skipping filtered rows, the adjusted @@ -2328,9 +2328,9 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, - BOOL bUp, ScMarkArray* pMarkArray ) + sal_Bool bUp, ScMarkArray* pMarkArray ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; if (pMarkArray) { @@ -2352,10 +2352,10 @@ SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, nRow = pMarkArray->GetNextMarked( nRow, bUp ); SCROW nStart = nIndex ? pData[nIndex-1].nRow+1 : 0; if (nRow >= nStart && nRow <= pData[nIndex].nRow) - bFound = TRUE; + bFound = sal_True; } else - bFound = TRUE; + bFound = sal_True; } if (!bFound) @@ -2390,8 +2390,8 @@ SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, } -BOOL ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, - const ScStyleSheet* pSearchStyle, BOOL bUp, ScMarkArray* pMarkArray ) +sal_Bool ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, + const ScStyleSheet* pSearchStyle, sal_Bool bUp, ScMarkArray* pMarkArray ) { SCsROW nStartRow = SearchStyle( rRow, pSearchStyle, bUp, pMarkArray ); if (VALIDROW(nStartRow)) @@ -2408,7 +2408,7 @@ BOOL ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, rEndRow = 0; if (pMarkArray) { - SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, TRUE ); + SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, sal_True ); if (nMarkEnd>rEndRow) rEndRow = nMarkEnd; } @@ -2418,16 +2418,16 @@ BOOL ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, rEndRow = pData[nIndex].nRow; if (pMarkArray) { - SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, FALSE ); + SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, false ); if (nMarkEnd<rEndRow) rEndRow = nMarkEnd; } } - return TRUE; + return sal_True; } else - return FALSE; + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 98404f7a944e..7474fb580d72 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -75,30 +75,30 @@ TYPEINIT1(ScPageScaleToItem, SfxPoolItem); // allgemeine Hilfsfunktionen // -BOOL ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) +sal_Bool ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) { if (!pThis) - return FALSE; + return false; if (!pOther) - return TRUE; + return sal_True; - USHORT nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth(); - USHORT nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth(); + sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth(); + sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth(); if (nThisSize > nOtherSize) - return TRUE; + return sal_True; else if (nThisSize < nOtherSize) - return FALSE; + return false; else { if ( pOther->GetInWidth() && !pThis->GetInWidth() ) - return TRUE; + return sal_True; else if ( pThis->GetInWidth() && !pOther->GetInWidth() ) - return FALSE; + return false; else { - return TRUE; //! ??? + return sal_True; //! ??? } } } @@ -170,10 +170,10 @@ SfxPoolItem* ScMergeAttr::Clone( SfxItemPool * ) const //------------------------------------------------------------------------ -SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, USHORT /* nVer */ ) const +SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const { - INT16 nCol; - INT16 nRow; + sal_Int16 nCol; + sal_Int16 nRow; rStream >> nCol; rStream >> nRow; return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow)); @@ -190,7 +190,7 @@ ScMergeFlagAttr::ScMergeFlagAttr(): //------------------------------------------------------------------------ -ScMergeFlagAttr::ScMergeFlagAttr(INT16 nFlags): +ScMergeFlagAttr::ScMergeFlagAttr(sal_Int16 nFlags): SfxInt16Item(ATTR_MERGE_FLAG, nFlags) { } @@ -205,17 +205,17 @@ ScMergeFlagAttr::~ScMergeFlagAttr() ScProtectionAttr::ScProtectionAttr(): SfxPoolItem(ATTR_PROTECTION), - bProtection(TRUE), - bHideFormula(FALSE), - bHideCell(FALSE), - bHidePrint(FALSE) + bProtection(sal_True), + bHideFormula(false), + bHideCell(false), + bHidePrint(false) { } //------------------------------------------------------------------------ -ScProtectionAttr::ScProtectionAttr( BOOL bProtect, BOOL bHFormula, - BOOL bHCell, BOOL bHPrint): +ScProtectionAttr::ScProtectionAttr( sal_Bool bProtect, sal_Bool bHFormula, + sal_Bool bHCell, sal_Bool bHPrint): SfxPoolItem(ATTR_PROTECTION), bProtection(bProtect), bHideFormula(bHFormula), @@ -241,7 +241,7 @@ ScProtectionAttr::~ScProtectionAttr() //------------------------------------------------------------------------ -bool ScProtectionAttr::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -272,7 +272,7 @@ bool ScProtectionAttr::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool ScProtectionAttr::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { bool bRet = false; sal_Bool bVal = sal_Bool(); @@ -395,12 +395,12 @@ SfxPoolItem* ScProtectionAttr::Clone( SfxItemPool * ) const //------------------------------------------------------------------------ -SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, USHORT /* n */ ) const +SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, sal_uInt16 /* n */ ) const { - BOOL bProtect; - BOOL bHFormula; - BOOL bHCell; - BOOL bHPrint; + sal_Bool bProtect; + sal_Bool bHFormula; + sal_Bool bHCell; + sal_Bool bHPrint; rStream >> bProtect; rStream >> bHFormula; @@ -412,34 +412,34 @@ SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, USHORT /* n */ ) const //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetProtection( BOOL bProtect) +sal_Bool ScProtectionAttr::SetProtection( sal_Bool bProtect) { bProtection = bProtect; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHideFormula( BOOL bHFormula) +sal_Bool ScProtectionAttr::SetHideFormula( sal_Bool bHFormula) { bHideFormula = bHFormula; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHideCell( BOOL bHCell) +sal_Bool ScProtectionAttr::SetHideCell( sal_Bool bHCell) { bHideCell = bHCell; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHidePrint( BOOL bHPrint) +sal_Bool ScProtectionAttr::SetHidePrint( sal_Bool bHPrint) { bHidePrint = bHPrint; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -510,7 +510,7 @@ ScTableListItem::ScTableListItem( const ScTableListItem& rCpy ) { pTabArr = new SCTAB [nCount]; - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) pTabArr[i] = rCpy.pTabArr[i]; } else @@ -534,7 +534,7 @@ ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy ) if ( rCpy.nCount > 0 ) { pTabArr = new SCTAB [rCpy.nCount]; - for ( USHORT i=0; i<rCpy.nCount; i++ ) + for ( sal_uInt16 i=0; i<rCpy.nCount; i++ ) pTabArr[i] = rCpy.pTabArr[i]; } else @@ -552,11 +552,11 @@ int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); ScTableListItem& rCmp = (ScTableListItem&)rAttr; - BOOL bEqual = (nCount == rCmp.nCount); + sal_Bool bEqual = (nCount == rCmp.nCount); if ( nCount > 0 ) { - USHORT i=0; + sal_uInt16 i=0; bEqual = ( pTabArr && rCmp.pTabArr ); @@ -599,7 +599,7 @@ SfxItemPresentation ScTableListItem::GetPresentation { rText = '('; if ( nCount>0 && pTabArr ) - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) { rText += String::CreateFromInt32( pTabArr[i] ); if ( i<(nCount-1) ) @@ -627,7 +627,7 @@ SfxItemPresentation ScTableListItem::GetPresentation // ScPageHFItem - Daten der Kopf-/Fusszeilen // ----------------------------------------------------------------------- -ScPageHFItem::ScPageHFItem( USHORT nWhichP ) +ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP ) : SfxPoolItem ( nWhichP ), pLeftArea ( NULL ), pCenterArea ( NULL ), @@ -662,7 +662,7 @@ ScPageHFItem::~ScPageHFItem() //------------------------------------------------------------------------ -bool ScPageHFItem::QueryValue( uno::Any& rVal, BYTE /* nMemberId */ ) const +bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const { uno::Reference<sheet::XHeaderFooterContent> xContent = new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea ); @@ -671,7 +671,7 @@ bool ScPageHFItem::QueryValue( uno::Any& rVal, BYTE /* nMemberId */ ) const return true; } -bool ScPageHFItem::PutValue( const uno::Any& rVal, BYTE /* nMemberId */ ) +bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ ) { bool bRet = false; uno::Reference<sheet::XHeaderFooterContent> xContent; @@ -698,7 +698,7 @@ bool ScPageHFItem::PutValue( const uno::Any& rVal, BYTE /* nMemberId */ ) if ( !pLeftArea || !pCenterArea || !pRightArea ) { // keine Texte auf NULL stehen lassen - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); if (!pLeftArea) pLeftArea = aEngine.CreateTextObject(); if (!pCenterArea) @@ -758,11 +758,11 @@ void lcl_SetSpace( String& rStr, const ESelection& rSel ) rStr.SetChar( rSel.nStartPos, ' ' ); } -BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) +sal_Bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) { - BOOL bChange = FALSE; - USHORT nParCnt = rEng.GetParagraphCount(); - for (USHORT nPar = 0; nPar<nParCnt; nPar++) + sal_Bool bChange = false; + sal_uInt16 nParCnt = rEng.GetParagraphCount(); + for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++) { String aStr = rEng.GetText( nPar ); xub_StrLen nPos; @@ -771,37 +771,37 @@ BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[0].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[1])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[1].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[3].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD ), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[4])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[4].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[5])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[5].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } } return bChange; @@ -809,7 +809,7 @@ BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) #define SC_FIELD_COUNT 6 -SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const +SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const { EditTextObject* pLeft = EditTextObject::Create(rStream); EditTextObject* pCenter = EditTextObject::Create(rStream); @@ -825,7 +825,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const // Excel import in 5.1 created broken TextObjects (#67442#) that are // corrected here to avoid saving wrong files again (#90487#). - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 ) { delete pLeft; @@ -845,7 +845,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const if ( nVer < 1 ) // alte Feldbefehle umsetzen { - USHORT i; + sal_uInt16 i; const String& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER ); String aCommands[SC_FIELD_COUNT]; for (i=0; i<SC_FIELD_COUNT; i++) @@ -859,7 +859,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const for (i=0; i<SC_FIELD_COUNT; i++) aCommands[i] += rDel; - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); aEngine.SetText(*pLeft); if (lcl_ConvertFields(aEngine,aCommands)) { @@ -932,15 +932,15 @@ void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea ) // ScViewObjectModeItem - Darstellungsmodus von ViewObjekten //----------------------------------------------------------------------- -ScViewObjectModeItem::ScViewObjectModeItem( USHORT nWhichP ) +ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP ) : SfxEnumItem( nWhichP, VOBJ_MODE_SHOW ) { } //------------------------------------------------------------------------ -ScViewObjectModeItem::ScViewObjectModeItem( USHORT nWhichP, ScVObjMode eMode ) - : SfxEnumItem( nWhichP, sal::static_int_cast<USHORT>(eMode) ) +ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP, ScVObjMode eMode ) + : SfxEnumItem( nWhichP, sal::static_int_cast<sal_uInt16>(eMode) ) { } @@ -1005,7 +1005,7 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation //------------------------------------------------------------------------ -String ScViewObjectModeItem::GetValueText( USHORT nVal ) const +String ScViewObjectModeItem::GetValueText( sal_uInt16 nVal ) const { DBG_ASSERT( nVal <= VOBJ_MODE_HIDE, "enum overflow!" ); @@ -1014,7 +1014,7 @@ String ScViewObjectModeItem::GetValueText( USHORT nVal ) const //------------------------------------------------------------------------ -USHORT ScViewObjectModeItem::GetValueCount() const +sal_uInt16 ScViewObjectModeItem::GetValueCount() const { return 2; } @@ -1028,7 +1028,7 @@ SfxPoolItem* ScViewObjectModeItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -USHORT ScViewObjectModeItem::GetVersion( USHORT /* nFileVersion */ ) const +sal_uInt16 ScViewObjectModeItem::GetVersion( sal_uInt16 /* nFileVersion */ ) const { return 1; } @@ -1037,7 +1037,7 @@ USHORT ScViewObjectModeItem::GetVersion( USHORT /* nFileVersion */ ) const SfxPoolItem* ScViewObjectModeItem::Create( SvStream& rStream, - USHORT nVersion ) const + sal_uInt16 nVersion ) const { if ( nVersion == 0 ) { @@ -1046,11 +1046,11 @@ SfxPoolItem* ScViewObjectModeItem::Create( } else { - USHORT nVal; + sal_uInt16 nVal; rStream >> nVal; //#i80528# adapt to new range eventually - if((USHORT)VOBJ_MODE_HIDE < nVal) nVal = (USHORT)VOBJ_MODE_SHOW; + if((sal_uInt16)VOBJ_MODE_HIDE < nVal) nVal = (sal_uInt16)VOBJ_MODE_SHOW; return new ScViewObjectModeItem( Which(), (ScVObjMode)nVal); } @@ -1060,7 +1060,7 @@ SfxPoolItem* ScViewObjectModeItem::Create( // double // ----------------------------------------------------------------------- -ScDoubleItem::ScDoubleItem( USHORT nWhichP, double nVal ) +ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal ) : SfxPoolItem ( nWhichP ), nValue ( nVal ) { @@ -1099,7 +1099,7 @@ SfxPoolItem* ScDoubleItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, USHORT /* nVer */ ) const +SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const { double nTmp=0; rStream >> nTmp; @@ -1200,7 +1200,7 @@ SfxItemPresentation ScPageScaleToItem::GetPresentation( return ePres; } -bool ScPageScaleToItem::QueryValue( uno::Any& rAny, BYTE nMemberId ) const +bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const { bool bRet = true; switch( nMemberId ) @@ -1214,9 +1214,9 @@ bool ScPageScaleToItem::QueryValue( uno::Any& rAny, BYTE nMemberId ) const return bRet; } -bool ScPageScaleToItem::PutValue( const uno::Any& rAny, BYTE nMemberId ) +bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId ) { - BOOL bRet = false; + sal_Bool bRet = false; switch( nMemberId ) { case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break; diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 356a980c06a1..f31bd26958e2 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -164,7 +164,7 @@ bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const if ( pShell ) pShell->SetError( SCWARN_CORE_HARD_RECALC, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - pDoc->SetAutoCalc( FALSE ); + pDoc->SetAutoCalc( false ); pDoc->SetHardRecalcState( 2 ); } return true; @@ -276,11 +276,11 @@ ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea( } -BOOL ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const +sal_Bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const { if (aBroadcastAreaTbl.empty()) - return FALSE; - BOOL bIsBroadcasted = FALSE; + return false; + sal_Bool bIsBroadcasted = false; const ScAddress& rAddress = rHint.GetAddress(); for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); aIter != aBroadcastAreaTbl.end(); /* increment in body */ ) @@ -296,7 +296,7 @@ BOOL ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const if (!pBASM->IsInBulkBroadcast() || pBASM->InsertBulkArea( pArea)) { pArea->GetBroadcaster().Broadcast( rHint); - bIsBroadcasted = TRUE; + bIsBroadcasted = sal_True; } } } @@ -304,12 +304,12 @@ BOOL ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const } -BOOL ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange, +sal_Bool ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint) const { if (aBroadcastAreaTbl.empty()) - return FALSE; - BOOL bIsBroadcasted = FALSE; + return false; + sal_Bool bIsBroadcasted = false; for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin()); aIter != aBroadcastAreaTbl.end(); /* increment in body */ ) { @@ -324,7 +324,7 @@ BOOL ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange, if (!pBASM->IsInBulkBroadcast() || pBASM->InsertBulkArea( pArea)) { pArea->GetBroadcaster().Broadcast( rHint); - bIsBroadcasted = TRUE; + bIsBroadcasted = sal_True; } } } @@ -387,7 +387,7 @@ void ScBroadcastAreaSlot::UpdateRemove( UpdateRefMode eUpdateRefMode, pArea->DecRef(); if (pBASM->IsInBulkBroadcast()) pBASM->RemoveBulkArea( pArea); - pArea->SetInUpdateChain( TRUE ); + pArea->SetInUpdateChain( sal_True ); ScBroadcastArea* pUC = pBASM->GetEOUpdateChain(); if ( pUC ) pUC->SetUpdateChainNext( pArea ); @@ -639,7 +639,7 @@ void ScBroadcastAreaSlotMachine::EndListeningArea( const ScRange& rRange, } -BOOL ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const +sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const { const ScAddress& rAddress = rHint.GetAddress(); if ( rAddress == BCA_BRDCST_ALWAYS ) @@ -647,30 +647,30 @@ BOOL ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const if ( pBCAlways ) { pBCAlways->Broadcast( rHint ); - return TRUE; + return sal_True; } else - return FALSE; + return false; } else { TableSlotsMap::const_iterator iTab( aTableSlotsMap.find( rAddress.Tab())); if (iTab == aTableSlotsMap.end()) - return FALSE; + return false; ScBroadcastAreaSlot* pSlot = (*iTab).second->getAreaSlot( ComputeSlotOffset( rAddress)); if ( pSlot ) return pSlot->AreaBroadcast( rHint ); else - return FALSE; + return false; } } -BOOL ScBroadcastAreaSlotMachine::AreaBroadcastInRange( const ScRange& rRange, +sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint ) const { - BOOL bBroadcasted = FALSE; + sal_Bool bBroadcasted = false; SCTAB nEndTab = rRange.aEnd.Tab(); for (TableSlotsMap::const_iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab())); iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab) @@ -894,7 +894,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( // unchain pArea->SetUpdateChainNext( NULL ); - pArea->SetInUpdateChain( FALSE ); + pArea->SetInUpdateChain( false ); // Delete if not inserted to any slot. RemoveBulkArea(pArea) was // already executed in UpdateRemove(). diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 8c8b3e07392a..d3e9cb8db5a5 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -66,16 +66,16 @@ using namespace formula; // hand, if the value fits all recursions, execution is quicker as no resumes // are necessary. Could be made a configurable option. // Allow for a year's calendar (366). -const USHORT MAXRECURSION = 400; +const sal_uInt16 MAXRECURSION = 400; // STATIC DATA ----------------------------------------------------------- #ifdef USE_MEMPOOL // MemPools auf 4k Boundaries - 64 Bytes ausrichten -const USHORT nMemPoolValueCell = (0x8000 - 64) / sizeof(ScValueCell); -const USHORT nMemPoolFormulaCell = (0x8000 - 64) / sizeof(ScFormulaCell); -const USHORT nMemPoolStringCell = (0x4000 - 64) / sizeof(ScStringCell); -const USHORT nMemPoolNoteCell = (0x1000 - 64) / sizeof(ScNoteCell); +const sal_uInt16 nMemPoolValueCell = (0x8000 - 64) / sizeof(ScValueCell); +const sal_uInt16 nMemPoolFormulaCell = (0x8000 - 64) / sizeof(ScFormulaCell); +const sal_uInt16 nMemPoolStringCell = (0x4000 - 64) / sizeof(ScStringCell); +const sal_uInt16 nMemPoolNoteCell = (0x1000 - 64) / sizeof(ScNoteCell); IMPL_FIXEDMEMPOOL_NEWDEL( ScValueCell, nMemPoolValueCell, nMemPoolValueCell ) IMPL_FIXEDMEMPOOL_NEWDEL( ScFormulaCell, nMemPoolFormulaCell, nMemPoolFormulaCell ) IMPL_FIXEDMEMPOOL_NEWDEL( ScStringCell, nMemPoolStringCell, nMemPoolStringCell ) @@ -88,7 +88,7 @@ ScBaseCell::ScBaseCell( CellType eNewType ) : mpNote( 0 ), mpBroadcaster( 0 ), nTextWidth( TEXTWIDTH_DIRTY ), - eCellType( sal::static_int_cast<BYTE>(eNewType) ), + eCellType( sal::static_int_cast<sal_uInt8>(eNewType) ), nScriptType( SC_SCRIPTTYPE_UNKNOWN ) { } @@ -242,7 +242,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) && !((ScFormulaCell*)this)->IsInChangeTrack() ) { - pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... + pDoc->SetDetectiveDirty(sal_True); // es hat sich was geaendert... ScFormulaCell* pFormCell = (ScFormulaCell*)this; ScTokenArray* pArr = pFormCell->GetCode(); @@ -314,7 +314,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc ) } } } - pFormCell->SetNeedsListening( FALSE); + pFormCell->SetNeedsListening( false); } } @@ -328,7 +328,7 @@ void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, && !((ScFormulaCell*)this)->IsInChangeTrack() ) { - pDoc->SetDetectiveDirty(TRUE); // es hat sich was geaendert... + pDoc->SetDetectiveDirty(sal_True); // es hat sich was geaendert... ScFormulaCell* pFormCell = (ScFormulaCell*)this; if( pFormCell->GetCode()->IsRecalcModeAlways() ) @@ -408,7 +408,7 @@ void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr, } -USHORT ScBaseCell::GetErrorCode() const +sal_uInt16 ScBaseCell::GetErrorCode() const { switch ( eCellType ) { @@ -420,45 +420,45 @@ USHORT ScBaseCell::GetErrorCode() const } -BOOL ScBaseCell::HasEmptyData() const +sal_Bool ScBaseCell::HasEmptyData() const { switch ( eCellType ) { case CELLTYPE_NOTE : - return TRUE; + return sal_True; case CELLTYPE_FORMULA : return ((ScFormulaCell*)this)->IsEmpty(); default: - return FALSE; + return false; } } -BOOL ScBaseCell::HasValueData() const +sal_Bool ScBaseCell::HasValueData() const { switch ( eCellType ) { case CELLTYPE_VALUE : - return TRUE; + return sal_True; case CELLTYPE_FORMULA : return ((ScFormulaCell*)this)->IsValue(); default: - return FALSE; + return false; } } -BOOL ScBaseCell::HasStringData() const +sal_Bool ScBaseCell::HasStringData() const { switch ( eCellType ) { case CELLTYPE_STRING : case CELLTYPE_EDIT : - return TRUE; + return sal_True; case CELLTYPE_FORMULA : return !((ScFormulaCell*)this)->IsValue(); default: - return FALSE; + return false; } } @@ -480,7 +480,7 @@ String ScBaseCell::GetStringData() const return aStr; } -BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) +sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) { CellType eType1 = CELLTYPE_NONE; CellType eType2 = CELLTYPE_NONE; @@ -501,12 +501,12 @@ BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) eType2 = CELLTYPE_NONE; } if ( eType1 != eType2 ) - return FALSE; + return false; switch ( eType1 ) // beide Typen gleich { case CELLTYPE_NONE: // beide leer - return TRUE; + return sal_True; case CELLTYPE_VALUE: // wirklich Value-Zellen return ( ((const ScValueCell*)pCell1)->GetValue() == ((const ScValueCell*)pCell2)->GetValue() ); @@ -535,27 +535,27 @@ BOOL ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN { - BOOL bEqual = TRUE; - USHORT nLen = pCode1->GetLen(); + sal_Bool bEqual = sal_True; + sal_uInt16 nLen = pCode1->GetLen(); FormulaToken** ppToken1 = pCode1->GetArray(); FormulaToken** ppToken2 = pCode2->GetArray(); - for (USHORT i=0; i<nLen; i++) + for (sal_uInt16 i=0; i<nLen; i++) if ( !ppToken1[i]->TextEqual(*(ppToken2[i])) ) { - bEqual = FALSE; + bEqual = false; break; } if (bEqual) - return TRUE; + return sal_True; } - return FALSE; // unterschiedlich lang oder unterschiedliche Tokens + return false; // unterschiedlich lang oder unterschiedliche Tokens } default: OSL_FAIL("huch, was fuer Zellen???"); } - return FALSE; + return false; } // ============================================================================ @@ -640,15 +640,15 @@ ScFormulaCell::ScFormulaCell() : nFormatType( NUMBERFORMAT_NUMBER ), nSeenInIteration(0), cMatrixFlag ( MM_NONE ), - bDirty( FALSE ), - bChanged( FALSE ), - bRunning( FALSE ), - bCompile( FALSE ), - bSubTotal( FALSE ), - bIsIterCell( FALSE ), - bInChangeTrack( FALSE ), - bTableOpDirty( FALSE ), - bNeedListening( FALSE ), + bDirty( false ), + bChanged( false ), + bRunning( false ), + bCompile( false ), + bSubTotal( false ), + bIsIterCell( false ), + bInChangeTrack( false ), + bTableOpDirty( false ), + bNeedListening( false ), aPos(0,0,0) { } @@ -656,7 +656,7 @@ ScFormulaCell::ScFormulaCell() : ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, const String& rFormula, const FormulaGrammar::Grammar eGrammar, - BYTE cMatInd ) : + sal_uInt8 cMatInd ) : ScBaseCell( CELLTYPE_FORMULA ), eTempGrammar( eGrammar), pCode( NULL ), @@ -669,25 +669,25 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, nFormatType( NUMBERFORMAT_NUMBER ), nSeenInIteration(0), cMatrixFlag ( cMatInd ), - bDirty( TRUE ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cMatInd != 0 - bChanged( FALSE ), - bRunning( FALSE ), - bCompile( FALSE ), - bSubTotal( FALSE ), - bIsIterCell( FALSE ), - bInChangeTrack( FALSE ), - bTableOpDirty( FALSE ), - bNeedListening( FALSE ), + bDirty( sal_True ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cMatInd != 0 + bChanged( false ), + bRunning( false ), + bCompile( false ), + bSubTotal( false ), + bIsIterCell( false ), + bInChangeTrack( false ), + bTableOpDirty( false ), + bNeedListening( false ), aPos( rPos ) { - Compile( rFormula, TRUE, eGrammar ); // bNoListening, Insert does that + Compile( rFormula, sal_True, eGrammar ); // bNoListening, Insert does that } // Wird von den Importfiltern verwendet ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, const ScTokenArray* pArr, - const FormulaGrammar::Grammar eGrammar, BYTE cInd ) : + const FormulaGrammar::Grammar eGrammar, sal_uInt8 cInd ) : ScBaseCell( CELLTYPE_FORMULA ), eTempGrammar( eGrammar), pCode( pArr ? new ScTokenArray( *pArr ) : new ScTokenArray ), @@ -701,14 +701,14 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, nSeenInIteration(0), cMatrixFlag ( cInd ), bDirty( NULL != pArr ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cInd != 0 - bChanged( FALSE ), - bRunning( FALSE ), - bCompile( FALSE ), - bSubTotal( FALSE ), - bIsIterCell( FALSE ), - bInChangeTrack( FALSE ), - bTableOpDirty( FALSE ), - bNeedListening( FALSE ), + bChanged( false ), + bRunning( false ), + bCompile( false ), + bSubTotal( false ), + bIsIterCell( false ), + bInChangeTrack( false ), + bTableOpDirty( false ), + bNeedListening( false ), aPos( rPos ) { // UPN-Array erzeugen @@ -723,7 +723,7 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, { pCode->Reset(); if ( pCode->GetNextOpCodeRPN( ocSubTotal ) ) - bSubTotal = TRUE; + bSubTotal = sal_True; } if (bSubTotal) @@ -746,13 +746,13 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons cMatrixFlag ( rCell.cMatrixFlag ), bDirty( rCell.bDirty ), bChanged( rCell.bChanged ), - bRunning( FALSE ), + bRunning( false ), bCompile( rCell.bCompile ), bSubTotal( rCell.bSubTotal ), - bIsIterCell( FALSE ), - bInChangeTrack( FALSE ), - bTableOpDirty( FALSE ), - bNeedListening( FALSE ), + bIsIterCell( false ), + bInChangeTrack( false ), + bTableOpDirty( false ), + bNeedListening( false ), aPos( rPos ) { pCode = rCell.pCode->Clone(); @@ -766,11 +766,11 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons if ( pCode->GetCodeError() && !pDocument->IsClipboard() && pCode->GetLen() ) { pCode->SetCodeError( 0 ); - bCompile = TRUE; + bCompile = sal_True; } //! Compile ColRowNames on URM_MOVE/URM_COPY _after_ UpdateReference - BOOL bCompileLater = FALSE; - BOOL bClipMode = rCell.pDocument->IsClipboard(); + sal_Bool bCompileLater = false; + sal_Bool bClipMode = rCell.pDocument->IsClipboard(); if( !bCompile ) { // Name references with references and ColRowNames pCode->Reset(); @@ -788,14 +788,14 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons if( pRangeData ) { if( pRangeData->HasReferences() ) - bCompile = TRUE; + bCompile = sal_True; } else - bCompile = TRUE; // invalid reference! + bCompile = sal_True; // invalid reference! } else if ( t->GetOpCode() == ocColRowName ) { - bCompile = TRUE; // new lookup needed + bCompile = sal_True; // new lookup needed bCompileLater = bClipMode; } } @@ -812,7 +812,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons { // bNoListening, not at all if in Clipboard/Undo, // and not from Clipboard either, instead after Insert(Clone) and UpdateReference. - CompileTokenArray( TRUE ); + CompileTokenArray( sal_True ); } } @@ -922,11 +922,11 @@ void ScFormulaCell::GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows ) } } -void ScFormulaCell::Compile( const String& rFormula, BOOL bNoListening, +void ScFormulaCell::Compile( const String& rFormula, sal_Bool bNoListening, const FormulaGrammar::Grammar eGrammar ) { if ( pDocument->IsClipOrUndo() ) return; - BOOL bWasInFormulaTree = pDocument->IsInFormulaTree( this ); + sal_Bool bWasInFormulaTree = pDocument->IsInFormulaTree( this ); if ( bWasInFormulaTree ) pDocument->RemoveFromFormulaTree( this ); // pCode darf fuer Abfragen noch nicht geloescht, muss aber leer sein @@ -947,12 +947,12 @@ void ScFormulaCell::Compile( const String& rFormula, BOOL bNoListening, else pCode->AddBad( rFormula.GetBuffer() ); } - bCompile = TRUE; + bCompile = sal_True; CompileTokenArray( bNoListening ); } else { - bChanged = TRUE; + bChanged = sal_True; SetTextWidth( TEXTWIDTH_DIRTY ); SetScriptType( SC_SCRIPTTYPE_UNKNOWN ); } @@ -961,7 +961,7 @@ void ScFormulaCell::Compile( const String& rFormula, BOOL bNoListening, } -void ScFormulaCell::CompileTokenArray( BOOL bNoListening ) +void ScFormulaCell::CompileTokenArray( sal_Bool bNoListening ) { // Not already compiled? if( !pCode->GetLen() && aResult.GetHybridFormula().Len() ) @@ -969,13 +969,13 @@ void ScFormulaCell::CompileTokenArray( BOOL bNoListening ) else if( bCompile && !pDocument->IsClipOrUndo() && !pCode->GetCodeError() ) { // RPN length may get changed - BOOL bWasInFormulaTree = pDocument->IsInFormulaTree( this ); + sal_Bool bWasInFormulaTree = pDocument->IsInFormulaTree( this ); if ( bWasInFormulaTree ) pDocument->RemoveFromFormulaTree( this ); // Loading from within filter? No listening yet! if( pDocument->IsInsertingFromOtherDoc() ) - bNoListening = TRUE; + bNoListening = sal_True; if( !bNoListening && pCode->GetCodeLen() ) EndListeningTo( pDocument ); @@ -986,9 +986,9 @@ void ScFormulaCell::CompileTokenArray( BOOL bNoListening ) { nFormatType = aComp.GetNumFormatType(); nFormatIndex = 0; - bChanged = TRUE; + bChanged = sal_True; aResult.SetToken( NULL); - bCompile = FALSE; + bCompile = false; if ( !bNoListening ) StartListeningTo( pDocument ); } @@ -1036,8 +1036,8 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress ) { nFormatType = aComp.GetNumFormatType(); nFormatIndex = 0; - bChanged = TRUE; - bCompile = FALSE; + bChanged = sal_True; + bCompile = false; StartListeningTo( pDocument ); } @@ -1046,7 +1046,7 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress ) } else { - bChanged = TRUE; + bChanged = sal_True; SetTextWidth( TEXTWIDTH_DIRTY ); SetScriptType( SC_SCRIPTTYPE_UNKNOWN ); } @@ -1054,21 +1054,21 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress ) // Same as in Load: after loading, it must be known if ocMacro is in any formula // (for macro warning, CompileXML is called at the end of loading XML file) if ( !pDocument->GetHasMacroFunc() && pCode->HasOpCodeRPN( ocMacro ) ) - pDocument->SetHasMacroFunc( TRUE ); + pDocument->SetHasMacroFunc( sal_True ); } void ScFormulaCell::CalcAfterLoad() { - BOOL bNewCompiled = FALSE; + sal_Bool bNewCompiled = false; // Falls ein Calc 1.0-Doc eingelesen wird, haben wir ein Ergebnis, // aber kein TokenArray if( !pCode->GetLen() && aResult.GetHybridFormula().Len() ) { - Compile( aResult.GetHybridFormula(), TRUE, eTempGrammar); + Compile( aResult.GetHybridFormula(), sal_True, eTempGrammar); aResult.SetToken( NULL); - bDirty = TRUE; - bNewCompiled = TRUE; + bDirty = sal_True; + bNewCompiled = sal_True; } // Das UPN-Array wird nicht erzeugt, wenn ein Calc 3.0-Doc eingelesen // wurde, da die RangeNames erst jetzt existieren. @@ -1079,9 +1079,9 @@ void ScFormulaCell::CalcAfterLoad() bSubTotal = aComp.CompileTokenArray(); nFormatType = aComp.GetNumFormatType(); nFormatIndex = 0; - bDirty = TRUE; - bCompile = FALSE; - bNewCompiled = TRUE; + bDirty = true; + bCompile = false; + bNewCompiled = true; if (bSubTotal) pDocument->AddSubTotalCell(this); @@ -1094,7 +1094,7 @@ void ScFormulaCell::CalcAfterLoad() { DBG_ERRORFILE("Formelzelle INFINITY !!! Woher kommt das Dokument?"); aResult.SetResultError( errIllegalFPOperation ); - bDirty = TRUE; + bDirty = sal_True; } // DoubleRefs bei binaeren Operatoren waren vor v5.0 immer Matrix, // jetzt nur noch wenn in Matrixformel, sonst implizite Schnittmenge @@ -1111,12 +1111,12 @@ void ScFormulaCell::CalcAfterLoad() { StartListeningTo( pDocument ); if( !pCode->IsRecalcModeNormal() ) - bDirty = TRUE; + bDirty = sal_True; } if ( pCode->IsRecalcModeAlways() ) { // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie // auch bei jedem F9 berechnet werden. - bDirty = TRUE; + bDirty = sal_True; } // Noch kein SetDirty weil noch nicht alle Listener bekannt, erst in // SetDirtyAfterLoad. @@ -1167,10 +1167,10 @@ void ScFormulaCell::Interpret() return ; ScRecursionHelper& rRecursionHelper = pDocument->GetRecursionHelper(); - BOOL bOldRunning = bRunning; + sal_Bool bOldRunning = bRunning; if (rRecursionHelper.GetRecursionCount() > MAXRECURSION) { - bRunning = TRUE; + bRunning = sal_True; rRecursionHelper.SetInRecursionReturn( true); } else @@ -1210,13 +1210,13 @@ void ScFormulaCell::Interpret() aOldStart; ++aIter) { pIterCell = (*aIter).pCell; - pIterCell->bIsIterCell = TRUE; + pIterCell->bIsIterCell = sal_True; } // Mark older cells dirty again, in case they converted // without accounting for all remaining cells in the circle // that weren't touched so far, e.g. conditional. Restore // backuped result. - USHORT nIteration = rRecursionHelper.GetIteration(); + sal_uInt16 nIteration = rRecursionHelper.GetIteration(); for (ScFormulaRecursionList::const_iterator aIter( aOldStart); aIter != rRecursionHelper.GetIterationEnd(); ++aIter) @@ -1230,7 +1230,7 @@ void ScFormulaCell::Interpret() } --pIterCell->nSeenInIteration; } - pIterCell->bDirty = TRUE; + pIterCell->bDirty = sal_True; } } else @@ -1247,11 +1247,11 @@ void ScFormulaCell::Interpret() rRecursionHelper.GetIterationEnd(); ++aIter) { pIterCell = (*aIter).pCell; - pIterCell->bIsIterCell = TRUE; + pIterCell->bIsIterCell = sal_True; } } bIterationFromRecursion = false; - USHORT nIterMax = pDocument->GetDocOptions().GetIterCount(); + sal_uInt16 nIterMax = pDocument->GetDocOptions().GetIterCount(); for ( ; rRecursionHelper.GetIteration() <= nIterMax && !rDone; rRecursionHelper.IncIteration()) { @@ -1288,7 +1288,7 @@ void ScFormulaCell::Interpret() ++aIter) { pIterCell = (*aIter).pCell; - pIterCell->bIsIterCell = FALSE; + pIterCell->bIsIterCell = false; pIterCell->nSeenInIteration = 0; pIterCell->bRunning = (*aIter).bOldRunning; } @@ -1301,16 +1301,16 @@ void ScFormulaCell::Interpret() ++aIter) { pIterCell = (*aIter).pCell; - pIterCell->bIsIterCell = FALSE; + pIterCell->bIsIterCell = false; pIterCell->nSeenInIteration = 0; pIterCell->bRunning = (*aIter).bOldRunning; // If one cell didn't converge, all cells of this // circular dependency don't, no matter whether // single cells did. - pIterCell->bDirty = FALSE; - pIterCell->bTableOpDirty = FALSE; + pIterCell->bDirty = false; + pIterCell->bTableOpDirty = false; pIterCell->aResult.SetResultError( errNoConvergence); - pIterCell->bChanged = TRUE; + pIterCell->bChanged = sal_True; pIterCell->SetTextWidth( TEXTWIDTH_DIRTY); pIterCell->SetScriptType( SC_SCRIPTTYPE_UNKNOWN); } @@ -1425,12 +1425,12 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) pDocument->IncInterpretLevel(); ScInterpreter* p = new ScInterpreter( this, pDocument, aPos, *pCode ); StackCleaner aStackCleaner( pDocument, p); - USHORT nOldErrCode = aResult.GetResultError(); + sal_uInt16 nOldErrCode = aResult.GetResultError(); if ( nSeenInIteration == 0 ) { // Only the first time - // With bChanged=FALSE, if a newly compiled cell has a result of + // With bChanged=sal_False, if a newly compiled cell has a result of // 0.0, no change is detected and the cell will not be repainted. - // bChanged = FALSE; + // bChanged = sal_False; aResult.SetResultError( 0 ); } @@ -1441,8 +1441,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) break; } - BOOL bOldRunning = bRunning; - bRunning = TRUE; + sal_Bool bOldRunning = bRunning; + bRunning = sal_True; p->Interpret(); if (pDocument->GetRecursionHelper().IsInReturn() && eTailParam != SCITP_CLOSE_ITERATION_CIRCLE) { @@ -1454,17 +1454,17 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) // #i102616# For single-sheet saving consider only content changes, not format type, // because format type isn't set on loading (might be changed later) - BOOL bContentChanged = FALSE; + sal_Bool bContentChanged = false; // Do not create a HyperLink() cell if the formula results in an error. if( p->GetError() && pCode->IsHyperLink()) - pCode->SetHyperLink(FALSE); + pCode->SetHyperLink(false); if( p->GetError() && p->GetError() != errCircularReference) { - bDirty = FALSE; - bTableOpDirty = FALSE; - bChanged = TRUE; + bDirty = false; + bTableOpDirty = false; + bChanged = sal_True; } if (eTailParam == SCITP_FROM_ITERATION && IsDirtyOrInTableOpDirty()) { @@ -1486,8 +1486,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if (nSeenInIteration > 1 || pDocument->GetDocOptions().GetIterCount() == 1) { - bDirty = FALSE; - bTableOpDirty = FALSE; + bDirty = false; + bTableOpDirty = false; } } } @@ -1495,21 +1495,21 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) // New error code? if( p->GetError() != nOldErrCode ) { - bChanged = TRUE; + bChanged = sal_True; // bContentChanged only has to be set if the file content would be changed if ( aResult.GetCellResultType() != svUnknown ) - bContentChanged = TRUE; + bContentChanged = sal_True; } // Different number format? if( nFormatType != p->GetRetFormatType() ) { nFormatType = p->GetRetFormatType(); - bChanged = TRUE; + bChanged = sal_True; } if( nFormatIndex != p->GetRetFormatIndex() ) { nFormatIndex = p->GetRetFormatIndex(); - bChanged = TRUE; + bChanged = sal_True; } // In case of changes just obtain the result, no temporary and @@ -1562,7 +1562,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) // no change, see above } else - bContentChanged = TRUE; + bContentChanged = sal_True; } aResult.Assign( aNewResult); @@ -1575,7 +1575,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) && nFormatType != NUMBERFORMAT_TIME && nFormatType != NUMBERFORMAT_DATETIME ) { - ULONG nFormat = pDocument->GetNumberFormat( aPos ); + sal_uLong nFormat = pDocument->GetNumberFormat( aPos ); if ( nFormatIndex && (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) nFormat = nFormatIndex; if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) @@ -1586,8 +1586,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) } if (eTailParam == SCITP_NORMAL) { - bDirty = FALSE; - bTableOpDirty = FALSE; + bDirty = false; + bTableOpDirty = false; } if( aResult.GetMatrix() ) { @@ -1599,7 +1599,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) ) { // Coded double error may occur via filter import. - USHORT nErr = GetDoubleErrorValue( aResult.GetDouble()); + sal_uInt16 nErr = GetDoubleErrorValue( aResult.GetDouble()); aResult.SetResultError( nErr); bChanged = bContentChanged = true; } @@ -1610,9 +1610,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) } if (bContentChanged && pDocument->IsStreamValid(aPos.Tab())) { - // pass bIgnoreLock=TRUE, because even if called from pending row height update, + // pass bIgnoreLock=sal_True, because even if called from pending row height update, // a changed result must still reset the stream flag - pDocument->SetStreamValid(aPos.Tab(), FALSE, TRUE); + pDocument->SetStreamValid(aPos.Tab(), false, sal_True); } if ( !pCode->IsRecalcModeAlways() ) pDocument->RemoveFromFormulaTree( this ); @@ -1621,7 +1621,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if ( pCode->IsRecalcModeForced() ) { - ULONG nValidation = ((const SfxUInt32Item*) pDocument->GetAttr( + sal_uLong nValidation = ((const SfxUInt32Item*) pDocument->GetAttr( aPos.Col(), aPos.Row(), aPos.Tab(), ATTR_VALIDDATA ))->GetValue(); if ( nValidation ) { @@ -1669,8 +1669,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) { // Zelle bei Compiler-Fehlern nicht ewig auf dirty stehenlassen DBG_ASSERT( pCode->GetCodeError(), "kein UPN-Code und kein Fehler ?!?!" ); - bDirty = FALSE; - bTableOpDirty = FALSE; + bDirty = false; + bTableOpDirty = false; } } @@ -1698,7 +1698,7 @@ void ScFormulaCell::GetMatColsRows( SCCOL & nCols, SCROW & nRows ) const } -ULONG ScFormulaCell::GetStandardFormat( SvNumberFormatter& rFormatter, ULONG nFormat ) const +sal_uLong ScFormulaCell::GetStandardFormat( SvNumberFormatter& rFormatter, sal_uLong nFormat ) const { if ( nFormatIndex && (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) return nFormatIndex; @@ -1715,17 +1715,17 @@ void ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint) if ( !pDocument->IsInDtorClear() && !pDocument->GetHardRecalcState() ) { const ScHint* p = PTR_CAST( ScHint, &rHint ); - ULONG nHint = (p ? p->GetId() : 0); + sal_uLong nHint = (p ? p->GetId() : 0); if (nHint & (SC_HINT_DATACHANGED | SC_HINT_DYING | SC_HINT_TABLEOPDIRTY)) { - BOOL bForceTrack = FALSE; + sal_Bool bForceTrack = false; if ( nHint & SC_HINT_TABLEOPDIRTY ) { bForceTrack = !bTableOpDirty; if ( !bTableOpDirty ) { pDocument->AddTableOpFormulaCell( this ); - bTableOpDirty = TRUE; + bTableOpDirty = sal_True; } } else @@ -1759,7 +1759,7 @@ void ScFormulaCell::SetDirty() { // Mehrfach-FormulaTracking in Load und in CompileAll // nach CopyScenario und CopyBlockFromClip vermeiden. - // Wenn unbedingtes FormulaTracking noetig, vor SetDirty bDirty=FALSE + // Wenn unbedingtes FormulaTracking noetig, vor SetDirty bDirty=sal_False // setzen, z.B. in CompileTokenArray if ( !bDirty || !pDocument->IsInFormulaTree( this ) ) { @@ -1770,20 +1770,20 @@ void ScFormulaCell::SetDirty() } if (pDocument->IsStreamValid(aPos.Tab())) - pDocument->SetStreamValid(aPos.Tab(), FALSE); + pDocument->SetStreamValid(aPos.Tab(), false); } } void ScFormulaCell::SetDirtyVar() { - bDirty = TRUE; + bDirty = true; // mark the sheet of this cell to be calculated //#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() ); } void ScFormulaCell::SetDirtyAfterLoad() { - bDirty = TRUE; + bDirty = sal_True; if ( !pDocument->GetHardRecalcState() ) pDocument->PutInFormulaTree( this ); } @@ -1793,7 +1793,7 @@ void ScFormulaCell::SetTableOpDirty() if ( !IsInChangeTrack() ) { if ( pDocument->GetHardRecalcState() ) - bTableOpDirty = TRUE; + bTableOpDirty = sal_True; else { if ( !bTableOpDirty || !pDocument->IsInFormulaTree( this ) ) @@ -1801,7 +1801,7 @@ void ScFormulaCell::SetTableOpDirty() if ( !bTableOpDirty ) { pDocument->AddTableOpFormulaCell( this ); - bTableOpDirty = TRUE; + bTableOpDirty = sal_True; } pDocument->AppendToFormulaTrack( this ); pDocument->TrackFormulas( SC_HINT_TABLEOPDIRTY ); @@ -1811,13 +1811,13 @@ void ScFormulaCell::SetTableOpDirty() } -BOOL ScFormulaCell::IsDirtyOrInTableOpDirty() const +sal_Bool ScFormulaCell::IsDirtyOrInTableOpDirty() const { return bDirty || (bTableOpDirty && pDocument->IsInInterpreterTableOp()); } -void ScFormulaCell::SetErrCode( USHORT n ) +void ScFormulaCell::SetErrCode( sal_uInt16 n ) { /* FIXME: check the numerous places where ScTokenArray::GetCodeError() is * used whether it is solely for transport of a simple result error and get @@ -1832,7 +1832,7 @@ void ScFormulaCell::SetErrCode( USHORT n ) void ScFormulaCell::AddRecalcMode( ScRecalcMode nBits ) { if ( (nBits & RECALCMODE_EMASK) != RECALCMODE_NORMAL ) - bDirty = TRUE; + bDirty = sal_True; if ( nBits & RECALCMODE_ONLOAD_ONCE ) { // OnLoadOnce nur zum Dirty setzen nach Filter-Import nBits = (nBits & ~RECALCMODE_EMASK) | RECALCMODE_NORMAL; @@ -1849,13 +1849,13 @@ void ScFormulaCell::GetURLResult( String& rURL, String& rCellText ) // Cell Text uses the Cell format while the URL uses // the default format for the type. - ULONG nCellFormat = pDocument->GetNumberFormat( aPos ); + sal_uLong nCellFormat = pDocument->GetNumberFormat( aPos ); SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); if ( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) nCellFormat = GetStandardFormat( *pFormatter,nCellFormat ); - ULONG nURLFormat = ScGlobal::GetStandardFormat( *pFormatter,nCellFormat, NUMBERFORMAT_NUMBER); + sal_uLong nURLFormat = ScGlobal::GetStandardFormat( *pFormatter,nCellFormat, NUMBERFORMAT_NUMBER); if ( IsValue() ) { @@ -1926,32 +1926,32 @@ ScDetectiveRefIter::ScDetectiveRefIter( ScFormulaCell* pCell ) aPos = pCell->aPos; } -BOOL lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) +sal_Bool lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) { ScSingleRefData& rRef1 = p->GetSingleRef(); if ( rRef1.IsColDeleted() || rRef1.IsRowDeleted() || rRef1.IsTabDeleted() || !rRef1.Valid() ) - return TRUE; + return true; if ( p->GetType() == svDoubleRef || p->GetType() == svExternalDoubleRef ) { ScSingleRefData& rRef2 = p->GetDoubleRef().Ref2; if ( rRef2.IsColDeleted() || rRef2.IsRowDeleted() || rRef2.IsTabDeleted() || !rRef2.Valid() ) - return TRUE; + return sal_True; } - return FALSE; + return false; } -BOOL ScDetectiveRefIter::GetNextRef( ScRange& rRange ) +sal_Bool ScDetectiveRefIter::GetNextRef( ScRange& rRange ) { - BOOL bRet = FALSE; + sal_Bool bRet = false; ScToken* p = GetNextRefToken(); if( p ) { SingleDoubleRefProvider aProv( *p ); rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab ); rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); - bRet = TRUE; + bRet = true; } return bRet; diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 083044f5e076..8969bed4b68f 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -60,7 +60,7 @@ using namespace formula; // STATIC DATA ----------------------------------------------------------- #ifdef USE_MEMPOOL -const USHORT nMemPoolEditCell = (0x1000 - 64) / sizeof(ScNoteCell); +const sal_uInt16 nMemPoolEditCell = (0x1000 - 64) / sizeof(ScNoteCell); IMPL_FIXEDMEMPOOL_NEWDEL( ScEditCell, nMemPoolEditCell, nMemPoolEditCell ) #endif @@ -145,19 +145,19 @@ void ScEditCell::GetString( String& rString ) const void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr ) { const struct { - USHORT nAttrType; - USHORT nCharType; + sal_uInt16 nAttrType; + sal_uInt16 nCharType; } AttrTypeMap[] = { { ATTR_FONT, EE_CHAR_FONTINFO }, { ATTR_FONT_HEIGHT, EE_CHAR_FONTHEIGHT }, { ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT }, { ATTR_FONT_COLOR, EE_CHAR_COLOR } }; - USHORT nMapCount = SAL_N_ELEMENTS(AttrTypeMap); + sal_uInt16 nMapCount = SAL_N_ELEMENTS(AttrTypeMap); const SfxItemSet& rSet = rAttr.GetItemSet(); const SfxPoolItem* pItem; - for (USHORT i = 0; i < nMapCount; ++i) + for (sal_uInt16 i = 0; i < nMapCount; ++i) { if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SFX_ITEM_SET ) pData->RemoveCharAttribs(AttrTypeMap[i].nCharType); @@ -178,9 +178,9 @@ void ScEditCell::SetTextObject( const EditTextObject* pObject, EditEngine& rEngine = pDoc->GetEditEngine(); if ( pObject->HasOnlineSpellErrors() ) { - ULONG nControl = rEngine.GetControlWord(); - const ULONG nSpellControl = EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS; - BOOL bNewControl = ( (nControl & nSpellControl) != nSpellControl ); + sal_uLong nControl = rEngine.GetControlWord(); + const sal_uLong nSpellControl = EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS; + sal_Bool bNewControl = ( (nControl & nSpellControl) != nSpellControl ); if ( bNewControl ) rEngine.SetControlWord( nControl | nSpellControl ); rEngine.SetText( *pObject ); @@ -485,19 +485,19 @@ bool lcl_isReference(const FormulaToken& rToken) } -BOOL ScFormulaCell::IsEmpty() +sal_Bool ScFormulaCell::IsEmpty() { MaybeInterpret(); return aResult.GetCellResultType() == formula::svEmptyCell; } -BOOL ScFormulaCell::IsEmptyDisplayedAsString() +sal_Bool ScFormulaCell::IsEmptyDisplayedAsString() { MaybeInterpret(); return aResult.IsEmptyDisplayedAsString(); } -BOOL ScFormulaCell::IsValue() +sal_Bool ScFormulaCell::IsValue() { MaybeInterpret(); return aResult.IsValue(); @@ -536,20 +536,20 @@ const ScMatrix* ScFormulaCell::GetMatrix() // Was stored !bDirty but an accompanying matrix cell was bDirty? // => we need to get the matrix. if (!bDirty && cMatrixFlag == MM_FORMULA && !aResult.GetMatrix()) - bDirty = TRUE; + bDirty = true; if ( IsDirtyOrInTableOpDirty() ) Interpret(); } return aResult.GetMatrix().get(); } -BOOL ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const +sal_Bool ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const { switch ( cMatrixFlag ) { case MM_FORMULA : rPos = aPos; - return TRUE; + return true; case MM_REFERENCE : { pCode->Reset(); @@ -561,13 +561,13 @@ BOOL ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const if ( rRef.Valid() ) { rPos.Set( rRef.nCol, rRef.nRow, rRef.nTab ); - return TRUE; + return sal_True; } } } break; } - return FALSE; + return false; } @@ -583,7 +583,7 @@ BOOL ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const (reserviert: offen: 32) */ -USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) +sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) { switch ( cMatrixFlag ) { @@ -616,7 +616,7 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) ScBaseCell* pCell; ScAddress aAdr( aOrg ); aAdr.IncCol(); - BOOL bCont = TRUE; + sal_Bool bCont = sal_True; do { pCell = pDocument->GetCell( aAdr ); @@ -628,11 +628,11 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) aAdr.IncCol(); } else - bCont = FALSE; + bCont = false; } while ( bCont ); aAdr = aOrg; aAdr.IncRow(); - bCont = TRUE; + bCont = sal_True; do { pCell = pDocument->GetCell( aAdr ); @@ -644,7 +644,7 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) aAdr.IncRow(); } else - bCont = FALSE; + bCont = false; } while ( bCont ); pFCell->SetMatColsRows( nC, nR ); } @@ -667,7 +667,7 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) // here we are, healthy and clean, somewhere in between SCsCOL dC = aPos.Col() - aOrg.Col(); SCsROW dR = aPos.Row() - aOrg.Row(); - USHORT nEdges = 0; + sal_uInt16 nEdges = 0; if ( dC >= 0 && dR >= 0 && dC < nC && dR < nR ) { if ( dC == 0 ) @@ -710,28 +710,28 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) } } -USHORT ScFormulaCell::GetErrCode() +sal_uInt16 ScFormulaCell::GetErrCode() { MaybeInterpret(); /* FIXME: If ScTokenArray::SetCodeError() was really only for code errors * and not also abused for signaling other error conditions we could bail * out even before attempting to interpret broken code. */ - USHORT nErr = pCode->GetCodeError(); + sal_uInt16 nErr = pCode->GetCodeError(); if (nErr) return nErr; return aResult.GetResultError(); } -USHORT ScFormulaCell::GetRawError() +sal_uInt16 ScFormulaCell::GetRawError() { - USHORT nErr = pCode->GetCodeError(); + sal_uInt16 nErr = pCode->GetCodeError(); if (nErr) return nErr; return aResult.GetResultError(); } -BOOL ScFormulaCell::HasOneReference( ScRange& r ) const +sal_Bool ScFormulaCell::HasOneReference( ScRange& r ) const { pCode->Reset(); ScToken* p = static_cast<ScToken*>(pCode->GetNextReferenceRPN()); @@ -745,10 +745,10 @@ BOOL ScFormulaCell::HasOneReference( ScRange& r ) const r.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); - return TRUE; + return sal_True; } else - return FALSE; + return false; } bool @@ -805,7 +805,7 @@ ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const return false; } -BOOL ScFormulaCell::HasRelNameReference() const +sal_Bool ScFormulaCell::HasRelNameReference() const { pCode->Reset(); ScToken* t; @@ -814,12 +814,12 @@ BOOL ScFormulaCell::HasRelNameReference() const if ( t->GetSingleRef().IsRelName() || (t->GetType() == formula::svDoubleRef && t->GetDoubleRef().Ref2.IsRelName()) ) - return TRUE; + return sal_True; } - return FALSE; + return false; } -BOOL ScFormulaCell::HasColRowName() const +sal_Bool ScFormulaCell::HasColRowName() const { pCode->Reset(); return (pCode->GetNextColRowName() != NULL); @@ -845,8 +845,8 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, if ( pUndoCellPos ) aUndoPos = *pUndoCellPos; ScAddress aOldPos( aPos ); -// BOOL bPosChanged = FALSE; // ob diese Zelle bewegt wurde - BOOL bIsInsert = FALSE; +// sal_Bool bPosChanged = sal_False; // ob diese Zelle bewegt wurde + sal_Bool bIsInsert = false; if (eUpdateRefMode == URM_INSDEL) { bIsInsert = (nDx >= 0 && nDy >= 0 && nDz >= 0); @@ -899,9 +899,9 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, aOldPos.Set( nCol - nDx, nRow - nDy, nTab - nDz ); } - BOOL bHasRefs = FALSE; - BOOL bHasColRowNames = FALSE; - BOOL bOnRefMove = FALSE; + sal_Bool bHasRefs = false; + sal_Bool bHasColRowNames = false; + sal_Bool bOnRefMove = false; if ( !pDocument->IsClipOrUndo() ) { pCode->Reset(); @@ -944,7 +944,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, bOnRefMove = (bValChanged || (aPos != aOldPos)); // Cell may reference itself, e.g. ocColumn, ocRow without parameter - BOOL bColRowNameCompile, bHasRelName, bNewListening, bInDeleteUndo; + sal_Bool bColRowNameCompile, bHasRelName, bNewListening, bInDeleteUndo; if ( bHasRefs ) { // Upon Insert ColRowNames have to be recompiled in case the @@ -953,7 +953,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, (eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0)); if ( bColRowNameCompile ) { - bColRowNameCompile = FALSE; + bColRowNameCompile = false; ScToken* t; ScRangePairList* pColList = pDocument->GetColNameRanges(); ScRangePairList* pRowList = pDocument->GetRowNameRanges(); @@ -969,12 +969,12 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, if ( pR ) { // definiert if ( pR->GetRange(1).aStart.Row() == nRow1 ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } else { // on the fly if ( rRef.nRow + 1 == nRow1 ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } } if ( nDx > 0 && rRef.IsRowRel() ) @@ -985,12 +985,12 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, if ( pR ) { // definiert if ( pR->GetRange(1).aStart.Col() == nCol1 ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } else { // on the fly if ( rRef.nCol + 1 == nCol1 ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } } } @@ -1001,11 +1001,11 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, bColRowNameCompile = bCompile; // evtl. aus Copy-ctor if ( !bColRowNameCompile ) { - BOOL bMoved = (aPos != aOldPos); + sal_Bool bMoved = (aPos != aOldPos); pCode->Reset(); ScToken* t = static_cast<ScToken*>(pCode->GetNextColRowName()); if ( t && bMoved ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; while ( t && !bColRowNameCompile ) { ScSingleRefData& rRef = t->GetSingleRef(); @@ -1014,7 +1014,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, { ScAddress aAdr( rRef.nCol, rRef.nRow, rRef.nTab ); if ( r.In( aAdr ) ) - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } t = static_cast<ScToken*>(pCode->GetNextColRowName()); } @@ -1022,13 +1022,13 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, } else if ( eUpdateRefMode == URM_COPY && bHasColRowNames && bValChanged ) { - bColRowNameCompile = TRUE; + bColRowNameCompile = sal_True; } ScChangeTrack* pChangeTrack = pDocument->GetChangeTrack(); if ( pChangeTrack && pChangeTrack->IsInDeleteUndo() ) - bInDeleteUndo = TRUE; + bInDeleteUndo = sal_True; else - bInDeleteUndo = FALSE; + bInDeleteUndo = false; // RelNameRefs are always moved bHasRelName = HasRelNameReference(); // Reference changed and new listening needed? @@ -1048,7 +1048,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, else { bColRowNameCompile = bHasRelName = bNewListening = bInDeleteUndo = - FALSE; + false; } bool bNeedDirty = false; @@ -1109,7 +1109,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, // UpdateReference calls. // All replaced shared formula listeners have to be // established after an Insert or Delete. Do nothing here. - SetNeedsListening( TRUE); + SetNeedsListening( sal_True); } else StartListeningTo( pDocument ); @@ -1117,9 +1117,9 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, } if ( bNeedDirty && (!(eUpdateRefMode == URM_INSDEL && bHasRelName) || pRangeData) ) { // Referenzen abgeschnitten, ungueltig o.ae.? - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); // kein Interpret in SubMinimalRecalc wegen evtl. falscher Referenzen - pDocument->SetAutoCalc( FALSE ); + pDocument->SetAutoCalc( false ); SetDirty(); pDocument->SetAutoCalc( bOldAutoCalc ); } @@ -1131,7 +1131,7 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, void ScFormulaCell::UpdateInsertTab(SCTAB nTable) { - BOOL bPosChanged = ( aPos.Tab() >= nTable ? TRUE : FALSE ); + sal_Bool bPosChanged = ( aPos.Tab() >= nTable ? sal_True : false ); pCode->Reset(); if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() ) { @@ -1142,21 +1142,21 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable) ScRangeData* pRangeData; ScCompiler aComp(pDocument, aPos, *pCode); aComp.SetGrammar(pDocument->GetGrammar()); - pRangeData = aComp.UpdateInsertTab( nTable, FALSE ); + pRangeData = aComp.UpdateInsertTab( nTable, false ); if (pRangeData) // Shared Formula gegen echte Formel { // austauschen - BOOL bRefChanged; + sal_Bool bRefChanged; pDocument->RemoveFromFormulaTree( this ); // update formula count delete pCode; pCode = new ScTokenArray( *pRangeData->GetCode() ); ScCompiler aComp2(pDocument, aPos, *pCode); aComp2.SetGrammar(pDocument->GetGrammar()); aComp2.MoveRelWrap(pRangeData->GetMaxCol(), pRangeData->GetMaxRow()); - aComp2.UpdateInsertTab( nTable, FALSE ); + aComp2.UpdateInsertTab( nTable, false ); // If the shared formula contained a named range/formula containing // an absolute reference to a sheet, those have to be readjusted. - aComp2.UpdateDeleteTab( nTable, FALSE, TRUE, bRefChanged ); - bCompile = TRUE; + aComp2.UpdateDeleteTab( nTable, false, sal_True, bRefChanged ); + bCompile = sal_True; } // kein StartListeningTo weil pTab[nTab] noch nicht existiert! } @@ -1164,10 +1164,10 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable) aPos.IncTab(); } -BOOL ScFormulaCell::UpdateDeleteTab(SCTAB nTable, BOOL bIsMove) +sal_Bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove) { - BOOL bRefChanged = FALSE; - BOOL bPosChanged = ( aPos.Tab() > nTable ? TRUE : FALSE ); + sal_Bool bRefChanged = false; + sal_Bool bPosChanged = ( aPos.Tab() > nTable ? sal_True : false ); pCode->Reset(); if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() ) { @@ -1178,7 +1178,7 @@ BOOL ScFormulaCell::UpdateDeleteTab(SCTAB nTable, BOOL bIsMove) ScRangeData* pRangeData; ScCompiler aComp(pDocument, aPos, *pCode); aComp.SetGrammar(pDocument->GetGrammar()); - pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, FALSE, bRefChanged); + pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, false, bRefChanged); if (pRangeData) // Shared Formula gegen echte Formel { // austauschen pDocument->RemoveFromFormulaTree( this ); // update formula count @@ -1188,13 +1188,13 @@ BOOL ScFormulaCell::UpdateDeleteTab(SCTAB nTable, BOOL bIsMove) aComp2.SetGrammar(pDocument->GetGrammar()); aComp2.CompileTokenArray(); aComp2.MoveRelWrap(pRangeData->GetMaxCol(), pRangeData->GetMaxRow()); - aComp2.UpdateDeleteTab( nTable, FALSE, FALSE, bRefChanged ); + aComp2.UpdateDeleteTab( nTable, false, false, bRefChanged ); // If the shared formula contained a named range/formula containing // an absolute reference to a sheet, those have to be readjusted. - aComp2.UpdateInsertTab( nTable,TRUE ); + aComp2.UpdateInsertTab( nTable,sal_True ); // bRefChanged kann beim letzten UpdateDeleteTab zurueckgesetzt worden sein - bRefChanged = TRUE; - bCompile = TRUE; + bRefChanged = sal_True; + bCompile = sal_True; } // kein StartListeningTo weil pTab[nTab] noch nicht korrekt! } @@ -1215,7 +1215,7 @@ void ScFormulaCell::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo ) ScRangeData* pRangeData; ScCompiler aComp(pDocument, aPos, *pCode); aComp.SetGrammar(pDocument->GetGrammar()); - pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, FALSE ); + pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, false ); if (pRangeData) // Shared Formula gegen echte Formel { // austauschen pDocument->RemoveFromFormulaTree( this ); // update formula count @@ -1225,8 +1225,8 @@ void ScFormulaCell::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo ) aComp2.SetGrammar(pDocument->GetGrammar()); aComp2.CompileTokenArray(); aComp2.MoveRelWrap(pRangeData->GetMaxCol(), pRangeData->GetMaxRow()); - aComp2.UpdateMoveTab( nOldPos, nNewPos, TRUE ); - bCompile = TRUE; + aComp2.UpdateMoveTab( nOldPos, nNewPos, sal_True ); + bCompile = sal_True; } // kein StartListeningTo weil pTab[nTab] noch nicht korrekt! } @@ -1256,9 +1256,9 @@ void ScFormulaCell::UpdateInsertTabAbs(SCTAB nTable) } } -BOOL ScFormulaCell::TestTabRefAbs(SCTAB nTable) +sal_Bool ScFormulaCell::TestTabRefAbs(SCTAB nTable) { - BOOL bRet = FALSE; + sal_Bool bRet = false; if( !pDocument->IsClipOrUndo() ) { pCode->Reset(); @@ -1269,7 +1269,7 @@ BOOL ScFormulaCell::TestTabRefAbs(SCTAB nTable) if( !rRef1.IsTabRel() ) { if( (SCsTAB) nTable != rRef1.nTab ) - bRet = TRUE; + bRet = sal_True; else if (nTable != aPos.Tab()) rRef1.nTab = aPos.Tab(); } @@ -1279,7 +1279,7 @@ BOOL ScFormulaCell::TestTabRefAbs(SCTAB nTable) if( !rRef2.IsTabRel() ) { if( (SCsTAB) nTable != rRef2.nTab ) - bRet = TRUE; + bRet = sal_True; else if (nTable != aPos.Tab()) rRef2.nTab = aPos.Tab(); } @@ -1290,7 +1290,7 @@ BOOL ScFormulaCell::TestTabRefAbs(SCTAB nTable) return bRet; } -void ScFormulaCell::UpdateCompile( BOOL bForceIfNameInUse ) +void ScFormulaCell::UpdateCompile( sal_Bool bForceIfNameInUse ) { if ( bForceIfNameInUse && !bCompile ) bCompile = pCode->HasNameOrColRowName(); @@ -1303,7 +1303,7 @@ void ScFormulaCell::UpdateCompile( BOOL bForceIfNameInUse ) void ScFormulaCell::TransposeReference() { - BOOL bFound = FALSE; + sal_Bool bFound = false; pCode->Reset(); ScToken* t; while ( ( t = static_cast<ScToken*>(pCode->GetNextReference()) ) != NULL ) @@ -1311,11 +1311,11 @@ void ScFormulaCell::TransposeReference() ScSingleRefData& rRef1 = t->GetSingleRef(); if ( rRef1.IsColRel() && rRef1.IsRowRel() ) { - BOOL bDouble = (t->GetType() == formula::svDoubleRef); + sal_Bool bDouble = (t->GetType() == formula::svDoubleRef); ScSingleRefData& rRef2 = (bDouble ? t->GetDoubleRef().Ref2 : rRef1); if ( !bDouble || (rRef2.IsColRel() && rRef2.IsRowRel()) ) { - INT16 nTemp; + sal_Int16 nTemp; nTemp = rRef1.nRelCol; rRef1.nRelCol = static_cast<SCCOL>(rRef1.nRelRow); @@ -1328,13 +1328,13 @@ void ScFormulaCell::TransposeReference() rRef2.nRelRow = static_cast<SCROW>(nTemp); } - bFound = TRUE; + bFound = sal_True; } } } if (bFound) - bCompile = TRUE; + bCompile = sal_True; } void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest, @@ -1343,7 +1343,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD EndListeningTo( pDocument ); ScAddress aOldPos = aPos; - BOOL bPosChanged = FALSE; // ob diese Zelle bewegt wurde + sal_Bool bPosChanged = false; // ob diese Zelle bewegt wurde ScRange aDestRange( rDest, ScAddress( static_cast<SCCOL>(rDest.Col() + rSource.aEnd.Row() - rSource.aStart.Row()), @@ -1357,11 +1357,11 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD SCsTAB nRelPosZ = aOldPos.Tab(); ScRefUpdate::DoTranspose( nRelPosX, nRelPosY, nRelPosZ, pDocument, aDestRange, rSource.aStart ); aOldPos.Set( nRelPosX, nRelPosY, nRelPosZ ); - bPosChanged = TRUE; + bPosChanged = sal_True; } ScTokenArray* pOld = pUndoDoc ? pCode->Clone() : NULL; - BOOL bRefChanged = FALSE; + sal_Bool bRefChanged = false; ScToken* t; ScRangeData* pShared = NULL; @@ -1374,7 +1374,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD if (pName) { if (pName->IsModified()) - bRefChanged = TRUE; + bRefChanged = sal_True; if (pName->HasType(RT_SHAREDMOD)) pShared = pName; } @@ -1382,7 +1382,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD else if( t->GetType() != svIndex ) { t->CalcAbsIfRel( aOldPos ); - BOOL bMod; + sal_Bool bMod; { // own scope for SingleDoubleRefModifier dtor if SingleRef SingleDoubleRefModifier aMod( *t ); ScComplexRefData& rRef = aMod.Ref(); @@ -1392,7 +1392,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD if ( bMod ) { t->CalcRelFromAbs( aPos ); - bRefChanged = TRUE; + bRefChanged = sal_True; } } } @@ -1402,14 +1402,14 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD pDocument->RemoveFromFormulaTree( this ); // update formula count delete pCode; pCode = new ScTokenArray( *pShared->GetCode() ); - bRefChanged = TRUE; + bRefChanged = sal_True; pCode->Reset(); while( (t = static_cast<ScToken*>(pCode->GetNextReference())) != NULL ) { if( t->GetType() != svIndex ) { t->CalcAbsIfRel( aOldPos ); - BOOL bMod; + sal_Bool bMod; { // own scope for SingleDoubleRefModifier dtor if SingleRef SingleDoubleRefModifier aMod( *t ); ScComplexRefData& rRef = aMod.Ref(); @@ -1432,7 +1432,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD pUndoDoc->PutCell( aPos.Col(), aPos.Row(), aPos.Tab(), pFCell ); } - bCompile = TRUE; + bCompile = sal_True; CompileTokenArray(); // ruft auch StartListeningTo SetDirty(); } @@ -1446,7 +1446,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY { EndListeningTo( pDocument ); - BOOL bRefChanged = FALSE; + sal_Bool bRefChanged = false; ScToken* t; ScRangeData* pShared = NULL; @@ -1459,7 +1459,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY if (pName) { if (pName->IsModified()) - bRefChanged = TRUE; + bRefChanged = sal_True; if (pName->HasType(RT_SHAREDMOD)) pShared = pName; } @@ -1467,7 +1467,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY else if( t->GetType() != svIndex ) { t->CalcAbsIfRel( aPos ); - BOOL bMod; + sal_Bool bMod; { // own scope for SingleDoubleRefModifier dtor if SingleRef SingleDoubleRefModifier aMod( *t ); ScComplexRefData& rRef = aMod.Ref(); @@ -1477,7 +1477,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY if ( bMod ) { t->CalcRelFromAbs( aPos ); - bRefChanged = TRUE; + bRefChanged = sal_True; } } } @@ -1487,14 +1487,14 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY pDocument->RemoveFromFormulaTree( this ); // update formula count delete pCode; pCode = new ScTokenArray( *pShared->GetCode() ); - bRefChanged = TRUE; + bRefChanged = sal_True; pCode->Reset(); while( (t = static_cast<ScToken*>(pCode->GetNextReference())) != NULL ) { if( t->GetType() != svIndex ) { t->CalcAbsIfRel( aPos ); - BOOL bMod; + sal_Bool bMod; { // own scope for SingleDoubleRefModifier dtor if SingleRef SingleDoubleRefModifier aMod( *t ); ScComplexRefData& rRef = aMod.Ref(); @@ -1509,7 +1509,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY if (bRefChanged) { - bCompile = TRUE; + bCompile = sal_True; CompileTokenArray(); // ruft auch StartListeningTo SetDirty(); } @@ -1517,39 +1517,39 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY StartListeningTo( pDocument ); // Listener wie vorher } -BOOL lcl_IsRangeNameInUse(size_t nIndex, ScTokenArray* pCode, ScRangeName* pNames) +sal_Bool lcl_IsRangeNameInUse(size_t nIndex, ScTokenArray* pCode, ScRangeName* pNames) { for (FormulaToken* p = pCode->First(); p; p = pCode->Next()) { if (p->GetOpCode() == ocName) { - if (p->GetIndex() == static_cast<USHORT>(nIndex)) - return TRUE; + if (p->GetIndex() == static_cast<sal_uInt16>(nIndex)) + return true; else { // RangeData kann Null sein in bestimmten Excel-Dateien ScRangeData* pSubName = pNames->findByIndex(p->GetIndex()); if (pSubName && lcl_IsRangeNameInUse(nIndex, pSubName->GetCode(), pNames)) - return TRUE; + return sal_True; } } } - return FALSE; + return false; } -BOOL ScFormulaCell::IsRangeNameInUse(USHORT nIndex) const +sal_Bool ScFormulaCell::IsRangeNameInUse(sal_uInt16 nIndex) const { return lcl_IsRangeNameInUse( nIndex, pCode, pDocument->GetRangeName() ); } -void lcl_FindRangeNamesInUse(std::set<USHORT>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames) +void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames) { for (FormulaToken* p = pCode->First(); p; p = pCode->Next()) { if (p->GetOpCode() == ocName) { - USHORT nTokenIndex = p->GetIndex(); + sal_uInt16 nTokenIndex = p->GetIndex(); rIndexes.insert( nTokenIndex ); ScRangeData* pSubName = pNames->findByIndex(p->GetIndex()); @@ -1559,7 +1559,7 @@ void lcl_FindRangeNamesInUse(std::set<USHORT>& rIndexes, ScTokenArray* pCode, Sc } } -void ScFormulaCell::FindRangeNamesInUse(std::set<USHORT>& rIndexes) const +void ScFormulaCell::FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes) const { lcl_FindRangeNamesInUse( rIndexes, pCode, pDocument->GetRangeName() ); } @@ -1576,7 +1576,7 @@ void ScFormulaCell::ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap ) if ( nIndex != nNewIndex ) { p->SetIndex( nNewIndex ); - bCompile = TRUE; + bCompile = sal_True; } } } @@ -1591,7 +1591,7 @@ void ScFormulaCell::CompileDBFormula() if ( p->GetOpCode() == ocDBArea || (p->GetOpCode() == ocName && p->GetIndex() >= SC_START_INDEX_DB_COLL) ) { - bCompile = TRUE; + bCompile = sal_True; CompileTokenArray(); SetDirty(); break; @@ -1599,14 +1599,14 @@ void ScFormulaCell::CompileDBFormula() } } -void ScFormulaCell::CompileDBFormula( BOOL bCreateFormulaString ) +void ScFormulaCell::CompileDBFormula( sal_Bool bCreateFormulaString ) { // zwei Phasen, muessen (!) nacheinander aufgerufen werden: // 1. FormelString mit alten Namen erzeugen // 2. FormelString mit neuen Namen kompilieren if ( bCreateFormulaString ) { - BOOL bRecompile = FALSE; + sal_Bool bRecompile = false; pCode->Reset(); for ( FormulaToken* p = pCode->First(); p && !bRecompile; p = pCode->Next() ) { @@ -1615,11 +1615,11 @@ void ScFormulaCell::CompileDBFormula( BOOL bCreateFormulaString ) case ocBad: // DB-Bereich evtl. zugefuegt case ocColRowName: // falls Namensgleichheit case ocDBArea: // DB-Bereich - bRecompile = TRUE; + bRecompile = sal_True; break; case ocName: if ( p->GetIndex() >= SC_START_INDEX_DB_COLL ) - bRecompile = TRUE; // DB-Bereich + bRecompile = sal_True; // DB-Bereich break; default: ; // nothing @@ -1644,20 +1644,20 @@ void ScFormulaCell::CompileDBFormula( BOOL bCreateFormulaString ) } else if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() ) { - Compile( aResult.GetHybridFormula(), FALSE, eTempGrammar ); + Compile( aResult.GetHybridFormula(), false, eTempGrammar ); aResult.SetToken( NULL); SetDirty(); } } -void ScFormulaCell::CompileNameFormula( BOOL bCreateFormulaString ) +void ScFormulaCell::CompileNameFormula( sal_Bool bCreateFormulaString ) { // zwei Phasen, muessen (!) nacheinander aufgerufen werden: // 1. FormelString mit alten RangeNames erzeugen // 2. FormelString mit neuen RangeNames kompilieren if ( bCreateFormulaString ) { - BOOL bRecompile = FALSE; + sal_Bool bRecompile = false; pCode->Reset(); for ( FormulaToken* p = pCode->First(); p && !bRecompile; p = pCode->Next() ) { @@ -1665,11 +1665,11 @@ void ScFormulaCell::CompileNameFormula( BOOL bCreateFormulaString ) { case ocBad: // RangeName evtl. zugefuegt case ocColRowName: // falls Namensgleichheit - bRecompile = TRUE; + bRecompile = true; break; default: if ( p->GetType() == svIndex ) - bRecompile = TRUE; // RangeName + bRecompile = sal_True; // RangeName } } if ( bRecompile ) @@ -1691,7 +1691,7 @@ void ScFormulaCell::CompileNameFormula( BOOL bCreateFormulaString ) } else if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() ) { - Compile( aResult.GetHybridFormula(), FALSE, eTempGrammar ); + Compile( aResult.GetHybridFormula(), false, eTempGrammar ); aResult.SetToken( NULL); SetDirty(); } @@ -1704,7 +1704,7 @@ void ScFormulaCell::CompileColRowNameFormula() { if ( p->GetOpCode() == ocColRowName ) { - bCompile = TRUE; + bCompile = sal_True; CompileTokenArray(); SetDirty(); break; diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx index 17690a2f1f8f..c39b69c3385a 100644 --- a/sc/source/core/data/clipparam.cxx +++ b/sc/source/core/data/clipparam.cxx @@ -37,13 +37,15 @@ using ::std::vector; ScClipParam::ScClipParam() : meDirection(Unspecified), - mbCutMode(false) + mbCutMode(false), + mnSourceDocID(0) { } ScClipParam::ScClipParam(const ScRange& rRange, bool bCutMode) : meDirection(Unspecified), - mbCutMode(bCutMode) + mbCutMode(bCutMode), + mnSourceDocID(0) { maRanges.Append(rRange); } @@ -51,7 +53,9 @@ ScClipParam::ScClipParam(const ScRange& rRange, bool bCutMode) : ScClipParam::ScClipParam(const ScClipParam& r) : maRanges(r.maRanges), meDirection(r.meDirection), - mbCutMode(r.mbCutMode) + mbCutMode(r.mbCutMode), + mnSourceDocID(r.mnSourceDocID), + maProtectedChartRangesVector(r.maProtectedChartRangesVector) { } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c2dd57f921fc..b85caa2a06ef 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -66,18 +66,18 @@ extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx using namespace formula; // STATIC DATA ----------------------------------------------------------- -bool ScColumn::bDoubleAlloc = FALSE; // fuer Import: Groesse beim Allozieren verdoppeln +bool ScColumn::bDoubleAlloc = false; // fuer Import: Groesse beim Allozieren verdoppeln void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell ) { - BOOL bIsAppended = FALSE; + sal_Bool bIsAppended = false; if (pItems && nCount>0) { if (pItems[nCount-1].nRow < nRow) { Append(nRow, pNewCell ); - bIsAppended = TRUE; + bIsAppended = sal_True; } } if ( !bIsAppended ) @@ -162,12 +162,12 @@ void ScColumn::Insert( SCROW nRow, sal_uInt32 nNumberFormat, ScBaseCell* pCell ) { Insert(nRow, pCell); short eOldType = pDocument->GetFormatTable()-> - GetType( (ULONG) + GetType( (sal_uLong) ((SfxUInt32Item*)GetAttr( nRow, ATTR_VALUE_FORMAT ))-> GetValue() ); short eNewType = pDocument->GetFormatTable()->GetType(nNumberFormat); if (!pDocument->GetFormatTable()->IsCompatible(eOldType, eNewType)) - ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, (UINT32) nNumberFormat) ); + ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, (sal_uInt32) nNumberFormat) ); } @@ -276,10 +276,10 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) if ( nFirstIndex >= nCount ) return ; - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden - BOOL bFound=FALSE; + sal_Bool bFound=false; SCROW nEndRow = nStartRow + nSize - 1; SCSIZE nStartIndex = 0; SCSIZE nEndIndex = 0; @@ -290,7 +290,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) if (!bFound) { nStartIndex = i; - bFound = TRUE; + bFound = sal_True; } nEndIndex = i; @@ -321,7 +321,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL) ScAddress& rAddress = aHint.GetAddress(); // for sparse occupation use single broadcasts, not ranges - BOOL bSingleBroadcasts = (((pItems[nCount-1].nRow - pItems[i].nRow) / + sal_Bool bSingleBroadcasts = (((pItems[nCount-1].nRow - pItems[i].nRow) / (nCount - i)) > 1); if ( bSingleBroadcasts ) { @@ -364,7 +364,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) } -void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, USHORT nDelFlag ) +void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag ) { /* If caller specifies to not remove the note caption objects, all cells have to forget the pointers to them. This is used e.g. while undoing a @@ -433,13 +433,13 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, USHORT nDelFla { case CELLTYPE_VALUE: { - USHORT nValFlags = nDelFlag & (IDF_DATETIME|IDF_VALUE); + sal_uInt16 nValFlags = nDelFlag & (IDF_DATETIME|IDF_VALUE); // delete values and dates? bDelete = nValFlags == (IDF_DATETIME|IDF_VALUE); // if not, decide according to cell number format if( !bDelete && (nValFlags != 0) ) { - ULONG nIndex = (ULONG)((SfxUInt32Item*)GetAttr( pItems[j].nRow, ATTR_VALUE_FORMAT ))->GetValue(); + sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)GetAttr( pItems[j].nRow, ATTR_VALUE_FORMAT ))->GetValue(); short nType = pDocument->GetFormatTable()->GetType(nIndex); bool bIsDate = (nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_TIME) || (nType == NUMBERFORMAT_DATETIME); bDelete = nValFlags == (bIsDate ? IDF_DATETIME : IDF_VALUE); @@ -549,18 +549,18 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, USHORT nDelFla } -void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) +void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag) { // FreeAll darf hier nicht gerufen werden wegen Broadcastern // Attribute erst am Ende, damit vorher noch zwischen Zahlen und Datum // unterschieden werden kann (#47901#) - USHORT nContMask = IDF_CONTENTS; + sal_uInt16 nContMask = IDF_CONTENTS; // IDF_NOCAPTIONS needs to be passed too, if IDF_NOTE is set if( nDelFlag & IDF_NOTE ) nContMask |= IDF_NOCAPTIONS; - USHORT nContFlag = nDelFlag & nContMask; + sal_uInt16 nContFlag = nDelFlag & nContMask; if (pItems && nCount>0 && nContFlag) { @@ -568,7 +568,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) DeleteRange( 0, nCount-1, nContFlag ); else { - BOOL bFound=FALSE; + sal_Bool bFound=false; SCSIZE nStartIndex = 0; SCSIZE nEndIndex = 0; for (SCSIZE i = 0; i < nCount; i++) @@ -577,7 +577,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) if (!bFound) { nStartIndex = i; - bFound = TRUE; + bFound = sal_True; } nEndIndex = i; } @@ -599,29 +599,29 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, USHORT nDelFlag) ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& rDestPos, - SCSIZE nIndex, USHORT nFlags ) const + SCSIZE nIndex, sal_uInt16 nFlags ) const { - USHORT nContFlags = nFlags & IDF_CONTENTS; + sal_uInt16 nContFlags = nFlags & IDF_CONTENTS; if (!nContFlags) return NULL; // Testen, ob Zelle kopiert werden soll // auch bei IDF_CONTENTS komplett, wegen Notes / Broadcastern - BOOL bMatch = FALSE; + sal_Bool bMatch = false; ScBaseCell* pCell = pItems[nIndex].pCell; CellType eCellType = pCell->GetCellType(); switch ( eCellType ) { case CELLTYPE_VALUE: { - USHORT nValFlags = nFlags & (IDF_DATETIME|IDF_VALUE); + sal_uInt16 nValFlags = nFlags & (IDF_DATETIME|IDF_VALUE); if ( nValFlags == (IDF_DATETIME|IDF_VALUE) ) - bMatch = TRUE; + bMatch = sal_True; else if ( nValFlags ) { - ULONG nNumIndex = (ULONG)((SfxUInt32Item*)GetAttr( + sal_uLong nNumIndex = (sal_uLong)((SfxUInt32Item*)GetAttr( pItems[nIndex].nRow, ATTR_VALUE_FORMAT ))->GetValue(); short nTyp = pDocument->GetFormatTable()->GetType(nNumIndex); if ((nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) || (nTyp == NUMBERFORMAT_DATETIME)) @@ -649,7 +649,7 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r aRef.nRow = pItems[nIndex].nRow; aRef.nTab = nTab; aRef.InitFlags(); // -> alles absolut - aRef.SetFlag3D(TRUE); + aRef.SetFlag3D(true); //! 3D(FALSE) und TabRel(TRUE), wenn die endgueltige Position auf der selben Tabelle ist? //! (bei TransposeClip ist die Zielposition noch nicht bekannt) @@ -667,7 +667,7 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r // nRow1, nRow2 = Zielposition void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, - USHORT nInsFlag, bool bAsLink, bool bSkipAttrForEmpty, + sal_uInt16 nInsFlag, bool bAsLink, bool bSkipAttrForEmpty, ScColumn& rColumn) { if ((nInsFlag & IDF_ATTRIB) != 0) @@ -725,7 +725,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, // nRow wird angepasst aRef.nTab = rColumn.nTab; aRef.InitFlags(); // -> alles absolut - aRef.SetFlag3D(TRUE); + aRef.SetFlag3D(true); for (SCROW nDestRow = nRow1; nDestRow <= nRow2; nDestRow++) { @@ -757,12 +757,12 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, // IDF_ADDNOTES must be passed without other content flags than IDF_NOTE bool bAddNotes = (nInsFlag & (IDF_CONTENTS | IDF_ADDNOTES)) == (IDF_NOTE | IDF_ADDNOTES); - BOOL bAtEnd = FALSE; + sal_Bool bAtEnd = false; for (SCSIZE i = 0; i < nColCount && !bAtEnd; i++) { SCsROW nDestRow = rColumn.pItems[i].nRow + nDy; if ( nDestRow > (SCsROW) nRow2 ) - bAtEnd = TRUE; + bAtEnd = sal_True; else if ( nDestRow >= (SCsROW) nRow1 ) { // rows at the beginning may be skipped if filtered rows are left out, @@ -816,7 +816,7 @@ bool lclCanCloneValue( ScDocument& rDoc, const ScColumn& rCol, SCROW nRow, bool return bCloneValue; // check number format of value cell - ULONG nNumIndex = (ULONG)((SfxUInt32Item*)rCol.GetAttr( nRow, ATTR_VALUE_FORMAT ))->GetValue(); + sal_uLong nNumIndex = (sal_uLong)((SfxUInt32Item*)rCol.GetAttr( nRow, ATTR_VALUE_FORMAT ))->GetValue(); short nTyp = rDoc.GetFormatTable()->GetType( nNumIndex ); bool bIsDateTime = (nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) || (nTyp == NUMBERFORMAT_DATETIME); return bIsDateTime ? bCloneDateTime : bCloneValue; @@ -825,7 +825,7 @@ bool lclCanCloneValue( ScDocument& rDoc, const ScColumn& rCol, SCROW nRow, bool } // namespace -ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos) +ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos) { bool bCloneValue = (nFlags & IDF_VALUE) != 0; bool bCloneDateTime = (nFlags & IDF_DATETIME) != 0; @@ -878,7 +878,7 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestD // ins Undo-Dokument immer nur die Original-Zelle kopieren, // aus Formeln keine Value/String-Zellen erzeugen ScFormulaCell& rForm = (ScFormulaCell&)rSource; - USHORT nErr = rForm.GetErrCode(); + sal_uInt16 nErr = rForm.GetErrCode(); if ( nErr ) { // error codes are cloned with values @@ -940,7 +940,7 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestD } -void ScColumn::MixMarked( const ScMarkData& rMark, USHORT nFunction, +void ScColumn::MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction, bool bSkipEmpty, ScColumn& rSrcCol ) { SCROW nRow1, nRow2; @@ -956,9 +956,9 @@ void ScColumn::MixMarked( const ScMarkData& rMark, USHORT nFunction, // Ergebnis in rVal1 -BOOL lcl_DoFunction( double& rVal1, double nVal2, USHORT nFunction ) +sal_Bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction ) { - BOOL bOk = FALSE; + sal_Bool bOk = false; switch (nFunction) { case PASTE_ADD: @@ -999,7 +999,7 @@ void lcl_AddCode( ScTokenArray& rArr, ScFormulaCell* pCell ) void ScColumn::MixData( SCROW nRow1, SCROW nRow2, - USHORT nFunction, bool bSkipEmpty, + sal_uInt16 nFunction, bool bSkipEmpty, ScColumn& rSrcCol ) { SCSIZE nSrcCount = rSrcCol.nCount; @@ -1025,7 +1025,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, ScBaseCell* pSrc = NULL; ScBaseCell* pDest = NULL; ScBaseCell* pNew = NULL; - BOOL bDelete = FALSE; + sal_Bool bDelete = false; if ( nSrcIndex < nSrcCount && nNextSrc == nRow ) pSrc = rSrcCol.pItems[nSrcIndex].pCell; @@ -1038,8 +1038,8 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, CellType eSrcType = pSrc ? pSrc->GetCellType() : CELLTYPE_NONE; CellType eDestType = pDest ? pDest->GetCellType() : CELLTYPE_NONE; - BOOL bSrcEmpty = ( eSrcType == CELLTYPE_NONE || eSrcType == CELLTYPE_NOTE ); - BOOL bDestEmpty = ( eDestType == CELLTYPE_NONE || eDestType == CELLTYPE_NOTE ); + sal_Bool bSrcEmpty = ( eSrcType == CELLTYPE_NONE || eSrcType == CELLTYPE_NOTE ); + sal_Bool bDestEmpty = ( eDestType == CELLTYPE_NONE || eDestType == CELLTYPE_NOTE ); if ( bSkipEmpty && bDestEmpty ) // Originalzelle wiederherstellen { @@ -1063,12 +1063,12 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, // leere Zellen werden als Werte behandelt - BOOL bSrcVal = ( bSrcEmpty || eSrcType == CELLTYPE_VALUE ); - BOOL bDestVal = ( bDestEmpty || eDestType == CELLTYPE_VALUE ); + sal_Bool bSrcVal = ( bSrcEmpty || eSrcType == CELLTYPE_VALUE ); + sal_Bool bDestVal = ( bDestEmpty || eDestType == CELLTYPE_VALUE ); - BOOL bSrcText = ( eSrcType == CELLTYPE_STRING || + sal_Bool bSrcText = ( eSrcType == CELLTYPE_STRING || eSrcType == CELLTYPE_EDIT ); - BOOL bDestText = ( eDestType == CELLTYPE_STRING || + sal_Bool bDestText = ( eDestType == CELLTYPE_STRING || eDestType == CELLTYPE_EDIT ); // sonst bleibt nur Formel... @@ -1081,7 +1081,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, { // neuen Wert eintragen, oder Fehler bei Ueberlauf - BOOL bOk = lcl_DoFunction( nVal1, nVal2, nFunction ); + sal_Bool bOk = lcl_DoFunction( nVal1, nVal2, nFunction ); if (bOk) pNew = new ScValueCell( nVal1 ); @@ -1103,7 +1103,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, if (pSrc) pNew = pSrc->CloneWithoutNote( *pDocument ); else if (pDest) - bDelete = TRUE; + bDelete = sal_True; } else { @@ -1271,7 +1271,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, return false; ScBaseCell* pNewCell = NULL; - BOOL bIsLoading = FALSE; + sal_Bool bIsLoading = false; if (rString.Len() > 0) { ScSetStringParam aParam; @@ -1326,7 +1326,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, else { double nVal; - BOOL bIsText = FALSE; + sal_Bool bIsText = false; if ( bIsLoading ) { if ( pItems && nCount ) @@ -1345,7 +1345,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, case CELLTYPE_STRING : ((ScStringCell*)pCell)->GetString( aStr ); if ( rString == aStr ) - bIsText = TRUE; + bIsText = true; break; case CELLTYPE_NOTE : // durch =Formel referenziert break; @@ -1386,7 +1386,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, // the old one was the default number, date, time or boolean format. // Exception: If the new format is boolean, always apply it. - BOOL bOverwrite = FALSE; + sal_Bool bOverwrite = false; const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex ); if ( pOldFormat ) { @@ -1397,19 +1397,19 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat( nOldType, pOldFormat->GetLanguage() ) ) { - bOverwrite = TRUE; // default of these types can be overwritten + bOverwrite = true; // default of these types can be overwritten } } } if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) { - bOverwrite = TRUE; // overwrite anything if boolean was detected + bOverwrite = true; // overwrite anything if boolean was detected } if ( bOverwrite ) { ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, - (UINT32) nIndex) ); + (sal_uInt32) nIndex) ); bNumFmtSet = true; } } @@ -1527,11 +1527,11 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec Search( nStartRow, nIndex ); - while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE ) + while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : false ) { ScBaseCell* pCell = pItems[nIndex].pCell; TypedStrData* pData; - ULONG nFormat = GetNumberFormat( nRow ); + sal_uLong nFormat = GetNumberFormat( nRow ); ScCellFormat::GetInputString( pCell, nFormat, aString, *pFormatter ); @@ -1591,11 +1591,11 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, bool bLimit) { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCSIZE nThisIndex; - BOOL bThisUsed = Search( nStartRow, nThisIndex ); + sal_Bool bThisUsed = Search( nStartRow, nThisIndex ); String aString; - USHORT nCells = 0; + sal_uInt16 nCells = 0; // Die Beschraenkung auf angrenzende Zellen (ohne Luecken) ist nicht mehr gewollt // (Featurekommission zur 5.1), stattdessen abwechselnd nach oben und unten suchen, @@ -1625,7 +1625,7 @@ bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, b delete pData; // doppelt else if ( bLimit && rStrings.GetCount() >= DATENT_MAX ) break; // Maximum erreicht - bFound = TRUE; + bFound = true; if ( bLimit ) if (++nCells >= DATENT_SEARCH) @@ -1650,7 +1650,7 @@ bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, b delete pData; // doppelt else if ( bLimit && rStrings.GetCount() >= DATENT_MAX ) break; // Maximum erreicht - bFound = TRUE; + bFound = true; if ( bLimit ) if (++nCells >= DATENT_SEARCH) @@ -1709,7 +1709,7 @@ void ScColumn::RemoveProtected( SCROW nStartRow, SCROW nEndRow ) } -void ScColumn::SetError( SCROW nRow, const USHORT nError) +void ScColumn::SetError( SCROW nRow, const sal_uInt16 nError) { if (VALIDROW(nRow)) { @@ -1740,7 +1740,7 @@ void ScColumn::GetString( SCROW nRow, String& rString ) const ScBaseCell* pCell = pItems[nIndex].pCell; if (pCell->GetCellType() != CELLTYPE_NOTE) { - ULONG nFormat = GetNumberFormat( nRow ); + sal_uLong nFormat = GetNumberFormat( nRow ); ScCellFormat::GetString( pCell, nFormat, rString, &pColor, *(pDocument->GetFormatTable()) ); } else @@ -1759,7 +1759,7 @@ void ScColumn::GetInputString( SCROW nRow, String& rString ) const ScBaseCell* pCell = pItems[nIndex].pCell; if (pCell->GetCellType() != CELLTYPE_NOTE) { - ULONG nFormat = GetNumberFormat( nRow ); + sal_uLong nFormat = GetNumberFormat( nRow ); ScCellFormat::GetInputString( pCell, nFormat, rString, *(pDocument->GetFormatTable()) ); } else @@ -1823,7 +1823,7 @@ CellType ScColumn::GetCellType( SCROW nRow ) const } -USHORT ScColumn::GetErrCode( SCROW nRow ) const +sal_uInt16 ScColumn::GetErrCode( SCROW nRow ) const { SCSIZE nIndex; if (Search(nRow, nIndex)) @@ -1841,7 +1841,7 @@ bool ScColumn::HasStringData( SCROW nRow ) const SCSIZE nIndex; if (Search(nRow, nIndex)) return (pItems[nIndex].pCell)->HasStringData(); - return FALSE; + return false; } @@ -1850,7 +1850,7 @@ bool ScColumn::HasValueData( SCROW nRow ) const SCSIZE nIndex; if (Search(nRow, nIndex)) return (pItems[nIndex].pCell)->HasValueData(); - return FALSE; + return false; } bool ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const @@ -1865,11 +1865,11 @@ bool ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const { CellType eType = pItems[nIndex].pCell->GetCellType(); if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT ) - return TRUE; + return sal_True; ++nIndex; } } - return FALSE; + return false; } @@ -1929,7 +1929,7 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh if ( pCell->GetCellType() != CELLTYPE_NOTE ) { Color* pColor; - ULONG nFormat = (ULONG) ((SfxUInt32Item*) GetAttr( + sal_uLong nFormat = (sal_uLong) ((SfxUInt32Item*) GetAttr( nRow, ATTR_VALUE_FORMAT ))->GetValue(); ScCellFormat::GetString( pCell, nFormat, aString, &pColor, *pNumFmt ); @@ -1983,7 +1983,7 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( if ( eType == CELLTYPE_VALUE || (eType == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->IsValue()) ) { - ULONG nFormat = (ULONG) ((SfxUInt32Item*) GetAttr( + sal_uLong nFormat = (sal_uLong) ((SfxUInt32Item*) GetAttr( nRow, ATTR_VALUE_FORMAT ))->GetValue(); ScCellFormat::GetInputString( pCell, nFormat, aString, *pNumFmt ); xub_StrLen nLen = aString.Len(); @@ -1995,8 +1995,8 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( sal_uInt16 nPrec; if (pEntry) { - BOOL bThousand, bNegRed; - USHORT nLeading; + sal_Bool bThousand, bNegRed; + sal_uInt16 nLeading; pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrec, nLeading); } else diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index f48d17c924ca..89abf3beabaa 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -486,11 +486,11 @@ void ScCompressedArrayIterator<A,D>::Follow( // === Force instantiation of specializations ================================ -template class ScCompressedArray< SCROW, USHORT>; // heights, base class -template class ScCompressedArray< SCROW, BYTE>; // flags, base class -template class ScBitMaskCompressedArray< SCROW, BYTE>; // flags -template void ScCompressedArrayIterator< SCROW, USHORT>::Follow( - const ScCompressedArrayIterator< SCROW, BYTE>&); +template class ScCompressedArray< SCROW, sal_uInt16>; // heights, base class +template class ScCompressedArray< SCROW, sal_uInt8>; // flags, base class +template class ScBitMaskCompressedArray< SCROW, sal_uInt8>; // flags +template void ScCompressedArrayIterator< SCROW, sal_uInt16>::Follow( + const ScCompressedArrayIterator< SCROW, sal_uInt8>&); // === EOF =================================================================== diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 1edef532025f..40390816128b 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -55,7 +55,7 @@ SV_IMPL_OP_PTRARR_SORT( ScConditionalFormats_Impl, ScConditionalFormatPtr ); //------------------------------------------------------------------------ -BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion = 0 ) +sal_Bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 ) { if (pFormula) { @@ -69,7 +69,7 @@ BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion { ScSingleRefData& rRef2 = static_cast<ScToken*>(t)->GetDoubleRef().Ref2; if ( rRef2.IsColRel() || rRef2.IsRowRel() || rRef2.IsTabRel() ) - return TRUE; + return sal_True; } // fall through @@ -77,7 +77,7 @@ BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion { ScSingleRefData& rRef1 = static_cast<ScToken*>(t)->GetSingleRef(); if ( rRef1.IsColRel() || rRef1.IsRowRel() || rRef1.IsTabRel() ) - return TRUE; + return sal_True; } break; @@ -86,7 +86,7 @@ BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion if( t->GetOpCode() == ocName ) // DB areas always absolute if( ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex( t->GetIndex() ) ) if( (nRecursion < 42) && lcl_HasRelRef( pDoc, pRangeData->GetCode(), nRecursion + 1 ) ) - return TRUE; + return sal_True; } break; @@ -99,7 +99,7 @@ BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion case ocColumn: // COLUMN() returns own column index case ocTable: // SHEET() returns own sheet index case ocCell: // CELL() may return own cell address - return TRUE; + return sal_True; // break; default: { @@ -116,7 +116,7 @@ BOOL lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, USHORT nRecursion } } } - return FALSE; + return false; } ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) : @@ -141,7 +141,7 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) : pDoc(r.pDoc), bRelRef1(r.bRelRef1), bRelRef2(r.bRelRef2), - bFirstRun(TRUE), + bFirstRun(true), pCondFormat(r.pCondFormat) { // ScTokenArray copy ctor erzeugt flache Kopie @@ -176,7 +176,7 @@ ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntr pDoc(pDocument), bRelRef1(r.bRelRef1), bRelRef2(r.bRelRef2), - bFirstRun(TRUE), + bFirstRun(true), pCondFormat(r.pCondFormat) { // echte Kopie der Formeln (fuer Ref-Undo) @@ -202,20 +202,20 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, aStrNmsp2(rExprNmsp2), eTempGrammar1(eGrammar1), eTempGrammar2(eGrammar2), - bIsStr1(FALSE), - bIsStr2(FALSE), + bIsStr1(false), + bIsStr2(false), pFormula1(NULL), pFormula2(NULL), aSrcPos(rPos), pFCell1(NULL), pFCell2(NULL), pDoc(pDocument), - bRelRef1(FALSE), - bRelRef2(FALSE), - bFirstRun(TRUE), + bRelRef1(false), + bRelRef2(false), + bFirstRun(true), pCondFormat(NULL) { - Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, FALSE ); + Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, false ); // Formelzellen werden erst bei IsValid angelegt } @@ -229,17 +229,17 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, nVal2(0.0), eTempGrammar1(FormulaGrammar::GRAM_DEFAULT), eTempGrammar2(FormulaGrammar::GRAM_DEFAULT), - bIsStr1(FALSE), - bIsStr2(FALSE), + bIsStr1(false), + bIsStr2(false), pFormula1(NULL), pFormula2(NULL), aSrcPos(rPos), pFCell1(NULL), pFCell2(NULL), pDoc(pDocument), - bRelRef1(FALSE), - bRelRef2(FALSE), - bFirstRun(TRUE), + bRelRef1(false), + bRelRef2(false), + bFirstRun(true), pCondFormat(NULL) { if ( pArr1 ) @@ -258,7 +258,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, } else if ( pToken->GetType() == svString ) { - bIsStr1 = TRUE; + bIsStr1 = sal_True; aStrVal1 = pToken->GetString(); DELETEZ(pFormula1); // nicht als Formel merken } @@ -282,7 +282,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper, } else if ( pToken->GetType() == svString ) { - bIsStr2 = TRUE; + bIsStr2 = sal_True; aStrVal2 = pToken->GetString(); DELETEZ(pFormula2); // nicht als Formel merken } @@ -305,7 +305,7 @@ ScConditionEntry::~ScConditionEntry() void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, const String& rExprNmsp1, const String& rExprNmsp2, - FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2, BOOL bTextToReal ) + FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2, sal_Bool bTextToReal ) { if ( rExpr1.Len() || rExpr2.Len() ) { @@ -338,7 +338,7 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, } else if ( pToken->GetType() == svString ) { - bIsStr1 = TRUE; + bIsStr1 = sal_True; aStrVal1 = pToken->GetString(); DELETEZ(pFormula1); // nicht als Formel merken } @@ -375,7 +375,7 @@ void ScConditionEntry::Compile( const String& rExpr1, const String& rExpr2, } else if ( pToken->GetType() == svString ) { - bIsStr2 = TRUE; + bIsStr2 = sal_True; aStrVal2 = pToken->GetString(); DELETEZ(pFormula2); // nicht als Formel merken } @@ -405,7 +405,7 @@ void ScConditionEntry::MakeCells( const ScAddress& rPos ) // Formelzel } } -void ScConditionEntry::SetIgnoreBlank(BOOL bSet) +void ScConditionEntry::SetIgnoreBlank(sal_Bool bSet) { // Das Bit SC_COND_NOBLANKS wird gesetzt, wenn Blanks nicht ignoriert werden // (nur bei Gueltigkeit) @@ -443,7 +443,7 @@ void ScConditionEntry::CompileXML() Compile( GetExpression(aSrcPos, 0, 0, eTempGrammar1), GetExpression(aSrcPos, 1, 0, eTempGrammar2), - aStrNmsp1, aStrNmsp2, eTempGrammar1, eTempGrammar2, TRUE ); + aStrNmsp1, aStrNmsp2, eTempGrammar1, eTempGrammar2, sal_True ); } void ScConditionEntry::SetSrcString( const String& rNew ) @@ -474,10 +474,10 @@ void ScConditionEntry::SetFormula2( const ScTokenArray& rArray ) } } -void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, BOOL& rChanged ) +void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, sal_Bool& rChanged ) { // Insert table: only update absolute table references. - // (Similar to ScCompiler::UpdateInsertTab with bIsName=TRUE, result is the same as for named ranges) + // (Similar to ScCompiler::UpdateInsertTab with bIsName=sal_True, result is the same as for named ranges) // For deleting, ScCompiler::UpdateDeleteTab is used because of the handling of invalid references. rCode.Reset(); @@ -489,7 +489,7 @@ void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, { rRef1.nTab += 1; rRef1.nRelTab = rRef1.nTab - nPosTab; - rChanged = TRUE; + rChanged = sal_True; } if( p->GetType() == svDoubleRef ) { @@ -498,7 +498,7 @@ void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, { rRef2.nTab += 1; rRef2.nRelTab = rRef2.nTab - nPosTab; - rChanged = TRUE; + rChanged = sal_True; } } p = static_cast<ScToken*>(rCode.GetNextReference()); @@ -508,11 +508,11 @@ void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - BOOL bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz == 1 ); - BOOL bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz == -1 ); + sal_Bool bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz == 1 ); + sal_Bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz == -1 ); - BOOL bChanged1 = FALSE; - BOOL bChanged2 = FALSE; + sal_Bool bChanged1 = false; + sal_Bool bChanged2 = false; if (pFormula1) { @@ -523,7 +523,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, ScCompiler aComp( pDoc, aSrcPos, *pFormula1 ); aComp.SetGrammar(pDoc->GetGrammar()); if ( bDeleteTab ) - aComp.UpdateDeleteTab( rRange.aStart.Tab(), FALSE, TRUE, bChanged1 ); + aComp.UpdateDeleteTab( rRange.aStart.Tab(), false, sal_True, bChanged1 ); else aComp.UpdateNameReference( eUpdateRefMode, rRange, nDx, nDy, nDz, bChanged1 ); } @@ -540,7 +540,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, ScCompiler aComp( pDoc, aSrcPos, *pFormula2); aComp.SetGrammar(pDoc->GetGrammar()); if ( bDeleteTab ) - aComp.UpdateDeleteTab( rRange.aStart.Tab(), FALSE, TRUE, bChanged2 ); + aComp.UpdateDeleteTab( rRange.aStart.Tab(), false, sal_True, bChanged2 ); else aComp.UpdateNameReference( eUpdateRefMode, rRange, nDx, nDy, nDz, bChanged2 ); } @@ -556,39 +556,39 @@ void ScConditionEntry::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) { ScCompiler aComp( pDoc, aSrcPos, *pFormula1); aComp.SetGrammar(pDoc->GetGrammar()); - aComp.UpdateMoveTab(nOldPos, nNewPos, TRUE ); + aComp.UpdateMoveTab(nOldPos, nNewPos, sal_True ); DELETEZ(pFCell1); } if (pFormula2) { ScCompiler aComp( pDoc, aSrcPos, *pFormula2); aComp.SetGrammar(pDoc->GetGrammar()); - aComp.UpdateMoveTab(nOldPos, nNewPos, TRUE ); + aComp.UpdateMoveTab(nOldPos, nNewPos, sal_True ); DELETEZ(pFCell2); } } //! als Vergleichsoperator ans TokenArray ??? -BOOL lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) +sal_Bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) { // verglichen wird nur das nicht-UPN Array if ( pArr1 && pArr2 ) { - USHORT nLen = pArr1->GetLen(); + sal_uInt16 nLen = pArr1->GetLen(); if ( pArr2->GetLen() != nLen ) - return FALSE; + return false; FormulaToken** ppToken1 = pArr1->GetArray(); FormulaToken** ppToken2 = pArr2->GetArray(); - for (USHORT i=0; i<nLen; i++) + for (sal_uInt16 i=0; i<nLen; i++) { if ( ppToken1[i] != ppToken2[i] && !(*ppToken1[i] == *ppToken2[i]) ) - return FALSE; // Unterschied + return false; // Unterschied } - return TRUE; // alle Eintraege gleich + return sal_True; // alle Eintraege gleich } else return !pArr1 && !pArr2; // beide 0 -> gleich @@ -596,7 +596,7 @@ BOOL lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) int ScConditionEntry::operator== ( const ScConditionEntry& r ) const { - BOOL bEq = (eOp == r.eOp && nOptions == r.nOptions && + sal_Bool bEq = (eOp == r.eOp && nOptions == r.nOptions && lcl_IsEqual( pFormula1, r.pFormula1 ) && lcl_IsEqual( pFormula2, r.pFormula2 )); if (bEq) @@ -604,13 +604,13 @@ int ScConditionEntry::operator== ( const ScConditionEntry& r ) const // for formulas, the reference positions must be compared, too // (including aSrcString, for inserting the entries during XML import) if ( ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) ) - bEq = FALSE; + bEq = false; // wenn keine Formeln, Werte vergleichen if ( !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) ) - bEq = FALSE; + bEq = false; if ( !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) ) - bEq = FALSE; + bEq = false; } return bEq; @@ -626,7 +626,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) // Formeln auswerten - BOOL bDirty = FALSE; //! 1 und 2 getrennt ??? + sal_Bool bDirty = false; //! 1 und 2 getrennt ??? ScFormulaCell* pTemp1 = NULL; ScFormulaCell* pEff1 = pFCell1; @@ -641,16 +641,16 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) { //! Changed statt Dirty abfragen !!! if (pEff1->GetDirty() && !bRelRef1) - bDirty = TRUE; + bDirty = sal_True; if (pEff1->IsValue()) { - bIsStr1 = FALSE; + bIsStr1 = false; nVal1 = pEff1->GetValue(); aStrVal1.Erase(); } else { - bIsStr1 = TRUE; + bIsStr1 = sal_True; pEff1->GetString( aStrVal1 ); nVal1 = 0.0; } @@ -670,16 +670,16 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) if (!pEff2->IsRunning()) // keine 522 erzeugen { if (pEff2->GetDirty() && !bRelRef2) - bDirty = TRUE; + bDirty = sal_True; if (pEff2->IsValue()) { - bIsStr2 = FALSE; + bIsStr2 = false; nVal2 = pEff2->GetValue(); aStrVal2.Erase(); } else { - bIsStr2 = TRUE; + bIsStr2 = sal_True; pEff2->GetString( aStrVal2 ); nVal2 = 0.0; } @@ -696,12 +696,12 @@ void ScConditionEntry::Interpret( const ScAddress& rPos ) DataChanged( NULL ); // alles } - bFirstRun = FALSE; + bFirstRun = false; } -static BOOL lcl_GetCellContent( ScBaseCell* pCell, BOOL bIsStr1, double& rArg, String& rArgStr ) +static sal_Bool lcl_GetCellContent( ScBaseCell* pCell, sal_Bool bIsStr1, double& rArg, String& rArgStr ) { - BOOL bVal = TRUE; + sal_Bool bVal = true; if ( pCell ) { @@ -723,7 +723,7 @@ static BOOL lcl_GetCellContent( ScBaseCell* pCell, BOOL bIsStr1, double& rArg, S break; case CELLTYPE_STRING: case CELLTYPE_EDIT: - bVal = FALSE; + bVal = false; if ( eType == CELLTYPE_STRING ) ((ScStringCell*)pCell)->GetString(rArgStr); else @@ -738,12 +738,12 @@ static BOOL lcl_GetCellContent( ScBaseCell* pCell, BOOL bIsStr1, double& rArg, S if( !pCell ) if( bIsStr1 ) - bVal = FALSE; // leere Zellen je nach Bedingung + bVal = false; // leere Zellen je nach Bedingung return bVal; } -static BOOL lcl_IsDuplicate( ScDocument *pDoc, double nArg, const String& rStr, const ScAddress& rAddr, const ScRangeListRef& rRanges ) +static sal_Bool lcl_IsDuplicate( ScDocument *pDoc, double nArg, const String& rStr, const ScAddress& rAddr, const ScRangeListRef& rRanges ) { size_t nListCount = rRanges->size(); for( size_t i = 0; i < nListCount; i++ ) @@ -764,36 +764,36 @@ static BOOL lcl_IsDuplicate( ScDocument *pDoc, double nArg, const String& rStr, if( !pCell ) continue; - if( !lcl_GetCellContent( pCell, FALSE, nVal, aStr ) ) + if( !lcl_GetCellContent( pCell, false, nVal, aStr ) ) { if( rStr.Len() && ( ScGlobal::GetCollator()->compareString( rStr, aStr ) == COMPARE_EQUAL ) ) - return TRUE; + return true; } else { if( !rStr.Len() && ::rtl::math::approxEqual( nArg, nVal ) ) - return TRUE; + return true; } } } - return FALSE; + return false; } -BOOL ScConditionEntry::IsValid( double nArg, const ScAddress& rAddr ) const +sal_Bool ScConditionEntry::IsValid( double nArg, const ScAddress& rAddr ) const { // Interpret muss schon gerufen sein if ( bIsStr1 ) { - // wenn auf String getestet wird, bei Zahlen immer FALSE, ausser bei "ungleich" + // wenn auf String getestet wird, bei Zahlen immer sal_False, ausser bei "ungleich" return ( eOp == SC_COND_NOTEQUAL ); } if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN ) if ( bIsStr2 ) - return FALSE; + return false; double nComp1 = nVal1; // Kopie, damit vertauscht werden kann double nComp2 = nVal2; @@ -807,11 +807,11 @@ BOOL ScConditionEntry::IsValid( double nArg, const ScAddress& rAddr ) const // Alle Grenzfaelle muessen per ::rtl::math::approxEqual getestet werden! - BOOL bValid = FALSE; + sal_Bool bValid = false; switch (eOp) { case SC_COND_NONE: - break; // immer FALSE; + break; // immer sal_False; case SC_COND_EQUAL: bValid = ::rtl::math::approxEqual( nArg, nComp1 ); break; @@ -858,9 +858,9 @@ BOOL ScConditionEntry::IsValid( double nArg, const ScAddress& rAddr ) const return bValid; } -BOOL ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) const +sal_Bool ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) const { - BOOL bValid = FALSE; + sal_Bool bValid = false; // Interpret muss schon gerufen sein if ( eOp == SC_COND_DIRECT ) // Formel ist unabhaengig vom Inhalt @@ -884,7 +884,7 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) return ( eOp == SC_COND_NOTEQUAL ); if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN ) if ( !bIsStr2 ) - return FALSE; + return false; String aUpVal1( aStrVal1 ); //! als Member? (dann auch in Interpret setzen) String aUpVal2( aStrVal2 ); @@ -937,7 +937,7 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) // SC_COND_DIRECT schon oben abgefragt default: OSL_FAIL("unbekannte Operation bei ScConditionEntry"); - bValid = FALSE; + bValid = false; break; } } @@ -945,21 +945,21 @@ BOOL ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) return bValid; } -BOOL ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) const +sal_Bool ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) const { ((ScConditionEntry*)this)->Interpret(rPos); // Formeln auswerten double nArg = 0.0; String aArgStr; - BOOL bVal = lcl_GetCellContent( pCell, bIsStr1, nArg, aArgStr ); + sal_Bool bVal = lcl_GetCellContent( pCell, bIsStr1, nArg, aArgStr ); if (bVal) return IsValid( nArg, rPos ); else return IsValidStr( aArgStr, rPos ); } -String ScConditionEntry::GetExpression( const ScAddress& rCursor, USHORT nIndex, - ULONG nNumFmt, +String ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 nIndex, + sal_uLong nNumFmt, const FormulaGrammar::Grammar eGrammar ) const { String aRet; @@ -1009,7 +1009,7 @@ String ScConditionEntry::GetExpression( const ScAddress& rCursor, USHORT nIndex, return aRet; } -ScTokenArray* ScConditionEntry::CreateTokenArry( USHORT nIndex ) const +ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const { ScTokenArray* pRet = NULL; ScAddress aAddr; @@ -1050,7 +1050,7 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( USHORT nIndex ) const void ScConditionEntry::SourceChanged( const ScAddress& rChanged ) { - for (USHORT nPass = 0; nPass < 2; nPass++) + for (sal_uInt16 nPass = 0; nPass < 2; nPass++) { ScTokenArray* pFormula = nPass ? pFormula2 : pFormula1; if (pFormula) @@ -1065,7 +1065,7 @@ void ScConditionEntry::SourceChanged( const ScAddress& rChanged ) { // absolut muss getroffen sein, relativ bestimmt Bereich - BOOL bHit = TRUE; + sal_Bool bHit = sal_True; SCsCOL nCol1; SCsROW nRow1; SCsTAB nTab1; @@ -1140,7 +1140,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const SCTAB nMinTab = aSrcPos.Tab(); SCTAB nMaxTab = nMinTab; - for (USHORT nPass = 0; nPass < 2; nPass++) + for (sal_uInt16 nPass = 0; nPass < 2; nPass++) { ScTokenArray* pFormula = nPass ? pFormula2 : pFormula1; if (pFormula) @@ -1191,7 +1191,7 @@ void ScConditionEntry::DataChanged( const ScRange* /* pModified */ ) const bool ScConditionEntry::MarkUsedExternalReferences() const { bool bAllMarked = false; - for (USHORT nPass = 0; !bAllMarked && nPass < 2; nPass++) + for (sal_uInt16 nPass = 0; !bAllMarked && nPass < 2; nPass++) { ScTokenArray* pFormula = nPass ? pFormula2 : pFormula1; if (pFormula) @@ -1275,7 +1275,7 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : if (nEntryCount) { ppEntries = new ScCondFormatEntry*[nEntryCount]; - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) { ppEntries[i] = new ScCondFormatEntry(*r.ppEntries[i]); ppEntries[i]->SetParent(this); @@ -1297,7 +1297,7 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const if (nEntryCount) { pNew->ppEntries = new ScCondFormatEntry*[nEntryCount]; - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) { pNew->ppEntries[i] = new ScCondFormatEntry( pNewDoc, *ppEntries[i] ); pNew->ppEntries[i]->SetParent(pNew); @@ -1309,21 +1309,21 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const return pNew; } -BOOL ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const +sal_Bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const { if ( nEntryCount != r.nEntryCount ) - return FALSE; + return false; //! auf gleiche Eintraege in anderer Reihenfolge testen ??? - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) if ( ! (*ppEntries[i] == *r.ppEntries[i]) ) - return FALSE; + return false; if( *pRanges != *r.pRanges ) - return FALSE; + return false; - return TRUE; + return true; } void ScConditionalFormat::AddRangeInfo( const ScRangeListRef& rRanges ) @@ -1336,7 +1336,7 @@ void ScConditionalFormat::AddRangeInfo( const ScRangeListRef& rRanges ) void ScConditionalFormat::AddEntry( const ScCondFormatEntry& rNew ) { ScCondFormatEntry** ppNew = new ScCondFormatEntry*[nEntryCount+1]; - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppNew[i] = ppEntries[i]; ppNew[nEntryCount] = new ScCondFormatEntry(rNew); ppNew[nEntryCount]->SetParent(this); @@ -1347,14 +1347,14 @@ void ScConditionalFormat::AddEntry( const ScCondFormatEntry& rNew ) ScConditionalFormat::~ScConditionalFormat() { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) delete ppEntries[i]; delete[] ppEntries; delete pAreas; } -const ScCondFormatEntry* ScConditionalFormat::GetEntry( USHORT nPos ) const +const ScCondFormatEntry* ScConditionalFormat::GetEntry( sal_uInt16 nPos ) const { if ( nPos < nEntryCount ) return ppEntries[nPos]; @@ -1364,14 +1364,14 @@ const ScCondFormatEntry* ScConditionalFormat::GetEntry( USHORT nPos ) const const String& ScConditionalFormat::GetCellStyle( ScBaseCell* pCell, const ScAddress& rPos ) const { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) if ( ppEntries[i]->IsCellValid( pCell, rPos ) ) return ppEntries[i]->GetStyle(); return EMPTY_STRING; } -void lcl_Extend( ScRange& rRange, ScDocument* pDoc, BOOL bLines ) +void lcl_Extend( ScRange& rRange, ScDocument* pDoc, sal_Bool bLines ) { SCTAB nTab = rRange.aStart.Tab(); DBG_ASSERT(rRange.aEnd.Tab() == nTab, "lcl_Extend - mehrere Tabellen?"); @@ -1381,7 +1381,7 @@ void lcl_Extend( ScRange& rRange, ScDocument* pDoc, BOOL bLines ) SCCOL nEndCol = rRange.aEnd.Col(); SCROW nEndRow = rRange.aEnd.Row(); - BOOL bEx = pDoc->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab ); + sal_Bool bEx = pDoc->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab ); if (bLines) { @@ -1398,7 +1398,7 @@ void lcl_Extend( ScRange& rRange, ScDocument* pDoc, BOOL bLines ) } } -BOOL lcl_CutRange( ScRange& rRange, const ScRange& rOther ) +sal_Bool lcl_CutRange( ScRange& rRange, const ScRange& rOther ) { rRange.Justify(); ScRange aCmpRange = rOther; @@ -1424,10 +1424,10 @@ BOOL lcl_CutRange( ScRange& rRange, const ScRange& rOther ) if ( rRange.aEnd.Tab() > aCmpRange.aEnd.Tab() ) rRange.aEnd.SetTab( aCmpRange.aEnd.Tab() ); - return TRUE; + return sal_True; } - return FALSE; // ausserhalb + return false; // ausserhalb } void ScConditionalFormat::DoRepaint( const ScRange* pModified ) @@ -1437,9 +1437,9 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) { // Rahmen/Schatten enthalten? // (alle Bedingungen testen) - BOOL bExtend = FALSE; - BOOL bRotate = FALSE; - BOOL bAttrTested = FALSE; + sal_Bool bExtend = false; + sal_Bool bRotate = false; + sal_Bool bAttrTested = false; if (!pAreas) // RangeList ggf. holen { @@ -1449,11 +1449,11 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) for (size_t i = 0, nCount = pAreas->size(); i < nCount; i++ ) { ScRange aRange = *(*pAreas)[i]; - BOOL bDo = TRUE; + sal_Bool bDo = true; if ( pModified ) { if ( !lcl_CutRange( aRange, *pModified ) ) - bDo = FALSE; + bDo = false; } if (bDo) { @@ -1462,7 +1462,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) // Look at the style's content only if the repaint is necessary // for any condition, to avoid the time-consuming Find() if there are many // conditional formats and styles. - for (USHORT nEntry=0; nEntry<nEntryCount; nEntry++) + for (sal_uInt16 nEntry=0; nEntry<nEntryCount; nEntry++) { String aStyle = ppEntries[nEntry]->GetStyle(); if (aStyle.Len()) @@ -1472,20 +1472,20 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) if ( pStyleSheet ) { const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - if (rSet.GetItemState( ATTR_BORDER, TRUE ) == SFX_ITEM_SET || - rSet.GetItemState( ATTR_SHADOW, TRUE ) == SFX_ITEM_SET) + if (rSet.GetItemState( ATTR_BORDER, sal_True ) == SFX_ITEM_SET || + rSet.GetItemState( ATTR_SHADOW, sal_True ) == SFX_ITEM_SET) { - bExtend = TRUE; + bExtend = sal_True; } - if (rSet.GetItemState( ATTR_ROTATE_VALUE, TRUE ) == SFX_ITEM_SET || - rSet.GetItemState( ATTR_ROTATE_MODE, TRUE ) == SFX_ITEM_SET) + if (rSet.GetItemState( ATTR_ROTATE_VALUE, sal_True ) == SFX_ITEM_SET || + rSet.GetItemState( ATTR_ROTATE_MODE, sal_True ) == SFX_ITEM_SET) { - bRotate = TRUE; + bRotate = sal_True; } } } } - bAttrTested = TRUE; + bAttrTested = sal_True; } lcl_Extend( aRange, pDoc, bExtend ); // zusammengefasste und bExtend @@ -1507,7 +1507,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) } } - pSh->Broadcast( ScPaintHint( aRange, PAINT_GRID ) ); + pDoc->RepaintRange( aRange ); } } } @@ -1521,20 +1521,20 @@ void ScConditionalFormat::InvalidateArea() void ScConditionalFormat::CompileAll() { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppEntries[i]->CompileAll(); } void ScConditionalFormat::CompileXML() { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppEntries[i]->CompileXML(); } void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppEntries[i]->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz); delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf @@ -1543,14 +1543,14 @@ void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode, void ScConditionalFormat::RenameCellStyle(const String& rOld, const String& rNew) { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) if ( ppEntries[i]->GetStyle() == rOld ) ppEntries[i]->UpdateStyleName( rNew ); } void ScConditionalFormat::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppEntries[i]->UpdateMoveTab( nOldPos, nNewPos ); delete pAreas; // aus dem AttrArray kommt beim Einfuegen/Loeschen kein Aufruf @@ -1559,14 +1559,14 @@ void ScConditionalFormat::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) void ScConditionalFormat::SourceChanged( const ScAddress& rAddr ) { - for (USHORT i=0; i<nEntryCount; i++) + for (sal_uInt16 i=0; i<nEntryCount; i++) ppEntries[i]->SourceChanged( rAddr ); } bool ScConditionalFormat::MarkUsedExternalReferences() const { bool bAllMarked = false; - for (USHORT i=0; !bAllMarked && i<nEntryCount; i++) + for (sal_uInt16 i=0; !bAllMarked && i<nEntryCount; i++) bAllMarked = ppEntries[i]->MarkUsedExternalReferences(); return bAllMarked; } @@ -1578,9 +1578,9 @@ ScConditionalFormatList::ScConditionalFormatList(const ScConditionalFormatList& { // fuer Ref-Undo - echte Kopie mit neuen Tokens! - USHORT nCount = rList.Count(); + sal_uInt16 nCount = rList.Count(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) InsertNew( rList[i]->Clone() ); //! sortierte Eintraege aus rList schneller einfuegen ??? @@ -1591,23 +1591,23 @@ ScConditionalFormatList::ScConditionalFormatList(ScDocument* pNewDoc, { // fuer neues Dokument - echte Kopie mit neuen Tokens! - USHORT nCount = rList.Count(); + sal_uInt16 nCount = rList.Count(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) InsertNew( rList[i]->Clone(pNewDoc) ); //! sortierte Eintraege aus rList schneller einfuegen ??? } -BOOL ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const +sal_Bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const { // fuer Ref-Undo - interne Variablen werden nicht verglichen - USHORT nCount = Count(); - BOOL bEqual = ( nCount == r.Count() ); - for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert + sal_uInt16 nCount = Count(); + sal_Bool bEqual = ( nCount == r.Count() ); + for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? - bEqual = FALSE; + bEqual = false; return bEqual; } @@ -1616,8 +1616,8 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) { //! binaer suchen - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) if ((*this)[i]->GetKey() == nKey) return (*this)[i]; @@ -1627,52 +1627,52 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) void ScConditionalFormatList::CompileAll() { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->CompileAll(); } void ScConditionalFormatList::CompileXML() { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->CompileXML(); } void ScConditionalFormatList::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz ); } void ScConditionalFormatList::RenameCellStyle( const String& rOld, const String& rNew ) { - ULONG nCount=Count(); - for (USHORT i=0; i<nCount; i++) + sal_uLong nCount=Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->RenameCellStyle(rOld,rNew); } void ScConditionalFormatList::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->UpdateMoveTab( nOldPos, nNewPos ); } void ScConditionalFormatList::SourceChanged( const ScAddress& rAddr ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->SourceChanged( rAddr ); } bool ScConditionalFormatList::MarkUsedExternalReferences() const { bool bAllMarked = false; - USHORT nCount = Count(); - for (USHORT i=0; !bAllMarked && i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; !bAllMarked && i<nCount; i++) bAllMarked = (*this)[i]->MarkUsedExternalReferences(); return bAllMarked; } diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index 7e0f8b7ebb82..15f08ec01112 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -58,14 +58,14 @@ ScDatabaseDocUtil::StrData::StrData() : void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const uno::Reference<sdbc::XRow>& xRow, long nRowPos, - long nType, BOOL bCurrency, StrData* pStrData ) + long nType, sal_Bool bCurrency, StrData* pStrData ) { String aString; double nVal = 0.0; - BOOL bValue = FALSE; - BOOL bEmptyFlag = FALSE; - BOOL bError = FALSE; - ULONG nFormatIndex = 0; + sal_Bool bValue = false; + sal_Bool bEmptyFlag = false; + sal_Bool bError = false; + sal_uLong nFormatIndex = 0; //! wasNull calls only if null value was found? @@ -80,7 +80,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB NUMBERFORMAT_LOGICAL, ScGlobal::eLnge ); nVal = (xRow->getBoolean(nRowPos) ? 1 : 0); bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull(); - bValue = TRUE; + bValue = sal_True; break; case sdbc::DataType::TINYINT: @@ -95,7 +95,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB //! do the conversion here? nVal = xRow->getDouble(nRowPos); bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull(); - bValue = TRUE; + bValue = sal_True; break; case sdbc::DataType::CHAR: @@ -115,7 +115,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nVal = Date( aDate.Day, aDate.Month, aDate.Year ) - *pFormTable->GetNullDate(); bEmptyFlag = xRow->wasNull(); - bValue = TRUE; + bValue = sal_True; } break; @@ -129,7 +129,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nVal = ( aTime.Hours * 3600 + aTime.Minutes * 60 + aTime.Seconds + aTime.HundredthSeconds / 100.0 ) / D_TIMEFACTOR; bEmptyFlag = xRow->wasNull(); - bValue = TRUE; + bValue = sal_True; } break; @@ -145,24 +145,24 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB ( aStamp.Hours * 3600 + aStamp.Minutes * 60 + aStamp.Seconds + aStamp.HundredthSeconds / 100.0 ) / D_TIMEFACTOR; bEmptyFlag = xRow->wasNull(); - bValue = TRUE; + bValue = sal_True; } break; case sdbc::DataType::SQLNULL: - bEmptyFlag = TRUE; + bEmptyFlag = sal_True; break; case sdbc::DataType::BINARY: case sdbc::DataType::VARBINARY: case sdbc::DataType::LONGVARBINARY: default: - bError = TRUE; // unknown type + bError = sal_True; // unknown type } } catch ( uno::Exception& ) { - bError = TRUE; + bError = sal_True; } if ( bValue && bCurrency ) diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index fc9fd39f1d04..c8602214f506 100644..100755 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -62,7 +62,7 @@ namespace { void lcl_toUpper(OUString& rStr) { - rStr = ScGlobal::pCharClass->toUpper(rStr.trim(), 0, static_cast<USHORT>(rStr.getLength())); + rStr = ScGlobal::pCharClass->toUpper(rStr.trim(), 0, static_cast<sal_uInt16>(rStr.getLength())); } } @@ -91,7 +91,7 @@ ScDocumentIterator::~ScDocumentIterator() { } -BOOL ScDocumentIterator::GetThisCol() +sal_Bool ScDocumentIterator::GetThisCol() { ScTable* pTab; while ( (pTab = pDoc->pTab[nTab]) == NULL ) @@ -100,14 +100,14 @@ BOOL ScDocumentIterator::GetThisCol() { nCol = MAXCOL; nRow = MAXROW; - return FALSE; + return false; } ++nTab; } ScColumn* pCol = &pTab->aCol[nCol]; ScAttrArray* pAtt = pCol->pAttrArray; - BOOL bFound = FALSE; + sal_Bool bFound = false; do { SCROW nColRow; @@ -131,13 +131,13 @@ BOOL ScDocumentIterator::GetThisCol() if (nColRow == nRow) { - bFound = TRUE; + bFound = sal_True; pCell = pCol->pItems[nColPos].pCell; pPattern = pAtt->pData[nAttrPos].pPattern; } else if ( pAtt->pData[nAttrPos].pPattern != pDefPattern ) { - bFound = TRUE; + bFound = sal_True; pCell = NULL; pPattern = pAtt->pData[nAttrPos].pPattern; } @@ -151,15 +151,15 @@ BOOL ScDocumentIterator::GetThisCol() return bFound; } -BOOL ScDocumentIterator::GetThis() +sal_Bool ScDocumentIterator::GetThis() { - BOOL bEnd = FALSE; - BOOL bSuccess = FALSE; + sal_Bool bEnd = false; + sal_Bool bSuccess = false; while ( !bSuccess && !bEnd ) { if ( nRow > MAXROW ) - bSuccess = FALSE; + bSuccess = false; else bSuccess = GetThisCol(); @@ -171,7 +171,7 @@ BOOL ScDocumentIterator::GetThis() nCol = 0; ++nTab; if (nTab > nEndTab) - bEnd = TRUE; + bEnd = sal_True; } nRow = 0; nColPos = 0; @@ -182,7 +182,7 @@ BOOL ScDocumentIterator::GetThis() return !bEnd; } -BOOL ScDocumentIterator::GetFirst() +sal_Bool ScDocumentIterator::GetFirst() { nCol = 0; nTab = nStartTab; @@ -194,7 +194,7 @@ BOOL ScDocumentIterator::GetFirst() return GetThis(); } -BOOL ScDocumentIterator::GetNext() +sal_Bool ScDocumentIterator::GetNext() { ++nRow; @@ -223,7 +223,7 @@ void ScDocumentIterator::GetPos( SCCOL& rCol, SCROW& rRow, SCTAB& rTab ) //------------------------------------------------------------------------ //------------------------------------------------------------------------ -void lcl_IterGetNumberFormat( ULONG& nFormat, const ScAttrArray*& rpArr, +void lcl_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, ScDocument* pDoc ) { @@ -239,7 +239,7 @@ void lcl_IterGetNumberFormat( ULONG& nFormat, const ScAttrArray*& rpArr, } ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange, - BOOL bSTotal, BOOL bTextZero ) : + sal_Bool bSTotal, sal_Bool bTextZero ) : pDoc( pDocument ), nNumFmtIndex(0), nStartCol( rRange.aStart.Col() ), @@ -249,9 +249,9 @@ ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange, nEndRow( rRange.aEnd.Row() ), nEndTab( rRange.aEnd.Tab() ), nNumFmtType( NUMBERFORMAT_UNDEFINED ), - bNumValid( FALSE ), + bNumValid( false ), bSubTotal(bSTotal), - bNextValid( FALSE ), + bNextValid( false ), bCalcAsShown( pDocument->GetDocOptions().IsCalcAsShown() ), bTextAsZero( bTextZero ) { @@ -277,7 +277,7 @@ ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange, nAttrEndRow = 0; } -BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) +sal_Bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr) { ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; for (;;) @@ -296,7 +296,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) { // rValue = 0.0; //! do not change caller's value! rErr = 0; - return FALSE; // Ende und Aus + return false; // Ende und Aus } } pCol = &(pDoc->pTab[nTab])->aCol[nCol]; @@ -318,7 +318,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) { case CELLTYPE_VALUE: { - bNumValid = FALSE; + bNumValid = false; rValue = ((ScValueCell*)pCell)->GetValue(); rErr = 0; --nRow; @@ -339,7 +339,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) { fNextValue = ((ScValueCell*)pCol->pItems[nColRow].pCell)->GetValue(); nNextRow = pCol->pItems[nColRow].nRow; - bNextValid = TRUE; + bNextValid = sal_True; if ( bCalcAsShown ) { lcl_IterGetNumberFormat( nNumFormat, pAttrArray, @@ -348,7 +348,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) } } - return TRUE; // gefunden + return sal_True; // gefunden } // break; case CELLTYPE_FORMULA: @@ -360,15 +360,15 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) { rValue = ((ScFormulaCell*)pCell)->GetValue(); nRow--; - bNumValid = FALSE; - return TRUE; // gefunden + bNumValid = false; + return sal_True; // gefunden } else if ( bTextAsZero ) { rValue = 0.0; nRow--; - bNumValid = FALSE; - return TRUE; + bNumValid = false; + return sal_True; } } } @@ -382,9 +382,9 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) rValue = 0.0; nNumFmtType = NUMBERFORMAT_NUMBER; nNumFmtIndex = 0; - bNumValid = TRUE; + bNumValid = sal_True; --nRow; - return TRUE; + return sal_True; } } break; @@ -400,7 +400,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) } } -void ScValueIterator::GetCurNumFmtInfo( short& nType, ULONG& nIndex ) +void ScValueIterator::GetCurNumFmtInfo( short& nType, sal_uLong& nIndex ) { if (!bNumValid) { @@ -427,13 +427,13 @@ void ScValueIterator::GetCurNumFmtInfo( short& nType, ULONG& nIndex ) } else nNumFmtType = pDoc->GetFormatTable()->GetType( nNumFmtIndex ); - bNumValid = TRUE; + bNumValid = sal_True; } nType = nNumFmtType; nIndex = nNumFmtIndex; } -BOOL ScValueIterator::GetFirst(double& rValue, USHORT& rErr) +sal_Bool ScValueIterator::GetFirst(double& rValue, sal_uInt16& rErr) { nCol = nStartCol; nRow = nStartRow; @@ -572,7 +572,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) nNumFmtType = NUMBERFORMAT_NUMBER; nNumFmtIndex = 0; rValue.mnError = 0; - return TRUE; // gefunden + return sal_True; // gefunden } // break; case CELLTYPE_FORMULA: @@ -585,7 +585,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) nNumFmtIndex, ScAddress( nCol, nRow, nTab ), pCell ); rValue.mnError = ((ScFormulaCell*)pCell)->GetErrCode(); - return TRUE; // gefunden + return sal_True; // gefunden } else nRow++; @@ -913,7 +913,7 @@ bool ScDBQueryDataIterator::GetNext(Value& rValue) ScCellIterator::ScCellIterator( ScDocument* pDocument, SCCOL nSCol, SCROW nSRow, SCTAB nSTab, - SCCOL nECol, SCROW nERow, SCTAB nETab, BOOL bSTotal ) : + SCCOL nECol, SCROW nERow, SCTAB nETab, sal_Bool bSTotal ) : pDoc( pDocument ), nStartCol( nSCol), nStartRow( nSRow), @@ -955,7 +955,7 @@ ScCellIterator::ScCellIterator( ScDocument* pDocument, } ScCellIterator::ScCellIterator - ( ScDocument* pDocument, const ScRange& rRange, BOOL bSTotal ) : + ( ScDocument* pDocument, const ScRange& rRange, sal_Bool bSTotal ) : pDoc( pDocument ), nStartCol( rRange.aStart.Col() ), nStartRow( rRange.aStart.Row() ), @@ -1064,14 +1064,14 @@ ScBaseCell* ScCellIterator::GetNext() //------------------------------------------------------------------------------- ScQueryCellIterator::ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable, - const ScQueryParam& rParam, BOOL bMod ) : + const ScQueryParam& rParam, sal_Bool bMod ) : aParam (rParam), pDoc( pDocument ), nTab( nTable), nStopOnMismatch( nStopOnMismatchDisabled ), nTestEqualCondition( nTestEqualConditionDisabled ), - bAdvanceQuery( FALSE ), - bIgnoreMismatchOnLeadingStrings( FALSE ) + bAdvanceQuery( false ), + bIgnoreMismatchOnLeadingStrings( false ) { nCol = aParam.nCol1; nRow = aParam.nRow1; @@ -1141,7 +1141,7 @@ ScBaseCell* ScQueryCellIterator::GetThis() ++nRow; else { - BOOL bTestEqualCondition; + sal_Bool bTestEqualCondition; if ( (pDoc->pTab[nTab])->ValidQuery( nRow, aParam, NULL, (nCol == static_cast<SCCOL>(nFirstQueryField) ? pCell : NULL), (nTestEqualCondition ? &bTestEqualCondition : NULL) ) ) @@ -1232,14 +1232,14 @@ void ScQueryCellIterator::AdvanceQueryParamEntryField() } -BOOL ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, - SCROW& nFoundRow, BOOL bSearchForEqualAfterMismatch, - BOOL bIgnoreMismatchOnLeadingStringsP ) +sal_Bool ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, + SCROW& nFoundRow, sal_Bool bSearchForEqualAfterMismatch, + sal_Bool bIgnoreMismatchOnLeadingStringsP ) { nFoundCol = MAXCOL+1; nFoundRow = MAXROW+1; - SetStopOnMismatch( TRUE ); // assume sorted keys - SetTestEqualCondition( TRUE ); + SetStopOnMismatch( sal_True ); // assume sorted keys + SetTestEqualCondition( sal_True ); bIgnoreMismatchOnLeadingStrings = bIgnoreMismatchOnLeadingStringsP; bool bRegExp = aParam.bRegExp && aParam.GetEntry(0).bQueryByString; bool bBinary = !bRegExp && aParam.bByRow && (aParam.GetEntry(0).eOp == @@ -1291,8 +1291,8 @@ BOOL ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, break; // for } SCSIZE nColRowSave; - bIgnoreMismatchOnLeadingStrings = FALSE; - SetTestEqualCondition( FALSE ); + bIgnoreMismatchOnLeadingStrings = false; + SetTestEqualCondition( false ); do { nFoundCol = GetCol(); @@ -1303,7 +1303,7 @@ BOOL ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, nCol = nFoundCol; nRow = nFoundRow; nColRow = nColRowSave; - return TRUE; + return sal_True; } if ( (bSearchForEqualAfterMismatch || aParam.bRegExp) && StoppedOnMismatch() ) @@ -1331,8 +1331,8 @@ BOOL ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, else break; // for } - SetStopOnMismatch( FALSE ); - SetTestEqualCondition( FALSE ); + SetStopOnMismatch( false ); + SetTestEqualCondition( false ); if (GetNext()) { // Last of a consecutive area, avoid searching the entire parameter @@ -1344,7 +1344,7 @@ BOOL ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol, nFoundCol = GetCol(); nFoundRow = GetRow(); nColRowSave = nColRow; - SetStopOnMismatch( TRUE ); + SetStopOnMismatch( sal_True ); } while (GetNext()); nCol = nFoundCol; nRow = nFoundRow; @@ -1382,7 +1382,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch() pItems[nLo].pCell->HasStringData()) { String aCellStr; - ULONG nFormat = pCol->GetNumberFormat( pItems[nLo].nRow); + sal_uLong nFormat = pCol->GetNumberFormat( pItems[nLo].nRow); ScCellFormat::GetInputString( pItems[nLo].pCell, nFormat, aCellStr, rFormatter); sal_Int32 nTmp = pCollator->compareString( aCellStr, *rEntry.pStr); @@ -1412,7 +1412,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch() pCell = pItems[nLastInRange].pCell; if (pCell->HasStringData()) { - ULONG nFormat = pCol->GetNumberFormat( pItems[nLastInRange].nRow); + sal_uLong nFormat = pCol->GetNumberFormat( pItems[nLastInRange].nRow); ScCellFormat::GetInputString( pCell, nFormat, aLastInRangeString, rFormatter); } @@ -1453,7 +1453,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch() bDone = true; continue; // while } - BOOL bStr = pItems[i].pCell->HasStringData(); + sal_Bool bStr = pItems[i].pCell->HasStringData(); nRes = 0; // compares are content<query:-1, content>query:1 // Cell value comparison similar to ScTable::ValidQuery() @@ -1514,7 +1514,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch() else if (bStr && bByString) { String aCellStr; - ULONG nFormat = pCol->GetNumberFormat( pItems[i].nRow); + sal_uLong nFormat = pCol->GetNumberFormat( pItems[i].nRow); ScCellFormat::GetInputString( pItems[i].pCell, nFormat, aCellStr, rFormatter); nRes = pCollator->compareString( aCellStr, *rEntry.pStr); @@ -1632,7 +1632,7 @@ ScHorizontalCellIterator::ScHorizontalCellIterator(ScDocument* pDocument, SCTAB nEndRow( nRow2 ), nCol( nCol1 ), nRow( nRow1 ), - bMore( TRUE ) + bMore( sal_True ) { SCCOL i; SCSIZE nIndex; @@ -1696,7 +1696,7 @@ ScBaseCell* ScHorizontalCellIterator::GetNext( SCCOL& rCol, SCROW& rRow ) return NULL; } -BOOL ScHorizontalCellIterator::ReturnNext( SCCOL& rCol, SCROW& rRow ) +sal_Bool ScHorizontalCellIterator::ReturnNext( SCCOL& rCol, SCROW& rRow ) { rCol = nCol; rRow = nRow; @@ -1705,14 +1705,14 @@ BOOL ScHorizontalCellIterator::ReturnNext( SCCOL& rCol, SCROW& rRow ) void ScHorizontalCellIterator::Advance() { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL i; for (i=nCol+1; i<=nEndCol && !bFound; i++) if (pNextRows[i-nStartCol] == nRow) { nCol = i; - bFound = TRUE; + bFound = sal_True; } if (!bFound) @@ -1728,12 +1728,12 @@ void ScHorizontalCellIterator::Advance() if (nMinRow <= nEndRow) { nRow = nMinRow; - bFound = TRUE; + bFound = sal_True; } } if ( !bFound ) - bMore = FALSE; + bMore = false; } //------------------------------------------------------------------------------- @@ -1753,14 +1753,14 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB nRow = nStartRow; nCol = nStartCol; - bRowEmpty = FALSE; + bRowEmpty = false; pIndices = new SCSIZE[nEndCol-nStartCol+1]; pNextEnd = new SCROW[nEndCol-nStartCol+1]; ppPatterns = new const ScPatternAttr*[nEndCol-nStartCol+1]; SCROW nSkipTo = MAXROW; - BOOL bEmpty = TRUE; + sal_Bool bEmpty = sal_True; for (i=nStartCol; i<=nEndCol; i++) { SCCOL nPos = i - nStartCol; @@ -1779,7 +1779,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB nSkipTo = nThisEnd; // nSkipTo kann gleich hier gesetzt werden } else - bEmpty = FALSE; // Attribute gefunden + bEmpty = false; // Attribute gefunden pIndices[nPos] = nIndex; pNextEnd[nPos] = nThisEnd; @@ -1828,7 +1828,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo if ( nRow > nEndRow ) // schon am Ende? return NULL; // nichts gefunden - BOOL bEmpty = TRUE; + sal_Bool bEmpty = sal_True; SCCOL i; for ( i = nStartCol; i <= nEndCol; i++) @@ -1846,7 +1846,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo if ( IsDefaultItem( pPattern ) ) pPattern = NULL; else - bEmpty = FALSE; // Attribute gefunden + bEmpty = false; // Attribute gefunden pNextEnd[nPos] = nThisEnd; ppPatterns[nPos] = pPattern; @@ -1861,7 +1861,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo } } else if ( ppPatterns[nPos] ) - bEmpty = FALSE; // Bereich noch nicht zuende + bEmpty = false; // Bereich noch nicht zuende } if (bEmpty) @@ -1880,7 +1880,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo //------------------------------------------------------------------------------- -inline BOOL IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) +inline sal_Bool IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) { return ( nRow1 > nRow2 ) || ( nRow1 == nRow2 && nCol1 > nCol2 ); } @@ -1900,7 +1900,7 @@ ScUsedAreaIterator::~ScUsedAreaIterator() { } -BOOL ScUsedAreaIterator::GetNext() +sal_Bool ScUsedAreaIterator::GetNext() { // Iteratoren weiterzaehlen @@ -1918,8 +1918,8 @@ BOOL ScUsedAreaIterator::GetNext() // naechsten Abschnitt heraussuchen - BOOL bFound = TRUE; - BOOL bUseCell = FALSE; + sal_Bool bFound = sal_True; + sal_Bool bUseCell = false; if ( pCell && pPattern ) { @@ -1936,7 +1936,7 @@ BOOL ScUsedAreaIterator::GetNext() } else { - bUseCell = TRUE; + bUseCell = sal_True; if ( nAttrRow == nCellRow && nAttrCol1 == nCellCol ) // Attribute auf der Zelle ? pFoundPattern = pPattern; else @@ -1946,7 +1946,7 @@ BOOL ScUsedAreaIterator::GetNext() else if ( pCell ) // nur Zelle -> direkt uebernehmen { pFoundPattern = NULL; - bUseCell = TRUE; // Position von Zelle + bUseCell = sal_True; // Position von Zelle } else if ( pPattern ) // nur Attribute -> direkt uebernehmen { @@ -1957,7 +1957,7 @@ BOOL ScUsedAreaIterator::GetNext() nFoundEndCol = nAttrCol2; } else // gar nichts - bFound = FALSE; + bFound = false; if ( bUseCell ) // Position von Zelle { @@ -2100,7 +2100,7 @@ void ScDocRowHeightUpdater::updateAll() ScProgress aProgress(mrDoc.GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount); Fraction aZoom(1, 1); - ULONG nProgressStart = 0; + sal_uLong nProgressStart = 0; for (SCTAB nTab = 0; nTab <= MAXTAB; ++nTab) { if (!ValidTab(nTab) || !mrDoc.pTab[nTab]) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 86e98e238337..cb9b8044efc3 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -80,17 +80,17 @@ // STATIC DATA ----------------------------------------------------------- -USHORT* ScDocumentPool::pVersionMap1 = 0; -USHORT* ScDocumentPool::pVersionMap2 = 0; -USHORT* ScDocumentPool::pVersionMap3 = 0; -USHORT* ScDocumentPool::pVersionMap4 = 0; -USHORT* ScDocumentPool::pVersionMap5 = 0; -USHORT* ScDocumentPool::pVersionMap6 = 0; -USHORT* ScDocumentPool::pVersionMap7 = 0; -USHORT* ScDocumentPool::pVersionMap8 = 0; -USHORT* ScDocumentPool::pVersionMap9 = 0; -USHORT* ScDocumentPool::pVersionMap10 = 0; -USHORT* ScDocumentPool::pVersionMap11 = 0; +sal_uInt16* ScDocumentPool::pVersionMap1 = 0; +sal_uInt16* ScDocumentPool::pVersionMap2 = 0; +sal_uInt16* ScDocumentPool::pVersionMap3 = 0; +sal_uInt16* ScDocumentPool::pVersionMap4 = 0; +sal_uInt16* ScDocumentPool::pVersionMap5 = 0; +sal_uInt16* ScDocumentPool::pVersionMap6 = 0; +sal_uInt16* ScDocumentPool::pVersionMap7 = 0; +sal_uInt16* ScDocumentPool::pVersionMap8 = 0; +sal_uInt16* ScDocumentPool::pVersionMap9 = 0; +sal_uInt16* ScDocumentPool::pVersionMap10 = 0; +sal_uInt16* ScDocumentPool::pVersionMap11 = 0; // ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c @@ -191,7 +191,7 @@ static SfxItemInfo const aItemInfos[] = // ----------------------------------------------------------------------- -ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) +ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts ) : SfxItemPool ( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScDocumentPool")), ATTR_STARTINDEX, ATTR_ENDINDEX, @@ -223,9 +223,9 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_HORI); pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_VERT); - pGlobalBorderInnerAttr->SetTable(TRUE); - pGlobalBorderInnerAttr->SetDist(TRUE); - pGlobalBorderInnerAttr->SetMinDist(FALSE); + pGlobalBorderInnerAttr->SetTable(sal_True); + pGlobalBorderInnerAttr->SetDist(sal_True); + pGlobalBorderInnerAttr->SetMinDist(false); ppPoolDefaults = new SfxPoolItem*[ATTR_ENDINDEX-ATTR_STARTINDEX+1]; @@ -236,8 +236,8 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults[ ATTR_FONT_UNDERLINE - ATTR_STARTINDEX ] = new SvxUnderlineItem( UNDERLINE_NONE, ATTR_FONT_UNDERLINE ); ppPoolDefaults[ ATTR_FONT_OVERLINE - ATTR_STARTINDEX ] = new SvxOverlineItem( UNDERLINE_NONE, ATTR_FONT_OVERLINE ); ppPoolDefaults[ ATTR_FONT_CROSSEDOUT - ATTR_STARTINDEX ] = new SvxCrossedOutItem( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT ); - ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( sal_False, ATTR_FONT_CONTOUR ); - ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( sal_False, ATTR_FONT_SHADOWED ); + ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( false, ATTR_FONT_CONTOUR ); + ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( false, ATTR_FONT_SHADOWED ); ppPoolDefaults[ ATTR_FONT_COLOR - ATTR_STARTINDEX ] = new SvxColorItem( Color(COL_AUTO), ATTR_FONT_COLOR ); ppPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_FONT_LANGUAGE ); ppPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont; @@ -254,18 +254,18 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ATTR_CTL_FONT_LANGUAGE ); ppPoolDefaults[ ATTR_FONT_EMPHASISMARK-ATTR_STARTINDEX ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, ATTR_FONT_EMPHASISMARK ); ppPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF ); - ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(sal_False, ATTR_FONT_WORDLINE ); + ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(false, ATTR_FONT_WORDLINE ); ppPoolDefaults[ ATTR_FONT_RELIEF - ATTR_STARTINDEX ] = new SvxCharReliefItem( RELIEF_NONE, ATTR_FONT_RELIEF ); ppPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE ); - ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( sal_False, ATTR_SCRIPTSPACE); - ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( sal_False, ATTR_HANGPUNCTUATION); - ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( sal_False, ATTR_FORBIDDEN_RULES); + ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( false, ATTR_SCRIPTSPACE); + ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( false, ATTR_HANGPUNCTUATION); + ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES); ppPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY); ppPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_HOR_JUSTIFY_METHOD); ppPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 ); ppPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY); ppPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_VER_JUSTIFY_METHOD); - ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, FALSE ); + ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, false ); ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 ); ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE ); ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN ); @@ -311,16 +311,16 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults[ ATTR_PAGE_MAXSIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_MAXSIZE ); ppPoolDefaults[ ATTR_PAGE_HORCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HORCENTER ); ppPoolDefaults[ ATTR_PAGE_VERCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_VERCENTER ); - ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, TRUE ); - ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, TRUE ); - ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, TRUE ); - ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, FALSE ); - ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, FALSE ); - ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, FALSE ); + ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, sal_True ); + ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, sal_True ); + ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, sal_True ); + ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, false ); + ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, false ); + ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, false ); ppPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS ); ppPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS ); ppPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS ); - ppPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, TRUE ); + ppPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, sal_True ); ppPoolDefaults[ ATTR_PAGE_SCALE - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALE, 100 ); ppPoolDefaults[ ATTR_PAGE_SCALETOPAGES-ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, 1 ); ppPoolDefaults[ ATTR_PAGE_FIRSTPAGENO- ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 1 ); @@ -334,8 +334,8 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT ); ppPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet ); ppPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet ); - ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, FALSE ); - ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, TRUE ); + ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false ); + ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, sal_True ); ppPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 ); SetDefaults( ppPoolDefaults ); @@ -384,7 +384,7 @@ ScDocumentPool::~ScDocumentPool() { Delete(); - for ( USHORT i=0; i < ATTR_ENDINDEX-ATTR_STARTINDEX+1; i++ ) + for ( sal_uInt16 i=0; i < ATTR_ENDINDEX-ATTR_STARTINDEX+1; i++ ) { SetRefCount( *ppPoolDefaults[i], 0 ); delete ppPoolDefaults[i]; @@ -408,12 +408,12 @@ void ScDocumentPool::InitVersionMaps() // erste Map: ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt - const USHORT nMap1Start = 100; // alter ATTR_STARTINDEX - const USHORT nMap1End = 157; // alter ATTR_ENDINDEX - const USHORT nMap1Count = nMap1End - nMap1Start + 1; - const USHORT nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX - pVersionMap1 = new USHORT [ nMap1Count ]; - USHORT i, j; + const sal_uInt16 nMap1Start = 100; // alter ATTR_STARTINDEX + const sal_uInt16 nMap1End = 157; // alter ATTR_ENDINDEX + const sal_uInt16 nMap1Count = nMap1End - nMap1Start + 1; + const sal_uInt16 nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX + pVersionMap1 = new sal_uInt16 [ nMap1Count ]; + sal_uInt16 i, j; for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ ) pVersionMap1[i] = j; // ein Eintrag eingefuegt... @@ -422,11 +422,11 @@ void ScDocumentPool::InitVersionMaps() // zweite Map: ATTR_VALIDDATA und ATTR_CONDITIONAL ab 341 eingefuegt - const USHORT nMap2Start = 100; // ATTR_STARTINDEX - const USHORT nMap2End = 158; // ATTR_ENDINDEX - const USHORT nMap2Count = nMap2End - nMap2Start + 1; - const USHORT nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX - pVersionMap2 = new USHORT [ nMap2Count ]; + const sal_uInt16 nMap2Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap2End = 158; // ATTR_ENDINDEX + const sal_uInt16 nMap2Count = nMap2End - nMap2Start + 1; + const sal_uInt16 nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX + pVersionMap2 = new sal_uInt16 [ nMap2Count ]; for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ ) pVersionMap2[i] = j; // zwei Eintraege eingefuegt... @@ -435,11 +435,11 @@ void ScDocumentPool::InitVersionMaps() // dritte Map: ATTR_INDENT ab 350 eingefuegt - const USHORT nMap3Start = 100; // ATTR_STARTINDEX - const USHORT nMap3End = 160; // ATTR_ENDINDEX - const USHORT nMap3Count = nMap3End - nMap3Start + 1; - const USHORT nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX - pVersionMap3 = new USHORT [ nMap3Count ]; + const sal_uInt16 nMap3Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap3End = 160; // ATTR_ENDINDEX + const sal_uInt16 nMap3Count = nMap3End - nMap3Start + 1; + const sal_uInt16 nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX + pVersionMap3 = new sal_uInt16 [ nMap3Count ]; for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ ) pVersionMap3[i] = j; // ein Eintrag eingefuegt... @@ -448,11 +448,11 @@ void ScDocumentPool::InitVersionMaps() // vierte Map: ATTR_ROTATE_VALUE und ATTR_ROTATE_MODE ab 367 eingefuegt - const USHORT nMap4Start = 100; // ATTR_STARTINDEX - const USHORT nMap4End = 161; // ATTR_ENDINDEX - const USHORT nMap4Count = nMap4End - nMap4Start + 1; - const USHORT nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX - pVersionMap4 = new USHORT [ nMap4Count ]; + const sal_uInt16 nMap4Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap4End = 161; // ATTR_ENDINDEX + const sal_uInt16 nMap4Count = nMap4End - nMap4Start + 1; + const sal_uInt16 nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX + pVersionMap4 = new sal_uInt16 [ nMap4Count ]; for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ ) pVersionMap4[i] = j; // zwei Eintraege eingefuegt... @@ -461,11 +461,11 @@ void ScDocumentPool::InitVersionMaps() // fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614 - const USHORT nMap5Start = 100; // ATTR_STARTINDEX - const USHORT nMap5End = 163; // ATTR_ENDINDEX - const USHORT nMap5Count = nMap5End - nMap5Start + 1; - const USHORT nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX - pVersionMap5 = new USHORT [ nMap5Count ]; + const sal_uInt16 nMap5Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap5End = 163; // ATTR_ENDINDEX + const sal_uInt16 nMap5Count = nMap5End - nMap5Start + 1; + const sal_uInt16 nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX + pVersionMap5 = new sal_uInt16 [ nMap5Count ]; for ( i=0, j=nMap5Start; i < nMap5New; i++, j++ ) pVersionMap5[i] = j; // 12 entries inserted @@ -474,11 +474,11 @@ void ScDocumentPool::InitVersionMaps() // sixth map: ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES added in 614d - const USHORT nMap6Start = 100; // ATTR_STARTINDEX - const USHORT nMap6End = 175; // ATTR_ENDINDEX - const USHORT nMap6Count = nMap6End - nMap6Start + 1; - const USHORT nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX - pVersionMap6 = new USHORT [ nMap6Count ]; + const sal_uInt16 nMap6Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap6End = 175; // ATTR_ENDINDEX + const sal_uInt16 nMap6Count = nMap6End - nMap6Start + 1; + const sal_uInt16 nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX + pVersionMap6 = new sal_uInt16 [ nMap6Count ]; for ( i=0, j=nMap6Start; i < nMap6New; i++, j++ ) pVersionMap6[i] = j; // 3 entries inserted @@ -487,11 +487,11 @@ void ScDocumentPool::InitVersionMaps() // seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b - const USHORT nMap7Start = 100; // ATTR_STARTINDEX - const USHORT nMap7End = 178; // ATTR_ENDINDEX - const USHORT nMap7Count = nMap7End - nMap7Start + 1; - const USHORT nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX - pVersionMap7 = new USHORT [ nMap7Count ]; + const sal_uInt16 nMap7Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap7End = 178; // ATTR_ENDINDEX + const sal_uInt16 nMap7Count = nMap7End - nMap7Start + 1; + const sal_uInt16 nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX + pVersionMap7 = new sal_uInt16 [ nMap7Count ]; for ( i=0, j=nMap7Start; i < nMap7New; i++, j++ ) pVersionMap7[i] = j; // 3 entries inserted @@ -500,11 +500,11 @@ void ScDocumentPool::InitVersionMaps() // eighth map: ATTR_VERTICAL_ASIAN added in 642q - const USHORT nMap8Start = 100; // ATTR_STARTINDEX - const USHORT nMap8End = 181; // ATTR_ENDINDEX - const USHORT nMap8Count = nMap8End - nMap8Start + 1; - const USHORT nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX - pVersionMap8 = new USHORT [ nMap8Count ]; + const sal_uInt16 nMap8Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap8End = 181; // ATTR_ENDINDEX + const sal_uInt16 nMap8Count = nMap8End - nMap8Start + 1; + const sal_uInt16 nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX + pVersionMap8 = new sal_uInt16 [ nMap8Count ]; for ( i=0, j=nMap8Start; i < nMap8New; i++, j++ ) pVersionMap8[i] = j; // 1 entry inserted @@ -513,11 +513,11 @@ void ScDocumentPool::InitVersionMaps() // 9th map: ATTR_WRITINGDIR added in 643y - const USHORT nMap9Start = 100; // ATTR_STARTINDEX - const USHORT nMap9End = 182; // ATTR_ENDINDEX - const USHORT nMap9Count = nMap9End - nMap9Start + 1; - const USHORT nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX - pVersionMap9 = new USHORT [ nMap9Count ]; + const sal_uInt16 nMap9Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap9End = 182; // ATTR_ENDINDEX + const sal_uInt16 nMap9Count = nMap9End - nMap9Start + 1; + const sal_uInt16 nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX + pVersionMap9 = new sal_uInt16 [ nMap9Count ]; for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ ) pVersionMap9[i] = j; // 1 entry inserted @@ -528,11 +528,11 @@ void ScDocumentPool::InitVersionMaps() // 10th map: ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14 - const USHORT nMap10Start = 100; // ATTR_STARTINDEX - const USHORT nMap10End = 184; // ATTR_ENDINDEX - const USHORT nMap10Count = nMap10End - nMap10Start + 1; - const USHORT nMap10New = 37; // ATTR_SHRINKTOFIT - ATTR_STARTINDEX - pVersionMap10 = new USHORT [ nMap10Count ]; + const sal_uInt16 nMap10Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap10End = 184; // ATTR_ENDINDEX + const sal_uInt16 nMap10Count = nMap10End - nMap10Start + 1; + const sal_uInt16 nMap10New = 37; // ATTR_SHRINKTOFIT - ATTR_STARTINDEX + pVersionMap10 = new sal_uInt16 [ nMap10Count ]; for ( i=0, j=nMap10Start; i < nMap10New; i++, j++ ) pVersionMap10[i] = j; // 3 entries inserted @@ -541,11 +541,11 @@ void ScDocumentPool::InitVersionMaps() // 11th map: ATTR_FONT_OVERLINE added in DEV300/overline2 - const USHORT nMap11Start = 100; // ATTR_STARTINDEX - const USHORT nMap11End = 187; // ATTR_ENDINDEX - const USHORT nMap11Count = nMap11End - nMap11Start + 1; - const USHORT nMap11New = 5; // ATTR_FONT_OVERLINE - ATTR_STARTINDEX - pVersionMap11 = new USHORT [ nMap11Count ]; + const sal_uInt16 nMap11Start = 100; // ATTR_STARTINDEX + const sal_uInt16 nMap11End = 187; // ATTR_ENDINDEX + const sal_uInt16 nMap11Count = nMap11End - nMap11Start + 1; + const sal_uInt16 nMap11New = 5; // ATTR_FONT_OVERLINE - ATTR_STARTINDEX + pVersionMap11 = new sal_uInt16 [ nMap11Count ]; for ( i=0, j=nMap11Start; i < nMap11New; i++, j++ ) pVersionMap11[i] = j; // 1 entry inserted @@ -588,7 +588,7 @@ void ScDocumentPool::DeleteVersionMaps() // ---------------------------------------------------------------------------------------- // -// Fuer die Pattern-Attribute (SetItems) kann der USHORT RefCount leicht ueberlaufen +// Fuer die Pattern-Attribute (SetItems) kann der sal_uInt16 RefCount leicht ueberlaufen // (z.B. 600 ganze Zeilen abwechselnd formatieren). // Darum wird der RefCount bei SC_MAX_POOLREF festgehalten und nicht mehr hoch- oder // heruntergezaehlt. Dieser RefCount wird dann erst beim naechsten Laden neu gezaehlt. @@ -597,7 +597,7 @@ void ScDocumentPool::DeleteVersionMaps() // wird (Assertions). // -const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) +const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ) { if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special return SfxItemPool::Put( rItem, nWhich ); @@ -616,13 +616,13 @@ void ScDocumentPool::Remove( const SfxPoolItem& rItem ) { if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special { - ULONG nRef = rItem.GetRefCount(); - if ( nRef >= (ULONG) SC_MAX_POOLREF && nRef <= (ULONG) SFX_ITEMS_OLD_MAXREF ) + sal_uLong nRef = rItem.GetRefCount(); + if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF ) { - if ( nRef != (ULONG) SC_SAFE_POOLREF ) + if ( nRef != (sal_uLong) SC_SAFE_POOLREF ) { OSL_FAIL("Wer fummelt da an meinen Ref-Counts herum"); - SetRefCount( (SfxPoolItem&)rItem, (ULONG) SC_SAFE_POOLREF ); + SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF ); } return; // nicht herunterzaehlen } @@ -632,14 +632,14 @@ void ScDocumentPool::Remove( const SfxPoolItem& rItem ) void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) { - ULONG nRef = rItem.GetRefCount(); - if ( nRef >= (ULONG) SC_MAX_POOLREF && nRef <= (ULONG) SFX_ITEMS_OLD_MAXREF ) + sal_uLong nRef = rItem.GetRefCount(); + if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF ) { // beim Apply vom Cache wird evtl. um 2 hochgezaehlt (auf MAX+1 oder SAFE+2), // heruntergezaehlt wird nur einzeln (in LoadCompleted) - DBG_ASSERT( nRef<=(ULONG)SC_MAX_POOLREF+1 || (nRef>=(ULONG)SC_SAFE_POOLREF-1 && nRef<=(ULONG)SC_SAFE_POOLREF+2), + DBG_ASSERT( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2), "ScDocumentPool::CheckRef" ); - SetRefCount( (SfxPoolItem&)rItem, (ULONG) SC_SAFE_POOLREF ); + SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF ); } } @@ -647,10 +647,10 @@ void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle ) { - USHORT nCount = GetItemCount(ATTR_PATTERN); - for (USHORT i=0; i<nCount; i++) + sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN); + for (sal_uInt32 i=0; i<nCount; i++) { - ScPatternAttr* pPattern = (ScPatternAttr*)GetItem(ATTR_PATTERN, i); + ScPatternAttr* pPattern = (ScPatternAttr*)GetItem2(ATTR_PATTERN, i); if ( pPattern && pPattern->GetStyleSheet() == pStyle ) pPattern->StyleToName(); } @@ -663,10 +663,12 @@ void ScDocumentPool::CellStyleCreated( const String& rName ) // Calling StyleSheetChanged isn't enough because the pool may still contain items // for undo or clipboard content. - sal_uInt16 nCount = GetItemCount(ATTR_PATTERN); - for (sal_uInt16 i=0; i<nCount; i++) + sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN); + for (sal_uInt32 i=0; i<nCount; i++) { - ScPatternAttr* pPattern = (ScPatternAttr*)GetItem(ATTR_PATTERN, i); + ScPatternAttr *const pPattern = + const_cast<ScPatternAttr*>( + static_cast<ScPatternAttr const*>(GetItem2(ATTR_PATTERN, i))); if ( pPattern && pPattern->GetStyleSheet() == NULL ) { const String* pStyleName = pPattern->GetStyleName(); @@ -678,7 +680,7 @@ void ScDocumentPool::CellStyleCreated( const String& rName ) SfxItemPool* ScDocumentPool::Clone() const { - return new SfxItemPool (*this, TRUE); + return new SfxItemPool (*this, sal_True); } SfxItemPresentation lcl_HFPresentation @@ -694,9 +696,9 @@ SfxItemPresentation lcl_HFPresentation const SfxItemSet& rSet = ((const SfxSetItem&)rItem).GetItemSet(); const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == rSet.GetItemState(ATTR_PAGE_ON,FALSE,&pItem) ) + if ( SFX_ITEM_SET == rSet.GetItemState(ATTR_PAGE_ON,false,&pItem) ) { - if( FALSE == ((const SfxBoolItem*)pItem)->GetValue() ) + if( false == ((const SfxBoolItem*)pItem)->GetValue() ) return SFX_ITEM_PRESENTATION_NONE; } @@ -707,7 +709,7 @@ SfxItemPresentation lcl_HFPresentation while( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); aText.Erase(); @@ -721,14 +723,14 @@ SfxItemPresentation lcl_HFPresentation case ATTR_LRSPACE: { SvxLRSpaceItem& rLRItem = (SvxLRSpaceItem&)*pItem; - USHORT nPropLeftMargin = rLRItem.GetPropLeft(); - USHORT nPropRightMargin = rLRItem.GetPropRight(); - USHORT nLeftMargin, nRightMargin; + sal_uInt16 nPropLeftMargin = rLRItem.GetPropLeft(); + sal_uInt16 nPropRightMargin = rLRItem.GetPropRight(); + sal_uInt16 nLeftMargin, nRightMargin; long nTmp; nTmp = rLRItem.GetLeft(); - nLeftMargin = nTmp < 0 ? 0 : USHORT(nTmp); + nLeftMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp); nTmp = rLRItem.GetRight(); - nRightMargin = nTmp < 0 ? 0 : USHORT(nTmp); + nRightMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp); aText = EE_RESSTR(RID_SVXITEMS_LRSPACE_LEFT); if ( 100 != nPropLeftMargin ) @@ -791,7 +793,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( String& rText, const IntlWrapper* pIntl ) const { - USHORT nW = rItem.Which(); + sal_uInt16 nW = rItem.Which(); String aStrYes ( ScGlobal::GetRscString(STR_YES) ); String aStrNo ( ScGlobal::GetRscString(STR_NO) ); String aStrSep = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(": ")); @@ -904,7 +906,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( case ATTR_PAGE_SCALETOPAGES: { - USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); + sal_uInt16 nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); if( nPagNo ) { @@ -937,7 +939,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( case ATTR_PAGE_FIRSTPAGENO: { - USHORT nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); + sal_uInt16 nPagNo = ((const SfxUInt16Item&)rItem).GetValue(); if( nPagNo ) { @@ -965,7 +967,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( case ATTR_PAGE_SCALE: { - USHORT nPercent = ((const SfxUInt16Item&)rItem).GetValue(); + sal_uInt16 nPercent = ((const SfxUInt16Item&)rItem).GetValue(); if( nPercent ) { @@ -1030,7 +1032,7 @@ SfxItemPresentation ScDocumentPool::GetPresentation( return ePresentation; } -SfxMapUnit ScDocumentPool::GetMetric( USHORT nWhich ) const +SfxMapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const { // eigene Attribute: Twips, alles andere 1/100 mm diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 62998357819f..f1faef8cb736 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -183,39 +183,39 @@ ScDocument::ScDocument( ScDocumentMode eMode, nVisibleTab( 0 ), eLinkMode(LM_UNKNOWN), bAutoCalc( eMode == SCDOCMODE_DOCUMENT ), - bAutoCalcShellDisabled( FALSE ), - bForcedFormulaPending( FALSE ), - bCalculatingFormulaTree( FALSE ), + bAutoCalcShellDisabled( false ), + bForcedFormulaPending( false ), + bCalculatingFormulaTree( false ), bIsClip( eMode == SCDOCMODE_CLIP ), bIsUndo( eMode == SCDOCMODE_UNDO ), - bIsVisible( FALSE ), - bIsEmbedded( FALSE ), - bNoSetDirty( FALSE ), - bInsertingFromOtherDoc( FALSE ), + bIsVisible( false ), + bIsEmbedded( false ), + bNoSetDirty( false ), + bInsertingFromOtherDoc( false ), bLoadingMedium( false ), bImportingXML( false ), - bXMLFromWrapper( FALSE ), - bCalcingAfterLoad( FALSE ), - bNoListening( FALSE ), - bIdleDisabled( FALSE ), - bInLinkUpdate( FALSE ), - bChartListenerCollectionNeedsUpdate( FALSE ), - bHasForcedFormulas( FALSE ), - bInDtorClear( FALSE ), - bExpandRefs( FALSE ), - bDetectiveDirty( FALSE ), + bXMLFromWrapper( false ), + bCalcingAfterLoad( false ), + bNoListening( false ), + bIdleDisabled( false ), + bInLinkUpdate( false ), + bChartListenerCollectionNeedsUpdate( false ), + bHasForcedFormulas( false ), + bInDtorClear( false ), + bExpandRefs( false ), + bDetectiveDirty( false ), nMacroCallMode( SC_MACROCALL_ALLOWED ), - bHasMacroFunc( FALSE ), + bHasMacroFunc( false ), nVisSpellState( 0 ), nAsianCompression(SC_ASIANCOMPRESSION_INVALID), nAsianKerning(SC_ASIANKERNING_INVALID), - bSetDrawDefaults( FALSE ), - bPastingDrawFromOtherDoc( FALSE ), + bSetDrawDefaults( false ), + bPastingDrawFromOtherDoc( false ), nInDdeLinkUpdate( 0 ), - bInUnoBroadcast( FALSE ), - bInUnoListenerCall( FALSE ), + bInUnoBroadcast( false ), + bInUnoListenerCall( false ), eGrammar( formula::FormulaGrammar::GRAM_NATIVE ), - bStyleSheetUsageInvalid( TRUE ), + bStyleSheetUsageInvalid( sal_True ), mbUndoEnabled( true ), mbAdjustHeightEnabled( true ), mbExecuteLinkEnabled( true ), @@ -251,7 +251,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, pTab[i] = NULL; pRangeName = new ScRangeName(this); - pDBCollection = new ScDBCollection( 4, 4, FALSE, this ); + pDBCollection = new ScDBCollection( 4, 4, false, this ); pSelectionAttr = NULL; pChartCollection = new ScChartCollection; apTemporaryChartLock = std::auto_ptr< ScTemporaryChartLock >( new ScTemporaryChartLock(this) ); @@ -293,7 +293,7 @@ void ScDocument::SetStorageGrammar( formula::FormulaGrammar::Grammar eGram ) } -void ScDocument::SetDocVisible( BOOL bSet ) +void ScDocument::SetDocVisible( sal_Bool bSet ) { // called from view ctor - only for a visible document, // each new sheet's RTL flag is initialized from the locale @@ -349,7 +349,7 @@ IMPL_LINK( ScDocument, TrackTimeHdl, Timer*, EMPTYARG ) if (!pShell->IsModified()) { - pShell->SetModified( TRUE ); + pShell->SetModified( sal_True ); SfxBindings* pBindings = GetViewBindings(); if (pBindings) { @@ -372,7 +372,7 @@ ScDocument::~ScDocument() { DBG_ASSERT( !bInLinkUpdate, "bInLinkUpdate in dtor" ); - bInDtorClear = TRUE; + bInDtorClear = sal_True; // first of all disable all refresh timers by deleting the control if ( pRefreshTimerControl ) @@ -387,7 +387,7 @@ ScDocument::~ScDocument() if ( GetLinkManager() ) { // BaseLinks freigeben - for ( USHORT n = pLinkManager->GetServers().Count(); n; ) + for ( sal_uInt16 n = pLinkManager->GetServers().Count(); n; ) pLinkManager->GetServers()[ --n ]->Closed(); if ( pLinkManager->GetLinks().Count() ) @@ -417,7 +417,7 @@ ScDocument::~ScDocument() delete pUnoRefUndoList; delete pUnoListenerCalls; - Clear( sal_True ); // TRUE = from destructor (needed for SdrModel::ClearModel) + Clear( sal_True ); // sal_True = from destructor (needed for SdrModel::ClearModel) if (pCondFormList) { @@ -530,8 +530,8 @@ ScFieldEditEngine& ScDocument::GetEditEngine() if ( !pEditEngine ) { pEditEngine = new ScFieldEditEngine( GetEnginePool(), GetEditPool() ); - pEditEngine->SetUpdateMode( FALSE ); - pEditEngine->EnableUndo( FALSE ); + pEditEngine->SetUpdateMode( false ); + pEditEngine->EnableUndo( false ); pEditEngine->SetRefMapMode( MAP_100TH_MM ); pEditEngine->SetForbiddenCharsTable( xForbiddenCharacters ); } @@ -543,8 +543,8 @@ ScNoteEditEngine& ScDocument::GetNoteEngine() if ( !pNoteEngine ) { pNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() ); - pNoteEngine->SetUpdateMode( FALSE ); - pNoteEngine->EnableUndo( FALSE ); + pNoteEngine->SetUpdateMode( false ); + pNoteEngine->EnableUndo( false ); pNoteEngine->SetRefMapMode( MAP_100TH_MM ); pNoteEngine->SetForbiddenCharsTable( xForbiddenCharacters ); const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet(); @@ -600,19 +600,19 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, SCTAB nTab ) void ScDocument::DeleteNumberFormat( const sal_uInt32* /* pDelKeys */, sal_uInt32 /* nCount */ ) { /* - for (ULONG i = 0; i < nCount; i++) + for (sal_uLong i = 0; i < nCount; i++) xPoolHelper->GetFormTable()->DeleteEntry(pDelKeys[i]); */ } void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, - ScBaseCell* pCell, ULONG nFormatIndex, BOOL bForceTab ) + ScBaseCell* pCell, sal_uLong nFormatIndex, sal_Bool bForceTab ) { if (VALIDTAB(nTab)) { if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + sal_Bool bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -625,20 +625,20 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, } -BOOL ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, - BOOL bNotes ) const +sal_Bool ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, + sal_Bool bNotes ) const { if (ValidTab(nTab) && pTab[nTab]) { - BOOL bAny = pTab[nTab]->GetPrintArea( rEndCol, rEndRow, bNotes ); + sal_Bool bAny = pTab[nTab]->GetPrintArea( rEndCol, rEndRow, bNotes ); if (pDrawLayer) { ScRange aDrawRange(0,0,nTab, MAXCOL,MAXROW,nTab); - if (DrawGetPrintArea( aDrawRange, TRUE, TRUE )) + if (DrawGetPrintArea( aDrawRange, sal_True, sal_True )) { if (aDrawRange.aEnd.Col()>rEndCol) rEndCol=aDrawRange.aEnd.Col(); if (aDrawRange.aEnd.Row()>rEndRow) rEndRow=aDrawRange.aEnd.Row(); - bAny = TRUE; + bAny = sal_True; } } return bAny; @@ -646,66 +646,66 @@ BOOL ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, rEndCol = 0; rEndRow = 0; - return FALSE; + return false; } -BOOL ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, - SCCOL& rEndCol, BOOL bNotes ) const +sal_Bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, + SCCOL& rEndCol, sal_Bool bNotes ) const { if (ValidTab(nTab) && pTab[nTab]) { - BOOL bAny = pTab[nTab]->GetPrintAreaHor( nStartRow, nEndRow, rEndCol, bNotes ); + sal_Bool bAny = pTab[nTab]->GetPrintAreaHor( nStartRow, nEndRow, rEndCol, bNotes ); if (pDrawLayer) { ScRange aDrawRange(0,nStartRow,nTab, MAXCOL,nEndRow,nTab); - if (DrawGetPrintArea( aDrawRange, TRUE, FALSE )) + if (DrawGetPrintArea( aDrawRange, sal_True, false )) { if (aDrawRange.aEnd.Col()>rEndCol) rEndCol=aDrawRange.aEnd.Col(); - bAny = TRUE; + bAny = sal_True; } } return bAny; } rEndCol = 0; - return FALSE; + return false; } -BOOL ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, - SCROW& rEndRow, BOOL bNotes ) const +sal_Bool ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, + SCROW& rEndRow, sal_Bool bNotes ) const { if (ValidTab(nTab) && pTab[nTab]) { - BOOL bAny = pTab[nTab]->GetPrintAreaVer( nStartCol, nEndCol, rEndRow, bNotes ); + sal_Bool bAny = pTab[nTab]->GetPrintAreaVer( nStartCol, nEndCol, rEndRow, bNotes ); if (pDrawLayer) { ScRange aDrawRange(nStartCol,0,nTab, nEndCol,MAXROW,nTab); - if (DrawGetPrintArea( aDrawRange, FALSE, TRUE )) + if (DrawGetPrintArea( aDrawRange, false, sal_True )) { if (aDrawRange.aEnd.Row()>rEndRow) rEndRow=aDrawRange.aEnd.Row(); - bAny = TRUE; + bAny = sal_True; } } return bAny; } rEndRow = 0; - return FALSE; + return false; } -BOOL ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const +sal_Bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const { if (ValidTab(nTab) && pTab[nTab]) { - BOOL bAny = pTab[nTab]->GetDataStart( rStartCol, rStartRow ); + sal_Bool bAny = pTab[nTab]->GetDataStart( rStartCol, rStartRow ); if (pDrawLayer) { ScRange aDrawRange(0,0,nTab, MAXCOL,MAXROW,nTab); - if (DrawGetPrintArea( aDrawRange, TRUE, TRUE )) + if (DrawGetPrintArea( aDrawRange, sal_True, sal_True )) { if (aDrawRange.aStart.Col()<rStartCol) rStartCol=aDrawRange.aStart.Col(); if (aDrawRange.aStart.Row()<rStartRow) rStartRow=aDrawRange.aStart.Row(); - bAny = TRUE; + bAny = sal_True; } } return bAny; @@ -713,13 +713,13 @@ BOOL ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) rStartCol = 0; rStartRow = 0; - return FALSE; + return false; } -BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) +sal_Bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) { - if (nOldPos == nNewPos) return FALSE; - BOOL bValid = FALSE; + if (nOldPos == nNewPos) return false; + sal_Bool bValid = false; if (VALIDTAB(nOldPos)) { if (pTab[nOldPos]) @@ -727,9 +727,9 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) SCTAB nTabCount = GetTableCount(); if (nTabCount > 1) { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden - SetNoListening( TRUE ); + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // Mehrfachberechnungen vermeiden + SetNoListening( sal_True ); ScProgress* pProgress = new ScProgress( GetDocumentShell(), ScGlobal::GetRscString(STR_UNDO_MOVE_TAB), GetCodeCount() ); if (nNewPos == SC_TAB_APPEND) @@ -774,7 +774,7 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) for (i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->UpdateCompile(); - SetNoListening( FALSE ); + SetNoListening( false ); for (i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->StartAllListeners(); @@ -786,14 +786,14 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos ) if (pDrawLayer) DrawMovePage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) ); - bValid = TRUE; + bValid = sal_True; } } } return bValid; } -BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyMarked ) +sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyMarked ) { if (SC_TAB_APPEND == nNewPos ) nNewPos = nMaxTableNumber; String aName; @@ -801,20 +801,20 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM // vorneweg testen, ob der Prefix als gueltig erkannt wird // wenn nicht, nur doppelte vermeiden - BOOL bPrefix = ValidTabName( aName ); + sal_Bool bPrefix = ValidTabName( aName ); DBG_ASSERT(bPrefix, "ungueltiger Tabellenname"); SCTAB nDummy; CreateValidTabName(aName); - BOOL bValid; + sal_Bool bValid; if (bPrefix) bValid = ( ValidNewTabName(aName) && (nMaxTableNumber <= MAXTAB) ); else bValid = ( !GetTable( aName, nDummy ) && (nMaxTableNumber <= MAXTAB) ); - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // Mehrfachberechnungen vermeiden if (bValid) { if (nNewPos == nMaxTableNumber) @@ -826,7 +826,7 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM { if (VALIDTAB(nNewPos) && (nNewPos < nMaxTableNumber)) { - SetNoListening( TRUE ); + SetNoListening( sal_True ); ScRange aRange( 0,0,nNewPos, MAXCOL,MAXROW,MAXTAB ); xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 ); @@ -853,11 +853,11 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM nOldPos++; pTab[nNewPos] = new ScTable(this, nNewPos, aName); ++nMaxTableNumber; - bValid = TRUE; + bValid = sal_True; for (i = 0; i <= MAXTAB; i++) if (pTab[i] && i != nOldPos && i != nNewPos) pTab[i]->UpdateCompile(); - SetNoListening( FALSE ); + SetNoListening( false ); for (i = 0; i <= MAXTAB; i++) if (pTab[i] && i != nOldPos && i != nNewPos) pTab[i]->StartAllListeners(); @@ -871,12 +871,12 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM pChartListenerCollection->UpdateScheduledSeriesRanges(); } else - bValid = FALSE; + bValid = false; } } if (bValid) { - SetNoListening( TRUE ); // noch nicht bei CopyToTable/Insert + SetNoListening( sal_True ); // noch nicht bei CopyToTable/Insert pTab[nOldPos]->CopyToTable(0, 0, MAXCOL, MAXROW, IDF_ALL, (pOnlyMarked != NULL), pTab[nNewPos], pOnlyMarked ); pTab[nNewPos]->SetTabBgColor(pTab[nOldPos]->GetTabBgColor()); @@ -890,8 +890,8 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM pTab[nOldPos]->UpdateInsertTab(nNewPos); pTab[nOldPos]->UpdateCompile(); - pTab[nNewPos]->UpdateCompile( TRUE ); // maybe already compiled in Clone, but used names need recompilation - SetNoListening( FALSE ); + pTab[nNewPos]->UpdateCompile( true ); // maybe already compiled in Clone, but used names need recompilation + SetNoListening( false ); pTab[nOldPos]->StartAllListeners(); pTab[nNewPos]->StartAllListeners(); SetDirty(); @@ -910,14 +910,14 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sModuleSource ); -ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, - SCTAB nDestPos, BOOL bInsertNew, - BOOL bResultsOnly ) +sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, + SCTAB nDestPos, sal_Bool bInsertNew, + sal_Bool bResultsOnly ) { - ULONG nRetVal = 1; // 0 => Fehler 1 = ok + sal_uLong nRetVal = 1; // 0 => Fehler 1 = ok // 2 => RefBox, 3 => NameBox // 4 => beides - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; if (bInsertNew) // neu einfuegen { String aName; @@ -932,19 +932,19 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, pTab[nDestPos]->DeleteArea( 0,0, MAXCOL,MAXROW, IDF_ALL ); } else - bValid = FALSE; + bValid = false; } if (bValid) { - BOOL bOldAutoCalcSrc = FALSE; - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden - SetNoListening( TRUE ); + sal_Bool bOldAutoCalcSrc = false; + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // Mehrfachberechnungen vermeiden + SetNoListening( sal_True ); if ( bResultsOnly ) { bOldAutoCalcSrc = pSrcDoc->GetAutoCalc(); - pSrcDoc->SetAutoCalc( TRUE ); // falls was berechnet werden muss + pSrcDoc->SetAutoCalc( sal_True ); // falls was berechnet werden muss } { @@ -955,14 +955,14 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, ScBulkBroadcast aBulkBroadcast( pBASM); pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW, ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL), - FALSE, pTab[nDestPos] ); + false, pTab[nDestPos] ); } } pTab[nDestPos]->SetTabNo(nDestPos); if ( !bResultsOnly ) { - BOOL bNamesLost = FALSE; + BOOL bNamesLost = false; // array containing range names which might need update of indices. // The instances inserted into this vector are managed by the // range name container of this document, so no need to delete @@ -971,10 +971,10 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, // the index mapping thereof ScRangeData::IndexMap aSrcRangeMap; - BOOL bRangeNameReplace = FALSE; + sal_Bool bRangeNameReplace = false; // find named ranges that are used in the source sheet - std::set<USHORT> aUsedNames; + std::set<sal_uInt16> aUsedNames; pSrcDoc->pTab[nSrcPos]->FindRangeNamesInUse( 0, 0, MAXCOL, MAXROW, aUsedNames ); ScRangeName::const_iterator itr = pSrcDoc->pRangeName->begin(), itrEnd = pSrcDoc->pRangeName->end(); @@ -996,8 +996,8 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, // don't modify the named range aSrcRangeMap.insert( ScRangeData::IndexMap::value_type(nOldIndex, nExistingIndex)); - bRangeNameReplace = TRUE; - bNamesLost = TRUE; + bRangeNameReplace = sal_True; + bNamesLost = sal_True; } else { @@ -1039,7 +1039,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, MAXCOL, MAXROW, nDestPos, 0, 0, nDz, NULL); // Test for outside absolute references for info box - BOOL bIsAbsRef = pSrcDoc->pTab[nSrcPos]->TestTabRefAbs(nSrcPos); + sal_Bool bIsAbsRef = pSrcDoc->pTab[nSrcPos]->TestTabRefAbs(nSrcPos); // Readjust self-contained absolute references to this sheet pTab[nDestPos]->TestTabRefAbs(nSrcPos); if (bIsAbsRef) @@ -1055,7 +1055,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, pTab[nDestPos]->CompileAll(); } - SetNoListening( FALSE ); + SetNoListening( false ); if ( !bResultsOnly ) pTab[nDestPos]->StartAllListeners(); SetDirty( ScRange( 0, 0, nDestPos, MAXCOL, MAXROW, nDestPos)); @@ -1073,7 +1073,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, } if (!bValid) nRetVal = 0; - BOOL bVbaEnabled = IsInVBAMode(); + sal_Bool bVbaEnabled = IsInVBAMode(); if ( bVbaEnabled ) { @@ -1115,7 +1115,7 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, // ---------------------------------------------------------------------------- -void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError) +void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError) { if (VALIDTAB(nTab)) if (pTab[nTab]) @@ -1194,16 +1194,16 @@ ScFieldEditEngine* ScDocument::CreateFieldEditEngine() if (!pCacheFieldEditEngine) { pNewEditEngine = new ScFieldEditEngine( GetEnginePool(), - GetEditPool(), FALSE ); + GetEditPool(), false ); } else { if ( !bImportingXML ) { // #i66209# previous use might not have restored update mode, - // ensure same state as for a new EditEngine (UpdateMode = TRUE) + // ensure same state as for a new EditEngine (UpdateMode = sal_True) if ( !pCacheFieldEditEngine->GetUpdateMode() ) - pCacheFieldEditEngine->SetUpdateMode(TRUE); + pCacheFieldEditEngine->SetUpdateMode(sal_True); } pNewEditEngine = pCacheFieldEditEngine; diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 5b82a1dcbc09..a2d828d41fd8 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -120,7 +120,7 @@ ScDBCollection* ScDocument::GetDBCollection() const return pDBCollection; } -void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemoveAutoFilter ) +void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, sal_Bool bRemoveAutoFilter ) { if ( bRemoveAutoFilter ) { @@ -129,8 +129,8 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove if ( pDBCollection ) { - USHORT nOldCount = pDBCollection->GetCount(); - for (USHORT nOld=0; nOld<nOldCount; nOld++) + sal_uInt16 nOldCount = pDBCollection->GetCount(); + for (sal_uInt16 nOld=0; nOld<nOldCount; nOld++) { ScDBData* pOldData = (*pDBCollection)[nOld]; if ( pOldData->HasAutoFilter() ) @@ -138,8 +138,8 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove ScRange aOldRange; pOldData->GetArea( aOldRange ); - BOOL bFound = FALSE; - USHORT nNewIndex = 0; + sal_Bool bFound = false; + sal_uInt16 nNewIndex = 0; if ( pNewDBCollection && pNewDBCollection->SearchName( pOldData->GetName(), nNewIndex ) ) { @@ -149,7 +149,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove ScRange aNewRange; pNewData->GetArea( aNewRange ); if ( aOldRange.aStart == aNewRange.aStart ) - bFound = TRUE; + bFound = sal_True; } } @@ -159,8 +159,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove RemoveFlagsTab( aOldRange.aStart.Col(), aOldRange.aStart.Row(), aOldRange.aEnd.Col(), aOldRange.aEnd.Row(), aOldRange.aStart.Tab(), SC_MF_AUTO ); - if (pShell) - pShell->Broadcast( ScPaintHint( aOldRange, PAINT_GRID ) ); + RepaintRange( aOldRange ); } } } @@ -172,7 +171,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove pDBCollection = pNewDBCollection; } -ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bStartOnly) const +ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const { if (pDBCollection) return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, bStartOnly); @@ -200,9 +199,9 @@ ScDPObject* ScDocument::GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const if (!pDPCollection) return NULL; - USHORT nCount = pDPCollection->GetCount(); + sal_uInt16 nCount = pDPCollection->GetCount(); ScAddress aPos( nCol, nRow, nTab ); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) if ( (*pDPCollection)[i]->GetOutRange().In( aPos ) ) return (*pDPCollection)[i]; @@ -216,7 +215,7 @@ ScDPObject* ScDocument::GetDPAtBlock( const ScRange & rBlock ) const /* Walk the collection in reverse order to get something of an * approximation of MS Excels 'most recent' effect. */ - USHORT i = pDPCollection->GetCount(); + sal_uInt16 i = pDPCollection->GetCount(); while ( i-- > 0 ) if ( (*pDPCollection)[i]->GetOutRange().In( rBlock ) ) return (*pDPCollection)[i]; @@ -237,7 +236,7 @@ void ScDocument::StopTemporaryChartLock() void ScDocument::SetChartListenerCollection( ScChartListenerCollection* pNewChartListenerCollection, - BOOL bSetChartRangeLists ) + sal_Bool bSetChartRangeLists ) { ScChartListenerCollection* pOld = pChartListenerCollection; pChartListenerCollection = pNewChartListenerCollection; @@ -250,19 +249,19 @@ void ScDocument::SetChartListenerCollection( delete pOld; } -void ScDocument::SetScenario( SCTAB nTab, BOOL bFlag ) +void ScDocument::SetScenario( SCTAB nTab, sal_Bool bFlag ) { if (ValidTab(nTab) && pTab[nTab]) pTab[nTab]->SetScenario(bFlag); } -BOOL ScDocument::IsScenario( SCTAB nTab ) const +sal_Bool ScDocument::IsScenario( SCTAB nTab ) const { return ValidTab(nTab) && pTab[nTab] &&pTab[nTab]->IsScenario(); } void ScDocument::SetScenarioData( SCTAB nTab, const String& rComment, - const Color& rColor, USHORT nFlags ) + const Color& rColor, sal_uInt16 nFlags ) { if (ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsScenario()) { @@ -293,7 +292,7 @@ bool ScDocument::IsDefaultTabBgColor( SCTAB nTab ) const } void ScDocument::GetScenarioData( SCTAB nTab, String& rComment, - Color& rColor, USHORT& rFlags ) const + Color& rColor, sal_uInt16& rFlags ) const { if (ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsScenario()) { @@ -303,19 +302,19 @@ void ScDocument::GetScenarioData( SCTAB nTab, String& rComment, } } -void ScDocument::GetScenarioFlags( SCTAB nTab, USHORT& rFlags ) const +void ScDocument::GetScenarioFlags( SCTAB nTab, sal_uInt16& rFlags ) const { if (VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->IsScenario()) rFlags = pTab[nTab]->GetScenarioFlags(); } -BOOL ScDocument::IsLinked( SCTAB nTab ) const +sal_Bool ScDocument::IsLinked( SCTAB nTab ) const { return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsLinked(); // euqivalent to //if (ValidTab(nTab) && pTab[nTab]) // return pTab[nTab]->IsLinked(); - //return FALSE; + //return sal_False; } formula::FormulaGrammar::AddressConvention ScDocument::GetAddressConvention() const @@ -333,7 +332,7 @@ void ScDocument::SetGrammar( formula::FormulaGrammar::Grammar eGram ) eGrammar = eGram; } -BOOL ScDocument::GetLinkMode( SCTAB nTab ) const +sal_Bool ScDocument::GetLinkMode( SCTAB nTab ) const { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetLinkMode(); @@ -368,22 +367,22 @@ const String& ScDocument::GetLinkTab( SCTAB nTab ) const return EMPTY_STRING; } -ULONG ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const +sal_uLong ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetLinkRefreshDelay(); return 0; } -void ScDocument::SetLink( SCTAB nTab, BYTE nMode, const String& rDoc, +void ScDocument::SetLink( SCTAB nTab, sal_uInt8 nMode, const String& rDoc, const String& rFilter, const String& rOptions, - const String& rTabName, ULONG nRefreshDelay ) + const String& rTabName, sal_uLong nRefreshDelay ) { if (ValidTab(nTab) && pTab[nTab]) pTab[nTab]->SetLink( nMode, rDoc, rFilter, rOptions, rTabName, nRefreshDelay ); } -BOOL ScDocument::HasLink( const String& rDoc, +sal_Bool ScDocument::HasLink( const String& rDoc, const String& rFilter, const String& rOptions ) const { SCTAB nCount = GetTableCount(); @@ -392,18 +391,18 @@ BOOL ScDocument::HasLink( const String& rDoc, && pTab[i]->GetLinkDoc() == rDoc && pTab[i]->GetLinkFlt() == rFilter && pTab[i]->GetLinkOpt() == rOptions) - return TRUE; + return sal_True; - return FALSE; + return false; } -BOOL ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, +sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, const String& aFileName, const String& aTabName ) { if ( IsClipboard() ) { DBG_ERRORFILE( "LinkExternalTab in Clipboard" ); - return FALSE; + return false; } rTab = 0; String aFilterName; // wird vom Loader gefuellt @@ -411,42 +410,42 @@ BOOL ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, sal_uInt32 nLinkCnt = pExtDocOptions ? pExtDocOptions->GetDocSettings().mnLinkCnt : 0; ScDocumentLoader aLoader( aFileName, aFilterName, aOptions, nLinkCnt + 1 ); if ( aLoader.IsError() ) - return FALSE; + return false; ScDocument* pSrcDoc = aLoader.GetDocument(); // Tabelle kopieren SCTAB nSrcTab; if ( pSrcDoc->GetTable( aTabName, nSrcTab ) ) { - if ( !InsertTab( SC_TAB_APPEND, aDocTab, TRUE ) ) + if ( !InsertTab( SC_TAB_APPEND, aDocTab, sal_True ) ) { DBG_ERRORFILE("can't insert external document table"); - return FALSE; + return false; } rTab = GetTableCount() - 1; // nicht neu einfuegen, nur Ergebnisse - TransferTab( pSrcDoc, nSrcTab, rTab, FALSE, TRUE ); + TransferTab( pSrcDoc, nSrcTab, rTab, false, sal_True ); } else - return FALSE; + return false; - ULONG nRefreshDelay = 0; + sal_uLong nRefreshDelay = 0; - BOOL bWasThere = HasLink( aFileName, aFilterName, aOptions ); + sal_Bool bWasThere = HasLink( aFileName, aFilterName, aOptions ); SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay ); if ( !bWasThere ) // Link pro Quelldokument nur einmal eintragen { ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay ); - pLink->SetInCreate( TRUE ); + pLink->SetInCreate( sal_True ); GetLinkManager()->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilterName ); pLink->Update(); - pLink->SetInCreate( FALSE ); + pLink->SetInCreate( false ); SfxBindings* pBindings = GetViewBindings(); if (pBindings) pBindings->Invalidate( SID_LINKS ); } - return TRUE; + return sal_True; } ScExternalRefManager* ScDocument::GetExternalRefManager() const @@ -530,28 +529,36 @@ bool ScDocument::HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents ) return false; } -BOOL ScDocument::HasCalcNotification( SCTAB nTab ) const +bool ScDocument::HasAnyCalcNotification() const +{ + for (SCTAB nTab = 0; nTab <= MAXTAB; nTab++) + if (pTab[nTab] && pTab[nTab]->GetCalcNotification()) + return true; + return false; +} + +sal_Bool ScDocument::HasCalcNotification( SCTAB nTab ) const { if (VALIDTAB(nTab) && pTab[nTab]) return pTab[nTab]->GetCalcNotification(); - return FALSE; + return false; } void ScDocument::SetCalcNotification( SCTAB nTab ) { // set only if not set before if (VALIDTAB(nTab) && pTab[nTab] && !pTab[nTab]->GetCalcNotification()) - pTab[nTab]->SetCalcNotification(TRUE); + pTab[nTab]->SetCalcNotification(sal_True); } void ScDocument::ResetCalcNotifications() { for (SCTAB nTab = 0; nTab <= MAXTAB; nTab++) if (pTab[nTab] && pTab[nTab]->GetCalcNotification()) - pTab[nTab]->SetCalcNotification(FALSE); + pTab[nTab]->SetCalcNotification(false); } -ScOutlineTable* ScDocument::GetOutlineTable( SCTAB nTab, BOOL bCreate ) +ScOutlineTable* ScDocument::GetOutlineTable( SCTAB nTab, sal_Bool bCreate ) { ScOutlineTable* pVal = NULL; @@ -570,7 +577,7 @@ ScOutlineTable* ScDocument::GetOutlineTable( SCTAB nTab, BOOL bCreate ) return pVal; } -BOOL ScDocument::SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline ) +sal_Bool ScDocument::SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->SetOutlineTable(pNewOutline); } @@ -582,7 +589,7 @@ void ScDocument::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, pTab[nTab]->DoAutoOutline( nStartCol, nStartRow, nEndCol, nEndRow ); } -BOOL ScDocument::TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam ) +sal_Bool ScDocument::TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->TestRemoveSubTotals( rParam ); } @@ -593,23 +600,23 @@ void ScDocument::RemoveSubTotals( SCTAB nTab, ScSubTotalParam& rParam ) pTab[nTab]->RemoveSubTotals( rParam ); } -BOOL ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam ) +sal_Bool ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->DoSubTotals( rParam ); } -BOOL ScDocument::HasSubTotalCells( const ScRange& rRange ) +sal_Bool ScDocument::HasSubTotalCells( const ScRange& rRange ) { ScCellIterator aIter( this, rRange ); ScBaseCell* pCell = aIter.GetFirst(); while (pCell) { if ( pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->IsSubTotal() ) - return TRUE; + return sal_True; pCell = aIter.GetNext(); } - return FALSE; // none found + return false; // none found } // kopiert aus diesem Dokument die Zellen von Positionen, an denen in pPosDoc @@ -623,7 +630,7 @@ void ScDocument::CopyUpdated( ScDocument* pPosDoc, ScDocument* pDestDoc ) pTab[nTab]->CopyUpdated( pPosDoc->pTab[nTab], pDestDoc->pTab[nTab] ); } -void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, BOOL bNewScenario ) +void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScenario ) { if (ValidTab(nSrcTab) && ValidTab(nDestTab) && pTab[nSrcTab] && pTab[nDestTab]) { @@ -639,27 +646,27 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, BOOL bNewScenario { if ( pTab[nTab]->IsActiveScenario() ) // auch wenn's dasselbe Szenario ist { - BOOL bTouched = FALSE; + sal_Bool bTouched = false; for ( size_t nR=0, nRangeCount = aRanges.size(); nR < nRangeCount && !bTouched; nR++ ) { const ScRange* pRange = aRanges[ nR ]; if ( pTab[nTab]->HasScenarioRange( *pRange ) ) - bTouched = TRUE; + bTouched = sal_True; } if (bTouched) { - pTab[nTab]->SetActiveScenario(FALSE); + pTab[nTab]->SetActiveScenario(false); if ( pTab[nTab]->GetScenarioFlags() & SC_SCENARIO_TWOWAY ) pTab[nTab]->CopyScenarioFrom( pTab[nDestTab] ); } } } - pTab[nSrcTab]->SetActiveScenario(TRUE); // da kommt's her... + pTab[nSrcTab]->SetActiveScenario(sal_True); // da kommt's her... if (!bNewScenario) // Daten aus dem ausgewaehlten Szenario kopieren { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // Mehrfachberechnungen vermeiden pTab[nSrcTab]->CopyScenarioTo( pTab[nDestTab] ); SetDirty(); SetAutoCalc( bOldAutoCalc ); @@ -668,7 +675,7 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, BOOL bNewScenario } void ScDocument::MarkScenario( SCTAB nSrcTab, SCTAB nDestTab, ScMarkData& rDestMark, - BOOL bResetMark, USHORT nNeededBits ) const + sal_Bool bResetMark, sal_uInt16 nNeededBits ) const { if (bResetMark) rDestMark.ResetMark(); @@ -679,7 +686,7 @@ void ScDocument::MarkScenario( SCTAB nSrcTab, SCTAB nDestTab, ScMarkData& rDestM rDestMark.SetAreaTab( nDestTab ); } -BOOL ScDocument::HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const +sal_Bool ScDocument::HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const { return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->HasScenarioRange( rRange ); } @@ -692,24 +699,24 @@ const ScRangeList* ScDocument::GetScenarioRanges( SCTAB nTab ) const return NULL; } -BOOL ScDocument::IsActiveScenario( SCTAB nTab ) const +sal_Bool ScDocument::IsActiveScenario( SCTAB nTab ) const { return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsActiveScenario( ); } -void ScDocument::SetActiveScenario( SCTAB nTab, BOOL bActive ) +void ScDocument::SetActiveScenario( SCTAB nTab, sal_Bool bActive ) { if (ValidTab(nTab) && pTab[nTab]) pTab[nTab]->SetActiveScenario( bActive ); } -BOOL ScDocument::TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const +sal_Bool ScDocument::TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const { if (ValidTab(nSrcTab) && ValidTab(nDestTab)) return pTab[nSrcTab]->TestCopyScenarioTo( pTab[nDestTab] ); OSL_FAIL("falsche Tabelle bei TestCopyScenario"); - return FALSE; + return false; } void ScDocument::AddUnoObject( SfxListener& rObject ) @@ -768,9 +775,9 @@ void ScDocument::BroadcastUno( const SfxHint &rHint ) { if (pUnoBroadcaster) { - bInUnoBroadcast = TRUE; + bInUnoBroadcast = sal_True; pUnoBroadcaster->Broadcast( rHint ); - bInUnoBroadcast = FALSE; + bInUnoBroadcast = false; // During Broadcast notification, Uno objects can add to pUnoListenerCalls. // The listener calls must be processed after completing the broadcast, @@ -785,9 +792,9 @@ void ScDocument::BroadcastUno( const SfxHint &rHint ) // outermost call executes them all. ScChartLockGuard aChartLockGuard(this); - bInUnoListenerCall = TRUE; + bInUnoListenerCall = sal_True; pUnoListenerCalls->ExecuteAndClear(); - bInUnoListenerCall = FALSE; + bInUnoListenerCall = false; } } } @@ -832,7 +839,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScDocument* pUndoDoc, BOOL bIncludeDraw, + ScDocument* pUndoDoc, sal_Bool bIncludeDraw, bool bUpdateNoteCaptionPos ) { PutInOrder( nCol1, nCol2 ); @@ -840,7 +847,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode, PutInOrder( nTab1, nTab2 ); if (VALIDTAB(nTab1) && VALIDTAB(nTab2)) { - BOOL bExpandRefsOld = IsExpandRefs(); + sal_Bool bExpandRefsOld = IsExpandRefs(); if ( eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0 || nDz > 0) ) SetExpandRefs( SC_MOD()->GetInputOptions().GetExpandRefs() ); SCTAB i; @@ -955,7 +962,7 @@ void ScDocument::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) } void ScDocument::Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark, - ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, + sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue) { PutInOrder( nCol1, nCol2 ); @@ -978,7 +985,7 @@ String ScDocument::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCRO } void ScDocument::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - USHORT nFormatNo, const ScMarkData& rMark ) + sal_uInt16 nFormatNo, const ScMarkData& rMark ) { PutInOrder( nStartCol, nEndCol ); PutInOrder( nStartRow, nEndRow ); @@ -1005,8 +1012,8 @@ void ScDocument::GetAutoFormatData(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, void ScDocument::GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow ) { - USHORT nCommand = rSearchItem.GetCommand(); - BOOL bReplace = ( nCommand == SVX_SEARCHCMD_REPLACE || + sal_uInt16 nCommand = rSearchItem.GetCommand(); + sal_Bool bReplace = ( nCommand == SVX_SEARCHCMD_REPLACE || nCommand == SVX_SEARCHCMD_REPLACE_ALL ); if ( rSearchItem.GetBackward() ) { @@ -1088,7 +1095,7 @@ void ScDocument::GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem, } } -BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, +sal_Bool ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, SCTAB& rTab, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) @@ -1097,13 +1104,13 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, rMark.MarkToMulti(); - BOOL bFound = FALSE; + sal_Bool bFound = false; if (VALIDTAB(rTab)) { SCCOL nCol; SCROW nRow; SCTAB nTab; - USHORT nCommand = rSearchItem.GetCommand(); + sal_uInt16 nCommand = rSearchItem.GetCommand(); if ( nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL ) { @@ -1174,36 +1181,36 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, // Outline anpassen -BOOL ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, BOOL bShow ) +sal_Bool ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, sal_Bool bShow ) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->UpdateOutlineCol( nStartCol, nEndCol, bShow ); OSL_FAIL("missing tab"); - return FALSE; + return false; } -BOOL ScDocument::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bShow ) +sal_Bool ScDocument::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bShow ) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->UpdateOutlineRow( nStartRow, nEndRow, bShow ); OSL_FAIL("missing tab"); - return FALSE; + return false; } -void ScDocument::Sort(SCTAB nTab, const ScSortParam& rSortParam, BOOL bKeepQuery) +void ScDocument::Sort(SCTAB nTab, const ScSortParam& rSortParam, sal_Bool bKeepQuery) { if ( ValidTab(nTab) && pTab[nTab] ) { - BOOL bOldDisableIdle = IsIdleDisabled(); - DisableIdle( TRUE ); + sal_Bool bOldDisableIdle = IsIdleDisabled(); + DisableIdle( sal_True ); pTab[nTab]->Sort(rSortParam, bKeepQuery); DisableIdle( bOldDisableIdle ); } } -SCSIZE ScDocument::Query(SCTAB nTab, const ScQueryParam& rQueryParam, BOOL bKeepSub) +SCSIZE ScDocument::Query(SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool bKeepSub) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->Query((ScQueryParam&)rQueryParam, bKeepSub); @@ -1221,19 +1228,19 @@ void ScDocument::GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr.Erase(); } -BOOL ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScQueryParam& rQueryParam) +sal_Bool ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScQueryParam& rQueryParam) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->CreateQueryParam(nCol1, nRow1, nCol2, nRow2, rQueryParam); OSL_FAIL("missing tab"); - return FALSE; + return false; } -BOOL ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab ) +sal_Bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab ) { ScDBData* pDBData = GetDBAtCursor( nCurCol, nCurRow, nCurTab ); - BOOL bHasAutoFilter = ( pDBData != NULL ); + sal_Bool bHasAutoFilter = ( pDBData != NULL ); if ( pDBData ) { @@ -1241,7 +1248,7 @@ BOOL ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab ) { SCCOL nCol; SCROW nRow; - INT16 nFlag; + sal_Int16 nFlag; ScQueryParam aParam; pDBData->GetQueryParam( aParam ); @@ -1254,23 +1261,23 @@ BOOL ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab ) GetValue(); if ( (nFlag & SC_MF_AUTO) == 0 ) - bHasAutoFilter = FALSE; + bHasAutoFilter = false; } } else - bHasAutoFilter = FALSE; + bHasAutoFilter = false; } return bHasAutoFilter; } -BOOL ScDocument::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, +sal_Bool ScDocument::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow ); } -BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, +sal_Bool ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) { return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow ); @@ -1292,12 +1299,12 @@ void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const // GetFilterEntries - Eintraege fuer AutoFilter-Listbox // -BOOL ScDocument::GetFilterEntries( +sal_Bool ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates) { if ( ValidTab(nTab) && pTab[nTab] && pDBCollection ) { - ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? + ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, false); //!?? if (pDBData) { UpdateDynamicEndRow(*pDBData); @@ -1339,47 +1346,47 @@ BOOL ScDocument::GetFilterEntries( pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates ); } - return TRUE; + return sal_True; } } - return FALSE; + return false; } // // GetFilterEntriesArea - Eintraege fuer Filter-Dialog // -BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, +sal_Bool ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates ) { if ( ValidTab(nTab) && pTab[nTab] ) { pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates ); - return TRUE; + return sal_True; } - return FALSE; + return false; } // // GetDataEntries - Eintraege fuer Auswahlliste-Listbox (keine Zahlen / Formeln) // -BOOL ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, - TypedScStrCollection& rStrings, BOOL bLimit ) +sal_Bool ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, + TypedScStrCollection& rStrings, sal_Bool bLimit ) { if( !bLimit ) { /* Try to generate the list from list validation. This part is skipped, - if bLimit==TRUE, because in that case this function is called to get + if bLimit==sal_True, because in that case this function is called to get cell values for auto completion on input. */ sal_uInt32 nValidation = static_cast< const SfxUInt32Item* >( GetAttr( nCol, nRow, nTab, ATTR_VALIDDATA ) )->GetValue(); if( nValidation ) { const ScValidationData* pData = GetValidationEntry( nValidation ); if( pData && pData->FillSelectionList( rStrings, ScAddress( nCol, nRow, nTab ) ) ) - return TRUE; + return sal_True; } } @@ -1395,7 +1402,7 @@ BOOL ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, #define SC_STRTYPE_DBNAMES 3 #define SC_STRTYPE_HEADERS 4 -BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) +sal_Bool ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) { // // Bereichsnamen @@ -1438,7 +1445,7 @@ BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) ScRangePairList* pLists[2]; pLists[0] = GetColNameRanges(); pLists[1] = GetRowNameRanges(); - for (USHORT nListNo=0; nListNo<2; nListNo++) + for (sal_uInt16 nListNo=0; nListNo<2; nListNo++) { ScRangePairList* pList = pLists[ nListNo ]; if (pList) @@ -1458,11 +1465,11 @@ BOOL ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings ) } } - return TRUE; + return sal_True; } -BOOL ScDocument::IsEmbedded() const +sal_Bool ScDocument::IsEmbedded() const { return bIsEmbedded; } @@ -1503,20 +1510,20 @@ Rectangle ScDocument::GetEmbeddedRect() const // 1/100 mm void ScDocument::SetEmbedded( const ScRange& rRange ) { - bIsEmbedded = TRUE; + bIsEmbedded = sal_True; aEmbedRange = rRange; } void ScDocument::ResetEmbedded() { - bIsEmbedded = FALSE; + bIsEmbedded = false; aEmbedRange = ScRange(); } /** Similar to ScViewData::AddPixelsWhile(), but add height twips and only while result is less than nStopTwips. - @return TRUE if advanced at least one row. + @return sal_True if advanced at least one row. */ bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SCROW nEndRow, const ScTable * pTable ) { @@ -1526,7 +1533,7 @@ bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SCROW nEn while (rTwips < nStopTwips && nRow <= nEndRow && !bStop) { SCROW nHeightEndRow; - USHORT nHeight = pTable->GetRowHeight( nRow, NULL, &nHeightEndRow); + sal_uInt16 nHeight = pTable->GetRowHeight( nRow, NULL, &nHeightEndRow); if (nHeightEndRow > nEndRow) nHeightEndRow = nEndRow; if (!nHeight) @@ -1577,13 +1584,13 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const long nSize; long nTwips; long nAdd; - BOOL bEnd; + sal_Bool bEnd; nSize = 0; nTwips = (long) (aPosRect.Left() / HMM_PER_TWIPS); SCCOL nX1 = 0; - bEnd = FALSE; + bEnd = false; while (!bEnd) { nAdd = (long) pTable->GetColWidth(nX1); @@ -1593,13 +1600,13 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const ++nX1; } else - bEnd = TRUE; + bEnd = sal_True; } nTwips = (long) (aPosRect.Right() / HMM_PER_TWIPS); SCCOL nX2 = nX1; - bEnd = FALSE; + bEnd = false; while (!bEnd) { nAdd = (long) pTable->GetColWidth(nX2); @@ -1609,7 +1616,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const ++nX2; } else - bEnd = TRUE; + bEnd = sal_True; } @@ -1633,7 +1640,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const void ScDocument::SetEmbedded( const Rectangle& rRect ) // aus VisArea (1/100 mm) { - bIsEmbedded = TRUE; + bIsEmbedded = sal_True; aEmbedRange = GetRange( nVisibleTab, rRect ); } @@ -1704,7 +1711,7 @@ void ScDocument::SnapVisArea( Rectangle& rRect ) const return; } - BOOL bNegativePage = IsNegativePage( nVisibleTab ); + sal_Bool bNegativePage = IsNegativePage( nVisibleTab ); if ( bNegativePage ) ScDrawLayer::MirrorRectRTL( rRect ); // calculate with positive (LTR) values @@ -1735,24 +1742,24 @@ void ScDocument::SetDocProtection(const ScDocProtection* pProtect) pDocProtection.reset(NULL); } -BOOL ScDocument::IsDocProtected() const +sal_Bool ScDocument::IsDocProtected() const { return pDocProtection.get() && pDocProtection->isProtected(); } -BOOL ScDocument::IsDocEditable() const +sal_Bool ScDocument::IsDocEditable() const { // import into read-only document is possible return !IsDocProtected() && ( bImportingXML || mbChangeReadOnlyEnabled || !pShell || !pShell->IsReadOnly() ); } -BOOL ScDocument::IsTabProtected( SCTAB nTab ) const +sal_Bool ScDocument::IsTabProtected( SCTAB nTab ) const { if (VALIDTAB(nTab) && pTab[nTab]) return pTab[nTab]->IsProtected(); OSL_FAIL("Falsche Tabellennummer"); - return FALSE; + return false; } ScTableProtection* ScDocument::GetTabProtection( SCTAB nTab ) const @@ -1857,7 +1864,7 @@ void ScDocument::SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageTy void ScDocument::SetDrawDefaults() { - bSetDrawDefaults = TRUE; + bSetDrawDefaults = sal_True; UpdateDrawDefaults(); } @@ -1939,7 +1946,7 @@ void ScDocument::DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, ApplyFlagsTab( nStartCol+1, nStartRow+1, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER ); // remove all covered notes (removed captions are collected by drawing undo if active) - USHORT nDelFlag = IDF_NOTE | (bDeleteCaptions ? 0 : IDF_NOCAPTIONS); + sal_uInt16 nDelFlag = IDF_NOTE | (bDeleteCaptions ? 0 : IDF_NOCAPTIONS); if( nStartCol < nEndCol ) DeleteAreaTab( nStartCol + 1, nStartRow, nEndCol, nStartRow, nTab, nDelFlag ); if( nStartRow < nEndRow ) diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index d2968d0531bf..1958bf721a4c 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -62,11 +62,11 @@ using namespace formula; // ----------------------------------------------------------------------- // Nach der Regula Falsi Methode -BOOL ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, +sal_Bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, SCCOL nVCol, SCROW nVRow, SCTAB nVTab, const String& sValStr, double& nX) { - BOOL bRet = FALSE; + sal_Bool bRet = false; nX = 0.0; if (ValidColRow(nFCol, nFRow) && ValidColRow(nVCol, nVRow) && VALIDTAB(nFTab) && VALIDTAB(nVTab) && pTab[nFTab] && pTab[nVTab]) @@ -111,10 +111,10 @@ BOOL ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, // FIXME FIXME FIXME this might need to be reworked now that we have formula::FormulaErrorToken and ScFormulaResult, double check !!! DBG_ERRORFILE("ScDocument::Solver: -> ScFormulaCell::GetValueAlways might need reimplementation"); pCell->Interpret(); - USHORT nErrCode = pCell->GetErrCode(); + sal_uInt16 nErrCode = pCell->GetErrCode(); nX = pCell->GetValueAlways(); if (nErrCode == 0) // kein fehler beim Rechnen - bRet = TRUE; + bRet = sal_True; delete pCell; } } @@ -135,11 +135,11 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, SCCOL j; SCROW k; i = 0; - BOOL bStop = FALSE; + sal_Bool bStop = false; while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden { if (pTab[i] && rMark.GetTableSelect(i)) - bStop = TRUE; + bStop = sal_True; else i++; } @@ -174,9 +174,9 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, aRefData.nCol = nCol1; aRefData.nRow = nRow1; aRefData.nTab = nTab1; - aRefData.SetColRel( TRUE ); - aRefData.SetRowRel( TRUE ); - aRefData.SetTabRel( TRUE ); + aRefData.SetColRel( sal_True ); + aRefData.SetRowRel( sal_True ); + aRefData.SetTabRel( sal_True ); aRefData.CalcRelFromAbs( ScAddress( nCol1, nRow1, nTab1 ) ); ScTokenArray aArr; @@ -222,11 +222,11 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera SCCOL j; SCROW k; i = 0; - BOOL bStop = FALSE; + sal_Bool bStop = false; while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden { if (pTab[i] && rMark.GetTableSelect(i)) - bStop = TRUE; + bStop = sal_True; else i++; } @@ -246,12 +246,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera const String& sSep = ScCompiler::GetNativeSymbol( ocSep); if (rParam.nMode == 0) // nur Spalte { - aRef.Set( rParam.aRefFormulaCell.GetAddress(), TRUE, FALSE, FALSE ); + aRef.Set( rParam.aRefFormulaCell.GetAddress(), sal_True, false, false ); aForString += aRef.GetRefString(this, nTab1); aForString += sSep; aForString += rParam.aRefColCell.GetRefString(this, nTab1); aForString += sSep; - aRef.Set( nCol1, nRow1, nTab1, FALSE, TRUE, TRUE ); + aRef.Set( nCol1, nRow1, nTab1, false, sal_True, sal_True ); aForString += aRef.GetRefString(this, nTab1); nCol1++; nCol2 = Min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() - @@ -259,12 +259,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera } else if (rParam.nMode == 1) // nur zeilenweise { - aRef.Set( rParam.aRefFormulaCell.GetAddress(), FALSE, TRUE, FALSE ); + aRef.Set( rParam.aRefFormulaCell.GetAddress(), false, sal_True, false ); aForString += aRef.GetRefString(this, nTab1); aForString += sSep; aForString += rParam.aRefRowCell.GetRefString(this, nTab1); aForString += sSep; - aRef.Set( nCol1, nRow1, nTab1, TRUE, FALSE, TRUE ); + aRef.Set( nCol1, nRow1, nTab1, sal_True, false, sal_True ); aForString += aRef.GetRefString(this, nTab1); nRow1++; nRow2 = Min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() - @@ -276,12 +276,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera aForString += sSep; aForString += rParam.aRefColCell.GetRefString(this, nTab1); aForString += sSep; - aRef.Set( nCol1, nRow1 + 1, nTab1, FALSE, TRUE, TRUE ); + aRef.Set( nCol1, nRow1 + 1, nTab1, false, sal_True, sal_True ); aForString += aRef.GetRefString(this, nTab1); aForString += sSep; aForString += rParam.aRefRowCell.GetRefString(this, nTab1); aForString += sSep; - aRef.Set( nCol1 + 1, nRow1, nTab1, TRUE, FALSE, TRUE ); + aRef.Set( nCol1 + 1, nRow1, nTab1, sal_True, false, sal_True ); aForString += aRef.GetRefString(this, nTab1); nCol1++; nRow1++; } @@ -338,33 +338,33 @@ bool ScDocument::MarkUsedExternalReferences( ScTokenArray & rArr ) return bAllMarked; } -BOOL ScDocument::GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab, - BOOL bInSel, const ScMarkData& rMark) const +sal_Bool ScDocument::GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab, + sal_Bool bInSel, const ScMarkData& rMark) const { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetNextSpellingCell( nCol, nRow, bInSel, rMark ); else - return FALSE; + return false; } -BOOL ScDocument::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab, +sal_Bool ScDocument::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab, const ScMarkData& rMark ) { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetNextMarkedCell( rCol, rRow, rMark ); else - return FALSE; + return false; } -BOOL ScDocument::ReplaceStyle(const SvxSearchItem& rSearchItem, +sal_Bool ScDocument::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow, SCTAB nTab, ScMarkData& rMark, - BOOL bIsUndoP) + sal_Bool bIsUndoP) { if (pTab[nTab]) return pTab[nTab]->ReplaceStyle(rSearchItem, nCol, nRow, rMark, bIsUndoP); else - return FALSE; + return false; } void ScDocument::CompileDBFormula() @@ -375,7 +375,7 @@ void ScDocument::CompileDBFormula() } } -void ScDocument::CompileDBFormula( BOOL bCreateFormulaString ) +void ScDocument::CompileDBFormula( sal_Bool bCreateFormulaString ) { for (SCTAB i=0; i<=MAXTAB; i++) { @@ -383,7 +383,7 @@ void ScDocument::CompileDBFormula( BOOL bCreateFormulaString ) } } -void ScDocument::CompileNameFormula( BOOL bCreateFormulaString ) +void ScDocument::CompileNameFormula( sal_Bool bCreateFormulaString ) { if ( pCondFormList ) pCondFormList->CompileAll(); // nach ScNameDlg noetig @@ -442,7 +442,7 @@ xub_StrLen ScDocument::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCTAB nTab return 0; } -BOOL ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, +sal_Bool ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, const ScAddress& rCursor, const ScMarkData& rMark, double& rResult ) { @@ -478,14 +478,14 @@ BOOL ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, if (aData.nCount) rResult = aData.nVal / (double) aData.nCount; else - aData.bError = TRUE; + aData.bError = sal_True; break; case SUBTOTAL_FUNC_MAX: case SUBTOTAL_FUNC_MIN: if (aData.nCount) rResult = aData.nVal; else - aData.bError = TRUE; + aData.bError = sal_True; break; default: { @@ -499,7 +499,7 @@ BOOL ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, return !aData.bError; } -double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat ) +double ScDocument::RoundValueAsShown( double fVal, sal_uLong nFormat ) { short nType; if ( (nType = GetFormatTable()->GetType( nFormat )) != NUMBERFORMAT_DATE @@ -545,7 +545,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat ) // bedingte Formate und Gueltigkeitsbereiche // -ULONG ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) +sal_uLong ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) { if (rNew.IsEmpty()) return 0; // leer ist immer 0 @@ -553,12 +553,12 @@ ULONG ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) if (!pCondFormList) pCondFormList = new ScConditionalFormatList; - ULONG nMax = 0; - USHORT nCount = pCondFormList->Count(); - for (USHORT i=0; i<nCount; i++) + sal_uLong nMax = 0; + sal_uInt16 nCount = pCondFormList->Count(); + for (sal_uInt16 i=0; i<nCount; i++) { const ScConditionalFormat* pForm = (*pCondFormList)[i]; - ULONG nKey = pForm->GetKey(); + sal_uLong nKey = pForm->GetKey(); if ( pForm->EqualEntries( rNew ) ) return nKey; if ( nKey > nMax ) @@ -567,14 +567,14 @@ ULONG ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) // Der Aufruf kann aus ScPatternAttr::PutInPool kommen, darum Clone (echte Kopie) - ULONG nNewKey = nMax + 1; + sal_uLong nNewKey = nMax + 1; ScConditionalFormat* pInsert = rNew.Clone(this); pInsert->SetKey( nNewKey ); pCondFormList->InsertNew( pInsert ); return nNewKey; } -ULONG ScDocument::AddValidationEntry( const ScValidationData& rNew ) +sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew ) { if (rNew.IsEmpty()) return 0; // leer ist immer 0 @@ -582,12 +582,12 @@ ULONG ScDocument::AddValidationEntry( const ScValidationData& rNew ) if (!pValidationList) pValidationList = new ScValidationDataList; - ULONG nMax = 0; - USHORT nCount = pValidationList->Count(); - for (USHORT i=0; i<nCount; i++) + sal_uLong nMax = 0; + sal_uInt16 nCount = pValidationList->Count(); + for (sal_uInt16 i=0; i<nCount; i++) { const ScValidationData* pData = (*pValidationList)[i]; - ULONG nKey = pData->GetKey(); + sal_uLong nKey = pData->GetKey(); if ( pData->EqualEntries( rNew ) ) return nKey; if ( nKey > nMax ) @@ -596,7 +596,7 @@ ULONG ScDocument::AddValidationEntry( const ScValidationData& rNew ) // Der Aufruf kann aus ScPatternAttr::PutInPool kommen, darum Clone (echte Kopie) - ULONG nNewKey = nMax + 1; + sal_uLong nNewKey = nMax + 1; ScValidationData* pInsert = rNew.Clone(this); pInsert->SetKey( nNewKey ); pValidationList->InsertNew( pInsert ); @@ -604,16 +604,16 @@ ULONG ScDocument::AddValidationEntry( const ScValidationData& rNew ) } const SfxPoolItem* ScDocument::GetEffItem( - SCCOL nCol, SCROW nRow, SCTAB nTab, USHORT nWhich ) const + SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const { const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); if ( pPattern ) { const SfxItemSet& rSet = pPattern->GetItemSet(); const SfxPoolItem* pItem; - if ( rSet.GetItemState( ATTR_CONDITIONAL, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rSet.GetItemState( ATTR_CONDITIONAL, sal_True, &pItem ) == SFX_ITEM_SET ) { - ULONG nIndex = ((const SfxUInt32Item*)pItem)->GetValue(); + sal_uLong nIndex = ((const SfxUInt32Item*)pItem)->GetValue(); if (nIndex && pCondFormList) { const ScConditionalFormat* pForm = pCondFormList->GetFormat( nIndex ); @@ -626,7 +626,7 @@ const SfxPoolItem* ScDocument::GetEffItem( SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find( aStyle, SFX_STYLE_FAMILY_PARA ); if ( pStyleSheet && pStyleSheet->GetItemSet().GetItemState( - nWhich, TRUE, &pItem ) == SFX_ITEM_SET ) + nWhich, sal_True, &pItem ) == SFX_ITEM_SET ) return pItem; } } @@ -659,7 +659,7 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab const ScConditionalFormat* ScDocument::GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { - ULONG nIndex = ((const SfxUInt32Item*)GetAttr(nCol,nRow,nTab,ATTR_CONDITIONAL))->GetValue(); + sal_uLong nIndex = ((const SfxUInt32Item*)GetAttr(nCol,nRow,nTab,ATTR_CONDITIONAL))->GetValue(); if (nIndex) { if (pCondFormList) @@ -673,7 +673,7 @@ const ScConditionalFormat* ScDocument::GetCondFormat( return NULL; } -const ScValidationData* ScDocument::GetValidationEntry( ULONG nIndex ) const +const ScValidationData* ScDocument::GetValidationEntry( sal_uLong nIndex ) const { if ( pValidationList ) return pValidationList->GetData( nIndex ); @@ -681,19 +681,19 @@ const ScValidationData* ScDocument::GetValidationEntry( ULONG nIndex ) const return NULL; } -void ScDocument::FindConditionalFormat( ULONG nKey, ScRangeList& rRanges ) +void ScDocument::FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges ) { for (SCTAB i=0; i<=MAXTAB && pTab[i]; i++) pTab[i]->FindConditionalFormat( nKey, rRanges ); } -void ScDocument::FindConditionalFormat( ULONG nKey, ScRangeList& rRanges, SCTAB nTab ) +void ScDocument::FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab ) { if(VALIDTAB(nTab) && pTab[nTab]) pTab[nTab]->FindConditionalFormat( nKey, rRanges ); } -void ScDocument::ConditionalChanged( ULONG nKey ) +void ScDocument::ConditionalChanged( sal_uLong nKey ) { if ( nKey && pCondFormList && !bIsClip && !bIsUndo ) // nKey==0 -> noop { @@ -716,7 +716,7 @@ void ScDocument::SetCondFormList(ScConditionalFormatList* pNew) //------------------------------------------------------------------------ -BOOL ScDocument::HasDetectiveOperations() const +sal_Bool ScDocument::HasDetectiveOperations() const { return pDetOpList && pDetOpList->Count(); } @@ -754,12 +754,12 @@ void ScDocument::SetDetOpList(ScDetOpList* pNew) #define SC_DOCCOMP_ROWS 100 -USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, +sal_uInt16 ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, ScDocument& rOtherDoc, SCROW nOtherRow, SCTAB nOtherTab, SCCOL nMaxCol, SCCOLROW* pOtherCols ) { - ULONG nDif = 0; - ULONG nUsed = 0; + sal_uLong nDif = 0; + sal_uLong nUsed = 0; for (SCCOL nThisCol=0; nThisCol<=nMaxCol; nThisCol++) { SCCOL nOtherCol; @@ -787,20 +787,20 @@ USHORT ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, } if (nUsed > 0) - return static_cast<USHORT>((nDif*64)/nUsed); // max.256 (SC_DOCCOMP_MAXDIFF) + return static_cast<sal_uInt16>((nDif*64)/nUsed); // max.256 (SC_DOCCOMP_MAXDIFF) DBG_ASSERT(!nDif,"Diff ohne Used"); return 0; } -USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, +sal_uInt16 ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, ScDocument& rOtherDoc, SCCOL nOtherCol, SCTAB nOtherTab, SCROW nMaxRow, SCCOLROW* pOtherRows ) { //! optimieren mit Iterator oder so - ULONG nDif = 0; - ULONG nUsed = 0; + sal_uLong nDif = 0; + sal_uLong nUsed = 0; for (SCROW nThisRow=0; nThisRow<=nMaxRow; nThisRow++) { SCROW nOtherRow; @@ -828,17 +828,17 @@ USHORT ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, } if (nUsed > 0) - return static_cast<USHORT>((nDif*64)/nUsed); // max.256 + return static_cast<sal_uInt16>((nDif*64)/nUsed); // max.256 DBG_ASSERT(!nDif,"Diff ohne Used"); return 0; } void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW nOtherEndRow, - BOOL bColumns, ScDocument& rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab, - SCCOLROW nEndCol, SCCOLROW* pTranslate, ScProgress* pProgress, ULONG nProAdd ) + sal_Bool bColumns, ScDocument& rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab, + SCCOLROW nEndCol, SCCOLROW* pTranslate, ScProgress* pProgress, sal_uLong nProAdd ) { - // bColumns=TRUE: Zeilen sind Spalten und umgekehrt + // bColumns=sal_True: Zeilen sind Spalten und umgekehrt SCCOLROW nMaxCont; // wieviel weiter SCCOLROW nMinGood; // was ist ein Treffer (incl.) @@ -853,19 +853,19 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW nMaxCont = SC_DOCCOMP_ROWS; // 100 Zeilen nMinGood = SC_DOCCOMP_MINGOOD; } - BOOL bUseTotal = bColumns && !pTranslate; // nur beim ersten Durchgang + sal_Bool bUseTotal = bColumns && !pTranslate; // nur beim ersten Durchgang SCCOLROW nOtherRow = 0; - USHORT nComp; + sal_uInt16 nComp; SCCOLROW nThisRow; - BOOL bTotal = FALSE; // ueber verschiedene nThisRow beibehalten + sal_Bool bTotal = false; // ueber verschiedene nThisRow beibehalten SCCOLROW nUnknown = 0; for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++) { SCCOLROW nTempOther = nOtherRow; - BOOL bFound = FALSE; - USHORT nBest = SC_DOCCOMP_MAXDIFF; + sal_Bool bFound = false; + sal_uInt16 nBest = SC_DOCCOMP_MAXDIFF; SCCOLROW nMax = Min( nOtherEndRow, static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) ); for (SCCOLROW i=nTempOther; i<=nMax && nBest>0; i++) // bei 0 abbrechen { @@ -877,12 +877,12 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW { nTempOther = i; nBest = nComp; - bFound = TRUE; + bFound = sal_True; } if ( nComp < SC_DOCCOMP_MAXDIFF || bFound ) - bTotal = FALSE; + bTotal = false; else if ( i == nTempOther && bUseTotal ) - bTotal = TRUE; // nur ganz oben + bTotal = sal_True; // nur ganz oben } if ( bFound ) { @@ -897,14 +897,14 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW } if (pProgress) - pProgress->SetStateOnPercent(nProAdd+static_cast<ULONG>(nThisRow)); + pProgress->SetStateOnPercent(nProAdd+static_cast<sal_uLong>(nThisRow)); } // Bloecke ohne Uebereinstimmung ausfuellen SCROW nFillStart = 0; SCROW nFillPos = 0; - BOOL bInFill = FALSE; + sal_Bool bInFill = false; for (nThisRow = 0; nThisRow <= nThisEndRow+1; nThisRow++) { SCROW nThisOther = ( nThisRow <= nThisEndRow ) ? pOtherRows[nThisRow] : (nOtherEndRow+1); @@ -921,13 +921,13 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW pOtherRows[nFillPos+i] = nFillStart+i; } - bInFill = FALSE; + bInFill = false; } nFillStart = nThisOther + 1; nFillPos = nThisRow + 1; } else - bInFill = TRUE; + bInFill = sal_True; } } @@ -963,7 +963,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) // auffuellen, damit einzeln umbenannte Tabellen nicht wegfallen SCTAB nFillStart = 0; SCTAB nFillPos = 0; - BOOL bInFill = FALSE; + sal_Bool bInFill = false; for (nThisTab = 0; nThisTab <= nThisCount; nThisTab++) { SCTAB nThisOther = ( nThisTab < nThisCount ) ? pOtherTabs[nThisTab] : nOtherCount; @@ -981,13 +981,13 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) pOtherTabs[nFillPos+i] = nFillStart+i; } - bInFill = FALSE; + bInFill = false; } nFillStart = nThisOther + 1; nFillPos = nThisTab + 1; } else - bInFill = TRUE; + bInFill = sal_True; } // @@ -1009,7 +1009,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) SCROW nEndRow = Max(nThisEndRow, nOtherEndRow); SCCOL nThisCol; SCROW nThisRow; - ULONG n1,n2; // fuer AppendDeleteRange + sal_uLong n1,n2; // fuer AppendDeleteRange //! ein Progress ueber alle Tabellen ??? String aTabName; @@ -1035,23 +1035,23 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) //! Spalten vergleichen zweimal mit unterschiedlichem nMinGood ??? // 1 - FindOrder( pTempRows, nThisEndRow, nOtherEndRow, FALSE, + FindOrder( pTempRows, nThisEndRow, nOtherEndRow, false, rOtherDoc, nThisTab, nOtherTab, nEndCol, NULL, &aProgress, 0 ); // 2 - FindOrder( pOtherCols, nThisEndCol, nOtherEndCol, TRUE, + FindOrder( pOtherCols, nThisEndCol, nOtherEndCol, sal_True, rOtherDoc, nThisTab, nOtherTab, nEndRow, NULL, NULL, 0 ); - FindOrder( pOtherRows, nThisEndRow, nOtherEndRow, FALSE, + FindOrder( pOtherRows, nThisEndRow, nOtherEndRow, false, rOtherDoc, nThisTab, nOtherTab, nThisEndCol, pOtherCols, &aProgress, nThisEndRow ); - ULONG nMatch1 = 0; // pTempRows, keine Spalten + sal_uLong nMatch1 = 0; // pTempRows, keine Spalten for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++) if (ValidRow(pTempRows[nThisRow])) nMatch1 += SC_DOCCOMP_MAXDIFF - RowDifferences( nThisRow, nThisTab, rOtherDoc, pTempRows[nThisRow], nOtherTab, nEndCol, NULL ); - ULONG nMatch2 = 0; // pOtherRows, pOtherCols + sal_uLong nMatch2 = 0; // pOtherRows, pOtherCols for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++) if (ValidRow(pOtherRows[nThisRow])) nMatch2 += SC_DOCCOMP_MAXDIFF - diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 4a6136fa2e3c..a737a5966764 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -130,11 +130,11 @@ void ScDocument::UpdateAllCharts() if ( !pDrawLayer || !pShell ) return; - USHORT nDataCount = pChartCollection->GetCount(); + sal_uInt16 nDataCount = pChartCollection->GetCount(); if ( !nDataCount ) return ; // nothing to do - USHORT nPos; + sal_uInt16 nPos; for (SCTAB nTab=0; nTab<=MAXTAB; nTab++) { @@ -204,7 +204,7 @@ void ScDocument::UpdateAllCharts() pChartCollection->FreeAll(); } -BOOL ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName ) +sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName ) { if (pDrawLayer && pTab[nTab]) { @@ -224,7 +224,7 @@ BOOL ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName ) { if (pName) *pName = ((SdrOle2Obj*)pObject)->GetPersistName(); - return TRUE; + return sal_True; } } pObject = aIter.Next(); @@ -233,12 +233,12 @@ BOOL ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName ) if (pName) pName->Erase(); - return FALSE; // nothing found + return false; // nothing found } void ScDocument::UpdateChartArea( const String& rChartName, - const ScRange& rNewArea, BOOL bColHeaders, BOOL bRowHeaders, - BOOL bAdd ) + const ScRange& rNewArea, sal_Bool bColHeaders, sal_Bool bRowHeaders, + sal_Bool bAdd ) { ScRangeListRef aRLR( new ScRangeList ); aRLR->Append( rNewArea ); @@ -309,7 +309,7 @@ void ScDocument::SetChartRanges( const String& rChartName, const ::std::vector< } void ScDocument::GetOldChartParameters( const String& rName, - ScRangeList& rRanges, BOOL& rColHeaders, BOOL& rRowHeaders ) + ScRangeList& rRanges, sal_Bool& rColHeaders, sal_Bool& rRowHeaders ) { // used for undo of changing chart source area @@ -358,8 +358,8 @@ void ScDocument::GetOldChartParameters( const String& rName, } void ScDocument::UpdateChartArea( const String& rChartName, - const ScRangeListRef& rNewList, BOOL bColHeaders, BOOL bRowHeaders, - BOOL bAdd ) + const ScRangeListRef& rNewList, sal_Bool bColHeaders, sal_Bool bRowHeaders, + sal_Bool bAdd ) { if (!pDrawLayer) return; @@ -461,9 +461,12 @@ void ScDocument::UpdateChart( const String& rChartName ) } // After the update, chart keeps track of its own data source ranges, - // the listener doesn't need to listen anymore. - if(pChartListenerCollection) + // the listener doesn't need to listen anymore, except the chart has + // an internal data provider. + if ( !( xChartDoc.is() && xChartDoc->hasInternalDataProvider() ) && pChartListenerCollection ) + { pChartListenerCollection->ChangeListening( rChartName, new ScRangeList ); + } } void ScDocument::RestoreChartListener( const String& rName ) @@ -503,15 +506,15 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, if (!pDrawLayer) return; - USHORT nChartCount = pChartListenerCollection->GetCount(); - for ( USHORT nIndex = 0; nIndex < nChartCount; nIndex++ ) + sal_uInt16 nChartCount = pChartListenerCollection->GetCount(); + for ( sal_uInt16 nIndex = 0; nIndex < nChartCount; nIndex++ ) { ScChartListener* pChartListener = (ScChartListener*) (pChartListenerCollection->At(nIndex)); ScRangeListRef aRLR( pChartListener->GetRangeList() ); ScRangeListRef aNewRLR( new ScRangeList ); - BOOL bChanged = FALSE; - BOOL bDataChanged = FALSE; + sal_Bool bChanged = false; + sal_Bool bDataChanged = false; for ( size_t i = 0, nListSize = aRLR->size(); i < nListSize; ++i ) { ScRange* pR = (*aRLR)[i]; @@ -529,7 +532,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, theCol2,theRow2,theTab2 ); if ( eRes != UR_NOTHING ) { - bChanged = TRUE; + bChanged = sal_True; aNewRLR->Append( ScRange( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )); @@ -543,7 +546,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, || (pR->aEnd.Tab() - pR->aStart.Tab() != theTab2 - theTab1))) ) { - bDataChanged = TRUE; + bDataChanged = sal_True; } } else @@ -560,9 +563,28 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode, svt::EmbeddedObjectRef::TryRunningState( xIPObj ); // After the change, chart keeps track of its own data source ranges, - // the listener doesn't need to listen anymore. - - pChartListener->ChangeListening( new ScRangeList, bDataChanged ); + // the listener doesn't need to listen anymore, except the chart has + // an internal data provider. + bool bInternalDataProvider = false; + if ( xIPObj.is() ) + { + try + { + uno::Reference< chart2::XChartDocument > xChartDoc( xIPObj->getComponent(), uno::UNO_QUERY_THROW ); + bInternalDataProvider = xChartDoc->hasInternalDataProvider(); + } + catch ( uno::Exception& ) + { + } + } + if ( bInternalDataProvider ) + { + pChartListener->ChangeListening( aNewRLR, bDataChanged ); + } + else + { + pChartListener->ChangeListening( new ScRangeList, bDataChanged ); + } } } } @@ -615,12 +637,12 @@ void ScDocument::SetChartRangeList( const String& rChartName, } -BOOL ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab ) +sal_Bool ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab ) { if (pTab[nTab]) return pTab[nTab]->HasData( nCol, nRow ); else - return FALSE; + return false; } uno::Reference< embed::XEmbeddedObject > @@ -659,19 +681,19 @@ uno::Reference< embed::XEmbeddedObject > return uno::Reference< embed::XEmbeddedObject >(); } -BOOL lcl_StringInCollection( const ScStrCollection* pColl, const String& rStr ) +sal_Bool lcl_StringInCollection( const ScStrCollection* pColl, const String& rStr ) { if ( !pColl ) - return FALSE; + return false; StrData aData( rStr ); - USHORT nDummy; + sal_uInt16 nDummy; return pColl->Search( &aData, nDummy ); } void ScDocument::UpdateChartListenerCollection() { - bChartListenerCollectionNeedsUpdate = FALSE; + bChartListenerCollectionNeedsUpdate = false; if (!pDrawLayer) return; else @@ -697,11 +719,11 @@ void ScDocument::UpdateChartListenerCollection() { String aObjName = ((SdrOle2Obj*)pObject)->GetPersistName(); aCLSearcher.SetString( aObjName ); - USHORT nIndex; + sal_uInt16 nIndex; if ( pChartListenerCollection->Search( &aCLSearcher, nIndex ) ) { ((ScChartListener*) (pChartListenerCollection-> - At( nIndex )))->SetUsed( TRUE ); + At( nIndex )))->SetUsed( sal_True ); } else if ( lcl_StringInCollection( pOtherObjects, aObjName ) ) { diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 9c19661dad8f..f747788977cf 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -70,7 +70,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator() return pScriptTypeData->xBreakIter; } -BOOL ScDocument::HasStringWeakCharacters( const String& rString ) +sal_Bool ScDocument::HasStringWeakCharacters( const String& rString ) { if (rString.Len()) { @@ -85,7 +85,7 @@ BOOL ScDocument::HasStringWeakCharacters( const String& rString ) { sal_Int16 nType = xBreakIter->getScriptType( aText, nPos ); if ( nType == i18n::ScriptType::WEAK ) - return TRUE; // found + return sal_True; // found nPos = xBreakIter->endOfScript( aText, nPos, nType ); } @@ -93,13 +93,13 @@ BOOL ScDocument::HasStringWeakCharacters( const String& rString ) } } - return FALSE; // none found + return false; // none found } -BYTE ScDocument::GetStringScriptType( const String& rString ) +sal_uInt8 ScDocument::GetStringScriptType( const String& rString ) { - BYTE nRet = 0; + sal_uInt8 nRet = 0; if (rString.Len()) { uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator(); @@ -133,12 +133,12 @@ BYTE ScDocument::GetStringScriptType( const String& rString ) return nRet; } -BYTE ScDocument::GetCellScriptType( ScBaseCell* pCell, ULONG nNumberFormat ) +sal_uInt8 ScDocument::GetCellScriptType( ScBaseCell* pCell, sal_uLong nNumberFormat ) { if ( !pCell ) return 0; // empty - BYTE nStored = pCell->GetScriptType(); + sal_uInt8 nStored = pCell->GetScriptType(); if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? return nStored; // use stored value @@ -146,14 +146,14 @@ BYTE ScDocument::GetCellScriptType( ScBaseCell* pCell, ULONG nNumberFormat ) Color* pColor; ScCellFormat::GetString( pCell, nNumberFormat, aStr, &pColor, *xPoolHelper->GetFormTable() ); - BYTE nRet = GetStringScriptType( aStr ); + sal_uInt8 nRet = GetStringScriptType( aStr ); pCell->SetScriptType( nRet ); // store for later calls return nRet; } -BYTE ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell ) +sal_uInt8 ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell ) { // if cell is not passed, take from document @@ -166,7 +166,7 @@ BYTE ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* // if script type is set, don't have to get number formats - BYTE nStored = pCell->GetScriptType(); + sal_uInt8 nStored = pCell->GetScriptType(); if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? return nStored; // use stored value @@ -178,7 +178,7 @@ BYTE ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() ) pCondSet = GetCondResult( nCol, nRow, nTab ); - ULONG nFormat = pPattern->GetNumberFormat( xPoolHelper->GetFormTable(), pCondSet ); + sal_uLong nFormat = pPattern->GetNumberFormat( xPoolHelper->GetFormTable(), pCondSet ); return GetCellScriptType( pCell, nFormat ); } diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 98bf119e94f3..3bbfde5b31a1 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -76,7 +76,7 @@ void ScDocument::EndListeningArea( const ScRange& rRange, } -void ScDocument::Broadcast( ULONG nHint, const ScAddress& rAddr, +void ScDocument::Broadcast( sal_uLong nHint, const ScAddress& rAddr, ScBaseCell* pCell ) { @@ -94,7 +94,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) if ( !nHardRecalcState ) { ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast - BOOL bIsBroadcasted = FALSE; + sal_Bool bIsBroadcasted = false; ScBaseCell* pCell = rHint.GetCell(); if ( pCell ) { @@ -102,7 +102,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) if ( pBC ) { pBC->Broadcast( rHint ); - bIsBroadcasted = TRUE; + bIsBroadcasted = sal_True; } } if ( pBASM->AreaBroadcast( rHint ) || bIsBroadcasted ) @@ -117,7 +117,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) { SCTAB nTab = rHint.GetAddress().Tab(); if (pTab[nTab] && pTab[nTab]->IsStreamValid()) - pTab[nTab]->SetStreamValid(FALSE); + pTab[nTab]->SetStreamValid(false); } } @@ -241,7 +241,7 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) pEOFormulaTree = pPrev; // ist letzte Zelle pCell->SetPrevious( 0 ); pCell->SetNext( 0 ); - USHORT nRPN = pCell->GetCode()->GetCodeLen(); + sal_uInt16 nRPN = pCell->GetCode()->GetCodeLen(); if ( nFormulaCodeInTree >= nRPN ) nFormulaCodeInTree -= nRPN; else @@ -258,27 +258,27 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) } -BOOL ScDocument::IsInFormulaTree( ScFormulaCell* pCell ) const +sal_Bool ScDocument::IsInFormulaTree( ScFormulaCell* pCell ) const { return pCell->GetPrevious() || pFormulaTree == pCell; } -void ScDocument::CalcFormulaTree( BOOL bOnlyForced, BOOL bNoProgress ) +void ScDocument::CalcFormulaTree( sal_Bool bOnlyForced, sal_Bool bNoProgress ) { DBG_ASSERT( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" ); // never ever recurse into this, might end up lost in infinity if ( IsCalculatingFormulaTree() ) return ; - bCalculatingFormulaTree = TRUE; + bCalculatingFormulaTree = sal_True; - SetForcedFormulaPending( FALSE ); - BOOL bOldIdleDisabled = IsIdleDisabled(); - DisableIdle( TRUE ); - BOOL bOldAutoCalc = GetAutoCalc(); - //! _nicht_ SetAutoCalc( TRUE ) weil das evtl. CalcFormulaTree( TRUE ) + SetForcedFormulaPending( false ); + sal_Bool bOldIdleDisabled = IsIdleDisabled(); + DisableIdle( sal_True ); + sal_Bool bOldAutoCalc = GetAutoCalc(); + //! _nicht_ SetAutoCalc( sal_True ) weil das evtl. CalcFormulaTree( sal_True ) //! aufruft, wenn vorher disabled war und bHasForcedFormulas gesetzt ist - bAutoCalc = TRUE; + bAutoCalc = sal_True; if ( nHardRecalcState ) CalcAll(); else @@ -306,9 +306,9 @@ void ScDocument::CalcFormulaTree( BOOL bOnlyForced, BOOL bNoProgress ) } } } - BOOL bProgress = !bOnlyForced && nFormulaCodeInTree && !bNoProgress; + sal_Bool bProgress = !bOnlyForced && nFormulaCodeInTree && !bNoProgress; if ( bProgress ) - ScProgress::CreateInterpretProgress( this, TRUE ); + ScProgress::CreateInterpretProgress( this, sal_True ); pCell = pFormulaTree; ScFormulaCell* pLastNoGood = 0; @@ -366,7 +366,7 @@ void ScDocument::CalcFormulaTree( BOOL bOnlyForced, BOOL bNoProgress ) } bAutoCalc = bOldAutoCalc; DisableIdle( bOldIdleDisabled ); - bCalculatingFormulaTree = FALSE; + bCalculatingFormulaTree = false; } @@ -424,7 +424,7 @@ void ScDocument::RemoveFromFormulaTrack( ScFormulaCell* pCell ) } -BOOL ScDocument::IsInFormulaTrack( ScFormulaCell* pCell ) const +sal_Bool ScDocument::IsInFormulaTrack( ScFormulaCell* pCell ) const { return pCell->GetPreviousTrack() || pFormulaTrack == pCell; } @@ -436,7 +436,7 @@ BOOL ScDocument::IsInFormulaTrack( ScFormulaCell* pCell ) const Der nachfolgende broadcastet wieder usw. View stoesst Interpret an. */ -void ScDocument::TrackFormulas( ULONG nHintId ) +void ScDocument::TrackFormulas( sal_uLong nHintId ) { if ( pFormulaTrack ) @@ -462,24 +462,24 @@ void ScDocument::TrackFormulas( ULONG nHintId ) pTrack = pTrack->GetNextTrack(); } while ( pTrack ); pTrack = pFormulaTrack; - BOOL bHaveForced = FALSE; + sal_Bool bHaveForced = false; do { pNext = pTrack->GetNextTrack(); RemoveFromFormulaTrack( pTrack ); PutInFormulaTree( pTrack ); if ( pTrack->GetCode()->IsRecalcModeForced() ) - bHaveForced = TRUE; + bHaveForced = sal_True; pTrack = pNext; } while ( pTrack ); if ( bHaveForced ) { - SetForcedFormulas( TRUE ); + SetForcedFormulas( sal_True ); if ( bAutoCalc && !IsAutoCalcShellDisabled() && !IsInInterpreter() && !IsCalculatingFormulaTree() ) - CalcFormulaTree( TRUE ); + CalcFormulaTree( sal_True ); else - SetForcedFormulaPending( TRUE ); + SetForcedFormulaPending( sal_True ); } } DBG_ASSERT( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" ); @@ -497,7 +497,7 @@ void ScDocument::UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - BOOL bExpandRefsOld = IsExpandRefs(); + sal_Bool bExpandRefsOld = IsExpandRefs(); if ( eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0 || nDz > 0) ) SetExpandRefs( SC_MOD()->GetInputOptions().GetExpandRefs() ); if ( pBASM ) @@ -505,16 +505,16 @@ void ScDocument::UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode, SetExpandRefs( bExpandRefsOld ); } -void ScDocument::SetAutoCalc( BOOL bNewAutoCalc ) +void ScDocument::SetAutoCalc( sal_Bool bNewAutoCalc ) { - BOOL bOld = bAutoCalc; + sal_Bool bOld = bAutoCalc; bAutoCalc = bNewAutoCalc; if ( !bOld && bNewAutoCalc && bHasForcedFormulas ) { if ( IsAutoCalcShellDisabled() ) - SetForcedFormulaPending( TRUE ); + SetForcedFormulaPending( sal_True ); else if ( !IsInInterpreter() ) - CalcFormulaTree( TRUE ); + CalcFormulaTree( sal_True ); } } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 0b525317ea12..cec0c0c45ca0 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -96,6 +96,7 @@ #include "charthelper.hxx" #include "macromgr.hxx" #include "dpobject.hxx" +#include "docuno.hxx" #define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() @@ -125,7 +126,7 @@ void ScDocument::ImplDeleteOptions() //------------------------------------------------------------------------ -SfxPrinter* ScDocument::GetPrinter(BOOL bCreateIfNotExist) +SfxPrinter* ScDocument::GetPrinter(sal_Bool bCreateIfNotExist) { if ( !pPrinter && bCreateIfNotExist ) { @@ -138,7 +139,7 @@ SfxPrinter* ScDocument::GetPrinter(BOOL bCreateIfNotExist) NULL ); ::utl::MiscCfg aMisc; - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( aMisc.IsPaperOrientationWarning() ) nFlags |= SFX_PRINTER_CHG_ORIENTATION; if ( aMisc.IsPaperSizeWarning() ) @@ -174,7 +175,7 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter ) pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() ); delete pOld; } - InvalidateTextWidth(NULL, NULL, FALSE); // in both cases + InvalidateTextWidth(NULL, NULL, false); // in both cases } //------------------------------------------------------------------------ @@ -189,7 +190,7 @@ void ScDocument::SetPrintOptions() ::utl::MiscCfg aMisc; SfxItemSet aOptSet( pPrinter->GetOptions() ); - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( aMisc.IsPaperOrientationWarning() ) nFlags |= SFX_PRINTER_CHG_ORIENTATION; if ( aMisc.IsPaperSizeWarning() ) @@ -238,11 +239,11 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, { case SFX_STYLE_FAMILY_PAGE: { - const USHORT nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); - const USHORT nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); + const sal_uInt16 nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); + const sal_uInt16 nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); rSet.Put( rChanges ); - const USHORT nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); - const USHORT nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); + const sal_uInt16 nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE); + const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES); if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) ) InvalidateTextWidth( rStyleSheet.GetName() ); @@ -250,7 +251,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, if( SvtLanguageOptions().IsCTLFontEnabled() ) { const SfxPoolItem *pItem = NULL; - if( rChanges.GetItemState(ATTR_WRITINGDIR, TRUE, &pItem ) == SFX_ITEM_SET ) + if( rChanges.GetItemState(ATTR_WRITINGDIR, sal_True, &pItem ) == SFX_ITEM_SET ) ScChartHelper::DoUpdateAllCharts( this ); } } @@ -258,19 +259,19 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, case SFX_STYLE_FAMILY_PARA: { - BOOL bNumFormatChanged; + sal_Bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rSet, rChanges ) ) InvalidateTextWidth( NULL, NULL, bNumFormatChanged ); for (SCTAB nTab=0; nTab<=MAXTAB; ++nTab) if (pTab[nTab] && pTab[nTab]->IsStreamValid()) - pTab[nTab]->SetStreamValid( FALSE ); + pTab[nTab]->SetStreamValid( false ); - ULONG nOldFormat = + sal_uLong nOldFormat = ((const SfxUInt32Item*)&rSet.Get( ATTR_VALUE_FORMAT ))->GetValue(); - ULONG nNewFormat = + sal_uLong nNewFormat = ((const SfxUInt32Item*)&rChanges.Get( ATTR_VALUE_FORMAT ))->GetValue(); LanguageType eNewLang, eOldLang; @@ -287,10 +288,10 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, // Dontcare - Default setzen // Default - keine Aenderung // ("keine Aenderung" geht nicht mit PutExtended, darum Schleife) - for (USHORT nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++) + for (sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++) { const SfxPoolItem* pItem; - SfxItemState eState = rChanges.GetItemState( nWhich, FALSE, &pItem ); + SfxItemState eState = rChanges.GetItemState( nWhich, false, &pItem ); if ( eState == SFX_ITEM_SET ) rSet.Put( *pItem ); else if ( eState == SFX_ITEM_DONTCARE ) @@ -335,14 +336,14 @@ void ScDocument::InvalidateTextWidth( SCTAB nTab ) { ScAddress aAdrFrom( 0, 0, nTab ); ScAddress aAdrTo ( MAXCOL, MAXROW, nTab ); - InvalidateTextWidth( &aAdrFrom, &aAdrTo, FALSE ); + InvalidateTextWidth( &aAdrFrom, &aAdrTo, false ); } //------------------------------------------------------------------------ -BOOL ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab ) +sal_Bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab ) { - BOOL bInUse = FALSE; + sal_Bool bInUse = false; const SCTAB nCount = GetTableCount(); SCTAB i; @@ -357,30 +358,30 @@ BOOL ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab ) //------------------------------------------------------------------------ -BOOL ScDocument::RemovePageStyleInUse( const String& rStyle ) +sal_Bool ScDocument::RemovePageStyleInUse( const String& rStyle ) { - BOOL bWasInUse = FALSE; + sal_Bool bWasInUse = false; const SCTAB nCount = GetTableCount(); for ( SCTAB i=0; i<nCount && pTab[i]; i++ ) if ( pTab[i]->GetPageStyle() == rStyle ) { - bWasInUse = TRUE; + bWasInUse = sal_True; pTab[i]->SetPageStyle( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); } return bWasInUse; } -BOOL ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew ) +sal_Bool ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew ) { - BOOL bWasInUse = FALSE; + sal_Bool bWasInUse = false; const SCTAB nCount = GetTableCount(); for ( SCTAB i=0; i<nCount && pTab[i]; i++ ) if ( pTab[i]->GetPageStyle() == rOld ) { - bWasInUse = TRUE; + bWasInUse = sal_True; pTab[i]->SetPageStyle( rNew ); } @@ -389,7 +390,7 @@ BOOL ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew ) //------------------------------------------------------------------------ -BYTE ScDocument::GetEditTextDirection(SCTAB nTab) const +sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const { EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT; @@ -408,7 +409,7 @@ BYTE ScDocument::GetEditTextDirection(SCTAB nTab) const // else (invalid for EditEngine): keep "default" } - return sal::static_int_cast<BYTE>(eRet); + return sal::static_int_cast<sal_uInt8>(eRet); } ScMacroManager* ScDocument::GetMacroManager() @@ -421,9 +422,9 @@ ScMacroManager* ScDocument::GetMacroManager() //------------------------------------------------------------------------ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, - BOOL bNumFormatChanged ) + sal_Bool bNumFormatChanged ) { - BOOL bBroadcast = (bNumFormatChanged && GetDocOptions().IsCalcAsShown() && !IsImportingXML() && !IsClipboard()); + sal_Bool bBroadcast = (bNumFormatChanged && GetDocOptions().IsCalcAsShown() && !IsImportingXML() && !IsClipboard()); if ( pAdrFrom && !pAdrTo ) { const SCTAB nTab = pAdrFrom->Tab(); @@ -447,14 +448,14 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress #define CALCMAX 1000 // Berechnungen #define ABORT_EVENTS (INPUT_ANY & ~INPUT_TIMER & ~INPUT_OTHER) -BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder versuchen +sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wieder versuchen { // #i75610# if a printer hasn't been set or created yet, don't create one for this - if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(FALSE) == NULL ) - return FALSE; - bIdleDisabled = TRUE; + if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(false) == NULL ) + return false; + bIdleDisabled = sal_True; - const ULONG nStart = Time::GetSystemTicks(); + const sal_uLong nStart = Time::GetSystemTicks(); OutputDevice* pDev = NULL; MapMode aOldMap; ScStyleSheet* pStyle = NULL; @@ -465,7 +466,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers SCTAB nTab = aCurTextWidthCalcPos.Tab(); SCROW nRow = aCurTextWidthCalcPos.Row(); SCsCOL nCol = aCurTextWidthCalcPos.Col(); - BOOL bNeedMore= FALSE; + sal_Bool bNeedMore= false; if ( !ValidRow(nRow) ) nRow = 0, nCol--; @@ -479,7 +480,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers // Query-Box aufgemacht wird !!! ScStyleSheetPool* pStylePool = xPoolHelper->GetStylePool(); - USHORT nOldMask = pStylePool->GetSearchMask(); + sal_uInt16 nOldMask = pStylePool->GetSearchMask(); SfxStyleFamily eOldFam = pStylePool->GetSearchFamily(); pTable = pTab[nTab]; @@ -489,12 +490,12 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers DBG_ASSERT( pStyle, "Missing StyleSheet :-/" ); - BOOL bProgress = FALSE; + sal_Bool bProgress = false; if ( pStyle && 0 == GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALETOPAGES) ) { - USHORT nRestart = 0; - USHORT nZoom = 0; - USHORT nCount = 0; + sal_uInt16 nRestart = 0; + sal_uInt16 nZoom = 0; + sal_uInt16 nCount = 0; nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE); Fraction aZoomFract( nZoom, 100 ); @@ -522,23 +523,23 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers if ( !bProgress && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetDirty() ) { - ScProgress::CreateInterpretProgress( this, FALSE ); - bProgress = TRUE; + ScProgress::CreateInterpretProgress( this, false ); + bProgress = sal_True; } - USHORT nNewWidth = (USHORT)GetNeededSize( nCol, nRow, nTab, + sal_uInt16 nNewWidth = (sal_uInt16)GetNeededSize( nCol, nRow, nTab, pDev, nPPTX, nPPTY, - aZoomFract,aZoomFract, TRUE, - TRUE ); // bTotalSize + aZoomFract,aZoomFract, sal_True, + sal_True ); // bTotalSize pCell->SetTextWidth( nNewWidth ); - bNeedMore = TRUE; + bNeedMore = sal_True; } } else { - BOOL bNewTab = FALSE; + sal_Bool bNewTab = false; nRow = 0; nCol--; @@ -547,14 +548,14 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers { nCol = MAXCOL; nTab++; - bNewTab = TRUE; + bNewTab = sal_True; } if ( !ValidTab(nTab) || !pTab[nTab] ) { nTab = 0; nRestart++; - bNewTab = TRUE; + bNewTab = sal_True; } if ( nRestart < 2 ) @@ -619,7 +620,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers aCurTextWidthCalcPos.SetCol( (SCCOL)nCol ); pStylePool->SetSearchMask( eOldFam, nOldMask ); - bIdleDisabled = FALSE; + bIdleDisabled = false; return bNeedMore; } @@ -629,18 +630,18 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers class ScSpellStatus { public: - BOOL bModified; + sal_Bool bModified; - ScSpellStatus() : bModified(FALSE) {}; + ScSpellStatus() : bModified(false) {}; DECL_LINK (EventHdl, EditStatus*); }; IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus ) { - ULONG nStatus = pStatus->GetStatusWord(); + sal_uLong nStatus = pStatus->GetStatusWord(); if ( nStatus & EE_STAT_WRONGWORDCHANGED ) - bModified = TRUE; + bModified = sal_True; return 0; } @@ -656,16 +657,16 @@ IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus ) #define SPELL_MAXTEST_ALL 3 #define SPELL_MAXCELLS 256 -BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos, - USHORT nMaxTest ) +sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos, + sal_uInt16 nMaxTest ) { ScEditEngineDefaulter* pEngine = NULL; //! am Dokument speichern SfxItemSet* pDefaults = NULL; ScSpellStatus aStatus; - USHORT nCellCount = 0; // Zellen insgesamt - USHORT nTestCount = 0; // Aufrufe Spelling - BOOL bChanged = FALSE; // Aenderungen? + sal_uInt16 nCellCount = 0; // Zellen insgesamt + sal_uInt16 nTestCount = 0; // Aufrufe Spelling + sal_Bool bChanged = false; // Aenderungen? SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge SCROW nRow = rSpellPos.Row(); @@ -677,7 +678,7 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe if ( !pTab[nTab] ) { // may happen for visible range - return FALSE; + return false; } } ScHorizontalCellIterator aIter( this, nTab, @@ -717,9 +718,9 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); pPattern->FillEditItemSet( pDefaults ); - pEngine->SetDefaults( pDefaults, FALSE ); //! noetig ? + pEngine->SetDefaults( pDefaults, false ); //! noetig ? - USHORT nCellLang = ((const SvxLanguageItem&) + sal_uInt16 nCellLang = ((const SvxLanguageItem&) pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); if ( nCellLang == LANGUAGE_SYSTEM ) nCellLang = Application::GetSettings().GetLanguage(); // never use SYSTEM for spelling @@ -734,11 +735,11 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe else pEngine->SetText( *((ScEditCell*)pCell)->GetData() ); - aStatus.bModified = FALSE; + aStatus.bModified = false; pEngine->CompleteOnlineSpelling(); if ( aStatus.bModified ) // Fehler dazu oder weggekommen? { - BOOL bNeedEdit = TRUE; // Test auf einfachen Text + sal_Bool bNeedEdit = sal_True; // Test auf einfachen Text if ( !pEngine->HasOnlineSpellErrors() ) { ScEditAttrTester aTester( pEngine ); @@ -765,11 +766,11 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe // Seitenvorschau ist davon nicht betroffen // (sollte jedenfalls nicht) ScPaintHint aHint( ScRange( nCol, nRow, nTab ), PAINT_GRID ); - aHint.SetPrintFlag( FALSE ); + aHint.SetPrintFlag( false ); pShell->Broadcast( aHint ); } - bChanged = TRUE; + bChanged = sal_True; } if ( ++nTestCount >= nMaxTest ) // checked enough text? @@ -811,24 +812,24 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe } -BOOL ScDocument::ContinueOnlineSpelling() +sal_Bool ScDocument::ContinueOnlineSpelling() { if ( bIdleDisabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly()) ) - return FALSE; + return false; // #i48433# set bInsertingFromOtherDoc flag so there are no broadcasts when PutCell is called // (same behavior as in RemoveAutoSpellObj: just transfer the broadcaster) - BOOL bOldInserting = IsInsertingFromOtherDoc(); - SetInsertingFromOtherDoc( TRUE ); + sal_Bool bOldInserting = IsInsertingFromOtherDoc(); + SetInsertingFromOtherDoc( sal_True ); //! use one EditEngine for both calls // first check visible range - BOOL bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS ); + sal_Bool bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS ); // during first pass through visible range, always continue if ( nVisSpellState == VSPL_START ) - bResult = TRUE; + bResult = sal_True; if (bResult) { @@ -857,13 +858,13 @@ void ScDocument::SetOnlineSpellPos( const ScAddress& rPos ) aOnlineSpellPos = aVisSpellRange.aEnd; } -BOOL ScDocument::SetVisibleSpellRange( const ScRange& rNewRange ) +sal_Bool ScDocument::SetVisibleSpellRange( const ScRange& rNewRange ) { - BOOL bChange = ( aVisSpellRange != rNewRange ); + sal_Bool bChange = ( aVisSpellRange != rNewRange ); if (bChange) { // continue spelling through visible range when scrolling down - BOOL bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) && + sal_Bool bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) && rNewRange.aStart.Row() > aVisSpellRange.aStart.Row() && rNewRange.aStart.Col() == aVisSpellRange.aStart.Col() && rNewRange.aEnd.Col() == aVisSpellRange.aEnd.Col() ); @@ -891,17 +892,27 @@ void ScDocument::RemoveAutoSpellObj() pTab[nTab]->RemoveAutoSpellObj(); } +void ScDocument::RepaintRange( const ScRange& rRange ) +{ + if ( bIsVisible && pShell ) + { + ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() ); + if ( pModel ) + pModel->RepaintRange( rRange ); // locked repaints are checked there + } +} + //------------------------------------------------------------------------ -BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen +sal_Bool ScDocument::IdleCheckLinks() // sal_True = demnaechst wieder versuchen { - BOOL bAnyLeft = FALSE; + sal_Bool bAnyLeft = false; if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) @@ -911,7 +922,7 @@ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuche { pDdeLink->TryUpdate(); if (pDdeLink->NeedsUpdate()) // war nix? - bAnyLeft = TRUE; + bAnyLeft = sal_True; } } } @@ -923,15 +934,15 @@ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuche void ScDocument::SaveDdeLinks(SvStream& rStream) const { // bei 4.0-Export alle mit Modus != DEFAULT weglassen - BOOL bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 ); + sal_Bool bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 ); const ::sfx2::SvBaseLinks& rLinks = GetLinkManager()->GetLinks(); - USHORT nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.Count(); // erstmal zaehlen... - USHORT nDdeCount = 0; - USHORT i; + sal_uInt16 nDdeCount = 0; + sal_uInt16 i; for (i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -964,9 +975,9 @@ void ScDocument::LoadDdeLinks(SvStream& rStream) ScMultipleReadHeader aHdr( rStream ); GetLinkManager(); - USHORT nCount; + sal_uInt16 nCount; rStream >> nCount; - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) { ScDdeLink* pLink = new ScDdeLink( this, rStream, aHdr ); pLinkManager->InsertDDELink( pLink, @@ -974,21 +985,21 @@ void ScDocument::LoadDdeLinks(SvStream& rStream) } } -BOOL ScDocument::HasDdeLinks() const +sal_Bool ScDocument::HasDdeLinks() const { if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScDdeLink)) - return TRUE; + return sal_True; } - return FALSE; + return false; } -void ScDocument::SetInLinkUpdate(BOOL bSet) +void ScDocument::SetInLinkUpdate(sal_Bool bSet) { // called from TableLink and AreaLink @@ -996,7 +1007,7 @@ void ScDocument::SetInLinkUpdate(BOOL bSet) bInLinkUpdate = bSet; } -BOOL ScDocument::IsInLinkUpdate() const +sal_Bool ScDocument::IsInLinkUpdate() const { return bInLinkUpdate || IsInDdeLinkUpdate(); } @@ -1007,10 +1018,10 @@ void ScDocument::UpdateExternalRefLinks() return; const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.Count(); bool bAny = false; - for (USHORT i = 0; i < nCount; ++i) + for (sal_uInt16 i = 0; i < nCount; ++i) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; ScExternalRefLink* pRefLink = dynamic_cast<ScExternalRefLink*>(pBase); @@ -1029,7 +1040,7 @@ void ScDocument::UpdateExternalRefLinks() // #i101960# set document modified, as in TrackTimeHdl for DDE links if (!pShell->IsModified()) { - pShell->SetModified( TRUE ); + pShell->SetModified( sal_True ); SfxBindings* pBindings = GetViewBindings(); if (pBindings) { @@ -1045,19 +1056,19 @@ void ScDocument::UpdateDdeLinks() if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - USHORT i; + sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 i; // falls das Updaten laenger dauert, erstmal alle Werte // zuruecksetzen, damit nichts altes (falsches) stehen bleibt - BOOL bAny = FALSE; + sal_Bool bAny = false; for (i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) { ((ScDdeLink*)pBase)->ResetValue(); - bAny = TRUE; + bAny = sal_True; } } if (bAny) @@ -1082,18 +1093,18 @@ void ScDocument::UpdateDdeLinks() } } -BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem ) +sal_Bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem ) { // fuer refresh() per StarOne Api // ResetValue() fuer einzelnen Link nicht noetig //! wenn's mal alles asynchron wird, aber auch hier - BOOL bFound = FALSE; + sal_Bool bFound = false; if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) @@ -1104,7 +1115,7 @@ BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const pDdeLink->GetItem() == rItem ) { pDdeLink->TryUpdate(); - bFound = TRUE; // koennen theoretisch mehrere sein (Mode), darum weitersuchen + bFound = sal_True; // koennen theoretisch mehrere sein (Mode), darum weitersuchen } } } @@ -1118,8 +1129,8 @@ void ScDocument::DisconnectDdeLinks() if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) @@ -1141,8 +1152,8 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const else if (GetLinkManager()) // Links direkt kopieren { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) @@ -1156,14 +1167,14 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const } } -USHORT ScDocument::GetDdeLinkCount() const +sal_uInt16 ScDocument::GetDdeLinkCount() const { - USHORT nDdeCount = 0; + sal_uInt16 nDdeCount = 0; if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScDdeLink)) ++nDdeCount; } @@ -1180,15 +1191,15 @@ namespace { @return The DDE link, if it exists, otherwise 0. */ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, - const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode, - USHORT* pnDdePos = NULL ) + const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, + sal_uInt16* pnDdePos = NULL ) { if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.Count(); if( pnDdePos ) *pnDdePos = 0; - for( USHORT nIndex = 0; nIndex < nCount; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) { ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) ) @@ -1208,14 +1219,14 @@ ScDdeLink* lclGetDdeLink( /** Returns a pointer to the specified DDE link. @param nDdePos Index of the DDE link (does not include other links from link manager). @return The DDE link, if it exists, otherwise 0. */ -ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, USHORT nDdePos ) +ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDdePos ) { if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - USHORT nDdeIndex = 0; // counts only the DDE links - for( USHORT nIndex = 0; nIndex < nCount; ++nIndex ) + sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nDdeIndex = 0; // counts only the DDE links + for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) { ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) ) @@ -1233,12 +1244,12 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, USHORT nDdePos // ---------------------------------------------------------------------------- -bool ScDocument::FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode, USHORT& rnDdePos ) +bool ScDocument::FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos ) { return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL; } -bool ScDocument::GetDdeLinkData( USHORT nDdePos, String& rAppl, String& rTopic, String& rItem ) const +bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, String& rAppl, String& rTopic, String& rItem ) const { if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { @@ -1250,7 +1261,7 @@ bool ScDocument::GetDdeLinkData( USHORT nDdePos, String& rAppl, String& rTopic, return false; } -bool ScDocument::GetDdeLinkMode( USHORT nDdePos, BYTE& rnMode ) const +bool ScDocument::GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const { if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { @@ -1260,13 +1271,13 @@ bool ScDocument::GetDdeLinkMode( USHORT nDdePos, BYTE& rnMode ) const return false; } -const ScMatrix* ScDocument::GetDdeLinkResultMatrix( USHORT nDdePos ) const +const ScMatrix* ScDocument::GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const { const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ); return pDdeLink ? pDdeLink->GetResult() : NULL; } -bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode, ScMatrixRef pResults ) +bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults ) { /* Create a DDE link without updating it (i.e. for Excel import), to prevent unwanted connections. First try to find existing link. Set result array @@ -1292,7 +1303,7 @@ bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const return false; } -bool ScDocument::SetDdeLinkResultMatrix( USHORT nDdePos, ScMatrixRef pResults ) +bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults ) { if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { @@ -1304,18 +1315,18 @@ bool ScDocument::SetDdeLinkResultMatrix( USHORT nDdePos, ScMatrixRef pResults ) //------------------------------------------------------------------------ -BOOL ScDocument::HasAreaLinks() const +sal_Bool ScDocument::HasAreaLinks() const { if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScAreaLink)) - return TRUE; + return sal_True; } - return FALSE; + return false; } void ScDocument::UpdateAreaLinks() @@ -1323,8 +1334,8 @@ void ScDocument::UpdateAreaLinks() if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScAreaLink)) @@ -1338,7 +1349,7 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab ) if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nPos = 0; + sal_uInt16 nPos = 0; while ( nPos < rLinks.Count() ) { const ::sfx2::SvBaseLink* pBase = *rLinks[nPos]; @@ -1359,8 +1370,8 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, bool bAnyUpdate = false; const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - USHORT nCount = rLinks.Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = rLinks.Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScAreaLink)) @@ -1394,7 +1405,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, // If several links start at the same cell, the one with the lower index is removed // (file format specifies only one link definition for a cell). - USHORT nFirstIndex = 0; + sal_uInt16 nFirstIndex = 0; while ( nFirstIndex < nCount ) { bool bFound = false; @@ -1402,7 +1413,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, if ( pFirst->ISA(ScAreaLink) ) { ScAddress aFirstPos = static_cast<ScAreaLink*>(pFirst)->GetDestArea().aStart; - for ( USHORT nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex ) + for ( sal_uInt16 nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex ) { ::sfx2::SvBaseLink* pSecond = *rLinks[nSecondIndex]; if ( pSecond->ISA(ScAreaLink) && @@ -1435,12 +1446,12 @@ void ScDocument::KeyInput( const KeyEvent& ) // ---------------------------------------------------------------------------- -BOOL ScDocument::CheckMacroWarn() +sal_Bool ScDocument::CheckMacroWarn() { // The check for macro configuration, macro warning and disabling is now handled // in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic. - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -1471,23 +1482,23 @@ SfxBindings* ScDocument::GetViewBindings() void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine, utl::TransliterationWrapper& rTranslitarationWrapper, - BOOL bConsiderLanguage, ScDocument* pDoc ) + sal_Bool bConsiderLanguage, ScDocument* pDoc ) { //! should use TransliterateText method of EditEngine instead, when available! sal_uInt16 nLanguage = LANGUAGE_SYSTEM; - USHORT nParCount = rEngine.GetParagraphCount(); - for (USHORT nPar=0; nPar<nParCount; nPar++) + sal_uInt16 nParCount = rEngine.GetParagraphCount(); + for (sal_uInt16 nPar=0; nPar<nParCount; nPar++) { SvUShorts aPortions; - rEngine.GetPortions( (USHORT)nPar, aPortions ); + rEngine.GetPortions( (sal_uInt16)nPar, aPortions ); - for ( USHORT nPos = aPortions.Count(); nPos; ) + for ( sal_uInt16 nPos = aPortions.Count(); nPos; ) { --nPos; - USHORT nEnd = aPortions.GetObject( nPos ); - USHORT nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0; ESelection aSel( nPar, nStart, nPar, nEnd ); String aOldStr = rEngine.GetText( aSel ); @@ -1497,8 +1508,8 @@ void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine, { if ( bConsiderLanguage ) { - BYTE nScript = pDoc->GetStringScriptType( aOldStr ); - USHORT nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_LANGUAGE_CJK : + sal_uInt8 nScript = pDoc->GetStringScriptType( aOldStr ); + sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_LANGUAGE_CJK : ( ( nScript == SCRIPTTYPE_COMPLEX ) ? EE_CHAR_LANGUAGE_CTL : EE_CHAR_LANGUAGE ); nLanguage = ((const SvxLanguageItem&)aAttr.Get(nWhich)).GetValue(); @@ -1525,7 +1536,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp DBG_ASSERT( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType ); - BOOL bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); + sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); sal_uInt16 nLanguage = LANGUAGE_SYSTEM; ScEditEngineDefaulter* pEngine = NULL; // not using pEditEngine member because of defaults @@ -1537,7 +1548,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp SCCOL nCol = 0; SCROW nRow = 0; - BOOL bFound = rMultiMark.IsCellMarked( nCol, nRow ); + sal_Bool bFound = rMultiMark.IsCellMarked( nCol, nRow ); if (!bFound) bFound = GetNextMarkedCell( nCol, nRow, nTab, rMultiMark ); @@ -1554,8 +1565,8 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp if ( bConsiderLanguage ) { - BYTE nScript = GetStringScriptType( aOldStr ); //! cell script type? - USHORT nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : + sal_uInt8 nScript = GetStringScriptType( aOldStr ); //! cell script type? + sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : ( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE ); nLanguage = ((const SvxLanguageItem*)GetAttr( nCol, nRow, nTab, nWhich ))->GetValue(); @@ -1576,7 +1587,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); SfxItemSet* pDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() ); pPattern->FillEditItemSet( pDefaults ); - pEngine->SetDefaults( pDefaults, TRUE ); + pEngine->SetDefaults( pDefaults, sal_True ); const EditTextObject* pData = ((const ScEditCell*)pCell)->GetData(); pEngine->SetText( *pData ); @@ -1592,7 +1603,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp { // remove defaults (paragraph attributes) before creating text object SfxItemSet* pEmpty = new SfxItemSet( pEngine->GetEmptyItemSet() ); - pEngine->SetDefaults( pEmpty, TRUE ); + pEngine->SetDefaults( pEmpty, sal_True ); EditTextObject* pNewData = pEngine->CreateTextObject(); PutCell( nCol, nRow, nTab, diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index aa8e3a3046fc..ece0deb81347 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -177,7 +177,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell ) UpdateDrawDefaults(); UpdateDrawLanguages(); if (bImportingXML) - pDrawLayer->EnableAdjust(FALSE); + pDrawLayer->EnableAdjust(false); pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters ); pDrawLayer->SetCharCompressType( GetAsianCompression() ); @@ -203,7 +203,7 @@ void ScDocument::UpdateDrawDefaults() if ( pDrawLayer && bSetDrawDefaults ) { SfxItemPool& rDrawPool = pDrawLayer->GetItemPool(); - rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) ); + rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) ); } } @@ -234,14 +234,14 @@ sal_Bool ScDocument::IsChart( const SdrObject* pObject ) return ((SdrOle2Obj*)pObject)->IsChart(); } - return sal_False; + return false; } -IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, USHORT *, pColorIndex ) +IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex ) { return (long) &((GetColorTable()->GetColor(*pColorIndex))->GetColor()); } -IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, USHORT *, pColorIndex ) +IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex ) void ScDocument::DeleteDrawLayer() { @@ -253,20 +253,20 @@ void ScDocument::DeleteColorTable() delete pColorTable; } -BOOL ScDocument::DrawGetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) const +sal_Bool ScDocument::DrawGetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const { return pDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer ); } -void ScDocument::DrawMovePage( USHORT nOldPos, USHORT nNewPos ) +void ScDocument::DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) { pDrawLayer->ScMovePage(nOldPos,nNewPos); } -void ScDocument::DrawCopyPage( USHORT nOldPos, USHORT nNewPos ) +void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) { // angelegt wird die Page schon im ScTable ctor - pDrawLayer->ScCopyPage( nOldPos, nNewPos, FALSE ); + pDrawLayer->ScCopyPage( nOldPos, nNewPos, false ); } void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, @@ -289,12 +289,12 @@ void ScDocument::DeleteObjectsInSelection( const ScMarkData& rMark ) pDrawLayer->DeleteObjectsInSelection( rMark ); } -BOOL ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark ) +sal_Bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark ) { // pTabMark is used only for selected tables. If pTabMark is 0, all tables of rRange are used. if (!pDrawLayer) - return FALSE; + return false; SCTAB nStartTab = 0; SCTAB nEndTab = MAXTAB; @@ -321,7 +321,7 @@ BOOL ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* p { if ( pObject->GetObjIdentifier() == OBJ_OLE2 && aMMRect.IsInside( pObject->GetCurrentBoundRect() ) ) - return TRUE; + return sal_True; pObject = aIter.Next(); } @@ -329,7 +329,7 @@ BOOL ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* p } } - return FALSE; + return false; } @@ -360,7 +360,7 @@ void ScDocument::StartAnimations( SCTAB nTab, Window* pWin ) } -BOOL ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) +sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) { // Gibt es Objekte auf dem Hintergrund-Layer, die (teilweise) von rMMRect // betroffen sind? @@ -368,47 +368,47 @@ BOOL ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) // zu werden) if (!pDrawLayer) - return FALSE; + return false; SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page ?"); if (!pPage) - return FALSE; + return false; - BOOL bFound = FALSE; + sal_Bool bFound = false; SdrObjListIter aIter( *pPage, IM_FLAT ); SdrObject* pObject = aIter.Next(); while (pObject && !bFound) { if ( pObject->GetLayer() == SC_LAYER_BACK && pObject->GetCurrentBoundRect().IsOver( rMMRect ) ) - bFound = TRUE; + bFound = sal_True; pObject = aIter.Next(); } return bFound; } -BOOL ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ) +sal_Bool ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ) { // Gibt es ueberhaupt Objekte, die (teilweise) von rMMRect // betroffen sind? // (um leere Seiten beim Drucken zu erkennen) if (!pDrawLayer) - return FALSE; + return false; SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page ?"); if (!pPage) - return FALSE; + return false; - BOOL bFound = FALSE; + sal_Bool bFound = false; SdrObjListIter aIter( *pPage, IM_FLAT ); SdrObject* pObject = aIter.Next(); while (pObject && !bFound) { if ( pObject->GetCurrentBoundRect().IsOver( rMMRect ) ) - bFound = TRUE; + bFound = sal_True; pObject = aIter.Next(); } @@ -460,12 +460,12 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos ) return pFound; } -BOOL ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, - SCCOL nEndCol, SCROW nEndRow, BOOL bLeftIsEmpty, +sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, sal_Bool bLeftIsEmpty, ScRange* pLastRange, Rectangle* pLastMM ) const { if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow )) - return FALSE; + return false; ScDocument* pThis = (ScDocument*)this; //! GetMMRect / HasAnyDraw etc. const !!! @@ -497,7 +497,7 @@ BOOL ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, } if ( pThis->HasAnyDraw( nTab, aMMRect )) - return FALSE; + return false; if ( nStartCol > 0 && !bLeftIsEmpty ) { @@ -508,16 +508,16 @@ BOOL ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCROW nTmpRow = nEndRow; pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab, - FALSE, TRUE ); // kein Refresh, incl. Attrs + false, sal_True ); // kein Refresh, incl. Attrs OutputDevice* pDev = pThis->GetPrinter(); pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize pThis->ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow ); if ( nExtendCol >= nStartCol ) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScDocument::Clear( sal_Bool bFromDestructor ) @@ -537,9 +537,9 @@ void ScDocument::Clear( sal_Bool bFromDestructor ) } } -BOOL ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect ) +sal_Bool ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; if (pDrawLayer) { @@ -555,7 +555,7 @@ BOOL ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect ) { Rectangle aObjRect = pObject->GetLogicRect(); if ( aObjRect.IsOver( rMMRect ) ) - bFound = TRUE; + bFound = sal_True; } pObject = aIter.Next(); @@ -597,12 +597,12 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle& } } -BOOL ScDocument::HasDetectiveObjects(SCTAB nTab) const +sal_Bool ScDocument::HasDetectiveObjects(SCTAB nTab) const { // looks for detective objects, annotations don't count // (used to adjust scale so detective objects hit their cells better) - BOOL bFound = FALSE; + sal_Bool bFound = false; if (pDrawLayer) { @@ -616,7 +616,7 @@ BOOL ScDocument::HasDetectiveObjects(SCTAB nTab) const { // anything on the internal layer except captions (annotations) if ( (pObject->GetLayer() == SC_LAYER_INTERN) && !ScDrawLayer::IsNoteCaption( pObject ) ) - bFound = TRUE; + bFound = sal_True; pObject = aIter.Next(); } @@ -634,19 +634,19 @@ void ScDocument::UpdateFontCharSet() // Alles, was nicht SYMBOL ist, wird auf den System-CharSet umgesetzt. // Bei neuen Dokumenten (Version SC_FONTCHARSET) sollte der CharSet stimmen. - BOOL bUpdateOld = ( nSrcVer < SC_FONTCHARSET ); + sal_Bool bUpdateOld = ( nSrcVer < SC_FONTCHARSET ); CharSet eSysSet = gsl_getSystemTextEncoding(); if ( eSrcSet != eSysSet || bUpdateOld ) { - USHORT nCount,i; + sal_uInt32 nCount,i; SvxFontItem* pItem; ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - nCount = pPool->GetItemCount(ATTR_FONT); + nCount = pPool->GetItemCount2(ATTR_FONT); for (i=0; i<nCount; i++) { - pItem = (SvxFontItem*)pPool->GetItem(ATTR_FONT, i); + pItem = (SvxFontItem*)pPool->GetItem2(ATTR_FONT, i); if ( pItem && ( pItem->GetCharSet() == eSrcSet || ( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) pItem->GetCharSet() = eSysSet; @@ -655,10 +655,10 @@ void ScDocument::UpdateFontCharSet() if ( pDrawLayer ) { SfxItemPool& rDrawPool = pDrawLayer->GetItemPool(); - nCount = rDrawPool.GetItemCount(EE_CHAR_FONTINFO); + nCount = rDrawPool.GetItemCount2(EE_CHAR_FONTINFO); for (i=0; i<nCount; i++) { - pItem = (SvxFontItem*)rDrawPool.GetItem(EE_CHAR_FONTINFO, i); + pItem = (SvxFontItem*)rDrawPool.GetItem2(EE_CHAR_FONTINFO, i); if ( pItem && ( pItem->GetCharSet() == eSrcSet || ( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) pItem->GetCharSet() = eSysSet; @@ -697,15 +697,15 @@ void ScDocument::SetImportingXML( bool bVal ) for ( SCTAB nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++ ) if ( pTab[nTab]->IsLoadingRTL() ) { - pTab[nTab]->SetLoadingRTL( FALSE ); - SetLayoutRTL( nTab, TRUE ); // includes mirroring; bImportingXML must be cleared first + pTab[nTab]->SetLoadingRTL( false ); + SetLayoutRTL( nTab, sal_True ); // includes mirroring; bImportingXML must be cleared first } } SetLoadingMedium(bVal); } -void ScDocument::SetXMLFromWrapper( BOOL bVal ) +void ScDocument::SetXMLFromWrapper( sal_Bool bVal ) { bXMLFromWrapper = bVal; } @@ -724,12 +724,12 @@ void ScDocument::SetForbiddenCharacters( const rtl::Reference<SvxForbiddenCharac pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters ); } -BOOL ScDocument::IsValidAsianCompression() const +sal_Bool ScDocument::IsValidAsianCompression() const { return ( nAsianCompression != SC_ASIANCOMPRESSION_INVALID ); } -BYTE ScDocument::GetAsianCompression() const +sal_uInt8 ScDocument::GetAsianCompression() const { if ( nAsianCompression == SC_ASIANCOMPRESSION_INVALID ) return 0; @@ -737,7 +737,7 @@ BYTE ScDocument::GetAsianCompression() const return nAsianCompression; } -void ScDocument::SetAsianCompression(BYTE nNew) +void ScDocument::SetAsianCompression(sal_uInt8 nNew) { nAsianCompression = nNew; if ( pEditEngine ) @@ -746,26 +746,26 @@ void ScDocument::SetAsianCompression(BYTE nNew) pDrawLayer->SetCharCompressType( nAsianCompression ); } -BOOL ScDocument::IsValidAsianKerning() const +sal_Bool ScDocument::IsValidAsianKerning() const { return ( nAsianKerning != SC_ASIANKERNING_INVALID ); } -BOOL ScDocument::GetAsianKerning() const +sal_Bool ScDocument::GetAsianKerning() const { if ( nAsianKerning == SC_ASIANKERNING_INVALID ) - return FALSE; + return false; else - return (BOOL)nAsianKerning; + return (sal_Bool)nAsianKerning; } -void ScDocument::SetAsianKerning(BOOL bNew) +void ScDocument::SetAsianKerning(sal_Bool bNew) { - nAsianKerning = (BYTE)bNew; + nAsianKerning = (sal_uInt8)bNew; if ( pEditEngine ) - pEditEngine->SetKernAsianPunctuation( (BOOL)nAsianKerning ); + pEditEngine->SetKernAsianPunctuation( (sal_Bool)nAsianKerning ); if ( pDrawLayer ) - pDrawLayer->SetKernAsianPunctuation( (BOOL)nAsianKerning ); + pDrawLayer->SetKernAsianPunctuation( (sal_Bool)nAsianKerning ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index b168749e2c4e..790a32699872 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -110,11 +110,11 @@ struct ScCopyBlockFromClipParams { ScDocument* pRefUndoDoc; ScDocument* pClipDoc; - USHORT nInsFlag; + sal_uInt16 nInsFlag; SCTAB nTabStart; SCTAB nTabEnd; - BOOL bAsLink; - BOOL bSkipAttrForEmpty; + sal_Bool bAsLink; + sal_Bool bSkipAttrForEmpty; }; struct ScDefaultAttr @@ -151,52 +151,52 @@ void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck ) } -BOOL ScDocument::HasTable( SCTAB nTab ) const +sal_Bool ScDocument::HasTable( SCTAB nTab ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) - return TRUE; + return sal_True; - return FALSE; + return false; } -BOOL ScDocument::GetName( SCTAB nTab, String& rName ) const +sal_Bool ScDocument::GetName( SCTAB nTab, String& rName ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) { pTab[nTab]->GetName( rName ); - return TRUE; + return sal_True; } rName.Erase(); - return FALSE; + return false; } -BOOL ScDocument::SetCodeName( SCTAB nTab, const String& rName ) +sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName ) { if (VALIDTAB(nTab)) { if (pTab[nTab]) { pTab[nTab]->SetCodeName( rName ); - return TRUE; + return sal_True; } } OSL_TRACE( "**** can't set code name %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() ); - return FALSE; + return false; } -BOOL ScDocument::GetCodeName( SCTAB nTab, String& rName ) const +sal_Bool ScDocument::GetCodeName( SCTAB nTab, String& rName ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) { pTab[nTab]->GetCodeName( rName ); - return TRUE; + return sal_True; } rName.Erase(); - return FALSE; + return false; } NameToNameMap* @@ -207,7 +207,7 @@ ScDocument::GetLocalNameMap( SCTAB& rTab ) return &pTab[rTab]->localNameToGlobalName; } -BOOL ScDocument::GetTable( const String& rName, SCTAB& rTab ) const +sal_Bool ScDocument::GetTable( const String& rName, SCTAB& rTab ) const { String aUpperName = rName; ScGlobal::pCharClass->toUpper(aUpperName); @@ -218,11 +218,11 @@ BOOL ScDocument::GetTable( const String& rName, SCTAB& rTab ) const if ( pTab[i]->GetUpperName() == aUpperName ) { rTab = i; - return TRUE; + return sal_True; } } rTab = 0; - return FALSE; + return false; } @@ -266,9 +266,9 @@ bool ScDocument::ValidTabName( const String& rName ) } -BOOL ScDocument::ValidNewTabName( const String& rName ) const +sal_Bool ScDocument::ValidNewTabName( const String& rName ) const { - BOOL bValid = ValidTabName(rName); + sal_Bool bValid = ValidTabName(rName); for (SCTAB i=0; (i<=MAXTAB) && bValid; i++) if (pTab[i]) { @@ -287,10 +287,10 @@ void ScDocument::CreateValidTabName(String& rName) const // Find new one const String aStrTable( ScResId(SCSTR_TABLE) ); - BOOL bOk = FALSE; + sal_Bool bOk = false; // First test if the prefix is valid, if so only avoid doubles - BOOL bPrefix = ValidTabName( aStrTable ); + sal_Bool bPrefix = ValidTabName( aStrTable ); OSL_ENSURE(bPrefix, "Invalid Table Name"); SCTAB nDummy; @@ -332,11 +332,11 @@ void ScDocument::CreateValidTabName(String& rName) const } -BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, - BOOL bExternalDocument ) +sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName, + sal_Bool bExternalDocument ) { SCTAB nTabCount = GetTableCount(); - BOOL bValid = ValidTab(nTabCount); + sal_Bool bValid = ValidTab(nTabCount); if ( !bExternalDocument ) // else test rName == "'Doc'!Tab" first bValid = (bValid && ValidNewTabName(rName)); if (bValid) @@ -347,7 +347,7 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, pTab[nTabCount]->SetCodeName( rName ); ++nMaxTableNumber; if ( bExternalDocument ) - pTab[nTabCount]->SetVisible( FALSE ); + pTab[nTabCount]->SetVisible( false ); } else { @@ -403,19 +403,19 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName, pChartListenerCollection->UpdateScheduledSeriesRanges(); SetDirty(); - bValid = TRUE; + bValid = sal_True; } else - bValid = FALSE; + bValid = false; } } return bValid; } -BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) +sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) { - BOOL bValid = FALSE; + sal_Bool bValid = false; if (VALIDTAB(nTab)) { if (pTab[nTab]) @@ -423,8 +423,8 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) SCTAB nTabCount = GetTableCount(); if (nTabCount > 1) { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab ); DelBroadcastAreasInRange( aRange ); @@ -464,7 +464,7 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) SCTAB i; for (i=0; i<=MAXTAB; i++) if (pTab[i]) - pTab[i]->UpdateDeleteTab(nTab,FALSE, + pTab[i]->UpdateDeleteTab(nTab,false, pRefUndoDoc ? pRefUndoDoc->pTab[i] : 0); delete pTab[nTab]; for (i=nTab + 1; i < nTabCount; i++) @@ -492,7 +492,7 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) pChartListenerCollection->UpdateScheduledSeriesRanges(); SetAutoCalc( bOldAutoCalc ); - bValid = TRUE; + bValid = sal_True; } } } @@ -500,16 +500,16 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) } -BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef */, - BOOL bExternalDocument ) +sal_Bool ScDocument::RenameTab( SCTAB nTab, const String& rName, sal_Bool /* bUpdateRef */, + sal_Bool bExternalDocument ) { - BOOL bValid = FALSE; + sal_Bool bValid = false; SCTAB i; if VALIDTAB(nTab) if (pTab[nTab]) { if ( bExternalDocument ) - bValid = TRUE; // composed name + bValid = true; // composed name else bValid = ValidTabName(rName); for (i=0; (i<=MAXTAB) && bValid; i++) @@ -531,14 +531,14 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef // but the XML stream must be re-generated. for (i=0; i<=MAXTAB; ++i) if (pTab[i] && pTab[i]->IsStreamValid()) - pTab[i]->SetStreamValid( FALSE ); + pTab[i]->SetStreamValid( false ); } } return bValid; } -void ScDocument::SetVisible( SCTAB nTab, BOOL bVisible ) +void ScDocument::SetVisible( SCTAB nTab, sal_Bool bVisible ) { if (VALIDTAB(nTab)) if (pTab[nTab]) @@ -546,26 +546,26 @@ void ScDocument::SetVisible( SCTAB nTab, BOOL bVisible ) } -BOOL ScDocument::IsVisible( SCTAB nTab ) const +sal_Bool ScDocument::IsVisible( SCTAB nTab ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) return pTab[nTab]->IsVisible(); - return FALSE; + return false; } -BOOL ScDocument::IsStreamValid( SCTAB nTab ) const +sal_Bool ScDocument::IsStreamValid( SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->IsStreamValid(); - return FALSE; + return false; } -void ScDocument::SetStreamValid( SCTAB nTab, BOOL bSet, BOOL bIgnoreLock ) +void ScDocument::SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetStreamValid( bSet, bIgnoreLock ); @@ -578,30 +578,30 @@ void ScDocument::LockStreamValid( bool bLock ) } -BOOL ScDocument::IsPendingRowHeights( SCTAB nTab ) const +sal_Bool ScDocument::IsPendingRowHeights( SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->IsPendingRowHeights(); - return FALSE; + return false; } -void ScDocument::SetPendingRowHeights( SCTAB nTab, BOOL bSet ) +void ScDocument::SetPendingRowHeights( SCTAB nTab, sal_Bool bSet ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetPendingRowHeights( bSet ); } -void ScDocument::SetLayoutRTL( SCTAB nTab, BOOL bRTL ) +void ScDocument::SetLayoutRTL( SCTAB nTab, sal_Bool bRTL ) { if ( ValidTab(nTab) && pTab[nTab] ) { if ( bImportingXML ) { // #i57869# only set the LoadingRTL flag, the real setting (including mirroring) - // is applied in SetImportingXML(FALSE). This is so the shapes can be loaded in + // is applied in SetImportingXML(sal_False). This is so the shapes can be loaded in // normal LTR mode. pTab[nTab]->SetLoadingRTL( bRTL ); @@ -639,16 +639,16 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, BOOL bRTL ) } -BOOL ScDocument::IsLayoutRTL( SCTAB nTab ) const +sal_Bool ScDocument::IsLayoutRTL( SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->IsLayoutRTL(); - return FALSE; + return false; } -BOOL ScDocument::IsNegativePage( SCTAB nTab ) const +sal_Bool ScDocument::IsNegativePage( SCTAB nTab ) const { // Negative page area is always used for RTL layout. // The separate method is used to find all RTL handling of drawing objects. @@ -666,7 +666,7 @@ BOOL ScDocument::IsNegativePage( SCTAB nTab ) const ---------------------------------------------------------------------------- */ -BOOL ScDocument::GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const +sal_Bool ScDocument::GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) @@ -674,11 +674,11 @@ BOOL ScDocument::GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const rEndCol = 0; rEndRow = 0; - return FALSE; + return false; } -BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const +sal_Bool ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const { if (VALIDTAB(nTab)) if (pTab[nTab]) @@ -686,7 +686,7 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons rEndCol = 0; rEndRow = 0; - return FALSE; + return false; } bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const @@ -734,7 +734,7 @@ bool ScDocument::ShrinkToUsedDataArea( bool& o_bShrunk, SCTAB nTab, SCCOL& rStar // connected area void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, - SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const + SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bIncludeOld, bool bOnlyDown ) const { if (ValidTab(nTab) && pTab[nTab]) pTab[nTab]->GetDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bIncludeOld, bOnlyDown ); @@ -821,7 +821,7 @@ bool lcl_GetNextTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScMa } -BOOL ScDocument::CanInsertRow( const ScRange& rRange ) const +sal_Bool ScDocument::CanInsertRow( const ScRange& rRange ) const { SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -834,7 +834,7 @@ BOOL ScDocument::CanInsertRow( const ScRange& rRange ) const PutInOrder( nStartTab, nEndTab ); SCSIZE nSize = static_cast<SCSIZE>(nEndRow - nStartRow + 1); - BOOL bTest = TRUE; + sal_Bool bTest = sal_True; for (SCTAB i=nStartTab; i<=nEndTab && bTest; i++) if (pTab[i]) bTest &= pTab[i]->TestInsertRow( nStartCol, nEndCol, nSize ); @@ -843,7 +843,7 @@ BOOL ScDocument::CanInsertRow( const ScRange& rRange ) const } -BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, +sal_Bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument* pRefUndoDoc, const ScMarkData* pTabMark ) @@ -858,10 +858,10 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, nEndTab = MAXTAB; } - BOOL bTest = TRUE; - BOOL bRet = FALSE; - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid mulitple calculations + sal_Bool bTest = true; + sal_Bool bRet = false; + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid mulitple calculations for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertRow( nStartCol, nEndCol, nSize ); @@ -887,7 +887,7 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, { UpdateReference( URM_INSDEL, nStartCol, nStartRow, nTabRangeStart, nEndCol, MAXROW, nTabRangeEnd, - 0, static_cast<SCsROW>(nSize), 0, pRefUndoDoc, FALSE ); // without drawing objects + 0, static_cast<SCsROW>(nSize), 0, pRefUndoDoc, false ); // without drawing objects } while ( lcl_GetNextTabRange( nTabRangeStart, nTabRangeEnd, pTabMark ) ); @@ -920,7 +920,7 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, if (pTab[i]) pTab[i]->SetRelNameDirty(); } - bRet = TRUE; + bRet = sal_True; } SetAutoCalc( bOldAutoCalc ); if ( bRet ) @@ -929,7 +929,7 @@ BOOL ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, } -BOOL ScDocument::InsertRow( const ScRange& rRange, ScDocument* pRefUndoDoc ) +sal_Bool ScDocument::InsertRow( const ScRange& rRange, ScDocument* pRefUndoDoc ) { return InsertRow( rRange.aStart.Col(), rRange.aStart.Tab(), rRange.aEnd.Col(), rRange.aEnd.Tab(), @@ -941,7 +941,7 @@ BOOL ScDocument::InsertRow( const ScRange& rRange, ScDocument* pRefUndoDoc ) void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, - ScDocument* pRefUndoDoc, BOOL* pUndoOutline, + ScDocument* pRefUndoDoc, sal_Bool* pUndoOutline, const ScMarkData* pTabMark ) { SCTAB i; @@ -954,8 +954,8 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, nEndTab = MAXTAB; } - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -986,13 +986,13 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, { UpdateReference( URM_INSDEL, nStartCol, nStartRow+nSize, nTabRangeStart, nEndCol, MAXROW, nTabRangeEnd, - 0, -(static_cast<SCsROW>(nSize)), 0, pRefUndoDoc, TRUE, false ); + 0, -(static_cast<SCsROW>(nSize)), 0, pRefUndoDoc, sal_True, false ); } while ( lcl_GetNextTabRange( nTabRangeStart, nTabRangeEnd, pTabMark ) ); } if (pUndoOutline) - *pUndoOutline = FALSE; + *pUndoOutline = false; for ( i = nStartTab; i <= nEndTab; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) @@ -1015,7 +1015,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, } -void ScDocument::DeleteRow( const ScRange& rRange, ScDocument* pRefUndoDoc, BOOL* pUndoOutline ) +void ScDocument::DeleteRow( const ScRange& rRange, ScDocument* pRefUndoDoc, sal_Bool* pUndoOutline ) { DeleteRow( rRange.aStart.Col(), rRange.aStart.Tab(), rRange.aEnd.Col(), rRange.aEnd.Tab(), @@ -1024,7 +1024,7 @@ void ScDocument::DeleteRow( const ScRange& rRange, ScDocument* pRefUndoDoc, BOOL } -BOOL ScDocument::CanInsertCol( const ScRange& rRange ) const +sal_Bool ScDocument::CanInsertCol( const ScRange& rRange ) const { SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -1037,7 +1037,7 @@ BOOL ScDocument::CanInsertCol( const ScRange& rRange ) const PutInOrder( nStartTab, nEndTab ); SCSIZE nSize = static_cast<SCSIZE>(nEndCol - nStartCol + 1); - BOOL bTest = TRUE; + sal_Bool bTest = sal_True; for (SCTAB i=nStartTab; i<=nEndTab && bTest; i++) if (pTab[i]) bTest &= pTab[i]->TestInsertCol( nStartRow, nEndRow, nSize ); @@ -1046,7 +1046,7 @@ BOOL ScDocument::CanInsertCol( const ScRange& rRange ) const } -BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, +sal_Bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc, const ScMarkData* pTabMark ) @@ -1061,10 +1061,10 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, nEndTab = MAXTAB; } - BOOL bTest = TRUE; - BOOL bRet = FALSE; - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bTest = true; + sal_Bool bRet = false; + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations for ( i = nStartTab; i <= nEndTab && bTest; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) bTest &= pTab[i]->TestInsertCol( nStartRow, nEndRow, nSize ); @@ -1087,7 +1087,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, { UpdateReference( URM_INSDEL, nStartCol, nStartRow, nTabRangeStart, MAXCOL, nEndRow, nTabRangeEnd, - static_cast<SCsCOL>(nSize), 0, 0, pRefUndoDoc, TRUE, false ); + static_cast<SCsCOL>(nSize), 0, 0, pRefUndoDoc, sal_True, false ); } while ( lcl_GetNextTabRange( nTabRangeStart, nTabRangeEnd, pTabMark ) ); @@ -1112,7 +1112,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, if (pTab[i]) pTab[i]->SetRelNameDirty(); } - bRet = TRUE; + bRet = sal_True; } SetAutoCalc( bOldAutoCalc ); if ( bRet ) @@ -1121,7 +1121,7 @@ BOOL ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, } -BOOL ScDocument::InsertCol( const ScRange& rRange, ScDocument* pRefUndoDoc ) +sal_Bool ScDocument::InsertCol( const ScRange& rRange, ScDocument* pRefUndoDoc ) { return InsertCol( rRange.aStart.Row(), rRange.aStart.Tab(), rRange.aEnd.Row(), rRange.aEnd.Tab(), @@ -1132,7 +1132,7 @@ BOOL ScDocument::InsertCol( const ScRange& rRange, ScDocument* pRefUndoDoc ) void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc, - BOOL* pUndoOutline, const ScMarkData* pTabMark ) + sal_Bool* pUndoOutline, const ScMarkData* pTabMark ) { SCTAB i; @@ -1144,8 +1144,8 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA nEndTab = MAXTAB; } - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations // handle chunks of consecutive selected sheets together SCTAB nTabRangeStart = nStartTab; @@ -1176,13 +1176,13 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA { UpdateReference( URM_INSDEL, sal::static_int_cast<SCCOL>(nStartCol+nSize), nStartRow, nTabRangeStart, MAXCOL, nEndRow, nTabRangeEnd, - -static_cast<SCsCOL>(nSize), 0, 0, pRefUndoDoc, TRUE, false ); + -static_cast<SCsCOL>(nSize), 0, 0, pRefUndoDoc, sal_True, false ); } while ( lcl_GetNextTabRange( nTabRangeStart, nTabRangeEnd, pTabMark ) ); } if (pUndoOutline) - *pUndoOutline = FALSE; + *pUndoOutline = false; for ( i = nStartTab; i <= nEndTab; i++) if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i))) @@ -1205,7 +1205,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA } -void ScDocument::DeleteCol( const ScRange& rRange, ScDocument* pRefUndoDoc, BOOL* pUndoOutline ) +void ScDocument::DeleteCol( const ScRange& rRange, ScDocument* pRefUndoDoc, sal_Bool* pUndoOutline ) { DeleteCol( rRange.aStart.Row(), rRange.aStart.Tab(), rRange.aEnd.Row(), rRange.aEnd.Tab(), @@ -1219,12 +1219,12 @@ void ScDocument::DeleteCol( const ScRange& rRange, ScDocument* pRefUndoDoc, BOOL void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, - ScRange& rColRange, BOOL& rInsCol, BOOL& rDelCol, - ScRange& rRowRange, BOOL& rInsRow, BOOL& rDelRow ) + ScRange& rColRange, sal_Bool& rInsCol, sal_Bool& rDelCol, + ScRange& rRowRange, sal_Bool& rInsRow, sal_Bool& rDelRow ) { OSL_ENSURE( rOld.aStart == rNew.aStart, "FitBlock: Beginning is different" ); - rInsCol = rDelCol = rInsRow = rDelRow = FALSE; + rInsCol = rDelCol = rInsRow = rDelRow = false; SCCOL nStartX = rOld.aStart.Col(); SCROW nStartY = rOld.aStart.Row(); @@ -1235,7 +1235,7 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, SCTAB nTab = rOld.aStart.Tab(); // wenn es mehr Zeilen werden, werden Spalten auf der alten Hoehe eingefuegt/geloescht - BOOL bGrowY = ( nNewEndY > nOldEndY ); + sal_Bool bGrowY = ( nNewEndY > nOldEndY ); SCROW nColEndY = bGrowY ? nOldEndY : nNewEndY; SCCOL nRowEndX = bGrowY ? nNewEndX : nOldEndX; @@ -1244,12 +1244,12 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, if ( nNewEndX > nOldEndX ) // Spalten einfuegen { rColRange = ScRange( nOldEndX+1, nStartY, nTab, nNewEndX, nColEndY, nTab ); - rInsCol = TRUE; + rInsCol = sal_True; } else if ( nNewEndX < nOldEndX ) // Spalten loeschen { rColRange = ScRange( nNewEndX+1, nStartY, nTab, nOldEndX, nColEndY, nTab ); - rDelCol = TRUE; + rDelCol = sal_True; } // Zeilen @@ -1257,19 +1257,19 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, if ( nNewEndY > nOldEndY ) // Zeilen einfuegen { rRowRange = ScRange( nStartX, nOldEndY+1, nTab, nRowEndX, nNewEndY, nTab ); - rInsRow = TRUE; + rInsRow = sal_True; } else if ( nNewEndY < nOldEndY ) // Zeilen loeschen { rRowRange = ScRange( nStartX, nNewEndY+1, nTab, nRowEndX, nOldEndY, nTab ); - rDelRow = TRUE; + rDelRow = sal_True; } } -BOOL ScDocument::HasPartOfMerged( const ScRange& rRange ) +sal_Bool ScDocument::HasPartOfMerged( const ScRange& rRange ) { - BOOL bPart = FALSE; + sal_Bool bPart = false; SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartX = rRange.aStart.Col(); @@ -1290,44 +1290,44 @@ BOOL ScDocument::HasPartOfMerged( const ScRange& rRange ) } -BOOL ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew ) +sal_Bool ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew ) { if ( rOld == rNew ) - return TRUE; + return sal_True; - BOOL bOk = TRUE; - BOOL bInsCol,bDelCol,bInsRow,bDelRow; + sal_Bool bOk = sal_True; + sal_Bool bInsCol,bDelCol,bInsRow,bDelRow; ScRange aColRange,aRowRange; lcl_GetInsDelRanges( rOld, rNew, aColRange,bInsCol,bDelCol, aRowRange,bInsRow,bDelRow ); if ( bInsCol && !CanInsertCol( aColRange ) ) // Zellen am Rand ? - bOk = FALSE; + bOk = false; if ( bInsRow && !CanInsertRow( aRowRange ) ) // Zellen am Rand ? - bOk = FALSE; + bOk = false; if ( bInsCol || bDelCol ) { aColRange.aEnd.SetCol(MAXCOL); if ( HasPartOfMerged(aColRange) ) - bOk = FALSE; + bOk = false; } if ( bInsRow || bDelRow ) { aRowRange.aEnd.SetRow(MAXROW); if ( HasPartOfMerged(aRowRange) ) - bOk = FALSE; + bOk = false; } return bOk; } -void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, BOOL bClear ) +void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, sal_Bool bClear ) { if (bClear) DeleteAreaTab( rOld, IDF_ALL ); - BOOL bInsCol,bDelCol,bInsRow,bDelRow; + sal_Bool bInsCol,bDelCol,bInsRow,bDelRow; ScRange aColRange,aRowRange; lcl_GetInsDelRanges( rOld, rNew, aColRange,bInsCol,bDelCol, aRowRange,bInsRow,bDelRow ); @@ -1357,12 +1357,12 @@ void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, BOOL bClear void ScDocument::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScMarkData& rMark, USHORT nDelFlag) + const ScMarkData& rMark, sal_uInt16 nDelFlag) { PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations for (SCTAB i = 0; i <= MAXTAB; i++) if (pTab[i]) if ( rMark.GetTableSelect(i) || bIsUndo ) @@ -1373,21 +1373,21 @@ void ScDocument::DeleteArea(SCCOL nCol1, SCROW nRow1, void ScDocument::DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - SCTAB nTab, USHORT nDelFlag) + SCTAB nTab, sal_uInt16 nDelFlag) { PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); if ( VALIDTAB(nTab) && pTab[nTab] ) { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations pTab[nTab]->DeleteArea(nCol1, nRow1, nCol2, nRow2, nDelFlag); SetAutoCalc( bOldAutoCalc ); } } -void ScDocument::DeleteAreaTab( const ScRange& rRange, USHORT nDelFlag ) +void ScDocument::DeleteAreaTab( const ScRange& rRange, sal_uInt16 nDelFlag ) { for ( SCTAB nTab = rRange.aStart.Tab(); nTab <= rRange.aEnd.Tab(); nTab++ ) DeleteAreaTab( rRange.aStart.Col(), rRange.aStart.Row(), @@ -1397,7 +1397,7 @@ void ScDocument::DeleteAreaTab( const ScRange& rRange, USHORT nDelFlag ) void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSelection, - BOOL bColInfo, BOOL bRowInfo ) + sal_Bool bColInfo, sal_Bool bRowInfo ) { if (bIsUndo) { @@ -1421,7 +1421,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2, - BOOL bColInfo, BOOL bRowInfo ) + sal_Bool bColInfo, sal_Bool bRowInfo ) { if (bIsUndo) { @@ -1442,7 +1442,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2, } -void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, BOOL bColInfo, BOOL bRowInfo ) +void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, sal_Bool bColInfo, sal_Bool bRowInfo ) { if (bIsUndo) { @@ -1461,7 +1461,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, BOOL bColInfo, BOOL bRowI } -void ScDocument::SetCutMode( BOOL bVal ) +void ScDocument::SetCutMode( sal_Bool bVal ) { if (bIsClip) GetClipParam().mbCutMode = bVal; @@ -1472,22 +1472,22 @@ void ScDocument::SetCutMode( BOOL bVal ) } -BOOL ScDocument::IsCutMode() +sal_Bool ScDocument::IsCutMode() { if (bIsClip) return GetClipParam().mbCutMode; else { OSL_FAIL("IsCutMode ohne bIsClip"); - return FALSE; + return false; } } void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - USHORT nFlags, BOOL bOnlyMarked, ScDocument* pDestDoc, - const ScMarkData* pMarks, BOOL bColRowFlags ) + sal_uInt16 nFlags, sal_Bool bOnlyMarked, ScDocument* pDestDoc, + const ScMarkData* pMarks, sal_Bool bColRowFlags ) { PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); @@ -1496,14 +1496,14 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, pDestDoc->aDocName = aDocName; if (VALIDTAB(nTab1) && VALIDTAB(nTab2)) { - BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc(); + pDestDoc->SetAutoCalc( false ); // avoid multiple calculations for (SCTAB i = nTab1; i <= nTab2; i++) { if (pTab[i] && pDestDoc->pTab[i]) pTab[i]->CopyToTable( nCol1, nRow1, nCol2, nRow2, nFlags, bOnlyMarked, pDestDoc->pTab[i], pMarks, - FALSE, bColRowFlags ); + false, bColRowFlags ); } pDestDoc->SetAutoCalc( bOldAutoCalc ); } @@ -1512,7 +1512,7 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - USHORT nFlags, BOOL bOnlyMarked, ScDocument* pDestDoc, + sal_uInt16 nFlags, sal_Bool bOnlyMarked, ScDocument* pDestDoc, const ScMarkData* pMarks) { PutInOrder( nCol1, nCol2 ); @@ -1520,10 +1520,10 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, PutInOrder( nTab1, nTab2 ); if (VALIDTAB(nTab1) && VALIDTAB(nTab2)) { - BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc(); + pDestDoc->SetAutoCalc( false ); // avoid multiple calculations if (nTab1 > 0) - CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); + CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks ); for (SCTAB i = nTab1; i <= nTab2; i++) { @@ -1533,35 +1533,35 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, } if (nTab2 < MAXTAB) - CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, FALSE, pDestDoc, pMarks ); + CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, false, pDestDoc, pMarks ); pDestDoc->SetAutoCalc( bOldAutoCalc ); } } void ScDocument::CopyToDocument(const ScRange& rRange, - USHORT nFlags, BOOL bOnlyMarked, ScDocument* pDestDoc, - const ScMarkData* pMarks, BOOL bColRowFlags) + sal_uInt16 nFlags, sal_Bool bOnlyMarked, ScDocument* pDestDoc, + const ScMarkData* pMarks, sal_Bool bColRowFlags) { ScRange aNewRange = rRange; aNewRange.Justify(); if( !pDestDoc->aDocName.Len() ) pDestDoc->aDocName = aDocName; - BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc(); + pDestDoc->SetAutoCalc( false ); // avoid multiple calculations for (SCTAB i = aNewRange.aStart.Tab(); i <= aNewRange.aEnd.Tab(); i++) if (pTab[i] && pDestDoc->pTab[i]) pTab[i]->CopyToTable(aNewRange.aStart.Col(), aNewRange.aStart.Row(), aNewRange.aEnd.Col(), aNewRange.aEnd.Row(), nFlags, bOnlyMarked, pDestDoc->pTab[i], - pMarks, FALSE, bColRowFlags); + pMarks, false, bColRowFlags); pDestDoc->SetAutoCalc( bOldAutoCalc ); } void ScDocument::UndoToDocument(const ScRange& rRange, - USHORT nFlags, BOOL bOnlyMarked, ScDocument* pDestDoc, + sal_uInt16 nFlags, sal_Bool bOnlyMarked, ScDocument* pDestDoc, const ScMarkData* pMarks) { ScRange aNewRange = rRange; @@ -1569,10 +1569,10 @@ void ScDocument::UndoToDocument(const ScRange& rRange, SCTAB nTab1 = aNewRange.aStart.Tab(); SCTAB nTab2 = aNewRange.aEnd.Tab(); - BOOL bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc(); + pDestDoc->SetAutoCalc( false ); // avoid multiple calculations if (nTab1 > 0) - CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, FALSE, pDestDoc, pMarks ); + CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks ); for (SCTAB i = nTab1; i <= nTab2; i++) { @@ -1583,7 +1583,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange, } if (nTab2 < MAXTAB) - CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, FALSE, pDestDoc, pMarks ); + CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, false, pDestDoc, pMarks ); pDestDoc->SetAutoCalc( bOldAutoCalc ); } @@ -1687,14 +1687,14 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, pClipDoc->ResetClip( this, nTab ); if (pTab[nTab] && pClipDoc->pTab[nTab]) - pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], FALSE, TRUE); + pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], false, sal_True); pClipDoc->GetClipParam().mbCutMode = false; } } -void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink ) +void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_Bool bAsLink ) { OSL_ENSURE( bIsClip && pTransClip && pTransClip->bIsClip, "TransposeClip with wrong Document" ); @@ -1710,7 +1710,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end(); for (; itr != itrEnd; ++itr) { - USHORT nIndex = itr->GetIndex(); + sal_uInt16 nIndex = itr->GetIndex(); ScRangeData* pData = new ScRangeData(*itr); if (!pTransClip->pRangeName->insert(pData)) delete pData; @@ -1764,13 +1764,13 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL namespace { -void copyUsedNamesToClip(ScRangeName* pClipRangeName, ScRangeName* pRangeName, const std::set<USHORT>& rUsedNames) +void copyUsedNamesToClip(ScRangeName* pClipRangeName, ScRangeName* pRangeName, const std::set<sal_uInt16>& rUsedNames) { pClipRangeName->clear(); ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end(); for (; itr != itrEnd; ++itr) //! DB-Bereiche Pivot-Bereiche auch !!! { - USHORT nIndex = itr->GetIndex(); + sal_uInt16 nIndex = itr->GetIndex(); bool bInUse = (rUsedNames.count(nIndex) > 0); if (!bInUse) continue; @@ -1787,7 +1787,7 @@ void copyUsedNamesToClip(ScRangeName* pClipRangeName, ScRangeName* pRangeName, c void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs) { - std::set<USHORT> aUsedNames; // indexes of named ranges that are used in the copied cells + std::set<sal_uInt16> aUsedNames; // indexes of named ranges that are used in the copied cells for (SCTAB i = 0; i <= MAXTAB; ++i) if (pTab[i] && pClipDoc->pTab[i]) if ( bAllTabs || !pMarks || pMarks->GetTableSelect(i) ) @@ -1801,7 +1801,7 @@ void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClip void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab) { // Indexes of named ranges that are used in the copied cells - std::set<USHORT> aUsedNames; + std::set<sal_uInt16> aUsedNames; if ( pTab[nTab] && pClipDoc->pTab[nTab] ) { pTab[nTab]->FindRangeNamesInUse( @@ -1854,8 +1854,8 @@ void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameDat const ScRangeData* pExistingData = pRangeName->findByName(itr->GetName()); if (pExistingData) { - USHORT nOldIndex = itr->GetIndex(); - USHORT nNewIndex = pExistingData->GetIndex(); + sal_uInt16 nOldIndex = itr->GetIndex(); + sal_uInt16 nNewIndex = pExistingData->GetIndex(); aClipRangeNames.insert(nOldIndex, nNewIndex); if ( !aClipRangeNames.mbReplace ) aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex ); @@ -1869,8 +1869,8 @@ void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameDat if ( pRangeName->insert(pData) ) { aClipRangeNames.mpRangeNames.push_back(pData); - USHORT nOldIndex = itr->GetIndex(); - USHORT nNewIndex = pData->GetIndex(); + sal_uInt16 nOldIndex = itr->GetIndex(); + sal_uInt16 nNewIndex = pData->GetIndex(); aClipRangeNames.insert(nOldIndex, nNewIndex); if ( !aClipRangeNames.mbReplace ) aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex ); @@ -1955,7 +1955,7 @@ void ScDocument::SetClipParam(const ScClipParam& rParam) mpClipParam.reset(new ScClipParam(rParam)); } -BOOL ScDocument::IsClipboardSource() const +sal_Bool ScDocument::IsClipboardSource() const { ScDocument* pClipDoc = SC_MOD()->GetClipDoc(); return pClipDoc && pClipDoc->xPoolHelper.is() && @@ -1965,7 +1965,7 @@ BOOL ScDocument::IsClipboardSource() const void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScMarkData& rMark, USHORT nInsFlag ) + const ScMarkData& rMark, sal_uInt16 nInsFlag ) { if (nInsFlag & IDF_CONTENTS) { @@ -1979,7 +1979,7 @@ void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1, void ScDocument::BroadcastFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScMarkData& rMark, USHORT nInsFlag ) + const ScMarkData& rMark, sal_uInt16 nInsFlag ) { if (nInsFlag & IDF_CONTENTS) { @@ -2054,17 +2054,17 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, if ( pCBFCP->pClipDoc->GetClipParam().mbCutMode ) { - BOOL bOldInserting = IsInsertingFromOtherDoc(); - SetInsertingFromOtherDoc( TRUE); + sal_Bool bOldInserting = IsInsertingFromOtherDoc(); + SetInsertingFromOtherDoc( sal_True); UpdateReference( URM_MOVE, nCol1, nRow1, i, nCol2, nRow2, i+nFollow, - nDx, nDy, nDz, pCBFCP->pRefUndoDoc ); + nDx, nDy, nDz, pCBFCP->pRefUndoDoc, false ); SetInsertingFromOtherDoc( bOldInserting); } else UpdateReference( URM_COPY, nCol1, nRow1, i, nCol2, nRow2, i+nFollow, - nDx, nDy, nDz, pCBFCP->pRefUndoDoc, FALSE ); + nDx, nDy, nDz, pCBFCP->pRefUndoDoc, false ); nClipTab = (nClipTab+nFollow+1) % (MAXTAB+1); i = sal::static_int_cast<SCTAB>( i + nFollow ); @@ -2125,9 +2125,9 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1, void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMark, - USHORT nInsFlag, - ScDocument* pRefUndoDoc, ScDocument* pClipDoc, BOOL bResetCut, - BOOL bAsLink, BOOL bIncludeFiltered, BOOL bSkipAttrForEmpty, + sal_uInt16 nInsFlag, + ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_Bool bResetCut, + sal_Bool bAsLink, sal_Bool bIncludeFiltered, sal_Bool bSkipAttrForEmpty, const ScRangeList * pDestRanges ) { if (!bIsClip) @@ -2139,8 +2139,8 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar } if (pClipDoc->bIsClip && pClipDoc->GetTableCount()) { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple recalculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple recalculations NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); @@ -2185,7 +2185,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar overwrite/delete existing cells but to insert the notes into these cells. In this case, just delete old notes from the destination area. */ - USHORT nDelFlag = IDF_NONE; + sal_uInt16 nDelFlag = IDF_NONE; if ( (nInsFlag & (IDF_CONTENTS | IDF_ADDNOTES)) == (IDF_NOTE | IDF_ADDNOTES) ) nDelFlag |= IDF_NOTE; else if ( nInsFlag & IDF_CONTENTS ) @@ -2224,13 +2224,13 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar pDestRanges = &aLocalRangeList; } - bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert + bInsertingFromOtherDoc = sal_True; // kein Broadcast/Listener aufbauen bei Insert // bei mindestens 64 Zeilen wird in ScColumn::CopyFromClip voralloziert - BOOL bDoDouble = ( nYw < 64 && nAllRow2 - nAllRow1 > 64); - BOOL bOldDouble = ScColumn::bDoubleAlloc; + sal_Bool bDoDouble = ( nYw < 64 && nAllRow2 - nAllRow1 > 64); + sal_Bool bOldDouble = ScColumn::bDoubleAlloc; if (bDoDouble) - ScColumn::bDoubleAlloc = TRUE; + ScColumn::bDoubleAlloc = sal_True; SCCOL nClipStartCol = aClipRange.aStart.Col(); SCROW nClipStartRow = aClipRange.aStart.Row(); @@ -2298,7 +2298,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar if (pTab[k] && rMark.GetTableSelect(k)) pTab[k]->DecRecalcLevel(); - bInsertingFromOtherDoc = FALSE; + bInsertingFromOtherDoc = false; UpdateRangeNamesInFormulas(aClipRangeNames, *pDestRanges, rMark, nXw, nYw); @@ -2314,7 +2314,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar } static SCROW lcl_getLastNonFilteredRow( - const ScBitMaskCompressedArray<SCROW, BYTE>& rFlags, SCROW nBegRow, SCROW nEndRow, + const ScBitMaskCompressedArray<SCROW, sal_uInt8>& rFlags, SCROW nBegRow, SCROW nEndRow, SCROW nRowCount) { SCROW nFilteredRow = rFlags.GetFirstForCondition( @@ -2339,8 +2339,8 @@ void ScDocument::CopyMultiRangeFromClip( // There is nothing in the clip doc to copy. return; - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple recalculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple recalculations NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); @@ -2375,11 +2375,11 @@ void ScDocument::CopyMultiRangeFromClip( rMark.GetMarkArea(aDestRange); SCROW nLastMarkedRow = aDestRange.aEnd.Row(); - bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert + bInsertingFromOtherDoc = sal_True; // kein Broadcast/Listener aufbauen bei Insert SCROW nBegRow = nRow1; sal_uInt16 nDelFlag = IDF_CONTENTS; - const ScBitMaskCompressedArray<SCROW, BYTE>& rFlags = GetRowFlagsArray(aCBFCP.nTabStart); + const ScBitMaskCompressedArray<SCROW, sal_uInt8>& rFlags = GetRowFlagsArray(aCBFCP.nTabStart); for ( size_t i = 0, n = rClipParam.maRanges.size(); i < n; ++i ) { @@ -2434,7 +2434,7 @@ void ScDocument::CopyMultiRangeFromClip( if (pTab[i] && rMark.GetTableSelect(i)) pTab[i]->DecRecalcLevel(); - bInsertingFromOtherDoc = FALSE; + bInsertingFromOtherDoc = false; ScRangeList aRanges; aRanges.Append(aDestRange); @@ -2454,7 +2454,7 @@ void ScDocument::CopyMultiRangeFromClip( SetAutoCalc( bOldAutoCalc ); } -void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut ) +void ScDocument::SetClipArea( const ScRange& rArea, sal_Bool bCut ) { if (bIsClip) { @@ -2470,7 +2470,7 @@ void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut ) } -void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered) +void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, sal_Bool bIncludeFiltered) { if (!bIsClip) { @@ -2541,7 +2541,7 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY) } -BOOL ScDocument::HasClipFilteredRows() +sal_Bool ScDocument::HasClipFilteredRows() { // count on first used table in clipboard SCTAB nCountTab = 0; @@ -2563,7 +2563,7 @@ BOOL ScDocument::HasClipFilteredRows() } -void ScDocument::MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSkipEmpty, +void ScDocument::MixDocument( const ScRange& rRange, sal_uInt16 nFunction, sal_Bool bSkipEmpty, ScDocument* pSrcDoc ) { SCTAB nTab1 = rRange.aStart.Tab(); @@ -2577,10 +2577,10 @@ void ScDocument::MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSki void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, - USHORT nFlags, USHORT nFunction, - BOOL bSkipEmpty, BOOL bAsLink ) + sal_uInt16 nFlags, sal_uInt16 nFunction, + sal_Bool bSkipEmpty, sal_Bool bAsLink ) { - USHORT nDelFlags = nFlags; + sal_uInt16 nDelFlags = nFlags; if (nDelFlags & IDF_CONTENTS) nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! @@ -2593,10 +2593,10 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, SCCOL nEndCol = rSrcArea.aEnd.Col(); SCROW nEndRow = rSrcArea.aEnd.Row(); ScDocument* pMixDoc = NULL; - BOOL bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); + sal_Bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations SCTAB nCount = GetTableCount(); for (SCTAB i=0; i<nCount; i++) @@ -2612,11 +2612,11 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, else pMixDoc->AddUndoTab( i, i ); pTab[i]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow, - IDF_CONTENTS, FALSE, pMixDoc->pTab[i] ); + IDF_CONTENTS, false, pMixDoc->pTab[i] ); } pTab[i]->DeleteArea( nStartCol,nStartRow, nEndCol,nEndRow, nDelFlags); pTab[nSrcTab]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow, - nFlags, FALSE, pTab[i], NULL, bAsLink ); + nFlags, false, pTab[i], NULL, bAsLink ); if (bDoMix) pTab[i]->MixData( nStartCol,nStartRow, nEndCol,nEndRow, @@ -2635,20 +2635,20 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark, void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, - USHORT nFlags, USHORT nFunction, - BOOL bSkipEmpty, BOOL bAsLink ) + sal_uInt16 nFlags, sal_uInt16 nFunction, + sal_Bool bSkipEmpty, sal_Bool bAsLink ) { - USHORT nDelFlags = nFlags; + sal_uInt16 nDelFlags = nFlags; if (nDelFlags & IDF_CONTENTS) nDelFlags |= IDF_CONTENTS; // immer alle Inhalte oder keine loeschen! if (ValidTab(nSrcTab) && pTab[nSrcTab]) { ScDocument* pMixDoc = NULL; - BOOL bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); + sal_Bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS ); - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple calculations + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); // avoid multiple calculations ScRange aArea; rMark.GetMultiMarkArea( aArea ); @@ -2671,12 +2671,12 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, else pMixDoc->AddUndoTab( i, i ); pTab[i]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow, - IDF_CONTENTS, TRUE, pMixDoc->pTab[i], &rMark ); + IDF_CONTENTS, sal_True, pMixDoc->pTab[i], &rMark ); } pTab[i]->DeleteSelection( nDelFlags, rMark ); pTab[nSrcTab]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow, - nFlags, TRUE, pTab[i], &rMark, bAsLink ); + nFlags, sal_True, pTab[i], &rMark, bAsLink ); if (bDoMix) pTab[i]->MixMarked( rMark, nFunction, bSkipEmpty, pMixDoc->pTab[i] ); @@ -2693,13 +2693,13 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, } -void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, BOOL bForceTab ) +void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, sal_Bool bForceTab ) { if (VALIDTAB(nTab)) { if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + sal_Bool bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -2713,12 +2713,12 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, } -void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceTab ) +void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, sal_Bool bForceTab ) { SCTAB nTab = rPos.Tab(); if ( bForceTab && !pTab[nTab] ) { - BOOL bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags + sal_Bool bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags pTab[nTab] = new ScTable(this, nTab, String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")), @@ -2731,13 +2731,13 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT } -BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, +sal_Bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, ScSetStringParam* pParam ) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pParam ); else - return FALSE; + return false; } @@ -2839,7 +2839,7 @@ sal_uInt32 ScDocument::GetNumberFormat( const ScAddress& rPos ) const } -void ScDocument::GetNumberFormatInfo( short& nType, ULONG& nIndex, +void ScDocument::GetNumberFormatInfo( short& nType, sal_uLong& nIndex, const ScAddress& rPos, const ScBaseCell* pCell ) const { SCTAB nTab = rPos.Tab(); @@ -2912,27 +2912,27 @@ ScBaseCell* ScDocument::GetCell( const ScAddress& rPos ) const } -BOOL ScDocument::HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +sal_Bool ScDocument::HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { if ( VALIDTAB(nTab) && pTab[nTab] ) return pTab[nTab]->HasStringData( nCol, nRow ); else - return FALSE; + return false; } -BOOL ScDocument::HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +sal_Bool ScDocument::HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { if ( VALIDTAB(nTab) && pTab[nTab] ) return pTab[nTab]->HasValueData( nCol, nRow ); else - return FALSE; + return false; } -BOOL ScDocument::HasStringCells( const ScRange& rRange ) const +sal_Bool ScDocument::HasStringCells( const ScRange& rRange ) const { - // TRUE, wenn String- oder Editzellen im Bereich + // sal_True, wenn String- oder Editzellen im Bereich SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -2943,20 +2943,20 @@ BOOL ScDocument::HasStringCells( const ScRange& rRange ) const for ( SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++ ) if ( pTab[nTab] && pTab[nTab]->HasStringCells( nStartCol, nStartRow, nEndCol, nEndRow ) ) - return TRUE; + return sal_True; - return FALSE; + return false; } -BOOL ScDocument::HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +sal_Bool ScDocument::HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { sal_uInt32 nValidation = static_cast< const SfxUInt32Item* >( GetAttr( nCol, nRow, nTab, ATTR_VALIDDATA ) )->GetValue(); if( nValidation ) { const ScValidationData* pData = GetValidationEntry( nValidation ); if( pData && pData->HasSelectionList() ) - return TRUE; + return sal_True; } return HasStringCells( ScRange( nCol, 0, nTab, nCol, MAXROW, nTab ) ); } @@ -3018,8 +3018,8 @@ void ScDocument::InitializeAllNoteCaptions( bool bForced ) void ScDocument::SetDirty() { - BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // keine Mehrfachberechnung + sal_Bool bOldAutoCalc = GetAutoCalc(); + bAutoCalc = false; // keine Mehrfachberechnung { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( GetBASM()); for (SCTAB i=0; i<=MAXTAB; i++) @@ -3038,8 +3038,8 @@ void ScDocument::SetDirty() void ScDocument::SetDirty( const ScRange& rRange ) { - BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // keine Mehrfachberechnung + sal_Bool bOldAutoCalc = GetAutoCalc(); + bAutoCalc = false; // keine Mehrfachberechnung { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( GetBASM()); SCTAB nTab2 = rRange.aEnd.Tab(); @@ -3052,8 +3052,8 @@ void ScDocument::SetDirty( const ScRange& rRange ) void ScDocument::SetTableOpDirty( const ScRange& rRange ) { - BOOL bOldAutoCalc = GetAutoCalc(); - bAutoCalc = FALSE; // no multiple recalculation + sal_Bool bOldAutoCalc = GetAutoCalc(); + bAutoCalc = false; // no multiple recalculation SCTAB nTab2 = rRange.aEnd.Tab(); for (SCTAB i=rRange.aStart.Tab(); i<=nTab2; i++) if (pTab[i]) pTab[i]->SetTableOpDirty( rRange ); @@ -3104,8 +3104,8 @@ void ScDocument::AddTableOpFormulaCell( ScFormulaCell* pCell ) void ScDocument::CalcAll() { ClearLookupCaches(); // Ensure we don't deliver zombie data. - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( TRUE ); + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( sal_True ); SCTAB i; for (i=0; i<=MAXTAB; i++) if (pTab[i]) pTab[i]->SetDirtyVar(); @@ -3129,8 +3129,8 @@ void ScDocument::CompileAll() void ScDocument::CompileXML() { - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); + sal_Bool bOldAutoCalc = GetAutoCalc(); + SetAutoCalc( false ); ScProgress aProgress( GetDocumentShell(), ScGlobal::GetRscString( STR_PROGRESS_CALCULATING ), GetXMLImportedFormulaCount() ); @@ -3160,14 +3160,14 @@ void ScDocument::CalcAfterLoad() if (bIsClip) // Excel-Dateien werden aus dem Clipboard in ein Clip-Doc geladen return; // dann wird erst beim Einfuegen in das richtige Doc berechnet - bCalcingAfterLoad = TRUE; + bCalcingAfterLoad = sal_True; for ( i = 0; i <= MAXTAB; i++) if (pTab[i]) pTab[i]->CalcAfterLoad(); for (i=0; i<=MAXTAB; i++) if (pTab[i]) pTab[i]->SetDirtyAfterLoad(); - bCalcingAfterLoad = FALSE; + bCalcingAfterLoad = false; - SetDetectiveDirty(FALSE); // noch keine wirklichen Aenderungen + SetDetectiveDirty(false); // noch keine wirklichen Aenderungen // #i112436# If formula cells are already dirty, they don't broadcast further changes. // So the source ranges of charts must be interpreted even if they are not visible, @@ -3184,7 +3184,7 @@ void ScDocument::CalcAfterLoad() } -USHORT ScDocument::GetErrCode( const ScAddress& rPos ) const +sal_uInt16 ScDocument::GetErrCode( const ScAddress& rPos ) const { SCTAB nTab = rPos.Tab(); if ( pTab[nTab] ) @@ -3207,46 +3207,46 @@ void ScDocument::ResetChanged( const ScRange& rRange ) // -void ScDocument::SetColWidth( SCCOL nCol, SCTAB nTab, USHORT nNewWidth ) +void ScDocument::SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetColWidth( nCol, nNewWidth ); } -void ScDocument::SetColWidthOnly( SCCOL nCol, SCTAB nTab, USHORT nNewWidth ) +void ScDocument::SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetColWidthOnly( nCol, nNewWidth ); } -void ScDocument::SetRowHeight( SCROW nRow, SCTAB nTab, USHORT nNewHeight ) +void ScDocument::SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetRowHeight( nRow, nNewHeight ); } -void ScDocument::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, USHORT nNewHeight ) +void ScDocument::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetRowHeightRange ( nStartRow, nEndRow, nNewHeight, 1.0, 1.0 ); } -void ScDocument::SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, USHORT nNewHeight ) +void ScDocument::SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetRowHeightOnly( nStartRow, nEndRow, nNewHeight ); } -void ScDocument::SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bManual ) +void ScDocument::SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bManual ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetManualHeight( nStartRow, nEndRow, bManual ); } -USHORT ScDocument::GetColWidth( SCCOL nCol, SCTAB nTab ) const +sal_uInt16 ScDocument::GetColWidth( SCCOL nCol, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetColWidth( nCol ); @@ -3255,7 +3255,7 @@ USHORT ScDocument::GetColWidth( SCCOL nCol, SCTAB nTab ) const } -USHORT ScDocument::GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const +sal_uInt16 ScDocument::GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetOriginalWidth( nCol ); @@ -3264,7 +3264,7 @@ USHORT ScDocument::GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const } -USHORT ScDocument::GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const +sal_uInt16 ScDocument::GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetCommonWidth( nEndCol ); @@ -3273,7 +3273,7 @@ USHORT ScDocument::GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const } -USHORT ScDocument::GetOriginalHeight( SCROW nRow, SCTAB nTab ) const +sal_uInt16 ScDocument::GetOriginalHeight( SCROW nRow, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetOriginalHeight( nRow ); @@ -3282,7 +3282,7 @@ USHORT ScDocument::GetOriginalHeight( SCROW nRow, SCTAB nTab ) const } -USHORT ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero ) const +sal_uInt16 ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetRowHeight( nRow, NULL, NULL, bHiddenAsZero ); @@ -3291,7 +3291,7 @@ USHORT ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero ) co } -USHORT ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero ) const +sal_uInt16 ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetRowHeight( nRow, pStartRow, pEndRow, bHiddenAsZero ); @@ -3300,7 +3300,7 @@ USHORT ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, SCROW } -ULONG ScDocument::GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const +sal_uLong ScDocument::GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const { if (nStartRow == nEndRow) return GetRowHeight( nStartRow, nTab); // faster for a single row @@ -3316,17 +3316,17 @@ ULONG ScDocument::GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) con return 0; } -SCROW ScDocument::GetRowForHeight( SCTAB nTab, ULONG nHeight ) const +SCROW ScDocument::GetRowForHeight( SCTAB nTab, sal_uLong nHeight ) const { return pTab[nTab]->GetRowForHeight(nHeight); } -ULONG ScDocument::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, +sal_uLong ScDocument::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const { // faster for a single row if (nStartRow == nEndRow) - return (ULONG) (GetRowHeight( nStartRow, nTab) * fScale); + return (sal_uLong) (GetRowHeight( nStartRow, nTab) * fScale); // check bounds because this method replaces former for(i=start;i<=end;++i) loops if (nStartRow > nEndRow) @@ -3348,7 +3348,7 @@ SCROW ScDocument::GetHiddenRowCount( SCROW nRow, SCTAB nTab ) const } -ULONG ScDocument::GetColOffset( SCCOL nCol, SCTAB nTab ) const +sal_uLong ScDocument::GetColOffset( SCCOL nCol, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetColOffset( nCol ); @@ -3357,7 +3357,7 @@ ULONG ScDocument::GetColOffset( SCCOL nCol, SCTAB nTab ) const } -ULONG ScDocument::GetRowOffset( SCROW nRow, SCTAB nTab ) const +sal_uLong ScDocument::GetRowOffset( SCROW nRow, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetRowOffset( nRow ); @@ -3366,10 +3366,10 @@ ULONG ScDocument::GetRowOffset( SCROW nRow, SCTAB nTab ) const } -USHORT ScDocument::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev, +sal_uInt16 ScDocument::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bFormula, const ScMarkData* pMarkData, + sal_Bool bFormula, const ScMarkData* pMarkData, const ScColWidthParam* pParam ) { if ( ValidTab(nTab) && pTab[nTab] ) @@ -3384,7 +3384,7 @@ long ScDocument::GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bWidth, BOOL bTotalSize ) + sal_Bool bWidth, sal_Bool bTotalSize ) { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetNeededSize @@ -3394,18 +3394,18 @@ long ScDocument::GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab, } -BOOL ScDocument::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, USHORT nExtra, +sal_Bool ScDocument::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nExtra, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bShrink ) + sal_Bool bShrink ) { //! MarkToMulti(); if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->SetOptimalHeight( nStartRow, nEndRow, nExtra, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bShrink ); OSL_FAIL("Falsche Tabellennummer"); - return FALSE; + return false; } @@ -3414,19 +3414,19 @@ void ScDocument::UpdateAllRowHeights( OutputDevice* pDev, double nPPTX, double n { // one progress across all (selected) sheets - ULONG nCellCount = 0; + sal_uLong nCellCount = 0; for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ ) if ( pTab[nTab] && ( !pTabMark || pTabMark->GetTableSelect(nTab) ) ) nCellCount += pTab[nTab]->GetWeightedCount(); ScProgress aProgress( GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount ); - ULONG nProgressStart = 0; + sal_uLong nProgressStart = 0; for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ ) if ( pTab[nTab] && ( !pTabMark || pTabMark->GetTableSelect(nTab) ) ) { pTab[nTab]->SetOptimalHeightOnly( 0, MAXROW, 0, - pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE, &aProgress, nProgressStart ); + pDev, nPPTX, nPPTY, rZoomX, rZoomY, false, &aProgress, nProgressStart ); pTab[nTab]->SetDrawPageSize(true, true); nProgressStart += pTab[nTab]->GetWeightedCount(); } @@ -3437,42 +3437,42 @@ void ScDocument::UpdateAllRowHeights( OutputDevice* pDev, double nPPTX, double n // Spalten-/Zeilen-Flags ---------------------------------------------- // -void ScDocument::ShowCol(SCCOL nCol, SCTAB nTab, BOOL bShow) +void ScDocument::ShowCol(SCCOL nCol, SCTAB nTab, sal_Bool bShow) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->ShowCol( nCol, bShow ); } -void ScDocument::ShowRow(SCROW nRow, SCTAB nTab, BOOL bShow) +void ScDocument::ShowRow(SCROW nRow, SCTAB nTab, sal_Bool bShow) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->ShowRow( nRow, bShow ); } -void ScDocument::ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, BOOL bShow) +void ScDocument::ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, sal_Bool bShow) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->ShowRows( nRow1, nRow2, bShow ); } -void ScDocument::SetRowFlags( SCROW nRow, SCTAB nTab, BYTE nNewFlags ) +void ScDocument::SetRowFlags( SCROW nRow, SCTAB nTab, sal_uInt8 nNewFlags ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetRowFlags( nRow, nNewFlags ); } -void ScDocument::SetRowFlags( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BYTE nNewFlags ) +void ScDocument::SetRowFlags( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt8 nNewFlags ) { if ( ValidTab(nTab) && pTab[nTab] ) pTab[nTab]->SetRowFlags( nStartRow, nEndRow, nNewFlags ); } -BYTE ScDocument::GetColFlags( SCCOL nCol, SCTAB nTab ) const +sal_uInt8 ScDocument::GetColFlags( SCCOL nCol, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetColFlags( nCol ); @@ -3480,7 +3480,7 @@ BYTE ScDocument::GetColFlags( SCCOL nCol, SCTAB nTab ) const return 0; } -BYTE ScDocument::GetRowFlags( SCROW nRow, SCTAB nTab ) const +sal_uInt8 ScDocument::GetRowFlags( SCROW nRow, SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->GetRowFlags( nRow ); @@ -3488,17 +3488,17 @@ BYTE ScDocument::GetRowFlags( SCROW nRow, SCTAB nTab ) const return 0; } -ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArrayModifiable( +ScBitMaskCompressedArray< SCROW, sal_uInt8> & ScDocument::GetRowFlagsArrayModifiable( SCTAB nTab ) { - return const_cast< ScBitMaskCompressedArray< SCROW, BYTE> & >( + return const_cast< ScBitMaskCompressedArray< SCROW, sal_uInt8> & >( GetRowFlagsArray( nTab)); } -const ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArray( +const ScBitMaskCompressedArray< SCROW, sal_uInt8> & ScDocument::GetRowFlagsArray( SCTAB nTab ) const { - const ScBitMaskCompressedArray< SCROW, BYTE> * pFlags; + const ScBitMaskCompressedArray< SCROW, sal_uInt8> * pFlags; if ( ValidTab(nTab) && pTab[nTab] ) pFlags = pTab[nTab]->GetRowFlagsArray(); else @@ -3509,7 +3509,7 @@ const ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArray( if (!pFlags) { OSL_FAIL("no row flags at sheet"); - static ScBitMaskCompressedArray< SCROW, BYTE> aDummy( MAXROW, 0); + static ScBitMaskCompressedArray< SCROW, sal_uInt8> aDummy( MAXROW, 0); pFlags = &aDummy; } return *pFlags; @@ -3766,8 +3766,8 @@ SCCOL ScDocument::GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const { if ( ValidTab(nTab) && pTab[nTab] ) { - BYTE nStartFlags = pTab[nTab]->GetColFlags(nStart); - USHORT nStartWidth = pTab[nTab]->GetOriginalWidth(nStart); + sal_uInt8 nStartFlags = pTab[nTab]->GetColFlags(nStart); + sal_uInt16 nStartWidth = pTab[nTab]->GetOriginalWidth(nStart); for (SCCOL nCol = nStart + 1; nCol <= MAXCOL; nCol++) { if (((nStartFlags & CR_MANUALBREAK) != (pTab[nTab]->GetColFlags(nCol) & CR_MANUALBREAK)) || @@ -3785,7 +3785,7 @@ SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCa if (!ValidTab(nTab) || !pTab[nTab]) return 0; - const ScBitMaskCompressedArray<SCROW, BYTE>* pRowFlagsArray = pTab[nTab]->GetRowFlagsArray(); + const ScBitMaskCompressedArray<SCROW, sal_uInt8>* pRowFlagsArray = pTab[nTab]->GetRowFlagsArray(); if (!pRowFlagsArray) return 0; @@ -3796,12 +3796,12 @@ SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCa SCROW nFlagsEndRow; SCROW nHiddenEndRow; SCROW nHeightEndRow; - BYTE nFlags; + sal_uInt8 nFlags; bool bHidden; - USHORT nHeight; - BYTE nStartFlags = nFlags = pRowFlagsArray->GetValue( nStart, nIndex, nFlagsEndRow); + sal_uInt16 nHeight; + sal_uInt8 nStartFlags = nFlags = pRowFlagsArray->GetValue( nStart, nIndex, nFlagsEndRow); bool bStartHidden = bHidden = pTab[nTab]->RowHidden( nStart, NULL, &nHiddenEndRow); - USHORT nStartHeight = nHeight = pTab[nTab]->GetRowHeight( nStart, NULL, &nHeightEndRow, false); + sal_uInt16 nStartHeight = nHeight = pTab[nTab]->GetRowHeight( nStart, NULL, &nHeightEndRow, false); SCROW nRow; while ((nRow = std::min( nHiddenEndRow, std::min( nFlagsEndRow, nHeightEndRow)) + 1) <= MAXROW) { @@ -3823,9 +3823,9 @@ SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCa return MAXROW+1; } -BOOL ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault) +sal_Bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault) { - BOOL bRet(FALSE); + sal_Bool bRet(false); nDefault = 0; ScDocAttrIterator aDocAttrItr(this, nTab, nCol, 0, nCol, nLastRow); SCCOL nColumn; @@ -3868,16 +3868,16 @@ BOOL ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& n ++aItr; } nDefault = aDefaultItr->nFirst; - bRet = TRUE; + bRet = sal_True; } else - bRet = TRUE; + bRet = sal_True; return bRet; } -BOOL ScDocument::GetRowDefault( SCTAB /* nTab */, SCROW /* nRow */, SCCOL /* nLastCol */, SCCOL& /* nDefault */ ) +sal_Bool ScDocument::GetRowDefault( SCTAB /* nTab */, SCROW /* nRow */, SCCOL /* nLastCol */, SCCOL& /* nDefault */ ) { - BOOL bRet(FALSE); + sal_Bool bRet(false); return bRet; } @@ -3898,7 +3898,7 @@ void ScDocument::ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, S // Attribute ---------------------------------------------------------- // -const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, USHORT nWhich ) const +const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const { if ( ValidTab(nTab) && pTab[nTab] ) { @@ -4032,7 +4032,7 @@ void ScDocument::ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkDat void ScDocument::ApplySelectionLineStyle( const ScMarkData& rMark, - const SvxBorderLine* pLine, BOOL bColorOnly ) + const SvxBorderLine* pLine, sal_Bool bColorOnly ) { if ( bColorOnly && !pLine ) return; @@ -4055,8 +4055,8 @@ const ScStyleSheet* ScDocument::GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) c const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) const { - BOOL bEqual = TRUE; - BOOL bFound; + sal_Bool bEqual = sal_True; + sal_Bool bFound; const ScStyleSheet* pStyle = NULL; const ScStyleSheet* pNewStyle; @@ -4069,7 +4069,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con if (bFound) { if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = false; // unterschiedliche pStyle = pNewStyle; } } @@ -4086,7 +4086,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con if (bFound) { if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = false; // unterschiedliche pStyle = pNewStyle; } } @@ -4096,7 +4096,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con } -void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRemoved, +void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, sal_Bool bRemoved, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY ) @@ -4114,7 +4114,7 @@ void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL b } -BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const +sal_Bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const { if ( bStyleSheetUsageInvalid || rStyle.GetUsage() == ScStyleSheet::UNKNOWN ) { @@ -4131,7 +4131,7 @@ BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllSt } } - BOOL bIsUsed = FALSE; + sal_Bool bIsUsed = false; for ( SCTAB i=0; i<=MAXTAB; i++ ) { @@ -4140,14 +4140,14 @@ BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllSt if ( pTab[i]->IsStyleSheetUsed( rStyle, bGatherAllStyles ) ) { if ( !bGatherAllStyles ) - return TRUE; - bIsUsed = TRUE; + return sal_True; + bIsUsed = sal_True; } } } if ( bGatherAllStyles ) - bStyleSheetUsageInvalid = FALSE; + bStyleSheetUsageInvalid = false; return bIsUsed; } @@ -4156,32 +4156,32 @@ BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllSt } -BOOL ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow, - SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, INT16 nFlags ) +sal_Bool ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, sal_Int16 nFlags ) { if (VALIDTAB(nTab)) if (pTab[nTab]) return pTab[nTab]->ApplyFlags( nStartCol, nStartRow, nEndCol, nEndRow, nFlags ); OSL_FAIL("ApplyFlags: falsche Tabelle"); - return FALSE; + return false; } -BOOL ScDocument::RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow, - SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, INT16 nFlags ) +sal_Bool ScDocument::RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, sal_Int16 nFlags ) { if (VALIDTAB(nTab)) if (pTab[nTab]) return pTab[nTab]->RemoveFlags( nStartCol, nStartRow, nEndCol, nEndRow, nFlags ); OSL_FAIL("RemoveFlags: falsche Tabelle"); - return FALSE; + return false; } void ScDocument::SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr, - BOOL bPutToPool ) + sal_Bool bPutToPool ) { if (VALIDTAB(nTab)) if (pTab[nTab]) @@ -4190,7 +4190,7 @@ void ScDocument::SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPattern void ScDocument::SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, - BOOL bPutToPool ) + sal_Bool bPutToPool ) { SCTAB nTab = rPos.Tab(); if (pTab[nTab]) @@ -4198,7 +4198,7 @@ void ScDocument::SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, } -ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, BOOL bDeep ) +ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, sal_Bool bDeep ) { ScMergePatternState aState; @@ -4227,7 +4227,7 @@ ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, BOOL } -const ScPatternAttr* ScDocument::GetSelectionPattern( const ScMarkData& rMark, BOOL bDeep ) +const ScPatternAttr* ScDocument::GetSelectionPattern( const ScMarkData& rMark, sal_Bool bDeep ) { delete pSelectionAttr; pSelectionAttr = CreateSelectionPattern( rMark, bDeep ); @@ -4247,9 +4247,9 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark, rLineInner.SetLine(NULL, BOXINFO_LINE_HORI); rLineInner.SetLine(NULL, BOXINFO_LINE_VERT); - rLineInner.SetTable(TRUE); - rLineInner.SetDist(TRUE); - rLineInner.SetMinDist(FALSE); + rLineInner.SetTable(sal_True); + rLineInner.SetDist(sal_True); + rLineInner.SetMinDist(false); ScLineFlags aFlags; @@ -4278,7 +4278,7 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark, bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, USHORT nMask ) + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask ) { if ( nMask & HASATTR_ROTATE ) { @@ -4287,19 +4287,19 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - BOOL bAnyItem = FALSE; - USHORT nRotCount = pPool->GetItemCount( ATTR_ROTATE_VALUE ); - for (USHORT nItem=0; nItem<nRotCount; nItem++) + sal_Bool bAnyItem = false; + sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++) { - const SfxPoolItem* pItem = pPool->GetItem( ATTR_ROTATE_VALUE, nItem ); + const SfxPoolItem* pItem = pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ); if ( pItem ) { // 90 or 270 degrees is former SvxOrientationItem - only look for other values // (see ScPatternAttr::GetCellOrientation) - INT32 nAngle = static_cast<const SfxInt32Item*>(pItem)->GetValue(); + sal_Int32 nAngle = static_cast<const SfxInt32Item*>(pItem)->GetValue(); if ( nAngle != 0 && nAngle != 9000 && nAngle != 27000 ) { - bAnyItem = TRUE; + bAnyItem = sal_True; break; } } @@ -4315,14 +4315,14 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - BOOL bHasRtl = FALSE; - USHORT nDirCount = pPool->GetItemCount( ATTR_WRITINGDIR ); - for (USHORT nItem=0; nItem<nDirCount; nItem++) + sal_Bool bHasRtl = false; + sal_uInt32 nDirCount = pPool->GetItemCount2( ATTR_WRITINGDIR ); + for (sal_uInt32 nItem=0; nItem<nDirCount; nItem++) { - const SfxPoolItem* pItem = pPool->GetItem( ATTR_WRITINGDIR, nItem ); + const SfxPoolItem* pItem = pPool->GetItem2( ATTR_WRITINGDIR, nItem ); if ( pItem && ((const SvxFrameDirectionItem*)pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP ) { - bHasRtl = TRUE; + bHasRtl = sal_True; break; } } @@ -4345,7 +4345,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, if ( nMask & HASATTR_RIGHTORCENTER ) { // On a RTL sheet, don't start to look for the default left value - // (which is then logically right), instead always assume TRUE. + // (which is then logically right), instead always assume sal_True. // That way, ScAttrArray::HasAttrib doesn't have to handle RTL sheets. if ( IsLayoutRTL(i) ) @@ -4359,7 +4359,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, return bFound; } -bool ScDocument::HasAttrib( const ScRange& rRange, USHORT nMask ) +bool ScDocument::HasAttrib( const ScRange& rRange, sal_uInt16 nMask ) { return HasAttrib( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(), rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), @@ -4430,7 +4430,7 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, *ppBottom = pBottomLine; } -BOOL ScDocument::IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes ) const { if (VALIDTAB(nTab)) @@ -4438,7 +4438,7 @@ BOOL ScDocument::IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, return pTab[nTab]->IsBlockEmpty( nStartCol, nStartRow, nEndCol, nEndRow, bIgnoreNotes ); OSL_FAIL("Falsche Tabellennummer"); - return FALSE; + return false; } @@ -4464,16 +4464,16 @@ void ScDocument::UnlockTable(SCTAB nTab) } -BOOL ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - BOOL* pOnlyNotBecauseOfMatrix /* = NULL */ ) const + sal_Bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const { // import into read-only document is possible if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() ) { if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; - return FALSE; + *pOnlyNotBecauseOfMatrix = false; + return false; } if (VALIDTAB(nTab)) @@ -4483,27 +4483,27 @@ BOOL ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, OSL_FAIL("Falsche Tabellennummer"); if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; - return FALSE; + *pOnlyNotBecauseOfMatrix = false; + return false; } -BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark, - BOOL* pOnlyNotBecauseOfMatrix /* = NULL */ ) const +sal_Bool ScDocument::IsSelectionEditable( const ScMarkData& rMark, + sal_Bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const { // import into read-only document is possible if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() ) { if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; - return FALSE; + *pOnlyNotBecauseOfMatrix = false; + return false; } ScRange aRange; rMark.GetMarkArea(aRange); - BOOL bOk = TRUE; - BOOL bMatrix = ( pOnlyNotBecauseOfMatrix != NULL ); + sal_Bool bOk = sal_True; + sal_Bool bMatrix = ( pOnlyNotBecauseOfMatrix != NULL ); for ( SCTAB i=0; i<=MAXTAB && (bOk || bMatrix); i++ ) { if ( pTab[i] && rMark.GetTableSelect(i) ) @@ -4514,7 +4514,7 @@ BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark, aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), pOnlyNotBecauseOfMatrix ) ) { - bOk = FALSE; + bOk = false; if ( pOnlyNotBecauseOfMatrix ) bMatrix = *pOnlyNotBecauseOfMatrix; } @@ -4523,7 +4523,7 @@ BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark, { if ( !pTab[i]->IsSelectionEditable( rMark, pOnlyNotBecauseOfMatrix ) ) { - bOk = FALSE; + bOk = false; if ( pOnlyNotBecauseOfMatrix ) bMatrix = *pOnlyNotBecauseOfMatrix; } @@ -4538,35 +4538,35 @@ BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark, } -BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) const { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; for (SCTAB i=0; i<=MAXTAB && bOk; i++) if (pTab[i]) if (rMark.GetTableSelect(i)) if (pTab[i]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow )) - bOk = FALSE; + bOk = false; return !bOk; } -BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const +sal_Bool ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const { - BOOL bOk = TRUE; + sal_Bool bOk = true; if ( pTab[nTab] && pTab[nTab]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ) ) { - bOk = FALSE; + bOk = false; } return !bOk; } -BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ) +sal_Bool ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ) { // if rCell is part of a matrix formula, return its complete range - BOOL bRet = FALSE; + sal_Bool bRet = false; ScBaseCell* pCell = GetCell( rCellPos ); if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA) { @@ -4598,7 +4598,7 @@ BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMat rMatrix.aStart = aOrigin; rMatrix.aEnd = aEnd; - bRet = TRUE; + bRet = sal_True; } } } @@ -4607,10 +4607,10 @@ BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMat } -BOOL ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, +sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; if ( ValidColRow(rStartCol,rStartRow) && ValidColRow(nEndCol,nEndRow) && ValidTab(nTab) ) { if (pTab[nTab]) @@ -4662,13 +4662,13 @@ BOOL ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, } -BOOL ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - const ScMarkData& rMark, BOOL bRefresh, BOOL bAttrs ) + const ScMarkData& rMark, sal_Bool bRefresh, sal_Bool bAttrs ) { // use all selected sheets from rMark - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nOldEndCol = rEndCol; SCROW nOldEndRow = rEndRow; @@ -4678,7 +4678,7 @@ BOOL ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, SCCOL nThisEndCol = nOldEndCol; SCROW nThisEndRow = nOldEndRow; if ( ExtendMerge( nStartCol, nStartRow, nThisEndCol, nThisEndRow, nTab, bRefresh, bAttrs ) ) - bFound = TRUE; + bFound = sal_True; if ( nThisEndCol > rEndCol ) rEndCol = nThisEndCol; if ( nThisEndRow > rEndRow ) @@ -4689,11 +4689,11 @@ BOOL ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, } -BOOL ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - SCTAB nTab, BOOL bRefresh, BOOL bAttrs ) + SCTAB nTab, sal_Bool bRefresh, sal_Bool bAttrs ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; if ( ValidColRow(nStartCol,nStartRow) && ValidColRow(rEndCol,rEndRow) && ValidTab(nTab) ) { if (pTab[nTab]) @@ -4711,9 +4711,9 @@ BOOL ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, } -BOOL ScDocument::ExtendMerge( ScRange& rRange, BOOL bRefresh, BOOL bAttrs ) +sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool bAttrs ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCTAB nStartTab = rRange.aStart.Tab(); SCTAB nEndTab = rRange.aEnd.Tab(); SCCOL nEndCol = rRange.aEnd.Col(); @@ -4728,7 +4728,7 @@ BOOL ScDocument::ExtendMerge( ScRange& rRange, BOOL bRefresh, BOOL bAttrs ) nExtendCol, nExtendRow, nTab, bRefresh, bAttrs ) ) { - bFound = TRUE; + bFound = sal_True; if (nExtendCol > nEndCol) nEndCol = nExtendCol; if (nExtendRow > nEndRow) nEndRow = nExtendRow; } @@ -4740,12 +4740,12 @@ BOOL ScDocument::ExtendMerge( ScRange& rRange, BOOL bRefresh, BOOL bAttrs ) return bFound; } -BOOL ScDocument::ExtendTotalMerge( ScRange& rRange ) +sal_Bool ScDocument::ExtendTotalMerge( ScRange& rRange ) { // Bereich genau dann auf zusammengefasste Zellen erweitern, wenn // dadurch keine neuen nicht-ueberdeckten Zellen getroffen werden - BOOL bRet = FALSE; + sal_Bool bRet = false; ScRange aExt = rRange; if (ExtendMerge(aExt)) { @@ -4770,9 +4770,9 @@ BOOL ScDocument::ExtendTotalMerge( ScRange& rRange ) return bRet; } -BOOL ScDocument::ExtendOverlapped( ScRange& rRange ) +sal_Bool ScDocument::ExtendOverlapped( ScRange& rRange ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCTAB nStartTab = rRange.aStart.Tab(); SCTAB nEndTab = rRange.aEnd.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -4788,12 +4788,12 @@ BOOL ScDocument::ExtendOverlapped( ScRange& rRange ) if (nExtendCol < nStartCol) { nStartCol = nExtendCol; - bFound = TRUE; + bFound = sal_True; } if (nExtendRow < nStartRow) { nStartRow = nExtendRow; - bFound = TRUE; + bFound = sal_True; } } @@ -4803,11 +4803,11 @@ BOOL ScDocument::ExtendOverlapped( ScRange& rRange ) return bFound; } -BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) { - USHORT nCount = pDBCollection->GetCount(); - USHORT i; + sal_uInt16 nCount = pDBCollection->GetCount(); + sal_uInt16 i; ScDBData* pData; SCTAB nDBTab; SCCOL nDBStartCol; @@ -4817,7 +4817,7 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, // Autofilter loeschen - BOOL bChange = RemoveFlagsTab( nStartCol,nStartRow, nEndCol,nEndRow, nTab, SC_MF_AUTO ); + sal_Bool bChange = RemoveFlagsTab( nStartCol,nStartRow, nEndCol,nEndRow, nTab, SC_MF_AUTO ); // Autofilter setzen @@ -4832,7 +4832,7 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, { if (ApplyFlagsTab( nDBStartCol,nDBStartRow, nDBEndCol,nDBStartRow, nDBTab, SC_MF_AUTO )) - bChange = TRUE; + bChange = sal_True; } } } @@ -4847,7 +4847,7 @@ void ScDocument::SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const --rRow; } -BOOL ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +sal_Bool ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { const ScMergeFlagAttr* pAttr = (const ScMergeFlagAttr*) GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ); @@ -4856,12 +4856,12 @@ BOOL ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const else { OSL_FAIL("Overlapped: Attr==0"); - return FALSE; + return false; } } -BOOL ScDocument::IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const +sal_Bool ScDocument::IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { const ScMergeFlagAttr* pAttr = (const ScMergeFlagAttr*) GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ); @@ -4870,7 +4870,7 @@ BOOL ScDocument::IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const else { OSL_FAIL("Overlapped: Attr==0"); - return FALSE; + return false; } } @@ -4880,7 +4880,7 @@ void ScDocument::ApplySelectionFrame( const ScMarkData& rMark, const SvxBoxInfoItem* pLineInner ) { ScRangeList aRangeList; - rMark.FillRangeListWithMarks( &aRangeList, FALSE ); + rMark.FillRangeListWithMarks( &aRangeList, false ); size_t nRangeCount = aRangeList.size(); for (SCTAB i=0; i<=MAXTAB; i++) { @@ -4915,11 +4915,11 @@ void ScDocument::ApplyFrameAreaTab( const ScRange& rRange, void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark, ScEditDataArray* pDataArray ) { const SfxItemSet* pSet = &rAttr.GetItemSet(); - BOOL bSet = FALSE; - USHORT i; + sal_Bool bSet = false; + sal_uInt16 i; for (i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END && !bSet; i++) if (pSet->GetItemState(i) == SFX_ITEM_SET) - bSet = TRUE; + bSet = sal_True; if (bSet) { @@ -4943,7 +4943,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark } -void ScDocument::ChangeSelectionIndent( BOOL bIncrement, const ScMarkData& rMark ) +void ScDocument::ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark ) { for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i] && rMark.GetTableSelect(i)) @@ -4951,7 +4951,7 @@ void ScDocument::ChangeSelectionIndent( BOOL bIncrement, const ScMarkData& rMark } -void ScDocument::ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark ) +void ScDocument::ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark ) { for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i] && rMark.GetTableSelect(i)) @@ -4959,7 +4959,7 @@ void ScDocument::ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rM } -void ScDocument::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) +void ScDocument::DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark ) { for (SCTAB i=0; i<=MAXTAB; i++) if (pTab[i] && rMark.GetTableSelect(i)) @@ -4967,7 +4967,7 @@ void ScDocument::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) } -void ScDocument::DeleteSelectionTab( SCTAB nTab, USHORT nDelFlag, const ScMarkData& rMark ) +void ScDocument::DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMarkData& rMark ) { if (ValidTab(nTab) && pTab[nTab]) pTab[nTab]->DeleteSelection( nDelFlag, rMark ); @@ -5023,12 +5023,12 @@ void ScDocument::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY, - BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark ) + sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark ) { DBG_ASSERT( !nMovX || !nMovY, "GetNextPos: nur X oder Y" ); ScMarkData aCopyMark = rMark; - aCopyMark.SetMarking(FALSE); + aCopyMark.SetMarking(false); aCopyMark.MarkToMulti(); if (ValidTab(nTab) && pTab[nTab]) @@ -5046,11 +5046,11 @@ void ScDocument::UpdStlShtPtrsFrmNms() ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - USHORT nCount = pPool->GetItemCount(ATTR_PATTERN); + sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN); ScPatternAttr* pPattern; - for (USHORT i=0; i<nCount; i++) + for (sal_uInt32 i=0; i<nCount; i++) { - pPattern = (ScPatternAttr*)pPool->GetItem(ATTR_PATTERN, i); + pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i); if (pPattern) pPattern->UpdateStyleSheet(); } @@ -5064,11 +5064,11 @@ void ScDocument::StylesToNames() ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - USHORT nCount = pPool->GetItemCount(ATTR_PATTERN); + sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN); ScPatternAttr* pPattern; - for (USHORT i=0; i<nCount; i++) + for (sal_uInt32 i=0; i<nCount; i++) { - pPattern = (ScPatternAttr*)pPool->GetItem(ATTR_PATTERN, i); + pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i); if (pPattern) pPattern->StyleToName(); } @@ -5076,9 +5076,9 @@ void ScDocument::StylesToNames() } -ULONG ScDocument::GetCellCount() const +sal_uLong ScDocument::GetCellCount() const { - ULONG nCellCount = 0L; + sal_uLong nCellCount = 0L; for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ ) if ( pTab[nTab] ) @@ -5095,9 +5095,9 @@ SCSIZE ScDocument::GetCellCount(SCTAB nTab, SCCOL nCol) const return pTab[nTab]->GetCellCount(nCol); } -ULONG ScDocument::GetCodeCount() const +sal_uLong ScDocument::GetCodeCount() const { - ULONG nCodeCount = 0; + sal_uLong nCodeCount = 0; for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ ) if ( pTab[nTab] ) @@ -5170,13 +5170,13 @@ void ScDocument::RemoveManualBreaks( SCTAB nTab ) pTab[nTab]->RemoveManualBreaks(); } -BOOL ScDocument::HasManualBreaks( SCTAB nTab ) const +sal_Bool ScDocument::HasManualBreaks( SCTAB nTab ) const { if ( ValidTab(nTab) && pTab[nTab] ) return pTab[nTab]->HasManualBreaks(); OSL_FAIL("falsche Tab"); - return FALSE; + return false; } @@ -5188,9 +5188,9 @@ void ScDocument::GetDocStat( ScDocStat& rDocStat ) } -BOOL ScDocument::HasPrintRange() +sal_Bool ScDocument::HasPrintRange() { - BOOL bResult = FALSE; + sal_Bool bResult = false; for ( SCTAB i=0; !bResult && i<nMaxTableNumber; i++ ) if ( pTab[i] ) @@ -5200,13 +5200,13 @@ BOOL ScDocument::HasPrintRange() } -BOOL ScDocument::IsPrintEntireSheet( SCTAB nTab ) const +sal_Bool ScDocument::IsPrintEntireSheet( SCTAB nTab ) const { return (ValidTab(nTab) ) && pTab[nTab] && pTab[nTab]->IsPrintEntireSheet(); } -USHORT ScDocument::GetPrintRangeCount( SCTAB nTab ) +sal_uInt16 ScDocument::GetPrintRangeCount( SCTAB nTab ) { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetPrintRangeCount(); @@ -5215,7 +5215,7 @@ USHORT ScDocument::GetPrintRangeCount( SCTAB nTab ) } -const ScRange* ScDocument::GetPrintRange( SCTAB nTab, USHORT nPos ) +const ScRange* ScDocument::GetPrintRange( SCTAB nTab, sal_uInt16 nPos ) { if (ValidTab(nTab) && pTab[nTab]) return pTab[nTab]->GetPrintRange(nPos); @@ -5297,7 +5297,7 @@ void ScDocument::RestorePrintRanges( const ScPrintRangeSaver& rSaver ) } -BOOL ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const +sal_Bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const { // Die Seitennummern-Zaehlung faengt bei einer Tabelle neu an, wenn eine // andere Vorlage als bei der vorherigen gesetzt ist (nur Namen vergleichen) @@ -5312,14 +5312,14 @@ BOOL ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const if ( pStyle ) { const SfxItemSet& rSet = pStyle->GetItemSet(); - USHORT nFirst = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_FIRSTPAGENO)).GetValue(); + sal_uInt16 nFirst = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_FIRSTPAGENO)).GetValue(); if ( nFirst != 0 ) - return TRUE; // Seitennummer in neuer Vorlage angegeben + return sal_True; // Seitennummer in neuer Vorlage angegeben } } } - return FALSE; // sonst nicht + return false; // sonst nicht } SfxUndoManager* ScDocument::GetUndoManager() diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx index 0a238dbc64a6..67b55e7f0155 100644 --- a/sc/source/core/data/dpcachetable.cxx +++ b/sc/source/core/data/dpcachetable.cxx @@ -65,7 +65,7 @@ using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::sheet::DataPilotFieldFilter; -static BOOL lcl_HasQueryEntry( const ScQueryParam& rParam ) +static sal_Bool lcl_HasQueryEntry( const ScQueryParam& rParam ) { return rParam.GetEntryCount() > 0 && rParam.GetEntry(0).bDoQuery; diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index ab65870b506f..03a176c65f2f 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -117,7 +117,7 @@ void ScDPSaveGroupItem::AddToData( ScDPGroupDimension& rDataDim, SvNumberFormatt sal_uInt32 nFormat = 0; //! ... double fValue; if ( pFormatter->IsNumberFormat( *aIter, nFormat, fValue ) ) - aData = ScDPItemData( *aIter, fValue, TRUE ); + aData = ScDPItemData( *aIter, fValue, sal_True ); else aData.SetString( *aIter ); @@ -258,7 +258,7 @@ bool ScDPSaveGroupDimension::HasOnlyHidden( const ScStrCollection& rVisible ) for ( ScDPSaveGroupItemVec::const_iterator aIter(aGroups.begin()); aIter != aGroups.end() && bAllHidden; aIter++ ) { StrData aSearch( aIter->GetGroupName() ); - USHORT nCollIndex; + sal_uInt16 nCollIndex; if ( rVisible.Search( &aSearch, nCollIndex ) ) bAllHidden = false; // found one that is visible } diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index e7fc20fc9d60..ab2094707a86 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -71,7 +71,7 @@ using ::boost::shared_ptr; #define D_TIMEFACTOR 86400.0 -const USHORT SC_DP_LEAPYEAR = 1648; // arbitrary leap year for date calculations +const sal_uInt16 SC_DP_LEAPYEAR = 1648; // arbitrary leap year for date calculations // part values for the extra "<" and ">" entries (same for all parts) const sal_Int32 SC_DP_DATE_FIRST = -1; @@ -80,10 +80,10 @@ const sal_Int32 SC_DP_DATE_LAST = 10000; // ============================================================================ namespace { - BOOL lcl_Search( SCCOL nSourceDim, const ScDPCache* pCache , const std::vector< SCROW >& vIdx, SCROW nNew , SCROW& rIndex) + sal_Bool lcl_Search( SCCOL nSourceDim, const ScDPCache* pCache , const std::vector< SCROW >& vIdx, SCROW nNew , SCROW& rIndex) { rIndex = vIdx.size(); - BOOL bFound = FALSE; + sal_Bool bFound = false; SCROW nLo = 0; SCROW nHi = vIdx.size() - 1; SCROW nIndex; @@ -103,7 +103,7 @@ namespace nHi = nIndex - 1; if (nCompare == 0) { - bFound = TRUE; + bFound = sal_True; nLo = nIndex; } } @@ -144,7 +144,7 @@ namespace template<bool bUpdateData> void lcl_InsertValue ( SCCOL nSourceDim, const ScDPCache* pCache, std::vector< SCROW >& vIdx, const String& rString, const double& fValue ) { - lcl_InsertValue<bUpdateData>( nSourceDim, pCache, vIdx, ScDPItemData( rString, fValue, TRUE ) ); + lcl_InsertValue<bUpdateData>( nSourceDim, pCache, vIdx, ScDPItemData( rString, fValue, sal_True ) ); } template<bool bUpdateData> @@ -155,7 +155,7 @@ namespace void lcl_AppendDateStr( rtl::OUStringBuffer& rBuffer, double fValue, SvNumberFormatter* pFormatter ) { - ULONG nFormat = pFormatter->GetStandardFormat( NUMBERFORMAT_DATE, ScGlobal::eLnge ); + sal_uLong nFormat = pFormatter->GetStandardFormat( NUMBERFORMAT_DATE, ScGlobal::eLnge ); String aString; pFormatter->GetInputLineString( fValue, nFormat, aString ); rBuffer.append( aString ); @@ -442,7 +442,7 @@ String lcl_GetDateGroupName( sal_Int32 nDatePart, sal_Int32 nValue, SvNumberForm Date aNullDate = *(pFormatter->GetNullDate()); long nDays = aDate - aNullDate; - ULONG nFormat = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMM, ScGlobal::eLnge ); + sal_uLong nFormat = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMM, ScGlobal::eLnge ); Color* pColor; pFormatter->GetOutputString( nDays, nFormat, aRet, &pColor ); } @@ -534,7 +534,7 @@ sal_Int32 lcl_GetDatePartValue( double fValue, sal_Int32 nDatePart, SvNumberForm return nResult; } -BOOL lcl_DateContained( sal_Int32 nGroupPart, const ScDPItemData& rGroupData, +sal_Bool lcl_DateContained( sal_Int32 nGroupPart, const ScDPItemData& rGroupData, sal_Int32 nBasePart, const ScDPItemData& rBaseData ) { if ( !rGroupData.IsValue() || !rBaseData.IsValue() ) @@ -561,7 +561,7 @@ BOOL lcl_DateContained( sal_Int32 nGroupPart, const ScDPItemData& rGroupData, return ( nGroupValue == nBaseValue ); } - BOOL bContained = TRUE; + sal_Bool bContained = sal_True; switch ( nBasePart ) // inner part { case com::sun::star::sheet::DataPilotFieldGroupBy::MONTHS: @@ -1130,13 +1130,13 @@ String ScDPGroupTableData::getDimensionName(long nColumn) return pSourceData->getDimensionName( nColumn ); } -BOOL ScDPGroupTableData::getIsDataLayoutDimension(long nColumn) +sal_Bool ScDPGroupTableData::getIsDataLayoutDimension(long nColumn) { // position of data layout dimension is moved from source data return ( nColumn == sal::static_int_cast<long>( nSourceCount + aGroups.size() ) ); // data layout dimension? } -BOOL ScDPGroupTableData::IsDateDimension(long nDim) +sal_Bool ScDPGroupTableData::IsDateDimension(long nDim) { if ( nDim >= nSourceCount ) { @@ -1149,7 +1149,7 @@ BOOL ScDPGroupTableData::IsDateDimension(long nDim) return pSourceData->IsDateDimension( nDim ); } -ULONG ScDPGroupTableData::GetNumberFormat(long nDim) +sal_uLong ScDPGroupTableData::GetNumberFormat(long nDim) { if ( nDim >= nSourceCount ) { @@ -1173,7 +1173,7 @@ void ScDPGroupTableData::DisposeData() pSourceData->DisposeData(); } -void ScDPGroupTableData::SetEmptyFlags( BOOL bIgnoreEmptyRows, BOOL bRepeatIfEmpty ) +void ScDPGroupTableData::SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty ) { pSourceData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); } @@ -1372,7 +1372,7 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt double fGroupValue; String aGroupName = lcl_GetNumGroupForValue( pData->GetValue(), aNumInfo, bHasNonInteger, cDecSeparator, fGroupValue, pDoc ); - ScDPItemData aItemData ( aGroupName, fGroupValue, TRUE ) ; + ScDPItemData aItemData ( aGroupName, fGroupValue, sal_True ) ; pItemDataIndex[nDim] = pCache->GetAdditionalItemID( aItemData ); } // else (textual) keep original value @@ -1394,16 +1394,16 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt } } -BOOL ScDPGroupTableData::IsBaseForGroup(long nDim) const +sal_Bool ScDPGroupTableData::IsBaseForGroup(long nDim) const { for ( ScDPGroupDimensionVec::const_iterator aIter(aGroups.begin()); aIter != aGroups.end(); aIter++ ) { const ScDPGroupDimension& rDim = *aIter; if ( rDim.GetSourceDim() == nDim ) - return TRUE; + return sal_True; } - return FALSE; + return false; } long ScDPGroupTableData::GetGroupBase(long nGroupDim) const @@ -1418,7 +1418,7 @@ long ScDPGroupTableData::GetGroupBase(long nGroupDim) const return -1; // none } -BOOL ScDPGroupTableData::IsNumOrDateGroup(long nDimension) const +sal_Bool ScDPGroupTableData::IsNumOrDateGroup(long nDimension) const { // Virtual method from ScDPTableData, used in result data to force text labels. @@ -1435,10 +1435,10 @@ BOOL ScDPGroupTableData::IsNumOrDateGroup(long nDimension) const return ( rDim.GetDateHelper() != NULL ); } - return FALSE; + return false; } -BOOL ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, +sal_Bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, const ScDPItemData& rBaseData, long nBaseIndex ) const { for ( ScDPGroupDimensionVec::const_iterator aIter(aGroups.begin()); aIter != aGroups.end(); aIter++ ) @@ -1462,7 +1462,7 @@ BOOL ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGroupI if ( !pBaseDateHelper ) { OSL_FAIL( "mix of date and non-date groups" ); - return TRUE; + return true; } sal_Int32 nGroupPart = pGroupDateHelper->GetDatePart(); @@ -1482,10 +1482,10 @@ BOOL ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGroupI } OSL_FAIL("IsInGroup: no group dimension found"); - return TRUE; + return true; } -BOOL ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, +sal_Bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const { const ScDPGroupDimension* pFirstDim = NULL; @@ -1508,7 +1508,7 @@ BOOL ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long if ( !pFirstDateHelper || !pSecondDateHelper ) { OSL_FAIL( "mix of date and non-date groups" ); - return TRUE; + return true; } sal_Int32 nFirstPart = pFirstDateHelper->GetDatePart(); @@ -1520,7 +1520,7 @@ BOOL ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long const ScDPGroupItem* pSecondItem = pSecondDim->GetGroupForName( rSecondData ); if ( pFirstItem && pSecondItem ) { - // two existing groups -> TRUE if they have a common element + // two existing groups -> sal_True if they have a common element return pFirstItem->HasCommonElement( *pSecondItem ); } else if ( pFirstItem ) @@ -1535,13 +1535,13 @@ BOOL ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long } else { - // no groups -> TRUE if equal + // no groups -> sal_True if equal return rFirstData.IsCaseInsEqual( rSecondData ); } } OSL_FAIL("HasCommonElement: no group dimension found"); - return TRUE; + return true; } long ScDPGroupTableData::GetSourceDim( long nDim ) diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 97cbcb439227..7de3d9884e4e 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -128,7 +128,7 @@ using ::rtl::OUString; // ----------------------------------------------------------------------- -USHORT lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { long nRet = sheet::DataPilotFieldOrientation_HIDDEN; if ( xSource.is() ) @@ -136,7 +136,7 @@ USHORT lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplie uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName ); long nIntCount = xIntDims->getCount(); - BOOL bFound = FALSE; + sal_Bool bFound = false; for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++) { uno::Reference<uno::XInterface> xIntDim = @@ -154,7 +154,7 @@ USHORT lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplie } } } - return static_cast< USHORT >( nRet ); + return static_cast< sal_uInt16 >( nRet ); } // ----------------------------------------------------------------------- @@ -167,10 +167,10 @@ ScDPObject::ScDPObject( ScDocument* pD ) : pServDesc( NULL ), mpTableData(static_cast<ScDPTableData*>(NULL)), pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), + bSettingsChanged( false ), + bAlive( false ), mnAutoFormatIndex( 65535 ), - bAllowMove( FALSE ), + bAllowMove( false ), nHeaderRows( 0 ), mbHeaderLayout(false) { @@ -187,10 +187,10 @@ ScDPObject::ScDPObject(const ScDPObject& r) : pServDesc( NULL ), mpTableData(static_cast<ScDPTableData*>(NULL)), pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), + bSettingsChanged( false ), + bAlive( false ), mnAutoFormatIndex( r.mnAutoFormatIndex ), - bAllowMove( FALSE ), + bAllowMove( false ), nHeaderRows( r.nHeaderRows ), mbHeaderLayout( r.mbHeaderLayout ) { @@ -215,12 +215,12 @@ ScDPObject::~ScDPObject() ClearSource(); } -void ScDPObject::SetAlive(BOOL bSet) +void ScDPObject::SetAlive(sal_Bool bSet) { bAlive = bSet; } -void ScDPObject::SetAllowMove(BOOL bSet) +void ScDPObject::SetAllowMove(sal_Bool bSet) { bAllowMove = bSet; } @@ -327,7 +327,7 @@ void ScDPObject::WriteTempDataTo( ScDPObject& rDest ) const rDest.nHeaderRows = nHeaderRows; } -BOOL ScDPObject::IsSheetData() const +sal_Bool ScDPObject::IsSheetData() const { return ( pSheetDesc != NULL ); } @@ -369,7 +369,7 @@ void ScDPObject::CreateOutput() CreateObjects(); if (!pOutput) { - BOOL bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton(); + sal_Bool bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton(); pOutput = new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton ); pOutput->SetHeaderLayout ( mbHeaderLayout ); @@ -394,7 +394,7 @@ void ScDPObject::CreateOutput() //! modify aOutRange? - bAllowMove = FALSE; // use only once + bAllowMove = false; // use only once } } } @@ -484,12 +484,12 @@ void ScDPObject::CreateObjects() if (pSaveData) pSaveData->WriteToSource( xSource ); } - bSettingsChanged = FALSE; + bSettingsChanged = false; } void ScDPObject::InvalidateData() { - bSettingsChanged = TRUE; + bSettingsChanged = sal_True; } void ScDPObject::ClearSource() @@ -557,7 +557,7 @@ const ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType ) return pOutput->GetOutputRange(nType); } -BOOL lcl_HasButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) +sal_Bool lcl_HasButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { return ((const ScMergeFlagAttr*)pDoc->GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->HasButton(); } @@ -582,7 +582,7 @@ void ScDPObject::RefreshAfterLoad() pDoc->IsBlockEmpty( nTab, nFirstCol, nFirstRow + nInitial, nFirstCol, nFirstRow + nInitial ) && aOutRange.aEnd.Col() > nFirstCol ) { - BOOL bFilterButton = IsSheetData(); // when available, filter button setting must be checked here + sal_Bool bFilterButton = IsSheetData(); // when available, filter button setting must be checked here SCROW nSkip = bFilterButton ? 1 : 0; for (SCROW nPos=nSkip; nPos<nInitial; nPos++) @@ -716,23 +716,23 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, } } -BOOL ScDPObject::RefsEqual( const ScDPObject& r ) const +sal_Bool ScDPObject::RefsEqual( const ScDPObject& r ) const { if ( aOutRange != r.aOutRange ) - return FALSE; + return false; if ( pSheetDesc && r.pSheetDesc ) { if ( pSheetDesc->GetSourceRange() != r.pSheetDesc->GetSourceRange() ) - return FALSE; + return false; } else if ( pSheetDesc || r.pSheetDesc ) { OSL_FAIL("RefsEqual: SheetDesc set at only one object"); - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScDPObject::WriteRefsTo( ScDPObject& r ) const @@ -806,9 +806,9 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const return false; } -String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags ) +String ScDPObject::GetDimName( long nDim, sal_Bool& rIsDataLayout, sal_Int32* pFlags ) { - rIsDataLayout = FALSE; + rIsDataLayout = false; String aRet; if ( xSource.is() ) @@ -824,7 +824,7 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags uno::Reference<beans::XPropertySet> xDimProp( xIntDim, uno::UNO_QUERY ); if ( xDimName.is() && xDimProp.is() ) { - BOOL bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, + sal_Bool bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ); //! error checking -- is "IsDataLayoutDimension" property required?? @@ -837,7 +837,7 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags { } if ( bData ) - rIsDataLayout = TRUE; + rIsDataLayout = sal_True; else aRet = String( aName ); @@ -851,9 +851,9 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags return aRet; } -BOOL ScDPObject::IsDuplicated( long nDim ) +sal_Bool ScDPObject::IsDuplicated( long nDim ) { - BOOL bDuplicated = FALSE; + sal_Bool bDuplicated = false; if ( xSource.is() ) { uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); @@ -872,7 +872,7 @@ BOOL ScDPObject::IsDuplicated( long nDim ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIGINAL)) ); uno::Reference<uno::XInterface> xIntOrig; if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() ) - bDuplicated = TRUE; + bDuplicated = sal_True; } catch(uno::Exception&) { @@ -1011,8 +1011,8 @@ void ScDPObject::GetHeaderPositionData(const ScAddress& rPos, DataPilotTableHead aPosData.PositionData >>= rData; } -// Returns TRUE on success and stores the result in rTarget -BOOL ScDPObject::GetPivotData( ScDPGetPivotDataField& rTarget, +// Returns sal_True on success and stores the result in rTarget +sal_Bool ScDPObject::GetPivotData( ScDPGetPivotDataField& rTarget, const std::vector< ScDPGetPivotDataField >& rFilters ) { CreateOutput(); // create xSource and pOutput if not already done @@ -1020,22 +1020,22 @@ BOOL ScDPObject::GetPivotData( ScDPGetPivotDataField& rTarget, return pOutput->GetPivotData( rTarget, rFilters ); } -BOOL ScDPObject::IsFilterButton( const ScAddress& rPos ) +sal_Bool ScDPObject::IsFilterButton( const ScAddress& rPos ) { CreateOutput(); // create xSource and pOutput if not already done return pOutput->IsFilterButton( rPos ); } -long ScDPObject::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) +long ScDPObject::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) { CreateOutput(); // create xSource and pOutput if not already done return pOutput->GetHeaderDim( rPos, rOrient ); } -BOOL ScDPObject::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMouseTop, long nDragDim, - Rectangle& rPosRect, USHORT& rOrient, long& rDimPos ) +sal_Bool ScDPObject::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft, sal_Bool bMouseTop, long nDragDim, + Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ) { CreateOutput(); // create xSource and pOutput if not already done @@ -1271,7 +1271,7 @@ bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32& rMatc return false; } -BOOL ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, +sal_Bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, std::vector< ScDPGetPivotDataField >& rFilters, const String& rFilterList ) { @@ -1297,7 +1297,7 @@ BOOL ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, uno::Reference<container::XNamed> xDim( xIntDim, uno::UNO_QUERY ); uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY ); uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDim, uno::UNO_QUERY ); - BOOL bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, + sal_Bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ); sal_Int32 nOrient = ScUnoHelpFunctions::GetEnumProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)), @@ -1507,7 +1507,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb String aDimName = xDim->getName(); uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY ); - BOOL bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, + sal_Bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ); if (bDataLayout) { @@ -1553,8 +1553,8 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb if ( xMbrSupp.is() ) xMembers = xMbrSupp->getMembers(); - BOOL bFound = FALSE; - BOOL bShowDetails = TRUE; + sal_Bool bFound = false; + sal_Bool bShowDetails = sal_True; if ( xMembers.is() ) { @@ -1568,7 +1568,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb bShowDetails = ScUnoHelpFunctions::GetBoolProperty( xMbrProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWDETAILS)) ); //! don't set bFound if property is unknown? - bFound = TRUE; + bFound = sal_True; } } } @@ -1608,7 +1608,7 @@ long lcl_FindName( const rtl::OUString& rString, const uno::Reference<container: return -1; // not found } -USHORT lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask +sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask { uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDimProp, uno::UNO_QUERY ); if ( xDimProp.is() && xDimSupp.is() ) @@ -1642,7 +1642,7 @@ USHORT lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) uno::Sequence<sheet::GeneralFunction> aSeq; if ( aSubAny >>= aSeq ) { - USHORT nMask = 0; + sal_uInt16 nMask = 0; const sheet::GeneralFunction* pArray = aSeq.getConstArray(); long nCount = aSeq.getLength(); for (long i=0; i<nCount; i++) @@ -1657,13 +1657,13 @@ USHORT lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) return 0; } -USHORT lcl_CountBits( USHORT nBits ) +sal_uInt16 lcl_CountBits( sal_uInt16 nBits ) { if (!nBits) return 0; - USHORT nCount = 0; - USHORT nMask = 1; - for (USHORT i=0; i<16; i++) + sal_uInt16 nCount = 0; + sal_uInt16 nMask = 1; + for (sal_uInt16 i=0; i<16; i++) { if ( nBits & nMask ) ++nCount; @@ -1675,7 +1675,7 @@ USHORT lcl_CountBits( USHORT nBits ) void lcl_FillOldFields( vector<PivotField>& rFields, const uno::Reference<sheet::XDimensionsSupplier>& xSource, - USHORT nOrient, SCCOL nColAdd, bool bAddData ) + sal_uInt16 nOrient, SCCOL nColAdd, bool bAddData ) { vector<PivotField> aFields; @@ -1708,7 +1708,7 @@ void lcl_FillOldFields( // Let's take this dimension. // function mask. - USHORT nMask = 0; + sal_uInt16 nMask = 0; if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) { sheet::GeneralFunction eFunc = (sheet::GeneralFunction)ScUnoHelpFunctions::GetEnumProperty( @@ -1832,7 +1832,7 @@ void lcl_FillOldFields( rFields.swap(aFields); } -BOOL ScDPObject::FillOldParam(ScPivotParam& rParam, BOOL bForFile) const +sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const { ((ScDPObject*)this)->CreateObjects(); // xSource is needed for field numbers @@ -1866,9 +1866,9 @@ BOOL ScDPObject::FillOldParam(ScPivotParam& rParam, BOOL bForFile) const try { rParam.bMakeTotalCol = ScUnoHelpFunctions::GetBoolProperty( xProp, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), TRUE ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), true ); rParam.bMakeTotalRow = ScUnoHelpFunctions::GetBoolProperty( xProp, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), TRUE ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), true ); // following properties may be missing for external sources rParam.bIgnoreEmptyRows = ScUnoHelpFunctions::GetBoolProperty( xProp, @@ -1881,7 +1881,7 @@ BOOL ScDPObject::FillOldParam(ScPivotParam& rParam, BOOL bForFile) const // no error } } - return TRUE; + return sal_True; } void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) @@ -1928,7 +1928,7 @@ void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XProp } } -BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) +sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam) { rParam.maLabelArray.clear(); @@ -1940,7 +1940,7 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) if ( nDimCount > MAX_LABELS ) nDimCount = MAX_LABELS; if (!nDimCount) - return FALSE; + return false; for (long nDim=0; nDim < nDimCount; nDim++) { @@ -1952,8 +1952,8 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) if ( xDimName.is() && xDimProp.is() ) { - BOOL bDuplicated = FALSE; - BOOL bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, + sal_Bool bDuplicated = false; + sal_Bool bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ); //! error checking -- is "IsDataLayoutDimension" property required?? @@ -1965,7 +1965,7 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIGINAL)) ); uno::Reference<uno::XInterface> xIntOrig; if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() ) - bDuplicated = TRUE; + bDuplicated = sal_True; } catch(uno::Exception&) { @@ -1991,12 +1991,12 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) } } - return TRUE; + return sal_True; } -BOOL ScDPObject::GetHierarchiesNA( sal_Int32 nDim, uno::Reference< container::XNameAccess >& xHiers ) +sal_Bool ScDPObject::GetHierarchiesNA( sal_Int32 nDim, uno::Reference< container::XNameAccess >& xHiers ) { - BOOL bRet = FALSE; + sal_Bool bRet = false; uno::Reference<container::XNameAccess> xDimsName( GetSource()->getDimensions() ); uno::Reference<container::XIndexAccess> xIntDims(new ScNameToIndexAccess( xDimsName )); if( xIntDims.is() ) @@ -2011,14 +2011,14 @@ BOOL ScDPObject::GetHierarchiesNA( sal_Int32 nDim, uno::Reference< container::XN return bRet; } -BOOL ScDPObject::GetHierarchies( sal_Int32 nDim, uno::Sequence< rtl::OUString >& rHiers ) +sal_Bool ScDPObject::GetHierarchies( sal_Int32 nDim, uno::Sequence< rtl::OUString >& rHiers ) { - BOOL bRet = FALSE; + sal_Bool bRet = false; uno::Reference< container::XNameAccess > xHiersNA; if( GetHierarchiesNA( nDim, xHiersNA ) ) { rHiers = xHiersNA->getElementNames(); - bRet = TRUE; + bRet = sal_True; } return bRet; } @@ -2034,14 +2034,14 @@ sal_Int32 ScDPObject::GetUsedHierarchy( sal_Int32 nDim ) return nHier; } -BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, uno::Reference< container::XNameAccess >& xMembers ) +sal_Bool ScDPObject::GetMembersNA( sal_Int32 nDim, uno::Reference< container::XNameAccess >& xMembers ) { return GetMembersNA( nDim, GetUsedHierarchy( nDim ), xMembers ); } -BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< container::XNameAccess >& xMembers ) +sal_Bool ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< container::XNameAccess >& xMembers ) { - BOOL bRet = FALSE; + sal_Bool bRet = false; uno::Reference<container::XNameAccess> xDimsName( GetSource()->getDimensions() ); uno::Reference<container::XIndexAccess> xIntDims(new ScNameToIndexAccess( xDimsName )); uno::Reference<beans::XPropertySet> xDim(xIntDims->getByIndex( nDim ), uno::UNO_QUERY); @@ -2064,7 +2064,7 @@ BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< if ( xMembSupp.is() ) { xMembers.set(xMembSupp->getMembers()); - bRet = TRUE; + bRet = sal_True; } } } @@ -2125,7 +2125,7 @@ bool hasFieldColumn(const vector<PivotField>* pRefFields, SCCOL nCol) } void ScDPObject::ConvertOrientation( - ScDPSaveData& rSaveData, const vector<PivotField>& rFields, USHORT nOrient, + ScDPSaveData& rSaveData, const vector<PivotField>& rFields, sal_uInt16 nOrient, const Reference<XDimensionsSupplier>& xSource, vector<PivotField>* pRefColFields, vector<PivotField>* pRefRowFields, vector<PivotField>* pRefPageFields ) { @@ -2138,7 +2138,7 @@ void ScDPObject::ConvertOrientation( const PivotField& rField = *itr; SCCOL nCol = rField.nCol; - USHORT nFuncs = rField.nFuncMask; + sal_uInt16 nFuncs = rField.nFuncMask; const sheet::DataPilotFieldReference& rFieldRef = rField.maFieldRef; ScDPSaveDimension* pDim = NULL; @@ -2186,15 +2186,15 @@ void ScDPObject::ConvertOrientation( } } - USHORT nMask = 1; - for (USHORT nBit=0; nBit<16; nBit++) + sal_uInt16 nMask = 1; + for (sal_uInt16 nBit=0; nBit<16; nBit++) { if ( nFuncs & nMask ) { sheet::GeneralFunction eFunc = ScDataPilotConversion::FirstFunc( nMask ); ScDPSaveDimension* pCurrDim = bFirst ? pDim : rSaveData.DuplicateDimension(pDim->GetName()); pCurrDim->SetOrientation( nOrient ); - pCurrDim->SetFunction( sal::static_int_cast<USHORT>(eFunc) ); + pCurrDim->SetFunction( sal::static_int_cast<sal_uInt16>(eFunc) ); if( rFieldRef.ReferenceType == sheet::DataPilotFieldReferenceType::NONE ) pCurrDim->SetReferenceValue( 0 ); @@ -2210,13 +2210,13 @@ void ScDPObject::ConvertOrientation( { pDim->SetOrientation( nOrient ); - USHORT nFuncArray[16]; - USHORT nFuncCount = 0; - USHORT nMask = 1; - for (USHORT nBit=0; nBit<16; nBit++) + sal_uInt16 nFuncArray[16]; + sal_uInt16 nFuncCount = 0; + sal_uInt16 nMask = 1; + for (sal_uInt16 nBit=0; nBit<16; nBit++) { if ( nFuncs & nMask ) - nFuncArray[nFuncCount++] = sal::static_int_cast<USHORT>(ScDataPilotConversion::FirstFunc( nMask )); + nFuncArray[nFuncCount++] = sal::static_int_cast<sal_uInt16>(ScDataPilotConversion::FirstFunc( nMask )); nMask *= 2; } pDim->SetSubTotals( nFuncCount, nFuncArray ); @@ -2224,12 +2224,12 @@ void ScDPObject::ConvertOrientation( // ShowEmpty was implicit in old tables, // must be set for data layout dimension (not accessible in dialog) if ( nCol == PIVOT_DATA_FIELD ) - pDim->SetShowEmpty( TRUE ); + pDim->SetShowEmpty( true ); } } } -bool ScDPObject::IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags ) +bool ScDPObject::IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags ) { bool bAllowed = true; switch (nOrient) @@ -2256,9 +2256,9 @@ bool ScDPObject::IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags ) // ----------------------------------------------------------------------- -BOOL ScDPObject::HasRegisteredSources() +sal_Bool ScDPObject::HasRegisteredSources() { - BOOL bFound = FALSE; + sal_Bool bFound = false; uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory(); uno::Reference<container::XContentEnumerationAccess> xEnAc( xManager, uno::UNO_QUERY ); @@ -2267,7 +2267,7 @@ BOOL ScDPObject::HasRegisteredSources() uno::Reference<container::XEnumeration> xEnum = xEnAc->createContentEnumeration( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDPSOURCE_SERVICE )) ); if ( xEnum.is() && xEnum->hasMoreElements() ) - bFound = TRUE; + bFound = sal_True; } return bFound; @@ -2523,7 +2523,7 @@ const ScDPObject* ScDPCollection::GetByName(const String& rName) const return NULL; } -String ScDPCollection::CreateNewName( USHORT nMin ) const +String ScDPCollection::CreateNewName( sal_uInt16 nMin ) const { String aBase = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DataPilot")); //! from Resource? diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 069c1a86edb8..f91b403f8986 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -111,7 +111,7 @@ struct ScDPOutLevelData mbHasHiddenMember = false; } - BOOL operator<(const ScDPOutLevelData& r) const + sal_Bool operator<(const ScDPOutLevelData& r) const { return nDimPos<r.nDimPos || ( nDimPos==r.nDimPos && nHier<r.nHier ) || ( nDimPos==r.nDimPos && nHier==r.nHier && nLevel<r.nLevel ); } @@ -125,7 +125,7 @@ struct ScDPOutLevelData void lcl_SetStyleById( ScDocument* pDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nStrId ) + sal_uInt16 nStrId ) { if ( nCol1 > nCol2 || nRow1 > nRow2 ) { @@ -155,7 +155,7 @@ void lcl_SetStyleById( ScDocument* pDoc, SCTAB nTab, void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nWidth ) + sal_uInt16 nWidth ) { SvxBorderLine aLine; aLine.SetOutWidth(nWidth); @@ -165,16 +165,16 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab, aBox.SetLine(&aLine, BOX_LINE_RIGHT); aBox.SetLine(&aLine, BOX_LINE_BOTTOM); SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER ); - aBoxInfo.SetValid(VALID_HORI,FALSE); - aBoxInfo.SetValid(VALID_VERT,FALSE); - aBoxInfo.SetValid(VALID_DISTANCE,FALSE); + aBoxInfo.SetValid(VALID_HORI,false); + aBoxInfo.SetValid(VALID_VERT,false); + aBoxInfo.SetValid(VALID_DISTANCE,false); pDoc->ApplyFrameAreaTab( ScRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab ), &aBox, &aBoxInfo ); } // ----------------------------------------------------------------------- -void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, +void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount, const uno::Reference<sheet::XDataPilotMemberResults>& xLevRes, const uno::Reference<container::XIndexAccess>& xDims ) { @@ -193,9 +193,9 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, //! merge this with the loop to collect ScDPOutLevelData? String aDataNames[SC_DPOUT_MAXLEVELS]; - UINT32 nDataFormats[SC_DPOUT_MAXLEVELS]; + sal_uInt32 nDataFormats[SC_DPOUT_MAXLEVELS]; long nDataCount = 0; - BOOL bAnySet = FALSE; + sal_Bool bAnySet = false; long nDimCount = xDims->getCount(); for (long nDim=0; nDim<nDimCount; nDim++) @@ -218,7 +218,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_NUMBERFORMAT)) ); nDataFormats[nDataCount] = nFormat; if ( nFormat != 0 ) - bAnySet = TRUE; + bAnySet = sal_True; ++nDataCount; } } @@ -229,7 +229,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, const sheet::MemberResult* pArray = aResult.getConstArray(); String aName; - UINT32* pNumFmt = new UINT32[nSize]; + sal_uInt32* pNumFmt = new sal_uInt32[nSize]; if (nDataCount == 1) { // only one data dimension -> use its numberformat everywhere @@ -246,7 +246,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, if ( !(pArray[nPos].Flags & sheet::MemberResultFlags::CONTINUE) ) aName = String( pArray[nPos].Name ); - UINT32 nFormat = 0; + sal_uInt32 nFormat = 0; for (long i=0; i<nDataCount; i++) if (aName == aDataNames[i]) //! search more efficiently? { @@ -263,7 +263,7 @@ void lcl_FillNumberFormats( UINT32*& rFormats, long& rCount, } } -UINT32 lcl_GetFirstNumberFormat( const uno::Reference<container::XIndexAccess>& xDims ) +sal_uInt32 lcl_GetFirstNumberFormat( const uno::Reference<container::XIndexAccess>& xDims ) { long nDimCount = xDims->getCount(); for (long nDim=0; nDim<nDimCount; nDim++) @@ -301,7 +301,7 @@ void lcl_SortFields( ScDPOutLevelData* pFields, long nFieldCount ) } } -BOOL lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq ) +sal_Bool lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq ) { // used to skip levels that have no members @@ -309,9 +309,9 @@ BOOL lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq ) const sheet::MemberResult* pArray = rSeq.getConstArray(); for (long i=0; i<nLen; i++) if (pArray[i].Flags & sheet::MemberResultFlags::HASMEMBER) - return FALSE; + return false; - return TRUE; // no member data -> empty + return sal_True; // no member data -> empty } uno::Sequence<sheet::MemberResult> lcl_GetSelectedPageAsResult( const uno::Reference<beans::XPropertySet>& xDimProp ) @@ -351,20 +351,20 @@ uno::Sequence<sheet::MemberResult> lcl_GetSelectedPageAsResult( const uno::Refer } ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsSupplier>& xSrc, - const ScAddress& rPos, BOOL bFilter ) : + const ScAddress& rPos, sal_Bool bFilter ) : pDoc( pD ), xSource( xSrc ), aStartPos( rPos ), bDoFilter( bFilter ), - bResultsError( FALSE ), + bResultsError( false ), mbHasDataLayout(false), pColNumFmt( NULL ), pRowNumFmt( NULL ), nColFmtCount( 0 ), nRowFmtCount( 0 ), nSingleNumFmt( 0 ), - bSizesValid( FALSE ), - bSizeOverflow( FALSE ), + bSizesValid( false ), + bSizeOverflow( false ), mbHeaderLayout( false ) { nTabStartCol = nMemberStartCol = nDataStartCol = nTabEndCol = 0; @@ -399,7 +399,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS sheet::DataPilotFieldOrientation_HIDDEN ); long nDimPos = ScUnoHelpFunctions::GetLongProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_POSITION)) ); - BOOL bIsDataLayout = ScUnoHelpFunctions::GetBoolProperty( + sal_Bool bIsDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ); bool bHasHiddenMember = ScUnoHelpFunctions::GetBoolProperty( @@ -527,7 +527,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS } catch (uno::RuntimeException&) { - bResultsError = TRUE; + bResultsError = sal_True; } } @@ -563,7 +563,7 @@ ScDPOutput::~ScDPOutput() void ScDPOutput::SetPosition( const ScAddress& rPos ) { aStartPos = rPos; - bSizesValid = bSizeOverflow = FALSE; + bSizesValid = bSizeOverflow = false; } void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::DataResult& rData ) @@ -580,7 +580,7 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data // use number formats from source DBG_ASSERT( bSizesValid, "DataCell: !bSizesValid" ); - UINT32 nFormat = 0; + sal_uInt32 nFormat = 0; if ( pColNumFmt ) { if ( nCol >= nDataStartCol ) @@ -608,7 +608,7 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data } void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, - const sheet::MemberResult& rData, BOOL bColHeader, long nLevel ) + const sheet::MemberResult& rData, sal_Bool bColHeader, long nLevel ) { long nFlags = rData.Flags; @@ -696,7 +696,7 @@ void ScDPOutput::CalcSizes() if ( aStartPos.Col() + nRowFieldCount + nColCount - 1 > MAXCOL || aStartPos.Row() + nPageSize + nHeaderSize + nColFieldCount + nRowCount > MAXROW ) { - bSizeOverflow = TRUE; + bSizeOverflow = sal_True; } nTabStartCol = aStartPos.Col(); @@ -716,7 +716,7 @@ void ScDPOutput::CalcSizes() nTabEndRow = nDataStartRow + (SCROW)nRowCount - 1; else nTabEndRow = nDataStartRow; // single row will remain empty - bSizesValid = TRUE; + bSizesValid = sal_True; } } @@ -855,7 +855,7 @@ void ScDPOutput::Output() for (long nCol=0; nCol<nThisColCount; nCol++) { SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow - HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], TRUE, nField ); + HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], true, nField ); if ( ( pArray[nCol].Flags & sheet::MemberResultFlags::HASMEMBER ) && !( pArray[nCol].Flags & sheet::MemberResultFlags::SUBTOTAL ) ) { @@ -869,7 +869,7 @@ void ScDPOutput::Output() { outputimp.AddCol( nColPos ); if ( nColPos + 1 == nEndColPos ) - outputimp.OutputBlockFrame( nColPos,nRowPos, nEndColPos,nRowPos+1, TRUE ); + outputimp.OutputBlockFrame( nColPos,nRowPos, nEndColPos,nRowPos+1, sal_True ); } else outputimp.OutputBlockFrame( nColPos,nRowPos, nEndColPos,nRowPos ); @@ -887,8 +887,8 @@ void ScDPOutput::Output() } // output row headers: - std::vector<BOOL> vbSetBorder; - vbSetBorder.resize( nTabEndRow - nDataStartRow + 1, FALSE ); + std::vector<sal_Bool> vbSetBorder; + vbSetBorder.resize( nTabEndRow - nDataStartRow + 1, false ); for (nField=0; nField<nRowFieldCount; nField++) { bool bDataLayout = mbHasDataLayout && (nField == nRowFieldCount-1); @@ -906,7 +906,7 @@ void ScDPOutput::Output() for (long nRow=0; nRow<nThisRowCount; nRow++) { SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow - HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], FALSE, nField ); + HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], false, nField ); if ( ( pArray[nRow].Flags & sheet::MemberResultFlags::HASMEMBER ) && !( pArray[nRow].Flags & sheet::MemberResultFlags::SUBTOTAL ) ) { @@ -917,10 +917,10 @@ void ScDPOutput::Output() ++nEnd; SCROW nEndRowPos = nDataStartRow + (SCROW)nEnd; //! check for overflow outputimp.AddRow( nRowPos ); - if ( vbSetBorder[ nRow ] == FALSE ) + if ( vbSetBorder[ nRow ] == false ) { outputimp.OutputBlockFrame( nColPos, nRowPos, nTabEndCol, nEndRowPos ); - vbSetBorder[ nRow ] = TRUE; + vbSetBorder[ nRow ] = sal_True; } outputimp.OutputBlockFrame( nColPos, nRowPos, nColPos, nEndRowPos ); @@ -1041,12 +1041,12 @@ void lcl_GetTableVars( sal_Int32& rGrandTotalCols, sal_Int32& rGrandTotalRows, s rDataOrient = sheet::DataPilotFieldOrientation_HIDDEN; uno::Reference<beans::XPropertySet> xSrcProp( xSource, uno::UNO_QUERY ); - BOOL bColGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp, + sal_Bool bColGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)) ); if ( bColGrand ) rGrandTotalCols = 1; // default if data layout not in columns - BOOL bRowGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp, + sal_Bool bRowGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)) ); if ( bRowGrand ) rGrandTotalRows = 1; // default if data layout not in rows @@ -1318,13 +1318,13 @@ bool lcl_IsCondition( const sheet::MemberResult& rResultEntry, const ScDPGetPivo bool lcl_CheckPageField( const ScDPOutLevelData& rField, const std::vector< ScDPGetPivotDataField >& rFilters, - std::vector< BOOL >& rFilterUsed ) + std::vector< sal_Bool >& rFilterUsed ) { for (SCSIZE nFilterPos = 0; nFilterPos < rFilters.size(); ++nFilterPos) { if ( lcl_IsNamedCategoryField( rFilters[nFilterPos], rField ) ) { - rFilterUsed[nFilterPos] = TRUE; + rFilterUsed[nFilterPos] = sal_True; // page field result is empty or the selection as single entry (see lcl_GetSelectedPageAsResult) if ( rField.aResult.getLength() == 1 && @@ -1402,10 +1402,10 @@ uno::Sequence<sheet::GeneralFunction> lcl_GetSubTotals( return aSubTotals; } -void lcl_FilterInclude( std::vector< BOOL >& rResult, std::vector< sal_Int32 >& rSubtotal, +void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 >& rSubtotal, const ScDPOutLevelData& rField, const std::vector< ScDPGetPivotDataField >& rFilters, - std::vector< BOOL >& rFilterUsed, + std::vector< sal_Bool >& rFilterUsed, bool& rBeforeDataLayout, sal_Int32 nGrandTotals, sal_Int32 nDataLayoutIndex, const std::vector<String>& rDataNames, const std::vector<String>& rGivenNames, @@ -1428,7 +1428,7 @@ void lcl_FilterInclude( std::vector< BOOL >& rResult, std::vector< sal_Int32 >& if ( lcl_IsNamedCategoryField( rFilters[nFilterPos], rField ) ) { aFilter = rFilters[nFilterPos]; - rFilterUsed[nFilterPos] = TRUE; + rFilterUsed[nFilterPos] = sal_True; bHasFilter = true; } } @@ -1540,7 +1540,7 @@ void lcl_FilterInclude( std::vector< BOOL >& rResult, std::vector< sal_Int32 >& // if a function was specified, automatic subtotals never match if ( bHasFunc ) - rResult[j] = FALSE; + rResult[j] = false; } } @@ -1574,7 +1574,7 @@ void lcl_FilterInclude( std::vector< BOOL >& rResult, std::vector< sal_Int32 >& // if a function was specified, simple (non-subtotal) values never match if ( bHasFunc && nSubTotalCount == 0 ) - rResult[j] = FALSE; + rResult[j] = false; } // if no condition is given, keep the columns/rows included } @@ -1582,7 +1582,7 @@ void lcl_FilterInclude( std::vector< BOOL >& rResult, std::vector< sal_Int32 >& } } -void lcl_StripSubTotals( std::vector< BOOL >& rResult, const std::vector< sal_Int32 >& rSubtotal ) +void lcl_StripSubTotals( std::vector< sal_Bool >& rResult, const std::vector< sal_Int32 >& rSubtotal ) { sal_Int32 nSize = rResult.size(); DBG_ASSERT( (sal_Int32)rSubtotal.size() == nSize, "sizes don't match" ); @@ -1595,13 +1595,13 @@ void lcl_StripSubTotals( std::vector< BOOL >& rResult, const std::vector< sal_In DBG_ASSERT( nStart >= 0, "invalid subtotal count" ); for (sal_Int32 nPrev = nStart; nPrev < nPos; nPrev++) - rResult[nPrev] = FALSE; + rResult[nPrev] = false; } } String lcl_GetDataFieldName( const String& rSourceName, sheet::GeneralFunction eFunc ) { - USHORT nStrId = 0; + sal_uInt16 nStrId = 0; switch ( eFunc ) { case sheet::GeneralFunction_SUM: nStrId = STR_FUN_TEXT_SUM; break; @@ -1653,9 +1653,9 @@ void ScDPOutput::GetDataDimensionNames( String& rSourceName, String& rGivenName, } } -// Returns TRUE on success and stores the result in rTarget -// Returns FALSE if rFilters or rTarget describes something that is not visible -BOOL ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, +// Returns sal_True on success and stores the result in rTarget +// Returns sal_False if rFilters or rTarget describes something that is not visible +sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, const std::vector< ScDPGetPivotDataField >& rFilters ) { CalcSizes(); @@ -1670,7 +1670,7 @@ BOOL ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, lcl_GetTableVars( nGrandTotalCols, nGrandTotalRows, nDataLayoutIndex, aDataNames, aGivenNames, eDataOrient, xSource ); if ( aDataNames.empty() ) - return FALSE; // incomplete table without data fields -> no result + return false; // incomplete table without data fields -> no result if ( eDataOrient == sheet::DataPilotFieldOrientation_HIDDEN ) { @@ -1678,15 +1678,15 @@ BOOL ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, DBG_ASSERT( aDataNames.size() == 1, "several data fields but no data layout field" ); if ( !lcl_IsNamedDataField( rTarget, aDataNames[0], aGivenNames[0] ) ) - return FALSE; + return false; } - std::vector< BOOL > aIncludeCol( nColCount, TRUE ); + std::vector< sal_Bool > aIncludeCol( nColCount, sal_True ); std::vector< sal_Int32 > aSubtotalCol( nColCount, 0 ); - std::vector< BOOL > aIncludeRow( nRowCount, TRUE ); + std::vector< sal_Bool > aIncludeRow( nRowCount, sal_True ); std::vector< sal_Int32 > aSubtotalRow( nRowCount, 0 ); - std::vector< BOOL > aFilterUsed( rFilters.size(), FALSE ); + std::vector< sal_Bool > aFilterUsed( rFilters.size(), false ); long nField; long nCol; @@ -1711,12 +1711,12 @@ BOOL ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, for (nField=0; nField<nPageFieldCount; nField++) if ( !lcl_CheckPageField( pPageFields[nField], rFilters, aFilterUsed ) ) - return FALSE; + return false; // all filter fields must be used for (SCSIZE nFilter=0; nFilter<aFilterUsed.size(); nFilter++) if (!aFilterUsed[nFilter]) - return FALSE; + return false; lcl_StripSubTotals( aIncludeCol, aSubtotalCol ); lcl_StripSubTotals( aIncludeRow, aSubtotalRow ); @@ -1740,35 +1740,35 @@ BOOL ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, } if ( nColIncluded != 1 || nRowIncluded != 1 ) - return FALSE; + return false; const uno::Sequence<sheet::DataResult>& rDataRow = aData[nRowPos]; if ( nColPos >= rDataRow.getLength() ) - return FALSE; + return false; const sheet::DataResult& rResult = rDataRow[nColPos]; if ( rResult.Flags & sheet::DataResultFlags::ERROR ) - return FALSE; //! different error? + return false; //! different error? - rTarget.mbValIsStr = FALSE; + rTarget.mbValIsStr = false; rTarget.mnValNum = rResult.Value; - return TRUE; + return sal_True; } -BOOL ScDPOutput::IsFilterButton( const ScAddress& rPos ) +sal_Bool ScDPOutput::IsFilterButton( const ScAddress& rPos ) { SCCOL nCol = rPos.Col(); SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() || !bDoFilter ) - return FALSE; // wrong sheet or no button at all + return false; // wrong sheet or no button at all // filter button is at top left return ( nCol == aStartPos.Col() && nRow == aStartPos.Row() ); } -long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) +long ScDPOutput::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) { SCCOL nCol = rPos.Col(); SCROW nRow = rPos.Row(); @@ -1814,9 +1814,9 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, USHORT& rOrient ) return -1; // invalid } -BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMouseTop, +sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft, sal_Bool bMouseTop, long nDragDim, - Rectangle& rPosRect, USHORT& rOrient, long& rDimPos ) + Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ) { // Rectangle instead of ScRange for rPosRect to allow for negative values @@ -1824,7 +1824,7 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo SCROW nRow = rPos.Row(); SCTAB nTab = rPos.Tab(); if ( nTab != aStartPos.Tab() ) - return FALSE; // wrong sheet + return false; // wrong sheet // calculate output positions and sizes @@ -1839,25 +1839,25 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo if (nField < 0) { nField = 0; - bMouseTop = TRUE; + bMouseTop = sal_True; } //! find start of dimension rPosRect = Rectangle( nDataStartCol, nMemberStartRow + nField, nTabEndCol, nMemberStartRow + nField -1 ); - BOOL bFound = FALSE; // is this within the same orientation? - BOOL bBeforeDrag = FALSE; - BOOL bAfterDrag = FALSE; + sal_Bool bFound = false; // is this within the same orientation? + sal_Bool bBeforeDrag = false; + sal_Bool bAfterDrag = false; for (long nPos=0; nPos<nColFieldCount && !bFound; nPos++) { if (pColFields[nPos].nDim == nDragDim) { - bFound = TRUE; + bFound = sal_True; if ( nField < nPos ) - bBeforeDrag = TRUE; + bBeforeDrag = sal_True; else if ( nField > nPos ) - bAfterDrag = TRUE; + bAfterDrag = sal_True; } } @@ -1882,13 +1882,13 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo rOrient = sheet::DataPilotFieldOrientation_COLUMN; rDimPos = nField; //!... - return TRUE; + return sal_True; } // test for row header // special case if no row fields - BOOL bSpecial = ( nRow+1 >= nDataStartRow && nRow <= nTabEndRow && + sal_Bool bSpecial = ( nRow+1 >= nDataStartRow && nRow <= nTabEndRow && nRowFieldCount == 0 && nCol == nTabStartCol && bMouseLeft ); if ( bSpecial || ( nRow+1 >= nDataStartRow && nRow <= nTabEndRow && @@ -1900,18 +1900,18 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo rPosRect = Rectangle( nTabStartCol + nField, nDataStartRow - 1, nTabStartCol + nField - 1, nTabEndRow ); - BOOL bFound = FALSE; // is this within the same orientation? - BOOL bBeforeDrag = FALSE; - BOOL bAfterDrag = FALSE; + sal_Bool bFound = false; // is this within the same orientation? + sal_Bool bBeforeDrag = false; + sal_Bool bAfterDrag = false; for (long nPos=0; nPos<nRowFieldCount && !bFound; nPos++) { if (pRowFields[nPos].nDim == nDragDim) { - bFound = TRUE; + bFound = sal_True; if ( nField < nPos ) - bBeforeDrag = TRUE; + bBeforeDrag = sal_True; else if ( nField > nPos ) - bAfterDrag = TRUE; + bAfterDrag = sal_True; } } @@ -1936,7 +1936,7 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo rOrient = sheet::DataPilotFieldOrientation_ROW; rDimPos = nField; //!... - return TRUE; + return sal_True; } // test for page fields @@ -1949,25 +1949,25 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo if (nField < 0) { nField = 0; - bMouseTop = TRUE; + bMouseTop = sal_True; } //! find start of dimension rPosRect = Rectangle( aStartPos.Col(), nPageStartRow + nField, nTabEndCol, nPageStartRow + nField - 1 ); - BOOL bFound = FALSE; // is this within the same orientation? - BOOL bBeforeDrag = FALSE; - BOOL bAfterDrag = FALSE; + sal_Bool bFound = false; // is this within the same orientation? + sal_Bool bBeforeDrag = false; + sal_Bool bAfterDrag = false; for (long nPos=0; nPos<nPageFieldCount && !bFound; nPos++) { if (pPageFields[nPos].nDim == nDragDim) { - bFound = TRUE; + bFound = sal_True; if ( nField < nPos ) - bBeforeDrag = TRUE; + bBeforeDrag = sal_True; else if ( nField > nPos ) - bAfterDrag = TRUE; + bAfterDrag = sal_True; } } @@ -1992,10 +1992,10 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo rOrient = sheet::DataPilotFieldOrientation_PAGE; rDimPos = nField; //!... - return TRUE; + return sal_True; } - return FALSE; + return false; } diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 3b63a29167f6..e14c99b77966 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -582,7 +582,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD { // single filter field: first field equal to selected string sheet::TableFilterField aField( sheet::FilterConnection_AND, 0, - sheet::FilterOperator_EQUAL, sal_False, 0.0, *pSelectedPage ); + sheet::FilterOperator_EQUAL, false, 0.0, *pSelectedPage ); aFilter = uno::Sequence<sheet::TableFilterField>( &aField, 1 ); } // else keep empty sequence diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index 01c66c4c61b6..7eeb4b93e284 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -192,18 +192,18 @@ String ScDatabaseDPData::getDimensionName(long nColumn) return aCacheTable.getFieldName((SCCOL)nColumn); } -BOOL ScDatabaseDPData::getIsDataLayoutDimension(long nColumn) +sal_Bool ScDatabaseDPData::getIsDataLayoutDimension(long nColumn) { return ( nColumn == GetCacheTable().getColSize()); } -BOOL ScDatabaseDPData::IsDateDimension(long /* nDim */) +sal_Bool ScDatabaseDPData::IsDateDimension(long /* nDim */) { //! later... - return FALSE; + return false; } -void ScDatabaseDPData::SetEmptyFlags( BOOL /* bIgnoreEmptyRows */, BOOL /* bRepeatIfEmpty */ ) +void ScDatabaseDPData::SetEmptyFlags( sal_Bool /* bIgnoreEmptyRows */, sal_Bool /* bRepeatIfEmpty */ ) { // not used for database data //! disable flags diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index ec2270029a3d..c209fecf03bc 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -64,8 +64,8 @@ ScSheetDPData::ScSheetDPData(ScDocument* pD, const ScSheetSourceDesc& rDesc) : ScDPTableData(pD), aQuery ( rDesc.GetQueryParam() ), pSpecial(NULL), - bIgnoreEmptyRows( FALSE ), - bRepeatIfEmpty(FALSE), + bIgnoreEmptyRows( false ), + bRepeatIfEmpty(false), mrDesc(rDesc), aCacheTable(rDesc.CreateCache()) { @@ -130,18 +130,18 @@ String ScSheetDPData::getDimensionName(long nColumn) } } -BOOL ScSheetDPData::IsDateDimension(long nDim) +sal_Bool ScSheetDPData::IsDateDimension(long nDim) { CreateCacheTable(); long nColCount = aCacheTable.getColSize(); if (getIsDataLayoutDimension(nDim)) { - return FALSE; + return false; } else if (nDim >= nColCount) { OSL_FAIL("IsDateDimension: invalid dimension"); - return FALSE; + return false; } else { @@ -149,7 +149,7 @@ BOOL ScSheetDPData::IsDateDimension(long nDim) } } -ULONG ScSheetDPData::GetNumberFormat(long nDim) +sal_uLong ScSheetDPData::GetNumberFormat(long nDim) { CreateCacheTable(); if (getIsDataLayoutDimension(nDim)) @@ -166,7 +166,7 @@ ULONG ScSheetDPData::GetNumberFormat(long nDim) return GetCacheTable().getCache()->GetNumberFormat( nDim ); } } -UINT32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) +sal_uInt32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) { if( !mpDoc ) return 0; @@ -177,13 +177,13 @@ UINT32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) return 0; } -BOOL ScSheetDPData::getIsDataLayoutDimension(long nColumn) +sal_Bool ScSheetDPData::getIsDataLayoutDimension(long nColumn) { CreateCacheTable(); return (nColumn ==(long)( aCacheTable.getColSize())); } -void ScSheetDPData::SetEmptyFlags( BOOL bIgnoreEmptyRowsP, BOOL bRepeatIfEmptyP ) +void ScSheetDPData::SetEmptyFlags( sal_Bool bIgnoreEmptyRowsP, sal_Bool bRepeatIfEmptyP ) { bIgnoreEmptyRows = bIgnoreEmptyRowsP; bRepeatIfEmpty = bRepeatIfEmptyP; @@ -312,7 +312,7 @@ ScDPCache* ScSheetSourceDesc::CreateCache() const if (!mpDoc) return NULL; - ULONG nErrId = CheckSourceRange(); + sal_uLong nErrId = CheckSourceRange(); if (nErrId) { OSL_FAIL( "Error Create Cache\n" ); @@ -329,7 +329,7 @@ long ScSheetSourceDesc::GetCacheId() const return -1; } -ULONG ScSheetSourceDesc::CheckSourceRange() const +sal_uLong ScSheetSourceDesc::CheckSourceRange() const { if (!mpDoc) return STR_ERR_DATAPILOTSOURCE; diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index 88c28afd3970..cca9ead058fb 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -124,14 +124,14 @@ bool ScDPTableData::IsRepeatIfEmpty() return false; } -ULONG ScDPTableData::GetNumberFormat(long) +sal_uLong ScDPTableData::GetNumberFormat(long) { return 0; // default format } -BOOL ScDPTableData::IsBaseForGroup(long) const +sal_Bool ScDPTableData::IsBaseForGroup(long) const { - return FALSE; // always false + return false; // always false } long ScDPTableData::GetGroupBase(long) const @@ -139,23 +139,23 @@ long ScDPTableData::GetGroupBase(long) const return -1; // always none } -BOOL ScDPTableData::IsNumOrDateGroup(long) const +sal_Bool ScDPTableData::IsNumOrDateGroup(long) const { - return FALSE; // always false + return false; // always false } -BOOL ScDPTableData::IsInGroup( const ScDPItemData&, long, +sal_Bool ScDPTableData::IsInGroup( const ScDPItemData&, long, const ScDPItemData&, long ) const { OSL_FAIL("IsInGroup shouldn't be called for non-group data"); - return FALSE; + return false; } -BOOL ScDPTableData::HasCommonElement( const ScDPItemData&, long, +sal_Bool ScDPTableData::HasCommonElement( const ScDPItemData&, long, const ScDPItemData&, long ) const { OSL_FAIL("HasCommonElement shouldn't be called for non-group data"); - return FALSE; + return false; } void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTable& rCacheTable, const CalcInfo& rInfo, CalcRowData& rData) @@ -189,13 +189,13 @@ void ScDPTableData::ProcessRowData(CalcInfo& rInfo, CalcRowData& rData, bool bAu { if (!bAutoShow) { - LateInitParams aColParams( rInfo.aColDims, rInfo.aColLevels, FALSE ); - LateInitParams aRowParams ( rInfo.aRowDims, rInfo.aRowLevels, TRUE ); + LateInitParams aColParams( rInfo.aColDims, rInfo.aColLevels, false ); + LateInitParams aRowParams ( rInfo.aRowDims, rInfo.aRowLevels, sal_True ); // root always init child - aColParams.SetInitChild( TRUE ); - aColParams.SetInitAllChildren( FALSE); - aRowParams.SetInitChild( TRUE ); - aRowParams.SetInitAllChildren( FALSE); + aColParams.SetInitChild( sal_True ); + aColParams.SetInitAllChildren( false); + aRowParams.SetInitChild( sal_True ); + aRowParams.SetInitAllChildren( false); rInfo.pColRoot->LateInitFrom( aColParams, rData.aColData,0, *rInfo.pInitState); rInfo.pRowRoot->LateInitFrom( aRowParams, rData.aRowData, 0, *rInfo.pInitState); diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index c05f3b3db8c6..e3ddbcbe0f59 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -60,7 +60,7 @@ using ::std::vector; namespace { -bool lcl_isDate( ULONG nNumType ) +bool lcl_isDate( sal_uLong nNumType ) { return ((nNumType & NUMBERFORMAT_DATE) != 0) ? 1 : 0; } @@ -171,13 +171,13 @@ ScDPItemData* lcl_GetItemValue( } -ScDPItemData::ScDPItemData(const String& rS, double fV, bool bHV, const ULONG nNumFormatP, bool bData) : +ScDPItemData::ScDPItemData(const String& rS, double fV, bool bHV, const sal_uLong nNumFormatP, bool bData) : nNumFormat( nNumFormatP ), aString(rS), fValue(fV), mbFlag( (MK_VAL*!!bHV) | (MK_DATA*!!bData) | (MK_ERR*!!false) | (MK_DATE*!!lcl_isDate( nNumFormat ) ) ) { } -ScDPItemData::ScDPItemData(ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDocTab) : +ScDPItemData::ScDPItemData(ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_uInt16 nDocTab) : nNumFormat( 0 ), fValue(0.0), mbFlag( 0 ) { String aDocStr; @@ -196,7 +196,7 @@ ScDPItemData::ScDPItemData(ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nDo else if ( pDoc->HasValueData( nCol, nRow, nDocTab ) ) { double fVal = pDoc->GetValue(ScAddress(nCol, nRow, nDocTab)); - ULONG nFormat = NUMBERFORMAT_NUMBER; + sal_uLong nFormat = NUMBERFORMAT_NUMBER; if ( pFormatter ) nFormat = pFormatter->GetType( pDoc->GetNumberFormat( ScAddress( nCol, nRow, nDocTab ) ) ); aString = aDocStr; @@ -331,7 +331,7 @@ double ScDPItemData::GetValue() const { return fValue; } -ULONG ScDPItemData::GetNumFormat() const +sal_uLong ScDPItemData::GetNumFormat() const { return nNumFormat; } @@ -447,9 +447,9 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) SCROW nStartRow = rRange.aStart.Row(); // start of data SCROW nEndRow = rRange.aEnd.Row(); - USHORT nStartCol = rRange.aStart.Col(); - USHORT nEndCol = rRange.aEnd.Col(); - USHORT nDocTab = rRange.aStart.Tab(); + sal_uInt16 nStartCol = rRange.aStart.Col(); + sal_uInt16 nEndCol = rRange.aEnd.Col(); + sal_uInt16 nDocTab = rRange.aStart.Tab(); mnColumnCount = nEndCol - nStartCol + 1; if ( IsValid() ) @@ -475,7 +475,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) //check valid for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow ++ ) { - for ( USHORT nCol = nStartCol; nCol <= nEndCol; nCol++ ) + for ( sal_uInt16 nCol = nStartCol; nCol <= nEndCol; nCol++ ) { if ( nRow == nStartRow ) AddLabel( new ScDPItemData( pDoc, nRow, nCol, nDocTab ) ); @@ -555,7 +555,7 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const } } -ULONG ScDPCache::GetDimNumType( SCCOL nDim) const +sal_uLong ScDPCache::GetDimNumType( SCCOL nDim) const { DBG_ASSERT( IsValid(), " IsValid() == false " ); DBG_ASSERT( nDim < mnColumnCount && nDim >=0, " dimention out of bound " ); @@ -598,7 +598,7 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, bool *pSpeci if ( nQueryCol > rParam.nCol2 ) nQueryCol = rParam.nCol2; SCCOL nSourceField = nQueryCol - rParam.nCol1; - SCROW nId = GetItemDataId( nSourceField, nRow, FALSE ); + SCROW nId = GetItemDataId( nSourceField, nRow, false ); const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId ); bool bOk = false; @@ -673,7 +673,7 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, bool *pSpeci { bOk = pTransliteration->isEqual( aCellStr, *rEntry.pStr ); String aStr = *rEntry.pStr; - sal_Bool bHasStar = sal_False; + sal_Bool bHasStar = false; xub_StrLen nIndex; if (( nIndex = aStr.Search('*') ) != STRING_NOTFOUND) bHasStar = sal_True; @@ -681,7 +681,7 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, bool *pSpeci { for (i=0;(i<nIndex) && (i< aCellStr.Len()) ; i++) { - if (aCellStr.GetChar( (USHORT)i ) == aStr.GetChar((USHORT) i )) + if (aCellStr.GetChar( (sal_uInt16)i ) == aStr.GetChar((sal_uInt16) i )) { bOk=1; } @@ -782,7 +782,7 @@ bool ScDPCache::IsRowEmpty( SCROW nRow ) const return mbEmptyRow[ nRow ]; } -bool ScDPCache::IsEmptyMember( SCROW nRow, USHORT nColumn ) const +bool ScDPCache::IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const { return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, false ) )->IsHasData(); } @@ -823,10 +823,10 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pitemData) } -String ScDPCache::GetDimensionName( USHORT nColumn ) const +String ScDPCache::GetDimensionName( sal_uInt16 nColumn ) const { DBG_ASSERT(nColumn < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); - DBG_ASSERT(maLabelNames.size() == static_cast <USHORT> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); + DBG_ASSERT(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); if ( static_cast<size_t>(nColumn+1) < maLabelNames.size() ) { @@ -867,7 +867,7 @@ void ScDPCache::AddLabel(ScDPItemData *pData) maLabelNames.push_back( pData ); } -SCROW ScDPCache::GetItemDataId(USHORT nDim, SCROW nRow, bool bRepeatIfEmpty) const +SCROW ScDPCache::GetItemDataId(sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const { DBG_ASSERT( IsValid(), " IsValid() == false " ); DBG_ASSERT( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " ); @@ -915,16 +915,16 @@ SCROW ScDPCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const return maGlobalOrder[nDim][nOrder]; } -ULONG ScDPCache::GetNumType(ULONG nFormat) const +sal_uLong ScDPCache::GetNumType(sal_uLong nFormat) const { SvNumberFormatter* pFormatter = mpDoc->GetFormatTable(); - ULONG nType = NUMBERFORMAT_NUMBER; + sal_uLong nType = NUMBERFORMAT_NUMBER; if ( pFormatter ) nType = pFormatter->GetType( nFormat ); return nType; } -ULONG ScDPCache::GetNumberFormat( long nDim ) const +sal_uLong ScDPCache::GetNumberFormat( long nDim ) const { if ( nDim >= mnColumnCount ) return 0; diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index ff3835a86af6..cae8fad17d2c 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -72,7 +72,7 @@ SV_IMPL_PTRARR( ScDPDataMembers, ScDPDataMemberPtr ); // ----------------------------------------------------------------------- -static USHORT nFuncStrIds[12] = // passend zum enum ScSubTotalFunc +static sal_uInt16 nFuncStrIds[12] = // passend zum enum ScSubTotalFunc { 0, // SUBTOTAL_FUNC_NONE STR_FUN_TEXT_AVG, // SUBTOTAL_FUNC_AVE @@ -99,10 +99,10 @@ namespace { } vec.resize( nSize, NULL ); } - BOOL lcl_SearchMember( const std::vector <ScDPResultMember *>& list, SCROW nOrder, SCROW& rIndex) + sal_Bool lcl_SearchMember( const std::vector <ScDPResultMember *>& list, SCROW nOrder, SCROW& rIndex) { rIndex = list.size(); - BOOL bFound = FALSE; + sal_Bool bFound = false; SCROW nLo = 0; SCROW nHi = list.size() - 1; SCROW nIndex; @@ -116,7 +116,7 @@ namespace { nHi = nIndex - 1; if ( list[nIndex]->GetOrder() == nOrder ) { - bFound = TRUE; + bFound = sal_True; nLo = nIndex; } } @@ -135,37 +135,37 @@ class ScDPRowMembersOrder { ScDPResultDimension& rDimension; long nMeasure; - BOOL bAscending; + sal_Bool bAscending; public: - ScDPRowMembersOrder( ScDPResultDimension& rDim, long nM, BOOL bAsc ) : + ScDPRowMembersOrder( ScDPResultDimension& rDim, long nM, sal_Bool bAsc ) : rDimension(rDim), nMeasure(nM), bAscending(bAsc) {} ~ScDPRowMembersOrder() {} - BOOL operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; + sal_Bool operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; }; class ScDPColMembersOrder { ScDPDataDimension& rDimension; long nMeasure; - BOOL bAscending; + sal_Bool bAscending; public: - ScDPColMembersOrder( ScDPDataDimension& rDim, long nM, BOOL bAsc ) : + ScDPColMembersOrder( ScDPDataDimension& rDim, long nM, sal_Bool bAsc ) : rDimension(rDim), nMeasure(nM), bAscending(bAsc) {} ~ScDPColMembersOrder() {} - BOOL operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; + sal_Bool operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; }; -static BOOL lcl_IsLess( const ScDPDataMember* pDataMember1, const ScDPDataMember* pDataMember2, long nMeasure, BOOL bAscending ) +static sal_Bool lcl_IsLess( const ScDPDataMember* pDataMember1, const ScDPDataMember* pDataMember2, long nMeasure, sal_Bool bAscending ) { // members can be NULL if used for rows @@ -173,17 +173,17 @@ static BOOL lcl_IsLess( const ScDPDataMember* pDataMember1, const ScDPDataMember const ScDPAggData* pAgg1 = pDataMember1 ? pDataMember1->GetConstAggData( nMeasure, aEmptyState ) : NULL; const ScDPAggData* pAgg2 = pDataMember2 ? pDataMember2->GetConstAggData( nMeasure, aEmptyState ) : NULL; - BOOL bError1 = pAgg1 && pAgg1->HasError(); - BOOL bError2 = pAgg2 && pAgg2->HasError(); + sal_Bool bError1 = pAgg1 && pAgg1->HasError(); + sal_Bool bError2 = pAgg2 && pAgg2->HasError(); if ( bError1 ) { if ( bError2 ) - return FALSE; // equal + return false; // equal else - return FALSE; // errors are always sorted at the end + return false; // errors are always sorted at the end } else if ( bError2 ) - return TRUE; // errors are always sorted at the end + return sal_True; // errors are always sorted at the end else { double fVal1 = ( pAgg1 && pAgg1->HasData() ) ? pAgg1->GetResult() : 0.0; // no data is sorted as 0 @@ -196,7 +196,7 @@ static BOOL lcl_IsLess( const ScDPDataMember* pDataMember1, const ScDPDataMember } } -static BOOL lcl_IsEqual( const ScDPDataMember* pDataMember1, const ScDPDataMember* pDataMember2, long nMeasure ) +static sal_Bool lcl_IsEqual( const ScDPDataMember* pDataMember1, const ScDPDataMember* pDataMember2, long nMeasure ) { // members can be NULL if used for rows @@ -204,17 +204,17 @@ static BOOL lcl_IsEqual( const ScDPDataMember* pDataMember1, const ScDPDataMembe const ScDPAggData* pAgg1 = pDataMember1 ? pDataMember1->GetConstAggData( nMeasure, aEmptyState ) : NULL; const ScDPAggData* pAgg2 = pDataMember2 ? pDataMember2->GetConstAggData( nMeasure, aEmptyState ) : NULL; - BOOL bError1 = pAgg1 && pAgg1->HasError(); - BOOL bError2 = pAgg2 && pAgg2->HasError(); + sal_Bool bError1 = pAgg1 && pAgg1->HasError(); + sal_Bool bError2 = pAgg2 && pAgg2->HasError(); if ( bError1 ) { if ( bError2 ) - return TRUE; // equal + return sal_True; // equal else - return FALSE; + return false; } else if ( bError2 ) - return FALSE; + return false; else { double fVal1 = ( pAgg1 && pAgg1->HasData() ) ? pAgg1->GetResult() : 0.0; // no data is sorted as 0 @@ -227,7 +227,7 @@ static BOOL lcl_IsEqual( const ScDPDataMember* pDataMember1, const ScDPDataMembe } } -BOOL ScDPRowMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const +sal_Bool ScDPRowMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const { const ScDPResultMember* pMember1 = rDimension.GetMember(nIndex1); const ScDPResultMember* pMember2 = rDimension.GetMember(nIndex2); @@ -238,16 +238,16 @@ BOOL ScDPRowMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) con const ScDPDataMember* pDataMember1 = pMember1->GetDataRoot() ; const ScDPDataMember* pDataMember2 = pMember2->GetDataRoot(); // GetDataRoot can be NULL if there was no data. - // IsVisible == FALSE can happen after AutoShow. + // IsVisible == sal_False can happen after AutoShow. return lcl_IsLess( pDataMember1, pDataMember2, nMeasure, bAscending ); } -BOOL ScDPColMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const +sal_Bool ScDPColMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const { ScDPDataMember* pDataMember1 = rDimension.GetMember(nIndex1); ScDPDataMember* pDataMember2 = rDimension.GetMember(nIndex2); - BOOL bHide1 = pDataMember1 && !pDataMember1->IsVisible(); - BOOL bHide2 = pDataMember2 && !pDataMember2->IsVisible(); + sal_Bool bHide1 = pDataMember1 && !pDataMember1->IsVisible(); + sal_Bool bHide2 = pDataMember2 && !pDataMember2->IsVisible(); if ( bHide1 || bHide2 ) return !bHide1; return lcl_IsLess( pDataMember1, pDataMember2, nMeasure, bAscending ); @@ -506,7 +506,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub // check the error conditions for the selected function - BOOL bError = FALSE; + sal_Bool bError = false; switch (eFunc) { case SUBTOTAL_FUNC_SUM: @@ -581,7 +581,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub } } - BOOL bEmpty = ( nCount == 0 ); // no data + sal_Bool bEmpty = ( nCount == 0 ); // no data // store the result // Empty is checked first, so empty results are shown empty even for "average" etc. @@ -603,7 +603,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub fAux = 0.0; // used for running total or original result of reference value } -BOOL ScDPAggData::IsCalculated() const +sal_Bool ScDPAggData::IsCalculated() const { return ( nCount <= SC_DPAGG_RESULT_EMPTY ); } @@ -615,14 +615,14 @@ double ScDPAggData::GetResult() const return fVal; // use calculated value } -BOOL ScDPAggData::HasError() const +sal_Bool ScDPAggData::HasError() const { DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); return ( nCount == SC_DPAGG_RESULT_ERROR ); } -BOOL ScDPAggData::HasData() const +sal_Bool ScDPAggData::HasData() const { DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); @@ -643,7 +643,7 @@ void ScDPAggData::SetError() nCount = SC_DPAGG_RESULT_ERROR; } -void ScDPAggData::SetEmpty( BOOL bSet ) +void ScDPAggData::SetEmpty( sal_Bool bSet ) { DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); @@ -688,7 +688,7 @@ void ScDPAggData::Reset() // ----------------------------------------------------------------------- ScDPRowTotals::ScDPRowTotals() : - bIsInColRoot( FALSE ) + bIsInColRoot( false ) { } @@ -767,9 +767,9 @@ ScDPResultData::ScDPResultData( ScDPSource* pSrc ) : //! Ref pMeasRefs( NULL ), pMeasRefOrient( NULL ), pMeasNames( NULL ), - bLateInit( FALSE ), - bDataAtCol( FALSE ), - bDataAtRow( FALSE ) + bLateInit( false ), + bDataAtCol( false ), + bDataAtRow( false ) { lcl_ResizePointVector( mpDimMembers , SC_DAPI_MAXFIELDS ); @@ -786,7 +786,7 @@ ScDPResultData::~ScDPResultData() } void ScDPResultData::SetMeasureData( long nCount, const ScSubTotalFunc* pFunctions, - const sheet::DataPilotFieldReference* pRefs, const USHORT* pRefOrient, + const sheet::DataPilotFieldReference* pRefs, const sal_uInt16* pRefOrient, const String* pNames ) { delete[] pMeasFuncs; @@ -798,7 +798,7 @@ void ScDPResultData::SetMeasureData( long nCount, const ScSubTotalFunc* pFunctio nMeasCount = nCount; pMeasFuncs = new ScSubTotalFunc[nCount]; pMeasRefs = new sheet::DataPilotFieldReference[nCount]; - pMeasRefOrient = new USHORT[nCount]; + pMeasRefOrient = new sal_uInt16[nCount]; pMeasNames = new String[nCount]; for (long i=0; i<nCount; i++) { @@ -815,20 +815,20 @@ void ScDPResultData::SetMeasureData( long nCount, const ScSubTotalFunc* pFunctio pMeasFuncs = new ScSubTotalFunc[1]; pMeasFuncs[0] = SUBTOTAL_FUNC_NONE; pMeasRefs = new sheet::DataPilotFieldReference[1]; // default ctor is ok - pMeasRefOrient = new USHORT[1]; + pMeasRefOrient = new sal_uInt16[1]; pMeasRefOrient[0] = sheet::DataPilotFieldOrientation_HIDDEN; pMeasNames = new String[1]; pMeasNames[0] = ScGlobal::GetRscString( STR_EMPTYDATA ); } } -void ScDPResultData::SetDataLayoutOrientation( USHORT nOrient ) +void ScDPResultData::SetDataLayoutOrientation( sal_uInt16 nOrient ) { bDataAtCol = ( nOrient == sheet::DataPilotFieldOrientation_COLUMN ); bDataAtRow = ( nOrient == sheet::DataPilotFieldOrientation_ROW ); } -void ScDPResultData::SetLateInit( BOOL bSet ) +void ScDPResultData::SetLateInit( sal_Bool bSet ) { bLateInit = bSet; } @@ -857,15 +857,15 @@ const sheet::DataPilotFieldReference& ScDPResultData::GetMeasureRefVal(long nMea return pMeasRefs[nMeasure]; } -USHORT ScDPResultData::GetMeasureRefOrient(long nMeasure) const +sal_uInt16 ScDPResultData::GetMeasureRefOrient(long nMeasure) const { DBG_ASSERT( pMeasRefOrient && nMeasure < nMeasCount, "bumm" ); return pMeasRefOrient[nMeasure]; } -String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const +String ScDPResultData::GetMeasureString(long nMeasure, sal_Bool bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const { - // with bForce==TRUE, return function instead of "result" for single measure + // with bForce==sal_True, return function instead of "result" for single measure // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc rbTotalResult = false; if ( nMeasure < 0 || ( nMeasCount == 1 && !bForce && eForceFunc == SUBTOTAL_FUNC_NONE ) ) @@ -891,7 +891,7 @@ String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFu String aRet; ScSubTotalFunc eFunc = ( eForceFunc == SUBTOTAL_FUNC_NONE ) ? GetMeasureFunction(nMeasure) : eForceFunc; - USHORT nId = nFuncStrIds[eFunc]; + sal_uInt16 nId = nFuncStrIds[eFunc]; if (nId) { aRet += ScGlobal::GetRscString(nId); // function name @@ -914,7 +914,7 @@ String ScDPResultData::GetMeasureDimensionName(long nMeasure) const return pSource->GetDataDimName( nMeasure ); } -BOOL ScDPResultData::IsBaseForGroup( long nDim ) const +sal_Bool ScDPResultData::IsBaseForGroup( long nDim ) const { return pSource->GetData()->IsBaseForGroup( nDim ); } @@ -924,38 +924,38 @@ long ScDPResultData::GetGroupBase( long nGroupDim ) const return pSource->GetData()->GetGroupBase( nGroupDim ); } -BOOL ScDPResultData::IsNumOrDateGroup( long nDim ) const +sal_Bool ScDPResultData::IsNumOrDateGroup( long nDim ) const { return pSource->GetData()->IsNumOrDateGroup( nDim ); } -BOOL ScDPResultData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, +sal_Bool ScDPResultData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex, long nBaseDataId, long nBaseIndex ) const { const ScDPItemData* pData = pSource->GetItemDataById( nGroupIndex , nBaseDataId); if ( pData ) return pSource->GetData()->IsInGroup( rGroupData, nGroupIndex, *pData , nBaseIndex ); else - return FALSE; + return false; } -BOOL ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex, +sal_Bool ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex, const ScDPItemData& rBaseData, long nBaseIndex ) const { const ScDPItemData* pGroupData = pSource->GetItemDataById( nGroupIndex , nGroupDataId); if ( pGroupData ) return pSource->GetData()->IsInGroup( *pGroupData, nGroupIndex, rBaseData , nBaseIndex ); else - return FALSE; + return false; } -BOOL ScDPResultData::HasCommonElement(/* const ScDPItemData& rFirstData*/SCROW nFirstDataId, long nFirstIndex, +sal_Bool ScDPResultData::HasCommonElement(/* const ScDPItemData& rFirstData*/SCROW nFirstDataId, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const { const ScDPItemData* pFirstData = pSource->GetItemDataById( nFirstIndex , nFirstDataId); if ( pFirstData ) return pSource->GetData()->HasCommonElement( *pFirstData, nFirstIndex, rSecondData, nSecondIndex ); else - return FALSE; + return false; } const ScDPSource* ScDPResultData::GetSource() const @@ -997,31 +997,31 @@ ResultMembers* ScDPResultData::GetDimResultMembers( long nDim , ScDPDimension* ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, const ScDPParentDimData& rParentDimData , - BOOL bForceSub ) : + sal_Bool bForceSub ) : pResultData( pData ), aParentDimData( rParentDimData ), pChildDimension( NULL ), pDataRoot( NULL ), - bHasElements( FALSE ), + bHasElements( false ), bForceSubTotal( bForceSub ), - bHasHiddenDetails( FALSE ), - bInitialized( FALSE ), - bAutoHidden( FALSE ), + bHasHiddenDetails( false ), + bInitialized( false ), + bAutoHidden( false ), nMemberStep( 1 ) { // pParentLevel/pMemberDesc is 0 for root members } ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, - BOOL bForceSub ) : + sal_Bool bForceSub ) : pResultData( pData ), pChildDimension( NULL ), pDataRoot( NULL ), - bHasElements( FALSE ), + bHasElements( false ), bForceSubTotal( bForceSub ), - bHasHiddenDetails( FALSE ), - bInitialized( FALSE ), - bAutoHidden( FALSE ), + bHasHiddenDetails( false ), + bInitialized( false ), + bAutoHidden( false ), nMemberStep( 1 ) { } @@ -1049,13 +1049,13 @@ void ScDPResultMember::FillItemData( ScDPItemData& rData ) const rData.SetString( ScGlobal::GetRscString(STR_PIVOT_TOTAL) ); // root member } -BOOL ScDPResultMember::IsNamedItem( SCROW nIndex ) const +sal_Bool ScDPResultMember::IsNamedItem( SCROW nIndex ) const { //! store ScDPMember pointer instead of ScDPMember ??? const ScDPMember* pMemberDesc = GetDPMember(); if (pMemberDesc) return ((ScDPMember*)pMemberDesc)->IsNamedItem( nIndex ); - return FALSE; + return false; } bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const @@ -1079,13 +1079,13 @@ bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, size_t nPos, ScDPInitState& rInitState , - BOOL bInitChild /*= TRUE */) + sal_Bool bInitChild /*= sal_True */) { // with LateInit, initialize only those members that have data if ( pResultData->IsLateInit() ) return; - bInitialized = TRUE; + bInitialized = sal_True; if (nPos >= ppDim.size()) return; @@ -1101,7 +1101,7 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect { if ( !pChildDimension ) pChildDimension = new ScDPResultDimension( pResultData ); - pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , FALSE ); + pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , false ); return; } else @@ -1110,14 +1110,14 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect nMemberStep ++; } } - bHasHiddenDetails = TRUE; // only if there is a next dimension + bHasHiddenDetails = true; // only if there is a next dimension return; } if ( bInitChild ) { pChildDimension = new ScDPResultDimension( pResultData ); - pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState, TRUE ); + pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState, sal_True ); } } @@ -1129,7 +1129,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD if ( !pResultData->IsLateInit() ) return; - bInitialized = TRUE; + bInitialized = sal_True; if ( rParams.IsEnd( nPos ) /*nPos >= ppDim.size()*/) // No next dimension. Bail out. @@ -1149,8 +1149,8 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD // #i111462# reset InitChild flag only for this child dimension's LateInitFrom call, // not for following members of parent dimensions - BOOL bWasInitChild = rParams.GetInitChild(); - rParams.SetInitChild( FALSE ); + sal_Bool bWasInitChild = rParams.GetInitChild(); + rParams.SetInitChild( false ); pChildDimension->LateInitFrom( rParams, pItemData, nPos, rInitState ); rParams.SetInitChild( bWasInitChild ); return; @@ -1161,7 +1161,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD nMemberStep ++; } } - bHasHiddenDetails = TRUE; // only if there is a next dimension + bHasHiddenDetails = true; // only if there is a next dimension return; } @@ -1174,9 +1174,9 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD } } -BOOL ScDPResultMember::IsSubTotalInTitle(long nMeasure) const +sal_Bool ScDPResultMember::IsSubTotalInTitle(long nMeasure) const { - BOOL bRet = FALSE; + sal_Bool bRet = false; if ( pChildDimension && /*pParentLevel*/GetParentLevel() && /*pParentLevel*/GetParentLevel()->IsOutlineLayout() && /*pParentLevel*/GetParentLevel()->IsSubtotalsAtTop() ) { @@ -1190,7 +1190,7 @@ BOOL ScDPResultMember::IsSubTotalInTitle(long nMeasure) const // only a single subtotal row will be shown in the outline title row if ( nSubTotals == 1 ) - bRet = TRUE; + bRet = sal_True; } } return bRet; @@ -1233,7 +1233,7 @@ long ScDPResultMember::GetSize(long nMeasure) const } } -BOOL ScDPResultMember::IsVisible() const +sal_Bool ScDPResultMember::IsVisible() const { // not initialized -> shouldn't be there at all // (allocated only to preserve ordering) @@ -1241,22 +1241,22 @@ BOOL ScDPResultMember::IsVisible() const return ( bHasElements || ( pParentLevel && pParentLevel->getShowEmpty() ) ) && IsValid() && bInitialized; } -BOOL ScDPResultMember::IsValid() const +sal_Bool ScDPResultMember::IsValid() const { // non-Valid members are left out of calculation // was member set no invisible at the DataPilotSource? const ScDPMember* pMemberDesc =GetDPMember(); if ( pMemberDesc && !pMemberDesc->getIsVisible() ) - return FALSE; + return false; if ( bAutoHidden ) - return FALSE; + return false; - return TRUE; + return sal_True; } -BOOL ScDPResultMember::HasHiddenDetails() const +sal_Bool ScDPResultMember::HasHiddenDetails() const { // bHasHiddenDetails is set only if the "show details" flag is off, // and there was a child dimension to skip @@ -1361,7 +1361,7 @@ static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaptio } void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pSequences, - long& rPos, long nMeasure, BOOL bRoot, + long& rPos, long nMeasure, sal_Bool bRoot, const String* pMemberName, const String* pMemberCaption ) { @@ -1372,7 +1372,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS sheet::MemberResult* pArray = pSequences->getArray(); DBG_ASSERT( rPos+nSize <= pSequences->getLength(), "bumm" ); - BOOL bIsNumeric = FALSE; + sal_Bool bIsNumeric = false; String aName; if ( pMemberName ) // if pMemberName != NULL, use instead of real member name aName = *pMemberName; @@ -1388,7 +1388,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS { // Numeric group dimensions use numeric entries for proper sorting, // but the group titles must be output as text. - bIsNumeric = FALSE; + bIsNumeric = false; } String aCaption = aName; @@ -1429,15 +1429,15 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS if ( pParentLevel && pParentLevel->IsAddEmpty() ) ++nExtraSpace; - BOOL bTitleLine = FALSE; + sal_Bool bTitleLine = false; if ( pParentLevel && pParentLevel->IsOutlineLayout() ) - bTitleLine = TRUE; + bTitleLine = sal_True; // if the subtotals are shown at the top (title row) in outline layout, // no extra row for the subtotals is needed - BOOL bSubTotalInTitle = IsSubTotalInTitle( nMeasure ); + sal_Bool bSubTotalInTitle = IsSubTotalInTitle( nMeasure ); - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); if (bHasChild) { if ( bTitleLine ) // in tabular layout the title is on a separate row @@ -1478,7 +1478,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS bool bTotalResult = false; String aSubStr = aCaption; aSubStr += ' '; - aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce, bTotalResult); + aSubStr += pResultData->GetMeasureString(nMemberMeasure, false, eForce, bTotalResult); if (bTotalResult) { @@ -1549,13 +1549,13 @@ void ScDPResultMember::FillDataResults( const ScDPResultMember* pRefMember, if ( pParentLevel && pParentLevel->IsAddEmpty() ) ++nExtraSpace; - BOOL bTitleLine = FALSE; + sal_Bool bTitleLine = false; if ( pParentLevel && pParentLevel->IsOutlineLayout() ) - bTitleLine = TRUE; + bTitleLine = sal_True; - BOOL bSubTotalInTitle = IsSubTotalInTitle( nMeasure ); + sal_Bool bSubTotalInTitle = IsSubTotalInTitle( nMeasure ); - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); if (bHasChild) { if ( bTitleLine ) // in tabular layout the title is on a separate row @@ -1639,7 +1639,7 @@ void ScDPResultMember::UpdateDataResults( const ScDPResultMember* pRefMember, lo // IsVisible() test is in ScDPResultDimension::FillDataResults // (not on data layout dimension) - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); long nUserSubCount = GetSubTotalCount(); // process subtotals even if not shown @@ -1686,7 +1686,7 @@ void ScDPResultMember::UpdateDataResults( const ScDPResultMember* pRefMember, lo void ScDPResultMember::SortMembers( ScDPResultMember* pRefMember ) { - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); if (bHasChild) pChildDimension->SortMembers( pRefMember ); // sorting is done at the dimension @@ -1701,7 +1701,7 @@ void ScDPResultMember::SortMembers( ScDPResultMember* pRefMember ) void ScDPResultMember::DoAutoShow( ScDPResultMember* pRefMember ) { - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); if (bHasChild) pChildDimension->DoAutoShow( pRefMember ); // sorting is done at the dimension @@ -1714,7 +1714,7 @@ void ScDPResultMember::DoAutoShow( ScDPResultMember* pRefMember ) } } -void ScDPResultMember::ResetResults( BOOL /*bRoot*/ ) +void ScDPResultMember::ResetResults( sal_Bool /*bRoot*/ ) { if (pDataRoot) pDataRoot->ResetResults(); @@ -1723,7 +1723,7 @@ void ScDPResultMember::ResetResults( BOOL /*bRoot*/ ) pChildDimension->ResetResults(); // if (!bRoot) - // bHasElements = FALSE; + // bHasElements = sal_False; } void ScDPResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, long nMeasure, @@ -1734,7 +1734,7 @@ void ScDPResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, rTotals.SetInColRoot( IsRoot() ); - BOOL bHasChild = ( pChildDimension != NULL ); + sal_Bool bHasChild = ( pChildDimension != NULL ); long nUserSubCount = GetSubTotalCount(); //if ( nUserSubCount || !bHasChild ) @@ -1827,28 +1827,28 @@ String ScDPDataMember::GetName() const return EMPTY_STRING; } -BOOL ScDPDataMember::IsVisible() const +sal_Bool ScDPDataMember::IsVisible() const { if (pResultMember) return pResultMember->IsVisible(); else - return FALSE; + return false; } -BOOL ScDPDataMember::IsNamedItem( /*const ScDPItemData& r*/SCROW r ) const +sal_Bool ScDPDataMember::IsNamedItem( /*const ScDPItemData& r*/SCROW r ) const { if (pResultMember) return pResultMember->IsNamedItem(r); else - return FALSE; + return false; } -BOOL ScDPDataMember::HasHiddenDetails() const +sal_Bool ScDPDataMember::HasHiddenDetails() const { if (pResultMember) return pResultMember->HasHiddenDetails(); else - return FALSE; + return false; } void ScDPDataMember::InitFrom( const ScDPResultDimension* pDim ) @@ -1938,26 +1938,26 @@ void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const ve pChildDimension->ProcessData( aChildMembers, aValues, rSubState ); // with unmodified subtotal state } -BOOL ScDPDataMember::HasData( long nMeasure, const ScDPSubTotalState& rSubState ) const +sal_Bool ScDPDataMember::HasData( long nMeasure, const ScDPSubTotalState& rSubState ) const { if ( rSubState.eColForce != SUBTOTAL_FUNC_NONE && rSubState.eRowForce != SUBTOTAL_FUNC_NONE && rSubState.eColForce != rSubState.eRowForce ) - return FALSE; + return false; // HasData can be different between measures! const ScDPAggData* pAgg = GetConstAggData( nMeasure, rSubState ); if (!pAgg) - return FALSE; //! error? + return false; //! error? return pAgg->HasData(); } -BOOL ScDPDataMember::HasError( long nMeasure, const ScDPSubTotalState& rSubState ) const +sal_Bool ScDPDataMember::HasError( long nMeasure, const ScDPSubTotalState& rSubState ) const { const ScDPAggData* pAgg = GetConstAggData( nMeasure, rSubState ); if (!pAgg) - return TRUE; + return sal_True; return pAgg->HasError(); } @@ -2013,7 +2013,7 @@ const ScDPAggData* ScDPDataMember::GetConstAggData( long nMeasure, const ScDPSub void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, uno::Sequence<sheet::DataResult>& rSequence, - long& rCol, long nMeasure, BOOL bIsSubTotalRow, + long& rCol, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); @@ -2031,15 +2031,15 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, if ( pRefParentLevel && pRefParentLevel->IsAddEmpty() ) ++nExtraSpace; - BOOL bTitleLine = FALSE; + sal_Bool bTitleLine = false; if ( pRefParentLevel && pRefParentLevel->IsOutlineLayout() ) - bTitleLine = TRUE; + bTitleLine = sal_True; - BOOL bSubTotalInTitle = pRefMember->IsSubTotalInTitle( nMeasure ); + sal_Bool bSubTotalInTitle = pRefMember->IsSubTotalInTitle( nMeasure ); // leave space for children even if the DataMember hasn't been initialized // (pDataChild is null then, this happens when no values for it are in this row) - BOOL bHasChild = ( pRefChild != NULL ); + sal_Bool bHasChild = ( pRefChild != NULL ); if ( bHasChild ) { @@ -2048,7 +2048,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, if ( pDataChild ) pDataChild->FillDataRow( pRefChild, rSequence, rCol, nMeasure, bIsSubTotalRow, rSubState ); - rCol += (USHORT)pRefMember->GetSize( nMeasure ); + rCol += (sal_uInt16)pRefMember->GetSize( nMeasure ); if ( bTitleLine ) // title column is included in GetSize, so the following --rCol; // positions are calculated with the normal values @@ -2131,7 +2131,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, } void ScDPDataMember::UpdateDataRow( const ScDPResultMember* pRefMember, - long nMeasure, BOOL bIsSubTotalRow, + long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) { DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); @@ -2142,7 +2142,7 @@ void ScDPDataMember::UpdateDataRow( const ScDPResultMember* pRefMember, // leave space for children even if the DataMember hasn't been initialized // (pDataChild is null then, this happens when no values for it are in this row) - BOOL bHasChild = ( pRefChild != NULL ); + sal_Bool bHasChild = ( pRefChild != NULL ); // process subtotals even if not shown long nUserSubCount = pRefMember->GetSubTotalCount(); @@ -2239,7 +2239,7 @@ void ScDPDataMember::ResetResults() } void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, - long nMeasure, BOOL bIsSubTotalRow, + long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState, ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals, const ScDPResultMember& rRowParent ) { @@ -2250,11 +2250,11 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, const ScDPDataDimension* pDataChild = GetChildDimension(); const ScDPResultDimension* pRefChild = pRefMember->GetChildDimension(); - BOOL bIsRoot = ( pResultMember == NULL || pResultMember->GetParentLevel() == NULL ); + sal_Bool bIsRoot = ( pResultMember == NULL || pResultMember->GetParentLevel() == NULL ); // leave space for children even if the DataMember hasn't been initialized // (pDataChild is null then, this happens when no values for it are in this row) - BOOL bHasChild = ( pRefChild != NULL ); + sal_Bool bHasChild = ( pRefChild != NULL ); long nUserSubCount = pRefMember->GetSubTotalCount(); { @@ -2295,8 +2295,8 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE || eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE ) { - BOOL bRunningTotal = ( eRefType == sheet::DataPilotFieldReferenceType::RUNNING_TOTAL ); - BOOL bRelative = + sal_Bool bRunningTotal = ( eRefType == sheet::DataPilotFieldReferenceType::RUNNING_TOTAL ); + sal_Bool bRelative = ( aReferenceValue.ReferenceItemType != sheet::DataPilotFieldReferenceItemType::NAMED && !bRunningTotal ); long nRelativeDir = bRelative ? ( ( aReferenceValue.ReferenceItemType == sheet::DataPilotFieldReferenceItemType::PREVIOUS ) ? -1 : 1 ) : 0; @@ -2309,9 +2309,9 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, String aRefFieldName = aReferenceValue.ReferenceField; //! aLocalSubState? - USHORT nRefOrient = pResultData->GetMeasureRefOrient( nMemberMeasure ); - BOOL bRefDimInCol = ( nRefOrient == sheet::DataPilotFieldOrientation_COLUMN ); - BOOL bRefDimInRow = ( nRefOrient == sheet::DataPilotFieldOrientation_ROW ); + sal_uInt16 nRefOrient = pResultData->GetMeasureRefOrient( nMemberMeasure ); + sal_Bool bRefDimInCol = ( nRefOrient == sheet::DataPilotFieldOrientation_COLUMN ); + sal_Bool bRefDimInRow = ( nRefOrient == sheet::DataPilotFieldOrientation_ROW ); const ScDPResultDimension* pSelectDim = NULL; long nRowPos = 0; @@ -2355,7 +2355,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, pSelectDim = NULL; } - BOOL bNoDetailsInRef = FALSE; + sal_Bool bNoDetailsInRef = false; if ( pSelectDim && bRunningTotal ) { // Running totals: @@ -2370,7 +2370,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, if ( pMyRefMember && pMyRefMember->HasHiddenDetails() ) { pSelectDim = NULL; // don't calculate - bNoDetailsInRef = TRUE; // show error, not empty + bNoDetailsInRef = sal_True; // show error, not empty } } } @@ -2389,17 +2389,17 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, // - Otherwise, the error isn't strictly necessary, but shown for // consistency. - BOOL bInnerNoDetails = bRefDimInCol ? HasHiddenDetails() : - ( bRefDimInRow ? rRowParent.HasHiddenDetails() : TRUE ); + sal_Bool bInnerNoDetails = bRefDimInCol ? HasHiddenDetails() : + ( bRefDimInRow ? rRowParent.HasHiddenDetails() : sal_True ); if ( bInnerNoDetails ) { pSelectDim = NULL; - bNoDetailsInRef = TRUE; // show error, not empty + bNoDetailsInRef = sal_True; // show error, not empty } } if ( !bRefDimInCol && !bRefDimInRow ) // invalid dimension specified - bNoDetailsInRef = TRUE; // pSelectDim is then already NULL + bNoDetailsInRef = sal_True; // pSelectDim is then already NULL // // get the member for the reference item and do the calculation @@ -2437,7 +2437,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, fTotal += pAggData->GetResult(); pSelectData->SetAuxiliary( fTotal ); pAggData->SetResult( fTotal ); - pAggData->SetEmpty(FALSE); // always display + pAggData->SetEmpty(false); // always display } } else @@ -2446,7 +2446,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, else if (bNoDetailsInRef) pAggData->SetError(); else - pAggData->SetEmpty(TRUE); // empty (dim set to 0 above) + pAggData->SetEmpty(sal_True); // empty (dim set to 0 above) } else { @@ -2483,7 +2483,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, if ( pSelectMember == this && eRefType != sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE ) { - pAggData->SetEmpty(TRUE); + pAggData->SetEmpty(sal_True); } else if ( pSelectMember ) { @@ -2497,7 +2497,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, double fOtherResult = pOtherAggData->GetAuxiliary(); double fThisResult = pAggData->GetResult(); - BOOL bError = FALSE; + sal_Bool bError = false; switch ( eRefType ) { case sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE: @@ -2505,13 +2505,13 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, break; case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE: if ( fOtherResult == 0.0 ) - bError = TRUE; + bError = sal_True; else fThisResult = fThisResult / fOtherResult; break; case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE: if ( fOtherResult == 0.0 ) - bError = TRUE; + bError = sal_True; else fThisResult = ( fThisResult - fOtherResult ) / fOtherResult; break; @@ -2525,20 +2525,20 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, else { pAggData->SetResult(fThisResult); - pAggData->SetEmpty(FALSE); // always display + pAggData->SetEmpty(false); // always display } //! errors in data? } } else if (bRelative && !bNoDetailsInRef) - pAggData->SetEmpty(TRUE); // empty + pAggData->SetEmpty(sal_True); // empty else pAggData->SetError(); // error } else if (bNoDetailsInRef) pAggData->SetError(); // error else - pAggData->SetEmpty(TRUE); // empty + pAggData->SetEmpty(sal_True); // empty } } else if ( eRefType == sheet::DataPilotFieldReferenceType::ROW_PERCENTAGE || @@ -2642,16 +2642,16 @@ private: const ScDPResultData* pResultData; const ScDPInitState& rInitState; long nDimSource; - BOOL bIncludeAll; - BOOL bIsBase; + sal_Bool bIncludeAll; + sal_Bool bIsBase; long nGroupBase; SCROW nBaseDataId; public: ScDPGroupCompare( const ScDPResultData* pData, const ScDPInitState& rState, long nDimension ); ~ScDPGroupCompare() {} - BOOL IsIncluded( const ScDPMember& rMember ) { return bIncludeAll || TestIncluded( rMember ); } - BOOL TestIncluded( const ScDPMember& rMember ); + sal_Bool IsIncluded( const ScDPMember& rMember ) { return bIncludeAll || TestIncluded( rMember ); } + sal_Bool TestIncluded( const ScDPMember& rMember ); }; ScDPGroupCompare::ScDPGroupCompare( const ScDPResultData* pData, const ScDPInitState& rState, long nDimension ) : @@ -2669,9 +2669,9 @@ ScDPGroupCompare::ScDPGroupCompare( const ScDPResultData* pData, const ScDPInitS bIncludeAll = !( bIsBase || nGroupBase >= 0 ); } -BOOL ScDPGroupCompare::TestIncluded( const ScDPMember& rMember ) +sal_Bool ScDPGroupCompare::TestIncluded( const ScDPMember& rMember ) { - BOOL bInclude = TRUE; + sal_Bool bInclude = sal_True; if ( nBaseDataId >=0 ) { ScDPItemData aMemberData; @@ -2723,13 +2723,13 @@ BOOL ScDPGroupCompare::TestIncluded( const ScDPMember& rMember ) ScDPResultDimension::ScDPResultDimension( const ScDPResultData* pData ) : pResultData( pData ), - bInitialized( FALSE ), - bIsDataLayout( FALSE ), - bSortByData( FALSE ), - bSortAscending( FALSE ), + bInitialized( false ), + bIsDataLayout( false ), + bSortByData( false ), + bSortAscending( false ), nSortMeasure( 0 ), - bAutoShow( FALSE ), - bAutoTopItems( FALSE ), + bAutoShow( false ), + bAutoTopItems( false ), nAutoMeasure( 0 ), nAutoCount( 0 ) { @@ -2766,7 +2766,7 @@ ScDPResultMember *ScDPResultDimension::FindMember( SCROW iData ) const } void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, - size_t nPos, ScDPInitState& rInitState, BOOL bInitChild /*= TRUE */ ) + size_t nPos, ScDPInitState& rInitState, sal_Bool bInitChild /*= sal_True */ ) { if (nPos >= ppDim.size() || nPos >= ppLev.size()) { @@ -2790,7 +2790,7 @@ void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const v const sheet::DataPilotFieldAutoShowInfo& rAutoInfo = pThisLevel->GetAutoShow(); if ( rAutoInfo.IsEnabled ) { - bAutoShow = TRUE; + bAutoShow = sal_True; bAutoTopItems = ( rAutoInfo.ShowItemsMode == sheet::DataPilotFieldShowItemsMode::FROM_TOP ); nAutoMeasure = pThisLevel->GetAutoMeasure(); nAutoCount = rAutoInfo.ItemCount; @@ -2800,7 +2800,7 @@ void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const v const sheet::DataPilotFieldSortInfo& rSortInfo = pThisLevel->GetSortInfo(); if ( rSortInfo.Mode == sheet::DataPilotFieldSortMode::DATA ) { - bSortByData = TRUE; + bSortByData = sal_True; bSortAscending = rSortInfo.IsAscending; nSortMeasure = pThisLevel->GetSortMeasure(); } @@ -2829,7 +2829,7 @@ void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const v rInitState.RemoveMember(); } } - bInitialized = TRUE; + bInitialized = sal_True; } void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev*/, @@ -2850,7 +2850,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S long nDimSource = pThisDim->GetDimension(); //! check GetSourceDim? - BOOL bShowEmpty = pThisLevel->getShowEmpty(); + sal_Bool bShowEmpty = pThisLevel->getShowEmpty(); if ( !bInitialized ) { // init some values @@ -2861,7 +2861,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S const sheet::DataPilotFieldAutoShowInfo& rAutoInfo = pThisLevel->GetAutoShow(); if ( rAutoInfo.IsEnabled ) { - bAutoShow = TRUE; + bAutoShow = sal_True; bAutoTopItems = ( rAutoInfo.ShowItemsMode == sheet::DataPilotFieldShowItemsMode::FROM_TOP ); nAutoMeasure = pThisLevel->GetAutoMeasure(); nAutoCount = rAutoInfo.ItemCount; @@ -2870,7 +2870,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S const sheet::DataPilotFieldSortInfo& rSortInfo = pThisLevel->GetSortInfo(); if ( rSortInfo.Mode == sheet::DataPilotFieldSortMode::DATA ) { - bSortByData = TRUE; + bSortByData = sal_True; bSortAscending = rSortInfo.IsAscending; nSortMeasure = pThisLevel->GetSortMeasure(); } @@ -2887,7 +2887,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S if ( pMembers->IsHasHideDetailsMembers() ) DBG_TRACE ( "HasHideDetailsMembers" ); #endif - pMembers->SetHasHideDetailsMembers( FALSE ); + pMembers->SetHasHideDetailsMembers( false ); } bool bNewAllMembers =(!rParams.IsRow()) || nPos == 0 || bLateInitAllMembers ; @@ -2913,7 +2913,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S AddMember( aData ); } } - bInitialized = TRUE; // don't call again, even if no members were included + bInitialized = sal_True; // don't call again, even if no members were included } // initialize only specific member (or all if "show empty" flag is set) if ( bLateInitAllMembers ) @@ -2924,13 +2924,13 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S ScDPResultMember* pResultMember = maMemberArray[i]; // check show empty - BOOL bAllChildren = FALSE; + sal_Bool bAllChildren = false; if( bShowEmpty ) { if ( pResultMember->IsNamedItem( rThisData ) ) - bAllChildren = FALSE; + bAllChildren = false; else - bAllChildren = TRUE; + bAllChildren = sal_True; } rParams.SetInitAllChildren( bAllChildren ); rInitState.AddMember( nDimSource, pResultMember->GetDataId() ); @@ -3029,11 +3029,11 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence<sheet::MemberResult>* { bool bTotalResult = false; String aMbrName = pResultData->GetMeasureDimensionName( nSorted ); - String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE, bTotalResult ); - maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, FALSE, &aMbrName, &aMbrCapt ); + String aMbrCapt = pResultData->GetMeasureString( nSorted, false, SUBTOTAL_FUNC_NONE, bTotalResult ); + maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, false, &aMbrName, &aMbrCapt ); } else if ( pMember->IsVisible() ) - pMember->FillMemberResults( pSequences, nPos, nMeasure, FALSE, NULL, NULL ); + pMember->FillMemberResults( pSequences, nPos, nMeasure, false, NULL, NULL ); // nPos is modified } } @@ -3150,10 +3150,10 @@ void ScDPResultDimension::DoAutoShow( ScDPResultMember* pRefMember ) long nIncluded = nAutoCount; const ScDPResultMember* pMember1 = maMemberArray[aAutoOrder[nIncluded - 1]]; const ScDPDataMember* pDataMember1 = pMember1->IsVisible() ? pMember1->GetDataRoot() : NULL; - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while ( bContinue ) { - bContinue = FALSE; + bContinue = false; if ( nIncluded < nCount ) { const ScDPResultMember* pMember2 = maMemberArray[aAutoOrder[nIncluded]]; @@ -3162,7 +3162,7 @@ void ScDPResultDimension::DoAutoShow( ScDPResultMember* pRefMember ) if ( lcl_IsEqual( pDataMember1, pDataMember2, nAutoMeasure ) ) { ++nIncluded; // include more members if values are equal - bContinue = TRUE; + bContinue = sal_True; } } } @@ -3184,7 +3184,7 @@ void ScDPResultDimension::ResetResults() { // sort order doesn't matter ScDPResultMember* pMember = maMemberArray[bIsDataLayout ? 0 : i]; - pMember->ResetResults( FALSE ); + pMember->ResetResults( false ); } } @@ -3234,7 +3234,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo ScDPDataMember* pColMember = NULL; - BOOL bFirstExisting = ( pRelativePos == NULL && pName == NULL ); + sal_Bool bFirstExisting = ( pRelativePos == NULL && pName == NULL ); long nMemberCount = maMemberArray.size(); long nMemberIndex = 0; // unsorted long nDirection = 1; // forward if no relative position is used @@ -3262,7 +3262,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo } } - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while ( bContinue && nMemberIndex >= 0 && nMemberIndex < nMemberCount ) { const ScDPResultMember* pRowMember = maMemberArray[GetSortedIndex(nMemberIndex)]; @@ -3368,7 +3368,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember( const ScDPRelativePo { long nReferenceCount = pReferenceDim->GetMemberCount(); - BOOL bFirstExisting = ( pRelativePos == NULL && pName == NULL ); + sal_Bool bFirstExisting = ( pRelativePos == NULL && pName == NULL ); long nMemberIndex = 0; // unsorted long nDirection = 1; // forward if no relative position is used pColMember = NULL; // don't use parent dimension's member if none found @@ -3394,7 +3394,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember( const ScDPRelativePo } } - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while ( bContinue && nMemberIndex >= 0 && nMemberIndex < nReferenceCount ) { pColMember = pReferenceDim->GetMember( pReferenceDim->GetSortedIndex( nMemberIndex ) ); @@ -3498,7 +3498,7 @@ void ScDPResultDimension::FillVisibilityData(ScDPResultVisibilityData& rData) co ScDPDataDimension::ScDPDataDimension( const ScDPResultData* pData ) : pResultData( pData ), pResultDimension( NULL ), - bIsDataLayout( FALSE ) + bIsDataLayout( false ) { } @@ -3544,7 +3544,7 @@ void ScDPDataDimension::ProcessData( const vector< SCROW >& aDataMembers, const long nCount = aMembers.Count(); for (long i=0; i<nCount; i++) { - ScDPDataMember* pMember = aMembers[(USHORT)i]; + ScDPDataMember* pMember = aMembers[(sal_uInt16)i]; // always first member for data layout dim if ( bIsDataLayout || ( !aDataMembers.empty() && pMember->IsNamedItem(aDataMembers[0]) ) ) @@ -3565,7 +3565,7 @@ void ScDPDataDimension::ProcessData( const vector< SCROW >& aDataMembers, const void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, uno::Sequence<sheet::DataResult>& rSequence, - long nCol, long nMeasure, BOOL bIsSubTotalRow, + long nCol, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); @@ -3592,7 +3592,7 @@ void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, const ScDPResultMember* pRefMember = pRefDim->GetMember(nMemberPos); if ( pRefMember->IsVisible() ) //! here or in ScDPDataMember::FillDataRow ??? { - const ScDPDataMember* pDataMember = aMembers[(USHORT)nMemberPos]; + const ScDPDataMember* pDataMember = aMembers[(sal_uInt16)nMemberPos]; pDataMember->FillDataRow( pRefMember, rSequence, nMemberCol, nMemberMeasure, bIsSubTotalRow, rSubState ); // nMemberCol is modified } @@ -3600,7 +3600,7 @@ void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, } void ScDPDataDimension::UpdateDataRow( const ScDPResultDimension* pRefDim, - long nMeasure, BOOL bIsSubTotalRow, + long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); @@ -3621,7 +3621,7 @@ void ScDPDataDimension::UpdateDataRow( const ScDPResultDimension* pRefDim, // Calculate must be called even if the member is not visible (for use as reference value) const ScDPResultMember* pRefMember = pRefDim->GetMember(nMemberPos); - ScDPDataMember* pDataMember = aMembers[(USHORT)nMemberPos]; + ScDPDataMember* pDataMember = aMembers[(sal_uInt16)nMemberPos]; pDataMember->UpdateDataRow( pRefMember, nMemberMeasure, bIsSubTotalRow, rSubState ); } } @@ -3656,7 +3656,7 @@ void ScDPDataDimension::SortMembers( ScDPResultDimension* pRefDim ) ScDPResultMember* pRefMember = pRefDim->GetMember(i); if ( pRefMember->IsVisible() ) //! here or in ScDPDataMember ??? { - ScDPDataMember* pDataMember = aMembers[(USHORT)i]; + ScDPDataMember* pDataMember = aMembers[(sal_uInt16)i]; pDataMember->SortMembers( pRefMember ); } } @@ -3678,7 +3678,7 @@ void ScDPDataDimension::DoAutoShow( ScDPResultDimension* pRefDim ) ScDPResultMember* pRefMember = pRefDim->GetMember(i); if ( pRefMember->IsVisible() ) //! here or in ScDPDataMember ??? { - ScDPDataMember* pDataMember = aMembers[(USHORT)i]; + ScDPDataMember* pDataMember = aMembers[(sal_uInt16)i]; pDataMember->DoAutoShow( pRefMember ); } } @@ -3699,23 +3699,23 @@ void ScDPDataDimension::DoAutoShow( ScDPResultDimension* pRefDim ) // look for equal values to the last included one long nIncluded = pRefDim->GetAutoCount(); - ScDPDataMember* pDataMember1 = aMembers[(USHORT)aAutoOrder[nIncluded - 1]]; + ScDPDataMember* pDataMember1 = aMembers[(sal_uInt16)aAutoOrder[nIncluded - 1]]; if ( !pDataMember1->IsVisible() ) pDataMember1 = NULL; - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while ( bContinue ) { - bContinue = FALSE; + bContinue = false; if ( nIncluded < nCount ) { - ScDPDataMember* pDataMember2 = aMembers[(USHORT)aAutoOrder[nIncluded]]; + ScDPDataMember* pDataMember2 = aMembers[(sal_uInt16)aAutoOrder[nIncluded]]; if ( !pDataMember2->IsVisible() ) pDataMember2 = NULL; if ( lcl_IsEqual( pDataMember1, pDataMember2, pRefDim->GetAutoMeasure() ) ) { ++nIncluded; // include more members if values are equal - bContinue = TRUE; + bContinue = sal_True; } } } @@ -3738,7 +3738,7 @@ void ScDPDataDimension::ResetResults() // sort order doesn't matter long nMemberPos = bIsDataLayout ? 0 : i; - ScDPDataMember* pDataMember = aMembers[(USHORT)nMemberPos]; + ScDPDataMember* pDataMember = aMembers[(sal_uInt16)nMemberPos]; pDataMember->ResetResults(); } } @@ -3753,7 +3753,7 @@ long ScDPDataDimension::GetSortedIndex( long nUnsorted ) const } void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim, - long nMeasure, BOOL bIsSubTotalRow, + long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState, ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals, const ScDPResultMember& rRowParent ) const { @@ -3784,7 +3784,7 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim, else rRunning.AddColIndex( i, nSorted ); - ScDPDataMember* pDataMember = aMembers[(USHORT)nMemberPos]; + ScDPDataMember* pDataMember = aMembers[(sal_uInt16)nMemberPos]; pDataMember->UpdateRunningTotals( pRefMember, nMemberMeasure, bIsSubTotalRow, rSubState, rRunning, rTotals, rRowParent ); @@ -3804,7 +3804,7 @@ void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocumen for (long i=0; i<nCount; i++) { const ScDPResultMember* pRefMember = pRefDim->GetMember(i); - const ScDPDataMember* pDataMember = aMembers[(USHORT)i]; + const ScDPDataMember* pDataMember = aMembers[(sal_uInt16)i]; pDataMember->DumpState( pRefMember, pDoc, rPos ); } @@ -3818,7 +3818,7 @@ long ScDPDataDimension::GetMemberCount() const ScDPDataMember* ScDPDataDimension::GetMember(long n) const { - return aMembers[(USHORT)n]; + return aMembers[(sal_uInt16)n]; } // ---------------------------------------------------------------------------- @@ -3916,7 +3916,7 @@ SCROW ScDPResultMember::GetDataId( ) const ScDPResultMember* ScDPResultDimension::AddMember(const ScDPParentDimData &aData ) { - ScDPResultMember* pMember = new ScDPResultMember( pResultData, aData, FALSE ); + ScDPResultMember* pMember = new ScDPResultMember( pResultData, aData, false ); SCROW nDataIndex = pMember->GetDataId(); maMemberArray.push_back( pMember ); @@ -3930,7 +3930,7 @@ ScDPResultMember* ScDPResultDimension::InsertMember(ScDPParentDimData *pMemberDa SCROW nInsert = 0; if ( !lcl_SearchMember( maMemberArray, pMemberData->mnOrder , nInsert ) ) { //Member not exist - ScDPResultMember* pNew = new ScDPResultMember( pResultData, *pMemberData, FALSE ); + ScDPResultMember* pNew = new ScDPResultMember( pResultData, *pMemberData, false ); maMemberArray.insert( maMemberArray.begin()+nInsert, pNew ); SCROW nDataIndex = pMemberData->mpMemberDesc->GetItemDataId(); @@ -3964,7 +3964,7 @@ void ScDPResultDimension:: InitWithMembers( LateInitParams& rParams, if ( bInitialized ) pResultMember = FindMember( nDataID ); else - bInitialized = TRUE; + bInitialized = sal_True; if ( pResultMember == NULL ) { //only insert found item @@ -3993,12 +3993,12 @@ ScDPParentDimData* ResultMembers::FindMember( const SCROW& nIndex ) const void ResultMembers::InsertMember( ScDPParentDimData* pNew ) { if ( !pNew->mpMemberDesc->getShowDetails() ) - mbHasHideDetailsMember = TRUE; + mbHasHideDetailsMember = sal_True; maMemberHash.insert( std::pair< const SCROW, ScDPParentDimData *>( pNew->mpMemberDesc->GetItemDataId(), pNew ) ); } ResultMembers::ResultMembers(): - mbHasHideDetailsMember( FALSE ) + mbHasHideDetailsMember( false ) { } ResultMembers::~ResultMembers() @@ -4007,7 +4007,7 @@ ResultMembers::~ResultMembers() delete iter->second; } // ----------------------------------------------------------------------- -LateInitParams::LateInitParams( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, BOOL bRow, BOOL bInitChild, BOOL bAllChildren ): +LateInitParams::LateInitParams( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, sal_Bool bRow, sal_Bool bInitChild, sal_Bool bAllChildren ): mppDim( ppDim ), mppLev( ppLev ), mbRow( bRow ), @@ -4020,12 +4020,12 @@ LateInitParams::~LateInitParams() { } -BOOL LateInitParams::IsEnd( size_t nPos ) const +sal_Bool LateInitParams::IsEnd( size_t nPos ) const { return nPos >= mppDim.size(); } -void ScDPResultDimension::CheckShowEmpty( BOOL bShow ) +void ScDPResultDimension::CheckShowEmpty( sal_Bool bShow ) { long nCount = maMemberArray.size(); @@ -4038,7 +4038,7 @@ void ScDPResultDimension::CheckShowEmpty( BOOL bShow ) } -void ScDPResultMember::CheckShowEmpty( BOOL bShow ) +void ScDPResultMember::CheckShowEmpty( sal_Bool bShow ) { if ( bHasElements ) { @@ -4054,7 +4054,7 @@ void ScDPResultMember::CheckShowEmpty( BOOL bShow ) SetHasElements(); ScDPResultDimension* pChildDim = GetChildDimension(); if (pChildDim ) - pChildDim->CheckShowEmpty( TRUE ); + pChildDim->CheckShowEmpty( sal_True ); } } } diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 5adc233ece0f..366ca1495dd6 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -107,14 +107,14 @@ SC_SIMPLE_SERVICE_INFO( ScDPMember, "ScDPMember", "com.sun.star.sheet. // ----------------------------------------------------------------------- //! move to a header? -BOOL lcl_GetBoolFromAny( const uno::Any& aAny ) +sal_Bool lcl_GetBoolFromAny( const uno::Any& aAny ) { if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN ) return *(sal_Bool*)aAny.getValue(); - return FALSE; + return false; } -void lcl_SetBoolInAny( uno::Any& rAny, BOOL bValue ) +void lcl_SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) { rAny.setValue( &bValue, getBooleanCppuType() ); } @@ -128,17 +128,17 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : nRowDimCount( 0 ), nDataDimCount( 0 ), nPageDimCount( 0 ), - bColumnGrand( TRUE ), // default is true - bRowGrand( TRUE ), - bIgnoreEmptyRows( FALSE ), - bRepeatIfEmpty( FALSE ), + bColumnGrand( sal_True ), // default is true + bRowGrand( sal_True ), + bIgnoreEmptyRows( false ), + bRepeatIfEmpty( false ), nDupCount( 0 ), pResData( NULL ), pColResRoot( NULL ), pRowResRoot( NULL ), pColResults( NULL ), pRowResults( NULL ), - bResultOverflow( FALSE ), + bResultOverflow( false ), mpGrandTotalName(NULL) { pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); @@ -164,7 +164,7 @@ const ::rtl::OUString* ScDPSource::GetGrandTotalName() const return mpGrandTotalName.get(); } -USHORT ScDPSource::GetOrientation(long nColumn) +sal_uInt16 ScDPSource::GetOrientation(long nColumn) { long i; for (i=0; i<nColDimCount; i++) @@ -223,14 +223,14 @@ long ScDPSource::GetPosition(long nColumn) return 0; } -BOOL lcl_TestSubTotal( BOOL& rAllowed, long nColumn, long* pArray, long nCount, ScDPSource* pSource ) +sal_Bool lcl_TestSubTotal( sal_Bool& rAllowed, long nColumn, long* pArray, long nCount, ScDPSource* pSource ) { for (long i=0; i<nCount; i++) if (pArray[i] == nColumn) { // no subtotals for data layout dim, no matter where if ( pSource->IsDataLayoutDimension(nColumn) ) - rAllowed = FALSE; + rAllowed = false; else { // no subtotals if no other dim but data layout follows @@ -238,18 +238,18 @@ BOOL lcl_TestSubTotal( BOOL& rAllowed, long nColumn, long* pArray, long nCount, if ( nNextIndex < nCount && pSource->IsDataLayoutDimension(pArray[nNextIndex]) ) ++nNextIndex; if ( nNextIndex >= nCount ) - rAllowed = FALSE; + rAllowed = false; } - return TRUE; // found + return sal_True; // found } - return FALSE; + return false; } -BOOL ScDPSource::SubTotalAllowed(long nColumn) +sal_Bool ScDPSource::SubTotalAllowed(long nColumn) { //! cache this at ScDPResultData - BOOL bAllowed = TRUE; + sal_Bool bAllowed = sal_True; if ( lcl_TestSubTotal( bAllowed, nColumn, nColDims, nColDimCount, this ) ) return bAllowed; if ( lcl_TestSubTotal( bAllowed, nColumn, nRowDims, nRowDimCount, this ) ) @@ -269,7 +269,7 @@ void lcl_RemoveDim( long nRemove, long* pDims, long& rCount ) } } -void ScDPSource::SetOrientation(long nColumn, USHORT nNew) +void ScDPSource::SetOrientation(long nColumn, sal_uInt16 nNew) { //! change to no-op if new orientation is equal to old? @@ -303,17 +303,17 @@ void ScDPSource::SetOrientation(long nColumn, USHORT nNew) } } -BOOL ScDPSource::IsDataLayoutDimension(long nDim) +sal_Bool ScDPSource::IsDataLayoutDimension(long nDim) { return nDim == pData->GetColumnCount(); } -USHORT ScDPSource::GetDataLayoutOrientation() +sal_uInt16 ScDPSource::GetDataLayoutOrientation() { return GetOrientation(pData->GetColumnCount()); } -BOOL ScDPSource::IsDateDimension(long nDim) +sal_Bool ScDPSource::IsDateDimension(long nDim) { return pData->IsDateDimension(nDim); } @@ -493,7 +493,7 @@ String ScDPSource::getDataDescription() if ( pResData->GetMeasureCount() == 1 ) { bool bTotalResult = false; - aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE, bTotalResult ); + aRet = pResData->GetMeasureString( 0, sal_True, SUBTOTAL_FUNC_NONE, bTotalResult ); } // empty for more than one measure @@ -501,43 +501,43 @@ String ScDPSource::getDataDescription() return aRet; } -BOOL ScDPSource::getColumnGrand() const +sal_Bool ScDPSource::getColumnGrand() const { return bColumnGrand; } -void ScDPSource::setColumnGrand(BOOL bSet) +void ScDPSource::setColumnGrand(sal_Bool bSet) { bColumnGrand = bSet; } -BOOL ScDPSource::getRowGrand() const +sal_Bool ScDPSource::getRowGrand() const { return bRowGrand; } -void ScDPSource::setRowGrand(BOOL bSet) +void ScDPSource::setRowGrand(sal_Bool bSet) { bRowGrand = bSet; } -BOOL ScDPSource::getIgnoreEmptyRows() const +sal_Bool ScDPSource::getIgnoreEmptyRows() const { return bIgnoreEmptyRows; } -void ScDPSource::setIgnoreEmptyRows(BOOL bSet) +void ScDPSource::setIgnoreEmptyRows(sal_Bool bSet) { bIgnoreEmptyRows = bSet; pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); } -BOOL ScDPSource::getRepeatIfEmpty() const +sal_Bool ScDPSource::getRepeatIfEmpty() const { return bRepeatIfEmpty; } -void ScDPSource::setRepeatIfEmpty(BOOL bSet) +void ScDPSource::setRepeatIfEmpty(sal_Bool bSet) { bRepeatIfEmpty = bSet; pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); @@ -576,7 +576,7 @@ void ScDPSource::disposeData() nColDimCount = nRowDimCount = nDataDimCount = nPageDimCount = 0; pData->DisposeData(); // cached entries etc. - bResultOverflow = FALSE; + bResultOverflow = false; } long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLevel, long nLevels ) @@ -586,7 +586,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL long nTotal = 1; long nDataCount = 1; - BOOL bWasShowAll = TRUE; + sal_Bool bWasShowAll = sal_True; long nPos = nLevels; while ( nPos > 0 ) { @@ -598,7 +598,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL return 0; } - BOOL bDo = FALSE; + sal_Bool bDo = false; if ( ppDim[nPos]->getIsDataLayoutDimension() ) { // data layout dim doesn't interfere with "show all" flags @@ -608,11 +608,11 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL } else if ( bWasShowAll ) // "show all" set for all following levels? { - bDo = TRUE; + bDo = sal_True; if ( !ppLevel[nPos]->getShowEmpty() ) { // this level is counted, following ones are not - bWasShowAll = FALSE; + bWasShowAll = false; } } if ( bDo ) @@ -679,7 +679,7 @@ void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool pLevel->SetEnableLayout( bIsRow ); if ( pLevel->GetAutoShow().IsEnabled ) - rHasAutoShow = TRUE; + rHasAutoShow = sal_True; if (bIsRow) { @@ -781,7 +781,7 @@ void ScDPSource::CreateRes_Impl() { if ( !pResData ) { - USHORT nDataOrient = GetDataLayoutOrientation(); + sal_uInt16 nDataOrient = GetDataLayoutOrientation(); if ( nDataDimCount > 1 && ( nDataOrient != sheet::DataPilotFieldOrientation_COLUMN && nDataOrient != sheet::DataPilotFieldOrientation_ROW ) ) { @@ -796,7 +796,7 @@ void ScDPSource::CreateRes_Impl() String* pDataNames = NULL; sheet::DataPilotFieldReference* pDataRefValues = NULL; ScSubTotalFunc eDataFunctions[SC_DAPI_MAXFIELDS]; - USHORT nDataRefOrient[SC_DAPI_MAXFIELDS]; + sal_uInt16 nDataRefOrient[SC_DAPI_MAXFIELDS]; if (nDataDimCount) { pDataNames = new String[nDataDimCount]; @@ -808,7 +808,7 @@ void ScDPSource::CreateRes_Impl() // LateInit (initialize only those rows/children that are used) can be used unless // any data dimension needs reference values from column/row dimensions - BOOL bLateInit = TRUE; + sal_Bool bLateInit = sal_True; // Go through all data dimensions (i.e. fields) and build their meta data // so that they can be passed on to ScDPResultData instance later. @@ -846,7 +846,7 @@ void ScDPSource::CreateRes_Impl() // need fully initialized results to find reference values // (both in column or row dimensions), so updated values or // differences to 0 can be displayed even for empty results. - bLateInit = FALSE; + bLateInit = false; } } @@ -907,7 +907,7 @@ void ScDPSource::CreateRes_Impl() if ( nRowLevelCount > 0 ) { // disable layout flags for the innermost row field (level) - aInfo.aRowLevels[nRowLevelCount-1]->SetEnableLayout( FALSE ); + aInfo.aRowLevels[nRowLevelCount-1]->SetEnableLayout( false ); } pRowResRoot->InitFrom( aInfo.aRowDims, aInfo.aRowLevels, 0, aInitState ); @@ -938,7 +938,7 @@ void ScDPSource::CreateRes_Impl() // resulting table is too big -> abort before calculating // (this relies on late init, so no members are allocated in InitFrom above) - bResultOverflow = TRUE; + bResultOverflow = sal_True; } else { @@ -969,8 +969,8 @@ void ScDPSource::CreateRes_Impl() // Reset all results to empty, so they can be built again with data for the // desired members only. - pColResRoot->ResetResults( TRUE ); - pRowResRoot->ResetResults( TRUE ); + pColResRoot->ResetResults( sal_True ); + pRowResRoot->ResetResults( sal_True ); pData->CalcResults(aInfo, true); // Call UpdateDataResults again, with the new (limited) values. @@ -998,7 +998,7 @@ void ScDPSource::CreateRes_Impl() } -void ScDPSource::FillLevelList( USHORT nOrientation, std::vector<ScDPLevel*> &rList ) +void ScDPSource::FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList ) { rList.clear(); @@ -1077,7 +1077,7 @@ void ScDPSource::FillMemberResults() long nPos = 0; pColResRoot->FillMemberResults( pColResults, nPos, pResData->GetColStartMeasure(), - TRUE, NULL, NULL ); + sal_True, NULL, NULL ); } FillLevelList( sheet::DataPilotFieldOrientation_ROW, aRowLevelList ); @@ -1091,7 +1091,7 @@ void ScDPSource::FillMemberResults() long nPos = 0; pRowResRoot->FillMemberResults( pRowResults, nPos, pResData->GetRowStartMeasure(), - TRUE, NULL, NULL ); + sal_True, NULL, NULL ); } } } @@ -1292,8 +1292,8 @@ sal_Bool SAL_CALL ScDPDimensions::hasByName( const rtl::OUString& aName ) throw( long nCount = getCount(); for (long i=0; i<nCount; i++) if ( getByIndex(i)->getName() == aName ) - return TRUE; - return FALSE; + return sal_True; + return false; } uno::Type SAL_CALL ScDPDimensions::getElementType() throw(uno::RuntimeException) @@ -1348,7 +1348,7 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : mpLayoutName(NULL), mpSubtotalName(NULL), nSourceDim( -1 ), - bHasSelectedPage( FALSE ), + bHasSelectedPage( false ), pSelectedData( NULL ), mbHasHiddenMember(false) { @@ -1405,12 +1405,12 @@ void SAL_CALL ScDPDimension::setName( const ::rtl::OUString& rNewName ) throw(un aName = String( rNewName ); } -USHORT ScDPDimension::getOrientation() const +sal_uInt16 ScDPDimension::getOrientation() const { return pSource->GetOrientation( nDim ); } -void ScDPDimension::setOrientation(USHORT nNew) +void ScDPDimension::setOrientation(sal_uInt16 nNew) { pSource->SetOrientation( nDim, nNew ); } @@ -1425,17 +1425,17 @@ void ScDPDimension::setPosition(long /* nNew */) //! ... } -BOOL ScDPDimension::getIsDataLayoutDimension() const +sal_Bool ScDPDimension::getIsDataLayoutDimension() const { return pSource->GetData()->getIsDataLayoutDimension( nDim ); } -USHORT ScDPDimension::getFunction() const +sal_uInt16 ScDPDimension::getFunction() const { return nFunction; } -void ScDPDimension::setFunction(USHORT nNew) +void ScDPDimension::setFunction(sal_uInt16 nNew) { nFunction = nNew; } @@ -1470,7 +1470,7 @@ uno::Reference<util::XCloneable> SAL_CALL ScDPDimension::createClone() throw(uno return CreateCloneObject(); } -BOOL ScDPDimension::isDuplicated() const +sal_Bool ScDPDimension::isDuplicated() const { return (nSourceDim >= 0); } @@ -1511,7 +1511,7 @@ const ScDPItemData& ScDPDimension::GetSelectedData() } if ( !pSelectedData ) - pSelectedData = new ScDPItemData( aSelectedPage, 0.0, FALSE ); // default - name only + pSelectedData = new ScDPItemData( aSelectedPage, 0.0, false ); // default - name only } return *pSelectedData; @@ -1554,13 +1554,13 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam String aNameStr = aPropertyName; if ( aNameStr.EqualsAscii( SC_UNO_POSITION ) ) { - INT32 nInt = 0; + sal_Int32 nInt = 0; if (aValue >>= nInt) setPosition( nInt ); } else if ( aNameStr.EqualsAscii( SC_UNO_USEDHIER ) ) { - INT32 nInt = 0; + sal_Int32 nInt = 0; if (aValue >>= nInt) setUsedHierarchy( nInt ); } @@ -1568,19 +1568,19 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam { sheet::DataPilotFieldOrientation eEnum; if (aValue >>= eEnum) - setOrientation( sal::static_int_cast<USHORT>(eEnum) ); + setOrientation( sal::static_int_cast<sal_uInt16>(eEnum) ); } else if ( aNameStr.EqualsAscii( SC_UNO_FUNCTION ) ) { sheet::GeneralFunction eEnum; if (aValue >>= eEnum) - setFunction( sal::static_int_cast<USHORT>(eEnum) ); + setFunction( sal::static_int_cast<sal_uInt16>(eEnum) ); } else if ( aNameStr.EqualsAscii( SC_UNO_REFVALUE ) ) aValue >>= aReferenceValue; else if ( aNameStr.EqualsAscii( SC_UNO_FILTER ) ) { - BOOL bDone = FALSE; + sal_Bool bDone = false; uno::Sequence<sheet::TableFilterField> aSeq; if (aValue >>= aSeq) { @@ -1588,8 +1588,8 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam if ( nLength == 0 ) { aSelectedPage.Erase(); - bHasSelectedPage = FALSE; - bDone = TRUE; + bHasSelectedPage = false; + bDone = sal_True; } else if ( nLength == 1 ) { @@ -1597,8 +1597,8 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam if ( rField.Field == 0 && rField.Operator == sheet::FilterOperator_EQUAL && !rField.IsNumeric ) { aSelectedPage = rField.StringValue; - bHasSelectedPage = TRUE; - bDone = TRUE; + bHasSelectedPage = sal_True; + bDone = sal_True; } } } @@ -1693,7 +1693,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert { // single filter field: first field equal to selected string sheet::TableFilterField aField( sheet::FilterConnection_AND, 0, - sheet::FilterOperator_EQUAL, sal_False, 0.0, aSelectedPage ); + sheet::FilterOperator_EQUAL, false, 0.0, aSelectedPage ); aRet <<= uno::Sequence<sheet::TableFilterField>( &aField, 1 ); } else @@ -1782,8 +1782,8 @@ sal_Bool SAL_CALL ScDPHierarchies::hasByName( const rtl::OUString& aName ) throw long nCount = getCount(); for (long i=0; i<nCount; i++) if ( getByIndex(i)->getName() == aName ) - return TRUE; - return FALSE; + return sal_True; + return false; } uno::Type SAL_CALL ScDPHierarchies::getElementType() throw(uno::RuntimeException) @@ -1965,8 +1965,8 @@ sal_Bool SAL_CALL ScDPLevels::hasByName( const rtl::OUString& aName ) throw(uno: long nCount = getCount(); for (long i=0; i<nCount; i++) if ( getByIndex(i)->getName() == aName ) - return TRUE; - return FALSE; + return sal_True; + return false; } uno::Type SAL_CALL ScDPLevels::getElementType() throw(uno::RuntimeException) @@ -2013,19 +2013,19 @@ ScDPLevel* ScDPLevels::getByIndex(long nIndex) const class ScDPGlobalMembersOrder { ScDPLevel& rLevel; - BOOL bAscending; + sal_Bool bAscending; public: - ScDPGlobalMembersOrder( ScDPLevel& rLev, BOOL bAsc ) : + ScDPGlobalMembersOrder( ScDPLevel& rLev, sal_Bool bAsc ) : rLevel(rLev), bAscending(bAsc) {} ~ScDPGlobalMembersOrder() {} - BOOL operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; + sal_Bool operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const; }; -BOOL ScDPGlobalMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const +sal_Bool ScDPGlobalMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) const { sal_Int32 nCompare = 0; // seems that some ::std::sort() implementations pass the same index twice @@ -2047,11 +2047,11 @@ ScDPLevel::ScDPLevel( ScDPSource* pSrc, long nD, long nH, long nL ) : nHier( nH ), nLev( nL ), pMembers( NULL ), - bShowEmpty( FALSE ), + bShowEmpty( false ), aSortInfo( EMPTY_STRING, sal_True, sheet::DataPilotFieldSortMode::NAME ), // default: sort by name nSortMeasure( 0 ), nAutoMeasure( 0 ), - bEnableLayout( FALSE ) + bEnableLayout( false ) { //! hold pSource // aSubTotals is empty @@ -2098,7 +2098,7 @@ void ScDPLevel::EvaluateSortOrder() aGlobalOrder[nPos] = nPos; // allow manual or name (manual is always ascending) - BOOL bAscending = ( aSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL || aSortInfo.IsAscending ); + sal_Bool bAscending = ( aSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL || aSortInfo.IsAscending ); ScDPGlobalMembersOrder aComp( *this, bAscending ); ::std::sort( aGlobalOrder.begin(), aGlobalOrder.end(), aComp ); } @@ -2124,7 +2124,7 @@ void ScDPLevel::EvaluateSortOrder() } } -void ScDPLevel::SetEnableLayout( BOOL bSet ) +void ScDPLevel::SetEnableLayout( sal_Bool bSet ) { bEnableLayout = bSet; } @@ -2232,12 +2232,12 @@ void ScDPLevel::setSubTotals(const uno::Sequence<sheet::GeneralFunction>& rNew) //! set "manual change" flag? } -BOOL ScDPLevel::getShowEmpty() const +sal_Bool ScDPLevel::getShowEmpty() const { return bShowEmpty; } -void ScDPLevel::setShowEmpty(BOOL bSet) +void ScDPLevel::setShowEmpty(sal_Bool bSet) { bShowEmpty = bSet; } @@ -2579,7 +2579,7 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const if ( !aName.Len() ) aName = String::CreateFromInt32(nVal); - ScDPItemData rData( aName, nVal, TRUE, 0 ) ; + ScDPItemData rData( aName, nVal, sal_True, 0 ) ; pNew = new ScDPMember( pSource, nDim, nHier, nLev, pSource->GetCache()->GetAdditionalItemID(rData)); } else @@ -2602,7 +2602,7 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const // ----------------------------------------------------------------------- ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, - SCROW nIndex /*const String& rN, double fV, BOOL bHV*/ ) : + SCROW nIndex /*const String& rN, double fV, sal_Bool bHV*/ ) : pSource( pSrc ), nDim( nD ), nHier( nH ), @@ -2610,8 +2610,8 @@ ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, mnDataId( nIndex ), mpLayoutName(NULL), nPosition( -1 ), - bVisible( TRUE ), - bShowDet( TRUE ) + bVisible( sal_True ), + bShowDet( sal_True ) { //! hold pSource } @@ -2621,7 +2621,7 @@ ScDPMember::~ScDPMember() //! release pSource } -BOOL ScDPMember::IsNamedItem( SCROW nIndex ) const +sal_Bool ScDPMember::IsNamedItem( SCROW nIndex ) const { long nSrcDim = pSource->GetSourceDim( nDim ); if ( nHier != SC_DAPI_HIERARCHY_FLAT && pSource->IsDateDimension( nSrcDim ) ) @@ -2692,23 +2692,23 @@ void SAL_CALL ScDPMember::setName( const ::rtl::OUString& /* rNewName */ ) throw OSL_FAIL("not implemented"); //! exception? } -BOOL ScDPMember::getIsVisible() const +sal_Bool ScDPMember::getIsVisible() const { return bVisible; } -void ScDPMember::setIsVisible(BOOL bSet) +void ScDPMember::setIsVisible(sal_Bool bSet) { bVisible = bSet; //! set "manual change" flag } -BOOL ScDPMember::getShowDetails() const +sal_Bool ScDPMember::getShowDetails() const { return bShowDet; } -void ScDPMember::setShowDetails(BOOL bSet) +void ScDPMember::setShowDetails(sal_Bool bSet) { bShowDet = bSet; //! set "manual change" flag diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 397efa4dfd9a..fbc2ea0814c9 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -106,11 +106,11 @@ TYPEINIT1(ScTabSizeChangedHint, SfxHint); static ScDrawObjFactory* pFac = NULL; static E3dObjFactory* pF3d = NULL; -static USHORT nInst = 0; +static sal_uInt16 nInst = 0; SfxObjectShell* ScDrawLayer::pGlobalDrawPersist = NULL; -BOOL bDrawIsInUndo = FALSE; //! Member +sal_Bool bDrawIsInUndo = false; //! Member // ----------------------------------------------------------------------- @@ -225,13 +225,13 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : pGlobalDrawPersist ? pGlobalDrawPersist : ( pDocument ? pDocument->GetDocumentShell() : NULL ), - TRUE ), // bUseExtColorTable (is set below) + sal_True ), // bUseExtColorTable (is set below) aName( rName ), pDoc( pDocument ), pUndoGroup( NULL ), - bRecording( FALSE ), - bAdjustEnabled( TRUE ), - bHyphenatorSet( FALSE ) + bRecording( false ), + bAdjustEnabled( sal_True ), + bHyphenatorSet( false ) { pGlobalDrawPersist = NULL; // nur einmal benutzen @@ -248,8 +248,8 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : else SetColorTable( XColorTable::GetStdColorTable() ); - SetSwapGraphics(TRUE); -// SetSwapAsynchron(TRUE); // an der View + SetSwapGraphics(sal_True); +// SetSwapAsynchron(sal_True); // an der View SetScaleUnit(MAP_100TH_MM); SfxItemPool& rPool = GetItemPool(); @@ -268,7 +268,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : eOfficeLanguage == LANGUAGE_JAPANESE ) { // secondary is edit engine pool - rPool.GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( FALSE, EE_PARA_ASIANCJKSPACING ) ); + rPool.GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) ); } rPool.FreezeIdRanges(); // the pool is also used directly @@ -330,7 +330,7 @@ void ScDrawLayer::UseHyphenator() GetDrawOutliner().SetHyphenator( xHyphenator ); GetHitTestOutliner().SetHyphenator( xHyphenator ); - bHyphenatorSet = TRUE; + bHyphenatorSet = sal_True; } } @@ -342,14 +342,14 @@ SdrPage* ScDrawLayer::AllocPage(bool bMasterPage) return pPage; } -BOOL ScDrawLayer::HasObjects() const +sal_Bool ScDrawLayer::HasObjects() const { - BOOL bFound = FALSE; + sal_Bool bFound = false; - USHORT nCount = GetPageCount(); - for (USHORT i=0; i<nCount && !bFound; i++) + sal_uInt16 nCount = GetPageCount(); + for (sal_uInt16 i=0; i<nCount && !bFound; i++) if (GetPage(i)->GetObjCount()) - bFound = TRUE; + bFound = sal_True; return bFound; } @@ -383,17 +383,17 @@ Window* ScDrawLayer::GetCurDocViewWin() return NULL; } -BOOL ScDrawLayer::ScAddPage( SCTAB nTab ) +sal_Bool ScDrawLayer::ScAddPage( SCTAB nTab ) { if (bDrawIsInUndo) - return FALSE; // not inserted + return false; // not inserted - ScDrawPage* pPage = (ScDrawPage*)AllocPage( FALSE ); + ScDrawPage* pPage = (ScDrawPage*)AllocPage( false ); InsertPage(pPage, static_cast<sal_uInt16>(nTab)); if (bRecording) AddCalcUndo(new SdrUndoNewPage(*pPage)); - return TRUE; // inserted + return sal_True; // inserted } void ScDrawLayer::ScRemovePage( SCTAB nTab ) @@ -419,20 +419,20 @@ void ScDrawLayer::ScRenamePage( SCTAB nTab, const String& rNewName ) pPage->SetName(rNewName); } -void ScDrawLayer::ScMovePage( USHORT nOldPos, USHORT nNewPos ) +void ScDrawLayer::ScMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) { MovePage( nOldPos, nNewPos ); } -void ScDrawLayer::ScCopyPage( USHORT nOldPos, USHORT nNewPos, BOOL bAlloc ) +void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool bAlloc ) { - //! remove argument bAlloc (always FALSE) + //! remove argument bAlloc (always sal_False) if (bDrawIsInUndo) return; SdrPage* pOldPage = GetPage(nOldPos); - SdrPage* pNewPage = bAlloc ? AllocPage(FALSE) : GetPage(nNewPos); + SdrPage* pNewPage = bAlloc ? AllocPage(false) : GetPage(nNewPos); // kopieren @@ -459,7 +459,7 @@ void ScDrawLayer::ScCopyPage( USHORT nOldPos, USHORT nNewPos, BOOL bAlloc ) InsertPage(pNewPage, nNewPos); } -inline BOOL IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) +inline sal_Bool IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) { return rPos.Col() >= nCol1 && rPos.Col() <= nCol2 && rPos.Row() >= nRow1 && rPos.Row() <= nRow2; @@ -473,10 +473,10 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC if (!pPage) return; - BOOL bNegativePage = pDoc && pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc && pDoc->IsNegativePage( nTab ); - ULONG nCount = pPage->GetObjCount(); - for ( ULONG i = 0; i < nCount; i++ ) + sal_uLong nCount = pPage->GetObjCount(); + for ( sal_uLong i = 0; i < nCount; i++ ) { SdrObject* pObj = pPage->GetObj( i ); ScDrawObjData* pData = GetObjDataTab( pObj, nTab ); @@ -484,18 +484,18 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC { const ScAddress aOldStt = pData->maStart; const ScAddress aOldEnd = pData->maEnd; - BOOL bChange = FALSE; + sal_Bool bChange = false; if ( aOldStt.IsValid() && IsInBlock( aOldStt, nCol1,nRow1, nCol2,nRow2 ) ) { pData->maStart.IncCol( nDx ); pData->maStart.IncRow( nDy ); - bChange = TRUE; + bChange = sal_True; } if ( aOldEnd.IsValid() && IsInBlock( aOldEnd, nCol1,nRow1, nCol2,nRow2 ) ) { pData->maEnd.IncCol( nDx ); pData->maEnd.IncRow( nDy ); - bChange = TRUE; + bChange = sal_True; } if (bChange) { @@ -508,7 +508,7 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC } } -void ScDrawLayer::SetPageSize( USHORT nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos ) +void ScDrawLayer::SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos ) { SdrPage* pPage = GetPage(nPageNo); if (pPage) @@ -523,10 +523,10 @@ void ScDrawLayer::SetPageSize( USHORT nPageNo, const Size& rSize, bool bUpdateNo // auch wenn Groesse gleich geblieben ist // (einzelne Zeilen/Spalten koennen geaendert sein) - BOOL bNegativePage = pDoc && pDoc->IsNegativePage( static_cast<SCTAB>(nPageNo) ); + sal_Bool bNegativePage = pDoc && pDoc->IsNegativePage( static_cast<SCTAB>(nPageNo) ); - ULONG nCount = pPage->GetObjCount(); - for ( ULONG i = 0; i < nCount; i++ ) + sal_uLong nCount = pPage->GetObjCount(); + for ( sal_uLong i = 0; i < nCount; i++ ) { SdrObject* pObj = pPage->GetObj( i ); ScDrawObjData* pData = GetObjDataTab( pObj, static_cast<SCTAB>(nPageNo) ); @@ -784,18 +784,18 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati } } -BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) const +sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const { DBG_ASSERT( pDoc, "ScDrawLayer::GetPrintArea without document" ); if ( !pDoc ) - return FALSE; + return false; SCTAB nTab = rRange.aStart.Tab(); DBG_ASSERT( rRange.aEnd.Tab() == nTab, "GetPrintArea: Tab unterschiedlich" ); - BOOL bNegativePage = pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); - BOOL bAny = FALSE; + sal_Bool bAny = false; long nEndX = 0; long nEndY = 0; long nStartX = LONG_MAX; @@ -844,11 +844,11 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co //! Flags (ausgeblendet?) testen Rectangle aObjRect = pObject->GetCurrentBoundRect(); - BOOL bFit = TRUE; + sal_Bool bFit = sal_True; if ( !bSetHor && ( aObjRect.Right() < nStartX || aObjRect.Left() > nEndX ) ) - bFit = FALSE; + bFit = false; if ( !bSetVer && ( aObjRect.Bottom() < nStartY || aObjRect.Top() > nEndY ) ) - bFit = FALSE; + bFit = false; if ( bFit ) { if (bSetHor) @@ -861,7 +861,7 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co if (aObjRect.Top() < nStartY) nStartY = aObjRect.Top(); if (aObjRect.Bottom() > nEndY) nEndY = aObjRect.Bottom(); } - bAny = TRUE; + bAny = sal_True; } pObject = aIter.Next(); @@ -940,19 +940,19 @@ void ScDrawLayer::AddCalcUndo( SdrUndoAction* pUndo ) void ScDrawLayer::BeginCalcUndo() { DELETEZ(pUndoGroup); - bRecording = TRUE; + bRecording = sal_True; } SdrUndoGroup* ScDrawLayer::GetCalcUndo() { SdrUndoGroup* pRet = pUndoGroup; pUndoGroup = NULL; - bRecording = FALSE; + bRecording = false; return pRet; } void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2, - SCsCOL nDx,SCsROW nDy, BOOL bInsDel, bool bUpdateNoteCaptionPos ) + SCsCOL nDx,SCsROW nDy, sal_Bool bInsDel, bool bUpdateNoteCaptionPos ) { DBG_ASSERT( pDoc, "ScDrawLayer::MoveArea without document" ); if ( !pDoc ) @@ -961,7 +961,7 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR if (!bAdjustEnabled) return; - BOOL bNegativePage = pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); Rectangle aRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab ); lcl_ReverseTwipsToMM( aRect ); @@ -999,11 +999,11 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR MoveCells( nTab, nCol1,nRow1, nCol2,nRow2, nDx,nDy, bUpdateNoteCaptionPos ); } -BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) +sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) { DBG_ASSERT( pDoc, "ScDrawLayer::HasObjectsInRows without document" ); if ( !pDoc ) - return FALSE; + return false; Rectangle aTestRect; @@ -1023,16 +1023,16 @@ BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) aTestRect.Left() = 0; aTestRect.Right() = MAXMM; - BOOL bNegativePage = pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); if ( bNegativePage ) MirrorRectRTL( aTestRect ); SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page nicht gefunden"); if (!pPage) - return FALSE; + return false; - BOOL bFound = FALSE; + sal_Bool bFound = false; Rectangle aObjRect; SdrObjListIter aIter( *pPage ); @@ -1041,7 +1041,7 @@ BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) { aObjRect = pObject->GetSnapRect(); //! GetLogicRect ? if (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft())) - bFound = TRUE; + bFound = true; pObject = aIter.Next(); } @@ -1063,7 +1063,7 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, pPage->RecalcObjOrdNums(); - ULONG nObjCount = pPage->GetObjCount(); + sal_uLong nObjCount = pPage->GetObjCount(); if (nObjCount) { long nDelCount = 0; @@ -1119,7 +1119,7 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark ) if (pPage) { pPage->RecalcObjOrdNums(); - ULONG nObjCount = pPage->GetObjCount(); + sal_uLong nObjCount = pPage->GetObjCount(); if (nObjCount) { long nDelCount = 0; @@ -1224,7 +1224,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& } } -BOOL lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange& rClipRange ) +sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange& rClipRange ) { // check if every range of rRangesVector is completely in rClipRange @@ -1237,17 +1237,17 @@ BOOL lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange aRange = *rRanges[ i ]; if ( !rClipRange.In( aRange ) ) { - return FALSE; // at least one range is not valid + return false; // at least one range is not valid } } } - return TRUE; // everything is fine + return sal_True; // everything is fine } -BOOL lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos ) +sal_Bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = false; ::std::vector< ScRangeList >::iterator aIt = rRangesVector.begin(); for( ;aIt!=rRangesVector.end(); ++aIt ) @@ -1262,7 +1262,7 @@ BOOL lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& SCsROW nDiffY = rDestPos.Row() - (SCsROW)rSourceRange.aStart.Row(); SCsTAB nDiffZ = rDestPos.Tab() - (SCsTAB)rSourceRange.aStart.Tab(); pRange->Move( nDiffX, nDiffY, nDiffZ ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -1286,7 +1286,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const return; } - BOOL bMirrorObj = ( rSourceRange.Left() < 0 && rSourceRange.Right() < 0 && + sal_Bool bMirrorObj = ( rSourceRange.Left() < 0 && rSourceRange.Right() < 0 && rDestRange.Left() > 0 && rDestRange.Right() > 0 ) || ( rSourceRange.Left() > 0 && rSourceRange.Right() > 0 && rDestRange.Left() < 0 && rDestRange.Right() < 0 ); @@ -1309,13 +1309,13 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const // a clipboard document and its source share the same document item pool, // so the pointers can be compared to see if this is copy&paste within // the same document - BOOL bSameDoc = pDoc && pClipDoc && pDoc->GetPool() == pClipDoc->GetPool(); - BOOL bDestClip = pDoc && pDoc->IsClipboard(); + sal_Bool bSameDoc = pDoc && pClipDoc && pDoc->GetPool() == pClipDoc->GetPool(); + sal_Bool bDestClip = pDoc && pDoc->IsClipboard(); //#i110034# charts need correct sheet names for xml range conversion during load //so the target sheet name is temporarily renamed (if we have any SdrObjects) String aDestTabName; - BOOL bRestoreDestTabName = FALSE; + sal_Bool bRestoreDestTabName = false; if( pOldObject && !bSameDoc && !bDestClip ) { if( pDoc && pClipDoc ) @@ -1327,7 +1327,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const if( !(aSourceTabName==aDestTabName) && pDoc->ValidNewTabName(aSourceTabName) ) { - bRestoreDestTabName = pDoc->RenameTab( nDestTab, aSourceTabName ); //BOOL bUpdateRef = TRUE, BOOL bExternalDocument = FALSE + bRestoreDestTabName = pDoc->RenameTab( nDestTab, aSourceTabName ); //sal_Bool bUpdateRef = sal_True, sal_Bool bExternalDocument = sal_False } } } @@ -1346,18 +1346,18 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const Fraction aHorFract(1,1); Fraction aVerFract(1,1); - BOOL bResize = FALSE; + sal_Bool bResize = false; // sizes can differ by 1 from twips->1/100mm conversion for equal cell sizes, // don't resize to empty size when pasting into hidden columns or rows if ( Abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 ) { aHorFract = Fraction( nDestWidth, nSourceWidth ); - bResize = TRUE; + bResize = sal_True; } if ( Abs(nHeightDiff) > 1 && nDestHeight > 1 && nSourceHeight > 1 ) { aVerFract = Fraction( nDestHeight, nSourceHeight ); - bResize = TRUE; + bResize = sal_True; } Point aRefPos = rDestRange.TopLeft(); // for resizing (after moving) @@ -1409,7 +1409,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const pDoc->GetChartRanges( aChartName, aRangesVector, pDoc ); if( !aRangesVector.empty() ) { - BOOL bInSourceRange = FALSE; + sal_Bool bInSourceRange = false; ScRange aClipRange; if ( pClipDoc ) { @@ -1418,7 +1418,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const SCCOL nClipEndX; SCROW nClipEndY; pClipDoc->GetClipStart( nClipStartX, nClipStartY ); - pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE ); + pClipDoc->GetClipArea( nClipEndX, nClipEndY, sal_True ); nClipEndX = nClipEndX + nClipStartX; nClipEndY += nClipStartY; // GetClipArea returns the difference @@ -1473,11 +1473,11 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const void ScDrawLayer::MirrorRTL( SdrObject* pObj ) { - UINT16 nIdent = pObj->GetObjIdentifier(); + sal_uInt16 nIdent = pObj->GetObjIdentifier(); // don't mirror OLE or graphics, otherwise ask the object // if it can be mirrored - BOOL bCanMirror = ( nIdent != OBJ_GRAF && nIdent != OBJ_OLE2 ); + sal_Bool bCanMirror = ( nIdent != OBJ_GRAF && nIdent != OBJ_OLE2 ); if (bCanMirror) { SdrObjTransformInfoRec aInfo; @@ -1573,7 +1573,7 @@ String ScDrawLayer::GetVisibleName( SdrObject* pObj ) inline sal_Bool IsNamedObject( SdrObject* pObj, const String& rName ) { - // TRUE if rName is the object's Name or PersistName + // sal_True if rName is the object's Name or PersistName // (used to find a named object) return ( pObj->GetName() == rName || @@ -1581,7 +1581,7 @@ inline sal_Bool IsNamedObject( SdrObject* pObj, const String& rName ) static_cast<SdrOle2Obj*>(pObj)->GetPersistName() == rName ) ); } -SdrObject* ScDrawLayer::GetNamedObject( const String& rName, USHORT nId, SCTAB& rFoundTab ) const +SdrObject* ScDrawLayer::GetNamedObject( const String& rName, sal_uInt16 nId, SCTAB& rFoundTab ) const { sal_uInt16 nTabCount = GetPageCount(); for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++) @@ -1614,7 +1614,7 @@ String ScDrawLayer::GetNewGraphicName( long* pnCounter ) const String aBase = ScGlobal::GetRscString(STR_GRAPHICNAME); aBase += ' '; - BOOL bThere = TRUE; + sal_Bool bThere = sal_True; String aGraphicName; SCTAB nDummy; long nId = pnCounter ? *pnCounter : 0; @@ -1666,8 +1666,8 @@ namespace { SdrObjUserData* GetFirstUserDataOfType(const SdrObject *pObj, UINT16 nId) { - USHORT nCount = pObj ? pObj->GetUserDataCount() : 0; - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0; + for( sal_uInt16 i = 0; i < nCount; i++ ) { SdrObjUserData* pData = pObj->GetUserData( i ); if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId ) @@ -1678,8 +1678,8 @@ namespace void DeleteFirstUserDataOfType(SdrObject *pObj, UINT16 nId) { - USHORT nCount = pObj ? pObj->GetUserDataCount() : 0; - for( USHORT i = nCount; i > 0; i-- ) + sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0; + for( sal_uInt16 i = nCount; i > 0; i-- ) { SdrObjUserData* pData = pObj->GetUserData( i-1 ); if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId ) @@ -1756,7 +1756,7 @@ ScAnchorType ScDrawLayer::GetAnchorType( const SdrObject &rObj ) return ScDrawLayer::GetObjData(const_cast<SdrObject*>(&rObj)) ? SCA_CELL : SCA_PAGE; } -ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, BOOL bCreate ) +ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate ) { if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_OBJDATA)) return (ScDrawObjData*) pData; @@ -1815,7 +1815,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj, Size aGraphSize; ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap(); Graphic aGraphic; - BOOL bObjSupported = FALSE; + sal_Bool bObjSupported = false; if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt { @@ -1844,13 +1844,13 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj, rGraphic.GetPrefMapMode(), aMap100 ); - bObjSupported = TRUE; + bObjSupported = sal_True; } else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt { // TODO/LEAN: working with visual area needs running state aGraphSize = ((const SdrOle2Obj*)pObj)->GetOrigObjSize(); - bObjSupported = TRUE; + bObjSupported = true; } // hat alles geklappt, dann HitTest ausfuehren @@ -1865,7 +1865,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj, return pIMapObj; } -ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, BOOL bCreate ) +ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) { if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_MACRODATA)) return (ScMacroInfo*) pData; @@ -1888,7 +1888,7 @@ void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) void ScDrawLayer::SetChanged( sal_Bool bFlg /* = sal_True */ ) { if ( bFlg && pDoc ) - pDoc->SetChartListenerCollectionNeedsUpdate( TRUE ); + pDoc->SetChartListenerCollectionNeedsUpdate( sal_True ); FmFormModel::SetChanged( bFlg ); } diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 28f687be8312..8839eaf19bc1 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -55,7 +55,7 @@ // ----------------------------------------------------------------------- -const USHORT ROWINFO_MAX = 1024; +const sal_uInt16 ROWINFO_MAX = 1024; enum FillInfoLinePos @@ -95,8 +95,8 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, rStartX = nX; rStartY = nY; - BOOL bHOver = pInfo->bHOverlapped; - BOOL bVOver = pInfo->bVOverlapped; + sal_Bool bHOver = pInfo->bHOverlapped; + sal_Bool bVOver = pInfo->bVOverlapped; SCCOL nLastCol; SCROW nLastRow; @@ -110,7 +110,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, } else { - USHORT nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr( + sal_uInt16 nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr( rStartX, rStartY, nTab, ATTR_MERGE_FLAG ))->GetValue(); bHOver = ((nOverlap & SC_MF_HOR) != 0); bVOver = ((nOverlap & SC_MF_VER) != 0); @@ -134,7 +134,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, } else { - USHORT nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr( + sal_uInt16 nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr( rStartX, rStartY, nTab, ATTR_MERGE_FLAG ))->GetValue(); bHOver = ((nOverlap & SC_MF_HOR) != 0); bVOver = ((nOverlap & SC_MF_VER) != 0); @@ -161,11 +161,11 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, SCTAB nTab, double nScaleX, double nScaleY, - BOOL bPageMode, BOOL bFormulaMode, const ScMarkData* pMarkData ) + sal_Bool bPageMode, sal_Bool bFormulaMode, const ScMarkData* pMarkData ) { DBG_ASSERT( pTab[nTab], "Tabelle existiert nicht" ); - BOOL bLayoutRTL = IsLayoutRTL( nTab ); + sal_Bool bLayoutRTL = IsLayoutRTL( nTab ); ScDocumentPool* pPool = xPoolHelper->GetDocPool(); ScStyleSheetPool* pStlPool = xPoolHelper->GetStylePool(); @@ -186,16 +186,16 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX SCCOL nArrX; SCSIZE nArrY; SCSIZE nArrCount; - BOOL bAnyMerged = FALSE; - BOOL bAnyShadow = FALSE; - BOOL bAnyCondition = FALSE; + sal_Bool bAnyMerged = false; + sal_Bool bAnyShadow = false; + sal_Bool bAnyCondition = false; - BOOL bTabProtect = IsTabProtected(nTab); + sal_Bool bTabProtect = IsTabProtected(nTab); // fuer Blockmarken von zusammengefassten Zellen mit // versteckter erster Zeile / Spalte - BOOL bPaintMarks = FALSE; - BOOL bSkipMarks = FALSE; + sal_Bool bPaintMarks = false; + sal_Bool bSkipMarks = false; SCCOL nBlockStartX = 0, nBlockEndX = 0; SCROW nBlockEndY = 0, nBlockStartY = 0; if (pMarkData && pMarkData->IsMarked()) @@ -210,9 +210,9 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nBlockEndY = aTmpRange.aEnd.Row(); ExtendHidden( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY, nTab ); //? noetig ? if (pMarkData->IsMarkNegative()) - bSkipMarks = TRUE; + bSkipMarks = sal_True; else - bPaintMarks = TRUE; + bPaintMarks = sal_True; } } @@ -220,7 +220,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nArrY=0; SCROW nYExtra = nY2+1; - USHORT nDocHeight = ScGlobal::nStdRowHeight; + sal_uInt16 nDocHeight = ScGlobal::nStdRowHeight; SCROW nDocHeightEndRow = -1; for (nSignedY=((SCsROW)nY1)-1; nSignedY<=(SCsROW)nYExtra; nSignedY++) { @@ -242,17 +242,17 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX RowInfo* pThisRowInfo = &pRowInfo[nArrY]; pThisRowInfo->pCellInfo = NULL; // wird unten belegt - USHORT nHeight = (USHORT) ( nDocHeight * nScaleY ); + sal_uInt16 nHeight = (sal_uInt16) ( nDocHeight * nScaleY ); if (!nHeight) nHeight = 1; pThisRowInfo->nRowNo = nY; //! Fall < 0 ? pThisRowInfo->nHeight = nHeight; - pThisRowInfo->bEmptyBack = TRUE; - pThisRowInfo->bEmptyText = TRUE; - pThisRowInfo->bChanged = TRUE; - pThisRowInfo->bAutoFilter = FALSE; - pThisRowInfo->bPushButton = FALSE; + pThisRowInfo->bEmptyBack = sal_True; + pThisRowInfo->bEmptyText = sal_True; + pThisRowInfo->bChanged = sal_True; + pThisRowInfo->bAutoFilter = false; + pThisRowInfo->bPushButton = false; pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE; ++nArrY; @@ -272,12 +272,12 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX // rotierter Text... // Attribut im Dokument ueberhaupt verwendet? - BOOL bAnyItem = FALSE; - USHORT nRotCount = pPool->GetItemCount( ATTR_ROTATE_VALUE ); - for (USHORT nItem=0; nItem<nRotCount; nItem++) - if (pPool->GetItem( ATTR_ROTATE_VALUE, nItem )) + sal_Bool bAnyItem = false; + sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++) + if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem )) { - bAnyItem = TRUE; + bAnyItem = sal_True; break; } @@ -314,28 +314,28 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nX = MAXCOL+1; // ungueltig CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; - pInfo->bEmptyCellText = TRUE; + pInfo->bEmptyCellText = sal_True; pInfo->pCell = NULL; if (bPaintMarks) pInfo->bMarked = ( nX >= nBlockStartX && nX <= nBlockEndX && nY >= nBlockStartY && nY <= nBlockEndY ); else - pInfo->bMarked = FALSE; + pInfo->bMarked = false; pInfo->nWidth = 0; pInfo->nClipMark = SC_CLIPMARK_NONE; - pInfo->bMerged = FALSE; - pInfo->bHOverlapped = FALSE; - pInfo->bVOverlapped = FALSE; - pInfo->bAutoFilter = FALSE; - pInfo->bPushButton = FALSE; + pInfo->bMerged = false; + pInfo->bHOverlapped = false; + pInfo->bVOverlapped = false; + pInfo->bAutoFilter = false; + pInfo->bPushButton = false; pInfo->bPopupButton = false; pInfo->bFilterActive = false; pInfo->nRotateDir = SC_ROTDIR_NONE; - pInfo->bPrinted = FALSE; // view-intern - pInfo->bHideGrid = FALSE; // view-intern - pInfo->bEditEngine = FALSE; // view-intern + pInfo->bPrinted = false; // view-intern + pInfo->bHideGrid = false; // view-intern + pInfo->bEditEngine = false; // view-intern pInfo->pBackground = NULL; //! weglassen? pInfo->pPatternAttr = NULL; @@ -358,7 +358,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { if (!ColHidden(nX, nTab)) { - USHORT nThisWidth = (USHORT) (GetColWidth( nX, nTab ) * nScaleX); + sal_uInt16 nThisWidth = (sal_uInt16) (GetColWidth( nX, nTab ) * nScaleX); if (!nThisWidth) nThisWidth = 1; @@ -379,7 +379,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX // TODO: Optimize this loop. if (!ColHidden(nX, nTab)) { - USHORT nThisWidth = (USHORT) (GetColWidth( nX, nTab ) * nScaleX); + sal_uInt16 nThisWidth = (sal_uInt16) (GetColWidth( nX, nTab ) * nScaleX); if (!nThisWidth) nThisWidth = 1; @@ -408,8 +408,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->pCell = pThisCol->pItems[nUIndex].pCell; if (pInfo->pCell->GetCellType() != CELLTYPE_NOTE) { - pThisRowInfo->bEmptyText = FALSE; // Zeile nicht leer - pInfo->bEmptyCellText = FALSE; // Zelle nicht leer + pThisRowInfo->bEmptyText = false; // Zeile nicht leer + pInfo->bEmptyCellText = false; // Zelle nicht leer } ++nArrY; } @@ -450,24 +450,24 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX const SvxShadowItem* pShadowAttr = (const SvxShadowItem*) &pPattern->GetItem(ATTR_SHADOW); if (pShadowAttr != pDefShadow) - bAnyShadow = TRUE; + bAnyShadow = sal_True; const ScMergeAttr* pMergeAttr = (const ScMergeAttr*) &pPattern->GetItem(ATTR_MERGE); - BOOL bMerged = ( pMergeAttr != pDefMerge && *pMergeAttr != *pDefMerge ); - USHORT nOverlap = ((const ScMergeFlagAttr*) &pPattern->GetItemSet(). + sal_Bool bMerged = ( pMergeAttr != pDefMerge && *pMergeAttr != *pDefMerge ); + sal_uInt16 nOverlap = ((const ScMergeFlagAttr*) &pPattern->GetItemSet(). Get(ATTR_MERGE_FLAG))->GetValue(); - BOOL bHOverlapped = ((nOverlap & SC_MF_HOR) != 0); - BOOL bVOverlapped = ((nOverlap & SC_MF_VER) != 0); - BOOL bAutoFilter = ((nOverlap & SC_MF_AUTO) != 0); - BOOL bPushButton = ((nOverlap & SC_MF_BUTTON) != 0); - BOOL bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); + sal_Bool bHOverlapped = ((nOverlap & SC_MF_HOR) != 0); + sal_Bool bVOverlapped = ((nOverlap & SC_MF_VER) != 0); + sal_Bool bAutoFilter = ((nOverlap & SC_MF_AUTO) != 0); + sal_Bool bPushButton = ((nOverlap & SC_MF_BUTTON) != 0); + sal_Bool bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); bool bPopupButton = ((nOverlap & SC_MF_BUTTON_POPUP) != 0); bool bFilterActive = ((nOverlap & SC_MF_HIDDEN_MEMBER) != 0); if (bMerged||bHOverlapped||bVOverlapped) - bAnyMerged = TRUE; // intern + bAnyMerged = sal_True; // intern - BOOL bHidden, bHideFormula; + sal_Bool bHidden, bHideFormula; if (bTabProtect) { const ScProtectionAttr& rProtAttr = (const ScProtectionAttr&) @@ -476,9 +476,9 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX bHideFormula = rProtAttr.GetHideFormula(); } else - bHidden = bHideFormula = FALSE; + bHidden = bHideFormula = false; - ULONG nConditional = ((const SfxUInt32Item&)pPattern-> + sal_uLong nConditional = ((const SfxUInt32Item&)pPattern-> GetItem(ATTR_CONDITIONAL)).GetValue(); const ScConditionalFormat* pCondForm = NULL; if ( nConditional && pCondFormList ) @@ -492,11 +492,11 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; if (pBackground != pDefBackground) // Spalten-HG == Standard ? - pThisRowInfo->bEmptyBack = FALSE; + pThisRowInfo->bEmptyBack = false; if (bAutoFilter) - pThisRowInfo->bAutoFilter = TRUE; + pThisRowInfo->bAutoFilter = sal_True; if (bPushButton) - pThisRowInfo->bPushButton = TRUE; + pThisRowInfo->bPushButton = sal_True; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; pInfo->pBackground = pBackground; @@ -514,7 +514,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->pShadowAttr = pShadowAttr; // nWidth wird nicht mehr einzeln gesetzt - BOOL bEmbed = FALSE; //bIsEmbedded && + sal_Bool bEmbed = false; //bIsEmbedded && nTab >= aEmbedRange.aStart.Tab() && nTab <= aEmbedRange.aEnd.Tab() && nX >= aEmbedRange.aStart.Col() && @@ -525,18 +525,18 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX if (bScenario) { pInfo->pBackground = ScGlobal::GetButtonBrushItem(); - pThisRowInfo->bEmptyBack = FALSE; + pThisRowInfo->bEmptyBack = false; } else if (bEmbed) { pInfo->pBackground = ScGlobal::GetEmbeddedBrushItem(); - pThisRowInfo->bEmptyBack = FALSE; + pThisRowInfo->bEmptyBack = false; } if (bHidden || ( bFormulaMode && bHideFormula && pInfo->pCell && pInfo->pCell->GetCellType() == CELLTYPE_FORMULA )) - pInfo->bEmptyCellText = TRUE; + pInfo->bEmptyCellText = sal_True; if ( pCondForm ) { @@ -550,7 +550,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { //! Style-Sets cachen !!! pInfo->pConditionSet = &pStyleSheet->GetItemSet(); - bAnyCondition = TRUE; + bAnyCondition = sal_True; } // if style is not there, treat like no condition } @@ -576,7 +576,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { // Blockmarken const ScMarkArray* pThisMarkArr = pMarkData->GetArray()+nX; - BOOL bThisMarked; + sal_Bool bThisMarked; nArrY = 1; nCurRow = nY1; // einzelne Zeile nThisRow = nY1; // Ende des Bereichs @@ -594,7 +594,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { if ( bThisMarked ) { - BOOL bSkip = bSkipMarks && + sal_Bool bSkip = bSkipMarks && nX >= nBlockStartX && nX <= nBlockEndX && nCurRow >= nBlockStartY && @@ -603,7 +603,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; - pInfo->bMarked = TRUE; + pInfo->bMarked = sal_True; } } ++nArrY; @@ -650,26 +650,26 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX const SfxPoolItem* pItem; // Hintergrund - if ( pCondSet->GetItemState( ATTR_BACKGROUND, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_BACKGROUND, sal_True, &pItem ) == SFX_ITEM_SET ) { pInfo->pBackground = (const SvxBrushItem*) pItem; - pRowInfo[nArrY].bEmptyBack = FALSE; + pRowInfo[nArrY].bEmptyBack = false; } // Umrandung - if ( pCondSet->GetItemState( ATTR_BORDER, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_BORDER, sal_True, &pItem ) == SFX_ITEM_SET ) pInfo->pLinesAttr = (const SvxBoxItem*) pItem; - if ( pCondSet->GetItemState( ATTR_BORDER_TLBR, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_BORDER_TLBR, sal_True, &pItem ) == SFX_ITEM_SET ) pInfo->mpTLBRLine = static_cast< const SvxLineItem* >( pItem ); - if ( pCondSet->GetItemState( ATTR_BORDER_BLTR, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_BORDER_BLTR, sal_True, &pItem ) == SFX_ITEM_SET ) pInfo->mpBLTRLine = static_cast< const SvxLineItem* >( pItem ); // Schatten - if ( pCondSet->GetItemState( ATTR_SHADOW, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_SHADOW, sal_True, &pItem ) == SFX_ITEM_SET ) { pInfo->pShadowAttr = (const SvxShadowItem*) pItem; - bAnyShadow = TRUE; + bAnyShadow = sal_True; } } } @@ -710,23 +710,23 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX // Hintergrund kopieren (oder in output.cxx) if ( !pStartCond || pStartCond-> - GetItemState(ATTR_BACKGROUND,TRUE,&pItem) != SFX_ITEM_SET ) + GetItemState(ATTR_BACKGROUND,sal_True,&pItem) != SFX_ITEM_SET ) pItem = &pStartPattern->GetItem(ATTR_BACKGROUND); pInfo->pBackground = (const SvxBrushItem*) pItem; - pRowInfo[nArrY].bEmptyBack = FALSE; + pRowInfo[nArrY].bEmptyBack = false; // Schatten if ( !pStartCond || pStartCond-> - GetItemState(ATTR_SHADOW,TRUE,&pItem) != SFX_ITEM_SET ) + GetItemState(ATTR_SHADOW,sal_True,&pItem) != SFX_ITEM_SET ) pItem = &pStartPattern->GetItem(ATTR_SHADOW); pInfo->pShadowAttr = (const SvxShadowItem*) pItem; if (pInfo->pShadowAttr != pDefShadow) - bAnyShadow = TRUE; + bAnyShadow = sal_True; // Blockmarken - wieder mit Original-Merge-Werten - BOOL bCellMarked = FALSE; + sal_Bool bCellMarked = false; if (bPaintMarks) bCellMarked = ( nStartX >= (SCsCOL) nBlockStartX && nStartX <= (SCsCOL) nBlockEndX @@ -750,13 +750,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { for (nArrY=0; nArrY<nArrCount; nArrY++) { - BOOL bTop = ( nArrY == 0 ); - BOOL bBottom = ( nArrY+1 == nArrCount ); + sal_Bool bTop = ( nArrY == 0 ); + sal_Bool bBottom = ( nArrY+1 == nArrCount ); for (nArrX=nX1; nArrX<=nX2+2; nArrX++) // links und rechts einer mehr { - BOOL bLeft = ( nArrX == nX1 ); - BOOL bRight = ( nArrX == nX2+2 ); + sal_Bool bLeft = ( nArrX == nX1 ); + sal_Bool bRight = ( nArrX == nX2+2 ); CellInfo* pInfo = &pRowInfo[nArrY].pCellInfo[nArrX]; const SvxShadowItem* pThisAttr = pInfo->pShadowAttr; @@ -773,13 +773,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX while ( nArrX+nDxNeg > nX1 && pRowInfo[0].pCellInfo[nArrX+nDxNeg].nWidth == 0 ) --nDxNeg; - BOOL bLeftDiff = !bLeft && + sal_Bool bLeftDiff = !bLeft && CELLINFO(nDxNeg,0).pShadowAttr->GetLocation() == SVX_SHADOW_NONE; - BOOL bRightDiff = !bRight && + sal_Bool bRightDiff = !bRight && CELLINFO(nDxPos,0).pShadowAttr->GetLocation() == SVX_SHADOW_NONE; - BOOL bTopDiff = !bTop && + sal_Bool bTopDiff = !bTop && CELLINFO(0,-1).pShadowAttr->GetLocation() == SVX_SHADOW_NONE; - BOOL bBottomDiff = !bBottom && + sal_Bool bBottomDiff = !bBottom && CELLINFO(0,1).pShadowAttr->GetLocation() == SVX_SHADOW_NONE; if ( bLayoutRTL ) @@ -887,7 +887,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX } } - rTabInfo.mnArrCount = sal::static_int_cast<USHORT>(nArrCount); + rTabInfo.mnArrCount = sal::static_int_cast<sal_uInt16>(nArrCount); rTabInfo.mbPageMode = bPageMode; // ======================================================================== @@ -905,12 +905,12 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX for( size_t nRow = 0; nRow < nRowCount; ++nRow ) { - USHORT nCellInfoY = static_cast< USHORT >( nRow ); + sal_uInt16 nCellInfoY = static_cast< sal_uInt16 >( nRow ); RowInfo& rThisRowInfo = pRowInfo[ nCellInfoY ]; for( size_t nCol = 0; nCol < nColCount; ++nCol ) { - USHORT nCellInfoX = static_cast< USHORT >( nCol + nX1 ); + sal_uInt16 nCellInfoX = static_cast< sal_uInt16 >( nCol + nX1 ); const CellInfo& rInfo = rThisRowInfo.pCellInfo[ nCellInfoX ]; const SvxBoxItem* pBox = rInfo.pLinesAttr; @@ -953,16 +953,16 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX // first visible column (nX1-1 is first processed document column) SCCOL nFirstDocCol = (nX1 > 0) ? ::std::max< SCCOL >( nFirstRealDocCol, nX1 - 1 ) : nFirstRealDocCol; - USHORT nFirstCellInfoX = static_cast< USHORT >( nFirstDocCol + 1 ); + sal_uInt16 nFirstCellInfoX = static_cast< sal_uInt16 >( nFirstDocCol + 1 ); nFirstCol = static_cast< size_t >( nFirstCellInfoX - nX1 ); // last visible column (nX2+1 is last processed document column) SCCOL nLastDocCol = (nX2 < MAXCOL) ? ::std::min< SCCOL >( nLastRealDocCol, nX2 + 1 ) : nLastRealDocCol; - USHORT nLastCellInfoX = static_cast< USHORT >( nLastDocCol + 1 ); + sal_uInt16 nLastCellInfoX = static_cast< sal_uInt16 >( nLastDocCol + 1 ); size_t nLastCol = static_cast< size_t >( nLastCellInfoX - nX1 ); // first visible row - USHORT nFirstCellInfoY = nCellInfoY; + sal_uInt16 nFirstCellInfoY = nCellInfoY; while( ((nFirstCellInfoY > 1) && (pRowInfo[ nFirstCellInfoY - 1 ].nRowNo >= nFirstRealDocRow)) || ((nFirstCellInfoY == 1) && (static_cast< SCROW >( nY1 - 1 ) >= nFirstRealDocRow)) ) --nFirstCellInfoY; @@ -970,7 +970,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nFirstRow = static_cast< size_t >( nFirstCellInfoY ); // last visible row - USHORT nLastCellInfoY = nCellInfoY; + sal_uInt16 nLastCellInfoY = nCellInfoY; while( (sal::static_int_cast<SCSIZE>(nLastCellInfoY + 1) < nArrCount) && (pRowInfo[ nLastCellInfoY + 1 ].nRowNo <= nLastRealDocRow) ) ++nLastCellInfoY; @@ -1065,13 +1065,13 @@ ScTableInfo::ScTableInfo() : mpRowInfo( new RowInfo[ ROWINFO_MAX ] ), mbPageMode( false ) { - for( USHORT nIdx = 0; nIdx < ROWINFO_MAX; ++nIdx ) + for( sal_uInt16 nIdx = 0; nIdx < ROWINFO_MAX; ++nIdx ) mpRowInfo[ nIdx ].pCellInfo = 0; } ScTableInfo::~ScTableInfo() { - for( USHORT nIdx = 0; nIdx < ROWINFO_MAX; ++nIdx ) + for( sal_uInt16 nIdx = 0; nIdx < ROWINFO_MAX; ++nIdx ) delete [] mpRowInfo[ nIdx ].pCellInfo; delete [] mpRowInfo; } diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 7522e64b256f..57c517c9b977 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -139,19 +139,19 @@ SvNumberFormatter* ScGlobal::pEnglishFormatter = NULL; double ScGlobal::nScreenPPTX = 96.0; double ScGlobal::nScreenPPTY = 96.0; -USHORT ScGlobal::nDefFontHeight = 240; -USHORT ScGlobal::nStdRowHeight = 257; +sal_uInt16 ScGlobal::nDefFontHeight = 240; +sal_uInt16 ScGlobal::nStdRowHeight = 257; long ScGlobal::nLastRowHeightExtra = 0; long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH; -static USHORT nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y +static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y class SfxViewShell; SfxViewShell* pScActiveViewShell = NULL; //! als Member !!!!! -USHORT nScClickMouseModifier = 0; //! dito -USHORT nScFillModeMouseModifier = 0; //! dito +sal_uInt16 nScClickMouseModifier = 0; //! dito +sal_uInt16 nScFillModeMouseModifier = 0; //! dito // Hack: ScGlobal::GetUserList() muss InitAppOptions in der UI aufrufen, // damit UserList aus Cfg geladen wird @@ -164,11 +164,11 @@ void global_InitAppOptions(); // //======================================================================== -BOOL ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, +sal_Bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, const SfxItemSet& rOldAttrs, - const USHORT nWhich ) + const sal_uInt16 nWhich ) { - BOOL bInvalidate = FALSE; + sal_Bool bInvalidate = false; const SfxItemState eNewState = rNewAttrs.GetItemState( nWhich ); const SfxItemState eOldState = rOldAttrs.GetItemState( nWhich ); @@ -194,14 +194,14 @@ BOOL ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, ? rNewAttrs.Get( nWhich ) : rNewAttrs.GetPool()->GetDefaultItem( nWhich ); - bInvalidate = sal::static_int_cast<BOOL>(rNewItem != rOldItem); + bInvalidate = sal::static_int_cast<sal_Bool>(rNewItem != rOldItem); } return bInvalidate; } -ULONG ScGlobal::GetStandardFormat( SvNumberFormatter& rFormatter, - ULONG nFormat, short nType ) +sal_uLong ScGlobal::GetStandardFormat( SvNumberFormatter& rFormatter, + sal_uLong nFormat, short nType ) { const SvNumberformat* pFormat = rFormatter.GetEntry( nFormat ); if ( pFormat ) @@ -209,8 +209,8 @@ ULONG ScGlobal::GetStandardFormat( SvNumberFormatter& rFormatter, return rFormatter.GetStandardFormat( nType, eLnge ); } -ULONG ScGlobal::GetStandardFormat( double fNumber, SvNumberFormatter& rFormatter, - ULONG nFormat, short nType ) +sal_uLong ScGlobal::GetStandardFormat( double fNumber, SvNumberFormatter& rFormatter, + sal_uLong nFormat, short nType ) { const SvNumberformat* pFormat = rFormatter.GetEntry( nFormat ); if ( pFormat ) @@ -234,7 +234,7 @@ SvNumberFormatter* ScGlobal::GetEnglishFormatter() //------------------------------------------------------------------------ -BOOL ScGlobal::CheckWidthInvalidate( BOOL& bNumFormatChanged, +sal_Bool ScGlobal::CheckWidthInvalidate( sal_Bool& bNumFormatChanged, const SfxItemSet& rNewAttrs, const SfxItemSet& rOldAttrs ) { @@ -350,7 +350,7 @@ void ScGlobal::SetUserList( const ScUserList* pNewList ) } } -const String& ScGlobal::GetRscString( USHORT nIndex ) +const String& ScGlobal::GetRscString( sal_uInt16 nIndex ) { DBG_ASSERT( nIndex < STR_COUNT, "ScGlobal::GetRscString - invalid string index"); if( !ppRscString[ nIndex ] ) @@ -393,7 +393,7 @@ const String& ScGlobal::GetRscString( USHORT nIndex ) return *ppRscString[ nIndex ]; } -String ScGlobal::GetErrorString(USHORT nErrNumber) +String ScGlobal::GetErrorString(sal_uInt16 nErrNumber) { String sResStr; switch (nErrNumber) @@ -419,7 +419,7 @@ String ScGlobal::GetErrorString(USHORT nErrNumber) return sResStr; } -String ScGlobal::GetLongErrorString(USHORT nErrNumber) +String ScGlobal::GetLongErrorString(sal_uInt16 nErrNumber) { switch (nErrNumber) { @@ -549,7 +549,7 @@ void ScGlobal::Init() pLocaleData = pSysLocale->GetLocaleDataPtr(); ppRscString = new String *[ STR_COUNT ]; - for( USHORT nC = 0 ; nC < STR_COUNT ; nC++ ) ppRscString[ nC ] = NULL; + for( sal_uInt16 nC = 0 ; nC < STR_COUNT ; nC++ ) ppRscString[ nC ] = NULL; pEmptyBrushItem = new SvxBrushItem( Color( COL_TRANSPARENT ), ATTR_BACKGROUND ); pButtonBrushItem = new SvxBrushItem( Color(), ATTR_BACKGROUND ); @@ -574,7 +574,7 @@ void ScGlobal::Init() void ScGlobal::UpdatePPT( OutputDevice* pDev ) { - USHORT nCurrentZoom = Application::GetSettings().GetStyleSettings().GetScreenZoom(); + sal_uInt16 nCurrentZoom = Application::GetSettings().GetStyleSettings().GetScreenZoom(); if ( nCurrentZoom != nPPTZoom ) { // Screen PPT values must be updated when ScreenZoom has changed. @@ -623,12 +623,12 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool) Font aDefFont; pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here aVirtWindow.SetFont(aDefFont); - nDefFontHeight = (USHORT) aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), + nDefFontHeight = (sal_uInt16) aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height(); const SvxMarginItem* pMargin = (const SvxMarginItem*)&pPattern->GetItem(ATTR_MARGIN); - nStdRowHeight = (USHORT) ( nDefFontHeight + + nStdRowHeight = (sal_uInt16) ( nDefFontHeight + pMargin->GetTopMargin() + pMargin->GetBottomMargin() - STD_ROWHEIGHT_DIFF ); } @@ -644,7 +644,7 @@ void ScGlobal::Clear() DELETEZ(pAddInCollection); DELETEZ(pUserList); - for( USHORT nC = 0 ; nC < STR_COUNT ; nC++ ) + for( sal_uInt16 nC = 0 ; nC < STR_COUNT ; nC++ ) if( ppRscString ) delete ppRscString[ nC ]; delete[] ppRscString; ppRscString = NULL; @@ -883,33 +883,33 @@ const sal_Unicode* ScGlobal::FindUnquoted( const sal_Unicode* pString, sal_Unico //------------------------------------------------------------------------ -BOOL ScGlobal::EETextObjEqual( const EditTextObject* pObj1, +sal_Bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, const EditTextObject* pObj2 ) { if ( pObj1 == pObj2 ) // both empty or the same object - return TRUE; + return sal_True; if ( pObj1 && pObj2 ) { // first test for equal text content - USHORT nParCount = pObj1->GetParagraphCount(); + sal_uInt16 nParCount = pObj1->GetParagraphCount(); if ( nParCount != pObj2->GetParagraphCount() ) - return FALSE; - for (USHORT nPar=0; nPar<nParCount; nPar++) + return false; + for (sal_uInt16 nPar=0; nPar<nParCount; nPar++) if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) ) - return FALSE; + return false; SvMemoryStream aStream1; SvMemoryStream aStream2; pObj1->Store( aStream1 ); pObj2->Store( aStream2 ); - ULONG nSize = aStream1.Tell(); + sal_uLong nSize = aStream1.Tell(); if ( aStream2.Tell() == nSize ) - if ( !memcmp( aStream1.GetData(), aStream2.GetData(), (USHORT) nSize ) ) - return TRUE; + if ( !memcmp( aStream1.GetData(), aStream2.GetData(), (sal_uInt16) nSize ) ) + return sal_True; } - return FALSE; + return false; } void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) @@ -937,8 +937,8 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) SfxFrameItem aFrm( SID_DOCFRAME, pFrame ); SfxStringItem aReferer( SID_REFERER, aReferName ); - SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, FALSE ); - SfxBoolItem aBrowsing( SID_BROWSE, TRUE ); + SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false ); + SfxBoolItem aBrowsing( SID_BROWSE, sal_True ); // kein SID_SILENT mehr @@ -954,19 +954,19 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) //------------------------------------------------------------------------ -BOOL ScGlobal::IsSystemRTL() +sal_Bool ScGlobal::IsSystemRTL() { return MsLangId::isRightToLeft( Application::GetSettings().GetLanguage() ); } -BYTE ScGlobal::GetDefaultScriptType() +sal_uInt8 ScGlobal::GetDefaultScriptType() { // Used when text contains only WEAK characters. // Script type of office language is used then (same as GetEditDefaultLanguage, // to get consistent behavior of text in simple cells and EditEngine, // also same as GetAppLanguage() in Writer) - return (BYTE) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguage() ); + return (sal_uInt8) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguage() ); } LanguageType ScGlobal::GetEditDefaultLanguage() @@ -976,7 +976,7 @@ LanguageType ScGlobal::GetEditDefaultLanguage() return Application::GetSettings().GetLanguage(); } -USHORT ScGlobal::GetScriptedWhichID( BYTE nScriptType, USHORT nWhich ) +sal_uInt16 ScGlobal::GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich ) { switch ( nScriptType ) { @@ -1068,16 +1068,16 @@ USHORT ScGlobal::GetScriptedWhichID( BYTE nScriptType, USHORT nWhich ) void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ) { - DBG_ASSERT( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, FALSE ) == SFX_ITEM_DEFAULT, + DBG_ASSERT( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, false ) == SFX_ITEM_DEFAULT, "ScGlobal::AddLanguage - language already added"); const SfxPoolItem* pHardItem; - if ( rSet.GetItemState( ATTR_VALUE_FORMAT, FALSE, &pHardItem ) == SFX_ITEM_SET ) + if ( rSet.GetItemState( ATTR_VALUE_FORMAT, false, &pHardItem ) == SFX_ITEM_SET ) { const SvNumberformat* pHardFormat = rFormatter.GetEntry( ((const SfxUInt32Item*)pHardItem)->GetValue() ); - ULONG nParentFmt = 0; // pool default + sal_uLong nParentFmt = 0; // pool default const SfxItemSet* pParent = rSet.GetParent(); if ( pParent ) nParentFmt = ((const SfxUInt32Item&)pParent->Get( ATTR_VALUE_FORMAT )).GetValue(); diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index bc805db5a650..fb03c65ce2bf 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -44,7 +44,6 @@ #include "global.hxx" #include "rangeutl.hxx" -#include "pivot.hxx" #include "rechead.hxx" #include "compiler.hxx" #include "paramisc.hxx" @@ -65,9 +64,9 @@ ScImportParam::ScImportParam() : nRow1(0), nCol2(0), nRow2(0), - bImport(FALSE), - bNative(FALSE), - bSql(TRUE), + bImport(false), + bNative(false), + bSql(sal_True), nType(ScDbTable) { } @@ -106,7 +105,7 @@ ScImportParam& ScImportParam::operator=( const ScImportParam& r ) return *this; } -BOOL ScImportParam::operator==( const ScImportParam& rOther ) const +sal_Bool ScImportParam::operator==( const ScImportParam& rOther ) const { return( nCol1 == rOther.nCol1 && nRow1 == rOther.nRow1 && @@ -126,8 +125,8 @@ BOOL ScImportParam::operator==( const ScImportParam& rOther ) const // struct ScQueryParam: ScQueryEntry::ScQueryEntry() : - bDoQuery(FALSE), - bQueryByString(FALSE), + bDoQuery(false), + bQueryByString(false), bQueryByDate(false), nField(0), eOp(SC_EQUAL), @@ -186,8 +185,8 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) void ScQueryEntry::Clear() { - bDoQuery = FALSE; - bQueryByString = FALSE; + bDoQuery = false; + bQueryByString = false; bQueryByDate = false; eOp = SC_EQUAL; eConnect = SC_AND; @@ -203,7 +202,7 @@ void ScQueryEntry::Clear() pSearchText = NULL; } -BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const +sal_Bool ScQueryEntry::operator==( const ScQueryEntry& r ) const { return bDoQuery == r.bDoQuery && bQueryByString == r.bQueryByString @@ -216,12 +215,12 @@ BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const //! pSearchParam und pSearchText nicht vergleichen } -utl::TextSearch* ScQueryEntry::GetSearchTextPtr( BOOL bCaseSens ) +utl::TextSearch* ScQueryEntry::GetSearchTextPtr( sal_Bool bCaseSens ) { if ( !pSearchParam ) { pSearchParam = new utl::SearchParam( *pStr, utl::SearchParam::SRCH_REGEXP, - bCaseSens, FALSE, FALSE ); + bCaseSens, false, false ); pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass ); } return pSearchText; @@ -232,7 +231,7 @@ utl::TextSearch* ScQueryEntry::GetSearchTextPtr( BOOL bCaseSens ) ScSubTotalParam::ScSubTotalParam() { - for ( USHORT i=0; i<MAXSUBTOTAL; i++ ) + for ( sal_uInt16 i=0; i<MAXSUBTOTAL; i++ ) { nSubTotals[i] = 0; pSubTotals[i] = NULL; @@ -250,7 +249,7 @@ ScSubTotalParam::ScSubTotalParam( const ScSubTotalParam& r ) : bDoSort(r.bDoSort),bAscending(r.bAscending),bUserDef(r.bUserDef),nUserIndex(r.nUserIndex), bIncludePattern(r.bIncludePattern) { - for (USHORT i=0; i<MAXSUBTOTAL; i++) + for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++) { bGroupActive[i] = r.bGroupActive[i]; nField[i] = r.nField[i]; @@ -283,12 +282,12 @@ void ScSubTotalParam::Clear() nCol1=nCol2= 0; nRow1=nRow2 = 0; nUserIndex = 0; - bPagebreak=bCaseSens=bUserDef=bIncludePattern=bRemoveOnly = FALSE; - bAscending=bReplace=bDoSort = TRUE; + bPagebreak=bCaseSens=bUserDef=bIncludePattern=bRemoveOnly = false; + bAscending=bReplace=bDoSort = sal_True; - for (USHORT i=0; i<MAXSUBTOTAL; i++) + for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++) { - bGroupActive[i] = FALSE; + bGroupActive[i] = false; nField[i] = 0; if ( (nSubTotals[i] > 0) && pSubTotals[i] && pFunctions[i] ) @@ -319,7 +318,7 @@ ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) nUserIndex = r.nUserIndex; bIncludePattern = r.bIncludePattern; - for (USHORT i=0; i<MAXSUBTOTAL; i++) + for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++) { bGroupActive[i] = r.bGroupActive[i]; nField[i] = r.nField[i]; @@ -352,9 +351,9 @@ ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) //------------------------------------------------------------------------ -BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const +sal_Bool ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const { - BOOL bEqual = (nCol1 == rOther.nCol1) + sal_Bool bEqual = (nCol1 == rOther.nCol1) && (nRow1 == rOther.nRow1) && (nCol2 == rOther.nCol2) && (nRow2 == rOther.nRow2) @@ -370,8 +369,8 @@ BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const if ( bEqual ) { - bEqual = TRUE; - for ( USHORT i=0; i<MAXSUBTOTAL && bEqual; i++ ) + bEqual = sal_True; + for ( sal_uInt16 i=0; i<MAXSUBTOTAL && bEqual; i++ ) { bEqual = (bGroupActive[i] == rOther.bGroupActive[i]) && (nField[i] == rOther.nField[i]) @@ -396,10 +395,10 @@ BOOL ScSubTotalParam::operator==( const ScSubTotalParam& rOther ) const //------------------------------------------------------------------------ -void ScSubTotalParam::SetSubTotals( USHORT nGroup, +void ScSubTotalParam::SetSubTotals( sal_uInt16 nGroup, const SCCOL* ptrSubTotals, const ScSubTotalFunc* ptrFunctions, - USHORT nCount ) + sal_uInt16 nCount ) { DBG_ASSERT( (nGroup <= MAXSUBTOTAL), "ScSubTotalParam::SetSubTotals(): nGroup > MAXSUBTOTAL!" ); @@ -423,7 +422,7 @@ void ScSubTotalParam::SetSubTotals( USHORT nGroup, pFunctions[nGroup] = new ScSubTotalFunc [nCount]; nSubTotals[nGroup] = static_cast<SCCOL>(nCount); - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) { pSubTotals[nGroup][i] = ptrSubTotals[i]; pFunctions[nGroup][i] = ptrFunctions[i]; @@ -452,7 +451,7 @@ ScConsolidateParam::ScConsolidateParam( const ScConsolidateParam& r ) : { nDataAreaCount = r.nDataAreaCount; ppDataAreas = new ScArea*[nDataAreaCount]; - for ( USHORT i=0; i<nDataAreaCount; i++ ) + for ( sal_uInt16 i=0; i<nDataAreaCount; i++ ) ppDataAreas[i] = new ScArea( *(r.ppDataAreas[i]) ); } } @@ -470,7 +469,7 @@ void ScConsolidateParam::ClearDataAreas() { if ( ppDataAreas ) { - for ( USHORT i=0; i<nDataAreaCount; i++ ) + for ( sal_uInt16 i=0; i<nDataAreaCount; i++ ) delete ppDataAreas[i]; delete [] ppDataAreas; ppDataAreas = NULL; @@ -487,7 +486,7 @@ void ScConsolidateParam::Clear() nCol = 0; nRow = 0; nTab = 0; - bByCol = bByRow = bReferenceData = FALSE; + bByCol = bByRow = bReferenceData = false; eFunction = SUBTOTAL_FUNC_SUM; } @@ -509,9 +508,9 @@ ScConsolidateParam& ScConsolidateParam::operator=( const ScConsolidateParam& r ) //------------------------------------------------------------------------ -BOOL ScConsolidateParam::operator==( const ScConsolidateParam& r ) const +sal_Bool ScConsolidateParam::operator==( const ScConsolidateParam& r ) const { - BOOL bEqual = (nCol == r.nCol) + sal_Bool bEqual = (nCol == r.nCol) && (nRow == r.nRow) && (nTab == r.nTab) && (bByCol == r.bByCol) @@ -526,7 +525,7 @@ BOOL ScConsolidateParam::operator==( const ScConsolidateParam& r ) const bEqual = bEqual && (ppDataAreas != NULL) && (r.ppDataAreas != NULL); if ( bEqual && (nDataAreaCount > 0) ) - for ( USHORT i=0; i<nDataAreaCount && bEqual; i++ ) + for ( sal_uInt16 i=0; i<nDataAreaCount && bEqual; i++ ) bEqual = *(ppDataAreas[i]) == *(r.ppDataAreas[i]); return bEqual; @@ -534,13 +533,13 @@ BOOL ScConsolidateParam::operator==( const ScConsolidateParam& r ) const //------------------------------------------------------------------------ -void ScConsolidateParam::SetAreas( ScArea* const* ppAreas, USHORT nCount ) +void ScConsolidateParam::SetAreas( ScArea* const* ppAreas, sal_uInt16 nCount ) { ClearDataAreas(); if ( ppAreas && nCount > 0 ) { ppDataAreas = new ScArea*[nCount]; - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) ppDataAreas[i] = new ScArea( *(ppAreas[i]) ); nDataAreaCount = nCount; } @@ -548,7 +547,7 @@ void ScConsolidateParam::SetAreas( ScArea* const* ppAreas, USHORT nCount ) // ----------------------------------------------------------------------- -PivotField::PivotField( SCsCOL nNewCol, USHORT nNewFuncMask ) : +PivotField::PivotField( SCsCOL nNewCol, sal_uInt16 nNewFuncMask ) : nCol( nNewCol ), nFuncMask( nNewFuncMask ), nFuncCount( 0 ) @@ -576,8 +575,8 @@ bool PivotField::operator==( const PivotField& r ) const ScPivotParam::ScPivotParam() : nCol(0), nRow(0), nTab(0), - bIgnoreEmptyRows(FALSE), bDetectCategories(FALSE), - bMakeTotalCol(TRUE), bMakeTotalRow(TRUE) + bIgnoreEmptyRows(false), bDetectCategories(false), + bMakeTotalCol(true), bMakeTotalRow(true) { } @@ -648,9 +647,9 @@ ScPivotParam& ScPivotParam::operator=( const ScPivotParam& r ) //------------------------------------------------------------------------ -BOOL ScPivotParam::operator==( const ScPivotParam& r ) const +sal_Bool ScPivotParam::operator==( const ScPivotParam& r ) const { - BOOL bEqual = (nCol == r.nCol) + sal_Bool bEqual = (nCol == r.nCol) && (nRow == r.nRow) && (nTab == r.nTab) && (bIgnoreEmptyRows == r.bIgnoreEmptyRows) @@ -719,17 +718,17 @@ ScSolveParam& ScSolveParam::operator=( const ScSolveParam& r ) //------------------------------------------------------------------------ -BOOL ScSolveParam::operator==( const ScSolveParam& r ) const +sal_Bool ScSolveParam::operator==( const ScSolveParam& r ) const { - BOOL bEqual = (aRefFormulaCell == r.aRefFormulaCell) + sal_Bool bEqual = (aRefFormulaCell == r.aRefFormulaCell) && (aRefVariableCell == r.aRefVariableCell); if ( bEqual ) { if ( !pStrTargetVal && !r.pStrTargetVal ) - bEqual = TRUE; + bEqual = sal_True; else if ( !pStrTargetVal || !r.pStrTargetVal ) - bEqual = FALSE; + bEqual = false; else if ( pStrTargetVal && r.pStrTargetVal ) bEqual = ( *pStrTargetVal == *(r.pStrTargetVal) ); } @@ -755,7 +754,7 @@ ScTabOpParam::ScTabOpParam( const ScRefAddress& rFormulaCell, const ScRefAddress& rFormulaEnd, const ScRefAddress& rRowCell, const ScRefAddress& rColCell, - BYTE nMd) + sal_uInt8 nMd) : aRefFormulaCell ( rFormulaCell ), aRefFormulaEnd ( rFormulaEnd ), aRefRowCell ( rRowCell ), @@ -778,7 +777,7 @@ ScTabOpParam& ScTabOpParam::operator=( const ScTabOpParam& r ) //------------------------------------------------------------------------ -BOOL ScTabOpParam::operator==( const ScTabOpParam& r ) const +sal_Bool ScTabOpParam::operator==( const ScTabOpParam& r ) const { return ( (aRefFormulaCell == r.aRefFormulaCell) && (aRefFormulaEnd == r.aRefFormulaEnd) diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index c9a7182d8fd6..940ef895ea1c 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -60,7 +60,7 @@ ScMarkArray::~ScMarkArray() //------------------------------------------------------------------------ -void ScMarkArray::Reset( BOOL bMarked ) +void ScMarkArray::Reset( sal_Bool bMarked ) { // always create pData here // (or have separate method to ensure pData) @@ -75,11 +75,11 @@ void ScMarkArray::Reset( BOOL bMarked ) //------------------------------------------------------------------------ -BOOL ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const +sal_Bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const { long nHi = static_cast<long>(nCount) - 1; long i = 0; - BOOL bFound = (nCount == 1); + sal_Bool bFound = (nCount == 1); if (pData) { long nLo = 0; @@ -98,11 +98,11 @@ BOOL ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const if (nStartRow >= (long) nRow) nHi = --i; else - bFound = TRUE; + bFound = sal_True; } } else - bFound = FALSE; + bFound = false; if (bFound) nIndex=(SCSIZE)i; @@ -111,19 +111,19 @@ BOOL ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const return bFound; } -BOOL ScMarkArray::GetMark( SCROW nRow ) const +sal_Bool ScMarkArray::GetMark( SCROW nRow ) const { SCSIZE i; if (Search( nRow, i )) return pData[i].bMarked; else - return FALSE; + return false; } //------------------------------------------------------------------------ -void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) +void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, sal_Bool bMarked ) { if (ValidRow(nStartRow) && ValidRow(nEndRow)) { @@ -134,7 +134,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) else { if (!pData) - Reset(FALSE); // create pData for further processing - could use special case handling! + Reset(false); // create pData for further processing - could use special case handling! SCSIZE nNeeded = nCount + 2; if ( nLimit < nNeeded ) @@ -150,8 +150,8 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) SCSIZE ni; // number of entries in beginning SCSIZE nInsert; // insert position (MAXROW+1 := no insert) - BOOL bCombined = FALSE; - BOOL bSplit = FALSE; + sal_Bool bCombined = false; + sal_Bool bSplit = false; if ( nStartRow > 0 ) { // skip beginning @@ -166,7 +166,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) { // may be a split or a simple insert or just a shrink, // row adjustment is done further down if ( pData[ni].nRow > nEndRow ) - bSplit = TRUE; + bSplit = sal_True; ni++; nInsert = ni; } @@ -177,7 +177,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) { // combine pData[ni-1].nRow = nEndRow; nInsert = MAXROWCOUNT; - bCombined = TRUE; + bCombined = sal_True; } } else @@ -204,7 +204,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) pData[ni-1].nRow = nStartRow - 1; // shrink } nInsert = MAXROWCOUNT; - bCombined = TRUE; + bCombined = sal_True; } else if ( ni > 0 && ni == nInsert ) pData[ni-1].nRow = nStartRow - 1; // shrink @@ -250,7 +250,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked ) } } -BOOL ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const +sal_Bool ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const { SCSIZE nStartIndex; SCSIZE nEndIndex; @@ -259,21 +259,21 @@ BOOL ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const if (pData[nStartIndex].bMarked) if (Search( nEndRow, nEndIndex )) if (nEndIndex==nStartIndex) - return TRUE; + return sal_True; - return FALSE; + return false; } -BOOL ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const +sal_Bool ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const { - BOOL bRet = FALSE; + sal_Bool bRet = false; if ( nCount == 1 ) { if ( pData[0].bMarked ) { rStartRow = 0; rEndRow = MAXROW; - bRet = TRUE; + bRet = sal_True; } } else if ( nCount == 2 ) @@ -288,7 +288,7 @@ BOOL ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const rStartRow = pData[0].nRow + 1; rEndRow = MAXROW; } - bRet = TRUE; + bRet = sal_True; } else if ( nCount == 3 ) { @@ -296,7 +296,7 @@ BOOL ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const { rStartRow = pData[0].nRow + 1; rEndRow = pData[1].nRow; - bRet = TRUE; + bRet = sal_True; } } return bRet; @@ -317,10 +317,10 @@ void ScMarkArray::CopyMarksTo( ScMarkArray& rDestMarkArray ) const rDestMarkArray.nCount = rDestMarkArray.nLimit = nCount; } -SCsROW ScMarkArray::GetNextMarked( SCsROW nRow, BOOL bUp ) const +SCsROW ScMarkArray::GetNextMarked( SCsROW nRow, sal_Bool bUp ) const { if (!pData) - const_cast<ScMarkArray*>(this)->Reset(FALSE); // create pData for further processing + const_cast<ScMarkArray*>(this)->Reset(false); // create pData for further processing SCsROW nRet = nRow; if (VALIDROW(nRow)) @@ -343,10 +343,10 @@ SCsROW ScMarkArray::GetNextMarked( SCsROW nRow, BOOL bUp ) const return nRet; } -SCROW ScMarkArray::GetMarkEnd( SCROW nRow, BOOL bUp ) const +SCROW ScMarkArray::GetMarkEnd( SCROW nRow, sal_Bool bUp ) const { if (!pData) - const_cast<ScMarkArray*>(this)->Reset(FALSE); // create pData for further processing + const_cast<ScMarkArray*>(this)->Reset(false); // create pData for further processing SCROW nRet; SCSIZE nIndex; @@ -379,15 +379,15 @@ ScMarkArrayIter::~ScMarkArrayIter() { } -BOOL ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom ) +sal_Bool ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom ) { if ( nPos >= pArray->nCount ) - return FALSE; + return false; while (!pArray->pData[nPos].bMarked) { ++nPos; if ( nPos >= pArray->nCount ) - return FALSE; + return false; } rBottom = pArray->pData[nPos].nRow; if (nPos==0) @@ -395,7 +395,7 @@ BOOL ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom ) else rTop = pArray->pData[nPos-1].nRow + 1; ++nPos; - return TRUE; + return sal_True; } diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index a85c13b6e27f..b5627a8d162a 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -47,7 +47,7 @@ ScMarkData::ScMarkData() : pMultiSel( NULL ) { for (SCTAB i=0; i<=MAXTAB; i++) - bTabMarked[i] = FALSE; + bTabMarked[i] = false; ResetMark(); } @@ -111,8 +111,8 @@ void ScMarkData::ResetMark() delete[] pMultiSel; pMultiSel = NULL; - bMarked = bMultiMarked = FALSE; - bMarking = bMarkIsNeg = FALSE; + bMarked = bMultiMarked = false; + bMarking = bMarkIsNeg = false; } void ScMarkData::SetMarkArea( const ScRange& rRange ) @@ -125,8 +125,8 @@ void ScMarkData::SetMarkArea( const ScRange& rRange ) // may query (default) attributes although no sheet is marked yet. // => mark that one. if ( !GetSelectCount() ) - bTabMarked[ aMarkRange.aStart.Tab() ] = TRUE; - bMarked = TRUE; + bTabMarked[ aMarkRange.aStart.Tab() ] = sal_True; + bMarked = sal_True; } } @@ -140,7 +140,7 @@ void ScMarkData::GetMultiMarkArea( ScRange& rRange ) const rRange = aMultiRange; } -void ScMarkData::SetMultiMarkArea( const ScRange& rRange, BOOL bMark ) +void ScMarkData::SetMultiMarkArea( const ScRange& rRange, sal_Bool bMark ) { if (!pMultiSel) { @@ -149,8 +149,8 @@ void ScMarkData::SetMultiMarkArea( const ScRange& rRange, BOOL bMark ) // if simple mark range is set, copy to multi marks if ( bMarked && !bMarkIsNeg ) { - bMarked = FALSE; - SetMultiMarkArea( aMarkRange, TRUE ); + bMarked = false; + SetMultiMarkArea( aMarkRange, sal_True ); } } @@ -179,7 +179,7 @@ void ScMarkData::SetMultiMarkArea( const ScRange& rRange, BOOL bMark ) else { aMultiRange = rRange; // neu - bMultiMarked = TRUE; + bMultiMarked = sal_True; } } @@ -222,7 +222,7 @@ void ScMarkData::MarkToMulti() if ( bMarked && !bMarking ) { SetMultiMarkArea( aMarkRange, !bMarkIsNeg ); - bMarked = FALSE; + bMarked = false; // check if all multi mark ranges have been removed if ( bMarkIsNeg && !HasAnyMultiMarks() ) @@ -244,7 +244,7 @@ void ScMarkData::MarkToSimple() ScRange aNew = aMultiRange; - BOOL bOk = FALSE; + sal_Bool bOk = false; SCCOL nStartCol = aNew.aStart.Col(); SCCOL nEndCol = aNew.aEnd.Col(); @@ -257,12 +257,12 @@ void ScMarkData::MarkToSimple() SCROW nStartRow, nEndRow; if ( pMultiSel[nStartCol].HasOneMark( nStartRow, nEndRow ) ) { - bOk = TRUE; + bOk = sal_True; SCROW nCmpStart, nCmpEnd; for (SCCOL nCol=nStartCol+1; nCol<=nEndCol && bOk; nCol++) if ( !pMultiSel[nCol].HasOneMark( nCmpStart, nCmpEnd ) || nCmpStart != nStartRow || nCmpEnd != nEndRow ) - bOk = FALSE; + bOk = false; } if (bOk) @@ -274,18 +274,18 @@ void ScMarkData::MarkToSimple() ResetMark(); aMarkRange = aNew; - bMarked = TRUE; - bMarkIsNeg = FALSE; + bMarked = sal_True; + bMarkIsNeg = false; } } } -BOOL ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, BOOL bNoSimple ) const +sal_Bool ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple ) const { if ( bMarked && !bNoSimple && !bMarkIsNeg ) if ( aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol && aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow ) - return TRUE; + return sal_True; if (bMultiMarked) { @@ -295,10 +295,10 @@ BOOL ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, BOOL bNoSimple ) const return pMultiSel[nCol].GetMark( nRow ); } - return FALSE; + return false; } -BOOL ScMarkData::IsColumnMarked( SCCOL nCol ) const +sal_Bool ScMarkData::IsColumnMarked( SCCOL nCol ) const { // bMarkIsNeg inzwischen auch fuer Spaltenkoepfe //! GetMarkColumnRanges fuer komplett markierte Spalten @@ -306,15 +306,15 @@ BOOL ScMarkData::IsColumnMarked( SCCOL nCol ) const if ( bMarked && !bMarkIsNeg && aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol && aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == MAXROW ) - return TRUE; + return sal_True; if ( bMultiMarked && pMultiSel[nCol].IsAllMarked(0,MAXROW) ) - return TRUE; + return sal_True; - return FALSE; + return false; } -BOOL ScMarkData::IsRowMarked( SCROW nRow ) const +sal_Bool ScMarkData::IsRowMarked( SCROW nRow ) const { // bMarkIsNeg inzwischen auch fuer Zeilenkoepfe //! GetMarkRowRanges fuer komplett markierte Zeilen @@ -322,26 +322,26 @@ BOOL ScMarkData::IsRowMarked( SCROW nRow ) const if ( bMarked && !bMarkIsNeg && aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == MAXCOL && aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow ) - return TRUE; + return sal_True; if ( bMultiMarked ) { DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) if (!pMultiSel[nCol].GetMark(nRow)) - return FALSE; - return TRUE; + return false; + return sal_True; } - return FALSE; + return false; } -void ScMarkData::MarkFromRangeList( const ScRangeList& rList, BOOL bReset ) +void ScMarkData::MarkFromRangeList( const ScRangeList& rList, sal_Bool bReset ) { if (bReset) { for (SCTAB i=0; i<=MAXTAB; i++) - bTabMarked[i] = FALSE; // Tabellen sind nicht in ResetMark + bTabMarked[i] = false; // Tabellen sind nicht in ResetMark ResetMark(); } @@ -350,20 +350,20 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, BOOL bReset ) { ScRange aRange = *rList[ 0 ]; SetMarkArea( aRange ); - SelectTable( aRange.aStart.Tab(), TRUE ); + SelectTable( aRange.aStart.Tab(), sal_True ); } else { for (size_t i=0; i < nCount; i++) { ScRange aRange = *rList[ i ]; - SetMultiMarkArea( aRange, TRUE ); - SelectTable( aRange.aStart.Tab(), TRUE ); + SetMultiMarkArea( aRange, true ); + SelectTable( aRange.aStart.Tab(), true ); } } } -void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, BOOL bClear ) const +void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, sal_Bool bClear ) const { if (!pList) return; @@ -483,8 +483,8 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges ) const SCCOLROW nMultiStart = aMultiRange.aStart.Row(); const SCCOLROW nMultiEnd = aMultiRange.aEnd.Row(); - BOOL* bRowMarked = new BOOL[MAXROWCOUNT]; - memset( bRowMarked, 0, sizeof(BOOL) * MAXROWCOUNT); + sal_Bool* bRowMarked = new sal_Bool[MAXROWCOUNT]; + memset( bRowMarked, 0, sizeof(sal_Bool) * MAXROWCOUNT); SCROW nRow; SCCOL nCol; @@ -494,7 +494,7 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges ) ScMarkArrayIter aMarkIter( &pMultiSel[nCol] ); while (aMarkIter.Next( nTop, nBottom )) for (nRow=nTop; nRow<=nBottom; nRow++) - bRowMarked[nRow] = TRUE; + bRowMarked[nRow] = sal_True; if (nTop == nMultiStart && nBottom == nMultiEnd) break; // for, all relevant rows marked } @@ -535,10 +535,10 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges ) return nRangeCnt; } -BOOL ScMarkData::IsAllMarked( const ScRange& rRange ) const +sal_Bool ScMarkData::IsAllMarked( const ScRange& rRange ) const { if ( !bMultiMarked ) - return FALSE; + return false; DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); @@ -546,15 +546,15 @@ BOOL ScMarkData::IsAllMarked( const ScRange& rRange ) const SCROW nStartRow = rRange.aStart.Row(); SCCOL nEndCol = rRange.aEnd.Col(); SCROW nEndRow = rRange.aEnd.Row(); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; for (SCCOL nCol=nStartCol; nCol<=nEndCol && bOk; nCol++) if ( !pMultiSel[nCol].IsAllMarked( nStartRow, nEndRow ) ) - bOk = FALSE; + bOk = false; return bOk; } -SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, BOOL bUp ) const +SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, sal_Bool bUp ) const { if ( !bMultiMarked ) return nRow; @@ -564,42 +564,42 @@ SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, BOOL bUp ) const return pMultiSel[nCol].GetNextMarked( nRow, bUp ); } -BOOL ScMarkData::HasMultiMarks( SCCOL nCol ) const +sal_Bool ScMarkData::HasMultiMarks( SCCOL nCol ) const { if ( !bMultiMarked ) - return FALSE; + return false; DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); return pMultiSel[nCol].HasMarks(); } -BOOL ScMarkData::HasAnyMultiMarks() const +sal_Bool ScMarkData::HasAnyMultiMarks() const { if ( !bMultiMarked ) - return FALSE; + return false; DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) if ( pMultiSel[nCol].HasMarks() ) - return TRUE; + return sal_True; - return FALSE; // nix + return false; // nix } void ScMarkData::InsertTab( SCTAB nTab ) { for (SCTAB i=MAXTAB; i>nTab; i--) bTabMarked[i] = bTabMarked[i-1]; - bTabMarked[nTab] = FALSE; + bTabMarked[nTab] = false; } void ScMarkData::DeleteTab( SCTAB nTab ) { for (SCTAB i=nTab; i<MAXTAB; i++) bTabMarked[i] = bTabMarked[i+1]; - bTabMarked[MAXTAB] = FALSE; + bTabMarked[MAXTAB] = false; } diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index 13cd05ce8d50..f4dc662f40b7 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -50,7 +50,7 @@ ScOutlineEntry::ScOutlineEntry( SCCOLROW nNewStart, SCCOLROW nNewSize, bool bNew nStart ( nNewStart ), nSize ( nNewSize ), bHidden ( bNewHidden ), - bVisible( TRUE ) + bVisible( sal_True ) { } @@ -108,7 +108,7 @@ void ScOutlineEntry::SetVisible( bool bNewVisible ) //------------------------------------------------------------------------ ScOutlineCollection::ScOutlineCollection() : - ScSortedCollection( 4,4,FALSE ) + ScSortedCollection( 4,4,false ) { } @@ -125,13 +125,13 @@ short ScOutlineCollection::Compare(ScDataObject* pKey1, ScDataObject* pKey2) con ((ScOutlineEntry*)pKey2)->GetStart() ); } -USHORT ScOutlineCollection::FindStart( SCCOLROW nMinStart ) +sal_uInt16 ScOutlineCollection::FindStart( SCCOLROW nMinStart ) { //! binaer suchen ? - USHORT nPos = 0; - USHORT nLocalCount = GetCount(); - while ( (nPos<nLocalCount) ? (((ScOutlineEntry*)At(nPos))->GetStart() < nMinStart) : FALSE ) + sal_uInt16 nPos = 0; + sal_uInt16 nLocalCount = GetCount(); + while ( (nPos<nLocalCount) ? (((ScOutlineEntry*)At(nPos))->GetStart() < nMinStart) : false ) ++nPos; return nPos; @@ -147,10 +147,10 @@ ScOutlineArray::ScOutlineArray() : ScOutlineArray::ScOutlineArray( const ScOutlineArray& rArray ) : nDepth( rArray.nDepth ) { - for (USHORT nLevel=0; nLevel<nDepth; nLevel++) + for (sal_uInt16 nLevel=0; nLevel<nDepth; nLevel++) { - USHORT nCount = rArray.aCollections[nLevel].GetCount(); - for (USHORT nEntry=0; nEntry<nCount; nEntry++) + sal_uInt16 nCount = rArray.aCollections[nLevel].GetCount(); + for (sal_uInt16 nEntry=0; nEntry<nCount; nEntry++) { ScOutlineEntry* pEntry = (ScOutlineEntry*) rArray.aCollections[nLevel].At(nEntry); aCollections[nLevel].Insert( new ScOutlineEntry( *pEntry ) ); @@ -158,19 +158,19 @@ ScOutlineArray::ScOutlineArray( const ScOutlineArray& rArray ) : } } -void ScOutlineArray::FindEntry( SCCOLROW nSearchPos, USHORT& rFindLevel, USHORT& rFindIndex, - USHORT nMaxLevel ) +void ScOutlineArray::FindEntry( SCCOLROW nSearchPos, sal_uInt16& rFindLevel, sal_uInt16& rFindIndex, + sal_uInt16 nMaxLevel ) { rFindLevel = rFindIndex = 0; if (nMaxLevel > nDepth) nMaxLevel = nDepth; - for (USHORT nLevel=0; nLevel<nMaxLevel; nLevel++) //! rueckwaerts suchen ? + for (sal_uInt16 nLevel=0; nLevel<nMaxLevel; nLevel++) //! rueckwaerts suchen ? { ScOutlineCollection* pCollect = &aCollections[nLevel]; - USHORT nCount = pCollect->GetCount(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = pCollect->GetCount(); + for (sal_uInt16 i=0; i<nCount; i++) { ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i); if ( pEntry->GetStart() <= nSearchPos && pEntry->GetEnd() >= nSearchPos ) @@ -182,28 +182,28 @@ void ScOutlineArray::FindEntry( SCCOLROW nSearchPos, USHORT& rFindLevel, USHORT& } } -BOOL ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, BOOL& rSizeChanged, - BOOL bHidden, BOOL bVisible ) +sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool& rSizeChanged, + sal_Bool bHidden, sal_Bool bVisible ) { - rSizeChanged = FALSE; + rSizeChanged = false; - USHORT nStartLevel; - USHORT nStartIndex; - USHORT nEndLevel; - USHORT nEndIndex; - BOOL bFound = FALSE; + sal_uInt16 nStartLevel; + sal_uInt16 nStartIndex; + sal_uInt16 nEndLevel; + sal_uInt16 nEndIndex; + sal_Bool bFound = false; - BOOL bCont; - USHORT nFindMax; + sal_Bool bCont; + sal_uInt16 nFindMax; FindEntry( nStartCol, nStartLevel, nStartIndex ); // nLevel = neuer Level (alter+1) !!! FindEntry( nEndCol, nEndLevel, nEndIndex ); nFindMax = Max(nStartLevel,nEndLevel); do { - bCont = FALSE; + bCont = false; if ( nStartLevel == nEndLevel && nStartIndex == nEndIndex && nStartLevel < SC_OL_MAXDEPTH ) - bFound = TRUE; + bFound = sal_True; if (!bFound) { @@ -218,25 +218,25 @@ BOOL ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, BOOL& rSizeCh if ( ((ScOutlineEntry*)aCollections[nEndLevel-1].At(nEndIndex))-> GetEnd() == nEndCol ) FindEntry( nEndCol, nEndLevel, nEndIndex, nFindMax ); - bCont = TRUE; + bCont = sal_True; } } } while ( !bFound && bCont ); if (!bFound) - return FALSE; + return false; - USHORT nLevel = nStartLevel; + sal_uInt16 nLevel = nStartLevel; // untere verschieben - BOOL bNeedSize = FALSE; + sal_Bool bNeedSize = false; for ( short nMoveLevel = nDepth-1; nMoveLevel >= (short) nLevel; nMoveLevel-- ) { - USHORT nCount = aCollections[nMoveLevel].GetCount(); - BOOL bMoved = FALSE; - for ( USHORT i=0; i<nCount; i += bMoved ? 0 : 1 ) + sal_uInt16 nCount = aCollections[nMoveLevel].GetCount(); + sal_Bool bMoved = false; + for ( sal_uInt16 i=0; i<nCount; i += bMoved ? 0 : 1 ) { ScOutlineEntry* pEntry = (ScOutlineEntry*) aCollections[nMoveLevel].At(i); SCCOLROW nEntryStart = pEntry->GetStart(); @@ -244,50 +244,50 @@ BOOL ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, BOOL& rSizeCh { if (nMoveLevel >= SC_OL_MAXDEPTH - 1) { - rSizeChanged = FALSE; // kein Platz - return FALSE; + rSizeChanged = false; // kein Platz + return false; } aCollections[nMoveLevel+1].Insert( new ScOutlineEntry( *pEntry ) ); aCollections[nMoveLevel].AtFree( i ); nCount = aCollections[nMoveLevel].GetCount(); - bMoved = TRUE; + bMoved = sal_True; if (nMoveLevel == (short) nDepth - 1) - bNeedSize = TRUE; + bNeedSize = sal_True; } else - bMoved = FALSE; + bMoved = false; } } if (bNeedSize) { ++nDepth; - rSizeChanged = TRUE; + rSizeChanged = sal_True; } if (nDepth <= nLevel) { nDepth = nLevel+1; - rSizeChanged = TRUE; + rSizeChanged = sal_True; } ScOutlineEntry* pNewEntry = new ScOutlineEntry( nStartCol, nEndCol+1-nStartCol, bHidden ); pNewEntry->SetVisible( bVisible ); aCollections[nLevel].Insert( pNewEntry ); - return TRUE; + return sal_True; } -BOOL ScOutlineArray::FindTouchedLevel( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, USHORT& rFindLevel ) const +sal_Bool ScOutlineArray::FindTouchedLevel( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_uInt16& rFindLevel ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; rFindLevel = 0; - for (USHORT nLevel=0; nLevel<nDepth; nLevel++) + for (sal_uInt16 nLevel=0; nLevel<nDepth; nLevel++) { const ScOutlineCollection* pCollect = &aCollections[nLevel]; - USHORT nCount = pCollect->GetCount(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = pCollect->GetCount(); + for (sal_uInt16 i=0; i<nCount; i++) { ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i); SCCOLROW nStart = pEntry->GetStart(); @@ -297,7 +297,7 @@ BOOL ScOutlineArray::FindTouchedLevel( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, ( nBlockEnd >=nStart && nBlockEnd <=nEnd ) ) { rFindLevel = nLevel; // wirklicher Level - bFound = TRUE; + bFound = sal_True; } } } @@ -305,16 +305,16 @@ BOOL ScOutlineArray::FindTouchedLevel( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, return bFound; } -void ScOutlineArray::RemoveSub( SCCOLROW nStartPos, SCCOLROW nEndPos, USHORT nLevel ) +void ScOutlineArray::RemoveSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt16 nLevel ) { if ( nLevel >= nDepth ) return; ScOutlineCollection* pCollect = &aCollections[nLevel]; - USHORT nCount = pCollect->GetCount(); - BOOL bFound = FALSE; - for ( USHORT i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) + sal_uInt16 nCount = pCollect->GetCount(); + sal_Bool bFound = false; + for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) { - bFound = FALSE; + bFound = false; ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i); SCCOLROW nStart = pEntry->GetStart(); SCCOLROW nEnd = pEntry->GetEnd(); @@ -324,12 +324,12 @@ void ScOutlineArray::RemoveSub( SCCOLROW nStartPos, SCCOLROW nEndPos, USHORT nLe RemoveSub( nStart, nEnd, nLevel+1 ); pCollect->AtFree(i); nCount = pCollect->GetCount(); - bFound = TRUE; + bFound = sal_True; } } } -void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, USHORT nStartLevel ) +void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt16 nStartLevel ) { if (nStartLevel==0) { @@ -337,14 +337,14 @@ void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, USHORT nS return; } - for (USHORT nLevel = nStartLevel; nLevel < nDepth; nLevel++) + for (sal_uInt16 nLevel = nStartLevel; nLevel < nDepth; nLevel++) { ScOutlineCollection* pCollect = &aCollections[nLevel]; - USHORT nCount = pCollect->GetCount(); - BOOL bFound = FALSE; - for ( USHORT i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) + sal_uInt16 nCount = pCollect->GetCount(); + sal_Bool bFound = false; + for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) { - bFound = FALSE; + bFound = false; ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i); SCCOLROW nStart = pEntry->GetStart(); SCCOLROW nEnd = pEntry->GetEnd(); @@ -354,43 +354,43 @@ void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, USHORT nS aCollections[nLevel-1].Insert( new ScOutlineEntry( *pEntry ) ); pCollect->AtFree(i); nCount = pCollect->GetCount(); - bFound = TRUE; + bFound = sal_True; } } } } -BOOL ScOutlineArray::DecDepth() // nDepth auf leere Levels anpassen +sal_Bool ScOutlineArray::DecDepth() // nDepth auf leere Levels anpassen { - BOOL bChanged = FALSE; - BOOL bCont; + sal_Bool bChanged = false; + sal_Bool bCont; do { - bCont = FALSE; + bCont = false; if (nDepth) if (aCollections[nDepth-1].GetCount() == 0) { --nDepth; - bChanged = TRUE; - bCont = TRUE; + bChanged = sal_True; + bCont = sal_True; } } while (bCont); return bChanged; } -BOOL ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, BOOL& rSizeChanged ) +sal_Bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_Bool& rSizeChanged ) { - USHORT nLevel; + sal_uInt16 nLevel; FindTouchedLevel( nBlockStart, nBlockEnd, nLevel ); ScOutlineCollection* pCollect = &aCollections[nLevel]; - USHORT nCount = pCollect->GetCount(); - BOOL bFound = FALSE; - BOOL bAny = FALSE; - for ( USHORT i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) + sal_uInt16 nCount = pCollect->GetCount(); + sal_Bool bFound = false; + sal_Bool bAny = false; + for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) ) { - bFound = FALSE; + bFound = false; ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i); SCCOLROW nStart = pEntry->GetStart(); SCCOLROW nEnd = pEntry->GetEnd(); @@ -401,34 +401,34 @@ BOOL ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, BOOL& rSi PromoteSub( nStart, nEnd, nLevel+1 ); nCount = pCollect->GetCount(); i = pCollect->FindStart( nEnd+1 ); - bFound = TRUE; - bAny = TRUE; + bFound = sal_True; + bAny = sal_True; } } if (bAny) // Depth anpassen if (DecDepth()) - rSizeChanged = TRUE; + rSizeChanged = sal_True; return bAny; } -ScOutlineEntry* ScOutlineArray::GetEntry( USHORT nLevel, USHORT nIndex ) const +ScOutlineEntry* ScOutlineArray::GetEntry( sal_uInt16 nLevel, sal_uInt16 nIndex ) const { return (ScOutlineEntry*)((nLevel < nDepth) ? aCollections[nLevel].At(nIndex) : NULL); } -USHORT ScOutlineArray::GetCount( USHORT nLevel ) const +sal_uInt16 ScOutlineArray::GetCount( sal_uInt16 nLevel ) const { return (nLevel < nDepth) ? aCollections[nLevel].GetCount() : 0; } -ScOutlineEntry* ScOutlineArray::GetEntryByPos( USHORT nLevel, SCCOLROW nPos ) const +ScOutlineEntry* ScOutlineArray::GetEntryByPos( sal_uInt16 nLevel, SCCOLROW nPos ) const { - USHORT nCount = GetCount( nLevel ); + sal_uInt16 nCount = GetCount( nLevel ); ScOutlineEntry* pEntry; - for (USHORT nIndex = 0; nIndex < nCount; nIndex++) + for (sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++) { pEntry = GetEntry( nLevel, nIndex ); if ((pEntry->GetStart() <= nPos) && (nPos <= pEntry->GetEnd())) @@ -437,34 +437,34 @@ ScOutlineEntry* ScOutlineArray::GetEntryByPos( USHORT nLevel, SCCOLROW nPos ) co return NULL; } -BOOL ScOutlineArray::GetEntryIndex( USHORT nLevel, SCCOLROW nPos, USHORT& rnIndex ) const +sal_Bool ScOutlineArray::GetEntryIndex( sal_uInt16 nLevel, SCCOLROW nPos, sal_uInt16& rnIndex ) const { // found entry contains passed position - USHORT nCount = GetCount( nLevel ); + sal_uInt16 nCount = GetCount( nLevel ); for ( rnIndex = 0; rnIndex < nCount; ++rnIndex ) { const ScOutlineEntry* pEntry = GetEntry( nLevel, rnIndex ); if ( (pEntry->GetStart() <= nPos) && (nPos <= pEntry->GetEnd()) ) - return TRUE; + return sal_True; } - return FALSE; + return false; } -BOOL ScOutlineArray::GetEntryIndexInRange( - USHORT nLevel, SCCOLROW nBlockStart, SCCOLROW nBlockEnd, USHORT& rnIndex ) const +sal_Bool ScOutlineArray::GetEntryIndexInRange( + sal_uInt16 nLevel, SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_uInt16& rnIndex ) const { // found entry will be completely inside of passed range - USHORT nCount = GetCount( nLevel ); + sal_uInt16 nCount = GetCount( nLevel ); for ( rnIndex = 0; rnIndex < nCount; ++rnIndex ) { const ScOutlineEntry* pEntry = GetEntry( nLevel, rnIndex ); if ( (nBlockStart <= pEntry->GetStart()) && (pEntry->GetEnd() <= nBlockEnd) ) - return TRUE; + return sal_True; } - return FALSE; + return false; } -void ScOutlineArray::SetVisibleBelow( USHORT nLevel, USHORT nEntry, BOOL bValue, BOOL bSkipHidden ) +void ScOutlineArray::SetVisibleBelow( sal_uInt16 nLevel, sal_uInt16 nEntry, sal_Bool bValue, sal_Bool bSkipHidden ) { ScOutlineEntry* pEntry = GetEntry( nLevel, nEntry ); if( pEntry ) @@ -472,9 +472,9 @@ void ScOutlineArray::SetVisibleBelow( USHORT nLevel, USHORT nEntry, BOOL bValue, SCCOLROW nStart = pEntry->GetStart(); SCCOLROW nEnd = pEntry->GetEnd(); - for (USHORT nSubLevel=nLevel+1; nSubLevel<nDepth; nSubLevel++) + for (sal_uInt16 nSubLevel=nLevel+1; nSubLevel<nDepth; nSubLevel++) { - USHORT i = 0; + sal_uInt16 i = 0; pEntry = (ScOutlineEntry*) aCollections[nSubLevel].At(i); while (pEntry) { @@ -484,7 +484,7 @@ void ScOutlineArray::SetVisibleBelow( USHORT nLevel, USHORT nEntry, BOOL bValue, if (bSkipHidden) if (!pEntry->IsHidden()) - SetVisibleBelow( nSubLevel, i, bValue, TRUE ); + SetVisibleBelow( nSubLevel, i, bValue, sal_True ); } ++i; @@ -499,7 +499,7 @@ void ScOutlineArray::SetVisibleBelow( USHORT nLevel, USHORT nEntry, BOOL bValue, void ScOutlineArray::GetRange( SCCOLROW& rStart, SCCOLROW& rEnd ) const { - USHORT nCount = aCollections[0].GetCount(); + sal_uInt16 nCount = aCollections[0].GetCount(); if (nCount) { rStart = ((ScOutlineEntry*) aCollections[0].At(0))->GetStart(); @@ -509,12 +509,12 @@ void ScOutlineArray::GetRange( SCCOLROW& rStart, SCCOLROW& rEnd ) const rStart = rEnd = 0; } -void ScOutlineArray::ExtendBlock( USHORT nLevel, SCCOLROW& rBlkStart, SCCOLROW& rBlkEnd ) +void ScOutlineArray::ExtendBlock( sal_uInt16 nLevel, SCCOLROW& rBlkStart, SCCOLROW& rBlkEnd ) { - USHORT nCount; + sal_uInt16 nCount; SCCOLROW nStart; SCCOLROW nEnd; - USHORT i; + sal_uInt16 i; ScOutlineEntry* pEntry; nCount = GetCount(nLevel); @@ -532,16 +532,16 @@ void ScOutlineArray::ExtendBlock( USHORT nLevel, SCCOLROW& rBlkStart, SCCOLROW& } } -BOOL ScOutlineArray::TestInsertSpace( SCSIZE nSize, SCCOLROW nMaxVal ) const +sal_Bool ScOutlineArray::TestInsertSpace( SCSIZE nSize, SCCOLROW nMaxVal ) const { - USHORT nCount = aCollections[0].GetCount(); + sal_uInt16 nCount = aCollections[0].GetCount(); if (nCount) { SCCOLROW nEnd = ((ScOutlineEntry*) aCollections[0].At(nCount-1))->GetEnd(); return ( sal::static_int_cast<SCCOLROW>(nEnd+nSize) <= nMaxVal ); } - return TRUE; + return sal_True; } void ScOutlineArray::InsertSpace( SCCOLROW nStartPos, SCSIZE nSize ) @@ -567,11 +567,11 @@ void ScOutlineArray::InsertSpace( SCCOLROW nStartPos, SCSIZE nSize ) } } -BOOL ScOutlineArray::DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize ) +sal_Bool ScOutlineArray::DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize ) { SCCOLROW nEndPos = nStartPos + nSize - 1; - BOOL bNeedSave = FALSE; // Original fuer Undo benoetigt? - BOOL bChanged = FALSE; // fuer Test auf Level + sal_Bool bNeedSave = false; // Original fuer Undo benoetigt? + sal_Bool bChanged = false; // fuer Test auf Level ScSubOutlineIterator aIter( this ); ScOutlineEntry* pEntry; @@ -589,11 +589,11 @@ BOOL ScOutlineArray::DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize ) pEntry->SetSize( nEntrySize-nSize ); else { - bNeedSave = TRUE; + bNeedSave = sal_True; if ( nEntryStart >= nStartPos && nEntryEnd <= nEndPos ) // innen { aIter.DeleteLast(); - bChanged = TRUE; + bChanged = sal_True; } else if ( nEntryStart >= nStartPos ) // rechts ueber pEntry->SetPosSize( nStartPos, static_cast<SCSIZE>(nEntryEnd-nEndPos) ); @@ -644,7 +644,7 @@ bool ScOutlineArray::ManualAction( SCCOLROW nStartPos, SCCOLROW nEndPos, bool bS void ScOutlineArray::RemoveAll() { - for (USHORT nLevel=0; nLevel<nDepth; nLevel++) + for (sal_uInt16 nLevel=0; nLevel<nDepth; nLevel++) aCollections[nLevel].FreeAll(); nDepth = 0; @@ -662,7 +662,7 @@ ScOutlineTable::ScOutlineTable( const ScOutlineTable& rOutline ) : { } -BOOL ScOutlineTable::TestInsertCol( SCSIZE nSize ) +sal_Bool ScOutlineTable::TestInsertCol( SCSIZE nSize ) { return aColOutline.TestInsertSpace( nSize, MAXCOL ); } @@ -672,12 +672,12 @@ void ScOutlineTable::InsertCol( SCCOL nStartCol, SCSIZE nSize ) aColOutline.InsertSpace( nStartCol, nSize ); } -BOOL ScOutlineTable::DeleteCol( SCCOL nStartCol, SCSIZE nSize ) +sal_Bool ScOutlineTable::DeleteCol( SCCOL nStartCol, SCSIZE nSize ) { return aColOutline.DeleteSpace( nStartCol, nSize ); } -BOOL ScOutlineTable::TestInsertRow( SCSIZE nSize ) +sal_Bool ScOutlineTable::TestInsertRow( SCSIZE nSize ) { return aRowOutline.TestInsertSpace( nSize, MAXROW ); } @@ -687,7 +687,7 @@ void ScOutlineTable::InsertRow( SCROW nStartRow, SCSIZE nSize ) aRowOutline.InsertSpace( nStartRow, nSize ); } -BOOL ScOutlineTable::DeleteRow( SCROW nStartRow, SCSIZE nSize ) +sal_Bool ScOutlineTable::DeleteRow( SCROW nStartRow, SCSIZE nSize ) { return aRowOutline.DeleteSpace( nStartRow, nSize ); } @@ -705,7 +705,7 @@ ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray ) : } ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray, - USHORT nLevel, USHORT nEntry ) : + sal_uInt16 nLevel, sal_uInt16 nEntry ) : pArray( pOutlineArray ) { ScOutlineEntry* pEntry = (ScOutlineEntry*) pArray->aCollections[nLevel].At(nEntry); @@ -719,7 +719,7 @@ ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray, ScOutlineEntry* ScSubOutlineIterator::GetNext() { ScOutlineEntry* pEntry; - BOOL bFound = FALSE; + sal_Bool bFound = false; do { if (nSubLevel >= nDepth) @@ -734,7 +734,7 @@ ScOutlineEntry* ScSubOutlineIterator::GetNext() else { if ( pEntry->GetStart() >= nStart && pEntry->GetEnd() <= nEnd ) - bFound = TRUE; + bFound = sal_True; ++nSubEntry; } } @@ -742,12 +742,12 @@ ScOutlineEntry* ScSubOutlineIterator::GetNext() return pEntry; // nSubLevel gueltig, wenn pEntry != 0 } -USHORT ScSubOutlineIterator::LastLevel() const +sal_uInt16 ScSubOutlineIterator::LastLevel() const { return nSubLevel; } -USHORT ScSubOutlineIterator::LastEntry() const +sal_uInt16 ScSubOutlineIterator::LastEntry() const { if (nSubEntry == 0) { diff --git a/sc/source/core/data/pagepar.cxx b/sc/source/core/data/pagepar.cxx index 03ca4060d49b..bbaac42b6292 100644 --- a/sc/source/core/data/pagepar.cxx +++ b/sc/source/core/data/pagepar.cxx @@ -58,11 +58,11 @@ ScPageTableParam::~ScPageTableParam() void ScPageTableParam::Reset() { - bCellContent = TRUE; + bCellContent = sal_True; bNotes=bGrid=bHeaders=bDrawings= bLeftRight=bScaleAll=bScaleTo=bScalePageNum= - bFormulas=bNullVals=bSkipEmpty = FALSE; - bTopDown=bScaleNone=bCharts=bObjects = TRUE; + bFormulas=bNullVals=bSkipEmpty = false; + bTopDown=bScaleNone=bCharts=bObjects = sal_True; nScaleAll = 100; nScalePageNum = nScaleWidth = nScaleHeight = 0; nFirstPageNo = 1; @@ -70,7 +70,7 @@ void ScPageTableParam::Reset() //------------------------------------------------------------------------ -BOOL ScPageTableParam::operator==( const ScPageTableParam& r ) const +sal_Bool ScPageTableParam::operator==( const ScPageTableParam& r ) const { return ( memcmp( this, &r, sizeof(ScPageTableParam) ) == 0 ); } @@ -93,7 +93,7 @@ ScPageAreaParam::~ScPageAreaParam() void ScPageAreaParam::Reset() { - bPrintArea = bRepeatRow = bRepeatCol = FALSE; + bPrintArea = bRepeatRow = bRepeatCol = false; memset( &aPrintArea, 0, sizeof(ScRange) ); memset( &aRepeatRow, 0, sizeof(ScRange) ); @@ -102,9 +102,9 @@ void ScPageAreaParam::Reset() //------------------------------------------------------------------------ -BOOL ScPageAreaParam::operator==( const ScPageAreaParam& r ) const +sal_Bool ScPageAreaParam::operator==( const ScPageAreaParam& r ) const { - BOOL bEqual = + sal_Bool bEqual = bPrintArea == r.bPrintArea && bRepeatRow == r.bRepeatRow && bRepeatCol == r.bRepeatCol; diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index adfedf20fb66..1c58a1644af7 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -128,7 +128,7 @@ ScPatternAttr::~ScPatternAttr() SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const { - ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().Clone(TRUE, pPool) ); + ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().Clone(sal_True, pPool) ); pPattern->pStyle = pStyle; pPattern->pName = pName ? new String(*pName) : NULL; @@ -138,7 +138,7 @@ SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const inline int StrCmp( const String* pStr1, const String* pStr2 ) { - return ( pStr1 ? ( pStr2 ? ( *pStr1 == *pStr2 ) : FALSE ) : ( pStr2 ? FALSE : TRUE ) ); + return ( pStr1 ? ( pStr2 ? ( *pStr1 == *pStr2 ) : false ) : ( pStr2 ? false : sal_True ) ); } inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) @@ -164,10 +164,10 @@ int ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() ) ); } -SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, USHORT /* nVersion */ ) const +SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ ) const { String* pStr; - BOOL bHasStyle; + sal_Bool bHasStyle; rStream >> bHasStyle; @@ -192,9 +192,9 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, USHORT /* nVersion */ ) c return pPattern; } -SvStream& ScPatternAttr::Store(SvStream& rStream, USHORT /* nItemVersion */) const +SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const { - rStream << (BOOL)TRUE; + rStream << (sal_Bool)sal_True; if ( pStyle ) rStream.WriteByteString( pStyle->GetName(), rStream.GetStreamCharSet() ); @@ -221,7 +221,7 @@ SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet& rItemSet } else { - INT32 nAngle = ((const SfxInt32Item&)GetItem( ATTR_ROTATE_VALUE, rItemSet, pCondSet )).GetValue(); + sal_Int32 nAngle = ((const SfxInt32Item&)GetItem( ATTR_ROTATE_VALUE, rItemSet, pCondSet )).GetValue(); if( nAngle == 9000 ) eOrient = SVX_ORIENTATION_BOTTOMTOP; else if( nAngle == 27000 ) @@ -239,27 +239,27 @@ SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet* pCondSet void ScPatternAttr::GetFont( Font& rFont, const SfxItemSet& rItemSet, ScAutoFontColorMode eAutoMode, OutputDevice* pOutDev, const Fraction* pScale, - const SfxItemSet* pCondSet, BYTE nScript, + const SfxItemSet* pCondSet, sal_uInt8 nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) { // Items auslesen const SvxFontItem* pFontAttr; - UINT32 nFontHeight; + sal_uInt32 nFontHeight; FontWeight eWeight; FontItalic eItalic; FontUnderline eUnder; FontUnderline eOver; - BOOL bWordLine; + sal_Bool bWordLine; FontStrikeout eStrike; - BOOL bOutline; - BOOL bShadow; + sal_Bool bOutline; + sal_Bool bShadow; FontEmphasisMark eEmphasis; FontRelief eRelief; Color aColor; LanguageType eLang; - USHORT nFontId, nHeightId, nWeightId, nPostureId, nLangId; + sal_uInt16 nFontId, nHeightId, nWeightId, nPostureId, nLangId; if ( nScript == SCRIPTTYPE_ASIAN ) { nFontId = ATTR_CJK_FONT; @@ -289,59 +289,59 @@ void ScPatternAttr::GetFont( { const SfxPoolItem* pItem; - if ( pCondSet->GetItemState( nFontId, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( nFontId, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( nFontId ); pFontAttr = (const SvxFontItem*) pItem; - if ( pCondSet->GetItemState( nHeightId, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( nHeightId, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( nHeightId ); nFontHeight = ((const SvxFontHeightItem*)pItem)->GetHeight(); - if ( pCondSet->GetItemState( nWeightId, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( nWeightId, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( nWeightId ); eWeight = (FontWeight)((const SvxWeightItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( nPostureId, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( nPostureId, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( nPostureId ); eItalic = (FontItalic)((const SvxPostureItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_UNDERLINE ); eUnder = (FontUnderline)((const SvxUnderlineItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_OVERLINE ); eOver = (FontUnderline)((const SvxOverlineItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_WORDLINE ); bWordLine = ((const SvxWordLineModeItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_CROSSEDOUT ); eStrike = (FontStrikeout)((const SvxCrossedOutItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_CONTOUR ); bOutline = ((const SvxContourItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_SHADOWED ); bShadow = ((const SvxShadowedItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_EMPHASISMARK ); eEmphasis = ((const SvxEmphasisMarkItem*)pItem)->GetEmphasisMark(); - if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_RELIEF ); eRelief = (FontRelief)((const SvxCharReliefItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_COLOR, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_COLOR, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_FONT_COLOR ); aColor = ((const SvxColorItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( nLangId, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( nLangId, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( nLangId ); eLang = ((const SvxLanguageItem*)pItem)->GetLanguage(); } @@ -434,7 +434,7 @@ void ScPatternAttr::GetFont( if ( pCondSet ) { const SfxPoolItem* pItem; - if ( pCondSet->GetItemState( ATTR_BACKGROUND, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_BACKGROUND, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rItemSet.Get( ATTR_BACKGROUND ); aBackColor = ((const SvxBrushItem*)pItem)->GetColor(); } @@ -499,13 +499,13 @@ void ScPatternAttr::GetFont( rFont.SetEmphasisMark( eEmphasis ); rFont.SetRelief( eRelief ); rFont.SetColor( aColor ); - rFont.SetTransparent( TRUE ); + rFont.SetTransparent( sal_True ); } void ScPatternAttr::GetFont( Font& rFont, ScAutoFontColorMode eAutoMode, OutputDevice* pOutDev, const Fraction* pScale, - const SfxItemSet* pCondSet, BYTE nScript, + const SfxItemSet* pCondSet, sal_uInt8 nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) const { GetFont( rFont, GetItemSet(), eAutoMode, pOutDev, pScale, pCondSet, nScript, pBackConfigColor, pTextConfigColor ); @@ -524,16 +524,16 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r FontWeight eWeight, eCjkWeight, eCtlWeight; SvxUnderlineItem aUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE); SvxOverlineItem aOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE); - BOOL bWordLine; + sal_Bool bWordLine; FontStrikeout eStrike; FontItalic eItalic, eCjkItalic, eCtlItalic; - BOOL bOutline; - BOOL bShadow; - BOOL bForbidden; + sal_Bool bOutline; + sal_Bool bShadow; + sal_Bool bForbidden; FontEmphasisMark eEmphasis; FontRelief eRelief; LanguageType eLang, eCjkLang, eCtlLang; - BOOL bHyphenate; + sal_Bool bHyphenate; SvxFrameDirection eDirection; //! additional parameter to control if language is needed? @@ -542,100 +542,100 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r { const SfxPoolItem* pItem; - if ( pCondSet->GetItemState( ATTR_FONT_COLOR, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_COLOR, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_COLOR ); aColorItem = *(const SvxColorItem*)pItem; - if ( pCondSet->GetItemState( ATTR_FONT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT ); aFontItem = *(const SvxFontItem*)pItem; - if ( pCondSet->GetItemState( ATTR_CJK_FONT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CJK_FONT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT ); aCjkFontItem = *(const SvxFontItem*)pItem; - if ( pCondSet->GetItemState( ATTR_CTL_FONT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CTL_FONT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT ); aCtlFontItem = *(const SvxFontItem*)pItem; - if ( pCondSet->GetItemState( ATTR_FONT_HEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_HEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_HEIGHT ); nTHeight = ((const SvxFontHeightItem*)pItem)->GetHeight(); - if ( pCondSet->GetItemState( ATTR_CJK_FONT_HEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CJK_FONT_HEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT_HEIGHT ); nCjkTHeight = ((const SvxFontHeightItem*)pItem)->GetHeight(); - if ( pCondSet->GetItemState( ATTR_CTL_FONT_HEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CTL_FONT_HEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT_HEIGHT ); nCtlTHeight = ((const SvxFontHeightItem*)pItem)->GetHeight(); - if ( pCondSet->GetItemState( ATTR_FONT_WEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_WEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_WEIGHT ); eWeight = (FontWeight)((const SvxWeightItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_CJK_FONT_WEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CJK_FONT_WEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT_WEIGHT ); eCjkWeight = (FontWeight)((const SvxWeightItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_CTL_FONT_WEIGHT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CTL_FONT_WEIGHT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT_WEIGHT ); eCtlWeight = (FontWeight)((const SvxWeightItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_POSTURE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_POSTURE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_POSTURE ); eItalic = (FontItalic)((const SvxPostureItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_CJK_FONT_POSTURE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CJK_FONT_POSTURE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT_POSTURE ); eCjkItalic = (FontItalic)((const SvxPostureItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_CTL_FONT_POSTURE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CTL_FONT_POSTURE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT_POSTURE ); eCtlItalic = (FontItalic)((const SvxPostureItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_UNDERLINE ); aUnderlineItem = *(const SvxUnderlineItem*)pItem; - if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_OVERLINE ); aOverlineItem = *(const SvxOverlineItem*)pItem; - if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_WORDLINE ); bWordLine = ((const SvxWordLineModeItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_CROSSEDOUT ); eStrike = (FontStrikeout)((const SvxCrossedOutItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_CONTOUR ); bOutline = ((const SvxContourItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_SHADOWED ); bShadow = ((const SvxShadowedItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FORBIDDEN_RULES, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FORBIDDEN_RULES, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FORBIDDEN_RULES ); bForbidden = ((const SvxForbiddenRuleItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_EMPHASISMARK ); eEmphasis = ((const SvxEmphasisMarkItem*)pItem)->GetEmphasisMark(); - if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_RELIEF ); eRelief = (FontRelief)((const SvxCharReliefItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_FONT_LANGUAGE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_FONT_LANGUAGE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_FONT_LANGUAGE ); eLang = ((const SvxLanguageItem*)pItem)->GetLanguage(); - if ( pCondSet->GetItemState( ATTR_CJK_FONT_LANGUAGE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CJK_FONT_LANGUAGE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT_LANGUAGE ); eCjkLang = ((const SvxLanguageItem*)pItem)->GetLanguage(); - if ( pCondSet->GetItemState( ATTR_CTL_FONT_LANGUAGE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_CTL_FONT_LANGUAGE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT_LANGUAGE ); eCtlLang = ((const SvxLanguageItem*)pItem)->GetLanguage(); - if ( pCondSet->GetItemState( ATTR_HYPHENATE, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_HYPHENATE, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_HYPHENATE ); bHyphenate = ((const SfxBoolItem*)pItem)->GetValue(); - if ( pCondSet->GetItemState( ATTR_WRITINGDIR, TRUE, &pItem ) != SFX_ITEM_SET ) + if ( pCondSet->GetItemState( ATTR_WRITINGDIR, sal_True, &pItem ) != SFX_ITEM_SET ) pItem = &rSrcSet.Get( ATTR_WRITINGDIR ); eDirection = (SvxFrameDirection)((const SvxFrameDirectionItem*)pItem)->GetValue(); } @@ -742,7 +742,7 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r // (don't evaluate attributes that can't be changed). // If a locale-dependent default is needed, it has to go into the cell // style, like the fonts. - rEditSet.Put( SvxScriptSpaceItem( FALSE, EE_PARA_ASIANCJKSPACING ) ); + rEditSet.Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) ); } void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCondSet ) const @@ -756,80 +756,80 @@ void ScPatternAttr::GetFromEditItemSet( SfxItemSet& rDestSet, const SfxItemSet& { const SfxPoolItem* pItem; - if (rEditSet.GetItemState(EE_CHAR_COLOR,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_COLOR,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxColorItem(ATTR_FONT_COLOR) = *(const SvxColorItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_FONTINFO,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTINFO,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontItem(ATTR_FONT) = *(const SvxFontItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CJK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CJK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontItem(ATTR_CJK_FONT) = *(const SvxFontItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CTL,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CTL,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontItem(ATTR_CTL_FONT) = *(const SvxFontItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontHeightItem( HMMToTwips( ((const SvxFontHeightItem*)pItem)->GetHeight() ), 100, ATTR_FONT_HEIGHT ) ); - if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CJK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CJK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontHeightItem( HMMToTwips( ((const SvxFontHeightItem*)pItem)->GetHeight() ), 100, ATTR_CJK_FONT_HEIGHT ) ); - if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CTL,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CTL,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxFontHeightItem( HMMToTwips( ((const SvxFontHeightItem*)pItem)->GetHeight() ), 100, ATTR_CTL_FONT_HEIGHT ) ); - if (rEditSet.GetItemState(EE_CHAR_WEIGHT,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_WEIGHT,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxWeightItem( (FontWeight)((const SvxWeightItem*)pItem)->GetValue(), ATTR_FONT_WEIGHT) ); - if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CJK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CJK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxWeightItem( (FontWeight)((const SvxWeightItem*)pItem)->GetValue(), ATTR_CJK_FONT_WEIGHT) ); - if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CTL,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CTL,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxWeightItem( (FontWeight)((const SvxWeightItem*)pItem)->GetValue(), ATTR_CTL_FONT_WEIGHT) ); // SvxTextLineItem contains enum and color - if (rEditSet.GetItemState(EE_CHAR_UNDERLINE,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_UNDERLINE,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxUnderlineItem(UNDERLINE_NONE,ATTR_FONT_UNDERLINE) = *(const SvxUnderlineItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_OVERLINE,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_OVERLINE,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxOverlineItem(UNDERLINE_NONE,ATTR_FONT_OVERLINE) = *(const SvxOverlineItem*)pItem ); - if (rEditSet.GetItemState(EE_CHAR_WLM,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_WLM,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxWordLineModeItem( ((const SvxWordLineModeItem*)pItem)->GetValue(), ATTR_FONT_WORDLINE) ); - if (rEditSet.GetItemState(EE_CHAR_STRIKEOUT,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_STRIKEOUT,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxCrossedOutItem( (FontStrikeout)((const SvxCrossedOutItem*)pItem)->GetValue(), ATTR_FONT_CROSSEDOUT) ); - if (rEditSet.GetItemState(EE_CHAR_ITALIC,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_ITALIC,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxPostureItem( (FontItalic)((const SvxPostureItem*)pItem)->GetValue(), ATTR_FONT_POSTURE) ); - if (rEditSet.GetItemState(EE_CHAR_ITALIC_CJK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_ITALIC_CJK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxPostureItem( (FontItalic)((const SvxPostureItem*)pItem)->GetValue(), ATTR_CJK_FONT_POSTURE) ); - if (rEditSet.GetItemState(EE_CHAR_ITALIC_CTL,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_ITALIC_CTL,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxPostureItem( (FontItalic)((const SvxPostureItem*)pItem)->GetValue(), ATTR_CTL_FONT_POSTURE) ); - if (rEditSet.GetItemState(EE_CHAR_OUTLINE,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_OUTLINE,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxContourItem( ((const SvxContourItem*)pItem)->GetValue(), ATTR_FONT_CONTOUR) ); - if (rEditSet.GetItemState(EE_CHAR_SHADOW,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_SHADOW,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxShadowedItem( ((const SvxShadowedItem*)pItem)->GetValue(), ATTR_FONT_SHADOWED) ); - if (rEditSet.GetItemState(EE_CHAR_EMPHASISMARK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_EMPHASISMARK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxEmphasisMarkItem( ((const SvxEmphasisMarkItem*)pItem)->GetEmphasisMark(), ATTR_FONT_EMPHASISMARK) ); - if (rEditSet.GetItemState(EE_CHAR_RELIEF,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_RELIEF,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxCharReliefItem( (FontRelief)((const SvxCharReliefItem*)pItem)->GetValue(), ATTR_FONT_RELIEF) ); - if (rEditSet.GetItemState(EE_CHAR_LANGUAGE,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_LANGUAGE,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_FONT_LANGUAGE) ); - if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CJK,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CJK,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_CJK_FONT_LANGUAGE) ); - if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CTL,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CTL,sal_True,&pItem) == SFX_ITEM_SET) rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_CTL_FONT_LANGUAGE) ); - if (rEditSet.GetItemState(EE_PARA_JUST,TRUE,&pItem) == SFX_ITEM_SET) + if (rEditSet.GetItemState(EE_PARA_JUST,sal_True,&pItem) == SFX_ITEM_SET) { SvxCellHorJustify eVal; switch ( ((const SvxAdjustItem*)pItem)->GetAdjust() ) @@ -898,12 +898,12 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) const SfxPoolItem* pThisItem; const SfxPoolItem* pOldItem; - for ( USHORT nSubWhich=ATTR_PATTERN_START; nSubWhich<=ATTR_PATTERN_END; nSubWhich++ ) + for ( sal_uInt16 nSubWhich=ATTR_PATTERN_START; nSubWhich<=ATTR_PATTERN_END; nSubWhich++ ) { // only items that are set are interesting - if ( rThisSet.GetItemState( nSubWhich, FALSE, &pThisItem ) == SFX_ITEM_SET ) + if ( rThisSet.GetItemState( nSubWhich, false, &pThisItem ) == SFX_ITEM_SET ) { - SfxItemState eOldState = rOldSet.GetItemState( nSubWhich, TRUE, &pOldItem ); + SfxItemState eOldState = rOldSet.GetItemState( nSubWhich, sal_True, &pOldItem ); if ( eOldState == SFX_ITEM_SET ) { // item is set in OldAttrs (or its parent) -> compare pointers @@ -920,19 +920,19 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs ) } } -BOOL ScPatternAttr::HasItemsSet( const USHORT* pWhich ) const +sal_Bool ScPatternAttr::HasItemsSet( const sal_uInt16* pWhich ) const { const SfxItemSet& rSet = GetItemSet(); - for (USHORT i=0; pWhich[i]; i++) - if ( rSet.GetItemState( pWhich[i], FALSE ) == SFX_ITEM_SET ) - return TRUE; - return FALSE; + for (sal_uInt16 i=0; pWhich[i]; i++) + if ( rSet.GetItemState( pWhich[i], false ) == SFX_ITEM_SET ) + return sal_True; + return false; } -void ScPatternAttr::ClearItems( const USHORT* pWhich ) +void ScPatternAttr::ClearItems( const sal_uInt16* pWhich ) { SfxItemSet& rSet = GetItemSet(); - for (USHORT i=0; pWhich[i]; i++) + for (sal_uInt16 i=0; pWhich[i]; i++) rSet.ClearItem(pWhich[i]); } @@ -970,9 +970,9 @@ SfxStyleSheetBase* lcl_CopyStyleToPool const SfxPoolItem* pSrcItem; if ( pFormatExchangeList && - rSrcSet.GetItemState( ATTR_VALUE_FORMAT, FALSE, &pSrcItem ) == SFX_ITEM_SET ) + rSrcSet.GetItemState( ATTR_VALUE_FORMAT, false, &pSrcItem ) == SFX_ITEM_SET ) { - ULONG nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue(); + sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue(); sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pFormatExchangeList->Get( nOldFormat )); if (pNewFormat) rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, *pNewFormat ) ); @@ -1018,10 +1018,10 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD pDestPattern->SetStyleSheet( (ScStyleSheet*)pStyleCpy ); } - for ( USHORT nAttrId = ATTR_PATTERN_START; nAttrId <= ATTR_PATTERN_END; nAttrId++ ) + for ( sal_uInt16 nAttrId = ATTR_PATTERN_START; nAttrId <= ATTR_PATTERN_END; nAttrId++ ) { const SfxPoolItem* pSrcItem; - SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, FALSE, &pSrcItem ); + SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, false, &pSrcItem ); if (eItemState==SFX_ITEM_ON) { SfxPoolItem* pNewItem = NULL; @@ -1030,11 +1030,11 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD { // Bedingte Formate ins neue Dokument kopieren - ULONG nNewIndex = 0; + sal_uLong nNewIndex = 0; ScConditionalFormatList* pSrcList = pSrcDoc->GetCondFormList(); if ( pSrcList ) { - ULONG nOldIndex = ((const SfxUInt32Item*)pSrcItem)->GetValue(); + sal_uLong nOldIndex = ((const SfxUInt32Item*)pSrcItem)->GetValue(); const ScConditionalFormat* pOldData = pSrcList->GetFormat( nOldIndex ); if ( pOldData ) { @@ -1046,8 +1046,8 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD ScStyleSheetPool* pSrcSPool = pSrcDoc->GetStyleSheetPool(); ScStyleSheetPool* pDestSPool = pDestDoc->GetStyleSheetPool(); const SvNumberFormatterIndexTable* pFormatExchangeList = pDestDoc->GetFormatExchangeList(); - USHORT nStlCnt = pOldData->Count(); - for (USHORT i=0; i<nStlCnt; i++) + sal_uInt16 nStlCnt = pOldData->Count(); + for (sal_uInt16 i=0; i<nStlCnt; i++) { String aName = pOldData->GetEntry(i)->GetStyle(); SfxStyleSheetBase* pSrcStl = @@ -1062,11 +1062,11 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD { // Gueltigkeit ins neue Dokument kopieren - ULONG nNewIndex = 0; + sal_uLong nNewIndex = 0; ScValidationDataList* pSrcList = pSrcDoc->GetValidationList(); if ( pSrcList ) { - ULONG nOldIndex = ((const SfxUInt32Item*)pSrcItem)->GetValue(); + sal_uLong nOldIndex = ((const SfxUInt32Item*)pSrcItem)->GetValue(); const ScValidationData* pOldData = pSrcList->GetData( nOldIndex ); if ( pOldData ) nNewIndex = pDestDoc->AddValidationEntry( *pOldData ); @@ -1077,10 +1077,10 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD { // Zahlformate nach Exchange-Liste - ULONG nOldFormat = ((const SfxUInt32Item*)pSrcItem)->GetValue(); + sal_uLong nOldFormat = ((const SfxUInt32Item*)pSrcItem)->GetValue(); sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDestDoc->GetFormatExchangeList()->Get(nOldFormat)); if (pNewFormat) - pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, (UINT32) (*pNewFormat) ); + pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, (sal_uInt32) (*pNewFormat) ); } if ( pNewItem ) @@ -1099,53 +1099,53 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD return pPatternAttr; } -BOOL ScPatternAttr::IsVisible() const +sal_Bool ScPatternAttr::IsVisible() const { const SfxItemSet& rSet = GetItemSet(); const SfxPoolItem* pItem; SfxItemState eState; - eState = rSet.GetItemState( ATTR_BACKGROUND, TRUE, &pItem ); + eState = rSet.GetItemState( ATTR_BACKGROUND, sal_True, &pItem ); if ( eState == SFX_ITEM_SET ) if ( ((const SvxBrushItem*)pItem)->GetColor().GetColor() != COL_TRANSPARENT ) - return TRUE; + return sal_True; - eState = rSet.GetItemState( ATTR_BORDER, TRUE, &pItem ); + eState = rSet.GetItemState( ATTR_BORDER, sal_True, &pItem ); if ( eState == SFX_ITEM_SET ) { const SvxBoxItem* pBoxItem = (SvxBoxItem*) pItem; if ( pBoxItem->GetTop() || pBoxItem->GetBottom() || pBoxItem->GetLeft() || pBoxItem->GetRight() ) - return TRUE; + return sal_True; } - eState = rSet.GetItemState( ATTR_BORDER_TLBR, TRUE, &pItem ); + eState = rSet.GetItemState( ATTR_BORDER_TLBR, sal_True, &pItem ); if ( eState == SFX_ITEM_SET ) if( static_cast< const SvxLineItem* >( pItem )->GetLine() ) - return TRUE; + return sal_True; - eState = rSet.GetItemState( ATTR_BORDER_BLTR, TRUE, &pItem ); + eState = rSet.GetItemState( ATTR_BORDER_BLTR, sal_True, &pItem ); if ( eState == SFX_ITEM_SET ) if( static_cast< const SvxLineItem* >( pItem )->GetLine() ) - return TRUE; + return sal_True; - eState = rSet.GetItemState( ATTR_SHADOW, TRUE, &pItem ); + eState = rSet.GetItemState( ATTR_SHADOW, sal_True, &pItem ); if ( eState == SFX_ITEM_SET ) if ( ((const SvxShadowItem*)pItem)->GetLocation() != SVX_SHADOW_NONE ) - return TRUE; + return sal_True; - return FALSE; + return false; } -inline BOOL OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, USHORT nId ) +inline sal_Bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) { const SfxPoolItem* pItem1 = &rSet1.Get(nId); const SfxPoolItem* pItem2 = &rSet2.Get(nId); return ( pItem1 == pItem2 || *pItem1 == *pItem2 ); } -BOOL ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const +sal_Bool ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const { const SfxItemSet& rThisSet = GetItemSet(); const SfxItemSet& rOtherSet = rOther.GetItemSet(); @@ -1172,9 +1172,9 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle ) SfxItemSet& rPatternSet = GetItemSet(); const SfxItemSet& rStyleSet = pNewStyle->GetItemSet(); - for (USHORT i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END; i++) + for (sal_uInt16 i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END; i++) { - if (rStyleSet.GetItemState(i, TRUE) == SFX_ITEM_SET) + if (rStyleSet.GetItemState(i, sal_True) == SFX_ITEM_SET) rPatternSet.ClearItem(i); } rPatternSet.SetParent(&pNewStyle->GetItemSet()); @@ -1231,20 +1231,20 @@ void ScPatternAttr::StyleToName() } } -BOOL ScPatternAttr::IsSymbolFont() const +sal_Bool ScPatternAttr::IsSymbolFont() const { const SfxPoolItem* pItem; - if( GetItemSet().GetItemState( ATTR_FONT, TRUE, &pItem ) == SFX_ITEM_SET ) - return BOOL( ((const SvxFontItem*) pItem)->GetCharSet() + if( GetItemSet().GetItemState( ATTR_FONT, sal_True, &pItem ) == SFX_ITEM_SET ) + return sal_Bool( ((const SvxFontItem*) pItem)->GetCharSet() == RTL_TEXTENCODING_SYMBOL ); else - return FALSE; + return false; } -ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const +sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const { - ULONG nFormat = + sal_uLong nFormat = ((SfxUInt32Item*)&GetItemSet().Get( ATTR_VALUE_FORMAT ))->GetValue(); LanguageType eLang = ((SvxLanguageItem*)&GetItemSet().Get( ATTR_LANGUAGE_FORMAT ))->GetLanguage(); @@ -1257,17 +1257,17 @@ ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const // dasselbe, wenn bedingte Formatierung im Spiel ist: -ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, +sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, const SfxItemSet* pCondSet ) const { DBG_ASSERT(pFormatter,"GetNumberFormat ohne Formatter"); const SfxPoolItem* pFormItem; - if ( !pCondSet || pCondSet->GetItemState(ATTR_VALUE_FORMAT,TRUE,&pFormItem) != SFX_ITEM_SET ) + if ( !pCondSet || pCondSet->GetItemState(ATTR_VALUE_FORMAT,sal_True,&pFormItem) != SFX_ITEM_SET ) pFormItem = &GetItemSet().Get(ATTR_VALUE_FORMAT); const SfxPoolItem* pLangItem; - if ( !pCondSet || pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT,TRUE,&pLangItem) != SFX_ITEM_SET ) + if ( !pCondSet || pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT,sal_True,&pLangItem) != SFX_ITEM_SET ) pLangItem = &GetItemSet().Get(ATTR_LANGUAGE_FORMAT); return pFormatter->GetFormatForLanguageIfBuiltIn( @@ -1275,15 +1275,15 @@ ULONG ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, ((SvxLanguageItem*)pLangItem)->GetLanguage() ); } -const SfxPoolItem& ScPatternAttr::GetItem( USHORT nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet ) +const SfxPoolItem& ScPatternAttr::GetItem( sal_uInt16 nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet ) { const SfxPoolItem* pCondItem; - if ( pCondSet && pCondSet->GetItemState( nWhich, TRUE, &pCondItem ) == SFX_ITEM_SET ) + if ( pCondSet && pCondSet->GetItemState( nWhich, sal_True, &pCondItem ) == SFX_ITEM_SET ) return *pCondItem; return rItemSet.Get(nWhich); } -const SfxPoolItem& ScPatternAttr::GetItem( USHORT nSubWhich, const SfxItemSet* pCondSet ) const +const SfxPoolItem& ScPatternAttr::GetItem( sal_uInt16 nSubWhich, const SfxItemSet* pCondSet ) const { return GetItem( nSubWhich, GetItemSet(), pCondSet ); } @@ -1295,7 +1295,7 @@ long ScPatternAttr::GetRotateVal( const SfxItemSet* pCondSet ) const long nAttrRotate = 0; if ( GetCellOrientation() == SVX_ORIENTATION_STANDARD ) { - BOOL bRepeat = ( static_cast<const SvxHorJustifyItem&>(GetItem(ATTR_HOR_JUSTIFY, pCondSet)). + sal_Bool bRepeat = ( static_cast<const SvxHorJustifyItem&>(GetItem(ATTR_HOR_JUSTIFY, pCondSet)). GetValue() == SVX_HOR_JUSTIFY_REPEAT ); // ignore orientation/rotation if "repeat" is active if ( !bRepeat ) @@ -1304,9 +1304,9 @@ long ScPatternAttr::GetRotateVal( const SfxItemSet* pCondSet ) const return nAttrRotate; } -BYTE ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const +sal_uInt8 ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const { - BYTE nRet = SC_ROTDIR_NONE; + sal_uInt8 nRet = SC_ROTDIR_NONE; long nAttrRotate = GetRotateVal( pCondSet ); if ( nAttrRotate ) diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index dd9980340cda..a76d4dac6cd3 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - - #ifdef _MSC_VER #pragma optimize("",off) #endif @@ -61,7 +59,6 @@ using ::com::sun::star::sheet::DataPilotFieldReference; using ::rtl::OUString; -// STATIC DATA ----------------------------------------------------------- // ============================================================================ ScDPName::ScDPName(const OUString& rName, const OUString& rLayoutName) : @@ -83,7 +80,7 @@ OUString ScDPLabelData::Member::getDisplayName() const return maName; } -ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : +ScDPLabelData::ScDPLabelData( const String& rName, SCCOL nCol, bool bIsValue ) : maName( rName ), mnCol( nCol ), mnFuncMask( PIVOT_FUNC_NONE ), @@ -104,13 +101,59 @@ OUString ScDPLabelData::getDisplayName() const // ============================================================================ -ScDPFuncData::ScDPFuncData( short nCol, USHORT nFuncMask ) : +ScPivotField::ScPivotField( SCCOL nNewCol, sal_uInt16 nNewFuncMask ) : + nCol( nNewCol ), + nFuncMask( nNewFuncMask ), + nFuncCount( 0 ) +{ +} + +bool ScPivotField::operator==( const ScPivotField& r ) const +{ + return (nCol == r.nCol) + && (nFuncMask == r.nFuncMask) + && (nFuncCount == r.nFuncCount) + && (maFieldRef.ReferenceType == r.maFieldRef.ReferenceType) + && (maFieldRef.ReferenceField == r.maFieldRef.ReferenceField) + && (maFieldRef.ReferenceItemType == r.maFieldRef.ReferenceItemType) + && (maFieldRef.ReferenceItemName == r.maFieldRef.ReferenceItemName); +} + +// ============================================================================ + +ScPivotParam::ScPivotParam() + : nCol( 0 ), nRow( 0 ), nTab( 0 ), + bIgnoreEmptyRows( false ), bDetectCategories( false ), + bMakeTotalCol( true ), bMakeTotalRow( true ) +{ +} + +bool ScPivotParam::operator==( const ScPivotParam& r ) const +{ + return + (nCol == r.nCol) + && (nRow == r.nRow) + && (nTab == r.nTab) + && (bIgnoreEmptyRows == r.bIgnoreEmptyRows) + && (bDetectCategories == r.bDetectCategories) + && (bMakeTotalCol == r.bMakeTotalCol) + && (bMakeTotalRow == r.bMakeTotalRow) + && (maLabelArray.size() == r.maLabelArray.size()) // ! only size?? + && (maPageArr == r.maPageArr) + && (maColArr == r.maColArr) + && (maRowArr == r.maRowArr) + && (maDataArr == r.maDataArr); +} + +// ============================================================================ + +ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask ) : mnCol( nCol ), mnFuncMask( nFuncMask ) { } -ScDPFuncData::ScDPFuncData( short nCol, USHORT nFuncMask, const DataPilotFieldReference& rFieldRef ) : +ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask, const DataPilotFieldReference& rFieldRef ) : mnCol( nCol ), mnFuncMask( nFuncMask ), maFieldRef( rFieldRef ) diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index 99e22727bd89..0596070e459a 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -102,10 +102,10 @@ void ScPoolHelper::UseDocOptions() const { if (pFormTable) { - USHORT d,m,y; + sal_uInt16 d,m,y; aOpt.GetDate( d,m,y ); pFormTable->ChangeNullDate( d,m,y ); - pFormTable->ChangeStandardPrec( (USHORT)aOpt.GetStdPrecision() ); + pFormTable->ChangeStandardPrec( (sal_uInt16)aOpt.GetStdPrecision() ); pFormTable->SetYear2000( aOpt.GetYear2000() ); } } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 60081966d443..ddf0941d1b44 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -129,16 +129,16 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc ) value. */ aItemSet.Put( XLineStartItem( String::EmptyString(), ::basegfx::B2DPolyPolygon( aTriangle ) ) ); aItemSet.Put( XLineStartWidthItem( 200 ) ); - aItemSet.Put( XLineStartCenterItem( FALSE ) ); + aItemSet.Put( XLineStartCenterItem( false ) ); aItemSet.Put( XFillStyleItem( XFILL_SOLID ) ); aItemSet.Put( XFillColorItem( String::EmptyString(), ScDetectiveFunc::GetCommentColor() ) ); aItemSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT ) ); // shadow - /* SdrShadowItem has FALSE, instead the shadow is set for the + /* SdrShadowItem has sal_False, instead the shadow is set for the rectangle only with SetSpecialTextBoxShadow() when the object is created (item must be set to adjust objects from older files). */ - aItemSet.Put( SdrShadowItem( FALSE ) ); + aItemSet.Put( SdrShadowItem( false ) ); aItemSet.Put( SdrShadowXDistItem( 100 ) ); aItemSet.Put( SdrShadowYDistItem( 100 ) ); @@ -147,8 +147,8 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc ) aItemSet.Put( SdrTextRightDistItem( 100 ) ); aItemSet.Put( SdrTextUpperDistItem( 100 ) ); aItemSet.Put( SdrTextLowerDistItem( 100 ) ); - aItemSet.Put( SdrTextAutoGrowWidthItem( FALSE ) ); - aItemSet.Put( SdrTextAutoGrowHeightItem( TRUE ) ); + aItemSet.Put( SdrTextAutoGrowWidthItem( false ) ); + aItemSet.Put( SdrTextAutoGrowHeightItem( true ) ); // use the default cell style to be able to modify the caption font const ScPatternAttr& rDefPattern = static_cast< const ScPatternAttr& >( rDoc.GetPool()->GetDefaultItem( ATTR_PATTERN ) ); rDefPattern.FillEditItemSet( &aItemSet ); @@ -161,7 +161,7 @@ void ScCaptionUtil::SetCaptionItems( SdrCaptionObj& rCaption, const SfxItemSet& // copy all items rCaption.SetMergedItemSet( rItemSet ); // reset shadow items - rCaption.SetMergedItem( SdrShadowItem( FALSE ) ); + rCaption.SetMergedItem( SdrShadowItem( false ) ); rCaption.SetMergedItem( SdrShadowXDistItem( 100 ) ); rCaption.SetMergedItem( SdrShadowYDistItem( 100 ) ); rCaption.SetSpecialTextBoxShadow(); @@ -566,7 +566,7 @@ OUString ScPostIt::GetText() const if( const EditTextObject* pEditObj = GetEditTextObject() ) { OUStringBuffer aBuffer; - for( USHORT nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara ) + for( sal_uInt16 nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara ) { if( nPara > 0 ) aBuffer.append( sal_Unicode( '\n' ) ); @@ -762,10 +762,13 @@ void ScPostIt::RemoveCaption() { pDrawPage->RecalcObjOrdNums(); // create drawing undo action (before removing the object to have valid draw page in undo action) - if( pDrawLayer && pDrawLayer->IsRecording() ) + bool bRecording = ( pDrawLayer && pDrawLayer->IsRecording() ); + if( bRecording ) pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) ); // remove the object from the drawing page, delete if undo is disabled - pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); + SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); + if( !bRecording ) + SdrObject::Free( pObj ); } } maNoteData.mpCaption = 0; @@ -833,10 +836,10 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption( ScCaptionUtil::SetDefaultItems( *pCaption, rDoc ); // adjust caption size to text size long nMaxWidth = ::std::min< long >( aVisRect.GetWidth() * 2 / 3, SC_NOTECAPTION_MAXWIDTH_TEMP ); - pCaption->SetMergedItem( SdrTextAutoGrowWidthItem( TRUE ) ); + pCaption->SetMergedItem( SdrTextAutoGrowWidthItem( sal_True ) ); pCaption->SetMergedItem( SdrTextMinFrameWidthItem( SC_NOTECAPTION_WIDTH ) ); pCaption->SetMergedItem( SdrTextMaxFrameWidthItem( nMaxWidth ) ); - pCaption->SetMergedItem( SdrTextAutoGrowHeightItem( TRUE ) ); + pCaption->SetMergedItem( SdrTextAutoGrowHeightItem( sal_True ) ); pCaption->AdjustTextFrameWidthAndHeight(); } diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx index df96c218ee89..1f533e034d32 100644 --- a/sc/source/core/data/scdpoutputimpl.cxx +++ b/sc/source/core/data/scdpoutputimpl.cxx @@ -50,7 +50,7 @@ void OutputImpl::OutputDataArea() mnCols.push_back( mnTabEndCol+1); //set last row bottom mnRows.push_back( mnTabEndRow+1); //set last col bottom - BOOL bAllRows = ( ( mnTabEndRow - mnDataStartRow + 2 ) == (SCROW) mnRows.size() ); + sal_Bool bAllRows = ( ( mnTabEndRow - mnDataStartRow + 2 ) == (SCROW) mnRows.size() ); std::sort( mnCols.begin(), mnCols.end(), lcl_compareColfuc ); std::sort( mnRows.begin(), mnRows.end(), lcl_compareRowfuc ); @@ -86,7 +86,7 @@ void OutputImpl::OutputDataArea() OutputBlockFrame( mnDataStartCol, mnTabStartRow, mnTabEndCol, mnDataStartRow-1 ); } -OutputImpl::OutputImpl( ScDocument* pDoc, USHORT nTab, +OutputImpl::OutputImpl( ScDocument* pDoc, sal_uInt16 nTab, SCCOL nTabStartCol, SCROW nTabStartRow, SCCOL nMemberStartCol, @@ -111,32 +111,32 @@ OutputImpl::OutputImpl( ScDocument* pDoc, USHORT nTab, } -BOOL OutputImpl::AddRow( SCROW nRow ) +sal_Bool OutputImpl::AddRow( SCROW nRow ) { if ( !mbNeedLineRows[ nRow - mnDataStartRow ] ) { mbNeedLineRows[ nRow - mnDataStartRow ] = true; mnRows.push_back( nRow ); - return TRUE; + return sal_True; } else - return FALSE; + return false; } -BOOL OutputImpl::AddCol( SCCOL nCol ) +sal_Bool OutputImpl::AddCol( SCCOL nCol ) { if ( !mbNeedLineCols[ nCol - mnDataStartCol ] ) { mbNeedLineCols[ nCol - mnDataStartCol ] = true; mnCols.push_back( nCol ); - return TRUE; + return sal_True; } else - return FALSE; + return false; } -void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, BOOL bHori ) +void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori ) { SvxBorderLine aLine, aOutLine; @@ -169,16 +169,16 @@ void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEnd SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER ); - aBoxInfo.SetValid(VALID_VERT,FALSE ); + aBoxInfo.SetValid(VALID_VERT,false ); if ( bHori ) { - aBoxInfo.SetValid(VALID_HORI,TRUE); + aBoxInfo.SetValid(VALID_HORI,sal_True); aBoxInfo.SetLine( &aLine, BOXINFO_LINE_HORI ); } else - aBoxInfo.SetValid(VALID_HORI,FALSE ); + aBoxInfo.SetValid(VALID_HORI,false ); - aBoxInfo.SetValid(VALID_DISTANCE,FALSE); + aBoxInfo.SetValid(VALID_DISTANCE,false); mpDoc->ApplyFrameAreaTab( ScRange( nStartCol, nStartRow, mnTab, nEndCol, nEndRow , mnTab ), &aBox, &aBoxInfo ); diff --git a/sc/source/core/data/scdpoutputimpl.hxx b/sc/source/core/data/scdpoutputimpl.hxx index 2b8d66b4c75a..35a0a65a06fc 100644 --- a/sc/source/core/data/scdpoutputimpl.hxx +++ b/sc/source/core/data/scdpoutputimpl.hxx @@ -39,7 +39,7 @@ class OutputImpl { ScDocument* mpDoc; - USHORT mnTab; + sal_uInt16 mnTab; ::std::vector< bool > mbNeedLineCols; ::std::vector< SCCOL > mnCols; @@ -57,7 +57,7 @@ class OutputImpl SCROW mnTabEndRow; public: - OutputImpl( ScDocument* pDoc, USHORT nTab, + OutputImpl( ScDocument* pDoc, sal_uInt16 nTab, SCCOL nTabStartCol, SCROW nTabStartRow, SCCOL nMemberStartCol, @@ -66,11 +66,11 @@ public: SCROW nDataStartRow, SCCOL nTabEndCol, SCROW nTabEndRow ); - BOOL AddRow( SCROW nRow ); - BOOL AddCol( SCCOL nCol ); + sal_Bool AddRow( SCROW nRow ); + sal_Bool AddCol( SCCOL nCol ); void OutputDataArea(); - void OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, BOOL bHori = FALSE ); + void OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori = false ); }; diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index aca3dc3fb2b8..fc3b4957c9ca 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -56,7 +56,7 @@ ScSortParam::ScSortParam( const ScSortParam& r ) : aCollatorLocale( r.aCollatorLocale ), aCollatorAlgorithm( r.aCollatorAlgorithm ), nCompatHeader( r.nCompatHeader ) { - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) { bDoSort[i] = r.bDoSort[i]; nField[i] = r.nField[i]; @@ -73,16 +73,16 @@ void ScSortParam::Clear() nCompatHeader = 2; nDestTab = 0; nUserIndex = 0; - bHasHeader=bCaseSens=bUserDef=bNaturalSort = FALSE; - bByRow=bIncludePattern=bInplace = TRUE; + bHasHeader=bCaseSens=bUserDef=bNaturalSort = false; + bByRow=bIncludePattern=bInplace = true; aCollatorLocale = ::com::sun::star::lang::Locale(); aCollatorAlgorithm.Erase(); - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) { - bDoSort[i] = FALSE; + bDoSort[i] = false; nField[i] = 0; - bAscending[i] = TRUE; + bAscending[i] = sal_True; } } @@ -109,7 +109,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r ) aCollatorAlgorithm = r.aCollatorAlgorithm; nCompatHeader = r.nCompatHeader; - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) { bDoSort[i] = r.bDoSort[i]; nField[i] = r.nField[i]; @@ -121,12 +121,12 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r ) //------------------------------------------------------------------------ -BOOL ScSortParam::operator==( const ScSortParam& rOther ) const +sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const { - BOOL bEqual = FALSE; + sal_Bool bEqual = false; // Anzahl der Sorts gleich? - USHORT nLast = 0; - USHORT nOtherLast = 0; + sal_uInt16 nLast = 0; + sal_uInt16 nOtherLast = 0; while ( bDoSort[nLast++] && nLast < MAXSORT ) ; while ( rOther.bDoSort[nOtherLast++] && nOtherLast < MAXSORT ) ; nLast--; @@ -153,8 +153,8 @@ BOOL ScSortParam::operator==( const ScSortParam& rOther ) const && (aCollatorAlgorithm == rOther.aCollatorAlgorithm) ) { - bEqual = TRUE; - for ( USHORT i=0; i<=nLast && bEqual; i++ ) + bEqual = sal_True; + for ( sal_uInt16 i=0; i<=nLast && bEqual; i++ ) { bEqual = (nField[i] == rOther.nField[i]) && (bAscending[i] == rOther.bAscending[i]); } @@ -166,15 +166,15 @@ BOOL ScSortParam::operator==( const ScSortParam& rOther ) const ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) : nCol1(rSub.nCol1),nRow1(rSub.nRow1),nCol2(rSub.nCol2),nRow2(rSub.nRow2), - bHasHeader(TRUE),bByRow(TRUE),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort), + bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort), bUserDef(rSub.bUserDef),nUserIndex(rSub.nUserIndex),bIncludePattern(rSub.bIncludePattern), - bInplace(TRUE), + bInplace(sal_True), nDestTab(0),nDestCol(0),nDestRow(0), aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ), nCompatHeader( rOld.nCompatHeader ) { - USHORT nNewCount = 0; - USHORT i; + sal_uInt16 nNewCount = 0; + sal_uInt16 i; // zuerst die Gruppen aus den Teilergebnissen if (rSub.bDoSort) @@ -183,7 +183,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) { if (nNewCount < MAXSORT) { - bDoSort[nNewCount] = TRUE; + bDoSort[nNewCount] = sal_True; nField[nNewCount] = rSub.nField[i]; bAscending[nNewCount] = rSub.bAscending; ++nNewCount; @@ -195,15 +195,15 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) if (rOld.bDoSort[i]) { SCCOLROW nThisField = rOld.nField[i]; - BOOL bDouble = FALSE; - for (USHORT j=0; j<nNewCount; j++) + sal_Bool bDouble = false; + for (sal_uInt16 j=0; j<nNewCount; j++) if ( nField[j] == nThisField ) - bDouble = TRUE; + bDouble = sal_True; if (!bDouble) // ein Feld nicht zweimal eintragen { if (nNewCount < MAXSORT) { - bDoSort[nNewCount] = TRUE; + bDoSort[nNewCount] = sal_True; nField[nNewCount] = nThisField; bAscending[nNewCount] = rOld.bAscending[i]; ++nNewCount; @@ -213,9 +213,9 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) for (i=nNewCount; i<MAXSORT; i++) // Rest loeschen { - bDoSort[i] = FALSE; + bDoSort[i] = false; nField[i] = 0; - bAscending[i] = TRUE; + bAscending[i] = sal_True; } } @@ -223,21 +223,21 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) : nCol1(nCol),nRow1(rParam.nRow1),nCol2(nCol),nRow2(rParam.nRow2), - bHasHeader(rParam.bHasHeader),bByRow(TRUE),bCaseSens(rParam.bCaseSens), - bNaturalSort(FALSE), + bHasHeader(rParam.bHasHeader),bByRow(true),bCaseSens(rParam.bCaseSens), + bNaturalSort(false), //! TODO: what about Locale and Algorithm? - bUserDef(FALSE),nUserIndex(0),bIncludePattern(FALSE), - bInplace(TRUE), + bUserDef(false),nUserIndex(0),bIncludePattern(false), + bInplace(true), nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2) { - bDoSort[0] = TRUE; + bDoSort[0] = sal_True; nField[0] = nCol; - bAscending[0] = TRUE; - for (USHORT i=1; i<MAXSORT; i++) + bAscending[0] = sal_True; + for (sal_uInt16 i=1; i<MAXSORT; i++) { - bDoSort[i] = FALSE; + bDoSort[i] = false; nField[i] = 0; - bAscending[i] = TRUE; + bAscending[i] = sal_True; } } @@ -254,13 +254,13 @@ void ScSortParam::MoveToDest() nRow1 = sal::static_int_cast<SCROW>( nRow1 + nDifY ); nCol2 = sal::static_int_cast<SCCOL>( nCol2 + nDifX ); nRow2 = sal::static_int_cast<SCROW>( nRow2 + nDifY ); - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) if (bByRow) nField[i] += nDifX; else nField[i] += nDifY; - bInplace = TRUE; + bInplace = sal_True; } else { diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 8d1d3a41dba1..a72a0c9953d9 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -95,7 +95,7 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument ) //------------------------------------------------------------------------ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, - SfxStyleFamily eFam, USHORT mask, USHORT nPos ) + SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos ) { // When updating styles from a template, Office 5.1 sometimes created // files with multiple default styles. @@ -124,7 +124,7 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, SfxStyleSheetBase* ScStyleSheetPool::Create( const String& rName, SfxStyleFamily eFamily, - USHORT nMaskP ) + sal_uInt16 nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); if ( eFamily == SFX_STYLE_FAMILY_PARA && ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != rName ) @@ -177,14 +177,14 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, { // Set-Items - if ( rSourceSet.GetItemState( ATTR_PAGE_HEADERSET, FALSE, &pItem ) == SFX_ITEM_SET ) + if ( rSourceSet.GetItemState( ATTR_PAGE_HEADERSET, false, &pItem ) == SFX_ITEM_SET ) { const SfxItemSet& rSrcSub = ((const SvxSetItem*) pItem)->GetItemSet(); SfxItemSet aDestSub( *rDestSet.GetPool(), rSrcSub.GetRanges() ); aDestSub.PutExtended( rSrcSub, SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT ); rDestSet.Put( SvxSetItem( ATTR_PAGE_HEADERSET, aDestSub ) ); } - if ( rSourceSet.GetItemState( ATTR_PAGE_FOOTERSET, FALSE, &pItem ) == SFX_ITEM_SET ) + if ( rSourceSet.GetItemState( ATTR_PAGE_FOOTERSET, false, &pItem ) == SFX_ITEM_SET ) { const SfxItemSet& rSrcSub = ((const SvxSetItem*) pItem)->GetItemSet(); SfxItemSet aDestSub( *rDestSet.GetPool(), rSrcSub.GetRanges() ); @@ -197,9 +197,9 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, // number format exchange list has to be handled here, too if ( pDoc && pDoc->GetFormatExchangeList() && - rSourceSet.GetItemState( ATTR_VALUE_FORMAT, FALSE, &pItem ) == SFX_ITEM_SET ) + rSourceSet.GetItemState( ATTR_VALUE_FORMAT, false, &pItem ) == SFX_ITEM_SET ) { - ULONG nOldFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); + sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDoc->GetFormatExchangeList()->Get( nOldFormat )); if (pNewFormat) rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, *pNewFormat ) ); @@ -231,7 +231,7 @@ void ScStyleSheetPool::CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ) //------------------------------------------------------------------------ -void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, USHORT nFontType, USHORT nItemId ) +void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, sal_uInt16 nFontType, sal_uInt16 nItemId ) { if ( eLang != LANGUAGE_NONE && eLang != LANGUAGE_DONTKNOW && eLang != LANGUAGE_SYSTEM ) { @@ -258,8 +258,8 @@ void ScStyleSheetPool::CreateStandardStyles() SfxItemSet* pSet = NULL; SfxItemSet* pHFSet = NULL; SvxSetItem* pHFSetItem = NULL; - ScEditEngineDefaulter* pEdEngine = new ScEditEngineDefaulter( EditEngine::CreatePool(), TRUE ); - pEdEngine->SetUpdateMode( FALSE ); + ScEditEngineDefaulter* pEdEngine = new ScEditEngineDefaulter( EditEngine::CreatePool(), sal_True ); + pEdEngine->SetUpdateMode( false ); EditTextObject* pEmptyTxtObj = pEdEngine->CreateTextObject(); EditTextObject* pTxtObj = NULL; ScPageHFItem* pHeaderItem = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ); @@ -431,13 +431,13 @@ void ScStyleSheetPool::CreateStandardStyles() aBoxItem.SetLine( &aBorderLine, BOX_LINE_LEFT ); aBoxItem.SetLine( &aBorderLine, BOX_LINE_RIGHT ); aBoxItem.SetDistance( 10 ); // 0.2mm - aBoxInfoItem.SetValid( VALID_TOP, TRUE ); - aBoxInfoItem.SetValid( VALID_BOTTOM, TRUE ); - aBoxInfoItem.SetValid( VALID_LEFT, TRUE ); - aBoxInfoItem.SetValid( VALID_RIGHT, TRUE ); - aBoxInfoItem.SetValid( VALID_DISTANCE, TRUE ); - aBoxInfoItem.SetTable( FALSE ); - aBoxInfoItem.SetDist ( TRUE ); + aBoxInfoItem.SetValid( VALID_TOP, sal_True ); + aBoxInfoItem.SetValid( VALID_BOTTOM, sal_True ); + aBoxInfoItem.SetValid( VALID_LEFT, sal_True ); + aBoxInfoItem.SetValid( VALID_RIGHT, sal_True ); + aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True ); + aBoxInfoItem.SetTable( false ); + aBoxInfoItem.SetDist ( sal_True ); pHFSetItem = new SvxSetItem( ((SvxSetItem&)pSet->Get( ATTR_PAGE_HEADERSET ) ) ); pHFSet = &(pHFSetItem->GetItemSet()); diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index e84bd904320f..d51582370045 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -68,7 +68,7 @@ TYPEINIT1(ScStyleSheet, SfxStyleSheet); ScStyleSheet::ScStyleSheet( const String& rName, ScStyleSheetPool& rPoolP, SfxStyleFamily eFamily, - USHORT nMaskP ) + sal_uInt16 nMaskP ) : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) , eUsage( UNKNOWN ) @@ -91,21 +91,21 @@ ScStyleSheet::~ScStyleSheet() //------------------------------------------------------------------------ -BOOL ScStyleSheet::HasFollowSupport() const +sal_Bool ScStyleSheet::HasFollowSupport() const { - return FALSE; + return false; } //------------------------------------------------------------------------ -BOOL ScStyleSheet::HasParentSupport () const +sal_Bool ScStyleSheet::HasParentSupport () const { - BOOL bHasParentSupport = FALSE; + sal_Bool bHasParentSupport = false; switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PARA: bHasParentSupport = TRUE; break; - case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = FALSE; break; + case SFX_STYLE_FAMILY_PARA: bHasParentSupport = sal_True; break; + case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; default: { // added to avoid warnings @@ -117,9 +117,9 @@ BOOL ScStyleSheet::HasParentSupport () const //------------------------------------------------------------------------ -BOOL ScStyleSheet::SetParent( const String& rParentName ) +sal_Bool ScStyleSheet::SetParent( const String& rParentName ) { - BOOL bResult = FALSE; + sal_Bool bResult = false; String aEffName = rParentName; SfxStyleSheetBase* pStyle = rPool.Find( aEffName, nFamily ); if (!pStyle) @@ -137,6 +137,13 @@ BOOL ScStyleSheet::SetParent( const String& rParentName ) { SfxItemSet& rParentSet = pStyle->GetItemSet(); GetItemSet().SetParent( &rParentSet ); + + // #i113491# Drag&Drop in the stylist's hierarchical view doesn't execute a slot, + // so the repaint has to come from here (after modifying the ItemSet). + // RepaintRange checks the document's IsVisible flag and locked repaints. + ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument(); + if (pDoc) + pDoc->RepaintRange( ScRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ) ); } } @@ -201,11 +208,11 @@ SfxItemSet& ScStyleSheet::GetItemSet() ATTR_ULSPACE ); SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER ); - aBoxInfoItem.SetTable( FALSE ); - aBoxInfoItem.SetDist( TRUE ); - aBoxInfoItem.SetValid( VALID_DISTANCE, TRUE ); + aBoxInfoItem.SetTable( false ); + aBoxInfoItem.SetDist( sal_True ); + aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True ); - aPageItem.SetLandscape( FALSE ); + aPageItem.SetLandscape( false ); rHFSet.Put( aBoxInfoItem ); rHFSet.Put( aHFSizeItem ); @@ -244,7 +251,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() 0 ); break; } - bMySet = TRUE; + bMySet = true; } if ( nHelpId == HID_SC_SHEET_CELL_ERG1 ) { @@ -253,7 +260,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() ScDocument* pDoc = ((ScStyleSheetPool&)GetPool()).GetDocument(); if ( pDoc ) { - ULONG nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY,ScGlobal::eLnge ); + sal_uLong nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY,ScGlobal::eLnge ); pSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNumFmt ) ); } } @@ -264,21 +271,21 @@ SfxItemSet& ScStyleSheet::GetItemSet() //------------------------------------------------------------------------ -BOOL ScStyleSheet::IsUsed() const +sal_Bool ScStyleSheet::IsUsed() const { if ( GetFamily() == SFX_STYLE_FAMILY_PARA ) { // Always query the document to let it decide if a rescan is necessary, // and store the state. ScDocument* pDoc = ((ScStyleSheetPool&)rPool).GetDocument(); - if ( pDoc && pDoc->IsStyleSheetUsed( *this, TRUE ) ) + if ( pDoc && pDoc->IsStyleSheetUsed( *this, sal_True ) ) eUsage = USED; else eUsage = NOTUSED; return eUsage == USED; } else - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -333,11 +340,11 @@ const String& ScStyleSheet::GetFollow() const //! Flag gesetzt und abgefragt werden. //! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. -BOOL ScStyleSheet::SetName( const String& rNew ) +sal_Bool ScStyleSheet::SetName( const String& rNew ) { String aFileStdName = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_STANDARD)); if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) - return FALSE; + return false; else return SfxStyleSheet::SetName( rNew ); } diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index dd1eca50e907..cc82529f149b 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" +// INCLUDE --------------------------------------------------------------- + #include "scitems.hxx" #include <svx/algitem.hxx> #include <editeng/justifyitem.hxx> @@ -82,7 +84,7 @@ ScProgress* GetProgressBar( } void GetOptimalHeightsInColumn( - ScColumn* pCol, SCROW nStartRow, SCROW nEndRow, vector<USHORT>& aHeights, + ScColumn* pCol, SCROW nStartRow, SCROW nEndRow, vector<sal_uInt16>& aHeights, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, bool bForce, ScProgress* pProgress, sal_uInt32 nProgressStart) { @@ -97,13 +99,13 @@ void GetOptimalHeightsInColumn( // daraus Standardhoehe suchen, die im unteren Bereich gilt - USHORT nMinHeight = aHeights[nCount-1]; + sal_uInt16 nMinHeight = aHeights[nCount-1]; SCSIZE nPos = nCount-1; while ( nPos && aHeights[nPos-1] >= nMinHeight ) --nPos; SCROW nMinStart = nStartRow + nPos; - ULONG nWeightedCount = 0; + sal_uLong nWeightedCount = 0; for (SCCOL nCol=0; nCol<MAXCOL; nCol++) // MAXCOL schon oben { pCol[nCol].GetOptimalHeight( @@ -112,7 +114,7 @@ void GetOptimalHeightsInColumn( if (pProgress) { - ULONG nWeight = pCol[nCol].GetWeightedCount(); + sal_uLong nWeight = pCol[nCol].GetWeightedCount(); if (nWeight) // nochmal denselben Status muss auch nicht sein { nWeightedCount += nWeight; @@ -125,7 +127,7 @@ void GetOptimalHeightsInColumn( struct OptimalHeightsFuncObjBase { virtual ~OptimalHeightsFuncObjBase() {} - virtual bool operator() (SCROW nStartRow, SCROW nEndRow, USHORT nHeight) = 0; + virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight) = 0; }; struct SetRowHeightOnlyFunc : public OptimalHeightsFuncObjBase @@ -135,7 +137,7 @@ struct SetRowHeightOnlyFunc : public OptimalHeightsFuncObjBase mpTab(pTab) {} - virtual bool operator() (SCROW nStartRow, SCROW nEndRow, USHORT nHeight) + virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight) { mpTab->SetRowHeightOnly(nStartRow, nEndRow, nHeight); return false; @@ -154,26 +156,26 @@ struct SetRowHeightRangeFunc : public OptimalHeightsFuncObjBase mnPPTY(nPPTY) {} - virtual bool operator() (SCROW nStartRow, SCROW nEndRow, USHORT nHeight) + virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight) { return mpTab->SetRowHeightRange(nStartRow, nEndRow, nHeight, mnPPTX, mnPPTY); } }; bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj, - ScBitMaskCompressedArray<SCROW, BYTE>* pRowFlags, SCROW nStartRow, SCROW nEndRow, USHORT nExtra, - const vector<USHORT>& aHeights, bool bForce) + ScBitMaskCompressedArray<SCROW, sal_uInt8>* pRowFlags, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra, + const vector<sal_uInt16>& aHeights, bool bForce) { SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1); bool bChanged = false; SCROW nRngStart = 0; SCROW nRngEnd = 0; - USHORT nLast = 0; + sal_uInt16 nLast = 0; for (SCSIZE i=0; i<nCount; i++) { size_t nIndex; SCROW nRegionEndRow; - BYTE nRowFlag = pRowFlags->GetValue( nStartRow+i, nIndex, nRegionEndRow ); + sal_uInt8 nRowFlag = pRowFlags->GetValue( nStartRow+i, nIndex, nRegionEndRow ); if ( nRegionEndRow > nEndRow ) nRegionEndRow = nEndRow; SCSIZE nMoreRows = nRegionEndRow - ( nStartRow+i ); // additional equal rows after first @@ -228,15 +230,15 @@ bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj, // ----------------------------------------------------------------------- ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, - BOOL bColInfo, BOOL bRowInfo ) : + sal_Bool bColInfo, sal_Bool bRowInfo ) : aName( rNewName ), aCodeName( rNewName ), - bScenario( FALSE ), - bLayoutRTL( FALSE ), - bLoadingRTL( FALSE ), + bScenario( false ), + bLayoutRTL( false ), + bLoadingRTL( false ), nLinkMode( 0 ), aPageStyle( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ), - bPageSizeValid( FALSE ), + bPageSizeValid( false ), nRepeatStartX( SCCOL_REPEAT_NONE ), nRepeatStartY( SCROW_REPEAT_NONE ), pTabProtection( NULL ), @@ -250,11 +252,11 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, mpFilteredRows(new ScFlatBoolRowSegments), pOutlineTable( NULL ), pSheetEvents( NULL ), - bTableAreaValid( FALSE ), - bVisible( TRUE ), - bStreamValid( FALSE ), - bPendingRowHeights( FALSE ), - bCalcNotification( FALSE ), + bTableAreaValid( false ), + bVisible( sal_True ), + bStreamValid( false ), + bPendingRowHeights( false ), + bCalcNotification( false ), nTab( nNewTab ), nRecalcLvl( 0 ), pDocument( pDoc ), @@ -269,14 +271,14 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, aScenarioColor( COL_LIGHTGRAY ), aTabBgColor( COL_AUTO ), nScenarioFlags( 0 ), - bActiveScenario( FALSE ), + bActiveScenario( false ), mbPageBreaksValid(false) { if (bColInfo) { - pColWidth = new USHORT[ MAXCOL+1 ]; - pColFlags = new BYTE[ MAXCOL+1 ]; + pColWidth = new sal_uInt16[ MAXCOL+1 ]; + pColFlags = new sal_uInt8[ MAXCOL+1 ]; for (SCCOL i=0; i<=MAXCOL; i++) { @@ -288,7 +290,7 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, if (bRowInfo) { mpRowHeights.reset(new ScFlatUInt16RowSegments(ScGlobal::nStdRowHeight)); - pRowFlags = new ScBitMaskCompressedArray< SCROW, BYTE>( MAXROW, 0); + pRowFlags = new ScBitMaskCompressedArray< SCROW, sal_uInt8>( MAXROW, 0); } if ( pDocument->IsDocVisible() ) @@ -301,11 +303,11 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if (pDrawLayer) { - if ( pDrawLayer->ScAddPage( nTab ) ) // FALSE (not inserted) during Undo + if ( pDrawLayer->ScAddPage( nTab ) ) // sal_False (not inserted) during Undo { pDrawLayer->ScRenamePage( nTab, aName ); - ULONG nx = (ULONG) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); - ULONG ny = (ULONG) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS ); + sal_uLong nx = (sal_uLong) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS ); + sal_uLong ny = (sal_uLong) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS ); pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( nx, ny ), false ); } } @@ -360,31 +362,31 @@ const String& ScTable::GetUpperName() const return aUpperName; } -void ScTable::SetVisible( BOOL bVis ) +void ScTable::SetVisible( sal_Bool bVis ) { if (bVisible != bVis && IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); bVisible = bVis; } -void ScTable::SetStreamValid( BOOL bSet, BOOL bIgnoreLock ) +void ScTable::SetStreamValid( sal_Bool bSet, sal_Bool bIgnoreLock ) { if ( bIgnoreLock || !pDocument->IsStreamValidLocked() ) bStreamValid = bSet; } -void ScTable::SetPendingRowHeights( BOOL bSet ) +void ScTable::SetPendingRowHeights( sal_Bool bSet ) { bPendingRowHeights = bSet; } -void ScTable::SetLayoutRTL( BOOL bSet ) +void ScTable::SetLayoutRTL( sal_Bool bSet ) { bLayoutRTL = bSet; } -void ScTable::SetLoadingRTL( BOOL bSet ) +void ScTable::SetLoadingRTL( sal_Bool bSet ) { bLoadingRTL = bSet; } @@ -405,14 +407,14 @@ void ScTable::SetTabBgColor(const Color& rColor) } } -void ScTable::SetScenario( BOOL bFlag ) +void ScTable::SetScenario( sal_Bool bFlag ) { bScenario = bFlag; } -void ScTable::SetLink( BYTE nMode, +void ScTable::SetLink( sal_uInt8 nMode, const String& rDoc, const String& rFlt, const String& rOpt, - const String& rTab, ULONG nRefreshDelay ) + const String& rTab, sal_uLong nRefreshDelay ) { nLinkMode = nMode; aLinkDoc = rDoc; // Datei @@ -422,13 +424,13 @@ void ScTable::SetLink( BYTE nMode, nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -USHORT ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev, +sal_uInt16 ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bFormula, const ScMarkData* pMarkData, + sal_Bool bFormula, const ScMarkData* pMarkData, const ScColWidthParam* pParam ) { return aCol[nCol].GetOptimalColWidth( pDev, nPPTX, nPPTY, rZoomX, rZoomY, @@ -439,34 +441,34 @@ long ScTable::GetNeededSize( SCCOL nCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bWidth, BOOL bTotalSize ) + sal_Bool bWidth, sal_Bool bTotalSize ) { ScNeededSizeOptions aOptions; - aOptions.bSkipMerged = FALSE; // zusammengefasste mitzaehlen + aOptions.bSkipMerged = false; // zusammengefasste mitzaehlen aOptions.bTotalSize = bTotalSize; return aCol[nCol].GetNeededSize ( nRow, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bWidth, aOptions ); } -BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, +sal_Bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bForce, ScProgress* pOuterProgress, ULONG nProgressStart ) + sal_Bool bForce, ScProgress* pOuterProgress, sal_uLong nProgressStart ) { DBG_ASSERT( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); if ( !pDocument->IsAdjustHeightEnabled() ) { - return FALSE; + return false; } SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1); ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument); - vector<USHORT> aHeights(nCount, 0); + vector<sal_uInt16> aHeights(nCount, 0); GetOptimalHeightsInColumn( aCol, nStartRow, nEndRow, aHeights, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, @@ -482,11 +484,11 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, return bChanged; } -void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nExtra, +void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, - BOOL bForce, ScProgress* pOuterProgress, ULONG nProgressStart ) + sal_Bool bForce, ScProgress* pOuterProgress, sal_uLong nProgressStart ) { DBG_ASSERT( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); @@ -497,7 +499,7 @@ void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nExtr ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument); - vector<USHORT> aHeights(nCount, 0); + vector<sal_uInt16> aHeights(nCount, 0); GetOptimalHeightsInColumn( aCol, nStartRow, nEndRow, aHeights, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, @@ -511,17 +513,17 @@ void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nExtr delete pProgress; } -BOOL ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const +sal_Bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nMaxX = 0; SCROW nMaxY = 0; for (SCCOL i=0; i<=MAXCOL; i++) - if (!aCol[i].IsEmptyVisData(TRUE)) // TRUE = Notizen zaehlen auch + if (!aCol[i].IsEmptyVisData(sal_True)) // sal_True = Notizen zaehlen auch { - bFound = TRUE; + bFound = sal_True; nMaxX = i; - SCROW nColY = aCol[i].GetLastVisDataPos(TRUE); + SCROW nColY = aCol[i].GetLastVisDataPos(sal_True); if (nColY > nMaxY) nMaxY = nColY; } @@ -531,14 +533,14 @@ BOOL ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const return bFound; } -BOOL ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const +sal_Bool ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const { - BOOL bRet = TRUE; //! merken? + sal_Bool bRet = sal_True; //! merken? if (!bTableAreaValid) { bRet = GetPrintArea( ((ScTable*)this)->nTableAreaX, - ((ScTable*)this)->nTableAreaY, TRUE ); - ((ScTable*)this)->bTableAreaValid = TRUE; + ((ScTable*)this)->nTableAreaY, sal_True ); + ((ScTable*)this)->bTableAreaValid = sal_True; } rEndCol = nTableAreaX; rEndRow = nTableAreaY; @@ -547,9 +549,9 @@ BOOL ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const const SCCOL SC_COLUMNS_STOP = 30; -BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const +sal_Bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bNotes ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nMaxX = 0; SCROW nMaxY = 0; SCCOL i; @@ -557,7 +559,7 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const for (i=0; i<=MAXCOL; i++) // Daten testen if (!aCol[i].IsEmptyVisData(bNotes)) { - bFound = TRUE; + bFound = sal_True; if (i>nMaxX) nMaxX = i; SCROW nColY = aCol[i].GetLastVisDataPos(bNotes); @@ -572,7 +574,7 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const SCROW nLastRow; if (aCol[i].GetLastVisibleAttr( nLastRow )) { - bFound = TRUE; + bFound = sal_True; nMaxX = i; if (nLastRow > nMaxY) nMaxY = nLastRow; @@ -618,10 +620,10 @@ BOOL ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const return bFound; } -BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, - SCCOL& rEndCol, BOOL /* bNotes */ ) const +sal_Bool ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, + SCCOL& rEndCol, sal_Bool /* bNotes */ ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nMaxX = 0; SCCOL i; @@ -629,7 +631,7 @@ BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, { if (aCol[i].HasVisibleAttrIn( nStartRow, nEndRow )) { - bFound = TRUE; + bFound = sal_True; nMaxX = i; } } @@ -645,7 +647,7 @@ BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, { if (!aCol[i].IsEmptyBlock( nStartRow, nEndRow )) //! bNotes ?????? { - bFound = TRUE; + bFound = sal_True; if (i>nMaxX) nMaxX = i; } @@ -655,10 +657,10 @@ BOOL ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, return bFound; } -BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, - SCROW& rEndRow, BOOL bNotes ) const +sal_Bool ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, + SCROW& rEndRow, sal_Bool bNotes ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCROW nMaxY = 0; SCCOL i; @@ -667,7 +669,7 @@ BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, SCROW nLastRow; if (aCol[i].GetLastVisibleAttr( nLastRow )) { - bFound = TRUE; + bFound = sal_True; if (nLastRow > nMaxY) nMaxY = nLastRow; } @@ -676,7 +678,7 @@ BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, for (i=nStartCol; i<=nEndCol; i++) // Daten testen if (!aCol[i].IsEmptyVisData(bNotes)) { - bFound = TRUE; + bFound = sal_True; SCROW nColY = aCol[i].GetLastVisDataPos(bNotes); if (nColY > nMaxY) nMaxY = nColY; @@ -686,9 +688,9 @@ BOOL ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, return bFound; } -BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const +sal_Bool ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nMinX = MAXCOL; SCROW nMinY = MAXROW; SCCOL i; @@ -700,7 +702,7 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const { if (!bFound) nMinX = i; - bFound = TRUE; + bFound = sal_True; if (nFirstRow < nMinY) nMinY = nFirstRow; } @@ -716,14 +718,14 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const } } - BOOL bDatFound = FALSE; + sal_Bool bDatFound = false; for (i=0; i<=MAXCOL; i++) // Daten testen - if (!aCol[i].IsEmptyVisData(TRUE)) + if (!aCol[i].IsEmptyVisData(sal_True)) { if (!bDatFound && i<nMinX) nMinX = i; - bFound = bDatFound = TRUE; - SCROW nColY = aCol[i].GetFirstVisDataPos(TRUE); + bFound = bDatFound = sal_True; + SCROW nColY = aCol[i].GetFirstVisDataPos(sal_True); if (nColY < nMinY) nMinY = nColY; } @@ -734,20 +736,20 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const } void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, - BOOL bIncludeOld, bool bOnlyDown ) const -{ - BOOL bLeft = FALSE; - BOOL bRight = FALSE; - BOOL bTop = FALSE; - BOOL bBottom = FALSE; - BOOL bChanged; - BOOL bFound; + sal_Bool bIncludeOld, bool bOnlyDown ) const +{ + sal_Bool bLeft = false; + sal_Bool bRight = false; + sal_Bool bTop = false; + sal_Bool bBottom = false; + sal_Bool bChanged; + sal_Bool bFound; SCCOL i; SCROW nTest; do { - bChanged = FALSE; + bChanged = false; if (!bOnlyDown) { @@ -760,30 +762,30 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S if (!aCol[rEndCol+1].IsEmptyBlock(nStart,nEnd)) { ++rEndCol; - bChanged = TRUE; - bRight = TRUE; + bChanged = sal_True; + bRight = sal_True; } if (rStartCol > 0) if (!aCol[rStartCol-1].IsEmptyBlock(nStart,nEnd)) { --rStartCol; - bChanged = TRUE; - bLeft = TRUE; + bChanged = sal_True; + bLeft = sal_True; } if (rStartRow > 0) { nTest = rStartRow-1; - bFound = FALSE; + bFound = false; for (i=rStartCol; i<=rEndCol && !bFound; i++) if (aCol[i].HasDataAt(nTest)) - bFound = TRUE; + bFound = sal_True; if (bFound) { --rStartRow; - bChanged = TRUE; - bTop = TRUE; + bChanged = sal_True; + bTop = sal_True; } } } @@ -791,15 +793,15 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S if (rEndRow < MAXROW) { nTest = rEndRow+1; - bFound = FALSE; + bFound = false; for (i=rStartCol; i<=rEndCol && !bFound; i++) if (aCol[i].HasDataAt(nTest)) - bFound = TRUE; + bFound = sal_True; if (bFound) { ++rEndRow; - bChanged = TRUE; - bBottom = TRUE; + bChanged = sal_True; + bBottom = sal_True; } } } @@ -815,19 +817,19 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S --rEndCol; if ( !bTop && rStartRow < MAXROW && rStartRow < rEndRow ) { - bFound = FALSE; + bFound = false; for (i=rStartCol; i<=rEndCol && !bFound; i++) if (aCol[i].HasDataAt(rStartRow)) - bFound = TRUE; + bFound = sal_True; if (!bFound) ++rStartRow; } if ( !bBottom && rEndRow > 0 && rStartRow < rEndRow ) { - bFound = FALSE; + bFound = false; for (i=rStartCol; i<=rEndCol && !bFound; i++) if (aCol[i].HasDataAt(rEndRow)) - bFound = TRUE; + bFound = sal_True; if (!bFound) --rEndRow; } @@ -950,12 +952,12 @@ SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, return nCount; } -BOOL ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol ) +sal_Bool ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCCOL i=nStartCol; i<=nEndCol && !bFound; i++) if (aCol[i].HasDataAt(nRow)) - bFound = TRUE; + bFound = sal_True; return !bFound; } @@ -979,20 +981,20 @@ void ScTable::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY if (nMovX) { SCsCOL nNewCol = (SCsCOL) rCol; - BOOL bThere = aCol[nNewCol].HasVisibleDataAt(rRow); - BOOL bFnd; + sal_Bool bThere = aCol[nNewCol].HasVisibleDataAt(rRow); + sal_Bool bFnd; if (bThere) { do { nNewCol = sal::static_int_cast<SCsCOL>( nNewCol + nMovX ); - bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : FALSE; + bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : false; } while (bFnd); nNewCol = sal::static_int_cast<SCsCOL>( nNewCol - nMovX ); if (nNewCol == (SCsCOL)rCol) - bThere = FALSE; + bThere = false; } if (!bThere) @@ -1000,7 +1002,7 @@ void ScTable::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY do { nNewCol = sal::static_int_cast<SCsCOL>( nNewCol + nMovX ); - bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : TRUE; + bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : sal_True; } while (!bFnd); } @@ -1014,22 +1016,22 @@ void ScTable::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY aCol[rCol].FindDataAreaPos(rRow,nMovY); } -BOOL ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, - BOOL bMarked, BOOL bUnprotected ) +sal_Bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, + sal_Bool bMarked, sal_Bool bUnprotected ) { if (!ValidCol(nCol) || !ValidRow(nRow)) - return FALSE; + return false; if (pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) // Skip an overlapped cell. return false; if (bMarked && !rMark.IsCellMarked(nCol,nRow)) - return FALSE; + return false; if (bUnprotected && ((const ScProtectionAttr*) GetAttr(nCol,nRow,ATTR_PROTECTION))->GetProtection()) - return FALSE; + return false; if (bMarked || bUnprotected) //! auch sonst ??? { @@ -1038,22 +1040,22 @@ BOOL ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, //! per Extra-Parameter steuern, nur fuer Cursor-Bewegung ??? if (RowHidden(nRow)) - return FALSE; + return false; if (ColHidden(nCol)) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, - BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark ) + sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark ) { if (bUnprotected && !IsProtected()) // Tabelle ueberhaupt geschuetzt? - bUnprotected = FALSE; + bUnprotected = false; - USHORT nWrap = 0; + sal_uInt16 nWrap = 0; SCsCOL nCol = rCol; SCsROW nRow = rRow; @@ -1065,7 +1067,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, if ( nMovY && bMarked ) { - BOOL bUp = ( nMovY < 0 ); + sal_Bool bUp = ( nMovY < 0 ); nRow = rMark.GetNextMarked( nCol, nRow, bUp ); while ( VALIDROW(nRow) && (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) ) @@ -1138,9 +1140,9 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, { SCsROW nNextRow = pNextRows[nCol] + 1; if ( bMarked ) - nNextRow = rMark.GetNextMarked( nCol, nNextRow, FALSE ); + nNextRow = rMark.GetNextMarked( nCol, nNextRow, false ); if ( bUnprotected ) - nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, FALSE ); + nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, false ); pNextRows[nCol] = nNextRow; SCsROW nMinRow = MAXROW+1; @@ -1171,9 +1173,9 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, { SCsROW nNextRow = pNextRows[nCol] - 1; if ( bMarked ) - nNextRow = rMark.GetNextMarked( nCol, nNextRow, TRUE ); + nNextRow = rMark.GetNextMarked( nCol, nNextRow, sal_True ); if ( bUnprotected ) - nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, TRUE ); + nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, sal_True ); pNextRows[nCol] = nNextRow; SCsROW nMaxRow = -1; @@ -1212,12 +1214,12 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, } } -BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) +sal_Bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) { const ScMarkArray* pMarkArray = rMark.GetArray(); DBG_ASSERT(pMarkArray,"GetNextMarkedCell ohne MarkArray"); if ( !pMarkArray ) - return FALSE; + return false; ++rRow; // naechste Zelle ist gesucht @@ -1226,10 +1228,10 @@ BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa const ScMarkArray& rArray = pMarkArray[rCol]; while ( rRow <= MAXROW ) { - SCROW nStart = (SCROW) rArray.GetNextMarked( (SCsROW) rRow, FALSE ); + SCROW nStart = (SCROW) rArray.GetNextMarked( (SCsROW) rRow, false ); if ( nStart <= MAXROW ) { - SCROW nEnd = rArray.GetMarkEnd( nStart, FALSE ); + SCROW nEnd = rArray.GetMarkEnd( nStart, false ); ScColumnIterator aColIter( &aCol[rCol], nStart, nEnd ); SCROW nCellRow; ScBaseCell* pCell = NULL; @@ -1238,7 +1240,7 @@ BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE ) { rRow = nCellRow; - return TRUE; // Zelle gefunden + return sal_True; // Zelle gefunden } } rRow = nEnd + 1; // naechsten markierten Bereich suchen @@ -1250,7 +1252,7 @@ BOOL ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa ++rCol; // naechste Spalte testen } - return FALSE; // alle Spalten durch + return false; // alle Spalten durch } void ScTable::UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, @@ -1278,7 +1280,7 @@ void ScTable::UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nR void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScDocument* pUndoDoc, BOOL bIncludeDraw, bool bUpdateNoteCaptionPos ) + ScDocument* pUndoDoc, sal_Bool bIncludeDraw, bool bUpdateNoteCaptionPos ) { bool bUpdated = false; SCCOL i; @@ -1308,7 +1310,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW SCROW nSRow = 0; SCCOL nECol = 0; SCROW nERow = 0; - BOOL bRecalcPages = FALSE; + sal_Bool bRecalcPages = false; for ( ScRangeVec::iterator aIt = aPrintRanges.begin(), aEnd = aPrintRanges.end(); aIt != aEnd; ++aIt ) { @@ -1324,7 +1326,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nSCol,nSRow,nSTab, nECol,nERow,nETab ) ) { *aIt = ScRange( nSCol, nSRow, 0, nECol, nERow, 0 ); - bRecalcPages = TRUE; + bRecalcPages = sal_True; } } @@ -1342,7 +1344,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nSCol,nSRow,nSTab, nECol,nERow,nETab ) ) { *pRepeatColRange = ScRange( nSCol, nSRow, 0, nECol, nERow, 0 ); - bRecalcPages = TRUE; + bRecalcPages = sal_True; nRepeatStartX = nSCol; // fuer UpdatePageBreaks nRepeatEndX = nECol; } @@ -1362,7 +1364,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nSCol,nSRow,nSTab, nECol,nERow,nETab ) ) { *pRepeatRowRange = ScRange( nSCol, nSRow, 0, nECol, nERow, 0 ); - bRecalcPages = TRUE; + bRecalcPages = sal_True; nRepeatStartY = nSRow; // fuer UpdatePageBreaks nRepeatEndY = nERow; } @@ -1373,11 +1375,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW { UpdatePageBreaks(NULL); - SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); - if (pDocSh) - pDocSh->Broadcast( ScPaintHint( - ScRange(0,0,nTab,MAXCOL,MAXROW,nTab), - PAINT_GRID ) ); + pDocument->RepaintRange( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) ); } } @@ -1404,10 +1402,10 @@ void ScTable::UpdateInsertTab(SCTAB nTable) for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -void ScTable::UpdateDeleteTab( SCTAB nTable, BOOL bIsMove, ScTable* pRefUndo ) +void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo ) { if (nTab > nTable) nTab--; @@ -1418,7 +1416,7 @@ void ScTable::UpdateDeleteTab( SCTAB nTable, BOOL bIsMove, ScTable* pRefUndo ) for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, @@ -1432,10 +1430,10 @@ void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, } if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -void ScTable::UpdateCompile( BOOL bForceIfNameInUse ) +void ScTable::UpdateCompile( sal_Bool bForceIfNameInUse ) { for (SCCOL i=0; i <= MAXCOL; i++) { @@ -1449,17 +1447,17 @@ void ScTable::SetTabNo(SCTAB nNewTab) for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].SetTabNo(nNewTab); } -BOOL ScTable::IsRangeNameInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nIndex) const +sal_Bool ScTable::IsRangeNameInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + sal_uInt16 nIndex) const { - BOOL bInUse = FALSE; + sal_Bool bInUse = false; for (SCCOL i = nCol1; !bInUse && (i <= nCol2) && (ValidCol(i)); i++) bInUse = aCol[i].IsRangeNameInUse(nRow1, nRow2, nIndex); return bInUse; } void ScTable::FindRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - std::set<USHORT>& rIndexes) const + std::set<sal_uInt16>& rIndexes) const { for (SCCOL i = nCol1; i <= nCol2 && ValidCol(i); i++) aCol[i].FindRangeNamesInUse(nRow1, nRow2, rIndexes); @@ -1572,14 +1570,14 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d if ( TEXTWIDTH_DIRTY == nPixel ) { ScNeededSizeOptions aOptions; - aOptions.bTotalSize = TRUE; + aOptions.bTotalSize = sal_True; aOptions.bFormula = bFormula; - aOptions.bSkipMerged = FALSE; + aOptions.bSkipMerged = false; Fraction aZoom(1,1); nPixel = aCol[rCol].GetNeededSize( nRow, pDev, nPPTX, nPPTY, aZoom, aZoom, true, aOptions ); - pCell->SetTextWidth( (USHORT)nPixel ); + pCell->SetTextWidth( (sal_uInt16)nPixel ); } long nTwips = (long) (nPixel / nPPTX); @@ -1645,7 +1643,7 @@ void ScTable::SetRepeatColRange( const ScRange* pNew ) SET_PRINTRANGE( pRepeatColRange, pNew ); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::SetRepeatRowRange( const ScRange* pNew ) @@ -1653,7 +1651,7 @@ void ScTable::SetRepeatRowRange( const ScRange* pNew ) SET_PRINTRANGE( pRepeatRowRange, pNew ); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::ClearPrintRanges() @@ -1662,7 +1660,7 @@ void ScTable::ClearPrintRanges() bPrintEntireSheet = false; if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::AddPrintRange( const ScRange& rNew ) @@ -1672,7 +1670,7 @@ void ScTable::AddPrintRange( const ScRange& rNew ) aPrintRanges.push_back( rNew ); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } @@ -1681,11 +1679,11 @@ void ScTable::SetPrintEntireSheet() if( !IsPrintEntireSheet() ) { ClearPrintRanges(); - bPrintEntireSheet = TRUE; + bPrintEntireSheet = sal_True; } } -const ScRange* ScTable::GetPrintRange(USHORT nPos) const +const ScRange* ScTable::GetPrintRange(sal_uInt16 nPos) const { return (nPos < GetPrintRangeCount()) ? &aPrintRanges[ nPos ] : NULL; } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 6ef093f5db40..31a5bca64866 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -64,12 +64,12 @@ // STATIC DATA ----------------------------------------------------------- -BOOL ScTable::SetOutlineTable( const ScOutlineTable* pNewOutline ) +sal_Bool ScTable::SetOutlineTable( const ScOutlineTable* pNewOutline ) { - USHORT nOldSizeX = 0; - USHORT nOldSizeY = 0; - USHORT nNewSizeX = 0; - USHORT nNewSizeY = 0; + sal_uInt16 nOldSizeX = 0; + sal_uInt16 nOldSizeY = 0; + sal_uInt16 nNewSizeX = 0; + sal_uInt16 nNewSizeY = 0; if (pOutlineTable) { @@ -106,22 +106,22 @@ void ScTable::SetSheetEvents( const ScSheetEvents* pNew ) else pSheetEvents = NULL; - SetCalcNotification( FALSE ); // discard notifications before the events were set + SetCalcNotification( false ); // discard notifications before the events were set if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -void ScTable::SetCalcNotification( BOOL bSet ) +void ScTable::SetCalcNotification( sal_Bool bSet ) { bCalcNotification = bSet; } -BOOL ScTable::TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize ) +sal_Bool ScTable::TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize ) { - BOOL bTest = TRUE; + sal_Bool bTest = sal_True; if ( nStartCol==0 && nEndCol==MAXCOL && pOutlineTable ) bTest = pOutlineTable->TestInsertRow(nSize); @@ -142,7 +142,7 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (mpRowHeights && pRowFlags) { mpRowHeights->insertSegment(nStartRow, nSize, false); - BYTE nNewFlags = pRowFlags->Insert( nStartRow, nSize); + sal_uInt8 nNewFlags = pRowFlags->Insert( nStartRow, nSize); // only copy manual size flag, clear all others if (nNewFlags && (nNewFlags != CR_MANUALSIZE)) pRowFlags->SetValue( nStartRow, nStartRow + nSize - 1, @@ -186,7 +186,7 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize, - BOOL* pUndoOutline ) + sal_Bool* pUndoOutline ) { IncRecalcLevel(); InitializeNoteCaptions(); @@ -201,7 +201,7 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (pOutlineTable) if (pOutlineTable->DeleteRow( nStartRow, nSize )) if (pUndoOutline) - *pUndoOutline = TRUE; + *pUndoOutline = sal_True; mpFilteredRows->removeSegment(nStartRow, nStartRow+nSize); mpHiddenRows->removeSegment(nStartRow, nStartRow+nSize); @@ -235,15 +235,15 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE } -BOOL ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) +sal_Bool ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) { - BOOL bTest = TRUE; + sal_Bool bTest = sal_True; if ( nStartRow==0 && nEndRow==MAXROW && pOutlineTable ) bTest = pOutlineTable->TestInsertCol(nSize); if ( nSize > static_cast<SCSIZE>(MAXCOL) ) - bTest = FALSE; + bTest = false; for (SCCOL i=MAXCOL; (i+static_cast<SCCOL>(nSize)>MAXCOL) && bTest; i--) bTest = aCol[i].TestInsertCol(nStartRow, nEndRow); @@ -303,14 +303,14 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE if (nStartCol>0) // copy old attributes { - USHORT nWhichArray[2]; + sal_uInt16 nWhichArray[2]; nWhichArray[0] = ATTR_MERGE; nWhichArray[1] = 0; for (SCSIZE i=0; i<nSize; i++) { aCol[nStartCol-1].CopyToColumn( nStartRow, nEndRow, IDF_ATTRIB, - FALSE, aCol[nStartCol+i] ); + false, aCol[nStartCol+i] ); aCol[nStartCol+i].RemoveFlags( nStartRow, nEndRow, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO ); aCol[nStartCol+i].ClearItems( nStartRow, nEndRow, nWhichArray ); @@ -328,7 +328,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize, - BOOL* pUndoOutline ) + sal_Bool* pUndoOutline ) { IncRecalcLevel(); InitializeNoteCaptions(); @@ -344,7 +344,7 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE if (pOutlineTable) if (pOutlineTable->DeleteCol( nStartCol, nSize )) if (pUndoOutline) - *pUndoOutline = TRUE; + *pUndoOutline = sal_True; SCCOL nRmSize = nStartCol + static_cast<SCCOL>(nSize); mpHiddenCols->removeSegment(nStartCol, nRmSize); @@ -392,7 +392,7 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE } -void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag) +void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nDelFlag) { if (nCol2 > MAXCOL) nCol2 = MAXCOL; if (nRow2 > MAXROW) nRow2 = MAXROW; @@ -411,7 +411,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH if ( IsProtected() && (nDelFlag & IDF_ATTRIB) ) { ScPatternAttr aPattern(pDocument->GetPool()); - aPattern.GetItemSet().Put( ScProtectionAttr( FALSE ) ); + aPattern.GetItemSet().Put( ScProtectionAttr( false ) ); ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern ); } } @@ -423,7 +423,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH } -void ScTable::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) +void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark ) { { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM()); @@ -439,7 +439,7 @@ void ScTable::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) { ScDocumentPool* pPool = pDocument->GetPool(); SfxItemSet aSet( *pPool, ATTR_PATTERN_START, ATTR_PATTERN_END ); - aSet.Put( ScProtectionAttr( FALSE ) ); + aSet.Put( ScProtectionAttr( false ) ); SfxItemPoolCache aCache( pPool, &aSet ); ApplySelectionCache( &aCache, rMark ); } @@ -453,7 +453,7 @@ void ScTable::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ) // pTable = Clipboard void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ScTable* pTable, BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions) + ScTable* pTable, sal_Bool bKeepScenarioFlags, sal_Bool bCloneNoteCaptions) { if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2)) { @@ -503,8 +503,8 @@ void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable, } void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - SCsCOL nDx, SCsROW nDy, USHORT nInsFlag, - BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable) + SCsCOL nDx, SCsROW nDy, sal_uInt16 nInsFlag, + sal_Bool bAsLink, sal_Bool bSkipAttrForEmpty, ScTable* pTable) { SCCOL i; @@ -532,7 +532,7 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( pTable->pRowFlags->GetValue(j-nDy) & CR_MANUALSIZE ) pRowFlags->OrValue( j, CR_MANUALSIZE); else - pRowFlags->AndValue( j, sal::static_int_cast<BYTE>(~CR_MANUALSIZE)); + pRowFlags->AndValue( j, sal::static_int_cast<sal_uInt8>(~CR_MANUALSIZE)); } } @@ -543,7 +543,7 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( IsProtected() && (nInsFlag & IDF_ATTRIB) ) { ScPatternAttr aPattern(pDocument->GetPool()); - aPattern.GetItemSet().Put( ScProtectionAttr( FALSE ) ); + aPattern.GetItemSet().Put( ScProtectionAttr( false ) ); ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern ); } } @@ -553,7 +553,7 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, void ScTable::MixData( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nFunction, BOOL bSkipEmpty, ScTable* pSrcTab ) + sal_uInt16 nFunction, sal_Bool bSkipEmpty, ScTable* pSrcTab ) { for (SCCOL i=nCol1; i<=nCol2; i++) aCol[i].MixData( nRow1, nRow2, nFunction, bSkipEmpty, pSrcTab->aCol[i] ); @@ -561,8 +561,8 @@ void ScTable::MixData( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Markierung von diesem Dokument -void ScTable::MixMarked( const ScMarkData& rMark, USHORT nFunction, - BOOL bSkipEmpty, ScTable* pSrcTab ) +void ScTable::MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction, + sal_Bool bSkipEmpty, ScTable* pSrcTab ) { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].MixMarked( rMark, nFunction, bSkipEmpty, pSrcTab->aCol[i] ); @@ -570,9 +570,9 @@ void ScTable::MixMarked( const ScMarkData& rMark, USHORT nFunction, void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ScTable* pTransClip, USHORT nFlags, BOOL bAsLink ) + ScTable* pTransClip, sal_uInt16 nFlags, sal_Bool bAsLink ) { - BOOL bWasCut = pDocument->IsCutMode(); + sal_Bool bWasCut = pDocument->IsCutMode(); ScDocument* pDestDoc = pTransClip->pDocument; @@ -595,7 +595,7 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, aRef.nRow = nRow; aRef.nTab = nTab; aRef.InitFlags(); // -> all absolute - aRef.SetFlag3D(TRUE); + aRef.SetFlag3D(sal_True); aRef.CalcRelFromAbs( aDestPos ); ScTokenArray aArr; aArr.AddSingleReference( aRef ); @@ -648,13 +648,13 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( !IsDefaultItem( pPattern ) ) { const SfxItemSet& rSet = pPattern->GetItemSet(); - if ( rSet.GetItemState( ATTR_MERGE, FALSE ) == SFX_ITEM_DEFAULT && - rSet.GetItemState( ATTR_MERGE_FLAG, FALSE ) == SFX_ITEM_DEFAULT && - rSet.GetItemState( ATTR_BORDER, FALSE ) == SFX_ITEM_DEFAULT ) + if ( rSet.GetItemState( ATTR_MERGE, false ) == SFX_ITEM_DEFAULT && + rSet.GetItemState( ATTR_MERGE_FLAG, false ) == SFX_ITEM_DEFAULT && + rSet.GetItemState( ATTR_BORDER, false ) == SFX_ITEM_DEFAULT ) { // no borders or merge items involved - use pattern as-is for (nRow = nAttrRow1; nRow<=nAttrRow2; nRow++) - pTransClip->SetPattern( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), *pPattern, TRUE ); + pTransClip->SetPattern( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), *pPattern, sal_True ); } else { @@ -688,7 +688,7 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMergeFlagAttr& rOldFlag = (const ScMergeFlagAttr&)rSet.Get(ATTR_MERGE_FLAG); if (rOldFlag.IsOverlapped()) { - INT16 nNewFlags = rOldFlag.GetValue() & ~( SC_MF_HOR | SC_MF_VER ); + sal_Int16 nNewFlags = rOldFlag.GetValue() & ~( SC_MF_HOR | SC_MF_VER ); if ( nNewFlags ) rNewSet.Put( ScMergeFlagAttr( nNewFlags ) ); else @@ -697,7 +697,7 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, for (nRow = nAttrRow1; nRow<=nAttrRow2; nRow++) pTransClip->SetPattern( static_cast<SCCOL>(nRow-nRow1), - static_cast<SCROW>(nCol-nCol1), aNewPattern, TRUE); + static_cast<SCROW>(nCol-nCol1), aNewPattern, sal_True); } } } @@ -744,9 +744,9 @@ void ScTable::StartListeningInArea( SCCOL nCol1, SCROW nRow1, void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nFlags, BOOL bMarked, ScTable* pDestTab, + sal_uInt16 nFlags, sal_Bool bMarked, ScTable* pDestTab, const ScMarkData* pMarkData, - BOOL bAsLink, BOOL bColRowFlags) + sal_Bool bAsLink, sal_Bool bColRowFlags) { if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2)) return; @@ -764,8 +764,8 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bFlagChange = false; - BOOL bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth); - BOOL bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights); + sal_Bool bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth); + sal_Bool bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights); if (bWidth || bHeight) { @@ -846,13 +846,13 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, void ScTable::UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nFlags, BOOL bMarked, ScTable* pDestTab, + sal_uInt16 nFlags, sal_Bool bMarked, ScTable* pDestTab, const ScMarkData* pMarkData) { if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2)) { - BOOL bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth); - BOOL bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights); + sal_Bool bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth); + sal_Bool bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights); if (bWidth||bHeight) IncRecalcLevel(); @@ -863,7 +863,7 @@ void ScTable::UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, aCol[i].UndoToColumn(nRow1, nRow2, nFlags, bMarked, pDestTab->aCol[i], pMarkData); else - aCol[i].CopyToColumn(0, MAXROW, IDF_FORMULA, FALSE, pDestTab->aCol[i]); + aCol[i].CopyToColumn(0, MAXROW, IDF_FORMULA, false, pDestTab->aCol[i]); } if (bWidth||bHeight) @@ -893,7 +893,7 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const void ScTable::InvalidateTableArea() { - bTableAreaValid = FALSE; + bTableAreaValid = false; } void ScTable::InvalidatePageBreaks() @@ -917,7 +917,7 @@ void ScTable::CopyScenarioFrom( const ScTable* pSrcTab ) aCol[i].CopyScenarioFrom( pSrcTab->aCol[i] ); } -void ScTable::MarkScenarioIn( ScMarkData& rDestMark, USHORT nNeededBits ) const +void ScTable::MarkScenarioIn( ScMarkData& rDestMark, sal_uInt16 nNeededBits ) const { DBG_ASSERT( bScenario, "bScenario == FALSE" ); @@ -928,7 +928,7 @@ void ScTable::MarkScenarioIn( ScMarkData& rDestMark, USHORT nNeededBits ) const aCol[i].MarkScenarioIn( rDestMark ); } -BOOL ScTable::HasScenarioRange( const ScRange& rRange ) const +sal_Bool ScTable::HasScenarioRange( const ScRange& rRange ) const { DBG_ASSERT( bScenario, "bScenario == FALSE" ); @@ -944,11 +944,11 @@ BOOL ScTable::HasScenarioRange( const ScRange& rRange ) const { const ScRange* pR = (*pList)[j]; if ( pR->Intersects( aTabRange ) ) - return TRUE; + return sal_True; } } - return FALSE; + return false; } void ScTable::InvalidateScenarioRanges() @@ -966,19 +966,19 @@ const ScRangeList* ScTable::GetScenarioRanges() const ((ScTable*)this)->pScenarioRanges = new ScRangeList; ScMarkData aMark; MarkScenarioIn( aMark, 0 ); // immer - aMark.FillRangeListWithMarks( pScenarioRanges, FALSE ); + aMark.FillRangeListWithMarks( pScenarioRanges, false ); } return pScenarioRanges; } -BOOL ScTable::TestCopyScenarioTo( const ScTable* pDestTab ) const +sal_Bool ScTable::TestCopyScenarioTo( const ScTable* pDestTab ) const { DBG_ASSERT( bScenario, "bScenario == FALSE" ); if (!pDestTab->IsProtected()) - return TRUE; + return sal_True; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; for (SCCOL i=0; i<=MAXCOL && bOk; i++) bOk = aCol[i].TestCopyScenarioTo( pDestTab->aCol[i] ); return bOk; @@ -996,7 +996,7 @@ void ScTable::PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell ) } -void ScTable::PutCell( SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell ) +void ScTable::PutCell( SCCOL nCol, SCROW nRow, sal_uLong nFormatIndex, ScBaseCell* pCell ) { if (ValidColRow(nCol,nRow)) { @@ -1017,14 +1017,14 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell ) } -BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, +sal_Bool ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, ScSetStringParam* pParam ) { if (ValidColRow(nCol,nRow)) return aCol[nCol].SetString( nRow, nTabP, rString, pDocument->GetAddressConvention(), pParam ); else - return FALSE; + return false; } @@ -1161,42 +1161,42 @@ void ScTable::GetLastDataPos(SCCOL& rCol, SCROW& rRow) const } -BOOL ScTable::HasData( SCCOL nCol, SCROW nRow ) +sal_Bool ScTable::HasData( SCCOL nCol, SCROW nRow ) { if (ValidColRow(nCol,nRow)) return aCol[nCol].HasDataAt( nRow ); else - return FALSE; + return false; } -BOOL ScTable::HasStringData( SCCOL nCol, SCROW nRow ) +sal_Bool ScTable::HasStringData( SCCOL nCol, SCROW nRow ) { if (ValidColRow(nCol,nRow)) return aCol[nCol].HasStringData( nRow ); else - return FALSE; + return false; } -BOOL ScTable::HasValueData( SCCOL nCol, SCROW nRow ) +sal_Bool ScTable::HasValueData( SCCOL nCol, SCROW nRow ) { if (ValidColRow(nCol,nRow)) return aCol[nCol].HasValueData( nRow ); else - return FALSE; + return false; } -BOOL ScTable::HasStringCells( SCCOL nStartCol, SCROW nStartRow, +sal_Bool ScTable::HasStringCells( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const { if ( ValidCol(nEndCol) ) for ( SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++ ) if (aCol[nCol].HasStringCells(nStartRow, nEndRow)) - return TRUE; + return sal_True; - return FALSE; + return false; } @@ -1209,8 +1209,8 @@ void ScTable::SetDirtyVar() void ScTable::SetDirty() { - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetDirty(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1219,8 +1219,8 @@ void ScTable::SetDirty() void ScTable::SetDirty( const ScRange& rRange ) { - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden SCCOL nCol2 = rRange.aEnd.Col(); for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++) aCol[i].SetDirty( rRange ); @@ -1230,8 +1230,8 @@ void ScTable::SetDirty( const ScRange& rRange ) void ScTable::SetTableOpDirty( const ScRange& rRange ) { - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // no multiple recalculation + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // no multiple recalculation SCCOL nCol2 = rRange.aEnd.Col(); for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++) aCol[i].SetTableOpDirty( rRange ); @@ -1241,8 +1241,8 @@ void ScTable::SetTableOpDirty( const ScRange& rRange ) void ScTable::SetDirtyAfterLoad() { - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetDirtyAfterLoad(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1251,8 +1251,8 @@ void ScTable::SetDirtyAfterLoad() void ScTable::SetRelNameDirty() { - BOOL bOldAutoCalc = pDocument->GetAutoCalc(); - pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden + sal_Bool bOldAutoCalc = pDocument->GetAutoCalc(); + pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].SetRelNameDirty(); pDocument->SetAutoCalc( bOldAutoCalc ); @@ -1304,7 +1304,7 @@ void ScTable::ResetChanged( const ScRange& rRange ) // Attribute -const SfxPoolItem* ScTable::GetAttr( SCCOL nCol, SCROW nRow, USHORT nWhich ) const +const SfxPoolItem* ScTable::GetAttr( SCCOL nCol, SCROW nRow, sal_uInt16 nWhich ) const { if (ValidColRow(nCol,nRow)) return aCol[nCol].GetAttr( nRow, nWhich ); @@ -1313,7 +1313,7 @@ const SfxPoolItem* ScTable::GetAttr( SCCOL nCol, SCROW nRow, USHORT nWhich ) con } -ULONG ScTable::GetNumberFormat( SCCOL nCol, SCROW nRow ) const +sal_uLong ScTable::GetNumberFormat( SCCOL nCol, SCROW nRow ) const { if (ValidColRow(nCol,nRow)) return aCol[nCol].GetNumberFormat( nRow ); @@ -1351,7 +1351,7 @@ const ScPatternAttr* ScTable::GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, S } -bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nMask ) const +bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nMask ) const { bool bFound = false; for (SCCOL i=nCol1; i<=nCol2 && !bFound; i++) @@ -1360,7 +1360,7 @@ bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH } -bool ScTable::HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const +bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const { bool bFound = false; for (SCCOL i=0; i<=MAXCOL && !bFound; i++) @@ -1371,7 +1371,7 @@ bool ScTable::HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - BOOL bRefresh, BOOL bAttrs ) + sal_Bool bRefresh, sal_Bool bAttrs ) { if (!(ValidCol(nStartCol) && ValidCol(rEndCol))) { @@ -1387,14 +1387,14 @@ bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, } -BOOL ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes ) const +sal_Bool ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes ) const { if (!(ValidCol(nCol1) && ValidCol(nCol2))) { DBG_ERRORFILE("ScTable::IsBlockEmpty: invalid column number"); - return FALSE; + return false; } - BOOL bEmpty = TRUE; + sal_Bool bEmpty = sal_True; for (SCCOL i=nCol1; i<=nCol2 && bEmpty; i++) bEmpty = aCol[i].IsEmptyBlock( nRow1, nRow2, bIgnoreNotes ); return bEmpty; @@ -1406,10 +1406,10 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO { // Rueckgabe = neues nArrY - BYTE nRotDir = pPattern->GetRotateDir( pCondSet ); + sal_uInt8 nRotDir = pPattern->GetRotateDir( pCondSet ); if ( nRotDir != SC_ROTDIR_NONE ) { - BOOL bHit = TRUE; + sal_Bool bHit = sal_True; if ( nCol+1 < nX1 ) // column to the left bHit = ( nRotDir != SC_ROTDIR_LEFT ); else if ( nCol > nX2+1 ) // column to the right @@ -1437,7 +1437,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO { if (!RowHidden(nRow)) { - BOOL bHitOne = TRUE; + sal_Bool bHitOne = sal_True; if ( nCol > nX2+1 ) { // reicht die gedrehte Zelle bis in den sichtbaren Bereich? @@ -1451,7 +1451,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO nWidth += GetColWidth( nTouchedCol ); } if ( nTouchedCol > nX2 ) - bHitOne = FALSE; + bHitOne = false; } if (bHitOne) @@ -1494,13 +1494,13 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC while ( pPattern ) { const SfxPoolItem* pCondItem; - if ( pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, TRUE, &pCondItem ) + if ( pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, sal_True, &pCondItem ) == SFX_ITEM_SET ) { // alle Formate durchgehen, damit die Zellen nicht einzeln // angeschaut werden muessen - ULONG nIndex = ((const SfxUInt32Item*)pCondItem)->GetValue(); + sal_uLong nIndex = ((const SfxUInt32Item*)pCondItem)->GetValue(); ScConditionalFormatList* pList = pDocument->GetCondFormList(); ScStyleSheetPool* pStylePool = pDocument->GetStyleSheetPool(); if (pList && pStylePool && nIndex) @@ -1508,8 +1508,8 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC const ScConditionalFormat* pFormat = pList->GetFormat(nIndex); if ( pFormat ) { - USHORT nEntryCount = pFormat->Count(); - for (USHORT nEntry=0; nEntry<nEntryCount; nEntry++) + sal_uInt16 nEntryCount = pFormat->Count(); + for (sal_uInt16 nEntry=0; nEntry<nEntryCount; nEntry++) { String aStyleName = pFormat->GetEntry(nEntry)->GetStyle(); if (aStyleName.Len()) @@ -1539,62 +1539,62 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC } } -BOOL ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const +sal_Bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const { // nix:0, mitte:1, unten:2, links:4, oben:8, rechts:16, offen:32 - USHORT nEdges; + sal_uInt16 nEdges; if ( nCol1 == nCol2 ) { // linke und rechte Spalte - const USHORT n = 4 | 16; + const sal_uInt16 n = 4 | 16; nEdges = aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, n ); // nicht (4 und 16) oder 1 oder 32 if ( nEdges && (((nEdges & n) != n) || (nEdges & 33)) ) - return TRUE; // linke oder rechte Kante fehlt oder offen + return sal_True; // linke oder rechte Kante fehlt oder offen } else { // linke Spalte nEdges = aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, 4 ); // nicht 4 oder 1 oder 32 if ( nEdges && (((nEdges & 4) != 4) || (nEdges & 33)) ) - return TRUE; // linke Kante fehlt oder offen + return sal_True; // linke Kante fehlt oder offen // rechte Spalte nEdges = aCol[nCol2].GetBlockMatrixEdges( nRow1, nRow2, 16 ); // nicht 16 oder 1 oder 32 if ( nEdges && (((nEdges & 16) != 16) || (nEdges & 33)) ) - return TRUE; // rechte Kante fehlt oder offen + return sal_True; // rechte Kante fehlt oder offen } if ( nRow1 == nRow2 ) { // obere und untere Zeile - BOOL bOpen = FALSE; - const USHORT n = 2 | 8; + sal_Bool bOpen = false; + const sal_uInt16 n = 2 | 8; for ( SCCOL i=nCol1; i<=nCol2; i++) { nEdges = aCol[i].GetBlockMatrixEdges( nRow1, nRow1, n ); if ( nEdges ) { if ( (nEdges & n) != n ) - return TRUE; // obere oder untere Kante fehlt + return sal_True; // obere oder untere Kante fehlt if ( nEdges & 4 ) - bOpen = TRUE; // linke Kante oeffnet, weitersehen + bOpen = sal_True; // linke Kante oeffnet, weitersehen else if ( !bOpen ) - return TRUE; // es gibt was, was nicht geoeffnet wurde + return sal_True; // es gibt was, was nicht geoeffnet wurde if ( nEdges & 16 ) - bOpen = FALSE; // rechte Kante schliesst + bOpen = false; // rechte Kante schliesst } } if ( bOpen ) - return TRUE; // es geht noch weiter + return sal_True; // es geht noch weiter } else { - USHORT j, n; + sal_uInt16 j, n; SCROW nR; // erst obere Zeile, dann untere Zeile for ( j=0, nR=nRow1, n=8; j<2; j++, nR=nRow2, n=2 ) { - BOOL bOpen = FALSE; + sal_Bool bOpen = false; for ( SCCOL i=nCol1; i<=nCol2; i++) { nEdges = aCol[i].GetBlockMatrixEdges( nR, nR, n ); @@ -1603,20 +1603,20 @@ BOOL ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR // in oberere Zeile keine obere Kante bzw. // in unterer Zeile keine untere Kante if ( (nEdges & n) != n ) - return TRUE; + return sal_True; if ( nEdges & 4 ) - bOpen = TRUE; // linke Kante oeffnet, weitersehen + bOpen = sal_True; // linke Kante oeffnet, weitersehen else if ( !bOpen ) - return TRUE; // es gibt was, was nicht geoeffnet wurde + return sal_True; // es gibt was, was nicht geoeffnet wurde if ( nEdges & 16 ) - bOpen = FALSE; // rechte Kante schliesst + bOpen = false; // rechte Kante schliesst } } if ( bOpen ) - return TRUE; // es geht noch weiter + return sal_True; // es geht noch weiter } } - return FALSE; + return false; } @@ -1629,35 +1629,35 @@ bool ScTable::HasSelectionMatrixFragment( const ScMarkData& rMark ) const } -BOOL ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, - SCROW nRow2, BOOL* pOnlyNotBecauseOfMatrix /* = NULL */ ) const +sal_Bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, + SCROW nRow2, sal_Bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const { if ( !ValidColRow( nCol2, nRow2 ) ) { DBG_ERRORFILE("IsBlockEditable: invalid column or row"); if (pOnlyNotBecauseOfMatrix) - *pOnlyNotBecauseOfMatrix = FALSE; - return FALSE; + *pOnlyNotBecauseOfMatrix = false; + return false; } - BOOL bIsEditable = TRUE; + sal_Bool bIsEditable = sal_True; if ( nLockCount ) - bIsEditable = FALSE; + bIsEditable = false; else if ( IsProtected() && !pDocument->IsScenario(nTab) ) { - if((bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HASATTR_PROTECTED )) != FALSE) + if((bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HASATTR_PROTECTED )) != false) { // If Sheet is protected and cells are not protected then // check the active scenario protect flag if this range is // on the active scenario range. Note the 'copy back' must also // be set to apply protection. - USHORT nScenTab = nTab+1; + sal_uInt16 nScenTab = nTab+1; while(pDocument->IsScenario(nScenTab)) { ScRange aEditRange(nCol1, nRow1, nScenTab, nCol2, nRow2, nScenTab); if(pDocument->IsActiveScenario(nScenTab) && pDocument->HasScenarioRange(nScenTab, aEditRange)) { - USHORT nFlags; + sal_uInt16 nFlags; pDocument->GetScenarioFlags(nScenTab,nFlags); bIsEditable = !((nFlags & SC_SCENARIO_PROTECT) && (nFlags & SC_SCENARIO_TWOWAY)); break; @@ -1681,7 +1681,7 @@ BOOL ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, ScRange aEditRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab); if(pDocument->HasScenarioRange(nTab, aEditRange)) { - USHORT nFlags; + sal_uInt16 nFlags; pDocument->GetScenarioFlags(nTab,nFlags); bIsEditable = !(nFlags & SC_SCENARIO_PROTECT); } @@ -1691,34 +1691,34 @@ BOOL ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, { if ( HasBlockMatrixFragment( nCol1, nRow1, nCol2, nRow2 ) ) { - bIsEditable = FALSE; + bIsEditable = false; if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = TRUE; + *pOnlyNotBecauseOfMatrix = sal_True; } else if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; + *pOnlyNotBecauseOfMatrix = false; } else if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; + *pOnlyNotBecauseOfMatrix = false; return bIsEditable; } -BOOL ScTable::IsSelectionEditable( const ScMarkData& rMark, - BOOL* pOnlyNotBecauseOfMatrix /* = NULL */ ) const +sal_Bool ScTable::IsSelectionEditable( const ScMarkData& rMark, + sal_Bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const { - BOOL bIsEditable = TRUE; + sal_Bool bIsEditable = sal_True; if ( nLockCount ) - bIsEditable = FALSE; + bIsEditable = false; else if ( IsProtected() && !pDocument->IsScenario(nTab) ) { - if((bIsEditable = !HasAttribSelection( rMark, HASATTR_PROTECTED )) != FALSE) + if((bIsEditable = !HasAttribSelection( rMark, HASATTR_PROTECTED )) != false) { // If Sheet is protected and cells are not protected then // check the active scenario protect flag if this area is // in the active scenario range. ScRangeList aRanges; - rMark.FillRangeListWithMarks( &aRanges, FALSE ); + rMark.FillRangeListWithMarks( &aRanges, false ); SCTAB nScenTab = nTab+1; while(pDocument->IsScenario(nScenTab) && bIsEditable) { @@ -1729,7 +1729,7 @@ BOOL ScTable::IsSelectionEditable( const ScMarkData& rMark, ScRange aRange = *aRanges[ i ]; if(pDocument->HasScenarioRange(nScenTab, aRange)) { - USHORT nFlags; + sal_uInt16 nFlags; pDocument->GetScenarioFlags(nScenTab,nFlags); bIsEditable = !((nFlags & SC_SCENARIO_PROTECT) && (nFlags & SC_SCENARIO_TWOWAY)); } @@ -1752,13 +1752,13 @@ BOOL ScTable::IsSelectionEditable( const ScMarkData& rMark, if(pDocument->IsTabProtected(nActualTab)) { ScRangeList aRanges; - rMark.FillRangeListWithMarks( &aRanges, FALSE ); + rMark.FillRangeListWithMarks( &aRanges, false ); for (size_t i = 0, nRange = aRanges.size(); (i < nRange) && bIsEditable; i++) { ScRange aRange = *aRanges[ i ]; if(pDocument->HasScenarioRange(nTab, aRange)) { - USHORT nFlags; + sal_uInt16 nFlags; pDocument->GetScenarioFlags(nTab,nFlags); bIsEditable = !(nFlags & SC_SCENARIO_PROTECT); } @@ -1769,15 +1769,15 @@ BOOL ScTable::IsSelectionEditable( const ScMarkData& rMark, { if ( HasSelectionMatrixFragment( rMark ) ) { - bIsEditable = FALSE; + bIsEditable = false; if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = TRUE; + *pOnlyNotBecauseOfMatrix = sal_True; } else if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; + *pOnlyNotBecauseOfMatrix = false; } else if ( pOnlyNotBecauseOfMatrix ) - *pOnlyNotBecauseOfMatrix = FALSE; + *pOnlyNotBecauseOfMatrix = false; return bIsEditable; } @@ -1800,7 +1800,7 @@ void ScTable::UnlockTable() } -void ScTable::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, BOOL bDeep ) const +void ScTable::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, sal_Bool bDeep ) const { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].MergeSelectionPattern( rState, rMark, bDeep ); @@ -1808,7 +1808,7 @@ void ScTable::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkDa void ScTable::MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1, - SCCOL nCol2, SCROW nRow2, BOOL bDeep ) const + SCCOL nCol2, SCROW nRow2, sal_Bool bDeep ) const { for (SCCOL i=nCol1; i<=nCol2; i++) aCol[i].MergePatternArea( rState, nRow1, nRow2, bDeep ); @@ -1909,7 +1909,7 @@ void ScTable::ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& void ScTable::ApplySelectionLineStyle( const ScMarkData& rMark, - const SvxBorderLine* pLine, BOOL bColorOnly ) + const SvxBorderLine* pLine, sal_Bool bColorOnly ) { if ( bColorOnly && !pLine ) return; @@ -1928,11 +1928,11 @@ const ScStyleSheet* ScTable::GetStyle( SCCOL nCol, SCROW nRow ) const } -const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const +const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, sal_Bool& rFound ) const { - rFound = FALSE; + rFound = false; - BOOL bEqual = TRUE; + sal_Bool bEqual = true; bool bColFound; const ScStyleSheet* pStyle = NULL; @@ -1944,9 +1944,9 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& r pNewStyle = aCol[i].GetSelectionStyle( rMark, bColFound ); if (bColFound) { - rFound = TRUE; + rFound = sal_True; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = false; // unterschiedliche pStyle = pNewStyle; } } @@ -1955,12 +1955,12 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, BOOL& r } -const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow1, +const ScStyleSheet* ScTable::GetAreaStyle( sal_Bool& rFound, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const { - rFound = FALSE; + rFound = false; - BOOL bEqual = TRUE; + sal_Bool bEqual = true; bool bColFound; const ScStyleSheet* pStyle = NULL; @@ -1971,9 +1971,9 @@ const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow pNewStyle = aCol[i].GetAreaStyle(bColFound, nRow1, nRow2); if (bColFound) { - rFound = TRUE; + rFound = sal_True; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) - bEqual = FALSE; // unterschiedliche + bEqual = false; // unterschiedliche pStyle = pNewStyle; } } @@ -1982,17 +1982,17 @@ const ScStyleSheet* ScTable::GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow } -BOOL ScTable::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const +sal_Bool ScTable::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const { - BOOL bIsUsed = FALSE; + sal_Bool bIsUsed = false; for ( SCCOL i=0; i<=MAXCOL; i++ ) { if ( aCol[i].IsStyleSheetUsed( rStyle, bGatherAllStyles ) ) { if ( !bGatherAllStyles ) - return TRUE; - bIsUsed = TRUE; + return sal_True; + bIsUsed = sal_True; } } @@ -2000,7 +2000,7 @@ BOOL ScTable::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyle } -void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRemoved, +void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, sal_Bool bRemoved, OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY ) @@ -2019,7 +2019,7 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRem SCROW nEndRow = aData.mnRow2; if (aData.mbValue) - SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE); + SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, false); nRow = nEndRow + 1; } @@ -2048,7 +2048,7 @@ bool ScTable::RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO } -void ScTable::SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, BOOL bPutToPool ) +void ScTable::SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, sal_Bool bPutToPool ) { if (ValidColRow(nCol,nRow)) aCol[nCol].SetPattern( nRow, rAttr, bPutToPool ); @@ -2070,14 +2070,14 @@ void ScTable::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& r } -void ScTable::ChangeSelectionIndent( BOOL bIncrement, const ScMarkData& rMark ) +void ScTable::ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark ) { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].ChangeSelectionIndent( bIncrement, rMark ); } -void ScTable::ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark ) +void ScTable::ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark ) { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].ClearSelectionItems( pWhich, rMark ); @@ -2086,7 +2086,7 @@ void ScTable::ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark // Spaltenbreiten / Zeilenhoehen -void ScTable::SetColWidth( SCCOL nCol, USHORT nNewWidth ) +void ScTable::SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth ) { if (VALIDCOL(nCol) && pColWidth) { @@ -2111,7 +2111,7 @@ void ScTable::SetColWidth( SCCOL nCol, USHORT nNewWidth ) } } -void ScTable::SetColWidthOnly( SCCOL nCol, USHORT nNewWidth ) +void ScTable::SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth ) { if (!VALIDCOL(nCol) || !pColWidth) return; @@ -2123,7 +2123,7 @@ void ScTable::SetColWidthOnly( SCCOL nCol, USHORT nNewWidth ) pColWidth[nCol] = nNewWidth; } -void ScTable::SetRowHeight( SCROW nRow, USHORT nNewHeight ) +void ScTable::SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight ) { if (VALIDROW(nRow) && mpRowHeights) { @@ -2180,10 +2180,10 @@ bool lcl_pixelSizeChanged( } -BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight, +sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight, double /* nPPTX */, double nPPTY ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = false; if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights) { if (!nNewHeight) @@ -2192,18 +2192,18 @@ BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeig nNewHeight = ScGlobal::nStdRowHeight; } - BOOL bSingle = FALSE; // TRUE = process every row for its own + sal_Bool bSingle = false; // sal_True = process every row for its own ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if (pDrawLayer) if (pDrawLayer->HasObjectsInRows( nTab, nStartRow, nEndRow )) - bSingle = TRUE; + bSingle = sal_True; if (bSingle) { ScFlatUInt16RowSegments::RangeData aData; mpRowHeights->getRangeData(nStartRow, aData); if (nNewHeight == aData.mnValue && nEndRow <= aData.mnRow2) - bSingle = FALSE; // no difference in this range + bSingle = false; // no difference in this range } if (bSingle) { @@ -2218,9 +2218,9 @@ BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeig { SCROW nMid = (nStartRow+nEndRow) / 2; if (SetRowHeightRange( nStartRow, nMid, nNewHeight, 1.0, 1.0 )) - bChanged = TRUE; + bChanged = sal_True; if (SetRowHeightRange( nMid+1, nEndRow, nNewHeight, 1.0, 1.0 )) - bChanged = TRUE; + bChanged = sal_True; } } else @@ -2243,7 +2243,7 @@ BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeig return bChanged; } -void ScTable::SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight ) +void ScTable::SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight ) { if (!ValidRow(nStartRow) || !ValidRow(nEndRow) || !mpRowHeights) return; @@ -2254,14 +2254,14 @@ void ScTable::SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeigh mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight); } -void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual ) +void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bManual ) { if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && pRowFlags) { if (bManual) pRowFlags->OrValue( nStartRow, nEndRow, CR_MANUALSIZE); else - pRowFlags->AndValue( nStartRow, nEndRow, sal::static_int_cast<BYTE>(~CR_MANUALSIZE)); + pRowFlags->AndValue( nStartRow, nEndRow, sal::static_int_cast<sal_uInt8>(~CR_MANUALSIZE)); } else { @@ -2270,7 +2270,7 @@ void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual ) } -USHORT ScTable::GetColWidth( SCCOL nCol ) const +sal_uInt16 ScTable::GetColWidth( SCCOL nCol ) const { DBG_ASSERT(VALIDCOL(nCol),"Falsche Spaltennummer"); @@ -2282,22 +2282,22 @@ USHORT ScTable::GetColWidth( SCCOL nCol ) const return pColWidth[nCol]; } else - return (USHORT) STD_COL_WIDTH; + return (sal_uInt16) STD_COL_WIDTH; } -USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte +sal_uInt16 ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte { DBG_ASSERT(VALIDCOL(nCol),"Falsche Spaltennummer"); if (VALIDCOL(nCol) && pColWidth) return pColWidth[nCol]; else - return (USHORT) STD_COL_WIDTH; + return (sal_uInt16) STD_COL_WIDTH; } -USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) +sal_uInt16 ScTable::GetCommonWidth( SCCOL nEndCol ) { // get the width that is used in the largest continuous column range (up to nEndCol) @@ -2307,8 +2307,8 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) nEndCol = MAXCOL; } - USHORT nMaxWidth = 0; - USHORT nMaxCount = 0; + sal_uInt16 nMaxWidth = 0; + sal_uInt16 nMaxCount = 0; SCCOL nRangeStart = 0; while ( nRangeStart <= nEndCol ) { @@ -2317,8 +2317,8 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) ++nRangeStart; if ( nRangeStart <= nEndCol ) { - USHORT nThisCount = 0; - USHORT nThisWidth = pColWidth[nRangeStart]; + sal_uInt16 nThisCount = 0; + sal_uInt16 nThisWidth = pColWidth[nRangeStart]; SCCOL nRangeEnd = nRangeStart; while ( nRangeEnd <= nEndCol && pColWidth[nRangeEnd] == nThisWidth ) { @@ -2344,7 +2344,7 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) } -USHORT ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero ) const +sal_uInt16 ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero ) const { DBG_ASSERT(VALIDROW(nRow),"Invalid row number"); @@ -2382,18 +2382,18 @@ USHORT ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, bool *pStartRow = nRow; if (pEndRow) *pEndRow = nRow; - return (USHORT) ScGlobal::nStdRowHeight; + return (sal_uInt16) ScGlobal::nStdRowHeight; } } -ULONG ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const +sal_uLong ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const { DBG_ASSERT(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights) { - ULONG nHeight = 0; + sal_uLong nHeight = 0; SCROW nRow = nStartRow; while (nRow <= nEndRow) { @@ -2409,17 +2409,17 @@ ULONG ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const return nHeight; } else - return (ULONG) ((nEndRow - nStartRow + 1) * ScGlobal::nStdRowHeight); + return (sal_uLong) ((nEndRow - nStartRow + 1) * ScGlobal::nStdRowHeight); } -ULONG ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const +sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const { DBG_ASSERT(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights) { - ULONG nHeight = 0; + sal_uLong nHeight = 0; SCROW nRow = nStartRow; while (nRow <= nEndRow) { @@ -2429,25 +2429,25 @@ ULONG ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale if (nLastRow > nEndRow) nLastRow = nEndRow; sal_uInt32 nThisHeight = mpRowHeights->getSumValue(nRow, nLastRow); - nHeight += static_cast<ULONG>(nThisHeight * fScale); + nHeight += static_cast<sal_uLong>(nThisHeight * fScale); } nRow = nLastRow + 1; } return nHeight; } else - return (ULONG) ((nEndRow - nStartRow + 1) * ScGlobal::nStdRowHeight * fScale); + return (sal_uLong) ((nEndRow - nStartRow + 1) * ScGlobal::nStdRowHeight * fScale); } -USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden +sal_uInt16 ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden { DBG_ASSERT(VALIDROW(nRow),"wrong row number"); if (VALIDROW(nRow) && mpRowHeights) return mpRowHeights->getValue(nRow); else - return (USHORT) ScGlobal::nStdRowHeight; + return (sal_uInt16) ScGlobal::nStdRowHeight; } @@ -2555,7 +2555,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow) if (nEndRow > nRow2) nEndRow = nRow2; - BOOL bChanged = ( bWasVis != bShow ); + sal_Bool bChanged = ( bWasVis != bShow ); SetRowHidden(nStartRow, nEndRow, !bShow); SetRowFiltered(nStartRow, nEndRow, !bShow); @@ -2595,7 +2595,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow) if (nEndRow > nRow2) nEndRow = nRow2; - BOOL bChanged = ( bWasVis != bShow ); + sal_Bool bChanged = ( bWasVis != bShow ); SetRowHidden(nStartRow, nEndRow, !bShow); if (bShow) @@ -2625,7 +2625,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow) } -void ScTable::SetColFlags( SCCOL nCol, BYTE nNewFlags ) +void ScTable::SetColFlags( SCCOL nCol, sal_uInt8 nNewFlags ) { if (VALIDCOL(nCol) && pColFlags) pColFlags[nCol] = nNewFlags; @@ -2636,7 +2636,7 @@ void ScTable::SetColFlags( SCCOL nCol, BYTE nNewFlags ) } -void ScTable::SetRowFlags( SCROW nRow, BYTE nNewFlags ) +void ScTable::SetRowFlags( SCROW nRow, sal_uInt8 nNewFlags ) { if (VALIDROW(nRow) && pRowFlags) pRowFlags->SetValue( nRow, nNewFlags); @@ -2647,7 +2647,7 @@ void ScTable::SetRowFlags( SCROW nRow, BYTE nNewFlags ) } -void ScTable::SetRowFlags( SCROW nStartRow, SCROW nEndRow, BYTE nNewFlags ) +void ScTable::SetRowFlags( SCROW nStartRow, SCROW nEndRow, sal_uInt8 nNewFlags ) { if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && pRowFlags) pRowFlags->SetValue( nStartRow, nEndRow, nNewFlags); @@ -2658,7 +2658,7 @@ void ScTable::SetRowFlags( SCROW nStartRow, SCROW nEndRow, BYTE nNewFlags ) } -BYTE ScTable::GetColFlags( SCCOL nCol ) const +sal_uInt8 ScTable::GetColFlags( SCCOL nCol ) const { if (VALIDCOL(nCol) && pColFlags) return pColFlags[nCol]; @@ -2667,7 +2667,7 @@ BYTE ScTable::GetColFlags( SCCOL nCol ) const } -BYTE ScTable::GetRowFlags( SCROW nRow ) const +sal_uInt8 ScTable::GetRowFlags( SCROW nRow ) const { if (VALIDROW(nRow) && pRowFlags) return pRowFlags->GetValue(nRow); @@ -2681,7 +2681,7 @@ SCROW ScTable::GetLastFlaggedRow() const SCROW nLastFound = 0; if (pRowFlags) { - SCROW nRow = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<BYTE>(CR_ALL) ); + SCROW nRow = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<sal_uInt8>(CR_ALL) ); if (ValidRow(nRow)) nLastFound = nRow; } @@ -2739,24 +2739,24 @@ SCROW ScTable::GetLastChangedRow() const } -BOOL ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow ) +sal_Bool ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, sal_Bool bShow ) { if (pOutlineTable && pColFlags) { - ScBitMaskCompressedArray< SCCOLROW, BYTE> aArray( MAXCOL, pColFlags, MAXCOLCOUNT); + ScBitMaskCompressedArray< SCCOLROW, sal_uInt8> aArray( MAXCOL, pColFlags, MAXCOLCOUNT); return pOutlineTable->GetColArray()->ManualAction( nStartCol, nEndCol, bShow, *this, true ); } else - return FALSE; + return false; } -BOOL ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow ) +sal_Bool ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, sal_Bool bShow ) { if (pOutlineTable && pRowFlags) return pOutlineTable->GetRowArray()->ManualAction( nStartRow, nEndRow, bShow, *this, false ); else - return FALSE; + return false; } @@ -2830,12 +2830,12 @@ short DiffSign( T a, T b ) void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) { - BOOL bSizeChanged = FALSE; + sal_Bool bSizeChanged = false; SCCOL nCol; SCROW nRow; SCROW i; - BOOL bFound; + sal_Bool bFound; ScOutlineArray* pArray; ScBaseCell* pCell; ScRange aRef; @@ -2847,7 +2847,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC SCROW nCount = nEndRow-nStartRow+1; bool* pUsed = new bool[nCount]; for (i=0; i<nCount; i++) - pUsed[i] = FALSE; + pUsed[i] = false; for (nCol=nStartCol; nCol<=nEndCol; nCol++) if (!aCol[nCol].IsEmptyData()) aCol[nCol].FindUsed( nStartRow, nEndRow, pUsed ); @@ -2856,7 +2856,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC for (nRow=nStartRow; nRow<=nEndRow; nRow++) if (pUsed[nRow-nStartRow]) { - bFound = FALSE; + bFound = false; for (nCol=nStartCol; nCol<=nEndCol && !bFound; nCol++) if (!aCol[nCol].IsEmptyData()) { @@ -2871,7 +2871,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC { if (pArray->Insert( aRef.aStart.Row(), aRef.aEnd.Row(), bSizeChanged )) { - bFound = TRUE; + bFound = true; } } } @@ -2886,7 +2886,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC { if (!aCol[nCol].IsEmptyData()) { - bFound = FALSE; + bFound = false; ScColumnIterator aIter( &aCol[nCol], nStartRow, nEndRow ); while ( aIter.Next( nRow, pCell ) && !bFound ) { @@ -2899,7 +2899,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC { if (pArray->Insert( aRef.aStart.Col(), aRef.aEnd.Col(), bSizeChanged )) { - bFound = TRUE; + bFound = true; } } } @@ -2917,7 +2917,7 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n ScAddress aSrc( nStartCol, nStartRow, nTab ); ScAddress aDest( nDestCol, nDestRow, nDestTab ); ScRange aRange( aSrc, aDest ); - BOOL bThisTab = ( nDestTab == nTab ); + sal_Bool bThisTab = ( nDestTab == nTab ); SCROW nDestY = nDestRow; for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++) { @@ -2944,12 +2944,12 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n if (bThisTab) { PutCell( nDestX, nDestY, pCell ); - SetPattern( nDestX, nDestY, *GetPattern( nCol, nRow ), TRUE ); + SetPattern( nDestX, nDestY, *GetPattern( nCol, nRow ), sal_True ); } else { pDocument->PutCell( aDest, pCell ); - pDocument->SetPattern( aDest, *GetPattern( nCol, nRow ), TRUE ); + pDocument->SetPattern( aDest, *GetPattern( nCol, nRow ), sal_True ); } ++nDestX; @@ -2959,7 +2959,7 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n } -BOOL ScTable::RefVisible(ScFormulaCell* pCell) +sal_Bool ScTable::RefVisible(ScFormulaCell* pCell) { ScRange aRef; @@ -2973,12 +2973,12 @@ BOOL ScTable::RefVisible(ScFormulaCell* pCell) nEndRow = ::std::numeric_limits<SCROW>::max(); if (!ValidRow(nEndRow) || nEndRow < aRef.aEnd.Row()) - return TRUE; // at least partly visible - return FALSE; // completely invisible + return sal_True; // at least partly visible + return false; // completely invisible } } - return TRUE; // irgendwie anders + return sal_True; // irgendwie anders } @@ -3015,13 +3015,13 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos // #i102616# actions that modify the draw page size count as sheet modification // (exception: InitDrawLayer) if (bResetStreamValid && IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -ULONG ScTable::GetRowOffset( SCROW nRow ) const +sal_uLong ScTable::GetRowOffset( SCROW nRow ) const { - ULONG n = 0; + sal_uLong n = 0; if ( mpHiddenRows && mpRowHeights ) { if (nRow == 0) @@ -3042,7 +3042,7 @@ ULONG ScTable::GetRowOffset( SCROW nRow ) const return n; } -SCROW ScTable::GetRowForHeight(ULONG nHeight) const +SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const { sal_uInt32 nSum = 0; @@ -3069,9 +3069,9 @@ SCROW ScTable::GetRowForHeight(ULONG nHeight) const } -ULONG ScTable::GetColOffset( SCCOL nCol ) const +sal_uLong ScTable::GetColOffset( SCCOL nCol ) const { - ULONG n = 0; + sal_uLong n = 0; if ( pColWidth ) { SCCOL i; diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index c7f067e39038..a2b4556e2738 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -143,15 +143,15 @@ bool SplitString( const rtl::OUString &sWhole, sInput2 is greater. */ short Compare( const String &sInput1, const String &sInput2, - const BOOL bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) + const sal_Bool bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) { rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; do { double nNum1, nNum2; - BOOL bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 ); - BOOL bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 ); + sal_Bool bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 ); + sal_Bool bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 ); short nPreRes; // Prefix comparison result if ( pData ) @@ -203,7 +203,7 @@ short Compare( const String &sInput1, const String &sInput2, // STATIC DATA ----------------------------------------------------------- -const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam +const sal_uInt16 nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam struct ScSortInfo { @@ -211,7 +211,7 @@ struct ScSortInfo SCCOLROW nOrg; DECL_FIXEDMEMPOOL_NEWDEL( ScSortInfo ); }; -const USHORT nMemPoolSortInfo = (0x8000 - 64) / sizeof(ScSortInfo); +const sal_uInt16 nMemPoolSortInfo = (0x8000 - 64) / sizeof(ScSortInfo); IMPL_FIXEDMEMPOOL_NEWDEL( ScSortInfo, nMemPoolSortInfo, nMemPoolSortInfo ) // END OF STATIC DATA ----------------------------------------------------- @@ -223,14 +223,14 @@ private: ScSortInfo** pppInfo[nMaxSorts]; SCSIZE nCount; SCCOLROW nStart; - USHORT nUsedSorts; + sal_uInt16 nUsedSorts; public: - ScSortInfoArray( USHORT nSorts, SCCOLROW nInd1, SCCOLROW nInd2 ) : + ScSortInfoArray( sal_uInt16 nSorts, SCCOLROW nInd1, SCCOLROW nInd2 ) : nCount( nInd2 - nInd1 + 1 ), nStart( nInd1 ), nUsedSorts( Min( nSorts, nMaxSorts ) ) { - for ( USHORT nSort = 0; nSort < nUsedSorts; nSort++ ) + for ( sal_uInt16 nSort = 0; nSort < nUsedSorts; nSort++ ) { ScSortInfo** ppInfo = new ScSortInfo* [nCount]; for ( SCSIZE j = 0; j < nCount; j++ ) @@ -240,7 +240,7 @@ public: } ~ScSortInfoArray() { - for ( USHORT nSort = 0; nSort < nUsedSorts; nSort++ ) + for ( sal_uInt16 nSort = 0; nSort < nUsedSorts; nSort++ ) { ScSortInfo** ppInfo = pppInfo[nSort]; for ( SCSIZE j = 0; j < nCount; j++ ) @@ -248,13 +248,13 @@ public: delete [] ppInfo; } } - ScSortInfo* Get( USHORT nSort, SCCOLROW nInd ) + ScSortInfo* Get( sal_uInt16 nSort, SCCOLROW nInd ) { return (pppInfo[nSort])[ nInd - nStart ]; } void Swap( SCCOLROW nInd1, SCCOLROW nInd2 ) { SCSIZE n1 = static_cast<SCSIZE>(nInd1 - nStart); SCSIZE n2 = static_cast<SCSIZE>(nInd2 - nStart); - for ( USHORT nSort = 0; nSort < nUsedSorts; nSort++ ) + for ( sal_uInt16 nSort = 0; nSort < nUsedSorts; nSort++ ) { ScSortInfo** ppInfo = pppInfo[nSort]; ScSortInfo* pTmp = ppInfo[n1]; @@ -262,7 +262,7 @@ public: ppInfo[n2] = pTmp; } } - USHORT GetUsedSorts() { return nUsedSorts; } + sal_uInt16 GetUsedSorts() { return nUsedSorts; } ScSortInfo** GetFirstArray() { return pppInfo[0]; } SCCOLROW GetStart() { return nStart; } SCSIZE GetCount() { return nCount; } @@ -270,13 +270,13 @@ public: ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 ) { - USHORT nUsedSorts = 1; + sal_uInt16 nUsedSorts = 1; while ( nUsedSorts < nMaxSorts && aSortParam.bDoSort[nUsedSorts] ) nUsedSorts++; ScSortInfoArray* pArray = new ScSortInfoArray( nUsedSorts, nInd1, nInd2 ); if ( aSortParam.bByRow ) { - for ( USHORT nSort = 0; nSort < nUsedSorts; nSort++ ) + for ( sal_uInt16 nSort = 0; nSort < nUsedSorts; nSort++ ) { SCCOL nCol = static_cast<SCCOL>(aSortParam.nField[nSort]); ScColumn* pCol = &aCol[nCol]; @@ -291,7 +291,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 ) } else { - for ( USHORT nSort = 0; nSort < nUsedSorts; nSort++ ) + for ( sal_uInt16 nSort = 0; nSort < nUsedSorts; nSort++ ) { SCROW nRow = aSortParam.nField[nSort]; for ( SCCOL nCol = static_cast<SCCOL>(nInd1); @@ -307,7 +307,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 ) } -BOOL ScTable::IsSortCollatorGlobal() const +sal_Bool ScTable::IsSortCollatorGlobal() const { return pSortCollator == ScGlobal::GetCollator() || pSortCollator == ScGlobal::GetCaseCollator(); @@ -345,7 +345,7 @@ void ScTable::DestroySortCollator() void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress& rProgress ) { - BOOL bByRow = aSortParam.bByRow; + sal_Bool bByRow = aSortParam.bByRow; SCSIZE nCount = pArray->GetCount(); SCCOLROW nStart = pArray->GetStart(); ScSortInfo** ppInfo = pArray->GetFirstArray(); @@ -376,7 +376,7 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress& rProgress ) } } -short ScTable::CompareCell( USHORT nSort, +short ScTable::CompareCell( sal_uInt16 nSort, ScBaseCell* pCell1, SCCOL nCell1Col, SCROW nCell1Row, ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row ) { @@ -400,12 +400,12 @@ short ScTable::CompareCell( USHORT nSort, { if (pCell2) { - BOOL bStr1 = ( eType1 != CELLTYPE_VALUE ); + sal_Bool bStr1 = ( eType1 != CELLTYPE_VALUE ); if ( eType1 == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell1)->IsValue() ) - bStr1 = FALSE; - BOOL bStr2 = ( eType2 != CELLTYPE_VALUE ); + bStr1 = false; + sal_Bool bStr2 = ( eType2 != CELLTYPE_VALUE ); if ( eType2 == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell2)->IsValue() ) - bStr2 = FALSE; + bStr2 = false; if ( bStr1 && bStr2 ) // nur Strings untereinander als String vergleichen! { @@ -420,9 +420,9 @@ short ScTable::CompareCell( USHORT nSort, else GetString(nCell2Col, nCell2Row, aStr2); - BOOL bUserDef = aSortParam.bUserDef; // custom sort order - BOOL bNaturalSort = aSortParam.bNaturalSort; // natural sort - BOOL bCaseSens = aSortParam.bCaseSens; // case sensitivity + sal_Bool bUserDef = aSortParam.bUserDef; // custom sort order + sal_Bool bNaturalSort = aSortParam.bNaturalSort; // natural sort + sal_Bool bCaseSens = aSortParam.bCaseSens; // case sensitivity if (bUserDef) { @@ -443,7 +443,7 @@ short ScTable::CompareCell( USHORT nSort, } } else - bUserDef = FALSE; + bUserDef = false; } if (!bUserDef) @@ -498,7 +498,7 @@ short ScTable::CompareCell( USHORT nSort, short ScTable::Compare( ScSortInfoArray* pArray, SCCOLROW nIndex1, SCCOLROW nIndex2 ) { short nRes; - USHORT nSort = 0; + sal_uInt16 nSort = 0; do { ScSortInfo* pInfo1 = pArray->Get( nSort, nIndex1 ); @@ -577,8 +577,8 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) const ScPatternAttr* pPat2 = GetPattern(nCol2, nRow); if (pPat1 != pPat2) { - SetPattern(nCol1, nRow, *pPat2, TRUE); - SetPattern(nCol2, nRow, *pPat1, TRUE); + SetPattern(nCol1, nRow, *pPat2, sal_True); + SetPattern(nCol2, nRow, *pPat1, sal_True); } } } @@ -595,8 +595,8 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) const ScPatternAttr* pPat2 = GetPattern(nCol, nRow2); if (pPat1 != pPat2) { - SetPattern(nCol, nRow1, *pPat2, TRUE); - SetPattern(nCol, nRow2, *pPat1, TRUE); + SetPattern(nCol, nRow1, *pPat2, sal_True); + SetPattern(nCol, nRow2, *pPat1, sal_True); } } } @@ -617,7 +617,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) { short nRes; - USHORT nSort = 0; + sal_uInt16 nSort = 0; if (aSortParam.bByRow) { do @@ -642,14 +642,14 @@ short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) return nRes; } -BOOL ScTable::IsSorted( SCCOLROW nStart, SCCOLROW nEnd ) // ueber aSortParam +sal_Bool ScTable::IsSorted( SCCOLROW nStart, SCCOLROW nEnd ) // ueber aSortParam { for (SCCOLROW i=nStart; i<nEnd; i++) { if (Compare( i, i+1 ) > 0) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScTable::DecoladeRow( ScSortInfoArray* pArray, SCROW nRow1, SCROW nRow2 ) @@ -663,7 +663,7 @@ void ScTable::DecoladeRow( ScSortInfoArray* pArray, SCROW nRow1, SCROW nRow2 ) } } -void ScTable::Sort(const ScSortParam& rSortParam, BOOL bKeepQuery) +void ScTable::Sort(const ScSortParam& rSortParam, sal_Bool bKeepQuery) { aSortParam = rSortParam; InitSortCollator( rSortParam ); @@ -718,7 +718,7 @@ void ScTable::Sort(const ScSortParam& rSortParam, BOOL bKeepQuery) // Testen, ob beim Loeschen von Zwischenergebnissen andere Daten mit geloescht werden // (fuer Hinweis-Box) -BOOL ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) +sal_Bool ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) { SCCOL nStartCol = rParam.nCol1; SCROW nStartRow = rParam.nRow1 + 1; // Header @@ -729,7 +729,7 @@ BOOL ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) SCROW nRow; ScBaseCell* pCell; - BOOL bWillDelete = FALSE; + sal_Bool bWillDelete = false; for ( nCol=nStartCol; nCol<=nEndCol && !bWillDelete; nCol++ ) { ScColumnIterator aIter( &aCol[nCol],nStartRow,nEndRow ); @@ -741,7 +741,7 @@ BOOL ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam ) for (SCCOL nTestCol=0; nTestCol<=MAXCOL; nTestCol++) if (nTestCol<nStartCol || nTestCol>nEndCol) if (aCol[nTestCol].HasDataAt(nRow)) - bWillDelete = TRUE; + bWillDelete = sal_True; } } } @@ -786,14 +786,14 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam ) void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow ) { const ScPatternAttr* pPattern = pTab->GetPattern( nCol, nRow ); - if ( pPattern->GetItemSet().GetItemState( ATTR_VALUE_FORMAT, FALSE ) + if ( pPattern->GetItemSet().GetItemState( ATTR_VALUE_FORMAT, false ) == SFX_ITEM_SET ) { ScPatternAttr aNewPattern( *pPattern ); SfxItemSet& rSet = aNewPattern.GetItemSet(); rSet.ClearItem( ATTR_VALUE_FORMAT ); rSet.ClearItem( ATTR_LANGUAGE_FORMAT ); - pTab->SetPattern( nCol, nRow, aNewPattern, TRUE ); + pTab->SetPattern( nCol, nRow, aNewPattern, sal_True ); } } @@ -801,7 +801,7 @@ void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow ) // at least MSC needs this at linkage level to be able to use it in a template typedef struct lcl_ScTable_DoSubTotals_RowEntry { - USHORT nGroupNo; + sal_uInt16 nGroupNo; SCROW nSubStartRow; SCROW nDestRow; SCROW nFuncStart; @@ -811,13 +811,13 @@ typedef struct lcl_ScTable_DoSubTotals_RowEntry // neue Zwischenergebnisse // rParam.nRow2 wird veraendert ! -BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) +sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) { SCCOL nStartCol = rParam.nCol1; SCROW nStartRow = rParam.nRow1 + 1; // Header SCCOL nEndCol = rParam.nCol2; SCROW nEndRow = rParam.nRow2; // wird veraendert - USHORT i; + sal_uInt16 i; // Leerzeilen am Ende weglassen, // damit alle Ueberlaeufe (MAXROW) bei InsertRow gefunden werden (#35180#) @@ -825,16 +825,16 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) SCSIZE nEmpty = GetEmptyLinesInBlock( nStartCol, nStartRow, nEndCol, nEndRow, DIR_BOTTOM ); nEndRow -= nEmpty; - USHORT nLevelCount = 0; // Anzahl Gruppierungen - BOOL bDoThis = TRUE; + sal_uInt16 nLevelCount = 0; // Anzahl Gruppierungen + sal_Bool bDoThis = sal_True; for (i=0; i<MAXSUBTOTAL && bDoThis; i++) if (rParam.bGroupActive[i]) nLevelCount = i+1; else - bDoThis = FALSE; + bDoThis = false; if (nLevelCount==0) // nichts tun - return TRUE; + return sal_True; SCCOL* nGroupCol = rParam.nField; // Spalten nach denen // gruppiert wird @@ -842,12 +842,12 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) // Durch (leer) als eigene Kategorie muss immer auf // Teilergebniszeilen aus den anderen Spalten getestet werden // (frueher nur, wenn eine Spalte mehrfach vorkam) - BOOL bTestPrevSub = ( nLevelCount > 1 ); + sal_Bool bTestPrevSub = ( nLevelCount > 1 ); String aSubString; String aOutString; - BOOL bIgnoreCase = !rParam.bCaseSens; + sal_Bool bIgnoreCase = !rParam.bCaseSens; String *pCompString[MAXSUBTOTAL]; // Pointer wegen Compiler-Problemen for (i=0; i<MAXSUBTOTAL; i++) @@ -858,7 +858,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) ScStyleSheet* pStyle = (ScStyleSheet*) pDocument->GetStyleSheetPool()->Find( ScGlobal::GetRscString(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ); - BOOL bSpaceLeft = TRUE; // Erfolg beim Einfuegen? + sal_Bool bSpaceLeft = sal_True; // Erfolg beim Einfuegen? // For performance reasons collect formula entries so their // references don't have to be tested for updates each time a new row is @@ -866,9 +866,9 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) RowEntry aRowEntry; ::std::vector< RowEntry > aRowVector; - for (USHORT nLevel=0; nLevel<=nLevelCount && bSpaceLeft; nLevel++) // incl. Gesamtergebnis + for (sal_uInt16 nLevel=0; nLevel<=nLevelCount && bSpaceLeft; nLevel++) // incl. Gesamtergebnis { - BOOL bTotal = ( nLevel == nLevelCount ); + sal_Bool bTotal = ( nLevel == nLevelCount ); aRowEntry.nGroupNo = bTotal ? 0 : (nLevelCount-nLevel-1); // how many results per level @@ -887,16 +887,16 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) *pCompString[i] = aSubString; } // aSubString bleibt auf dem letzten stehen - BOOL bBlockVis = FALSE; // Gruppe eingeblendet? + sal_Bool bBlockVis = false; // Gruppe eingeblendet? aRowEntry.nSubStartRow = nStartRow; for (SCROW nRow=nStartRow; nRow<=nEndRow+1 && bSpaceLeft; nRow++) { - BOOL bChanged; + sal_Bool bChanged; if (nRow>nEndRow) - bChanged = TRUE; + bChanged = sal_True; else { - bChanged = FALSE; + bChanged = false; if (!bTotal) { String aString; @@ -919,7 +919,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) { if ( iEntry->nDestRow == nRow ) { - bChanged = FALSE; + bChanged = false; break; } } @@ -935,7 +935,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) bSpaceLeft = pDocument->InsertRow( 0, nTab, MAXCOL, nTab, aRowEntry.nDestRow, 1 ); DBShowRow( aRowEntry.nDestRow, bBlockVis ); - bBlockVis = FALSE; + bBlockVis = false; if ( rParam.bPagebreak && nRow < MAXROW && aRowEntry.nSubStartRow != nStartRow && nLevel == 0) SetRowBreak(aRowEntry.nSubStartRow, false, true); @@ -966,7 +966,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) if (!aOutString.Len()) aOutString = ScGlobal::GetRscString( STR_EMPTYDATA ); aOutString += ' '; - USHORT nStrId = STR_TABLE_ERGEBNIS; + sal_uInt16 nStrId = STR_TABLE_ERGEBNIS; if ( nResCount == 1 ) switch ( eResFunc[0] ) { @@ -1065,25 +1065,25 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) } -BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, - BOOL* pSpecial /* =NULL */ , ScBaseCell* pCell /* =NULL */ , - BOOL* pbTestEqualCondition /* = NULL */ ) +sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, + sal_Bool* pSpecial /* =NULL */ , ScBaseCell* pCell /* =NULL */ , + sal_Bool* pbTestEqualCondition /* = NULL */ ) { if (!rParam.GetEntry(0).bDoQuery) - return TRUE; + return sal_True; //--------------------------------------------------------------- const SCSIZE nFixedBools = 32; - BOOL aBool[nFixedBools]; - BOOL aTest[nFixedBools]; + sal_Bool aBool[nFixedBools]; + sal_Bool aTest[nFixedBools]; SCSIZE nEntryCount = rParam.GetEntryCount(); - BOOL* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new BOOL[nEntryCount] ); - BOOL* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new BOOL[nEntryCount] ); + sal_Bool* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new sal_Bool[nEntryCount] ); + sal_Bool* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new sal_Bool[nEntryCount] ); long nPos = -1; SCSIZE i = 0; - BOOL bMatchWholeCell = pDocument->GetDocOptions().IsMatchWholeCell(); + sal_Bool bMatchWholeCell = pDocument->GetDocOptions().IsMatchWholeCell(); CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() : ScGlobal::GetCollator()); ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ? @@ -1096,8 +1096,8 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, if ( !pCell || i > 0 ) pCell = GetCell( static_cast<SCCOL>(rEntry.nField), nRow ); - BOOL bOk = FALSE; - BOOL bTestEqual = FALSE; + sal_Bool bOk = false; + sal_Bool bTestEqual = false; if ( pSpecial && pSpecial[i] ) { @@ -1199,24 +1199,24 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, if( rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_BEGIN_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH ) - bMatchWholeCell = FALSE; + bMatchWholeCell = false; if ( pCell ) { if (pCell->GetCellType() != CELLTYPE_NOTE) { - ULONG nFormat = GetNumberFormat( static_cast<SCCOL>(rEntry.nField), nRow ); + sal_uLong nFormat = GetNumberFormat( static_cast<SCCOL>(rEntry.nField), nRow ); ScCellFormat::GetInputString( pCell, nFormat, aCellStr, *(pDocument->GetFormatTable()) ); } } else GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); - BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) + sal_Bool bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) || (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) || (rEntry.eOp == SC_DOES_NOT_CONTAIN) || (rEntry.eOp == SC_BEGINS_WITH) || (rEntry.eOp == SC_ENDS_WITH) || (rEntry.eOp == SC_DOES_NOT_BEGIN_WITH) || (rEntry.eOp == SC_DOES_NOT_END_WITH))); - BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp + sal_Bool bTestRegExp = (pbTestEqualCondition && rParam.bRegExp && ((rEntry.eOp == SC_LESS_EQUAL) || (rEntry.eOp == SC_GREATER_EQUAL))); if ( bRealRegExp || bTestRegExp ) @@ -1225,22 +1225,22 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, xub_StrLen nEnd = aCellStr.Len(); // from 614 on, nEnd is behind the found text - BOOL bMatch = FALSE; + sal_Bool bMatch = false; if ( rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH ) { nEnd = 0; nStart = aCellStr.Len(); - bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) + bMatch = (sal_Bool) rEntry.GetSearchTextPtr( rParam.bCaseSens ) ->SearchBkwrd( aCellStr, &nStart, &nEnd ); } else { - bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) + bMatch = (sal_Bool) rEntry.GetSearchTextPtr( rParam.bCaseSens ) ->SearchFrwrd( aCellStr, &nStart, &nEnd ); } if ( bMatch && bMatchWholeCell && (nStart != 0 || nEnd != aCellStr.Len()) ) - bMatch = FALSE; // RegExp must match entire cell string + bMatch = false; // RegExp must match entire cell string if ( bRealRegExp ) switch (rEntry.eOp) { @@ -1284,7 +1284,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, // #i18374# When used from functions (match, countif, sumif, vlookup, hlookup, lookup), // the query value is assigned directly, and the string is empty. In that case, // don't find any string (isEqual would find empty string results in formula cells). - bOk = FALSE; + bOk = false; if ( rEntry.eOp == SC_NOT_EQUAL ) bOk = !bOk; } @@ -1371,14 +1371,14 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, (pCell ? pCell->HasValueData() : HasValueData( static_cast<SCCOL>(rEntry.nField), nRow))) { - bOk = TRUE; + bOk = sal_True; } else if (!rEntry.bQueryByString && (rEntry.eOp == SC_GREATER || rEntry.eOp == SC_GREATER_EQUAL) && (pCell ? pCell->HasStringData() : HasStringData( static_cast<SCCOL>(rEntry.nField), nRow))) { - bOk = TRUE; + bOk = sal_True; } } @@ -1411,7 +1411,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, pTest[0] = pTest[0] || pTest[j]; } - BOOL bRet = pPasst[0]; + sal_Bool bRet = pPasst[0]; if ( pPasst != &aBool[0] ) delete [] pPasst; if ( pbTestEqualCondition ) @@ -1424,7 +1424,7 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, void ScTable::TopTenQuery( ScQueryParam& rParam ) { - BOOL bSortCollatorInitialized = FALSE; + sal_Bool bSortCollatorInitialized = false; SCSIZE nEntryCount = rParam.GetEntryCount(); SCROW nRow1 = (rParam.bHasHeader ? rParam.nRow1 + 1 : rParam.nRow1); SCSIZE nCount = static_cast<SCSIZE>(rParam.nRow2 - nRow1 + 1); @@ -1442,7 +1442,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) aSortParam = aLocalSortParam; // used in CreateSortInfoArray, Compare if ( !bSortCollatorInitialized ) { - bSortCollatorInitialized = TRUE; + bSortCollatorInitialized = sal_True; InitSortCollator( aLocalSortParam ); } ScSortInfoArray* pArray = CreateSortInfoArray( nRow1, rParam.nRow2 ); @@ -1462,7 +1462,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) { if ( rEntry.bQueryByString ) { // dat wird nix - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = 10; // 10 bzw. 10% } SCSIZE nVal = (rEntry.nVal >= 1 ? static_cast<SCSIZE>(rEntry.nVal) : 1); @@ -1528,7 +1528,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) else { rEntry.eOp = SC_GREATER_EQUAL; - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = 0; } delete pArray; @@ -1544,14 +1544,14 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) DestroySortCollator(); } -static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rParam, BOOL* pSpecial ) +static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rParam, sal_Bool* pSpecial ) { bool bTopTen = false; SCSIZE nEntryCount = rParam.GetEntryCount(); for ( SCSIZE i = 0; i < nEntryCount; ++i ) { - pSpecial[i] = FALSE; + pSpecial[i] = false; ScQueryEntry& rEntry = rParam.GetEntry(i); if ( rEntry.bDoQuery ) { @@ -1583,7 +1583,7 @@ static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rPa // call from UNO or second call from autofilter if ( rEntry.nVal == SC_EMPTYFIELDS || rEntry.nVal == SC_NONEMPTYFIELDS ) { - pSpecial[i] = TRUE; + pSpecial[i] = sal_True; } } if ( !bTopTen ) @@ -1612,14 +1612,14 @@ static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rPa } } -SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) +SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub) { ScQueryParam aParam( rParamOrg ); ScStrCollection aScStrCollection; StrData* pStrData = NULL; - BOOL bStarted = FALSE; - BOOL bOldResult = TRUE; + sal_Bool bStarted = false; + sal_Bool bOldResult = sal_True; SCROW nOldStart = 0; SCROW nOldEnd = 0; @@ -1628,7 +1628,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) SCROW nHeader = aParam.bHasHeader ? 1 : 0; SCSIZE nEntryCount = aParam.GetEntryCount(); - BOOL* pSpecial = new BOOL[nEntryCount]; + sal_Bool* pSpecial = new sal_Bool[nEntryCount]; lcl_PrepareQuery( pDocument, this, aParam, pSpecial ); if (!aParam.bInplace) @@ -1646,8 +1646,8 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) SCROW nRealRow2 = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2; for (SCROW j = aParam.nRow1 + nHeader; j <= nRealRow2; ++j) { - BOOL bResult; // Filterergebnis - BOOL bValid = ValidQuery(j, aParam, pSpecial); + sal_Bool bResult; // Filterergebnis + sal_Bool bValid = ValidQuery(j, aParam, pSpecial); if (!bValid && bKeepSub) // Subtotals stehenlassen { for (SCCOL nCol=aParam.nCol1; nCol<=aParam.nCol2 && !bValid; nCol++) @@ -1658,13 +1658,13 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) if ( pCell->GetCellType() == CELLTYPE_FORMULA ) if (((ScFormulaCell*)pCell)->IsSubTotal()) if (RefVisible((ScFormulaCell*)pCell)) - bValid = TRUE; + bValid = sal_True; } } if (bValid) { if (aParam.bDuplicate) - bResult = TRUE; + bResult = sal_True; else { String aStr; @@ -1677,20 +1677,20 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) } pStrData = new StrData(aStr); - BOOL bIsUnique = TRUE; + sal_Bool bIsUnique = sal_True; if (pStrData) bIsUnique = aScStrCollection.Insert(pStrData); if (bIsUnique) - bResult = TRUE; + bResult = sal_True; else { delete pStrData; - bResult = FALSE; + bResult = false; } } } else - bResult = FALSE; + bResult = false; if (aParam.bInplace) { @@ -1703,7 +1703,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) nOldStart = nOldEnd = j; bOldResult = bResult; } - bStarted = TRUE; + bStarted = sal_True; } else { @@ -1727,9 +1727,9 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) return nCount; } -BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) +sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) { - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; SCCOL* pFields = new SCCOL[nCol2-nCol1+1]; String aCellStr; SCCOL nCol = nCol1; @@ -1742,7 +1742,7 @@ BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow { String aQueryStr; GetUpperCellString(nCol, nRow1, aQueryStr); - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL i = rQueryParam.nCol1; while (!bFound && (i <= nDBCol2)) { @@ -1756,12 +1756,12 @@ BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow if (bFound) pFields[nCol - nCol1] = i; else - bValid = FALSE; + bValid = false; nCol++; } if (bValid) { - ULONG nVisible = 0; + sal_uLong nVisible = 0; for ( nCol=nCol1; nCol<=nCol2; nCol++ ) nVisible += aCol[nCol].VisibleCount( nRow1+1, nRow2 ); @@ -1794,7 +1794,7 @@ BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow rQueryParam.GetEntry(nIndex).eConnect = SC_AND; } else - bValid = FALSE; + bValid = false; } nCol++; } @@ -1807,7 +1807,7 @@ BOOL ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow return bValid; } -BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) +sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) { // A valid StarQuery must be at least 4 columns wide. To be precise it // should be exactly 4 columns ... @@ -1818,10 +1818,10 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 // range wasn't sufficiently specified data changes wouldn't flag formula // cells for recalculation. if (nCol2 - nCol1 < 3) - return FALSE; + return false; - BOOL bValid; - BOOL bFound; + sal_Bool bValid; + sal_Bool bFound; String aCellStr; SCSIZE nIndex = 0; SCROW nRow = nRow1; @@ -1837,7 +1837,7 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 { ScQueryEntry& rEntry = rQueryParam.GetEntry(nIndex); - bValid = FALSE; + bValid = false; // Erste Spalte UND/ODER if (nIndex > 0) { @@ -1845,18 +1845,18 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 if ( aCellStr == ScGlobal::GetRscString(STR_TABLE_UND) ) { rEntry.eConnect = SC_AND; - bValid = TRUE; + bValid = sal_True; } else if ( aCellStr == ScGlobal::GetRscString(STR_TABLE_ODER) ) { rEntry.eConnect = SC_OR; - bValid = TRUE; + bValid = sal_True; } } // Zweite Spalte FeldName if ((nIndex < 1) || bValid) { - bFound = FALSE; + bFound = false; GetUpperCellString(nCol1 + 1, nRow, aCellStr); for (SCCOL i=rQueryParam.nCol1; (i <= nDBCol2) && (!bFound); i++) { @@ -1869,16 +1869,16 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 if (bFound) { rEntry.nField = i; - bValid = TRUE; + bValid = sal_True; } else - bValid = FALSE; + bValid = false; } } // Dritte Spalte Operator =<>... if (bValid) { - bFound = FALSE; + bFound = false; GetUpperCellString(nCol1 + 2, nRow, aCellStr); if (aCellStr.GetChar(0) == '<') { @@ -1904,7 +1904,7 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 if (bValid) { GetString(nCol1 + 3, nRow, *rEntry.pStr); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; } nIndex++; nRow++; @@ -1913,7 +1913,7 @@ BOOL ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 return bValid; } -BOOL ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) +sal_Bool ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam) { SCSIZE i, nCount; PutInOrder(nCol1, nCol2); @@ -1924,7 +1924,7 @@ BOOL ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow rQueryParam.GetEntry(i).Clear(); // Standard QueryTabelle - BOOL bValid = CreateStarQuery(nCol1, nRow1, nCol2, nRow2, rQueryParam); + sal_Bool bValid = CreateStarQuery(nCol1, nRow1, nCol2, nRow2, rQueryParam); // Excel QueryTabelle if (!bValid) bValid = CreateExcelQuery(nCol1, nRow1, nCol2, nRow2, rQueryParam); @@ -1934,7 +1934,7 @@ BOOL ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow { // bQueryByString muss gesetzt sein for (i=0; i < nCount; i++) - rQueryParam.GetEntry(i).bQueryByString = TRUE; + rQueryParam.GetEntry(i).bQueryByString = sal_True; } else { @@ -1945,26 +1945,26 @@ BOOL ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow return bValid; } -BOOL ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW /* nEndRow */ ) +sal_Bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW /* nEndRow */ ) { for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++) { CellType eType = GetCellType( nCol, nStartRow ); if (eType != CELLTYPE_STRING && eType != CELLTYPE_EDIT) - return FALSE; + return false; } - return TRUE; + return sal_True; } -BOOL ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol */, SCROW nEndRow ) +sal_Bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol */, SCROW nEndRow ) { for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++) { CellType eType = GetCellType( nStartCol, nRow ); if (eType != CELLTYPE_STRING && eType != CELLTYPE_EDIT) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates) @@ -1989,7 +1989,7 @@ void ScTable::GetFilteredFilterEntries( } nEntryCount = aParam.GetEntryCount(); - BOOL* pSpecial = new BOOL[nEntryCount]; + sal_Bool* pSpecial = new sal_Bool[nEntryCount]; lcl_PrepareQuery( pDocument, this, aParam, pSpecial ); bool bHasDates = false; for ( SCROW j = nRow1; j <= nRow2; ++j ) @@ -2006,7 +2006,7 @@ void ScTable::GetFilteredFilterEntries( delete[] pSpecial; } -BOOL ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit) +sal_Bool ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, sal_Bool bLimit) { return aCol[nCol].GetDataEntries( nRow, rStrings, bLimit ); } @@ -2016,9 +2016,9 @@ SCSIZE ScTable::GetCellCount(SCCOL nCol) const return aCol[nCol].GetCellCount(); } -ULONG ScTable::GetCellCount() const +sal_uLong ScTable::GetCellCount() const { - ULONG nCellCount = 0; + sal_uLong nCellCount = 0; for ( SCCOL nCol=0; nCol<=MAXCOL; nCol++ ) nCellCount += aCol[nCol].GetCellCount(); @@ -2026,9 +2026,9 @@ ULONG ScTable::GetCellCount() const return nCellCount; } -ULONG ScTable::GetWeightedCount() const +sal_uLong ScTable::GetWeightedCount() const { - ULONG nCellCount = 0; + sal_uLong nCellCount = 0; for ( SCCOL nCol=0; nCol<=MAXCOL; nCol++ ) if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline @@ -2037,9 +2037,9 @@ ULONG ScTable::GetWeightedCount() const return nCellCount; } -ULONG ScTable::GetCodeCount() const +sal_uLong ScTable::GetCodeCount() const { - ULONG nCodeCount = 0; + sal_uLong nCodeCount = 0; for ( SCCOL nCol=0; nCol<=MAXCOL; nCol++ ) if ( aCol[nCol].GetCellCount() ) // GetCellCount ist inline @@ -2072,7 +2072,7 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, { // Cursor neben einer Markierung nicht beruecksichtigen: //! nur noch MarkData uebergeben, Cursorposition ggf. hineinselektieren!!! - BOOL bSingle = ( rMark.IsMarked() || !rMark.IsMultiMarked() ); + sal_Bool bSingle = ( rMark.IsMarked() || !rMark.IsMultiMarked() ); // Mehrfachselektion: @@ -2092,7 +2092,7 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, aCol[nCol].UpdateAreaFunction( rData, *mpHiddenRows, nStartRow, nEndRow ); } -void ScTable::FindConditionalFormat( ULONG nKey, ScRangeList& rList ) +void ScTable::FindConditionalFormat( sal_uLong nKey, ScRangeList& rList ) { SCROW nStartRow = 0, nEndRow = 0; for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index bd46fb105da0..e7ba2153a3f1 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -86,11 +86,11 @@ #define _D_MAX_LONG_ (double) 0x7fffffff -extern USHORT nScFillModeMouseModifier; // global.cxx +extern sal_uInt16 nScFillModeMouseModifier; // global.cxx // ----------------------------------------------------------------------- -short lcl_DecompValueString( String& aValue, sal_Int32& nVal, USHORT* pMinDigits = NULL ) +short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDigits = NULL ) { if ( !aValue.Len() ) { @@ -145,7 +145,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, USHORT* pMinDigits return 0; } -String lcl_ValueString( sal_Int32 nValue, USHORT nMinDigits ) +String lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits ) { if ( nMinDigits <= 1 ) return String::CreateFromInt32( nValue ); // simple case... @@ -166,8 +166,8 @@ String lcl_ValueString( sal_Int32 nValue, USHORT nMinDigits ) } static ScBaseCell * lcl_getSuffixCell( ScDocument* pDocument, sal_Int32 nValue, - USHORT nDigits, const String& rSuffix, CellType eCellType, - BOOL bIsOrdinalSuffix ) + sal_uInt16 nDigits, const String& rSuffix, CellType eCellType, + sal_Bool bIsOrdinalSuffix ) { String aValue( lcl_ValueString( nValue, nDigits )); if (!bIsOrdinalSuffix) @@ -190,8 +190,8 @@ static ScBaseCell * lcl_getSuffixCell( ScDocument* pDocument, sal_Int32 nValue, void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, FillCmd& rCmd, FillDateCmd& rDateCmd, - double& rInc, USHORT& rMinDigits, - ScUserListData*& rListData, USHORT& rListIndex) + double& rInc, sal_uInt16& rMinDigits, + ScUserListData*& rListData, sal_uInt16& rListIndex) { DBG_ASSERT( nCol1==nCol2 || nRow1==nRow2, "FillAnalyse: falscher Bereich" ); @@ -226,8 +226,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (eCellType == CELLTYPE_VALUE) { - UINT32 nFormat = ((const SfxUInt32Item*)GetAttr(nCol,nRow,ATTR_VALUE_FORMAT))->GetValue(); - BOOL bDate = ( pDocument->GetFormatTable()->GetType(nFormat) == NUMBERFORMAT_DATE ); + sal_uInt32 nFormat = ((const SfxUInt32Item*)GetAttr(nCol,nRow,ATTR_VALUE_FORMAT))->GetValue(); + sal_Bool bDate = ( pDocument->GetFormatTable()->GetType(nFormat) == NUMBERFORMAT_DATE ); if (bDate) { if (nCount > 1) @@ -260,8 +260,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); - BOOL bVal = TRUE; - for (USHORT i=1; i<nCount && bVal; i++) + sal_Bool bVal = sal_True; + for (sal_uInt16 i=1; i<nCount && bVal; i++) { ScBaseCell* pCell = GetCell(nCol,nRow); if (pCell && pCell->GetCellType() == CELLTYPE_VALUE) @@ -271,7 +271,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( eType == FILL_DAY ) { if ( aDate2-aDate1 != nCmpInc ) - bVal = FALSE; + bVal = false; } else { @@ -279,14 +279,14 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nMDiff = aDate2.GetMonth() - (long) aDate1.GetMonth(); nYDiff = aDate2.GetYear() - (long) aDate1.GetYear(); if (nDDiff || ( nMDiff + 12 * nYDiff != nCmpInc )) - bVal = FALSE; + bVal = false; } aDate1 = aDate2; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); } else - bVal = FALSE; // kein Datum passt auch nicht + bVal = false; // kein Datum passt auch nicht } if (bVal) { @@ -317,8 +317,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, rInc = nVal2 - nVal1; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); - BOOL bVal = TRUE; - for (USHORT i=1; i<nCount && bVal; i++) + sal_Bool bVal = sal_True; + for (sal_uInt16 i=1; i<nCount && bVal; i++) { ScBaseCell* pCell = GetCell(nCol,nRow); if (pCell && pCell->GetCellType() == CELLTYPE_VALUE) @@ -326,11 +326,11 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nVal2 = ((ScValueCell*)pCell)->GetValue(); double nDiff = nVal2 - nVal1; if ( !::rtl::math::approxEqual( nDiff, rInc ) ) - bVal = FALSE; + bVal = false; nVal1 = nVal2; } else - bVal = FALSE; + bVal = false; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); } @@ -349,7 +349,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, rListData->GetSubIndex(aStr, rListIndex); nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); - for (USHORT i=1; i<nCount && rListData; i++) + for (sal_uInt16 i=1; i<nCount && rListData; i++) { GetString(nCol, nRow, aStr); if (!rListData->GetSubIndex(aStr, rListIndex)) @@ -375,8 +375,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, rInc = (double)nVal2 - (double)nVal1; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); - BOOL bVal = TRUE; - for (USHORT i=1; i<nCount && bVal; i++) + sal_Bool bVal = sal_True; + for (sal_uInt16 i=1; i<nCount && bVal; i++) { ScBaseCell* pCell = GetCell(nCol,nRow); CellType eType = pCell ? pCell->GetCellType() : CELLTYPE_NONE; @@ -391,14 +391,14 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { double nDiff = (double)nVal2 - (double)nVal1; if ( !::rtl::math::approxEqual( nDiff, rInc ) ) - bVal = FALSE; + bVal = false; nVal1 = nVal2; } else - bVal = FALSE; + bVal = false; } else - bVal = FALSE; + bVal = false; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); } @@ -416,11 +416,11 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } -void ScTable::FillFormula(ULONG& /* nFormulaCounter */, BOOL /* bFirst */, ScFormulaCell* pSrcCell, - SCCOL nDestCol, SCROW nDestRow, BOOL bLast ) +void ScTable::FillFormula(sal_uLong& /* nFormulaCounter */, sal_Bool /* bFirst */, ScFormulaCell* pSrcCell, + SCCOL nDestCol, SCROW nDestRow, sal_Bool bLast ) { - pDocument->SetNoListening( TRUE ); // noch falsche Referenzen + pDocument->SetNoListening( true ); // noch falsche Referenzen ScAddress aAddr( nDestCol, nDestRow, nTab ); ScFormulaCell* pDestCell = new ScFormulaCell( *pSrcCell, *pDocument, aAddr ); aCol[nDestCol].Insert(nDestRow, pDestCell); @@ -455,13 +455,13 @@ void ScTable::FillFormula(ULONG& /* nFormulaCounter */, BOOL /* bFirst */, ScFor DBG_ERRORFILE( "FillFormula: kein MatrixOrigin" ); } } - pDocument->SetNoListening( FALSE ); + pDocument->SetNoListening( false ); pDestCell->StartListeningTo( pDocument ); } void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ULONG nFillCount, FillDir eFillDir, ScProgress& rProgress ) + sal_uLong nFillCount, FillDir eFillDir, ScProgress& rProgress ) { if ( (nFillCount == 0) || !ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2) ) return; @@ -470,19 +470,19 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Richtung auswerten // - BOOL bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); - BOOL bPositive = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_RIGHT); + sal_Bool bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); + sal_Bool bPositive = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_RIGHT); - ULONG nCol = 0; - ULONG nRow = 0; - ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen - ULONG& rOuter = bVertical ? nCol : nRow; - ULONG nOStart; - ULONG nOEnd; - ULONG nIStart; - ULONG nIEnd; - ULONG nISrcStart; - ULONG nISrcEnd; + sal_uLong nCol = 0; + sal_uLong nRow = 0; + sal_uLong& rInner = bVertical ? nRow : nCol; // Schleifenvariablen + sal_uLong& rOuter = bVertical ? nCol : nRow; + sal_uLong nOStart; + sal_uLong nOEnd; + sal_uLong nIStart; + sal_uLong nIEnd; + sal_uLong nISrcStart; + sal_uLong nISrcEnd; if (bVertical) { @@ -522,32 +522,32 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nIEnd = nCol1 - nFillCount; } } - ULONG nIMin = nIStart; - ULONG nIMax = nIEnd; + sal_uLong nIMin = nIStart; + sal_uLong nIMax = nIEnd; PutInOrder(nIMin,nIMax); if (bVertical) DeleteArea(nCol1, static_cast<SCROW>(nIMin), nCol2, static_cast<SCROW>(nIMax), IDF_AUTOFILL); else DeleteArea(static_cast<SCCOL>(nIMin), nRow1, static_cast<SCCOL>(nIMax), nRow2, IDF_AUTOFILL); - ULONG nProgress = rProgress.GetState(); + sal_uLong nProgress = rProgress.GetState(); // // ausfuehren // - ULONG nActFormCnt = 0; + sal_uLong nActFormCnt = 0; for (rOuter = nOStart; rOuter <= nOEnd; rOuter++) { - ULONG nMaxFormCnt = 0; // fuer Formeln + sal_uLong nMaxFormCnt = 0; // fuer Formeln // Attributierung uebertragen const ScPatternAttr* pSrcPattern = NULL; const ScStyleSheet* pStyleSheet = NULL; - ULONG nAtSrc = nISrcStart; + sal_uLong nAtSrc = nISrcStart; ScPatternAttr* pNewPattern = NULL; - BOOL bGetPattern = TRUE; + sal_Bool bGetPattern = sal_True; rInner = nIStart; while (true) // #i53728# with "for (;;)" old solaris/x86 compiler mis-optimizes { @@ -559,12 +559,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, pSrcPattern = aCol[nCol].GetPattern(static_cast<SCROW>(nAtSrc)); else // rInner&:=nCol, rOuter&:=nRow pSrcPattern = aCol[nAtSrc].GetPattern(static_cast<SCROW>(nRow)); - bGetPattern = FALSE; + bGetPattern = false; pStyleSheet = pSrcPattern->GetStyleSheet(); // Merge/Mergeflag nicht uebernehmen, const SfxItemSet& rSet = pSrcPattern->GetItemSet(); - if ( rSet.GetItemState(ATTR_MERGE, FALSE) == SFX_ITEM_SET - || rSet.GetItemState(ATTR_MERGE_FLAG, FALSE) == SFX_ITEM_SET ) + if ( rSet.GetItemState(ATTR_MERGE, false) == SFX_ITEM_SET + || rSet.GetItemState(ATTR_MERGE_FLAG, false) == SFX_ITEM_SET ) { pNewPattern = new ScPatternAttr( *pSrcPattern ); SfxItemSet& rNewSet = pNewPattern->GetItemSet(); @@ -612,18 +612,18 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( nAtSrc != nISrcStart ) { // mehr als eine Source-Zelle nAtSrc = nISrcStart; - bGetPattern = TRUE; + bGetPattern = sal_True; } } else if (bPositive) { ++nAtSrc; - bGetPattern = TRUE; + bGetPattern = sal_True; } else { --nAtSrc; - bGetPattern = TRUE; + bGetPattern = sal_True; } if (rInner == nIEnd) break; @@ -637,9 +637,9 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, FillCmd eFillCmd; FillDateCmd eDateCmd; double nInc; - USHORT nMinDigits; + sal_uInt16 nMinDigits; ScUserListData* pListData = NULL; - USHORT nListIndex; + sal_uInt16 nListIndex; if (bVertical) FillAnalyse(static_cast<SCCOL>(nCol),nRow1, static_cast<SCCOL>(nCol),nRow2, eFillCmd,eDateCmd, @@ -654,12 +654,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (pListData) { - USHORT nListCount = pListData->GetSubCount(); + sal_uInt16 nListCount = pListData->GetSubCount(); if ( !bPositive ) { // nListIndex auf FillAnalyse zeigt auf den letzten Eintrag -> anpassen - ULONG nSub = nISrcStart - nISrcEnd; - for (ULONG i=0; i<nSub; i++) + sal_uLong nSub = nISrcStart - nISrcEnd; + for (sal_uLong i=0; i<nSub; i++) { if (nListIndex == 0) nListIndex = nListCount; --nListIndex; @@ -689,7 +689,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } else if (eFillCmd == FILL_SIMPLE) // Auffuellen mit Muster { - ULONG nSource = nISrcStart; + sal_uLong nSource = nISrcStart; double nDelta; if ( nScFillModeMouseModifier & KEY_MOD1 ) nDelta = 0.0; @@ -698,16 +698,16 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, else nDelta = -1.0; double nVal = 0.0; - ULONG nFormulaCounter = nActFormCnt; - BOOL bFirst = TRUE; - BOOL bGetCell = TRUE; - USHORT nCellDigits = 0; + sal_uLong nFormulaCounter = nActFormCnt; + sal_Bool bFirst = sal_True; + sal_Bool bGetCell = sal_True; + sal_uInt16 nCellDigits = 0; short nHeadNoneTail = 0; sal_Int32 nStringValue = 0; String aValue; ScBaseCell* pSrcCell = NULL; CellType eCellType = CELLTYPE_NONE; - BOOL bIsOrdinalSuffix = FALSE; + sal_Bool bIsOrdinalSuffix = false; rInner = nIStart; while (true) // #i53728# with "for (;;)" old solaris/x86 compiler mis-optimizes @@ -718,7 +718,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, pSrcCell = aCol[nCol].GetCell( static_cast<SCROW>(nSource) ); else // rInner&:=nCol, rOuter&:=nRow pSrcCell = aCol[nSource].GetCell( static_cast<SCROW>(nRow) ); - bGetCell = FALSE; + bGetCell = false; if ( pSrcCell ) { eCellType = pSrcCell->GetCellType(); @@ -817,7 +817,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if ( nSource != nISrcStart ) { // mehr als eine Source-Zelle nSource = nISrcStart; - bGetCell = TRUE; + bGetCell = sal_True; } if ( !(nScFillModeMouseModifier & KEY_MOD1) ) { @@ -827,17 +827,17 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nDelta -= 1.0; } nFormulaCounter = nActFormCnt; - bFirst = FALSE; + bFirst = false; } else if (bPositive) { ++nSource; - bGetCell = TRUE; + bGetCell = sal_True; } else { --nSource; - bGetCell = TRUE; + bGetCell = sal_True; } // Progress in der inneren Schleife nur bei teuren Zellen, @@ -860,12 +860,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (bVertical) FillSeries( static_cast<SCCOL>(nCol), nRow1, static_cast<SCCOL>(nCol), nRow2, nFillCount, eFillDir, - eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, FALSE, + eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, false, rProgress ); else FillSeries( nCol1, static_cast<SCROW>(nRow), nCol2, static_cast<SCROW>(nRow), nFillCount, eFillDir, - eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, FALSE, + eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, false, rProgress ); nProgress = rProgress.GetState(); } @@ -882,12 +882,12 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n SCROW nRow1 = rSource.aStart.Row(); SCCOL nCol2 = rSource.aEnd.Col(); SCROW nRow2 = rSource.aEnd.Row(); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; long nIndex = 0; - ULONG nSrcCount = 0; + sal_uLong nSrcCount = 0; FillDir eFillDir = FILL_TO_BOTTOM; if ( nEndX == nCol2 && nEndY == nRow2 ) // leer - bOk = FALSE; + bOk = false; else if ( nEndX == nCol2 ) // nach oben/unten { nEndX = nCol2 = nCol1; // nur erste Spalte ansehen @@ -909,29 +909,29 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n eFillDir = FILL_TO_LEFT; } else // Richtung nicht eindeutig - bOk = FALSE; + bOk = false; if ( bOk ) { FillCmd eFillCmd; FillDateCmd eDateCmd; double nInc; - USHORT nMinDigits; + sal_uInt16 nMinDigits; ScUserListData* pListData = NULL; - USHORT nListIndex; + sal_uInt16 nListIndex; FillAnalyse(nCol1,nRow1, nCol2,nRow2, eFillCmd,eDateCmd, nInc,nMinDigits, pListData,nListIndex); if ( pListData ) // benutzerdefinierte Liste { - USHORT nListCount = pListData->GetSubCount(); + sal_uInt16 nListCount = pListData->GetSubCount(); if ( nListCount ) { - ULONG nSub = nSrcCount - 1; // nListIndex ist vom letzten Source-Eintrag + sal_uLong nSub = nSrcCount - 1; // nListIndex ist vom letzten Source-Eintrag while ( nIndex < sal::static_int_cast<long>(nSub) ) nIndex += nListCount; - ULONG nPos = ( nListIndex + nIndex - nSub ) % nListCount; - aValue = pListData->GetSubStr(sal::static_int_cast<USHORT>(nPos)); + sal_uLong nPos = ( nListIndex + nIndex - nSub ) % nListCount; + aValue = pListData->GetSubStr(sal::static_int_cast<sal_uInt16>(nPos)); } } else if ( eFillCmd == FILL_SIMPLE ) // Auffuellen mit Muster @@ -939,7 +939,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n long nPosIndex = nIndex; while ( nPosIndex < 0 ) nPosIndex += nSrcCount; - ULONG nPos = nPosIndex % nSrcCount; + sal_uLong nPos = nPosIndex % nSrcCount; SCCOL nSrcX = nCol1; SCROW nSrcY = nRow1; if ( eFillDir == FILL_TO_TOP || eFillDir == FILL_TO_BOTTOM ) @@ -969,7 +969,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n if ( !(nScFillModeMouseModifier & KEY_MOD1) ) { sal_Int32 nVal; - USHORT nCellDigits = 0; // look at each source cell individually + sal_uInt16 nCellDigits = 0; // look at each source cell individually short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits ); if ( nFlag < 0 ) { @@ -991,7 +991,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n nVal += (double) nDelta; Color* pColor; - ULONG nNumFmt = GetNumberFormat( nSrcX, nSrcY ); + sal_uLong nNumFmt = GetNumberFormat( nSrcX, nSrcY ); pDocument->GetFormatTable()-> GetOutputString( nVal, nNumFmt, aValue, &pColor ); } @@ -1006,7 +1006,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n } else if ( eFillCmd == FILL_LINEAR || eFillCmd == FILL_DATE ) // Werte { - BOOL bValueOk; + sal_Bool bValueOk; double nStart; sal_Int32 nVal = 0; short nHeadNoneTail = 0; @@ -1050,8 +1050,8 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n } else // Datum { - bValueOk = TRUE; - USHORT nDayOfMonth = 0; + bValueOk = sal_True; + sal_uInt16 nDayOfMonth = 0; if ( nIndex < 0 ) { nIndex = -nIndex; @@ -1079,7 +1079,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n { //! Zahlformat je nach Index holen? Color* pColor; - ULONG nNumFmt = GetNumberFormat( nCol1, nRow1 ); + sal_uLong nNumFmt = GetNumberFormat( nCol1, nRow1 ); pDocument->GetFormatTable()-> GetOutputString( nStart, nNumFmt, aValue, &pColor ); } @@ -1094,7 +1094,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n return aValue; } -void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateCmd eCmd) +void ScTable::IncDate(double& rVal, sal_uInt16& nDayOfMonth, double nStep, FillDateCmd eCmd) { if (eCmd == FILL_DAY) { @@ -1103,8 +1103,8 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC } // class Date Grenzen - const USHORT nMinYear = 1583; - const USHORT nMaxYear = 9956; + const sal_uInt16 nMinYear = 1583; + const sal_uInt16 nMaxYear = 9956; long nInc = (long) nStep; // nach oben/unten begrenzen ? Date aNullDate = *pDocument->GetFormatTable()->GetNullDate(); @@ -1166,8 +1166,8 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC aDate = Date( 31,12, nMaxYear ); else { - aDate.SetMonth((USHORT) nMonth); - aDate.SetYear((USHORT) nYear); + aDate.SetMonth((sal_uInt16) nMonth); + aDate.SetYear((sal_uInt16) nYear); if ( nDayOfMonth > 28 ) aDate.SetDay( Min( aDate.GetDaysInMonth(), nDayOfMonth ) ); } @@ -1182,7 +1182,7 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC else if ( nYear > nMaxYear ) aDate = Date( 31,12, nMaxYear ); else - aDate.SetYear((USHORT) nYear); + aDate.SetYear((sal_uInt16) nYear); } break; default: @@ -1195,26 +1195,26 @@ void ScTable::IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateC } void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, - double nStepValue, double nMaxValue, USHORT nArgMinDigits, - BOOL bAttribs, ScProgress& rProgress ) + sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, + double nStepValue, double nMaxValue, sal_uInt16 nArgMinDigits, + sal_Bool bAttribs, ScProgress& rProgress ) { // // Richtung auswerten // - BOOL bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); - BOOL bPositive = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_RIGHT); + sal_Bool bVertical = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP); + sal_Bool bPositive = (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_RIGHT); - ULONG nCol = 0; - ULONG nRow = 0; - ULONG& rInner = bVertical ? nRow : nCol; // Schleifenvariablen - ULONG& rOuter = bVertical ? nCol : nRow; - ULONG nOStart; - ULONG nOEnd; - ULONG nIStart; - ULONG nIEnd; - ULONG nISource; + sal_uLong nCol = 0; + sal_uLong nRow = 0; + sal_uLong& rInner = bVertical ? nRow : nCol; // Schleifenvariablen + sal_uLong& rOuter = bVertical ? nCol : nRow; + sal_uLong nOStart; + sal_uLong nOEnd; + sal_uLong nIStart; + sal_uLong nIEnd; + sal_uLong nISource; if (bVertical) { @@ -1257,25 +1257,25 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } - ULONG nIMin = nIStart; - ULONG nIMax = nIEnd; + sal_uLong nIMin = nIStart; + sal_uLong nIMax = nIEnd; PutInOrder(nIMin,nIMax); - USHORT nDel = bAttribs ? IDF_AUTOFILL : (IDF_AUTOFILL & IDF_CONTENTS); + sal_uInt16 nDel = bAttribs ? IDF_AUTOFILL : (IDF_AUTOFILL & IDF_CONTENTS); if (bVertical) DeleteArea(nCol1, static_cast<SCROW>(nIMin), nCol2, static_cast<SCROW>(nIMax), nDel); else DeleteArea(static_cast<SCCOL>(nIMin), nRow1, static_cast<SCCOL>(nIMax), nRow2, nDel); - ULONG nProgress = rProgress.GetState(); + sal_uLong nProgress = rProgress.GetState(); // // ausfuehren // - ULONG nActFormCnt = 0; + sal_uLong nActFormCnt = 0; for (rOuter = nOStart; rOuter <= nOEnd; rOuter++) { - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; rInner = nISource; ScBaseCell* pSrcCell = aCol[nCol].GetCell(static_cast<SCROW>(nRow)); @@ -1287,10 +1287,10 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScPatternAttr* pSrcPattern = aCol[nCol].GetPattern(static_cast<SCROW>(nRow)); if (bVertical) aCol[nCol].SetPatternArea( static_cast<SCROW>(nIMin), - static_cast<SCROW>(nIMax), *pSrcPattern, TRUE ); + static_cast<SCROW>(nIMax), *pSrcPattern, sal_True ); else for (SCCOL nAtCol = static_cast<SCCOL>(nIMin); nAtCol <= sal::static_int_cast<SCCOL>(nIMax); nAtCol++) - aCol[nAtCol].SetPattern(static_cast<SCROW>(nRow), *pSrcPattern, TRUE); + aCol[nAtCol].SetPattern(static_cast<SCROW>(nRow), *pSrcPattern, sal_True); } if (pSrcCell) @@ -1305,10 +1305,10 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { if (pDocument->RowFiltered( rInner, nTab)) continue; - ULONG nInd = nActFormCnt; + sal_uLong nInd = nActFormCnt; FillFormula(nInd, bFirst, (ScFormulaCell*)pSrcCell, static_cast<SCCOL>(nCol), nRow, (rInner == nIEnd) ); - bFirst = FALSE; + bFirst = false; rProgress.SetStateOnPercent( ++nProgress ); } } @@ -1335,10 +1335,10 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, double nVal = nStartVal; long nIndex = 0; - BOOL bError = FALSE; - BOOL bOverflow = FALSE; + sal_Bool bError = false; + sal_Bool bOverflow = false; - USHORT nDayOfMonth = 0; + sal_uInt16 nDayOfMonth = 0; rInner = nIStart; while (true) // #i53728# with "for (;;)" old solaris/x86 compiler mis-optimizes { @@ -1354,16 +1354,16 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, double nAdd = nStepValue; if ( !SubTotal::SafeMult( nAdd, (double) ++nIndex ) || !SubTotal::SafePlus( nVal, nAdd ) ) - bError = TRUE; + bError = sal_True; } break; case FILL_GROWTH: if (!SubTotal::SafeMult(nVal, nStepValue)) - bError = TRUE; + bError = sal_True; break; case FILL_DATE: if (fabs(nVal) > _D_MAX_LONG_) - bError = TRUE; + bError = sal_True; else IncDate(nVal, nDayOfMonth, nStepValue, eFillDateCmd); break; @@ -1378,7 +1378,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nVal > nMaxValue) // Zielwert erreicht? { nVal = nMaxValue; - bOverflow = TRUE; + bOverflow = sal_True; } } else @@ -1386,7 +1386,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nVal < nMaxValue) { nVal = nMaxValue; - bOverflow = TRUE; + bOverflow = sal_True; } } } @@ -1420,17 +1420,17 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, else ((ScEditCell*)pSrcCell)->GetString( aValue ); sal_Int32 nStringValue; - USHORT nMinDigits = nArgMinDigits; + sal_uInt16 nMinDigits = nArgMinDigits; short nHeadNoneTail = lcl_DecompValueString( aValue, nStringValue, &nMinDigits ); if ( nHeadNoneTail ) { double nStartVal = (double)nStringValue; double nVal = nStartVal; long nIndex = 0; - BOOL bError = FALSE; - BOOL bOverflow = FALSE; + sal_Bool bError = false; + sal_Bool bOverflow = false; - BOOL bIsOrdinalSuffix = aValue.Equals( ScGlobal::GetOrdinalSuffix( + sal_Bool bIsOrdinalSuffix = aValue.Equals( ScGlobal::GetOrdinalSuffix( (sal_Int32)nStartVal)); rInner = nIStart; @@ -1448,12 +1448,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, double nAdd = nStepValue; if ( !SubTotal::SafeMult( nAdd, (double) ++nIndex ) || !SubTotal::SafePlus( nVal, nAdd ) ) - bError = TRUE; + bError = sal_True; } break; case FILL_GROWTH: if (!SubTotal::SafeMult(nVal, nStepValue)) - bError = TRUE; + bError = sal_True; break; default: { @@ -1466,7 +1466,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nVal > nMaxValue) // Zielwert erreicht? { nVal = nMaxValue; - bOverflow = TRUE; + bOverflow = sal_True; } } else @@ -1474,7 +1474,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (nVal < nMaxValue) { nVal = nMaxValue; - bOverflow = TRUE; + bOverflow = sal_True; } } } @@ -1519,10 +1519,10 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, + sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue) { - ULONG nProgCount; + sal_uLong nProgCount; if (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP) nProgCount = nCol2 - nCol1 + 1; else @@ -1531,13 +1531,13 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScProgress aProgress( pDocument->GetDocumentShell(), ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount ); - bSharedNameInserted = FALSE; + bSharedNameInserted = false; if (eFillCmd == FILL_AUTO) FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, aProgress); else FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, - eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0, TRUE, aProgress); + eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0, sal_True, aProgress); if (bSharedNameInserted) // Wurde Shared-Name eingefuegt? pDocument->GetRangeName()->SetSharedMaxIndex( @@ -1546,7 +1546,7 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, void ScTable::AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - const ScPatternAttr& rAttr, USHORT nFormatNo) + const ScPatternAttr& rAttr, sal_uInt16 nFormatNo) { ScAutoFormat* pAutoFormat = ScGlobal::GetAutoFormat(); if (pAutoFormat) @@ -1560,7 +1560,7 @@ void ScTable::AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC } void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - USHORT nFormatNo ) + sal_uInt16 nFormatNo ) { if (ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow)) { @@ -1579,7 +1579,7 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW SCCOL nCol = nStartCol; SCROW nRow = nStartRow; - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; // Linke obere Ecke AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo); // Linke Spalte @@ -1701,9 +1701,9 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW } // if ValidColRow } -void ScTable::GetAutoFormatAttr(SCCOL nCol, SCROW nRow, USHORT nIndex, ScAutoFormatData& rData) +void ScTable::GetAutoFormatAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nIndex, ScAutoFormatData& rData) { - UINT32 nFormatIndex = GetNumberFormat( nCol, nRow ); + sal_uInt32 nFormatIndex = GetNumberFormat( nCol, nRow ); ScNumFormatAbbrev aNumFormat( nFormatIndex, *pDocument->GetFormatTable() ); rData.GetFromItemSet( nIndex, GetPattern( nCol, nRow )->GetItemSet(), aNumFormat ); } @@ -1714,7 +1714,7 @@ void ScTable::GetAutoFormatAttr(SCCOL nCol, SCROW nRow, USHORT nIndex, ScAutoFor #define LF_BOTTOM 8 #define LF_ALL (LF_LEFT | LF_TOP | LF_RIGHT | LF_BOTTOM) -void ScTable::GetAutoFormatFrame(SCCOL nCol, SCROW nRow, USHORT nFlags, USHORT nIndex, ScAutoFormatData& rData) +void ScTable::GetAutoFormatFrame(SCCOL nCol, SCROW nRow, sal_uInt16 nFlags, sal_uInt16 nIndex, ScAutoFormatData& rData) { const SvxBoxItem* pTheBox = (SvxBoxItem*)GetAttr(nCol, nRow, ATTR_BORDER); const SvxBoxItem* pLeftBox = (SvxBoxItem*)GetAttr(nCol - 1, nRow, ATTR_BORDER); @@ -1846,7 +1846,7 @@ void ScTable::GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, } } -void ScTable::SetError( SCCOL nCol, SCROW nRow, USHORT nError) +void ScTable::SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError) { if (ValidColRow(nCol, nRow)) aCol[nCol].SetError( nRow, nError ); @@ -1858,7 +1858,7 @@ void ScTable::UpdateInsertTabAbs(SCTAB nTable) aCol[i].UpdateInsertTabAbs(nTable); } -BOOL ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel, +sal_Bool ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, sal_Bool bInSel, const ScMarkData& rMark) const { if (rRow == MAXROW+2) // Tabellenende @@ -1876,17 +1876,17 @@ BOOL ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel, } } if (rCol == MAXCOL+1) - return TRUE; + return sal_True; else { - BOOL bStop = FALSE; + sal_Bool bStop = false; while (!bStop) { if (ValidCol(rCol)) { bStop = aCol[rCol].GetNextSpellingCell(rRow, bInSel, rMark); if (bStop) - return TRUE; + return sal_True; else /*if (rRow == MAXROW+1) */ { rCol++; @@ -1894,10 +1894,10 @@ BOOL ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel, } } else - return TRUE; + return sal_True; } } - return FALSE; + return false; } void ScTable::RemoveAutoSpellObj() @@ -1906,12 +1906,12 @@ void ScTable::RemoveAutoSpellObj() aCol[i].RemoveAutoSpellObj(); } -BOOL ScTable::TestTabRefAbs(SCTAB nTable) +sal_Bool ScTable::TestTabRefAbs(SCTAB nTable) { - BOOL bRet = FALSE; + sal_Bool bRet = false; for (SCCOL i=0; i <= MAXCOL; i++) if (aCol[i].TestTabRefAbs(nTable)) - bRet = TRUE; + bRet = sal_True; return bRet; } @@ -1920,12 +1920,12 @@ void ScTable::CompileDBFormula() for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].CompileDBFormula(); } -void ScTable::CompileDBFormula( BOOL bCreateFormulaString ) +void ScTable::CompileDBFormula( sal_Bool bCreateFormulaString ) { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].CompileDBFormula( bCreateFormulaString ); } -void ScTable::CompileNameFormula( BOOL bCreateFormulaString ) +void ScTable::CompileNameFormula( sal_Bool bCreateFormulaString ) { for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].CompileNameFormula( bCreateFormulaString ); } diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 24165dbe39b7..d11e38cd2472 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -107,7 +107,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) } else { - USHORT nAreaCount = GetPrintRangeCount(); + sal_uInt16 nAreaCount = GetPrintRangeCount(); if ( nAreaCount > 1 ) { // bei mehreren Bereichen nichts anzeigen: @@ -138,13 +138,13 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) bool bSkipRowBreaks = false; bool bSkipBreaks = false; - if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, FALSE, &pItem ) == SFX_ITEM_SET ) + if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, false, &pItem ) == SFX_ITEM_SET ) { DBG_ASSERT( pItem->ISA(SfxUInt16Item), "falsches Item" ); bSkipColBreaks = bSkipRowBreaks = ( ((const SfxUInt16Item*)pItem)->GetValue() > 0 ); } - if ( !bSkipColBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, FALSE, &pItem) == SFX_ITEM_SET ) + if ( !bSkipColBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET ) { // #i54993# when fitting to width or height, ignore only manual breaks in that direction const ScPageScaleToItem* pScaleToItem = static_cast<const ScPageScaleToItem*>(pItem); @@ -181,24 +181,24 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) // Mittelteil: Breaks verteilen - BOOL bRepeatCol = ( nRepeatStartX != SCCOL_REPEAT_NONE ); - BOOL bColFound = FALSE; + sal_Bool bRepeatCol = ( nRepeatStartX != SCCOL_REPEAT_NONE ); + sal_Bool bColFound = false; long nSizeX = 0; for (nX=nStartCol; nX<=nEndCol; nX++) { - BOOL bStartOfPage = FALSE; + sal_Bool bStartOfPage = false; long nThisX = ColHidden(nX) ? 0 : pColWidth[nX]; bool bManualBreak = HasColManualBreak(nX); if ( (nSizeX+nThisX > nPageSizeX) || (bManualBreak && !bSkipColBreaks) ) { SetColBreak(nX, true, false); nSizeX = 0; - bStartOfPage = TRUE; + bStartOfPage = sal_True; } else if (nX != nStartCol) RemoveColBreak(nX, true, false); else - bStartOfPage = TRUE; + bStartOfPage = sal_True; if ( bStartOfPage && bRepeatCol && nX>nRepeatStartX && !bColFound ) { @@ -207,7 +207,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) nPageSizeX -= ColHidden(i) ? 0 : pColWidth[i]; while (nX<=nRepeatEndX) RemoveColBreak(++nX, true, false); - bColFound = TRUE; + bColFound = sal_True; } nSizeX += nThisX; @@ -217,15 +217,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) RemoveRowPageBreaks(nStartRow+1, nEndRow); // And set new page breaks. - BOOL bRepeatRow = ( nRepeatStartY != SCROW_REPEAT_NONE ); - BOOL bRowFound = FALSE; + sal_Bool bRepeatRow = ( nRepeatStartY != SCROW_REPEAT_NONE ); + sal_Bool bRowFound = false; long nSizeY = 0; ScFlatBoolRowSegments::ForwardIterator aIterHidden(*mpHiddenRows); ScFlatUInt16RowSegments::ForwardIterator aIterHeights(*mpRowHeights); SCROW nNextManualBreak = GetNextManualBreak(nStartRow); // -1 => no more manual breaks for (SCROW nY = nStartRow; nY <= nEndRow; ++nY) { - BOOL bStartOfPage = FALSE; + sal_Bool bStartOfPage = false; bool bThisRowHidden = false; aIterHidden.getValue(nY, bThisRowHidden); long nThisY = 0; @@ -249,12 +249,12 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) { SetRowBreak(nY, true, false); nSizeY = 0; - bStartOfPage = TRUE; + bStartOfPage = sal_True; } else if (nY != nStartRow) ; // page break already removed else - bStartOfPage = TRUE; + bStartOfPage = sal_True; if ( bStartOfPage && bRepeatRow && nY>nRepeatStartY && !bRowFound ) { @@ -267,7 +267,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) nPageSizeY -= nHeights; if (nY <= nRepeatEndY) RemoveRowPageBreaks(nY, nRepeatEndY); - bRowFound = TRUE; + bRowFound = sal_True; } if (bThisRowHidden) @@ -329,10 +329,10 @@ void ScTable::RemoveManualBreaks() InvalidatePageBreaks(); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } -BOOL ScTable::HasManualBreaks() const +sal_Bool ScTable::HasManualBreaks() const { return !maRowManualBreaks.empty() || !maColManualBreaks.empty(); } @@ -342,7 +342,7 @@ void ScTable::SetRowManualBreaks( const ::std::set<SCROW>& rBreaks ) maRowManualBreaks = rBreaks; InvalidatePageBreaks(); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::SetColManualBreaks( const ::std::set<SCCOL>& rBreaks ) @@ -350,7 +350,7 @@ void ScTable::SetColManualBreaks( const ::std::set<SCCOL>& rBreaks ) maColManualBreaks = rBreaks; InvalidatePageBreaks(); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } void ScTable::GetAllRowBreaks(set<SCROW>& rBreaks, bool bPage, bool bManual) const @@ -964,13 +964,13 @@ SCROW ScTable::CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow) const namespace { void lcl_syncFlags(ScFlatBoolColSegments& rColSegments, ScFlatBoolRowSegments& rRowSegments, - BYTE* pColFlags, ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, const BYTE nFlagMask) + sal_uInt8* pColFlags, ScBitMaskCompressedArray< SCROW, sal_uInt8>* pRowFlags, const sal_uInt8 nFlagMask) { using ::sal::static_int_cast; - pRowFlags->AndValue(0, MAXROW, static_int_cast<BYTE>(~nFlagMask)); + pRowFlags->AndValue(0, MAXROW, static_int_cast<sal_uInt8>(~nFlagMask)); for (SCCOL i = 0; i <= MAXCOL; ++i) - pColFlags[i] &= static_int_cast<BYTE>(~nFlagMask); + pColFlags[i] &= static_int_cast<sal_uInt8>(~nFlagMask); { // row hidden flags. @@ -983,7 +983,7 @@ void lcl_syncFlags(ScFlatBoolColSegments& rColSegments, ScFlatBoolRowSegments& r break; if (aData.mbValue) - pRowFlags->OrValue(nRow, aData.mnRow2, static_int_cast<BYTE>(nFlagMask)); + pRowFlags->OrValue(nRow, aData.mnRow2, static_int_cast<sal_uInt8>(nFlagMask)); nRow = aData.mnRow2 + 1; } @@ -1017,15 +1017,15 @@ void ScTable::SyncColRowFlags() using ::sal::static_int_cast; // Manual breaks. - pRowFlags->AndValue(0, MAXROW, static_int_cast<BYTE>(~CR_MANUALBREAK)); + pRowFlags->AndValue(0, MAXROW, static_int_cast<sal_uInt8>(~CR_MANUALBREAK)); for (SCCOL i = 0; i <= MAXCOL; ++i) - pColFlags[i] &= static_int_cast<BYTE>(~CR_MANUALBREAK); + pColFlags[i] &= static_int_cast<sal_uInt8>(~CR_MANUALBREAK); if (!maRowManualBreaks.empty()) { for (set<SCROW>::const_iterator itr = maRowManualBreaks.begin(), itrEnd = maRowManualBreaks.end(); itr != itrEnd; ++itr) - pRowFlags->OrValue(*itr, static_int_cast<BYTE>(CR_MANUALBREAK)); + pRowFlags->OrValue(*itr, static_int_cast<sal_uInt8>(CR_MANUALBREAK)); } if (!maColManualBreaks.empty()) @@ -1047,14 +1047,14 @@ void ScTable::SetPageSize( const Size& rSize ) if (aPageSizeTwips != rSize) InvalidatePageBreaks(); - bPageSizeValid = TRUE; + bPageSizeValid = sal_True; aPageSizeTwips = rSize; } else - bPageSizeValid = FALSE; + bPageSizeValid = false; } -BOOL ScTable::IsProtected() const +sal_Bool ScTable::IsProtected() const { return pTabProtection.get() && pTabProtection->isProtected(); } @@ -1067,7 +1067,7 @@ void ScTable::SetProtection(const ScTableProtection* pProtect) pTabProtection.reset(NULL); if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } ScTableProtection* ScTable::GetProtection() @@ -1123,20 +1123,20 @@ void ScTable::SetPageStyle( const String& rName ) { SfxItemSet& rOldSet = pOldStyle->GetItemSet(); SfxItemSet& rNewSet = pNewStyle->GetItemSet(); - const USHORT nOldScale = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALE); - const USHORT nOldScaleToPages = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALETOPAGES); - const USHORT nNewScale = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALE); - const USHORT nNewScaleToPages = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALETOPAGES); + const sal_uInt16 nOldScale = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALE); + const sal_uInt16 nOldScaleToPages = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALETOPAGES); + const sal_uInt16 nNewScale = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALE); + const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALETOPAGES); if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) ) - InvalidateTextWidth(NULL, NULL, FALSE, FALSE); + InvalidateTextWidth(NULL, NULL, false, false); } if ( pNewStyle ) // auch ohne den alten (fuer UpdateStdNames) aPageStyle = aStrNew; if (IsStreamValid()) - SetStreamValid(FALSE); + SetStreamValid(false); } } } @@ -1144,11 +1144,11 @@ void ScTable::SetPageStyle( const String& rName ) void ScTable::PageStyleModified( const String& rNewName ) { aPageStyle = rNewName; - InvalidateTextWidth(NULL, NULL, FALSE, FALSE); // don't know what was in the style before + InvalidateTextWidth(NULL, NULL, false, false); // don't know what was in the style before } void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, - BOOL bNumFormatChanged, BOOL bBroadcast ) + sal_Bool bNumFormatChanged, sal_Bool bBroadcast ) { if ( pAdrFrom && !pAdrTo ) { diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 853bae233afc..20ad1ca1b007 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -52,9 +52,9 @@ using ::com::sun::star::util::SearchOptions; -BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal ) +sal_Bool lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal ) { - // TRUE = more than 1 paragraph + // sal_True = more than 1 paragraph const EditTextObject* pData = NULL; rCell.GetData( pData ); @@ -64,12 +64,12 @@ BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& r return ( rEngine.GetParagraphCount() > 1 ); } -BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow, +sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow, const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bFound = FALSE; - BOOL bDoSearch = TRUE; - BOOL bDoBack = rSearchItem.GetBackward(); + sal_Bool bFound = false; + sal_Bool bDoSearch = sal_True; + sal_Bool bDoBack = rSearchItem.GetBackward(); String aString; ScBaseCell* pCell; @@ -77,7 +77,7 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo bDoSearch = rMark.IsCellMarked(nCol, nRow); if ( bDoSearch && ((pCell = aCol[nCol].GetCell( nRow )) != NULL) ) { - BOOL bMultiLine = FALSE; + sal_Bool bMultiLine = false; CellType eCellType = pCell->GetCellType(); switch (rSearchItem.GetCellType()) { @@ -120,13 +120,13 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo if ( bDoBack ) { xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp; - bFound = (BOOL)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd, &aSearchResult)); + bFound = (sal_Bool)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd, &aSearchResult)); // change results to definition before 614: --nEnd; } else { - bFound = (BOOL)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd, &aSearchResult)); + bFound = (sal_Bool)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd, &aSearchResult)); // change results to definition before 614: --nEnd; } @@ -140,7 +140,7 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo return bFound; } - BYTE cMatrixFlag = MM_NONE; + sal_uInt8 cMatrixFlag = MM_NONE; if ( bFound && ( (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE) ||(rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) ) && @@ -159,13 +159,13 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo ScBaseCell* pUndoCell = pCell->CloneWithoutNote( *pUndoDoc ); pUndoDoc->PutCell( aAdr, pUndoCell); } - BOOL bRepeat = !rSearchItem.GetWordOnly(); + sal_Bool bRepeat = !rSearchItem.GetWordOnly(); do { // wenn der gefundene Text leer ist, nicht weitersuchen, // sonst wuerde man nie mehr aufhoeren (#35410#) if ( nEnd < nStart || nEnd == STRING_MAXLEN ) - bRepeat = FALSE; + bRepeat = false; String sReplStr = rSearchItem.GetReplaceString(); if (rSearchItem.GetRegExp()) @@ -197,17 +197,17 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo if (bRepeat) { if ( rSearchItem.GetCommand() != SVX_SEARCHCMD_REPLACE_ALL || nStart >= nEnd ) - bRepeat = FALSE; + bRepeat = false; else if (bDoBack) { xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp; - bRepeat = ((BOOL)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd))); + bRepeat = ((sal_Bool)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd))); // change results to definition before 614: --nEnd; } else { - bRepeat = ((BOOL)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd))); + bRepeat = ((sal_Bool)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd))); // change results to definition before 614: --nEnd; } @@ -285,11 +285,11 @@ void ScTable::SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bFo } } -BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, +sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bFound = FALSE; - BOOL bAll = (rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL) + sal_Bool bFound = false; + sal_Bool bAll = (rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL) ||(rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL); SCCOL nCol = rCol; SCROW nRow = rRow; @@ -315,14 +315,14 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); if (!bFound) { - BOOL bIsEmpty; + sal_Bool bIsEmpty; do { nCol--; if ((SCsCOL)nCol >= 0) bIsEmpty = aCol[nCol].IsEmptyData(); else - bIsEmpty = TRUE; + bIsEmpty = sal_True; } while (((SCsCOL)nCol >= 0) && bIsEmpty); } @@ -354,7 +354,7 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, if (!bFound) { // Not found in this column. Move to the next column. - BOOL bIsEmpty; + sal_Bool bIsEmpty; nRow = nLastRow; nLastNonFilteredRow = MAXROW + 1; do @@ -363,7 +363,7 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, if ((SCsCOL)nCol >= 0) bIsEmpty = aCol[nCol].IsEmptyData(); else - bIsEmpty = TRUE; + bIsEmpty = sal_True; } while (((SCsCOL)nCol >= 0) && bIsEmpty); } @@ -433,10 +433,10 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, return bFound; } -BOOL ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, +sal_Bool ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bFound = TRUE; + sal_Bool bFound = sal_True; SCCOL nCol = 0; SCROW nRow = -1; @@ -456,10 +456,10 @@ BOOL ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, return (aNewMark.IsMultiMarked()); } -BOOL ScTable::Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, +sal_Bool ScTable::Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nCol = rCol; SCROW nRow = rRow; if (rSearchItem.GetBackward()) @@ -485,14 +485,14 @@ BOOL ScTable::Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow return bFound; } -BOOL ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, +sal_Bool ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - BOOL bOldDouble = ScColumn::bDoubleAlloc; // sollte immer FALSE sein? + sal_Bool bOldDouble = ScColumn::bDoubleAlloc; // sollte immer sal_False sein? DBG_ASSERT(!bOldDouble,"bDoubleAlloc ???"); - ScColumn::bDoubleAlloc = TRUE; // fuer Undo-Doc + ScColumn::bDoubleAlloc = sal_True; // fuer Undo-Doc - BOOL bFound = TRUE; + sal_Bool bFound = sal_True; SCCOL nCol = 0; SCROW nRow = -1; @@ -514,7 +514,7 @@ BOOL ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark, return (aNewMark.IsMultiMarked()); } -BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, +sal_Bool ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark) { const ScStyleSheet* pSearchStyle = (const ScStyleSheet*) @@ -523,11 +523,11 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& SCsCOL nCol = rCol; SCsROW nRow = rRow; - BOOL bFound = FALSE; + sal_Bool bFound = false; - BOOL bSelect = rSearchItem.GetSelection(); - BOOL bRows = rSearchItem.GetRowDirection(); - BOOL bBack = rSearchItem.GetBackward(); + sal_Bool bSelect = rSearchItem.GetSelection(); + sal_Bool bRows = rSearchItem.GetRowDirection(); + sal_Bool bBack = rSearchItem.GetBackward(); short nAdd = bBack ? -1 : 1; if (bRows) // zeilenweise @@ -544,7 +544,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& else { nRow = nNextRow; - bFound = TRUE; + bFound = sal_True; } } while (!bFound && ValidCol(nCol)); @@ -568,7 +568,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& { nCol = i; nRow = nNextRows[i]; - bFound = TRUE; + bFound = sal_True; } } else // vorwaerts @@ -579,7 +579,7 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& { nCol = i; nRow = nNextRows[i]; - bFound = TRUE; + bFound = sal_True; } } } @@ -594,12 +594,12 @@ BOOL ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& //! einzelnes Pattern fuer Undo zurueckgeben -BOOL ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, - ScMarkData& rMark, BOOL bIsUndo) +sal_Bool ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + ScMarkData& rMark, sal_Bool bIsUndo) { - BOOL bRet; + sal_Bool bRet; if (bIsUndo) - bRet = TRUE; + bRet = sal_True; else bRet = SearchStyle(rSearchItem, rCol, rRow, rMark); if (bRet) @@ -619,19 +619,19 @@ BOOL ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& return bRet; } -BOOL ScTable::SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark) +sal_Bool ScTable::SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark) { const ScStyleSheet* pSearchStyle = (const ScStyleSheet*) pDocument->GetStyleSheetPool()->Find( rSearchItem.GetSearchString(), SFX_STYLE_FAMILY_PARA ); - BOOL bSelect = rSearchItem.GetSelection(); - BOOL bBack = rSearchItem.GetBackward(); + sal_Bool bSelect = rSearchItem.GetSelection(); + sal_Bool bBack = rSearchItem.GetBackward(); ScMarkData aNewMark( rMark ); // Tabellen-Markierungen kopieren aNewMark.ResetMark(); for (SCCOL i=0; i<=MAXCOL; i++) { - BOOL bFound = TRUE; + sal_Bool bFound = sal_True; SCsROW nRow = 0; SCsROW nEndRow; while (bFound && nRow <= MAXROW) @@ -657,10 +657,10 @@ BOOL ScTable::SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark return (aNewMark.IsMultiMarked()); } -BOOL ScTable::ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark, +sal_Bool ScTable::ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark, ScDocument* pUndoDoc) { - BOOL bRet = SearchAllStyle(rSearchItem, rMark); + sal_Bool bRet = SearchAllStyle(rSearchItem, rMark); if (bRet) { const ScStyleSheet* pReplaceStyle = (const ScStyleSheet*) @@ -671,7 +671,7 @@ BOOL ScTable::ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMar { if (pUndoDoc) pDocument->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, - IDF_ATTRIB, TRUE, pUndoDoc, &rMark ); + IDF_ATTRIB, sal_True, pUndoDoc, &rMark ); ApplySelectionStyle( *pReplaceStyle, rMark ); } else @@ -683,12 +683,12 @@ BOOL ScTable::ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMar return bRet; } -BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, +sal_Bool ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) { - USHORT nCommand = rSearchItem.GetCommand(); - BOOL bFound = FALSE; + sal_uInt16 nCommand = rSearchItem.GetCommand(); + sal_Bool bFound = false; if ( ValidColRow(rCol, rRow) || ((nCommand == SVX_SEARCHCMD_FIND || nCommand == SVX_SEARCHCMD_REPLACE) && (((rCol == MAXCOLCOUNT || rCol == -1) && VALIDROW(rRow)) || @@ -697,13 +697,13 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, ) ) { - BOOL bStyles = rSearchItem.GetPattern(); + sal_Bool bStyles = rSearchItem.GetPattern(); if (bStyles) { if (nCommand == SVX_SEARCHCMD_FIND) bFound = SearchStyle(rSearchItem, rCol, rRow, rMark); else if (nCommand == SVX_SEARCHCMD_REPLACE) - bFound = ReplaceStyle(rSearchItem, rCol, rRow, rMark, FALSE); + bFound = ReplaceStyle(rSearchItem, rCol, rRow, rMark, false); else if (nCommand == SVX_SEARCHCMD_FIND_ALL) bFound = SearchAllStyle(rSearchItem, rMark); else if (nCommand == SVX_SEARCHCMD_REPLACE_ALL) diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 75ad071ffcee..137759d674da 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -82,7 +82,7 @@ ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOpe eErrorStyle( SC_VALERR_STOP ), mnListType( ValidListType::UNSORTED ) { - bShowInput = bShowError = FALSE; + bShowInput = bShowError = false; } ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper, @@ -94,7 +94,7 @@ ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOpe eErrorStyle( SC_VALERR_STOP ), mnListType( ValidListType::UNSORTED ) { - bShowInput = bShowError = FALSE; + bShowInput = bShowError = false; } ScValidationData::ScValidationData( const ScValidationData& r ) : @@ -133,14 +133,14 @@ ScValidationData::~ScValidationData() { } -BOOL ScValidationData::IsEmpty() const +sal_Bool ScValidationData::IsEmpty() const { String aEmpty; ScValidationData aDefault( SC_VALID_ANY, SC_COND_EQUAL, aEmpty, aEmpty, GetDocument(), ScAddress() ); return EqualEntries( aDefault ); } -BOOL ScValidationData::EqualEntries( const ScValidationData& r ) const +sal_Bool ScValidationData::EqualEntries( const ScValidationData& r ) const { // gleiche Parameter eingestellt (ohne Key) @@ -158,17 +158,17 @@ BOOL ScValidationData::EqualEntries( const ScValidationData& r ) const void ScValidationData::ResetInput() { - bShowInput = FALSE; + bShowInput = false; } void ScValidationData::ResetError() { - bShowError = FALSE; + bShowError = false; } void ScValidationData::SetInput( const String& rTitle, const String& rMsg ) { - bShowInput = TRUE; + bShowInput = sal_True; aInputTitle = rTitle; aInputMessage = rMsg; } @@ -176,13 +176,13 @@ void ScValidationData::SetInput( const String& rTitle, const String& rMsg ) void ScValidationData::SetError( const String& rTitle, const String& rMsg, ScValidErrorStyle eStyle ) { - bShowError = TRUE; + bShowError = sal_True; eErrorStyle = eStyle; aErrorTitle = rTitle; aErrorMessage = rMsg; } -BOOL ScValidationData::GetErrMsg( String& rTitle, String& rMsg, +sal_Bool ScValidationData::GetErrMsg( String& rTitle, String& rMsg, ScValidErrorStyle& rStyle ) const { rTitle = aErrorTitle; @@ -191,15 +191,15 @@ BOOL ScValidationData::GetErrMsg( String& rTitle, String& rMsg, return bShowError; } -BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, +sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, ScFormulaCell* pCell, Window* pParent ) const { ScDocument* pDocument = GetDocument(); SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); if ( !pDocSh || !pDocument->CheckMacroWarn() ) - return FALSE; + return false; - BOOL bScriptReturnedFalse = FALSE; // Standard: kein Abbruch + sal_Bool bScriptReturnedFalse = false; // Standard: kein Abbruch // Set up parameters ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aParams(2); @@ -207,7 +207,7 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, // 1) eingegebener / berechneter Wert String aValStr = rInput; double nValue; - BOOL bIsValue = FALSE; + sal_Bool bIsValue = false; if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen { bIsValue = pCell->IsValue(); @@ -228,9 +228,9 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, // use link-update flag to prevent closing the document // while the macro is running - BOOL bWasInLinkUpdate = pDocument->IsInLinkUpdate(); + sal_Bool bWasInLinkUpdate = pDocument->IsInLinkUpdate(); if ( !bWasInLinkUpdate ) - pDocument->SetInLinkUpdate( TRUE ); + pDocument->SetInLinkUpdate( sal_True ); if ( pCell ) pDocument->LockTable( rPos.Tab() ); @@ -246,17 +246,17 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, pDocument->UnlockTable( rPos.Tab() ); if ( !bWasInLinkUpdate ) - pDocument->SetInLinkUpdate( FALSE ); + pDocument->SetInLinkUpdate( false ); // Check the return value from the script // The contents of the cell get reset if the script returns false - BOOL bTmp = FALSE; + sal_Bool bTmp = false; if ( eRet == ERRCODE_NONE && aRet.getValueType() == getCppuBooleanType() && sal_True == ( aRet >>= bTmp ) && - bTmp == FALSE ) + bTmp == false ) { - bScriptReturnedFalse = TRUE; + bScriptReturnedFalse = sal_True; } if ( eRet == ERRCODE_BASIC_METHOD_NOT_FOUND && !pCell ) @@ -272,9 +272,9 @@ BOOL ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, return bScriptReturnedFalse; } - // TRUE -> Abbruch + // sal_True -> Abbruch -BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, +sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, ScFormulaCell* pCell, Window* pParent ) const { if ( SfxApplication::IsXScriptURL( aErrorTitle ) ) @@ -285,12 +285,10 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, ScDocument* pDocument = GetDocument(); SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); if ( !pDocSh || !pDocument->CheckMacroWarn() ) - return FALSE; + return false; - BOOL bDone = FALSE; - BOOL bRet = FALSE; // Standard: kein Abbruch - SfxApplication* pSfxApp = SFX_APP(); - pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc. + sal_Bool bDone = false; + sal_Bool bRet = false; // Standard: kein Abbruch // Wenn das Dok waehrend eines Basic-Calls geladen wurde, // ist das Sbx-Objekt evtl. nicht angelegt (?) @@ -331,7 +329,7 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, // 1) eingegebener / berechneter Wert String aValStr = rInput; double nValue = 0.0; - BOOL bIsValue = FALSE; + sal_Bool bIsValue = false; if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen { bIsValue = pCell->IsValue(); @@ -352,26 +350,25 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, // use link-update flag to prevent closing the document // while the macro is running - BOOL bWasInLinkUpdate = pDocument->IsInLinkUpdate(); + sal_Bool bWasInLinkUpdate = pDocument->IsInLinkUpdate(); if ( !bWasInLinkUpdate ) - pDocument->SetInLinkUpdate( TRUE ); + pDocument->SetInLinkUpdate( sal_True ); if ( pCell ) pDocument->LockTable( rPos.Tab() ); SbxVariableRef refRes = new SbxVariable; - ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, NULL, refPar, refRes ); + ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar, refRes ); if ( pCell ) pDocument->UnlockTable( rPos.Tab() ); if ( !bWasInLinkUpdate ) - pDocument->SetInLinkUpdate( FALSE ); + pDocument->SetInLinkUpdate( false ); - // Eingabe abbrechen, wenn Basic-Makro FALSE zurueckgibt - if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == FALSE ) - bRet = TRUE; - bDone = TRUE; + // Eingabe abbrechen, wenn Basic-Makro sal_False zurueckgibt + if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == false ) + bRet = sal_True; + bDone = sal_True; } - pSfxApp->LeaveBasicCall(); if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe) { @@ -391,9 +388,9 @@ void ScValidationData::DoCalcError( ScFormulaCell* pCell ) const DoMacro( pCell->aPos, EMPTY_STRING, pCell, NULL ); } - // TRUE -> Abbruch + // sal_True -> Abbruch -BOOL ScValidationData::DoError( Window* pParent, const String& rInput, +sal_Bool ScValidationData::DoError( Window* pParent, const String& rInput, const ScAddress& rPos ) const { if ( eErrorStyle == SC_VALERR_MACRO ) @@ -430,20 +427,20 @@ BOOL ScValidationData::DoError( Window* pParent, const String& rInput, } MessBox aBox( pParent, WinBits(nStyle), aTitle, aMessage ); - USHORT nRet = aBox.Execute(); + sal_uInt16 nRet = aBox.Execute(); return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL ); } -BOOL ScValidationData::IsDataValid( const String& rTest, const ScPatternAttr& rPattern, +sal_Bool ScValidationData::IsDataValid( const String& rTest, const ScPatternAttr& rPattern, const ScAddress& rPos ) const { if ( eDataMode == SC_VALID_ANY ) - return TRUE; // alles erlaubt + return sal_True; // alles erlaubt if ( rTest.GetChar(0) == '=' ) - return FALSE; // Formeln sind sonst immer ungueltig + return false; // Formeln sind sonst immer ungueltig if ( !rTest.Len() ) return IsIgnoreBlank(); // leer: wie eingestellt @@ -455,27 +452,27 @@ BOOL ScValidationData::IsDataValid( const String& rTest, const ScPatternAttr& rP sal_uInt32 nFormat = rPattern.GetNumberFormat( pFormatter ); double nVal; - BOOL bIsVal = pFormatter->IsNumberFormat( rTest, nFormat, nVal ); + sal_Bool bIsVal = pFormatter->IsNumberFormat( rTest, nFormat, nVal ); ScBaseCell* pCell; if (bIsVal) pCell = new ScValueCell( nVal ); else pCell = new ScStringCell( rTest ); - BOOL bRet = IsDataValid( pCell, rPos ); + sal_Bool bRet = IsDataValid( pCell, rPos ); pCell->Delete(); return bRet; } -BOOL ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) const +sal_Bool ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) const { if( eDataMode == SC_VALID_LIST ) return IsListValid( pCell, rPos ); double nVal = 0.0; String aString; - BOOL bIsVal = TRUE; + sal_Bool bIsVal = sal_True; switch (pCell->GetCellType()) { @@ -484,11 +481,11 @@ BOOL ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) c break; case CELLTYPE_STRING: ((ScStringCell*)pCell)->GetString( aString ); - bIsVal = FALSE; + bIsVal = false; break; case CELLTYPE_EDIT: ((ScEditCell*)pCell)->GetString( aString ); - bIsVal = FALSE; + bIsVal = false; break; case CELLTYPE_FORMULA: { @@ -504,7 +501,7 @@ BOOL ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) c return IsIgnoreBlank(); // wie eingestellt } - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; switch (eDataMode) { // SC_VALID_ANY schon oben @@ -597,7 +594,7 @@ const String* ScStringTokenIterator::Next() // ---------------------------------------------------------------------------- /** Returns the number format of the passed cell, or the standard format. */ -ULONG lclGetCellFormat( ScDocument& rDoc, const ScAddress& rPos ) +sal_uLong lclGetCellFormat( ScDocument& rDoc, const ScAddress& rPos ) { const ScPatternAttr* pPattern = rDoc.GetPattern( rPos.Col(), rPos.Row(), rPos.Tab() ); if( !pPattern ) @@ -652,7 +649,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, // Use an interim matrix to create the TypedStrData below. xMatRef = new ScMatrix(1,1); - USHORT nErrCode = aValidationSrc.GetErrCode(); + sal_uInt16 nErrCode = aValidationSrc.GetErrCode(); if (nErrCode) { /* TODO : to use later in an alert box? @@ -684,7 +681,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, SCSIZE nCol, nRow, nCols, nRows, n = 0; pValues->GetDimensions( nCols, nRows ); - BOOL bRef = FALSE; + sal_Bool bRef = false; ScRange aRange; ScTokenArray* pArr = (ScTokenArray*) &rTokArr; @@ -697,7 +694,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, if( ScDBData* pDBData = pDocument->GetDBCollection()->FindIndex( t->GetIndex() ) ) { pDBData->GetArea(aRange); - bRef = TRUE; + bRef = sal_True; } } else if (t->GetOpCode() == ocName) @@ -705,7 +702,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, ScRangeData* pName = pDocument->GetRangeName()->findByIndex( t->GetIndex() ); if (pName && pName->IsReference(aRange)) { - bRef = TRUE; + bRef = sal_True; } } else if (t->GetType() != svIndex) @@ -713,7 +710,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, t->CalcAbsIfRel(rPos); if (pArr->IsValidReference(aRange)) { - bRef = TRUE; + bRef = sal_True; } } } @@ -746,7 +743,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, } else { - USHORT nErr = nMatVal.GetError(); + sal_uInt16 nErr = nMatVal.GetError(); if( 0 != nErr ) { @@ -809,7 +806,7 @@ bool ScValidationData::FillSelectionList( TypedScStrCollection& rStrColl, const // *** try if formula is a string list *** bool bSortList = (mnListType == ValidListType::SORTEDASCENDING); - UINT32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); + sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); ScStringTokenIterator aIt( *pTokArr ); for( const String* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() ) { @@ -861,7 +858,7 @@ bool ScValidationData::IsListValid( ScBaseCell* pCell, const ScAddress& rPos ) c // *** try if formula is a string list *** - UINT32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); + sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); ScStringTokenIterator aIt( *pTokArr ); for( const String* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() ) { @@ -905,9 +902,9 @@ ScValidationDataList::ScValidationDataList(const ScValidationDataList& rList) : { // fuer Ref-Undo - echte Kopie mit neuen Tokens! - USHORT nCount = rList.Count(); + sal_uInt16 nCount = rList.Count(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) InsertNew( rList[i]->Clone() ); //! sortierte Eintraege aus rList schneller einfuegen ??? @@ -918,9 +915,9 @@ ScValidationDataList::ScValidationDataList(ScDocument* pNewDoc, { // fuer neues Dokument - echte Kopie mit neuen Tokens! - USHORT nCount = rList.Count(); + sal_uInt16 nCount = rList.Count(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) InsertNew( rList[i]->Clone(pNewDoc) ); //! sortierte Eintraege aus rList schneller einfuegen ??? @@ -930,8 +927,8 @@ ScValidationData* ScValidationDataList::GetData( sal_uInt32 nKey ) { //! binaer suchen - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) if ((*this)[i]->GetKey() == nKey) return (*this)[i]; @@ -941,35 +938,35 @@ ScValidationData* ScValidationDataList::GetData( sal_uInt32 nKey ) void ScValidationDataList::CompileXML() { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->CompileXML(); } void ScValidationDataList::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz); } void ScValidationDataList::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) (*this)[i]->UpdateMoveTab( nOldPos, nNewPos ); } -BOOL ScValidationDataList::operator==( const ScValidationDataList& r ) const +sal_Bool ScValidationDataList::operator==( const ScValidationDataList& r ) const { // fuer Ref-Undo - interne Variablen werden nicht verglichen - USHORT nCount = Count(); - BOOL bEqual = ( nCount == r.Count() ); - for (USHORT i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert + sal_uInt16 nCount = Count(); + sal_Bool bEqual = ( nCount == r.Count() ); + for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ? - bEqual = FALSE; + bEqual = false; return bEqual; } diff --git a/sc/source/core/inc/addinhelpid.hxx b/sc/source/core/inc/addinhelpid.hxx index 6618c97b6dc9..94ccfb64fbb3 100644 --- a/sc/source/core/inc/addinhelpid.hxx +++ b/sc/source/core/inc/addinhelpid.hxx @@ -30,7 +30,7 @@ #define SC_ADDINHELPID_HXX #include <rtl/ustring.hxx> - +#include <rtl/string.hxx> // ============================================================================ @@ -51,7 +51,7 @@ public: void SetServiceName( const ::rtl::OUString& rServiceName ); /** @return The help ID of the function with given built-in name or 0 if not found. */ - sal_uInt16 GetHelpId( const ::rtl::OUString& rFuncName ) const; + rtl::OString GetHelpId( const ::rtl::OUString& rFuncName ) const; }; diff --git a/sc/source/core/inc/adiasync.hxx b/sc/source/core/inc/adiasync.hxx index 69896c08160a..061c5077137b 100644 --- a/sc/source/core/inc/adiasync.hxx +++ b/sc/source/core/inc/adiasync.hxx @@ -60,32 +60,32 @@ private: }; ScAddInDocs* pDocs; // Liste der benutzenden Dokumente FuncData* pFuncData; // Zeiger auf die Daten in der Collection - ULONG nHandle; // wird von double auf ULONG gecasted + sal_uLong nHandle; // wird von double auf sal_uLong gecasted ParamType eType; // PTR_DOUBLE oder PTR_STRING Ergebnis - BOOL bValid; // ob Wert gueltig + sal_Bool bValid; // ob Wert gueltig public: // cTor nur wenn ScAddInAsync::Get fehlschlaegt! // nIndex: Index aus der FunctionCollection - ScAddInAsync( ULONG nHandle, USHORT nIndex, + ScAddInAsync( sal_uLong nHandle, sal_uInt16 nIndex, ScDocument* pDoc ); // default-cTor nur fuer das eine globale aSeekObj !!! ScAddInAsync(); virtual ~ScAddInAsync(); - static ScAddInAsync* Get( ULONG nHandle ); - static void CallBack( ULONG nHandle, void* pData ); + static ScAddInAsync* Get( sal_uLong nHandle ); + static void CallBack( sal_uLong nHandle, void* pData ); static void RemoveDocument( ScDocument* pDocument ); - BOOL IsValid() const { return bValid; } + sal_Bool IsValid() const { return bValid; } ParamType GetType() const { return eType; } double GetValue() const { return nVal; } const String& GetString() const { return *pStr; } - BOOL HasDocument( ScDocument* pDoc ) const + sal_Bool HasDocument( ScDocument* pDoc ) const { return pDocs->Seek_Entry( pDoc ); } void AddDocument( ScDocument* pDoc ) { pDocs->Insert( pDoc ); } // Vergleichsoperatoren fuer PtrArrSort - BOOL operator < ( const ScAddInAsync& r ) { return nHandle < r.nHandle; } - BOOL operator ==( const ScAddInAsync& r ) { return nHandle == r.nHandle; } + sal_Bool operator < ( const ScAddInAsync& r ) { return nHandle < r.nHandle; } + sal_Bool operator ==( const ScAddInAsync& r ) { return nHandle == r.nHandle; } }; diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx index 6d857c10f2e9..642baa97262b 100644 --- a/sc/source/core/inc/bcaslot.hxx +++ b/sc/source/core/inc/bcaslot.hxx @@ -48,13 +48,13 @@ private: ScBroadcastArea* pUpdateChainNext; SvtBroadcaster aBroadcaster; ScRange aRange; - ULONG nRefCount; - BOOL bInUpdateChain; + sal_uLong nRefCount; + sal_Bool bInUpdateChain; public: ScBroadcastArea( const ScRange& rRange ) : pUpdateChainNext( NULL ), aRange( rRange ), - nRefCount( 0 ), bInUpdateChain( FALSE ) {} + nRefCount( 0 ), bInUpdateChain( false ) {} inline SvtBroadcaster& GetBroadcaster() { return aBroadcaster; } inline const SvtBroadcaster& GetBroadcaster() const { return aBroadcaster; } inline void UpdateRange( const ScRange& rNewRange ) @@ -63,12 +63,12 @@ public: inline const ScAddress& GetStart() const { return aRange.aStart; } inline const ScAddress& GetEnd() const { return aRange.aEnd; } inline void IncRef() { ++nRefCount; } - inline ULONG DecRef() { return nRefCount ? --nRefCount : 0; } - inline ULONG GetRef() { return nRefCount; } + inline sal_uLong DecRef() { return nRefCount ? --nRefCount : 0; } + inline sal_uLong GetRef() { return nRefCount; } inline ScBroadcastArea* GetUpdateChainNext() const { return pUpdateChainNext; } inline void SetUpdateChainNext( ScBroadcastArea* p ) { pUpdateChainNext = p; } - inline BOOL IsInUpdateChain() const { return bInUpdateChain; } - inline void SetInUpdateChain( BOOL b ) { bInUpdateChain = b; } + inline sal_Bool IsInUpdateChain() const { return bInUpdateChain; } + inline void SetInUpdateChain( sal_Bool b ) { bInUpdateChain = b; } /** Equalness of this or range. */ inline bool operator==( const ScBroadcastArea & rArea ) const; @@ -140,7 +140,7 @@ private: whether there would be an overflow when adding an area, setting the proper state if so. - @return TRUE if a HardRecalcState is effective and area is not to be + @return sal_True if a HardRecalcState is effective and area is not to be added. */ bool CheckHardRecalcStateCondition() const; @@ -166,7 +166,7 @@ public: as InsertListeningArea(), so use that instead. @return - TRUE if rpArea passed was NULL and ScBroadcastArea is newly + sal_True if rpArea passed was NULL and ScBroadcastArea is newly created. */ bool StartListeningArea( const ScRange& rRange, @@ -182,9 +182,9 @@ public: void EndListeningArea( const ScRange& rRange, SvtListener* pListener, ScBroadcastArea*& rpArea ); - BOOL AreaBroadcast( const ScHint& rHint ) const; - /// @return TRUE if at least one broadcast occurred. - BOOL AreaBroadcastInRange( const ScRange& rRange, + sal_Bool AreaBroadcast( const ScHint& rHint ) const; + /// @return sal_True if at least one broadcast occurred. + sal_Bool AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint ) const; void DelBroadcastAreasInRange( const ScRange& rRange ); void UpdateRemove( UpdateRefMode eUpdateRefMode, @@ -246,7 +246,7 @@ private: ScDocument *pDoc; ScBroadcastArea *pUpdateChain; ScBroadcastArea *pEOUpdateChain; - ULONG nInBulkBroadcast; + sal_uLong nInBulkBroadcast; inline SCSIZE ComputeSlotOffset( const ScAddress& rAddress ) const; void ComputeAreaPoints( const ScRange& rRange, @@ -260,9 +260,9 @@ public: SvtListener* pListener ); void EndListeningArea( const ScRange& rRange, SvtListener* pListener ); - BOOL AreaBroadcast( const ScHint& rHint ) const; + sal_Bool AreaBroadcast( const ScHint& rHint ) const; // return: at least one broadcast occurred - BOOL AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint ) const; + sal_Bool AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint ) const; void DelBroadcastAreasInRange( const ScRange& rRange ); void UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode, const ScRange& rRange, diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx index 5d22588fe1c9..2d906c5b1de8 100644 --- a/sc/source/core/inc/core_pch.hxx +++ b/sc/source/core/inc/core_pch.hxx @@ -120,7 +120,7 @@ #include <vcl/outdev.hxx> #include <vcl/pointr.hxx> #include <vcl/ptrstyle.hxx> -#include <vcl/wintypes.hxx> +#include <tools/wintypes.hxx> #include <vcl/event.hxx> #include <tools/ownlist.hxx> #include <svl/itempool.hxx> diff --git a/sc/source/core/inc/ddelink.hxx b/sc/source/core/inc/ddelink.hxx index b437f10c1d68..fd9317ce28f5 100644 --- a/sc/source/core/inc/ddelink.hxx +++ b/sc/source/core/inc/ddelink.hxx @@ -42,16 +42,16 @@ class SvStream; class ScDdeLink : public ::sfx2::SvBaseLink, public SvtBroadcaster { private: -static BOOL bIsInUpdate; +static sal_Bool bIsInUpdate; ScDocument* pDoc; String aAppl; // Verbindungsdaten String aTopic; String aItem; - BYTE nMode; // Zahlformat-Modus + sal_uInt8 nMode; // Zahlformat-Modus - BOOL bNeedUpdate; // wird gesetzt, wenn Update nicht moeglich war + sal_Bool bNeedUpdate; // wird gesetzt, wenn Update nicht moeglich war ScMatrixRef pResult; // Ergebnis @@ -60,7 +60,7 @@ public: ScDdeLink( ScDocument* pD, const String& rA, const String& rT, const String& rI, - BYTE nM ); + sal_uInt8 nM ); ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr ); ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ); virtual ~ScDdeLink(); @@ -85,14 +85,14 @@ public: const String& GetAppl() const { return aAppl; } const String& GetTopic() const { return aTopic; } const String& GetItem() const { return aItem; } - BYTE GetMode() const { return nMode; } + sal_uInt8 GetMode() const { return nMode; } void ResetValue(); // Wert zuruecksetzen void TryUpdate(); - BOOL NeedsUpdate() const { return bNeedUpdate; } + sal_Bool NeedsUpdate() const { return bNeedUpdate; } - static BOOL IsInUpdate() { return bIsInUpdate; } + static sal_Bool IsInUpdate() { return bIsInUpdate; } }; diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index aa366298a51f..ce59c16ffa20 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -55,14 +55,14 @@ struct ScCompare { double nVal[2]; String* pVal[2]; - BOOL bVal[2]; - BOOL bEmpty[2]; + sal_Bool bVal[2]; + sal_Bool bEmpty[2]; ScCompare( String* p1, String* p2 ) { pVal[ 0 ] = p1; pVal[ 1 ] = p2; - bEmpty[0] = FALSE; - bEmpty[1] = FALSE; + bEmpty[0] = false; + bEmpty[1] = false; } }; @@ -127,9 +127,9 @@ public: /// Could string be a regular expression? /// If pDoc!=NULL the document options are taken into account and if - /// RegularExpressions are disabled the function returns FALSE regardless + /// RegularExpressions are disabled the function returns sal_False regardless /// of the string content. - static BOOL MayBeRegExp( const String& rStr, const ScDocument* pDoc ); + static sal_Bool MayBeRegExp( const String& rStr, const ScDocument* pDoc ); /// Fail safe division, returning an errDivisionByZero coded into a double /// if denominator is 0.0 @@ -147,7 +147,7 @@ public: private: static ScTokenStack* pGlobalStack; - static BOOL bGlobalStackInUse; + static sal_Bool bGlobalStackInUse; formula::FormulaTokenIterator aCode; ScAddress aPos; @@ -164,28 +164,28 @@ private: String aTempStr; // for GetString() ScTokenStack* pStackObj; // contains the stacks formula::FormulaToken** pStack; // the current stack - USHORT nGlobalError; // global (local to this formula expression) error - USHORT sp; // stack pointer - USHORT maxsp; // the maximal used stack pointer - ULONG nFuncFmtIndex; // NumberFormatIndex of a function - ULONG nCurFmtIndex; // current NumberFormatIndex - ULONG nRetFmtIndex; // NumberFormatIndex of an expression, if any + sal_uInt16 nGlobalError; // global (local to this formula expression) error + sal_uInt16 sp; // stack pointer + sal_uInt16 maxsp; // the maximal used stack pointer + sal_uLong nFuncFmtIndex; // NumberFormatIndex of a function + sal_uLong nCurFmtIndex; // current NumberFormatIndex + sal_uLong nRetFmtIndex; // NumberFormatIndex of an expression, if any short nFuncFmtType; // NumberFormatType of a function short nCurFmtType; // current NumberFormatType short nRetFmtType; // NumberFormatType of an expression - USHORT mnStringNoValueError; // the error set in ConvertStringToValue() if no value - BOOL glSubTotal; // flag for subtotal functions - BYTE cPar; // current count of parameters - BOOL bCalcAsShown; // precision as shown - BOOL bMatrixFormula; // formula cell is a matrix formula + sal_uInt16 mnStringNoValueError; // the error set in ConvertStringToValue() if no value + sal_Bool glSubTotal; // flag for subtotal functions + sal_uInt8 cPar; // current count of parameters + sal_Bool bCalcAsShown; // precision as shown + sal_Bool bMatrixFormula; // formula cell is a matrix formula VolatileType meVolaileType; //---------------------------------Funktionen in interpre.cxx--------- // nMust <= nAct <= nMax ? ok : PushError -inline BOOL MustHaveParamCount( short nAct, short nMust ); -inline BOOL MustHaveParamCount( short nAct, short nMust, short nMax ); -inline BOOL MustHaveParamCountMin( short nAct, short nMin ); +inline sal_Bool MustHaveParamCount( short nAct, short nMust ); +inline sal_Bool MustHaveParamCount( short nAct, short nMust, short nMax ); +inline sal_Bool MustHaveParamCountMin( short nAct, short nMin ); void PushParameterExpected(); void PushIllegalParameter(); void PushIllegalArgument(); @@ -196,8 +196,8 @@ void PushNA(); //------------------------------------------------------------------------- void ReplaceCell( ScAddress& ); // for TableOp void ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab ); // for TableOp -BOOL IsTableOpInRange( const ScRange& ); -ULONG GetCellNumberFormat( const ScAddress&, const ScBaseCell* ); +sal_Bool IsTableOpInRange( const ScRange& ); +sal_uLong GetCellNumberFormat( const ScAddress&, const ScBaseCell* ); double ConvertStringToValue( const String& ); double GetCellValue( const ScAddress&, const ScBaseCell* ); double GetCellValueOrZero( const ScAddress&, const ScBaseCell* ); @@ -205,26 +205,26 @@ double GetValueCellValue( const ScAddress&, const ScValueCell* ); ScBaseCell* GetCell( const ScAddress& rPos ) { return pDok->GetCell( rPos ); } void GetCellString( String& rStr, const ScBaseCell* pCell ); -inline USHORT GetCellErrCode( const ScBaseCell* pCell ) +inline sal_uInt16 GetCellErrCode( const ScBaseCell* pCell ) { return pCell ? pCell->GetErrorCode() : 0; } inline CellType GetCellType( const ScBaseCell* pCell ) { return pCell ? pCell->GetCellType() : CELLTYPE_NONE; } /// Really empty or inherited emptiness. -inline BOOL HasCellEmptyData( const ScBaseCell* pCell ) - { return pCell ? pCell->HasEmptyData() : TRUE; } +inline sal_Bool HasCellEmptyData( const ScBaseCell* pCell ) + { return pCell ? pCell->HasEmptyData() : sal_True; } /// This includes inherited emptiness, which usually is regarded as value! -inline BOOL HasCellValueData( const ScBaseCell* pCell ) - { return pCell ? pCell->HasValueData() : FALSE; } +inline sal_Bool HasCellValueData( const ScBaseCell* pCell ) + { return pCell ? pCell->HasValueData() : false; } /// Not empty and not value. -inline BOOL HasCellStringData( const ScBaseCell* pCell ) - { return pCell ? pCell->HasStringData() : FALSE; } +inline sal_Bool HasCellStringData( const ScBaseCell* pCell ) + { return pCell ? pCell->HasStringData() : false; } -BOOL CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, BYTE* pCellArr); -BOOL CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, BYTE* pCellArr); -BOOL CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, BYTE* pCellArr); +sal_Bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr); +sal_Bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr); +sal_Bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr); //----------------------------------------------------------------------------- // Stack operations @@ -279,7 +279,7 @@ inline bool IfErrorPushError() result. Also obtain number format and type if _both_, type and index pointer, are not NULL. */ void PushCellResultToken( bool bDisplayEmptyAsString, const ScAddress & rAddress, - short * pRetTypeExpr, ULONG * pRetIndexExpr ); + short * pRetTypeExpr, sal_uLong * pRetIndexExpr ); formula::FormulaTokenRef PopToken(); void Pop(); @@ -292,7 +292,7 @@ void ValidateRef( const ScRefList & rRefList ); void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab ); void PopSingleRef( ScAddress& ); void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab); -void DoubleRefToRange( const ScComplexRefData&, ScRange&, BOOL bDontCheckForTableOp = FALSE ); +void DoubleRefToRange( const ScComplexRefData&, ScRange&, sal_Bool bDontCheckForTableOp = false ); /** If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of ScComplexRefData. Else if StackVar svRefList return values of the ScComplexRefData where @@ -302,31 +302,31 @@ void DoubleRefToRange( const ScComplexRefData&, ScRange&, BOOL bDontCheckForTabl while(nParamCount--) PopDoubleRef(aRange,nParamCount,nRefInList); */ void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList ); -void PopDoubleRef( ScRange&, BOOL bDontCheckForTableOp = FALSE ); +void PopDoubleRef( ScRange&, sal_Bool bDontCheckForTableOp = false ); void DoubleRefToVars( const ScToken* p, SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, - BOOL bDontCheckForTableOp = FALSE ); + sal_Bool bDontCheckForTableOp = false ); ScDBRangeBase* PopDBDoubleRef(); void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, - BOOL bDontCheckForTableOp = FALSE ); + sal_Bool bDontCheckForTableOp = false ); void PopExternalSingleRef(sal_uInt16& rFileId, String& rTabName, ScSingleRefData& rRef); void PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, ScExternalRefCache::CellFormat* pFmt = NULL); void PopExternalDoubleRef(sal_uInt16& rFileId, String& rTabName, ScComplexRefData& rRef); void PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArray); void PopExternalDoubleRef(ScMatrixRef& rMat); -BOOL PopDoubleRefOrSingleRef( ScAddress& rAdr ); +sal_Bool PopDoubleRefOrSingleRef( ScAddress& rAdr ); void PopDoubleRefPushMatrix(); // If MatrixFormula: convert formula::svDoubleRef to svMatrix, create JumpMatrix. // Else convert area reference parameters marked as ForceArray to array. -// Returns TRUE if JumpMatrix created. +// Returns sal_True if JumpMatrix created. bool ConvertMatrixParameters(); inline void MatrixDoubleRefToMatrix(); // if MatrixFormula: PopDoubleRefPushMatrix // If MatrixFormula or ForceArray: ConvertMatrixParameters() inline bool MatrixParameterConversion(); ScMatrixRef PopMatrix(); -void QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, ULONG& rRetIndexExpr); +void QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_uLong& rRetIndexExpr); //void PushByte(BYTE nVal); void PushDouble(double nVal); void PushInt( int nVal ); @@ -341,21 +341,21 @@ void PushExternalDoubleRef(sal_uInt16 nFileId, const String& rTabName, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2); void PushMatrix(const ScMatrixRef& pMat); -void PushError( USHORT nError ); +void PushError( sal_uInt16 nError ); /// Raw stack type without default replacements. formula::StackVar GetRawStackType(); /// Stack type with replacement of defaults, e.g. svMissing and formula::svEmptyCell will result in formula::svDouble. formula::StackVar GetStackType(); // peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ... -formula::StackVar GetStackType( BYTE nParam ); -BYTE GetByte() { return cPar; } +formula::StackVar GetStackType( sal_uInt8 nParam ); +sal_uInt8 GetByte() { return cPar; } // generiert aus DoubleRef positionsabhaengige SingleRef -BOOL DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr ); +sal_Bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr ); double GetDoubleFromMatrix(const ScMatrixRef& pMat); double GetDouble(); double GetDoubleWithDefault(double nDefault); -BOOL IsMissing(); -BOOL GetBool() { return GetDouble() != 0.0; } +sal_Bool IsMissing(); +sal_Bool GetBool() { return GetDouble() != 0.0; } const String& GetString(); const String& GetStringFromMatrix(const ScMatrixRef& pMat); // pop matrix and obtain one element, upper left or according to jump matrix @@ -370,15 +370,15 @@ void ScTableOp(); // Mehrfachoperationen void ScErrCell(); // Sonderbehandlung // Fehlerzelle //-----------------------------allgemeine Hilfsfunktionen -void SetMaxIterationCount(USHORT n); +void SetMaxIterationCount(sal_uInt16 n); inline void CurFmtToFuncFmt() { nFuncFmtType = nCurFmtType; nFuncFmtIndex = nCurFmtIndex; } // Check for String overflow of rResult+rAdd and set error and erase rResult -// if so. Return TRUE if ok, FALSE if overflow -inline BOOL CheckStringResultLen( String& rResult, const String& rAdd ); +// if so. Return sal_True if ok, sal_False if overflow +inline sal_Bool CheckStringResultLen( String& rResult, const String& rAdd ); // Set error according to rVal, and set rVal to 0.0 if there was an error. inline void TreatDoubleError( double& rVal ); -// Lookup using ScLookupCache, @returns TRUE if found and result address +// Lookup using ScLookupCache, @returns sal_True if found and result address bool LookupQueryWithCache( ScAddress & o_rResultPos, const ScQueryParam & rParam ) const; @@ -475,20 +475,20 @@ void ScJis(); void ScAsc(); void ScUnicode(); void ScUnichar(); -void ScMin( BOOL bTextAsZero = FALSE ); -void ScMax( BOOL bTextAsZero = FALSE ); -double IterateParameters( ScIterFunc, BOOL bTextAsZero = FALSE ); +void ScMin( sal_Bool bTextAsZero = false ); +void ScMax( sal_Bool bTextAsZero = false ); +double IterateParameters( ScIterFunc, sal_Bool bTextAsZero = false ); void ScSumSQ(); void ScSum(); void ScProduct(); -void ScAverage( BOOL bTextAsZero = FALSE ); +void ScAverage( sal_Bool bTextAsZero = false ); void ScCount(); void ScCount2(); -void GetStVarParams( double& rVal, double& rValCount, BOOL bTextAsZero = FALSE ); -void ScVar( BOOL bTextAsZero = FALSE ); -void ScVarP( BOOL bTextAsZero = FALSE ); -void ScStDev( BOOL bTextAsZero = FALSE ); -void ScStDevP( BOOL bTextAsZero = FALSE ); +void GetStVarParams( double& rVal, double& rValCount, sal_Bool bTextAsZero = false ); +void ScVar( sal_Bool bTextAsZero = false ); +void ScVarP( sal_Bool bTextAsZero = false ); +void ScStDev( sal_Bool bTextAsZero = false ); +void ScStDevP( sal_Bool bTextAsZero = false ); void ScColumns(); void ScRows(); void ScTables(); @@ -504,13 +504,13 @@ void ScHLookup(); void ScVLookup(); void ScSubTotal(); -// If upon call rMissingField==TRUE then the database field parameter may be +// If upon call rMissingField==sal_True then the database field parameter may be // missing (Xcl DCOUNT() syntax), or may be faked as missing by having the // value 0.0 or being exactly the entire database range reference (old SO -// compatibility). If this was the case then rMissingField is set to TRUE upon -// return. If rMissingField==FALSE upon call all "missing cases" are considered +// compatibility). If this was the case then rMissingField is set to sal_True upon +// return. If rMissingField==sal_False upon call all "missing cases" are considered // to be an error. -ScDBQueryParamBase* GetDBParams( BOOL& rMissingField ); +ScDBQueryParamBase* GetDBParams( sal_Bool& rMissingField ); void DBIterator( ScIterFunc ); void ScDBSum(); @@ -548,8 +548,8 @@ void ScConcat(); void ScExternal(); void ScMissing(); void ScMacro(); -BOOL SetSbxVariable( SbxVariable* pVar, const ScAddress& ); -BOOL SetSbxVariable( SbxVariable* pVar, SCCOL nCol, SCROW nRow, SCTAB nTab ); +sal_Bool SetSbxVariable( SbxVariable* pVar, const ScAddress& ); +sal_Bool SetSbxVariable( SbxVariable* pVar, SCCOL nCol, SCROW nRow, SCTAB nTab ); void ScErrorType(); void ScDBArea(); void ScColRowNameAuto(); @@ -568,7 +568,7 @@ void ScTTT(); If TRUE, the date passed must be a valid Gregorian calendar date. No two-digit expanding or rollover is done. */ -double GetDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, bool bStrict ); +double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict ); void ScGetActDate(); void ScGetActTime(); @@ -677,21 +677,21 @@ void ScSumX2DY2(); void ScSumXMY2(); void ScGrowth(); bool CalculateSkew(double& fSum,double& fCount,double& vSum,std::vector<double>& values); -void CalculateSlopeIntercept(BOOL bSlope); -void CalculateSmallLarge(BOOL bSmall); -void CalculatePearsonCovar(BOOL _bPearson,BOOL _bStexy); -bool CalculateTest( BOOL _bTemplin +void CalculateSlopeIntercept(sal_Bool bSlope); +void CalculateSmallLarge(sal_Bool bSmall); +void CalculatePearsonCovar(sal_Bool _bPearson,sal_Bool _bStexy); +bool CalculateTest( sal_Bool _bTemplin ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2 ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2 ,double& fT,double& fF); -void CalculateLookup(BOOL HLookup); +void CalculateLookup(sal_Bool HLookup); bool FillEntry(ScQueryEntry& rEntry); -void CalculateAddSub(BOOL _bSub); +void CalculateAddSub(sal_Bool _bSub); void CalculateTrendGrowth(bool _bGrowth); void CalulateRGPRKP(bool _bRKP); -void CalculateSumX2MY2SumX2DY2(BOOL _bSumX2DY2); +void CalculateSumX2MY2SumX2DY2(sal_Bool _bSumX2DY2); void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR); -bool CheckMatrix(bool _bLOG,BYTE& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY); +bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY); void ScRGP(); void ScRKP(); void ScForecast(); @@ -701,7 +701,7 @@ void ScBadName(); // Statistik: double phi(double x); double integralPhi(double x); -double taylor(double* pPolynom, USHORT nMax, double x); +double taylor(double* pPolynom, sal_uInt16 nMax, double x); double gauss(double x); double gaussinv(double x); double GetBetaDist(double x, double alpha, double beta); //cumulative distribution function @@ -760,8 +760,8 @@ void ScSkew(); void ScMedian(); double GetMedian( ::std::vector<double> & rArray ); double GetPercentile( ::std::vector<double> & rArray, double fPercentile ); -void GetNumberSequenceArray( BYTE nParamCount, ::std::vector<double>& rArray ); -void GetSortArray(BYTE nParamCount, ::std::vector<double>& rSortArray, ::std::vector<long>* pIndexOrder = NULL); +void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector<double>& rArray ); +void GetSortArray(sal_uInt8 nParamCount, ::std::vector<double>& rSortArray, ::std::vector<long>* pIndexOrder = NULL); void QuickSort(::std::vector<double>& rSortArray, ::std::vector<long>* pIndexOrder = NULL); void ScModalValue(); void ScAveDev(); @@ -811,17 +811,17 @@ public: formula::StackVar Interpret(); - void SetError(USHORT nError) + void SetError(sal_uInt16 nError) { if (nError && !nGlobalError) nGlobalError = nError; } - USHORT GetError() const { return nGlobalError; } + sal_uInt16 GetError() const { return nGlobalError; } formula::StackVar GetResultType() const { return xResult->GetType(); } const String& GetStringResult() const { return xResult->GetString(); } double GetNumResult() const { return xResult->GetDouble(); } formula::FormulaTokenRef GetResultToken() const { return xResult; } short GetRetFormatType() const { return nRetFmtType; } - ULONG GetRetFormatIndex() const { return nRetFmtIndex; } + sal_uLong GetRetFormatIndex() const { return nRetFmtIndex; } }; @@ -851,48 +851,48 @@ inline ScTokenMatrixMap& ScInterpreter::GetTokenMatrixMap() } -inline BOOL ScInterpreter::MustHaveParamCount( short nAct, short nMust ) +inline sal_Bool ScInterpreter::MustHaveParamCount( short nAct, short nMust ) { if ( nAct == nMust ) - return TRUE; + return sal_True; if ( nAct < nMust ) PushParameterExpected(); else PushIllegalParameter(); - return FALSE; + return false; } -inline BOOL ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax ) +inline sal_Bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax ) { if ( nMust <= nAct && nAct <= nMax ) - return TRUE; + return sal_True; if ( nAct < nMust ) PushParameterExpected(); else PushIllegalParameter(); - return FALSE; + return false; } -inline BOOL ScInterpreter::MustHaveParamCountMin( short nAct, short nMin ) +inline sal_Bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin ) { if ( nAct >= nMin ) - return TRUE; + return sal_True; PushParameterExpected(); - return FALSE; + return false; } -inline BOOL ScInterpreter::CheckStringResultLen( String& rResult, const String& rAdd ) +inline sal_Bool ScInterpreter::CheckStringResultLen( String& rResult, const String& rAdd ) { - if ( (ULONG) rResult.Len() + rAdd.Len() > STRING_MAXLEN ) + if ( (sal_uLong) rResult.Len() + rAdd.Len() > STRING_MAXLEN ) { SetError( errStringOverflow ); rResult.Erase(); - return FALSE; + return false; } - return TRUE; + return sal_True; } @@ -900,7 +900,7 @@ inline void ScInterpreter::TreatDoubleError( double& rVal ) { if ( !::rtl::math::isFinite( rVal ) ) { - USHORT nErr = GetDoubleErrorValue( rVal ); + sal_uInt16 nErr = GetDoubleErrorValue( rVal ); if ( nErr ) SetError( nErr ); else diff --git a/sc/source/core/inc/jumpmatrix.hxx b/sc/source/core/inc/jumpmatrix.hxx index 07dabaa536b4..be2719c0a213 100644 --- a/sc/source/core/inc/jumpmatrix.hxx +++ b/sc/source/core/inc/jumpmatrix.hxx @@ -123,7 +123,7 @@ public: short nStart, short nNext, short nStop = SHRT_MAX ) { - pJump[ (ULONG)nCol * nRows + nRow ]. + pJump[ (sal_uLong)nCol * nRows + nRow ]. SetJump( fBool, nStart, nNext, nStop); } void GetJump( SCSIZE nCol, SCSIZE nRow, double& rBool, @@ -145,15 +145,15 @@ public: nCol = 0; nRow = 0; } - pJump[ (ULONG)nCol * nRows + nRow ]. + pJump[ (sal_uLong)nCol * nRows + nRow ]. GetJump( rBool, rStart, rNext, rStop); } void SetAllJumps( double fBool, short nStart, short nNext, short nStop = SHRT_MAX ) { - ULONG n = (ULONG)nCols * nRows; - for ( ULONG j=0; j<n; ++j ) + sal_uLong n = (sal_uLong)nCols * nRows; + for ( sal_uLong j=0; j<n; ++j ) { pJump[ j ].SetJump( fBool, nStart, nNext, nStop); diff --git a/sc/source/core/inc/parclass.hxx b/sc/source/core/inc/parclass.hxx index de2fba3fb694..2bd309f08d30 100644 --- a/sc/source/core/inc/parclass.hxx +++ b/sc/source/core/inc/parclass.hxx @@ -89,7 +89,7 @@ public: @param nParameter Which parameter, 0-based */ static Type GetParameterType( const formula::FormulaToken* pToken, - USHORT nParameter); + sal_uInt16 nParameter); /** Whether OpCode has a parameter of type ForceArray or ReferenceOrForceArray. */ @@ -125,7 +125,7 @@ private: struct RunData { CommonData aData; - BYTE nMinParams; // fix or minimum, or repeat start + sal_uInt8 nMinParams; // fix or minimum, or repeat start bool bHasForceArray; }; @@ -134,7 +134,7 @@ private: // ocExternal AddIns static Type GetExternalParameterType( - const formula::FormulaToken* pToken, USHORT nParameter); + const formula::FormulaToken* pToken, sal_uInt16 nParameter); #if OSL_DEBUG_LEVEL > 1 // Generate documentation to stdout if environment variable @@ -152,14 +152,14 @@ private: /** Minimum number of parameters, or fix number of parameters if HasRepeatParameters() - returns FALSE. For opcodes not specified in + returns sal_False. For opcodes not specified in the implementation a parameter count of 1 is assumed, for opcodes out of range 0 is assumed. If HasRepeatParameters() returns - TRUE, information is NOT related to whether + sal_True, information is NOT related to whether any parameters are optional, only the type of parameters is significant. */ - static inline BYTE GetMinimumParameters( OpCode eOp) + static inline sal_uInt8 GetMinimumParameters( OpCode eOp) { if ( eOp <= SC_OPCODE_LAST_OPCODE_ID ) return pData[eOp].aData.nParam[0] diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx index 1ecae5f11d1f..544de4029661 100644 --- a/sc/source/core/inc/refupdat.hxx +++ b/sc/source/core/inc/refupdat.hxx @@ -64,7 +64,7 @@ public: static ScRefUpdateRes Update( UpdateRefMode eUpdateRefMode, const ScBigRange& rWhere, - INT32 nDx, INT32 nDy, INT32 nDz, + sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz, ScBigRange& rWhat ); /// Before calling, the absolute references must be up-to-date! @@ -77,7 +77,7 @@ public: /// Before calling, the absolute references must be up-to-date! static ScRefUpdateRes Move( ScDocument* pDoc, const ScAddress& rPos, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScComplexRefData& rRef, BOOL bWrap, BOOL bAbsolute ); + ScComplexRefData& rRef, sal_Bool bWrap, sal_Bool bAbsolute ); static void MoveRelWrap( ScDocument* pDoc, const ScAddress& rPos, SCCOL nMaxCol, SCROW nMaxRow, ScComplexRefData& rRef ); diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 9421304a1eac..dd86967431d2 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -83,7 +83,7 @@ using namespace com::sun::star; ScUnoAddInFuncData::ScUnoAddInFuncData( const String& rNam, const String& rLoc, const String& rDesc, - USHORT nCat, USHORT nHelp, + sal_uInt16 nCat, const rtl::OString& sHelp, const uno::Reference<reflection::XIdlMethod>& rFunc, const uno::Any& rO, long nAC, const ScAddInArgDesc* pAD, @@ -98,8 +98,8 @@ ScUnoAddInFuncData::ScUnoAddInFuncData( const String& rNam, const String& rLoc, nArgCount( nAC ), nCallerPos( nCP ), nCategory( nCat ), - nHelpId( nHelp ), - bCompInitialized( FALSE ) + sHelpId( sHelp ), + bCompInitialized( false ) { if ( nArgCount ) { @@ -152,7 +152,7 @@ const uno::Sequence<sheet::LocalizedName>& ScUnoAddInFuncData::GetCompNames() co } } - bCompInitialized = TRUE; // also if not successful + bCompInitialized = sal_True; // also if not successful } return aCompNames; } @@ -179,10 +179,10 @@ void ScUnoAddInFuncData::SetCompNames( const uno::Sequence< sheet::LocalizedName } } - bCompInitialized = TRUE; + bCompInitialized = sal_True; } -BOOL ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetExcelName ) const +sal_Bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetExcelName ) const { const uno::Sequence<sheet::LocalizedName>& rSequence = GetCompNames(); long nSeqLen = rSequence.getLength(); @@ -203,7 +203,7 @@ BOOL ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetExcel pArray[i].Locale.Country == aUserCountry ) { rRetExcelName = pArray[i].Name; - return TRUE; + return sal_True; } // second: check only language @@ -212,7 +212,7 @@ BOOL ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetExcel if ( pArray[i].Locale.Language == aUserLang ) { rRetExcelName = pArray[i].Name; - return TRUE; + return sal_True; } // third: #i57772# fall-back to en-US @@ -223,9 +223,9 @@ BOOL ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetExcel // forth: use first (default) entry rRetExcelName = pArray[0].Name; - return TRUE; + return sal_True; } - return FALSE; + return false; } void ScUnoAddInFuncData::SetFunction( const uno::Reference< reflection::XIdlMethod>& rNewFunc, const uno::Any& rNewObj ) @@ -262,7 +262,7 @@ ScUnoAddInCollection::ScUnoAddInCollection() : pExactHashMap( NULL ), pNameHashMap( NULL ), pLocalHashMap( NULL ), - bInitialized( FALSE ) + bInitialized( false ) { } @@ -285,7 +285,7 @@ void ScUnoAddInCollection::Clear() ppFuncData = NULL; nFuncCount = 0; - bInitialized = FALSE; + bInitialized = false; } uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiServiceFactory> xMSF) @@ -358,11 +358,11 @@ void ScUnoAddInCollection::Initialize() // when argument information is needed). ReadConfiguration(); - bInitialized = TRUE; // with or without functions + bInitialized = sal_True; // with or without functions } // ----------------------------------------------------------------------------- -USHORT lcl_GetCategory( const String& rName ) +sal_uInt16 lcl_GetCategory( const String& rName ) { static const sal_Char* aFuncNames[SC_FUNCGROUP_COUNT] = { @@ -380,7 +380,7 @@ USHORT lcl_GetCategory( const String& rName ) "Text", // ID_FUNCTION_GRP_TEXT "Add-In" // ID_FUNCTION_GRP_ADDINS }; - for (USHORT i=0; i<SC_FUNCGROUP_COUNT; i++) + for (sal_uInt16 i=0; i<SC_FUNCGROUP_COUNT; i++) if ( rName.EqualsAscii( aFuncNames[i] ) ) return i+1; // IDs start at 1 @@ -474,7 +474,7 @@ void ScUnoAddInCollection::ReadConfiguration() { rtl::OUString aLocalName; rtl::OUString aDescription; - USHORT nCategory = ID_FUNCTION_GRP_ADDINS; + sal_uInt16 nCategory = ID_FUNCTION_GRP_ADDINS; // get direct information on the function @@ -588,7 +588,7 @@ void ScUnoAddInCollection::ReadConfiguration() ScAddInArgDesc aDesc; aDesc.eType = SC_ADDINARG_NONE; // arg type is not in configuration - aDesc.bOptional = FALSE; + aDesc.bOptional = false; nVisibleCount = nArgumentCount; pVisibleArgs = new ScAddInArgDesc[nVisibleCount]; @@ -608,7 +608,7 @@ void ScUnoAddInCollection::ReadConfiguration() } } - USHORT nHelpId = aHelpIdGenerator.GetHelpId( pFuncNameArray[nFuncPos] ); + rtl::OString sHelpId = aHelpIdGenerator.GetHelpId( pFuncNameArray[nFuncPos] ); uno::Reference<reflection::XIdlMethod> xFunc; // remains empty uno::Any aObject; // also empty @@ -617,7 +617,7 @@ void ScUnoAddInCollection::ReadConfiguration() ScUnoAddInFuncData* pData = new ScUnoAddInFuncData( aFuncName, aLocalName, aDescription, - nCategory, nHelpId, + nCategory, sHelpId, xFunc, aObject, nVisibleCount, pVisibleArgs, nCallerPos ); @@ -660,16 +660,16 @@ void ScUnoAddInCollection::LoadComponent( const ScUnoAddInFuncData& rFuncData ) } } -BOOL ScUnoAddInCollection::GetExcelName( const String& rCalcName, +sal_Bool ScUnoAddInCollection::GetExcelName( const String& rCalcName, LanguageType eDestLang, String& rRetExcelName ) { const ScUnoAddInFuncData* pFuncData = GetFuncData( rCalcName ); if ( pFuncData ) return pFuncData->GetExcelName( eDestLang, rRetExcelName); - return FALSE; + return false; } -BOOL ScUnoAddInCollection::GetCalcName( const String& rExcelName, String& rRetCalcName ) +sal_Bool ScUnoAddInCollection::GetCalcName( const String& rExcelName, String& rRetCalcName ) { if (!bInitialized) Initialize(); @@ -694,24 +694,24 @@ BOOL ScUnoAddInCollection::GetCalcName( const String& rExcelName, String& rRetCa // use the first function that has this name for any language rRetCalcName = pFuncData->GetOriginalName(); - return TRUE; + return sal_True; } } } } - return FALSE; + return false; } -inline BOOL IsTypeName( const rtl::OUString& rName, const uno::Type& rType ) +inline sal_Bool IsTypeName( const rtl::OUString& rName, const uno::Type& rType ) { return rName == rType.getTypeName(); } -BOOL lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) +sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) { // this must match with ScUnoAddInCall::SetResult - if ( !xClass.is() ) return FALSE; + if ( !xClass.is() ) return false; switch (xClass->getTypeClass()) { @@ -727,7 +727,7 @@ BOOL lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) case uno::TypeClass_FLOAT: case uno::TypeClass_DOUBLE: case uno::TypeClass_STRING: - return TRUE; // values or string + return sal_True; // values or string case uno::TypeClass_INTERFACE: { @@ -747,13 +747,13 @@ BOOL lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) rtl::OUString sName = xClass->getName(); return ( - IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<INT32> >*)0) ) || + IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<sal_Int32> >*)0) ) || IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<double> >*)0) ) || IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<rtl::OUString> >*)0) ) || IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<uno::Any> >*)0) ) ); } } - return FALSE; + return false; } ScAddInArgumentType lcl_GetArgType( const uno::Reference<reflection::XIdlClass>& xClass ) @@ -775,7 +775,7 @@ ScAddInArgumentType lcl_GetArgType( const uno::Reference<reflection::XIdlClass>& //! XIdlClass needs getType() method! rtl::OUString sName = xClass->getName(); - if (IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<INT32> >*)0) )) + if (IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<sal_Int32> >*)0) )) return SC_ADDINARG_INTEGER_ARRAY; if (IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<double> >*)0) )) @@ -870,7 +870,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& // leave out internal functions uno::Reference<reflection::XIdlClass> xClass = xFunc->getDeclaringClass(); - BOOL bSkip = TRUE; + sal_Bool bSkip = sal_True; if ( xClass.is() ) { //! XIdlClass needs getType() method! @@ -892,7 +892,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& uno::Reference<reflection::XIdlClass> xReturn = xFunc->getReturnType(); if ( !lcl_ValidReturnType( xReturn ) ) - bSkip = TRUE; + bSkip = sal_True; } if (!bSkip) { @@ -903,7 +903,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& aFuncName += '.'; aFuncName += String( aFuncU ); - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; long nVisibleCount = 0; long nCallerPos = SC_CALLERPOS_NONE; @@ -915,12 +915,12 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& for (nParamPos=0; nParamPos<nParamCount; nParamPos++) { if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN ) - bValid = FALSE; + bValid = false; uno::Reference<reflection::XIdlClass> xParClass = pParArr[nParamPos].aType; ScAddInArgumentType eArgType = lcl_GetArgType( xParClass ); if ( eArgType == SC_ADDINARG_NONE ) - bValid = FALSE; + bValid = false; else if ( eArgType == SC_ADDINARG_CALLER ) nCallerPos = nParamPos; else @@ -928,12 +928,12 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& } if (bValid) { - USHORT nCategory = lcl_GetCategory( + sal_uInt16 nCategory = lcl_GetCategory( String( xAddIn->getProgrammaticCategoryName( aFuncU ) ) ); - USHORT nHelpId = aHelpIdGenerator.GetHelpId( aFuncU ); + rtl::OString sHelpId = aHelpIdGenerator.GetHelpId( aFuncU ); rtl::OUString aLocalU; try @@ -993,7 +993,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& aArgName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" )); } - BOOL bOptional = + sal_Bool bOptional = ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY || eArgType == SC_ADDINARG_VARARGS ); @@ -1012,7 +1012,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& ppFuncData[nFuncPos+nOld] = new ScUnoAddInFuncData( aFuncName, aLocalName, aDescription, - nCategory, nHelpId, + nCategory, sHelpId, xFunc, aObject, nVisibleCount, pVisibleArgs, nCallerPos ); @@ -1047,8 +1047,8 @@ void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFunc { ::rtl::OUString aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData - ULONG nCount = rFunctionList.GetCount(); - for (ULONG nPos=0; nPos<nCount; nPos++) + sal_uLong nCount = rFunctionList.GetCount(); + for (sal_uLong nPos=0; nPos<nCount; nPos++) { const ScFuncDesc* pDesc = rFunctionList.GetFunction( nPos ); if ( pDesc && pDesc->pFuncName && *pDesc->pFuncName == aCompare ) @@ -1129,7 +1129,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface // Local names and descriptions from pOldData are looked up using the // internal argument name. - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; long nVisibleCount = 0; long nCallerPos = SC_CALLERPOS_NONE; @@ -1141,12 +1141,12 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface for (nParamPos=0; nParamPos<nParamCount; nParamPos++) { if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN ) - bValid = FALSE; + bValid = false; uno::Reference<reflection::XIdlClass> xParClass = pParArr[nParamPos].aType; ScAddInArgumentType eArgType = lcl_GetArgType( xParClass ); if ( eArgType == SC_ADDINARG_NONE ) - bValid = FALSE; + bValid = false; else if ( eArgType == SC_ADDINARG_CALLER ) nCallerPos = nParamPos; else @@ -1177,7 +1177,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface else aDesc.aName = aDesc.aDescription = String::CreateFromAscii( "###" ); - BOOL bOptional = + sal_Bool bOptional = ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY || eArgType == SC_ADDINARG_VARARGS ); @@ -1209,7 +1209,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface } } -String ScUnoAddInCollection::FindFunction( const String& rUpperName, BOOL bLocalFirst ) +String ScUnoAddInCollection::FindFunction( const String& rUpperName, sal_Bool bLocalFirst ) { if (!bInitialized) Initialize(); @@ -1296,28 +1296,28 @@ long ScUnoAddInCollection::GetFuncCount() return nFuncCount; } -BOOL ScUnoAddInCollection::FillFunctionDesc( long nFunc, ScFuncDesc& rDesc ) +sal_Bool ScUnoAddInCollection::FillFunctionDesc( long nFunc, ScFuncDesc& rDesc ) { if (!bInitialized) Initialize(); if (nFunc >= nFuncCount || !ppFuncData[nFunc]) - return FALSE; + return false; const ScUnoAddInFuncData& rFuncData = *ppFuncData[nFunc]; return FillFunctionDescFromData( rFuncData, rDesc ); } -BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& rFuncData, ScFuncDesc& rDesc ) +sal_Bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& rFuncData, ScFuncDesc& rDesc ) { rDesc.Clear(); - BOOL bIncomplete = !rFuncData.GetFunction().is(); //! extra flag? + sal_Bool bIncomplete = !rFuncData.GetFunction().is(); //! extra flag? long nArgCount = rFuncData.GetArgumentCount(); if ( nArgCount > USHRT_MAX ) - return FALSE; + return false; if ( bIncomplete ) nArgCount = 0; // if incomplete, fill without argument info (no wrong order) @@ -1326,7 +1326,7 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r rDesc.pFuncName = new ::rtl::OUString( rFuncData.GetUpperLocal() ); //! upper? rDesc.nCategory = rFuncData.GetCategory(); - rDesc.nHelpId = rFuncData.GetHelpId(); + rDesc.sHelpId = rFuncData.GetHelpId(); String aDesc = rFuncData.GetDescription(); if (!aDesc.Len()) @@ -1335,10 +1335,10 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r // AddInArgumentType_CALLER is already left out in FuncData - rDesc.nArgCount = (USHORT)nArgCount; + rDesc.nArgCount = (sal_uInt16)nArgCount; if ( nArgCount ) { - BOOL bMultiple = FALSE; + sal_Bool bMultiple = false; const ScAddInArgDesc* pArgs = rFuncData.GetArguments(); rDesc.ppDefArgNames = new ::rtl::OUString*[nArgCount]; @@ -1361,7 +1361,7 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r // last argument repeated? if ( nArg+1 == nArgCount && ( pArgs[nArg].eType == SC_ADDINARG_VARARGS ) ) - bMultiple = TRUE; + bMultiple = sal_True; } if ( bMultiple ) @@ -1370,7 +1370,7 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r rDesc.bIncomplete = bIncomplete; - return TRUE; + return sal_True; } @@ -1378,9 +1378,9 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const String& rName, long nParamCount ) : - bValidCount( FALSE ), + bValidCount( false ), nErrCode( errNoCode ), // before function was called - bHasString( TRUE ), + bHasString( sal_True ), fValue( 0.0 ), xMatrix( NULL ) { @@ -1397,15 +1397,15 @@ ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const String& rName { long nVarCount = nParamCount - ( nDescCount - 1 ); // size of last argument aVarArg.realloc( nVarCount ); - bValidCount = TRUE; + bValidCount = sal_True; } else if ( nParamCount <= nDescCount ) { // all args behind nParamCount must be optional - bValidCount = TRUE; + bValidCount = sal_True; for (long i=nParamCount; i<nDescCount; i++) if ( !pArgs[i].bOptional ) - bValidCount = FALSE; + bValidCount = false; } // else invalid (too many arguments) @@ -1419,7 +1419,7 @@ ScUnoAddInCall::~ScUnoAddInCall() // pFuncData is deleted with ScUnoAddInCollection } -BOOL ScUnoAddInCall::ValidParamCount() +sal_Bool ScUnoAddInCall::ValidParamCount() { return bValidCount; } @@ -1441,7 +1441,7 @@ ScAddInArgumentType ScUnoAddInCall::GetArgType( long nPos ) return SC_ADDINARG_VALUE_OR_ARRAY; //! error code !!!! } -BOOL ScUnoAddInCall::NeedsCaller() const +sal_Bool ScUnoAddInCall::NeedsCaller() const { return pFuncData && pFuncData->GetCallerPos() != SC_CALLERPOS_NONE; } @@ -1611,7 +1611,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) { uno::TypeClass eMyClass; ScApiTypeConversion::ConvertAnyToDouble( fValue, eMyClass, rNewRes); - bHasString = FALSE; + bHasString = false; } break; @@ -1620,7 +1620,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) rtl::OUString aUStr; rNewRes >>= aUStr; aString = String( aUStr ); - bHasString = TRUE; + bHasString = sal_True; } break; @@ -1638,19 +1638,19 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) break; default: - if ( aType.equals( getCppuType( (uno::Sequence< uno::Sequence<INT32> > *)0 ) ) ) + if ( aType.equals( getCppuType( (uno::Sequence< uno::Sequence<sal_Int32> > *)0 ) ) ) { - const uno::Sequence< uno::Sequence<INT32> >* pRowSeq = NULL; + const uno::Sequence< uno::Sequence<sal_Int32> >* pRowSeq = NULL; //! use pointer from any! - uno::Sequence< uno::Sequence<INT32> > aSequence; + uno::Sequence< uno::Sequence<sal_Int32> > aSequence; if ( rNewRes >>= aSequence ) pRowSeq = &aSequence; if ( pRowSeq ) { long nRowCount = pRowSeq->getLength(); - const uno::Sequence<INT32>* pRowArr = pRowSeq->getConstArray(); + const uno::Sequence<sal_Int32>* pRowArr = pRowSeq->getConstArray(); long nMaxColCount = 0; long nCol, nRow; for (nRow=0; nRow<nRowCount; nRow++) @@ -1667,7 +1667,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) for (nRow=0; nRow<nRowCount; nRow++) { long nColCount = pRowArr[nRow].getLength(); - const INT32* pColArr = pRowArr[nRow].getConstArray(); + const sal_Int32* pColArr = pRowArr[nRow].getConstArray(); for (nCol=0; nCol<nColCount; nCol++) xMatrix->PutDouble( pColArr[nCol], static_cast<SCSIZE>(nCol), diff --git a/sc/source/core/tool/addinhelpid.cxx b/sc/source/core/tool/addinhelpid.cxx index 8f347a9dea0b..02fe446f4293 100644 --- a/sc/source/core/tool/addinhelpid.cxx +++ b/sc/source/core/tool/addinhelpid.cxx @@ -38,7 +38,7 @@ struct ScUnoAddInHelpId { const sal_Char* pFuncName; - sal_uInt16 nHelpId; + const sal_Char* sHelpId; }; @@ -185,10 +185,10 @@ void ScUnoAddInHelpIdGenerator::SetServiceName( const ::rtl::OUString& rServiceN nArrayCount = nSize / sizeof( ScUnoAddInHelpId ); } -sal_uInt16 ScUnoAddInHelpIdGenerator::GetHelpId( const ::rtl::OUString& rFuncName ) const +rtl::OString ScUnoAddInHelpIdGenerator::GetHelpId( const ::rtl::OUString& rFuncName ) const { if( !pCurrHelpIds || !nArrayCount ) - return 0; + return rtl::OString(); const ScUnoAddInHelpId* pFirst = pCurrHelpIds; const ScUnoAddInHelpId* pLast = pCurrHelpIds + nArrayCount - 1; @@ -198,14 +198,14 @@ sal_uInt16 ScUnoAddInHelpIdGenerator::GetHelpId( const ::rtl::OUString& rFuncNam const ScUnoAddInHelpId* pMiddle = pFirst + (pLast - pFirst) / 2; sal_Int32 nResult = rFuncName.compareToAscii( pMiddle->pFuncName ); if( !nResult ) - return pMiddle->nHelpId; + return pMiddle->sHelpId; else if( nResult < 0 ) pLast = pMiddle - 1; else pFirst = pMiddle + 1; } - return 0; + return rtl::OString(); } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 0b73062a2c49..5c058c1a26f3 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -157,7 +157,7 @@ const sal_Unicode* lcl_eatWhiteSpace( const sal_Unicode* p ) */ static bool lcl_ScRange_External_TabSpan( ScRange & rRange, - USHORT & rFlags, + sal_uInt16 & rFlags, ScAddress::ExternalInfo* pExtInfo, const String & rExternDocName, const String & rStartTabName, @@ -266,7 +266,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start, } else { - bool only_digits = TRUE; + bool only_digits = sal_True; /* * Valid: Normal!a1 @@ -294,7 +294,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start, p = start; break; } - only_digits = FALSE; + only_digits = false; p++; } else if( CharClass::isAsciiDigit( uc )) @@ -336,12 +336,12 @@ const sal_Unicode* ScRange::Parse_XL_Header( String& rExternDocName, String& rStartTabName, String& rEndTabName, - USHORT& nFlags, + sal_uInt16& nFlags, bool bOnlyAcceptSingle, const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks ) { const sal_Unicode* startTabs, *start = p; - USHORT nSaveFlags = nFlags; + sal_uInt16 nSaveFlags = nFlags; // Is this an external reference ? rStartTabName.Erase(); @@ -531,7 +531,7 @@ const sal_Unicode* ScRange::Parse_XL_Header( static const sal_Unicode* lcl_r1c1_get_col( const sal_Unicode* p, const ScAddress::Details& rDetails, - ScAddress* pAddr, USHORT* nFlags ) + ScAddress* pAddr, sal_uInt16* nFlags ) { const sal_Unicode *pEnd; long int n; @@ -576,7 +576,7 @@ lcl_r1c1_get_col( const sal_Unicode* p, static inline const sal_Unicode* lcl_r1c1_get_row( const sal_Unicode* p, const ScAddress::Details& rDetails, - ScAddress* pAddr, USHORT* nFlags ) + ScAddress* pAddr, sal_uInt16* nFlags ) { const sal_Unicode *pEnd; long int n; @@ -619,7 +619,7 @@ lcl_r1c1_get_row( const sal_Unicode* p, return pEnd; } -static USHORT +static sal_uInt16 lcl_ScRange_Parse_XL_R1C1( ScRange& r, const sal_Unicode* p, ScDocument* pDoc, @@ -629,9 +629,9 @@ lcl_ScRange_Parse_XL_R1C1( ScRange& r, { const sal_Unicode* pTmp = NULL; String aExternDocName, aStartTabName, aEndTabName; - USHORT nFlags = SCA_VALID | SCA_VALID_TAB; + sal_uInt16 nFlags = SCA_VALID | SCA_VALID_TAB; // Keep in mind that nFlags2 gets left-shifted by 4 bits before being merged. - USHORT nFlags2 = SCA_VALID_TAB; + sal_uInt16 nFlags2 = SCA_VALID_TAB; p = r.Parse_XL_Header( p, pDoc, aExternDocName, aStartTabName, aEndTabName, nFlags, bOnlyAcceptSingle, NULL ); @@ -755,7 +755,7 @@ failed : } static inline const sal_Unicode* -lcl_a1_get_col( const sal_Unicode* p, ScAddress* pAddr, USHORT* nFlags ) +lcl_a1_get_col( const sal_Unicode* p, ScAddress* pAddr, sal_uInt16* nFlags ) { SCCOL nCol; @@ -778,7 +778,7 @@ lcl_a1_get_col( const sal_Unicode* p, ScAddress* pAddr, USHORT* nFlags ) } static inline const sal_Unicode* -lcl_a1_get_row( const sal_Unicode* p, ScAddress* pAddr, USHORT* nFlags ) +lcl_a1_get_row( const sal_Unicode* p, ScAddress* pAddr, sal_uInt16* nFlags ) { const sal_Unicode *pEnd; long int n; @@ -796,7 +796,7 @@ lcl_a1_get_row( const sal_Unicode* p, ScAddress* pAddr, USHORT* nFlags ) return pEnd; } -static USHORT +static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r, const sal_Unicode* p, ScDocument* pDoc, @@ -806,7 +806,7 @@ lcl_ScRange_Parse_XL_A1( ScRange& r, { const sal_Unicode* tmp1, *tmp2; String aExternDocName, aStartTabName, aEndTabName; // for external link table - USHORT nFlags = SCA_VALID | SCA_VALID_TAB, nFlags2 = SCA_VALID_TAB; + sal_uInt16 nFlags = SCA_VALID | SCA_VALID_TAB, nFlags2 = SCA_VALID_TAB; p = r.Parse_XL_Header( p, pDoc, aExternDocName, aStartTabName, aEndTabName, nFlags, bOnlyAcceptSingle, pExternalLinks ); @@ -943,11 +943,11 @@ lcl_ScRange_Parse_XL_A1( ScRange& r, used in conjunction with pExtInfo to determine the tab span of a 3D reference. */ -static USHORT +static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAddr, ScAddress::ExternalInfo* pExtInfo = NULL, ScRange* pRange = NULL ) { - USHORT nRes = 0; + sal_uInt16 nRes = 0; String aDocName; // der pure Dokumentenname String aTab; bool bExtDoc = false; @@ -976,7 +976,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd SCCOL nCol = 0; SCROW nRow = 0; SCTAB nTab = 0; - USHORT nBits = SCA_VALID_TAB; + sal_uInt16 nBits = SCA_VALID_TAB; const sal_Unicode* q; if ( ScGlobal::FindUnquoted( p, '.') ) { @@ -1144,7 +1144,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd nRes = 0; else { - USHORT nFlags = nRes | SCA_VALID_TAB2; + sal_uInt16 nFlags = nRes | SCA_VALID_TAB2; if (!lcl_ScRange_External_TabSpan( *pRange, nFlags, pExtInfo, aDocName, pExtInfo->maTabName, aTab, pDoc)) @@ -1173,7 +1173,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd } if( !*p ) { - USHORT nMask = nRes & ( SCA_VALID_ROW | SCA_VALID_COL | SCA_VALID_TAB ); + sal_uInt16 nMask = nRes & ( SCA_VALID_ROW | SCA_VALID_COL | SCA_VALID_TAB ); if( nMask == ( SCA_VALID_ROW | SCA_VALID_COL | SCA_VALID_TAB ) ) nRes |= SCA_VALID; } @@ -1182,7 +1182,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd return nRes; } -static USHORT +static sal_uInt16 lcl_ScAddress_Parse ( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAddr, const ScAddress::Details& rDetails, ScAddress::ExternalInfo* pExtInfo = NULL, @@ -1203,7 +1203,7 @@ lcl_ScAddress_Parse ( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAddr, case formula::FormulaGrammar::CONV_XL_OOX: { ScRange r = rAddr; - USHORT nFlags = lcl_ScRange_Parse_XL_A1( r, p, pDoc, true, pExtInfo, + sal_uInt16 nFlags = lcl_ScRange_Parse_XL_A1( r, p, pDoc, true, pExtInfo, (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : NULL) ); rAddr = r.aStart; return nFlags; @@ -1211,7 +1211,7 @@ lcl_ScAddress_Parse ( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAddr, case formula::FormulaGrammar::CONV_XL_R1C1: { ScRange r = rAddr; - USHORT nFlags = lcl_ScRange_Parse_XL_R1C1( r, p, pDoc, rDetails, true, pExtInfo ); + sal_uInt16 nFlags = lcl_ScRange_Parse_XL_R1C1( r, p, pDoc, rDetails, true, pExtInfo ); rAddr = r.aStart; return nFlags; } @@ -1228,7 +1228,7 @@ bool ConvertSingleRef( ScDocument* pDoc, const String& rRefString, if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == STRING_NOTFOUND)) { ScAddress aAddr( 0, 0, nDefTab ); - USHORT nRes = aAddr.Parse( rRefString, pDoc, rDetails, pExtInfo); + sal_uInt16 nRes = aAddr.Parse( rRefString, pDoc, rDetails, pExtInfo); if ( nRes & SCA_VALID ) { rRefAddress.Set( aAddr, @@ -1251,7 +1251,7 @@ bool ConvertDoubleRef( ScDocument* pDoc, const String& rRefString, SCTAB nDefTab if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == STRING_NOTFOUND)) { ScRange aRange( ScAddress( 0, 0, nDefTab)); - USHORT nRes = aRange.Parse( rRefString, pDoc, rDetails, pExtInfo); + sal_uInt16 nRes = aRange.Parse( rRefString, pDoc, rDetails, pExtInfo); if ( nRes & SCA_VALID ) { rStartRefAddress.Set( aRange.aStart, @@ -1269,7 +1269,7 @@ bool ConvertDoubleRef( ScDocument* pDoc, const String& rRefString, SCTAB nDefTab } -USHORT ScAddress::Parse( const String& r, ScDocument* pDoc, +sal_uInt16 ScAddress::Parse( const String& r, ScDocument* pDoc, const Details& rDetails, ExternalInfo* pExtInfo, const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks ) @@ -1323,10 +1323,10 @@ void ScRange::ExtendTo( const ScRange& rRange ) *this = rRange; } -static USHORT +static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAddress::ExternalInfo* pExtInfo = NULL ) { - USHORT nRes1 = 0, nRes2 = 0; + sal_uInt16 nRes1 = 0, nRes2 = 0; xub_StrLen nPos = ScGlobal::FindUnquoted( r, ':'); if (nPos != STRING_NOTFOUND) { @@ -1339,7 +1339,7 @@ lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAdd if ( (nRes2 = lcl_ScAddress_Parse_OOo( p + nPos+ 1, pDoc, aRange.aEnd, pExtInfo, &aRange ) ) != 0 ) { // PutInOrder / Justify - USHORT nMask, nBits1, nBits2; + sal_uInt16 nMask, nBits1, nBits2; SCCOL nTempCol; if ( aRange.aEnd.Col() < (nTempCol = aRange.aStart.Col()) ) { @@ -1385,7 +1385,7 @@ lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAdd return nRes1; } -USHORT ScRange::Parse( const String& r, ScDocument* pDoc, +sal_uInt16 ScRange::Parse( const String& r, ScDocument* pDoc, const ScAddress::Details& rDetails, ScAddress::ExternalInfo* pExtInfo, const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks ) @@ -1411,11 +1411,11 @@ USHORT ScRange::Parse( const String& r, ScDocument* pDoc, // Accept a full range, or an address -USHORT ScRange::ParseAny( const String& r, ScDocument* pDoc, +sal_uInt16 ScRange::ParseAny( const String& r, ScDocument* pDoc, const ScAddress::Details& rDetails ) { - USHORT nRet = Parse( r, pDoc, rDetails ); - const USHORT nValid = SCA_VALID | SCA_VALID_COL2 | SCA_VALID_ROW2 | + sal_uInt16 nRet = Parse( r, pDoc, rDetails ); + const sal_uInt16 nValid = SCA_VALID | SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2; if ( (nRet & nValid) != nValid ) @@ -1429,11 +1429,11 @@ USHORT ScRange::ParseAny( const String& r, ScDocument* pDoc, } // Parse only full row references -USHORT ScRange::ParseCols( const String& rStr, ScDocument* pDoc, +sal_uInt16 ScRange::ParseCols( const String& rStr, ScDocument* pDoc, const ScAddress::Details& rDetails ) { const sal_Unicode* p = rStr.GetBuffer(); - USHORT nRes = 0, ignored = 0; + sal_uInt16 nRes = 0, ignored = 0; if( NULL == p ) return 0; @@ -1488,11 +1488,11 @@ USHORT ScRange::ParseCols( const String& rStr, ScDocument* pDoc, } // Parse only full row references -USHORT ScRange::ParseRows( const String& rStr, ScDocument* pDoc, +sal_uInt16 ScRange::ParseRows( const String& rStr, ScDocument* pDoc, const ScAddress::Details& rDetails ) { const sal_Unicode* p = rStr.GetBuffer(); - USHORT nRes = 0, ignored = 0; + sal_uInt16 nRes = 0, ignored = 0; if( NULL == p ) return 0; @@ -1627,7 +1627,7 @@ getFileNameFromDoc( const ScDocument* pDoc ) return sFileName; } -void ScAddress::Format( String& r, USHORT nFlags, ScDocument* pDoc, +void ScAddress::Format( String& r, sal_uInt16 nFlags, ScDocument* pDoc, const Details& rDetails) const { r.Erase(); @@ -1715,7 +1715,7 @@ void ScAddress::Format( String& r, USHORT nFlags, ScDocument* pDoc, static void lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab, const ScAddress::Details& rDetails, - USHORT nFlags, + sal_uInt16 nFlags, String& rTabName, String& rDocName ) { pDoc->GetName( nTab, rTabName ); @@ -1744,7 +1744,7 @@ lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab, static void lcl_ScRange_Format_XL_Header( String& r, const ScRange& rRange, - USHORT nFlags, ScDocument* pDoc, + sal_uInt16 nFlags, ScDocument* pDoc, const ScAddress::Details& rDetails ) { if( nFlags & SCA_TAB_3D ) @@ -1771,7 +1771,7 @@ lcl_ScRange_Format_XL_Header( String& r, const ScRange& rRange, } } -void ScRange::Format( String& r, USHORT nFlags, ScDocument* pDoc, +void ScRange::Format( String& r, sal_uInt16 nFlags, ScDocument* pDoc, const ScAddress::Details& rDetails ) const { r.Erase(); @@ -1785,7 +1785,7 @@ void ScRange::Format( String& r, USHORT nFlags, ScDocument* pDoc, switch( rDetails.eConv ) { default : case formula::FormulaGrammar::CONV_OOO: { - BOOL bOneTab = (aStart.Tab() == aEnd.Tab()); + sal_Bool bOneTab = (aStart.Tab() == aEnd.Tab()); if ( !bOneTab ) nFlags |= SCA_TAB_3D; aStart.Format( r, nFlags, pDoc, rDetails ); @@ -1875,7 +1875,7 @@ void ScRange::Format( String& r, USHORT nFlags, ScDocument* pDoc, #undef absrel_differ } -void ScRange::Format( OUString& r, USHORT nFlags, ScDocument* pDoc, +void ScRange::Format( OUString& r, sal_uInt16 nFlags, ScDocument* pDoc, const ScAddress::Details& rDetails ) const { String aStr; @@ -1889,19 +1889,19 @@ bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc ) dx = Col() + dx; dy = Row() + dy; dz = Tab() + dz; - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; if( dx < 0 ) - dx = 0, bValid = FALSE; + dx = 0, bValid = false; else if( dx > MAXCOL ) - dx = MAXCOL, bValid =FALSE; + dx = MAXCOL, bValid =false; if( dy < 0 ) - dy = 0, bValid = FALSE; + dy = 0, bValid = false; else if( dy > MAXROW ) - dy = MAXROW, bValid =FALSE; + dy = MAXROW, bValid =false; if( dz < 0 ) - dz = 0, bValid = FALSE; + dz = 0, bValid = false; else if( dz >= nMaxTab ) - dz = nMaxTab-1, bValid =FALSE; + dz = nMaxTab-1, bValid =false; Set( dx, dy, dz ); return bValid; } @@ -1955,7 +1955,7 @@ String ScRefAddress::GetRefString( ScDocument* pDoc, SCTAB nActTab, return ScGlobal::GetRscString( STR_NOREF_STR ); String aString; - USHORT nFlags = SCA_VALID; + sal_uInt16 nFlags = SCA_VALID; if ( nActTab != Tab() ) { nFlags |= SCA_TAB_3D; diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx index cc7433f20caf..341aee188fd0 100644 --- a/sc/source/core/tool/adiasync.cxx +++ b/sc/source/core/tool/adiasync.cxx @@ -56,7 +56,7 @@ SV_IMPL_PTRARR_SORT( ScAddInDocs, ScAddInDocPtr ); extern "C" { void CALLTYPE ScAddInAsyncCallBack( double& nHandle, void* pData ) { - ScAddInAsync::CallBack( ULONG( nHandle ), pData ); + ScAddInAsync::CallBack( sal_uLong( nHandle ), pData ); } } @@ -70,11 +70,11 @@ ScAddInAsync::ScAddInAsync() : -ScAddInAsync::ScAddInAsync( ULONG nHandleP, USHORT nIndex, ScDocument* pDoc ) : +ScAddInAsync::ScAddInAsync( sal_uLong nHandleP, sal_uInt16 nIndex, ScDocument* pDoc ) : SvtBroadcaster(), pStr( NULL ), nHandle( nHandleP ), - bValid( FALSE ) + bValid( false ) { pDocs = new ScAddInDocs( 1, 1 ); pDocs->Insert( pDoc ); @@ -100,9 +100,9 @@ ScAddInAsync::~ScAddInAsync() -ScAddInAsync* ScAddInAsync::Get( ULONG nHandleP ) +ScAddInAsync* ScAddInAsync::Get( sal_uLong nHandleP ) { - USHORT nPos; + sal_uInt16 nPos; ScAddInAsync* pRet = 0; aSeekObj.nHandle = nHandleP; if ( theAddInAsyncTbl.Seek_Entry( &aSeekObj, &nPos ) ) @@ -113,7 +113,7 @@ ScAddInAsync* ScAddInAsync::Get( ULONG nHandleP ) -void ScAddInAsync::CallBack( ULONG nHandleP, void* pData ) +void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData ) { ScAddInAsync* p; if ( (p = Get( nHandleP )) == NULL ) @@ -141,12 +141,12 @@ void ScAddInAsync::CallBack( ULONG nHandleP, void* pData ) OSL_FAIL( "unbekannter AsyncType" ); return; } - p->bValid = TRUE; + p->bValid = sal_True; p->Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) ); const ScDocument** ppDoc = (const ScDocument**) p->pDocs->GetData(); - USHORT nCount = p->pDocs->Count(); - for ( USHORT j=0; j<nCount; j++, ppDoc++ ) + sal_uInt16 nCount = p->pDocs->Count(); + for ( sal_uInt16 j=0; j<nCount; j++, ppDoc++ ) { ScDocument* pDoc = (ScDocument*)*ppDoc; pDoc->TrackFormulas(); @@ -159,7 +159,7 @@ void ScAddInAsync::CallBack( ULONG nHandleP, void* pData ) void ScAddInAsync::RemoveDocument( ScDocument* pDocumentP ) { - USHORT nPos = theAddInAsyncTbl.Count(); + sal_uInt16 nPos = theAddInAsyncTbl.Count(); if ( nPos ) { const ScAddInAsync** ppAsync = @@ -167,7 +167,7 @@ void ScAddInAsync::RemoveDocument( ScDocument* pDocumentP ) for ( ; nPos-- >0; ppAsync-- ) { // rueckwaerts wg. Pointer-Aufrueckerei im Array ScAddInDocs* p = ((ScAddInAsync*)*ppAsync)->pDocs; - USHORT nFoundPos; + sal_uInt16 nFoundPos; if ( p->Seek_Entry( pDocumentP, &nFoundPos ) ) { p->Remove( nFoundPos ); diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index a973eebc9606..616002e1c0c2 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -55,7 +55,7 @@ using ::rtl::OUString; // STATIC DATA ----------------------------------------------------------- -#define SC_VERSION ((USHORT)304) +#define SC_VERSION ((sal_uInt16)304) //======================================================================== // ScAppOptions - Applikations-Optionen @@ -94,13 +94,13 @@ void ScAppOptions::SetDefaults() nZoom = 100; eZoomType = SVX_ZOOM_PERCENT; - bSynchronizeZoom = TRUE; + bSynchronizeZoom = sal_True; nStatusFunc = SUBTOTAL_FUNC_SUM; - bAutoComplete = TRUE; - bDetectiveAuto = TRUE; + bAutoComplete = sal_True; + bDetectiveAuto = sal_True; delete [] pLRUList; - pLRUList = new USHORT[5]; // sinnvoll vorbelegen + pLRUList = new sal_uInt16[5]; // sinnvoll vorbelegen pLRUList[0] = SC_OPCODE_SUM; pLRUList[1] = SC_OPCODE_AVERAGE; pLRUList[2] = SC_OPCODE_MIN; @@ -146,7 +146,7 @@ const ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy ) //------------------------------------------------------------------------ -void ScAppOptions::SetLRUFuncList( const USHORT* pList, const USHORT nCount ) +void ScAppOptions::SetLRUFuncList( const sal_uInt16* pList, const sal_uInt16 nCount ) { delete [] pLRUList; @@ -154,9 +154,9 @@ void ScAppOptions::SetLRUFuncList( const USHORT* pList, const USHORT nCount ) if ( nLRUFuncCount > 0 ) { - pLRUList = new USHORT[nLRUFuncCount]; + pLRUList = new sal_uInt16[nLRUFuncCount]; - for ( USHORT i=0; i<nLRUFuncCount; i++ ) + for ( sal_uInt16 i=0; i<nLRUFuncCount; i++ ) pLRUList[i] = pList[i]; } else @@ -176,11 +176,11 @@ void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) if ( nCount < USHRT_MAX ) { const sal_Int32* pArray = aSeq.getConstArray(); - USHORT* pUShorts = new USHORT[nCount]; + sal_uInt16* pUShorts = new sal_uInt16[nCount]; for (long i=0; i<nCount; i++) - pUShorts[i] = (USHORT) pArray[i]; + pUShorts[i] = (sal_uInt16) pArray[i]; - rOpt.SetLRUFuncList( pUShorts, sal::static_int_cast<USHORT>(nCount) ); + rOpt.SetLRUFuncList( pUShorts, sal::static_int_cast<sal_uInt16>(nCount) ); delete[] pUShorts; } @@ -190,7 +190,7 @@ void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt ) { long nCount = rOpt.GetLRUFuncListCount(); - USHORT* pUShorts = rOpt.GetLRUFuncList(); + sal_uInt16* pUShorts = rOpt.GetLRUFuncList(); if ( nCount && pUShorts ) { Sequence<sal_Int32> aSeq( nCount ); @@ -214,7 +214,7 @@ void lcl_SetSortList( const Any& rValue ) // if setting is "default", keep default values from ScUserList ctor //! mark "default" in a safe way - BOOL bDefault = ( nCount == 1 && + sal_Bool bDefault = ( nCount == 1 && pArray[0].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "NULL" ) ) ); if (!bDefault) @@ -242,7 +242,7 @@ void lcl_GetSortList( Any& rDest ) Sequence<OUString> aSeq( nCount ); OUString* pArray = aSeq.getArray(); for (long i=0; i<nCount; i++) - pArray[i] = (*pUserList)[sal::static_int_cast<USHORT>(i)]->GetString(); + pArray[i] = (*pUserList)[sal::static_int_cast<sal_uInt16>(i)]->GetString(); rDest <<= aSeq; } else @@ -425,10 +425,10 @@ ScAppCfg::ScAppCfg() : if (pValues[nProp] >>= nIntVal) SetAppMetric( (FieldUnit) nIntVal ); break; case SCLAYOUTOPT_STATUSBAR: - if (pValues[nProp] >>= nIntVal) SetStatusFunc( (USHORT) nIntVal ); + if (pValues[nProp] >>= nIntVal) SetStatusFunc( (sal_uInt16) nIntVal ); break; case SCLAYOUTOPT_ZOOMVAL: - if (pValues[nProp] >>= nIntVal) SetZoom( (USHORT) nIntVal ); + if (pValues[nProp] >>= nIntVal) SetZoom( (sal_uInt16) nIntVal ); break; case SCLAYOUTOPT_ZOOMTYPE: if (pValues[nProp] >>= nIntVal) SetZoomType( (SvxZoomType) nIntVal ); diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 24b22ad1ed20..7492f52ecaa2 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -59,43 +59,43 @@ const sal_Char *linker_dummy = ""; static const sal_Char sAutoTblFmtName[] = "autotbl.fmt"; // bis SO5PF -const USHORT AUTOFORMAT_ID_X = 9501; -const USHORT AUTOFORMAT_ID_358 = 9601; -const USHORT AUTOFORMAT_DATA_ID_X = 9502; +const sal_uInt16 AUTOFORMAT_ID_X = 9501; +const sal_uInt16 AUTOFORMAT_ID_358 = 9601; +const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502; // ab SO5 //! in nachfolgenden Versionen muss der Betrag dieser IDs groesser sein -const USHORT AUTOFORMAT_ID_504 = 9801; -const USHORT AUTOFORMAT_DATA_ID_504 = 9802; +const sal_uInt16 AUTOFORMAT_ID_504 = 9801; +const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802; -const USHORT AUTOFORMAT_ID_552 = 9901; -const USHORT AUTOFORMAT_DATA_ID_552 = 9902; +const sal_uInt16 AUTOFORMAT_ID_552 = 9901; +const sal_uInt16 AUTOFORMAT_DATA_ID_552 = 9902; // --- from 641 on: CJK and CTL font settings -const USHORT AUTOFORMAT_ID_641 = 10001; -const USHORT AUTOFORMAT_DATA_ID_641 = 10002; +const sal_uInt16 AUTOFORMAT_ID_641 = 10001; +const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002; // --- from 680/dr14 on: diagonal frame lines -const USHORT AUTOFORMAT_ID_680DR14 = 10011; -const USHORT AUTOFORMAT_DATA_ID_680DR14 = 10012; +const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011; +const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012; // --- from 680/dr25 on: store strings as UTF-8 -const USHORT AUTOFORMAT_ID_680DR25 = 10021; -const USHORT AUTOFORMAT_DATA_ID_680DR25 = 10022; +const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021; +const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022; // --- from DEV300/overline2 on: overline support -const USHORT AUTOFORMAT_ID_300OVRLN = 10031; -const USHORT AUTOFORMAT_DATA_ID_300OVRLN = 10032; +const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031; +const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032; // aktuelle Version -const USHORT AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN; -const USHORT AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN; +const sal_uInt16 AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN; +const sal_uInt16 AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN; #ifdef READ_OLDVERS -const USHORT AUTOFORMAT_OLD_ID_OLD = 4201; -const USHORT AUTOFORMAT_OLD_DATA_ID = 4202; -const USHORT AUTOFORMAT_OLD_ID_NEW = 4203; +const sal_uInt16 AUTOFORMAT_OLD_ID_OLD = 4201; +const sal_uInt16 AUTOFORMAT_OLD_DATA_ID = 4202; +const sal_uInt16 AUTOFORMAT_OLD_ID_NEW = 4203; #endif @@ -104,34 +104,34 @@ const USHORT AUTOFORMAT_OLD_ID_NEW = 4203; struct ScAfVersions { public: - USHORT nFontVersion; - USHORT nFontHeightVersion; - USHORT nWeightVersion; - USHORT nPostureVersion; - USHORT nUnderlineVersion; - USHORT nOverlineVersion; - USHORT nCrossedOutVersion; - USHORT nContourVersion; - USHORT nShadowedVersion; - USHORT nColorVersion; - USHORT nBoxVersion; - USHORT nLineVersion; - USHORT nBrushVersion; - - USHORT nAdjustVersion; - - USHORT nHorJustifyVersion; - USHORT nVerJustifyVersion; - USHORT nOrientationVersion; - USHORT nMarginVersion; - USHORT nBoolVersion; - USHORT nInt32Version; - USHORT nRotateModeVersion; - - USHORT nNumFmtVersion; + sal_uInt16 nFontVersion; + sal_uInt16 nFontHeightVersion; + sal_uInt16 nWeightVersion; + sal_uInt16 nPostureVersion; + sal_uInt16 nUnderlineVersion; + sal_uInt16 nOverlineVersion; + sal_uInt16 nCrossedOutVersion; + sal_uInt16 nContourVersion; + sal_uInt16 nShadowedVersion; + sal_uInt16 nColorVersion; + sal_uInt16 nBoxVersion; + sal_uInt16 nLineVersion; + sal_uInt16 nBrushVersion; + + sal_uInt16 nAdjustVersion; + + sal_uInt16 nHorJustifyVersion; + sal_uInt16 nVerJustifyVersion; + sal_uInt16 nOrientationVersion; + sal_uInt16 nMarginVersion; + sal_uInt16 nBoolVersion; + sal_uInt16 nInt32Version; + sal_uInt16 nRotateModeVersion; + + sal_uInt16 nNumFmtVersion; ScAfVersions(); - void Load( SvStream& rStream, USHORT nVer ); + void Load( SvStream& rStream, sal_uInt16 nVer ); static void Write(SvStream& rStream); }; @@ -161,7 +161,7 @@ ScAfVersions::ScAfVersions() : { } -void ScAfVersions::Load( SvStream& rStream, USHORT nVer ) +void ScAfVersions::Load( SvStream& rStream, sal_uInt16 nVer ) { rStream >> nFontVersion; rStream >> nFontHeightVersion; @@ -201,8 +201,8 @@ void ScAfVersions::Write(SvStream& rStream) rStream << SvxUnderlineItem(UNDERLINE_NONE, ATTR_FONT_UNDERLINE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxOverlineItem(UNDERLINE_NONE, ATTR_FONT_OVERLINE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxCrossedOutItem(STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << SvxContourItem(sal_False, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << SvxShadowedItem(sal_False, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40); + rStream << SvxContourItem(false, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40); + rStream << SvxShadowedItem(false, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxColorItem(ATTR_FONT_COLOR).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxBoxItem(ATTR_BORDER).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxLineItem(SID_FRAME_LINESTYLE).GetVersion(SOFFICE_FILEFORMAT_40); @@ -218,7 +218,7 @@ void ScAfVersions::Write(SvStream& rStream) rStream << SfxInt32Item(ATTR_ROTATE_VALUE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD,0).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << (USHORT)0; // Num-Format + rStream << (sal_uInt16)0; // Num-Format } // --------------------------------------------------------------------------- @@ -242,8 +242,8 @@ ScAutoFormatDataField::ScAutoFormatDataField() : aUnderline( UNDERLINE_NONE,ATTR_FONT_UNDERLINE ), aOverline( UNDERLINE_NONE,ATTR_FONT_OVERLINE ), aCrossedOut( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT ), - aContour( sal_False, ATTR_FONT_CONTOUR ), - aShadowed( sal_False, ATTR_FONT_SHADOWED ), + aContour( false, ATTR_FONT_CONTOUR ), + aShadowed( false, ATTR_FONT_SHADOWED ), aColor( ATTR_FONT_COLOR ), aBox( ATTR_BORDER ), aTLBR( ATTR_BORDER_TLBR ), @@ -310,7 +310,7 @@ void ScAutoFormatDataField::SetAdjust( const SvxAdjustItem& rAdjust ) aItem = *(ItemType*)pNew; \ delete pNew; -BOOL ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersions, USHORT nVer ) +sal_Bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersions, sal_uInt16 nVer ) { SfxPoolItem* pNew; SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0 ); @@ -394,7 +394,7 @@ BOOL ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersio } #ifdef READ_OLDVERS -BOOL ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) { SfxPoolItem* pNew; SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0 ); @@ -427,7 +427,7 @@ BOOL ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVer } #endif -BOOL ScAutoFormatDataField::Save( SvStream& rStream ) +sal_Bool ScAutoFormatDataField::Save( SvStream& rStream ) { SvxOrientationItem aOrientation( aRotateAngle.GetValue(), aStacked.GetValue(), 0 ); @@ -489,10 +489,10 @@ ScAutoFormatData::ScAutoFormatData() bIncludeJustify = bIncludeFrame = bIncludeBackground = - bIncludeWidthHeight = TRUE; + bIncludeWidthHeight = sal_True; ppDataField = new ScAutoFormatDataField*[ 16 ]; - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) ppDataField[ nIndex ] = new ScAutoFormatDataField; } @@ -508,32 +508,32 @@ ScAutoFormatData::ScAutoFormatData( const ScAutoFormatData& rData ) : bIncludeWidthHeight( rData.bIncludeWidthHeight ) { ppDataField = new ScAutoFormatDataField*[ 16 ]; - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) ppDataField[ nIndex ] = new ScAutoFormatDataField( rData.GetField( nIndex ) ); } ScAutoFormatData::~ScAutoFormatData() { - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) delete ppDataField[ nIndex ]; delete[] ppDataField; } -ScAutoFormatDataField& ScAutoFormatData::GetField( USHORT nIndex ) +ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) { DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } -const ScAutoFormatDataField& ScAutoFormatData::GetField( USHORT nIndex ) const +const ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) const { DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } -const SfxPoolItem* ScAutoFormatData::GetItem( USHORT nIndex, USHORT nWhich ) const +const SfxPoolItem* ScAutoFormatData::GetItem( sal_uInt16 nIndex, sal_uInt16 nWhich ) const { const ScAutoFormatDataField& rField = GetField( nIndex ); switch( nWhich ) @@ -571,7 +571,7 @@ const SfxPoolItem* ScAutoFormatData::GetItem( USHORT nIndex, USHORT nWhich ) con return NULL; } -void ScAutoFormatData::PutItem( USHORT nIndex, const SfxPoolItem& rItem ) +void ScAutoFormatData::PutItem( sal_uInt16 nIndex, const SfxPoolItem& rItem ) { ScAutoFormatDataField& rField = GetField( nIndex ); switch( rItem.Which() ) @@ -608,21 +608,21 @@ void ScAutoFormatData::PutItem( USHORT nIndex, const SfxPoolItem& rItem ) } } -void ScAutoFormatData::CopyItem( USHORT nToIndex, USHORT nFromIndex, USHORT nWhich ) +void ScAutoFormatData::CopyItem( sal_uInt16 nToIndex, sal_uInt16 nFromIndex, sal_uInt16 nWhich ) { const SfxPoolItem* pItem = GetItem( nFromIndex, nWhich ); if( pItem ) PutItem( nToIndex, *pItem ); } -const ScNumFormatAbbrev& ScAutoFormatData::GetNumFormat( USHORT nIndex ) const +const ScNumFormatAbbrev& ScAutoFormatData::GetNumFormat( sal_uInt16 nIndex ) const { return GetField( nIndex ).GetNumFormat(); } -BOOL ScAutoFormatData::IsEqualData( USHORT nIndex1, USHORT nIndex2 ) const +sal_Bool ScAutoFormatData::IsEqualData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const { - BOOL bEqual = TRUE; + sal_Bool bEqual = sal_True; const ScAutoFormatDataField& rField1 = GetField( nIndex1 ); const ScAutoFormatDataField& rField2 = GetField( nIndex2 ); @@ -679,7 +679,7 @@ BOOL ScAutoFormatData::IsEqualData( USHORT nIndex1, USHORT nIndex2 ) const return bEqual; } -void ScAutoFormatData::FillToItemSet( USHORT nIndex, SfxItemSet& rItemSet, ScDocument& rDoc ) const +void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, ScDocument& rDoc ) const { const ScAutoFormatDataField& rField = GetField( nIndex ); @@ -754,7 +754,7 @@ void ScAutoFormatData::FillToItemSet( USHORT nIndex, SfxItemSet& rItemSet, ScDoc rItemSet.Put( rField.GetBackground() ); } -void ScAutoFormatData::GetFromItemSet( USHORT nIndex, const SfxItemSet& rItemSet, const ScNumFormatAbbrev& rNumFormat ) +void ScAutoFormatData::GetFromItemSet( sal_uInt16 nIndex, const SfxItemSet& rItemSet, const ScNumFormatAbbrev& rNumFormat ) { ScAutoFormatDataField& rField = GetField( nIndex ); @@ -789,10 +789,10 @@ void ScAutoFormatData::GetFromItemSet( USHORT nIndex, const SfxItemSet& rItemSet rField.SetRotateMode ( (const SvxRotateModeItem&) rItemSet.Get( ATTR_ROTATE_MODE ) ); } -BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) { - BOOL bRet = TRUE; - USHORT nVer = 0; + sal_Bool bRet = sal_True; + sal_uInt16 nVer = 0; rStream >> nVer; bRet = 0 == rStream.GetError(); if( bRet && (nVer == AUTOFORMAT_DATA_ID_X || @@ -804,7 +804,7 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) if( AUTOFORMAT_DATA_ID_552 <= nVer ) { rStream >> nStrResId; - USHORT nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId; + sal_uInt16 nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId; if( RID_SVXSTR_TBLAFMT_BEGIN <= nId && nId < RID_SVXSTR_TBLAFMT_END ) { @@ -814,7 +814,7 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) nStrResId = USHRT_MAX; } - BOOL b; + sal_Bool b; rStream >> b; bIncludeFont = b; rStream >> b; bIncludeJustify = b; rStream >> b; bIncludeFrame = b; @@ -823,25 +823,25 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) rStream >> b; bIncludeWidthHeight = b; bRet = 0 == rStream.GetError(); - for( USHORT i = 0; bRet && i < 16; ++i ) + for( sal_uInt16 i = 0; bRet && i < 16; ++i ) bRet = GetField( i ).Load( rStream, rVersions, nVer ); } else - bRet = FALSE; + bRet = false; return bRet; } #ifdef READ_OLDVERS -BOOL ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) { - BOOL bRet = TRUE; - USHORT nVal = 0; + sal_Bool bRet = sal_True; + sal_uInt16 nVal = 0; rStream >> nVal; bRet = (rStream.GetError() == 0); if (bRet && (nVal == AUTOFORMAT_OLD_DATA_ID)) { rStream.ReadByteString( aName, rStream.GetStreamCharSet() ); - BOOL b; + sal_Bool b; rStream >> b; bIncludeFont = b; rStream >> b; bIncludeJustify = b; rStream >> b; bIncludeFrame = b; @@ -850,19 +850,19 @@ BOOL ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions rStream >> b; bIncludeWidthHeight = b; bRet = 0 == rStream.GetError(); - for (USHORT i=0; bRet && i < 16; i++) + for (sal_uInt16 i=0; bRet && i < 16; i++) bRet = GetField( i ).LoadOld( rStream, rVersions ); } else - bRet = FALSE; + bRet = false; return bRet; } #endif -BOOL ScAutoFormatData::Save(SvStream& rStream) +sal_Bool ScAutoFormatData::Save(SvStream& rStream) { - USHORT nVal = AUTOFORMAT_DATA_ID; - BOOL b; + sal_uInt16 nVal = AUTOFORMAT_DATA_ID; + sal_Bool b; rStream << nVal; // --- from 680/dr25 on: store strings as UTF-8 rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 ); @@ -875,8 +875,8 @@ BOOL ScAutoFormatData::Save(SvStream& rStream) rStream << ( b = bIncludeValueFormat ); rStream << ( b = bIncludeWidthHeight ); - BOOL bRet = 0 == rStream.GetError(); - for (USHORT i = 0; bRet && (i < 16); i++) + sal_Bool bRet = 0 == rStream.GetError(); + for (sal_uInt16 i = 0; bRet && (i < 16); i++) bRet = GetField( i ).Save( rStream ); return bRet; @@ -885,9 +885,9 @@ BOOL ScAutoFormatData::Save(SvStream& rStream) //--------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------- -ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): +ScAutoFormat::ScAutoFormat(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup): ScSortedCollection (nLim, nDel, bDup), - bSaveLater (FALSE) + bSaveLater (false) { // create default autoformat ScAutoFormatData* pData = new ScAutoFormatData; @@ -933,7 +933,7 @@ ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): SvxBrushItem aGray70Back( Color(0x4d, 0x4d, 0x4d), ATTR_BACKGROUND ); SvxBrushItem aGray20Back( Color(0xcc, 0xcc, 0xcc), ATTR_BACKGROUND ); - for (USHORT i=0; i<16; i++) + for (sal_uInt16 i=0; i<16; i++) { pData->PutItem( i, aBox ); pData->PutItem( i, aFontItem ); @@ -972,7 +972,7 @@ ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): ScAutoFormat::ScAutoFormat(const ScAutoFormat& rAutoFormat) : ScSortedCollection (rAutoFormat), - bSaveLater (FALSE) + bSaveLater (false) {} ScAutoFormat::~ScAutoFormat() @@ -984,7 +984,7 @@ ScAutoFormat::~ScAutoFormat() Save(); } -void ScAutoFormat::SetSaveLater( BOOL bSet ) +void ScAutoFormat::SetSaveLater( sal_Bool bSet ) { bSaveLater = bSet; } @@ -1003,9 +1003,9 @@ short ScAutoFormat::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const return (short) ScGlobal::GetpTransliteration()->compareString( aStr1, aStr2 ); } -BOOL ScAutoFormat::Load() +sal_Bool ScAutoFormat::Load() { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; INetURLObject aURL; SvtPathOptions aPathOpt; @@ -1013,14 +1013,14 @@ BOOL ScAutoFormat::Load() aURL.setFinalSlash(); aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( sAutoTblFmtName ) ) ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ, TRUE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ, sal_True ); SvStream* pStream = aMedium.GetInStream(); bRet = (pStream && pStream->GetError() == 0); if (bRet) { SvStream& rStream = *pStream; // Achtung hier muss ein allgemeiner Header gelesen werden - USHORT nVal = 0; + sal_uInt16 nVal = 0; rStream >> nVal; bRet = 0 == rStream.GetError(); @@ -1031,11 +1031,11 @@ BOOL ScAutoFormat::Load() if( nVal == AUTOFORMAT_ID_358 || (AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) ) { - UINT16 nFileVers = SOFFICE_FILEFORMAT_40; - BYTE nChrSet, nCnt; + sal_uInt16 nFileVers = SOFFICE_FILEFORMAT_40; + sal_uInt8 nChrSet, nCnt; long nPos = rStream.Tell(); rStream >> nCnt >> nChrSet; - if( rStream.Tell() != ULONG(nPos + nCnt) ) + if( rStream.Tell() != sal_uLong(nPos + nCnt) ) { DBG_ERRORFILE( "Der Header enthaelt mehr/neuere Daten" ); rStream.Seek( nPos + nCnt ); @@ -1050,10 +1050,10 @@ BOOL ScAutoFormat::Load() aVersions.Load( rStream, nVal ); // Item-Versionen ScAutoFormatData* pData; - USHORT nAnz = 0; + sal_uInt16 nAnz = 0; rStream >> nAnz; bRet = (rStream.GetError() == 0); - for (USHORT i=0; bRet && (i < nAnz); i++) + for (sal_uInt16 i=0; bRet && (i < nAnz); i++) { pData = new ScAutoFormatData(); bRet = pData->Load(rStream, aVersions); @@ -1087,10 +1087,10 @@ BOOL ScAutoFormat::Load() AUTOFORMAT_OLD_ID_NEW == nVal ) { ScAutoFormatData* pData; - USHORT nAnz = 0; + sal_uInt16 nAnz = 0; rStream >> nAnz; bRet = 0 == rStream.GetError(); - for( USHORT i=0; bRet && (i < nAnz); ++i ) + for( sal_uInt16 i=0; bRet && (i < nAnz); ++i ) { pData = new ScAutoFormatData(); bRet = pData->LoadOld( rStream, aVersions ); @@ -1098,18 +1098,18 @@ BOOL ScAutoFormat::Load() } } else - bRet = FALSE; + bRet = false; } #endif } } - bSaveLater = FALSE; + bSaveLater = false; return bRet; } -BOOL ScAutoFormat::Save() +sal_Bool ScAutoFormat::Save() { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; INetURLObject aURL; SvtPathOptions aPathOpt; @@ -1117,7 +1117,7 @@ BOOL ScAutoFormat::Save() aURL.setFinalSlash(); aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( sAutoTblFmtName ) ) ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE, TRUE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE, sal_True ); SvStream* pStream = aMedium.GetOutStream(); bRet = (pStream && pStream->GetError() == 0); if (bRet) @@ -1126,32 +1126,32 @@ BOOL ScAutoFormat::Save() rStream.SetVersion( SOFFICE_FILEFORMAT_40 ); // Achtung hier muss ein allgemeiner Header gespeichert werden - USHORT nVal = AUTOFORMAT_ID; + sal_uInt16 nVal = AUTOFORMAT_ID; rStream << nVal - << (BYTE)2 // Anzahl von Zeichen des Headers incl. diesem - << (BYTE)::GetSOStoreTextEncoding( - gsl_getSystemTextEncoding(), sal::static_int_cast<USHORT>(rStream.GetVersion()) ); + << (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem + << (sal_uInt8)::GetSOStoreTextEncoding( + gsl_getSystemTextEncoding(), sal::static_int_cast<sal_uInt16>(rStream.GetVersion()) ); ScAfVersions::Write(rStream); // Item-Versionen bRet = (rStream.GetError() == 0); //----------------------------------------------------------- - rStream << (USHORT)(nCount - 1); + rStream << (sal_uInt16)(nCount - 1); bRet = (rStream.GetError() == 0); - for (USHORT i=1; bRet && (i < nCount); i++) + for (sal_uInt16 i=1; bRet && (i < nCount); i++) bRet = ((ScAutoFormatData*)pItems[i])->Save(rStream); rStream.Flush(); aMedium.Commit(); } - bSaveLater = FALSE; + bSaveLater = false; return bRet; } -USHORT ScAutoFormat::FindIndexPerName( const String& rName ) const +sal_uInt16 ScAutoFormat::FindIndexPerName( const String& rName ) const { String aName; - for( USHORT i=0; i<nCount ; i++ ) + for( sal_uInt16 i=0; i<nCount ; i++ ) { ScAutoFormatData* pItem = (ScAutoFormatData*)pItems[i]; pItem->GetName( aName ); diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index ad065f46eba5..67d5d913fc96 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -62,17 +62,17 @@ typedef void (CALLTYPE* ExFuncPtr14)(void*, void*, void*, void*, void*, void*, v typedef void (CALLTYPE* ExFuncPtr15)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); typedef void (CALLTYPE* ExFuncPtr16)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (CALLTYPE* GetFuncCountPtr)(USHORT& nCount); +typedef void (CALLTYPE* GetFuncCountPtr)(sal_uInt16& nCount); typedef void (CALLTYPE* GetFuncDataPtr) - (USHORT& nNo, sal_Char* pFuncName, USHORT& nParamCount, ParamType* peType, sal_Char* pInternalName); + (sal_uInt16& nNo, sal_Char* pFuncName, sal_uInt16& nParamCount, ParamType* peType, sal_Char* pInternalName); -typedef void (CALLTYPE* SetLanguagePtr)( USHORT& nLanguage ); +typedef void (CALLTYPE* SetLanguagePtr)( sal_uInt16& nLanguage ); typedef void (CALLTYPE* GetParamDesc) - (USHORT& nNo, USHORT& nParam, sal_Char* pName, sal_Char* pDesc ); + (sal_uInt16& nNo, sal_uInt16& nParam, sal_Char* pName, sal_Char* pDesc ); -typedef void (CALLTYPE* IsAsync) ( USHORT& nNo, +typedef void (CALLTYPE* IsAsync) ( sal_uInt16& nNo, ParamType* peType ); -typedef void (CALLTYPE* Advice) ( USHORT& nNo, +typedef void (CALLTYPE* Advice) ( sal_uInt16& nNo, AdvData& pfCallback ); typedef void (CALLTYPE* Unadvice)( double& nHandle ); @@ -100,7 +100,7 @@ FuncData::FuncData(const String& rIName) : nParamCount (0), eAsyncType (NONE) { - for (USHORT i = 0; i < MAXFUNCPARAM; i++) + for (sal_uInt16 i = 0; i < MAXFUNCPARAM; i++) eParamType[i] = PTR_DOUBLE; } @@ -109,8 +109,8 @@ FuncData::FuncData(const String& rIName) : FuncData::FuncData(const ModuleData*pModule, const String& rIName, const String& rFName, - USHORT nNo, - USHORT nCount, + sal_uInt16 nNo, + sal_uInt16 nCount, const ParamType* peType, ParamType eType) : pModuleData (pModule), @@ -120,7 +120,7 @@ FuncData::FuncData(const ModuleData*pModule, nParamCount (nCount), eAsyncType (eType) { - for (USHORT i = 0; i < MAXFUNCPARAM; i++) + for (sal_uInt16 i = 0; i < MAXFUNCPARAM; i++) eParamType[i] = peType[i]; } @@ -135,7 +135,7 @@ FuncData::FuncData(const FuncData& rData) : nParamCount (rData.nParamCount), eAsyncType (rData.eAsyncType) { - for (USHORT i = 0; i < MAXFUNCPARAM; i++) + for (sal_uInt16 i = 0; i < MAXFUNCPARAM; i++) eParamType[i] = rData.eParamType[i]; } @@ -149,7 +149,7 @@ short FuncCollection::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const //------------------------------------------------------------------------ -BOOL FuncCollection::SearchFunc( const String& rName, USHORT& rIndex ) const +sal_Bool FuncCollection::SearchFunc( const String& rName, sal_uInt16& rIndex ) const { FuncData aDataObj(rName); return Search( &aDataObj, rIndex ); @@ -176,13 +176,13 @@ public: class ModuleCollection : public ScSortedCollection { public: - ModuleCollection(USHORT nLim = 4, USHORT nDel = 4, BOOL bDup = FALSE) : ScSortedCollection ( nLim, nDel, bDup ) {} + ModuleCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false) : ScSortedCollection ( nLim, nDel, bDup ) {} ModuleCollection(const ModuleCollection& rModuleCollection) : ScSortedCollection ( rModuleCollection ) {} virtual ScDataObject* Clone() const { return new ModuleCollection(*this); } - ModuleData* operator[]( const USHORT nIndex) const {return (ModuleData*)At(nIndex);} + ModuleData* operator[]( const sal_uInt16 nIndex) const {return (ModuleData*)At(nIndex);} virtual short Compare(ScDataObject* pKey1, ScDataObject* pKey2) const; - BOOL SearchModule( const String& rName, + sal_Bool SearchModule( const String& rName, const ModuleData*& rpModule ) const; }; @@ -198,12 +198,12 @@ short ModuleCollection::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const //------------------------------------------------------------------------ -BOOL ModuleCollection::SearchModule( const String& rName, +sal_Bool ModuleCollection::SearchModule( const String& rName, const ModuleData*& rpModule ) const { - USHORT nIndex; + sal_uInt16 nIndex; ModuleData aSearchModule(rName, 0); - BOOL bFound = Search( &aSearchModule, nIndex ); + sal_Bool bFound = Search( &aSearchModule, nIndex ); if (bFound) rpModule = (ModuleData*)At(nIndex); else @@ -213,19 +213,19 @@ BOOL ModuleCollection::SearchModule( const String& rName, //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL InitExternalFunc(const rtl::OUString& rModuleName) +sal_Bool InitExternalFunc(const rtl::OUString& rModuleName) { String aModuleName( rModuleName ); // Module schon geladen? const ModuleData* pTemp; if (aModuleCollection.SearchModule(aModuleName, pTemp)) - return FALSE; + return false; rtl::OUString aNP; aNP = rModuleName; - BOOL bRet = FALSE; + sal_Bool bRet = false; osl::Module* pLib = new osl::Module( aNP ); if (pLib->is()) { @@ -239,7 +239,7 @@ BOOL InitExternalFunc(const rtl::OUString& rModuleName) if ( fpSetLanguage ) { LanguageType eLanguage = Application::GetSettings().GetUILanguage(); - USHORT nLanguage = (USHORT) eLanguage; + sal_uInt16 nLanguage = (sal_uInt16) eLanguage; (*((SetLanguagePtr)fpSetLanguage))( nLanguage ); } @@ -251,20 +251,20 @@ BOOL InitExternalFunc(const rtl::OUString& rModuleName) AdvData pfCallBack = &ScAddInAsyncCallBack; FuncData* pFuncData; FuncCollection* pFuncCol = ScGlobal::GetFuncCollection(); - USHORT nCount; + sal_uInt16 nCount; (*((GetFuncCountPtr)fpGetCount))(nCount); - for (USHORT i=0; i < nCount; i++) + for (sal_uInt16 i=0; i < nCount; i++) { sal_Char cFuncName[256]; sal_Char cInternalName[256]; - USHORT nParamCount; + sal_uInt16 nParamCount; ParamType eParamType[MAXFUNCPARAM]; ParamType eAsyncType = NONE; // alles initialisieren, falls das AddIn sich schlecht verhaelt cFuncName[0] = 0; cInternalName[0] = 0; nParamCount = 0; - for ( USHORT j=0; j<MAXFUNCPARAM; j++ ) + for ( sal_uInt16 j=0; j<MAXFUNCPARAM; j++ ) { eParamType[j] = NONE; } @@ -287,7 +287,7 @@ BOOL InitExternalFunc(const rtl::OUString& rModuleName) eAsyncType ); pFuncCol->Insert(pFuncData); } - bRet = TRUE; + bRet = sal_True; } else delete pLib; @@ -301,8 +301,8 @@ BOOL InitExternalFunc(const rtl::OUString& rModuleName) void ExitExternalFunc() { - USHORT nCount = aModuleCollection.GetCount(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = aModuleCollection.GetCount(); + for (sal_uInt16 i=0; i<nCount; i++) { ModuleData* pData = aModuleCollection[i]; pData->FreeInstance(); @@ -311,9 +311,9 @@ void ExitExternalFunc() //------------------------------------------------------------------------ -BOOL FuncData::Call(void** ppParam) +sal_Bool FuncData::Call(void** ppParam) { - BOOL bRet = FALSE; + sal_Bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(aFuncName); if (fProc != NULL) @@ -322,81 +322,81 @@ BOOL FuncData::Call(void** ppParam) { case 1 : (*((ExFuncPtr1)fProc))(ppParam[0]); - bRet = TRUE; + bRet = sal_True; break; case 2 : (*((ExFuncPtr2)fProc))(ppParam[0], ppParam[1]); - bRet = TRUE; + bRet = sal_True; break; case 3 : (*((ExFuncPtr3)fProc))(ppParam[0], ppParam[1], ppParam[2]); - bRet = TRUE; + bRet = sal_True; break; case 4 : (*((ExFuncPtr4)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3]); - bRet = TRUE; + bRet = sal_True; break; case 5 : (*((ExFuncPtr5)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4]); - bRet = TRUE; + bRet = sal_True; break; case 6 : (*((ExFuncPtr6)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5]); - bRet = TRUE; + bRet = sal_True; break; case 7 : (*((ExFuncPtr7)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6]); - bRet = TRUE; + bRet = sal_True; break; case 8 : (*((ExFuncPtr8)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7]); - bRet = TRUE; + bRet = sal_True; break; case 9 : (*((ExFuncPtr9)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8]); - bRet = TRUE; + bRet = sal_True; break; case 10 : (*((ExFuncPtr10)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9]); - bRet = TRUE; + bRet = sal_True; break; case 11 : (*((ExFuncPtr11)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10]); - bRet = TRUE; + bRet = sal_True; break; case 12: (*((ExFuncPtr12)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11]); - bRet = TRUE; + bRet = sal_True; break; case 13: (*((ExFuncPtr13)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12]); - bRet = TRUE; + bRet = sal_True; break; case 14 : (*((ExFuncPtr14)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13]); - bRet = TRUE; + bRet = sal_True; break; case 15 : (*((ExFuncPtr15)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13], ppParam[14]); - bRet = TRUE; + bRet = sal_True; break; case 16 : (*((ExFuncPtr16)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13], ppParam[14], ppParam[15]); - bRet = TRUE; + bRet = sal_True; break; default : break; } @@ -406,15 +406,15 @@ BOOL FuncData::Call(void** ppParam) //------------------------------------------------------------------------ -BOOL FuncData::Unadvice( double nHandle ) +sal_Bool FuncData::Unadvice( double nHandle ) { - BOOL bRet = FALSE; + sal_Bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(LIBFUNCNAME(UNADVICE)); if (fProc != NULL) { ((::Unadvice)fProc)(nHandle); - bRet = TRUE; + bRet = sal_True; } return bRet; } diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index f68587399ce8..48be5206566b 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -47,10 +47,10 @@ const ScFormulaCell* pLastFormulaTreeTop = 0; // ----------------------------------------------------------------------- -void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString, +void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rString, Color** ppColor, SvNumberFormatter& rFormatter, - BOOL bNullVals, - BOOL bFormula, + sal_Bool bNullVals, + sal_Bool bFormula, ScForceTextFmt eForceTextFmt ) { *ppColor = NULL; @@ -121,7 +121,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString, } else { - USHORT nErrCode = pFCell->GetErrCode(); + sal_uInt16 nErrCode = pFCell->GetErrCode(); // get the number format only after interpretation (GetErrCode): if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) @@ -156,7 +156,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString, } } -void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rString, +void ScCellFormat::GetInputString( ScBaseCell* pCell, sal_uLong nFormat, String& rString, SvNumberFormatter& rFormatter ) { if (&rFormatter==NULL) @@ -200,7 +200,7 @@ void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rSt ((ScFormulaCell*)pCell)->GetString( rString ); } - USHORT nErrCode = ((ScFormulaCell*)pCell)->GetErrCode(); + sal_uInt16 nErrCode = ((ScFormulaCell*)pCell)->GetErrCode(); if (nErrCode != 0) { rString.Erase(); diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index 4f851fdc76b2..6148dac2fa11 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -85,7 +85,7 @@ ScChartArray::ScChartArray( ScDocument* pDoc, SCTAB nTab, aName( rChartName ), pDocument( pDoc ), aPositioner(pDoc, nTab, nStartColP, nStartRowP, nEndColP, nEndRowP), - bValid( TRUE ) + bValid( sal_True ) { } @@ -94,7 +94,7 @@ ScChartArray::ScChartArray( ScDocument* pDoc, const ScRangeListRef& rRangeList, aName( rChartName ), pDocument( pDoc ), aPositioner(pDoc, rRangeList), - bValid( TRUE ) + bValid( sal_True ) { } @@ -116,7 +116,7 @@ ScDataObject* ScChartArray::Clone() const return new ScChartArray(*this); } -BOOL ScChartArray::operator==(const ScChartArray& rCmp) const +sal_Bool ScChartArray::operator==(const ScChartArray& rCmp) const { return aPositioner == rCmp.aPositioner && aName == rCmp.aName; @@ -226,16 +226,16 @@ ScMemChart* ScChartArray::CreateMemChartSingle() nRowCount = 0; } - BOOL bValidData = TRUE; + sal_Bool bValidData = sal_True; if ( !nColCount ) { - bValidData = FALSE; + bValidData = false; nColCount = 1; aCols.push_back(nStrCol); } if ( !nRowCount ) { - bValidData = FALSE; + bValidData = false; nRowCount = 1; aRows.push_back(nStrRow); } @@ -250,7 +250,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() { if ( bValidData ) { - BOOL bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); + sal_Bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); ScBaseCell* pCell; for (nCol=0; nCol<nColCount; nCol++) { @@ -350,15 +350,15 @@ ScMemChart* ScChartArray::CreateMemChartMulti() nRowCount = 0; } - BOOL bValidData = TRUE; + sal_Bool bValidData = sal_True; if ( !nColCount ) { - bValidData = FALSE; + bValidData = false; nColCount = 1; } if ( !nRowCount ) { - bValidData = FALSE; + bValidData = false; nRowCount = 1; } @@ -372,8 +372,8 @@ ScMemChart* ScChartArray::CreateMemChartMulti() { SCSIZE nCol = 0; SCSIZE nRow = 0; - BOOL bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); - ULONG nIndex = 0; + sal_Bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); + sal_uLong nIndex = 0; if (bValidData) { for ( nCol = 0; nCol < nColCount; nCol++ ) @@ -393,7 +393,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() nVal = ((ScValueCell*)pCell)->GetValue(); if ( bCalcAsShown && nVal != 0.0 ) { - ULONG nFormat = pDocument->GetNumberFormat( *pPos ); + sal_uLong nFormat = pDocument->GetNumberFormat( *pPos ); nVal = pDocument->RoundValueAsShown( nVal, nFormat ); } } @@ -426,7 +426,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() nVal = ((ScValueCell*)pCell)->GetValue(); if ( bCalcAsShown && nVal != 0.0 ) { - ULONG nFormat = pDocument->GetNumberFormat( *pPos ); + sal_uLong nFormat = pDocument->GetNumberFormat( *pPos ); nVal = pDocument->RoundValueAsShown( nVal, nFormat ); } } @@ -516,16 +516,16 @@ ScDataObject* ScChartCollection::Clone() const return new ScChartCollection(*this); } -BOOL ScChartCollection::operator==(const ScChartCollection& rCmp) const +sal_Bool ScChartCollection::operator==(const ScChartCollection& rCmp) const { if (nCount != rCmp.nCount) - return FALSE; + return false; - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) if (!((*(const ScChartArray*)pItems[i]) == (*(const ScChartArray*)rCmp.pItems[i]))) - return FALSE; + return false; - return TRUE; + return sal_True; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 422d7694b820..47854ec57f37 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -34,6 +34,7 @@ #include "drwlayer.hxx" #include "rangelst.hxx" #include "chartlis.hxx" +#include "docuno.hxx" #include <svx/svditer.hxx> #include <svx/svdoole2.hxx> @@ -51,16 +52,16 @@ namespace { -USHORT lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, BOOL bAllCharts ) +sal_uInt16 lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) return 0; - USHORT nFound = 0; + sal_uInt16 nFound = 0; - USHORT nPageCount = pModel->GetPageCount(); - for (USHORT nPageNo=0; nPageNo<nPageCount; nPageNo++) + sal_uInt16 nPageCount = pModel->GetPageCount(); + for (sal_uInt16 nPageNo=0; nPageNo<nPageCount; nPageNo++) { SdrPage* pPage = pModel->GetPage(nPageNo); DBG_ASSERT(pPage,"Page ?"); @@ -72,12 +73,12 @@ USHORT lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, BOOL bAllCha if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart( pObject ) ) { String aName = ((SdrOle2Obj*)pObject)->GetPersistName(); - BOOL bHit = TRUE; + sal_Bool bHit = sal_True; if ( !bAllCharts ) { ScRangeList aRanges; - BOOL bColHeaders = FALSE; - BOOL bRowHeaders = FALSE; + sal_Bool bColHeaders = false; + sal_Bool bRowHeaders = false; pDoc->GetOldChartParameters( aName, aRanges, bColHeaders, bRowHeaders ); bHit = aRanges.In( rPos ); } @@ -93,7 +94,7 @@ USHORT lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, BOOL bAllCha return nFound; } -BOOL lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTab, SCTAB nTabCount ) +sal_Bool lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTab, SCTAB nTabCount ) { //! if multiple sheets are copied, update references into the other copied sheets? @@ -126,9 +127,9 @@ BOOL lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTab, S }//end anonymous namespace // === ScChartHelper ====================================== -USHORT ScChartHelper::DoUpdateAllCharts( ScDocument* pDoc ) +sal_uInt16 ScChartHelper::DoUpdateAllCharts( ScDocument* pDoc ) { - return lcl_DoUpdateCharts( ScAddress(), pDoc, TRUE ); + return lcl_DoUpdateCharts( ScAddress(), pDoc, sal_True ); } void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab ) diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx index f8fa036dc095..2fa1ede0b851 100644 --- a/sc/source/core/tool/chartlis.cxx +++ b/sc/source/core/tool/chartlis.cxx @@ -128,9 +128,9 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, mpTokens(new vector<ScTokenRef>), pUnoData( NULL ), pDoc( pDocP ), - bUsed( FALSE ), - bDirty( FALSE ), - bSeriesRangesScheduled( FALSE ) + bUsed( false ), + bDirty( false ), + bSeriesRangesScheduled( false ) { SetRangeList( rRange ); } @@ -143,9 +143,9 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, mpTokens(new vector<ScTokenRef>), pUnoData( NULL ), pDoc( pDocP ), - bUsed( FALSE ), - bDirty( FALSE ), - bSeriesRangesScheduled( FALSE ) + bUsed( false ), + bDirty( false ), + bSeriesRangesScheduled( false ) { ScRefTokenHelper::getTokensFromRangeList(*mpTokens, *rRangeList); } @@ -157,9 +157,9 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, vector mpTokens(pTokens), pUnoData( NULL ), pDoc( pDocP ), - bUsed( FALSE ), - bDirty( FALSE ), - bSeriesRangesScheduled( FALSE ) + bUsed( false ), + bDirty( false ), + bSeriesRangesScheduled( false ) { } @@ -170,7 +170,7 @@ ScChartListener::ScChartListener( const ScChartListener& r ) : mpTokens(new vector<ScTokenRef>(*r.mpTokens)), pUnoData( NULL ), pDoc( r.pDoc ), - bUsed( FALSE ), + bUsed( false ), bDirty( r.bDirty ), bSeriesRangesScheduled( r.bSeriesRangesScheduled ) { @@ -256,7 +256,7 @@ void ScChartListener::Update() } if ( pUnoData ) { - bDirty = FALSE; + bDirty = false; //! irgendwann mal erkennen, was sich innerhalb des Charts geaendert hat chart::ChartDataChangeEvent aEvent( pUnoData->GetSource(), chart::ChartDataChangeType_ALL, @@ -265,7 +265,7 @@ void ScChartListener::Update() } else if ( pDoc->GetAutoCalc() ) { - bDirty = FALSE; + bDirty = false; pDoc->UpdateChart( GetString()); } } @@ -375,13 +375,13 @@ void ScChartListener::EndListeningTo() void ScChartListener::ChangeListening( const ScRangeListRef& rRangeListRef, - BOOL bDirtyP ) + sal_Bool bDirtyP ) { EndListeningTo(); SetRangeList( rRangeListRef ); StartListeningTo(); if ( bDirtyP ) - SetDirty( TRUE ); + SetDirty( sal_True ); } @@ -389,7 +389,7 @@ void ScChartListener::UpdateScheduledSeriesRanges() { if ( bSeriesRangesScheduled ) { - bSeriesRangesScheduled = FALSE; + bSeriesRangesScheduled = false; UpdateSeriesRanges(); } } @@ -429,7 +429,7 @@ void ScChartListener::SetUpdateQueue() pDoc->GetChartListenerCollection()->StartTimer(); } -BOOL ScChartListener::operator==( const ScChartListener& r ) +sal_Bool ScChartListener::operator==( const ScChartListener& r ) { bool b1 = (mpTokens.get() && !mpTokens->empty()); bool b2 = (r.mpTokens.get() && !r.mpTokens->empty()); @@ -465,7 +465,7 @@ ScChartListenerCollection::RangeListenerItem::RangeListenerItem(const ScRange& r } ScChartListenerCollection::ScChartListenerCollection( ScDocument* pDocP ) : - ScStrCollection( 4, 4, FALSE ), + ScStrCollection( 4, 4, false ), pDoc( pDocP ) { aTimer.SetTimeoutHdl( LINK( this, ScChartListenerCollection, TimerHdl ) ); @@ -496,18 +496,18 @@ ScDataObject* ScChartListenerCollection::Clone() const void ScChartListenerCollection::StartAllListeners() { - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ((ScChartListener*) pItems[ nIndex ])->StartListeningTo(); } } void ScChartListenerCollection::ChangeListening( const String& rName, - const ScRangeListRef& rRangeListRef, BOOL bDirty ) + const ScRangeListRef& rRangeListRef, sal_Bool bDirty ) { ScChartListener aCLSearcher( rName, pDoc, rRangeListRef ); ScChartListener* pCL; - USHORT nIndex; + sal_uInt16 nIndex; if ( Search( &aCLSearcher, nIndex ) ) { pCL = (ScChartListener*) pItems[ nIndex ]; @@ -521,13 +521,13 @@ void ScChartListenerCollection::ChangeListening( const String& rName, } pCL->StartListeningTo(); if ( bDirty ) - pCL->SetDirty( TRUE ); + pCL->SetDirty( sal_True ); } void ScChartListenerCollection::FreeUnused() { // rueckwaerts wg. Pointer-Aufrueckerei im Array - for ( USHORT nIndex = nCount; nIndex-- >0; ) + for ( sal_uInt16 nIndex = nCount; nIndex-- >0; ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; // Uno-Charts nicht rauskicken @@ -535,7 +535,7 @@ void ScChartListenerCollection::FreeUnused() if ( !pCL->IsUno() ) { if ( pCL->IsUsed() ) - pCL->SetUsed( FALSE ); + pCL->SetUsed( false ); else Free( pCL ); } @@ -546,7 +546,7 @@ void ScChartListenerCollection::FreeUno( const uno::Reference< chart::XChartData const uno::Reference< chart::XChartData >& rSource ) { // rueckwaerts wg. Pointer-Aufrueckerei im Array - for ( USHORT nIndex = nCount; nIndex-- >0; ) + for ( sal_uInt16 nIndex = nCount; nIndex-- >0; ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; if ( pCL->IsUno() && @@ -578,7 +578,7 @@ IMPL_LINK( ScChartListenerCollection, TimerHdl, Timer*, EMPTYARG ) void ScChartListenerCollection::UpdateDirtyCharts() { - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; if ( pCL->IsDirty() ) @@ -591,24 +591,24 @@ void ScChartListenerCollection::UpdateDirtyCharts() void ScChartListenerCollection::SetDirty() { - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; - pCL->SetDirty( TRUE ); + pCL->SetDirty( sal_True ); } StartTimer(); } void ScChartListenerCollection::SetDiffDirty( - const ScChartListenerCollection& rCmp, BOOL bSetChartRangeLists ) + const ScChartListenerCollection& rCmp, sal_Bool bSetChartRangeLists ) { - BOOL bDirty = FALSE; - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + sal_Bool bDirty = false; + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; - USHORT nFound; - BOOL bFound = rCmp.Search( pCL, nFound ); + sal_uInt16 nFound; + sal_Bool bFound = rCmp.Search( pCL, nFound ); if ( !bFound || (*pCL != *((const ScChartListener*) rCmp.pItems[ nFound ])) ) { if ( bSetChartRangeLists ) @@ -618,16 +618,16 @@ void ScChartListenerCollection::SetDiffDirty( const ScRangeListRef& rList1 = pCL->GetRangeList(); const ScRangeListRef& rList2 = ((const ScChartListener*) rCmp.pItems[ nFound ])->GetRangeList(); - BOOL b1 = rList1.Is(); - BOOL b2 = rList2.Is(); + sal_Bool b1 = rList1.Is(); + sal_Bool b2 = rList2.Is(); if ( b1 != b2 || (b1 && b2 && (*rList1 != *rList2)) ) pDoc->SetChartRangeList( pCL->GetString(), rList1 ); } else pDoc->SetChartRangeList( pCL->GetString(), pCL->GetRangeList() ); } - bDirty = TRUE; - pCL->SetDirty( TRUE ); + bDirty = sal_True; + pCL->SetDirty( sal_True ); } } if ( bDirty ) @@ -637,15 +637,15 @@ void ScChartListenerCollection::SetDiffDirty( void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange ) { - BOOL bDirty = FALSE; - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + sal_Bool bDirty = false; + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; const ScRangeListRef& rList = pCL->GetRangeList(); if ( rList.Is() && rList->Intersects( rRange ) ) { - bDirty = TRUE; - pCL->SetDirty( TRUE ); + bDirty = sal_True; + pCL->SetDirty( sal_True ); } } if ( bDirty ) @@ -663,7 +663,7 @@ void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange ) void ScChartListenerCollection::UpdateScheduledSeriesRanges() { - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; pCL->UpdateScheduledSeriesRanges(); @@ -674,7 +674,7 @@ void ScChartListenerCollection::UpdateScheduledSeriesRanges() void ScChartListenerCollection::UpdateChartsContainingTab( SCTAB nTab ) { ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab ); - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ]; pCL->UpdateChartIntersecting( aRange ); @@ -682,19 +682,19 @@ void ScChartListenerCollection::UpdateChartsContainingTab( SCTAB nTab ) } -BOOL ScChartListenerCollection::operator==( const ScChartListenerCollection& r ) +sal_Bool ScChartListenerCollection::operator==( const ScChartListenerCollection& r ) { // hier nicht ScStrCollection::operator==() verwenden, der umstaendlich via // IsEqual und Compare laeuft, stattdessen ScChartListener::operator==() if ( pDoc != r.pDoc || nCount != r.nCount ) - return FALSE; - for ( USHORT nIndex = 0; nIndex < nCount; nIndex++ ) + return false; + for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { if ( *((ScChartListener*) pItems[ nIndex ]) != *((ScChartListener*) r.pItems[ nIndex ]) ) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScChartListenerCollection::StartListeningHiddenRange( const ScRange& rRange, ScChartHiddenRangeListener* pListener ) diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 06d508308981..7baa02ad5dc7 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -37,6 +37,22 @@ #include "document.hxx" #include "rechead.hxx" +namespace +{ + bool lcl_hasValueDataButNoDates( ScDocument* pDocument, SCCOL nCol, SCROW nRow, SCTAB nTab ) + { + bool bReturn = false; + if (pDocument->HasValueData( nCol, nRow, nTab )) + { + //treat dates like text #i25706# + sal_uInt32 nNumberFormat = pDocument->GetNumberFormat( ScAddress( nCol, nRow, nTab ) ); + short nType = pDocument->GetFormatTable()->GetType(nNumberFormat); + bool bIsDate = (nType & NUMBERFORMAT_DATE); + bReturn = !bIsDate; + } + return bReturn; + } +} ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab, SCCOL nStartColP, SCROW nStartRowP, SCCOL nEndColP, SCROW nEndRowP) : @@ -45,9 +61,9 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab, eGlue( SC_CHARTGLUE_NA ), nStartCol(0), nStartRow(0), - bColHeaders( FALSE ), - bRowHeaders( FALSE ), - bDummyUpperLeft( FALSE ) + bColHeaders( false ), + bRowHeaders( false ), + bDummyUpperLeft( false ) { SetRangeList( ScRange( nStartColP, nStartRowP, nTab, nEndColP, nEndRowP, nTab ) ); CheckColRowHeaders(); @@ -60,9 +76,9 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, const ScRangeListRef& rR eGlue( SC_CHARTGLUE_NA ), nStartCol(0), nStartRow(0), - bColHeaders( FALSE ), - bRowHeaders( FALSE ), - bDummyUpperLeft( FALSE ) + bColHeaders( false ), + bRowHeaders( false ), + bDummyUpperLeft( false ) { if ( aRangeListRef.Is() ) CheckColRowHeaders(); @@ -86,7 +102,7 @@ ScChartPositioner::~ScChartPositioner() delete pPositionMap; } -BOOL ScChartPositioner::operator==(const ScChartPositioner& rCmp) const +sal_Bool ScChartPositioner::operator==(const ScChartPositioner& rCmp) const { return bColHeaders == rCmp.bColHeaders && bRowHeaders == rCmp.bRowHeaders @@ -104,7 +120,7 @@ void ScChartPositioner::GlueState() { if ( eGlue != SC_CHARTGLUE_NA ) return; - bDummyUpperLeft = FALSE; + bDummyUpperLeft = false; ScRange* pR; if ( aRangeListRef->size() <= 1 ) { @@ -158,7 +174,7 @@ void ScChartPositioner::GlueState() eGlue = SC_CHARTGLUE_COLS; return; } - ULONG nCR = (ULONG)nC * nR; + sal_uLong nCR = (sal_uLong)nC * nR; //2do: /* Erstmal simpel ohne Bitmaskiererei, maximal koennten so 8MB alloziert @@ -168,29 +184,13 @@ void ScChartPositioner::GlueState() Zeilen/Spalten abzulegen, wuerde aber ein weiteres durchlaufen der RangeList und indirekten Zugriff auf das Array bedeuten. */ - const BYTE nHole = 0; - const BYTE nOccu = 1; - const BYTE nFree = 2; - const BYTE nGlue = 3; -#ifdef WIN - // we hate 16bit, don't we? - BYTE huge* p; - BYTE huge* pA = (BYTE huge*) SvMemAlloc( nCR ); - if ( nCR > (ULONG)((USHORT)~0) ) - { // in 32k Bloecken initialisieren - ULONG j; - for ( j=0; j<nCR; j+=0x8000 ) - { - memset( pA+j, nHole, Min( (ULONG)0x8000, nCR-j ) ); - } - } - else - memset( pA, nHole, nCR * sizeof(BYTE) ); -#else - BYTE* p; - BYTE* pA = new BYTE[ nCR ]; - memset( pA, 0, nCR * sizeof(BYTE) ); -#endif + const sal_uInt8 nHole = 0; + const sal_uInt8 nOccu = 1; + const sal_uInt8 nFree = 2; + const sal_uInt8 nGlue = 3; + sal_uInt8* p; + sal_uInt8* pA = new sal_uInt8[ nCR ]; + memset( pA, 0, nCR * sizeof(sal_uInt8) ); SCCOL nCol, nCol1, nCol2; SCROW nRow, nRow1, nRow2; @@ -203,17 +203,17 @@ void ScChartPositioner::GlueState() nRow2 = pR->aEnd.Row() - nStartRow; for ( nCol = nCol1; nCol <= nCol2; nCol++ ) { - p = pA + (ULONG)nCol * nR + nRow1; + p = pA + (sal_uLong)nCol * nR + nRow1; for ( nRow = nRow1; nRow <= nRow2; nRow++, p++ ) *p = nOccu; } } - BOOL bGlue = TRUE; + sal_Bool bGlue = sal_True; - BOOL bGlueCols = FALSE; + sal_Bool bGlueCols = false; for ( nCol = 0; bGlue && nCol < nC; nCol++ ) { // Spalten probieren durchzugehen und als frei markieren - p = pA + (ULONG)nCol * nR; + p = pA + (sal_uLong)nCol * nR; for ( nRow = 0; bGlue && nRow < nR; nRow++, p++ ) { if ( *p == nOccu ) @@ -221,21 +221,21 @@ void ScChartPositioner::GlueState() // moeglich. Am Rand koennte ok sein, wenn in dieser Spalte // in jeder belegten Zeile einer belegt ist. if ( nRow > 0 && nCol > 0 ) - bGlue = FALSE; // nCol==0 kann DummyUpperLeft sein + bGlue = false; // nCol==0 kann DummyUpperLeft sein else nRow = nR; } else *p = nFree; } - if ( bGlue && *(p = (pA + ((((ULONG)nCol+1) * nR) - 1))) == nFree ) + if ( bGlue && *(p = (pA + ((((sal_uLong)nCol+1) * nR) - 1))) == nFree ) { // Spalte als komplett frei markieren *p = nGlue; - bGlueCols = TRUE; // mindestens eine freie Spalte + bGlueCols = sal_True; // mindestens eine freie Spalte } } - BOOL bGlueRows = FALSE; + sal_Bool bGlueRows = false; for ( nRow = 0; bGlue && nRow < nR; nRow++ ) { // Zeilen probieren durchzugehen und als frei markieren p = pA + nRow; @@ -244,28 +244,28 @@ void ScChartPositioner::GlueState() if ( *p == nOccu ) { if ( nCol > 0 && nRow > 0 ) - bGlue = FALSE; // nRow==0 kann DummyUpperLeft sein + bGlue = false; // nRow==0 kann DummyUpperLeft sein else nCol = nC; } else *p = nFree; } - if ( bGlue && *(p = (pA + ((((ULONG)nC-1) * nR) + nRow))) == nFree ) + if ( bGlue && *(p = (pA + ((((sal_uLong)nC-1) * nR) + nRow))) == nFree ) { // Zeile als komplett frei markieren *p = nGlue; - bGlueRows = TRUE; // mindestens eine freie Zeile + bGlueRows = sal_True; // mindestens eine freie Zeile } } // n=1: die linke obere Ecke koennte bei Beschriftung automagisch // hinzugezogen werden p = pA + 1; - for ( ULONG n = 1; bGlue && n < nCR; n++, p++ ) + for ( sal_uLong n = 1; bGlue && n < nCR; n++, p++ ) { // ein unberuehrtes Feld heisst, dass es weder spaltenweise noch // zeilenweise zu erreichen war, also nichts zusamenzufassen if ( *p == nHole ) - bGlue = FALSE; + bGlue = false; } if ( bGlue ) { @@ -276,18 +276,14 @@ void ScChartPositioner::GlueState() else eGlue = SC_CHARTGLUE_COLS; if ( *pA != nOccu ) - bDummyUpperLeft = TRUE; + bDummyUpperLeft = sal_True; } else { eGlue = SC_CHARTGLUE_NONE; } -#ifdef WIN - SvMemFree( pA ); -#else delete [] pA; -#endif } void ScChartPositioner::CheckColRowHeaders() @@ -296,31 +292,31 @@ void ScChartPositioner::CheckColRowHeaders() SCROW nRow1, nRow2, iRow; SCTAB nTab1, nTab2; - BOOL bColStrings = TRUE; - BOOL bRowStrings = TRUE; + sal_Bool bColStrings = sal_True; + sal_Bool bRowStrings = sal_True; GlueState(); if ( aRangeListRef->size() == 1 ) { aRangeListRef->front()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); if ( nCol1 > nCol2 || nRow1 > nRow2 ) - bColStrings = bRowStrings = FALSE; + bColStrings = bRowStrings = false; else { for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (pDocument->HasValueData( iCol, nRow1, nTab1 )) - bColStrings = FALSE; + if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) + bColStrings = false; } for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (pDocument->HasValueData( nCol1, iRow, nTab1 )) - bRowStrings = FALSE; + if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) + bRowStrings = false; } } } else { - BOOL bVert = (eGlue == SC_CHARTGLUE_NONE || eGlue == SC_CHARTGLUE_ROWS); + sal_Bool bVert = (eGlue == SC_CHARTGLUE_NONE || eGlue == SC_CHARTGLUE_ROWS); for ( size_t i = 0, nRanges = aRangeListRef->size(); (i < nRanges) && (bColStrings || bRowStrings); ++i @@ -328,15 +324,15 @@ void ScChartPositioner::CheckColRowHeaders() { ScRange* pR = (*aRangeListRef)[i]; pR->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); - BOOL bTopRow = (nRow1 == nStartRow); + sal_Bool bTopRow = (nRow1 == nStartRow); if ( bRowStrings && (bVert || nCol1 == nStartCol) ) { // NONE oder ROWS: RowStrings in jeder Selektion moeglich // COLS oder BOTH: nur aus der ersten Spalte if ( nCol1 <= nCol2 ) for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (pDocument->HasValueData( nCol1, iRow, nTab1 )) - bRowStrings = FALSE; + if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) + bRowStrings = false; } } if ( bColStrings && bTopRow ) @@ -344,8 +340,8 @@ void ScChartPositioner::CheckColRowHeaders() if ( nRow1 <= nRow2 ) for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (pDocument->HasValueData( iCol, nRow1, nTab1 )) - bColStrings = FALSE; + if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) + bColStrings = false; } } } @@ -388,7 +384,7 @@ void ScChartPositioner::CreatePositionMap() GlueState(); - BOOL bNoGlue = (eGlue == SC_CHARTGLUE_NONE); + sal_Bool bNoGlue = (eGlue == SC_CHARTGLUE_NONE); Table* pCols = new Table; Table* pNewRowTable = new Table; ScAddress* pNewAddress = new ScAddress; @@ -402,8 +398,8 @@ void ScChartPositioner::CreatePositionMap() for ( nTab = nTab1; nTab <= nTab2; nTab++ ) { // nTab im ColKey, um gleiche Col/Row in anderer Table haben zu koennen - ULONG nInsCol = (static_cast<ULONG>(nTab) << 16) | (bNoGlue ? 0 : - static_cast<ULONG>(nCol1)); + sal_uLong nInsCol = (static_cast<sal_uLong>(nTab) << 16) | (bNoGlue ? 0 : + static_cast<sal_uLong>(nCol1)); for ( nCol = nCol1; nCol <= nCol2; ++nCol, ++nInsCol ) { if ( bNoGlue || eGlue == SC_CHARTGLUE_ROWS ) @@ -427,7 +423,7 @@ void ScChartPositioner::CreatePositionMap() } // bei anderer Tabelle wurde bereits neuer ColKey erzeugt, // die Zeilen muessen fuer's Dummy fuellen gleich sein! - ULONG nInsRow = (bNoGlue ? nNoGlueRow : nRow1); + sal_uLong nInsRow = (bNoGlue ? nNoGlueRow : nRow1); for ( nRow = nRow1; nRow <= nRow2; nRow++, nInsRow++ ) { if ( pCol->Insert( nInsRow, pNewAddress ) ) @@ -489,11 +485,11 @@ void ScChartPositioner::CreatePositionMap() if ( bNoGlue ) { // Luecken mit Dummies fuellen, erste Spalte ist Master Table* pFirstCol = (Table*) pCols->First(); - ULONG nCount = pFirstCol->Count(); + sal_uLong nCount = pFirstCol->Count(); pFirstCol->First(); - for ( ULONG n = 0; n < nCount; n++, pFirstCol->Next() ) + for ( sal_uLong n = 0; n < nCount; n++, pFirstCol->Next() ) { - ULONG nKey = pFirstCol->GetCurKey(); + sal_uLong nKey = pFirstCol->GetCurKey(); pCols->First(); while ( (pCol = (Table*) pCols->Next())!=NULL ) pCol->Insert( nKey, (void*)0 ); // keine Daten @@ -518,14 +514,11 @@ ScChartPositionMap::ScChartPositionMap( SCCOL nChartCols, SCROW nChartRows, ppData( new ScAddress* [ nChartCols * nChartRows ] ), ppColHeader( new ScAddress* [ nChartCols ] ), ppRowHeader( new ScAddress* [ nChartRows ] ), - nCount( (ULONG) nChartCols * nChartRows ), + nCount( (sal_uLong) nChartCols * nChartRows ), nColCount( nChartCols ), nRowCount( nChartRows ) { DBG_ASSERT( nColCount && nRowCount, "ScChartPositionMap without dimension" ); -#ifdef WIN -#error ScChartPositionMap not implemented for 16-bit dumdums -#endif ScAddress* pPos; SCCOL nCol; @@ -557,7 +550,7 @@ ScChartPositionMap::ScChartPositionMap( SCCOL nChartCols, SCROW nChartRows, pCol = (Table*) rCols.Next(); // Daten spaltenweise und Spalten-Header - ULONG nIndex = 0; + sal_uLong nIndex = 0; for ( nCol = 0; nCol < nColCount; nCol++ ) { if ( pCol ) @@ -591,7 +584,7 @@ ScChartPositionMap::ScChartPositionMap( SCCOL nChartCols, SCROW nChartRows, ScChartPositionMap::~ScChartPositionMap() { - for ( ULONG nIndex=0; nIndex < nCount; nIndex++ ) + for ( sal_uLong nIndex=0; nIndex < nCount; nIndex++ ) { delete ppData[nIndex]; } diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 55be05cc12b9..dd9ecebe89d5 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -62,10 +62,10 @@ DECLARE_STACK( ScChangeActionStack, ScChangeAction* ) -const USHORT nMemPoolChangeActionCellListEntry = (0x2000 - 64) / sizeof(ScChangeActionCellListEntry); +const sal_uInt16 nMemPoolChangeActionCellListEntry = (0x2000 - 64) / sizeof(ScChangeActionCellListEntry); IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionCellListEntry, nMemPoolChangeActionCellListEntry, nMemPoolChangeActionCellListEntry ) -const USHORT nMemPoolChangeActionLinkEntry = (0x8000 - 64) / sizeof(ScChangeActionLinkEntry); +const sal_uInt16 nMemPoolChangeActionLinkEntry = (0x8000 - 64) / sizeof(ScChangeActionLinkEntry); IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionLinkEntry, nMemPoolChangeActionLinkEntry, nMemPoolChangeActionLinkEntry ) // loaded MSB > eigenes => inkompatibel @@ -92,7 +92,7 @@ ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScRange& rRange } ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScBigRange& rRange, - const ULONG nTempAction, const ULONG nTempRejectAction, + const sal_uLong nTempAction, const sal_uLong nTempRejectAction, const ScChangeActionState eTempState, const DateTime& aTempDateTime, const String& aTempUser, const String& aTempComment) : @@ -114,7 +114,7 @@ ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScBigRange& rRa } ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScBigRange& rRange, - const ULONG nTempAction) + const sal_uLong nTempAction) : aBigRange( rRange ), pNext( NULL ), @@ -138,45 +138,45 @@ ScChangeAction::~ScChangeAction() } -BOOL ScChangeAction::IsVisible() const +sal_Bool ScChangeAction::IsVisible() const { //! sequence order of execution is significant if ( IsRejected() || GetType() == SC_CAT_DELETE_TABS || IsDeletedIn() ) - return FALSE; + return false; if ( GetType() == SC_CAT_CONTENT ) return ((ScChangeActionContent*)this)->IsTopContent(); - return TRUE; + return sal_True; } -BOOL ScChangeAction::IsTouchable() const +sal_Bool ScChangeAction::IsTouchable() const { //! sequence order of execution is significant if ( IsRejected() || GetType() == SC_CAT_REJECT || IsDeletedIn() ) - return FALSE; + return false; // content may reject and be touchable if on top if ( GetType() == SC_CAT_CONTENT ) return ((ScChangeActionContent*)this)->IsTopContent(); if ( IsRejecting() ) - return FALSE; - return TRUE; + return false; + return sal_True; } -BOOL ScChangeAction::IsClickable() const +sal_Bool ScChangeAction::IsClickable() const { //! sequence order of execution is significant if ( !IsVirgin() ) - return FALSE; + return false; if ( IsDeletedIn() ) - return FALSE; + return false; if ( GetType() == SC_CAT_CONTENT ) { ScChangeActionContentCellType eCCT = ScChangeActionContent::GetContentCellType( ((ScChangeActionContent*)this)->GetNewCell() ); if ( eCCT == SC_CACCT_MATREF ) - return FALSE; + return false; if ( eCCT == SC_CACCT_MATORG ) { // no Accept-Select if one of the references is in a deleted col/row const ScChangeActionLinkEntry* pL = @@ -185,101 +185,101 @@ BOOL ScChangeAction::IsClickable() const { ScChangeAction* p = (ScChangeAction*) pL->GetAction(); if ( p && p->IsDeletedIn() ) - return FALSE; + return false; pL = pL->GetNext(); } } - return TRUE; // for Select() a content doesn't have to be touchable + return sal_True; // for Select() a content doesn't have to be touchable } return IsTouchable(); // Accept()/Reject() only on touchables } -BOOL ScChangeAction::IsRejectable() const +sal_Bool ScChangeAction::IsRejectable() const { //! sequence order of execution is significant if ( !IsClickable() ) - return FALSE; + return false; if ( GetType() == SC_CAT_CONTENT ) { if ( ((ScChangeActionContent*)this)->IsOldMatrixReference() ) - return FALSE; + return false; ScChangeActionContent* pNextContent = ((ScChangeActionContent*)this)->GetNextContent(); if ( pNextContent == NULL ) - return TRUE; // *this is TopContent + return sal_True; // *this is TopContent return pNextContent->IsRejected(); // *this is next rejectable } return IsTouchable(); } -BOOL ScChangeAction::IsInternalRejectable() const +sal_Bool ScChangeAction::IsInternalRejectable() const { //! sequence order of execution is significant if ( !IsVirgin() ) - return FALSE; + return false; if ( IsDeletedIn() ) - return FALSE; + return false; if ( GetType() == SC_CAT_CONTENT ) { ScChangeActionContent* pNextContent = ((ScChangeActionContent*)this)->GetNextContent(); if ( pNextContent == NULL ) - return TRUE; // *this is TopContent + return sal_True; // *this is TopContent return pNextContent->IsRejected(); // *this is next rejectable } return IsTouchable(); } -BOOL ScChangeAction::IsDialogRoot() const +sal_Bool ScChangeAction::IsDialogRoot() const { return IsInternalRejectable(); // only rejectables in root } -BOOL ScChangeAction::IsDialogParent() const +sal_Bool ScChangeAction::IsDialogParent() const { //! sequence order of execution is significant if ( GetType() == SC_CAT_CONTENT ) { if ( !IsDialogRoot() ) - return FALSE; + return false; if ( ((ScChangeActionContent*)this)->IsMatrixOrigin() && HasDependent() ) - return TRUE; + return sal_True; ScChangeActionContent* pPrevContent = ((ScChangeActionContent*)this)->GetPrevContent(); return pPrevContent && pPrevContent->IsVirgin(); } if ( HasDependent() ) - return IsDeleteType() ? TRUE : !IsDeletedIn(); + return IsDeleteType() ? sal_True : !IsDeletedIn(); if ( HasDeleted() ) { if ( IsDeleteType() ) { if ( IsDialogRoot() ) - return TRUE; + return sal_True; ScChangeActionLinkEntry* pL = pLinkDeleted; while ( pL ) { ScChangeAction* p = pL->GetAction(); if ( p && p->GetType() != eType ) - return TRUE; + return sal_True; pL = pL->GetNext(); } } else - return TRUE; + return sal_True; } - return FALSE; + return false; } -BOOL ScChangeAction::IsMasterDelete() const +sal_Bool ScChangeAction::IsMasterDelete() const { if ( !IsDeleteType() ) - return FALSE; + return false; ScChangeActionDel* pDel = (ScChangeActionDel*) this; return pDel->IsMultiDelete() && (pDel->IsTopDelete() || pDel->IsRejectable()); } @@ -301,9 +301,9 @@ void ScChangeAction::RemoveAllAnyLinks() } -BOOL ScChangeAction::RemoveDeletedIn( const ScChangeAction* p ) +sal_Bool ScChangeAction::RemoveDeletedIn( const ScChangeAction* p ) { - BOOL bRemoved = FALSE; + sal_Bool bRemoved = false; ScChangeActionLinkEntry* pL = GetDeletedIn(); while ( pL ) { @@ -311,7 +311,7 @@ BOOL ScChangeAction::RemoveDeletedIn( const ScChangeAction* p ) if ( pL->GetAction() == p ) { delete pL; - bRemoved = TRUE; + bRemoved = sal_True; } pL = pNextLink; } @@ -319,16 +319,16 @@ BOOL ScChangeAction::RemoveDeletedIn( const ScChangeAction* p ) } -BOOL ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const +sal_Bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const { ScChangeActionLinkEntry* pL = GetDeletedIn(); while ( pL ) { if ( pL->GetAction() == p ) - return TRUE; + return sal_True; pL = pL->GetNext(); } - return FALSE; + return false; } @@ -340,7 +340,7 @@ void ScChangeAction::RemoveAllDeletedIn() } -BOOL ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const +sal_Bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const { ScChangeAction* p; ScChangeActionLinkEntry* pL = GetDeletedIn(); @@ -366,11 +366,11 @@ BOOL ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const { if ( (p = pL->GetAction()) != NULL && (p->GetType() == eDelType || p->GetType() == eInsType) ) - return TRUE; + return sal_True; pL = pL->GetNext(); } } - return FALSE; + return false; } @@ -410,14 +410,14 @@ DateTime ScChangeAction::GetDateTime() const void ScChangeAction::UpdateReference( const ScChangeTrack* /* pTrack */, UpdateRefMode eMode, const ScBigRange& rRange, - INT32 nDx, INT32 nDy, INT32 nDz ) + sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) { ScRefUpdate::Update( eMode, rRange, nDx, nDy, nDz, GetBigRange() ); } void ScChangeAction::GetDescription( String& rStr, ScDocument* /* pDoc */, - BOOL /* bSplitRange */, bool bWarning ) const + sal_Bool /* bSplitRange */, bool bWarning ) const { if ( IsRejecting() && bWarning ) { @@ -460,7 +460,7 @@ void ScChangeAction::GetDescription( String& rStr, ScDocument* /* pDoc */, else if (pReject->HasDependent()) { ScChangeActionTable aTable; - pCT->GetDependents( pReject, aTable, FALSE, TRUE ); + pCT->GetDependents( pReject, aTable, false, sal_True ); for ( const ScChangeAction* p = aTable.First(); p; p = aTable.Next() ) { @@ -488,10 +488,10 @@ void ScChangeAction::GetDescription( String& rStr, ScDocument* /* pDoc */, String ScChangeAction::GetRefString( const ScBigRange& rRange, - ScDocument* pDoc, BOOL bFlag3D ) const + ScDocument* pDoc, sal_Bool bFlag3D ) const { String aStr; - USHORT nFlags = ( rRange.IsValid( pDoc ) ? SCA_VALID : 0 ); + sal_uInt16 nFlags = ( rRange.IsValid( pDoc ) ? SCA_VALID : 0 ); if ( !nFlags ) aStr = ScGlobal::GetRscString( STR_NOREF_STR ); else @@ -537,7 +537,7 @@ String ScChangeAction::GetRefString( const ScBigRange& rRange, void ScChangeAction::GetRefString( String& rStr, ScDocument* pDoc, - BOOL bFlag3D ) const + sal_Bool bFlag3D ) const { rStr = GetRefString( GetBigRange(), pDoc, bFlag3D ); } @@ -580,7 +580,7 @@ void ScChangeAction::RejectRestoreContents( ScChangeTrack* pTrack, } } SetState( SC_CAS_REJECTED ); // vor UpdateReference fuer Move - pTrack->UpdateReference( this, TRUE ); // LinkDeleted freigeben + pTrack->UpdateReference( this, sal_True ); // LinkDeleted freigeben DBG_ASSERT( !pLinkDeleted, "ScChangeAction::RejectRestoreContents: pLinkDeleted != NULL" ); // Liste der Contents abarbeiten und loeschen ScDocument* pDoc = pTrack->GetDocument(); @@ -599,7 +599,7 @@ void ScChangeAction::RejectRestoreContents( ScChangeTrack* pTrack, } -void ScChangeAction::SetDeletedInThis( ULONG nActionNumber, +void ScChangeAction::SetDeletedInThis( sal_uLong nActionNumber, const ScChangeTrack* pTrack ) { if ( nActionNumber ) @@ -612,7 +612,7 @@ void ScChangeAction::SetDeletedInThis( ULONG nActionNumber, } -void ScChangeAction::AddDependent( ULONG nActionNumber, +void ScChangeAction::AddDependent( sal_uLong nActionNumber, const ScChangeTrack* pTrack ) { if ( nActionNumber ) @@ -658,7 +658,7 @@ ScChangeActionIns::ScChangeActionIns( const ScRange& rRange ) } -ScChangeActionIns::ScChangeActionIns(const ULONG nActionNumber, const ScChangeActionState eStateP, const ULONG nRejectingNumber, +ScChangeActionIns::ScChangeActionIns(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String& sComment, const ScChangeActionType eTypeP) : @@ -672,11 +672,11 @@ ScChangeActionIns::~ScChangeActionIns() void ScChangeActionIns::GetDescription( String& rStr, ScDocument* pDoc, - BOOL bSplitRange, bool bWarning ) const + sal_Bool bSplitRange, bool bWarning ) const { ScChangeAction::GetDescription( rStr, pDoc, bSplitRange, bWarning ); - USHORT nWhatId; + sal_uInt16 nWhatId; switch ( GetType() ) { case SC_CAT_INSERT_COLS : @@ -699,15 +699,15 @@ void ScChangeActionIns::GetDescription( String& rStr, ScDocument* pDoc, } -BOOL ScChangeActionIns::Reject( ScDocument* pDoc ) +sal_Bool ScChangeActionIns::Reject( ScDocument* pDoc ) { if ( !aBigRange.IsValid( pDoc ) ) - return FALSE; + return false; ScRange aRange( aBigRange.MakeRange() ); if ( !pDoc->IsBlockEditable( aRange.aStart.Tab(), aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row() ) ) - return FALSE; + return false; switch ( GetType() ) { @@ -727,7 +727,7 @@ BOOL ScChangeActionIns::Reject( ScDocument* pDoc ) } SetState( SC_CAS_REJECTED ); RemoveAllLinks(); - return TRUE; + return sal_True; } @@ -771,7 +771,7 @@ ScChangeActionDel::ScChangeActionDel( const ScRange& rRange, } -ScChangeActionDel::ScChangeActionDel(const ULONG nActionNumber, const ScChangeActionState eStateP, const ULONG nRejectingNumber, +ScChangeActionDel::ScChangeActionDel(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, const ScChangeActionType eTypeP, const SCsCOLROW nD, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type : @@ -811,40 +811,40 @@ void ScChangeActionDel::DeleteCellEntries() } -BOOL ScChangeActionDel::IsBaseDelete() const +sal_Bool ScChangeActionDel::IsBaseDelete() const { return !GetDx() && !GetDy(); } -BOOL ScChangeActionDel::IsTopDelete() const +sal_Bool ScChangeActionDel::IsTopDelete() const { const ScChangeAction* p = GetNext(); if ( !p || p->GetType() != GetType() ) - return TRUE; + return sal_True; return ((ScChangeActionDel*)p)->IsBaseDelete(); } -BOOL ScChangeActionDel::IsMultiDelete() const +sal_Bool ScChangeActionDel::IsMultiDelete() const { if ( GetDx() || GetDy() ) - return TRUE; + return sal_True; const ScChangeAction* p = GetNext(); if ( !p || p->GetType() != GetType() ) - return FALSE; + return false; const ScChangeActionDel* pDel = (const ScChangeActionDel*) p; if ( (pDel->GetDx() > GetDx() || pDel->GetDy() > GetDy()) && pDel->GetBigRange() == aBigRange ) - return TRUE; - return FALSE; + return sal_True; + return false; } -BOOL ScChangeActionDel::IsTabDeleteCol() const +sal_Bool ScChangeActionDel::IsTabDeleteCol() const { if ( GetType() != SC_CAT_DELETE_COLS ) - return FALSE; + return false; const ScChangeAction* p = this; while ( p && p->GetType() == SC_CAT_DELETE_COLS && !((const ScChangeActionDel*)p)->IsTopDelete() ) @@ -855,7 +855,7 @@ BOOL ScChangeActionDel::IsTabDeleteCol() const void ScChangeActionDel::UpdateReference( const ScChangeTrack* /* pTrack */, UpdateRefMode eMode, const ScBigRange& rRange, - INT32 nDxP, INT32 nDyP, INT32 nDz ) + sal_Int32 nDxP, sal_Int32 nDyP, sal_Int32 nDz ) { ScRefUpdate::Update( eMode, rRange, nDxP, nDyP, nDz, GetBigRange() ); if ( !IsDeletedIn() ) @@ -901,11 +901,11 @@ ScBigRange ScChangeActionDel::GetOverAllRange() const void ScChangeActionDel::GetDescription( String& rStr, ScDocument* pDoc, - BOOL bSplitRange, bool bWarning ) const + sal_Bool bSplitRange, bool bWarning ) const { ScChangeAction::GetDescription( rStr, pDoc, bSplitRange, bWarning ); - USHORT nWhatId; + sal_uInt16 nWhatId; switch ( GetType() ) { case SC_CAT_DELETE_COLS : @@ -940,12 +940,12 @@ void ScChangeActionDel::GetDescription( String& rStr, ScDocument* pDoc, } -BOOL ScChangeActionDel::Reject( ScDocument* pDoc ) +sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc ) { if ( !aBigRange.IsValid( pDoc ) && GetType() != SC_CAT_DELETE_TABS ) - return FALSE; + return false; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; if ( IsTopDelete() ) { // den kompletten Bereich in einem Rutsch restaurieren @@ -955,30 +955,30 @@ BOOL ScChangeActionDel::Reject( ScDocument* pDoc ) if ( GetType() == SC_CAT_DELETE_TABS ) { // wird Tab angehaengt? if ( aTmpRange.aStart.Tab() > pDoc->GetMaxTableNumber() ) - bOk = FALSE; + bOk = false; } else - bOk = FALSE; + bOk = false; } if ( bOk ) { ScRange aRange( aTmpRange.MakeRange() ); // InDelete... fuer Formel UpdateReference in Document pTrack->SetInDeleteRange( aRange ); - pTrack->SetInDeleteTop( TRUE ); - pTrack->SetInDeleteUndo( TRUE ); - pTrack->SetInDelete( TRUE ); + pTrack->SetInDeleteTop( sal_True ); + pTrack->SetInDeleteUndo( sal_True ); + pTrack->SetInDelete( sal_True ); switch ( GetType() ) { case SC_CAT_DELETE_COLS : if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL) ) { // nur wenn nicht TabDelete - if ( ( bOk = pDoc->CanInsertCol( aRange ) ) != FALSE ) + if ( ( bOk = pDoc->CanInsertCol( aRange ) ) != false ) bOk = pDoc->InsertCol( aRange ); } break; case SC_CAT_DELETE_ROWS : - if ( ( bOk = pDoc->CanInsertRow( aRange ) ) != FALSE ) + if ( ( bOk = pDoc->CanInsertRow( aRange ) ) != false ) bOk = pDoc->InsertRow( aRange ); break; case SC_CAT_DELETE_TABS : @@ -986,7 +986,7 @@ BOOL ScChangeActionDel::Reject( ScDocument* pDoc ) //2do: Tabellennamen merken? String aName; pDoc->CreateValidTabName( aName ); - if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != FALSE ) + if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != false ) bOk = pDoc->InsertTab( aRange.aStart.Tab(), aName ); } break; @@ -995,13 +995,13 @@ BOOL ScChangeActionDel::Reject( ScDocument* pDoc ) // added to avoid warnings } } - pTrack->SetInDelete( FALSE ); - pTrack->SetInDeleteUndo( FALSE ); + pTrack->SetInDelete( false ); + pTrack->SetInDeleteUndo( false ); } if ( !bOk ) { - pTrack->SetInDeleteTop( FALSE ); - return FALSE; + pTrack->SetInDeleteTop( false ); + return false; } // InDeleteTop fuer UpdateReference-Undo behalten } @@ -1009,9 +1009,9 @@ BOOL ScChangeActionDel::Reject( ScDocument* pDoc ) // setzt rejected und ruft UpdateReference-Undo und DeleteCellEntries RejectRestoreContents( pTrack, GetDx(), GetDy() ); - pTrack->SetInDeleteTop( FALSE ); + pTrack->SetInDeleteTop( false ); RemoveAllLinks(); - return TRUE; + return sal_True; } @@ -1099,7 +1099,7 @@ void ScChangeActionDel::UndoCutOffInsert() // --- ScChangeActionMove -------------------------------------------------- -ScChangeActionMove::ScChangeActionMove(const ULONG nActionNumber, const ScChangeActionState eStateP, const ULONG nRejectingNumber, +ScChangeActionMove::ScChangeActionMove(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScBigRange& aToBigRange, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, const ScBigRange& aFromBigRange, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type : @@ -1134,14 +1134,14 @@ void ScChangeActionMove::DeleteCellEntries() void ScChangeActionMove::UpdateReference( const ScChangeTrack* /* pTrack */, UpdateRefMode eMode, const ScBigRange& rRange, - INT32 nDx, INT32 nDy, INT32 nDz ) + sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) { ScRefUpdate::Update( eMode, rRange, nDx, nDy, nDz, aFromRange ); ScRefUpdate::Update( eMode, rRange, nDx, nDy, nDz, GetBigRange() ); } -void ScChangeActionMove::GetDelta( INT32& nDx, INT32& nDy, INT32& nDz ) const +void ScChangeActionMove::GetDelta( sal_Int32& nDx, sal_Int32& nDy, sal_Int32& nDz ) const { const ScBigAddress& rToPos = GetBigRange().aStart; const ScBigAddress& rFromPos = GetFromRange().aStart; @@ -1152,11 +1152,11 @@ void ScChangeActionMove::GetDelta( INT32& nDx, INT32& nDy, INT32& nDz ) const void ScChangeActionMove::GetDescription( String& rStr, ScDocument* pDoc, - BOOL bSplitRange, bool bWarning ) const + sal_Bool bSplitRange, bool bWarning ) const { ScChangeAction::GetDescription( rStr, pDoc, bSplitRange, bWarning ); - BOOL bFlag3D = ( GetFromRange().aStart.Tab() != GetBigRange().aStart.Tab() ); + sal_Bool bFlag3D = ( GetFromRange().aStart.Tab() != GetBigRange().aStart.Tab() ); String aRsc( ScGlobal::GetRscString( STR_CHANGED_MOVE ) ); @@ -1178,7 +1178,7 @@ void ScChangeActionMove::GetDescription( String& rStr, ScDocument* pDoc, void ScChangeActionMove::GetRefString( String& rStr, ScDocument* pDoc, - BOOL bFlag3D ) const + sal_Bool bFlag3D ) const { if ( !bFlag3D ) bFlag3D = ( GetFromRange().aStart.Tab() != GetBigRange().aStart.Tab() ); @@ -1189,15 +1189,15 @@ void ScChangeActionMove::GetRefString( String& rStr, ScDocument* pDoc, } -BOOL ScChangeActionMove::Reject( ScDocument* pDoc ) +sal_Bool ScChangeActionMove::Reject( ScDocument* pDoc ) { if ( !(aBigRange.IsValid( pDoc ) && aFromRange.IsValid( pDoc )) ) - return FALSE; + return false; ScRange aToRange( aBigRange.MakeRange() ); ScRange aFrmRange( aFromRange.MakeRange() ); - BOOL bOk = pDoc->IsBlockEditable( aToRange.aStart.Tab(), + sal_Bool bOk = pDoc->IsBlockEditable( aToRange.aStart.Tab(), aToRange.aStart.Col(), aToRange.aStart.Row(), aToRange.aEnd.Col(), aToRange.aEnd.Row() ); if ( bOk ) @@ -1205,7 +1205,7 @@ BOOL ScChangeActionMove::Reject( ScDocument* pDoc ) aFrmRange.aStart.Col(), aFrmRange.aStart.Row(), aFrmRange.aEnd.Col(), aFrmRange.aEnd.Row() ); if ( !bOk ) - return FALSE; + return false; pTrack->LookUpContents( aToRange, pDoc, 0, 0, 0 ); // zu movende Contents @@ -1247,17 +1247,17 @@ BOOL ScChangeActionMove::Reject( ScDocument* pDoc ) } RemoveAllLinks(); - return TRUE; + return sal_True; } // --- ScChangeActionContent ----------------------------------------------- -const USHORT nMemPoolChangeActionContent = (0x8000 - 64) / sizeof(ScChangeActionContent); +const sal_uInt16 nMemPoolChangeActionContent = (0x8000 - 64) / sizeof(ScChangeActionContent); IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionContent, nMemPoolChangeActionContent, nMemPoolChangeActionContent ) -ScChangeActionContent::ScChangeActionContent( const ULONG nActionNumber, - const ScChangeActionState eStateP, const ULONG nRejectingNumber, +ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, + const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String& sComment, ScBaseCell* pTempOldCell, ScDocument* pDoc, const String& sOldValue ) @@ -1278,7 +1278,7 @@ ScChangeActionContent::ScChangeActionContent( const ULONG nActionNumber, aOldValue = sOldValue; // set again, because SetCell removes it } -ScChangeActionContent::ScChangeActionContent( const ULONG nActionNumber, +ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ScBaseCell* pTempNewCell, const ScBigRange& aBigRangeP, ScDocument* pDoc, const String& sNewValue ) : @@ -1343,7 +1343,7 @@ ScChangeActionLinkEntry** ScChangeActionContent::GetDeletedInAddress() void ScChangeActionContent::SetOldValue( const ScBaseCell* pCell, - const ScDocument* pFromDoc, ScDocument* pToDoc, ULONG nFormat ) + const ScDocument* pFromDoc, ScDocument* pToDoc, sal_uLong nFormat ) { ScChangeActionContent::SetValue( aOldValue, pOldCell, nFormat, pCell, pFromDoc, pToDoc ); @@ -1367,8 +1367,8 @@ void ScChangeActionContent::SetNewValue( const ScBaseCell* pCell, void ScChangeActionContent::SetOldNewCells( ScBaseCell* pOldCellP, - ULONG nOldFormat, ScBaseCell* pNewCellP, - ULONG nNewFormat, ScDocument* pDoc ) + sal_uLong nOldFormat, ScBaseCell* pNewCellP, + sal_uLong nNewFormat, ScDocument* pDoc ) { pOldCell = pOldCellP; pNewCell = pNewCellP; @@ -1400,7 +1400,7 @@ void ScChangeActionContent::SetValueString( String& rValue, ScBaseCell*& pCell, rValue.Erase(); pCell = new ScFormulaCell( pDoc, aBigRange.aStart.MakeAddress(), rStr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::CONV_OOO ); - ((ScFormulaCell*)pCell)->SetInChangeTrack( TRUE ); + ((ScFormulaCell*)pCell)->SetInChangeTrack( sal_True ); } else rValue = rStr; @@ -1432,7 +1432,7 @@ void ScChangeActionContent::GetNewString( String& rStr ) const void ScChangeActionContent::GetDescription( String& rStr, ScDocument* pDoc, - BOOL bSplitRange, bool bWarning ) const + sal_Bool bSplitRange, bool bWarning ) const { ScChangeAction::GetDescription( rStr, pDoc, bSplitRange, bWarning ); @@ -1467,9 +1467,9 @@ void ScChangeActionContent::GetDescription( String& rStr, ScDocument* pDoc, void ScChangeActionContent::GetRefString( String& rStr, ScDocument* pDoc, - BOOL bFlag3D ) const + sal_Bool bFlag3D ) const { - USHORT nFlags = ( GetBigRange().IsValid( pDoc ) ? SCA_VALID : 0 ); + sal_uInt16 nFlags = ( GetBigRange().IsValid( pDoc ) ? SCA_VALID : 0 ); if ( nFlags ) { const ScBaseCell* pCell = GetNewCell(); @@ -1501,25 +1501,25 @@ void ScChangeActionContent::GetRefString( String& rStr, ScDocument* pDoc, } -BOOL ScChangeActionContent::Reject( ScDocument* pDoc ) +sal_Bool ScChangeActionContent::Reject( ScDocument* pDoc ) { if ( !aBigRange.IsValid( pDoc ) ) - return FALSE; + return false; PutOldValueToDoc( pDoc, 0, 0 ); SetState( SC_CAS_REJECTED ); RemoveAllLinks(); - return TRUE; + return sal_True; } -BOOL ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack, - BOOL bOldest, Stack* pRejectActions ) +sal_Bool ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack, + sal_Bool bOldest, Stack* pRejectActions ) { if ( !aBigRange.IsValid( pDoc ) ) - return FALSE; + return false; ScChangeActionContent* pContent = this; // accept previous contents @@ -1574,7 +1574,7 @@ BOOL ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack, else SetState( SC_CAS_ACCEPTED ); - return TRUE; + return sal_True; } @@ -1594,7 +1594,7 @@ void ScChangeActionContent::GetStringOfCell( String& rStr, void ScChangeActionContent::GetStringOfCell( String& rStr, - const ScBaseCell* pCell, const ScDocument* pDoc, ULONG nFormat ) + const ScBaseCell* pCell, const ScDocument* pDoc, sal_uLong nFormat ) { if ( ScChangeActionContent::GetContentCellType( pCell ) ) { @@ -1660,7 +1660,7 @@ ScChangeActionContentCellType ScChangeActionContent::GetContentCellType( const S } -BOOL ScChangeActionContent::NeedsNumberFormat( const ScBaseCell* pCell ) +sal_Bool ScChangeActionContent::NeedsNumberFormat( const ScBaseCell* pCell ) { return pCell && pCell->GetCellType() == CELLTYPE_VALUE; } @@ -1670,12 +1670,12 @@ void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell, const ScAddress& rPos, const ScBaseCell* pOrgCell, const ScDocument* pFromDoc, ScDocument* pToDoc ) { - ULONG nFormat = NeedsNumberFormat( pOrgCell ) ? pFromDoc->GetNumberFormat( rPos ) : 0; + sal_uLong nFormat = NeedsNumberFormat( pOrgCell ) ? pFromDoc->GetNumberFormat( rPos ) : 0; SetValue( rStr, pCell, nFormat, pOrgCell, pFromDoc, pToDoc ); } void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell, - ULONG nFormat, const ScBaseCell* pOrgCell, + sal_uLong nFormat, const ScBaseCell* pOrgCell, const ScDocument* pFromDoc, ScDocument* pToDoc ) { rStr.Erase(); @@ -1694,7 +1694,7 @@ void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell, } break; case CELLTYPE_FORMULA : - ((ScFormulaCell*)pCell)->SetInChangeTrack( TRUE ); + ((ScFormulaCell*)pCell)->SetInChangeTrack( sal_True ); break; default: { @@ -1708,7 +1708,7 @@ void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell, void ScChangeActionContent::SetCell( String& rStr, ScBaseCell* pCell, - ULONG nFormat, const ScDocument* pDoc ) + sal_uLong nFormat, const ScDocument* pDoc ) { rStr.Erase(); if ( pCell ) @@ -1723,7 +1723,7 @@ void ScChangeActionContent::SetCell( String& rStr, ScBaseCell* pCell, } break; case CELLTYPE_FORMULA : - ((ScFormulaCell*)pCell)->SetInChangeTrack( TRUE ); + ((ScFormulaCell*)pCell)->SetInChangeTrack( sal_True ); break; default: { @@ -1862,19 +1862,19 @@ void lcl_InvalidateReference( ScToken& rTok, const ScBigAddress& rPos ) { rRef1.nCol = SCCOL_MAX; rRef1.nRelCol = SCCOL_MAX; - rRef1.SetColDeleted( TRUE ); + rRef1.SetColDeleted( sal_True ); } if ( rPos.Row() < 0 || MAXROW < rPos.Row() ) { rRef1.nRow = SCROW_MAX; rRef1.nRelRow = SCROW_MAX; - rRef1.SetRowDeleted( TRUE ); + rRef1.SetRowDeleted( sal_True ); } if ( rPos.Tab() < 0 || MAXTAB < rPos.Tab() ) { rRef1.nTab = SCTAB_MAX; rRef1.nRelTab = SCTAB_MAX; - rRef1.SetTabDeleted( TRUE ); + rRef1.SetTabDeleted( sal_True ); } if ( rTok.GetType() == formula::svDoubleRef ) { @@ -1883,19 +1883,19 @@ void lcl_InvalidateReference( ScToken& rTok, const ScBigAddress& rPos ) { rRef2.nCol = SCCOL_MAX; rRef2.nRelCol = SCCOL_MAX; - rRef2.SetColDeleted( TRUE ); + rRef2.SetColDeleted( sal_True ); } if ( rPos.Row() < 0 || MAXROW < rPos.Row() ) { rRef2.nRow = SCROW_MAX; rRef2.nRelRow = SCROW_MAX; - rRef2.SetRowDeleted( TRUE ); + rRef2.SetRowDeleted( sal_True ); } if ( rPos.Tab() < 0 || MAXTAB < rPos.Tab() ) { rRef2.nTab = SCTAB_MAX; rRef2.nRelTab = SCTAB_MAX; - rRef2.SetTabDeleted( TRUE ); + rRef2.SetTabDeleted( sal_True ); } } } @@ -1903,7 +1903,7 @@ void lcl_InvalidateReference( ScToken& rTok, const ScBigAddress& rPos ) void ScChangeActionContent::UpdateReference( const ScChangeTrack* pTrack, UpdateRefMode eMode, const ScBigRange& rRange, - INT32 nDx, INT32 nDy, INT32 nDz ) + sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) { SCSIZE nOldSlot = ScChangeTrack::ComputeContentSlot( aBigRange.aStart.Row() ); ScRefUpdate::Update( eMode, rRange, nDx, nDy, nDz, aBigRange ); @@ -1917,8 +1917,8 @@ void ScChangeActionContent::UpdateReference( const ScChangeTrack* pTrack, if ( pTrack->IsInDelete() && !pTrack->IsInDeleteTop() ) return ; // Formeln nur kompletten Bereich updaten - BOOL bOldFormula = ( pOldCell && pOldCell->GetCellType() == CELLTYPE_FORMULA ); - BOOL bNewFormula = ( pNewCell && pNewCell->GetCellType() == CELLTYPE_FORMULA ); + sal_Bool bOldFormula = ( pOldCell && pOldCell->GetCellType() == CELLTYPE_FORMULA ); + sal_Bool bNewFormula = ( pNewCell && pNewCell->GetCellType() == CELLTYPE_FORMULA ); if ( bOldFormula || bNewFormula ) { // via ScFormulaCell UpdateReference anpassen (dort) if ( pTrack->IsInDelete() ) @@ -2022,7 +2022,7 @@ void ScChangeActionContent::UpdateReference( const ScChangeTrack* pTrack, // --- ScChangeActionReject ------------------------------------------------ -ScChangeActionReject::ScChangeActionReject(const ULONG nActionNumber, const ScChangeActionState eStateP, const ULONG nRejectingNumber, +ScChangeActionReject::ScChangeActionReject(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String& sComment) : ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment) @@ -2095,13 +2095,13 @@ void ScChangeTrack::Init() nLastMerge = 0; eMergeState = SC_CTMS_NONE; nLoadedFileFormatVersion = SC_CHGTRACK_FILEFORMAT; - bLoadSave = FALSE; - bInDelete = FALSE; - bInDeleteTop = FALSE; - bInDeleteUndo = FALSE; - bInPasteCut = FALSE; - bUseFixDateTime = FALSE; - bTime100thSeconds = TRUE; + bLoadSave = false; + bInDelete = false; + bInDeleteTop = false; + bInDeleteUndo = false; + bInPasteCut = false; + bUseFixDateTime = false; + bTime100thSeconds = sal_True; const SvtUserOptions& rUserOpt = SC_MOD()->GetUserOptions(); aUser = rUserOpt.GetFirstName(); @@ -2168,7 +2168,7 @@ void ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uI if ( !pDoc->IsInDtorClear() ) { const SvtUserOptions& rUserOptions = SC_MOD()->GetUserOptions(); - USHORT nOldCount = aUserCollection.GetCount(); + sal_uInt16 nOldCount = aUserCollection.GetCount(); String aStr( rUserOptions.GetFirstName() ); aStr += ' '; @@ -2203,7 +2203,7 @@ void ScChangeTrack::SetUser( const String& rUser ) void ScChangeTrack::StartBlockModify( ScChangeTrackMsgType eMsgType, - ULONG nStartAction ) + sal_uLong nStartAction ) { if ( aModifiedLink.IsSet() ) { @@ -2216,7 +2216,7 @@ void ScChangeTrack::StartBlockModify( ScChangeTrackMsgType eMsgType, } -void ScChangeTrack::EndBlockModify( ULONG nEndAction ) +void ScChangeTrack::EndBlockModify( sal_uLong nEndAction ) { if ( aModifiedLink.IsSet() ) { @@ -2234,12 +2234,12 @@ void ScChangeTrack::EndBlockModify( ULONG nEndAction ) } if ( !pBlockModifyMsg ) { - BOOL bNew = FALSE; + sal_Bool bNew = false; ScChangeTrackMsgInfo* pMsg; while ( ( pMsg = aMsgStackFinal.Pop() ) != NULL ) { aMsgQueue.Put( pMsg ); - bNew = TRUE; + bNew = sal_True; } if ( bNew ) aModifiedLink.Call( this ); @@ -2249,7 +2249,7 @@ void ScChangeTrack::EndBlockModify( ULONG nEndAction ) void ScChangeTrack::NotifyModified( ScChangeTrackMsgType eMsgType, - ULONG nStartAction, ULONG nEndAction ) + sal_uLong nStartAction, sal_uLong nEndAction ) { if ( aModifiedLink.IsSet() ) { @@ -2336,7 +2336,7 @@ void ScChangeTrack::AppendLoaded( ScChangeAction* pAppend ) } -void ScChangeTrack::Append( ScChangeAction* pAppend, ULONG nAction ) +void ScChangeTrack::Append( ScChangeAction* pAppend, sal_uLong nAction ) { if ( nActionMax < nAction ) nActionMax = nAction; @@ -2350,7 +2350,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend, ULONG nAction ) // UpdateReference auch wenn pLast==NULL, weil pAppend ein Delete sein // kann, dass DelContents generiert haben kann if ( pAppend->IsInsertType() && !pAppend->IsRejecting() ) - UpdateReference( pAppend, FALSE ); + UpdateReference( pAppend, false ); if ( !pLast ) pFirst = pLast = pAppend; else @@ -2365,7 +2365,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend, ULONG nAction ) // ToRange nicht deleten. if ( !pAppend->IsInsertType() && !(pAppend->GetType() == SC_CAT_MOVE && pAppend->IsRejecting()) ) - UpdateReference( pAppend, FALSE ); + UpdateReference( pAppend, false ); MasterLinks( pAppend ); if ( aModifiedLink.IsSet() ) @@ -2376,7 +2376,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend, ULONG nAction ) ScChangeActionContent* pContent = (ScChangeActionContent*) pAppend; if ( ( pContent = pContent->GetPrevContent() ) != NULL ) { - ULONG nMod = pContent->GetActionNumber(); + sal_uLong nMod = pContent->GetActionNumber(); NotifyModified( SC_CTM_CHANGE, nMod, nMod ); } } @@ -2394,7 +2394,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend ) void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, - ScDocument* pRefDoc, ULONG& nStartAction, ULONG& nEndAction, SCsTAB nDz ) + ScDocument* pRefDoc, sal_uLong& nStartAction, sal_uLong& nEndAction, SCsTAB nDz ) { nStartAction = GetActionMax() + 1; AppendDeleteRange( rRange, pRefDoc, nDz, 0 ); @@ -2403,7 +2403,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, - ScDocument* pRefDoc, SCsTAB nDz, ULONG nRejectingInsert ) + ScDocument* pRefDoc, SCsTAB nDz, sal_uLong nRejectingInsert ) { SetInDeleteRange( rRange ); StartBlockModify( SC_CTM_APPEND, GetActionMax() + 1 ); @@ -2429,7 +2429,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, aRange.aStart.SetCol( nCol ); aRange.aEnd.SetCol( nCol ); if ( nCol == nCol2 ) - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); AppendOneDeleteRange( aRange, pRefDoc, nCol-nCol1, 0, nTab-nTab1 + nDz, nRejectingInsert ); } @@ -2445,7 +2445,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, aRange.aStart.SetRow( nRow ); aRange.aEnd.SetRow( nRow ); if ( nRow == nRow2 ) - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); AppendOneDeleteRange( aRange, pRefDoc, 0, nRow-nRow1, 0, nRejectingInsert ); } @@ -2459,7 +2459,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, aRange.aStart.SetCol( nCol ); aRange.aEnd.SetCol( nCol ); if ( nCol == nCol2 ) - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); AppendOneDeleteRange( aRange, pRefDoc, nCol-nCol1, 0, 0, nRejectingInsert ); } @@ -2468,7 +2468,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, { OSL_FAIL( "ScChangeTrack::AppendDeleteRange: Block not supported!" ); } - SetInDeleteTop( FALSE ); + SetInDeleteTop( false ); } } EndBlockModify( GetActionMax() ); @@ -2477,7 +2477,7 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange, void ScChangeTrack::AppendOneDeleteRange( const ScRange& rOrgRange, ScDocument* pRefDoc, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ULONG nRejectingInsert ) + sal_uLong nRejectingInsert ) { ScRange aTrackRange( rOrgRange ); if ( nDx ) @@ -2551,7 +2551,7 @@ void ScChangeTrack::AppendMove( const ScRange& rFromRange, } -BOOL ScChangeTrack::IsMatrixFormulaRangeDifferent( const ScBaseCell* pOldCell, +sal_Bool ScChangeTrack::IsMatrixFormulaRangeDifferent( const ScBaseCell* pOldCell, const ScBaseCell* pNewCell ) { SCCOL nC1, nC2; @@ -2568,7 +2568,7 @@ BOOL ScChangeTrack::IsMatrixFormulaRangeDifferent( const ScBaseCell* pOldCell, } void ScChangeTrack::AppendContent( const ScAddress& rPos, - const ScBaseCell* pOldCell, ULONG nOldFormat, ScDocument* pRefDoc ) + const ScBaseCell* pOldCell, sal_uLong nOldFormat, ScDocument* pRefDoc ) { if ( !pRefDoc ) pRefDoc = pDoc; @@ -2642,7 +2642,7 @@ void ScChangeTrack::SetLastCutMoveRange( const ScRange& rRange, void ScChangeTrack::AppendContentRange( const ScRange& rRange, - ScDocument* pRefDoc, ULONG& nStartAction, ULONG& nEndAction, + ScDocument* pRefDoc, sal_uLong& nStartAction, sal_uLong& nEndAction, ScChangeActionClipMode eClipMode ) { if ( eClipMode == SC_CACM_CUT ) @@ -2658,11 +2658,11 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange, SCROW nRow2; SCTAB nTab2; rRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); - BOOL bDoContents; + sal_Bool bDoContents; if ( eClipMode == SC_CACM_PASTE && HasLastCut() ) { - bDoContents = FALSE; - SetInPasteCut( TRUE ); + bDoContents = false; + SetInPasteCut( sal_True ); // Paste und Cut abstimmen, Paste kann groesserer Range sein ScRange aRange( rRange ); ScBigRange& r = pLastCutMove->GetBigRange(); @@ -2671,21 +2671,21 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange, { aRange.aEnd.SetCol( aRange.aStart.Col() + nTmpCol ); nCol1 += nTmpCol + 1; - bDoContents = TRUE; + bDoContents = sal_True; } SCROW nTmpRow; if ( (nTmpRow = (SCROW) (r.aEnd.Row() - r.aStart.Row())) != (nRow2 - nRow1) ) { aRange.aEnd.SetRow( aRange.aStart.Row() + nTmpRow ); nRow1 += nTmpRow + 1; - bDoContents = TRUE; + bDoContents = sal_True; } SCTAB nTmpTab; if ( (nTmpTab = (SCTAB) (r.aEnd.Tab() - r.aStart.Tab())) != (nTab2 - nTab1) ) { aRange.aEnd.SetTab( aRange.aStart.Tab() + nTmpTab ); nTab1 += nTmpTab + 1; - bDoContents = TRUE; + bDoContents = sal_True; } r = aRange; Undo( nStartLastCut, nEndLastCut ); // hier werden sich die Cuts gemerkt @@ -2699,11 +2699,11 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange, Append( pLastCutMove ); pLastCutMove = NULL; ResetLastCut(); - SetInPasteCut( FALSE ); + SetInPasteCut( false ); } else { - bDoContents = TRUE; + bDoContents = sal_True; nStartAction = GetActionMax() + 1; StartBlockModify( SC_CTM_APPEND, nStartAction ); } @@ -2735,7 +2735,7 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange, void ScChangeTrack::AppendContentsIfInRefDoc( ScDocument* pRefDoc, - ULONG& nStartAction, ULONG& nEndAction ) + sal_uLong& nStartAction, sal_uLong& nEndAction ) { ScDocumentIterator aIter( pRefDoc, 0, MAXTAB ); if ( aIter.GetFirst() ) @@ -2763,7 +2763,7 @@ void ScChangeTrack::AppendContentsIfInRefDoc( ScDocument* pRefDoc, ScChangeActionContent* ScChangeTrack::AppendContentOnTheFly( const ScAddress& rPos, ScBaseCell* pOldCell, ScBaseCell* pNewCell, - ULONG nOldFormat, ULONG nNewFormat ) + sal_uLong nOldFormat, sal_uLong nNewFormat ) { ScRange aRange( rPos ); ScChangeActionContent* pAct = new ScChangeActionContent( aRange ); @@ -2823,7 +2823,7 @@ ScChangeActionContent* ScChangeTrack::GenerateDelContent( void ScChangeTrack::DeleteGeneratedDelContent( ScChangeActionContent* pContent ) { - ULONG nAct = pContent->GetActionNumber(); + sal_uLong nAct = pContent->GetActionNumber(); aGeneratedTable.Remove( nAct ); if ( pFirstGeneratedDelContent == pContent ) pFirstGeneratedDelContent = (ScChangeActionContent*) pContent->pNext; @@ -2864,7 +2864,7 @@ void ScChangeTrack::AddDependentWithNotify( ScChangeAction* pParent, pDependent->AddLink( pParent, pLink ); if ( aModifiedLink.IsSet() ) { - ULONG nMod = pParent->GetActionNumber(); + sal_uLong nMod = pParent->GetActionNumber(); NotifyModified( SC_CTM_PARENT, nMod, nMod ); } } @@ -2924,10 +2924,10 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct ) // also genau richtig const ScBigRange& rRange = pAct->GetBigRange(); - BOOL bActNoInsert = !pAct->IsInsertType(); - BOOL bActColDel = ( eActType == SC_CAT_DELETE_COLS ); - BOOL bActRowDel = ( eActType == SC_CAT_DELETE_ROWS ); - BOOL bActTabDel = ( eActType == SC_CAT_DELETE_TABS ); + sal_Bool bActNoInsert = !pAct->IsInsertType(); + sal_Bool bActColDel = ( eActType == SC_CAT_DELETE_COLS ); + sal_Bool bActRowDel = ( eActType == SC_CAT_DELETE_ROWS ); + sal_Bool bActTabDel = ( eActType == SC_CAT_DELETE_TABS ); if ( pLinkInsertCol && (eActType == SC_CAT_INSERT_COLS || (bActNoInsert && !bActRowDel && !bActTabDel)) ) @@ -3021,7 +3021,7 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct ) void ScChangeTrack::Remove( ScChangeAction* pRemove ) { // aus Track ausklinken - ULONG nAct = pRemove->GetActionNumber(); + sal_uLong nAct = pRemove->GetActionNumber(); aTable.Remove( nAct ); if ( nAct == nActionMax ) --nActionMax; @@ -3050,7 +3050,7 @@ void ScChangeTrack::Remove( ScChangeAction* pRemove ) ScChangeActionContent* pContent = (ScChangeActionContent*) pRemove; if ( ( pContent = pContent->GetPrevContent() ) != NULL ) { - ULONG nMod = pContent->GetActionNumber(); + sal_uLong nMod = pContent->GetActionNumber(); NotifyModified( SC_CTM_CHANGE, nMod, nMod ); } } @@ -3070,7 +3070,7 @@ void ScChangeTrack::Remove( ScChangeAction* pRemove ) } -void ScChangeTrack::Undo( ULONG nStartAction, ULONG nEndAction, bool bMerge ) +void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge ) { // #i94841# [Collaboration] When deleting rows is rejected, the content is sometimes wrong if ( bMerge ) @@ -3088,7 +3088,7 @@ void ScChangeTrack::Undo( ULONG nStartAction, ULONG nEndAction, bool bMerge ) !IsInPasteCut() ) ResetLastCut(); StartBlockModify( SC_CTM_REMOVE, nStartAction ); - for ( ULONG j = nEndAction; j >= nStartAction; --j ) + for ( sal_uLong j = nEndAction; j >= nStartAction; --j ) { // rueckwaerts um evtl. nActionMax zu recyclen und schnelleren // Zugriff via pLast, Deletes in richtiger Reihenfolge ScChangeAction* pAct = ( (j == nActionMax && pLast && @@ -3100,13 +3100,13 @@ void ScChangeTrack::Undo( ULONG nStartAction, ULONG nEndAction, bool bMerge ) if ( j == nEndAction || (pAct != pLast && ((ScChangeActionDel*)pAct)->IsTopDelete()) ) { - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); SetInDeleteRange( ((ScChangeActionDel*)pAct)-> GetOverAllRange().MakeRange() ); } } - UpdateReference( pAct, TRUE ); - SetInDeleteTop( FALSE ); + UpdateReference( pAct, sal_True ); + SetInDeleteTop( false ); Remove( pAct ); if ( IsInPasteCut() ) aPasteCutTable.Insert( pAct->GetActionNumber(), pAct ); @@ -3115,14 +3115,14 @@ void ScChangeTrack::Undo( ULONG nStartAction, ULONG nEndAction, bool bMerge ) if ( j == nStartAction && pAct->GetType() == SC_CAT_MOVE ) { ScChangeActionMove* pMove = (ScChangeActionMove*) pAct; - ULONG nStart = pMove->GetStartLastCut(); - ULONG nEnd = pMove->GetEndLastCut(); + sal_uLong nStart = pMove->GetStartLastCut(); + sal_uLong nEnd = pMove->GetEndLastCut(); if ( nStart && nStart <= nEnd ) { // LastCut wiederherstellen //! Links vor Cut-Append aufloesen pMove->RemoveAllLinks(); StartBlockModify( SC_CTM_APPEND, nStart ); - for ( ULONG nCut = nStart; nCut <= nEnd; nCut++ ) + for ( sal_uLong nCut = nStart; nCut <= nEnd; nCut++ ) { ScChangeAction* pCut = aPasteCutTable.Remove( nCut ); if ( pCut ) @@ -3162,22 +3162,22 @@ void ScChangeTrack::Undo( ULONG nStartAction, ULONG nEndAction, bool bMerge ) } -BOOL ScChangeTrack::MergeIgnore( const ScChangeAction& rAction, ULONG nFirstMerge ) +sal_Bool ScChangeTrack::MergeIgnore( const ScChangeAction& rAction, sal_uLong nFirstMerge ) { if ( rAction.IsRejected() ) - return TRUE; // da kommt noch eine passende Reject-Action + return sal_True; // da kommt noch eine passende Reject-Action if ( rAction.IsRejecting() && rAction.GetRejectAction() >= nFirstMerge ) - return TRUE; // da ist sie + return sal_True; // da ist sie - return FALSE; // alles andere + return false; // alles andere } void ScChangeTrack::MergePrepare( ScChangeAction* pFirstMerge, bool bShared ) { SetMergeState( SC_CTMS_PREPARE ); - ULONG nFirstMerge = pFirstMerge->GetActionNumber(); + sal_uLong nFirstMerge = pFirstMerge->GetActionNumber(); ScChangeAction* pAct = GetLast(); if ( pAct ) { @@ -3191,13 +3191,13 @@ void ScChangeTrack::MergePrepare( ScChangeAction* pFirstMerge, bool bShared ) { if ( ((ScChangeActionDel*)pAct)->IsTopDelete() ) { - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); SetInDeleteRange( ((ScChangeActionDel*)pAct)-> GetOverAllRange().MakeRange() ); } } - UpdateReference( pAct, TRUE ); - SetInDeleteTop( FALSE ); + UpdateReference( pAct, sal_True ); + SetInDeleteTop( false ); pAct->DeleteCellEntries(); // sonst GPF bei Track Clear() } pAct = ( pAct == pFirstMerge ? NULL : pAct->GetPrev() ); @@ -3207,7 +3207,7 @@ void ScChangeTrack::MergePrepare( ScChangeAction* pFirstMerge, bool bShared ) } -void ScChangeTrack::MergeOwn( ScChangeAction* pAct, ULONG nFirstMerge, bool bShared ) +void ScChangeTrack::MergeOwn( ScChangeAction* pAct, sal_uLong nFirstMerge, bool bShared ) { // #i94841# [Collaboration] When deleting rows is rejected, the content is sometimes wrong if ( bShared || !ScChangeTrack::MergeIgnore( *pAct, nFirstMerge ) ) @@ -3217,45 +3217,45 @@ void ScChangeTrack::MergeOwn( ScChangeAction* pAct, ULONG nFirstMerge, bool bSha { if ( ((ScChangeActionDel*)pAct)->IsTopDelete() ) { - SetInDeleteTop( TRUE ); + SetInDeleteTop( sal_True ); SetInDeleteRange( ((ScChangeActionDel*)pAct)-> GetOverAllRange().MakeRange() ); } } - UpdateReference( pAct, FALSE ); - SetInDeleteTop( FALSE ); + UpdateReference( pAct, false ); + SetInDeleteTop( false ); SetMergeState( SC_CTMS_OTHER ); //! nachfolgende per default MergeOther } } -void ScChangeTrack::UpdateReference( ScChangeAction* pAct, BOOL bUndo ) +void ScChangeTrack::UpdateReference( ScChangeAction* pAct, sal_Bool bUndo ) { ScChangeActionType eActType = pAct->GetType(); if ( eActType == SC_CAT_CONTENT || eActType == SC_CAT_REJECT ) return ; //! Formelzellen haengen nicht im Dokument - BOOL bOldAutoCalc = pDoc->GetAutoCalc(); - pDoc->SetAutoCalc( FALSE ); - BOOL bOldNoListening = pDoc->GetNoListening(); - pDoc->SetNoListening( TRUE ); + sal_Bool bOldAutoCalc = pDoc->GetAutoCalc(); + pDoc->SetAutoCalc( false ); + sal_Bool bOldNoListening = pDoc->GetNoListening(); + pDoc->SetNoListening( sal_True ); //! Formelzellen ExpandRefs synchronisiert zu denen im Dokument - BOOL bOldExpandRefs = pDoc->IsExpandRefs(); + sal_Bool bOldExpandRefs = pDoc->IsExpandRefs(); if ( (!bUndo && pAct->IsInsertType()) || (bUndo && pAct->IsDeleteType()) ) pDoc->SetExpandRefs( SC_MOD()->GetInputOptions().GetExpandRefs() ); if ( pAct->IsDeleteType() ) { SetInDeleteUndo( bUndo ); - SetInDelete( TRUE ); + SetInDelete( sal_True ); } else if ( GetMergeState() == SC_CTMS_OWN ) { // Referenzen von Formelzellen wiederherstellen, // vorheriges MergePrepare war bei einem Insert wie ein Delete if ( pAct->IsInsertType() ) - SetInDeleteUndo( TRUE ); + SetInDeleteUndo( sal_True ); } //! erst die generated, als waeren sie vorher getrackt worden @@ -3264,8 +3264,8 @@ void ScChangeTrack::UpdateReference( ScChangeAction* pAct, BOOL bUndo ) bUndo ); UpdateReference( &pFirst, pAct, bUndo ); - SetInDelete( FALSE ); - SetInDeleteUndo( FALSE ); + SetInDelete( false ); + SetInDeleteUndo( false ); pDoc->SetExpandRefs( bOldExpandRefs ); pDoc->SetNoListening( bOldNoListening ); @@ -3274,18 +3274,18 @@ void ScChangeTrack::UpdateReference( ScChangeAction* pAct, BOOL bUndo ) void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, - ScChangeAction* pAct, BOOL bUndo ) + ScChangeAction* pAct, sal_Bool bUndo ) { ScChangeActionType eActType = pAct->GetType(); - BOOL bGeneratedDelContents = + sal_Bool bGeneratedDelContents = ( ppFirstAction == (ScChangeAction**)&pFirstGeneratedDelContent ); const ScBigRange& rOrgRange = pAct->GetBigRange(); ScBigRange aRange( rOrgRange ); ScBigRange aDelRange( rOrgRange ); - INT32 nDx, nDy, nDz; + sal_Int32 nDx, nDy, nDz; nDx = nDy = nDz = 0; UpdateRefMode eMode = URM_INSDEL; - BOOL bDel = FALSE; + sal_Bool bDel = false; switch ( eActType ) { case SC_CAT_INSERT_COLS : @@ -3304,19 +3304,19 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, aRange.aEnd.SetCol( nInt32Max ); nDx = -(rOrgRange.aEnd.Col() - rOrgRange.aStart.Col() + 1); aDelRange.aEnd.SetCol( aDelRange.aStart.Col() - nDx - 1 ); - bDel = TRUE; + bDel = sal_True; break; case SC_CAT_DELETE_ROWS : aRange.aEnd.SetRow( nInt32Max ); nDy = -(rOrgRange.aEnd.Row() - rOrgRange.aStart.Row() + 1); aDelRange.aEnd.SetRow( aDelRange.aStart.Row() - nDy - 1 ); - bDel = TRUE; + bDel = sal_True; break; case SC_CAT_DELETE_TABS : aRange.aEnd.SetTab( nInt32Max ); nDz = -(rOrgRange.aEnd.Tab() - rOrgRange.aStart.Tab() + 1); aDelRange.aEnd.SetTab( aDelRange.aStart.Tab() - nDz - 1 ); - bDel = TRUE; + bDel = sal_True; break; case SC_CAT_MOVE : eMode = URM_MOVE; @@ -3358,7 +3358,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, { if ( p == pAct ) continue; // for - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( GetMergeState() == SC_CTMS_OTHER && p->GetActionNumber() <= GetLastMerge() ) { // Delete in mergendem Dokument, Action im zu mergenden @@ -3368,7 +3368,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, // das Insert nicht schneidet. if ( !aDelRange.Intersects( p->GetBigRange() ) ) p->UpdateReference( this, eMode, aRange, nDx, nDy, nDz ); - bUpdate = FALSE; + bUpdate = false; } else if ( p->GetType() == SC_CAT_CONTENT && p->IsDeletedInDelType( eInsType ) ) @@ -3376,7 +3376,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, // Nicht anpassen, wenn dieses Delete in dem // Insert-"Delete" sein wuerde (ist nur verschoben). if ( aDelRange.In( p->GetBigRange().aStart ) ) - bUpdate = FALSE; + bUpdate = false; else { const ScChangeActionLinkEntry* pLink = p->GetDeletedIn(); @@ -3385,7 +3385,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, const ScChangeAction* pDel = pLink->GetAction(); if ( pDel && pDel->GetType() == eInsType && pDel->GetBigRange().In( aDelRange ) ) - bUpdate = FALSE; + bUpdate = false; pLink = pLink->GetNext(); } } @@ -3406,7 +3406,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, if ( bGeneratedDelContents ) pActDel->AddContent( (ScChangeActionContent*) p ); } - bUpdate = FALSE; + bUpdate = false; } else { @@ -3571,7 +3571,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, { if ( p == pAct ) continue; // for - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( aDelRange.In( p->GetBigRange() ) ) { // #i94841# [Collaboration] When deleting rows is rejected, the content is sometimes wrong @@ -3596,18 +3596,18 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, // geloescht wird in DeleteCellEntries } } - bUpdate = FALSE; + bUpdate = false; } else if ( eActType != SC_CAT_DELETE_TABS && p->IsDeletedInDelType( SC_CAT_DELETE_TABS ) ) { // in geloeschten Tabellen nicht updaten, // ausser wenn Tabelle verschoben wird - bUpdate = FALSE; + bUpdate = false; } if ( p->GetType() == eActType && pActDel->IsDeletedIn( p ) ) { pActDel->RemoveDeletedIn( p ); // "druntergerutscht" - bUpdate = TRUE; + bUpdate = sal_True; } } if ( bUpdate ) @@ -3623,7 +3623,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, else if ( eActType == SC_CAT_MOVE ) { ScChangeActionMove* pActMove = (ScChangeActionMove*) pAct; - BOOL bLastCutMove = ( pActMove == pLastCutMove ); + sal_Bool bLastCutMove = ( pActMove == pLastCutMove ); const ScBigRange& rTo = pActMove->GetBigRange(); const ScBigRange& rFrom = pActMove->GetFromRange(); if ( !bUndo ) @@ -3673,7 +3673,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, } else { // Undo Move - BOOL bActRejected = pActMove->IsRejected(); + sal_Bool bActRejected = pActMove->IsRejected(); for ( ScChangeAction* p = *ppFirstAction; p; p = p->GetNext() ) { if ( p == pAct ) @@ -3832,13 +3832,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, void ScChangeTrack::GetDependents( ScChangeAction* pAct, - ScChangeActionTable& rTable, BOOL bListMasterDelete, BOOL bAllFlat ) const + ScChangeActionTable& rTable, sal_Bool bListMasterDelete, sal_Bool bAllFlat ) const { //! bAllFlat==TRUE: intern aus Accept oder Reject gerufen, //! => Generated werden nicht aufgenommen - BOOL bIsDelete = pAct->IsDeleteType(); - BOOL bIsMasterDelete = ( bListMasterDelete && pAct->IsMasterDelete() ); + sal_Bool bIsDelete = pAct->IsDeleteType(); + sal_Bool bIsMasterDelete = ( bListMasterDelete && pAct->IsMasterDelete() ); const ScChangeAction* pCur = pAct; ScChangeActionStack* pStack = new ScChangeActionStack; @@ -3854,7 +3854,7 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct, { if ( bAllFlat ) { - ULONG n = p->GetActionNumber(); + sal_uLong n = p->GetActionNumber(); if ( !IsGenerated( n ) && rTable.Insert( n, p ) ) if ( p->HasDependent() ) pStack->Push( p ); @@ -3901,7 +3901,7 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct, if ( bAllFlat ) { // nur ein TopContent einer Kette ist in LinkDeleted - ULONG n = p->GetActionNumber(); + sal_uLong n = p->GetActionNumber(); if ( !IsGenerated( n ) && rTable.Insert( n, p ) ) if ( p->HasDeleted() || p->GetType() == SC_CAT_CONTENT ) @@ -3950,7 +3950,7 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct, { if ( bAllFlat ) { - ULONG n = p->GetActionNumber(); + sal_uLong n = p->GetActionNumber(); if ( !IsGenerated( n ) && rTable.Insert( n, p ) ) if ( p->HasDependent() || p->HasDeleted() ) pStack->Push( p ); @@ -3994,7 +3994,7 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct, { if ( bAllFlat ) { - ULONG n = p->GetActionNumber(); + sal_uLong n = p->GetActionNumber(); if ( !IsGenerated( n ) && rTable.Insert( n, p ) ) if ( p->HasDependent() ) pStack->Push( p ); @@ -4020,10 +4020,10 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct, } -BOOL ScChangeTrack::SelectContent( ScChangeAction* pAct, BOOL bOldest ) +sal_Bool ScChangeTrack::SelectContent( ScChangeAction* pAct, sal_Bool bOldest ) { if ( pAct->GetType() != SC_CAT_CONTENT ) - return FALSE; + return false; ScChangeActionContent* pContent = (ScChangeActionContent*) pAct; if ( bOldest ) @@ -4036,7 +4036,7 @@ BOOL ScChangeTrack::SelectContent( ScChangeAction* pAct, BOOL bOldest ) } if ( !pContent->IsClickable() ) - return FALSE; + return false; ScBigRange aBigRange( pContent->GetBigRange() ); const ScBaseCell* pCell = (bOldest ? pContent->GetOldCell() : @@ -4051,16 +4051,16 @@ BOOL ScChangeTrack::SelectContent( ScChangeAction* pAct, BOOL bOldest ) } if ( !aBigRange.IsValid( pDoc ) ) - return FALSE; + return false; ScRange aRange( aBigRange.MakeRange() ); if ( !pDoc->IsBlockEditable( aRange.aStart.Tab(), aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row() ) ) - return FALSE; + return false; if ( pContent->HasDependent() ) { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; Stack aRejectActions; const ScChangeActionLinkEntry* pL = pContent->GetFirstDependentEntry(); while ( pL ) @@ -4108,28 +4108,28 @@ void ScChangeTrack::AcceptAll() } -BOOL ScChangeTrack::Accept( ScChangeAction* pAct ) +sal_Bool ScChangeTrack::Accept( ScChangeAction* pAct ) { if ( !pAct->IsClickable() ) - return FALSE; + return false; if ( pAct->IsDeleteType() || pAct->GetType() == SC_CAT_CONTENT ) { ScChangeActionTable aActionTable; - GetDependents( pAct, aActionTable, FALSE, TRUE ); + GetDependents( pAct, aActionTable, false, sal_True ); for ( ScChangeAction* p = aActionTable.First(); p; p = aActionTable.Next() ) { p->Accept(); } } pAct->Accept(); - return TRUE; + return sal_True; } -BOOL ScChangeTrack::RejectAll() +sal_Bool ScChangeTrack::RejectAll() { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; for ( ScChangeAction* p = GetLast(); p && bOk; p = p->GetPrev() ) { //! rueckwaerts, weil abhaengige hinten und RejectActions angehaengt if ( p->IsInternalRejectable() ) @@ -4139,7 +4139,7 @@ BOOL ScChangeTrack::RejectAll() } -BOOL ScChangeTrack::Reject( ScChangeAction* pAct, bool bShared ) +sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, bool bShared ) { // #i100895# When collaboration changes are reversed, it must be possible // to reject a deleted row above another deleted row. @@ -4147,29 +4147,29 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, bool bShared ) pAct->RemoveAllDeletedIn(); if ( !pAct->IsRejectable() ) - return FALSE; + return false; ScChangeActionTable* pTable = NULL; if ( pAct->HasDependent() ) { pTable = new ScChangeActionTable; - GetDependents( pAct, *pTable, FALSE, TRUE ); + GetDependents( pAct, *pTable, false, sal_True ); } - BOOL bRejected = Reject( pAct, pTable, FALSE ); + sal_Bool bRejected = Reject( pAct, pTable, false ); if ( pTable ) delete pTable; return bRejected; } -BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, - BOOL bRecursion ) +sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, + sal_Bool bRecursion ) { if ( !pAct->IsInternalRejectable() ) - return FALSE; + return false; - BOOL bOk = TRUE; - BOOL bRejected = FALSE; + sal_Bool bOk = sal_True; + sal_Bool bRejected = false; if ( pAct->IsInsertType() ) { if ( pAct->HasDependent() && !bRecursion ) @@ -4183,10 +4183,10 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, else if ( p->IsDeleteType() ) p->Accept(); // geloeschtes ins Nirvana else - bOk = Reject( p, NULL, TRUE ); //! rekursiv + bOk = Reject( p, NULL, sal_True ); //! rekursiv } } - if ( bOk && (bRejected = pAct->Reject( pDoc )) != FALSE ) + if ( bOk && (bRejected = pAct->Reject( pDoc )) != false ) { // pRefDoc NULL := geloeschte Zellen nicht speichern AppendDeleteRange( pAct->GetBigRange().MakeRange(), NULL, (short) 0, @@ -4197,11 +4197,11 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, { DBG_ASSERT( !pTable, "ScChangeTrack::Reject: Delete mit Table" ); ScBigRange aDelRange; - ULONG nRejectAction = pAct->GetActionNumber(); - BOOL bTabDel, bTabDelOk; + sal_uLong nRejectAction = pAct->GetActionNumber(); + sal_Bool bTabDel, bTabDelOk; if ( pAct->GetType() == SC_CAT_DELETE_TABS ) { - bTabDel = TRUE; + bTabDel = sal_True; aDelRange = pAct->GetBigRange(); bOk = bTabDelOk = pAct->Reject( pDoc ); if ( bOk ) @@ -4211,14 +4211,14 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, } } else - bTabDel = bTabDelOk = FALSE; + bTabDel = bTabDelOk = false; ScChangeActionDel* pDel = (ScChangeActionDel*) pAct; if ( bOk ) { aDelRange = pDel->GetOverAllRange(); bOk = aDelRange.IsValid( pDoc ); } - BOOL bOneOk = FALSE; + sal_Bool bOneOk = false; if ( bOk ) { ScChangeActionType eActType = pAct->GetType(); @@ -4239,7 +4239,7 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, } } ScChangeAction* p = pAct; - BOOL bLoop = TRUE; + sal_Bool bLoop = sal_True; do { pDel = (ScChangeActionDel*) p; @@ -4266,10 +4266,10 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, } } else - bOneOk = TRUE; + bOneOk = sal_True; } if ( pDel->IsBaseDelete() ) - bLoop = FALSE; + bLoop = false; else p = p->GetPrev(); } while ( bOk && bLoop && p && p->GetType() == eActType && @@ -4293,10 +4293,10 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, DBG_ASSERT( pTable, "ScChangeTrack::Reject: Move ohne Table" ); for ( ScChangeAction* p = pTable->Last(); p && bOk; p = pTable->Prev() ) { - bOk = Reject( p, NULL, TRUE ); //! rekursiv + bOk = Reject( p, NULL, sal_True ); //! rekursiv } } - if ( bOk && (bRejected = pAct->Reject( pDoc )) != FALSE ) + if ( bOk && (bRejected = pAct->Reject( pDoc )) != false ) { ScChangeActionMove* pReject = new ScChangeActionMove( pAct->GetBigRange().MakeRange(), @@ -4318,7 +4318,7 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, pReject = new ScChangeActionContent( aRange ); pReject->SetOldValue( pDoc->GetCell( aRange.aStart ), pDoc, pDoc ); } - if ( (bRejected = pAct->Reject( pDoc )) != FALSE && !bRecursion ) + if ( (bRejected = pAct->Reject( pDoc )) != false && !bRecursion ) { pReject->SetNewValue( pDoc->GetCell( aRange.aStart ), pDoc ); pReject->SetRejectAction( pAct->GetActionNumber() ); @@ -4337,7 +4337,7 @@ BOOL ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTable, } -ULONG ScChangeTrack::AddLoadedGenerated(ScBaseCell* pNewCell, const ScBigRange& aBigRange, const String& sNewValue ) +sal_uLong ScChangeTrack::AddLoadedGenerated(ScBaseCell* pNewCell, const ScBigRange& aBigRange, const String& sNewValue ) { ScChangeActionContent* pAct = new ScChangeActionContent( --nGeneratedMin, pNewCell, aBigRange, pDoc, sNewValue ); if ( pAct ) @@ -4539,7 +4539,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const { if ( pAction->HasDeleted() ) { - ::std::stack< ULONG > aStack; + ::std::stack< sal_uLong > aStack; const ScChangeActionLinkEntry* pL = pAction->GetFirstDeletedEntry(); while ( pL ) { @@ -4573,7 +4573,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const { if ( pAction->HasDependent() ) { - ::std::stack< ULONG > aStack; + ::std::stack< sal_uLong > aStack; const ScChangeActionLinkEntry* pL = pAction->GetFirstDependentEntry(); while ( pL ) { diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index 514336368797..e50b43859e52 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -91,16 +91,16 @@ ScChangeViewSettings& ScChangeViewSettings::operator=( const ScChangeViewSetting return *this; } -BOOL ScChangeViewSettings::IsValidComment(const String* pCommentStr) const +sal_Bool ScChangeViewSettings::IsValidComment(const String* pCommentStr) const { - BOOL nTheFlag=TRUE; + sal_Bool nTheFlag=sal_True; if(pCommentSearcher!=NULL) { xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pCommentStr->Len(); - nTheFlag=sal::static_int_cast<BOOL>(pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos)); + nTheFlag=sal::static_int_cast<sal_Bool>(pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos)); } return nTheFlag; } @@ -117,7 +117,7 @@ void ScChangeViewSettings::SetTheComment(const String& rString) if(rString.Len()>0) { utl::SearchParam aSearchParam( rString, - utl::SearchParam::SRCH_REGEXP,FALSE,FALSE,FALSE ); + utl::SearchParam::SRCH_REGEXP,false,false,false ); pCommentSearcher = new utl::TextSearch( aSearchParam, *ScGlobal::pCharClass ); } diff --git a/sc/source/core/tool/collect.cxx b/sc/source/core/tool/collect.cxx index 1b929892bd1e..c202107ea425 100644 --- a/sc/source/core/tool/collect.cxx +++ b/sc/source/core/tool/collect.cxx @@ -49,17 +49,17 @@ ScDataObject::~ScDataObject() // Collection //------------------------------------------------------------------------ -void lcl_DeleteScDataObjects( ScDataObject** p, USHORT nCount ) +void lcl_DeleteScDataObjects( ScDataObject** p, sal_uInt16 nCount ) { if ( p ) { - for (USHORT i = 0; i < nCount; i++) delete p[i]; + for (sal_uInt16 i = 0; i < nCount; i++) delete p[i]; delete[] p; p = NULL; } } -ScCollection::ScCollection(USHORT nLim, USHORT nDel) : +ScCollection::ScCollection(sal_uInt16 nLim, sal_uInt16 nDel) : nCount ( 0 ), nLimit ( nLim ), nDelta ( nDel ), @@ -94,8 +94,8 @@ ScCollection::~ScCollection() } //------------------------------------------------------------------------ -USHORT ScCollection::GetCount() const { return nCount; } -void ScCollection::AtFree(USHORT nIndex) +sal_uInt16 ScCollection::GetCount() const { return nCount; } +void ScCollection::AtFree(sal_uInt16 nIndex) { if ((pItems) && (nIndex < nCount)) { @@ -124,7 +124,7 @@ void ScCollection::FreeAll() //------------------------------------------------------------------------ -BOOL ScCollection::AtInsert(USHORT nIndex, ScDataObject* pScDataObject) +sal_Bool ScCollection::AtInsert(sal_uInt16 nIndex, ScDataObject* pScDataObject) { if ((nCount < MAXCOLLECTIONSIZE) && (nIndex <= nCount) && pItems) { @@ -132,8 +132,8 @@ BOOL ScCollection::AtInsert(USHORT nIndex, ScDataObject* pScDataObject) { ScDataObject** pNewItems = new ScDataObject*[nLimit + nDelta]; if (!pNewItems) - return FALSE; - nLimit = sal::static_int_cast<USHORT>( nLimit + nDelta ); + return false; + nLimit = sal::static_int_cast<sal_uInt16>( nLimit + nDelta ); memmove(pNewItems, pItems, nCount * sizeof(ScDataObject*)); delete[] pItems; pItems = pNewItems; @@ -142,21 +142,21 @@ BOOL ScCollection::AtInsert(USHORT nIndex, ScDataObject* pScDataObject) memmove(&pItems[nIndex + 1], &pItems[nIndex], (nCount - nIndex) * sizeof(ScDataObject*)); pItems[nIndex] = pScDataObject; nCount++; - return TRUE; + return sal_True; } - return FALSE; + return false; } //------------------------------------------------------------------------ -BOOL ScCollection::Insert(ScDataObject* pScDataObject) +sal_Bool ScCollection::Insert(ScDataObject* pScDataObject) { return AtInsert(nCount, pScDataObject); } //------------------------------------------------------------------------ -ScDataObject* ScCollection::At(USHORT nIndex) const +ScDataObject* ScCollection::At(sal_uInt16 nIndex) const { if (nIndex < nCount) return pItems[nIndex]; @@ -166,10 +166,10 @@ ScDataObject* ScCollection::At(USHORT nIndex) const //------------------------------------------------------------------------ -USHORT ScCollection::IndexOf(ScDataObject* pScDataObject) const +sal_uInt16 ScCollection::IndexOf(ScDataObject* pScDataObject) const { - USHORT nIndex = 0xffff; - for (USHORT i = 0; ((i < nCount) && (nIndex == 0xffff)); i++) + sal_uInt16 nIndex = 0xffff; + for (sal_uInt16 i = 0; ((i < nCount) && (nIndex == 0xffff)); i++) { if (pItems[i] == pScDataObject) nIndex = i; } @@ -186,7 +186,7 @@ ScCollection& ScCollection::operator=( const ScCollection& r ) nLimit = r.nLimit; nDelta = r.nDelta; pItems = new ScDataObject*[nLimit]; - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) pItems[i] = r.pItems[i]->Clone(); return *this; @@ -203,7 +203,7 @@ ScDataObject* ScCollection::Clone() const // ScSortedCollection //------------------------------------------------------------------------ -ScSortedCollection::ScSortedCollection(USHORT nLim, USHORT nDel, BOOL bDup) : +ScSortedCollection::ScSortedCollection(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup) : ScCollection (nLim, nDel), bDuplicates ( bDup) { @@ -211,9 +211,9 @@ ScSortedCollection::ScSortedCollection(USHORT nLim, USHORT nDel, BOOL bDup) : //------------------------------------------------------------------------ -USHORT ScSortedCollection::IndexOf(ScDataObject* pScDataObject) const +sal_uInt16 ScSortedCollection::IndexOf(ScDataObject* pScDataObject) const { - USHORT nIndex; + sal_uInt16 nIndex; if (Search(pScDataObject, nIndex)) return nIndex; else @@ -222,10 +222,10 @@ USHORT ScSortedCollection::IndexOf(ScDataObject* pScDataObject) const //------------------------------------------------------------------------ -BOOL ScSortedCollection::Search(ScDataObject* pScDataObject, USHORT& rIndex) const +sal_Bool ScSortedCollection::Search(ScDataObject* pScDataObject, sal_uInt16& rIndex) const { rIndex = nCount; - BOOL bFound = FALSE; + sal_Bool bFound = false; short nLo = 0; short nHi = nCount - 1; short nIndex; @@ -241,7 +241,7 @@ BOOL ScSortedCollection::Search(ScDataObject* pScDataObject, USHORT& rIndex) con nHi = nIndex - 1; if (nCompare == 0) { - bFound = TRUE; + bFound = sal_True; nLo = nIndex; } } @@ -252,16 +252,16 @@ BOOL ScSortedCollection::Search(ScDataObject* pScDataObject, USHORT& rIndex) con //------------------------------------------------------------------------ -BOOL ScSortedCollection::Insert(ScDataObject* pScDataObject) +sal_Bool ScSortedCollection::Insert(ScDataObject* pScDataObject) { - USHORT nIndex; - BOOL bFound = Search(pScDataObject, nIndex); + sal_uInt16 nIndex; + sal_Bool bFound = Search(pScDataObject, nIndex); if (bFound) { if (bDuplicates) return AtInsert(nIndex, pScDataObject); else - return FALSE; + return false; } else return AtInsert(nIndex, pScDataObject); @@ -269,15 +269,15 @@ BOOL ScSortedCollection::Insert(ScDataObject* pScDataObject) //------------------------------------------------------------------------ -BOOL ScSortedCollection::InsertPos(ScDataObject* pScDataObject, USHORT& nIndex) +sal_Bool ScSortedCollection::InsertPos(ScDataObject* pScDataObject, sal_uInt16& nIndex) { - BOOL bFound = Search(pScDataObject, nIndex); + sal_Bool bFound = Search(pScDataObject, nIndex); if (bFound) { if (bDuplicates) return AtInsert(nIndex, pScDataObject); else - return FALSE; + return false; } else return AtInsert(nIndex, pScDataObject); @@ -285,21 +285,21 @@ BOOL ScSortedCollection::InsertPos(ScDataObject* pScDataObject, USHORT& nIndex) //------------------------------------------------------------------------ -BOOL ScSortedCollection::operator==(const ScSortedCollection& rCmp) const +sal_Bool ScSortedCollection::operator==(const ScSortedCollection& rCmp) const { if ( nCount != rCmp.nCount ) - return FALSE; - for (USHORT i=0; i<nCount; i++) + return false; + for (sal_uInt16 i=0; i<nCount; i++) if ( !IsEqual(pItems[i],rCmp.pItems[i]) ) - return FALSE; - return TRUE; + return false; + return sal_True; } //------------------------------------------------------------------------ // IsEqual - komplette Inhalte vergleichen -BOOL ScSortedCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const +sal_Bool ScSortedCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const { return ( Compare(pKey1, pKey2) == 0 ); // Default: nur Index vergleichen } @@ -341,10 +341,10 @@ ScDataObject* TypedStrData::Clone() const return new TypedStrData(*this); } -TypedScStrCollection::TypedScStrCollection( USHORT nLim , USHORT nDel , BOOL bDup ) +TypedScStrCollection::TypedScStrCollection( sal_uInt16 nLim , sal_uInt16 nDel , sal_Bool bDup ) : ScSortedCollection( nLim, nDel, bDup ) { - bCaseSensitive = FALSE; + bCaseSensitive = false; } TypedScStrCollection::~TypedScStrCollection() @@ -354,12 +354,12 @@ ScDataObject* TypedScStrCollection::Clone() const return new TypedScStrCollection(*this); } -TypedStrData* TypedScStrCollection::operator[]( const USHORT nIndex) const +TypedStrData* TypedScStrCollection::operator[]( const sal_uInt16 nIndex) const { return (TypedStrData*)At(nIndex); } -void TypedScStrCollection::SetCaseSensitive( BOOL bSet ) +void TypedScStrCollection::SetCaseSensitive( sal_Bool bSet ) { bCaseSensitive = bSet; } @@ -406,13 +406,13 @@ short TypedScStrCollection::Compare( ScDataObject* pKey1, ScDataObject* pKey2 ) return nResult; } -BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, - USHORT& rPos, BOOL bBack ) const +sal_Bool TypedScStrCollection::FindText( const String& rStart, String& rResult, + sal_uInt16& rPos, sal_Bool bBack ) const { // Die Collection ist nach String-Vergleichen sortiert, darum muss hier // alles durchsucht werden - BOOL bFound = FALSE; + sal_Bool bFound = false; String aOldResult; if ( rPos != SCPOS_INVALID && rPos < nCount ) @@ -424,11 +424,11 @@ BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, if ( bBack ) // rueckwaerts { - USHORT nStartPos = nCount; + sal_uInt16 nStartPos = nCount; if ( rPos != SCPOS_INVALID ) nStartPos = rPos; // weitersuchen... - for ( USHORT i=nStartPos; i>0; ) + for ( sal_uInt16 i=nStartPos; i>0; ) { --i; TypedStrData* pData = (TypedStrData*) pItems[i]; @@ -444,7 +444,7 @@ BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, { rResult = pData->aStrValue; rPos = i; - bFound = TRUE; + bFound = sal_True; break; } } @@ -453,11 +453,11 @@ BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, } else // vorwaerts { - USHORT nStartPos = 0; + sal_uInt16 nStartPos = 0; if ( rPos != SCPOS_INVALID ) nStartPos = rPos + 1; // weitersuchen... - for ( USHORT i=nStartPos; i<nCount; i++ ) + for ( sal_uInt16 i=nStartPos; i<nCount; i++ ) { TypedStrData* pData = (TypedStrData*) pItems[i]; if (pData->nStrType) @@ -472,7 +472,7 @@ BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, { rResult = pData->aStrValue; rPos = i; - bFound = TRUE; + bFound = sal_True; break; } } @@ -485,20 +485,20 @@ BOOL TypedScStrCollection::FindText( const String& rStart, String& rResult, // Gross-/Kleinschreibung anpassen -BOOL TypedScStrCollection::GetExactMatch( String& rString ) const +sal_Bool TypedScStrCollection::GetExactMatch( String& rString ) const { - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) { TypedStrData* pData = (TypedStrData*) pItems[i]; if ( pData->nStrType && ScGlobal::GetpTransliteration()->isEqual( pData->aStrValue, rString ) ) { rString = pData->aStrValue; // String anpassen - return TRUE; + return sal_True; } } - return FALSE; + return false; } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index db37d0302939..746438a70f1e 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -223,14 +223,14 @@ bool ScCompiler::IsEnglishSymbol( const String& rName ) return true; } // 2. old add in functions - USHORT nIndex; + sal_uInt16 nIndex; if ( ScGlobal::GetFuncCollection()->SearchFunc( aUpper, nIndex ) ) { return true; } // 3. new (uno) add in functions - String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, FALSE )); + String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, false )); if (aIntName.Len()) { return true; @@ -322,9 +322,9 @@ void ScCompiler::SetGrammarAndRefConvention( SetRefConvention( eConv ); } -String ScCompiler::FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const +String ScCompiler::FindAddInFunction( const String& rUpperName, sal_Bool bLocalFirst ) const { - return ScGlobal::GetAddInCollection()->FindFunction(rUpperName, bLocalFirst); // bLocalFirst=FALSE for english + return ScGlobal::GetAddInCollection()->FindFunction(rUpperName, bLocalFirst); // bLocalFirst=sal_False for english } @@ -341,7 +341,7 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv ) meConv( eConv ) { int i; - ULONG *t= new ULONG [128]; + sal_uLong *t= new sal_uLong [128]; ScCompiler::pConventions[ meConv ] = this; mpCharTable = t; @@ -512,7 +512,7 @@ static bool lcl_parseExternalName( // indexed external document names. ScRange aRange; String aStartTabName, aEndTabName; - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; p = aRange.Parse_XL_Header( p, pDoc, aTmpFile, aStartTabName, aEndTabName, nFlags, true, pExternalLinks ); if (!p || p == pStart) @@ -748,7 +748,7 @@ struct Convention_A1 : public ScCompiler::Convention nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed ); } - virtual ULONG getCharTableFlags( sal_Unicode c, sal_Unicode /*cLast*/ ) const + virtual sal_uLong getCharTableFlags( sal_Unicode c, sal_Unicode /*cLast*/ ) const { return mpCharTable[static_cast<sal_uInt8>(c)]; } @@ -893,7 +893,7 @@ struct ConventionOOO_A1 : public Convention_A1 void MakeRefStr( rtl::OUStringBuffer& rBuffer, const ScCompiler& rComp, const ScComplexRefData& rRef, - BOOL bSingleRef ) const + sal_Bool bSingleRef ) const { MakeRefStrImpl( rBuffer, rComp, rRef, bSingleRef, false); } @@ -1080,7 +1080,7 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1 void MakeRefStr( rtl::OUStringBuffer& rBuffer, const ScCompiler& rComp, const ScComplexRefData& rRef, - BOOL bSingleRef ) const + sal_Bool bSingleRef ) const { MakeRefStrImpl( rBuffer, rComp, rRef, bSingleRef, true); } @@ -1337,7 +1337,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL void MakeRefStr( rtl::OUStringBuffer& rBuf, const ScCompiler& rComp, const ScComplexRefData& rRef, - BOOL bSingleRef ) const + sal_Bool bSingleRef ) const { ScComplexRefData aRef( rRef ); @@ -1539,7 +1539,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL void MakeRefStr( rtl::OUStringBuffer& rBuf, const ScCompiler& rComp, const ScComplexRefData& rRef, - BOOL bSingleRef ) const + sal_Bool bSingleRef ) const { ScComplexRefData aRef( rRef ); @@ -1718,9 +1718,9 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL r1c1_add_col(rBuffer, aRef.Ref2); } - virtual ULONG getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const + virtual sal_uLong getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const { - ULONG nFlags = mpCharTable[static_cast<sal_uInt8>(c)]; + sal_uLong nFlags = mpCharTable[static_cast<sal_uInt8>(c)]; if (c == '-' && cLast == '[') // '-' can occur within a reference string only after '[' e.g. R[-1]C. nFlags |= SC_COMPILER_C_IDENT; @@ -1830,7 +1830,7 @@ void ScCompiler::SetRefConvention( const ScCompiler::Convention *pConvP ) "ScCompiler::SetRefConvention: unsupported grammar resulting"); } -void ScCompiler::SetError(USHORT nError) +void ScCompiler::SetError(sal_uInt16 nError) { if( !pArr->GetCodeError() ) pArr->SetCodeError( nError); @@ -1916,7 +1916,7 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray) while ((c != 0) && (eState != ssStop) ) { pSrc++; - ULONG nMask = GetCharTableFlags( c, cLast ); + sal_uLong nMask = GetCharTableFlags( c, cLast ); // The parameter separator and the array column and row separators end // things unconditionally if not in string or reference. @@ -2352,7 +2352,7 @@ Label_MaskStateMachine: nSrcPos = sal::static_int_cast<xub_StrLen>( nSrcPos + nSpaces ); String aSymbol; mnRangeOpPosInSymbol = -1; - USHORT nErr = 0; + sal_uInt16 nErr = 0; do { bi18n = false; @@ -2422,10 +2422,10 @@ Label_MaskStateMachine: // Convert symbol to token //--------------------------------------------------------------------------- -BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) +sal_Bool ScCompiler::IsOpCode( const String& rName, bool bInArray ) { OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName)); - BOOL bFound = (iLook != mxSymbols->getHashMap()->end()); + sal_Bool bFound = (iLook != mxSymbols->getHashMap()->end()); if (bFound) { ScRawToken aToken; @@ -2468,7 +2468,7 @@ BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) ScRawToken aToken; aToken.SetOpCode( aOdffAliases[i].eOp); pRawToken = aToken.Clone(); - bFound = TRUE; + bFound = sal_True; break; // for } } @@ -2492,13 +2492,13 @@ BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) // last resort by just falling through to FindFunction(), but // it shouldn't happen if the map was setup correctly. Don't // waste time and bail out. - return FALSE; + return false; } } if (!aIntName.Len()) { // Old (deprecated) addins first for legacy. - USHORT nIndex; + sal_uInt16 nIndex; bFound = ScGlobal::GetFuncCollection()->SearchFunc( cSymbol, nIndex); if (bFound) { @@ -2507,7 +2507,7 @@ BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) pRawToken = aToken.Clone(); } else - // bLocalFirst=FALSE for (English) upper full original name + // bLocalFirst=sal_False for (English) upper full original name // (service.function) aIntName = ScGlobal::GetAddInCollection()->FindFunction( rName, !mxSymbols->isEnglish()); @@ -2517,7 +2517,7 @@ BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) ScRawToken aToken; aToken.SetExternal( aIntName.GetBuffer() ); // international name pRawToken = aToken.Clone(); - bFound = TRUE; + bFound = sal_True; } } OpCode eOp; @@ -2537,10 +2537,10 @@ BOOL ScCompiler::IsOpCode( const String& rName, bool bInArray ) return bFound; } -BOOL ScCompiler::IsOpCode2( const String& rName ) +sal_Bool ScCompiler::IsOpCode2( const String& rName ) { - BOOL bFound = FALSE; - USHORT i; + sal_Bool bFound = false; + sal_uInt16 i; for( i = ocInternalBegin; i <= ocInternalEnd && !bFound; i++ ) bFound = rName.EqualsAscii( pInternal[ i-ocInternalBegin ] ); @@ -2554,7 +2554,7 @@ BOOL ScCompiler::IsOpCode2( const String& rName ) return bFound; } -BOOL ScCompiler::IsValue( const String& rSym ) +sal_Bool ScCompiler::IsValue( const String& rSym ) { double fVal; sal_uInt32 nIndex = ( mxSymbols->isEnglish() ? @@ -2562,7 +2562,7 @@ BOOL ScCompiler::IsValue( const String& rSym ) if (pDoc->GetFormatTable()->IsNumberFormat( rSym, nIndex, fVal ) ) { - USHORT nType = pDoc->GetFormatTable()->GetType(nIndex); + sal_uInt16 nType = pDoc->GetFormatTable()->GetType(nIndex); // Don't accept 3:3 as time, it is a reference to entire row 3 instead. // Dates should never be entered directly and automatically converted @@ -2570,7 +2570,7 @@ BOOL ScCompiler::IsValue( const String& rSym ) // Usually it wouldn't be accepted anyway because the date separator // clashed with other separators or operators. if (nType & (NUMBERFORMAT_TIME | NUMBERFORMAT_DATE)) - return FALSE; + return false; if (nType == NUMBERFORMAT_LOGICAL) { @@ -2578,7 +2578,7 @@ BOOL ScCompiler::IsValue( const String& rSym ) while( *p == ' ' ) p++; if (*p == '(') - return FALSE; // Boolean function instead. + return false; // Boolean function instead. } if( nType == NUMBERFORMAT_TEXT ) @@ -2587,23 +2587,23 @@ BOOL ScCompiler::IsValue( const String& rSym ) ScRawToken aToken; aToken.SetDouble( fVal ); pRawToken = aToken.Clone(); - return TRUE; + return sal_True; } else - return FALSE; + return false; } -BOOL ScCompiler::IsString() +sal_Bool ScCompiler::IsString() { register const sal_Unicode* p = cSymbol; while ( *p ) p++; xub_StrLen nLen = sal::static_int_cast<xub_StrLen>( p - cSymbol - 1 ); - BOOL bQuote = ((cSymbol[0] == '"') && (cSymbol[nLen] == '"')); + sal_Bool bQuote = ((cSymbol[0] == '"') && (cSymbol[nLen] == '"')); if ((bQuote ? nLen-2 : nLen) > MAXSTRLEN-1) { SetError(errStringOverflow); - return FALSE; + return false; } if ( bQuote ) { @@ -2611,13 +2611,13 @@ BOOL ScCompiler::IsString() ScRawToken aToken; aToken.SetString( cSymbol+1 ); pRawToken = aToken.Clone(); - return TRUE; + return sal_True; } - return FALSE; + return false; } -BOOL ScCompiler::IsPredetectedReference( const String& rName ) +sal_Bool ScCompiler::IsPredetectedReference( const String& rName ) { // Speedup documents with lots of broken references, e.g. sheet deleted. xub_StrLen nPos = rName.SearchAscii( "#REF!"); @@ -2669,12 +2669,12 @@ BOOL ScCompiler::IsPredetectedReference( const String& rName ) } -BOOL ScCompiler::IsDoubleReference( const String& rName ) +sal_Bool ScCompiler::IsDoubleReference( const String& rName ) { ScRange aRange( aPos, aPos ); const ScAddress::Details aDetails( pConv->meConv, aPos ); ScAddress::ExternalInfo aExtInfo; - USHORT nFlags = aRange.Parse( rName, pDoc, aDetails, &aExtInfo, &maExternalLinks ); + sal_uInt16 nFlags = aRange.Parse( rName, pDoc, aDetails, &aExtInfo, &maExternalLinks ); if( nFlags & SCA_VALID ) { ScRawToken aToken; @@ -2684,13 +2684,13 @@ BOOL ScCompiler::IsDoubleReference( const String& rName ) aRef.Ref1.SetRowRel( (nFlags & SCA_ROW_ABSOLUTE) == 0 ); aRef.Ref1.SetTabRel( (nFlags & SCA_TAB_ABSOLUTE) == 0 ); if ( !(nFlags & SCA_VALID_TAB) ) - aRef.Ref1.SetTabDeleted( TRUE ); // #REF! + aRef.Ref1.SetTabDeleted( sal_True ); // #REF! aRef.Ref1.SetFlag3D( ( nFlags & SCA_TAB_3D ) != 0 ); aRef.Ref2.SetColRel( (nFlags & SCA_COL2_ABSOLUTE) == 0 ); aRef.Ref2.SetRowRel( (nFlags & SCA_ROW2_ABSOLUTE) == 0 ); aRef.Ref2.SetTabRel( (nFlags & SCA_TAB2_ABSOLUTE) == 0 ); if ( !(nFlags & SCA_VALID_TAB2) ) - aRef.Ref2.SetTabDeleted( TRUE ); // #REF! + aRef.Ref2.SetTabDeleted( sal_True ); // #REF! aRef.Ref2.SetFlag3D( ( nFlags & SCA_TAB2_3D ) != 0 ); aRef.CalcRelFromAbs( aPos ); if (aExtInfo.mbExternal) @@ -2711,12 +2711,12 @@ BOOL ScCompiler::IsDoubleReference( const String& rName ) } -BOOL ScCompiler::IsSingleReference( const String& rName ) +sal_Bool ScCompiler::IsSingleReference( const String& rName ) { ScAddress aAddr( aPos ); const ScAddress::Details aDetails( pConv->meConv, aPos ); ScAddress::ExternalInfo aExtInfo; - USHORT nFlags = aAddr.Parse( rName, pDoc, aDetails, &aExtInfo, &maExternalLinks ); + sal_uInt16 nFlags = aAddr.Parse( rName, pDoc, aDetails, &aExtInfo, &maExternalLinks ); // Something must be valid in order to recognize Sheet1.blah or blah.a1 // as a (wrong) reference. if( nFlags & ( SCA_VALID_COL|SCA_VALID_ROW|SCA_VALID_TAB ) ) @@ -2757,14 +2757,14 @@ BOOL ScCompiler::IsSingleReference( const String& rName ) } -BOOL ScCompiler::IsReference( const String& rName ) +sal_Bool ScCompiler::IsReference( const String& rName ) { // Has to be called before IsValue sal_Unicode ch1 = rName.GetChar(0); sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0) ); if ( ch1 == cDecSep ) - return FALSE; + return false; // Who was that imbecile introducing '.' as the sheet name separator!?! if ( CharClass::isAsciiNumeric( ch1 ) ) { @@ -2779,12 +2779,12 @@ BOOL ScCompiler::IsReference( const String& rName ) { if (ScGlobal::FindUnquoted( rName, ':') != STRING_NOTFOUND) break; // may be 3:3, continue as usual - return FALSE; + return false; } sal_Unicode const * const pTabSep = rName.GetBuffer() + nPos; sal_Unicode ch2 = pTabSep[1]; // maybe a column identifier if ( !(ch2 == '$' || CharClass::isAsciiAlpha( ch2 )) ) - return FALSE; + return false; if ( cDecSep == '.' && (ch2 == 'E' || ch2 == 'e') // E + - digit && (GetCharTableFlags( pTabSep[2], pTabSep[1] ) & SC_COMPILER_C_VALUE_EXP) ) { // #91053# @@ -2801,7 +2801,7 @@ BOOL ScCompiler::IsReference( const String& rName ) String aTabName( rName.Copy( 0, nPos ) ); SCTAB nTab; if ( !pDoc->GetTable( aTabName, nTab ) ) - return FALSE; + return false; // If sheet "1" exists and the expression is 1.E+2 continue as // usual, the ScRange/ScAddress parser will take care of it. } @@ -2849,14 +2849,13 @@ BOOL ScCompiler::IsReference( const String& rName ) return false; } -BOOL ScCompiler::IsMacro( const String& rName ) +sal_Bool ScCompiler::IsMacro( const String& rName ) { String aName( rName); StarBASIC* pObj = 0; SfxObjectShell* pDocSh = pDoc->GetDocumentShell(); SfxApplication* pSfxApp = SFX_APP(); - pSfxApp->EnterBasicCall(); // initialize document's BASIC if( pDocSh )//XXX pObj = pDocSh->GetBasic(); @@ -2873,26 +2872,23 @@ BOOL ScCompiler::IsMacro( const String& rName ) SbxMethod* pMeth = (SbxMethod*) pObj->Find( aName, SbxCLASS_METHOD ); if( !pMeth ) { - pSfxApp->LeaveBasicCall(); - return FALSE; + return false; } // It really should be a BASIC function! if( pMeth->GetType() == SbxVOID || ( pMeth->IsFixed() && pMeth->GetType() == SbxEMPTY ) || !pMeth->ISA(SbMethod) ) { - pSfxApp->LeaveBasicCall(); - return FALSE; + return false; } ScRawToken aToken; aToken.SetExternal( aName.GetBuffer() ); aToken.eOp = ocMacro; pRawToken = aToken.Clone(); - pSfxApp->LeaveBasicCall(); - return TRUE; + return sal_True; } -BOOL ScCompiler::IsNamedRange( const String& rUpperName ) +sal_Bool ScCompiler::IsNamedRange( const String& rUpperName ) { // IsNamedRange is called only from NextNewToken, with an upper-case string @@ -2941,9 +2937,9 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol ) return true; } -BOOL ScCompiler::IsDBRange( const String& rName ) +sal_Bool ScCompiler::IsDBRange( const String& rName ) { - USHORT n; + sal_uInt16 n; ScDBCollection* pDBColl = pDoc->GetDBCollection(); if (pDBColl->SearchName( rName, n ) ) { @@ -2952,16 +2948,16 @@ BOOL ScCompiler::IsDBRange( const String& rName ) aToken.SetName( pData->GetIndex() ); aToken.eOp = ocDBArea; pRawToken = aToken.Clone(); - return TRUE; + return sal_True; } else - return FALSE; + return false; } -BOOL ScCompiler::IsColRowName( const String& rName ) +sal_Bool ScCompiler::IsColRowName( const String& rName ) { - BOOL bInList = FALSE; - BOOL bFound = FALSE; + sal_Bool bInList = false; + sal_Bool bFound = false; ScSingleRefData aRef; String aName( rName ); DeQuote( aName ); @@ -2992,10 +2988,10 @@ BOOL ScCompiler::IsColRowName( const String& rName ) // recursive.. // Furthermore, *this* cell won't be touched, since no RPN exists yet. CellType eType = pCell->GetCellType(); - BOOL bOk = sal::static_int_cast<BOOL>( (eType == CELLTYPE_FORMULA ? + sal_Bool bOk = sal::static_int_cast<sal_Bool>( (eType == CELLTYPE_FORMULA ? ((ScFormulaCell*)pCell)->GetCode()->GetCodeLen() > 0 && ((ScFormulaCell*)pCell)->aPos != aPos // noIter - : TRUE ) ); + : sal_True ) ); if ( bOk && pCell->HasStringData() ) { String aStr; @@ -3027,11 +3023,11 @@ BOOL ScCompiler::IsColRowName( const String& rName ) aRef.nRow = aIter.GetRow(); aRef.nTab = aIter.GetTab(); if ( !jRow ) - aRef.SetColRel( TRUE ); // ColName + aRef.SetColRel( sal_True ); // ColName else - aRef.SetRowRel( TRUE ); // RowName + aRef.SetRowRel( sal_True ); // RowName aRef.CalcRelFromAbs( aPos ); - bInList = bFound = TRUE; + bInList = bFound = sal_True; } } } @@ -3043,7 +3039,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) long nDistance = 0, nMax = 0; long nMyCol = (long) aPos.Col(); long nMyRow = (long) aPos.Row(); - BOOL bTwo = FALSE; + sal_Bool bTwo = false; ScAddress aOne( 0, 0, aPos.Tab() ); ScAddress aTwo( MAXCOL, MAXROW, aPos.Tab() ); @@ -3083,7 +3079,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) { if ( nC < 0 || nR < 0 ) { // right or below - bTwo = TRUE; + bTwo = sal_True; aTwo.Set( nCol, nRow, aAddress.Tab() ); nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); nDistance = nD; @@ -3093,7 +3089,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) // upper left, only if not further up than the // current entry and nMyRow is below (CellIter // runs column-wise) - bTwo = FALSE; + bTwo = false; aOne.Set( nCol, nRow, aAddress.Tab() ); nMax = Max( nMyCol + nC, nMyRow + nR ); nDistance = nD; @@ -3106,7 +3102,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) nDistance = nC * nC + nR * nR; nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); } - bFound = TRUE; + bFound = sal_True; } } } @@ -3121,10 +3117,10 @@ BOOL ScCompiler::IsColRowName( const String& rName ) break; // aIter } CellType eType = pCell->GetCellType(); - BOOL bOk = sal::static_int_cast<BOOL>( (eType == CELLTYPE_FORMULA ? + sal_Bool bOk = sal::static_int_cast<sal_Bool>( (eType == CELLTYPE_FORMULA ? ((ScFormulaCell*)pCell)->GetCode()->GetCodeLen() > 0 && ((ScFormulaCell*)pCell)->aPos != aPos // noIter - : TRUE ) ); + : sal_True ) ); if ( bOk && pCell->HasStringData() ) { String aStr; @@ -3162,7 +3158,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) { if ( nC < 0 || nR < 0 ) { // right or below - bTwo = TRUE; + bTwo = sal_True; aTwo.Set( nCol, nRow, aIter.GetTab() ); nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); nDistance = nD; @@ -3172,7 +3168,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) // upper left, only if not further up than the // current entry and nMyRow is below (CellIter // runs column-wise) - bTwo = FALSE; + bTwo = false; aOne.Set( nCol, nRow, aIter.GetTab() ); nMax = Max( nMyCol + nC, nMyRow + nR ); nDistance = nD; @@ -3185,7 +3181,7 @@ BOOL ScCompiler::IsColRowName( const String& rName ) nDistance = nC * nC + nR * nR; nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); } - bFound = TRUE; + bFound = sal_True; } } } @@ -3227,9 +3223,9 @@ BOOL ScCompiler::IsColRowName( const String& rName ) aRef.nCol, aRef.nRow + 1, aRef.nTab )) || (aRef.nRow != 0 && pDoc->HasStringData( aRef.nCol, aRef.nRow - 1, aRef.nTab )) ) - aRef.SetRowRel( TRUE ); // RowName + aRef.SetRowRel( sal_True ); // RowName else - aRef.SetColRel( TRUE ); // ColName + aRef.SetColRel( sal_True ); // ColName aRef.CalcRelFromAbs( aPos ); } } @@ -3239,13 +3235,13 @@ BOOL ScCompiler::IsColRowName( const String& rName ) aToken.SetSingleReference( aRef ); aToken.eOp = ocColRowName; pRawToken = aToken.Clone(); - return TRUE; + return sal_True; } else - return FALSE; + return false; } -BOOL ScCompiler::IsBoolean( const String& rName ) +sal_Bool ScCompiler::IsBoolean( const String& rName ) { OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName ) ); if( iLook != mxSymbols->getHashMap()->end() && @@ -3255,10 +3251,10 @@ BOOL ScCompiler::IsBoolean( const String& rName ) ScRawToken aToken; aToken.SetOpCode( (*iLook).second ); pRawToken = aToken.Clone(); - return TRUE; + return sal_True; } else - return FALSE; + return false; } //--------------------------------------------------------------------------- @@ -3287,17 +3283,17 @@ void ScCompiler::AutoCorrectParsedSymbol() aCorrectedSymbol.SetChar( nPos, cQuote ); // '"' the 255th character else aCorrectedSymbol.Insert( cQuote, nPos + 1 ); - bCorrected = TRUE; + bCorrected = sal_True; } else if ( c1 != cQuote && c2 == cQuote ) { // ..." aCorrectedSymbol.Insert( cQuote, 0 ); - bCorrected = TRUE; + bCorrected = sal_True; } else if ( nPos == 0 && (c1 == cx || c1 == cX) ) { // x => * aCorrectedSymbol = mxSymbols->getSymbol(ocMul); - bCorrected = TRUE; + bCorrected = sal_True; } else if ( (GetCharTableFlags( c1, 0 ) & SC_COMPILER_C_CHAR_VALUE) && (GetCharTableFlags( c2, c2p ) & SC_COMPILER_C_CHAR_VALUE) ) @@ -3310,7 +3306,7 @@ void ScCompiler::AutoCorrectParsedSymbol() while ( (nIndex = aCorrectedSymbol.SearchAndReplace( cx, c, nIndex )) != STRING_NOTFOUND ) nIndex++; - bCorrected = TRUE; + bCorrected = sal_True; } if ( (nXcount = aCorrectedSymbol.GetTokenCount( cX )) > 1 ) { // X => * @@ -3319,7 +3315,7 @@ void ScCompiler::AutoCorrectParsedSymbol() while ( (nIndex = aCorrectedSymbol.SearchAndReplace( cX, c, nIndex )) != STRING_NOTFOUND ) nIndex++; - bCorrected = TRUE; + bCorrected = sal_True; } } else @@ -3334,16 +3330,16 @@ void ScCompiler::AutoCorrectParsedSymbol() aSymbol.Erase( 0, nPosition + 2 ); } xub_StrLen nRefs = aSymbol.GetTokenCount( ':' ); - BOOL bColons; + sal_Bool bColons; if ( nRefs > 2 ) { // duplicated or too many ':'? B:2::C10 => B2:C10 - bColons = TRUE; + bColons = sal_True; xub_StrLen nIndex = 0; String aTmp1( aSymbol.GetToken( 0, ':', nIndex ) ); xub_StrLen nLen1 = aTmp1.Len(); String aSym, aTmp2; - BOOL bLastAlp, bNextNum; - bLastAlp = bNextNum = TRUE; + sal_Bool bLastAlp, bNextNum; + bLastAlp = bNextNum = sal_True; xub_StrLen nStrip = 0; xub_StrLen nCount = nRefs; for ( xub_StrLen j=1; j<nCount; j++ ) @@ -3397,7 +3393,7 @@ void ScCompiler::AutoCorrectParsedSymbol() aSymbol += aTmp1; } else - bColons = FALSE; + bColons = false; if ( nRefs && nRefs <= 2 ) { // reference twisted? 4A => A4 etc. String aTab[2], aRef[2]; @@ -3410,9 +3406,9 @@ void ScCompiler::AutoCorrectParsedSymbol() else aRef[0] = aSymbol; - BOOL bChanged = FALSE; - BOOL bOk = TRUE; - USHORT nMask = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW; + sal_Bool bChanged = false; + sal_Bool bOk = sal_True; + sal_uInt16 nMask = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW; for ( int j=0; j<nRefs; j++ ) { xub_StrLen nTmp = 0; @@ -3433,7 +3429,7 @@ void ScCompiler::AutoCorrectParsedSymbol() aRef[j] += aStr2; if ( bColons || aRef[j] != aOld ) { - bChanged = TRUE; + bChanged = sal_True; ScAddress aAdr; bOk &= ((aAdr.Parse( aRef[j], pDoc, aDetails ) & nMask) == nMask); } @@ -3449,7 +3445,7 @@ void ScCompiler::AutoCorrectParsedSymbol() aCorrectedSymbol += aTab[1]; aCorrectedSymbol += aRef[1]; } - bCorrected = TRUE; + bCorrected = sal_True; } } } @@ -3473,7 +3469,7 @@ inline bool lcl_UpperAsciiOrI18n( String& rUpper, const String& rOrg, FormulaGra } } -BOOL ScCompiler::NextNewToken( bool bInArray ) +sal_Bool ScCompiler::NextNewToken( bool bInArray ) { bool bAllowBooleans = bInArray; xub_StrLen nSpaces = NextSymbol(bInArray); @@ -3485,7 +3481,7 @@ BOOL ScCompiler::NextNewToken( bool bInArray ) { ScRawToken aToken; aToken.SetOpCode( ocSpaces ); - aToken.sbyte.cByte = (BYTE) ( nSpaces > 255 ? 255 : nSpaces ); + aToken.sbyte.cByte = (sal_uInt8) ( nSpaces > 255 ? 255 : nSpaces ); if( !static_cast<ScTokenArray*>(pArr)->AddRawToken( aToken ) ) { SetError(errCodeOverflow); @@ -3637,7 +3633,7 @@ BOOL ScCompiler::NextNewToken( bool bInArray ) void ScCompiler::CreateStringFromXMLTokenArray( String& rFormula, String& rFormulaNmsp ) { bool bExternal = GetGrammar() == FormulaGrammar::GRAM_EXTERNAL; - USHORT nExpectedCount = bExternal ? 2 : 1; + sal_uInt16 nExpectedCount = bExternal ? 2 : 1; DBG_ASSERT( pArr->GetLen() == nExpectedCount, "ScCompiler::CreateStringFromXMLTokenArray - wrong number of tokens" ); if( pArr->GetLen() == nExpectedCount ) { @@ -3662,13 +3658,13 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula ) aFormula.EraseLeadingChars(); aFormula.EraseTrailingChars(); nSrcPos = 0; - bCorrected = FALSE; + bCorrected = false; if ( bAutoCorrect ) { aCorrectedFormula.Erase(); aCorrectedSymbol.Erase(); } - BYTE nForced = 0; // ==formula forces recalc even if cell is not visible + sal_uInt8 nForced = 0; // ==formula forces recalc even if cell is not visible if( aFormula.GetChar(nSrcPos) == '=' ) { nSrcPos++; @@ -3723,7 +3719,7 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula ) SetError( errPairExpected ); if ( bAutoCorrect ) { - bCorrected = TRUE; + bCorrected = sal_True; aCorrectedSymbol.Erase(); } } @@ -3765,7 +3761,7 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula ) SetError( errPairExpected ); if ( bAutoCorrect ) { - bCorrected = TRUE; + bCorrected = sal_True; aCorrectedSymbol.Erase(); } } @@ -3885,12 +3881,12 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula, const String& r } -BOOL ScCompiler::HandleRange() +sal_Bool ScCompiler::HandleRange() { ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex( pToken->GetIndex() ); if (pRangeData) { - USHORT nErr = pRangeData->GetErrCode(); + sal_uInt16 nErr = pRangeData->GetErrCode(); if( nErr ) SetError( errNoName ); else if ( !bCompileForFAP ) @@ -3906,18 +3902,18 @@ BOOL ScCompiler::HandleRange() FormulaToken* p2 = pArr->PeekNextNoSpaces(); OpCode eOp1 = (p1 ? p1->GetOpCode() : static_cast<OpCode>( ocSep ) ); OpCode eOp2 = (p2 ? p2->GetOpCode() : static_cast<OpCode>( ocSep ) ); - BOOL bBorder1 = (eOp1 == ocSep || eOp1 == ocOpen); - BOOL bBorder2 = (eOp2 == ocSep || eOp2 == ocClose); - BOOL bAddPair = !(bBorder1 && bBorder2); + sal_Bool bBorder1 = (eOp1 == ocSep || eOp1 == ocOpen); + sal_Bool bBorder2 = (eOp2 == ocSep || eOp2 == ocClose); + sal_Bool bAddPair = !(bBorder1 && bBorder2); if ( bAddPair ) { pNew = new ScTokenArray(); pNew->AddOpCode( ocClose ); - PushTokenArray( pNew, TRUE ); + PushTokenArray( pNew, sal_True ); pNew->Reset(); } pNew = pRangeData->GetCode()->Clone(); - PushTokenArray( pNew, TRUE ); + PushTokenArray( pNew, sal_True ); if( pRangeData->HasReferences() ) { SetRelNameReference(); @@ -3928,7 +3924,7 @@ BOOL ScCompiler::HandleRange() { pNew = new ScTokenArray(); pNew->AddOpCode( ocOpen ); - PushTokenArray( pNew, TRUE ); + PushTokenArray( pNew, sal_True ); pNew->Reset(); } return GetToken(); @@ -3936,10 +3932,10 @@ BOOL ScCompiler::HandleRange() } else SetError(errNoName); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ScCompiler::HandleExternalReference(const FormulaToken& _aToken) +sal_Bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken) { // Handle external range names. switch (_aToken.GetType()) @@ -3980,9 +3976,9 @@ BOOL ScCompiler::HandleExternalReference(const FormulaToken& _aToken) } default: OSL_FAIL("Wrong type for external reference!"); - return FALSE; + return false; } - return TRUE; + return sal_True; } @@ -4004,7 +4000,7 @@ BOOL ScCompiler::HandleExternalReference(const FormulaToken& _aToken) //----------------------------------------------------------------------------- -BOOL ScCompiler::HasModifiedRange() +sal_Bool ScCompiler::HasModifiedRange() { pArr->Reset(); for ( FormulaToken* t = pArr->Next(); t; t = pArr->Next() ) @@ -4015,24 +4011,24 @@ BOOL ScCompiler::HasModifiedRange() ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex(t->GetIndex()); if (pRangeData && pRangeData->IsModified()) - return TRUE; + return sal_True; } else if ( eOpCode == ocDBArea ) { ScDBData* pDBData = pDoc->GetDBCollection()->FindIndex(t->GetIndex()); if (pDBData && pDBData->IsModified()) - return TRUE; + return sal_True; } } - return FALSE; + return false; } //--------------------------------------------------------------------------- template< typename T, typename S > -S lcl_adjval( S& n, T pos, T max, BOOL bRel ) +S lcl_adjval( S& n, T pos, T max, sal_Bool bRel ) { max++; if( bRel ) @@ -4056,12 +4052,12 @@ void ScCompiler::SetRelNameReference() { ScSingleRefData& rRef1 = t->GetSingleRef(); if ( rRef1.IsColRel() || rRef1.IsRowRel() || rRef1.IsTabRel() ) - rRef1.SetRelName( TRUE ); + rRef1.SetRelName( sal_True ); if ( t->GetType() == svDoubleRef ) { ScSingleRefData& rRef2 = t->GetDoubleRef().Ref2; if ( rRef2.IsColRel() || rRef2.IsRowRel() || rRef2.IsTabRel() ) - rRef2.SetRelName( TRUE ); + rRef2.SetRelName( sal_True ); } } } @@ -4149,14 +4145,14 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, for( t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()); t && !pRangeData; t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()) ) { - BOOL bRelName = (t->GetType() == svSingleRef ? + sal_Bool bRelName = (t->GetType() == svSingleRef ? t->GetSingleRef().IsRelName() : (t->GetDoubleRef().Ref1.IsRelName() || t->GetDoubleRef().Ref2.IsRelName())); if (bRelName) { t->CalcAbsIfRel( rOldPos); - BOOL bValid = (t->GetType() == svSingleRef ? + sal_Bool bValid = (t->GetType() == svSingleRef ? t->GetSingleRef().Valid() : t->GetDoubleRef().Valid()); // If the reference isn't valid, copying the formula @@ -4242,12 +4238,12 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, } } #if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - BOOL bEasyShared, bPosInRange; + sal_Bool bEasyShared, bPosInRange; if ( !pRangeData ) - bEasyShared = bPosInRange = FALSE; + bEasyShared = bPosInRange = false; else { - bEasyShared = TRUE; + bEasyShared = sal_True; bPosInRange = r.In( eUpdateRefMode == URM_MOVE ? aPos : rOldPos ); } #endif @@ -4257,7 +4253,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, if ( t->GetRef() != 1 ) { #if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - bEasyShared = FALSE; + bEasyShared = false; #endif } else @@ -4286,7 +4282,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, const ScSingleRefData& rSRD = aMod.Ref().Ref1; ScAddress aRef( rSRD.nCol, rSRD.nRow, rSRD.nTab ); if ( r.In( aRef ) != bPosInRange ) - bEasyShared = FALSE; + bEasyShared = false; } #endif } @@ -4315,7 +4311,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, { rRefSizeChanged = true; #if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - bEasyShared = FALSE; + bEasyShared = false; #endif } } @@ -4327,7 +4323,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, rRef.Ref1.nTab, rRef.Ref2.nCol, rRef.Ref2.nRow, rRef.Ref2.nTab ); if ( r.In( aRef ) != bPosInRange ) - bEasyShared = FALSE; + bEasyShared = false; } #endif } @@ -4347,13 +4343,13 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, } } -BOOL ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode, +sal_Bool ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - BOOL& rChanged, BOOL bSharedFormula) + sal_Bool& rChanged, sal_Bool bSharedFormula) { - BOOL bRelRef = FALSE; // set if relative reference - rChanged = FALSE; + sal_Bool bRelRef = false; // set if relative reference + rChanged = false; pArr->Reset(); ScToken* t; while ( (t = static_cast<ScToken*>(pArr->GetNextReference())) != NULL ) @@ -4387,7 +4383,7 @@ BOOL ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode, if (ScRefUpdate::Update( pDoc, eUpdateRefMode, aPos, r, nDx, nDy, nDz, rRef, ScRefUpdate::ABSOLUTE) != UR_NOTHING ) - rChanged = TRUE; + rChanged = sal_True; } } return bRelRef; @@ -4463,12 +4459,12 @@ void ScCompiler::UpdateSharedFormulaReference( UpdateRefMode eUpdateRefMode, } -ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, BOOL bIsName ) +ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, sal_Bool bIsName ) { ScRangeData* pRangeData = NULL; SCTAB nPosTab = aPos.Tab(); // _after_ incremented! SCTAB nOldPosTab = ((nPosTab > nTable) ? (nPosTab - 1) : nPosTab); - BOOL bIsRel = FALSE; + sal_Bool bIsRel = false; ScToken* t; pArr->Reset(); if (bIsName) @@ -4502,7 +4498,7 @@ ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, BOOL bIsName ) rRef.nRelTab = rRef.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; if ( t->GetType() == svDoubleRef ) { if ( !(bIsName && t->GetDoubleRef().Ref2.IsTabRel()) ) @@ -4519,7 +4515,7 @@ ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, BOOL bIsName ) rRef.nRelTab = rRef.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; } if ( bIsName && bIsRel ) pRangeData = (ScRangeData*) this; // not dereferenced in rangenam @@ -4571,15 +4567,15 @@ ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, BOOL bIsName ) return pRangeData; } -ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL bIsName, - BOOL& rChanged) +ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, sal_Bool /* bIsMove */, sal_Bool bIsName, + sal_Bool& rChanged) { ScRangeData* pRangeData = NULL; SCTAB nTab, nTab2; SCTAB nPosTab = aPos.Tab(); // _after_ decremented! SCTAB nOldPosTab = ((nPosTab >= nTable) ? (nPosTab + 1) : nPosTab); - rChanged = FALSE; - BOOL bIsRel = FALSE; + rChanged = false; + sal_Bool bIsRel = false; ScToken* t; pArr->Reset(); if (bIsName) @@ -4596,7 +4592,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL if (pName && pName->HasType(RT_SHAREDMOD)) pRangeData = pName; } - rChanged = TRUE; + rChanged = sal_True; } else if( t->GetType() != svIndex ) // it may be a DB area!!! { @@ -4610,7 +4606,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL if ( nTable < nTab ) { rRef.nTab = nTab - 1; - rChanged = TRUE; + rChanged = sal_True; } else if ( nTable == nTab ) { @@ -4625,7 +4621,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL || (nTab+1) >= pDoc->GetTableCount() ) { rRef.nTab = MAXTAB+1; - rRef.SetTabDeleted( TRUE ); + rRef.SetTabDeleted( sal_True ); } // else: nTab later points to what's nTable+1 now // => area shrunk @@ -4633,14 +4629,14 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL else { rRef.nTab = MAXTAB+1; - rRef.SetTabDeleted( TRUE ); + rRef.SetTabDeleted( sal_True ); } - rChanged = TRUE; + rChanged = sal_True; } rRef.nRelTab = rRef.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; if ( t->GetType() == svDoubleRef ) { if ( !(bIsName && t->GetDoubleRef().Ref2.IsTabRel()) ) @@ -4653,7 +4649,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL if ( nTable < nTab ) { rRef.nTab = nTab - 1; - rChanged = TRUE; + rChanged = sal_True; } else if ( nTable == nTab ) { @@ -4662,14 +4658,14 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL else { rRef.nTab = MAXTAB+1; - rRef.SetTabDeleted( TRUE ); + rRef.SetTabDeleted( sal_True ); } - rChanged = TRUE; + rChanged = sal_True; } rRef.nRelTab = rRef.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; } if ( bIsName && bIsRel ) pRangeData = (ScRangeData*) this; // not dereferenced in rangenam @@ -4696,7 +4692,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL if ( nTable < nTab ) { rRef1.nTab = nTab - 1; - rChanged = TRUE; + rChanged = sal_True; } else if ( nTable == nTab ) { @@ -4711,7 +4707,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL || (nTab+1) >= pDoc->GetTableCount() ) { rRef1.nTab = MAXTAB+1; - rRef1.SetTabDeleted( TRUE ); + rRef1.SetTabDeleted( sal_True ); } // else: nTab later points to what's nTable+1 now // => area shrunk @@ -4719,9 +4715,9 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL else { rRef1.nTab = MAXTAB+1; - rRef1.SetTabDeleted( TRUE ); + rRef1.SetTabDeleted( sal_True ); } - rChanged = TRUE; + rChanged = sal_True; } rRef1.nRelTab = rRef1.nTab - nPosTab; } @@ -4737,7 +4733,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL if ( nTable < nTab ) { rRef2.nTab = nTab - 1; - rChanged = TRUE; + rChanged = sal_True; } else if ( nTable == nTab ) { @@ -4746,9 +4742,9 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL else { rRef2.nTab = MAXTAB+1; - rRef2.SetTabDeleted( TRUE ); + rRef2.SetTabDeleted( sal_True ); } - rChanged = TRUE; + rChanged = sal_True; } rRef2.nRelTab = rRef2.nTab - nPosTab; } @@ -4761,7 +4757,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, BOOL /* bIsMove */, BOOL // aPos.Tab() must be already adjusted! ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, - BOOL bIsName ) + sal_Bool bIsName ) { ScRangeData* pRangeData = NULL; SCsTAB nTab; @@ -4789,7 +4785,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, else nOldPosTab = nPosTab - nDir; // moved by one - BOOL bIsRel = FALSE; + sal_Bool bIsRel = false; ScToken* t; pArr->Reset(); if (bIsName) @@ -4823,7 +4819,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, rRef1.nRelTab = rRef1.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; if ( t->GetType() == svDoubleRef ) { ScSingleRefData& rRef2 = t->GetDoubleRef().Ref2; @@ -4840,7 +4836,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, rRef2.nRelTab = rRef2.nTab - nPosTab; } else - bIsRel = TRUE; + bIsRel = sal_True; SCsTAB nTab1, nTab2; if ( rRef1.IsTabRel() ) nTab1 = rRef1.nRelTab + nPosTab; @@ -5001,7 +4997,7 @@ void ScCompiler::CreateStringFromMatrix( rtl::OUStringBuffer& rBuffer, AppendBoolean(rBuffer, pMatrix->GetDouble(nC, nR) != 0.0); else { - USHORT nErr = pMatrix->GetError(nC, nR); + sal_uInt16 nErr = pMatrix->GetError(nC, nR); if (nErr) rBuffer.append(ScGlobal::GetErrorString(nErr)); else @@ -5036,16 +5032,16 @@ void ScCompiler::CreateStringFromSingleRef(rtl::OUStringBuffer& rBuffer,FormulaT else { rBuffer.append(ScGlobal::GetRscString(STR_NO_NAME_REF)); - pConv->MakeRefStr (rBuffer, *this, aRef, TRUE ); + pConv->MakeRefStr (rBuffer, *this, aRef, sal_True ); } } else - pConv->MakeRefStr( rBuffer, *this, aRef, TRUE ); + pConv->MakeRefStr( rBuffer, *this, aRef, sal_True ); } // ----------------------------------------------------------------------------- void ScCompiler::CreateStringFromDoubleRef(rtl::OUStringBuffer& rBuffer,FormulaToken* _pTokenP) { - pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), FALSE ); + pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), false ); } // ----------------------------------------------------------------------------- void ScCompiler::CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken* _pTokenP) @@ -5087,19 +5083,19 @@ void ScCompiler::LocalizeString( String& rName ) ScGlobal::GetAddInCollection()->LocalizeString( rName ); } // ----------------------------------------------------------------------------- -BOOL ScCompiler::IsImportingXML() const +sal_Bool ScCompiler::IsImportingXML() const { return pDoc->IsImportingXML(); } // Put quotes around string if non-alphanumeric characters are contained, // quote characters contained within are escaped by '\\'. -BOOL ScCompiler::EnQuote( String& rStr ) +sal_Bool ScCompiler::EnQuote( String& rStr ) { sal_Int32 nType = ScGlobal::pCharClass->getStringType( rStr, 0, rStr.Len() ); if ( !CharClass::isNumericType( nType ) && CharClass::isAlphaNumericType( nType ) ) - return FALSE; + return false; xub_StrLen nPos = 0; while ( (nPos = rStr.Search( '\'', nPos)) != STRING_NOTFOUND ) @@ -5109,7 +5105,7 @@ BOOL ScCompiler::EnQuote( String& rStr ) } rStr.Insert( '\'', 0 ); rStr += '\''; - return TRUE; + return sal_True; } sal_Unicode ScCompiler::GetNativeAddressSymbol( Convention::SpecialSymbolType eType ) const @@ -5147,24 +5143,24 @@ void ScCompiler::fillAddInToken(::std::vector< ::com::sun::star::sheet::FormulaO // FIXME: what about those old non-UNO AddIns? } // ----------------------------------------------------------------------------- -BOOL ScCompiler::HandleSingleRef() +sal_Bool ScCompiler::HandleSingleRef() { ScSingleRefData& rRef = static_cast<ScToken*>(pToken.get())->GetSingleRef(); rRef.CalcAbsIfRel( aPos ); if ( !rRef.Valid() ) { SetError( errNoRef ); - return TRUE; + return sal_True; } SCCOL nCol = rRef.nCol; SCROW nRow = rRef.nRow; SCTAB nTab = rRef.nTab; ScAddress aLook( nCol, nRow, nTab ); - BOOL bColName = rRef.IsColRel(); + sal_Bool bColName = rRef.IsColRel(); SCCOL nMyCol = aPos.Col(); SCROW nMyRow = aPos.Row(); - BOOL bInList = FALSE; - BOOL bValidName = FALSE; + sal_Bool bInList = false; + sal_Bool bValidName = false; ScRangePairList* pRL = (bColName ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges()); ScRange aRange; @@ -5173,7 +5169,7 @@ BOOL ScCompiler::HandleSingleRef() ScRangePair* pR = (*pRL)[i]; if ( pR->GetRange(0).In( aLook ) ) { - bInList = bValidName = TRUE; + bInList = bValidName = sal_True; aRange = pR->GetRange(1); if ( bColName ) { @@ -5190,12 +5186,12 @@ BOOL ScCompiler::HandleSingleRef() } if ( !bInList && pDoc->GetDocOptions().IsLookUpColRowNames() ) { // automagically or created by copying and NamePos isn't in list - BOOL bString = pDoc->HasStringData( nCol, nRow, nTab ); + sal_Bool bString = pDoc->HasStringData( nCol, nRow, nTab ); if ( !bString && !pDoc->GetCell( aLook ) ) - bString = TRUE; // empty cell is ok + bString = sal_True; // empty cell is ok if ( bString ) { //! coresponds with ScInterpreter::ScColRowNameAuto() - bValidName = TRUE; + bValidName = sal_True; if ( bColName ) { // ColName SCROW nStartRow = nRow + 1; @@ -5273,10 +5269,10 @@ BOOL ScCompiler::HandleSingleRef() // generated. A ocColRowName or ocIntersect as a neighbor results // in a range. Special case: if label is valid for a single cell, a // position independent SingleRef is generated. - BOOL bSingle = (aRange.aStart == aRange.aEnd); - BOOL bFound; + sal_Bool bSingle = (aRange.aStart == aRange.aEnd); + sal_Bool bFound; if ( bSingle ) - bFound = TRUE; + bFound = sal_True; else { FormulaToken* p1 = pArr->PeekPrevNoSpaces(); @@ -5289,7 +5285,7 @@ BOOL ScCompiler::HandleSingleRef() { if ( (SC_OPCODE_START_BIN_OP <= eOp1 && eOp1 < SC_OPCODE_STOP_BIN_OP) || (SC_OPCODE_START_BIN_OP <= eOp2 && eOp2 < SC_OPCODE_STOP_BIN_OP)) - bSingle = TRUE; + bSingle = sal_True; } if ( bSingle ) { // column and/or row must match range @@ -5309,7 +5305,7 @@ BOOL ScCompiler::HandleSingleRef() } } else - bFound = TRUE; + bFound = sal_True; } if ( !bFound ) SetError(errNoRef); @@ -5321,9 +5317,9 @@ BOOL ScCompiler::HandleSingleRef() ScSingleRefData aRefData; aRefData.InitAddress( aRange.aStart ); if ( bColName ) - aRefData.SetColRel( TRUE ); + aRefData.SetColRel( sal_True ); else - aRefData.SetRowRel( TRUE ); + aRefData.SetRowRel( sal_True ); aRefData.CalcRelFromAbs( aPos ); pNew->AddSingleReference( aRefData ); } @@ -5333,13 +5329,13 @@ BOOL ScCompiler::HandleSingleRef() aRefData.InitRange( aRange ); if ( bColName ) { - aRefData.Ref1.SetColRel( TRUE ); - aRefData.Ref2.SetColRel( TRUE ); + aRefData.Ref1.SetColRel( sal_True ); + aRefData.Ref2.SetColRel( sal_True ); } else { - aRefData.Ref1.SetRowRel( TRUE ); - aRefData.Ref2.SetRowRel( TRUE ); + aRefData.Ref1.SetRowRel( sal_True ); + aRefData.Ref2.SetRowRel( sal_True ); } aRefData.CalcRelFromAbs( aPos ); if ( bInList ) @@ -5349,17 +5345,17 @@ BOOL ScCompiler::HandleSingleRef() pNew->Add( new ScDoubleRefToken( aRefData, ocColRowNameAuto ) ); } } - PushTokenArray( pNew, TRUE ); + PushTokenArray( pNew, sal_True ); pNew->Reset(); return GetToken(); } } else SetError(errNoName); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ScCompiler::HandleDbData() +sal_Bool ScCompiler::HandleDbData() { ScDBData* pDBData = pDoc->GetDBCollection()->FindIndex( pToken->GetIndex() ); if ( !pDBData ) @@ -5377,11 +5373,11 @@ BOOL ScCompiler::HandleDbData() aRefData.CalcRelFromAbs( aPos ); ScTokenArray* pNew = new ScTokenArray(); pNew->AddDoubleReference( aRefData ); - PushTokenArray( pNew, TRUE ); + PushTokenArray( pNew, sal_True ); pNew->Reset(); return GetToken(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index f881a23d9cd2..e92963b0c645 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -107,10 +107,10 @@ void lcl_AddString( String**& pData, T& nCount, const String& rInsert ) ScConsData::ScConsData() : eFunction(SUBTOTAL_FUNC_SUM), - bReference(FALSE), - bColByName(FALSE), - bRowByName(FALSE), - bSubTitles(FALSE), + bReference(false), + bColByName(false), + bRowByName(false), + bSubTitles(false), nColCount(0), nRowCount(0), ppUsed(NULL), @@ -124,7 +124,7 @@ ScConsData::ScConsData() : nTitleCount(0), ppTitles(NULL), ppTitlePos(NULL), - bCornerUsed(FALSE) + bCornerUsed(false) { } @@ -136,7 +136,7 @@ ScConsData::~ScConsData() #define DELETEARR(ppArray,nCount) \ { \ - ULONG i; \ + sal_uLong i; \ if (ppArray) \ for(i=0; i<nCount; i++) \ delete[] ppArray[i]; \ @@ -146,7 +146,7 @@ ScConsData::~ScConsData() #define DELETESTR(ppArray,nCount) \ { \ - ULONG i; \ + sal_uLong i; \ if (ppArray) \ for(i=0; i<nCount; i++) \ delete ppArray[i]; \ @@ -183,14 +183,14 @@ void ScConsData::DeleteData() if (bColByName) nColCount = 0; // sonst stimmt ppColHeaders nicht if (bRowByName) nRowCount = 0; - bCornerUsed = FALSE; + bCornerUsed = false; aCornerText.Erase(); } #undef DELETEARR #undef DELETESTR -void ScConsData::InitData( BOOL bDelete ) +void ScConsData::InitData( sal_Bool bDelete ) { if (bDelete) DeleteData(); @@ -216,11 +216,11 @@ void ScConsData::InitData( BOOL bDelete ) if (nColCount && !ppUsed) { - ppUsed = new BOOL*[nColCount]; + ppUsed = new sal_Bool*[nColCount]; for (SCSIZE i=0; i<nColCount; i++) { - ppUsed[i] = new BOOL[nRowCount]; - memset( ppUsed[i], 0, nRowCount * sizeof(BOOL) ); + ppUsed[i] = new sal_Bool[nRowCount]; + memset( ppUsed[i], 0, nRowCount * sizeof(sal_Bool) ); } } @@ -239,7 +239,7 @@ void ScConsData::InitData( BOOL bDelete ) void ScConsData::DoneFields() { - InitData(FALSE); + InitData(false); } void ScConsData::SetSize( SCCOL nCols, SCROW nRows ) @@ -255,7 +255,7 @@ void ScConsData::GetSize( SCCOL& rCols, SCROW& rRows ) const rRows = static_cast<SCROW>(nRowCount); } -void ScConsData::SetFlags( ScSubTotalFunc eFunc, BOOL bColName, BOOL bRowName, BOOL bRef ) +void ScConsData::SetFlags( ScSubTotalFunc eFunc, sal_Bool bColName, sal_Bool bRowName, sal_Bool bRef ) { DeleteData(); bReference = bRef; @@ -285,10 +285,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab, pSrcDoc->GetString( nCol, nRow1, nTab, aTitle ); if (aTitle.Len()) { - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCSIZE i=0; i<nColCount && !bFound; i++) if ( *ppColHeaders[i] == aTitle ) - bFound = TRUE; + bFound = sal_True; if (!bFound) lcl_AddString( ppColHeaders, nColCount, aTitle ); } @@ -302,10 +302,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab, pSrcDoc->GetString( nCol1, nRow, nTab, aTitle ); if (aTitle.Len()) { - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCSIZE i=0; i<nRowCount && !bFound; i++) if ( *ppRowHeaders[i] == aTitle ) - bFound = TRUE; + bFound = sal_True; if (!bFound) lcl_AddString( ppRowHeaders, nRowCount, aTitle ); } @@ -335,7 +335,7 @@ void ScConsData::AddName( const String& rName ) { if (!ppUsed[nArrX][nArrY]) { - ppUsed[nArrX][nArrY] = TRUE; + ppUsed[nArrX][nArrY] = sal_True; ppRefs[nArrX][nArrY].Init(); } ppRefs[nArrX][nArrY].SetFullSize(nMax); @@ -390,7 +390,7 @@ void lcl_UpdateArray( ScSubTotalFunc eFunc, case SUBTOTAL_FUNC_VAR: case SUBTOTAL_FUNC_VARP: { - BOOL bOk = SubTotal::SafePlus(rSum, nVal); + sal_Bool bOk = SubTotal::SafePlus(rSum, nVal); bOk = bOk && SubTotal::SafeMult(nVal, nVal); bOk = bOk && SubTotal::SafePlus(rSumSqr, nVal); if (!bOk) @@ -425,7 +425,7 @@ void lcl_InitArray( ScSubTotalFunc eFunc, case SUBTOTAL_FUNC_VARP: { rSum = nVal; - BOOL bOk = SubTotal::SafeMult(nVal, nVal); + sal_Bool bOk = SubTotal::SafeMult(nVal, nVal); if (bOk) rSumSqr = nVal; else @@ -536,7 +536,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, else { aCornerText = aThisCorner; - bCornerUsed = TRUE; + bCornerUsed = sal_True; } } @@ -558,12 +558,12 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, SCCOL nPos = SC_CONS_NOTFOUND; if (aTitle.Len()) { - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCSIZE i=0; i<nColCount && !bFound; i++) if ( *ppColHeaders[i] == aTitle ) { nPos = static_cast<SCCOL>(i); - bFound = TRUE; + bFound = sal_True; } DBG_ASSERT(bFound, "Spalte nicht gefunden"); } @@ -579,12 +579,12 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, SCROW nPos = SC_CONS_NOTFOUND; if (aTitle.Len()) { - BOOL bFound = FALSE; + sal_Bool bFound = false; for (SCSIZE i=0; i<nRowCount && !bFound; i++) if ( *ppRowHeaders[i] == aTitle ) { nPos = static_cast<SCROW>(i); - bFound = TRUE; + bFound = sal_True; } DBG_ASSERT(bFound, "Zeile nicht gefunden"); } @@ -596,7 +596,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, // Daten - BOOL bAnyCell = ( eFunction == SUBTOTAL_FUNC_CNT2 ); + sal_Bool bAnyCell = ( eFunction == SUBTOTAL_FUNC_CNT2 ); for (nCol=nCol1; nCol<=nCol2; nCol++) { SCCOL nArrX = nCol-nCol1; @@ -617,7 +617,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, ppRefs[nArrX][nArrY].AddEntry( nCol, nRow, nTab ); else { - ppUsed[nArrX][nArrY] = TRUE; + ppUsed[nArrX][nArrY] = sal_True; ppRefs[nArrX][nArrY].Init(); ppRefs[nArrX][nArrY].AddEntry( nCol, nRow, nTab ); } @@ -632,7 +632,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, nVal); else { - ppUsed[nArrX][nArrY] = TRUE; + ppUsed[nArrX][nArrY] = sal_True; lcl_InitArray( eFunction, ppCount[nArrX][nArrY], ppSum[nArrX][nArrY], ppSumSqr[nArrX][nArrY], nVal ); @@ -728,12 +728,12 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, ScSingleRefData aSRef; // Daten fuer Referenz-Formelzellen aSRef.InitFlags(); - aSRef.SetFlag3D(TRUE); + aSRef.SetFlag3D(sal_True); ScComplexRefData aCRef; // Daten fuer Summen-Zellen aCRef.InitFlags(); - aCRef.Ref1.SetColRel(TRUE); aCRef.Ref1.SetRowRel(TRUE); aCRef.Ref1.SetTabRel(TRUE); - aCRef.Ref2.SetColRel(TRUE); aCRef.Ref2.SetRowRel(TRUE); aCRef.Ref2.SetTabRel(TRUE); + aCRef.Ref1.SetColRel(sal_True); aCRef.Ref1.SetRowRel(sal_True); aCRef.Ref1.SetTabRel(sal_True); + aCRef.Ref2.SetColRel(sal_True); aCRef.Ref2.SetRowRel(sal_True); aCRef.Ref2.SetTabRel(sal_True); for (nArrY=0; nArrY<nRowCount; nArrY++) { @@ -798,16 +798,16 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, // Gliederung einfuegen - ScOutlineArray* pOutArr = pDestDoc->GetOutlineTable( nTab, TRUE )->GetRowArray(); + ScOutlineArray* pOutArr = pDestDoc->GetOutlineTable( nTab, sal_True )->GetRowArray(); SCROW nOutStart = nRow+nArrY; SCROW nOutEnd = nRow+nArrY+nNeeded-1; - BOOL bSize = FALSE; + sal_Bool bSize = false; pOutArr->Insert( nOutStart, nOutEnd, bSize ); pDestDoc->InitializeNoteCaptions(nTab); for (SCROW nOutRow=nOutStart; nOutRow<=nOutEnd; nOutRow++) - pDestDoc->ShowRow( nOutRow, nTab, FALSE ); + pDestDoc->ShowRow( nOutRow, nTab, false ); pDestDoc->SetDrawPageSize(nTab); - pDestDoc->UpdateOutlineRow( nOutStart, nOutEnd, nTab, FALSE ); + pDestDoc->UpdateOutlineRow( nOutStart, nOutEnd, nTab, false ); // Zwischentitel @@ -817,10 +817,10 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, for (SCSIZE nPos=0; nPos<nDataCount; nPos++) { SCSIZE nTPos = ppTitlePos[nArrY][nPos]; - BOOL bDo = TRUE; + sal_Bool bDo = sal_True; if (nPos+1<nDataCount) if (ppTitlePos[nArrY][nPos+1] == nTPos) - bDo = FALSE; // leer + bDo = false; // leer if ( bDo && nTPos < nNeeded ) { aString = *ppRowHeaders[nArrY]; diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx index 3bd737b2c572..a7e27dcf4dd2 100644 --- a/sc/source/core/tool/dbcolect.cxx +++ b/sc/source/core/tool/dbcolect.cxx @@ -47,7 +47,7 @@ ScDBData::ScDBData( const String& rName, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - BOOL bByR, BOOL bHasH) : + sal_Bool bByR, sal_Bool bHasH) : aName (rName), nTable (nTab), nStartCol (nCol1), @@ -56,16 +56,16 @@ ScDBData::ScDBData( const String& rName, nEndRow (nRow2), bByRow (bByR), bHasHeader (bHasH), - bDoSize (FALSE), - bKeepFmt (FALSE), - bStripData (FALSE), - bIsAdvanced (FALSE), - bDBSelection(FALSE), + bDoSize (false), + bKeepFmt (false), + bStripData (false), + bIsAdvanced (false), + bDBSelection(false), nIndex (0), - bAutoFilter (FALSE), - bModified (FALSE) + bAutoFilter (false), + bModified (false) { - USHORT i; + sal_uInt16 i; ScSortParam aSortParam; ScQueryParam aQueryParam; @@ -142,8 +142,8 @@ ScDBData::ScDBData( const ScDBData& rData ) : bAutoFilter (rData.bAutoFilter), bModified (rData.bModified) { - USHORT i; - USHORT j; + sal_uInt16 i; + sal_uInt16 j; for (i=0; i<MAXSORT; i++) { @@ -182,8 +182,8 @@ ScDBData::ScDBData( const ScDBData& rData ) : ScDBData& ScDBData::operator= (const ScDBData& rData) { - USHORT i; - USHORT j; + sal_uInt16 i; + sal_uInt16 j; ScRefreshTimer::operator=( rData ); aName = rData.aName; @@ -275,7 +275,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData) return *this; } -BOOL ScDBData::operator== (const ScDBData& rData) const +sal_Bool ScDBData::operator== (const ScDBData& rData) const { // Daten, die nicht in den Params sind @@ -288,42 +288,42 @@ BOOL ScDBData::operator== (const ScDBData& rData) const // bAutoFilter!= rData.bAutoFilter|| ScRefreshTimer::operator!=( rData ) ) - return FALSE; + return false; if ( bIsAdvanced && aAdvSource != rData.aAdvSource ) - return FALSE; + return false; ScSortParam aSort1, aSort2; GetSortParam(aSort1); rData.GetSortParam(aSort2); if (!(aSort1 == aSort2)) - return FALSE; + return false; ScQueryParam aQuery1, aQuery2; GetQueryParam(aQuery1); rData.GetQueryParam(aQuery2); if (!(aQuery1 == aQuery2)) - return FALSE; + return false; ScSubTotalParam aSubTotal1, aSubTotal2; GetSubTotalParam(aSubTotal1); rData.GetSubTotalParam(aSubTotal2); if (!(aSubTotal1 == aSubTotal2)) - return FALSE; + return false; ScImportParam aImport1, aImport2; GetImportParam(aImport1); rData.GetImportParam(aImport2); if (!(aImport1 == aImport2)) - return FALSE; + return false; - return TRUE; + return sal_True; } ScDBData::~ScDBData() { StopRefreshTimer(); - USHORT i; + sal_uInt16 i; for (i=0; i<MAXQUERY; i++) delete pQueryStr[i]; @@ -405,7 +405,7 @@ void ScDBData::SetDynamicEndRow(SCROW nRow) void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) { - USHORT i; + sal_uInt16 i; long nDifX = ((long) nCol1) - ((long) nStartCol); long nDifY = ((long) nRow1) - ((long) nStartRow); @@ -418,7 +418,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n if (nSortField[i] > nSortEnd) { nSortField[i] = 0; - bDoSort[i] = FALSE; + bDoSort[i] = false; } } for (i=0; i<MAXQUERY; i++) @@ -427,7 +427,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n if (nQueryField[i] > nCol2) { nQueryField[i] = 0; - bDoQuery[i] = FALSE; + bDoQuery[i] = false; } } for (i=0; i<MAXSUBTOTAL; i++) @@ -436,7 +436,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n if (nSubField[i] > nCol2) { nSubField[i] = 0; - bDoSubTotal[i] = FALSE; + bDoSubTotal[i] = false; } } @@ -460,7 +460,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const rSortParam.bIncludePattern = bIncludePattern; rSortParam.bUserDef = bSortUserDef; rSortParam.nUserIndex = nSortUserIndex; - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) { rSortParam.bDoSort[i] = bDoSort[i]; rSortParam.nField[i] = nSortField[i]; @@ -481,7 +481,7 @@ void ScDBData::SetSortParam( const ScSortParam& rSortParam ) nSortDestRow = rSortParam.nDestRow; bSortUserDef = rSortParam.bUserDef; nSortUserIndex = rSortParam.nUserIndex; - for (USHORT i=0; i<MAXSORT; i++) + for (sal_uInt16 i=0; i<MAXSORT; i++) { bDoSort[i] = rSortParam.bDoSort[i]; nSortField[i] = rSortParam.nField[i]; @@ -534,9 +534,9 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam) !rQueryParam.GetEntry(MAXQUERY).bDoQuery, "zuviele Eintraege bei ScDBData::SetQueryParam" ); - // set bIsAdvanced to FALSE for everything that is not from the + // set bIsAdvanced to sal_False for everything that is not from the // advanced filter dialog - bIsAdvanced = FALSE; + bIsAdvanced = false; bQueryInplace = rQueryParam.bInplace; bQueryCaseSens = rQueryParam.bCaseSens; @@ -565,13 +565,13 @@ void ScDBData::SetAdvancedQuerySource(const ScRange* pSource) if (pSource) { aAdvSource = *pSource; - bIsAdvanced = TRUE; + bIsAdvanced = sal_True; } else - bIsAdvanced = FALSE; + bIsAdvanced = false; } -BOOL ScDBData::GetAdvancedQuerySource(ScRange& rSource) const +sal_Bool ScDBData::GetAdvancedQuerySource(ScRange& rSource) const { rSource = aAdvSource; return bIsAdvanced; @@ -579,8 +579,8 @@ BOOL ScDBData::GetAdvancedQuerySource(ScRange& rSource) const void ScDBData::GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const { - USHORT i; - USHORT j; + sal_uInt16 i; + sal_uInt16 j; rSubTotalParam.nCol1 = nStartCol; rSubTotalParam.nRow1 = nStartRow; @@ -619,8 +619,8 @@ void ScDBData::GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const void ScDBData::SetSubTotalParam(const ScSubTotalParam& rSubTotalParam) { - USHORT i; - USHORT j; + sal_uInt16 i; + sal_uInt16 j; bSubRemoveOnly = rSubTotalParam.bRemoveOnly; bSubReplace = rSubTotalParam.bReplace; @@ -676,7 +676,7 @@ void ScDBData::SetImportParam(const ScImportParam& rImportParam) nDBType = rImportParam.nType; } -BOOL ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bStartOnly) const +sal_Bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const { if (nTab == nTable) { @@ -687,12 +687,12 @@ BOOL ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bStartOnly) nRow >= nStartRow && nRow <= nEndRow ); } - return FALSE; + return false; } -BOOL ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const +sal_Bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const { - return (BOOL)((nTab == nTable) + return (sal_Bool)((nTab == nTable) && (nCol1 == nStartCol) && (nRow1 == nStartRow) && (nCol2 == nEndCol) && (nRow2 == nEndRow)); } @@ -715,19 +715,19 @@ short ScDBCollection::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const // IsEqual - alles gleich -BOOL ScDBCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const +sal_Bool ScDBCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const { return *(ScDBData*)pKey1 == *(ScDBData*)pKey2; } -ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bStartOnly) const +ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const { ScDBData* pNoNameData = NULL; if (pItems) { const String& rNoName = ScGlobal::GetRscString( STR_DB_NONAME ); - for (USHORT i = 0; i < nCount; i++) + for (sal_uInt16 i = 0; i < nCount; i++) if (((ScDBData*)pItems[i])->IsDBAtCursor(nCol, nRow, nTab, bStartOnly)) { ScDBData* pDB = (ScDBData*)pItems[i]; @@ -747,7 +747,7 @@ ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCO { const String& rNoName = ScGlobal::GetRscString( STR_DB_NONAME ); - for (USHORT i = 0; i < nCount; i++) + for (sal_uInt16 i = 0; i < nCount; i++) if (((ScDBData*)pItems[i])->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2)) { ScDBData* pDB = (ScDBData*)pItems[i]; @@ -760,7 +760,7 @@ ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCO return pNoNameData; // "unbenannt" nur zurueck, wenn sonst nichts gefunden } -BOOL ScDBCollection::SearchName( const String& rName, USHORT& rIndex ) const +sal_Bool ScDBCollection::SearchName( const String& rName, sal_uInt16& rIndex ) const { ScDBData aDataObj( rName, 0,0,0,0,0 ); return Search( &aDataObj, rIndex ); @@ -768,7 +768,7 @@ BOOL ScDBCollection::SearchName( const String& rName, USHORT& rIndex ) const void ScDBCollection::DeleteOnTab( SCTAB nTab ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; while ( nPos < nCount ) { // look for output positions on the deleted sheet @@ -789,7 +789,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) { SCCOL theCol1; SCROW theRow1; @@ -800,7 +800,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode, ((ScDBData*)pItems[i])->GetArea( theTab1, theCol1, theRow1, theCol2, theRow2 ); theTab2 = theTab1; - BOOL bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode, + sal_Bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode, nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz, theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) != UR_NOTHING; if (bDoUpdate) @@ -818,7 +818,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode, aAdvSource.aEnd.Set( theCol2,theRow2,theTab2 ); ((ScDBData*)pItems[i])->SetAdvancedQuerySource( &aAdvSource ); - bDoUpdate = TRUE; // DBData is modified + bDoUpdate = sal_True; // DBData is modified } } @@ -833,7 +833,7 @@ void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) { // wenn nOldPos vor nNewPos liegt, ist nNewPos schon angepasst - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) { ScRange aRange; ScDBData* pData = (ScDBData*)pItems[i]; @@ -855,7 +855,7 @@ void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) ++nTab; } - BOOL bChanged = ( nTab != aRange.aStart.Tab() ); + sal_Bool bChanged = ( nTab != aRange.aStart.Tab() ); if (bChanged) pData->SetArea( nTab, aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(),aRange.aEnd .Row() ); @@ -867,9 +867,9 @@ void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) } -ScDBData* ScDBCollection::FindIndex(USHORT nIndex) +ScDBData* ScDBCollection::FindIndex(sal_uInt16 nIndex) { - USHORT i = 0; + sal_uInt16 i = 0; while (i < nCount) { if ((*this)[i]->GetIndex() == nIndex) @@ -879,12 +879,12 @@ ScDBData* ScDBCollection::FindIndex(USHORT nIndex) return NULL; } -BOOL ScDBCollection::Insert(ScDataObject* pScDataObject) +sal_Bool ScDBCollection::Insert(ScDataObject* pScDataObject) { ScDBData* pData = (ScDBData*) pScDataObject; if (!pData->GetIndex()) // schon gesetzt? pData->SetIndex(nEntryIndex++); - BOOL bInserted = ScSortedCollection::Insert(pScDataObject); + sal_Bool bInserted = ScSortedCollection::Insert(pScDataObject); if ( bInserted && pData->HasImportParam() && !pData->HasImportSelection() ) { pData->SetRefreshHandler( GetRefreshHandler() ); diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index c3def17327b2..1f0a1f7b5f8c 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -47,19 +47,19 @@ TYPEINIT2(ScDdeLink,::sfx2::SvBaseLink,SfxBroadcaster); #define DDE_TXT_ENCODING gsl_getSystemTextEncoding() -BOOL ScDdeLink::bIsInUpdate = FALSE; +sal_Bool ScDdeLink::bIsInUpdate = false; //------------------------------------------------------------------------ ScDdeLink::ScDdeLink( ScDocument* pD, const String& rA, const String& rT, const String& rI, - BYTE nM ) : + sal_uInt8 nM ) : ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), pDoc( pD ), aAppl( rA ), aTopic( rT ), aItem( rI ), nMode( nM ), - bNeedUpdate( FALSE ), + bNeedUpdate( false ), pResult( NULL ) { } @@ -78,7 +78,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) : aTopic ( rOther.aTopic ), aItem ( rOther.aItem ), nMode ( rOther.nMode ), - bNeedUpdate( FALSE ), + bNeedUpdate( false ), pResult ( NULL ) { if (rOther.pResult) @@ -88,7 +88,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) : ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr ) : ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), pDoc( pD ), - bNeedUpdate( FALSE ), + bNeedUpdate( false ), pResult( NULL ) { rHdr.StartEntry(); @@ -98,7 +98,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& r rStream.ReadByteString( aTopic, eCharSet ); rStream.ReadByteString( aItem, eCharSet ); - BOOL bHasValue; + sal_Bool bHasValue; rStream >> bHasValue; if ( bHasValue ) pResult = new ScMatrix(0, 0); @@ -120,7 +120,7 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const rStream.WriteByteString( aTopic, eCharSet ); rStream.WriteByteString( aItem, eCharSet ); - BOOL bHasValue = ( pResult != NULL ); + sal_Bool bHasValue = ( pResult != NULL ); rStream << bHasValue; if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 ) // nicht bei 4.0 Export @@ -175,7 +175,7 @@ void ScDdeLink::DataChanged( const String& rMimeType, // SC_DDE_DEFAULT - Zahlformat aus Zellvorlage "Standard" // SC_DDE_ENGLISH - Standard-Zahlformat fuer English/US // SC_DDE_TEXT - ohne NumberFormatter direkt als String - ULONG nStdFormat = 0; + sal_uLong nStdFormat = 0; if ( nMode == SC_DDE_DEFAULT ) { ScPatternAttr* pDefPattern = pDoc->GetDefPattern(); // enthaelt Standard-Vorlage @@ -240,8 +240,8 @@ void ScDdeLink::ResetValue() void ScDdeLink::ListenersGone() { - BOOL bWas = bIsInUpdate; - bIsInUpdate = TRUE; // Remove() kann Reschedule ausloesen??!? + sal_Bool bWas = bIsInUpdate; + bIsInUpdate = sal_True; // Remove() kann Reschedule ausloesen??!? ScDocument* pStackDoc = pDoc; // member pDoc can't be used after removing the link @@ -261,15 +261,15 @@ void ScDdeLink::ListenersGone() void ScDdeLink::TryUpdate() { if (bIsInUpdate) - bNeedUpdate = TRUE; // kann jetzt nicht ausgefuehrt werden + bNeedUpdate = sal_True; // kann jetzt nicht ausgefuehrt werden else { - bIsInUpdate = TRUE; + bIsInUpdate = true; pDoc->IncInDdeLinkUpdate(); Update(); pDoc->DecInDdeLinkUpdate(); - bIsInUpdate = FALSE; - bNeedUpdate = FALSE; + bIsInUpdate = false; + bNeedUpdate = false; } } diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx index 075187105461..57000eb99844 100644 --- a/sc/source/core/tool/detdata.cxx +++ b/sc/source/core/tool/detdata.cxx @@ -47,17 +47,17 @@ SV_IMPL_PTRARR( ScDetOpArr_Impl, ScDetOpDataPtr ); ScDetOpList::ScDetOpList(const ScDetOpList& rList) : ScDetOpArr_Impl(), - bHasAddError( FALSE ) + bHasAddError( false ) { - USHORT nCount = rList.Count(); + sal_uInt16 nCount = rList.Count(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) Append( new ScDetOpData(*rList[i]) ); } void ScDetOpList::DeleteOnTab( SCTAB nTab ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; while ( nPos < Count() ) { // look for operations on the deleted sheet @@ -72,8 +72,8 @@ void ScDetOpList::DeleteOnTab( SCTAB nTab ) void ScDetOpList::UpdateReference( ScDocument* pDoc, UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - USHORT nCount = Count(); - for (USHORT i=0; i<nCount; i++) + sal_uInt16 nCount = Count(); + for (sal_uInt16 i=0; i<nCount; i++) { ScAddress aPos = (*this)[i]->GetPos(); SCCOL nCol1 = aPos.Col(); @@ -96,21 +96,21 @@ void ScDetOpList::UpdateReference( ScDocument* pDoc, UpdateRefMode eUpdateRefMod void ScDetOpList::Append( ScDetOpData* pDetOpData ) { if ( pDetOpData->GetOperation() == SCDETOP_ADDERROR ) - bHasAddError = TRUE; + bHasAddError = sal_True; Insert( pDetOpData, Count() ); } -BOOL ScDetOpList::operator==( const ScDetOpList& r ) const +sal_Bool ScDetOpList::operator==( const ScDetOpList& r ) const { // fuer Ref-Undo - USHORT nCount = Count(); - BOOL bEqual = ( nCount == r.Count() ); - for (USHORT i=0; i<nCount && bEqual; i++) // Reihenfolge muss auch gleich sein + sal_uInt16 nCount = Count(); + sal_Bool bEqual = ( nCount == r.Count() ); + for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Reihenfolge muss auch gleich sein if ( !(*(*this)[i] == *r[i]) ) // Eintraege unterschiedlich ? - bEqual = FALSE; + bEqual = false; return bEqual; } diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index dd063f5d341a..801a0535c4e4 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -110,7 +110,7 @@ private: SfxItemSet aToTabSet; SfxItemSet aFromTabSet; SfxItemSet aCircleSet; //! einzeln ? - USHORT nMaxLevel; + sal_uInt16 nMaxLevel; public: ScDetectiveData( SdrModel* pModel ); @@ -121,8 +121,8 @@ public: SfxItemSet& GetFromTabSet() { return aFromTabSet; } SfxItemSet& GetCircleSet() { return aCircleSet; } - void SetMaxLevel( USHORT nVal ) { nMaxLevel = nVal; } - USHORT GetMaxLevel() const { return nMaxLevel; } + void SetMaxLevel( sal_uInt16 nVal ) { nMaxLevel = nVal; } + sal_uInt16 GetMaxLevel() const { return nMaxLevel; } }; class ScCommentData @@ -142,11 +142,11 @@ private: ColorData ScDetectiveFunc::nArrowColor = 0; ColorData ScDetectiveFunc::nErrorColor = 0; ColorData ScDetectiveFunc::nCommentColor = 0; -BOOL ScDetectiveFunc::bColorsInitialized = FALSE; +sal_Bool ScDetectiveFunc::bColorsInitialized = false; //------------------------------------------------------------------------ -BOOL lcl_HasThickLine( SdrObject& rObj ) +sal_Bool lcl_HasThickLine( SdrObject& rObj ) { // thin lines get width 0 -> everything greater 0 is a thick line @@ -190,28 +190,28 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) : aArrowSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aCircle) ) ); aArrowSet.Put( XLineStartWidthItem( 200 ) ); - aArrowSet.Put( XLineStartCenterItem( TRUE ) ); + aArrowSet.Put( XLineStartCenterItem( sal_True ) ); aArrowSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) ); aArrowSet.Put( XLineEndWidthItem( 200 ) ); - aArrowSet.Put( XLineEndCenterItem( FALSE ) ); + aArrowSet.Put( XLineEndCenterItem( false ) ); aToTabSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aCircle) ) ); aToTabSet.Put( XLineStartWidthItem( 200 ) ); - aToTabSet.Put( XLineStartCenterItem( TRUE ) ); + aToTabSet.Put( XLineStartCenterItem( sal_True ) ); aToTabSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aSquare) ) ); aToTabSet.Put( XLineEndWidthItem( 300 ) ); - aToTabSet.Put( XLineEndCenterItem( FALSE ) ); + aToTabSet.Put( XLineEndCenterItem( false ) ); aFromTabSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aSquare) ) ); aFromTabSet.Put( XLineStartWidthItem( 300 ) ); - aFromTabSet.Put( XLineStartCenterItem( TRUE ) ); + aFromTabSet.Put( XLineStartCenterItem( sal_True ) ); aFromTabSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) ); aFromTabSet.Put( XLineEndWidthItem( 200 ) ); - aFromTabSet.Put( XLineEndCenterItem( FALSE ) ); + aFromTabSet.Put( XLineEndCenterItem( false ) ); aCircleSet.Put( XLineColorItem( String(), Color( ScDetectiveFunc::GetErrorColor() ) ) ); aCircleSet.Put( XFillStyleItem( XFILL_NONE ) ); - USHORT nWidth = 55; // 54 = 1 Pixel + sal_uInt16 nWidth = 55; // 54 = 1 Pixel aCircleSet.Put( XLineWidthItem( nWidth ) ); } @@ -228,16 +228,16 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) : aCaptionSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) ); aCaptionSet.Put( XLineStartWidthItem( 200 ) ); - aCaptionSet.Put( XLineStartCenterItem( FALSE ) ); + aCaptionSet.Put( XLineStartCenterItem( false ) ); aCaptionSet.Put( XFillStyleItem( XFILL_SOLID ) ); Color aYellow( ScDetectiveFunc::GetCommentColor() ); aCaptionSet.Put( XFillColorItem( String(), aYellow ) ); // shadow - // SdrShadowItem has FALSE, instead the shadow is set for the rectangle + // SdrShadowItem has sal_False, instead the shadow is set for the rectangle // only with SetSpecialTextBoxShadow when the object is created // (item must be set to adjust objects from older files) - aCaptionSet.Put( SdrShadowItem( FALSE ) ); + aCaptionSet.Put( SdrShadowItem( false ) ); aCaptionSet.Put( SdrShadowXDistItem( 100 ) ); aCaptionSet.Put( SdrShadowYDistItem( 100 ) ); @@ -247,8 +247,8 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) : aCaptionSet.Put( SdrTextUpperDistItem( 100 ) ); aCaptionSet.Put( SdrTextLowerDistItem( 100 ) ); - aCaptionSet.Put( SdrTextAutoGrowWidthItem( FALSE ) ); - aCaptionSet.Put( SdrTextAutoGrowHeightItem( TRUE ) ); + aCaptionSet.Put( SdrTextAutoGrowWidthItem( false ) ); + aCaptionSet.Put( SdrTextAutoGrowHeightItem( sal_True ) ); // do use the default cell style, so the user has a chance to // modify the font for the annotations @@ -265,9 +265,9 @@ void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet ) SfxWhichIter aWhichIter( rItemSet ); const SfxPoolItem* pPoolItem = 0; - for( USHORT nWhich = aWhichIter.FirstWhich(); nWhich > 0; nWhich = aWhichIter.NextWhich() ) + for( sal_uInt16 nWhich = aWhichIter.FirstWhich(); nWhich > 0; nWhich = aWhichIter.NextWhich() ) { - if(rItemSet.GetItemState(nWhich, FALSE, &pPoolItem) == SFX_ITEM_SET) + if(rItemSet.GetItemState(nWhich, false, &pPoolItem) == SFX_ITEM_SET) { switch(nWhich) { @@ -297,20 +297,20 @@ void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet ) void ScDetectiveFunc::Modified() { if (pDoc->IsStreamValid(nTab)) - pDoc->SetStreamValid(nTab, FALSE); + pDoc->SetStreamValid(nTab, false); } -inline BOOL Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, +inline sal_Bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, SCCOL nStartCol2, SCROW nStartRow2, SCCOL nEndCol2, SCROW nEndRow2 ) { return nEndCol1 >= nStartCol2 && nEndCol2 >= nStartCol1 && nEndRow1 >= nStartRow2 && nEndRow2 >= nStartRow1; } -BOOL ScDetectiveFunc::HasError( const ScRange& rRange, ScAddress& rErrPos ) +sal_Bool ScDetectiveFunc::HasError( const ScRange& rRange, ScAddress& rErrPos ) { rErrPos = rRange.aStart; - USHORT nError = 0; + sal_uInt16 nError = 0; ScCellIterator aCellIter( pDoc, rRange); ScBaseCell* pCell = aCellIter.GetFirst(); @@ -391,7 +391,7 @@ Rectangle ScDetectiveFunc::GetDrawRect( SCCOL nCol, SCROW nRow ) const return GetDrawRect( nCol, nRow, nCol, nRow ); } -BOOL lcl_IsOtherTab( const basegfx::B2DPolyPolygon& rPolyPolygon ) +sal_Bool lcl_IsOtherTab( const basegfx::B2DPolyPolygon& rPolyPolygon ) { // test if rPolygon is the line end for "other table" (rectangle) if(1L == rPolyPolygon.count()) @@ -409,16 +409,16 @@ BOOL lcl_IsOtherTab( const basegfx::B2DPolyPolygon& rPolyPolygon ) return false; } -BOOL ScDetectiveFunc::HasArrow( const ScAddress& rStart, +sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab ) { - BOOL bStartAlien = ( rStart.Tab() != nTab ); - BOOL bEndAlien = ( nEndTab != nTab ); + sal_Bool bStartAlien = ( rStart.Tab() != nTab ); + sal_Bool bEndAlien = ( nEndTab != nTab ); if (bStartAlien && bEndAlien) { OSL_FAIL("bStartAlien && bEndAlien"); - return TRUE; + return true; } Rectangle aStartRect; @@ -432,7 +432,7 @@ BOOL ScDetectiveFunc::HasArrow( const ScAddress& rStart, SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page ?"); - BOOL bFound = FALSE; + sal_Bool bFound = false; SdrObjListIter aIter( *pPage, IM_FLAT ); SdrObject* pObject = aIter.Next(); while (pObject && !bFound) @@ -442,18 +442,18 @@ BOOL ScDetectiveFunc::HasArrow( const ScAddress& rStart, { const SfxItemSet& rSet = pObject->GetMergedItemSet(); - BOOL bObjStartAlien = + sal_Bool bObjStartAlien = lcl_IsOtherTab( ((const XLineStartItem&)rSet.Get(XATTR_LINESTART)).GetLineStartValue() ); - BOOL bObjEndAlien = + sal_Bool bObjEndAlien = lcl_IsOtherTab( ((const XLineEndItem&)rSet.Get(XATTR_LINEEND)).GetLineEndValue() ); - BOOL bStartHit = bStartAlien ? bObjStartAlien : + sal_Bool bStartHit = bStartAlien ? bObjStartAlien : ( !bObjStartAlien && aStartRect.IsInside(pObject->GetPoint(0)) ); - BOOL bEndHit = bEndAlien ? bObjEndAlien : + sal_Bool bEndHit = bEndAlien ? bObjEndAlien : ( !bObjEndAlien && aEndRect.IsInside(pObject->GetPoint(1)) ); if ( bStartHit && bEndHit ) - bFound = TRUE; + bFound = sal_True; } pObject = aIter.Next(); } @@ -461,38 +461,38 @@ BOOL ScDetectiveFunc::HasArrow( const ScAddress& rStart, return bFound; } -BOOL ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject ) +sal_Bool ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject ) { if ( pObject->GetLayer()==SC_LAYER_INTERN && pObject->IsPolyObj() && pObject->GetPointCount()==2 ) { const SfxItemSet& rSet = pObject->GetMergedItemSet(); - BOOL bObjStartAlien = + sal_Bool bObjStartAlien = lcl_IsOtherTab( ((const XLineStartItem&)rSet.Get(XATTR_LINESTART)).GetLineStartValue() ); - BOOL bObjEndAlien = + sal_Bool bObjEndAlien = lcl_IsOtherTab( ((const XLineEndItem&)rSet.Get(XATTR_LINEEND)).GetLineEndValue() ); return !bObjStartAlien && !bObjEndAlien; } - return FALSE; + return false; } //------------------------------------------------------------------------ // InsertXXX: called from DrawEntry/DrawAlienEntry and InsertObject -BOOL ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, +sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, SCCOL nRefStartCol, SCROW nRefStartRow, SCCOL nRefEndCol, SCROW nRefEndRow, - BOOL bFromOtherTab, BOOL bRed, + sal_Bool bFromOtherTab, sal_Bool bRed, ScDetectiveData& rData ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - BOOL bArea = ( nRefStartCol != nRefEndCol || nRefStartRow != nRefEndRow ); + sal_Bool bArea = ( nRefStartCol != nRefEndCol || nRefStartRow != nRefEndRow ); if (bArea && !bFromOtherTab) { // insert the rectangle before the arrow - this is relied on in FindFrameForObject @@ -506,7 +506,7 @@ BOOL ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, pPage->InsertObject( pBox ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, TRUE ); + ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True ); pData->maStart.Set( nRefStartCol, nRefStartRow, nTab); pData->maEnd.Set( nRefEndCol, nRefEndRow, nTab); } @@ -516,7 +516,7 @@ BOOL ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, if (bFromOtherTab) { - BOOL bNegativePage = pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); long nPageSign = bNegativePage ? -1 : 1; aStartPos = Point( aEndPos.X() - 1000 * nPageSign, aEndPos.Y() - 1000 ); @@ -547,7 +547,7 @@ BOOL ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, pPage->InsertObject( pArrow ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, TRUE ); + ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True ); if (bFromOtherTab) pData->maStart.SetInvalid(); else @@ -556,17 +556,17 @@ BOOL ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, pData->maEnd.Set( nCol, nRow, nTab); Modified(); - return TRUE; + return sal_True; } -BOOL ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, - SCCOL nEndCol, SCROW nEndRow, BOOL bRed, +sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, sal_Bool bRed, ScDetectiveData& rData ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - BOOL bArea = ( nStartCol != nEndCol || nStartRow != nEndRow ); + sal_Bool bArea = ( nStartCol != nEndCol || nStartRow != nEndRow ); if (bArea) { Rectangle aRect = GetDrawRect( nStartCol, nStartRow, nEndCol, nEndRow ); @@ -578,12 +578,12 @@ BOOL ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, pPage->InsertObject( pBox ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, TRUE ); + ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True ); pData->maStart.Set( nStartCol, nStartRow, nTab); pData->maEnd.Set( nEndCol, nEndRow, nTab); } - BOOL bNegativePage = pDoc->IsNegativePage( nTab ); + sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); long nPageSign = bNegativePage ? -1 : 1; Point aStartPos = GetDrawPos( nStartCol, nStartRow, DRAWPOS_DETARROW ); @@ -612,12 +612,12 @@ BOOL ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, pPage->InsertObject( pArrow ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, TRUE ); + ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True ); pData->maStart.Set( nStartCol, nStartRow, nTab); pData->maEnd.SetInvalid(); Modified(); - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -629,16 +629,16 @@ BOOL ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, // return FALSE: da war schon ein Pfeil -BOOL ScDetectiveFunc::DrawEntry( SCCOL nCol, SCROW nRow, +sal_Bool ScDetectiveFunc::DrawEntry( SCCOL nCol, SCROW nRow, const ScRange& rRef, ScDetectiveData& rData ) { if ( HasArrow( rRef.aStart, nCol, nRow, nTab ) ) - return FALSE; + return false; ScAddress aErrorPos; - BOOL bError = HasError( rRef, aErrorPos ); - BOOL bAlien = ( rRef.aEnd.Tab() < nTab || rRef.aStart.Tab() > nTab ); + sal_Bool bError = HasError( rRef, aErrorPos ); + sal_Bool bAlien = ( rRef.aEnd.Tab() < nTab || rRef.aStart.Tab() > nTab ); return InsertArrow( nCol, nRow, rRef.aStart.Col(), rRef.aStart.Row(), @@ -646,14 +646,14 @@ BOOL ScDetectiveFunc::DrawEntry( SCCOL nCol, SCROW nRow, bAlien, bError, rData ); } -BOOL ScDetectiveFunc::DrawAlienEntry( const ScRange& rRef, +sal_Bool ScDetectiveFunc::DrawAlienEntry( const ScRange& rRef, ScDetectiveData& rData ) { if ( HasArrow( rRef.aStart, 0, 0, nTab+1 ) ) - return FALSE; + return false; ScAddress aErrorPos; - BOOL bError = HasError( rRef, aErrorPos ); + sal_Bool bError = HasError( rRef, aErrorPos ); return InsertToOtherTab( rRef.aStart.Col(), rRef.aStart.Row(), rRef.aEnd.Col(), rRef.aEnd.Row(), @@ -680,14 +680,14 @@ void ScDetectiveFunc::DrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData pPage->InsertObject( pCircle ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pCircle ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pCircle, TRUE ); + ScDrawObjData* pData = ScDrawLayer::GetObjData( pCircle, sal_True ); pData->maStart.Set( nCol, nRow, nTab); pData->maEnd.SetInvalid(); Modified(); } -void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, BOOL bDestPnt ) +void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt ) { Rectangle aRect = GetDrawRect( nCol, nRow ); @@ -697,7 +697,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, BOOL bDestPnt ) pPage->RecalcObjOrdNums(); - ULONG nObjCount = pPage->GetObjCount(); + sal_uLong nObjCount = pPage->GetObjCount(); if (nObjCount) { long nDelCount = 0; @@ -734,7 +734,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, BOOL bDestPnt ) #define SC_DET_TOLERANCE 50 -inline BOOL RectIsPoints( const Rectangle& rRect, const Point& rStart, const Point& rEnd ) +inline sal_Bool RectIsPoints( const Rectangle& rRect, const Point& rStart, const Point& rEnd ) { return rRect.Left() >= rStart.X() - SC_DET_TOLERANCE && rRect.Left() <= rStart.X() + SC_DET_TOLERANCE @@ -761,7 +761,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR pPage->RecalcObjOrdNums(); - ULONG nObjCount = pPage->GetObjCount(); + sal_uLong nObjCount = pPage->GetObjCount(); if (nObjCount) { long nDelCount = 0; @@ -798,10 +798,10 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR //------------------------------------------------------------------------ -USHORT ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef, - ScDetectiveData& rData, USHORT nLevel ) +sal_uInt16 ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef, + ScDetectiveData& rData, sal_uInt16 nLevel ) { - USHORT nResult = DET_INS_EMPTY; + sal_uInt16 nResult = DET_INS_EMPTY; ScCellIterator aCellIter( pDoc, rRef); ScBaseCell* pCell = aCellIter.GetFirst(); @@ -829,8 +829,8 @@ USHORT ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef, return nResult; } -USHORT ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, - USHORT nLevel ) +sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, + sal_uInt16 nLevel ) { ScBaseCell* pCell; pDoc->GetCell( nCol, nRow, nTab, pCell ); @@ -845,9 +845,9 @@ USHORT ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData if (pFCell->GetDirty()) pFCell->Interpret(); // nach SetRunning geht's nicht mehr! - pFCell->SetRunning(TRUE); + pFCell->SetRunning(sal_True); - USHORT nResult = DET_INS_EMPTY; + sal_uInt16 nResult = DET_INS_EMPTY; ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScRange aRef; @@ -863,8 +863,8 @@ USHORT ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData if ( nLevel < rData.GetMaxLevel() ) { - USHORT nSubResult; - BOOL bArea = (aRef.aStart != aRef.aEnd); + sal_uInt16 nSubResult; + sal_Bool bArea = (aRef.aStart != aRef.aEnd); if (bArea) nSubResult = InsertPredLevelArea( aRef, rData, nLevel+1 ); else @@ -893,15 +893,15 @@ USHORT ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData } } - pFCell->SetRunning(FALSE); + pFCell->SetRunning(false); return nResult; } -USHORT ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, - USHORT nLevel, USHORT nDeleteLevel ) +sal_uInt16 ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, + sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ) { - USHORT nResult = nLevel; + sal_uInt16 nResult = nLevel; ScCellIterator aCellIter( pDoc, rRef); ScBaseCell* pCell = aCellIter.GetFirst(); @@ -909,7 +909,7 @@ USHORT ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, { if (pCell->GetCellType() == CELLTYPE_FORMULA) { - USHORT nTemp = FindPredLevel( aCellIter.GetCol(), aCellIter.GetRow(), nLevel, nDeleteLevel ); + sal_uInt16 nTemp = FindPredLevel( aCellIter.GetCol(), aCellIter.GetRow(), nLevel, nDeleteLevel ); if (nTemp > nResult) nResult = nTemp; } @@ -921,7 +921,7 @@ USHORT ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, // nDeleteLevel != 0 -> loeschen -USHORT ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, USHORT nLevel, USHORT nDeleteLevel ) +sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ) { DBG_ASSERT( nLevel<1000, "Level" ); @@ -938,21 +938,21 @@ USHORT ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, USHORT nLevel, US if (pFCell->GetDirty()) pFCell->Interpret(); // nach SetRunning geht's nicht mehr! - pFCell->SetRunning(TRUE); + pFCell->SetRunning(sal_True); - USHORT nResult = nLevel; - BOOL bDelete = ( nDeleteLevel && nLevel == nDeleteLevel-1 ); + sal_uInt16 nResult = nLevel; + sal_Bool bDelete = ( nDeleteLevel && nLevel == nDeleteLevel-1 ); if ( bDelete ) { - DeleteArrowsAt( nCol, nRow, TRUE ); // Pfeile, die hierher zeigen + DeleteArrowsAt( nCol, nRow, sal_True ); // Pfeile, die hierher zeigen } ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScRange aRef; while ( aIter.GetNextRef( aRef) ) { - BOOL bArea = ( aRef.aStart != aRef.aEnd ); + sal_Bool bArea = ( aRef.aStart != aRef.aEnd ); if ( bDelete ) // Rahmen loeschen ? { @@ -965,7 +965,7 @@ USHORT ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, USHORT nLevel, US { if ( HasArrow( aRef.aStart, nCol,nRow,nTab ) ) { - USHORT nTemp; + sal_uInt16 nTemp; if (bArea) nTemp = FindPredLevelArea( aRef, nLevel+1, nDeleteLevel ); else @@ -977,15 +977,15 @@ USHORT ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, USHORT nLevel, US } } - pFCell->SetRunning(FALSE); + pFCell->SetRunning(false); return nResult; } //------------------------------------------------------------------------ -USHORT ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, - USHORT nLevel ) +sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, + sal_uInt16 nLevel ) { ScBaseCell* pCell; pDoc->GetCell( nCol, nRow, nTab, pCell ); @@ -1000,19 +1000,19 @@ USHORT ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveDat if (pFCell->GetDirty()) pFCell->Interpret(); // nach SetRunning geht's nicht mehr! - pFCell->SetRunning(TRUE); + pFCell->SetRunning(sal_True); - USHORT nResult = DET_INS_EMPTY; + sal_uInt16 nResult = DET_INS_EMPTY; ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScRange aRef; ScAddress aErrorPos; - BOOL bHasError = FALSE; + sal_Bool bHasError = false; while ( aIter.GetNextRef( aRef ) ) { if (HasError( aRef, aErrorPos )) { - bHasError = TRUE; + bHasError = sal_True; if (DrawEntry( nCol, nRow, ScRange( aErrorPos), rData )) nResult = DET_INS_INSERTED; @@ -1027,7 +1027,7 @@ USHORT ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveDat } } - pFCell->SetRunning(FALSE); + pFCell->SetRunning(false); // Blaetter ? if (!bHasError) @@ -1039,12 +1039,12 @@ USHORT ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveDat //------------------------------------------------------------------------ -USHORT ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ScDetectiveData& rData, USHORT nLevel ) +sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + ScDetectiveData& rData, sal_uInt16 nLevel ) { // ueber ganzes Dokument - USHORT nResult = DET_INS_EMPTY; + sal_uInt16 nResult = DET_INS_EMPTY; ScCellIterator aCellIter( pDoc, 0,0,0, MAXCOL,MAXROW,MAXTAB ); // alle Tabellen ScBaseCell* pCell = aCellIter.GetFirst(); while (pCell) @@ -1052,11 +1052,11 @@ USHORT ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, if (pCell->GetCellType() == CELLTYPE_FORMULA) { ScFormulaCell* pFCell = (ScFormulaCell*)pCell; - BOOL bRunning = pFCell->IsRunning(); + sal_Bool bRunning = pFCell->IsRunning(); if (pFCell->GetDirty()) pFCell->Interpret(); // nach SetRunning geht's nicht mehr! - pFCell->SetRunning(TRUE); + pFCell->SetRunning(sal_True); ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScRange aRef; @@ -1068,8 +1068,8 @@ USHORT ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, aRef.aStart.Col(),aRef.aStart.Row(), aRef.aEnd.Col(),aRef.aEnd.Row() )) { - BOOL bAlien = ( aCellIter.GetTab() != nTab ); - BOOL bDrawRet; + sal_Bool bAlien = ( aCellIter.GetTab() != nTab ); + sal_Bool bDrawRet; if (bAlien) bDrawRet = DrawAlienEntry( aRef, rData ); else @@ -1092,7 +1092,7 @@ USHORT ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, if ( nLevel < rData.GetMaxLevel() ) { - USHORT nSubResult = InsertSuccLevel( + sal_uInt16 nSubResult = InsertSuccLevel( aCellIter.GetCol(), aCellIter.GetRow(), aCellIter.GetCol(), aCellIter.GetRow(), rData, nLevel+1 ); @@ -1128,13 +1128,13 @@ USHORT ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, return nResult; } -USHORT ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - USHORT nLevel, USHORT nDeleteLevel ) +sal_uInt16 ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ) { DBG_ASSERT( nLevel<1000, "Level" ); - USHORT nResult = nLevel; - BOOL bDelete = ( nDeleteLevel && nLevel == nDeleteLevel-1 ); + sal_uInt16 nResult = nLevel; + sal_Bool bDelete = ( nDeleteLevel && nLevel == nDeleteLevel-1 ); ScCellIterator aCellIter( pDoc, 0,0, nTab, MAXCOL,MAXROW, nTab ); ScBaseCell* pCell = aCellIter.GetFirst(); @@ -1143,11 +1143,11 @@ USHORT ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SC if (pCell->GetCellType() == CELLTYPE_FORMULA) { ScFormulaCell* pFCell = (ScFormulaCell*)pCell; - BOOL bRunning = pFCell->IsRunning(); + sal_Bool bRunning = pFCell->IsRunning(); if (pFCell->GetDirty()) pFCell->Interpret(); // nach SetRunning geht's nicht mehr! - pFCell->SetRunning(TRUE); + pFCell->SetRunning(sal_True); ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScRange aRef; @@ -1166,13 +1166,13 @@ USHORT ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SC DeleteBox( aRef.aStart.Col(), aRef.aStart.Row(), aRef.aEnd.Col(), aRef.aEnd.Row() ); } - DeleteArrowsAt( aRef.aStart.Col(), aRef.aStart.Row(), FALSE ); + DeleteArrowsAt( aRef.aStart.Col(), aRef.aStart.Row(), false ); } else if ( !bRunning && HasArrow( aRef.aStart, aCellIter.GetCol(),aCellIter.GetRow(),aCellIter.GetTab() ) ) { - USHORT nTemp = FindSuccLevel( aCellIter.GetCol(), aCellIter.GetRow(), + sal_uInt16 nTemp = FindSuccLevel( aCellIter.GetCol(), aCellIter.GetRow(), aCellIter.GetCol(), aCellIter.GetRow(), nLevel+1, nDeleteLevel ); if (nTemp > nResult) @@ -1195,16 +1195,16 @@ USHORT ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SC // -------------------------------------------------------------------------------- // -BOOL ScDetectiveFunc::ShowPred( SCCOL nCol, SCROW nRow ) +sal_Bool ScDetectiveFunc::ShowPred( SCCOL nCol, SCROW nRow ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; ScDetectiveData aData( pModel ); - USHORT nMaxLevel = 0; - USHORT nResult = DET_INS_CONTINUE; + sal_uInt16 nMaxLevel = 0; + sal_uInt16 nResult = DET_INS_CONTINUE; while (nResult == DET_INS_CONTINUE && nMaxLevel < 1000) { aData.SetMaxLevel( nMaxLevel ); @@ -1215,16 +1215,16 @@ BOOL ScDetectiveFunc::ShowPred( SCCOL nCol, SCROW nRow ) return ( nResult == DET_INS_INSERTED ); } -BOOL ScDetectiveFunc::ShowSucc( SCCOL nCol, SCROW nRow ) +sal_Bool ScDetectiveFunc::ShowSucc( SCCOL nCol, SCROW nRow ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; ScDetectiveData aData( pModel ); - USHORT nMaxLevel = 0; - USHORT nResult = DET_INS_CONTINUE; + sal_uInt16 nMaxLevel = 0; + sal_uInt16 nResult = DET_INS_CONTINUE; while (nResult == DET_INS_CONTINUE && nMaxLevel < 1000) { aData.SetMaxLevel( nMaxLevel ); @@ -1235,56 +1235,56 @@ BOOL ScDetectiveFunc::ShowSucc( SCCOL nCol, SCROW nRow ) return ( nResult == DET_INS_INSERTED ); } -BOOL ScDetectiveFunc::ShowError( SCCOL nCol, SCROW nRow ) +sal_Bool ScDetectiveFunc::ShowError( SCCOL nCol, SCROW nRow ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; ScRange aRange( nCol, nRow, nTab ); ScAddress aErrPos; if ( !HasError( aRange,aErrPos ) ) - return FALSE; + return false; ScDetectiveData aData( pModel ); aData.SetMaxLevel( 1000 ); - USHORT nResult = InsertErrorLevel( nCol, nRow, aData, 0 ); + sal_uInt16 nResult = InsertErrorLevel( nCol, nRow, aData, 0 ); return ( nResult == DET_INS_INSERTED ); } -BOOL ScDetectiveFunc::DeleteSucc( SCCOL nCol, SCROW nRow ) +sal_Bool ScDetectiveFunc::DeleteSucc( SCCOL nCol, SCROW nRow ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; - USHORT nLevelCount = FindSuccLevel( nCol, nRow, nCol, nRow, 0, 0 ); + sal_uInt16 nLevelCount = FindSuccLevel( nCol, nRow, nCol, nRow, 0, 0 ); if ( nLevelCount ) FindSuccLevel( nCol, nRow, nCol, nRow, 0, nLevelCount ); // loeschen return ( nLevelCount != 0 ); } -BOOL ScDetectiveFunc::DeletePred( SCCOL nCol, SCROW nRow ) +sal_Bool ScDetectiveFunc::DeletePred( SCCOL nCol, SCROW nRow ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; - USHORT nLevelCount = FindPredLevel( nCol, nRow, 0, 0 ); + sal_uInt16 nLevelCount = FindPredLevel( nCol, nRow, 0, 0 ); if ( nLevelCount ) FindPredLevel( nCol, nRow, 0, nLevelCount ); // loeschen return ( nLevelCount != 0 ); } -BOOL ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) +sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page ?"); @@ -1292,7 +1292,7 @@ BOOL ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) pPage->RecalcObjOrdNums(); long nDelCount = 0; - ULONG nObjCount = pPage->GetObjCount(); + sal_uLong nObjCount = pPage->GetObjCount(); if (nObjCount) { SdrObject** ppObj = new SdrObject*[nObjCount]; @@ -1303,11 +1303,11 @@ BOOL ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) { if ( pObject->GetLayer() == SC_LAYER_INTERN ) { - BOOL bDoThis = TRUE; + sal_Bool bDoThis = sal_True; if ( eWhat != SC_DET_ALL ) { - BOOL bCircle = ( pObject->ISA(SdrCircObj) ); - BOOL bCaption = ScDrawLayer::IsNoteCaption( pObject ); + sal_Bool bCircle = ( pObject->ISA(SdrCircObj) ); + sal_Bool bCaption = ScDrawLayer::IsNoteCaption( pObject ); if ( eWhat == SC_DET_DETECTIVE ) // Detektiv, aus Menue bDoThis = !bCaption; // auch Kreise else if ( eWhat == SC_DET_CIRCLES ) // Kreise, wenn neue erzeugt werden @@ -1341,14 +1341,14 @@ BOOL ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) return ( nDelCount != 0 ); } -BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) +sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow) { - rOverflow = FALSE; + rOverflow = false; ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) - return FALSE; + return false; - BOOL bDeleted = DeleteAll( SC_DET_CIRCLES ); // nur die Kreise + sal_Bool bDeleted = DeleteAll( SC_DET_CIRCLES ); // nur die Kreise ScDetectiveData aData( pModel ); long nInsCount = 0; @@ -1362,7 +1362,7 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) const ScPatternAttr* pPattern = aAttrIter.GetNext( nCol, nRow1, nRow2 ); while ( pPattern && nInsCount < SC_DET_MAXCIRCLE ) { - ULONG nIndex = ((const SfxUInt32Item&)pPattern->GetItem(ATTR_VALIDDATA)).GetValue(); + sal_uLong nIndex = ((const SfxUInt32Item&)pPattern->GetItem(ATTR_VALIDDATA)).GetValue(); if (nIndex) { const ScValidationData* pData = pDoc->GetValidationEntry( nIndex ); @@ -1370,7 +1370,7 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) { // Zellen in dem Bereich durchgehen - BOOL bMarkEmpty = !pData->IsIgnoreBlank(); + sal_Bool bMarkEmpty = !pData->IsIgnoreBlank(); SCROW nNextRow = nRow1; SCROW nRow; ScCellIterator aCellIter( pDoc, nCol,nRow1,nTab, nCol,nRow2,nTab ); @@ -1405,7 +1405,7 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) } if ( nInsCount >= SC_DET_MAXCIRCLE ) - rOverflow = TRUE; + rOverflow = sal_True; return ( bDeleted || nInsCount != 0 ); } @@ -1520,12 +1520,12 @@ void ScDetectiveFunc::UpdateAllArrowColors() { if ( pObject->GetLayer() == SC_LAYER_INTERN ) { - BOOL bArrow = FALSE; - BOOL bError = FALSE; + sal_Bool bArrow = false; + sal_Bool bError = false; ScAddress aPos; ScRange aSource; - BOOL bDummy; + sal_Bool bDummy; ScDetectiveObjType eType = GetDetectiveObjectType( pObject, nObjTab, aPos, aSource, bDummy ); if ( eType == SC_DETOBJ_ARROW || eType == SC_DETOBJ_TOOTHERTAB ) { @@ -1533,9 +1533,9 @@ void ScDetectiveFunc::UpdateAllArrowColors() ScAddress aErrPos; if ( HasError( aSource, aErrPos ) ) - bError = TRUE; + bError = sal_True; else - bArrow = TRUE; + bArrow = sal_True; } else if ( eType == SC_DETOBJ_FROMOTHERTAB ) { @@ -1545,15 +1545,15 @@ void ScDetectiveFunc::UpdateAllArrowColors() ScAddress aErrPos; if ( HasError( ScRange( aPos), aErrPos ) ) - bError = TRUE; + bError = sal_True; else - bArrow = TRUE; + bArrow = sal_True; } else if ( eType == SC_DETOBJ_CIRCLE ) { // circles (error marks) are always red - bError = TRUE; + bError = sal_True; } else if ( eType == SC_DETOBJ_NONE ) { @@ -1561,7 +1561,7 @@ void ScDetectiveFunc::UpdateAllArrowColors() if ( pObject->ISA( SdrRectObj ) && !pObject->ISA( SdrCaptionObj ) ) { - bArrow = TRUE; + bArrow = sal_True; } } @@ -1579,17 +1579,17 @@ void ScDetectiveFunc::UpdateAllArrowColors() } } -BOOL ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRange ) +sal_Bool ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRange ) { // find the rectangle for an arrow (always the object directly before the arrow) // rRange must be initialized to the source cell of the arrow (start of area) ScDrawLayer* pModel = pDoc->GetDrawLayer(); - if (!pModel) return FALSE; + if (!pModel) return false; SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); DBG_ASSERT(pPage,"Page ?"); - if (!pPage) return FALSE; + if (!pPage) return false; // test if the object is a direct page member if( pObject && pObject->GetPage() && (pObject->GetPage() == pObject->GetObjList()) ) @@ -1607,18 +1607,18 @@ BOOL ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRange ) if ( pPrevData && pPrevData->maStart.IsValid() && pPrevData->maEnd.IsValid() && (pPrevData->maStart == rRange.aStart) ) { rRange.aEnd = pPrevData->maEnd; - return TRUE; + return sal_True; } } } } - return FALSE; + return false; } ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject, SCTAB nObjTab, - ScAddress& rPosition, ScRange& rSource, BOOL& rRedLine ) + ScAddress& rPosition, ScRange& rSource, sal_Bool& rRedLine ) { - rRedLine = FALSE; + rRedLine = false; ScDetectiveObjType eType = SC_DETOBJ_NONE; if ( pObject && pObject->GetLayer() == SC_LAYER_INTERN ) @@ -1651,7 +1651,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject, ColorData nObjColor = ((const XLineColorItem&)pObject->GetMergedItem(XATTR_LINECOLOR)).GetColorValue().GetColor(); if ( nObjColor == GetErrorColor() && nObjColor != GetArrowColor() ) - rRedLine = TRUE; + rRedLine = sal_True; } else if ( pObject->ISA(SdrCircObj) ) { @@ -1671,7 +1671,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject, void ScDetectiveFunc::InsertObject( ScDetectiveObjType eType, const ScAddress& rPosition, const ScRange& rSource, - BOOL bRedLine ) + sal_Bool bRedLine ) { ScDrawLayer* pModel = pDoc->GetDrawLayer(); if (!pModel) return; @@ -1731,10 +1731,10 @@ void ScDetectiveFunc::InitializeColors() nErrorColor = rColorCfg.GetColorValue(svtools::CALCDETECTIVEERROR).nColor; nCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor; - bColorsInitialized = TRUE; + bColorsInitialized = sal_True; } -BOOL ScDetectiveFunc::IsColorsInitialized() +sal_Bool ScDetectiveFunc::IsColorsInitialized() { return bColorsInitialized; } diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index dc219ac62b60..113af9a69db6 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -55,7 +55,7 @@ using ::rtl::OUString; //------------------------------------------------------------------------ -#define SC_VERSION ((USHORT)251) +#define SC_VERSION ((sal_uInt16)251) TYPEINIT1(ScTpCalcItem, SfxPoolItem); @@ -69,7 +69,7 @@ inline long TwipsToEvenHMM(long nTwips) { return ( (nTwips * 127 + 72) / 144 ) * //------------------------------------------------------------------------ -USHORT lcl_GetDefaultTabDist() +sal_uInt16 lcl_GetDefaultTabDist() { if ( ScOptionsUtil::IsMetricSystem() ) return 709; // 1,25 cm @@ -123,8 +123,8 @@ ScDocOptions::~ScDocOptions() void ScDocOptions::ResetDocOptions() { - bIsIgnoreCase = FALSE; - bIsIter = FALSE; + bIsIgnoreCase = false; + bIsIter = false; nIterCount = 100; fIterEps = 1.0E-3; nPrecStandardFormat = SvNumberFormatter::UNLIMITED_PRECISION; @@ -134,11 +134,11 @@ void ScDocOptions::ResetDocOptions() nYear = 1899; nYear2000 = SvNumberFormatter::GetYear2000Default(); nTabDistance = lcl_GetDefaultTabDist(); - bCalcAsShown = FALSE; - bMatchWholeCell = TRUE; - bDoAutoSpell = FALSE; - bLookUpColRowNames = TRUE; - bFormulaRegexEnabled= TRUE; + bCalcAsShown = false; + bMatchWholeCell = true; + bDoAutoSpell = false; + bLookUpColRowNames = true; + bFormulaRegexEnabled= true; bUseEnglishFuncName = false; eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE; @@ -208,7 +208,7 @@ const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper() //------------------------------------------------------------------------ -ScTpCalcItem::ScTpCalcItem( USHORT nWhichP, const ScDocOptions& rOpt ) +ScTpCalcItem::ScTpCalcItem( sal_uInt16 nWhichP, const ScDocOptions& rOpt ) : SfxPoolItem ( nWhichP ), theOptions ( rOpt ) { @@ -377,7 +377,7 @@ ScDocCfg::ScDocCfg() : Sequence<Any> aValues; const Any* pValues = NULL; - USHORT nDateDay, nDateMonth, nDateYear; + sal_uInt16 nDateDay, nDateMonth, nDateYear; GetDate( nDateDay, nDateMonth, nDateYear ); aNames = GetCalcPropertyNames(); @@ -399,22 +399,22 @@ ScDocCfg::ScDocCfg() : SetIter( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); break; case SCCALCOPT_ITER_STEPS: - if (pValues[nProp] >>= nIntVal) SetIterCount( (USHORT) nIntVal ); + if (pValues[nProp] >>= nIntVal) SetIterCount( (sal_uInt16) nIntVal ); break; case SCCALCOPT_ITER_MINCHG: if (pValues[nProp] >>= fDoubleVal) SetIterEps( fDoubleVal ); break; case SCCALCOPT_DATE_DAY: - if (pValues[nProp] >>= nIntVal) nDateDay = (USHORT) nIntVal; + if (pValues[nProp] >>= nIntVal) nDateDay = (sal_uInt16) nIntVal; break; case SCCALCOPT_DATE_MONTH: - if (pValues[nProp] >>= nIntVal) nDateMonth = (USHORT) nIntVal; + if (pValues[nProp] >>= nIntVal) nDateMonth = (sal_uInt16) nIntVal; break; case SCCALCOPT_DATE_YEAR: - if (pValues[nProp] >>= nIntVal) nDateYear = (USHORT) nIntVal; + if (pValues[nProp] >>= nIntVal) nDateYear = (sal_uInt16) nIntVal; break; case SCCALCOPT_DECIMALS: - if (pValues[nProp] >>= nIntVal) SetStdPrecision( (USHORT) nIntVal ); + if (pValues[nProp] >>= nIntVal) SetStdPrecision( (sal_uInt16) nIntVal ); break; case SCCALCOPT_CASESENSITIVE: // content is reversed @@ -530,7 +530,7 @@ ScDocCfg::ScDocCfg() : case SCDOCLAYOUTOPT_TABSTOP: // TabDistance in ScDocOptions is in twips if (pValues[nProp] >>= nIntVal) - SetTabDistance( (USHORT) HMMToTwips( nIntVal ) ); + SetTabDistance( (sal_uInt16) HMMToTwips( nIntVal ) ); break; } } @@ -567,7 +567,7 @@ IMPL_LINK( ScDocCfg, CalcCommitHdl, void *, EMPTYARG ) Sequence<Any> aValues(aNames.getLength()); Any* pValues = aValues.getArray(); - USHORT nDateDay, nDateMonth, nDateYear; + sal_uInt16 nDateDay, nDateMonth, nDateYear; GetDate( nDateDay, nDateMonth, nDateYear ); for(int nProp = 0; nProp < aNames.getLength(); nProp++) diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx index d87407f6ba1c..5724c79715e2 100644 --- a/sc/source/core/tool/doubleref.cxx +++ b/sc/source/core/tool/doubleref.cxx @@ -66,7 +66,7 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, if (pQueryRef->getColSize() < 4) return false; - BOOL bValid; + sal_Bool bValid; OUString aCellStr; SCSIZE nIndex = 0; SCROW nRow = 0; @@ -78,7 +78,7 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, { ScQueryEntry& rEntry = pParam->GetEntry(nIndex); - bValid = FALSE; + bValid = false; if (nIndex > 0) { @@ -88,12 +88,12 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, if ( aCellStr.equals(ScGlobal::GetRscString(STR_TABLE_UND)) ) { rEntry.eConnect = SC_AND; - bValid = TRUE; + bValid = sal_True; } else if ( aCellStr.equals(ScGlobal::GetRscString(STR_TABLE_ODER)) ) { rEntry.eConnect = SC_OR; - bValid = TRUE; + bValid = sal_True; } } @@ -142,7 +142,7 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, { // Finally, the right-hand-side value in the 4th column. *rEntry.pStr = pQueryRef->getString(3, nRow); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; } nIndex++; nRow++; @@ -205,7 +205,7 @@ bool lcl_createExcelQuery( pParam->GetEntry(nIndex).eConnect = SC_AND; } else - bValid = FALSE; + bValid = false; } nCol++; } @@ -369,7 +369,7 @@ sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) c if (pFCell->IsValue()) { double fVal = pFCell->GetValue(); - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GetInputLineString(fVal, nIndex, aStr); @@ -381,7 +381,7 @@ sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) c case CELLTYPE_VALUE: { double fVal = ((ScValueCell*) pCell)->GetValue(); - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GetInputLineString(fVal, nIndex, aStr); @@ -408,9 +408,9 @@ SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) SCCOL nDBCol2 = e.Col(); SCCOL nField = nDBCol1; - BOOL bFound = TRUE; + sal_Bool bFound = sal_True; - bFound = FALSE; + bFound = false; OUString aCellStr; ScAddress aLook( nDBCol1, nDBRow1, nDBTab1 ); while (!bFound && (aLook.Col() <= nDBCol2)) diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 3b6c0339d963..fe31cd9a0d79 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -86,8 +86,8 @@ String ScEditUtil::ModifyDelimiters( const String& rOld ) static String lcl_GetDelimitedString( const EditEngine& rEngine, const sal_Char c ) { String aRet; - USHORT nParCount = rEngine.GetParagraphCount(); - for (USHORT nPar=0; nPar<nParCount; nPar++) + sal_uInt16 nParCount = rEngine.GetParagraphCount(); + for (sal_uInt16 nPar=0; nPar<nParCount; nPar++) { if (nPar > 0) aRet += c; @@ -108,17 +108,17 @@ String ScEditUtil::GetMultilineString( const EditEngine& rEngine ) //------------------------------------------------------------------------ -Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToTop ) +Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, sal_Bool bForceToTop ) { // bForceToTop = always align to top, for editing - // (FALSE for querying URLs etc.) + // (sal_False for querying URLs etc.) if (!pPattern) pPattern = pDoc->GetPattern( nCol, nRow, nTab ); Point aStartPos = aScrPos; - BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); + sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); long nLayoutSign = bLayoutRTL ? -1 : 1; const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE); @@ -137,7 +137,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToT } const SvxMarginItem* pMargin = (const SvxMarginItem*)&pPattern->GetItem(ATTR_MARGIN); - USHORT nIndent = 0; + sal_uInt16 nIndent = 0; if ( ((const SvxHorJustifyItem&)pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue() == SVX_HOR_JUSTIFY_LEFT ) nIndent = ((const SfxUInt16Item&)pPattern->GetItem(ATTR_INDENT)).GetValue(); @@ -153,7 +153,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToT GetItem(ATTR_VER_JUSTIFY)).GetValue(); // asian vertical is always edited top-aligned - BOOL bAsianVertical = ((const SfxBoolItem&)pPattern->GetItem( ATTR_STACKED )).GetValue() && + sal_Bool bAsianVertical = ((const SfxBoolItem&)pPattern->GetItem( ATTR_STACKED )).GetValue() && ((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN )).GetValue(); if ( eJust == SVX_VER_JUSTIFY_TOP || @@ -165,7 +165,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToT pDev->SetMapMode( MAP_PIXEL ); long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab, - pDev, nPPTX, nPPTY, aZoomX, aZoomY, FALSE ); + pDev, nPPTX, nPPTY, aZoomX, aZoomY, false ); if (!nTextHeight) { // leere Zelle Font aFont; @@ -204,12 +204,12 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToT ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) : pEngine( pEng ), pEditAttrs( NULL ), - bNeedsObject( FALSE ), - bNeedsCellAttr( FALSE ) + bNeedsObject( false ), + bNeedsCellAttr( false ) { if ( pEngine->GetParagraphCount() > 1 ) { - bNeedsObject = TRUE; //! Zellatribute finden ? + bNeedsObject = sal_True; //! Zellatribute finden ? } else { @@ -218,11 +218,11 @@ ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) : ESelection(0,0,0,pEngine->GetTextLen(0)), EditEngineAttribs_OnlyHard ) ); const SfxItemSet& rEditDefaults = pEngine->GetDefaults(); - for (USHORT nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++) + for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++) { - SfxItemState eState = pEditAttrs->GetItemState( nId, FALSE, &pItem ); + SfxItemState eState = pEditAttrs->GetItemState( nId, false, &pItem ); if (eState == SFX_ITEM_DONTCARE) - bNeedsObject = TRUE; + bNeedsObject = sal_True; else if (eState == SFX_ITEM_SET) { if ( nId == EE_CHAR_ESCAPEMENT || nId == EE_CHAR_PAIRKERNING || @@ -234,27 +234,27 @@ ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) : // from "user attributes applied to the cell". if ( *pItem != rEditDefaults.Get(nId) ) - bNeedsObject = TRUE; + bNeedsObject = sal_True; } else if (!bNeedsCellAttr) if ( *pItem != rEditDefaults.Get(nId) ) - bNeedsCellAttr = TRUE; + bNeedsCellAttr = sal_True; // rEditDefaults contains the defaults from the cell format } } // Feldbefehle enthalten? - SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, FALSE ); + SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, false ); if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET ) - bNeedsObject = TRUE; + bNeedsObject = sal_True; // not converted characters? - SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, FALSE ); + SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, false ); if ( eConvState == SFX_ITEM_DONTCARE || eConvState == SFX_ITEM_SET ) - bNeedsObject = TRUE; + bNeedsObject = sal_True; } } @@ -267,12 +267,12 @@ ScEditAttrTester::~ScEditAttrTester() //------------------------------------------------------------------------ ScEnginePoolHelper::ScEnginePoolHelper( SfxItemPool* pEnginePoolP, - BOOL bDeleteEnginePoolP ) + sal_Bool bDeleteEnginePoolP ) : pEnginePool( pEnginePoolP ), pDefaults( NULL ), bDeleteEnginePool( bDeleteEnginePoolP ), - bDeleteDefaults( FALSE ) + bDeleteDefaults( false ) { } @@ -282,7 +282,7 @@ ScEnginePoolHelper::ScEnginePoolHelper( const ScEnginePoolHelper& rOrg ) pEnginePool( rOrg.bDeleteEnginePool ? rOrg.pEnginePool->Clone() : rOrg.pEnginePool ), pDefaults( NULL ), bDeleteEnginePool( rOrg.bDeleteEnginePool ), - bDeleteDefaults( FALSE ) + bDeleteDefaults( false ) { } @@ -299,7 +299,7 @@ ScEnginePoolHelper::~ScEnginePoolHelper() //------------------------------------------------------------------------ ScEditEngineDefaulter::ScEditEngineDefaulter( SfxItemPool* pEnginePoolP, - BOOL bDeleteEnginePoolP ) + sal_Bool bDeleteEnginePoolP ) : ScEnginePoolHelper( pEnginePoolP, bDeleteEnginePoolP ), EditEngine( pEnginePoolP ) @@ -325,41 +325,41 @@ ScEditEngineDefaulter::~ScEditEngineDefaulter() } -void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, BOOL bRememberCopy ) +void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, sal_Bool bRememberCopy ) { if ( bRememberCopy ) { if ( bDeleteDefaults ) delete pDefaults; pDefaults = new SfxItemSet( rSet ); - bDeleteDefaults = TRUE; + bDeleteDefaults = sal_True; } const SfxItemSet& rNewSet = bRememberCopy ? *pDefaults : rSet; - BOOL bUndo = IsUndoEnabled(); - EnableUndo( FALSE ); - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUndo = IsUndoEnabled(); + EnableUndo( false ); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); - USHORT nPara = GetParagraphCount(); - for ( USHORT j=0; j<nPara; j++ ) + SetUpdateMode( false ); + sal_uInt16 nPara = GetParagraphCount(); + for ( sal_uInt16 j=0; j<nPara; j++ ) { SetParaAttribs( j, rNewSet ); } if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); if ( bUndo ) - EnableUndo( TRUE ); + EnableUndo( sal_True ); } -void ScEditEngineDefaulter::SetDefaults( SfxItemSet* pSet, BOOL bTakeOwnership ) +void ScEditEngineDefaulter::SetDefaults( SfxItemSet* pSet, sal_Bool bTakeOwnership ) { if ( bDeleteDefaults ) delete pDefaults; pDefaults = pSet; bDeleteDefaults = bTakeOwnership; if ( pDefaults ) - SetDefaults( *pDefaults, FALSE ); + SetDefaults( *pDefaults, false ); } @@ -368,10 +368,10 @@ void ScEditEngineDefaulter::SetDefaultItem( const SfxPoolItem& rItem ) if ( !pDefaults ) { pDefaults = new SfxItemSet( GetEmptyItemSet() ); - bDeleteDefaults = TRUE; + bDeleteDefaults = sal_True; } pDefaults->Put( rItem ); - SetDefaults( *pDefaults, FALSE ); + SetDefaults( *pDefaults, false ); } const SfxItemSet& ScEditEngineDefaulter::GetDefaults() @@ -379,90 +379,90 @@ const SfxItemSet& ScEditEngineDefaulter::GetDefaults() if ( !pDefaults ) { pDefaults = new SfxItemSet( GetEmptyItemSet() ); - bDeleteDefaults = TRUE; + bDeleteDefaults = sal_True; } return *pDefaults; } void ScEditEngineDefaulter::SetText( const EditTextObject& rTextObject ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rTextObject ); if ( pDefaults ) - SetDefaults( *pDefaults, FALSE ); + SetDefaults( *pDefaults, false ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObject, - const SfxItemSet& rSet, BOOL bRememberCopy ) + const SfxItemSet& rSet, sal_Bool bRememberCopy ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rTextObject ); SetDefaults( rSet, bRememberCopy ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObject, - SfxItemSet* pSet, BOOL bTakeOwnership ) + SfxItemSet* pSet, sal_Bool bTakeOwnership ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rTextObject ); SetDefaults( pSet, bTakeOwnership ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::SetText( const String& rText ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rText ); if ( pDefaults ) - SetDefaults( *pDefaults, FALSE ); + SetDefaults( *pDefaults, false ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::SetTextNewDefaults( const String& rText, - const SfxItemSet& rSet, BOOL bRememberCopy ) + const SfxItemSet& rSet, sal_Bool bRememberCopy ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rText ); SetDefaults( rSet, bRememberCopy ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::SetTextNewDefaults( const String& rText, - SfxItemSet* pSet, BOOL bTakeOwnership ) + SfxItemSet* pSet, sal_Bool bTakeOwnership ) { - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); + SetUpdateMode( false ); EditEngine::SetText( rText ); SetDefaults( pSet, bTakeOwnership ); if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } void ScEditEngineDefaulter::RepeatDefaults() { if ( pDefaults ) { - USHORT nPara = GetParagraphCount(); - for ( USHORT j=0; j<nPara; j++ ) + sal_uInt16 nPara = GetParagraphCount(); + for ( sal_uInt16 j=0; j<nPara; j++ ) SetParaAttribs( j, *pDefaults ); } } @@ -470,18 +470,18 @@ void ScEditEngineDefaulter::RepeatDefaults() void ScEditEngineDefaulter::RemoveParaAttribs() { SfxItemSet* pCharItems = NULL; - BOOL bUpdateMode = GetUpdateMode(); + sal_Bool bUpdateMode = GetUpdateMode(); if ( bUpdateMode ) - SetUpdateMode( FALSE ); - USHORT nParCount = GetParagraphCount(); - for (USHORT nPar=0; nPar<nParCount; nPar++) + SetUpdateMode( false ); + sal_uInt16 nParCount = GetParagraphCount(); + for (sal_uInt16 nPar=0; nPar<nParCount; nPar++) { const SfxItemSet& rParaAttribs = GetParaAttribs( nPar ); - USHORT nWhich; + sal_uInt16 nWhich; for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++) { const SfxPoolItem* pParaItem; - if ( rParaAttribs.GetItemState( nWhich, FALSE, &pParaItem ) == SFX_ITEM_SET ) + if ( rParaAttribs.GetItemState( nWhich, false, &pParaItem ) == SFX_ITEM_SET ) { // if defaults are set, use only items that are different from default if ( !pDefaults || *pParaItem != pDefaults->Get(nWhich) ) @@ -501,11 +501,11 @@ void ScEditEngineDefaulter::RemoveParaAttribs() // loop through the portions of the paragraph, and set only those items // that are not overridden by existing character attributes - USHORT nPCount = aPortions.Count(); - USHORT nStart = 0; - for ( USHORT nPos=0; nPos<nPCount; nPos++ ) + sal_uInt16 nPCount = aPortions.Count(); + sal_uInt16 nStart = 0; + for ( sal_uInt16 nPos=0; nPos<nPCount; nPos++ ) { - USHORT nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nEnd = aPortions.GetObject( nPos ); ESelection aSel( nPar, nStart, nPar, nEnd ); SfxItemSet aOldCharAttrs = GetAttribs( aSel ); SfxItemSet aNewCharAttrs = *pCharItems; @@ -514,7 +514,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs() // Clear those items that are different from existing character attributes. // Where no character attributes are set, GetAttribs returns the paragraph attributes. const SfxPoolItem* pItem; - if ( aNewCharAttrs.GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET && + if ( aNewCharAttrs.GetItemState( nWhich, false, &pItem ) == SFX_ITEM_SET && *pItem != aOldCharAttrs.Get(nWhich) ) { aNewCharAttrs.ClearItem(nWhich); @@ -538,7 +538,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs() } } if ( bUpdateMode ) - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } //------------------------------------------------------------------------ @@ -642,13 +642,13 @@ ScHeaderFieldData::ScHeaderFieldData() eNumType = SVX_ARABIC; } -ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP, BOOL bDeleteEnginePoolP ) +ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP, sal_Bool bDeleteEnginePoolP ) : ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ) { } String ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField, - USHORT /* nPara */, USHORT /* nPos */, + sal_uInt16 /* nPara */, sal_uInt16 /* nPos */, Color*& /* rTxtColor */, Color*& /* rFldColor */ ) { String aRet; @@ -700,10 +700,10 @@ String ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField, //------------------------------------------------------------------------ ScFieldEditEngine::ScFieldEditEngine( SfxItemPool* pEnginePoolP, - SfxItemPool* pTextObjectPool, BOOL bDeleteEnginePoolP ) + SfxItemPool* pTextObjectPool, sal_Bool bDeleteEnginePoolP ) : ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ), - bExecuteURL( TRUE ) + bExecuteURL( sal_True ) { if ( pTextObjectPool ) SetEditTextObjectPool( pTextObjectPool ); @@ -713,7 +713,7 @@ ScFieldEditEngine::ScFieldEditEngine( SfxItemPool* pEnginePoolP, } String ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField, - USHORT /* nPara */, USHORT /* nPos */, + sal_uInt16 /* nPara */, sal_uInt16 /* nPos */, Color*& rTxtColor, Color*& /* rFldColor */ ) { String aRet; @@ -755,7 +755,7 @@ String ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField, return aRet; } -void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, USHORT, USHORT ) +void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 ) { const SvxFieldData* pFld = rField.GetField(); @@ -769,7 +769,7 @@ void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, USHORT, USHORT //------------------------------------------------------------------------ ScNoteEditEngine::ScNoteEditEngine( SfxItemPool* pEnginePoolP, - SfxItemPool* pTextObjectPool, BOOL bDeleteEnginePoolP ) : + SfxItemPool* pTextObjectPool, sal_Bool bDeleteEnginePoolP ) : ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ) { if ( pTextObjectPool ) diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx index f23cd4e2b29a..c43a2b9c844f 100644 --- a/sc/source/core/tool/filtopt.cxx +++ b/sc/source/core/tool/filtopt.cxx @@ -73,7 +73,7 @@ Sequence<OUString> ScFilterOptions::GetPropertyNames() ScFilterOptions::ScFilterOptions() : ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_FILTER )) ), - bWK3Flag( FALSE ), + bWK3Flag( false ), fExcelColScale( 0 ), fExcelRowScale( 0 ) { diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx index 6082317d03e4..0add593eae10 100644 --- a/sc/source/core/tool/formulaparserpool.cxx +++ b/sc/source/core/tool/formulaparserpool.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/container/XContentEnumerationAccess.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sheet/XFilterFormulaParser.hpp> #include <rtl/instance.hxx> #include <comphelper/processfactory.hxx> @@ -69,21 +68,17 @@ private: OUStringHash, ::std::equal_to< OUString > > FactoryMap; - Reference< XComponentContext > mxContext; /// Default context of global process factory. + Reference< XComponentContext > mxContext; /// Global component context. FactoryMap maFactories; /// All parser factories, mapped by formula namespace. }; -ScParserFactoryMap::ScParserFactoryMap() +ScParserFactoryMap::ScParserFactoryMap() : + mxContext( ::comphelper::getProcessComponentContext() ) { - try + if( mxContext.is() ) try { - // get process factory and default component context - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW ); - Reference< XPropertySet > xPropSet( xFactory, UNO_QUERY_THROW ); - mxContext.set( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), UNO_QUERY_THROW ); - // enumerate all implementations of the FormulaParser service - Reference< XContentEnumerationAccess > xFactoryEA( xFactory, UNO_QUERY_THROW ); + Reference< XContentEnumerationAccess > xFactoryEA( mxContext->getServiceManager(), UNO_QUERY_THROW ); Reference< XEnumeration > xEnum( xFactoryEA->createContentEnumeration( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FilterFormulaParser" ) ) ), UNO_SET_THROW ); while( xEnum->hasMoreElements() ) try // single try/catch for every element { diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx index 7597070fbe18..aadc8fcb2a8a 100644 --- a/sc/source/core/tool/hints.cxx +++ b/sc/source/core/tool/hints.cxx @@ -47,10 +47,10 @@ TYPEINIT1(ScDataPilotModifiedHint, SfxHint); // ScPaintHint - Angabe, was neu gezeichnet werden muss // ----------------------------------------------------------------------- -ScPaintHint::ScPaintHint( const ScRange& rRng, USHORT nPaint ) : +ScPaintHint::ScPaintHint( const ScRange& rRng, sal_uInt16 nPaint ) : aRange( rRng ), nParts( nPaint ), - bPrint( TRUE ) + bPrint( sal_True ) { } @@ -106,7 +106,7 @@ void ScLinkRefreshedHint::SetSheetLink( const String& rSourceUrl ) } void ScLinkRefreshedHint::SetDdeLink( - const String& rA, const String& rT, const String& rI, BYTE nM ) + const String& rA, const String& rT, const String& rI, sal_uInt8 nM ) { nLinkType = SC_LINKREFTYPE_DDE; aDdeAppl = rA; @@ -126,7 +126,7 @@ void ScLinkRefreshedHint::SetAreaLink( const ScAddress& rPos ) // ----------------------------------------------------------------------- ScAutoStyleHint::ScAutoStyleHint( const ScRange& rR, const String& rSt1, - ULONG nT, const String& rSt2 ) : + sal_uLong nT, const String& rSt2 ) : aRange( rR ), aStyle1( rSt1 ), aStyle2( rSt2 ), diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx index e2f5e90b0d92..8d300c5ebfff 100644 --- a/sc/source/core/tool/inputopt.cxx +++ b/sc/source/core/tool/inputopt.cxx @@ -54,7 +54,7 @@ using ::rtl::OUString; //------------------------------------------------------------------ // Version, ab der das Item kompatibel ist -#define SC_VERSION ((USHORT)351) +#define SC_VERSION ((sal_uInt16)351) //======================================================================== @@ -84,15 +84,15 @@ ScInputOptions::~ScInputOptions() void ScInputOptions::SetDefaults() { nMoveDir = DIR_BOTTOM; - bMoveSelection = TRUE; - bEnterEdit = FALSE; - bExtendFormat = FALSE; - bRangeFinder = TRUE; - bExpandRefs = FALSE; - bMarkHeader = TRUE; - bUseTabCol = FALSE; - bTextWysiwyg = FALSE; - bReplCellsWarn = TRUE; + bMoveSelection = sal_True; + bEnterEdit = false; + bExtendFormat = false; + bRangeFinder = sal_True; + bExpandRefs = false; + bMarkHeader = sal_True; + bUseTabCol = false; + bTextWysiwyg = false; + bReplCellsWarn = sal_True; } //------------------------------------------------------------------------ @@ -175,7 +175,7 @@ ScInputCfg::ScInputCfg() : { case SCINPUTOPT_MOVEDIR: if ( pValues[nProp] >>= nIntVal ) - SetMoveDir( (USHORT)nIntVal ); + SetMoveDir( (sal_uInt16)nIntVal ); break; case SCINPUTOPT_MOVESEL: SetMoveSelection( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 4bcdb7536d5f..3e630425e7f4 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -81,7 +81,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScTokenStack, 8, 4 ) IMPL_FIXEDMEMPOOL_NEWDEL( ScInterpreter, 32, 16 ) ScTokenStack* ScInterpreter::pGlobalStack = NULL; -BOOL ScInterpreter::bGlobalStackInUse = FALSE; +sal_Bool ScInterpreter::bGlobalStackInUse = false; using namespace formula; using ::std::auto_ptr; @@ -265,7 +265,7 @@ void ScInterpreter::ScChoseJump() fVal = ::rtl::math::approxFloor( fVal); if ( (fVal < 1) || (fVal >= nJumpCount)) { - bIsValue = FALSE; + bIsValue = false; fVal = CreateDoubleError( errIllegalArgument); } @@ -453,11 +453,11 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) // Do not modify the original range because we use it // to adjust the size of the result matrix if necessary. ScAddress aAdr( aRange.aStart); - ULONG nCol = (ULONG)aAdr.Col() + nC; - ULONG nRow = (ULONG)aAdr.Row() + nR; - if ((nCol > static_cast<ULONG>(aRange.aEnd.Col()) && + sal_uLong nCol = (sal_uLong)aAdr.Col() + nC; + sal_uLong nRow = (sal_uLong)aAdr.Row() + nR; + if ((nCol > static_cast<sal_uLong>(aRange.aEnd.Col()) && aRange.aEnd.Col() != aRange.aStart.Col()) - || (nRow > static_cast<ULONG>(aRange.aEnd.Row()) && + || (nRow > static_cast<sal_uLong>(aRange.aEnd.Row()) && aRange.aEnd.Row() != aRange.aStart.Row())) { fVal = CreateDoubleError( NOTAVAILABLE ); @@ -579,7 +579,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) { // push all results that have no jump path if ( pResMat ) { - // a FALSE without path results in an empty path value + // a sal_False without path results in an empty path value if ( fBool == 0.0 ) pResMat->PutEmptyPath( nC, nR ); else @@ -778,16 +778,16 @@ double ScInterpreter::Compare() { case svEmptyCell: Pop(); - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; break; case svMissing: case svDouble: aComp.nVal[ i ] = GetDouble(); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; break; case svString: *aComp.pVal[ i ] = GetString(); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = false; break; case svDoubleRef : case svSingleRef : @@ -797,16 +797,16 @@ double ScInterpreter::Compare() break; ScBaseCell* pCell = GetCell( aAdr ); if (HasCellEmptyData( pCell)) - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; else if (HasCellStringData( pCell)) { GetCellString( *aComp.pVal[ i ], pCell); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = false; } else { aComp.nVal[ i ] = GetCellValue( aAdr, pCell ); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; } } break; @@ -835,32 +835,32 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { case svEmptyCell: Pop(); - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; break; case svMissing: case svDouble: aComp.nVal[ i ] = GetDouble(); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; break; case svString: *aComp.pVal[ i ] = GetString(); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = false; break; case svSingleRef: { PopSingleRef( aAdr ); ScBaseCell* pCell = GetCell( aAdr ); if (HasCellEmptyData( pCell)) - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; else if (HasCellStringData( pCell)) { GetCellString( *aComp.pVal[ i ], pCell); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = false; } else { aComp.nVal[ i ] = GetCellValue( aAdr, pCell ); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; } } break; @@ -904,15 +904,15 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { if ( pMat[i]->IsString(j,k) ) { - aComp.bVal[i] = FALSE; + aComp.bVal[i] = false; *aComp.pVal[i] = pMat[i]->GetString(j,k); aComp.bEmpty[i] = pMat[i]->IsEmpty(j,k); } else { - aComp.bVal[i] = TRUE; + aComp.bVal[i] = sal_True; aComp.nVal[i] = pMat[i]->GetDouble(j,k); - aComp.bEmpty[i] = FALSE; + aComp.bEmpty[i] = false; } } pResMat->PutDouble( CompareFunc( aComp, pOptions ), j,k ); @@ -937,13 +937,13 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { if ( pMat[i]->IsValue(j,k) ) { - aComp.bVal[i] = TRUE; + aComp.bVal[i] = true; aComp.nVal[i] = pMat[i]->GetDouble(j,k); - aComp.bEmpty[i] = FALSE; + aComp.bEmpty[i] = false; } else { - aComp.bVal[i] = FALSE; + aComp.bVal[i] = false; *aComp.pVal[i] = pMat[i]->GetString(j,k); aComp.bEmpty[i] = pMat[i]->IsEmpty(j,k); } @@ -1124,8 +1124,8 @@ void ScInterpreter::ScAnd() short nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 1 ) ) { - BOOL bHaveValue = FALSE; - short nRes = TRUE; + sal_Bool bHaveValue = false; + short nRes = sal_True; size_t nRefInList = 0; while( nParamCount-- > 0) { @@ -1134,7 +1134,7 @@ void ScInterpreter::ScAnd() switch ( GetStackType() ) { case svDouble : - bHaveValue = TRUE; + bHaveValue = sal_True; nRes &= ( PopDouble() != 0.0 ); break; case svString : @@ -1150,7 +1150,7 @@ void ScInterpreter::ScAnd() ScBaseCell* pCell = GetCell( aAdr ); if ( HasCellValueData( pCell ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; nRes &= ( GetCellValue( aAdr, pCell ) != 0.0 ); } // else: Xcl raises no error here @@ -1165,11 +1165,11 @@ void ScInterpreter::ScAnd() if ( !nGlobalError ) { double fVal; - USHORT nErr = 0; + sal_uInt16 nErr = 0; ScValueIterator aValIter( pDok, aRange ); if ( aValIter.GetFirst( fVal, nErr ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; do { nRes &= ( fVal != 0.0 ); @@ -1185,13 +1185,13 @@ void ScInterpreter::ScAnd() ScMatrixRef pMat = GetMatrix(); if ( pMat ) { - bHaveValue = TRUE; + bHaveValue = sal_True; double fVal = pMat->And(); - USHORT nErr = GetDoubleErrorValue( fVal ); + sal_uInt16 nErr = GetDoubleErrorValue( fVal ); if ( nErr ) { SetError( nErr ); - nRes = FALSE; + nRes = false; } else nRes &= (fVal != 0.0); @@ -1222,8 +1222,8 @@ void ScInterpreter::ScOr() short nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 1 ) ) { - BOOL bHaveValue = FALSE; - short nRes = FALSE; + sal_Bool bHaveValue = false; + short nRes = false; size_t nRefInList = 0; while( nParamCount-- > 0) { @@ -1232,7 +1232,7 @@ void ScInterpreter::ScOr() switch ( GetStackType() ) { case svDouble : - bHaveValue = TRUE; + bHaveValue = sal_True; nRes |= ( PopDouble() != 0.0 ); break; case svString : @@ -1248,7 +1248,7 @@ void ScInterpreter::ScOr() ScBaseCell* pCell = GetCell( aAdr ); if ( HasCellValueData( pCell ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; nRes |= ( GetCellValue( aAdr, pCell ) != 0.0 ); } // else: Xcl raises no error here @@ -1263,11 +1263,11 @@ void ScInterpreter::ScOr() if ( !nGlobalError ) { double fVal; - USHORT nErr = 0; + sal_uInt16 nErr = 0; ScValueIterator aValIter( pDok, aRange ); if ( aValIter.GetFirst( fVal, nErr ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; do { nRes |= ( fVal != 0.0 ); @@ -1280,17 +1280,17 @@ void ScInterpreter::ScOr() break; case svMatrix: { - bHaveValue = TRUE; + bHaveValue = sal_True; ScMatrixRef pMat = GetMatrix(); if ( pMat ) { - bHaveValue = TRUE; + bHaveValue = sal_True; double fVal = pMat->Or(); - USHORT nErr = GetDoubleErrorValue( fVal ); + sal_uInt16 nErr = GetDoubleErrorValue( fVal ); if ( nErr ) { SetError( nErr ); - nRes = FALSE; + nRes = false; } else nRes |= (fVal != 0.0); @@ -1363,7 +1363,7 @@ void ScInterpreter::ScPercentSign() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPercentSign" ); nFuncFmtType = NUMBERFORMAT_PERCENT; const FormulaToken* pSaveCur = pCur; - BYTE nSavePar = cPar; + sal_uInt8 nSavePar = cPar; PushInt( 100 ); cPar = 2; FormulaByteToken aDivOp( ocDiv, cPar ); @@ -1643,7 +1643,7 @@ void ScInterpreter::ScIsEmpty() pJumpMatrix->GetPos( nC, nR); if ( nC < nCols && nR < nRows ) nRes = pMat->IsEmpty( nC, nR); - // else: FALSE, not empty (which is what Xcl does) + // else: sal_False, not empty (which is what Xcl does) } } break; @@ -1747,7 +1747,7 @@ void ScInterpreter::ScIsLogical() { if (HasCellValueData(pCell)) { - ULONG nFormat = GetCellNumberFormat( aAdr, pCell ); + sal_uLong nFormat = GetCellNumberFormat( aAdr, pCell ); nRes = ( pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL); } @@ -1796,7 +1796,7 @@ void ScInterpreter::ScType() break; case CELLTYPE_VALUE : { - ULONG nFormat = GetCellNumberFormat( aAdr, pCell ); + sal_uLong nFormat = GetCellNumberFormat( aAdr, pCell ); if (pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL) nType = 4; @@ -1851,13 +1851,13 @@ void ScInterpreter::ScType() } -inline BOOL lcl_FormatHasNegColor( const SvNumberformat* pFormat ) +inline sal_Bool lcl_FormatHasNegColor( const SvNumberformat* pFormat ) { return pFormat && pFormat->GetColor( 1 ); } -inline BOOL lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) +inline sal_Bool lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) { return pFormat && (pFormat->GetFormatstring().Search( '(' ) != STRING_NOTFOUND); } @@ -1865,11 +1865,11 @@ inline BOOL lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) void ScInterpreter::ScCell() { // ATTRIBUTE ; [REF] - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if( MustHaveParamCount( nParamCount, 1, 2 ) ) { ScAddress aCellPos( aPos ); - BOOL bError = FALSE; + sal_Bool bError = false; if( nParamCount == 2 ) bError = !PopDoubleRefOrSingleRef( aCellPos ); String aInfoType( GetString() ); @@ -1897,7 +1897,7 @@ void ScInterpreter::ScCell() } else if( aInfoType.EqualsAscii( "ADDRESS" ) ) { // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW - USHORT nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D); + sal_uInt16 nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D); aCellPos.Format( aFuncResult, nFlags, pDok, pDok->GetAddressConvention() ); PushString( aFuncResult ); } @@ -2002,10 +2002,10 @@ void ScInterpreter::ScCell() // *** FORMATTING *** else if( aInfoType.EqualsAscii( "FORMAT" ) ) { // specific format code for standard formats - ULONG nFormat = pDok->GetNumberFormat( aCellPos ); - BOOL bAppendPrec = TRUE; - USHORT nPrec, nLeading; - BOOL bThousand, bIsRed; + sal_uLong nFormat = pDok->GetNumberFormat( aCellPos ); + sal_Bool bAppendPrec = sal_True; + sal_uInt16 nPrec, nLeading; + sal_Bool bThousand, bIsRed; pFormatter->GetFormatSpecialInfo( nFormat, bThousand, bIsRed, nPrec, nLeading ); switch( pFormatter->GetType( nFormat ) ) @@ -2016,7 +2016,7 @@ void ScInterpreter::ScCell() case NUMBERFORMAT_PERCENT: aFuncResult = 'P'; break; default: { - bAppendPrec = FALSE; + bAppendPrec = false; switch( pFormatter->GetIndexTableOffset( nFormat ) ) { case NF_DATE_SYSTEM_SHORT: @@ -2242,7 +2242,7 @@ void ScInterpreter::ScIsNV() else { ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); nRes = (nErr == NOTAVAILABLE); } } @@ -2291,7 +2291,7 @@ void ScInterpreter::ScIsErr() else { ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); nRes = (nErr && nErr != NOTAVAILABLE); } } @@ -2303,7 +2303,7 @@ void ScInterpreter::ScIsErr() nRes = ((nGlobalError && nGlobalError != NOTAVAILABLE) || !pMat); else if ( !pJumpMatrix ) { - USHORT nErr = pMat->GetErrorIfNotString( 0, 0); + sal_uInt16 nErr = pMat->GetErrorIfNotString( 0, 0); nRes = (nErr && nErr != NOTAVAILABLE); } else @@ -2313,7 +2313,7 @@ void ScInterpreter::ScIsErr() pJumpMatrix->GetPos( nC, nR); if ( nC < nCols && nR < nRows ) { - USHORT nErr = pMat->GetErrorIfNotString( nC, nR); + sal_uInt16 nErr = pMat->GetErrorIfNotString( nC, nR); nRes = (nErr && nErr != NOTAVAILABLE); } } @@ -2396,7 +2396,7 @@ short ScInterpreter::IsEven() if ( !PopDoubleRefOrSingleRef( aAdr ) ) break; ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); if (nErr != 0) SetError(nErr); else @@ -2481,11 +2481,11 @@ void ScInterpreter::ScIsOdd() void ScInterpreter::ScN() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScN" ); - USHORT nErr = nGlobalError; + sal_uInt16 nErr = nGlobalError; nGlobalError = 0; // Temporarily override the ConvertStringToValue() error for // GetCellValue() / GetCellValueOrZero() - USHORT nSErr = mnStringNoValueError; + sal_uInt16 nSErr = mnStringNoValueError; mnStringNoValueError = errCellNoValue; double fVal = GetDouble(); mnStringNoValueError = nSErr; @@ -2588,14 +2588,14 @@ void ScInterpreter::ScT() PushInt(0); return ; } - BOOL bValue = FALSE; + sal_Bool bValue = false; ScBaseCell* pCell = GetCell( aAdr ); if ( GetCellErrCode( pCell ) == 0 ) { switch ( GetCellType( pCell ) ) { case CELLTYPE_VALUE : - bValue = TRUE; + bValue = sal_True; break; case CELLTYPE_FORMULA : bValue = ((ScFormulaCell*)pCell)->IsValue(); @@ -2706,7 +2706,7 @@ void ScInterpreter::ScValue() //2do: this should be a proper unicode string method -inline BOOL lcl_ScInterpreter_IsPrintable( sal_Unicode c ) +inline sal_Bool lcl_ScInterpreter_IsPrintable( sal_Unicode c ) { return 0x20 <= c && c != 0x7f; } @@ -2764,7 +2764,7 @@ static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr ) bFirstASCCall = false; } - return aTrans.transliterate( rStr, 0, USHORT( rStr.getLength() ), NULL ); + return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ), NULL ); } @@ -2779,7 +2779,7 @@ static ::rtl::OUString lcl_convertIntoFullWidth( const ::rtl::OUString & rStr ) bFirstJISCall = false; } - return aTrans.transliterate( rStr, 0, USHORT( rStr.getLength() ), NULL ); + return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ), NULL ); } @@ -2848,7 +2848,7 @@ void ScInterpreter::ScUnichar() } -void ScInterpreter::ScMin( BOOL bTextAsZero ) +void ScInterpreter::ScMin( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMin" ); short nParamCount = GetByte(); @@ -2890,7 +2890,7 @@ void ScInterpreter::ScMin( BOOL bTextAsZero ) case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(nVal, nErr)) @@ -2969,11 +2969,7 @@ void ScInterpreter::ScMin( BOOL bTextAsZero ) PushDouble(nMin); } -#if defined(WIN) && defined(MSC) -#pragma optimize("",off) -#endif - -void ScInterpreter::ScMax( BOOL bTextAsZero ) +void ScInterpreter::ScMax( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMax" ); short nParamCount = GetByte(); @@ -3015,7 +3011,7 @@ void ScInterpreter::ScMax( BOOL bTextAsZero ) case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(nVal, nErr)) @@ -3100,8 +3096,8 @@ void ScInterpreter::ScMax( BOOL bTextAsZero ) namespace { void IterateMatrix( - const ScMatrixRef& pMat, ScIterFunc eFunc, BOOL bTextAsZero, - ULONG& rCount, short& rFuncFmtType, double& fRes, double& fMem, bool& bNull) + const ScMatrixRef& pMat, ScIterFunc eFunc, sal_Bool bTextAsZero, + sal_uLong& rCount, short& rFuncFmtType, double& fRes, double& fMem, bool& bNull) { if (!pMat) return; @@ -3151,7 +3147,7 @@ void IterateMatrix( } -double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) +double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IterateParameters" ); short nParamCount = GetByte(); @@ -3159,7 +3155,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) double fVal = 0.0; double fMem = 0.0; // first numeric value. bool bNull = true; - ULONG nCount = 0; + sal_uLong nCount = 0; ScAddress aAdr; ScRange aRange; size_t nRefInList = 0; @@ -3386,7 +3382,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) else { ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); - USHORT nErr = 0; + sal_uInt16 nErr = 0; if (aValIter.GetFirst(fVal, nErr)) { // placed the loop on the inside for performance reasons: @@ -3487,7 +3483,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case ifPRODUCT: if ( !nCount ) fRes = 0.0; break; default: ; // nothing } - // Bei Summen etc. macht ein BOOL-Ergebnis keinen Sinn + // Bei Summen etc. macht ein sal_Bool-Ergebnis keinen Sinn // und Anzahl ist immer Number (#38345#) if( eFunc == ifCOUNT || nFuncFmtType == NUMBERFORMAT_LOGICAL ) nFuncFmtType = NUMBERFORMAT_NUMBER; @@ -3516,7 +3512,7 @@ void ScInterpreter::ScProduct() } -void ScInterpreter::ScAverage( BOOL bTextAsZero ) +void ScInterpreter::ScAverage( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAverage" ); PushDouble( IterateParameters( ifAVERAGE, bTextAsZero ) ); @@ -3538,7 +3534,7 @@ void ScInterpreter::ScCount2() void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, - BOOL bTextAsZero ) + sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetStVarParams" ); short nParamCount = GetByte(); @@ -3585,7 +3581,7 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(fVal, nErr)) @@ -3654,7 +3650,7 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, } -void ScInterpreter::ScVar( BOOL bTextAsZero ) +void ScInterpreter::ScVar( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVar" ); double nVal; @@ -3668,7 +3664,7 @@ void ScInterpreter::ScVar( BOOL bTextAsZero ) } -void ScInterpreter::ScVarP( BOOL bTextAsZero ) +void ScInterpreter::ScVarP( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVarP" ); double nVal; @@ -3679,7 +3675,7 @@ void ScInterpreter::ScVarP( BOOL bTextAsZero ) } -void ScInterpreter::ScStDev( BOOL bTextAsZero ) +void ScInterpreter::ScStDev( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScStDev" ); double nVal; @@ -3692,7 +3688,7 @@ void ScInterpreter::ScStDev( BOOL bTextAsZero ) } -void ScInterpreter::ScStDevP( BOOL bTextAsZero ) +void ScInterpreter::ScStDevP( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScStDevP" ); double nVal; @@ -3725,8 +3721,8 @@ void ScInterpreter::ScStDevP( BOOL bTextAsZero ) void ScInterpreter::ScColumns() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScColumns" ); - BYTE nParamCount = GetByte(); - ULONG nVal = 0; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal = 0; SCCOL nCol1; SCROW nRow1; SCTAB nTab1; @@ -3743,8 +3739,8 @@ void ScInterpreter::ScColumns() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1) * - static_cast<ULONG>(nCol2 - nCol1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1) * + static_cast<sal_uLong>(nCol2 - nCol1 + 1); break; case svMatrix: { @@ -3769,8 +3765,8 @@ void ScInterpreter::ScColumns() void ScInterpreter::ScRows() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRows" ); - BYTE nParamCount = GetByte(); - ULONG nVal = 0; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal = 0; SCCOL nCol1; SCROW nRow1; SCTAB nTab1; @@ -3787,8 +3783,8 @@ void ScInterpreter::ScRows() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1) * - static_cast<ULONG>(nRow2 - nRow1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1) * + static_cast<sal_uLong>(nRow2 - nRow1 + 1); break; case svMatrix: { @@ -3812,8 +3808,8 @@ void ScInterpreter::ScRows() void ScInterpreter::ScTables() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTables" ); - BYTE nParamCount = GetByte(); - ULONG nVal; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal; if ( nParamCount == 0 ) nVal = pDok->GetTableCount(); else @@ -3835,7 +3831,7 @@ void ScInterpreter::ScTables() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1); break; case svMatrix: PopError(); @@ -3854,7 +3850,7 @@ void ScInterpreter::ScTables() void ScInterpreter::ScColumn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScColumn" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { double nVal = 0; @@ -3930,7 +3926,7 @@ void ScInterpreter::ScColumn() void ScInterpreter::ScRow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRow" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { double nVal = 0; @@ -4005,7 +4001,7 @@ void ScInterpreter::ScRow() void ScInterpreter::ScTable() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTable" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { SCTAB nVal = 0; @@ -4207,7 +4203,7 @@ void ScInterpreter::ScMatch() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMatch" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { double fTyp; @@ -4264,10 +4260,10 @@ void ScInterpreter::ScMatch() rParam.nRow1 = nRow1; rParam.nCol2 = nCol2; rParam.nTab = nTab1; - rParam.bMixedComparison = TRUE; + rParam.bMixedComparison = sal_True; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if (fTyp < 0.0) rEntry.eOp = SC_GREATER_EQUAL; else if (fTyp > 0.0) @@ -4277,14 +4273,14 @@ void ScInterpreter::ScMatch() case svDouble: { fVal = GetDouble(); - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = fVal; } break; case svString: { sStr = GetString(); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } break; @@ -4301,13 +4297,13 @@ void ScInterpreter::ScMatch() if (HasCellValueData(pCell)) { fVal = GetCellValue( aAdr, pCell ); - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = fVal; } else { GetCellString(sStr, pCell); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } } @@ -4353,13 +4349,13 @@ void ScInterpreter::ScMatch() } if ( rEntry.bQueryByString ) { - BOOL bIsVBAMode = FALSE; + sal_Bool bIsVBAMode = false; if ( pDok ) bIsVBAMode = pDok->IsInVBAMode(); // #TODO handle MSO wildcards if ( bIsVBAMode ) - rParam.bRegExp = FALSE; + rParam.bRegExp = false; else rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); } @@ -4474,12 +4470,12 @@ void ScInterpreter::ScMatch() else { // search column in row SCCOL nC; - rParam.bByRow = FALSE; + rParam.bByRow = false; rParam.nRow2 = nRow1; rEntry.nField = nCol1; - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false); // Advance Entry.nField in Iterator if column changed - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if (fTyp == 0.0) { // EQUAL if ( aCellIter.GetFirst() ) @@ -4514,7 +4510,7 @@ void ScInterpreter::ScCountEmptyCells() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCountEmptyCells" ); if ( MustHaveParamCount( GetByte(), 1 ) ) { - ULONG nMaxCount = 0, nCount = 0; + sal_uLong nMaxCount = 0, nCount = 0; CellType eCellType; switch (GetStackType()) { @@ -4538,9 +4534,9 @@ void ScInterpreter::ScCountEmptyCells() { PopDoubleRef( aRange, nParam, nRefInList); nMaxCount += - static_cast<ULONG>(aRange.aEnd.Row() - aRange.aStart.Row() + 1) * - static_cast<ULONG>(aRange.aEnd.Col() - aRange.aStart.Col() + 1) * - static_cast<ULONG>(aRange.aEnd.Tab() - aRange.aStart.Tab() + 1); + static_cast<sal_uLong>(aRange.aEnd.Row() - aRange.aStart.Row() + 1) * + static_cast<sal_uLong>(aRange.aEnd.Col() - aRange.aStart.Col() + 1) * + static_cast<sal_uLong>(aRange.aEnd.Tab() - aRange.aStart.Tab() + 1); ScBaseCell* pCell; ScCellIterator aDocIter( pDok, aRange, glSubTotal); if ( (pCell = aDocIter.GetFirst()) != NULL ) @@ -4569,7 +4565,7 @@ void ScInterpreter::ScCountIf() { String rString; double fVal = 0.0; - BOOL bIsString = TRUE; + sal_Bool bIsString = sal_True; switch ( GetStackType() ) { case svDoubleRef : @@ -4586,13 +4582,13 @@ void ScInterpreter::ScCountIf() { case CELLTYPE_VALUE : fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = false; break; case CELLTYPE_FORMULA : if( ((ScFormulaCell*)pCell)->IsValue() ) { fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = false; } else GetCellString(rString, pCell); @@ -4603,7 +4599,7 @@ void ScInterpreter::ScCountIf() break; default: fVal = 0.0; - bIsString = FALSE; + bIsString = false; } } break; @@ -4620,7 +4616,7 @@ void ScInterpreter::ScCountIf() default: { fVal = GetDouble(); - bIsString = FALSE; + bIsString = false; } } double fSum = 0.0; @@ -4690,10 +4686,10 @@ void ScInterpreter::ScCountIf() rParam.nRow2 = nRow2; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if (!bIsString) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = fVal; rEntry.eOp = SC_EQUAL; } @@ -4731,9 +4727,9 @@ void ScInterpreter::ScCountIf() } else { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false); // Keep Entry.nField in iterator on column change - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( true ); if ( aCellIter.GetFirst() ) { do @@ -4756,7 +4752,7 @@ void ScInterpreter::ScCountIf() void ScInterpreter::ScSumIf() { - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return; @@ -4894,7 +4890,7 @@ void ScInterpreter::ScSumIf() double fSum = 0.0; double fMem = 0.0; - BOOL bNull = TRUE; + sal_Bool bNull = true; short nParam = 1; size_t nRefInList = 0; while (nParam-- > 0) @@ -5012,10 +5008,10 @@ void ScInterpreter::ScSumIf() rParam.nRow2 = nRow2; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = true; if (!bIsString) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = fVal; rEntry.eOp = SC_EQUAL; } @@ -5063,7 +5059,7 @@ void ScInterpreter::ScSumIf() fVal = pSumExtraMatrix->GetDouble( nC, nR); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = false; fMem = fVal; } else @@ -5089,7 +5085,7 @@ void ScInterpreter::ScSumIf() fVal = GetCellValue( aAdr, pCell ); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = false; fMem = fVal; } else @@ -5102,9 +5098,9 @@ void ScInterpreter::ScSumIf() } else { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false); // Increment Entry.nField in iterator when switching to next column. - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( true ); if ( aCellIter.GetFirst() ) { if (pSumExtraMatrix) @@ -5118,7 +5114,7 @@ void ScInterpreter::ScSumIf() fVal = pSumExtraMatrix->GetDouble( nC, nR); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = false; fMem = fVal; } else @@ -5138,7 +5134,7 @@ void ScInterpreter::ScSumIf() fVal = GetCellValue( aAdr, pCell ); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = false; fMem = fVal; } else @@ -5162,7 +5158,7 @@ void ScInterpreter::ScSumIf() void ScInterpreter::ScLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLookup" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return ; @@ -5585,13 +5581,13 @@ void ScInterpreter::ScLookup() aParam.bByRow = bVertical; aParam.bMixedComparison = true; - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; rEntry.eOp = SC_LESS_EQUAL; rEntry.nField = nCol1; if ( rEntry.bQueryByString ) aParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); - ScQueryCellIterator aCellIter(pDok, nTab1, aParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, aParam, false); SCCOL nC; SCROW nR; // Advance Entry.nField in iterator upon switching columns if @@ -5717,19 +5713,19 @@ void ScInterpreter::ScLookup() void ScInterpreter::ScHLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScHLookup" ); - CalculateLookup(TRUE); + CalculateLookup(sal_True); } -void ScInterpreter::CalculateLookup(BOOL HLookup) +void ScInterpreter::CalculateLookup(sal_Bool HLookup) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateLookup" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { - BOOL bSorted; + sal_Bool bSorted; if (nParamCount == 4) bSorted = GetBool(); else - bSorted = TRUE; + bSorted = sal_True; double fIndex = ::rtl::math::approxFloor( GetDouble() ) - 1.0; ScMatrixRef pMat = NULL; SCSIZE nC = 0, nR = 0; @@ -5789,7 +5785,7 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) { rParam.nCol2 = nCol2; rParam.nRow2 = nRow1; // nur in der ersten Zeile suchen - rParam.bByRow = FALSE; + rParam.bByRow = false; } // if ( HLookup ) else { @@ -5797,10 +5793,10 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) rParam.nRow2 = nRow2; rParam.nTab = nTab1; } - rParam.bMixedComparison = TRUE; + rParam.bMixedComparison = sal_True; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if ( bSorted ) rEntry.eOp = SC_LESS_EQUAL; if ( !FillEntry(rEntry) ) @@ -5902,16 +5898,16 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) else { rEntry.nField = nCol1; - BOOL bFound = FALSE; + sal_Bool bFound = false; SCCOL nCol = 0; SCROW nRow = 0; if ( bSorted ) rEntry.eOp = SC_LESS_EQUAL; if ( HLookup ) { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false); // advance Entry.nField in Iterator upon switching columns - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if ( bSorted ) { SCROW nRow1_temp; @@ -5919,7 +5915,7 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) } else if ( aCellIter.GetFirst() ) { - bFound = TRUE; + bFound = sal_True; nCol = aCellIter.GetCol(); } nRow = nZIndex; @@ -5952,14 +5948,14 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) { case svDouble: { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = GetDouble(); } break; case svString: { const String sStr = GetString(); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } break; @@ -5975,21 +5971,21 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) ScBaseCell* pCell = GetCell( aAdr ); if (HasCellValueData(pCell)) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = GetCellValue( aAdr, pCell ); } else { if ( GetCellType( pCell ) == CELLTYPE_NOTE ) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; rEntry.nVal = 0.0; } else { String sStr; GetCellString(sStr, pCell); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } } @@ -6012,17 +6008,13 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) void ScInterpreter::ScVLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVLookup" ); - CalculateLookup(FALSE); + CalculateLookup(false); } -#if defined(WIN) && defined(MSC) -#pragma optimize("",off) -#endif - void ScInterpreter::ScSubTotal() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSubTotal" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 2 ) ) { // We must fish the 1st parameter deep from the stack! And push it on top. @@ -6034,7 +6026,7 @@ void ScInterpreter::ScSubTotal() else { cPar = nParamCount - 1; - glSubTotal = TRUE; + glSubTotal = sal_True; switch( nFunc ) { case SUBTOTAL_FUNC_AVE : ScAverage(); break; @@ -6050,7 +6042,7 @@ void ScInterpreter::ScSubTotal() case SUBTOTAL_FUNC_VARP : ScVarP(); break; default : PushIllegalArgument(); break; } - glSubTotal = FALSE; + glSubTotal = false; } // Get rid of the 1st (fished) parameter. double nVal = GetDouble(); @@ -6058,19 +6050,15 @@ void ScInterpreter::ScSubTotal() PushDouble( nVal ); } } -#if defined(WIN) && defined(MSC) -#pragma optimize("",on) -#endif - -ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) +ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDBParams" ); - BOOL bAllowMissingField = FALSE; + sal_Bool bAllowMissingField = false; if ( rMissingField ) { - bAllowMissingField = TRUE; - rMissingField = FALSE; + bAllowMissingField = sal_True; + rMissingField = false; } if ( GetByte() == 3 ) { @@ -6079,20 +6067,20 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) if (!pQueryRef.get()) return NULL; - BOOL bByVal = TRUE; + sal_Bool bByVal = sal_True; double nVal = 0.0; String aStr; ScRange aMissingRange; - BOOL bRangeFake = FALSE; + sal_Bool bRangeFake = false; switch (GetStackType()) { case svDouble : nVal = ::rtl::math::approxFloor( GetDouble() ); if ( bAllowMissingField && nVal == 0.0 ) - rMissingField = TRUE; // fake missing parameter + rMissingField = sal_True; // fake missing parameter break; case svString : - bByVal = FALSE; + bByVal = false; aStr = GetString(); break; case svSingleRef : @@ -6104,7 +6092,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) nVal = GetCellValue( aAdr, pCell ); else { - bByVal = FALSE; + bByVal = false; GetCellString(aStr, pCell); } } @@ -6112,7 +6100,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) case svDoubleRef : if ( bAllowMissingField ) { // fake missing parameter for old SO compatibility - bRangeFake = TRUE; + bRangeFake = sal_True; PopDoubleRef( aMissingRange ); } else @@ -6124,7 +6112,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) case svMissing : PopError(); if ( bAllowMissingField ) - rMissingField = TRUE; + rMissingField = sal_True; else SetError( errIllegalParameter ); break; @@ -6142,7 +6130,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) { // range parameter must match entire database range if (pDBRef->isRangeEqual(aMissingRange)) - rMissingField = TRUE; + rMissingField = sal_True; else SetError( errIllegalParameter ); } @@ -6203,9 +6191,9 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::DBIterator" ); double nErg = 0.0; double fMem = 0.0; - BOOL bNull = TRUE; - ULONG nCount = 0; - BOOL bMissingField = FALSE; + sal_Bool bNull = sal_True; + sal_uLong nCount = 0; + sal_Bool bMissingField = false; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { @@ -6234,7 +6222,7 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) case ifSUM: if ( bNull && aValue.mfValue != 0.0 ) { - bNull = FALSE; + bNull = false; fMem = aValue.mfValue; } else @@ -6274,11 +6262,11 @@ void ScInterpreter::ScDBSum() void ScInterpreter::ScDBCount() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBCount" ); - BOOL bMissingField = TRUE; + sal_Bool bMissingField = sal_True; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { - ULONG nCount = 0; + sal_uLong nCount = 0; if ( bMissingField && pQueryParam->GetType() == ScDBQueryParamBase::INTERNAL ) { // count all matching records // TODO: currently the QueryIterators only return cell pointers of @@ -6334,7 +6322,7 @@ void ScInterpreter::ScDBCount() void ScInterpreter::ScDBCount2() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBCount2" ); - BOOL bMissingField = TRUE; + sal_Bool bMissingField = sal_True; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { @@ -6343,7 +6331,7 @@ void ScInterpreter::ScDBCount2() SetError(errNoValue); return; } - ULONG nCount = 0; + sal_uLong nCount = 0; pQueryParam->mbSkipString = false; ScDBQueryDataIterator aValIter( pDok, pQueryParam.release()); ScDBQueryDataIterator::Value aValue; @@ -6400,7 +6388,7 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount ) rValCount = 0.0; double fSum = 0.0; - BOOL bMissingField = FALSE; + sal_Bool bMissingField = false; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { @@ -6520,7 +6508,7 @@ ScTokenArray* lcl_CreateExternalRefTokenArray( const ScAddress& rPos, ScDocument void ScInterpreter::ScIndirect() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIndirect" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { bool bTryXlA1 = true; // whether to try XL_A1 style as well. @@ -6609,7 +6597,7 @@ void ScInterpreter::ScAddressFunc() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAddressFunc" ); String sTabStr; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if( !MustHaveParamCount( nParamCount, 2, 5 ) ) return; @@ -6620,10 +6608,10 @@ void ScInterpreter::ScAddressFunc() if( nParamCount >= 4 && 0.0 == ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0))) eConv = FormulaGrammar::CONV_XL_R1C1; - USHORT nFlags = SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE; // default + sal_uInt16 nFlags = SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE; // default if( nParamCount >= 3 ) { - USHORT n = (USHORT) ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0)); + sal_uInt16 n = (sal_uInt16) ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0)); switch ( n ) { default : @@ -6682,7 +6670,7 @@ void ScInterpreter::ScAddressFunc() void ScInterpreter::ScOffset() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScOffset" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 5 ) ) { long nColNew = -1, nRowNew = -1, nColPlus, nRowPlus; @@ -6822,7 +6810,7 @@ void ScInterpreter::ScOffset() void ScInterpreter::ScIndex() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIndex" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 4 ) ) { long nArea; @@ -6863,7 +6851,7 @@ void ScInterpreter::ScIndex() { if (nArea != 1) SetError(errIllegalArgument); - USHORT nOldSp = sp; + sal_uInt16 nOldSp = sp; ScMatrixRef pMat = GetMatrix(); if (pMat) { @@ -6961,7 +6949,7 @@ void ScInterpreter::ScIndex() SCCOL nCol2 = 0; SCROW nRow2 = 0; SCTAB nTab2 = 0; - BOOL bRowArray = FALSE; + sal_Bool bRowArray = false; if (GetStackType() == svRefList) { FormulaTokenRef xRef = PopToken(); @@ -6974,13 +6962,13 @@ void ScInterpreter::ScIndex() DoubleRefToRange( (*(static_cast<ScToken*>(xRef.get())->GetRefList()))[nArea-1], aRange); aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); if ( nParamCount == 2 && nRow1 == nRow2 ) - bRowArray = TRUE; + bRowArray = sal_True; } else { PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); if ( nParamCount == 2 && nRow1 == nRow2 ) - bRowArray = TRUE; + bRowArray = sal_True; } if ( nTab1 != nTab2 || (nCol > 0 && nCol1+nCol-1 > nCol2) || @@ -7031,7 +7019,7 @@ void ScInterpreter::ScMultiArea() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMultiArea" ); // Legacy support, convert to RefList - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (MustHaveParamCountMin( nParamCount, 1)) { while (!nGlobalError && nParamCount-- > 1) @@ -7045,7 +7033,7 @@ void ScInterpreter::ScMultiArea() void ScInterpreter::ScAreas() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAreas" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (MustHaveParamCount( nParamCount, 1)) { size_t nCount = 0; @@ -7083,7 +7071,7 @@ void ScInterpreter::ScAreas() void ScInterpreter::ScCurrency() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCurrency" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { String aStr; @@ -7112,18 +7100,18 @@ void ScInterpreter::ScCurrency() Color* pColor = NULL; if ( fDec < 0.0 ) fDec = 0.0; - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_CURRENCY, ScGlobal::eLnge); - if ( (USHORT) fDec != pFormatter->GetFormatPrecision( nIndex ) ) + if ( (sal_uInt16) fDec != pFormatter->GetFormatPrecision( nIndex ) ) { String sFormatString; pFormatter->GenerateFormat(sFormatString, nIndex, ScGlobal::eLnge, - TRUE, // mit Tausenderpunkt - FALSE, // nicht rot - (USHORT) fDec,// Nachkommastellen + sal_True, // mit Tausenderpunkt + false, // nicht rot + (sal_uInt16) fDec,// Nachkommastellen 1); // 1 Vorkommanull if (!pFormatter->GetPreviewString(sFormatString, fVal, @@ -7174,16 +7162,16 @@ void ScInterpreter::ScReplace() void ScInterpreter::ScFixed() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFixed" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 3 ) ) { String aStr; double fDec; - BOOL bThousand; + sal_Bool bThousand; if (nParamCount == 3) bThousand = !GetBool(); // Param TRUE: keine Tausenderpunkte else - bThousand = TRUE; + bThousand = sal_True; if (nParamCount >= 2) { fDec = ::rtl::math::approxFloor(GetDoubleWithDefault( 2.0 )); @@ -7209,15 +7197,15 @@ void ScInterpreter::ScFixed() String sFormatString; if (fDec < 0.0) fDec = 0.0; - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GenerateFormat(sFormatString, nIndex, ScGlobal::eLnge, bThousand, // mit Tausenderpunkt - FALSE, // nicht rot - (USHORT) fDec,// Nachkommastellen + false, // nicht rot + (sal_uInt16) fDec,// Nachkommastellen 1); // 1 Vorkommanull if (!pFormatter->GetPreviewString(sFormatString, fVal, @@ -7234,7 +7222,7 @@ void ScInterpreter::ScFixed() void ScInterpreter::ScFind() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFind" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { double fAnz; @@ -7273,7 +7261,7 @@ void ScInterpreter::ScExact() void ScInterpreter::ScLeft() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLeft" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { xub_StrLen n; @@ -7300,7 +7288,7 @@ void ScInterpreter::ScLeft() void ScInterpreter::ScRight() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRight" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { xub_StrLen n; @@ -7328,7 +7316,7 @@ void ScInterpreter::ScRight() void ScInterpreter::ScSearch() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSearch" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { double fAnz; @@ -7354,7 +7342,7 @@ void ScInterpreter::ScSearch() utl::SearchParam::SearchType eSearchType = (MayBeRegExp( SearchStr, pDok ) ? utl::SearchParam::SRCH_REGEXP : utl::SearchParam::SRCH_NORMAL); - utl::SearchParam sPar(SearchStr, eSearchType, FALSE, FALSE, FALSE); + utl::SearchParam sPar(SearchStr, eSearchType, false, false, false); utl::TextSearch sT( sPar, *ScGlobal::pCharClass ); int nBool = sT.SearchFrwrd(sStr, &nPos, &nEndPos); if (!nBool) @@ -7407,7 +7395,7 @@ void ScInterpreter::ScText() PushTempToken( xTok.get()); // Temporarily override the ConvertStringToValue() // error for GetCellValue() / GetCellValueOrZero() - USHORT nSErr = mnStringNoValueError; + sal_uInt16 nSErr = mnStringNoValueError; mnStringNoValueError = errNotNumericString; fVal = GetDouble(); mnStringNoValueError = nSErr; @@ -7460,7 +7448,7 @@ void ScInterpreter::ScText() void ScInterpreter::ScSubstitute() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSubstitute" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { xub_StrLen nAnz; @@ -7484,7 +7472,7 @@ void ScInterpreter::ScSubstitute() xub_StrLen nCount = 0; xub_StrLen nNewLen = sNewStr.Len(); xub_StrLen nOldLen = sOldStr.Len(); - while( TRUE ) + while( sal_True ) { nPos = sStr.Search( sOldStr, nPos ); if (nPos != STRING_NOTFOUND) @@ -7548,7 +7536,7 @@ void ScInterpreter::ScRept() void ScInterpreter::ScConcat() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScConcat" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); String aRes; while( nParamCount-- > 0) { @@ -7562,8 +7550,8 @@ void ScInterpreter::ScConcat() void ScInterpreter::ScErrorType() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScErrorType" ); - USHORT nErr; - USHORT nOldError = nGlobalError; + sal_uInt16 nErr; + sal_uInt16 nOldError = nGlobalError; nGlobalError = 0; switch ( GetStackType() ) { @@ -7641,13 +7629,13 @@ void ScInterpreter::ScErrorType() } -BOOL ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) +sal_Bool ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MayBeRegExp" ); if ( pDoc && !pDoc->GetDocOptions().IsFormulaRegexEnabled() ) - return FALSE; + return false; if ( !rStr.Len() || (rStr.Len() == 1 && rStr.GetChar(0) != '.') ) - return FALSE; // einzelnes Metazeichen kann keine RegExp sein + return false; // einzelnes Metazeichen kann keine RegExp sein static const sal_Unicode cre[] = { '.','*','+','?','[',']','^','$','\\','<','>','(',')','|', 0 }; const sal_Unicode* p1 = rStr.GetBuffer(); sal_Unicode c1; @@ -7657,17 +7645,17 @@ BOOL ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) while ( *p2 ) { if ( c1 == *p2++ ) - return TRUE; + return sal_True; } } - return FALSE; + return false; } static bool lcl_LookupQuery( ScAddress & o_rResultPos, ScDocument * pDoc, const ScQueryParam & rParam, const ScQueryEntry & rEntry ) { bool bFound = false; - ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, FALSE); + ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, false); if (rEntry.eOp != SC_EQUAL) { // range lookup <= or >= diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index a70ec554d02d..aa06d915cb14 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -68,14 +68,14 @@ using namespace formula; // Datum und Zeit //----------------------------------------------------------------------------- -double ScInterpreter::GetDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, bool bStrict ) +double ScInterpreter::GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDateSerial" ); if ( nYear < 100 && !bStrict ) nYear = pFormatter->ExpandTwoDigitYear( nYear ); // Do not use a default Date ctor here because it asks system time with a // performance penalty. - INT16 nY, nM, nD; + sal_Int16 nY, nM, nD; if (bStrict) nY = nYear, nM = nMonth, nD = nDay; else @@ -203,7 +203,7 @@ void ScInterpreter::ScGetDateValue() void ScInterpreter::ScGetDayOfWeek() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetDayOfWeek" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { short nFlag; @@ -247,8 +247,8 @@ void ScInterpreter::ScEasterSunday() nFuncFmtType = NUMBERFORMAT_DATE; if ( MustHaveParamCount( GetByte(), 1 ) ) { - INT16 nDay, nMonth, nYear; - nYear = (INT16) ::rtl::math::approxFloor( GetDouble() ); + sal_Int16 nDay, nMonth, nYear; + nYear = (sal_Int16) ::rtl::math::approxFloor( GetDouble() ); if ( nYear < 100 ) nYear = pFormatter->ExpandTwoDigitYear( nYear ); // don't worry, be happy :) @@ -266,8 +266,8 @@ void ScInterpreter::ScEasterSunday() L = (32 + 2 * E + 2 * I - H - K) % 7; M = int((N + 11 * H + 22 * L) / 451); O = H + L - 7 * M + 114; - nDay = sal::static_int_cast<INT16>( O % 31 + 1 ); - nMonth = sal::static_int_cast<INT16>( int(O / 31) ); + nDay = sal::static_int_cast<sal_Int16>( O % 31 + 1 ); + nMonth = sal::static_int_cast<sal_Int16>( int(O / 31) ); PushDouble( GetDateSerial( nYear, nMonth, nDay, true ) ); } } @@ -278,9 +278,9 @@ void ScInterpreter::ScGetDate() nFuncFmtType = NUMBERFORMAT_DATE; if ( MustHaveParamCount( GetByte(), 3 ) ) { - INT16 nDay = (INT16) ::rtl::math::approxFloor(GetDouble()); - INT16 nMonth = (INT16) ::rtl::math::approxFloor(GetDouble()); - INT16 nYear = (INT16) ::rtl::math::approxFloor(GetDouble()); + sal_Int16 nDay = (sal_Int16) ::rtl::math::approxFloor(GetDouble()); + sal_Int16 nMonth = (sal_Int16) ::rtl::math::approxFloor(GetDouble()); + sal_Int16 nYear = (sal_Int16) ::rtl::math::approxFloor(GetDouble()); if (nYear < 0) PushIllegalArgument(); else @@ -342,14 +342,14 @@ void ScInterpreter::ScGetDiffDate360() * In Calc the result is 419 respectively -419. I consider the -418 a bug in Excel. */ - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { - BOOL bFlag; + sal_Bool bFlag; if (nParamCount == 3) bFlag = GetBool(); else - bFlag = FALSE; + bFlag = false; double nDate2 = GetDouble(); double nDate1 = GetDouble(); if (nGlobalError) @@ -373,7 +373,7 @@ void ScInterpreter::ScGetDiffDate360() Date aDate2 = *(pFormatter->GetNullDate()); aDate2 += (long) ::rtl::math::approxFloor(nDate2); if (aDate1.GetDay() == 31) - aDate1 -= (ULONG) 1; + aDate1 -= (sal_uLong) 1; else if (!bFlag) { if (aDate1.GetMonth() == 2) @@ -395,7 +395,7 @@ void ScInterpreter::ScGetDiffDate360() if (!bFlag ) { if (aDate1.GetDay() == 30) - aDate2 -= (ULONG) 1; + aDate2 -= (sal_uLong) 1; } else aDate2.SetDay(30); @@ -459,7 +459,7 @@ void ScInterpreter::ScInt() void ScInterpreter::RoundNumber( rtl_math_RoundingMode eMode ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::RoundNumber" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { double fVal = 0.0; @@ -467,7 +467,7 @@ void ScInterpreter::RoundNumber( rtl_math_RoundingMode eMode ) fVal = ::rtl::math::round( GetDouble(), 0, eMode ); else { - INT32 nDec = (INT32) ::rtl::math::approxFloor(GetDouble()); + sal_Int32 nDec = (sal_Int32) ::rtl::math::approxFloor(GetDouble()); if( nDec < -20 || nDec > 20 ) PushIllegalArgument(); else @@ -498,10 +498,10 @@ void ScInterpreter::ScRoundUp() void ScInterpreter::ScCeil() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCeil" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { - BOOL bAbs = ( nParamCount == 3 ? GetBool() : FALSE ); + sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : false ); double fDec = GetDouble(); double fVal = GetDouble(); if ( fDec == 0.0 ) @@ -521,10 +521,10 @@ void ScInterpreter::ScCeil() void ScInterpreter::ScFloor() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFloor" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { - BOOL bAbs = ( nParamCount == 3 ? GetBool() : FALSE ); + sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : false ); double fDec = GetDouble(); double fVal = GetDouble(); if ( fDec == 0.0 ) @@ -584,7 +584,7 @@ void ScInterpreter::ScArcTan2() void ScInterpreter::ScLog() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLog" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { double nBase; @@ -659,7 +659,7 @@ void ScInterpreter::ScNPV() case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; double nCellVal; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter(pDok, aRange, glSubTotal); @@ -684,23 +684,19 @@ void ScInterpreter::ScNPV() } } -#if defined(WIN) && defined(MSC) -#pragma optimize("",off) -#endif - void ScInterpreter::ScIRR() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIRR" ); double fSchaetzwert; nFuncFmtType = NUMBERFORMAT_PERCENT; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 1, 2 ) ) return; if (nParamCount == 2) fSchaetzwert = GetDouble(); else fSchaetzwert = 0.1; - USHORT sPos = sp; // Stack-Position merken + sal_uInt16 sPos = sp; // Stack-Position merken double fEps = 1.0; double x, xNeu, fWert, fZaehler, fNenner, nCount; if (fSchaetzwert == -1.0) @@ -717,8 +713,8 @@ void ScInterpreter::ScIRR() return; } } - const USHORT nIterationsMax = 20; - USHORT nItCount = 0; + const sal_uInt16 nIterationsMax = 20; + sal_uInt16 nItCount = 0; ScRange aRange; while (fEps > SCdEpsilon && nItCount < nIterationsMax) { // Newton-Verfahren: @@ -726,7 +722,7 @@ void ScInterpreter::ScIRR() nCount = 0.0; fZaehler = 0.0; fNenner = 0.0; - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange ); ScValueIterator aValIter(pDok, aRange, glSubTotal); if (aValIter.GetFirst(fWert, nErr)) @@ -754,10 +750,6 @@ void ScInterpreter::ScIRR() else PushError( errNoConvergence); } -#if defined(WIN) && defined(MSC) -#pragma optimize("",on) -#endif - void ScInterpreter::ScMIRR() { // range_of_values ; rate_invest ; rate_reinvest @@ -780,10 +772,10 @@ void ScInterpreter::ScMIRR() double fPow_invest = 1.0; ScValueIterator aValIter( pDok, aRange, glSubTotal ); double fCellValue; - ULONG nCount = 0; - USHORT nIterError = 0; + sal_uLong nCount = 0; + sal_uInt16 nIterError = 0; - BOOL bLoop = aValIter.GetFirst( fCellValue, nIterError ); + sal_Bool bLoop = aValIter.GetFirst( fCellValue, nIterError ); while( bLoop ) { if( fCellValue > 0.0 ) // reinvestments @@ -851,7 +843,7 @@ void ScInterpreter::ScBW() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBW" ); nFuncFmtType = NUMBERFORMAT_CURRENCY; double nRmz, nZzr, nZins, nZw = 0, nFlag = 0; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) return; if (nParamCount == 5) @@ -911,7 +903,7 @@ void ScInterpreter::ScGDA() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGDA" ); nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 4, 5 ) ) { double nFaktor; @@ -935,7 +927,7 @@ void ScInterpreter::ScGDA2() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGDA2" ); nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 4, 5 ) ) return ; double nMonate; @@ -964,8 +956,8 @@ void ScInterpreter::ScGDA2() double nSummAbRate = nErsteAbRate; double nMin = nDauer; if (nMin > nPeriode) nMin = nPeriode; - USHORT iMax = (USHORT)::rtl::math::approxFloor(nMin); - for (USHORT i = 2; i <= iMax; i++) + sal_uInt16 iMax = (sal_uInt16)::rtl::math::approxFloor(nMin); + for (sal_uInt16 i = 2; i <= iMax; i++) { nGda2 = (nWert - nSummAbRate) * nAbRate; nSummAbRate += nGda2; @@ -983,14 +975,14 @@ double ScInterpreter::ScInterVDB(double fWert,double fRest,double fDauer, RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScInterVDB" ); double fVdb=0; double fIntEnd = ::rtl::math::approxCeil(fPeriode); - ULONG nLoopEnd = (ULONG) fIntEnd; + sal_uLong nLoopEnd = (sal_uLong) fIntEnd; double fTerm, fLia; double fRestwert = fWert - fRest; - BOOL bNowLia = FALSE; + sal_Bool bNowLia = false; double fGda; - ULONG i; + sal_uLong i; fLia=0; for ( i = 1; i <= nLoopEnd; i++) { @@ -1002,7 +994,7 @@ double ScInterpreter::ScInterVDB(double fWert,double fRest,double fDauer, if (fLia > fGda) { fTerm = fLia; - bNowLia = TRUE; + bNowLia = sal_True; } else { @@ -1033,15 +1025,15 @@ void ScInterpreter::ScVDB() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVDB" ); nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 5, 7 ) ) { double fWert, fRest, fDauer, fAnfang, fEnde, fFaktor, fVdb = 0.0; - BOOL bFlag; + sal_Bool bFlag; if (nParamCount == 7) bFlag = GetBool(); else - bFlag = FALSE; + bFlag = false; if (nParamCount >= 6) fFaktor = GetDouble(); else @@ -1058,13 +1050,13 @@ void ScInterpreter::ScVDB() { double fIntStart = ::rtl::math::approxFloor(fAnfang); double fIntEnd = ::rtl::math::approxCeil(fEnde); - ULONG nLoopStart = (ULONG) fIntStart; - ULONG nLoopEnd = (ULONG) fIntEnd; + sal_uLong nLoopStart = (sal_uLong) fIntStart; + sal_uLong nLoopEnd = (sal_uLong) fIntEnd; fVdb = 0.0; if (bFlag) { - for (ULONG i = nLoopStart + 1; i <= nLoopEnd; i++) + for (sal_uLong i = nLoopStart + 1; i <= nLoopEnd; i++) { double fTerm = ScGetGDA(fWert, fRest, fDauer, (double) i, fFaktor); @@ -1155,7 +1147,7 @@ void ScInterpreter::ScRMZ() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRMZ" ); double nZins, nZzr, nBw, nZw = 0, nFlag = 0; nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) return; if (nParamCount == 5) @@ -1204,7 +1196,7 @@ void ScInterpreter::ScZW() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScZW" ); double nZins, nZzr, nRmz, nBw = 0, nFlag = 0; nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) return; if (nParamCount == 5) @@ -1221,7 +1213,7 @@ void ScInterpreter::ScZZR() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScZZR" ); double nZins, nRmz, nBw, nZw = 0, nFlag = 0; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) return; if (nParamCount == 5) @@ -1252,8 +1244,8 @@ bool ScInterpreter::RateIteration( double fNper, double fPayment, double fPv, bool bValid = true, bFound = false; double fX, fXnew, fTerm, fTermDerivation; double fGeoSeries, fGeoSeriesDerivation; - const USHORT nIterationsMax = 150; - USHORT nCount = 0; + const sal_uInt16 nIterationsMax = 150; + sal_uInt16 nCount = 0; const double fEpsilonSmall = 1.0E-14; // convert any fPayType situation to fPayType == zero situation fFv = fFv - fPayment * fPayType; @@ -1343,7 +1335,7 @@ void ScInterpreter::ScZins() double fFv = 0, fPayType = 0, fGuess = 0.1; bool bValid = true; nFuncFmtType = NUMBERFORMAT_PERCENT; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 6 ) ) return; if (nParamCount == 6) @@ -1398,7 +1390,7 @@ void ScInterpreter::ScZinsZ() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScZinsZ" ); double nZins, nZr, nZzr, nBw, nZw = 0, nFlag = 0; nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 4, 6 ) ) return; if (nParamCount == 6) @@ -1423,7 +1415,7 @@ void ScInterpreter::ScKapz() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScKapz" ); double nZins, nZr, nZzr, nBw, nZw = 0, nFlag = 0; nFuncFmtType = NUMBERFORMAT_CURRENCY; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 4, 6 ) ) return; if (nParamCount == 6) @@ -1462,8 +1454,8 @@ void ScInterpreter::ScKumZinsZ() PushIllegalArgument(); else { - ULONG nAnfang = (ULONG) fAnfang; - ULONG nEnde = (ULONG) fEnde ; + sal_uLong nAnfang = (sal_uLong) fAnfang; + sal_uLong nEnde = (sal_uLong) fEnde ; double fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF); double fZinsZ = 0.0; if (nAnfang == 1) @@ -1472,7 +1464,7 @@ void ScInterpreter::ScKumZinsZ() fZinsZ = -fBw; nAnfang++; } - for (ULONG i = nAnfang; i <= nEnde; i++) + for (sal_uLong i = nAnfang; i <= nEnde; i++) { if (fF > 0.0) fZinsZ += ScGetZw(fZins, (double)(i-2), fRmz, fBw, 1.0) - fRmz; @@ -1505,8 +1497,8 @@ void ScInterpreter::ScKumKapZ() { double fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF); double fKapZ = 0.0; - ULONG nAnfang = (ULONG) fAnfang; - ULONG nEnde = (ULONG) fEnde; + sal_uLong nAnfang = (sal_uLong) fAnfang; + sal_uLong nEnde = (sal_uLong) fEnde; if (nAnfang == 1) { if (fF <= 0.0) @@ -1515,7 +1507,7 @@ void ScInterpreter::ScKumKapZ() fKapZ = fRmz; nAnfang++; } - for (ULONG i = nAnfang; i <= nEnde; i++) + for (sal_uLong i = nAnfang; i <= nEnde; i++) { if (fF > 0.0) fKapZ += fRmz - (ScGetZw(fZins, (double)(i-2), fRmz, fBw, 1.0) - fRmz) * fZins; @@ -1606,7 +1598,7 @@ void ScInterpreter::ScBackSolver() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBackSolver" ); if ( MustHaveParamCount( GetByte(), 3 ) ) { - BOOL bDoneIteration = FALSE; + sal_Bool bDoneIteration = false; ScAddress aValueAdr, aFormulaAdr; double fTargetVal = GetDouble(); PopSingleRef( aFormulaAdr ); @@ -1616,7 +1608,7 @@ void ScInterpreter::ScBackSolver() { ScBaseCell* pVCell = GetCell( aValueAdr ); // CELLTYPE_NOTE: kein Value aber von Formel referiert - BOOL bTempCell = (!pVCell || pVCell->GetCellType() == CELLTYPE_NOTE); + sal_Bool bTempCell = (!pVCell || pVCell->GetCellType() == CELLTYPE_NOTE); ScBaseCell* pFCell = GetCell( aFormulaAdr ); if ( ((pVCell && pVCell->GetCellType() == CELLTYPE_VALUE) || bTempCell) @@ -1636,7 +1628,7 @@ void ScInterpreter::ScBackSolver() else fSaveVal = GetCellValue( aValueAdr, pVCell ); - const USHORT nMaxIter = 100; + const sal_uInt16 nMaxIter = 100; const double fEps = 1E-10; const double fDelta = 1E-6; @@ -1648,22 +1640,22 @@ void ScInterpreter::ScBackSolver() ScValueCell* pValue = (ScValueCell*) pVCell; pFormula->Interpret(); - BOOL bError = ( pFormula->GetErrCode() != 0 ); + sal_Bool bError = ( pFormula->GetErrCode() != 0 ); // bError always corresponds with fF fFPrev = pFormula->GetValue() - fTargetVal; fBestF = fabs( fFPrev ); if ( fBestF < fDelta ) - bDoneIteration = TRUE; + bDoneIteration = sal_True; double fX = fXPrev + fEps; double fF = fFPrev; double fSlope; - USHORT nIter = 0; + sal_uInt16 nIter = 0; - BOOL bHorMoveError = FALSE; + sal_Bool bHorMoveError = false; // Nach der Regula Falsi Methode while ( !bDoneIteration && ( nIter++ < nMaxIter ) ) { @@ -1681,18 +1673,18 @@ void ScInterpreter::ScBackSolver() // may become zero which ultimately causes the goal seek operation // to fail. #i28955# - USHORT nHorIter = 0; + sal_uInt16 nHorIter = 0; const double fHorStepAngle = 5.0; const double fHorMaxAngle = 80.0; int nHorMaxIter = static_cast<int>( fHorMaxAngle / fHorStepAngle ); - BOOL bDoneHorMove = FALSE; + sal_Bool bDoneHorMove = false; while ( !bDoneHorMove && !bHorMoveError && nHorIter++ < nHorMaxIter ) { double fHorAngle = fHorStepAngle * static_cast<double>( nHorIter ); double fHorTangent = ::rtl::math::tan( fHorAngle * F_PI / 180 ); - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; while( nIdx++ < 2 && !bDoneHorMove ) { double fHorX; @@ -1712,12 +1704,12 @@ void ScInterpreter::ScBackSolver() if ( fF != fFPrev ) { fX = fHorX; - bDoneHorMove = TRUE; + bDoneHorMove = sal_True; } } } if ( !bDoneHorMove ) - bHorMoveError = TRUE; + bHorMoveError = sal_True; } if ( bError ) @@ -1734,7 +1726,7 @@ void ScInterpreter::ScBackSolver() { // converged to root fBestX = fX; - bDoneIteration = TRUE; + bDoneIteration = sal_True; } else { @@ -2065,7 +2057,7 @@ void ScInterpreter::ScCurrent() void ScInterpreter::ScStyle() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScStyle" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (nParamCount >= 1 && nParamCount <= 3) { String aStyle2; // Vorlage nach Timer @@ -2103,10 +2095,10 @@ void ScInterpreter::ScStyle() } ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, - const String& rA, const String& rT, const String& rI, BYTE nM ) + const String& rA, const String& rT, const String& rI, sal_uInt8 nM ) { - USHORT nCount = pLinkMgr->GetLinks().Count(); - for (USHORT i=0; i<nCount; i++ ) + sal_uInt16 nCount = pLinkMgr->GetLinks().Count(); + for (sal_uInt16 i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i]; if (pBase->ISA(ScDdeLink)) @@ -2129,12 +2121,12 @@ void ScInterpreter::ScDde() // Applikation, Datei, Bereich // Application, Topic, Item - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { - BYTE nMode = SC_DDE_DEFAULT; + sal_uInt8 nMode = SC_DDE_DEFAULT; if (nParamCount == 4) - nMode = (BYTE) ::rtl::math::approxFloor(GetDouble()); + nMode = (sal_uInt8) ::rtl::math::approxFloor(GetDouble()); String aItem = GetString(); String aTopic = GetString(); String aAppl = GetString(); @@ -2160,8 +2152,8 @@ void ScInterpreter::ScDde() // solange der Link nicht ausgewertet ist, Idle abklemmen // (um zirkulaere Referenzen zu vermeiden) - BOOL bOldDis = pDok->IsIdleDisabled(); - pDok->DisableIdle( TRUE ); + sal_Bool bOldDis = pDok->IsIdleDisabled(); + pDok->DisableIdle( sal_True ); // Link-Objekt holen / anlegen @@ -2170,7 +2162,7 @@ void ScInterpreter::ScDde() //! Dde-Links (zusaetzlich) effizienter am Dokument speichern !!!!! // ScDdeLink* pLink = pDok->GetDdeLink( aAppl, aTopic, aItem ); - BOOL bWasError = ( pMyFormulaCell->GetRawError() != 0 ); + sal_Bool bWasError = ( pMyFormulaCell->GetRawError() != 0 ); if (!pLink) { @@ -2227,7 +2219,7 @@ void ScInterpreter::ScDde() void ScInterpreter::ScBase() { // Value, Base [, MinLen] - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { static const sal_Unicode pDigits[] = { @@ -2270,10 +2262,10 @@ void ScInterpreter::ScBase() } sal_Unicode* p = pBuf + nBuf - 1; *p = 0; - if ( fVal <= (ULONG)(~0) ) + if ( fVal <= (sal_uLong)(~0) ) { - ULONG nVal = (ULONG) fVal; - ULONG nBase = (ULONG) fBase; + sal_uLong nVal = (sal_uLong) fVal; + sal_uLong nBase = (sal_uLong) fBase; while ( nVal && p > pBuf ) { *--p = pDigits[ nVal % nBase ]; @@ -2283,7 +2275,7 @@ void ScInterpreter::ScBase() } else { - BOOL bDirt = FALSE; + sal_Bool bDirt = false; while ( fVal && p > pBuf ) { //! mit fmod Rundungsfehler ab 2**48 @@ -2313,7 +2305,7 @@ void ScInterpreter::ScBase() size_t nDig; if ( fVal < fMult ) { // da ist was gekippt - bDirt = TRUE; + bDirt = sal_True; nDig = 0; } else @@ -2321,7 +2313,7 @@ void ScInterpreter::ScBase() double fDig = ::rtl::math::approxFloor( ::rtl::math::approxSub( fVal, fMult ) ); if ( bDirt ) { - bDirt = FALSE; + bDirt = false; --fDig; } if ( fDig <= 0.0 ) @@ -2434,7 +2426,7 @@ void ScInterpreter::ScConvert() void ScInterpreter::ScRoman() { // Value [Mode] - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if( MustHaveParamCount( nParamCount, 1, 2 ) ) { double fMode = (nParamCount == 2) ? ::rtl::math::approxFloor( GetDouble() ) : 0.0; @@ -2444,22 +2436,22 @@ void ScInterpreter::ScRoman() else if( (fMode >= 0.0) && (fMode < 5.0) && (fVal >= 0.0) && (fVal < 4000.0) ) { static const sal_Unicode pChars[] = { 'M', 'D', 'C', 'L', 'X', 'V', 'I' }; - static const USHORT pValues[] = { 1000, 500, 100, 50, 10, 5, 1 }; - static const USHORT nMaxIndex = (USHORT)(SAL_N_ELEMENTS(pValues) - 1); + static const sal_uInt16 pValues[] = { 1000, 500, 100, 50, 10, 5, 1 }; + static const sal_uInt16 nMaxIndex = (sal_uInt16)(SAL_N_ELEMENTS(pValues) - 1); String aRoman; - USHORT nVal = (USHORT) fVal; - USHORT nMode = (USHORT) fMode; + sal_uInt16 nVal = (sal_uInt16) fVal; + sal_uInt16 nMode = (sal_uInt16) fMode; - for( UINT16 i = 0; i <= nMaxIndex / 2; i++ ) + for( sal_uInt16 i = 0; i <= nMaxIndex / 2; i++ ) { - USHORT nIndex = 2 * i; - USHORT nDigit = nVal / pValues[ nIndex ]; + sal_uInt16 nIndex = 2 * i; + sal_uInt16 nDigit = nVal / pValues[ nIndex ]; if( (nDigit % 5) == 4 ) { - USHORT nIndex2 = (nDigit == 4) ? nIndex - 1 : nIndex - 2; - USHORT nSteps = 0; + sal_uInt16 nIndex2 = (nDigit == 4) ? nIndex - 1 : nIndex - 2; + sal_uInt16 nSteps = 0; while( (nSteps < nMode) && (nIndex < nMaxIndex) ) { nSteps++; @@ -2470,8 +2462,8 @@ void ScInterpreter::ScRoman() } aRoman += pChars[ nIndex ]; aRoman += pChars[ nIndex2 ]; - nVal = sal::static_int_cast<USHORT>( nVal + pValues[ nIndex ] ); - nVal = sal::static_int_cast<USHORT>( nVal - pValues[ nIndex2 ] ); + nVal = sal::static_int_cast<sal_uInt16>( nVal + pValues[ nIndex ] ); + nVal = sal::static_int_cast<sal_uInt16>( nVal - pValues[ nIndex2 ] ); } else { @@ -2490,21 +2482,21 @@ void ScInterpreter::ScRoman() } -BOOL lcl_GetArabicValue( sal_Unicode cChar, USHORT& rnValue, BOOL& rbIsDec ) +sal_Bool lcl_GetArabicValue( sal_Unicode cChar, sal_uInt16& rnValue, sal_Bool& rbIsDec ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBase" ); switch( cChar ) { - case 'M': rnValue = 1000; rbIsDec = TRUE; break; - case 'D': rnValue = 500; rbIsDec = FALSE; break; - case 'C': rnValue = 100; rbIsDec = TRUE; break; - case 'L': rnValue = 50; rbIsDec = FALSE; break; - case 'X': rnValue = 10; rbIsDec = TRUE; break; - case 'V': rnValue = 5; rbIsDec = FALSE; break; - case 'I': rnValue = 1; rbIsDec = TRUE; break; - default: return FALSE; + case 'M': rnValue = 1000; rbIsDec = sal_True; break; + case 'D': rnValue = 500; rbIsDec = false; break; + case 'C': rnValue = 100; rbIsDec = sal_True; break; + case 'L': rnValue = 50; rbIsDec = false; break; + case 'X': rnValue = 10; rbIsDec = sal_True; break; + case 'V': rnValue = 5; rbIsDec = false; break; + case 'I': rnValue = 1; rbIsDec = sal_True; break; + default: return false; } - return TRUE; + return sal_True; } @@ -2518,18 +2510,18 @@ void ScInterpreter::ScArabic() { aRoman.ToUpperAscii(); - USHORT nValue = 0; - USHORT nValidRest = 3999; - USHORT nCharIndex = 0; - USHORT nCharCount = aRoman.Len(); - BOOL bValid = TRUE; + sal_uInt16 nValue = 0; + sal_uInt16 nValidRest = 3999; + sal_uInt16 nCharIndex = 0; + sal_uInt16 nCharCount = aRoman.Len(); + sal_Bool bValid = sal_True; while( bValid && (nCharIndex < nCharCount) ) { - USHORT nDigit1 = 0; - USHORT nDigit2 = 0; - BOOL bIsDec1 = FALSE; - BOOL bIsDec2 = FALSE; + sal_uInt16 nDigit1 = 0; + sal_uInt16 nDigit2 = 0; + sal_Bool bIsDec1 = false; + sal_Bool bIsDec2 = false; bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex ), nDigit1, bIsDec1 ); if( bValid && (nCharIndex + 1 < nCharCount) ) bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex + 1 ), nDigit2, bIsDec2 ); @@ -2537,24 +2529,24 @@ void ScInterpreter::ScArabic() { if( nDigit1 >= nDigit2 ) { - nValue = sal::static_int_cast<USHORT>( nValue + nDigit1 ); + nValue = sal::static_int_cast<sal_uInt16>( nValue + nDigit1 ); nValidRest %= (nDigit1 * (bIsDec1 ? 5 : 2)); bValid = (nValidRest >= nDigit1); if( bValid ) - nValidRest = sal::static_int_cast<USHORT>( nValidRest - nDigit1 ); + nValidRest = sal::static_int_cast<sal_uInt16>( nValidRest - nDigit1 ); nCharIndex++; } else if( nDigit1 * 2 != nDigit2 ) { - USHORT nDiff = nDigit2 - nDigit1; - nValue = sal::static_int_cast<USHORT>( nValue + nDiff ); + sal_uInt16 nDiff = nDigit2 - nDigit1; + nValue = sal::static_int_cast<sal_uInt16>( nValue + nDiff ); bValid = (nValidRest >= nDiff); if( bValid ) nValidRest = nDigit1 - 1; nCharIndex += 2; } else - bValid = FALSE; + bValid = false; } } if( bValid ) @@ -2568,7 +2560,7 @@ void ScInterpreter::ScArabic() void ScInterpreter::ScHyperLink() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScHyperLink" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { double fVal = 0.0; @@ -2597,7 +2589,7 @@ void ScInterpreter::ScHyperLink() nResultType = SC_MATVAL_EMPTY; else { - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); if (nErr) SetError( nErr); else if (HasCellValueData( pCell)) @@ -2650,7 +2642,7 @@ void ScInterpreter::ScHyperLink() } -BOOL lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) +sal_Bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) { struct ConvertInfo { @@ -2684,14 +2676,14 @@ BOOL lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) { rfRate = aConvertTable[i].fRate; rnDec = aConvertTable[i].nDec; - return TRUE; + return sal_True; } - return FALSE; + return false; } void ScInterpreter::ScEuroConvert() { //Value, FromUnit, ToUnit[, FullPrecision, [TriangulationPrecision]] - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 5 ) ) { double nPrecision = 0.0; @@ -2704,7 +2696,7 @@ void ScInterpreter::ScEuroConvert() return; } } - BOOL bFullPrecision = FALSE; + sal_Bool bFullPrecision = false; if ( nParamCount >= 4 ) bFullPrecision = GetBool(); String aToUnit( GetString() ); @@ -2875,7 +2867,7 @@ void lclAppendBlock( ByteString& rText, sal_Int32 nValue ) void ScInterpreter::ScBahtText() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBahtText" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1 ) ) { double fValue = GetDouble(); @@ -2944,7 +2936,7 @@ void ScInterpreter::ScBahtText() void ScInterpreter::ScGetPivotData() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetPivotData" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 30 ) ) { @@ -2971,14 +2963,14 @@ void ScInterpreter::ScGetPivotData() { // new syntax: separate name/value pairs - USHORT nFilterCount = nParamCount / 2 - 1; + sal_uInt16 nFilterCount = nParamCount / 2 - 1; aFilters.resize( nFilterCount ); - USHORT i = nFilterCount; + sal_uInt16 i = nFilterCount; while( i-- > 0 ) { //! should allow numeric constraint values - aFilters[i].mbValIsStr = TRUE; + aFilters[i].mbValIsStr = sal_True; aFilters[i].maValStr = GetString(); aFilters[i].maFieldName = GetString(); diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 60f944666342..3eec9942195f 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -210,7 +210,7 @@ double ScInterpreter::integralPhi(double x) return 0.5 * ::rtl::math::erfc(-x * 0.7071067811865475); // * 1/sqrt(2) } -double ScInterpreter::taylor(double* pPolynom, USHORT nMax, double x) +double ScInterpreter::taylor(double* pPolynom, sal_uInt16 nMax, double x) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::taylor" ); double nVal = pPolynom[nMax]; @@ -249,7 +249,7 @@ double ScInterpreter::gauss(double x) double asympt[] = { -1.0, 1.0, -3.0, 15.0, -105.0 }; double xAbs = fabs(x); - USHORT xShort = (USHORT)::rtl::math::approxFloor(xAbs); + sal_uInt16 xShort = (sal_uInt16)::rtl::math::approxFloor(xAbs); double nVal = 0.0; if (xShort == 0) nVal = taylor(t0, 11, (xAbs * xAbs)) * xAbs; @@ -722,7 +722,7 @@ double ScInterpreter::GetChiSqDistPDF(double fX, double fDF) void ScInterpreter::ScChiSqDist() { - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return; bool bCumulative; @@ -1008,7 +1008,7 @@ double ScInterpreter::GetBetaDist(double fXin, double fAlpha, double fBeta) void ScInterpreter::ScBetaDist() { - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 6 ) ) // expanded, see #i91547# return; double fLowerBound, fUpperBound; @@ -1144,7 +1144,7 @@ void ScInterpreter::ScVariationen() else { double nVal = n; - for (ULONG i = (ULONG)k-1; i >= 1; i--) + for (sal_uLong i = (sal_uLong)k-1; i >= 1; i--) nVal *= n-(double)i; PushDouble(nVal); } @@ -1168,7 +1168,7 @@ void ScInterpreter::ScVariationen2() void ScInterpreter::ScB() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScB" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 4 ) ) return ; if (nParamCount == 3) @@ -1189,16 +1189,16 @@ void ScInterpreter::ScB() PushNoValue(); else { - ULONG max = (ULONG) (n - x); - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) (n - x); + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*q/p; PushDouble(fFactor); } } else { - ULONG max = (ULONG) x; - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) x; + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*p/q; PushDouble(fFactor); } @@ -1233,16 +1233,16 @@ void ScInterpreter::ScB() else { double fSum = 0.0; - ULONG max; - if (xe < (ULONG) n) - max = (ULONG) (n-xe)-1; + sal_uLong max; + if (xe < (sal_uLong) n) + max = (sal_uLong) (n-xe)-1; else max = 0; - ULONG i; + sal_uLong i; for (i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*q/p; - if (xs < (ULONG) n) - max = (ULONG) (n-xs); + if (xs < (sal_uLong) n) + max = (sal_uLong) (n-xs); else fSum = fFactor; for (; i < max && fFactor > 0.0; i++) @@ -1255,25 +1255,25 @@ void ScInterpreter::ScB() } else { - ULONG max; + sal_uLong max; double fSum; - if ( (ULONG) xs == 0) + if ( (sal_uLong) xs == 0) { fSum = fFactor; max = 0; } else { - max = (ULONG) xs-1; + max = (sal_uLong) xs-1; fSum = 0.0; } - ULONG i; + sal_uLong i; for (i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*p/q; - if ((ULONG)xe == 0) // beide 0 + if ((sal_uLong)xe == 0) // beide 0 fSum = fFactor; else - max = (ULONG) xe; + max = (sal_uLong) xe; for (; i < max && fFactor > 0.0; i++) { fFactor *= (n-i)/(i+1)*p/q; @@ -1322,16 +1322,16 @@ void ScInterpreter::ScBinomDist() PushNoValue(); else { - ULONG max = (ULONG) (n - x); - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) (n - x); + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*q/p; PushDouble(fFactor); } } else { - ULONG max = (ULONG) x; - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) x; + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) fFactor *= (n-i)/(i+1)*p/q; PushDouble(fFactor); } @@ -1353,8 +1353,8 @@ void ScInterpreter::ScBinomDist() else { fSum = 1.0 - fFactor; - ULONG max = (ULONG) (n - x) - 1; - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) (n - x) - 1; + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) { fFactor *= (n-i)/(i+1)*q/p; fSum -= fFactor; @@ -1368,8 +1368,8 @@ void ScInterpreter::ScBinomDist() else { fSum = fFactor; - ULONG max = (ULONG) x; - for (ULONG i = 0; i < max && fFactor > 0.0; i++) + sal_uLong max = (sal_uLong) x; + for (sal_uLong i = 0; i < max && fFactor > 0.0; i++) { fFactor *= (n-i)/(i+1)*p/q; fSum += fFactor; @@ -1402,8 +1402,8 @@ void ScInterpreter::ScCritBinom() PushNoValue(); else { - double fSum = 1.0 - fFactor; ULONG max = (ULONG) n; - ULONG i; + double fSum = 1.0 - fFactor; sal_uLong max = (sal_uLong) n; + sal_uLong i; for ( i = 0; i < max && fSum >= alpha; i++) { @@ -1415,8 +1415,8 @@ void ScInterpreter::ScCritBinom() } else { - double fSum = fFactor; ULONG max = (ULONG) n; - ULONG i; + double fSum = fFactor; sal_uLong max = (sal_uLong) n; + sal_uLong i; for ( i = 0; i < max && fSum < alpha; i++) { @@ -1453,7 +1453,7 @@ void ScInterpreter::ScNegBinomDist() void ScInterpreter::ScNormDist() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScNormDist" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 4)) return; bool bCumulative = nParamCount == 4 ? GetBool() : true; @@ -1474,7 +1474,7 @@ void ScInterpreter::ScNormDist() void ScInterpreter::ScLogNormDist() //expanded, see #i100119# { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLogNormDist" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 1, 4)) return; bool bCumulative = nParamCount == 4 ? GetBool() : true; // cumulative @@ -1615,7 +1615,7 @@ void ScInterpreter::ScWeibull() void ScInterpreter::ScPoissonDist() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPoissonDist" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { bool bCumulative = (nParamCount == 3 ? GetBool() : true); // default cumulative @@ -1917,7 +1917,7 @@ void ScInterpreter::ScHypGeomDist() void ScInterpreter::ScGammaDist() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGammaDist" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 4 ) ) return; double bCumulative; @@ -2037,7 +2037,7 @@ public: void ScInterpreter::ScBetaInv() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBetaInv" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) return; double fP, fA, fB, fAlpha, fBeta; @@ -2227,7 +2227,7 @@ void ScInterpreter::ScConfidence() void ScInterpreter::ScZTest() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScZTest" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return; double sigma = 0.0, mue, x; @@ -2278,7 +2278,7 @@ void ScInterpreter::ScZTest() while (nParam-- > 0) { ScRange aRange; - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParam, nRefInList); ScValueIterator aValIter(pDok, aRange, glSubTotal); if (aValIter.GetFirst(fVal, nErr)) @@ -2345,7 +2345,7 @@ void ScInterpreter::ScZTest() PushDouble(0.5 - gauss((mue-x)*sqrt(rValCount)/sigma)); } } -bool ScInterpreter::CalculateTest(BOOL _bTemplin +bool ScInterpreter::CalculateTest(sal_Bool _bTemplin ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2 ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2 ,double& fT,double& fF) @@ -2475,11 +2475,11 @@ void ScInterpreter::ScTTest() } else if (fTyp == 2.0) { - CalculateTest(FALSE,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF); + CalculateTest(false,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF); } else if (fTyp == 3.0) { - CalculateTest(TRUE,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF); + CalculateTest(sal_True,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF); } else @@ -2708,7 +2708,7 @@ void ScInterpreter::ScHarMean() case formula::svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); double nCellVal; ScValueIterator aValIter(pDok, aRange, glSubTotal); @@ -2831,7 +2831,7 @@ void ScInterpreter::ScGeoMean() case formula::svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); double nCellVal; ScValueIterator aValIter(pDok, aRange, glSubTotal); @@ -2967,7 +2967,7 @@ bool ScInterpreter::CalculateSkew(double& fSum,double& fCount,double& vSum,std:: case svRefList : { PopDoubleRef( aRange, nParamCount, nRefInList); - USHORT nErr = 0; + sal_uInt16 nErr = 0; ScValueIterator aValIter(pDok, aRange); if (aValIter.GetFirst(fVal, nErr)) { @@ -3091,7 +3091,7 @@ double ScInterpreter::GetMedian( vector<double> & rArray ) void ScInterpreter::ScMedian() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMedian" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCountMin( nParamCount, 1 ) ) return; vector<double> aArray; @@ -3165,7 +3165,7 @@ void ScInterpreter::ScQuartile() void ScInterpreter::ScModalValue() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScModalValue" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCountMin( nParamCount, 1 ) ) return; vector<double> aSortArray; @@ -3208,7 +3208,7 @@ void ScInterpreter::ScModalValue() } } -void ScInterpreter::CalculateSmallLarge(BOOL bSmall) +void ScInterpreter::CalculateSmallLarge(sal_Bool bSmall) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateSmallLarge" ); if ( !MustHaveParamCount( GetByte(), 2 ) ) @@ -3241,19 +3241,19 @@ void ScInterpreter::CalculateSmallLarge(BOOL bSmall) void ScInterpreter::ScLarge() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLarge" ); - CalculateSmallLarge(FALSE); + CalculateSmallLarge(false); } void ScInterpreter::ScSmall() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSmall" ); - CalculateSmallLarge(TRUE); + CalculateSmallLarge(sal_True); } void ScInterpreter::ScPercentrank() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPercentrank" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2 ) ) return; @@ -3328,7 +3328,7 @@ void ScInterpreter::ScTrimMean() PushNoValue(); else { - ULONG nIndex = (ULONG) ::rtl::math::approxFloor(alpha*(double)nSize); + sal_uLong nIndex = (sal_uLong) ::rtl::math::approxFloor(alpha*(double)nSize); if (nIndex % 2 != 0) nIndex--; nIndex /= 2; @@ -3340,7 +3340,7 @@ void ScInterpreter::ScTrimMean() } } -void ScInterpreter::GetNumberSequenceArray( BYTE nParamCount, vector<double>& rArray ) +void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double>& rArray ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetSortArray" ); ScAddress aAdr; @@ -3374,7 +3374,7 @@ void ScInterpreter::GetNumberSequenceArray( BYTE nParamCount, vector<double>& rA nCellCount *= aRange.aEnd.Row() - aRange.aStart.Row() + 1; rArray.reserve( rArray.size() + nCellCount); - USHORT nErr = 0; + sal_uInt16 nErr = 0; double fCellVal; ScValueIterator aValIter(pDok, aRange); if (aValIter.GetFirst( fCellVal, nErr)) @@ -3424,7 +3424,7 @@ void ScInterpreter::GetNumberSequenceArray( BYTE nParamCount, vector<double>& rA PopError(); } -void ScInterpreter::GetSortArray( BYTE nParamCount, vector<double>& rSortArray, vector<long>* pIndexOrder ) +void ScInterpreter::GetSortArray( sal_uInt8 nParamCount, vector<double>& rSortArray, vector<long>* pIndexOrder ) { GetNumberSequenceArray( nParamCount, rSortArray); @@ -3519,16 +3519,16 @@ void ScInterpreter::QuickSort( vector<double>& rSortArray, vector<long>* pIndexO void ScInterpreter::ScRank() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRank" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return; - BOOL bDescending; + sal_Bool bDescending; if (nParamCount == 3) bDescending = GetBool(); else - bDescending = FALSE; + bDescending = false; double fCount = 1.0; - BOOL bValid = FALSE; + sal_Bool bValid = false; switch (GetStackType()) { case formula::svDouble : @@ -3536,7 +3536,7 @@ void ScInterpreter::ScRank() double x = GetDouble(); double fVal = GetDouble(); if (x == fVal) - bValid = TRUE; + bValid = sal_True; break; } case svSingleRef : @@ -3549,7 +3549,7 @@ void ScInterpreter::ScRank() { double x = GetCellValue( aAdr, pCell ); if (x == fVal) - bValid = TRUE; + bValid = sal_True; } break; } @@ -3561,9 +3561,9 @@ void ScInterpreter::ScRank() size_t nRefInList = 0; while (nParam-- > 0) { - USHORT nErr = 0; + sal_uInt16 nErr = 0; // Preserve stack until all RefList elements are done! - USHORT nSaveSP = sp; + sal_uInt16 nSaveSP = sp; PopDoubleRef( aRange, nParam, nRefInList); if (nParam) --sp; // simulate pop @@ -3575,7 +3575,7 @@ void ScInterpreter::ScRank() if (aValIter.GetFirst(nCellVal, nErr)) { if (nCellVal == fVal) - bValid = TRUE; + bValid = sal_True; else if ((!bDescending && nCellVal > fVal) || (bDescending && nCellVal < fVal) ) fCount++; @@ -3583,7 +3583,7 @@ void ScInterpreter::ScRank() while ((nErr == 0) && aValIter.GetNext(nCellVal, nErr)) { if (nCellVal == fVal) - bValid = TRUE; + bValid = sal_True; else if ((!bDescending && nCellVal > fVal) || (bDescending && nCellVal < fVal) ) fCount++; @@ -3608,7 +3608,7 @@ void ScInterpreter::ScRank() { double x = pMat->GetDouble(i); if (x == fVal) - bValid = TRUE; + bValid = sal_True; else if ((!bDescending && x > fVal) || (bDescending && x < fVal) ) fCount++; @@ -3621,7 +3621,7 @@ void ScInterpreter::ScRank() { double x = pMat->GetDouble(i); if (x == fVal) - bValid = TRUE; + bValid = sal_True; else if ((!bDescending && x > fVal) || (bDescending && x < fVal) ) fCount++; @@ -3641,10 +3641,10 @@ void ScInterpreter::ScRank() void ScInterpreter::ScAveDev() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAveDev" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCountMin( nParamCount, 1 ) ) return; - USHORT SaveSP = sp; + sal_uInt16 SaveSP = sp; double nMiddle = 0.0; double rVal = 0.0; double rValCount = 0.0; @@ -3674,7 +3674,7 @@ void ScInterpreter::ScAveDev() case formula::svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; double nCellVal; PopDoubleRef( aRange, nParam, nRefInList); ScValueIterator aValIter(pDok, aRange); @@ -3753,7 +3753,7 @@ void ScInterpreter::ScAveDev() case formula::svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; double nCellVal; PopDoubleRef( aRange, nParam, nRefInList); ScValueIterator aValIter(pDok, aRange); @@ -3809,7 +3809,7 @@ void ScInterpreter::ScDevSq() void ScInterpreter::ScProbability() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScProbability" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 3, 4 ) ) return; double fUp, fLo; @@ -3841,7 +3841,7 @@ void ScInterpreter::ScProbability() { double fSum = 0.0; double fRes = 0.0; - BOOL bStop = FALSE; + sal_Bool bStop = false; double fP, fW; for ( SCSIZE i = 0; i < nC1 && !bStop; i++ ) { @@ -3852,7 +3852,7 @@ void ScInterpreter::ScProbability() fP = pMatP->GetDouble(i,j); fW = pMatW->GetDouble(i,j); if (fP < 0.0 || fP > 1.0) - bStop = TRUE; + bStop = true; else { fSum += fP; @@ -3882,15 +3882,15 @@ void ScInterpreter::ScCorrel() void ScInterpreter::ScCovar() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCovar" ); - CalculatePearsonCovar(FALSE,FALSE); + CalculatePearsonCovar(false,false); } void ScInterpreter::ScPearson() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPearson" ); - CalculatePearsonCovar(TRUE,FALSE); + CalculatePearsonCovar(sal_True,false); } -void ScInterpreter::CalculatePearsonCovar(BOOL _bPearson,BOOL _bStexy) +void ScInterpreter::CalculatePearsonCovar(sal_Bool _bPearson,sal_Bool _bStexy) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculatePearsonCovar" ); if ( !MustHaveParamCount( GetByte(), 2 ) ) @@ -4001,9 +4001,9 @@ void ScInterpreter::ScRSQ() void ScInterpreter::ScSTEXY() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSTEXY" ); - CalculatePearsonCovar(TRUE,TRUE); + CalculatePearsonCovar(true,true); } -void ScInterpreter::CalculateSlopeIntercept(BOOL bSlope) +void ScInterpreter::CalculateSlopeIntercept(sal_Bool bSlope) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateSlopeIntercept" ); if ( !MustHaveParamCount( GetByte(), 2 ) ) @@ -4078,13 +4078,13 @@ void ScInterpreter::CalculateSlopeIntercept(BOOL bSlope) void ScInterpreter::ScSlope() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSlope" ); - CalculateSlopeIntercept(TRUE); + CalculateSlopeIntercept(sal_True); } void ScInterpreter::ScIntercept() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIntercept" ); - CalculateSlopeIntercept(FALSE); + CalculateSlopeIntercept(false); } void ScInterpreter::ScForecast() diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index a7cfb71a9699..17d789b0eb56 100644..100755 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -145,11 +145,11 @@ void ScInterpreter::ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab ) } -BOOL ScInterpreter::IsTableOpInRange( const ScRange& rRange ) +sal_Bool ScInterpreter::IsTableOpInRange( const ScRange& rRange ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IsTableOpInRange" ); if ( rRange.aStart == rRange.aEnd ) - return FALSE; // not considered to be a range in TableOp sense + return false; // not considered to be a range in TableOp sense // we can't replace a single cell in a range size_t ListSize = pDok->aTableOpList.size(); @@ -157,19 +157,19 @@ BOOL ScInterpreter::IsTableOpInRange( const ScRange& rRange ) { ScInterpreterTableOpParams* pTOp = &pDok->aTableOpList[ i ]; if ( rRange.In( pTOp->aOld1 ) ) - return TRUE; + return sal_True; if ( rRange.In( pTOp->aOld2 ) ) - return TRUE; + return true; } - return FALSE; + return false; } -ULONG ScInterpreter::GetCellNumberFormat( const ScAddress& rPos, const ScBaseCell* pCell) +sal_uLong ScInterpreter::GetCellNumberFormat( const ScAddress& rPos, const ScBaseCell* pCell) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetCellNumberFormat" ); - ULONG nFormat; - USHORT nErr; + sal_uLong nFormat; + sal_uInt16 nErr; if ( pCell ) { if ( pCell->GetCellType() == CELLTYPE_FORMULA ) @@ -199,7 +199,7 @@ double ScInterpreter::GetValueCellValue( const ScAddress& rPos, const ScValueCel double fVal = pCell->GetValue(); if ( bCalcAsShown && fVal != 0.0 ) { - ULONG nFormat = pDok->GetNumberFormat( rPos ); + sal_uLong nFormat = pDok->GetNumberFormat( rPos ); fVal = pDok->RoundValueAsShown( fVal, nFormat ); } return fVal; @@ -413,7 +413,7 @@ double ScInterpreter::ConvertStringToValue( const String& rStr ) double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetCellValue" ); - USHORT nErr = nGlobalError; + sal_uInt16 nErr = nGlobalError; nGlobalError = 0; double nVal = GetCellValueOrZero( rPos, pCell ); if ( !nGlobalError || nGlobalError == errCellNoValue ) @@ -434,7 +434,7 @@ double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, const ScBaseCel case CELLTYPE_FORMULA: { ScFormulaCell* pFCell = (ScFormulaCell*) pCell; - USHORT nErr = pFCell->GetErrCode(); + sal_uInt16 nErr = pFCell->GetErrCode(); if( !nErr ) { if (pFCell->IsValue()) @@ -501,7 +501,7 @@ double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, const ScBaseCel void ScInterpreter::GetCellString( String& rStr, const ScBaseCell* pCell ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetCellString" ); - USHORT nErr = 0; + sal_uInt16 nErr = 0; if (pCell) { switch (pCell->GetCellType()) @@ -519,7 +519,7 @@ void ScInterpreter::GetCellString( String& rStr, const ScBaseCell* pCell ) if (pFCell->IsValue()) { double fVal = pFCell->GetValue(); - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GetInputLineString(fVal, nIndex, rStr); @@ -531,7 +531,7 @@ void ScInterpreter::GetCellString( String& rStr, const ScBaseCell* pCell ) case CELLTYPE_VALUE: { double fVal = ((ScValueCell*) pCell)->GetValue(); - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GetInputLineString(fVal, nIndex, rStr); @@ -548,29 +548,29 @@ void ScInterpreter::GetCellString( String& rStr, const ScBaseCell* pCell ) } -BOOL ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, BYTE* pCellArr) +sal_Bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CreateDoubleArr" ); - // Old Add-Ins are hard limited to USHORT values. + // Old Add-Ins are hard limited to sal_uInt16 values. #if MAXCOLCOUNT_DEFINE > USHRT_MAX #error Add check for columns > USHRT_MAX! #endif if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) - return FALSE; - - USHORT nCount = 0; - USHORT* p = (USHORT*) pCellArr; - *p++ = static_cast<USHORT>(nCol1); - *p++ = static_cast<USHORT>(nRow1); - *p++ = static_cast<USHORT>(nTab1); - *p++ = static_cast<USHORT>(nCol2); - *p++ = static_cast<USHORT>(nRow2); - *p++ = static_cast<USHORT>(nTab2); - USHORT* pCount = p; + return false; + + sal_uInt16 nCount = 0; + sal_uInt16* p = (sal_uInt16*) pCellArr; + *p++ = static_cast<sal_uInt16>(nCol1); + *p++ = static_cast<sal_uInt16>(nRow1); + *p++ = static_cast<sal_uInt16>(nTab1); + *p++ = static_cast<sal_uInt16>(nCol2); + *p++ = static_cast<sal_uInt16>(nRow2); + *p++ = static_cast<sal_uInt16>(nTab2); + sal_uInt16* pCount = p; *p++ = 0; - USHORT nPos = 14; + sal_uInt16 nPos = 14; SCTAB nTab = nTab1; ScAddress aAdr; while (nTab <= nTab2) @@ -587,9 +587,9 @@ BOOL ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScBaseCell* pCell = pDok->GetCell( aAdr ); if (pCell) { - USHORT nErr = 0; + sal_uInt16 nErr = 0; double nVal = 0.0; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; switch ( pCell->GetCellType() ) { case CELLTYPE_VALUE : @@ -602,23 +602,23 @@ BOOL ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, nVal = ((ScFormulaCell*)pCell)->GetValue(); } else - bOk = FALSE; + bOk = false; break; default : - bOk = FALSE; + bOk = false; break; } if (bOk) { - if ((nPos + (4 * sizeof(USHORT)) + sizeof(double)) > MAXARRSIZE) - return FALSE; - *p++ = static_cast<USHORT>(nCol); - *p++ = static_cast<USHORT>(nRow); - *p++ = static_cast<USHORT>(nTab); + if ((nPos + (4 * sizeof(sal_uInt16)) + sizeof(double)) > MAXARRSIZE) + return false; + *p++ = static_cast<sal_uInt16>(nCol); + *p++ = static_cast<sal_uInt16>(nRow); + *p++ = static_cast<sal_uInt16>(nTab); *p++ = nErr; memcpy( p, &nVal, sizeof(double)); nPos += 8 + sizeof(double); - p = (USHORT*) ( pCellArr + nPos ); + p = (sal_uInt16*) ( pCellArr + nPos ); nCount++; } } @@ -629,34 +629,34 @@ BOOL ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, nTab++; } *pCount = nCount; - return TRUE; + return sal_True; } -BOOL ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, +sal_Bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - BYTE* pCellArr) + sal_uInt8* pCellArr) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CreateStringArr" ); - // Old Add-Ins are hard limited to USHORT values. + // Old Add-Ins are hard limited to sal_uInt16 values. #if MAXCOLCOUNT_DEFINE > USHRT_MAX #error Add check for columns > USHRT_MAX! #endif if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) - return FALSE; - - USHORT nCount = 0; - USHORT* p = (USHORT*) pCellArr; - *p++ = static_cast<USHORT>(nCol1); - *p++ = static_cast<USHORT>(nRow1); - *p++ = static_cast<USHORT>(nTab1); - *p++ = static_cast<USHORT>(nCol2); - *p++ = static_cast<USHORT>(nRow2); - *p++ = static_cast<USHORT>(nTab2); - USHORT* pCount = p; + return false; + + sal_uInt16 nCount = 0; + sal_uInt16* p = (sal_uInt16*) pCellArr; + *p++ = static_cast<sal_uInt16>(nCol1); + *p++ = static_cast<sal_uInt16>(nRow1); + *p++ = static_cast<sal_uInt16>(nTab1); + *p++ = static_cast<sal_uInt16>(nCol2); + *p++ = static_cast<sal_uInt16>(nRow2); + *p++ = static_cast<sal_uInt16>(nTab2); + sal_uInt16* pCount = p; *p++ = 0; - USHORT nPos = 14; + sal_uInt16 nPos = 14; SCTAB nTab = nTab1; while (nTab <= nTab2) { @@ -671,8 +671,8 @@ BOOL ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, if (pCell) { String aStr; - USHORT nErr = 0; - BOOL bOk = TRUE; + sal_uInt16 nErr = 0; + sal_Bool bOk = sal_True; switch ( pCell->GetCellType() ) { case CELLTYPE_STRING : @@ -688,10 +688,10 @@ BOOL ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ((ScFormulaCell*)pCell)->GetString(aStr); } else - bOk = FALSE; + bOk = false; break; default : - bOk = FALSE; + bOk = false; break; } if (bOk) @@ -699,26 +699,26 @@ BOOL ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ByteString aTmp( aStr, osl_getThreadTextEncoding() ); // In case the xub_StrLen will be longer than USHORT // one day, and room for pad byte check. - if ( aTmp.Len() > ((USHORT)(~0)) - 2 ) - return FALSE; + if ( aTmp.Len() > ((sal_uInt16)(~0)) - 2 ) + return false; // Append a 0-pad-byte if string length is not even - //! MUST be USHORT and not xub_StrLen - USHORT nStrLen = (USHORT) aTmp.Len(); - USHORT nLen = ( nStrLen + 2 ) & ~1; - - if (((ULONG)nPos + (5 * sizeof(USHORT)) + nLen) > MAXARRSIZE) - return FALSE; - *p++ = static_cast<USHORT>(nCol); - *p++ = static_cast<USHORT>(nRow); - *p++ = static_cast<USHORT>(nTab); + //! MUST be sal_uInt16 and not xub_StrLen + sal_uInt16 nStrLen = (sal_uInt16) aTmp.Len(); + sal_uInt16 nLen = ( nStrLen + 2 ) & ~1; + + if (((sal_uLong)nPos + (5 * sizeof(sal_uInt16)) + nLen) > MAXARRSIZE) + return false; + *p++ = static_cast<sal_uInt16>(nCol); + *p++ = static_cast<sal_uInt16>(nRow); + *p++ = static_cast<sal_uInt16>(nTab); *p++ = nErr; *p++ = nLen; memcpy( p, aTmp.GetBuffer(), nStrLen + 1); nPos += 10 + nStrLen + 1; - BYTE* q = ( pCellArr + nPos ); + sal_uInt8* q = ( pCellArr + nPos ); if( !nStrLen & 1 ) *q++ = 0, nPos++; - p = (USHORT*) ( pCellArr + nPos ); + p = (sal_uInt16*) ( pCellArr + nPos ); nCount++; } } @@ -729,34 +729,34 @@ BOOL ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, nTab++; } *pCount = nCount; - return TRUE; + return sal_True; } -BOOL ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, +sal_Bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - BYTE* pCellArr) + sal_uInt8* pCellArr) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CreateCellArr" ); - // Old Add-Ins are hard limited to USHORT values. + // Old Add-Ins are hard limited to sal_uInt16 values. #if MAXCOLCOUNT_DEFINE > USHRT_MAX #error Add check for columns > USHRT_MAX! #endif if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) - return FALSE; - - USHORT nCount = 0; - USHORT* p = (USHORT*) pCellArr; - *p++ = static_cast<USHORT>(nCol1); - *p++ = static_cast<USHORT>(nRow1); - *p++ = static_cast<USHORT>(nTab1); - *p++ = static_cast<USHORT>(nCol2); - *p++ = static_cast<USHORT>(nRow2); - *p++ = static_cast<USHORT>(nTab2); - USHORT* pCount = p; + return false; + + sal_uInt16 nCount = 0; + sal_uInt16* p = (sal_uInt16*) pCellArr; + *p++ = static_cast<sal_uInt16>(nCol1); + *p++ = static_cast<sal_uInt16>(nRow1); + *p++ = static_cast<sal_uInt16>(nTab1); + *p++ = static_cast<sal_uInt16>(nCol2); + *p++ = static_cast<sal_uInt16>(nRow2); + *p++ = static_cast<sal_uInt16>(nTab2); + sal_uInt16* pCount = p; *p++ = 0; - USHORT nPos = 14; + sal_uInt16 nPos = 14; SCTAB nTab = nTab1; ScAddress aAdr; while (nTab <= nTab2) @@ -773,11 +773,11 @@ BOOL ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScBaseCell* pCell = pDok->GetCell( aAdr ); if (pCell) { - USHORT nErr = 0; - USHORT nType = 0; // 0 = Zahl; 1 = String + sal_uInt16 nErr = 0; + sal_uInt16 nType = 0; // 0 = Zahl; 1 = String double nVal = 0.0; String aStr; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; switch ( pCell->GetCellType() ) { case CELLTYPE_STRING : @@ -799,23 +799,23 @@ BOOL ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ((ScFormulaCell*)pCell)->GetString(aStr); break; default : - bOk = FALSE; + bOk = false; break; } if (bOk) { - if ((nPos + (5 * sizeof(USHORT))) > MAXARRSIZE) - return FALSE; - *p++ = static_cast<USHORT>(nCol); - *p++ = static_cast<USHORT>(nRow); - *p++ = static_cast<USHORT>(nTab); + if ((nPos + (5 * sizeof(sal_uInt16))) > MAXARRSIZE) + return false; + *p++ = static_cast<sal_uInt16>(nCol); + *p++ = static_cast<sal_uInt16>(nRow); + *p++ = static_cast<sal_uInt16>(nTab); *p++ = nErr; *p++ = nType; nPos += 10; if (nType == 0) { if ((nPos + sizeof(double)) > MAXARRSIZE) - return FALSE; + return false; memcpy( p, &nVal, sizeof(double)); nPos += sizeof(double); } @@ -824,23 +824,23 @@ BOOL ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ByteString aTmp( aStr, osl_getThreadTextEncoding() ); // In case the xub_StrLen will be longer than USHORT // one day, and room for pad byte check. - if ( aTmp.Len() > ((USHORT)(~0)) - 2 ) - return FALSE; + if ( aTmp.Len() > ((sal_uInt16)(~0)) - 2 ) + return false; // Append a 0-pad-byte if string length is not even - //! MUST be USHORT and not xub_StrLen - USHORT nStrLen = (USHORT) aTmp.Len(); - USHORT nLen = ( nStrLen + 2 ) & ~1; - if ( ((ULONG)nPos + 2 + nLen) > MAXARRSIZE) - return FALSE; + //! MUST be sal_uInt16 and not xub_StrLen + sal_uInt16 nStrLen = (sal_uInt16) aTmp.Len(); + sal_uInt16 nLen = ( nStrLen + 2 ) & ~1; + if ( ((sal_uLong)nPos + 2 + nLen) > MAXARRSIZE) + return false; *p++ = nLen; memcpy( p, aTmp.GetBuffer(), nStrLen + 1); nPos += 2 + nStrLen + 1; - BYTE* q = ( pCellArr + nPos ); + sal_uInt8* q = ( pCellArr + nPos ); if( !nStrLen & 1 ) *q++ = 0, nPos++; } nCount++; - p = (USHORT*) ( pCellArr + nPos ); + p = (sal_uInt16*) ( pCellArr + nPos ); } } nCol++; @@ -850,7 +850,7 @@ BOOL ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, nTab++; } *pCount = nCount; - return TRUE; + return sal_True; } @@ -966,7 +966,7 @@ void ScInterpreter::PushTempToken( const FormulaToken& r ) void ScInterpreter::PushCellResultToken( bool bDisplayEmptyAsString, - const ScAddress & rAddress, short * pRetTypeExpr, ULONG * pRetIndexExpr ) + const ScAddress & rAddress, short * pRetTypeExpr, sal_uLong * pRetIndexExpr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PushCellResultToken" ); ScBaseCell* pCell = pDok->GetCell( rAddress); @@ -978,7 +978,7 @@ void ScInterpreter::PushCellResultToken( bool bDisplayEmptyAsString, PushTempToken( new ScEmptyCellToken( bInherited, bDisplayEmptyAsString)); return; } - USHORT nErr; + sal_uInt16 nErr; if ((nErr = pCell->GetErrorCode()) != 0) { PushError( nErr); @@ -1228,7 +1228,7 @@ void ScInterpreter::PopSingleRef( ScAddress& rAdr ) void ScInterpreter::DoubleRefToVars( const ScToken* p, SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, - BOOL bDontCheckForTableOp ) + sal_Bool bDontCheckForTableOp ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::DoubleRefToVars" ); const ScComplexRefData& rCRef = p->GetDoubleRef(); @@ -1283,7 +1283,7 @@ ScDBRangeBase* ScInterpreter::PopDBDoubleRef() void ScInterpreter::PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, - BOOL bDontCheckForTableOp ) + sal_Bool bDontCheckForTableOp ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PopDoubleRef" ); if( sp ) @@ -1309,7 +1309,7 @@ void ScInterpreter::PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, void ScInterpreter::DoubleRefToRange( const ScComplexRefData & rCRef, - ScRange & rRange, BOOL bDontCheckForTableOp ) + ScRange & rRange, sal_Bool bDontCheckForTableOp ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::DoubleRefToRange" ); SCCOL nCol; @@ -1374,7 +1374,7 @@ void ScInterpreter::PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRe } -void ScInterpreter::PopDoubleRef( ScRange& rRange, BOOL bDontCheckForTableOp ) +void ScInterpreter::PopDoubleRef( ScRange& rRange, sal_Bool bDontCheckForTableOp ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PopDoubleRef" ); if( sp ) @@ -1563,7 +1563,7 @@ void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) rMat = p->GetMatrix(); } -BOOL ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) +sal_Bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PopDoubleRefOrSingleRef" ); switch ( GetStackType() ) @@ -1571,19 +1571,19 @@ BOOL ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) case svDoubleRef : { ScRange aRange; - PopDoubleRef( aRange, TRUE ); + PopDoubleRef( aRange, sal_True ); return DoubleRefToPosSingleRef( aRange, rAdr ); } case svSingleRef : { PopSingleRef( rAdr ); - return TRUE; + return sal_True; } default: PopError(); SetError( errNoRef ); } - return FALSE; + return false; } @@ -1613,10 +1613,10 @@ ScTokenMatrixMap* ScInterpreter::CreateTokenMatrixMap() bool ScInterpreter::ConvertMatrixParameters() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ConvertMatrixParameters" ); - USHORT nParams = pCur->GetParamCount(); + sal_uInt16 nParams = pCur->GetParamCount(); DBG_ASSERT( nParams <= sp, "ConvertMatrixParameters: stack/param count mismatch"); SCSIZE nJumpCols = 0, nJumpRows = 0; - for ( USHORT i=1; i <= nParams && i <= sp; ++i ) + for ( sal_uInt16 i=1; i <= nParams && i <= sp; ++i ) { FormulaToken* p = pStack[ sp - i ]; if ( p->GetOpCode() != ocPush && p->GetOpCode() != ocMissing) @@ -1721,7 +1721,7 @@ bool ScInterpreter::ConvertMatrixParameters() pJumpMat->SetAllJumps( 1.0, nStart, nNext, nStop); // pop parameters and store in ScJumpMatrix, push in JumpMatrix() ScTokenVec* pParams = new ScTokenVec( nParams); - for ( USHORT i=1; i <= nParams && sp > 0; ++i ) + for ( sal_uInt16 i=1; i <= nParams && sp > 0; ++i ) { FormulaToken* p = pStack[ --sp ]; p->IncRef(); @@ -1772,7 +1772,7 @@ ScMatrixRef ScInterpreter::PopMatrix() return NULL; } -void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, ULONG& rRetIndexExpr) +void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_uLong& rRetIndexExpr) { if (xMat) { @@ -1796,7 +1796,7 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, ULON } else { - USHORT nErr = GetDoubleErrorValue( nMatVal.fVal); + sal_uInt16 nErr = GetDoubleErrorValue( nMatVal.fVal); FormulaTokenRef xRes; if (nErr) xRes = new FormulaErrorToken( nErr); @@ -1930,7 +1930,7 @@ void ScInterpreter::PushMatrix(const ScMatrixRef& pMat) } -void ScInterpreter::PushError( USHORT nError ) +void ScInterpreter::PushError( sal_uInt16 nError ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PushError" ); SetError( nError ); // only sets error if not already set @@ -1972,7 +1972,7 @@ void ScInterpreter::PushNoValue() } -BOOL ScInterpreter::IsMissing() +sal_Bool ScInterpreter::IsMissing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IsMissing" ); return sp && pStack[sp - 1]->GetType() == svMissing; @@ -2015,7 +2015,7 @@ StackVar ScInterpreter::GetStackType() } -StackVar ScInterpreter::GetStackType( BYTE nParam ) +StackVar ScInterpreter::GetStackType( sal_uInt8 nParam ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetStackType" ); StackVar eRes; @@ -2031,17 +2031,17 @@ StackVar ScInterpreter::GetStackType( BYTE nParam ) } -BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr ) +sal_Bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::DoubleRefToPosSingleRef" ); // Check for a singleton first - no implicit intersection for them. if( rRange.aStart == rRange.aEnd ) { rAdr = rRange.aStart; - return TRUE; + return sal_True; } - BOOL bOk = FALSE; + sal_Bool bOk = false; if ( pJumpMatrix ) { @@ -2076,13 +2076,13 @@ BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r nRow = rRange.aStart.Row(); if ( nRow == rRange.aEnd.Row() ) { - bOk = TRUE; + bOk = sal_True; nCol = nMyCol; } else if ( nTab != nMyTab && nTab == rRange.aEnd.Tab() && rRange.aStart.Row() <= nMyRow && nMyRow <= rRange.aEnd.Row() ) { - bOk = TRUE; + bOk = sal_True; nCol = nMyCol; nRow = nMyRow; } @@ -2092,13 +2092,13 @@ BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r nCol = rRange.aStart.Col(); if ( nCol == rRange.aEnd.Col() ) { - bOk = TRUE; + bOk = sal_True; nRow = nMyRow; } else if ( nTab != nMyTab && nTab == rRange.aEnd.Tab() && rRange.aStart.Col() <= nMyCol && nMyCol <= rRange.aEnd.Col() ) { - bOk = TRUE; + bOk = sal_True; nCol = nMyCol; nRow = nMyRow; } @@ -2110,7 +2110,7 @@ BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r else if ( nTab <= nMyTab && nMyTab <= rRange.aEnd.Tab() ) nTab = nMyTab; else - bOk = FALSE; + bOk = false; if ( bOk ) rAdr.Set( nCol, nRow, nTab ); } @@ -2241,7 +2241,7 @@ const String& ScInterpreter::GetString() case svDouble: { double fVal = PopDouble(); - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GetInputLineString(fVal, nIndex, aTempStr); @@ -2393,7 +2393,7 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble, void ScInterpreter::ScDBGet() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBGet" ); - BOOL bMissingField = FALSE; + sal_Bool bMissingField = false; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (!pQueryParam.get()) { @@ -2430,8 +2430,8 @@ void ScInterpreter::ScDBGet() void ScInterpreter::ScExternal() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScExternal" ); - USHORT nIndex; - BYTE nParamCount = GetByte(); + sal_uInt16 nIndex; + sal_uInt8 nParamCount = GetByte(); String aUnoName; String aFuncName( ScGlobal::pCharClass->upper( pCur->GetExternal() ) ); if (ScGlobal::GetFuncCollection()->SearchFunc(aFuncName, nIndex)) @@ -2443,7 +2443,7 @@ void ScInterpreter::ScExternal() void* ppParam[MAXFUNCPARAM]; double nVal[MAXFUNCPARAM]; sal_Char* pStr[MAXFUNCPARAM]; - BYTE* pCellArr[MAXFUNCPARAM]; + sal_uInt8* pCellArr[MAXFUNCPARAM]; short i; for (i = 0; i < MAXFUNCPARAM; i++) @@ -2488,7 +2488,7 @@ void ScInterpreter::ScExternal() SCROW nRow2; SCTAB nTab2; PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - pCellArr[i-1] = new BYTE[MAXARRSIZE]; + pCellArr[i-1] = new sal_uInt8[MAXARRSIZE]; if (!CreateDoubleArr(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, pCellArr[i-1])) SetError(errCodeOverflow); else @@ -2504,7 +2504,7 @@ void ScInterpreter::ScExternal() SCROW nRow2; SCTAB nTab2; PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - pCellArr[i-1] = new BYTE[MAXARRSIZE]; + pCellArr[i-1] = new sal_uInt8[MAXARRSIZE]; if (!CreateStringArr(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, pCellArr[i-1])) SetError(errCodeOverflow); else @@ -2520,7 +2520,7 @@ void ScInterpreter::ScExternal() SCROW nRow2; SCTAB nTab2; PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - pCellArr[i-1] = new BYTE[MAXARRSIZE]; + pCellArr[i-1] = new sal_uInt8[MAXARRSIZE]; if (!CreateCellArr(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, pCellArr[i-1])) SetError(errCodeOverflow); else @@ -2573,7 +2573,7 @@ void ScInterpreter::ScExternal() double nErg = 0.0; ppParam[0] = &nErg; pFuncData->Call(ppParam); - ULONG nHandle = ULONG( nErg ); + sal_uLong nHandle = sal_uLong( nErg ); if ( nHandle >= 65536 ) { ScAddInAsync* pAs = ScAddInAsync::Get( nHandle ); @@ -2625,9 +2625,9 @@ void ScInterpreter::ScExternal() PushIllegalParameter(); } } - else if ( ( aUnoName = ScGlobal::GetAddInCollection()->FindFunction(aFuncName, FALSE) ).Len() ) + else if ( ( aUnoName = ScGlobal::GetAddInCollection()->FindFunction(aFuncName, false) ).Len() ) { - // bLocalFirst=FALSE in FindFunction, cFunc should be the stored internal name + // bLocalFirst=sal_False in FindFunction, cFunc should be the stored internal name ScUnoAddInCall aCall( *ScGlobal::GetAddInCollection(), aUnoName, nParamCount ); @@ -2653,7 +2653,7 @@ void ScInterpreter::ScExternal() --nPar; // 0 .. (nParamCount-1) ScAddInArgumentType eType = aCall.GetArgType( nPar ); - BYTE nStackType = sal::static_int_cast<BYTE>( GetStackType() ); + sal_uInt8 nStackType = sal::static_int_cast<sal_uInt8>( GetStackType() ); uno::Any aParam; switch (eType) @@ -2664,7 +2664,7 @@ void ScInterpreter::ScExternal() double fInt = (fVal >= 0.0) ? ::rtl::math::approxFloor( fVal ) : ::rtl::math::approxCeil( fVal ); if ( fInt >= LONG_MIN && fInt <= LONG_MAX ) - aParam <<= (INT32)fInt; + aParam <<= (sal_Int32)fInt; else SetError(errIllegalArgument); } @@ -2690,9 +2690,9 @@ void ScInterpreter::ScExternal() ::rtl::math::approxCeil( fVal ); if ( fInt >= LONG_MIN && fInt <= LONG_MAX ) { - INT32 nIntVal = (long)fInt; - uno::Sequence<INT32> aInner( &nIntVal, 1 ); - uno::Sequence< uno::Sequence<INT32> > aOuter( &aInner, 1 ); + sal_Int32 nIntVal = (long)fInt; + uno::Sequence<sal_Int32> aInner( &nIntVal, 1 ); + uno::Sequence< uno::Sequence<sal_Int32> > aOuter( &aInner, 1 ); aParam <<= aOuter; } else @@ -3041,7 +3041,7 @@ void ScInterpreter::ScMacro() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMacro" ); SbxBase::ResetError(); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); String aMacro( pCur->GetExternal() ); SfxObjectShell* pDocSh = pDok->GetDocumentShell(); @@ -3053,9 +3053,6 @@ void ScInterpreter::ScMacro() // keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic - SfxApplication* pSfxApp = SFX_APP(); - pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc. - // Wenn das Dok waehrend eines Basic-Calls geladen wurde, // ist das Sbx-Objekt evtl. nicht angelegt (?) // pDocSh->GetSbxObject(); @@ -3068,7 +3065,6 @@ void ScInterpreter::ScMacro() if( !pVar || pVar->GetType() == SbxVOID || !pVar->ISA(SbMethod) ) { PushError( errNoMacro ); - pSfxApp->LeaveBasicCall(); return; } @@ -3099,11 +3095,11 @@ void ScInterpreter::ScMacro() // Parameter-Array zusammenbauen SbxArrayRef refPar = new SbxArray; - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; for( short i = nParamCount; i && bOk ; i-- ) { - SbxVariable* pPar = refPar->Get( (USHORT) i ); - BYTE nStackType = sal::static_int_cast<BYTE>( GetStackType() ); + SbxVariable* pPar = refPar->Get( (sal_uInt16) i ); + sal_uInt8 nStackType = sal::static_int_cast<sal_uInt8>( GetStackType() ); switch( nStackType ) { case svDouble: @@ -3137,7 +3133,7 @@ void ScInterpreter::ScMacro() if( nTab1 != nTab2 ) { SetError( errIllegalParameter ); - bOk = FALSE; + bOk = false; } else { @@ -3178,15 +3174,15 @@ void ScInterpreter::ScMacro() { pMat->GetDimensions(nC, nR); SbxDimArrayRef refArray = new SbxDimArray; - refArray->AddDim32( 1, static_cast<INT32>(nR) ); - refArray->AddDim32( 1, static_cast<INT32>(nC) ); + refArray->AddDim32( 1, static_cast<sal_Int32>(nR) ); + refArray->AddDim32( 1, static_cast<sal_Int32>(nC) ); for( SCSIZE nMatRow = 0; nMatRow < nR; nMatRow++ ) { - INT32 nIdx[ 2 ]; - nIdx[ 0 ] = static_cast<INT32>(nMatRow+1); + sal_Int32 nIdx[ 2 ]; + nIdx[ 0 ] = static_cast<sal_Int32>(nMatRow+1); for( SCSIZE nMatCol = 0; nMatCol < nC; nMatCol++ ) { - nIdx[ 1 ] = static_cast<INT32>(nMatCol+1); + nIdx[ 1 ] = static_cast<sal_Int32>(nMatCol+1); SbxVariable* p = refArray->Get32( nIdx ); if (pMat->IsString(nMatCol, nMatRow)) p->PutString( pMat->GetString(nMatCol, nMatRow) ); @@ -3202,7 +3198,7 @@ void ScInterpreter::ScMacro() break; default: SetError( errIllegalParameter ); - bOk = FALSE; + bOk = false; } } if( bOk ) @@ -3210,7 +3206,7 @@ void ScInterpreter::ScMacro() pDok->LockTable( aPos.Tab() ); SbxVariableRef refRes = new SbxVariable; pDok->IncMacroInterpretLevel(); - ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, NULL, refPar, refRes ); + ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar, refRes ); pDok->DecMacroInterpretLevel(); pDok->UnlockTable( aPos.Tab() ); @@ -3235,7 +3231,7 @@ void ScInterpreter::ScMacro() short nDim = pDimArray->GetDims(); if ( 1 <= nDim && nDim <= 2 ) { - INT32 nCs, nCe, nRs, nRe; + sal_Int32 nCs, nCe, nRs, nRe; SCSIZE nC, nR; SCCOL nColIdx; SCROW nRowIdx; @@ -3264,13 +3260,13 @@ void ScInterpreter::ScMacro() SbxDataType eType; for ( SCSIZE j=0; j < nR; j++ ) { - INT32 nIdx[ 2 ]; + sal_Int32 nIdx[ 2 ]; // bei eindimensionalem array( cols ) wird nIdx[1] // von SbxDimArray::Get ignoriert - nIdx[ nRowIdx ] = nRs + static_cast<INT32>(j); + nIdx[ nRowIdx ] = nRs + static_cast<sal_Int32>(j); for ( SCSIZE i=0; i < nC; i++ ) { - nIdx[ nColIdx ] = nCs + static_cast<INT32>(i); + nIdx[ nColIdx ] = nCs + static_cast<sal_Int32>(i); pV = pDimArray->Get32( nIdx ); eType = pV->GetType(); if ( eType >= SbxINTEGER && eType <= SbxDOUBLE ) @@ -3298,14 +3294,14 @@ void ScInterpreter::ScMacro() } -BOOL ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos ) +sal_Bool ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::SetSbxVariable" ); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; ScBaseCell* pCell = pDok->GetCell( rPos ); if (pCell) { - USHORT nErr; + sal_uInt16 nErr; double nVal; switch( pCell->GetCellType() ) { @@ -3344,7 +3340,7 @@ BOOL ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos ) } } else - SetError( nErr ), bOk = FALSE; + SetError( nErr ), bOk = false; break; default : pVar->PutDouble( 0.0 ); @@ -3359,7 +3355,7 @@ BOOL ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos ) void ScInterpreter::ScTableOp() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTableOp" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (nParamCount != 3 && nParamCount != 5) { PushIllegalParameter(); @@ -3375,15 +3371,15 @@ void ScInterpreter::ScTableOp() PopSingleRef( pTableOp->aOld1 ); PopSingleRef( pTableOp->aFormulaPos ); - pTableOp->bValid = TRUE; + pTableOp->bValid = true; pDok->aTableOpList.push_back( pTableOp ); pDok->IncInterpreterTableOpLevel(); - BOOL bReuseLastParams = (pDok->aLastTableOpParams == *pTableOp); + sal_Bool bReuseLastParams = (pDok->aLastTableOpParams == *pTableOp); if ( bReuseLastParams ) { pTableOp->aNotifiedFormulaPos = pDok->aLastTableOpParams.aNotifiedFormulaPos; - pTableOp->bRefresh = TRUE; + pTableOp->bRefresh = sal_True; for ( ::std::vector< ScAddress >::const_iterator iBroadcast( pTableOp->aNotifiedFormulaPos.begin() ); iBroadcast != pTableOp->aNotifiedFormulaPos.end(); @@ -3400,7 +3396,7 @@ void ScInterpreter::ScTableOp() if ( nParamCount == 5 ) pDok->SetTableOpDirty( pTableOp->aOld2 ); } - pTableOp->bCollectNotifications = FALSE; + pTableOp->bCollectNotifications = false; ScBaseCell* pFCell = pDok->GetCell( pTableOp->aFormulaPos ); if ( pFCell && pFCell->GetCellType() == CELLTYPE_FORMULA ) @@ -3494,7 +3490,7 @@ void ScInterpreter::ScColRowNameAuto() (SCROW&) aRefData.Ref1.nRow, (SCCOL&) aRefData.Ref2.nCol, (SCROW&) aRefData.Ref2.nRow, - TRUE, false ); + sal_True, false ); // DataArea im Ursprung begrenzen aRefData.Ref1.nCol = nStartCol; aRefData.Ref1.nRow = nStartRow; @@ -3558,7 +3554,7 @@ void ScInterpreter::ScColRowNameAuto() void ScInterpreter::ScTTT() { // Temporaerer Test-Tanz, zum auspropieren von Funktionen etc. - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); // do something, nParamCount bei Pops runterzaehlen! // Stack aufraeumen @@ -3585,11 +3581,11 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" ); - BYTE cMatFlag = pMyFormulaCell->GetMatrixFlag(); + sal_uInt8 cMatFlag = pMyFormulaCell->GetMatrixFlag(); bMatrixFormula = ( cMatFlag == MM_FORMULA || cMatFlag == MM_FAKE ); if (!bGlobalStackInUse) { - bGlobalStackInUse = TRUE; + bGlobalStackInUse = sal_True; if (!pGlobalStack) pGlobalStack = new ScTokenStack; pStackObj = pGlobalStack; @@ -3606,7 +3602,7 @@ ScInterpreter::~ScInterpreter() // delete pStack; if ( pStackObj == pGlobalStack ) - bGlobalStackInUse = FALSE; + bGlobalStackInUse = false; else delete pStackObj; if (pTokenMatrixMap) @@ -3626,10 +3622,10 @@ StackVar ScInterpreter::Interpret() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::Interpret" ); short nRetTypeExpr = NUMBERFORMAT_UNDEFINED; - ULONG nRetIndexExpr = 0; - USHORT nErrorFunction = 0; - USHORT nErrorFunctionCount = 0; - USHORT nStackBase; + sal_uLong nRetIndexExpr = 0; + sal_uInt16 nErrorFunction = 0; + sal_uInt16 nErrorFunctionCount = 0; + sal_uInt16 nStackBase; nGlobalError = 0; nStackBase = sp = maxsp = 0; @@ -3638,7 +3634,7 @@ StackVar ScInterpreter::Interpret() nFuncFmtIndex = nCurFmtIndex = nRetFmtIndex = 0; xResult = NULL; pJumpMatrix = NULL; - glSubTotal = FALSE; + glSubTotal = false; ScTokenMatrixMap::const_iterator aTokenMatrixMapIter; // Once upon a time we used to have FP exceptions on, and there was a @@ -3827,28 +3823,28 @@ StackVar ScInterpreter::Interpret() case ocGetTime : ScGetTime(); break; case ocGetDiffDate : ScGetDiffDate(); break; case ocGetDiffDate360 : ScGetDiffDate360(); break; - case ocMin : ScMin( FALSE ); break; - case ocMinA : ScMin( TRUE ); break; - case ocMax : ScMax( FALSE ); break; - case ocMaxA : ScMax( TRUE ); break; + case ocMin : ScMin( false ); break; + case ocMinA : ScMin( sal_True ); break; + case ocMax : ScMax( false ); break; + case ocMaxA : ScMax( sal_True ); break; case ocSum : ScSum(); break; case ocProduct : ScProduct(); break; case ocNPV : ScNPV(); break; case ocIRR : ScIRR(); break; case ocMIRR : ScMIRR(); break; case ocISPMT : ScISPMT(); break; - case ocAverage : ScAverage( FALSE ); break; - case ocAverageA : ScAverage( TRUE ); break; + case ocAverage : ScAverage( false ); break; + case ocAverageA : ScAverage( sal_True ); break; case ocCount : ScCount(); break; case ocCount2 : ScCount2(); break; - case ocVar : ScVar( FALSE ); break; - case ocVarA : ScVar( TRUE ); break; - case ocVarP : ScVarP( FALSE ); break; - case ocVarPA : ScVarP( TRUE ); break; - case ocStDev : ScStDev( FALSE ); break; - case ocStDevA : ScStDev( TRUE ); break; - case ocStDevP : ScStDevP( FALSE ); break; - case ocStDevPA : ScStDevP( TRUE ); break; + case ocVar : ScVar( false ); break; + case ocVarA : ScVar( sal_True ); break; + case ocVarP : ScVarP( false ); break; + case ocVarPA : ScVarP( sal_True ); break; + case ocStDev : ScStDev( false ); break; + case ocStDevA : ScStDev( sal_True ); break; + case ocStDevP : ScStDevP( false ); break; + case ocStDevPA : ScStDevP( sal_True ); break; case ocBW : ScBW(); break; case ocDIA : ScDIA(); break; case ocGDA : ScGDA(); break; @@ -4057,7 +4053,7 @@ StackVar ScInterpreter::Interpret() do { bGotResult = false; - BYTE nLevel = 0; + sal_uInt8 nLevel = 0; if ( GetStackType( ++nLevel ) == svJumpMatrix ) ; // nothing else if ( GetStackType( ++nLevel ) == svJumpMatrix ) diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index a40bc6e572f6..0d0b50d70baf 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -173,7 +173,7 @@ void ScInterpreter::ScGCD() case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); double nCellVal; ScValueIterator aValIter(pDok, aRange, glSubTotal); @@ -266,7 +266,7 @@ void ScInterpreter:: ScLCM() case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); double nCellVal; ScValueIterator aValIter(pDok, aRange, glSubTotal); @@ -605,7 +605,7 @@ void ScInterpreter::ScMatValue() ScBaseCell* pCell = GetCell( aAdr ); if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA) { - USHORT nErrCode = ((ScFormulaCell*)pCell)->GetErrCode(); + sal_uInt16 nErrCode = ((ScFormulaCell*)pCell)->GetErrCode(); if (nErrCode != 0) PushError( nErrCode); else @@ -892,7 +892,7 @@ void ScInterpreter::ScMatDet() } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); - if ( nC != nR || nC == 0 || (ULONG) nC * nC > ScMatrix::GetElementsMax() ) + if ( nC != nR || nC == 0 || (sal_uLong) nC * nC > ScMatrix::GetElementsMax() ) PushIllegalArgument(); else { @@ -938,7 +938,7 @@ void ScInterpreter::ScMatInv() } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); - if ( nC != nR || nC == 0 || (ULONG) nC * nC > ScMatrix::GetElementsMax() ) + if ( nC != nR || nC == 0 || (sal_uLong) nC * nC > ScMatrix::GetElementsMax() ) PushIllegalArgument(); else { @@ -1154,7 +1154,7 @@ ScMatrixRef ScInterpreter::MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef { for (j = 0; j < nMinR; j++) { - USHORT nErr = pMat1->GetErrorIfNotString( i, j); + sal_uInt16 nErr = pMat1->GetErrorIfNotString( i, j); if (!nErr) nErr = pMat2->GetErrorIfNotString( i, j); if (nErr) @@ -1203,9 +1203,9 @@ void lcl_GetDiffDateTimeFmtType( short& nFuncFmt, short nFmt1, short nFmt2 ) void ScInterpreter::ScAdd() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAdd" ); - CalculateAddSub(FALSE); + CalculateAddSub(false); } -void ScInterpreter::CalculateAddSub(BOOL _bSub) +void ScInterpreter::CalculateAddSub(sal_Bool _bSub) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateAddSub" ); ScMatrixRef pMat1 = NULL; @@ -1214,7 +1214,7 @@ void ScInterpreter::CalculateAddSub(BOOL _bSub) short nFmt1, nFmt2; nFmt1 = nFmt2 = NUMBERFORMAT_UNDEFINED; short nFmtCurrencyType = nCurFmtType; - ULONG nFmtCurrencyIndex = nCurFmtIndex; + sal_uLong nFmtCurrencyIndex = nCurFmtIndex; short nFmtPercentType = nCurFmtType; if ( GetStackType() == svMatrix ) pMat2 = GetMatrix(); @@ -1280,18 +1280,18 @@ void ScInterpreter::CalculateAddSub(BOOL _bSub) else if (pMat1 || pMat2) { double fVal; - BOOL bFlag; + sal_Bool bFlag; ScMatrixRef pMat = pMat1; if (!pMat) { fVal = fVal1; pMat = pMat2; - bFlag = TRUE; // double - Matrix + bFlag = sal_True; // double - Matrix } else { fVal = fVal2; - bFlag = FALSE; // Matrix - double + bFlag = false; // Matrix - double } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); @@ -1365,18 +1365,18 @@ void ScInterpreter::ScAmpersand() else if (pMat1 || pMat2) { String sStr; - BOOL bFlag; + sal_Bool bFlag; ScMatrixRef pMat = pMat1; if (!pMat) { sStr = sStr1; pMat = pMat2; - bFlag = TRUE; // double - Matrix + bFlag = sal_True; // double - Matrix } else { sStr = sStr2; - bFlag = FALSE; // Matrix - double + bFlag = false; // Matrix - double } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); @@ -1394,7 +1394,7 @@ void ScInterpreter::ScAmpersand() for (SCSIZE i = 0; i < nC; ++i) for (SCSIZE j = 0; j < nR; ++j) { - USHORT nErr = pMat->GetErrorIfNotString( i, j); + sal_uInt16 nErr = pMat->GetErrorIfNotString( i, j); if (nErr) pResMat->PutError( nErr, i, j); else @@ -1410,7 +1410,7 @@ void ScInterpreter::ScAmpersand() for (SCSIZE i = 0; i < nC; ++i) for (SCSIZE j = 0; j < nR; ++j) { - USHORT nErr = pMat->GetErrorIfNotString( i, j); + sal_uInt16 nErr = pMat->GetErrorIfNotString( i, j); if (nErr) pResMat->PutError( nErr, i, j); else @@ -1437,7 +1437,7 @@ void ScInterpreter::ScAmpersand() void ScInterpreter::ScSub() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSub" ); - CalculateAddSub(TRUE); + CalculateAddSub(sal_True); } void ScInterpreter::ScMul() @@ -1447,7 +1447,7 @@ void ScInterpreter::ScMul() ScMatrixRef pMat2 = NULL; double fVal1 = 0.0, fVal2 = 0.0; short nFmtCurrencyType = nCurFmtType; - ULONG nFmtCurrencyIndex = nCurFmtIndex; + sal_uLong nFmtCurrencyIndex = nCurFmtIndex; if ( GetStackType() == svMatrix ) pMat2 = GetMatrix(); else @@ -1526,7 +1526,7 @@ void ScInterpreter::ScDiv() ScMatrixRef pMat2 = NULL; double fVal1 = 0.0, fVal2 = 0.0; short nFmtCurrencyType = nCurFmtType; - ULONG nFmtCurrencyIndex = nCurFmtIndex; + sal_uLong nFmtCurrencyIndex = nCurFmtIndex; short nFmtCurrencyType2 = NUMBERFORMAT_UNDEFINED; if ( GetStackType() == svMatrix ) pMat2 = GetMatrix(); @@ -1561,18 +1561,18 @@ void ScInterpreter::ScDiv() else if (pMat1 || pMat2) { double fVal; - BOOL bFlag; + sal_Bool bFlag; ScMatrixRef pMat = pMat1; if (!pMat) { fVal = fVal1; pMat = pMat2; - bFlag = TRUE; // double - Matrix + bFlag = sal_True; // double - Matrix } else { fVal = fVal2; - bFlag = FALSE; // Matrix - double + bFlag = false; // Matrix - double } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); @@ -1643,18 +1643,18 @@ void ScInterpreter::ScPow() else if (pMat1 || pMat2) { double fVal; - BOOL bFlag; + sal_Bool bFlag; ScMatrixRef pMat = pMat1; if (!pMat) { fVal = fVal1; pMat = pMat2; - bFlag = TRUE; // double - Matrix + bFlag = sal_True; // double - Matrix } else { fVal = fVal2; - bFlag = FALSE; // Matrix - double + bFlag = false; // Matrix - double } SCSIZE nC, nR; pMat->GetDimensions(nC, nR); @@ -1688,7 +1688,7 @@ void ScInterpreter::ScPow() void ScInterpreter::ScSumProduct() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumProduct" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 1, 30 ) ) return; @@ -1706,7 +1706,7 @@ void ScInterpreter::ScSumProduct() pMat2->GetDimensions(nC, nR); pMat = pMat2; MatrixMul aMul; - for (USHORT i = 1; i < nParamCount; i++) + for (sal_uInt16 i = 1; i < nParamCount; i++) { pMat1 = GetMatrix(); if (!pMat1) @@ -1742,9 +1742,9 @@ void ScInterpreter::ScSumProduct() void ScInterpreter::ScSumX2MY2() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumX2MY2" ); - CalculateSumX2MY2SumX2DY2(FALSE); + CalculateSumX2MY2SumX2DY2(false); } -void ScInterpreter::CalculateSumX2MY2SumX2DY2(BOOL _bSumX2DY2) +void ScInterpreter::CalculateSumX2MY2SumX2DY2(sal_Bool _bSumX2DY2) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateSumX2MY2SumX2DY2" ); if ( !MustHaveParamCount( GetByte(), 2 ) ) @@ -1788,7 +1788,7 @@ void ScInterpreter::CalculateSumX2MY2SumX2DY2(BOOL _bSumX2DY2) void ScInterpreter::ScSumX2DY2() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumX2DY2" ); - CalculateSumX2MY2SumX2DY2(TRUE); + CalculateSumX2MY2SumX2DY2(sal_True); } void ScInterpreter::ScSumXMY2() @@ -2265,7 +2265,7 @@ double lcl_GetSSresid(ScMatrixRef pMatX, ScMatrixRef pMatY, double fSlope, // Fill default values in matrix X, transform Y to log(Y) in case LOGEST|GROWTH, // determine sizes of matrices X and Y, determine kind of regression, clone // Y in case LOGEST|GROWTH, if constant. -bool ScInterpreter::CheckMatrix(bool _bLOG, BYTE& nCase, SCSIZE& nCX, +bool ScInterpreter::CheckMatrix(bool _bLOG, sal_uInt8& nCase, SCSIZE& nCX, SCSIZE& nCY, SCSIZE& nRX, SCSIZE& nRY, SCSIZE& M, SCSIZE& N, ScMatrixRef& pMatX, ScMatrixRef& pMatY) { @@ -2388,7 +2388,7 @@ void ScInterpreter::ScRKP() void ScInterpreter::CalulateRGPRKP(bool _bRKP) { - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (!MustHaveParamCount( nParamCount, 1, 4 )) return; bool bConstant, bStats; @@ -2441,7 +2441,7 @@ void ScInterpreter::CalulateRGPRKP(bool _bRKP) } // 1 = simple; 2 = multiple with Y as column; 3 = multiple with Y as row - BYTE nCase; + sal_uInt8 nCase; SCSIZE nCX, nCY; // number of columns SCSIZE nRX, nRY; //number of rows @@ -2919,7 +2919,7 @@ void ScInterpreter::ScGrowth() void ScInterpreter::CalculateTrendGrowth(bool _bGrowth) { - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (!MustHaveParamCount( nParamCount, 1, 4 )) return; @@ -2973,7 +2973,7 @@ void ScInterpreter::CalculateTrendGrowth(bool _bGrowth) } // 1 = simple; 2 = multiple with Y as column; 3 = multiple with Y as row - BYTE nCase; + sal_uInt8 nCase; SCSIZE nCX, nCY; // number of columns SCSIZE nRX, nRY; //number of rows @@ -3244,7 +3244,7 @@ void ScInterpreter::ScMatRef() if (ScMatrix::IsNonValueType( nMatValType)) { if (ScMatrix::IsEmptyPathType( nMatValType)) - { // result of empty FALSE jump path + { // result of empty sal_False jump path nFuncFmtType = NUMBERFORMAT_LOGICAL; PushInt(0); } @@ -3268,7 +3268,7 @@ void ScInterpreter::ScMatRef() else { // If not a result matrix, obtain the cell value. - USHORT nErr = pCell->GetErrCode(); + sal_uInt16 nErr = pCell->GetErrCode(); if (nErr) PushError( nErr ); else if( pCell->IsValue() ) diff --git a/sc/source/core/tool/navicfg.cxx b/sc/source/core/tool/navicfg.cxx index 703c15175536..a4c6891db19c 100644 --- a/sc/source/core/tool/navicfg.cxx +++ b/sc/source/core/tool/navicfg.cxx @@ -51,7 +51,7 @@ ScNavipiCfg::ScNavipiCfg() : //------------------------------------------------------------------------ -void ScNavipiCfg::SetListMode(USHORT nNew) +void ScNavipiCfg::SetListMode(sal_uInt16 nNew) { if ( nListMode != nNew ) { @@ -60,7 +60,7 @@ void ScNavipiCfg::SetListMode(USHORT nNew) } } -void ScNavipiCfg::SetDragMode(USHORT nNew) +void ScNavipiCfg::SetDragMode(sal_uInt16 nNew) { if ( nDragMode != nNew ) { @@ -69,7 +69,7 @@ void ScNavipiCfg::SetDragMode(USHORT nNew) } } -void ScNavipiCfg::SetRootType(USHORT nNew) +void ScNavipiCfg::SetRootType(sal_uInt16 nNew) { if ( nRootType != nNew ) { diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx index 377676e5647f..e11322e9a056 100644 --- a/sc/source/core/tool/optutil.cxx +++ b/sc/source/core/tool/optutil.cxx @@ -39,7 +39,7 @@ //------------------------------------------------------------------ -BOOL ScOptionsUtil::IsMetricSystem() +sal_Bool ScOptionsUtil::IsMetricSystem() { //! which language should be used here - system language or installed office language? diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index 44cb18c093ad..698601ee6ef3 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -242,7 +242,7 @@ void ScParameterClassification::Init() if ( pRun->aData.nParam[j] ) { eLast = pRun->aData.nParam[j]; - pRun->nMinParams = sal::static_int_cast<BYTE>( j+1 ); + pRun->nMinParams = sal::static_int_cast<sal_uInt8>( j+1 ); } else pRun->aData.nParam[j] = eLast; @@ -255,7 +255,7 @@ void ScParameterClassification::Init() if ( !pRun->aData.nParam[j] ) { if ( j == 0 || pRun->aData.nParam[j-1] != Bounds ) - pRun->nMinParams = sal::static_int_cast<BYTE>( j ); + pRun->nMinParams = sal::static_int_cast<sal_uInt8>( j ); pRun->aData.nParam[j] = Bounds; } } @@ -288,7 +288,7 @@ void ScParameterClassification::Exit() ScParameterClassification::Type ScParameterClassification::GetParameterType( - const formula::FormulaToken* pToken, USHORT nParameter) + const formula::FormulaToken* pToken, sal_uInt16 nParameter) { OpCode eOp = pToken->GetOpCode(); switch ( eOp ) @@ -322,11 +322,11 @@ ScParameterClassification::Type ScParameterClassification::GetParameterType( ScParameterClassification::Type ScParameterClassification::GetExternalParameterType( const formula::FormulaToken* pToken, - USHORT nParameter) + sal_uInt16 nParameter) { Type eRet = Unknown; // similar to ScInterpreter::ScExternal() - USHORT nIndex; + sal_uInt16 nIndex; String aUnoName; String aFuncName( ScGlobal::pCharClass->upper( pToken->GetExternal())); if ( ScGlobal::GetFuncCollection()->SearchFunc( aFuncName, nIndex) ) @@ -350,7 +350,7 @@ ScParameterClassification::GetExternalParameterType( const formula::FormulaToken } } else if ( (aUnoName = ScGlobal::GetAddInCollection()->FindFunction( - aFuncName, FALSE)).Len() ) + aFuncName, false)).Len() ) { // the relevant parts of ScUnoAddInCall without having to create one const ScUnoAddInFuncData* pFuncData = @@ -425,7 +425,7 @@ void ScParameterClassification::MergeArgumentsFromFunctionResource() nArgs = CommonData::nMaxParams; pRun->aData.bRepeatLast = true; } - pRun->nMinParams = static_cast< BYTE >( nArgs ); + pRun->nMinParams = static_cast< sal_uInt8 >( nArgs ); for ( size_t j=0; j < nArgs; ++j ) { pRun->aData.nParam[j] = Value; @@ -470,7 +470,7 @@ void ScParameterClassification::GenerateDocumentation() ByteString aStr( xMap->getSymbol(eOp), RTL_TEXTENCODING_UTF8); aStr += "("; formula::FormulaByteToken aToken( eOp); - BYTE nParams = GetMinimumParameters( eOp); + sal_uInt8 nParams = GetMinimumParameters( eOp); // preset parameter count according to opcode value, with some // special handling if ( eOp < SC_OPCODE_STOP_DIV ) @@ -521,7 +521,7 @@ void ScParameterClassification::GenerateDocumentation() if ( nParams != aToken.GetParamCount() ) fprintf( stdout, "(parameter count differs, token ParamCount: %d classification: %d) ", aToken.GetParamCount(), nParams); - for ( USHORT j=0; j < nParams; ++j ) + for ( sal_uInt16 j=0; j < nParams; ++j ) { if ( j > 0 ) aStr += ","; diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx index 83010a3c9e40..35b91f1734de 100644 --- a/sc/source/core/tool/printopt.cxx +++ b/sc/source/core/tool/printopt.cxx @@ -65,8 +65,8 @@ ScPrintOptions::~ScPrintOptions() void ScPrintOptions::SetDefaults() { - bSkipEmpty = TRUE; - bAllSheets = FALSE; + bSkipEmpty = sal_True; + bAllSheets = false; } const ScPrintOptions& ScPrintOptions::operator=( const ScPrintOptions& rCpy ) @@ -90,7 +90,7 @@ int ScPrintOptions::operator!=( const ScPrintOptions& rOpt ) const // ----------------------------------------------------------------------- -ScTpPrintItem::ScTpPrintItem( USHORT nWhichP, const ScPrintOptions& rOpt ) : +ScTpPrintItem::ScTpPrintItem( sal_uInt16 nWhichP, const ScPrintOptions& rOpt ) : SfxPoolItem ( nWhichP ), theOptions ( rOpt ) { diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx index 35200d6b4ff9..7813539dc06b 100644 --- a/sc/source/core/tool/prnsave.cxx +++ b/sc/source/core/tool/prnsave.cxx @@ -50,7 +50,7 @@ ScPrintSaverTab::ScPrintSaverTab() : mpRepeatCol(NULL), mpRepeatRow(NULL), - mbEntireSheet(FALSE) + mbEntireSheet(false) { } @@ -60,7 +60,7 @@ ScPrintSaverTab::~ScPrintSaverTab() delete mpRepeatRow; } -void ScPrintSaverTab::SetAreas( const ScRangeVec& rRanges, BOOL bEntireSheet ) +void ScPrintSaverTab::SetAreas( const ScRangeVec& rRanges, sal_Bool bEntireSheet ) { maPrintRanges = rRanges; mbEntireSheet = bEntireSheet; @@ -74,12 +74,12 @@ void ScPrintSaverTab::SetRepeat( const ScRange* pCol, const ScRange* pRow ) mpRepeatRow = pRow ? new ScRange(*pRow) : NULL; } -inline BOOL PtrEqual( const ScRange* p1, const ScRange* p2 ) +inline sal_Bool PtrEqual( const ScRange* p1, const ScRange* p2 ) { return ( !p1 && !p2 ) || ( p1 && p2 && *p1 == *p2 ); } -BOOL ScPrintSaverTab::operator==( const ScPrintSaverTab& rCmp ) const +sal_Bool ScPrintSaverTab::operator==( const ScPrintSaverTab& rCmp ) const { return PtrEqual( mpRepeatCol, rCmp.mpRepeatCol ) && @@ -118,14 +118,14 @@ const ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB nTab) const return pData[nTab]; } -BOOL ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const +sal_Bool ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const { - BOOL bEqual = ( nTabCount == rCmp.nTabCount ); + sal_Bool bEqual = ( nTabCount == rCmp.nTabCount ); if (bEqual) for (SCTAB i=0; i<nTabCount; i++) if (!(pData[i]==rCmp.pData[i])) { - bEqual = FALSE; + bEqual = false; break; } return bEqual; diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index 1f3492a3d5a0..9cb767b7a487 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -47,22 +47,23 @@ #include "global.hxx" #include "globstr.hrc" +using namespace com::sun::star; static ScProgress theDummyInterpretProgress; SfxProgress* ScProgress::pGlobalProgress = NULL; -ULONG ScProgress::nGlobalRange = 0; -ULONG ScProgress::nGlobalPercent = 0; -BOOL ScProgress::bGlobalNoUserBreak = TRUE; +sal_uLong ScProgress::nGlobalRange = 0; +sal_uLong ScProgress::nGlobalPercent = 0; +sal_Bool ScProgress::bGlobalNoUserBreak = sal_True; ScProgress* ScProgress::pInterpretProgress = &theDummyInterpretProgress; ScProgress* ScProgress::pOldInterpretProgress = NULL; -ULONG ScProgress::nInterpretProgress = 0; -BOOL ScProgress::bAllowInterpretProgress = TRUE; +sal_uLong ScProgress::nInterpretProgress = 0; +sal_Bool ScProgress::bAllowInterpretProgress = sal_True; ScDocument* ScProgress::pInterpretDoc; -BOOL ScProgress::bIdleWasDisabled = FALSE; +sal_Bool ScProgress::bIdleWasDisabled = false; -BOOL lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) +sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) { if (pObjSh) { @@ -71,16 +72,24 @@ BOOL lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) { SfxItemSet* pSet = pMed->GetItemSet(); const SfxPoolItem* pItem; - if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_HIDDEN, TRUE, &pItem ) && + if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_HIDDEN, sal_True, &pItem ) && ((const SfxBoolItem*)pItem)->GetValue() ) - return TRUE; + return sal_True; } } - return FALSE; + return false; +} + +bool lcl_HasControllersLocked( SfxObjectShell& rObjSh ) +{ + uno::Reference<frame::XModel> xModel( rObjSh.GetBaseModel() ); + if (xModel.is()) + return xModel->hasControllersLocked(); + return false; } ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText, - ULONG nRange, BOOL bAllDocs, BOOL bWait ) + sal_uLong nRange, sal_Bool bAllDocs, sal_Bool bWait ) { if ( pGlobalProgress || SfxProgress::GetActiveProgress( NULL ) ) @@ -105,7 +114,8 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText, pProgress = NULL; } else if ( pObjSh && ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || - pObjSh->GetProgress() ) ) + pObjSh->GetProgress() || + lcl_HasControllersLocked(*pObjSh) ) ) { // no own progress for embedded objects, // no second progress if the document already has one @@ -118,7 +128,7 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText, pGlobalProgress = pProgress; nGlobalRange = nRange; nGlobalPercent = 0; - bGlobalNoUserBreak = TRUE; + bGlobalNoUserBreak = sal_True; } } @@ -137,12 +147,12 @@ ScProgress::~ScProgress() pGlobalProgress = NULL; nGlobalRange = 0; nGlobalPercent = 0; - bGlobalNoUserBreak = TRUE; + bGlobalNoUserBreak = sal_True; } } -void ScProgress::CreateInterpretProgress( ScDocument* pDoc, BOOL bWait ) +void ScProgress::CreateInterpretProgress( ScDocument* pDoc, sal_Bool bWait ) { if ( bAllowInterpretProgress ) { @@ -152,14 +162,14 @@ void ScProgress::CreateInterpretProgress( ScDocument* pDoc, BOOL bWait ) { nInterpretProgress = 1; bIdleWasDisabled = pDoc->IsIdleDisabled(); - pDoc->DisableIdle( TRUE ); + pDoc->DisableIdle( sal_True ); // Interpreter may be called in many circumstances, also if another // progress bar is active, for example while adapting row heights. // Keep the dummy interpret progress. if ( !pGlobalProgress ) pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(), ScGlobal::GetRscString( STR_PROGRESS_CALCULATING ), - pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, FALSE, bWait ); + pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, false, bWait ); pInterpretDoc = pDoc; } } diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index 12d40ff2e13a..e991b4d7277c 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -40,7 +40,7 @@ using ::std::vector; ScQueryParamBase::ScQueryParamBase() { Resize( MAXQUERY ); - for (USHORT i=0; i<MAXQUERY; i++) + for (sal_uInt16 i=0; i<MAXQUERY; i++) maEntries[i].Clear(); } @@ -111,7 +111,7 @@ void ScQueryParamBase::FillInExcelSyntax(String& aCellStr, SCSIZE nIndex) ScQueryEntry& rEntry = GetEntry(nIndex); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; // Operatoren herausfiltern if (aCellStr.GetChar(0) == '<') { @@ -219,11 +219,11 @@ void ScQueryParam::Clear() nCol1=nCol2 = 0; nRow1=nRow2 = 0; nTab = SCTAB_MAX; - bHasHeader = bCaseSens = bRegExp = bMixedComparison = FALSE; - bInplace = bByRow = bDuplicate = TRUE; + bHasHeader = bCaseSens = bRegExp = bMixedComparison = false; + bInplace = bByRow = bDuplicate = sal_True; Resize( MAXQUERY ); - for (USHORT i=0; i<MAXQUERY; i++) + for (sal_uInt16 i=0; i<MAXQUERY; i++) maEntries[i].Clear(); ClearDestParams(); @@ -269,9 +269,9 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r ) //------------------------------------------------------------------------ -BOOL ScQueryParam::operator==( const ScQueryParam& rOther ) const +sal_Bool ScQueryParam::operator==( const ScQueryParam& rOther ) const { - BOOL bEqual = FALSE; + sal_Bool bEqual = false; // Anzahl der Queries gleich? SCSIZE nUsed = 0; @@ -303,7 +303,7 @@ BOOL ScQueryParam::operator==( const ScQueryParam& rOther ) const && (nDynamicEndRow == rOther.nDynamicEndRow) && (bUseDynamicRange == rOther.bUseDynamicRange) ) { - bEqual = TRUE; + bEqual = sal_True; for ( SCSIZE i=0; i<nUsed && bEqual; i++ ) bEqual = maEntries[i] == rOther.maEntries[i]; } @@ -330,7 +330,7 @@ void ScQueryParam::MoveToDest() for (size_t i=0; i<n; i++) maEntries[i].nField += nDifX; - bInplace = TRUE; + bInplace = sal_True; } else { diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index c570655a351b..7395da73d33e 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -125,7 +125,7 @@ private: class FormatString : public ::std::unary_function<void, const ScRange*> { public: - FormatString(String& rStr, USHORT nFlags, ScDocument* pDoc, FormulaGrammar::AddressConvention eConv, sal_Unicode cDelim) : + FormatString(String& rStr, sal_uInt16 nFlags, ScDocument* pDoc, FormulaGrammar::AddressConvention eConv, sal_Unicode cDelim) : mrStr(rStr), mnFlags(nFlags), mpDoc(pDoc), @@ -153,7 +153,7 @@ public: } private: String& mrStr; - USHORT mnFlags; + sal_uInt16 mnFlags; ScDocument* mpDoc; FormulaGrammar::AddressConvention meConv; sal_Unicode mcDelim; @@ -169,7 +169,7 @@ ScRangeList::~ScRangeList() RemoveAll(); } -USHORT ScRangeList::Parse( const String& rStr, ScDocument* pDoc, USHORT nMask, +sal_uInt16 ScRangeList::Parse( const String& rStr, ScDocument* pDoc, sal_uInt16 nMask, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cDelimiter ) { @@ -179,7 +179,7 @@ USHORT ScRangeList::Parse( const String& rStr, ScDocument* pDoc, USHORT nMask, cDelimiter = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); nMask |= SCA_VALID; // falls das jemand vergessen sollte - USHORT nResult = (USHORT)~0; // alle Bits setzen + sal_uInt16 nResult = (sal_uInt16)~0; // alle Bits setzen ScRange aRange; String aOne; SCTAB nTab = 0; @@ -190,15 +190,15 @@ USHORT ScRangeList::Parse( const String& rStr, ScDocument* pDoc, USHORT nMask, } else nTab = 0; - USHORT nTCount = rStr.GetTokenCount( cDelimiter ); - for ( USHORT i=0; i<nTCount; i++ ) + sal_uInt16 nTCount = rStr.GetTokenCount( cDelimiter ); + for ( sal_uInt16 i=0; i<nTCount; i++ ) { aOne = rStr.GetToken( i, cDelimiter ); aRange.aStart.SetTab( nTab ); // Default Tab wenn nicht angegeben - USHORT nRes = aRange.ParseAny( aOne, pDoc, eConv ); - USHORT nEndRangeBits = SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2; - USHORT nTmp1 = ( nRes & SCA_BITS ); - USHORT nTmp2 = ( nRes & nEndRangeBits ); + sal_uInt16 nRes = aRange.ParseAny( aOne, pDoc, eConv ); + sal_uInt16 nEndRangeBits = SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2; + sal_uInt16 nTmp1 = ( nRes & SCA_BITS ); + sal_uInt16 nTmp2 = ( nRes & nEndRangeBits ); // If we have a valid single range with // any of the address bits we are interested in // set - set the equiv end range bits @@ -216,7 +216,7 @@ USHORT ScRangeList::Parse( const String& rStr, ScDocument* pDoc, USHORT nMask, } -void ScRangeList::Format( String& rStr, USHORT nFlags, ScDocument* pDoc, +void ScRangeList::Format( String& rStr, sal_uInt16 nFlags, ScDocument* pDoc, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cDelimiter ) const { @@ -603,7 +603,7 @@ bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode, for ( size_t i = 0, nPairs = maPairs.size(); i < nPairs; ++i ) { ScRangePair* pR = maPairs[ i ]; - for ( USHORT j=0; j<2; j++ ) + for ( sal_uInt16 j=0; j<2; j++ ) { ScRange& rRange = pR->GetRange(j); SCCOL theCol1; @@ -899,8 +899,8 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( size_t& nListCount, DBG_ASSERT( nListCount * sizeof(ScRangePairNameSort) <= (size_t)~0x1F, "ScRangePairList::CreateNameSortedArray nListCount * sizeof(ScRangePairNameSort) > (size_t)~0x1F" ); ScRangePairNameSort* pSortArray = (ScRangePairNameSort*) - new BYTE [ nListCount * sizeof(ScRangePairNameSort) ]; - ULONG j; + new sal_uInt8 [ nListCount * sizeof(ScRangePairNameSort) ]; + sal_uLong j; for ( j=0; j < nListCount; j++ ) { pSortArray[j].pPair = maPairs[ j ]; diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 29491808c6f1..05d70f834a2d 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -59,8 +59,8 @@ using ::rtl::OUString; // Interner ctor fuer das Suchen nach einem Index -ScRangeData::ScRangeData( USHORT n ) - : pCode( NULL ), nIndex( n ), bModified( FALSE ), mnMaxRow(-1), mnMaxCol(-1) +ScRangeData::ScRangeData( sal_uInt16 n ) + : pCode( NULL ), nIndex( n ), bModified( false ), mnMaxRow(-1), mnMaxCol(-1) {} ScRangeData::ScRangeData( ScDocument* pDok, @@ -76,7 +76,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, eType ( nType ), pDoc ( pDok ), nIndex ( 0 ), - bModified ( FALSE ), + bModified ( false ), mnMaxRow (-1), mnMaxCol (-1) { @@ -124,7 +124,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, eType ( nType ), pDoc ( pDok ), nIndex ( 0 ), - bModified ( FALSE ), + bModified ( false ), mnMaxRow (-1), mnMaxCol (-1) { @@ -152,13 +152,13 @@ ScRangeData::ScRangeData( ScDocument* pDok, eType ( RT_NAME ), pDoc ( pDok ), nIndex ( 0 ), - bModified ( FALSE ), + bModified ( false ), mnMaxRow (-1), mnMaxCol (-1) { ScSingleRefData aRefData; aRefData.InitAddress( rTarget ); - aRefData.SetFlag3D( TRUE ); + aRefData.SetFlag3D( sal_True ); pCode->AddSingleReference( aRefData ); ScCompiler aComp( pDoc, aPos, *pCode ); aComp.SetGrammar(pDoc->GetGrammar()); @@ -251,15 +251,15 @@ void ScRangeData::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = false; pCode->Reset(); if( pCode->GetNextReference() ) { - BOOL bSharedFormula = ((eType & RT_SHARED) == RT_SHARED); + sal_Bool bSharedFormula = ((eType & RT_SHARED) == RT_SHARED); ScCompiler aComp( pDoc, aPos, *pCode ); aComp.SetGrammar(pDoc->GetGrammar()); - const BOOL bRelRef = aComp.UpdateNameReference( eUpdateRefMode, r, + const sal_Bool bRelRef = aComp.UpdateNameReference( eUpdateRefMode, r, nDx, nDy, nDz, bChanged, bSharedFormula); if (bSharedFormula) @@ -277,7 +277,7 @@ void ScRangeData::UpdateReference( UpdateRefMode eUpdateRefMode, void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = false; ScToken* t; pCode->Reset(); @@ -295,7 +295,7 @@ void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDes (!rRef.Ref2.IsFlag3D() || !rRef.Ref2.IsTabRel())))) { if ( ScRefUpdate::UpdateTranspose( pDoc, rSource, rDest, rRef ) != UR_NOTHING ) - bChanged = TRUE; + bChanged = sal_True; } } } @@ -305,7 +305,7 @@ void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDes void ScRangeData::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = false; ScToken* t; pCode->Reset(); @@ -323,7 +323,7 @@ void ScRangeData::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) (!rRef.Ref2.IsFlag3D() || !rRef.Ref2.IsTabRel())))) { if ( ScRefUpdate::UpdateGrow( rArea,nGrowX,nGrowY, rRef ) != UR_NOTHING ) - bChanged = TRUE; + bChanged = sal_True; } } } @@ -331,45 +331,45 @@ void ScRangeData::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ) bModified = bChanged; // muss direkt hinterher ausgewertet werden } -BOOL ScRangeData::operator== (const ScRangeData& rData) const // fuer Undo +sal_Bool ScRangeData::operator== (const ScRangeData& rData) const // fuer Undo { if ( nIndex != rData.nIndex || aName != rData.aName || aPos != rData.aPos || - eType != rData.eType ) return FALSE; + eType != rData.eType ) return false; - USHORT nLen = pCode->GetLen(); - if ( nLen != rData.pCode->GetLen() ) return FALSE; + sal_uInt16 nLen = pCode->GetLen(); + if ( nLen != rData.pCode->GetLen() ) return false; FormulaToken** ppThis = pCode->GetArray(); FormulaToken** ppOther = rData.pCode->GetArray(); - for ( USHORT i=0; i<nLen; i++ ) + for ( sal_uInt16 i=0; i<nLen; i++ ) if ( ppThis[i] != ppOther[i] && !(*ppThis[i] == *ppOther[i]) ) - return FALSE; + return false; - return TRUE; + return sal_True; } -BOOL ScRangeData::IsRangeAtBlock( const ScRange& rBlock ) const +sal_Bool ScRangeData::IsRangeAtBlock( const ScRange& rBlock ) const { - BOOL bRet = FALSE; + sal_Bool bRet = false; ScRange aRange; if ( IsReference(aRange) ) bRet = ( rBlock == aRange ); return bRet; } -BOOL ScRangeData::IsReference( ScRange& rRange ) const +sal_Bool ScRangeData::IsReference( ScRange& rRange ) const { if ( (eType & ( RT_ABSAREA | RT_REFAREA | RT_ABSPOS )) && pCode ) return pCode->IsReference( rRange ); - return FALSE; + return false; } -BOOL ScRangeData::IsReference( ScRange& rRange, const ScAddress& rPos ) const +sal_Bool ScRangeData::IsReference( ScRange& rRange, const ScAddress& rPos ) const { if ( (eType & ( RT_ABSAREA | RT_REFAREA | RT_ABSPOS ) ) && pCode ) { @@ -380,37 +380,37 @@ BOOL ScRangeData::IsReference( ScRange& rRange, const ScAddress& rPos ) const return pTemp->IsReference( rRange ); } - return FALSE; + return false; } -BOOL ScRangeData::IsValidReference( ScRange& rRange ) const +sal_Bool ScRangeData::IsValidReference( ScRange& rRange ) const { if ( (eType & ( RT_ABSAREA | RT_REFAREA | RT_ABSPOS ) ) && pCode ) return pCode->IsValidReference( rRange ); - return FALSE; + return false; } -void ScRangeData::UpdateTabRef(SCTAB nOldTable, USHORT nFlag, SCTAB nNewTable) +void ScRangeData::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTable) { pCode->Reset(); if( pCode->GetNextReference() ) { ScRangeData* pRangeData = NULL; // must not be dereferenced - BOOL bChanged; + sal_Bool bChanged; ScCompiler aComp( pDoc, aPos, *pCode); aComp.SetGrammar(pDoc->GetGrammar()); switch (nFlag) { case 1: // einfache InsertTab (doc.cxx) - pRangeData = aComp.UpdateInsertTab(nOldTable, TRUE ); // und CopyTab (doc2.cxx) + pRangeData = aComp.UpdateInsertTab(nOldTable, sal_True ); // und CopyTab (doc2.cxx) break; case 2: // einfaches delete (doc.cxx) - pRangeData = aComp.UpdateDeleteTab(nOldTable, FALSE, TRUE, bChanged); + pRangeData = aComp.UpdateDeleteTab(nOldTable, false, sal_True, bChanged); break; case 3: // move (doc2.cxx) { - pRangeData = aComp.UpdateMoveTab(nOldTable, nNewTable, TRUE ); + pRangeData = aComp.UpdateMoveTab(nOldTable, nNewTable, sal_True ); } break; default: @@ -472,18 +472,18 @@ void ScRangeData::MakeValidName( String& rName ) } } -BOOL ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc ) +sal_Bool ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc ) { /* XXX If changed, sc/source/filter/ftools/ftools.cxx * ScfTools::ConvertToScDefinedName needs to be changed too. */ xub_StrLen nPos = 0; xub_StrLen nLen = rName.Len(); if ( !nLen || !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_CHAR_NAME ) ) - return FALSE; + return false; while ( nPos < nLen ) { if ( !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_NAME ) ) - return FALSE; + return false; } ScAddress aAddr; ScRange aRange; @@ -493,9 +493,9 @@ BOOL ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc ) // Don't check Parse on VALID, any partial only VALID may result in // #REF! during compile later! if (aRange.Parse( rName, pDoc, details) || aAddr.Parse( rName, pDoc, details)) - return FALSE; + return false; } - return TRUE; + return sal_True; } void ScRangeData::SetMaxRow(SCROW nRow) @@ -519,15 +519,15 @@ SCCOL ScRangeData::GetMaxCol() const } -USHORT ScRangeData::GetErrCode() +sal_uInt16 ScRangeData::GetErrCode() { return pCode ? pCode->GetCodeError() : 0; } -BOOL ScRangeData::HasReferences() const +sal_Bool ScRangeData::HasReferences() const { pCode->Reset(); - return BOOL( pCode->GetNextReference() != NULL ); + return sal_Bool( pCode->GetNextReference() != NULL ); } // bei TransferTab von einem in ein anderes Dokument anpassen, @@ -703,9 +703,9 @@ public: class MatchByIndex : public unary_function<ScRangeData, bool> { - USHORT mnIndex; + sal_uInt16 mnIndex; public: - MatchByIndex(USHORT nIndex) : mnIndex(nIndex) {} + MatchByIndex(sal_uInt16 nIndex) : mnIndex(nIndex) {} bool operator() (const ScRangeData& r) const { return mnIndex == r.GetIndex(); @@ -755,7 +755,7 @@ const ScRangeData* ScRangeName::findByUpperName(const OUString& rName) const return itr == maData.end() ? NULL : &(*itr); } -ScRangeData* ScRangeName::findByIndex(USHORT i) +ScRangeData* ScRangeName::findByIndex(sal_uInt16 i) { DataType::iterator itr = std::find_if( maData.begin(), maData.end(), MatchByIndex(i)); @@ -839,11 +839,11 @@ bool ScRangeName::insert(ScRangeData* p) if (!p->GetIndex()) { // Assign a new index. An index must be unique. - USHORT nHigh = 0; + sal_uInt16 nHigh = 0; DataType::const_iterator itr = maData.begin(), itrEnd = maData.end(); for (; itr != itrEnd; ++itr) { - USHORT n = itr->GetIndex(); + sal_uInt16 n = itr->GetIndex(); if (n > nHigh) nHigh = n; } diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index d89e649b73c4..87c2a8f64556 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -57,7 +57,7 @@ long lcl_DoubleToLong( double fVal ) return 0; // out of range } -BOOL ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) +sal_Bool ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) { SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -65,12 +65,12 @@ BOOL ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument* pDoc, const S long nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); - uno::Sequence< uno::Sequence<INT32> > aRowSeq( nRowCount ); - uno::Sequence<INT32>* pRowAry = aRowSeq.getArray(); + uno::Sequence< uno::Sequence<sal_Int32> > aRowSeq( nRowCount ); + uno::Sequence<sal_Int32>* pRowAry = aRowSeq.getArray(); for (long nRow = 0; nRow < nRowCount; nRow++) { - uno::Sequence<INT32> aColSeq( nColCount ); - INT32* pColAry = aColSeq.getArray(); + uno::Sequence<sal_Int32> aColSeq( nColCount ); + sal_Int32* pColAry = aColSeq.getArray(); for (long nCol = 0; nCol < nColCount; nCol++) pColAry[nCol] = lcl_DoubleToLong( pDoc->GetValue( ScAddress( (SCCOL)(nStartCol+nCol), (SCROW)(nStartRow+nRow), nTab ) ) ); @@ -79,25 +79,25 @@ BOOL ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument* pDoc, const S } rAny <<= aRowSeq; - return TRUE; //! check for errors + return sal_True; //! check for errors } -BOOL ScRangeToSequence::FillLongArray( uno::Any& rAny, const ScMatrix* pMatrix ) +sal_Bool ScRangeToSequence::FillLongArray( uno::Any& rAny, const ScMatrix* pMatrix ) { if (!pMatrix) - return FALSE; + return false; SCSIZE nColCount; SCSIZE nRowCount; pMatrix->GetDimensions( nColCount, nRowCount ); - uno::Sequence< uno::Sequence<INT32> > aRowSeq( static_cast<sal_Int32>(nRowCount) ); - uno::Sequence<INT32>* pRowAry = aRowSeq.getArray(); + uno::Sequence< uno::Sequence<sal_Int32> > aRowSeq( static_cast<sal_Int32>(nRowCount) ); + uno::Sequence<sal_Int32>* pRowAry = aRowSeq.getArray(); for (SCSIZE nRow = 0; nRow < nRowCount; nRow++) { - uno::Sequence<INT32> aColSeq( static_cast<sal_Int32>(nColCount) ); - INT32* pColAry = aColSeq.getArray(); + uno::Sequence<sal_Int32> aColSeq( static_cast<sal_Int32>(nColCount) ); + sal_Int32* pColAry = aColSeq.getArray(); for (SCSIZE nCol = 0; nCol < nColCount; nCol++) if ( pMatrix->IsString( nCol, nRow ) ) pColAry[nCol] = 0; @@ -108,12 +108,12 @@ BOOL ScRangeToSequence::FillLongArray( uno::Any& rAny, const ScMatrix* pMatrix ) } rAny <<= aRowSeq; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScRangeToSequence::FillDoubleArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) +sal_Bool ScRangeToSequence::FillDoubleArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) { SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -135,14 +135,14 @@ BOOL ScRangeToSequence::FillDoubleArray( uno::Any& rAny, ScDocument* pDoc, const } rAny <<= aRowSeq; - return TRUE; //! check for errors + return sal_True; //! check for errors } -BOOL ScRangeToSequence::FillDoubleArray( uno::Any& rAny, const ScMatrix* pMatrix ) +sal_Bool ScRangeToSequence::FillDoubleArray( uno::Any& rAny, const ScMatrix* pMatrix ) { if (!pMatrix) - return FALSE; + return false; SCSIZE nColCount; SCSIZE nRowCount; @@ -164,12 +164,12 @@ BOOL ScRangeToSequence::FillDoubleArray( uno::Any& rAny, const ScMatrix* pMatrix } rAny <<= aRowSeq; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScRangeToSequence::FillStringArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) +sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange ) { SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -194,15 +194,15 @@ BOOL ScRangeToSequence::FillStringArray( uno::Any& rAny, ScDocument* pDoc, const } rAny <<= aRowSeq; - return TRUE; //! check for errors + return sal_True; //! check for errors } -BOOL ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMatrix, +sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMatrix, SvNumberFormatter* pFormatter ) { if (!pMatrix) - return FALSE; + return false; SCSIZE nColCount; SCSIZE nRowCount; @@ -235,7 +235,7 @@ BOOL ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMatrix } rAny <<= aRowSeq; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -254,8 +254,8 @@ double lcl_GetValueFromCell( ScBaseCell& rCell ) return 0; } -BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange, - BOOL bAllowNV ) +sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const ScRange& rRange, + sal_Bool bAllowNV ) { SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -264,7 +264,7 @@ BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); String aDocStr; - BOOL bHasErrors = FALSE; + sal_Bool bHasErrors = false; uno::Sequence< uno::Sequence<uno::Any> > aRowSeq( nRowCount ); uno::Sequence<uno::Any>* pRowAry = aRowSeq.getArray(); @@ -284,7 +284,7 @@ BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const ((ScFormulaCell*)pCell)->GetErrCode() != 0 ) { // if NV is allowed, leave empty for errors - bHasErrors = TRUE; + bHasErrors = sal_True; } else if ( pCell->HasValueData() ) rElement <<= (double) lcl_GetValueFromCell( *pCell ); @@ -302,10 +302,10 @@ BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const } -BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMatrix, bool bDataTypes ) +sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMatrix, bool bDataTypes ) { if (!pMatrix) - return FALSE; + return false; SCSIZE nColCount; SCSIZE nRowCount; @@ -340,7 +340,7 @@ BOOL ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMatrix, } rAny <<= aRowSeq; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -454,7 +454,7 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An //------------------------------------------------------------------------ -BOOL ScByteSequenceToString::GetString( String& rString, const uno::Any& rAny, +sal_Bool ScByteSequenceToString::GetString( String& rString, const uno::Any& rAny, sal_uInt16 nEncoding ) { uno::Sequence<sal_Int8> aSeq; @@ -463,9 +463,9 @@ BOOL ScByteSequenceToString::GetString( String& rString, const uno::Any& rAny, rString = String( (const sal_Char*)aSeq.getConstArray(), (xub_StrLen)aSeq.getLength(), nEncoding ); rString.EraseTrailingChars( (sal_Unicode) 0 ); - return TRUE; + return sal_True; } - return FALSE; + return false; } //------------------------------------------------------------------------ diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index fb9a7b3cdb0a..87020e34498b 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ -BOOL ScRangeUtil::MakeArea( const String& rAreaStr, +sal_Bool ScRangeUtil::MakeArea( const String& rAreaStr, ScArea& rArea, ScDocument* pDoc, SCTAB nTab, @@ -64,9 +64,9 @@ BOOL ScRangeUtil::MakeArea( const String& rAreaStr, // BROKEN BROKEN BROKEN // but it is only used in the consolidate dialog. Ignore for now. - BOOL nSuccess = FALSE; - USHORT nPointPos = rAreaStr.Search('.'); - USHORT nColonPos = rAreaStr.Search(':'); + sal_Bool nSuccess = false; + sal_uInt16 nPointPos = rAreaStr.Search('.'); + sal_uInt16 nColonPos = rAreaStr.Search(':'); String aStrArea( rAreaStr ); ScRefAddress startPos; ScRefAddress endPos; @@ -97,7 +97,7 @@ void ScRangeUtil::CutPosString( const String& theAreaStr, // BROKEN BROKEN BROKEN // but it is only used in the consolidate dialog. Ignore for now. - USHORT nColonPos = theAreaStr.Search(':'); + sal_uInt16 nColonPos = theAreaStr.Search(':'); if ( nColonPos != STRING_NOTFOUND ) aPosStr = theAreaStr.Copy( 0, nColonPos ); // ':' nicht mitkopieren @@ -109,16 +109,16 @@ void ScRangeUtil::CutPosString( const String& theAreaStr, //------------------------------------------------------------------------ -BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, +sal_Bool ScRangeUtil::IsAbsTabArea( const String& rAreaStr, ScDocument* pDoc, ScArea*** pppAreas, - USHORT* pAreaCount, - BOOL /* bAcceptCellRef */, + sal_uInt16* pAreaCount, + sal_Bool /* bAcceptCellRef */, ScAddress::Details const & rDetails ) const { DBG_ASSERT( pDoc, "Kein Dokument uebergeben!" ); if ( !pDoc ) - return FALSE; + return false; // BROKEN BROKEN BROKEN // but it is only used in the consolidate dialog. Ignore for now. @@ -126,7 +126,7 @@ BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, /* * Erwartet wird ein String der Form * "$Tabelle1.$A$1:$Tabelle3.$D$17" - * Wenn bAcceptCellRef == TRUE ist, wird auch ein String der Form + * Wenn bAcceptCellRef == sal_True ist, wird auch ein String der Form * "$Tabelle1.$A$1" * akzeptiert. * @@ -135,7 +135,7 @@ BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, * wieder geloescht werden muss! */ - BOOL bStrOk = FALSE; + sal_Bool bStrOk = false; String aTempAreaStr(rAreaStr); String aStartPosStr; String aEndPosStr; @@ -146,7 +146,7 @@ BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, aTempAreaStr.Append(rAreaStr); } - USHORT nColonPos = aTempAreaStr.Search(':'); + sal_uInt16 nColonPos = aTempAreaStr.Search(':'); if ( STRING_NOTFOUND != nColonPos && STRING_NOTFOUND != aTempAreaStr.Search('.') ) @@ -161,23 +161,23 @@ BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, { if ( ConvertSingleRef( pDoc, aEndPosStr, aStartPos.Tab(), aEndPos, rDetails ) ) { - aStartPos.SetRelCol( FALSE ); - aStartPos.SetRelRow( FALSE ); - aStartPos.SetRelTab( FALSE ); - aEndPos.SetRelCol( FALSE ); - aEndPos.SetRelRow( FALSE ); - aEndPos.SetRelTab( FALSE ); + aStartPos.SetRelCol( false ); + aStartPos.SetRelRow( false ); + aStartPos.SetRelTab( false ); + aEndPos.SetRelCol( false ); + aEndPos.SetRelRow( false ); + aEndPos.SetRelTab( false ); - bStrOk = TRUE; + bStrOk = sal_True; if ( pppAreas && pAreaCount ) // Array zurueckgegeben? { SCTAB nStartTab = aStartPos.Tab(); SCTAB nEndTab = aEndPos.Tab(); - USHORT nTabCount = static_cast<USHORT>(nEndTab-nStartTab+1); + sal_uInt16 nTabCount = static_cast<sal_uInt16>(nEndTab-nStartTab+1); ScArea** theAreas = new ScArea*[nTabCount]; SCTAB nTab = 0; - USHORT i = 0; + sal_uInt16 i = 0; ScArea theArea( 0, aStartPos.Col(), aStartPos.Row(), aEndPos.Col(), aEndPos.Row() ); @@ -200,7 +200,7 @@ BOOL ScRangeUtil::IsAbsTabArea( const String& rAreaStr, //------------------------------------------------------------------------ -BOOL ScRangeUtil::IsAbsArea( const String& rAreaStr, +sal_Bool ScRangeUtil::IsAbsArea( const String& rAreaStr, ScDocument* pDoc, SCTAB nTab, String* pCompleteStr, @@ -208,7 +208,7 @@ BOOL ScRangeUtil::IsAbsArea( const String& rAreaStr, ScRefAddress* pEndPos, ScAddress::Details const & rDetails ) const { - BOOL bIsAbsArea = FALSE; + sal_Bool bIsAbsArea = false; ScRefAddress startPos; ScRefAddress endPos; @@ -216,12 +216,12 @@ BOOL ScRangeUtil::IsAbsArea( const String& rAreaStr, if ( bIsAbsArea ) { - startPos.SetRelCol( FALSE ); - startPos.SetRelRow( FALSE ); - startPos.SetRelTab( FALSE ); - endPos .SetRelCol( FALSE ); - endPos .SetRelRow( FALSE ); - endPos .SetRelTab( FALSE ); + startPos.SetRelCol( false ); + startPos.SetRelRow( false ); + startPos.SetRelTab( false ); + endPos .SetRelCol( false ); + endPos .SetRelRow( false ); + endPos .SetRelTab( false ); if ( pCompleteStr ) { @@ -242,20 +242,20 @@ BOOL ScRangeUtil::IsAbsArea( const String& rAreaStr, //------------------------------------------------------------------------ -BOOL ScRangeUtil::IsAbsPos( const String& rPosStr, +sal_Bool ScRangeUtil::IsAbsPos( const String& rPosStr, ScDocument* pDoc, SCTAB nTab, String* pCompleteStr, ScRefAddress* pPosTripel, ScAddress::Details const & rDetails ) const { - BOOL bIsAbsPos = FALSE; + sal_Bool bIsAbsPos = false; ScRefAddress thePos; bIsAbsPos = ConvertSingleRef( pDoc, rPosStr, nTab, thePos, rDetails ); - thePos.SetRelCol( FALSE ); - thePos.SetRelRow( FALSE ); - thePos.SetRelTab( FALSE ); + thePos.SetRelCol( false ); + thePos.SetRelRow( false ); + thePos.SetRelTab( false ); if ( bIsAbsPos ) { @@ -270,7 +270,7 @@ BOOL ScRangeUtil::IsAbsPos( const String& rPosStr, //------------------------------------------------------------------------ -BOOL ScRangeUtil::MakeRangeFromName ( +sal_Bool ScRangeUtil::MakeRangeFromName ( const String& rName, ScDocument* pDoc, SCTAB nCurTab, @@ -278,7 +278,7 @@ BOOL ScRangeUtil::MakeRangeFromName ( RutlNameScope eScope, ScAddress::Details const & rDetails ) const { - BOOL bResult=FALSE; + sal_Bool bResult=false; ScRangeUtil aRangeUtil; SCTAB nTab = 0; SCCOL nColStart = 0; @@ -306,7 +306,7 @@ BOOL ScRangeUtil::MakeRangeFromName ( nRowStart = aStartPos.Row(); nColEnd = aEndPos.Col(); nRowEnd = aEndPos.Row(); - bResult = TRUE; + bResult = sal_True; } else { @@ -318,7 +318,7 @@ BOOL ScRangeUtil::MakeRangeFromName ( nTab = aStartPos.Tab(); nColStart = nColEnd = aStartPos.Col(); nRowStart = nRowEnd = aStartPos.Row(); - bResult = TRUE; + bResult = sal_True; } } } @@ -326,7 +326,7 @@ BOOL ScRangeUtil::MakeRangeFromName ( else if( eScope==RUTL_DBASE ) { ScDBCollection& rDbNames = *(pDoc->GetDBCollection()); - USHORT nAt = 0; + sal_uInt16 nAt = 0; if ( rDbNames.SearchName( rName, nAt ) ) { @@ -334,7 +334,7 @@ BOOL ScRangeUtil::MakeRangeFromName ( pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd ); - bResult = TRUE; + bResult = sal_True; } } else @@ -379,8 +379,8 @@ sal_Int32 ScRangeStringConverter::IndexOf( { sal_Int32 nLength = rString.getLength(); sal_Int32 nIndex = nOffset; - sal_Bool bQuoted = sal_False; - sal_Bool bExitLoop = sal_False; + sal_Bool bQuoted = false; + sal_Bool bExitLoop = false; while( !bExitLoop && (nIndex < nLength) ) { @@ -400,7 +400,7 @@ sal_Int32 ScRangeStringConverter::IndexOfDifferent( { sal_Int32 nLength = rString.getLength(); sal_Int32 nIndex = nOffset; - sal_Bool bExitLoop = sal_False; + sal_Bool bExitLoop = false; while( !bExitLoop && (nIndex < nLength) ) { @@ -479,7 +479,7 @@ sal_Bool ScRangeStringConverter::GetAddressFromString( if (eConv != eConvUI) return ((rAddress.Parse(sToken, const_cast<ScDocument*>(pDocument), eConvUI) & SCA_VALID) == SCA_VALID); } - return sal_False; + return false; } sal_Bool ScRangeStringConverter::GetRangeFromString( @@ -492,7 +492,7 @@ sal_Bool ScRangeStringConverter::GetRangeFromString( sal_Unicode cQuote ) { OUString sToken; - sal_Bool bResult(sal_False); + sal_Bool bResult(false); GetTokenByOffset( sToken, rRangeStr, nOffset, cSeperator, cQuote ); if( nOffset >= 0 ) { @@ -563,7 +563,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString( ) rRangeList.push_back( pRange ); else if (nOffset > -1) - bRet = sal_False; + bRet = false; } return bRet; } @@ -581,7 +581,7 @@ sal_Bool ScRangeStringConverter::GetAreaFromString( sal_Unicode cQuote ) { ScRange aScRange; - sal_Bool bResult(sal_False); + sal_Bool bResult(false); if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) ) { rArea.nTab = aScRange.aStart.Tab(); @@ -607,7 +607,7 @@ sal_Bool ScRangeStringConverter::GetAddressFromString( sal_Unicode cQuote ) { ScAddress aScAddress; - sal_Bool bResult(sal_False); + sal_Bool bResult(false); if( GetAddressFromString( aScAddress, rAddressStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) ) { ScUnoConversion::FillApiAddress( rAddress, aScAddress ); @@ -626,7 +626,7 @@ sal_Bool ScRangeStringConverter::GetRangeFromString( sal_Unicode cQuote ) { ScRange aScRange; - sal_Bool bResult(sal_False); + sal_Bool bResult(false); if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) ) { ScUnoConversion::FillApiRange( rRange, aScRange ); @@ -655,7 +655,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString( rRangeSeq[ rRangeSeq.getLength() - 1 ] = aRange; } else - bRet = sal_False; + bRet = false; } return bRet; } @@ -925,7 +925,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con ScAddress::ExternalInfo aExtInfo1, aExtInfo2; ScAddress aCell1, aCell2; rtl::OUString aBuf; - USHORT nRet = aCell1.Parse(aBeginCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo1); + sal_uInt16 nRet = aCell1.Parse(aBeginCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo1); if ((nRet & SCA_VALID) != SCA_VALID) { // first cell is invalid. @@ -969,7 +969,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con // Chart always saves ranges using CONV_OOO convention. ScAddress::ExternalInfo aExtInfo; ScAddress aCell; - USHORT nRet = aCell.Parse(aToken, pDoc, ::formula::FormulaGrammar::CONV_OOO, &aExtInfo); + sal_uInt16 nRet = aCell.Parse(aToken, pDoc, ::formula::FormulaGrammar::CONV_OOO, &aExtInfo); if ((nRet & SCA_VALID) != SCA_VALID) { nRet = aCell.Parse(aToken, pDoc, eConv, &aExtInfo); @@ -1025,7 +1025,7 @@ ScArea& ScArea::operator=( const ScArea& r ) //------------------------------------------------------------------------ -BOOL ScArea::operator==( const ScArea& r ) const +sal_Bool ScArea::operator==( const ScArea& r ) const { return ( (nTab == r.nTab) && (nColStart == r.nColStart) @@ -1050,7 +1050,7 @@ ScAreaNameIterator::ScAreaNameIterator( ScDocument* pDoc ) : } } -BOOL ScAreaNameIterator::Next( String& rName, ScRange& rRange ) +sal_Bool ScAreaNameIterator::Next( String& rName, ScRange& rRange ) { for (;;) { @@ -1083,11 +1083,11 @@ BOOL ScAreaNameIterator::Next( String& rName, ScRange& rRange ) { pData->GetArea( rRange ); rName = pData->GetName(); - return TRUE; // gefunden + return sal_True; // gefunden } } else - return FALSE; // gibt nichts mehr + return false; // gibt nichts mehr } } } diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index 4f0d93fcbe61..47dee0c8b956 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -47,12 +47,12 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) : { sal_uInt32 nDataSize; rStream >> nDataSize; - ULONG nDataPos = rStream.Tell(); + sal_uLong nDataPos = rStream.Tell(); nTotalEnd = nDataPos + nDataSize; nEntryEnd = nTotalEnd; rStream.SeekRel(nDataSize); - USHORT nID; + sal_uInt16 nID; rStream >> nID; if (nID != SCID_SIZES) { @@ -68,7 +68,7 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) : { sal_uInt32 nSizeTableLen; rStream >> nSizeTableLen; - pBuf = new BYTE[nSizeTableLen]; + pBuf = new sal_uInt8[nSizeTableLen]; rStream.Read( pBuf, nSizeTableLen ); pMemStream = new SvMemoryStream( (char*)pBuf, nSizeTableLen, STREAM_READ ); } @@ -93,7 +93,7 @@ ScMultipleReadHeader::~ScMultipleReadHeader() void ScMultipleReadHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" ); if ( nPos != nEntryEnd ) { @@ -107,7 +107,7 @@ void ScMultipleReadHeader::EndEntry() void ScMultipleReadHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); sal_uInt32 nEntrySize; (*pMemStream) >> nEntrySize; @@ -115,9 +115,9 @@ void ScMultipleReadHeader::StartEntry() DBG_ASSERT( nEntryEnd <= nTotalEnd, "zuviele Eintraege gelesen" ); } -ULONG ScMultipleReadHeader::BytesLeft() const +sal_uLong ScMultipleReadHeader::BytesLeft() const { - ULONG nReadEnd = rStream.Tell(); + sal_uLong nReadEnd = rStream.Tell(); if (nReadEnd <= nEntryEnd) return nEntryEnd-nReadEnd; @@ -140,16 +140,16 @@ ScMultipleWriteHeader::ScMultipleWriteHeader(SvStream& rNewStream, sal_uInt32 nD ScMultipleWriteHeader::~ScMultipleWriteHeader() { - ULONG nDataEnd = rStream.Tell(); + sal_uLong nDataEnd = rStream.Tell(); - rStream << (USHORT) SCID_SIZES; + rStream << (sal_uInt16) SCID_SIZES; rStream << static_cast<sal_uInt32>(aMemStream.Tell()); rStream.Write( aMemStream.GetData(), aMemStream.Tell() ); if ( nDataEnd - nDataPos != nDataSize ) // Default getroffen? { nDataSize = nDataEnd - nDataPos; - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek(nDataPos-sizeof(sal_uInt32)); rStream << nDataSize; // Groesse am Anfang eintragen rStream.Seek(nPos); @@ -158,13 +158,13 @@ ScMultipleWriteHeader::~ScMultipleWriteHeader() void ScMultipleWriteHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); aMemStream << static_cast<sal_uInt32>(nPos - nEntryStart); } void ScMultipleWriteHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); nEntryStart = nPos; } diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx index 07c8442f6bd7..a4bbe7d65d54 100644 --- a/sc/source/core/tool/refdata.cxx +++ b/sc/source/core/tool/refdata.cxx @@ -67,25 +67,25 @@ void ScSingleRefData::CalcAbsIfRel( const ScAddress& rPos ) { nCol = nRelCol + rPos.Col(); if ( !VALIDCOL( nCol ) ) - Flags.bColDeleted = TRUE; + Flags.bColDeleted = sal_True; } if ( Flags.bRowRel ) { nRow = nRelRow + rPos.Row(); if ( !VALIDROW( nRow ) ) - Flags.bRowDeleted = TRUE; + Flags.bRowDeleted = sal_True; } if ( Flags.bTabRel ) { nTab = nRelTab + rPos.Tab(); if ( !VALIDTAB( nTab ) ) - Flags.bTabDeleted = TRUE; + Flags.bTabDeleted = sal_True; } } -BOOL ScSingleRefData::operator==( const ScSingleRefData& r ) const +sal_Bool ScSingleRefData::operator==( const ScSingleRefData& r ) const { return bFlags == r.bFlags && (Flags.bColRel ? nRelCol == r.nRelCol : nCol == r.nCol) && @@ -103,8 +103,8 @@ static void lcl_putInOrder( ScSingleRefData & rRef1, ScSingleRefData & rRef2 ) SCCOL nCol1, nCol2; SCROW nRow1, nRow2; SCTAB nTab1, nTab2; - BOOL bTmp; - BYTE nRelState1, nRelState2; + sal_Bool bTmp; + sal_uInt8 nRelState1, nRelState2; if ( rRef1.Flags.bRelName ) nRelState1 = ((rRef1.Flags.bTabRel & 0x01) << 2) @@ -185,8 +185,8 @@ static void lcl_putInOrder( ScSingleRefData & rRef1, ScSingleRefData & rRef2 ) rRef1.Flags.bTabDeleted = rRef2.Flags.bTabDeleted; rRef2.Flags.bTabDeleted = bTmp; } - rRef1.Flags.bRelName = ( nRelState1 ? TRUE : FALSE ); - rRef2.Flags.bRelName = ( nRelState2 ? TRUE : FALSE ); + rRef1.Flags.bRelName = ( nRelState1 ? sal_True : false ); + rRef2.Flags.bRelName = ( nRelState2 ? sal_True : false ); } diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx index 74c62e51f767..a3b2ce55585d 100644 --- a/sc/source/core/tool/reffind.cxx +++ b/sc/source/core/tool/reffind.cxx @@ -49,7 +49,7 @@ const sal_Unicode ScRefFinder::pDelimiters[] = { // ======================================================================= -inline BOOL IsText( sal_Unicode c ) +inline sal_Bool IsText( sal_Unicode c ) { bool bFound = ScGlobal::UnicodeStrChr( ScRefFinder::pDelimiters, c ); if (bFound) @@ -61,15 +61,15 @@ inline BOOL IsText( sal_Unicode c ) return c != sep; } -inline BOOL IsText( BOOL& bQuote, sal_Unicode c ) +inline sal_Bool IsText( sal_Bool& bQuote, sal_Unicode c ) { if ( c == '\'' ) { bQuote = !bQuote; - return TRUE; + return sal_True; } if ( bQuote ) - return TRUE; + return sal_True; return IsText( c ); } @@ -86,9 +86,9 @@ ScRefFinder::~ScRefFinder() { } -USHORT lcl_NextFlags( USHORT nOld ) +sal_uInt16 lcl_NextFlags( sal_uInt16 nOld ) { - USHORT nNew = nOld & 7; // die drei Abs-Flags + sal_uInt16 nNew = nOld & 7; // die drei Abs-Flags nNew = ( nNew - 1 ) & 7; // weiterzaehlen if (!(nOld & SCA_TAB_3D)) @@ -132,7 +132,7 @@ void ScRefFinder::ToggleRel( xub_StrLen nStartPos, xub_StrLen nEndPos ) while ( nEStart <= nEndPos && !IsText(pSource[nEStart]) ) ++nEStart; - BOOL bQuote = FALSE; + sal_Bool bQuote = false; xub_StrLen nEEnd = nEStart; while ( nEEnd <= nEndPos && IsText(bQuote,pSource[nEEnd]) ) ++nEEnd; @@ -142,10 +142,10 @@ void ScRefFinder::ToggleRel( xub_StrLen nStartPos, xub_StrLen nEndPos ) // Test, ob aExpr eine Referenz ist - USHORT nResult = aAddr.Parse( aExpr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = aAddr.Parse( aExpr, pDoc, pDoc->GetAddressConvention() ); if ( nResult & SCA_VALID ) { - USHORT nFlags = lcl_NextFlags( nResult ); + sal_uInt16 nFlags = lcl_NextFlags( nResult ); aAddr.Format( aExpr, nFlags, pDoc, pDoc->GetAddressConvention() ); xub_StrLen nAbsStart = nStartPos+aResult.Len()+aSep.Len(); diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx index e12916a9f907..ced9c1ebaa48 100644 --- a/sc/source/core/tool/refreshtimer.cxx +++ b/sc/source/core/tool/refreshtimer.cxx @@ -40,7 +40,7 @@ ScRefreshTimerProtector::ScRefreshTimerProtector( ScRefreshTimerControl * const { if ( ppControl && *ppControl ) { - (*ppControl)->SetAllowRefresh( FALSE ); + (*ppControl)->SetAllowRefresh( false ); // wait for any running refresh in another thread to finnish ::osl::MutexGuard aGuard( (*ppControl)->GetMutex() ); } @@ -55,9 +55,9 @@ ScRefreshTimer::~ScRefreshTimer() } -void ScRefreshTimer::SetRefreshDelay( ULONG nSeconds ) +void ScRefreshTimer::SetRefreshDelay( sal_uLong nSeconds ) { - BOOL bActive = IsActive(); + sal_Bool bActive = IsActive(); if ( bActive && !nSeconds ) Stop(); SetTimeout( nSeconds * 1000 ); diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index 39dade20b41d..26167cdf8ba1 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -72,7 +72,7 @@ void ScRefTokenHelper::compileRangeRepresentation( // There MUST be exactly one reference per range token and nothing // else, and it MUST be a valid reference, not some #REF! - USHORT nLen = pArray->GetLen(); + sal_uInt16 nLen = pArray->GetLen(); if (!nLen) continue; // Should a missing range really be allowed? if (nLen != 1) diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 970a85d3392a..e084b5e76d75 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -42,9 +42,9 @@ //------------------------------------------------------------------------ template< typename R, typename S, typename U > -BOOL lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) +sal_Bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) { - BOOL bCut = FALSE; + sal_Bool bCut = false; if ( rRef >= nStart ) rRef = sal::static_int_cast<R>( rRef + nDelta ); else if ( nDelta < 0 && rRef >= nStart + nDelta ) @@ -52,20 +52,20 @@ BOOL lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) if ( rRef < 0 ) { rRef = 0; - bCut = TRUE; + bCut = sal_True; } else if ( rRef > nMask ) { rRef = nMask; - bCut = TRUE; + bCut = sal_True; } return bCut; } template< typename R, typename S, typename U > -BOOL lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) +sal_Bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) { - BOOL bCut = FALSE; + sal_Bool bCut = false; if ( rRef >= nStart ) rRef = sal::static_int_cast<R>( rRef + nDelta ); else if ( nDelta < 0 && rRef >= nStart + nDelta ) @@ -73,23 +73,23 @@ BOOL lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) if ( rRef < 0 ) { rRef = 0; - bCut = TRUE; + bCut = sal_True; } else if ( rRef > nMask ) { rRef = nMask; - bCut = TRUE; + bCut = sal_True; } return bCut; } template< typename R, typename S, typename U > -BOOL lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) +sal_Bool lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) { if ( rRef >= nStart && rRef <= nEnd ) { rRef = sal::static_int_cast<R>( rRef + nDelta ); - return TRUE; + return sal_True; } if ( nDelta > 0 ) // nach hinten schieben @@ -100,7 +100,7 @@ BOOL lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) rRef = sal::static_int_cast<R>( rRef + nDelta ); // in the moved range else rRef -= nEnd - nStart + 1; // nachruecken - return TRUE; + return sal_True; } } else // nach vorne schieben @@ -111,27 +111,27 @@ BOOL lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) rRef = sal::static_int_cast<R>( rRef + nDelta ); // in the moved range else rRef += nEnd - nStart + 1; // nachruecken - return TRUE; + return sal_True; } } - return FALSE; + return false; } template< typename R, typename S, typename U > -BOOL lcl_MoveItCut( R& rRef, S nDelta, U nMask ) +sal_Bool lcl_MoveItCut( R& rRef, S nDelta, U nMask ) { - BOOL bCut = FALSE; + sal_Bool bCut = false; rRef = sal::static_int_cast<R>( rRef + nDelta ); if ( rRef < 0 ) { rRef = 0; - bCut = TRUE; + bCut = sal_True; } else if ( rRef > nMask ) { rRef = nMask; - bCut = TRUE; + bCut = sal_True; } return bCut; } @@ -147,14 +147,14 @@ void lcl_MoveItWrap( R& rRef, S nDelta, U nMask ) } template< typename R, typename S, typename U > -BOOL lcl_MoveRefPart( R& rRef1Val, BOOL& rRef1Del, BOOL bDo1, - R& rRef2Val, BOOL& rRef2Del, BOOL bDo2, +sal_Bool lcl_MoveRefPart( R& rRef1Val, sal_Bool& rRef1Del, sal_Bool bDo1, + R& rRef2Val, sal_Bool& rRef2Del, sal_Bool bDo2, U nStart, U nEnd, S nDelta, U nMask ) { if ( nDelta ) { - BOOL bDel, bCut1, bCut2; - bDel = bCut1 = bCut2 = FALSE; + sal_Bool bDel, bCut1, bCut2; + bDel = bCut1 = bCut2 = false; S n; if (bDo1 && bDo2) { @@ -163,14 +163,14 @@ BOOL lcl_MoveRefPart( R& rRef1Val, BOOL& rRef1Del, BOOL bDo1, n = nStart + nDelta; if ( n <= rRef1Val && rRef1Val < nStart && n <= rRef2Val && rRef2Val < nStart ) - bDel = TRUE; + bDel = sal_True; } else { n = nEnd + nDelta; if ( nEnd < rRef1Val && rRef1Val <= n && nEnd < rRef2Val && rRef2Val <= n ) - bDel = TRUE; + bDel = sal_True; } } if ( bDel ) @@ -196,15 +196,15 @@ BOOL lcl_MoveRefPart( R& rRef1Val, BOOL& rRef1Del, BOOL bDo1, } } if ( bDel || (bCut1 && bCut2) ) - rRef1Del = rRef2Del = TRUE; + rRef1Del = rRef2Del = sal_True; return bDel || bCut1 || bCut2 || rRef1Del || rRef2Del; } else - return FALSE; + return false; } template< typename R, typename S, typename U > -BOOL IsExpand( R n1, R n2, U nStart, S nD ) +sal_Bool IsExpand( R n1, R n2, U nStart, S nD ) { //! vor normalem Move... return nD > 0 // Insert @@ -218,7 +218,7 @@ BOOL IsExpand( R n1, R n2, U nStart, S nD ) template< typename R, typename S, typename U > void Expand( R& n1, R& n2, U nStart, S nD ) -{ //! nach normalem Move..., nur wenn IsExpand vorher TRUE war! +{ //! nach normalem Move..., nur wenn IsExpand vorher sal_True war! //! erst das Ende if ( n2 + 1 == nStart ) { // am Ende @@ -230,19 +230,19 @@ void Expand( R& n1, R& n2, U nStart, S nD ) } -BOOL lcl_IsWrapBig( INT32 nRef, INT32 nDelta ) +sal_Bool lcl_IsWrapBig( sal_Int32 nRef, sal_Int32 nDelta ) { if ( nRef > 0 && nDelta > 0 ) return nRef + nDelta <= 0; else if ( nRef < 0 && nDelta < 0 ) return nRef + nDelta >= 0; - return FALSE; + return false; } -BOOL lcl_MoveBig( INT32& rRef, INT32 nStart, INT32 nDelta ) +sal_Bool lcl_MoveBig( sal_Int32& rRef, sal_Int32 nStart, sal_Int32 nDelta ) { - BOOL bCut = FALSE; + sal_Bool bCut = false; if ( rRef >= nStart ) { if ( nDelta > 0 ) @@ -255,9 +255,9 @@ BOOL lcl_MoveBig( INT32& rRef, INT32 nStart, INT32 nDelta ) return bCut; } -BOOL lcl_MoveItCutBig( INT32& rRef, INT32 nDelta ) +sal_Bool lcl_MoveItCutBig( sal_Int32& rRef, sal_Int32 nDelta ) { - BOOL bCut = lcl_IsWrapBig( rRef, nDelta ); + sal_Bool bCut = lcl_IsWrapBig( rRef, nDelta ); rRef += nDelta; return bCut; } @@ -279,15 +279,15 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo SCROW oldRow2 = theRow2; SCTAB oldTab2 = theTab2; - BOOL bCut1, bCut2; + sal_Bool bCut1, bCut2; if (eUpdateRefMode == URM_INSDEL) { - BOOL bExpand = pDoc->IsExpandRefs(); + sal_Bool bExpand = pDoc->IsExpandRefs(); if ( nDx && (theRow1 >= nRow1) && (theRow2 <= nRow2) && (theTab1 >= nTab1) && (theTab2 <= nTab2) ) { - BOOL bExp = (bExpand && IsExpand( theCol1, theCol2, nCol1, nDx )); + sal_Bool bExp = (bExpand && IsExpand( theCol1, theCol2, nCol1, nDx )); bCut1 = lcl_MoveStart( theCol1, nCol1, nDx, MAXCOL ); bCut2 = lcl_MoveEnd( theCol2, nCol1, nDx, MAXCOL ); if ( theCol2 < theCol1 ) @@ -306,7 +306,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo if ( nDy && (theCol1 >= nCol1) && (theCol2 <= nCol2) && (theTab1 >= nTab1) && (theTab2 <= nTab2) ) { - BOOL bExp = (bExpand && IsExpand( theRow1, theRow2, nRow1, nDy )); + sal_Bool bExp = (bExpand && IsExpand( theRow1, theRow2, nRow1, nDy )); bCut1 = lcl_MoveStart( theRow1, nRow1, nDy, MAXROW ); bCut2 = lcl_MoveEnd( theRow2, nRow1, nDy, MAXROW ); if ( theRow2 < theRow1 ) @@ -327,7 +327,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo { SCsTAB nMaxTab = pDoc->GetTableCount() - 1; nMaxTab = sal::static_int_cast<SCsTAB>(nMaxTab + nDz); // adjust to new count - BOOL bExp = (bExpand && IsExpand( theTab1, theTab2, nTab1, nDz )); + sal_Bool bExp = (bExpand && IsExpand( theTab1, theTab2, nTab1, nDz )); bCut1 = lcl_MoveStart( theTab1, nTab1, nDz, static_cast<SCTAB>(nMaxTab) ); bCut2 = lcl_MoveEnd( theTab2, nTab1, nDz, static_cast<SCTAB>(nMaxTab) ); if ( theTab2 < theTab1 ) @@ -407,18 +407,18 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo // Referenzen koennen auch ausserhalb des Dokuments liegen! // Ganze Spalten/Zeilen (nInt32Min..nInt32Max) bleiben immer solche! ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, - const ScBigRange& rWhere, INT32 nDx, INT32 nDy, INT32 nDz, + const ScBigRange& rWhere, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz, ScBigRange& rWhat ) { ScRefUpdateRes eRet = UR_NOTHING; const ScBigRange aOldRange( rWhat ); - INT32 nCol1, nRow1, nTab1, nCol2, nRow2, nTab2; - INT32 theCol1, theRow1, theTab1, theCol2, theRow2, theTab2; + sal_Int32 nCol1, nRow1, nTab1, nCol2, nRow2, nTab2; + sal_Int32 theCol1, theRow1, theTab1, theCol2, theRow2, theTab2; rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); rWhat.GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 ); - BOOL bCut1, bCut2; + sal_Bool bCut1, bCut2; if (eUpdateRefMode == URM_INSDEL) { @@ -513,11 +513,11 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, if( eMode == URM_INSDEL ) { - BOOL bExpand = pDoc->IsExpandRefs(); + sal_Bool bExpand = pDoc->IsExpandRefs(); const ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); - BOOL bInDeleteUndo = - ( pChangeTrack ? pChangeTrack->IsInDeleteUndo() : FALSE ); + sal_Bool bInDeleteUndo = + ( pChangeTrack ? pChangeTrack->IsInDeleteUndo() : false ); SCCOL oldCol1 = rRef.Ref1.nCol; SCROW oldRow1 = rRef.Ref1.nRow; @@ -526,12 +526,12 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, SCROW oldRow2 = rRef.Ref2.nRow; SCTAB oldTab2 = rRef.Ref2.nTab; - BOOL bRef1ColDel = rRef.Ref1.IsColDeleted(); - BOOL bRef2ColDel = rRef.Ref2.IsColDeleted(); - BOOL bRef1RowDel = rRef.Ref1.IsRowDeleted(); - BOOL bRef2RowDel = rRef.Ref2.IsRowDeleted(); - BOOL bRef1TabDel = rRef.Ref1.IsTabDeleted(); - BOOL bRef2TabDel = rRef.Ref2.IsTabDeleted(); + sal_Bool bRef1ColDel = rRef.Ref1.IsColDeleted(); + sal_Bool bRef2ColDel = rRef.Ref2.IsColDeleted(); + sal_Bool bRef1RowDel = rRef.Ref1.IsRowDeleted(); + sal_Bool bRef2RowDel = rRef.Ref2.IsRowDeleted(); + sal_Bool bRef1TabDel = rRef.Ref1.IsTabDeleted(); + sal_Bool bRef2TabDel = rRef.Ref2.IsTabDeleted(); if( nDx && ((rRef.Ref1.nRow >= nRow1 @@ -541,11 +541,11 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, && rRef.Ref2.nTab <= nTab2) || (bRef1TabDel || bRef2TabDel)) ) { - BOOL bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nCol, + sal_Bool bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nCol, rRef.Ref2.nCol, nCol1, nDx )); - BOOL bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref1.IsColRel())); - BOOL bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref2.IsColRel())); if ( lcl_MoveRefPart( rRef.Ref1.nCol, bRef1ColDel, bDo1, rRef.Ref2.nCol, bRef2ColDel, bDo2, @@ -556,17 +556,17 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, { if ( bRef1ColDel && nCol1 <= rRef.Ref1.nCol && rRef.Ref1.nCol <= nCol1 + nDx ) - rRef.Ref1.SetColDeleted( FALSE ); + rRef.Ref1.SetColDeleted( false ); if ( bRef2ColDel && nCol1 <= rRef.Ref2.nCol && rRef.Ref2.nCol <= nCol1 + nDx ) - rRef.Ref2.SetColDeleted( FALSE ); + rRef.Ref2.SetColDeleted( false ); } else { if ( bRef1ColDel ) - rRef.Ref1.SetColDeleted( TRUE ); + rRef.Ref1.SetColDeleted( sal_True ); if ( bRef2ColDel ) - rRef.Ref2.SetColDeleted( TRUE ); + rRef.Ref2.SetColDeleted( sal_True ); } } if ( bExp ) @@ -583,11 +583,11 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, && rRef.Ref2.nTab <= nTab2) || (bRef1TabDel || bRef2TabDel)) ) { - BOOL bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nRow, + sal_Bool bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nRow, rRef.Ref2.nRow, nRow1, nDy )); - BOOL bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref1.IsRowRel())); - BOOL bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref2.IsRowRel())); if ( lcl_MoveRefPart( rRef.Ref1.nRow, bRef1RowDel, bDo1, rRef.Ref2.nRow, bRef2RowDel, bDo2, @@ -598,17 +598,17 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, { if ( bRef1RowDel && nRow1 <= rRef.Ref1.nRow && rRef.Ref1.nRow <= nRow1 + nDy ) - rRef.Ref1.SetRowDeleted( FALSE ); + rRef.Ref1.SetRowDeleted( false ); if ( bRef2RowDel && nRow1 <= rRef.Ref2.nRow && rRef.Ref2.nRow <= nRow1 + nDy ) - rRef.Ref2.SetRowDeleted( FALSE ); + rRef.Ref2.SetRowDeleted( false ); } else { if ( bRef1RowDel ) - rRef.Ref1.SetRowDeleted( TRUE ); + rRef.Ref1.SetRowDeleted( sal_True ); if ( bRef2RowDel ) - rRef.Ref2.SetRowDeleted( TRUE ); + rRef.Ref2.SetRowDeleted( sal_True ); } } if ( bExp ) @@ -625,12 +625,12 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, && rRef.Ref2.nRow <= nRow2) || (bRef1RowDel || bRef2RowDel)) ) { - BOOL bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nTab, + sal_Bool bExp = (bExpand && !bInDeleteUndo && IsExpand( rRef.Ref1.nTab, rRef.Ref2.nTab, nTab1, nDz )); SCTAB nMaxTab = pDoc->GetTableCount() - 1; - BOOL bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo1 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref1.IsTabRel())); - BOOL bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == + sal_Bool bDo2 = (eWhat == ScRefUpdate::ALL || (eWhat == ScRefUpdate::ABSOLUTE && !rRef.Ref2.IsTabRel())); if ( lcl_MoveRefPart( rRef.Ref1.nTab, bRef1TabDel, bDo1, rRef.Ref2.nTab, bRef2TabDel, bDo2, @@ -641,17 +641,17 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, { if ( bRef1TabDel && nTab1 <= rRef.Ref1.nTab && rRef.Ref1.nTab <= nTab1 + nDz ) - rRef.Ref1.SetTabDeleted( FALSE ); + rRef.Ref1.SetTabDeleted( false ); if ( bRef2TabDel && nTab1 <= rRef.Ref2.nTab && rRef.Ref2.nTab <= nTab1 + nDz ) - rRef.Ref2.SetTabDeleted( FALSE ); + rRef.Ref2.SetTabDeleted( false ); } else { if ( bRef1TabDel ) - rRef.Ref1.SetTabDeleted( TRUE ); + rRef.Ref1.SetTabDeleted( sal_True ); if ( bRef2TabDel ) - rRef.Ref2.SetTabDeleted( TRUE ); + rRef.Ref2.SetTabDeleted( sal_True ); } } if ( bExp ) @@ -685,12 +685,12 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, && rRef.Ref2.nRow <= nRow2-nDy && rRef.Ref2.nTab <= nTab2-nDz ) { - eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, FALSE, TRUE ); // immer verschieben + eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, false, sal_True ); // immer verschieben } else if ( nDz && r.In( rPos ) ) { - rRef.Ref1.SetFlag3D( TRUE ); - rRef.Ref2.SetFlag3D( TRUE ); + rRef.Ref1.SetFlag3D( sal_True ); + rRef.Ref2.SetFlag3D( sal_True ); eRet = UR_UPDATED; if (eWhat != ScRefUpdate::ABSOLUTE) rRef.CalcRelFromAbs( rPos ); @@ -699,7 +699,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, rRef.CalcRelFromAbs( rPos ); } else if( eMode == URM_COPY && r.In( rPos ) ) - eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, FALSE, FALSE ); // nur relative + eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, false, false ); // nur relative // sollte nicht mehr verwendet werden muessen else if (eWhat != ScRefUpdate::ABSOLUTE) rRef.CalcRelFromAbs( rPos ); @@ -710,7 +710,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode, ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, - ScComplexRefData& rRef, BOOL bWrap, BOOL bAbsolute ) + ScComplexRefData& rRef, sal_Bool bWrap, sal_Bool bAbsolute ) { ScRefUpdateRes eRet = UR_NOTHING; @@ -721,10 +721,10 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos, SCROW oldRow2 = rRef.Ref2.nRow; SCTAB oldTab2 = rRef.Ref2.nTab; - BOOL bCut1, bCut2; + sal_Bool bCut1, bCut2; if ( nDx ) { - bCut1 = bCut2 = FALSE; + bCut1 = bCut2 = false; if( bAbsolute || rRef.Ref1.IsColRel() ) { if( bWrap ) @@ -743,13 +743,13 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos, eRet = UR_UPDATED; if ( bCut1 && bCut2 ) { - rRef.Ref1.SetColDeleted( TRUE ); - rRef.Ref2.SetColDeleted( TRUE ); + rRef.Ref1.SetColDeleted( sal_True ); + rRef.Ref2.SetColDeleted( sal_True ); } } if ( nDy ) { - bCut1 = bCut2 = FALSE; + bCut1 = bCut2 = false; if( bAbsolute || rRef.Ref1.IsRowRel() ) { if( bWrap ) @@ -768,13 +768,13 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos, eRet = UR_UPDATED; if ( bCut1 && bCut2 ) { - rRef.Ref1.SetRowDeleted( TRUE ); - rRef.Ref2.SetRowDeleted( TRUE ); + rRef.Ref1.SetRowDeleted( sal_True ); + rRef.Ref2.SetRowDeleted( sal_True ); } } if ( nDz ) { - bCut1 = bCut2 = FALSE; + bCut1 = bCut2 = false; SCsTAB nMaxTab = (SCsTAB) pDoc->GetTableCount() - 1; if( bAbsolute || rRef.Ref1.IsTabRel() ) { @@ -796,8 +796,8 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos, eRet = UR_UPDATED; if ( bCut1 && bCut2 ) { - rRef.Ref1.SetTabDeleted( TRUE ); - rRef.Ref2.SetTabDeleted( TRUE ); + rRef.Ref1.SetTabDeleted( sal_True ); + rRef.Ref2.SetTabDeleted( sal_True ); } } @@ -913,11 +913,11 @@ ScRefUpdateRes ScRefUpdate::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCRO // in Y-Richtung darf die Ref auch eine Zeile weiter unten anfangen, // falls ein Bereich Spaltenkoepfe enthaelt - BOOL bUpdateX = ( nGrowX && + sal_Bool bUpdateX = ( nGrowX && rRef.Ref1.nCol == rArea.aStart.Col() && rRef.Ref2.nCol == rArea.aEnd.Col() && rRef.Ref1.nRow >= rArea.aStart.Row() && rRef.Ref2.nRow <= rArea.aEnd.Row() && rRef.Ref1.nTab >= rArea.aStart.Tab() && rRef.Ref2.nTab <= rArea.aEnd.Tab() ); - BOOL bUpdateY = ( nGrowY && + sal_Bool bUpdateY = ( nGrowY && rRef.Ref1.nCol >= rArea.aStart.Col() && rRef.Ref2.nCol <= rArea.aEnd.Col() && ( rRef.Ref1.nRow == rArea.aStart.Row() || rRef.Ref1.nRow == rArea.aStart.Row()+1 ) && rRef.Ref2.nRow == rArea.aEnd.Row() && diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 22b316aa71de..9add45e417ec 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -194,7 +194,7 @@ public: SCSIZE CalcOffset( SCSIZE nC, SCSIZE nR) const; bool ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const; bool ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const; - void SetErrorAtInterpreter( USHORT nError ) const; + void SetErrorAtInterpreter( sal_uInt16 nError ) const; void PutDouble(double fVal, SCSIZE nC, SCSIZE nR); void PutDouble( double fVal, SCSIZE nIndex); void PutString(const String& rStr, SCSIZE nC, SCSIZE nR); @@ -202,9 +202,9 @@ public: void PutEmpty(SCSIZE nC, SCSIZE nR); void PutEmptyPath(SCSIZE nC, SCSIZE nR); - void PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ); + void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ); void PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR); - USHORT GetError( SCSIZE nC, SCSIZE nR) const; + sal_uInt16 GetError( SCSIZE nC, SCSIZE nR) const; double GetDouble(SCSIZE nC, SCSIZE nR) const; double GetDouble( SCSIZE nIndex) const; const String& GetString(SCSIZE nC, SCSIZE nR) const; @@ -337,7 +337,7 @@ bool ScMatrixImpl::ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const return ValidColRow( rC, rR) || ValidColRowReplicated( rC, rR); } -void ScMatrixImpl::SetErrorAtInterpreter( USHORT nError ) const +void ScMatrixImpl::SetErrorAtInterpreter( sal_uInt16 nError ) const { if ( pErrorInterpreter ) pErrorInterpreter->SetError( nError); @@ -403,7 +403,7 @@ void ScMatrixImpl::PutEmptyPath(SCSIZE nC, SCSIZE nR) } } -void ScMatrixImpl::PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ) +void ScMatrixImpl::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ) { maMat.set_numeric(nR, nC, CreateDoubleError(nErrorCode)); } @@ -418,7 +418,7 @@ void ScMatrixImpl::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) } } -USHORT ScMatrixImpl::GetError( SCSIZE nC, SCSIZE nR) const +sal_uInt16 ScMatrixImpl::GetError( SCSIZE nC, SCSIZE nR) const { if (ValidColRowOrReplicated( nC, nR )) { @@ -439,7 +439,7 @@ double ScMatrixImpl::GetDouble(SCSIZE nC, SCSIZE nR) const double fVal = maMat.get_numeric(nR, nC); if ( pErrorInterpreter ) { - USHORT nError = GetDoubleErrorValue(fVal); + sal_uInt16 nError = GetDoubleErrorValue(fVal); if ( nError ) SetErrorAtInterpreter( nError); } @@ -497,7 +497,7 @@ String ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE { if (IsEmptyPath( nC, nR)) { // result of empty FALSE jump path - ULONG nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL, + sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL, ScGlobal::eLnge); String aStr; Color* pColor = NULL; @@ -507,7 +507,7 @@ String ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE return GetString( nC, nR); } - USHORT nError = GetError( nC, nR); + sal_uInt16 nError = GetError( nC, nR); if (nError) { SetErrorAtInterpreter( nError); @@ -515,7 +515,7 @@ String ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE } double fVal= GetDouble( nC, nR); - ULONG nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_NUMBER, + sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); String aStr; rFormatter.GetInputLineString( fVal, nKey, aStr); @@ -1039,7 +1039,7 @@ void ScMatrix::PutEmptyPath(SCSIZE nC, SCSIZE nR) pImpl->PutEmptyPath(nC, nR); } -void ScMatrix::PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ) +void ScMatrix::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ) { pImpl->PutError(nErrorCode, nC, nR); } @@ -1049,7 +1049,7 @@ void ScMatrix::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) pImpl->PutBoolean(bVal, nC, nR); } -USHORT ScMatrix::GetError( SCSIZE nC, SCSIZE nR) const +sal_uInt16 ScMatrix::GetError( SCSIZE nC, SCSIZE nR) const { return pImpl->GetError(nC, nR); } @@ -1084,47 +1084,47 @@ ScMatrixValue ScMatrix::Get(SCSIZE nC, SCSIZE nR) const return pImpl->Get(nC, nR); } -BOOL ScMatrix::IsString( SCSIZE nIndex ) const +sal_Bool ScMatrix::IsString( SCSIZE nIndex ) const { return pImpl->IsString(nIndex); } -BOOL ScMatrix::IsString( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsString( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsString(nC, nR); } -BOOL ScMatrix::IsEmpty( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsEmpty( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsEmpty(nC, nR); } -BOOL ScMatrix::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsEmptyPath(nC, nR); } -BOOL ScMatrix::IsValue( SCSIZE nIndex ) const +sal_Bool ScMatrix::IsValue( SCSIZE nIndex ) const { return pImpl->IsValue(nIndex); } -BOOL ScMatrix::IsValue( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsValue( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsValue(nC, nR); } -BOOL ScMatrix::IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsValueOrEmpty(nC, nR); } -BOOL ScMatrix::IsBoolean( SCSIZE nC, SCSIZE nR ) const +sal_Bool ScMatrix::IsBoolean( SCSIZE nC, SCSIZE nR ) const { return pImpl->IsBoolean(nC, nR); } -BOOL ScMatrix::IsNumeric() const +sal_Bool ScMatrix::IsNumeric() const { return pImpl->IsNumeric(); } diff --git a/sc/source/core/tool/subtotal.cxx b/sc/source/core/tool/subtotal.cxx index 7f211cef4033..e1c1b607a908 100644 --- a/sc/source/core/tool/subtotal.cxx +++ b/sc/source/core/tool/subtotal.cxx @@ -37,14 +37,14 @@ // ----------------------------------------------------------------------- -BOOL SubTotal::SafePlus(double& fVal1, double fVal2) +sal_Bool SubTotal::SafePlus(double& fVal1, double fVal2) { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SAL_MATH_FPEXCEPTIONS_OFF(); fVal1 += fVal2; if (!::rtl::math::isFinite(fVal1)) { - bOk = FALSE; + bOk = false; if (fVal2 > 0.0) fVal1 = DBL_MAX; else @@ -54,28 +54,28 @@ BOOL SubTotal::SafePlus(double& fVal1, double fVal2) } -BOOL SubTotal::SafeMult(double& fVal1, double fVal2) +sal_Bool SubTotal::SafeMult(double& fVal1, double fVal2) { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SAL_MATH_FPEXCEPTIONS_OFF(); fVal1 *= fVal2; if (!::rtl::math::isFinite(fVal1)) { - bOk = FALSE; + bOk = false; fVal1 = DBL_MAX; } return bOk; } -BOOL SubTotal::SafeDiv(double& fVal1, double fVal2) +sal_Bool SubTotal::SafeDiv(double& fVal1, double fVal2) { - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SAL_MATH_FPEXCEPTIONS_OFF(); fVal1 /= fVal2; if (!::rtl::math::isFinite(fVal1)) { - bOk = FALSE; + bOk = false; fVal1 = DBL_MAX; } return bOk; diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0e41bd2f86fc..9ddb3509ad81 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -112,19 +112,19 @@ namespace // ScRawToken size is FixMembers + MAXSTRLEN + ~4 ~= 1036 IMPL_FIXEDMEMPOOL_NEWDEL( ScRawToken, 8, 4 ) // Some ScDoubleRawToken, FixMembers + sizeof(double) ~= 16 -const USHORT nMemPoolDoubleRawToken = 0x0400 / sizeof(ScDoubleRawToken); +const sal_uInt16 nMemPoolDoubleRawToken = 0x0400 / sizeof(ScDoubleRawToken); IMPL_FIXEDMEMPOOL_NEWDEL( ScDoubleRawToken, nMemPoolDoubleRawToken, nMemPoolDoubleRawToken ) // Need a whole bunch of ScSingleRefToken -const USHORT nMemPoolSingleRefToken = (0x4000 - 64) / sizeof(ScSingleRefToken); +const sal_uInt16 nMemPoolSingleRefToken = (0x4000 - 64) / sizeof(ScSingleRefToken); IMPL_FIXEDMEMPOOL_NEWDEL( ScSingleRefToken, nMemPoolSingleRefToken, nMemPoolSingleRefToken ) // Need quite a lot of ScDoubleRefToken -const USHORT nMemPoolDoubleRefToken = (0x2000 - 64) / sizeof(ScDoubleRefToken); +const sal_uInt16 nMemPoolDoubleRefToken = (0x2000 - 64) / sizeof(ScDoubleRefToken); IMPL_FIXEDMEMPOOL_NEWDEL( ScDoubleRefToken, nMemPoolDoubleRefToken, nMemPoolDoubleRefToken ) // --- 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)) @@ -223,7 +223,7 @@ void ScRawToken::SetDouble(double rVal) nRefCnt = 0; } -void ScRawToken::SetName( USHORT n ) +void ScRawToken::SetName( sal_uInt16 n ) { eOp = ocName; eType = svIndex; @@ -288,13 +288,13 @@ void ScRawToken::SetExternal( const sal_Unicode* pStr ) nRefCnt = 0; } -USHORT lcl_ScRawTokenOffset() +sal_uInt16 lcl_ScRawTokenOffset() { // offset of sbyte in ScRawToken // offsetof(ScRawToken, sbyte) gives a warning with gcc, because ScRawToken is no POD ScRawToken aToken; - return static_cast<USHORT>( reinterpret_cast<char*>(&aToken.sbyte) - reinterpret_cast<char*>(&aToken) ); + return static_cast<sal_uInt16>( reinterpret_cast<char*>(&aToken.sbyte) - reinterpret_cast<char*>(&aToken) ); } ScRawToken* ScRawToken::Clone() const @@ -309,21 +309,21 @@ ScRawToken* ScRawToken::Clone() const } else { - static USHORT nOffset = lcl_ScRawTokenOffset(); // offset of sbyte - USHORT n = nOffset; + static sal_uInt16 nOffset = lcl_ScRawTokenOffset(); // offset of sbyte + sal_uInt16 n = nOffset; switch( eType ) { case svSep: break; case svByte: n += sizeof(ScRawToken::sbyte); break; case svDouble: n += sizeof(double); break; - case svString: n = sal::static_int_cast<USHORT>( n + GetStrLenBytes( cStr ) + GetStrLenBytes( 1 ) ); break; + case svString: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr ) + GetStrLenBytes( 1 ) ); break; case svSingleRef: case svDoubleRef: n += sizeof(aRef); break; case svMatrix: n += sizeof(ScMatrix*); break; - case svIndex: n += sizeof(USHORT); break; + case svIndex: n += sizeof(sal_uInt16); break; case svJump: n += nJump[ 0 ] * 2 + 2; break; - case svExternal: n = sal::static_int_cast<USHORT>( n + GetStrLenBytes( cStr+1 ) + GetStrLenBytes( 2 ) ); break; + case svExternal: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr+1 ) + GetStrLenBytes( 2 ) ); break; // external references case svExternalSingleRef: @@ -334,11 +334,11 @@ ScRawToken* ScRawToken::Clone() const DBG_ERROR1( "unknown ScRawToken::Clone() type %d", int(eType)); } } - p = (ScRawToken*) new BYTE[ n ]; - memcpy( p, this, n * sizeof(BYTE) ); + p = (ScRawToken*) new sal_uInt8[ n ]; + memcpy( p, this, n * sizeof(sal_uInt8) ); } p->nRefCnt = 0; - p->bRaw = FALSE; + p->bRaw = false; return p; } @@ -427,7 +427,7 @@ void ScRawToken::Delete() delete (ScDoubleRawToken*) this; // FixedMemPool ScDoubleRawToken break; default: - delete [] (BYTE*) this; + delete [] (sal_uInt8*) this; } } } @@ -455,14 +455,14 @@ ScToken::~ScToken() } // TextEqual: if same formula entered (for optimization in sort) -BOOL ScToken::TextEqual( const FormulaToken& _rToken ) const +sal_Bool ScToken::TextEqual( const FormulaToken& _rToken ) const { if ( eType == svSingleRef || eType == svDoubleRef ) { // in relative Refs only compare relative parts if ( eType != _rToken.GetType() || GetOpCode() != _rToken.GetOpCode() ) - return FALSE; + return false; const ScToken& rToken = static_cast<const ScToken&>(_rToken); ScComplexRefData aTemp1; @@ -503,24 +503,24 @@ BOOL ScToken::TextEqual( const FormulaToken& _rToken ) const } -BOOL ScToken::Is3DRef() const +sal_Bool ScToken::Is3DRef() const { switch ( eType ) { case svDoubleRef : if ( GetSingleRef2().IsFlag3D() ) - return TRUE; + return sal_True; //! fallthru case svSingleRef : if ( GetSingleRef().IsFlag3D() ) - return TRUE; + return sal_True; break; default: { // added to avoid warnings } } - return FALSE; + return false; } FormulaTokenRef ScToken::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, @@ -744,7 +744,7 @@ void ScSingleRefToken::CalcAbsIfRel( const ScAddress& rPos ) { aSingleRef.CalcAbsIfRel( rPos ); } void ScSingleRefToken::CalcRelFromAbs( const ScAddress& rPos ) { aSingleRef.CalcRelFromAbs( rPos ); } -BOOL ScSingleRefToken::operator==( const FormulaToken& r ) const +sal_Bool ScSingleRefToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && aSingleRef == static_cast<const ScToken&>(r).GetSingleRef(); } @@ -760,7 +760,7 @@ void ScDoubleRefToken::CalcAbsIfRel( const ScAddress& rPos ) { aDoubleRef.CalcAbsIfRel( rPos ); } void ScDoubleRefToken::CalcRelFromAbs( const ScAddress& rPos ) { aDoubleRef.CalcRelFromAbs( rPos ); } -BOOL ScDoubleRefToken::operator==( const FormulaToken& r ) const +sal_Bool ScDoubleRefToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && aDoubleRef == static_cast<const ScToken&>(r).GetDoubleRef(); } @@ -778,7 +778,7 @@ void ScRefListToken::CalcRelFromAbs( const ScAddress& rPos ) for (ScRefList::iterator it( aRefList.begin()); it != aRefList.end(); ++it) (*it).CalcRelFromAbs( rPos); } -BOOL ScRefListToken::operator==( const FormulaToken& r ) const +sal_Bool ScRefListToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && &aRefList == static_cast<const ScToken&>(r).GetRefList(); } @@ -786,7 +786,7 @@ BOOL ScRefListToken::operator==( const FormulaToken& r ) const const ScMatrix* ScMatrixToken::GetMatrix() const { return pMatrix.get(); } ScMatrix* ScMatrixToken::GetMatrix() { return pMatrix.get(); } -BOOL ScMatrixToken::operator==( const FormulaToken& r ) const +sal_Bool ScMatrixToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && pMatrix == static_cast<const ScToken&>(r).GetMatrix(); } @@ -813,7 +813,7 @@ ScExternalSingleRefToken::~ScExternalSingleRefToken() { } -USHORT ScExternalSingleRefToken::GetIndex() const +sal_uInt16 ScExternalSingleRefToken::GetIndex() const { return mnFileId; } @@ -843,7 +843,7 @@ void ScExternalSingleRefToken::CalcRelFromAbs( const ScAddress& rPos ) maSingleRef.CalcRelFromAbs( rPos ); } -BOOL ScExternalSingleRefToken::operator ==( const FormulaToken& r ) const +sal_Bool ScExternalSingleRefToken::operator ==( const FormulaToken& r ) const { if (!FormulaToken::operator==(r)) return false; @@ -879,7 +879,7 @@ ScExternalDoubleRefToken::~ScExternalDoubleRefToken() { } -USHORT ScExternalDoubleRefToken::GetIndex() const +sal_uInt16 ScExternalDoubleRefToken::GetIndex() const { return mnFileId; } @@ -929,7 +929,7 @@ void ScExternalDoubleRefToken::CalcRelFromAbs( const ScAddress& rPos ) maDoubleRef.CalcRelFromAbs( rPos ); } -BOOL ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const +sal_Bool ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const { if (!ScToken::operator==(r)) return false; @@ -961,7 +961,7 @@ ScExternalNameToken::ScExternalNameToken( const ScExternalNameToken& r ) : ScExternalNameToken::~ScExternalNameToken() {} -USHORT ScExternalNameToken::GetIndex() const +sal_uInt16 ScExternalNameToken::GetIndex() const { return mnFileId; } @@ -971,7 +971,7 @@ const String& ScExternalNameToken::GetString() const return maName; } -BOOL ScExternalNameToken::operator==( const FormulaToken& r ) const +sal_Bool ScExternalNameToken::operator==( const FormulaToken& r ) const { if ( !FormulaToken::operator==(r) ) return false; @@ -997,7 +997,7 @@ BOOL ScExternalNameToken::operator==( const FormulaToken& r ) const // ============================================================================ ScJumpMatrix* ScJumpMatrixToken::GetJumpMatrix() const { return pJumpMatrix; } -BOOL ScJumpMatrixToken::operator==( const FormulaToken& r ) const +sal_Bool ScJumpMatrixToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && pJumpMatrix == static_cast<const ScToken&>(r).GetJumpMatrix(); } @@ -1012,7 +1012,7 @@ const String & ScEmptyCellToken::GetString() const static String aDummyString; return aDummyString; } -BOOL ScEmptyCellToken::operator==( const FormulaToken& r ) const +sal_Bool ScEmptyCellToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && bInherited == static_cast< const ScEmptyCellToken & >(r).IsInherited() && @@ -1029,7 +1029,7 @@ ScMatrix* ScMatrixCellResultToken::GetMatrix() { return const_cast<ScMatrix*>(xMatrix.operator->()); } -BOOL ScMatrixCellResultToken::operator==( const FormulaToken& r ) const +sal_Bool ScMatrixCellResultToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && xUpperLeft == static_cast<const ScMatrixCellResultToken &>(r).xUpperLeft && @@ -1037,7 +1037,7 @@ BOOL ScMatrixCellResultToken::operator==( const FormulaToken& r ) const } -BOOL ScMatrixFormulaCellToken::operator==( const FormulaToken& r ) const +sal_Bool ScMatrixFormulaCellToken::operator==( const FormulaToken& r ) const { const ScMatrixFormulaCellToken* p = dynamic_cast<const ScMatrixFormulaCellToken*>(&r); return p && ScMatrixCellResultToken::operator==( r ) && @@ -1089,7 +1089,7 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f ) double ScHybridCellToken::GetDouble() const { return fDouble; } const String & ScHybridCellToken::GetString() const { return aString; } -BOOL ScHybridCellToken::operator==( const FormulaToken& r ) const +sal_Bool ScHybridCellToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && fDouble == r.GetDouble() && aString == r.GetString() && @@ -1223,9 +1223,9 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a } return bError; } -BOOL ScTokenArray::ImplGetReference( ScRange& rRange, BOOL bValidOnly ) const +sal_Bool ScTokenArray::ImplGetReference( ScRange& rRange, sal_Bool bValidOnly ) const { - BOOL bIs = FALSE; + sal_Bool bIs = false; if ( pCode && nLen == 1 ) { const FormulaToken* pToken = pCode[0]; @@ -1251,14 +1251,14 @@ BOOL ScTokenArray::ImplGetReference( ScRange& rRange, BOOL bValidOnly ) const return bIs; } -BOOL ScTokenArray::IsReference( ScRange& rRange ) const +sal_Bool ScTokenArray::IsReference( ScRange& rRange ) const { - return ImplGetReference( rRange, FALSE ); + return ImplGetReference( rRange, false ); } -BOOL ScTokenArray::IsValidReference( ScRange& rRange ) const +sal_Bool ScTokenArray::IsValidReference( ScRange& rRange ) const { - return ImplGetReference( rRange, TRUE ); + return ImplGetReference( rRange, sal_True ); } //////////////////////////////////////////////////////////////////////////// @@ -1298,7 +1298,7 @@ ScTokenArray* ScTokenArray::Clone() const { pp = p->pCode = new FormulaToken*[ nLen ]; memcpy( pp, pCode, nLen * sizeof( ScToken* ) ); - for( USHORT i = 0; i < nLen; i++, pp++ ) + for( sal_uInt16 i = 0; i < nLen; i++, pp++ ) { *pp = (*pp)->Clone(); (*pp)->IncRef(); @@ -1308,14 +1308,14 @@ ScTokenArray* ScTokenArray::Clone() const { pp = p->pRPN = new FormulaToken*[ nRPN ]; memcpy( pp, pRPN, nRPN * sizeof( ScToken* ) ); - 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 ) { @@ -1520,7 +1520,7 @@ FormulaToken* ScTokenArray::MergeArray( ) pCode[i] = NULL; t->DecRef(); } - nLen = USHORT( nStart ); + nLen = sal_uInt16( nStart ); return AddMatrix( pArray ); } @@ -1529,7 +1529,7 @@ FormulaToken* ScTokenArray::MergeRangeReference( const ScAddress & rPos ) { if (!pCode || !nLen) return NULL; - USHORT nIdx = nLen; + sal_uInt16 nIdx = nLen; FormulaToken *p1, *p2, *p3; // ref, ocRange, ref // The actual types are checked in ExtendRangeReference(). if (((p3 = PeekPrev(nIdx)) != 0) && @@ -1598,7 +1598,7 @@ FormulaToken* ScTokenArray::AddColRowName( const ScSingleRefData& rRef ) return Add( new ScSingleRefToken( rRef, ocColRowName ) ); } -BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, +sal_Bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, const ScAddress& rPos, ScDirection eDir ) { SCCOL nCol = 0; @@ -1609,40 +1609,40 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, if ( rPos.Row() < MAXROW ) nRow = (nExtend = rPos.Row()) + 1; else - return FALSE; + return false; break; case DIR_RIGHT : if ( rPos.Col() < MAXCOL ) nCol = static_cast<SCCOL>(nExtend = rPos.Col()) + 1; else - return FALSE; + return false; break; case DIR_TOP : if ( rPos.Row() > 0 ) nRow = (nExtend = rPos.Row()) - 1; else - return FALSE; + return false; break; case DIR_LEFT : if ( rPos.Col() > 0 ) nCol = static_cast<SCCOL>(nExtend = rPos.Col()) - 1; else - return FALSE; + return false; break; default: DBG_ERRORFILE( "unknown Direction" ); - return FALSE; + return false; } if ( pRPN && nRPN ) { FormulaToken* t = pRPN[nRPN-1]; if ( t->GetType() == svByte ) { - BYTE nParamCount = t->GetByte(); + sal_uInt8 nParamCount = t->GetByte(); if ( nParamCount && nRPN > nParamCount ) { - BOOL bRet = FALSE; - USHORT nParam = nRPN - nParamCount - 1; + sal_Bool bRet = false; + sal_uInt16 nParam = nRPN - nParamCount - 1; for ( ; nParam < nRPN-1; nParam++ ) { FormulaToken* p = pRPN[nParam]; @@ -1659,7 +1659,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, && rRef.nRow > nExtend ) { nExtend = rRef.nRow; - bRet = TRUE; + bRet = sal_True; } break; case DIR_RIGHT : @@ -1668,7 +1668,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, > nExtend ) { nExtend = rRef.nCol; - bRet = TRUE; + bRet = sal_True; } break; case DIR_TOP : @@ -1676,7 +1676,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, && rRef.nRow < nExtend ) { nExtend = rRef.nRow; - bRet = TRUE; + bRet = sal_True; } break; case DIR_LEFT : @@ -1685,7 +1685,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, < nExtend ) { nExtend = rRef.nCol; - bRet = TRUE; + bRet = sal_True; } break; } @@ -1702,7 +1702,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, && rRef.Ref2.nRow > nExtend ) { nExtend = rRef.Ref2.nRow; - bRet = TRUE; + bRet = sal_True; } break; case DIR_RIGHT : @@ -1711,7 +1711,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, > nExtend ) { nExtend = rRef.Ref2.nCol; - bRet = TRUE; + bRet = sal_True; } break; case DIR_TOP : @@ -1719,7 +1719,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, && rRef.Ref1.nRow < nExtend ) { nExtend = rRef.Ref1.nRow; - bRet = TRUE; + bRet = sal_True; } break; case DIR_LEFT : @@ -1728,7 +1728,7 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, < nExtend ) { nExtend = rRef.Ref1.nCol; - bRet = TRUE; + bRet = sal_True; } break; } @@ -1744,14 +1744,14 @@ BOOL ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, } } } - return FALSE; + return false; } void ScTokenArray::ReadjustRelative3DReferences( const ScAddress& rOldPos, const ScAddress& rNewPos ) { - for ( USHORT j=0; j<nLen; ++j ) + for ( sal_uInt16 j=0; j<nLen; ++j ) { switch ( pCode[j]->GetType() ) { diff --git a/sc/source/core/tool/unitconv.cxx b/sc/source/core/tool/unitconv.cxx index 27eaede85175..90f30cd6774c 100644 --- a/sc/source/core/tool/unitconv.cxx +++ b/sc/source/core/tool/unitconv.cxx @@ -103,8 +103,8 @@ void ScUnitConverterData::BuildIndexString( String& rStr, #define CFGSTR_UNIT_TO "ToUnit" #define CFGSTR_UNIT_FACTOR "Factor" -ScUnitConverter::ScUnitConverter( USHORT nInit, USHORT nDeltaP ) : - ScStrCollection( nInit, nDeltaP, FALSE ) +ScUnitConverter::ScUnitConverter( sal_uInt16 nInit, sal_uInt16 nDeltaP ) : + ScStrCollection( nInit, nDeltaP, false ) { // read from configuration - "convert.ini" is no longer used //! config item as member to allow change of values @@ -162,18 +162,18 @@ ScUnitConverter::ScUnitConverter( USHORT nInit, USHORT nDeltaP ) : } } -BOOL ScUnitConverter::GetValue( double& fValue, const String& rFromUnit, +sal_Bool ScUnitConverter::GetValue( double& fValue, const String& rFromUnit, const String& rToUnit ) const { ScUnitConverterData aSearch( rFromUnit, rToUnit ); - USHORT nIndex; + sal_uInt16 nIndex; if ( Search( &aSearch, nIndex ) ) { fValue = ((const ScUnitConverterData*)(At( nIndex )))->GetValue(); - return TRUE; + return sal_True; } fValue = 1.0; - return FALSE; + return false; } diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index edbaf7aba3c0..6e96b85ee00c 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -50,12 +50,12 @@ void ScUserListData::InitTokens() { sal_Unicode cSep = ScGlobal::cListDelimiter; - nTokenCount = (USHORT) aStr.GetTokenCount(cSep); + nTokenCount = (sal_uInt16) aStr.GetTokenCount(cSep); if (nTokenCount) { pSubStrings = new String[nTokenCount]; pUpperSub = new String[nTokenCount]; - for (USHORT i=0; i<nTokenCount; i++) + for (sal_uInt16 i=0; i<nTokenCount; i++) { pUpperSub[i] = pSubStrings[i] = aStr.GetToken((xub_StrLen)i,cSep); ScGlobal::pCharClass->toUpper(pUpperSub[i]); @@ -93,19 +93,19 @@ void ScUserListData::SetString( const String& rStr ) InitTokens(); } -USHORT ScUserListData::GetSubCount() const +sal_uInt16 ScUserListData::GetSubCount() const { return nTokenCount; } -BOOL ScUserListData::GetSubIndex(const String& rSubStr, USHORT& rIndex) const +sal_Bool ScUserListData::GetSubIndex(const String& rSubStr, sal_uInt16& rIndex) const { - USHORT i; + sal_uInt16 i; for (i=0; i<nTokenCount; i++) if (rSubStr == pSubStrings[i]) { rIndex = i; - return TRUE; + return sal_True; } String aUpStr = rSubStr; @@ -114,13 +114,13 @@ BOOL ScUserListData::GetSubIndex(const String& rSubStr, USHORT& rIndex) const if (aUpStr == pUpperSub[i]) { rIndex = i; - return TRUE; + return sal_True; } - return FALSE; + return false; } -String ScUserListData::GetSubStr(USHORT nIndex) const +String ScUserListData::GetSubStr(sal_uInt16 nIndex) const { if (nIndex < nTokenCount) return pSubStrings[nIndex]; @@ -130,10 +130,10 @@ String ScUserListData::GetSubStr(USHORT nIndex) const StringCompare ScUserListData::Compare(const String& rSubStr1, const String& rSubStr2) const { - USHORT nIndex1; - USHORT nIndex2; - BOOL bFound1 = GetSubIndex(rSubStr1, nIndex1); - BOOL bFound2 = GetSubIndex(rSubStr2, nIndex2); + sal_uInt16 nIndex1; + sal_uInt16 nIndex2; + sal_Bool bFound1 = GetSubIndex(rSubStr1, nIndex1); + sal_Bool bFound2 = GetSubIndex(rSubStr2, nIndex2); if (bFound1) { if (bFound2) @@ -156,10 +156,10 @@ StringCompare ScUserListData::Compare(const String& rSubStr1, const String& rSub StringCompare ScUserListData::ICompare(const String& rSubStr1, const String& rSubStr2) const { - USHORT nIndex1; - USHORT nIndex2; - BOOL bFound1 = GetSubIndex(rSubStr1, nIndex1); - BOOL bFound2 = GetSubIndex(rSubStr2, nIndex2); + sal_uInt16 nIndex1; + sal_uInt16 nIndex2; + sal_Bool bFound1 = GetSubIndex(rSubStr1, nIndex1); + sal_Bool bFound2 = GetSubIndex(rSubStr2, nIndex2); if (bFound1) { if (bFound2) @@ -180,7 +180,7 @@ StringCompare ScUserListData::ICompare(const String& rSubStr1, const String& rSu return (StringCompare) ScGlobal::GetpTransliteration()->compareString( rSubStr1, rSubStr2 ); } -ScUserList::ScUserList(USHORT nLim, USHORT nDel) : +ScUserList::ScUserList(sal_uInt16 nLim, sal_uInt16 nDel) : ScCollection ( nLim, nDel ) { using namespace ::com::sun::star; @@ -254,24 +254,24 @@ ScDataObject* ScUserList::Clone() const ScUserListData* ScUserList::GetData(const String& rSubStr) const { - USHORT nIndex; - USHORT i = 0; + sal_uInt16 nIndex; + sal_uInt16 i = 0; for (i=0; i < nCount; i++) if (((ScUserListData*)pItems[i])->GetSubIndex(rSubStr, nIndex)) return (ScUserListData*)pItems[i]; return NULL; } -BOOL ScUserList::operator==( const ScUserList& r ) const +sal_Bool ScUserList::operator==( const ScUserList& r ) const { - BOOL bEqual = (nCount == r.nCount); + sal_Bool bEqual = (nCount == r.nCount); if ( bEqual ) { ScUserListData* pMyData = NULL; ScUserListData* pOtherData = NULL; - for ( USHORT i=0; i<nCount && bEqual; i++) + for ( sal_uInt16 i=0; i<nCount && bEqual; i++) { pMyData = (ScUserListData*)At(i); pOtherData = (ScUserListData*)r.At(i); @@ -285,15 +285,15 @@ BOOL ScUserList::operator==( const ScUserList& r ) const } -BOOL ScUserList::HasEntry( const String& rStr ) const +sal_Bool ScUserList::HasEntry( const String& rStr ) const { - for ( USHORT i=0; i<nCount; i++) + for ( sal_uInt16 i=0; i<nCount; i++) { const ScUserListData* pMyData = (ScUserListData*) At(i); if ( pMyData->aStr == rStr ) - return TRUE; + return sal_True; } - return FALSE; + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index 618959958834..fdf8c8581d26 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -54,7 +54,7 @@ using ::rtl::OUString; TYPEINIT1(ScTpViewItem, SfxPoolItem); -#define SC_VERSION ((USHORT)302) +#define SC_VERSION ((sal_uInt16)302) //======================================================================== @@ -153,7 +153,7 @@ void ScViewOptions::SetDefaults() aOptArr[ VOPT_FORMULAS ] = aOptArr[ VOPT_SYNTAX ] = aOptArr[ VOPT_HELPLINES ] = - aOptArr[ VOPT_BIGHANDLES ] = FALSE; + aOptArr[ VOPT_BIGHANDLES ] = false; aOptArr[ VOPT_NOTES ] = aOptArr[ VOPT_NULLVALS ] = aOptArr[ VOPT_VSCROLL ] = @@ -165,7 +165,7 @@ void ScViewOptions::SetDefaults() aOptArr[ VOPT_ANCHOR ] = aOptArr[ VOPT_PAGEBREAKS ] = aOptArr[ VOPT_SOLIDHANDLES] = - aOptArr[ VOPT_CLIPMARKS ] = TRUE; + aOptArr[ VOPT_CLIPMARKS ] = sal_True; aModeArr[VOBJ_TYPE_OLE ] = aModeArr[VOBJ_TYPE_CHART] = @@ -191,7 +191,7 @@ Color ScViewOptions::GetGridColor( String* pStrName ) const const ScViewOptions& ScViewOptions::operator=( const ScViewOptions& rCpy ) { - USHORT i; + sal_uInt16 i; for ( i=0; i<MAX_OPT; i++ ) aOptArr [i] = rCpy.aOptArr[i]; for ( i=0; i<MAX_TYPE; i++ ) aModeArr[i] = rCpy.aModeArr[i]; @@ -207,8 +207,8 @@ const ScViewOptions& ScViewOptions::operator=( const ScViewOptions& rCpy ) int ScViewOptions::operator==( const ScViewOptions& rOpt ) const { - BOOL bEqual = TRUE; - USHORT i; + sal_Bool bEqual = sal_True; + sal_uInt16 i; for ( i=0; i<MAX_OPT && bEqual; i++ ) bEqual = (aOptArr [i] == rOpt.aOptArr[i]); for ( i=0; i<MAX_TYPE && bEqual; i++ ) bEqual = (aModeArr[i] == rOpt.aModeArr[i]); @@ -222,7 +222,7 @@ int ScViewOptions::operator==( const ScViewOptions& rOpt ) const //------------------------------------------------------------------------ -SvxGridItem* ScViewOptions::CreateGridItem( USHORT nId /* = SID_ATTR_GRID_OPTIONS */ ) const +SvxGridItem* ScViewOptions::CreateGridItem( sal_uInt16 nId /* = SID_ATTR_GRID_OPTIONS */ ) const { SvxGridItem* pItem = new SvxGridItem( nId ); @@ -246,7 +246,7 @@ SvxGridItem* ScViewOptions::CreateGridItem( USHORT nId /* = SID_ATTR_GRID_OPTION //------------------------------------------------------------------------ -ScTpViewItem::ScTpViewItem( USHORT nWhichP, const ScViewOptions& rOpt ) +ScTpViewItem::ScTpViewItem( sal_uInt16 nWhichP, const ScViewOptions& rOpt ) : SfxPoolItem ( nWhichP ), theOptions ( rOpt ) { diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index b1df1c384b77..9fd1b6f9ed36 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -55,7 +55,7 @@ ScNumFormatAbbrev::ScNumFormatAbbrev(const ScNumFormatAbbrev& aFormat) : { } -ScNumFormatAbbrev::ScNumFormatAbbrev(ULONG nFormat, +ScNumFormatAbbrev::ScNumFormatAbbrev(sal_uLong nFormat, SvNumberFormatter& rFormatter) { PutFormatIndex(nFormat, rFormatter); @@ -63,7 +63,7 @@ ScNumFormatAbbrev::ScNumFormatAbbrev(ULONG nFormat, void ScNumFormatAbbrev::Load( SvStream& rStream, CharSet eByteStrSet ) { - USHORT nSysLang, nLang; + sal_uInt16 nSysLang, nLang; rStream.ReadByteString( sFormatstring, eByteStrSet ); rStream >> nSysLang >> nLang; eLnge = (LanguageType) nLang; @@ -75,10 +75,10 @@ void ScNumFormatAbbrev::Load( SvStream& rStream, CharSet eByteStrSet ) void ScNumFormatAbbrev::Save( SvStream& rStream, CharSet eByteStrSet ) const { rStream.WriteByteString( sFormatstring, eByteStrSet ); - rStream << (USHORT) eSysLnge << (USHORT) eLnge; + rStream << (sal_uInt16) eSysLnge << (sal_uInt16) eLnge; } -void ScNumFormatAbbrev::PutFormatIndex(ULONG nFormat, +void ScNumFormatAbbrev::PutFormatIndex(sal_uLong nFormat, SvNumberFormatter& rFormatter) { const SvNumberformat* pFormat = rFormatter.GetEntry(nFormat); @@ -97,10 +97,10 @@ void ScNumFormatAbbrev::PutFormatIndex(ULONG nFormat, } } -ULONG ScNumFormatAbbrev::GetFormatIndex( SvNumberFormatter& rFormatter) +sal_uLong ScNumFormatAbbrev::GetFormatIndex( SvNumberFormatter& rFormatter) { short nType; - BOOL bNewInserted; + sal_Bool bNewInserted; xub_StrLen nCheckPos; return rFormatter.GetIndexPuttingAndConverting( sFormatstring, eLnge, eSysLnge, nType, bNewInserted, nCheckPos); |